From 239b871703b38fbda8e0dcc874cb4b31ce223cd9 Mon Sep 17 00:00:00 2001 From: genbs Date: Wed, 28 Jul 2021 20:04:07 +0200 Subject: [PATCH] v1.0.3 --- build/esm/urpflanze-light.js | 18219 ++++++++-------- build/esm/urpflanze-light.js.map | 2 +- build/esm/urpflanze-light.min.js | 2 +- build/esm/urpflanze-light.min.js.LICENSE.txt | 2 +- build/esm/urpflanze.js | 18282 +++++++++-------- build/esm/urpflanze.js.map | 2 +- build/esm/urpflanze.min.js | 2 +- build/esm/urpflanze.min.js.LICENSE.txt | 2 +- build/umd/urpflanze-light.js | 17826 ++++++++-------- build/umd/urpflanze-light.js.map | 2 +- build/umd/urpflanze-light.min.js | 2 +- build/umd/urpflanze-light.min.js.LICENSE.txt | 2 +- build/umd/urpflanze.js | 17827 ++++++++-------- build/umd/urpflanze.js.map | 2 +- build/umd/urpflanze.min.js | 2 +- build/umd/urpflanze.min.js.LICENSE.txt | 2 +- docs/index-v0001.js | 2 +- package.json | 4 +- 18 files changed, 36259 insertions(+), 35925 deletions(-) diff --git a/build/esm/urpflanze-light.js b/build/esm/urpflanze-light.js index cc607a2..a44c46a 100644 --- a/build/esm/urpflanze-light.js +++ b/build/esm/urpflanze-light.js @@ -1,5 +1,5 @@ /*! - * @license UrpflanzeJS v"1.0.2" + * @license UrpflanzeJS v"1.0.3" * urpflanze-light.js * * Github: https://github.com/urpflanze-org/urpflanze @@ -15,14 +15,52 @@ "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "Circle": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Circle), +/* harmony export */ "Group": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Group), +/* harmony export */ "Line": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Line), +/* harmony export */ "Lissajous": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Lissajous), +/* harmony export */ "Modifier": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Modifier), +/* harmony export */ "Modifiers": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Modifiers), +/* harmony export */ "PHI": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.PHI), +/* harmony export */ "PI2": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.PI2), +/* harmony export */ "Polygon": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Polygon), +/* harmony export */ "Rect": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Rect), +/* harmony export */ "Rose": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Rose), +/* harmony export */ "Scene": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Scene), +/* harmony export */ "SceneChild": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.SceneChild), +/* harmony export */ "Shape": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Shape), +/* harmony export */ "ShapeBase": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.ShapeBase), +/* harmony export */ "ShapeBuffer": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.ShapeBuffer), +/* harmony export */ "ShapeFollow": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.ShapeFollow), +/* harmony export */ "ShapeLoop": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.ShapeLoop), +/* harmony export */ "ShapePrimitive": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.ShapePrimitive), +/* harmony export */ "ShapeRecursive": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.ShapeRecursive), +/* harmony export */ "Spiral": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Spiral), +/* harmony export */ "Star": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Star), +/* harmony export */ "SuperShape": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.SuperShape), +/* harmony export */ "Triangle": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Triangle), +/* harmony export */ "Vec2": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Vec2), +/* harmony export */ "__esModule": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.__esModule), +/* harmony export */ "angle2FromRepetition": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.angle2FromRepetition), +/* harmony export */ "angleFromRepetition": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.angleFromRepetition), +/* harmony export */ "clamp": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.clamp), +/* harmony export */ "distanceFromRepetition": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.distanceFromRepetition), +/* harmony export */ "distributePointsInBuffer": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.distributePointsInBuffer), +/* harmony export */ "interpolate": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.interpolate), +/* harmony export */ "lerp": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.lerp), +/* harmony export */ "log": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.log), +/* harmony export */ "mod": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.mod), +/* harmony export */ "noise": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.noise), +/* harmony export */ "now": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.now), +/* harmony export */ "prepareBufferForInterpolation": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.prepareBufferForInterpolation), +/* harmony export */ "random": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.random), +/* harmony export */ "relativeClamp": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.relativeClamp), +/* harmony export */ "toDegrees": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.toDegrees), +/* harmony export */ "toRadians": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.toRadians), /* harmony export */ "Animation": () => (/* reexport module object */ _urpflanze_animation_dist_cjs__WEBPACK_IMPORTED_MODULE_1__), /* harmony export */ "DrawerCanvas": () => (/* reexport safe */ _urpflanze_drawer_canvas_dist_cjs_browser_BrowserDrawerCanvas__WEBPACK_IMPORTED_MODULE_2__.BrowserDrawerCanvas) /* harmony export */ }); -/* harmony import */ var _urpflanze_core_dist_cjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); -/* harmony import */ var _urpflanze_core_dist_cjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_urpflanze_core_dist_cjs__WEBPACK_IMPORTED_MODULE_0__); -/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; -/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _urpflanze_core_dist_cjs__WEBPACK_IMPORTED_MODULE_0__) if(["default","Animation","DrawerCanvas"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _urpflanze_core_dist_cjs__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__] -/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); +/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /* harmony import */ var _urpflanze_animation_dist_cjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57); /* harmony import */ var _urpflanze_animation_dist_cjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_urpflanze_animation_dist_cjs__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _urpflanze_drawer_canvas_dist_cjs_browser_BrowserDrawerCanvas__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71); @@ -33,9191 +71,9216 @@ __webpack_require__.r(__webpack_exports__); /***/ }), /* 2 */ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "Scene": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Scene__WEBPACK_IMPORTED_MODULE_0__.Scene), +/* harmony export */ "__esModule": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Scene__WEBPACK_IMPORTED_MODULE_0__.__esModule), +/* harmony export */ "SceneChild": () => (/* reexport safe */ _urpflanze_core_dist_cjs_SceneChild__WEBPACK_IMPORTED_MODULE_1__.SceneChild), +/* harmony export */ "Group": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Group__WEBPACK_IMPORTED_MODULE_2__.Group), +/* harmony export */ "ShapeBase": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_ShapeBase__WEBPACK_IMPORTED_MODULE_3__.ShapeBase), +/* harmony export */ "ShapePrimitive": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_ShapePrimitive__WEBPACK_IMPORTED_MODULE_4__.ShapePrimitive), +/* harmony export */ "ShapeLoop": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_ShapeLoop__WEBPACK_IMPORTED_MODULE_5__.ShapeLoop), +/* harmony export */ "ShapeBuffer": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_ShapeBuffer__WEBPACK_IMPORTED_MODULE_6__.ShapeBuffer), +/* harmony export */ "Shape": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_Shape__WEBPACK_IMPORTED_MODULE_7__.Shape), +/* harmony export */ "ShapeRecursive": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_ShapeRecursive__WEBPACK_IMPORTED_MODULE_8__.ShapeRecursive), +/* harmony export */ "ShapeFollow": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_ShapeFollow__WEBPACK_IMPORTED_MODULE_9__.ShapeFollow), +/* harmony export */ "Line": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_primitives_Line__WEBPACK_IMPORTED_MODULE_10__.Line), +/* harmony export */ "Triangle": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_primitives_Triangle__WEBPACK_IMPORTED_MODULE_11__.Triangle), +/* harmony export */ "Rect": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_primitives_Rect__WEBPACK_IMPORTED_MODULE_12__.Rect), +/* harmony export */ "Polygon": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_primitives_Polygon__WEBPACK_IMPORTED_MODULE_13__.Polygon), +/* harmony export */ "Circle": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_primitives_Circle__WEBPACK_IMPORTED_MODULE_14__.Circle), +/* harmony export */ "Star": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_primitives_Star__WEBPACK_IMPORTED_MODULE_15__.Star), +/* harmony export */ "Rose": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_primitives_Rose__WEBPACK_IMPORTED_MODULE_16__.Rose), +/* harmony export */ "Spiral": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_primitives_Spiral__WEBPACK_IMPORTED_MODULE_17__.Spiral), +/* harmony export */ "Lissajous": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_primitives_Lissajous__WEBPACK_IMPORTED_MODULE_18__.Lissajous), +/* harmony export */ "SuperShape": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_primitives_SuperShape__WEBPACK_IMPORTED_MODULE_19__.SuperShape), +/* harmony export */ "Modifier": () => (/* reexport safe */ _urpflanze_core_dist_cjs_modifiers_Modifier__WEBPACK_IMPORTED_MODULE_20__.Modifier), +/* harmony export */ "Modifiers": () => (/* reexport safe */ _urpflanze_core_dist_cjs_modifiers__WEBPACK_IMPORTED_MODULE_21__.Modifiers), +/* harmony export */ "lerp": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.lerp), +/* harmony export */ "clamp": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.clamp), +/* harmony export */ "relativeClamp": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.relativeClamp), +/* harmony export */ "toDegrees": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.toDegrees), +/* harmony export */ "toRadians": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.toRadians), +/* harmony export */ "now": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.now), +/* harmony export */ "noise": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.noise), +/* harmony export */ "random": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.random), +/* harmony export */ "angleFromRepetition": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.angleFromRepetition), +/* harmony export */ "angle2FromRepetition": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.angle2FromRepetition), +/* harmony export */ "distanceFromRepetition": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.distanceFromRepetition), +/* harmony export */ "interpolate": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.interpolate), +/* harmony export */ "prepareBufferForInterpolation": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.prepareBufferForInterpolation), +/* harmony export */ "distributePointsInBuffer": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.distributePointsInBuffer), +/* harmony export */ "Vec2": () => (/* reexport safe */ _urpflanze_core_dist_cjs_math_Vec2__WEBPACK_IMPORTED_MODULE_23__.default), +/* harmony export */ "PHI": () => (/* reexport safe */ _urpflanze_core_dist_cjs_math__WEBPACK_IMPORTED_MODULE_24__.PHI), +/* harmony export */ "PI2": () => (/* reexport safe */ _urpflanze_core_dist_cjs_math__WEBPACK_IMPORTED_MODULE_24__.PI2), +/* harmony export */ "log": () => (/* reexport safe */ _urpflanze_core_dist_cjs_math__WEBPACK_IMPORTED_MODULE_24__.log), +/* harmony export */ "mod": () => (/* reexport safe */ _urpflanze_core_dist_cjs_math__WEBPACK_IMPORTED_MODULE_24__.mod) +/* harmony export */ }); +/* harmony import */ var _urpflanze_core_dist_cjs_Scene__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); +/* harmony import */ var _urpflanze_core_dist_cjs_SceneChild__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4); +/* harmony import */ var _urpflanze_core_dist_cjs_Group__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_ShapeBase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_ShapePrimitive__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(35); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_ShapeLoop__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(36); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_ShapeBuffer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(37); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_Shape__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(34); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_ShapeRecursive__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(38); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_ShapeFollow__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(39); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_primitives_Line__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(40); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_primitives_Triangle__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(41); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_primitives_Rect__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(42); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_primitives_Polygon__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(43); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_primitives_Circle__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(44); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_primitives_Star__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(45); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_primitives_Rose__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(46); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_primitives_Spiral__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(47); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_primitives_Lissajous__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(48); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_primitives_SuperShape__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(49); +/* harmony import */ var _urpflanze_core_dist_cjs_modifiers_Modifier__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(31); +/* harmony import */ var _urpflanze_core_dist_cjs_modifiers__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(50); +/* harmony import */ var _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(32); +/* harmony import */ var _urpflanze_core_dist_cjs_math_Vec2__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(28); +/* harmony import */ var _urpflanze_core_dist_cjs_math__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(29); -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.mod = exports.log = exports.PI2 = exports.PHI = exports.Vec2 = exports.distributePointsInBuffer = exports.prepareBufferForInterpolation = exports.interpolate = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.now = exports.toRadians = exports.toDegrees = exports.relativeClamp = exports.clamp = exports.lerp = void 0; -/** - * Types & Interface - */ -__exportStar(__webpack_require__(3), exports); -// Set glMatrixArrayType -const gl_matrix_1 = __webpack_require__(12); -gl_matrix_1.glMatrix.setMatrixArrayType(Array); -/** - * Core - */ -__exportStar(__webpack_require__(23), exports); -__exportStar(__webpack_require__(24), exports); -__exportStar(__webpack_require__(25), exports); -// Shapes -__exportStar(__webpack_require__(26), exports); -__exportStar(__webpack_require__(35), exports); -__exportStar(__webpack_require__(36), exports); -__exportStar(__webpack_require__(37), exports); -__exportStar(__webpack_require__(34), exports); -__exportStar(__webpack_require__(38), exports); -__exportStar(__webpack_require__(39), exports); -__exportStar(__webpack_require__(40), exports); -__exportStar(__webpack_require__(41), exports); -__exportStar(__webpack_require__(42), exports); -__exportStar(__webpack_require__(43), exports); -__exportStar(__webpack_require__(44), exports); -__exportStar(__webpack_require__(45), exports); -__exportStar(__webpack_require__(46), exports); -__exportStar(__webpack_require__(47), exports); -__exportStar(__webpack_require__(48), exports); -__exportStar(__webpack_require__(49), exports); -// Modifiers -__exportStar(__webpack_require__(31), exports); -__exportStar(__webpack_require__(50), exports); -// Utilities -var Utilities_1 = __webpack_require__(32); -Object.defineProperty(exports, "lerp", ({ enumerable: true, get: function () { return Utilities_1.lerp; } })); -Object.defineProperty(exports, "clamp", ({ enumerable: true, get: function () { return Utilities_1.clamp; } })); -Object.defineProperty(exports, "relativeClamp", ({ enumerable: true, get: function () { return Utilities_1.relativeClamp; } })); -Object.defineProperty(exports, "toDegrees", ({ enumerable: true, get: function () { return Utilities_1.toDegrees; } })); -Object.defineProperty(exports, "toRadians", ({ enumerable: true, get: function () { return Utilities_1.toRadians; } })); -Object.defineProperty(exports, "now", ({ enumerable: true, get: function () { return Utilities_1.now; } })); -Object.defineProperty(exports, "noise", ({ enumerable: true, get: function () { return Utilities_1.noise; } })); -Object.defineProperty(exports, "random", ({ enumerable: true, get: function () { return Utilities_1.random; } })); -Object.defineProperty(exports, "angleFromRepetition", ({ enumerable: true, get: function () { return Utilities_1.angleFromRepetition; } })); -Object.defineProperty(exports, "angle2FromRepetition", ({ enumerable: true, get: function () { return Utilities_1.angle2FromRepetition; } })); -Object.defineProperty(exports, "distanceFromRepetition", ({ enumerable: true, get: function () { return Utilities_1.distanceFromRepetition; } })); -Object.defineProperty(exports, "interpolate", ({ enumerable: true, get: function () { return Utilities_1.interpolate; } })); -Object.defineProperty(exports, "prepareBufferForInterpolation", ({ enumerable: true, get: function () { return Utilities_1.prepareBufferForInterpolation; } })); -Object.defineProperty(exports, "distributePointsInBuffer", ({ enumerable: true, get: function () { return Utilities_1.distributePointsInBuffer; } })); -var Vec2_1 = __webpack_require__(28); -Object.defineProperty(exports, "Vec2", ({ enumerable: true, get: function () { return Vec2_1.default; } })); -var math_1 = __webpack_require__(29); -Object.defineProperty(exports, "PHI", ({ enumerable: true, get: function () { return math_1.PHI; } })); -Object.defineProperty(exports, "PI2", ({ enumerable: true, get: function () { return math_1.PI2; } })); -Object.defineProperty(exports, "log", ({ enumerable: true, get: function () { return math_1.log; } })); -Object.defineProperty(exports, "mod", ({ enumerable: true, get: function () { return math_1.mod; } })); -//# sourceMappingURL=index.js.map -/***/ }), -/* 3 */ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__webpack_require__(4), exports); -__exportStar(__webpack_require__(5), exports); -__exportStar(__webpack_require__(6), exports); -__exportStar(__webpack_require__(7), exports); -__exportStar(__webpack_require__(8), exports); -__exportStar(__webpack_require__(9), exports); -__exportStar(__webpack_require__(10), exports); -__exportStar(__webpack_require__(11), exports); -//# sourceMappingURL=index.js.map -/***/ }), -/* 4 */ -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=indexedBuffer.js.map -/***/ }), -/* 5 */ -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=propArguments.js.map -/***/ }), -/* 6 */ -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ERepetitionType = void 0; -/** - * Repetition type enumerator. - * - * @category Core.Repetition - * @internal - */ -var ERepetitionType; -(function (ERepetitionType) { - /** - * Defines the type of repetition of the shape, - * in a circular way starting from the center of the scene - * @order 1 - */ - ERepetitionType[ERepetitionType["Ring"] = 1] = "Ring"; - /** - * Defines the type of repetition of the shape, - * on a nxm grid starting from the center of the scene - * @order 2 - */ - ERepetitionType[ERepetitionType["Matrix"] = 2] = "Matrix"; -})(ERepetitionType = exports.ERepetitionType || (exports.ERepetitionType = {})); -//# sourceMappingURL=repetitions.js.map -/***/ }), -/* 7 */ -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=scene-child.js.map -/***/ }), -/* 8 */ -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=scene.js.map -/***/ }), -/* 9 */ -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EBoundingType = void 0; -var EBoundingType; -(function (EBoundingType) { - /** - * Relative to the real bounding of the shape - * @order 2 - */ - EBoundingType[EBoundingType["Relative"] = 1] = "Relative"; - /** - * Fixed to te width and height of the shape - * @order 3 - */ - EBoundingType[EBoundingType["Fixed"] = 2] = "Fixed"; -})(EBoundingType = exports.EBoundingType || (exports.EBoundingType = {})); -//# sourceMappingURL=shape-base.js.map -/***/ }), -/* 10 */ -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -////// -//# sourceMappingURL=shape-primitives.js.map +//# sourceMappingURL=core.js.map /***/ }), -/* 11 */ -/***/ ((__unused_webpack_module, exports) => { +/* 3 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; -// Shape Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=shapes.js.map - -/***/ }), -/* 12 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "glMatrix": () => (/* reexport module object */ _common_js__WEBPACK_IMPORTED_MODULE_0__), -/* harmony export */ "mat2": () => (/* reexport module object */ _mat2_js__WEBPACK_IMPORTED_MODULE_1__), -/* harmony export */ "mat2d": () => (/* reexport module object */ _mat2d_js__WEBPACK_IMPORTED_MODULE_2__), -/* harmony export */ "mat3": () => (/* reexport module object */ _mat3_js__WEBPACK_IMPORTED_MODULE_3__), -/* harmony export */ "mat4": () => (/* reexport module object */ _mat4_js__WEBPACK_IMPORTED_MODULE_4__), -/* harmony export */ "quat": () => (/* reexport module object */ _quat_js__WEBPACK_IMPORTED_MODULE_5__), -/* harmony export */ "quat2": () => (/* reexport module object */ _quat2_js__WEBPACK_IMPORTED_MODULE_6__), -/* harmony export */ "vec2": () => (/* reexport module object */ _vec2_js__WEBPACK_IMPORTED_MODULE_7__), -/* harmony export */ "vec3": () => (/* reexport module object */ _vec3_js__WEBPACK_IMPORTED_MODULE_8__), -/* harmony export */ "vec4": () => (/* reexport module object */ _vec4_js__WEBPACK_IMPORTED_MODULE_9__) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); -/* harmony import */ var _mat2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14); -/* harmony import */ var _mat2d_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15); -/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16); -/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17); -/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(18); -/* harmony import */ var _quat2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(21); -/* harmony import */ var _vec2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22); -/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(20); -/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(19); - - - - - - - - - - - - -/***/ }), -/* 13 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "EPSILON": () => (/* binding */ EPSILON), -/* harmony export */ "ARRAY_TYPE": () => (/* binding */ ARRAY_TYPE), -/* harmony export */ "RANDOM": () => (/* binding */ RANDOM), -/* harmony export */ "setMatrixArrayType": () => (/* binding */ setMatrixArrayType), -/* harmony export */ "toRadian": () => (/* binding */ toRadian), -/* harmony export */ "equals": () => (/* binding */ equals) -/* harmony export */ }); -/** - * Common utilities - * @module glMatrix - */ -// Configuration Constants -var EPSILON = 0.000001; -var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array; -var RANDOM = Math.random; -/** - * Sets the type of array used when creating new vectors and matrices - * - * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array - */ - -function setMatrixArrayType(type) { - ARRAY_TYPE = type; -} -var degree = Math.PI / 180; -/** - * Convert Degree To Radian - * - * @param {Number} a Angle in Degrees - */ - -function toRadian(a) { - return a * degree; -} -/** - * Tests whether or not the arguments have approximately the same value, within an absolute - * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less - * than or equal to 1.0, and a relative tolerance is used for larger values) - * - * @param {Number} a The first number to test. - * @param {Number} b The second number to test. - * @returns {Boolean} True if the numbers are approximately equal, false otherwise. +exports.Scene = void 0; +const SceneChild_1 = __webpack_require__(4); +const Group_1 = __webpack_require__(5); +const Shape_1 = __webpack_require__(34); +const Utilities_1 = __webpack_require__(32); +/** + * Container for all SceneChild. + * The main purpose is to manage the drawing order and update the child buffers + * + * @order 1 + * @category Core.Scene + * @class Scene */ - -function equals(a, b) { - return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b)); -} -if (!Math.hypot) Math.hypot = function () { - var y = 0, - i = arguments.length; - - while (i--) { - y += arguments[i] * arguments[i]; - } - - return Math.sqrt(y); -}; - -/***/ }), -/* 14 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "transpose": () => (/* binding */ transpose), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "adjoint": () => (/* binding */ adjoint), -/* harmony export */ "determinant": () => (/* binding */ determinant), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "rotate": () => (/* binding */ rotate), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), -/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "frob": () => (/* binding */ frob), -/* harmony export */ "LDU": () => (/* binding */ LDU), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), -/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "sub": () => (/* binding */ sub) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); - -/** - * 2x2 Matrix - * @module mat2 - */ - -/** - * Creates a new identity mat2 - * - * @returns {mat2} a new 2x2 matrix - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[1] = 0; - out[2] = 0; - } - - out[0] = 1; - out[3] = 1; - return out; -} -/** - * Creates a new mat2 initialized with values from an existing matrix - * - * @param {ReadonlyMat2} a matrix to clone - * @returns {mat2} a new 2x2 matrix - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - return out; -} -/** - * Copy the values from one mat2 to another - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the source matrix - * @returns {mat2} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - return out; -} -/** - * Set a mat2 to the identity matrix - * - * @param {mat2} out the receiving matrix - * @returns {mat2} out - */ - -function identity(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 1; - return out; -} -/** - * Create a new mat2 with the given values - * - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m10 Component in column 1, row 0 position (index 2) - * @param {Number} m11 Component in column 1, row 1 position (index 3) - * @returns {mat2} out A new 2x2 matrix - */ - -function fromValues(m00, m01, m10, m11) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - out[0] = m00; - out[1] = m01; - out[2] = m10; - out[3] = m11; - return out; -} -/** - * Set the components of a mat2 to the given values - * - * @param {mat2} out the receiving matrix - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m10 Component in column 1, row 0 position (index 2) - * @param {Number} m11 Component in column 1, row 1 position (index 3) - * @returns {mat2} out - */ - -function set(out, m00, m01, m10, m11) { - out[0] = m00; - out[1] = m01; - out[2] = m10; - out[3] = m11; - return out; -} -/** - * Transpose the values of a mat2 - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the source matrix - * @returns {mat2} out - */ - -function transpose(out, a) { - // If we are transposing ourselves we can skip a few steps but have to cache - // some values - if (out === a) { - var a1 = a[1]; - out[1] = a[2]; - out[2] = a1; - } else { - out[0] = a[0]; - out[1] = a[2]; - out[2] = a[1]; - out[3] = a[3]; - } - - return out; -} -/** - * Inverts a mat2 - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the source matrix - * @returns {mat2} out - */ - -function invert(out, a) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; // Calculate the determinant - - var det = a0 * a3 - a2 * a1; - - if (!det) { - return null; - } - - det = 1.0 / det; - out[0] = a3 * det; - out[1] = -a1 * det; - out[2] = -a2 * det; - out[3] = a0 * det; - return out; -} -/** - * Calculates the adjugate of a mat2 - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the source matrix - * @returns {mat2} out - */ - -function adjoint(out, a) { - // Caching this value is nessecary if out == a - var a0 = a[0]; - out[0] = a[3]; - out[1] = -a[1]; - out[2] = -a[2]; - out[3] = a0; - return out; -} -/** - * Calculates the determinant of a mat2 - * - * @param {ReadonlyMat2} a the source matrix - * @returns {Number} determinant of a - */ - -function determinant(a) { - return a[0] * a[3] - a[2] * a[1]; -} -/** - * Multiplies two mat2's - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the first operand - * @param {ReadonlyMat2} b the second operand - * @returns {mat2} out - */ - -function multiply(out, a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3]; - out[0] = a0 * b0 + a2 * b1; - out[1] = a1 * b0 + a3 * b1; - out[2] = a0 * b2 + a2 * b3; - out[3] = a1 * b2 + a3 * b3; - return out; -} -/** - * Rotates a mat2 by the given angle - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat2} out - */ - -function rotate(out, a, rad) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var s = Math.sin(rad); - var c = Math.cos(rad); - out[0] = a0 * c + a2 * s; - out[1] = a1 * c + a3 * s; - out[2] = a0 * -s + a2 * c; - out[3] = a1 * -s + a3 * c; - return out; -} -/** - * Scales the mat2 by the dimensions in the given vec2 - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the matrix to rotate - * @param {ReadonlyVec2} v the vec2 to scale the matrix by - * @returns {mat2} out - **/ - -function scale(out, a, v) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var v0 = v[0], - v1 = v[1]; - out[0] = a0 * v0; - out[1] = a1 * v0; - out[2] = a2 * v1; - out[3] = a3 * v1; - return out; -} -/** - * Creates a matrix from a given angle - * This is equivalent to (but much faster than): - * - * mat2.identity(dest); - * mat2.rotate(dest, dest, rad); - * - * @param {mat2} out mat2 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat2} out - */ - -function fromRotation(out, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); - out[0] = c; - out[1] = s; - out[2] = -s; - out[3] = c; - return out; -} -/** - * Creates a matrix from a vector scaling - * This is equivalent to (but much faster than): - * - * mat2.identity(dest); - * mat2.scale(dest, dest, vec); - * - * @param {mat2} out mat2 receiving operation result - * @param {ReadonlyVec2} v Scaling vector - * @returns {mat2} out - */ - -function fromScaling(out, v) { - out[0] = v[0]; - out[1] = 0; - out[2] = 0; - out[3] = v[1]; - return out; -} -/** - * Returns a string representation of a mat2 - * - * @param {ReadonlyMat2} a matrix to represent as a string - * @returns {String} string representation of the matrix - */ - -function str(a) { - return "mat2(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; -} -/** - * Returns Frobenius norm of a mat2 - * - * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of - * @returns {Number} Frobenius norm - */ - -function frob(a) { - return Math.hypot(a[0], a[1], a[2], a[3]); -} -/** - * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix - * @param {ReadonlyMat2} L the lower triangular matrix - * @param {ReadonlyMat2} D the diagonal matrix - * @param {ReadonlyMat2} U the upper triangular matrix - * @param {ReadonlyMat2} a the input matrix to factorize - */ - -function LDU(L, D, U, a) { - L[2] = a[2] / a[0]; - U[0] = a[0]; - U[1] = a[1]; - U[3] = a[3] - L[2] * U[1]; - return [L, D, U]; -} -/** - * Adds two mat2's - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the first operand - * @param {ReadonlyMat2} b the second operand - * @returns {mat2} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - return out; -} -/** - * Subtracts matrix b from matrix a - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the first operand - * @param {ReadonlyMat2} b the second operand - * @returns {mat2} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - out[3] = a[3] - b[3]; - return out; -} -/** - * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyMat2} a The first matrix. - * @param {ReadonlyMat2} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; -} -/** - * Returns whether or not the matrices have approximately the same elements in the same position. - * - * @param {ReadonlyMat2} a The first matrix. - * @param {ReadonlyMat2} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)); -} -/** - * Multiply each element of the matrix by a scalar. - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the matrix to scale - * @param {Number} b amount to scale the matrix's elements by - * @returns {mat2} out - */ - -function multiplyScalar(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - return out; -} -/** - * Adds two mat2's after multiplying each element of the second operand by a scalar value. - * - * @param {mat2} out the receiving vector - * @param {ReadonlyMat2} a the first operand - * @param {ReadonlyMat2} b the second operand - * @param {Number} scale the amount to scale b's elements by before adding - * @returns {mat2} out - */ - -function multiplyScalarAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - out[3] = a[3] + b[3] * scale; - return out; -} -/** - * Alias for {@link mat2.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link mat2.subtract} - * @function - */ - -var sub = subtract; - -/***/ }), -/* 15 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "determinant": () => (/* binding */ determinant), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "rotate": () => (/* binding */ rotate), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "translate": () => (/* binding */ translate), -/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), -/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), -/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "frob": () => (/* binding */ frob), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), -/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "sub": () => (/* binding */ sub) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); - -/** - * 2x3 Matrix - * @module mat2d - * @description - * A mat2d contains six elements defined as: - *
- * [a, b,
- *  c, d,
- *  tx, ty]
- * 
- * This is a short form for the 3x3 matrix: - *
- * [a, b, 0,
- *  c, d, 0,
- *  tx, ty, 1]
- * 
- * The last column is ignored so the array is shorter and operations are faster. - */ - -/** - * Creates a new identity mat2d - * - * @returns {mat2d} a new 2x3 matrix - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[1] = 0; - out[2] = 0; - out[4] = 0; - out[5] = 0; - } - - out[0] = 1; - out[3] = 1; - return out; -} -/** - * Creates a new mat2d initialized with values from an existing matrix - * - * @param {ReadonlyMat2d} a matrix to clone - * @returns {mat2d} a new 2x3 matrix - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - return out; -} -/** - * Copy the values from one mat2d to another - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the source matrix - * @returns {mat2d} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - return out; -} -/** - * Set a mat2d to the identity matrix - * - * @param {mat2d} out the receiving matrix - * @returns {mat2d} out - */ - -function identity(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 1; - out[4] = 0; - out[5] = 0; - return out; -} -/** - * Create a new mat2d with the given values - * - * @param {Number} a Component A (index 0) - * @param {Number} b Component B (index 1) - * @param {Number} c Component C (index 2) - * @param {Number} d Component D (index 3) - * @param {Number} tx Component TX (index 4) - * @param {Number} ty Component TY (index 5) - * @returns {mat2d} A new mat2d - */ - -function fromValues(a, b, c, d, tx, ty) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); - out[0] = a; - out[1] = b; - out[2] = c; - out[3] = d; - out[4] = tx; - out[5] = ty; - return out; -} -/** - * Set the components of a mat2d to the given values - * - * @param {mat2d} out the receiving matrix - * @param {Number} a Component A (index 0) - * @param {Number} b Component B (index 1) - * @param {Number} c Component C (index 2) - * @param {Number} d Component D (index 3) - * @param {Number} tx Component TX (index 4) - * @param {Number} ty Component TY (index 5) - * @returns {mat2d} out - */ - -function set(out, a, b, c, d, tx, ty) { - out[0] = a; - out[1] = b; - out[2] = c; - out[3] = d; - out[4] = tx; - out[5] = ty; - return out; -} -/** - * Inverts a mat2d - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the source matrix - * @returns {mat2d} out - */ - -function invert(out, a) { - var aa = a[0], - ab = a[1], - ac = a[2], - ad = a[3]; - var atx = a[4], - aty = a[5]; - var det = aa * ad - ab * ac; - - if (!det) { - return null; - } - - det = 1.0 / det; - out[0] = ad * det; - out[1] = -ab * det; - out[2] = -ac * det; - out[3] = aa * det; - out[4] = (ac * aty - ad * atx) * det; - out[5] = (ab * atx - aa * aty) * det; - return out; -} -/** - * Calculates the determinant of a mat2d - * - * @param {ReadonlyMat2d} a the source matrix - * @returns {Number} determinant of a - */ - -function determinant(a) { - return a[0] * a[3] - a[1] * a[2]; -} -/** - * Multiplies two mat2d's - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the first operand - * @param {ReadonlyMat2d} b the second operand - * @returns {mat2d} out - */ - -function multiply(out, a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3], - b4 = b[4], - b5 = b[5]; - out[0] = a0 * b0 + a2 * b1; - out[1] = a1 * b0 + a3 * b1; - out[2] = a0 * b2 + a2 * b3; - out[3] = a1 * b2 + a3 * b3; - out[4] = a0 * b4 + a2 * b5 + a4; - out[5] = a1 * b4 + a3 * b5 + a5; - return out; -} -/** - * Rotates a mat2d by the given angle - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat2d} out - */ - -function rotate(out, a, rad) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5]; - var s = Math.sin(rad); - var c = Math.cos(rad); - out[0] = a0 * c + a2 * s; - out[1] = a1 * c + a3 * s; - out[2] = a0 * -s + a2 * c; - out[3] = a1 * -s + a3 * c; - out[4] = a4; - out[5] = a5; - return out; -} -/** - * Scales the mat2d by the dimensions in the given vec2 - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the matrix to translate - * @param {ReadonlyVec2} v the vec2 to scale the matrix by - * @returns {mat2d} out - **/ - -function scale(out, a, v) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5]; - var v0 = v[0], - v1 = v[1]; - out[0] = a0 * v0; - out[1] = a1 * v0; - out[2] = a2 * v1; - out[3] = a3 * v1; - out[4] = a4; - out[5] = a5; - return out; -} -/** - * Translates the mat2d by the dimensions in the given vec2 - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the matrix to translate - * @param {ReadonlyVec2} v the vec2 to translate the matrix by - * @returns {mat2d} out - **/ - -function translate(out, a, v) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5]; - var v0 = v[0], - v1 = v[1]; - out[0] = a0; - out[1] = a1; - out[2] = a2; - out[3] = a3; - out[4] = a0 * v0 + a2 * v1 + a4; - out[5] = a1 * v0 + a3 * v1 + a5; - return out; -} -/** - * Creates a matrix from a given angle - * This is equivalent to (but much faster than): - * - * mat2d.identity(dest); - * mat2d.rotate(dest, dest, rad); - * - * @param {mat2d} out mat2d receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat2d} out - */ - -function fromRotation(out, rad) { - var s = Math.sin(rad), - c = Math.cos(rad); - out[0] = c; - out[1] = s; - out[2] = -s; - out[3] = c; - out[4] = 0; - out[5] = 0; - return out; -} -/** - * Creates a matrix from a vector scaling - * This is equivalent to (but much faster than): - * - * mat2d.identity(dest); - * mat2d.scale(dest, dest, vec); - * - * @param {mat2d} out mat2d receiving operation result - * @param {ReadonlyVec2} v Scaling vector - * @returns {mat2d} out - */ - -function fromScaling(out, v) { - out[0] = v[0]; - out[1] = 0; - out[2] = 0; - out[3] = v[1]; - out[4] = 0; - out[5] = 0; - return out; -} -/** - * Creates a matrix from a vector translation - * This is equivalent to (but much faster than): - * - * mat2d.identity(dest); - * mat2d.translate(dest, dest, vec); - * - * @param {mat2d} out mat2d receiving operation result - * @param {ReadonlyVec2} v Translation vector - * @returns {mat2d} out - */ - -function fromTranslation(out, v) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 1; - out[4] = v[0]; - out[5] = v[1]; - return out; -} -/** - * Returns a string representation of a mat2d - * - * @param {ReadonlyMat2d} a matrix to represent as a string - * @returns {String} string representation of the matrix - */ - -function str(a) { - return "mat2d(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ")"; -} -/** - * Returns Frobenius norm of a mat2d - * - * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of - * @returns {Number} Frobenius norm - */ - -function frob(a) { - return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1); -} -/** - * Adds two mat2d's - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the first operand - * @param {ReadonlyMat2d} b the second operand - * @returns {mat2d} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - out[4] = a[4] + b[4]; - out[5] = a[5] + b[5]; - return out; -} -/** - * Subtracts matrix b from matrix a - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the first operand - * @param {ReadonlyMat2d} b the second operand - * @returns {mat2d} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - out[3] = a[3] - b[3]; - out[4] = a[4] - b[4]; - out[5] = a[5] - b[5]; - return out; -} -/** - * Multiply each element of the matrix by a scalar. - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the matrix to scale - * @param {Number} b amount to scale the matrix's elements by - * @returns {mat2d} out - */ - -function multiplyScalar(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - out[4] = a[4] * b; - out[5] = a[5] * b; - return out; -} -/** - * Adds two mat2d's after multiplying each element of the second operand by a scalar value. - * - * @param {mat2d} out the receiving vector - * @param {ReadonlyMat2d} a the first operand - * @param {ReadonlyMat2d} b the second operand - * @param {Number} scale the amount to scale b's elements by before adding - * @returns {mat2d} out - */ - -function multiplyScalarAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - out[3] = a[3] + b[3] * scale; - out[4] = a[4] + b[4] * scale; - out[5] = a[5] + b[5] * scale; - return out; -} -/** - * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyMat2d} a The first matrix. - * @param {ReadonlyMat2d} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5]; -} -/** - * Returns whether or not the matrices have approximately the same elements in the same position. - * - * @param {ReadonlyMat2d} a The first matrix. - * @param {ReadonlyMat2d} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3], - b4 = b[4], - b5 = b[5]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)); -} -/** - * Alias for {@link mat2d.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link mat2d.subtract} - * @function - */ - -var sub = subtract; - -/***/ }), -/* 16 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "fromMat4": () => (/* binding */ fromMat4), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "transpose": () => (/* binding */ transpose), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "adjoint": () => (/* binding */ adjoint), -/* harmony export */ "determinant": () => (/* binding */ determinant), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "translate": () => (/* binding */ translate), -/* harmony export */ "rotate": () => (/* binding */ rotate), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), -/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), -/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), -/* harmony export */ "fromMat2d": () => (/* binding */ fromMat2d), -/* harmony export */ "fromQuat": () => (/* binding */ fromQuat), -/* harmony export */ "normalFromMat4": () => (/* binding */ normalFromMat4), -/* harmony export */ "projection": () => (/* binding */ projection), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "frob": () => (/* binding */ frob), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), -/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "sub": () => (/* binding */ sub) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); - -/** - * 3x3 Matrix - * @module mat3 - */ - -/** - * Creates a new identity mat3 - * - * @returns {mat3} a new 3x3 matrix - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[5] = 0; - out[6] = 0; - out[7] = 0; - } - - out[0] = 1; - out[4] = 1; - out[8] = 1; - return out; -} -/** - * Copies the upper-left 3x3 values into the given mat3. - * - * @param {mat3} out the receiving 3x3 matrix - * @param {ReadonlyMat4} a the source 4x4 matrix - * @returns {mat3} out - */ - -function fromMat4(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[4]; - out[4] = a[5]; - out[5] = a[6]; - out[6] = a[8]; - out[7] = a[9]; - out[8] = a[10]; - return out; -} -/** - * Creates a new mat3 initialized with values from an existing matrix - * - * @param {ReadonlyMat3} a matrix to clone - * @returns {mat3} a new 3x3 matrix - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - return out; -} -/** - * Copy the values from one mat3 to another - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the source matrix - * @returns {mat3} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - return out; -} -/** - * Create a new mat3 with the given values - * - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m02 Component in column 0, row 2 position (index 2) - * @param {Number} m10 Component in column 1, row 0 position (index 3) - * @param {Number} m11 Component in column 1, row 1 position (index 4) - * @param {Number} m12 Component in column 1, row 2 position (index 5) - * @param {Number} m20 Component in column 2, row 0 position (index 6) - * @param {Number} m21 Component in column 2, row 1 position (index 7) - * @param {Number} m22 Component in column 2, row 2 position (index 8) - * @returns {mat3} A new mat3 - */ - -function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); - out[0] = m00; - out[1] = m01; - out[2] = m02; - out[3] = m10; - out[4] = m11; - out[5] = m12; - out[6] = m20; - out[7] = m21; - out[8] = m22; - return out; -} -/** - * Set the components of a mat3 to the given values - * - * @param {mat3} out the receiving matrix - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m02 Component in column 0, row 2 position (index 2) - * @param {Number} m10 Component in column 1, row 0 position (index 3) - * @param {Number} m11 Component in column 1, row 1 position (index 4) - * @param {Number} m12 Component in column 1, row 2 position (index 5) - * @param {Number} m20 Component in column 2, row 0 position (index 6) - * @param {Number} m21 Component in column 2, row 1 position (index 7) - * @param {Number} m22 Component in column 2, row 2 position (index 8) - * @returns {mat3} out - */ - -function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) { - out[0] = m00; - out[1] = m01; - out[2] = m02; - out[3] = m10; - out[4] = m11; - out[5] = m12; - out[6] = m20; - out[7] = m21; - out[8] = m22; - return out; -} -/** - * Set a mat3 to the identity matrix - * - * @param {mat3} out the receiving matrix - * @returns {mat3} out - */ - -function identity(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 1; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 1; - return out; -} -/** - * Transpose the values of a mat3 - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the source matrix - * @returns {mat3} out - */ - -function transpose(out, a) { - // If we are transposing ourselves we can skip a few steps but have to cache some values - if (out === a) { - var a01 = a[1], - a02 = a[2], - a12 = a[5]; - out[1] = a[3]; - out[2] = a[6]; - out[3] = a01; - out[5] = a[7]; - out[6] = a02; - out[7] = a12; - } else { - out[0] = a[0]; - out[1] = a[3]; - out[2] = a[6]; - out[3] = a[1]; - out[4] = a[4]; - out[5] = a[7]; - out[6] = a[2]; - out[7] = a[5]; - out[8] = a[8]; - } - - return out; -} -/** - * Inverts a mat3 - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the source matrix - * @returns {mat3} out - */ - -function invert(out, a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2]; - var a10 = a[3], - a11 = a[4], - a12 = a[5]; - var a20 = a[6], - a21 = a[7], - a22 = a[8]; - var b01 = a22 * a11 - a12 * a21; - var b11 = -a22 * a10 + a12 * a20; - var b21 = a21 * a10 - a11 * a20; // Calculate the determinant - - var det = a00 * b01 + a01 * b11 + a02 * b21; - - if (!det) { - return null; - } - - det = 1.0 / det; - out[0] = b01 * det; - out[1] = (-a22 * a01 + a02 * a21) * det; - out[2] = (a12 * a01 - a02 * a11) * det; - out[3] = b11 * det; - out[4] = (a22 * a00 - a02 * a20) * det; - out[5] = (-a12 * a00 + a02 * a10) * det; - out[6] = b21 * det; - out[7] = (-a21 * a00 + a01 * a20) * det; - out[8] = (a11 * a00 - a01 * a10) * det; - return out; -} -/** - * Calculates the adjugate of a mat3 - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the source matrix - * @returns {mat3} out - */ - -function adjoint(out, a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2]; - var a10 = a[3], - a11 = a[4], - a12 = a[5]; - var a20 = a[6], - a21 = a[7], - a22 = a[8]; - out[0] = a11 * a22 - a12 * a21; - out[1] = a02 * a21 - a01 * a22; - out[2] = a01 * a12 - a02 * a11; - out[3] = a12 * a20 - a10 * a22; - out[4] = a00 * a22 - a02 * a20; - out[5] = a02 * a10 - a00 * a12; - out[6] = a10 * a21 - a11 * a20; - out[7] = a01 * a20 - a00 * a21; - out[8] = a00 * a11 - a01 * a10; - return out; -} -/** - * Calculates the determinant of a mat3 - * - * @param {ReadonlyMat3} a the source matrix - * @returns {Number} determinant of a - */ - -function determinant(a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2]; - var a10 = a[3], - a11 = a[4], - a12 = a[5]; - var a20 = a[6], - a21 = a[7], - a22 = a[8]; - return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); -} -/** - * Multiplies two mat3's - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the first operand - * @param {ReadonlyMat3} b the second operand - * @returns {mat3} out - */ - -function multiply(out, a, b) { - var a00 = a[0], - a01 = a[1], - a02 = a[2]; - var a10 = a[3], - a11 = a[4], - a12 = a[5]; - var a20 = a[6], - a21 = a[7], - a22 = a[8]; - var b00 = b[0], - b01 = b[1], - b02 = b[2]; - var b10 = b[3], - b11 = b[4], - b12 = b[5]; - var b20 = b[6], - b21 = b[7], - b22 = b[8]; - out[0] = b00 * a00 + b01 * a10 + b02 * a20; - out[1] = b00 * a01 + b01 * a11 + b02 * a21; - out[2] = b00 * a02 + b01 * a12 + b02 * a22; - out[3] = b10 * a00 + b11 * a10 + b12 * a20; - out[4] = b10 * a01 + b11 * a11 + b12 * a21; - out[5] = b10 * a02 + b11 * a12 + b12 * a22; - out[6] = b20 * a00 + b21 * a10 + b22 * a20; - out[7] = b20 * a01 + b21 * a11 + b22 * a21; - out[8] = b20 * a02 + b21 * a12 + b22 * a22; - return out; -} -/** - * Translate a mat3 by the given vector - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the matrix to translate - * @param {ReadonlyVec2} v vector to translate by - * @returns {mat3} out - */ - -function translate(out, a, v) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a10 = a[3], - a11 = a[4], - a12 = a[5], - a20 = a[6], - a21 = a[7], - a22 = a[8], - x = v[0], - y = v[1]; - out[0] = a00; - out[1] = a01; - out[2] = a02; - out[3] = a10; - out[4] = a11; - out[5] = a12; - out[6] = x * a00 + y * a10 + a20; - out[7] = x * a01 + y * a11 + a21; - out[8] = x * a02 + y * a12 + a22; - return out; -} -/** - * Rotates a mat3 by the given angle - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat3} out - */ - -function rotate(out, a, rad) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a10 = a[3], - a11 = a[4], - a12 = a[5], - a20 = a[6], - a21 = a[7], - a22 = a[8], - s = Math.sin(rad), - c = Math.cos(rad); - out[0] = c * a00 + s * a10; - out[1] = c * a01 + s * a11; - out[2] = c * a02 + s * a12; - out[3] = c * a10 - s * a00; - out[4] = c * a11 - s * a01; - out[5] = c * a12 - s * a02; - out[6] = a20; - out[7] = a21; - out[8] = a22; - return out; -} -/** - * Scales the mat3 by the dimensions in the given vec2 - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the matrix to rotate - * @param {ReadonlyVec2} v the vec2 to scale the matrix by - * @returns {mat3} out - **/ - -function scale(out, a, v) { - var x = v[0], - y = v[1]; - out[0] = x * a[0]; - out[1] = x * a[1]; - out[2] = x * a[2]; - out[3] = y * a[3]; - out[4] = y * a[4]; - out[5] = y * a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - return out; -} -/** - * Creates a matrix from a vector translation - * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.translate(dest, dest, vec); - * - * @param {mat3} out mat3 receiving operation result - * @param {ReadonlyVec2} v Translation vector - * @returns {mat3} out - */ - -function fromTranslation(out, v) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 1; - out[5] = 0; - out[6] = v[0]; - out[7] = v[1]; - out[8] = 1; - return out; -} -/** - * Creates a matrix from a given angle - * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.rotate(dest, dest, rad); - * - * @param {mat3} out mat3 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat3} out - */ - -function fromRotation(out, rad) { - var s = Math.sin(rad), - c = Math.cos(rad); - out[0] = c; - out[1] = s; - out[2] = 0; - out[3] = -s; - out[4] = c; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 1; - return out; -} -/** - * Creates a matrix from a vector scaling - * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.scale(dest, dest, vec); - * - * @param {mat3} out mat3 receiving operation result - * @param {ReadonlyVec2} v Scaling vector - * @returns {mat3} out - */ - -function fromScaling(out, v) { - out[0] = v[0]; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = v[1]; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 1; - return out; -} -/** - * Copies the values from a mat2d into a mat3 - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat2d} a the matrix to copy - * @returns {mat3} out - **/ - -function fromMat2d(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = 0; - out[3] = a[2]; - out[4] = a[3]; - out[5] = 0; - out[6] = a[4]; - out[7] = a[5]; - out[8] = 1; - return out; -} -/** - * Calculates a 3x3 matrix from the given quaternion - * - * @param {mat3} out mat3 receiving operation result - * @param {ReadonlyQuat} q Quaternion to create matrix from - * - * @returns {mat3} out - */ - -function fromQuat(out, q) { - var x = q[0], - y = q[1], - z = q[2], - w = q[3]; - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - var xx = x * x2; - var yx = y * x2; - var yy = y * y2; - var zx = z * x2; - var zy = z * y2; - var zz = z * z2; - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - out[0] = 1 - yy - zz; - out[3] = yx - wz; - out[6] = zx + wy; - out[1] = yx + wz; - out[4] = 1 - xx - zz; - out[7] = zy - wx; - out[2] = zx - wy; - out[5] = zy + wx; - out[8] = 1 - xx - yy; - return out; -} -/** - * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix - * - * @param {mat3} out mat3 receiving operation result - * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from - * - * @returns {mat3} out - */ - -function normalFromMat4(out, a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7]; - var a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; - var a30 = a[12], - a31 = a[13], - a32 = a[14], - a33 = a[15]; - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; // Calculate the determinant - - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) { - return null; - } - - det = 1.0 / det; - out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - return out; -} -/** - * Generates a 2D projection matrix with the given bounds - * - * @param {mat3} out mat3 frustum matrix will be written into - * @param {number} width Width of your gl context - * @param {number} height Height of gl context - * @returns {mat3} out - */ - -function projection(out, width, height) { - out[0] = 2 / width; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = -2 / height; - out[5] = 0; - out[6] = -1; - out[7] = 1; - out[8] = 1; - return out; -} -/** - * Returns a string representation of a mat3 - * - * @param {ReadonlyMat3} a matrix to represent as a string - * @returns {String} string representation of the matrix - */ - -function str(a) { - return "mat3(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ")"; -} -/** - * Returns Frobenius norm of a mat3 - * - * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of - * @returns {Number} Frobenius norm - */ - -function frob(a) { - return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]); -} -/** - * Adds two mat3's - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the first operand - * @param {ReadonlyMat3} b the second operand - * @returns {mat3} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - out[4] = a[4] + b[4]; - out[5] = a[5] + b[5]; - out[6] = a[6] + b[6]; - out[7] = a[7] + b[7]; - out[8] = a[8] + b[8]; - return out; -} -/** - * Subtracts matrix b from matrix a - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the first operand - * @param {ReadonlyMat3} b the second operand - * @returns {mat3} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - out[3] = a[3] - b[3]; - out[4] = a[4] - b[4]; - out[5] = a[5] - b[5]; - out[6] = a[6] - b[6]; - out[7] = a[7] - b[7]; - out[8] = a[8] - b[8]; - return out; -} -/** - * Multiply each element of the matrix by a scalar. - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the matrix to scale - * @param {Number} b amount to scale the matrix's elements by - * @returns {mat3} out - */ - -function multiplyScalar(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - out[4] = a[4] * b; - out[5] = a[5] * b; - out[6] = a[6] * b; - out[7] = a[7] * b; - out[8] = a[8] * b; - return out; -} -/** - * Adds two mat3's after multiplying each element of the second operand by a scalar value. - * - * @param {mat3} out the receiving vector - * @param {ReadonlyMat3} a the first operand - * @param {ReadonlyMat3} b the second operand - * @param {Number} scale the amount to scale b's elements by before adding - * @returns {mat3} out - */ - -function multiplyScalarAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - out[3] = a[3] + b[3] * scale; - out[4] = a[4] + b[4] * scale; - out[5] = a[5] + b[5] * scale; - out[6] = a[6] + b[6] * scale; - out[7] = a[7] + b[7] * scale; - out[8] = a[8] + b[8] * scale; - return out; -} -/** - * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyMat3} a The first matrix. - * @param {ReadonlyMat3} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8]; -} -/** - * Returns whether or not the matrices have approximately the same elements in the same position. - * - * @param {ReadonlyMat3} a The first matrix. - * @param {ReadonlyMat3} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5], - a6 = a[6], - a7 = a[7], - a8 = a[8]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3], - b4 = b[4], - b5 = b[5], - b6 = b[6], - b7 = b[7], - b8 = b[8]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)); -} -/** - * Alias for {@link mat3.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link mat3.subtract} - * @function - */ - -var sub = subtract; - -/***/ }), -/* 17 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "transpose": () => (/* binding */ transpose), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "adjoint": () => (/* binding */ adjoint), -/* harmony export */ "determinant": () => (/* binding */ determinant), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "translate": () => (/* binding */ translate), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "rotate": () => (/* binding */ rotate), -/* harmony export */ "rotateX": () => (/* binding */ rotateX), -/* harmony export */ "rotateY": () => (/* binding */ rotateY), -/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), -/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), -/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), -/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), -/* harmony export */ "fromXRotation": () => (/* binding */ fromXRotation), -/* harmony export */ "fromYRotation": () => (/* binding */ fromYRotation), -/* harmony export */ "fromZRotation": () => (/* binding */ fromZRotation), -/* harmony export */ "fromRotationTranslation": () => (/* binding */ fromRotationTranslation), -/* harmony export */ "fromQuat2": () => (/* binding */ fromQuat2), -/* harmony export */ "getTranslation": () => (/* binding */ getTranslation), -/* harmony export */ "getScaling": () => (/* binding */ getScaling), -/* harmony export */ "getRotation": () => (/* binding */ getRotation), -/* harmony export */ "fromRotationTranslationScale": () => (/* binding */ fromRotationTranslationScale), -/* harmony export */ "fromRotationTranslationScaleOrigin": () => (/* binding */ fromRotationTranslationScaleOrigin), -/* harmony export */ "fromQuat": () => (/* binding */ fromQuat), -/* harmony export */ "frustum": () => (/* binding */ frustum), -/* harmony export */ "perspective": () => (/* binding */ perspective), -/* harmony export */ "perspectiveFromFieldOfView": () => (/* binding */ perspectiveFromFieldOfView), -/* harmony export */ "ortho": () => (/* binding */ ortho), -/* harmony export */ "lookAt": () => (/* binding */ lookAt), -/* harmony export */ "targetTo": () => (/* binding */ targetTo), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "frob": () => (/* binding */ frob), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), -/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "sub": () => (/* binding */ sub) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); - -/** - * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied. - * @module mat4 - */ - -/** - * Creates a new identity mat4 - * - * @returns {mat4} a new 4x4 matrix - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - } - - out[0] = 1; - out[5] = 1; - out[10] = 1; - out[15] = 1; - return out; -} -/** - * Creates a new mat4 initialized with values from an existing matrix - * - * @param {ReadonlyMat4} a matrix to clone - * @returns {mat4} a new 4x4 matrix - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - return out; -} -/** - * Copy the values from one mat4 to another - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the source matrix - * @returns {mat4} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - return out; -} -/** - * Create a new mat4 with the given values - * - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m02 Component in column 0, row 2 position (index 2) - * @param {Number} m03 Component in column 0, row 3 position (index 3) - * @param {Number} m10 Component in column 1, row 0 position (index 4) - * @param {Number} m11 Component in column 1, row 1 position (index 5) - * @param {Number} m12 Component in column 1, row 2 position (index 6) - * @param {Number} m13 Component in column 1, row 3 position (index 7) - * @param {Number} m20 Component in column 2, row 0 position (index 8) - * @param {Number} m21 Component in column 2, row 1 position (index 9) - * @param {Number} m22 Component in column 2, row 2 position (index 10) - * @param {Number} m23 Component in column 2, row 3 position (index 11) - * @param {Number} m30 Component in column 3, row 0 position (index 12) - * @param {Number} m31 Component in column 3, row 1 position (index 13) - * @param {Number} m32 Component in column 3, row 2 position (index 14) - * @param {Number} m33 Component in column 3, row 3 position (index 15) - * @returns {mat4} A new mat4 - */ - -function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); - out[0] = m00; - out[1] = m01; - out[2] = m02; - out[3] = m03; - out[4] = m10; - out[5] = m11; - out[6] = m12; - out[7] = m13; - out[8] = m20; - out[9] = m21; - out[10] = m22; - out[11] = m23; - out[12] = m30; - out[13] = m31; - out[14] = m32; - out[15] = m33; - return out; -} -/** - * Set the components of a mat4 to the given values - * - * @param {mat4} out the receiving matrix - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m02 Component in column 0, row 2 position (index 2) - * @param {Number} m03 Component in column 0, row 3 position (index 3) - * @param {Number} m10 Component in column 1, row 0 position (index 4) - * @param {Number} m11 Component in column 1, row 1 position (index 5) - * @param {Number} m12 Component in column 1, row 2 position (index 6) - * @param {Number} m13 Component in column 1, row 3 position (index 7) - * @param {Number} m20 Component in column 2, row 0 position (index 8) - * @param {Number} m21 Component in column 2, row 1 position (index 9) - * @param {Number} m22 Component in column 2, row 2 position (index 10) - * @param {Number} m23 Component in column 2, row 3 position (index 11) - * @param {Number} m30 Component in column 3, row 0 position (index 12) - * @param {Number} m31 Component in column 3, row 1 position (index 13) - * @param {Number} m32 Component in column 3, row 2 position (index 14) - * @param {Number} m33 Component in column 3, row 3 position (index 15) - * @returns {mat4} out - */ - -function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { - out[0] = m00; - out[1] = m01; - out[2] = m02; - out[3] = m03; - out[4] = m10; - out[5] = m11; - out[6] = m12; - out[7] = m13; - out[8] = m20; - out[9] = m21; - out[10] = m22; - out[11] = m23; - out[12] = m30; - out[13] = m31; - out[14] = m32; - out[15] = m33; - return out; -} -/** - * Set a mat4 to the identity matrix - * - * @param {mat4} out the receiving matrix - * @returns {mat4} out - */ - -function identity(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Transpose the values of a mat4 - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the source matrix - * @returns {mat4} out - */ - -function transpose(out, a) { - // If we are transposing ourselves we can skip a few steps but have to cache some values - if (out === a) { - var a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a12 = a[6], - a13 = a[7]; - var a23 = a[11]; - out[1] = a[4]; - out[2] = a[8]; - out[3] = a[12]; - out[4] = a01; - out[6] = a[9]; - out[7] = a[13]; - out[8] = a02; - out[9] = a12; - out[11] = a[14]; - out[12] = a03; - out[13] = a13; - out[14] = a23; - } else { - out[0] = a[0]; - out[1] = a[4]; - out[2] = a[8]; - out[3] = a[12]; - out[4] = a[1]; - out[5] = a[5]; - out[6] = a[9]; - out[7] = a[13]; - out[8] = a[2]; - out[9] = a[6]; - out[10] = a[10]; - out[11] = a[14]; - out[12] = a[3]; - out[13] = a[7]; - out[14] = a[11]; - out[15] = a[15]; - } - - return out; -} -/** - * Inverts a mat4 - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the source matrix - * @returns {mat4} out - */ - -function invert(out, a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7]; - var a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; - var a30 = a[12], - a31 = a[13], - a32 = a[14], - a33 = a[15]; - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; // Calculate the determinant - - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) { - return null; - } - - det = 1.0 / det; - out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; - out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; - out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; - out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; - out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; - out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; - out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; - return out; -} -/** - * Calculates the adjugate of a mat4 - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the source matrix - * @returns {mat4} out - */ - -function adjoint(out, a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7]; - var a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; - var a30 = a[12], - a31 = a[13], - a32 = a[14], - a33 = a[15]; - out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22); - out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); - out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12); - out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); - out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); - out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22); - out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); - out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12); - out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21); - out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); - out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11); - out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); - out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); - out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21); - out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); - out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11); - return out; -} -/** - * Calculates the determinant of a mat4 - * - * @param {ReadonlyMat4} a the source matrix - * @returns {Number} determinant of a - */ - -function determinant(a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7]; - var a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; - var a30 = a[12], - a31 = a[13], - a32 = a[14], - a33 = a[15]; - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; // Calculate the determinant - - return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; -} -/** - * Multiplies two mat4s - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the first operand - * @param {ReadonlyMat4} b the second operand - * @returns {mat4} out - */ - -function multiply(out, a, b) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7]; - var a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; - var a30 = a[12], - a31 = a[13], - a32 = a[14], - a33 = a[15]; // Cache only the current line of the second matrix - - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3]; - out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - b0 = b[4]; - b1 = b[5]; - b2 = b[6]; - b3 = b[7]; - out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - b0 = b[8]; - b1 = b[9]; - b2 = b[10]; - b3 = b[11]; - out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - b0 = b[12]; - b1 = b[13]; - b2 = b[14]; - b3 = b[15]; - out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - return out; -} -/** - * Translate a mat4 by the given vector - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to translate - * @param {ReadonlyVec3} v vector to translate by - * @returns {mat4} out - */ - -function translate(out, a, v) { - var x = v[0], - y = v[1], - z = v[2]; - var a00, a01, a02, a03; - var a10, a11, a12, a13; - var a20, a21, a22, a23; - - if (a === out) { - out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - } else { - a00 = a[0]; - a01 = a[1]; - a02 = a[2]; - a03 = a[3]; - a10 = a[4]; - a11 = a[5]; - a12 = a[6]; - a13 = a[7]; - a20 = a[8]; - a21 = a[9]; - a22 = a[10]; - a23 = a[11]; - out[0] = a00; - out[1] = a01; - out[2] = a02; - out[3] = a03; - out[4] = a10; - out[5] = a11; - out[6] = a12; - out[7] = a13; - out[8] = a20; - out[9] = a21; - out[10] = a22; - out[11] = a23; - out[12] = a00 * x + a10 * y + a20 * z + a[12]; - out[13] = a01 * x + a11 * y + a21 * z + a[13]; - out[14] = a02 * x + a12 * y + a22 * z + a[14]; - out[15] = a03 * x + a13 * y + a23 * z + a[15]; - } - - return out; -} -/** - * Scales the mat4 by the dimensions in the given vec3 not using vectorization - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to scale - * @param {ReadonlyVec3} v the vec3 to scale the matrix by - * @returns {mat4} out - **/ - -function scale(out, a, v) { - var x = v[0], - y = v[1], - z = v[2]; - out[0] = a[0] * x; - out[1] = a[1] * x; - out[2] = a[2] * x; - out[3] = a[3] * x; - out[4] = a[4] * y; - out[5] = a[5] * y; - out[6] = a[6] * y; - out[7] = a[7] * y; - out[8] = a[8] * z; - out[9] = a[9] * z; - out[10] = a[10] * z; - out[11] = a[11] * z; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - return out; -} -/** - * Rotates a mat4 by the given angle around the given axis - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @param {ReadonlyVec3} axis the axis to rotate around - * @returns {mat4} out - */ - -function rotate(out, a, rad, axis) { - var x = axis[0], - y = axis[1], - z = axis[2]; - var len = Math.hypot(x, y, z); - var s, c, t; - var a00, a01, a02, a03; - var a10, a11, a12, a13; - var a20, a21, a22, a23; - var b00, b01, b02; - var b10, b11, b12; - var b20, b21, b22; - - if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - return null; - } - - len = 1 / len; - x *= len; - y *= len; - z *= len; - s = Math.sin(rad); - c = Math.cos(rad); - t = 1 - c; - a00 = a[0]; - a01 = a[1]; - a02 = a[2]; - a03 = a[3]; - a10 = a[4]; - a11 = a[5]; - a12 = a[6]; - a13 = a[7]; - a20 = a[8]; - a21 = a[9]; - a22 = a[10]; - a23 = a[11]; // Construct the elements of the rotation matrix - - b00 = x * x * t + c; - b01 = y * x * t + z * s; - b02 = z * x * t - y * s; - b10 = x * y * t - z * s; - b11 = y * y * t + c; - b12 = z * y * t + x * s; - b20 = x * z * t + y * s; - b21 = y * z * t - x * s; - b22 = z * z * t + c; // Perform rotation-specific matrix multiplication - - out[0] = a00 * b00 + a10 * b01 + a20 * b02; - out[1] = a01 * b00 + a11 * b01 + a21 * b02; - out[2] = a02 * b00 + a12 * b01 + a22 * b02; - out[3] = a03 * b00 + a13 * b01 + a23 * b02; - out[4] = a00 * b10 + a10 * b11 + a20 * b12; - out[5] = a01 * b10 + a11 * b11 + a21 * b12; - out[6] = a02 * b10 + a12 * b11 + a22 * b12; - out[7] = a03 * b10 + a13 * b11 + a23 * b12; - out[8] = a00 * b20 + a10 * b21 + a20 * b22; - out[9] = a01 * b20 + a11 * b21 + a21 * b22; - out[10] = a02 * b20 + a12 * b21 + a22 * b22; - out[11] = a03 * b20 + a13 * b21 + a23 * b22; - - if (a !== out) { - // If the source and destination differ, copy the unchanged last row - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - } - - return out; -} -/** - * Rotates a matrix by the given angle around the X axis - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function rotateX(out, a, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - if (a !== out) { - // If the source and destination differ, copy the unchanged rows - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - } // Perform axis-specific matrix multiplication - - - out[4] = a10 * c + a20 * s; - out[5] = a11 * c + a21 * s; - out[6] = a12 * c + a22 * s; - out[7] = a13 * c + a23 * s; - out[8] = a20 * c - a10 * s; - out[9] = a21 * c - a11 * s; - out[10] = a22 * c - a12 * s; - out[11] = a23 * c - a13 * s; - return out; -} -/** - * Rotates a matrix by the given angle around the Y axis - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function rotateY(out, a, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - if (a !== out) { - // If the source and destination differ, copy the unchanged rows - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - } // Perform axis-specific matrix multiplication - - - out[0] = a00 * c - a20 * s; - out[1] = a01 * c - a21 * s; - out[2] = a02 * c - a22 * s; - out[3] = a03 * c - a23 * s; - out[8] = a00 * s + a20 * c; - out[9] = a01 * s + a21 * c; - out[10] = a02 * s + a22 * c; - out[11] = a03 * s + a23 * c; - return out; -} -/** - * Rotates a matrix by the given angle around the Z axis - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function rotateZ(out, a, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - if (a !== out) { - // If the source and destination differ, copy the unchanged last row - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - } // Perform axis-specific matrix multiplication - - - out[0] = a00 * c + a10 * s; - out[1] = a01 * c + a11 * s; - out[2] = a02 * c + a12 * s; - out[3] = a03 * c + a13 * s; - out[4] = a10 * c - a00 * s; - out[5] = a11 * c - a01 * s; - out[6] = a12 * c - a02 * s; - out[7] = a13 * c - a03 * s; - return out; -} -/** - * Creates a matrix from a vector translation - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, dest, vec); - * - * @param {mat4} out mat4 receiving operation result - * @param {ReadonlyVec3} v Translation vector - * @returns {mat4} out - */ - -function fromTranslation(out, v) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = v[0]; - out[13] = v[1]; - out[14] = v[2]; - out[15] = 1; - return out; -} -/** - * Creates a matrix from a vector scaling - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.scale(dest, dest, vec); - * - * @param {mat4} out mat4 receiving operation result - * @param {ReadonlyVec3} v Scaling vector - * @returns {mat4} out - */ - -function fromScaling(out, v) { - out[0] = v[0]; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = v[1]; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = v[2]; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Creates a matrix from a given angle around a given axis - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotate(dest, dest, rad, axis); - * - * @param {mat4} out mat4 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @param {ReadonlyVec3} axis the axis to rotate around - * @returns {mat4} out - */ - -function fromRotation(out, rad, axis) { - var x = axis[0], - y = axis[1], - z = axis[2]; - var len = Math.hypot(x, y, z); - var s, c, t; - - if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - return null; - } - - len = 1 / len; - x *= len; - y *= len; - z *= len; - s = Math.sin(rad); - c = Math.cos(rad); - t = 1 - c; // Perform rotation-specific matrix multiplication - - out[0] = x * x * t + c; - out[1] = y * x * t + z * s; - out[2] = z * x * t - y * s; - out[3] = 0; - out[4] = x * y * t - z * s; - out[5] = y * y * t + c; - out[6] = z * y * t + x * s; - out[7] = 0; - out[8] = x * z * t + y * s; - out[9] = y * z * t - x * s; - out[10] = z * z * t + c; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Creates a matrix from the given angle around the X axis - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateX(dest, dest, rad); - * - * @param {mat4} out mat4 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function fromXRotation(out, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); // Perform axis-specific matrix multiplication - - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = c; - out[6] = s; - out[7] = 0; - out[8] = 0; - out[9] = -s; - out[10] = c; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Creates a matrix from the given angle around the Y axis - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateY(dest, dest, rad); - * - * @param {mat4} out mat4 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function fromYRotation(out, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); // Perform axis-specific matrix multiplication - - out[0] = c; - out[1] = 0; - out[2] = -s; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = s; - out[9] = 0; - out[10] = c; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Creates a matrix from the given angle around the Z axis - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateZ(dest, dest, rad); - * - * @param {mat4} out mat4 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function fromZRotation(out, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); // Perform axis-specific matrix multiplication - - out[0] = c; - out[1] = s; - out[2] = 0; - out[3] = 0; - out[4] = -s; - out[5] = c; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Creates a matrix from a quaternion rotation and vector translation - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * - * @param {mat4} out mat4 receiving operation result - * @param {quat4} q Rotation quaternion - * @param {ReadonlyVec3} v Translation vector - * @returns {mat4} out - */ - -function fromRotationTranslation(out, q, v) { - // Quaternion math - var x = q[0], - y = q[1], - z = q[2], - w = q[3]; - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - out[0] = 1 - (yy + zz); - out[1] = xy + wz; - out[2] = xz - wy; - out[3] = 0; - out[4] = xy - wz; - out[5] = 1 - (xx + zz); - out[6] = yz + wx; - out[7] = 0; - out[8] = xz + wy; - out[9] = yz - wx; - out[10] = 1 - (xx + yy); - out[11] = 0; - out[12] = v[0]; - out[13] = v[1]; - out[14] = v[2]; - out[15] = 1; - return out; -} -/** - * Creates a new mat4 from a dual quat. - * - * @param {mat4} out Matrix - * @param {ReadonlyQuat2} a Dual Quaternion - * @returns {mat4} mat4 receiving operation result - */ - -function fromQuat2(out, a) { - var translation = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - var bx = -a[0], - by = -a[1], - bz = -a[2], - bw = a[3], - ax = a[4], - ay = a[5], - az = a[6], - aw = a[7]; - var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense - - if (magnitude > 0) { - translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude; - translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude; - translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude; - } else { - translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; - translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; - translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; - } - - fromRotationTranslation(out, a, translation); - return out; -} -/** - * Returns the translation vector component of a transformation - * matrix. If a matrix is built with fromRotationTranslation, - * the returned vector will be the same as the translation vector - * originally supplied. - * @param {vec3} out Vector to receive translation component - * @param {ReadonlyMat4} mat Matrix to be decomposed (input) - * @return {vec3} out - */ - -function getTranslation(out, mat) { - out[0] = mat[12]; - out[1] = mat[13]; - out[2] = mat[14]; - return out; -} -/** - * Returns the scaling factor component of a transformation - * matrix. If a matrix is built with fromRotationTranslationScale - * with a normalized Quaternion paramter, the returned vector will be - * the same as the scaling vector - * originally supplied. - * @param {vec3} out Vector to receive scaling factor component - * @param {ReadonlyMat4} mat Matrix to be decomposed (input) - * @return {vec3} out - */ - -function getScaling(out, mat) { - var m11 = mat[0]; - var m12 = mat[1]; - var m13 = mat[2]; - var m21 = mat[4]; - var m22 = mat[5]; - var m23 = mat[6]; - var m31 = mat[8]; - var m32 = mat[9]; - var m33 = mat[10]; - out[0] = Math.hypot(m11, m12, m13); - out[1] = Math.hypot(m21, m22, m23); - out[2] = Math.hypot(m31, m32, m33); - return out; -} -/** - * Returns a quaternion representing the rotational component - * of a transformation matrix. If a matrix is built with - * fromRotationTranslation, the returned quaternion will be the - * same as the quaternion originally supplied. - * @param {quat} out Quaternion to receive the rotation component - * @param {ReadonlyMat4} mat Matrix to be decomposed (input) - * @return {quat} out - */ - -function getRotation(out, mat) { - var scaling = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - getScaling(scaling, mat); - var is1 = 1 / scaling[0]; - var is2 = 1 / scaling[1]; - var is3 = 1 / scaling[2]; - var sm11 = mat[0] * is1; - var sm12 = mat[1] * is2; - var sm13 = mat[2] * is3; - var sm21 = mat[4] * is1; - var sm22 = mat[5] * is2; - var sm23 = mat[6] * is3; - var sm31 = mat[8] * is1; - var sm32 = mat[9] * is2; - var sm33 = mat[10] * is3; - var trace = sm11 + sm22 + sm33; - var S = 0; - - if (trace > 0) { - S = Math.sqrt(trace + 1.0) * 2; - out[3] = 0.25 * S; - out[0] = (sm23 - sm32) / S; - out[1] = (sm31 - sm13) / S; - out[2] = (sm12 - sm21) / S; - } else if (sm11 > sm22 && sm11 > sm33) { - S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2; - out[3] = (sm23 - sm32) / S; - out[0] = 0.25 * S; - out[1] = (sm12 + sm21) / S; - out[2] = (sm31 + sm13) / S; - } else if (sm22 > sm33) { - S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2; - out[3] = (sm31 - sm13) / S; - out[0] = (sm12 + sm21) / S; - out[1] = 0.25 * S; - out[2] = (sm23 + sm32) / S; - } else { - S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2; - out[3] = (sm12 - sm21) / S; - out[0] = (sm31 + sm13) / S; - out[1] = (sm23 + sm32) / S; - out[2] = 0.25 * S; - } - - return out; -} -/** - * Creates a matrix from a quaternion rotation, vector translation and vector scale - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale) - * - * @param {mat4} out mat4 receiving operation result - * @param {quat4} q Rotation quaternion - * @param {ReadonlyVec3} v Translation vector - * @param {ReadonlyVec3} s Scaling vector - * @returns {mat4} out - */ - -function fromRotationTranslationScale(out, q, v, s) { - // Quaternion math - var x = q[0], - y = q[1], - z = q[2], - w = q[3]; - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - var sx = s[0]; - var sy = s[1]; - var sz = s[2]; - out[0] = (1 - (yy + zz)) * sx; - out[1] = (xy + wz) * sx; - out[2] = (xz - wy) * sx; - out[3] = 0; - out[4] = (xy - wz) * sy; - out[5] = (1 - (xx + zz)) * sy; - out[6] = (yz + wx) * sy; - out[7] = 0; - out[8] = (xz + wy) * sz; - out[9] = (yz - wx) * sz; - out[10] = (1 - (xx + yy)) * sz; - out[11] = 0; - out[12] = v[0]; - out[13] = v[1]; - out[14] = v[2]; - out[15] = 1; - return out; -} -/** - * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * mat4.translate(dest, origin); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale) - * mat4.translate(dest, negativeOrigin); - * - * @param {mat4} out mat4 receiving operation result - * @param {quat4} q Rotation quaternion - * @param {ReadonlyVec3} v Translation vector - * @param {ReadonlyVec3} s Scaling vector - * @param {ReadonlyVec3} o The origin vector around which to scale and rotate - * @returns {mat4} out - */ - -function fromRotationTranslationScaleOrigin(out, q, v, s, o) { - // Quaternion math - var x = q[0], - y = q[1], - z = q[2], - w = q[3]; - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - var sx = s[0]; - var sy = s[1]; - var sz = s[2]; - var ox = o[0]; - var oy = o[1]; - var oz = o[2]; - var out0 = (1 - (yy + zz)) * sx; - var out1 = (xy + wz) * sx; - var out2 = (xz - wy) * sx; - var out4 = (xy - wz) * sy; - var out5 = (1 - (xx + zz)) * sy; - var out6 = (yz + wx) * sy; - var out8 = (xz + wy) * sz; - var out9 = (yz - wx) * sz; - var out10 = (1 - (xx + yy)) * sz; - out[0] = out0; - out[1] = out1; - out[2] = out2; - out[3] = 0; - out[4] = out4; - out[5] = out5; - out[6] = out6; - out[7] = 0; - out[8] = out8; - out[9] = out9; - out[10] = out10; - out[11] = 0; - out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz); - out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz); - out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz); - out[15] = 1; - return out; -} -/** - * Calculates a 4x4 matrix from the given quaternion - * - * @param {mat4} out mat4 receiving operation result - * @param {ReadonlyQuat} q Quaternion to create matrix from - * - * @returns {mat4} out - */ - -function fromQuat(out, q) { - var x = q[0], - y = q[1], - z = q[2], - w = q[3]; - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - var xx = x * x2; - var yx = y * x2; - var yy = y * y2; - var zx = z * x2; - var zy = z * y2; - var zz = z * z2; - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - out[0] = 1 - yy - zz; - out[1] = yx + wz; - out[2] = zx - wy; - out[3] = 0; - out[4] = yx - wz; - out[5] = 1 - xx - zz; - out[6] = zy + wx; - out[7] = 0; - out[8] = zx + wy; - out[9] = zy - wx; - out[10] = 1 - xx - yy; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Generates a frustum matrix with the given bounds - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {Number} left Left bound of the frustum - * @param {Number} right Right bound of the frustum - * @param {Number} bottom Bottom bound of the frustum - * @param {Number} top Top bound of the frustum - * @param {Number} near Near bound of the frustum - * @param {Number} far Far bound of the frustum - * @returns {mat4} out - */ - -function frustum(out, left, right, bottom, top, near, far) { - var rl = 1 / (right - left); - var tb = 1 / (top - bottom); - var nf = 1 / (near - far); - out[0] = near * 2 * rl; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = near * 2 * tb; - out[6] = 0; - out[7] = 0; - out[8] = (right + left) * rl; - out[9] = (top + bottom) * tb; - out[10] = (far + near) * nf; - out[11] = -1; - out[12] = 0; - out[13] = 0; - out[14] = far * near * 2 * nf; - out[15] = 0; - return out; -} -/** - * Generates a perspective projection matrix with the given bounds. - * Passing null/undefined/no value for far will generate infinite projection matrix. - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {number} fovy Vertical field of view in radians - * @param {number} aspect Aspect ratio. typically viewport width/height - * @param {number} near Near bound of the frustum - * @param {number} far Far bound of the frustum, can be null or Infinity - * @returns {mat4} out - */ - -function perspective(out, fovy, aspect, near, far) { - var f = 1.0 / Math.tan(fovy / 2), - nf; - out[0] = f / aspect; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = f; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[11] = -1; - out[12] = 0; - out[13] = 0; - out[15] = 0; - - if (far != null && far !== Infinity) { - nf = 1 / (near - far); - out[10] = (far + near) * nf; - out[14] = 2 * far * near * nf; - } else { - out[10] = -1; - out[14] = -2 * near; - } - - return out; -} -/** - * Generates a perspective projection matrix with the given field of view. - * This is primarily useful for generating projection matrices to be used - * with the still experiemental WebVR API. - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees - * @param {number} near Near bound of the frustum - * @param {number} far Far bound of the frustum - * @returns {mat4} out - */ - -function perspectiveFromFieldOfView(out, fov, near, far) { - var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0); - var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0); - var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0); - var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0); - var xScale = 2.0 / (leftTan + rightTan); - var yScale = 2.0 / (upTan + downTan); - out[0] = xScale; - out[1] = 0.0; - out[2] = 0.0; - out[3] = 0.0; - out[4] = 0.0; - out[5] = yScale; - out[6] = 0.0; - out[7] = 0.0; - out[8] = -((leftTan - rightTan) * xScale * 0.5); - out[9] = (upTan - downTan) * yScale * 0.5; - out[10] = far / (near - far); - out[11] = -1.0; - out[12] = 0.0; - out[13] = 0.0; - out[14] = far * near / (near - far); - out[15] = 0.0; - return out; -} -/** - * Generates a orthogonal projection matrix with the given bounds - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {number} left Left bound of the frustum - * @param {number} right Right bound of the frustum - * @param {number} bottom Bottom bound of the frustum - * @param {number} top Top bound of the frustum - * @param {number} near Near bound of the frustum - * @param {number} far Far bound of the frustum - * @returns {mat4} out - */ - -function ortho(out, left, right, bottom, top, near, far) { - var lr = 1 / (left - right); - var bt = 1 / (bottom - top); - var nf = 1 / (near - far); - out[0] = -2 * lr; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = -2 * bt; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 2 * nf; - out[11] = 0; - out[12] = (left + right) * lr; - out[13] = (top + bottom) * bt; - out[14] = (far + near) * nf; - out[15] = 1; - return out; -} -/** - * Generates a look-at matrix with the given eye position, focal point, and up axis. - * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {ReadonlyVec3} eye Position of the viewer - * @param {ReadonlyVec3} center Point the viewer is looking at - * @param {ReadonlyVec3} up vec3 pointing up - * @returns {mat4} out - */ - -function lookAt(out, eye, center, up) { - var x0, x1, x2, y0, y1, y2, z0, z1, z2, len; - var eyex = eye[0]; - var eyey = eye[1]; - var eyez = eye[2]; - var upx = up[0]; - var upy = up[1]; - var upz = up[2]; - var centerx = center[0]; - var centery = center[1]; - var centerz = center[2]; - - if (Math.abs(eyex - centerx) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON && Math.abs(eyey - centery) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON && Math.abs(eyez - centerz) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - return identity(out); - } - - z0 = eyex - centerx; - z1 = eyey - centery; - z2 = eyez - centerz; - len = 1 / Math.hypot(z0, z1, z2); - z0 *= len; - z1 *= len; - z2 *= len; - x0 = upy * z2 - upz * z1; - x1 = upz * z0 - upx * z2; - x2 = upx * z1 - upy * z0; - len = Math.hypot(x0, x1, x2); - - if (!len) { - x0 = 0; - x1 = 0; - x2 = 0; - } else { - len = 1 / len; - x0 *= len; - x1 *= len; - x2 *= len; - } - - y0 = z1 * x2 - z2 * x1; - y1 = z2 * x0 - z0 * x2; - y2 = z0 * x1 - z1 * x0; - len = Math.hypot(y0, y1, y2); - - if (!len) { - y0 = 0; - y1 = 0; - y2 = 0; - } else { - len = 1 / len; - y0 *= len; - y1 *= len; - y2 *= len; - } - - out[0] = x0; - out[1] = y0; - out[2] = z0; - out[3] = 0; - out[4] = x1; - out[5] = y1; - out[6] = z1; - out[7] = 0; - out[8] = x2; - out[9] = y2; - out[10] = z2; - out[11] = 0; - out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); - out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); - out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); - out[15] = 1; - return out; -} -/** - * Generates a matrix that makes something look at something else. - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {ReadonlyVec3} eye Position of the viewer - * @param {ReadonlyVec3} center Point the viewer is looking at - * @param {ReadonlyVec3} up vec3 pointing up - * @returns {mat4} out - */ - -function targetTo(out, eye, target, up) { - var eyex = eye[0], - eyey = eye[1], - eyez = eye[2], - upx = up[0], - upy = up[1], - upz = up[2]; - var z0 = eyex - target[0], - z1 = eyey - target[1], - z2 = eyez - target[2]; - var len = z0 * z0 + z1 * z1 + z2 * z2; - - if (len > 0) { - len = 1 / Math.sqrt(len); - z0 *= len; - z1 *= len; - z2 *= len; - } - - var x0 = upy * z2 - upz * z1, - x1 = upz * z0 - upx * z2, - x2 = upx * z1 - upy * z0; - len = x0 * x0 + x1 * x1 + x2 * x2; - - if (len > 0) { - len = 1 / Math.sqrt(len); - x0 *= len; - x1 *= len; - x2 *= len; - } - - out[0] = x0; - out[1] = x1; - out[2] = x2; - out[3] = 0; - out[4] = z1 * x2 - z2 * x1; - out[5] = z2 * x0 - z0 * x2; - out[6] = z0 * x1 - z1 * x0; - out[7] = 0; - out[8] = z0; - out[9] = z1; - out[10] = z2; - out[11] = 0; - out[12] = eyex; - out[13] = eyey; - out[14] = eyez; - out[15] = 1; - return out; -} -/** - * Returns a string representation of a mat4 - * - * @param {ReadonlyMat4} a matrix to represent as a string - * @returns {String} string representation of the matrix - */ - -function str(a) { - return "mat4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ", " + a[9] + ", " + a[10] + ", " + a[11] + ", " + a[12] + ", " + a[13] + ", " + a[14] + ", " + a[15] + ")"; -} -/** - * Returns Frobenius norm of a mat4 - * - * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of - * @returns {Number} Frobenius norm - */ - -function frob(a) { - return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); -} -/** - * Adds two mat4's - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the first operand - * @param {ReadonlyMat4} b the second operand - * @returns {mat4} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - out[4] = a[4] + b[4]; - out[5] = a[5] + b[5]; - out[6] = a[6] + b[6]; - out[7] = a[7] + b[7]; - out[8] = a[8] + b[8]; - out[9] = a[9] + b[9]; - out[10] = a[10] + b[10]; - out[11] = a[11] + b[11]; - out[12] = a[12] + b[12]; - out[13] = a[13] + b[13]; - out[14] = a[14] + b[14]; - out[15] = a[15] + b[15]; - return out; -} -/** - * Subtracts matrix b from matrix a - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the first operand - * @param {ReadonlyMat4} b the second operand - * @returns {mat4} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - out[3] = a[3] - b[3]; - out[4] = a[4] - b[4]; - out[5] = a[5] - b[5]; - out[6] = a[6] - b[6]; - out[7] = a[7] - b[7]; - out[8] = a[8] - b[8]; - out[9] = a[9] - b[9]; - out[10] = a[10] - b[10]; - out[11] = a[11] - b[11]; - out[12] = a[12] - b[12]; - out[13] = a[13] - b[13]; - out[14] = a[14] - b[14]; - out[15] = a[15] - b[15]; - return out; -} -/** - * Multiply each element of the matrix by a scalar. - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to scale - * @param {Number} b amount to scale the matrix's elements by - * @returns {mat4} out - */ - -function multiplyScalar(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - out[4] = a[4] * b; - out[5] = a[5] * b; - out[6] = a[6] * b; - out[7] = a[7] * b; - out[8] = a[8] * b; - out[9] = a[9] * b; - out[10] = a[10] * b; - out[11] = a[11] * b; - out[12] = a[12] * b; - out[13] = a[13] * b; - out[14] = a[14] * b; - out[15] = a[15] * b; - return out; -} -/** - * Adds two mat4's after multiplying each element of the second operand by a scalar value. - * - * @param {mat4} out the receiving vector - * @param {ReadonlyMat4} a the first operand - * @param {ReadonlyMat4} b the second operand - * @param {Number} scale the amount to scale b's elements by before adding - * @returns {mat4} out - */ - -function multiplyScalarAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - out[3] = a[3] + b[3] * scale; - out[4] = a[4] + b[4] * scale; - out[5] = a[5] + b[5] * scale; - out[6] = a[6] + b[6] * scale; - out[7] = a[7] + b[7] * scale; - out[8] = a[8] + b[8] * scale; - out[9] = a[9] + b[9] * scale; - out[10] = a[10] + b[10] * scale; - out[11] = a[11] + b[11] * scale; - out[12] = a[12] + b[12] * scale; - out[13] = a[13] + b[13] * scale; - out[14] = a[14] + b[14] * scale; - out[15] = a[15] + b[15] * scale; - return out; -} -/** - * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyMat4} a The first matrix. - * @param {ReadonlyMat4} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15]; -} -/** - * Returns whether or not the matrices have approximately the same elements in the same position. - * - * @param {ReadonlyMat4} a The first matrix. - * @param {ReadonlyMat4} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var a4 = a[4], - a5 = a[5], - a6 = a[6], - a7 = a[7]; - var a8 = a[8], - a9 = a[9], - a10 = a[10], - a11 = a[11]; - var a12 = a[12], - a13 = a[13], - a14 = a[14], - a15 = a[15]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3]; - var b4 = b[4], - b5 = b[5], - b6 = b[6], - b7 = b[7]; - var b8 = b[8], - b9 = b[9], - b10 = b[10], - b11 = b[11]; - var b12 = b[12], - b13 = b[13], - b14 = b[14], - b15 = b[15]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15)); -} -/** - * Alias for {@link mat4.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link mat4.subtract} - * @function - */ - -var sub = subtract; - -/***/ }), -/* 18 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "setAxisAngle": () => (/* binding */ setAxisAngle), -/* harmony export */ "getAxisAngle": () => (/* binding */ getAxisAngle), -/* harmony export */ "getAngle": () => (/* binding */ getAngle), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "rotateX": () => (/* binding */ rotateX), -/* harmony export */ "rotateY": () => (/* binding */ rotateY), -/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), -/* harmony export */ "calculateW": () => (/* binding */ calculateW), -/* harmony export */ "exp": () => (/* binding */ exp), -/* harmony export */ "ln": () => (/* binding */ ln), -/* harmony export */ "pow": () => (/* binding */ pow), -/* harmony export */ "slerp": () => (/* binding */ slerp), -/* harmony export */ "random": () => (/* binding */ random), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "conjugate": () => (/* binding */ conjugate), -/* harmony export */ "fromMat3": () => (/* binding */ fromMat3), -/* harmony export */ "fromEuler": () => (/* binding */ fromEuler), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "dot": () => (/* binding */ dot), -/* harmony export */ "lerp": () => (/* binding */ lerp), -/* harmony export */ "length": () => (/* binding */ length), -/* harmony export */ "len": () => (/* binding */ len), -/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), -/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), -/* harmony export */ "normalize": () => (/* binding */ normalize), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "rotationTo": () => (/* binding */ rotationTo), -/* harmony export */ "sqlerp": () => (/* binding */ sqlerp), -/* harmony export */ "setAxes": () => (/* binding */ setAxes) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); -/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16); -/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20); -/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19); - - - - -/** - * Quaternion - * @module quat - */ - -/** - * Creates a new identity quat - * - * @returns {quat} a new quaternion - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - } - - out[3] = 1; - return out; -} -/** - * Set a quat to the identity quaternion - * - * @param {quat} out the receiving quaternion - * @returns {quat} out - */ - -function identity(out) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 1; - return out; -} -/** - * Sets a quat from the given angle and rotation axis, - * then returns it. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyVec3} axis the axis around which to rotate - * @param {Number} rad the angle in radians - * @returns {quat} out - **/ - -function setAxisAngle(out, axis, rad) { - rad = rad * 0.5; - var s = Math.sin(rad); - out[0] = s * axis[0]; - out[1] = s * axis[1]; - out[2] = s * axis[2]; - out[3] = Math.cos(rad); - return out; -} -/** - * Gets the rotation axis and angle for a given - * quaternion. If a quaternion is created with - * setAxisAngle, this method will return the same - * values as providied in the original parameter list - * OR functionally equivalent values. - * Example: The quaternion formed by axis [0, 0, 1] and - * angle -90 is the same as the quaternion formed by - * [0, 0, 1] and 270. This method favors the latter. - * @param {vec3} out_axis Vector receiving the axis of rotation - * @param {ReadonlyQuat} q Quaternion to be decomposed - * @return {Number} Angle, in radians, of the rotation - */ - -function getAxisAngle(out_axis, q) { - var rad = Math.acos(q[3]) * 2.0; - var s = Math.sin(rad / 2.0); - - if (s > _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - out_axis[0] = q[0] / s; - out_axis[1] = q[1] / s; - out_axis[2] = q[2] / s; - } else { - // If s is zero, return any axis (no rotation - axis does not matter) - out_axis[0] = 1; - out_axis[1] = 0; - out_axis[2] = 0; - } - - return rad; -} -/** - * Gets the angular distance between two unit quaternions - * - * @param {ReadonlyQuat} a Origin unit quaternion - * @param {ReadonlyQuat} b Destination unit quaternion - * @return {Number} Angle, in radians, between the two quaternions - */ - -function getAngle(a, b) { - var dotproduct = dot(a, b); - return Math.acos(2 * dotproduct * dotproduct - 1); -} -/** - * Multiplies two quat's - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @returns {quat} out - */ - -function multiply(out, a, b) { - var ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - var bx = b[0], - by = b[1], - bz = b[2], - bw = b[3]; - out[0] = ax * bw + aw * bx + ay * bz - az * by; - out[1] = ay * bw + aw * by + az * bx - ax * bz; - out[2] = az * bw + aw * bz + ax * by - ay * bx; - out[3] = aw * bw - ax * bx - ay * by - az * bz; - return out; -} -/** - * Rotates a quaternion by the given angle about the X axis - * - * @param {quat} out quat receiving operation result - * @param {ReadonlyQuat} a quat to rotate - * @param {number} rad angle (in radians) to rotate - * @returns {quat} out - */ - -function rotateX(out, a, rad) { - rad *= 0.5; - var ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - var bx = Math.sin(rad), - bw = Math.cos(rad); - out[0] = ax * bw + aw * bx; - out[1] = ay * bw + az * bx; - out[2] = az * bw - ay * bx; - out[3] = aw * bw - ax * bx; - return out; -} -/** - * Rotates a quaternion by the given angle about the Y axis - * - * @param {quat} out quat receiving operation result - * @param {ReadonlyQuat} a quat to rotate - * @param {number} rad angle (in radians) to rotate - * @returns {quat} out - */ - -function rotateY(out, a, rad) { - rad *= 0.5; - var ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - var by = Math.sin(rad), - bw = Math.cos(rad); - out[0] = ax * bw - az * by; - out[1] = ay * bw + aw * by; - out[2] = az * bw + ax * by; - out[3] = aw * bw - ay * by; - return out; -} -/** - * Rotates a quaternion by the given angle about the Z axis - * - * @param {quat} out quat receiving operation result - * @param {ReadonlyQuat} a quat to rotate - * @param {number} rad angle (in radians) to rotate - * @returns {quat} out - */ - -function rotateZ(out, a, rad) { - rad *= 0.5; - var ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - var bz = Math.sin(rad), - bw = Math.cos(rad); - out[0] = ax * bw + ay * bz; - out[1] = ay * bw - ax * bz; - out[2] = az * bw + aw * bz; - out[3] = aw * bw - az * bz; - return out; -} -/** - * Calculates the W component of a quat from the X, Y, and Z components. - * Assumes that quaternion is 1 unit in length. - * Any existing W component will be ignored. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate W component of - * @returns {quat} out - */ - -function calculateW(out, a) { - var x = a[0], - y = a[1], - z = a[2]; - out[0] = x; - out[1] = y; - out[2] = z; - out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z)); - return out; -} -/** - * Calculate the exponential of a unit quaternion. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate the exponential of - * @returns {quat} out - */ - -function exp(out, a) { - var x = a[0], - y = a[1], - z = a[2], - w = a[3]; - var r = Math.sqrt(x * x + y * y + z * z); - var et = Math.exp(w); - var s = r > 0 ? et * Math.sin(r) / r : 0; - out[0] = x * s; - out[1] = y * s; - out[2] = z * s; - out[3] = et * Math.cos(r); - return out; -} -/** - * Calculate the natural logarithm of a unit quaternion. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate the exponential of - * @returns {quat} out - */ - -function ln(out, a) { - var x = a[0], - y = a[1], - z = a[2], - w = a[3]; - var r = Math.sqrt(x * x + y * y + z * z); - var t = r > 0 ? Math.atan2(r, w) / r : 0; - out[0] = x * t; - out[1] = y * t; - out[2] = z * t; - out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w); - return out; -} -/** - * Calculate the scalar power of a unit quaternion. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate the exponential of - * @param {Number} b amount to scale the quaternion by - * @returns {quat} out - */ - -function pow(out, a, b) { - ln(out, a); - scale(out, out, b); - exp(out, out); - return out; -} -/** - * Performs a spherical linear interpolation between two quat - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {quat} out - */ - -function slerp(out, a, b, t) { - // benchmarks: - // http://jsperf.com/quaternion-slerp-implementations - var ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - var bx = b[0], - by = b[1], - bz = b[2], - bw = b[3]; - var omega, cosom, sinom, scale0, scale1; // calc cosine - - cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary) - - if (cosom < 0.0) { - cosom = -cosom; - bx = -bx; - by = -by; - bz = -bz; - bw = -bw; - } // calculate coefficients - - - if (1.0 - cosom > _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - // standard case (slerp) - omega = Math.acos(cosom); - sinom = Math.sin(omega); - scale0 = Math.sin((1.0 - t) * omega) / sinom; - scale1 = Math.sin(t * omega) / sinom; - } else { - // "from" and "to" quaternions are very close - // ... so we can do a linear interpolation - scale0 = 1.0 - t; - scale1 = t; - } // calculate final values - - - out[0] = scale0 * ax + scale1 * bx; - out[1] = scale0 * ay + scale1 * by; - out[2] = scale0 * az + scale1 * bz; - out[3] = scale0 * aw + scale1 * bw; - return out; -} -/** - * Generates a random unit quaternion - * - * @param {quat} out the receiving quaternion - * @returns {quat} out - */ - -function random(out) { - // Implementation of http://planning.cs.uiuc.edu/node198.html - // TODO: Calling random 3 times is probably not the fastest solution - var u1 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); - var u2 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); - var u3 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); - var sqrt1MinusU1 = Math.sqrt(1 - u1); - var sqrtU1 = Math.sqrt(u1); - out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2); - out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2); - out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3); - out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3); - return out; -} -/** - * Calculates the inverse of a quat - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate inverse of - * @returns {quat} out - */ - -function invert(out, a) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; - var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 - - out[0] = -a0 * invDot; - out[1] = -a1 * invDot; - out[2] = -a2 * invDot; - out[3] = a3 * invDot; - return out; -} -/** - * Calculates the conjugate of a quat - * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate conjugate of - * @returns {quat} out - */ - -function conjugate(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - out[2] = -a[2]; - out[3] = a[3]; - return out; -} -/** - * Creates a quaternion from the given 3x3 rotation matrix. - * - * NOTE: The resultant quaternion is not normalized, so you should be sure - * to renormalize the quaternion yourself where necessary. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyMat3} m rotation matrix - * @returns {quat} out - * @function - */ - -function fromMat3(out, m) { - // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes - // article "Quaternion Calculus and Fast Animation". - var fTrace = m[0] + m[4] + m[8]; - var fRoot; - - if (fTrace > 0.0) { - // |w| > 1/2, may as well choose w > 1/2 - fRoot = Math.sqrt(fTrace + 1.0); // 2w - - out[3] = 0.5 * fRoot; - fRoot = 0.5 / fRoot; // 1/(4w) - - out[0] = (m[5] - m[7]) * fRoot; - out[1] = (m[6] - m[2]) * fRoot; - out[2] = (m[1] - m[3]) * fRoot; - } else { - // |w| <= 1/2 - var i = 0; - if (m[4] > m[0]) i = 1; - if (m[8] > m[i * 3 + i]) i = 2; - var j = (i + 1) % 3; - var k = (i + 2) % 3; - fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0); - out[i] = 0.5 * fRoot; - fRoot = 0.5 / fRoot; - out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot; - out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; - out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; - } - - return out; -} -/** - * Creates a quaternion from the given euler angle x, y, z. - * - * @param {quat} out the receiving quaternion - * @param {x} Angle to rotate around X axis in degrees. - * @param {y} Angle to rotate around Y axis in degrees. - * @param {z} Angle to rotate around Z axis in degrees. - * @returns {quat} out - * @function - */ - -function fromEuler(out, x, y, z) { - var halfToRad = 0.5 * Math.PI / 180.0; - x *= halfToRad; - y *= halfToRad; - z *= halfToRad; - var sx = Math.sin(x); - var cx = Math.cos(x); - var sy = Math.sin(y); - var cy = Math.cos(y); - var sz = Math.sin(z); - var cz = Math.cos(z); - out[0] = sx * cy * cz - cx * sy * sz; - out[1] = cx * sy * cz + sx * cy * sz; - out[2] = cx * cy * sz - sx * sy * cz; - out[3] = cx * cy * cz + sx * sy * sz; - return out; -} -/** - * Returns a string representation of a quatenion - * - * @param {ReadonlyQuat} a vector to represent as a string - * @returns {String} string representation of the vector - */ - -function str(a) { - return "quat(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; -} -/** - * Creates a new quat initialized with values from an existing quaternion - * - * @param {ReadonlyQuat} a quaternion to clone - * @returns {quat} a new quaternion - * @function - */ - -var clone = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.clone; -/** - * Creates a new quat initialized with the given values - * - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @param {Number} w W component - * @returns {quat} a new quaternion - * @function - */ - -var fromValues = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.fromValues; -/** - * Copy the values from one quat to another - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the source quaternion - * @returns {quat} out - * @function - */ - -var copy = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.copy; -/** - * Set the components of a quat to the given values - * - * @param {quat} out the receiving quaternion - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @param {Number} w W component - * @returns {quat} out - * @function - */ - -var set = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.set; -/** - * Adds two quat's - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @returns {quat} out - * @function - */ - -var add = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.add; -/** - * Alias for {@link quat.multiply} - * @function - */ - -var mul = multiply; -/** - * Scales a quat by a scalar number - * - * @param {quat} out the receiving vector - * @param {ReadonlyQuat} a the vector to scale - * @param {Number} b amount to scale the vector by - * @returns {quat} out - * @function - */ - -var scale = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.scale; -/** - * Calculates the dot product of two quat's - * - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @returns {Number} dot product of a and b - * @function - */ - -var dot = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.dot; -/** - * Performs a linear interpolation between two quat's - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {quat} out - * @function - */ - -var lerp = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.lerp; -/** - * Calculates the length of a quat - * - * @param {ReadonlyQuat} a vector to calculate length of - * @returns {Number} length of a - */ - -var length = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.length; -/** - * Alias for {@link quat.length} - * @function - */ - -var len = length; -/** - * Calculates the squared length of a quat - * - * @param {ReadonlyQuat} a vector to calculate squared length of - * @returns {Number} squared length of a - * @function - */ - -var squaredLength = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.squaredLength; -/** - * Alias for {@link quat.squaredLength} - * @function - */ - -var sqrLen = squaredLength; -/** - * Normalize a quat - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quaternion to normalize - * @returns {quat} out - * @function - */ - -var normalize = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.normalize; -/** - * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyQuat} a The first quaternion. - * @param {ReadonlyQuat} b The second quaternion. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -var exactEquals = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.exactEquals; -/** - * Returns whether or not the quaternions have approximately the same elements in the same position. - * - * @param {ReadonlyQuat} a The first vector. - * @param {ReadonlyQuat} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -var equals = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.equals; -/** - * Sets a quaternion to represent the shortest rotation from one - * vector to another. - * - * Both vectors are assumed to be unit length. - * - * @param {quat} out the receiving quaternion. - * @param {ReadonlyVec3} a the initial vector - * @param {ReadonlyVec3} b the destination vector - * @returns {quat} out - */ - -var rotationTo = function () { - var tmpvec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.create(); - var xUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.fromValues(1, 0, 0); - var yUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.fromValues(0, 1, 0); - return function (out, a, b) { - var dot = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.dot(a, b); - - if (dot < -0.999999) { - _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, xUnitVec3, a); - if (_vec3_js__WEBPACK_IMPORTED_MODULE_2__.len(tmpvec3) < 0.000001) _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, yUnitVec3, a); - _vec3_js__WEBPACK_IMPORTED_MODULE_2__.normalize(tmpvec3, tmpvec3); - setAxisAngle(out, tmpvec3, Math.PI); - return out; - } else if (dot > 0.999999) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 1; - return out; - } else { - _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, a, b); - out[0] = tmpvec3[0]; - out[1] = tmpvec3[1]; - out[2] = tmpvec3[2]; - out[3] = 1 + dot; - return normalize(out, out); - } - }; -}(); -/** - * Performs a spherical linear interpolation with two control points - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @param {ReadonlyQuat} c the third operand - * @param {ReadonlyQuat} d the fourth operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {quat} out - */ - -var sqlerp = function () { - var temp1 = create(); - var temp2 = create(); - return function (out, a, b, c, d, t) { - slerp(temp1, a, d, t); - slerp(temp2, b, c, t); - slerp(out, temp1, temp2, 2 * t * (1 - t)); - return out; - }; -}(); -/** - * Sets the specified quaternion with values corresponding to the given - * axes. Each axis is a vec3 and is expected to be unit length and - * perpendicular to all other specified axes. - * - * @param {ReadonlyVec3} view the vector representing the viewing direction - * @param {ReadonlyVec3} right the vector representing the local "right" direction - * @param {ReadonlyVec3} up the vector representing the local "up" direction - * @returns {quat} out - */ - -var setAxes = function () { - var matr = _mat3_js__WEBPACK_IMPORTED_MODULE_3__.create(); - return function (out, view, right, up) { - matr[0] = right[0]; - matr[3] = right[1]; - matr[6] = right[2]; - matr[1] = up[0]; - matr[4] = up[1]; - matr[7] = up[2]; - matr[2] = -view[0]; - matr[5] = -view[1]; - matr[8] = -view[2]; - return normalize(out, fromMat3(out, matr)); - }; -}(); - -/***/ }), -/* 19 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "divide": () => (/* binding */ divide), -/* harmony export */ "ceil": () => (/* binding */ ceil), -/* harmony export */ "floor": () => (/* binding */ floor), -/* harmony export */ "min": () => (/* binding */ min), -/* harmony export */ "max": () => (/* binding */ max), -/* harmony export */ "round": () => (/* binding */ round), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), -/* harmony export */ "distance": () => (/* binding */ distance), -/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), -/* harmony export */ "length": () => (/* binding */ length), -/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), -/* harmony export */ "negate": () => (/* binding */ negate), -/* harmony export */ "inverse": () => (/* binding */ inverse), -/* harmony export */ "normalize": () => (/* binding */ normalize), -/* harmony export */ "dot": () => (/* binding */ dot), -/* harmony export */ "cross": () => (/* binding */ cross), -/* harmony export */ "lerp": () => (/* binding */ lerp), -/* harmony export */ "random": () => (/* binding */ random), -/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), -/* harmony export */ "transformQuat": () => (/* binding */ transformQuat), -/* harmony export */ "zero": () => (/* binding */ zero), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "sub": () => (/* binding */ sub), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "div": () => (/* binding */ div), -/* harmony export */ "dist": () => (/* binding */ dist), -/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), -/* harmony export */ "len": () => (/* binding */ len), -/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), -/* harmony export */ "forEach": () => (/* binding */ forEach) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); - -/** - * 4 Dimensional Vector - * @module vec4 - */ - -/** - * Creates a new, empty vec4 - * - * @returns {vec4} a new 4D vector - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 0; - } - - return out; -} -/** - * Creates a new vec4 initialized with values from an existing vector - * - * @param {ReadonlyVec4} a vector to clone - * @returns {vec4} a new 4D vector - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - return out; -} -/** - * Creates a new vec4 initialized with the given values - * - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @param {Number} w W component - * @returns {vec4} a new 4D vector - */ - -function fromValues(x, y, z, w) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - out[0] = x; - out[1] = y; - out[2] = z; - out[3] = w; - return out; -} -/** - * Copy the values from one vec4 to another - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the source vector - * @returns {vec4} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - return out; -} -/** - * Set the components of a vec4 to the given values - * - * @param {vec4} out the receiving vector - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @param {Number} w W component - * @returns {vec4} out - */ - -function set(out, x, y, z, w) { - out[0] = x; - out[1] = y; - out[2] = z; - out[3] = w; - return out; -} -/** - * Adds two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - return out; -} -/** - * Subtracts vector b from vector a - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - out[3] = a[3] - b[3]; - return out; -} -/** - * Multiplies two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function multiply(out, a, b) { - out[0] = a[0] * b[0]; - out[1] = a[1] * b[1]; - out[2] = a[2] * b[2]; - out[3] = a[3] * b[3]; - return out; -} -/** - * Divides two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function divide(out, a, b) { - out[0] = a[0] / b[0]; - out[1] = a[1] / b[1]; - out[2] = a[2] / b[2]; - out[3] = a[3] / b[3]; - return out; -} -/** - * Math.ceil the components of a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to ceil - * @returns {vec4} out - */ - -function ceil(out, a) { - out[0] = Math.ceil(a[0]); - out[1] = Math.ceil(a[1]); - out[2] = Math.ceil(a[2]); - out[3] = Math.ceil(a[3]); - return out; -} -/** - * Math.floor the components of a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to floor - * @returns {vec4} out - */ - -function floor(out, a) { - out[0] = Math.floor(a[0]); - out[1] = Math.floor(a[1]); - out[2] = Math.floor(a[2]); - out[3] = Math.floor(a[3]); - return out; -} -/** - * Returns the minimum of two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function min(out, a, b) { - out[0] = Math.min(a[0], b[0]); - out[1] = Math.min(a[1], b[1]); - out[2] = Math.min(a[2], b[2]); - out[3] = Math.min(a[3], b[3]); - return out; -} -/** - * Returns the maximum of two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function max(out, a, b) { - out[0] = Math.max(a[0], b[0]); - out[1] = Math.max(a[1], b[1]); - out[2] = Math.max(a[2], b[2]); - out[3] = Math.max(a[3], b[3]); - return out; -} -/** - * Math.round the components of a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to round - * @returns {vec4} out - */ - -function round(out, a) { - out[0] = Math.round(a[0]); - out[1] = Math.round(a[1]); - out[2] = Math.round(a[2]); - out[3] = Math.round(a[3]); - return out; -} -/** - * Scales a vec4 by a scalar number - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the vector to scale - * @param {Number} b amount to scale the vector by - * @returns {vec4} out - */ - -function scale(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - return out; -} -/** - * Adds two vec4's after scaling the second operand by a scalar value - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @param {Number} scale the amount to scale b by before adding - * @returns {vec4} out - */ - -function scaleAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - out[3] = a[3] + b[3] * scale; - return out; -} -/** - * Calculates the euclidian distance between two vec4's - * - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {Number} distance between a and b - */ - -function distance(a, b) { - var x = b[0] - a[0]; - var y = b[1] - a[1]; - var z = b[2] - a[2]; - var w = b[3] - a[3]; - return Math.hypot(x, y, z, w); -} -/** - * Calculates the squared euclidian distance between two vec4's - * - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {Number} squared distance between a and b - */ - -function squaredDistance(a, b) { - var x = b[0] - a[0]; - var y = b[1] - a[1]; - var z = b[2] - a[2]; - var w = b[3] - a[3]; - return x * x + y * y + z * z + w * w; -} -/** - * Calculates the length of a vec4 - * - * @param {ReadonlyVec4} a vector to calculate length of - * @returns {Number} length of a - */ - -function length(a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - var w = a[3]; - return Math.hypot(x, y, z, w); -} -/** - * Calculates the squared length of a vec4 - * - * @param {ReadonlyVec4} a vector to calculate squared length of - * @returns {Number} squared length of a - */ - -function squaredLength(a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - var w = a[3]; - return x * x + y * y + z * z + w * w; -} -/** - * Negates the components of a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to negate - * @returns {vec4} out - */ - -function negate(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - out[2] = -a[2]; - out[3] = -a[3]; - return out; -} -/** - * Returns the inverse of the components of a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to invert - * @returns {vec4} out - */ - -function inverse(out, a) { - out[0] = 1.0 / a[0]; - out[1] = 1.0 / a[1]; - out[2] = 1.0 / a[2]; - out[3] = 1.0 / a[3]; - return out; -} -/** - * Normalize a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to normalize - * @returns {vec4} out - */ - -function normalize(out, a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - var w = a[3]; - var len = x * x + y * y + z * z + w * w; - - if (len > 0) { - len = 1 / Math.sqrt(len); - } - - out[0] = x * len; - out[1] = y * len; - out[2] = z * len; - out[3] = w * len; - return out; -} -/** - * Calculates the dot product of two vec4's - * - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {Number} dot product of a and b - */ - -function dot(a, b) { - return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; -} -/** - * Returns the cross-product of three vectors in a 4-dimensional space - * - * @param {ReadonlyVec4} result the receiving vector - * @param {ReadonlyVec4} U the first vector - * @param {ReadonlyVec4} V the second vector - * @param {ReadonlyVec4} W the third vector - * @returns {vec4} result - */ - -function cross(out, u, v, w) { - var A = v[0] * w[1] - v[1] * w[0], - B = v[0] * w[2] - v[2] * w[0], - C = v[0] * w[3] - v[3] * w[0], - D = v[1] * w[2] - v[2] * w[1], - E = v[1] * w[3] - v[3] * w[1], - F = v[2] * w[3] - v[3] * w[2]; - var G = u[0]; - var H = u[1]; - var I = u[2]; - var J = u[3]; - out[0] = H * F - I * E + J * D; - out[1] = -(G * F) + I * C - J * B; - out[2] = G * E - H * C + J * A; - out[3] = -(G * D) + H * B - I * A; - return out; -} -/** - * Performs a linear interpolation between two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {vec4} out - */ - -function lerp(out, a, b, t) { - var ax = a[0]; - var ay = a[1]; - var az = a[2]; - var aw = a[3]; - out[0] = ax + t * (b[0] - ax); - out[1] = ay + t * (b[1] - ay); - out[2] = az + t * (b[2] - az); - out[3] = aw + t * (b[3] - aw); - return out; -} -/** - * Generates a random vector with the given scale - * - * @param {vec4} out the receiving vector - * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned - * @returns {vec4} out - */ - -function random(out, scale) { - scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a - // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646. - // http://projecteuclid.org/euclid.aoms/1177692644; - - var v1, v2, v3, v4; - var s1, s2; - - do { - v1 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; - v2 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; - s1 = v1 * v1 + v2 * v2; - } while (s1 >= 1); - - do { - v3 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; - v4 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; - s2 = v3 * v3 + v4 * v4; - } while (s2 >= 1); - - var d = Math.sqrt((1 - s1) / s2); - out[0] = scale * v1; - out[1] = scale * v2; - out[2] = scale * v3 * d; - out[3] = scale * v4 * d; - return out; -} -/** - * Transforms the vec4 with a mat4. - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the vector to transform - * @param {ReadonlyMat4} m matrix to transform with - * @returns {vec4} out - */ - -function transformMat4(out, a, m) { - var x = a[0], - y = a[1], - z = a[2], - w = a[3]; - out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; - out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; - out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; - out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; - return out; -} -/** - * Transforms the vec4 with a quat - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the vector to transform - * @param {ReadonlyQuat} q quaternion to transform with - * @returns {vec4} out - */ - -function transformQuat(out, a, q) { - var x = a[0], - y = a[1], - z = a[2]; - var qx = q[0], - qy = q[1], - qz = q[2], - qw = q[3]; // calculate quat * vec - - var ix = qw * x + qy * z - qz * y; - var iy = qw * y + qz * x - qx * z; - var iz = qw * z + qx * y - qy * x; - var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat - - out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy; - out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz; - out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx; - out[3] = a[3]; - return out; -} -/** - * Set the components of a vec4 to zero - * - * @param {vec4} out the receiving vector - * @returns {vec4} out - */ - -function zero(out) { - out[0] = 0.0; - out[1] = 0.0; - out[2] = 0.0; - out[3] = 0.0; - return out; -} -/** - * Returns a string representation of a vector - * - * @param {ReadonlyVec4} a vector to represent as a string - * @returns {String} string representation of the vector - */ - -function str(a) { - return "vec4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; -} -/** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyVec4} a The first vector. - * @param {ReadonlyVec4} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; -} -/** - * Returns whether or not the vectors have approximately the same elements in the same position. - * - * @param {ReadonlyVec4} a The first vector. - * @param {ReadonlyVec4} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)); -} -/** - * Alias for {@link vec4.subtract} - * @function - */ - -var sub = subtract; -/** - * Alias for {@link vec4.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link vec4.divide} - * @function - */ - -var div = divide; -/** - * Alias for {@link vec4.distance} - * @function - */ - -var dist = distance; -/** - * Alias for {@link vec4.squaredDistance} - * @function - */ - -var sqrDist = squaredDistance; -/** - * Alias for {@link vec4.length} - * @function - */ - -var len = length; -/** - * Alias for {@link vec4.squaredLength} - * @function - */ - -var sqrLen = squaredLength; -/** - * Perform some operation over an array of vec4s. - * - * @param {Array} a the array of vectors to iterate over - * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed - * @param {Number} offset Number of elements to skip at the beginning of the array - * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array - * @param {Function} fn Function to call for each vector in the array - * @param {Object} [arg] additional argument to pass to fn - * @returns {Array} a - * @function - */ - -var forEach = function () { - var vec = create(); - return function (a, stride, offset, count, fn, arg) { - var i, l; - - if (!stride) { - stride = 4; - } - - if (!offset) { - offset = 0; - } - - if (count) { - l = Math.min(count * stride + offset, a.length); - } else { - l = a.length; - } - - for (i = offset; i < l; i += stride) { - vec[0] = a[i]; - vec[1] = a[i + 1]; - vec[2] = a[i + 2]; - vec[3] = a[i + 3]; - fn(vec, vec, arg); - a[i] = vec[0]; - a[i + 1] = vec[1]; - a[i + 2] = vec[2]; - a[i + 3] = vec[3]; - } - - return a; - }; -}(); - -/***/ }), -/* 20 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "length": () => (/* binding */ length), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "divide": () => (/* binding */ divide), -/* harmony export */ "ceil": () => (/* binding */ ceil), -/* harmony export */ "floor": () => (/* binding */ floor), -/* harmony export */ "min": () => (/* binding */ min), -/* harmony export */ "max": () => (/* binding */ max), -/* harmony export */ "round": () => (/* binding */ round), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), -/* harmony export */ "distance": () => (/* binding */ distance), -/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), -/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), -/* harmony export */ "negate": () => (/* binding */ negate), -/* harmony export */ "inverse": () => (/* binding */ inverse), -/* harmony export */ "normalize": () => (/* binding */ normalize), -/* harmony export */ "dot": () => (/* binding */ dot), -/* harmony export */ "cross": () => (/* binding */ cross), -/* harmony export */ "lerp": () => (/* binding */ lerp), -/* harmony export */ "hermite": () => (/* binding */ hermite), -/* harmony export */ "bezier": () => (/* binding */ bezier), -/* harmony export */ "random": () => (/* binding */ random), -/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), -/* harmony export */ "transformMat3": () => (/* binding */ transformMat3), -/* harmony export */ "transformQuat": () => (/* binding */ transformQuat), -/* harmony export */ "rotateX": () => (/* binding */ rotateX), -/* harmony export */ "rotateY": () => (/* binding */ rotateY), -/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), -/* harmony export */ "angle": () => (/* binding */ angle), -/* harmony export */ "zero": () => (/* binding */ zero), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "sub": () => (/* binding */ sub), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "div": () => (/* binding */ div), -/* harmony export */ "dist": () => (/* binding */ dist), -/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), -/* harmony export */ "len": () => (/* binding */ len), -/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), -/* harmony export */ "forEach": () => (/* binding */ forEach) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); - -/** - * 3 Dimensional Vector - * @module vec3 - */ - -/** - * Creates a new, empty vec3 - * - * @returns {vec3} a new 3D vector - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - } - - return out; -} -/** - * Creates a new vec3 initialized with values from an existing vector - * - * @param {ReadonlyVec3} a vector to clone - * @returns {vec3} a new 3D vector - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - return out; -} -/** - * Calculates the length of a vec3 - * - * @param {ReadonlyVec3} a vector to calculate length of - * @returns {Number} length of a - */ - -function length(a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - return Math.hypot(x, y, z); -} -/** - * Creates a new vec3 initialized with the given values - * - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @returns {vec3} a new 3D vector - */ - -function fromValues(x, y, z) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - out[0] = x; - out[1] = y; - out[2] = z; - return out; -} -/** - * Copy the values from one vec3 to another - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the source vector - * @returns {vec3} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - return out; -} -/** - * Set the components of a vec3 to the given values - * - * @param {vec3} out the receiving vector - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @returns {vec3} out - */ - -function set(out, x, y, z) { - out[0] = x; - out[1] = y; - out[2] = z; - return out; -} -/** - * Adds two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - return out; -} -/** - * Subtracts vector b from vector a - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - return out; -} -/** - * Multiplies two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function multiply(out, a, b) { - out[0] = a[0] * b[0]; - out[1] = a[1] * b[1]; - out[2] = a[2] * b[2]; - return out; -} -/** - * Divides two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function divide(out, a, b) { - out[0] = a[0] / b[0]; - out[1] = a[1] / b[1]; - out[2] = a[2] / b[2]; - return out; -} -/** - * Math.ceil the components of a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to ceil - * @returns {vec3} out - */ - -function ceil(out, a) { - out[0] = Math.ceil(a[0]); - out[1] = Math.ceil(a[1]); - out[2] = Math.ceil(a[2]); - return out; -} -/** - * Math.floor the components of a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to floor - * @returns {vec3} out - */ - -function floor(out, a) { - out[0] = Math.floor(a[0]); - out[1] = Math.floor(a[1]); - out[2] = Math.floor(a[2]); - return out; -} -/** - * Returns the minimum of two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function min(out, a, b) { - out[0] = Math.min(a[0], b[0]); - out[1] = Math.min(a[1], b[1]); - out[2] = Math.min(a[2], b[2]); - return out; -} -/** - * Returns the maximum of two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function max(out, a, b) { - out[0] = Math.max(a[0], b[0]); - out[1] = Math.max(a[1], b[1]); - out[2] = Math.max(a[2], b[2]); - return out; -} -/** - * Math.round the components of a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to round - * @returns {vec3} out - */ - -function round(out, a) { - out[0] = Math.round(a[0]); - out[1] = Math.round(a[1]); - out[2] = Math.round(a[2]); - return out; -} -/** - * Scales a vec3 by a scalar number - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the vector to scale - * @param {Number} b amount to scale the vector by - * @returns {vec3} out - */ - -function scale(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - return out; -} -/** - * Adds two vec3's after scaling the second operand by a scalar value - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @param {Number} scale the amount to scale b by before adding - * @returns {vec3} out - */ - -function scaleAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - return out; -} -/** - * Calculates the euclidian distance between two vec3's - * - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {Number} distance between a and b - */ - -function distance(a, b) { - var x = b[0] - a[0]; - var y = b[1] - a[1]; - var z = b[2] - a[2]; - return Math.hypot(x, y, z); -} -/** - * Calculates the squared euclidian distance between two vec3's - * - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {Number} squared distance between a and b - */ - -function squaredDistance(a, b) { - var x = b[0] - a[0]; - var y = b[1] - a[1]; - var z = b[2] - a[2]; - return x * x + y * y + z * z; -} -/** - * Calculates the squared length of a vec3 - * - * @param {ReadonlyVec3} a vector to calculate squared length of - * @returns {Number} squared length of a - */ - -function squaredLength(a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - return x * x + y * y + z * z; -} -/** - * Negates the components of a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to negate - * @returns {vec3} out - */ - -function negate(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - out[2] = -a[2]; - return out; -} -/** - * Returns the inverse of the components of a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to invert - * @returns {vec3} out - */ - -function inverse(out, a) { - out[0] = 1.0 / a[0]; - out[1] = 1.0 / a[1]; - out[2] = 1.0 / a[2]; - return out; -} -/** - * Normalize a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to normalize - * @returns {vec3} out - */ - -function normalize(out, a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - var len = x * x + y * y + z * z; - - if (len > 0) { - //TODO: evaluate use of glm_invsqrt here? - len = 1 / Math.sqrt(len); - } - - out[0] = a[0] * len; - out[1] = a[1] * len; - out[2] = a[2] * len; - return out; -} -/** - * Calculates the dot product of two vec3's - * - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {Number} dot product of a and b - */ - -function dot(a, b) { - return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; -} -/** - * Computes the cross product of two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function cross(out, a, b) { - var ax = a[0], - ay = a[1], - az = a[2]; - var bx = b[0], - by = b[1], - bz = b[2]; - out[0] = ay * bz - az * by; - out[1] = az * bx - ax * bz; - out[2] = ax * by - ay * bx; - return out; -} -/** - * Performs a linear interpolation between two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {vec3} out - */ - -function lerp(out, a, b, t) { - var ax = a[0]; - var ay = a[1]; - var az = a[2]; - out[0] = ax + t * (b[0] - ax); - out[1] = ay + t * (b[1] - ay); - out[2] = az + t * (b[2] - az); - return out; -} -/** - * Performs a hermite interpolation with two control points - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @param {ReadonlyVec3} c the third operand - * @param {ReadonlyVec3} d the fourth operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {vec3} out - */ - -function hermite(out, a, b, c, d, t) { - var factorTimes2 = t * t; - var factor1 = factorTimes2 * (2 * t - 3) + 1; - var factor2 = factorTimes2 * (t - 2) + t; - var factor3 = factorTimes2 * (t - 1); - var factor4 = factorTimes2 * (3 - 2 * t); - out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; - out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; - out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; - return out; -} -/** - * Performs a bezier interpolation with two control points - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @param {ReadonlyVec3} c the third operand - * @param {ReadonlyVec3} d the fourth operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {vec3} out - */ - -function bezier(out, a, b, c, d, t) { - var inverseFactor = 1 - t; - var inverseFactorTimesTwo = inverseFactor * inverseFactor; - var factorTimes2 = t * t; - var factor1 = inverseFactorTimesTwo * inverseFactor; - var factor2 = 3 * t * inverseFactorTimesTwo; - var factor3 = 3 * factorTimes2 * inverseFactor; - var factor4 = factorTimes2 * t; - out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; - out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; - out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; - return out; -} -/** - * Generates a random vector with the given scale - * - * @param {vec3} out the receiving vector - * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned - * @returns {vec3} out - */ - -function random(out, scale) { - scale = scale || 1.0; - var r = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 * Math.PI; - var z = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 - 1.0; - var zScale = Math.sqrt(1.0 - z * z) * scale; - out[0] = Math.cos(r) * zScale; - out[1] = Math.sin(r) * zScale; - out[2] = z * scale; - return out; -} -/** - * Transforms the vec3 with a mat4. - * 4th vector component is implicitly '1' - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the vector to transform - * @param {ReadonlyMat4} m matrix to transform with - * @returns {vec3} out - */ - -function transformMat4(out, a, m) { - var x = a[0], - y = a[1], - z = a[2]; - var w = m[3] * x + m[7] * y + m[11] * z + m[15]; - w = w || 1.0; - out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w; - out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w; - out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w; - return out; -} -/** - * Transforms the vec3 with a mat3. - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the vector to transform - * @param {ReadonlyMat3} m the 3x3 matrix to transform with - * @returns {vec3} out - */ - -function transformMat3(out, a, m) { - var x = a[0], - y = a[1], - z = a[2]; - out[0] = x * m[0] + y * m[3] + z * m[6]; - out[1] = x * m[1] + y * m[4] + z * m[7]; - out[2] = x * m[2] + y * m[5] + z * m[8]; - return out; -} -/** - * Transforms the vec3 with a quat - * Can also be used for dual quaternions. (Multiply it with the real part) - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the vector to transform - * @param {ReadonlyQuat} q quaternion to transform with - * @returns {vec3} out - */ - -function transformQuat(out, a, q) { - // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed - var qx = q[0], - qy = q[1], - qz = q[2], - qw = q[3]; - var x = a[0], - y = a[1], - z = a[2]; // var qvec = [qx, qy, qz]; - // var uv = vec3.cross([], qvec, a); - - var uvx = qy * z - qz * y, - uvy = qz * x - qx * z, - uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv); - - var uuvx = qy * uvz - qz * uvy, - uuvy = qz * uvx - qx * uvz, - uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w); - - var w2 = qw * 2; - uvx *= w2; - uvy *= w2; - uvz *= w2; // vec3.scale(uuv, uuv, 2); - - uuvx *= 2; - uuvy *= 2; - uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv)); - - out[0] = x + uvx + uuvx; - out[1] = y + uvy + uuvy; - out[2] = z + uvz + uuvz; - return out; -} -/** - * Rotate a 3D vector around the x-axis - * @param {vec3} out The receiving vec3 - * @param {ReadonlyVec3} a The vec3 point to rotate - * @param {ReadonlyVec3} b The origin of the rotation - * @param {Number} rad The angle of rotation in radians - * @returns {vec3} out - */ - -function rotateX(out, a, b, rad) { - var p = [], - r = []; //Translate point to the origin - - p[0] = a[0] - b[0]; - p[1] = a[1] - b[1]; - p[2] = a[2] - b[2]; //perform rotation - - r[0] = p[0]; - r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad); - r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position - - out[0] = r[0] + b[0]; - out[1] = r[1] + b[1]; - out[2] = r[2] + b[2]; - return out; -} -/** - * Rotate a 3D vector around the y-axis - * @param {vec3} out The receiving vec3 - * @param {ReadonlyVec3} a The vec3 point to rotate - * @param {ReadonlyVec3} b The origin of the rotation - * @param {Number} rad The angle of rotation in radians - * @returns {vec3} out - */ - -function rotateY(out, a, b, rad) { - var p = [], - r = []; //Translate point to the origin - - p[0] = a[0] - b[0]; - p[1] = a[1] - b[1]; - p[2] = a[2] - b[2]; //perform rotation - - r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad); - r[1] = p[1]; - r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position - - out[0] = r[0] + b[0]; - out[1] = r[1] + b[1]; - out[2] = r[2] + b[2]; - return out; -} -/** - * Rotate a 3D vector around the z-axis - * @param {vec3} out The receiving vec3 - * @param {ReadonlyVec3} a The vec3 point to rotate - * @param {ReadonlyVec3} b The origin of the rotation - * @param {Number} rad The angle of rotation in radians - * @returns {vec3} out - */ - -function rotateZ(out, a, b, rad) { - var p = [], - r = []; //Translate point to the origin - - p[0] = a[0] - b[0]; - p[1] = a[1] - b[1]; - p[2] = a[2] - b[2]; //perform rotation - - r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad); - r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad); - r[2] = p[2]; //translate to correct position - - out[0] = r[0] + b[0]; - out[1] = r[1] + b[1]; - out[2] = r[2] + b[2]; - return out; -} -/** - * Get the angle between two 3D vectors - * @param {ReadonlyVec3} a The first operand - * @param {ReadonlyVec3} b The second operand - * @returns {Number} The angle in radians - */ - -function angle(a, b) { - var ax = a[0], - ay = a[1], - az = a[2], - bx = b[0], - by = b[1], - bz = b[2], - mag1 = Math.sqrt(ax * ax + ay * ay + az * az), - mag2 = Math.sqrt(bx * bx + by * by + bz * bz), - mag = mag1 * mag2, - cosine = mag && dot(a, b) / mag; - return Math.acos(Math.min(Math.max(cosine, -1), 1)); -} -/** - * Set the components of a vec3 to zero - * - * @param {vec3} out the receiving vector - * @returns {vec3} out - */ - -function zero(out) { - out[0] = 0.0; - out[1] = 0.0; - out[2] = 0.0; - return out; -} -/** - * Returns a string representation of a vector - * - * @param {ReadonlyVec3} a vector to represent as a string - * @returns {String} string representation of the vector - */ - -function str(a) { - return "vec3(" + a[0] + ", " + a[1] + ", " + a[2] + ")"; -} -/** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyVec3} a The first vector. - * @param {ReadonlyVec3} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; -} -/** - * Returns whether or not the vectors have approximately the same elements in the same position. - * - * @param {ReadonlyVec3} a The first vector. - * @param {ReadonlyVec3} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2]; - var b0 = b[0], - b1 = b[1], - b2 = b[2]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)); -} -/** - * Alias for {@link vec3.subtract} - * @function - */ - -var sub = subtract; -/** - * Alias for {@link vec3.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link vec3.divide} - * @function - */ - -var div = divide; -/** - * Alias for {@link vec3.distance} - * @function - */ - -var dist = distance; -/** - * Alias for {@link vec3.squaredDistance} - * @function - */ - -var sqrDist = squaredDistance; -/** - * Alias for {@link vec3.length} - * @function - */ - -var len = length; -/** - * Alias for {@link vec3.squaredLength} - * @function - */ - -var sqrLen = squaredLength; -/** - * Perform some operation over an array of vec3s. - * - * @param {Array} a the array of vectors to iterate over - * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed - * @param {Number} offset Number of elements to skip at the beginning of the array - * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array - * @param {Function} fn Function to call for each vector in the array - * @param {Object} [arg] additional argument to pass to fn - * @returns {Array} a - * @function - */ - -var forEach = function () { - var vec = create(); - return function (a, stride, offset, count, fn, arg) { - var i, l; - - if (!stride) { - stride = 3; - } - - if (!offset) { - offset = 0; - } - - if (count) { - l = Math.min(count * stride + offset, a.length); - } else { - l = a.length; - } - - for (i = offset; i < l; i += stride) { - vec[0] = a[i]; - vec[1] = a[i + 1]; - vec[2] = a[i + 2]; - fn(vec, vec, arg); - a[i] = vec[0]; - a[i + 1] = vec[1]; - a[i + 2] = vec[2]; - } - - return a; - }; -}(); - -/***/ }), -/* 21 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "fromRotationTranslationValues": () => (/* binding */ fromRotationTranslationValues), -/* harmony export */ "fromRotationTranslation": () => (/* binding */ fromRotationTranslation), -/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), -/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), -/* harmony export */ "fromMat4": () => (/* binding */ fromMat4), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "getReal": () => (/* binding */ getReal), -/* harmony export */ "getDual": () => (/* binding */ getDual), -/* harmony export */ "setReal": () => (/* binding */ setReal), -/* harmony export */ "setDual": () => (/* binding */ setDual), -/* harmony export */ "getTranslation": () => (/* binding */ getTranslation), -/* harmony export */ "translate": () => (/* binding */ translate), -/* harmony export */ "rotateX": () => (/* binding */ rotateX), -/* harmony export */ "rotateY": () => (/* binding */ rotateY), -/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), -/* harmony export */ "rotateByQuatAppend": () => (/* binding */ rotateByQuatAppend), -/* harmony export */ "rotateByQuatPrepend": () => (/* binding */ rotateByQuatPrepend), -/* harmony export */ "rotateAroundAxis": () => (/* binding */ rotateAroundAxis), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "dot": () => (/* binding */ dot), -/* harmony export */ "lerp": () => (/* binding */ lerp), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "conjugate": () => (/* binding */ conjugate), -/* harmony export */ "length": () => (/* binding */ length), -/* harmony export */ "len": () => (/* binding */ len), -/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), -/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), -/* harmony export */ "normalize": () => (/* binding */ normalize), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); -/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18); -/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17); - - - -/** - * Dual Quaternion
- * Format: [real, dual]
- * Quaternion format: XYZW
- * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
- * @module quat2 - */ - -/** - * Creates a new identity dual quat - * - * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation] - */ - -function create() { - var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - dq[0] = 0; - dq[1] = 0; - dq[2] = 0; - dq[4] = 0; - dq[5] = 0; - dq[6] = 0; - dq[7] = 0; - } - - dq[3] = 1; - return dq; -} -/** - * Creates a new quat initialized with values from an existing quaternion - * - * @param {ReadonlyQuat2} a dual quaternion to clone - * @returns {quat2} new dual quaternion - * @function - */ - -function clone(a) { - var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); - dq[0] = a[0]; - dq[1] = a[1]; - dq[2] = a[2]; - dq[3] = a[3]; - dq[4] = a[4]; - dq[5] = a[5]; - dq[6] = a[6]; - dq[7] = a[7]; - return dq; -} -/** - * Creates a new dual quat initialized with the given values - * - * @param {Number} x1 X component - * @param {Number} y1 Y component - * @param {Number} z1 Z component - * @param {Number} w1 W component - * @param {Number} x2 X component - * @param {Number} y2 Y component - * @param {Number} z2 Z component - * @param {Number} w2 W component - * @returns {quat2} new dual quaternion - * @function - */ - -function fromValues(x1, y1, z1, w1, x2, y2, z2, w2) { - var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); - dq[0] = x1; - dq[1] = y1; - dq[2] = z1; - dq[3] = w1; - dq[4] = x2; - dq[5] = y2; - dq[6] = z2; - dq[7] = w2; - return dq; -} -/** - * Creates a new dual quat from the given values (quat and translation) - * - * @param {Number} x1 X component - * @param {Number} y1 Y component - * @param {Number} z1 Z component - * @param {Number} w1 W component - * @param {Number} x2 X component (translation) - * @param {Number} y2 Y component (translation) - * @param {Number} z2 Z component (translation) - * @returns {quat2} new dual quaternion - * @function - */ - -function fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) { - var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); - dq[0] = x1; - dq[1] = y1; - dq[2] = z1; - dq[3] = w1; - var ax = x2 * 0.5, - ay = y2 * 0.5, - az = z2 * 0.5; - dq[4] = ax * w1 + ay * z1 - az * y1; - dq[5] = ay * w1 + az * x1 - ax * z1; - dq[6] = az * w1 + ax * y1 - ay * x1; - dq[7] = -ax * x1 - ay * y1 - az * z1; - return dq; -} -/** - * Creates a dual quat from a quaternion and a translation - * - * @param {ReadonlyQuat2} dual quaternion receiving operation result - * @param {ReadonlyQuat} q a normalized quaternion - * @param {ReadonlyVec3} t tranlation vector - * @returns {quat2} dual quaternion receiving operation result - * @function - */ - -function fromRotationTranslation(out, q, t) { - var ax = t[0] * 0.5, - ay = t[1] * 0.5, - az = t[2] * 0.5, - bx = q[0], - by = q[1], - bz = q[2], - bw = q[3]; - out[0] = bx; - out[1] = by; - out[2] = bz; - out[3] = bw; - out[4] = ax * bw + ay * bz - az * by; - out[5] = ay * bw + az * bx - ax * bz; - out[6] = az * bw + ax * by - ay * bx; - out[7] = -ax * bx - ay * by - az * bz; - return out; -} -/** - * Creates a dual quat from a translation - * - * @param {ReadonlyQuat2} dual quaternion receiving operation result - * @param {ReadonlyVec3} t translation vector - * @returns {quat2} dual quaternion receiving operation result - * @function - */ - -function fromTranslation(out, t) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 1; - out[4] = t[0] * 0.5; - out[5] = t[1] * 0.5; - out[6] = t[2] * 0.5; - out[7] = 0; - return out; -} -/** - * Creates a dual quat from a quaternion - * - * @param {ReadonlyQuat2} dual quaternion receiving operation result - * @param {ReadonlyQuat} q the quaternion - * @returns {quat2} dual quaternion receiving operation result - * @function - */ - -function fromRotation(out, q) { - out[0] = q[0]; - out[1] = q[1]; - out[2] = q[2]; - out[3] = q[3]; - out[4] = 0; - out[5] = 0; - out[6] = 0; - out[7] = 0; - return out; -} -/** - * Creates a new dual quat from a matrix (4x4) - * - * @param {quat2} out the dual quaternion - * @param {ReadonlyMat4} a the matrix - * @returns {quat2} dual quat receiving operation result - * @function - */ - -function fromMat4(out, a) { - //TODO Optimize this - var outer = _quat_js__WEBPACK_IMPORTED_MODULE_1__.create(); - _mat4_js__WEBPACK_IMPORTED_MODULE_2__.getRotation(outer, a); - var t = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - _mat4_js__WEBPACK_IMPORTED_MODULE_2__.getTranslation(t, a); - fromRotationTranslation(out, outer, t); - return out; -} -/** - * Copy the values from one dual quat to another - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the source dual quaternion - * @returns {quat2} out - * @function - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - return out; -} -/** - * Set a dual quat to the identity dual quaternion - * - * @param {quat2} out the receiving quaternion - * @returns {quat2} out - */ - -function identity(out) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 1; - out[4] = 0; - out[5] = 0; - out[6] = 0; - out[7] = 0; - return out; -} -/** - * Set the components of a dual quat to the given values - * - * @param {quat2} out the receiving quaternion - * @param {Number} x1 X component - * @param {Number} y1 Y component - * @param {Number} z1 Z component - * @param {Number} w1 W component - * @param {Number} x2 X component - * @param {Number} y2 Y component - * @param {Number} z2 Z component - * @param {Number} w2 W component - * @returns {quat2} out - * @function - */ - -function set(out, x1, y1, z1, w1, x2, y2, z2, w2) { - out[0] = x1; - out[1] = y1; - out[2] = z1; - out[3] = w1; - out[4] = x2; - out[5] = y2; - out[6] = z2; - out[7] = w2; - return out; -} -/** - * Gets the real part of a dual quat - * @param {quat} out real part - * @param {ReadonlyQuat2} a Dual Quaternion - * @return {quat} real part - */ - -var getReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__.copy; -/** - * Gets the dual part of a dual quat - * @param {quat} out dual part - * @param {ReadonlyQuat2} a Dual Quaternion - * @return {quat} dual part - */ - -function getDual(out, a) { - out[0] = a[4]; - out[1] = a[5]; - out[2] = a[6]; - out[3] = a[7]; - return out; -} -/** - * Set the real component of a dual quat to the given quaternion - * - * @param {quat2} out the receiving quaternion - * @param {ReadonlyQuat} q a quaternion representing the real part - * @returns {quat2} out - * @function - */ - -var setReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__.copy; -/** - * Set the dual component of a dual quat to the given quaternion - * - * @param {quat2} out the receiving quaternion - * @param {ReadonlyQuat} q a quaternion representing the dual part - * @returns {quat2} out - * @function - */ - -function setDual(out, q) { - out[4] = q[0]; - out[5] = q[1]; - out[6] = q[2]; - out[7] = q[3]; - return out; -} -/** - * Gets the translation of a normalized dual quat - * @param {vec3} out translation - * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed - * @return {vec3} translation - */ - -function getTranslation(out, a) { - var ax = a[4], - ay = a[5], - az = a[6], - aw = a[7], - bx = -a[0], - by = -a[1], - bz = -a[2], - bw = a[3]; - out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; - out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; - out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; - return out; -} -/** - * Translates a dual quat by the given vector - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to translate - * @param {ReadonlyVec3} v vector to translate by - * @returns {quat2} out - */ - -function translate(out, a, v) { - var ax1 = a[0], - ay1 = a[1], - az1 = a[2], - aw1 = a[3], - bx1 = v[0] * 0.5, - by1 = v[1] * 0.5, - bz1 = v[2] * 0.5, - ax2 = a[4], - ay2 = a[5], - az2 = a[6], - aw2 = a[7]; - out[0] = ax1; - out[1] = ay1; - out[2] = az1; - out[3] = aw1; - out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2; - out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2; - out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2; - out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2; - return out; -} -/** - * Rotates a dual quat around the X axis - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @param {number} rad how far should the rotation be - * @returns {quat2} out - */ - -function rotateX(out, a, rad) { - var bx = -a[0], - by = -a[1], - bz = -a[2], - bw = a[3], - ax = a[4], - ay = a[5], - az = a[6], - aw = a[7], - ax1 = ax * bw + aw * bx + ay * bz - az * by, - ay1 = ay * bw + aw * by + az * bx - ax * bz, - az1 = az * bw + aw * bz + ax * by - ay * bx, - aw1 = aw * bw - ax * bx - ay * by - az * bz; - _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateX(out, a, rad); - bx = out[0]; - by = out[1]; - bz = out[2]; - bw = out[3]; - out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; - out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; - out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; - out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; - return out; -} -/** - * Rotates a dual quat around the Y axis - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @param {number} rad how far should the rotation be - * @returns {quat2} out - */ - -function rotateY(out, a, rad) { - var bx = -a[0], - by = -a[1], - bz = -a[2], - bw = a[3], - ax = a[4], - ay = a[5], - az = a[6], - aw = a[7], - ax1 = ax * bw + aw * bx + ay * bz - az * by, - ay1 = ay * bw + aw * by + az * bx - ax * bz, - az1 = az * bw + aw * bz + ax * by - ay * bx, - aw1 = aw * bw - ax * bx - ay * by - az * bz; - _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateY(out, a, rad); - bx = out[0]; - by = out[1]; - bz = out[2]; - bw = out[3]; - out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; - out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; - out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; - out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; - return out; -} -/** - * Rotates a dual quat around the Z axis - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @param {number} rad how far should the rotation be - * @returns {quat2} out - */ - -function rotateZ(out, a, rad) { - var bx = -a[0], - by = -a[1], - bz = -a[2], - bw = a[3], - ax = a[4], - ay = a[5], - az = a[6], - aw = a[7], - ax1 = ax * bw + aw * bx + ay * bz - az * by, - ay1 = ay * bw + aw * by + az * bx - ax * bz, - az1 = az * bw + aw * bz + ax * by - ay * bx, - aw1 = aw * bw - ax * bx - ay * by - az * bz; - _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateZ(out, a, rad); - bx = out[0]; - by = out[1]; - bz = out[2]; - bw = out[3]; - out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; - out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; - out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; - out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; - return out; -} -/** - * Rotates a dual quat by a given quaternion (a * q) - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @param {ReadonlyQuat} q quaternion to rotate by - * @returns {quat2} out - */ - -function rotateByQuatAppend(out, a, q) { - var qx = q[0], - qy = q[1], - qz = q[2], - qw = q[3], - ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - out[0] = ax * qw + aw * qx + ay * qz - az * qy; - out[1] = ay * qw + aw * qy + az * qx - ax * qz; - out[2] = az * qw + aw * qz + ax * qy - ay * qx; - out[3] = aw * qw - ax * qx - ay * qy - az * qz; - ax = a[4]; - ay = a[5]; - az = a[6]; - aw = a[7]; - out[4] = ax * qw + aw * qx + ay * qz - az * qy; - out[5] = ay * qw + aw * qy + az * qx - ax * qz; - out[6] = az * qw + aw * qz + ax * qy - ay * qx; - out[7] = aw * qw - ax * qx - ay * qy - az * qz; - return out; -} -/** - * Rotates a dual quat by a given quaternion (q * a) - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat} q quaternion to rotate by - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @returns {quat2} out - */ - -function rotateByQuatPrepend(out, q, a) { - var qx = q[0], - qy = q[1], - qz = q[2], - qw = q[3], - bx = a[0], - by = a[1], - bz = a[2], - bw = a[3]; - out[0] = qx * bw + qw * bx + qy * bz - qz * by; - out[1] = qy * bw + qw * by + qz * bx - qx * bz; - out[2] = qz * bw + qw * bz + qx * by - qy * bx; - out[3] = qw * bw - qx * bx - qy * by - qz * bz; - bx = a[4]; - by = a[5]; - bz = a[6]; - bw = a[7]; - out[4] = qx * bw + qw * bx + qy * bz - qz * by; - out[5] = qy * bw + qw * by + qz * bx - qx * bz; - out[6] = qz * bw + qw * bz + qx * by - qy * bx; - out[7] = qw * bw - qx * bx - qy * by - qz * bz; - return out; -} -/** - * Rotates a dual quat around a given axis. Does the normalisation automatically - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @param {ReadonlyVec3} axis the axis to rotate around - * @param {Number} rad how far the rotation should be - * @returns {quat2} out - */ - -function rotateAroundAxis(out, a, axis, rad) { - //Special case for rad = 0 - if (Math.abs(rad) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - return copy(out, a); - } - - var axisLength = Math.hypot(axis[0], axis[1], axis[2]); - rad = rad * 0.5; - var s = Math.sin(rad); - var bx = s * axis[0] / axisLength; - var by = s * axis[1] / axisLength; - var bz = s * axis[2] / axisLength; - var bw = Math.cos(rad); - var ax1 = a[0], - ay1 = a[1], - az1 = a[2], - aw1 = a[3]; - out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; - out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; - out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; - out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; - var ax = a[4], - ay = a[5], - az = a[6], - aw = a[7]; - out[4] = ax * bw + aw * bx + ay * bz - az * by; - out[5] = ay * bw + aw * by + az * bx - ax * bz; - out[6] = az * bw + aw * bz + ax * by - ay * bx; - out[7] = aw * bw - ax * bx - ay * by - az * bz; - return out; -} -/** - * Adds two dual quat's - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the first operand - * @param {ReadonlyQuat2} b the second operand - * @returns {quat2} out - * @function - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - out[4] = a[4] + b[4]; - out[5] = a[5] + b[5]; - out[6] = a[6] + b[6]; - out[7] = a[7] + b[7]; - return out; -} -/** - * Multiplies two dual quat's - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the first operand - * @param {ReadonlyQuat2} b the second operand - * @returns {quat2} out - */ - -function multiply(out, a, b) { - var ax0 = a[0], - ay0 = a[1], - az0 = a[2], - aw0 = a[3], - bx1 = b[4], - by1 = b[5], - bz1 = b[6], - bw1 = b[7], - ax1 = a[4], - ay1 = a[5], - az1 = a[6], - aw1 = a[7], - bx0 = b[0], - by0 = b[1], - bz0 = b[2], - bw0 = b[3]; - out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0; - out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0; - out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0; - out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0; - out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0; - out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0; - out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0; - out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0; - return out; -} -/** - * Alias for {@link quat2.multiply} - * @function - */ - -var mul = multiply; -/** - * Scales a dual quat by a scalar number - * - * @param {quat2} out the receiving dual quat - * @param {ReadonlyQuat2} a the dual quat to scale - * @param {Number} b amount to scale the dual quat by - * @returns {quat2} out - * @function - */ - -function scale(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - out[4] = a[4] * b; - out[5] = a[5] * b; - out[6] = a[6] * b; - out[7] = a[7] * b; - return out; -} -/** - * Calculates the dot product of two dual quat's (The dot product of the real parts) - * - * @param {ReadonlyQuat2} a the first operand - * @param {ReadonlyQuat2} b the second operand - * @returns {Number} dot product of a and b - * @function - */ - -var dot = _quat_js__WEBPACK_IMPORTED_MODULE_1__.dot; -/** - * Performs a linear interpolation between two dual quats's - * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5) - * - * @param {quat2} out the receiving dual quat - * @param {ReadonlyQuat2} a the first operand - * @param {ReadonlyQuat2} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {quat2} out - */ - -function lerp(out, a, b, t) { - var mt = 1 - t; - if (dot(a, b) < 0) t = -t; - out[0] = a[0] * mt + b[0] * t; - out[1] = a[1] * mt + b[1] * t; - out[2] = a[2] * mt + b[2] * t; - out[3] = a[3] * mt + b[3] * t; - out[4] = a[4] * mt + b[4] * t; - out[5] = a[5] * mt + b[5] * t; - out[6] = a[6] * mt + b[6] * t; - out[7] = a[7] * mt + b[7] * t; - return out; -} -/** - * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a dual quat to calculate inverse of - * @returns {quat2} out - */ - -function invert(out, a) { - var sqlen = squaredLength(a); - out[0] = -a[0] / sqlen; - out[1] = -a[1] / sqlen; - out[2] = -a[2] / sqlen; - out[3] = a[3] / sqlen; - out[4] = -a[4] / sqlen; - out[5] = -a[5] / sqlen; - out[6] = -a[6] / sqlen; - out[7] = a[7] / sqlen; - return out; -} -/** - * Calculates the conjugate of a dual quat - * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result. - * - * @param {quat2} out the receiving quaternion - * @param {ReadonlyQuat2} a quat to calculate conjugate of - * @returns {quat2} out - */ - -function conjugate(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - out[2] = -a[2]; - out[3] = a[3]; - out[4] = -a[4]; - out[5] = -a[5]; - out[6] = -a[6]; - out[7] = a[7]; - return out; -} -/** - * Calculates the length of a dual quat - * - * @param {ReadonlyQuat2} a dual quat to calculate length of - * @returns {Number} length of a - * @function - */ - -var length = _quat_js__WEBPACK_IMPORTED_MODULE_1__.length; -/** - * Alias for {@link quat2.length} - * @function - */ - -var len = length; -/** - * Calculates the squared length of a dual quat - * - * @param {ReadonlyQuat2} a dual quat to calculate squared length of - * @returns {Number} squared length of a - * @function - */ - -var squaredLength = _quat_js__WEBPACK_IMPORTED_MODULE_1__.squaredLength; -/** - * Alias for {@link quat2.squaredLength} - * @function - */ - -var sqrLen = squaredLength; -/** - * Normalize a dual quat - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a dual quaternion to normalize - * @returns {quat2} out - * @function - */ - -function normalize(out, a) { - var magnitude = squaredLength(a); - - if (magnitude > 0) { - magnitude = Math.sqrt(magnitude); - var a0 = a[0] / magnitude; - var a1 = a[1] / magnitude; - var a2 = a[2] / magnitude; - var a3 = a[3] / magnitude; - var b0 = a[4]; - var b1 = a[5]; - var b2 = a[6]; - var b3 = a[7]; - var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3; - out[0] = a0; - out[1] = a1; - out[2] = a2; - out[3] = a3; - out[4] = (b0 - a0 * a_dot_b) / magnitude; - out[5] = (b1 - a1 * a_dot_b) / magnitude; - out[6] = (b2 - a2 * a_dot_b) / magnitude; - out[7] = (b3 - a3 * a_dot_b) / magnitude; - } - - return out; -} -/** - * Returns a string representation of a dual quatenion - * - * @param {ReadonlyQuat2} a dual quaternion to represent as a string - * @returns {String} string representation of the dual quat - */ - -function str(a) { - return "quat2(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ")"; -} -/** - * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyQuat2} a the first dual quaternion. - * @param {ReadonlyQuat2} b the second dual quaternion. - * @returns {Boolean} true if the dual quaternions are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7]; -} -/** - * Returns whether or not the dual quaternions have approximately the same elements in the same position. - * - * @param {ReadonlyQuat2} a the first dual quat. - * @param {ReadonlyQuat2} b the second dual quat. - * @returns {Boolean} true if the dual quats are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5], - a6 = a[6], - a7 = a[7]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3], - b4 = b[4], - b5 = b[5], - b6 = b[6], - b7 = b[7]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)); -} - -/***/ }), -/* 22 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "divide": () => (/* binding */ divide), -/* harmony export */ "ceil": () => (/* binding */ ceil), -/* harmony export */ "floor": () => (/* binding */ floor), -/* harmony export */ "min": () => (/* binding */ min), -/* harmony export */ "max": () => (/* binding */ max), -/* harmony export */ "round": () => (/* binding */ round), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), -/* harmony export */ "distance": () => (/* binding */ distance), -/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), -/* harmony export */ "length": () => (/* binding */ length), -/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), -/* harmony export */ "negate": () => (/* binding */ negate), -/* harmony export */ "inverse": () => (/* binding */ inverse), -/* harmony export */ "normalize": () => (/* binding */ normalize), -/* harmony export */ "dot": () => (/* binding */ dot), -/* harmony export */ "cross": () => (/* binding */ cross), -/* harmony export */ "lerp": () => (/* binding */ lerp), -/* harmony export */ "random": () => (/* binding */ random), -/* harmony export */ "transformMat2": () => (/* binding */ transformMat2), -/* harmony export */ "transformMat2d": () => (/* binding */ transformMat2d), -/* harmony export */ "transformMat3": () => (/* binding */ transformMat3), -/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), -/* harmony export */ "rotate": () => (/* binding */ rotate), -/* harmony export */ "angle": () => (/* binding */ angle), -/* harmony export */ "zero": () => (/* binding */ zero), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "len": () => (/* binding */ len), -/* harmony export */ "sub": () => (/* binding */ sub), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "div": () => (/* binding */ div), -/* harmony export */ "dist": () => (/* binding */ dist), -/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), -/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), -/* harmony export */ "forEach": () => (/* binding */ forEach) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); - -/** - * 2 Dimensional Vector - * @module vec2 - */ - -/** - * Creates a new, empty vec2 - * - * @returns {vec2} a new 2D vector - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[0] = 0; - out[1] = 0; - } - - return out; -} -/** - * Creates a new vec2 initialized with values from an existing vector - * - * @param {ReadonlyVec2} a vector to clone - * @returns {vec2} a new 2D vector - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); - out[0] = a[0]; - out[1] = a[1]; - return out; -} -/** - * Creates a new vec2 initialized with the given values - * - * @param {Number} x X component - * @param {Number} y Y component - * @returns {vec2} a new 2D vector - */ - -function fromValues(x, y) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); - out[0] = x; - out[1] = y; - return out; -} -/** - * Copy the values from one vec2 to another - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the source vector - * @returns {vec2} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - return out; -} -/** - * Set the components of a vec2 to the given values - * - * @param {vec2} out the receiving vector - * @param {Number} x X component - * @param {Number} y Y component - * @returns {vec2} out - */ - -function set(out, x, y) { - out[0] = x; - out[1] = y; - return out; -} -/** - * Adds two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - return out; -} -/** - * Subtracts vector b from vector a - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - return out; -} -/** - * Multiplies two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function multiply(out, a, b) { - out[0] = a[0] * b[0]; - out[1] = a[1] * b[1]; - return out; -} -/** - * Divides two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function divide(out, a, b) { - out[0] = a[0] / b[0]; - out[1] = a[1] / b[1]; - return out; -} -/** - * Math.ceil the components of a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to ceil - * @returns {vec2} out - */ - -function ceil(out, a) { - out[0] = Math.ceil(a[0]); - out[1] = Math.ceil(a[1]); - return out; -} -/** - * Math.floor the components of a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to floor - * @returns {vec2} out - */ - -function floor(out, a) { - out[0] = Math.floor(a[0]); - out[1] = Math.floor(a[1]); - return out; -} -/** - * Returns the minimum of two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function min(out, a, b) { - out[0] = Math.min(a[0], b[0]); - out[1] = Math.min(a[1], b[1]); - return out; -} -/** - * Returns the maximum of two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function max(out, a, b) { - out[0] = Math.max(a[0], b[0]); - out[1] = Math.max(a[1], b[1]); - return out; -} -/** - * Math.round the components of a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to round - * @returns {vec2} out - */ - -function round(out, a) { - out[0] = Math.round(a[0]); - out[1] = Math.round(a[1]); - return out; -} -/** - * Scales a vec2 by a scalar number - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the vector to scale - * @param {Number} b amount to scale the vector by - * @returns {vec2} out - */ - -function scale(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - return out; -} -/** - * Adds two vec2's after scaling the second operand by a scalar value - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @param {Number} scale the amount to scale b by before adding - * @returns {vec2} out - */ - -function scaleAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - return out; -} -/** - * Calculates the euclidian distance between two vec2's - * - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {Number} distance between a and b - */ - -function distance(a, b) { - var x = b[0] - a[0], - y = b[1] - a[1]; - return Math.hypot(x, y); -} -/** - * Calculates the squared euclidian distance between two vec2's - * - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {Number} squared distance between a and b - */ - -function squaredDistance(a, b) { - var x = b[0] - a[0], - y = b[1] - a[1]; - return x * x + y * y; -} -/** - * Calculates the length of a vec2 - * - * @param {ReadonlyVec2} a vector to calculate length of - * @returns {Number} length of a - */ - -function length(a) { - var x = a[0], - y = a[1]; - return Math.hypot(x, y); -} -/** - * Calculates the squared length of a vec2 - * - * @param {ReadonlyVec2} a vector to calculate squared length of - * @returns {Number} squared length of a - */ - -function squaredLength(a) { - var x = a[0], - y = a[1]; - return x * x + y * y; -} -/** - * Negates the components of a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to negate - * @returns {vec2} out - */ - -function negate(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - return out; -} -/** - * Returns the inverse of the components of a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to invert - * @returns {vec2} out - */ - -function inverse(out, a) { - out[0] = 1.0 / a[0]; - out[1] = 1.0 / a[1]; - return out; -} -/** - * Normalize a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to normalize - * @returns {vec2} out - */ - -function normalize(out, a) { - var x = a[0], - y = a[1]; - var len = x * x + y * y; - - if (len > 0) { - //TODO: evaluate use of glm_invsqrt here? - len = 1 / Math.sqrt(len); - } - - out[0] = a[0] * len; - out[1] = a[1] * len; - return out; -} -/** - * Calculates the dot product of two vec2's - * - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {Number} dot product of a and b - */ - -function dot(a, b) { - return a[0] * b[0] + a[1] * b[1]; -} -/** - * Computes the cross product of two vec2's - * Note that the cross product must by definition produce a 3D vector - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec3} out - */ - -function cross(out, a, b) { - var z = a[0] * b[1] - a[1] * b[0]; - out[0] = out[1] = 0; - out[2] = z; - return out; -} -/** - * Performs a linear interpolation between two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {vec2} out - */ - -function lerp(out, a, b, t) { - var ax = a[0], - ay = a[1]; - out[0] = ax + t * (b[0] - ax); - out[1] = ay + t * (b[1] - ay); - return out; -} -/** - * Generates a random vector with the given scale - * - * @param {vec2} out the receiving vector - * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned - * @returns {vec2} out - */ - -function random(out, scale) { - scale = scale || 1.0; - var r = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 * Math.PI; - out[0] = Math.cos(r) * scale; - out[1] = Math.sin(r) * scale; - return out; -} -/** - * Transforms the vec2 with a mat2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the vector to transform - * @param {ReadonlyMat2} m matrix to transform with - * @returns {vec2} out - */ - -function transformMat2(out, a, m) { - var x = a[0], - y = a[1]; - out[0] = m[0] * x + m[2] * y; - out[1] = m[1] * x + m[3] * y; - return out; -} -/** - * Transforms the vec2 with a mat2d - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the vector to transform - * @param {ReadonlyMat2d} m matrix to transform with - * @returns {vec2} out - */ - -function transformMat2d(out, a, m) { - var x = a[0], - y = a[1]; - out[0] = m[0] * x + m[2] * y + m[4]; - out[1] = m[1] * x + m[3] * y + m[5]; - return out; -} -/** - * Transforms the vec2 with a mat3 - * 3rd vector component is implicitly '1' - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the vector to transform - * @param {ReadonlyMat3} m matrix to transform with - * @returns {vec2} out - */ - -function transformMat3(out, a, m) { - var x = a[0], - y = a[1]; - out[0] = m[0] * x + m[3] * y + m[6]; - out[1] = m[1] * x + m[4] * y + m[7]; - return out; -} -/** - * Transforms the vec2 with a mat4 - * 3rd vector component is implicitly '0' - * 4th vector component is implicitly '1' - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the vector to transform - * @param {ReadonlyMat4} m matrix to transform with - * @returns {vec2} out - */ - -function transformMat4(out, a, m) { - var x = a[0]; - var y = a[1]; - out[0] = m[0] * x + m[4] * y + m[12]; - out[1] = m[1] * x + m[5] * y + m[13]; - return out; -} -/** - * Rotate a 2D vector - * @param {vec2} out The receiving vec2 - * @param {ReadonlyVec2} a The vec2 point to rotate - * @param {ReadonlyVec2} b The origin of the rotation - * @param {Number} rad The angle of rotation in radians - * @returns {vec2} out - */ - -function rotate(out, a, b, rad) { - //Translate point to the origin - var p0 = a[0] - b[0], - p1 = a[1] - b[1], - sinC = Math.sin(rad), - cosC = Math.cos(rad); //perform rotation and translate to correct position - - out[0] = p0 * cosC - p1 * sinC + b[0]; - out[1] = p0 * sinC + p1 * cosC + b[1]; - return out; -} -/** - * Get the angle between two 2D vectors - * @param {ReadonlyVec2} a The first operand - * @param {ReadonlyVec2} b The second operand - * @returns {Number} The angle in radians - */ - -function angle(a, b) { - var x1 = a[0], - y1 = a[1], - x2 = b[0], - y2 = b[1], - // mag is the product of the magnitudes of a and b - mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2), - // mag &&.. short circuits if mag == 0 - cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1 - - return Math.acos(Math.min(Math.max(cosine, -1), 1)); -} -/** - * Set the components of a vec2 to zero - * - * @param {vec2} out the receiving vector - * @returns {vec2} out - */ - -function zero(out) { - out[0] = 0.0; - out[1] = 0.0; - return out; -} -/** - * Returns a string representation of a vector - * - * @param {ReadonlyVec2} a vector to represent as a string - * @returns {String} string representation of the vector - */ - -function str(a) { - return "vec2(" + a[0] + ", " + a[1] + ")"; -} -/** - * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===) - * - * @param {ReadonlyVec2} a The first vector. - * @param {ReadonlyVec2} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1]; -} -/** - * Returns whether or not the vectors have approximately the same elements in the same position. - * - * @param {ReadonlyVec2} a The first vector. - * @param {ReadonlyVec2} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1]; - var b0 = b[0], - b1 = b[1]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)); +class Scene { + /** + * Creates an instance of Scene. + * You can see the default values in the property definitions + */ + constructor(settings = {}) { + /** + * Logical number, the drawer will take care of defining the unit of measure + */ + this.width = 400; + /** + * Logical number, the drawer will take care of defining the unit of measure + */ + this.height = 400; + /** + * Default background color (black) + */ + this.background = 'hsla(0, 0%, 0%, 1)'; + /** + * Default ScenePrimitive stroke color (white) + */ + this.color = 'hsla(0, 0%, 100%, 1)'; + /** + * Current time + */ + this.currentTime = 0; + if (typeof settings.width !== 'undefined') + this.width = settings.width; + if (typeof settings.height !== 'undefined') + this.height = settings.height; + if (typeof settings.background !== 'undefined') + this.background = settings.background; + if (typeof settings.color !== 'undefined') + this.color = settings.color; + this.children = []; + this.center = [this.width / 2, this.height / 2]; + this.anchor = + settings.anchor && Array.isArray(settings.anchor) + ? [ + typeof settings.anchor[0] === 'number' + ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[0]) * 0.5) * this.width + : settings.anchor[0] === 'left' + ? 0 + : settings.anchor[0] === 'right' + ? this.width + : this.center[0], + typeof settings.anchor[1] === 'number' + ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[1]) * 0.5) * this.height + : settings.anchor[1] === 'top' + ? 0 + : settings.anchor[1] === 'bottom' + ? this.height + : this.center[1], + ] + : [this.center[0], this.center[1]]; + } + /** + * Return width percentage + * + * @param {number} [percentage=100] + * @returns {number} + */ + getWidth(percentage = 100) { + return (this.width * percentage) / 100; + } + /** + * Return height percentage + * + * @param {number} [percentage=100] + * @returns {number} + */ + getHeight(percentage = 100) { + return (this.height * percentage) / 100; + } + /** + * Resize the scene size + * + * @param {number} width + * @param {number} [height=width] + * @memberof Scene + */ + resize(width, height = width) { + this.width = width; + this.height = height; + this.center = [this.width / 2, this.height / 2]; + const anchor = [this.width / this.anchor[0], this.height / this.anchor[1]]; + this.anchor = [this.width / anchor[0], this.height / anchor[1]]; + this.children.forEach(sceneChild => sceneChild.clearBuffer(true, false)); + } + /** + * Update all children, generate a streamable buffer for drawing + * + * @param {number} [atTime] time in ms + * @memberof Scene + */ + update(atTime = 0) { + this.currentTime = atTime; + for (let i = 0, len = this.children.length; i < len; i++) { + this.children[i].generate(this.currentTime, true); + } + } + /** + * Traverse the child buffer and use it with callback + * + * @param {(streamArguments: IStreamArguments) => void} callback + * @memberof Scene + */ + stream(callback) { + this.children.forEach(sceneChild => sceneChild.stream(callback)); + } + /* + |-------------------------------------------------------------------------- + | SceneChild + |-------------------------------------------------------------------------- + */ + /** + * Return a list of children + * + * @returns {Array} + * @memberof Scene + */ + getChildren() { + return this.children; + } + /** + * Add SceneChild to Scene, pass `order` as last parameter for drawing priorities + * + * @param {Array} items + * @param {number} [order] + * @memberof Scene + */ + add(...items /**, order: number */) { + const order = typeof items[items.length - 1] === 'number' ? items[items.length - 1] : undefined; + const len = items.length - (typeof order === 'undefined' ? 0 : 1); + for (let i = 0; i < len; i++) { + const item = items[i]; + item.order = + typeof order !== 'undefined' + ? order + i + : typeof item.order !== 'undefined' + ? item.order + : this.children.length > 0 + ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1 + : 0; + Scene.propagateToChilden(item, this); + this.children.push(item); + item.clearBuffer(true, false); + item.generate(0, true); + } + this.sortChildren(); + } + /** + * Sort children by order + * + * @memberof Scene + */ + sortChildren() { + this.children.sort((a, b) => a.order - b.order); + this.children = this.children.map((child, index) => { + child.order = index; + return child; + }); + } + /** + * Find sceneChild from id or name in the whole scene + * + * @param {string | number} idOrName + * @returns {(SceneChild | null)} + * @memberof Scene + */ + find(idOrName) { + const children = this.getChildren(); + for (let i = 0, len = children.length; i < len; i++) { + const result = children[i].find(idOrName); + if (result !== null) + return result; + } + return null; + } + /** + * Get shape by index + * + * @param {number} index + * @returns {(SceneChild | null)} + * @memberof Scene + */ + get(index) { + return index >= 0 && index < this.children.length ? this.children[index] : null; + } + /** + * Remove a shape by index + * + * @param {number} index + * @memberof Scene + */ + remove(index) { + index >= 0 && index < this.children.length && this.children.splice(index, 1); + } + /** + * Removes all children + * + * @memberof Scene + */ + removeChildren() { + this.children = []; + } + /** + * Remove sceneChild by id or name + * + * @param {number | number} idOrName + * @memberof Scene + */ + removeFromId(idOrName) { + for (let i = 0, len = this.children.length; i < len; i++) + if (this.children[i].id === idOrName || this.children[i].name === idOrName) { + this.children.splice(i, 1); + return; + } + } + /** + * Return true if sceneChild is direct children + * + * @param {SceneChild} sceneChild + * @returns {boolean} + * @memberof Scene + */ + isFirstLevelChild(sceneChild) { + for (let i = 0, len = this.children.length; i < len; i++) + if (this.children[i].id === sceneChild.id) + return true; + const parents = this.getParentsOfSceneChild(sceneChild); + return parents.length === 1 && parents[0] instanceof Group_1.Group; + } + /** + * Returns the list of sceneChild hierarchy starting from the scene + * + * @param {SceneChild} sceneChild + * @returns {Array} + * @memberof Scene + */ + getParentsOfSceneChild(sceneChild) { + const result = Scene.getParentsOfSceneChild(this, sceneChild); + if (result) { + result.splice(0, 1); + return result; + } + return []; + } + /** + * Returns the list of sceneChild hierarchy starting from the scene + * + * @static + * @param {(Scene | SceneChild)} current + * @param {SceneChild} sceneChild + * @param {(Array)} [parents=[]] + * @returns {(Array | null)} + * @memberof Scene + */ + static getParentsOfSceneChild(current, sceneChild, parents = []) { + let result; + if (current instanceof SceneChild_1.SceneChild) { + if (current.id == sceneChild.id) + return parents; + if (current instanceof Shape_1.Shape && current.shape) { + const tmpParents = parents.slice(); + tmpParents.push(current); + if ((result = Scene.getParentsOfSceneChild(current.shape, sceneChild, tmpParents))) + return result; + } + } + if (current instanceof Scene || current instanceof Group_1.Group) { + const children = current.getChildren(); + parents.push(current); + for (let i = 0, len = children.length; i < len; i++) { + const child = children[i]; + if ((result = Scene.getParentsOfSceneChild(child, sceneChild, parents))) + return result; + } + parents.pop(); + } + return null; + } + /** + * Walk through the scene + * + * @static + * @param {SceneChild} callbackk + * @param {(Scene | SceneChild)} current + * @memberof Scene + */ + static walk(callback, current) { + if (current instanceof SceneChild_1.SceneChild) { + if (callback(current) === false) + return false; + if (current instanceof Shape_1.Shape && current.shape) + if (Scene.walk(callback, current.shape) === false) + return false; + } + if (current instanceof Scene || current instanceof Group_1.Group) { + const children = current.getChildren(); + for (let i = 0, len = children.length; i < len; i++) { + const child = children[i]; + if (Scene.walk(callback, child) === false) + return false; + } + } + } + /** + * Propagate scene to sceneChild (and children) + * + * @static + * @param {SceneChild} sceneChild + * @param {Scene} scene + * @memberof Scene + */ + static propagateToChilden(sceneChild, scene) { + sceneChild.scene = scene; + if (sceneChild instanceof Group_1.Group) { + sceneChild.getChildren().forEach((item) => { + Scene.propagateToChilden(item, scene); + }); + } + else if (sceneChild instanceof Shape_1.Shape && sceneChild.shape) { + sceneChild.shape.scene = scene; + Scene.propagateToChilden(sceneChild.shape, scene); + } + } } -/** - * Alias for {@link vec2.length} - * @function - */ +exports.Scene = Scene; +//# sourceMappingURL=Scene.js.map -var len = length; -/** - * Alias for {@link vec2.subtract} - * @function - */ +/***/ }), +/* 4 */ +/***/ ((__unused_webpack_module, exports) => { -var sub = subtract; -/** - * Alias for {@link vec2.multiply} - * @function - */ +"use strict"; -var mul = multiply; -/** - * Alias for {@link vec2.divide} - * @function +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SceneChild = void 0; +/** + * Autoincrement sceneChild default id + * + * @internal + * @ignore */ - -var div = divide; -/** - * Alias for {@link vec2.distance} - * @function +let __id = 0; +/** + * The element to be added into a scene. + * Preserve props, drawing order, generate and return buffers. + * The only implementations of this class are Group and ShapeBase + * + * @abstract + * @category Core.Abstract + * @order 2 + * @class SceneChild */ +class SceneChild { + /** + * Creates an instance of SceneChild. + * Base values will be assigned in case they are not passed + * + * @param {ISceneChildSettings} settings + */ + constructor(settings) { + var _a; + /** + * Shape generation id + * used for prevent buffer calculation + * + * @internal + * @ignore + */ + this.generateId = -1; + this.id = (_a = settings.id) !== null && _a !== void 0 ? _a : ++__id; + this.type = settings.type || 'SceneChild'; + this.name = settings.name || this.type + '_' + this.id; + this.data = settings.data || {}; + this.props = {}; + } + /** + * Find this or form or children. + * Overridden by classes that extend it + * + * @param {string | number} idOrName + * @returns {(SceneChild | null)} + */ + find(idOrName) { + if (this.id === idOrName || this.name === idOrName) + return this; + return null; + } + /** + * Return the sceneChild properties + * + * @returns {Props} + */ + getProps() { + return this.props; + } + /** + * Return a sceneChild prop or default value + * + * @param {keyof Props} key + * @param {PropArguments} [propArguments] + * @param {*} [defaultValue] + * @returns {*} + */ + getProp(key, propArguments, defaultValue) { + var _a; + return ((_a = this.props[key]) !== null && _a !== void 0 ? _a : defaultValue); + } + /** + * Check SceneChild has prop + * + * @param {keyof Props} key + * @returns + */ + hasProp(key) { + return typeof this.props[key] !== 'undefined'; + } + /** + * Set a single or multiple props + * + * @param {(keyof ISceneChildProps | ISceneChildProps)} key + * @param {*} [value] + */ + setPropUnsafe(key, value) { + if (typeof key == 'string') + this.props[key] = value; + else + Object.keys(key).forEach((k) => (this.props[k] = key[k])); + } +} +exports.SceneChild = SceneChild; +//# sourceMappingURL=SceneChild.js.map -var dist = distance; -/** - * Alias for {@link vec2.squaredDistance} - * @function - */ +/***/ }), +/* 5 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { -var sqrDist = squaredDistance; -/** - * Alias for {@link vec2.squaredLength} - * @function - */ +"use strict"; -var sqrLen = squaredLength; -/** - * Perform some operation over an array of vec2s. - * - * @param {Array} a the array of vectors to iterate over - * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed - * @param {Number} offset Number of elements to skip at the beginning of the array - * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array - * @param {Function} fn Function to call for each vector in the array - * @param {Object} [arg] additional argument to pass to fn - * @returns {Array} a - * @function +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Group = void 0; +const Scene_1 = __webpack_require__(3); +const SceneChild_1 = __webpack_require__(4); +const ShapeBase_1 = __webpack_require__(6); +const Adapt_1 = __webpack_require__(30); +/** + * A SceneChild container, propagates properties to children + * + * @order 3 + * @category Core.Scene + * @extends {SceneChild} + * @example + * ```javascript + * // Group example + * + * const rect = new Urpflanze.Rect({ + * distance: 100 // <- if a property is set the group will not overwrite it + * }) + * const group = new Urpflanze.Group({ + * repetitions: 3, + * distance: 200 + * }) + * + * group.add(rect) + * group.add(new Urpflanze.Triangle()) + * ``` + * @class Group */ - -var forEach = function () { - var vec = create(); - return function (a, stride, offset, count, fn, arg) { - var i, l; - - if (!stride) { - stride = 2; +class Group extends SceneChild_1.SceneChild { + /** + * Creates an instance of Group + * + * @param {ISceneChildSettings} [settings={}] + * @memberof Group + */ + constructor(settings = {}) { + settings.type = 'Group'; + super(settings); + this.children = []; + ['id', 'name', 'data', 'order', 'type'].forEach((prop) => { + if (prop in settings) + delete settings[prop]; + }); + this.props = settings; + } + /** + * Check group has static children + * + * @returns {boolean} + * @memberof Group + */ + isStatic() { + const children = this.children; + for (let i = 0, len = children.length; i < len; i++) + if (!children[i].isStatic()) + return false; + return true; + } + /** + * Check group has static children indexed + * + * @returns {boolean} + * @memberof Group + */ + isStaticIndexed() { + const children = this.children; + for (let i = 0, len = children.length; i < len; i++) + if (!children[i].isStaticIndexed()) + return false; + return true; + } + /** + * Add item to Group + * + * @param {Array} items + * @memberof Group + */ + add(...items) { + for (let i = 0, len = items.length; i < len; i++) { + const item = items[i]; + const rawItemProps = item.getProps(); + Object.keys(this.props).forEach((propKey) => { + if (typeof rawItemProps[propKey] === 'undefined') + item.setProp(propKey, this.props[propKey]); + }); + item.order = + typeof item.order !== 'undefined' + ? item.order + : this.children.length > 0 + ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1 + : 0; + this.scene && Scene_1.Scene.propagateToChilden(item, this.scene); + this.children.push(item); + } + this.sortChildren(); + } + /** + * Sort children + * + * @memberof Group + */ + sortChildren() { + this.children.sort((a, b) => a.order - b.order); + this.children = this.children.map((child, index) => { + child.order = index; + return child; + }); + this.clearBuffer(true); + } + /** + * Return shape children + * + * @returns {Array} + * @memberof Group + */ + getChildren() { + return this.children; + } + /** + * Find scene child from id or name + * + * @param {number | string} idOrName + * @returns {(SceneChild | null)} + * @memberof Group + */ + find(idOrName) { + if (this.id === idOrName || this.name === idOrName) + return this; + const children = this.getChildren(); + for (let i = 0, len = children.length; i < len; i++) { + const result = children[i].find(idOrName); + if (result !== null) + return result; + } + return null; + } + /** + * Get item from group + * + * @param {number} index + * @returns {(SceneChild | null)} + * @memberof Group + */ + get(index) { + return index >= 0 && index < this.children.length ? this.children[index] : null; + } + /** + * Remove item from group + * + * @param {number} index + * @returns {(false | Array)} + * @memberof Group + */ + remove(index) { + if (index >= 0 && index < this.children.length) { + const removed = this.children.splice(index, 1); + this.clearBuffer(true); + return removed; + } + return false; + } + /** + * Remove from id + * + * @param {number} id + * @memberof Scene + */ + removeFromId(id) { + for (let i = 0, len = this.children.length; i < len; i++) { + if (this.children[i].id == id) { + this.children.splice(i, 1); + return this.clearBuffer(true); + } + } + } + /** + * Generate children buffers + * + * @param {number} generateId + * @param {boolean} [bDirectSceneChild=false] + * @param {IPropArguments} [parentPropArguments] + * @memberof Group + */ + generate(generateId, bDirectSceneChild = false, parentPropArguments) { + this.generateId = generateId; + this.children.forEach(item => item.generate(generateId, bDirectSceneChild, parentPropArguments)); + } + /** + * Sum the children bounding + * + * @return {IShapeBounding} + */ + getBounding() { + const boundings = []; + const bounding = Adapt_1.Bounding.empty(); + if (this.children.length > 0) { + this.children.forEach(item => boundings.push(item.getBounding())); + for (let i = 0, len = this.children.length; i < len; i++) { + bounding.x = bounding.x > boundings[i].x ? boundings[i].x : bounding.x; + bounding.y = bounding.y > boundings[i].y ? boundings[i].y : bounding.y; + bounding.width = bounding.width < boundings[i].width ? boundings[i].width : bounding.width; + bounding.height = bounding.height < boundings[i].height ? boundings[i].height : bounding.height; + } + bounding.cx = bounding.x + bounding.width / 2; + bounding.cy = bounding.y + bounding.height / 2; + } + return bounding; + } + /** + * Chear children buffer + * + * @param {boolean} [bClearIndexed=false] + * @param {boolean} [bPropagateToParents=false] + * @memberof Group + */ + clearBuffer(bClearIndexed = false, bPropagateToParents = true) { + this.children.forEach(item => item.clearBuffer(bClearIndexed, false)); + if (this.scene && bPropagateToParents) { + const parents = this.scene.getParentsOfSceneChild(this); + parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */); + } + // if (bPropagateToParents && this.scene) + // { + // const parents = this.scene.getParentsOfSceneChild(this) + // parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, true, false) + // } + // if (bPropagateToChildren) + // { + // this.children.forEach(sceneChild => sceneChild.clearBuffer(bClearIndexed, false, true)) + // } } - - if (!offset) { - offset = 0; + /** + * Set a single or multiple props + * + * @abstract + * @param {(keyof ISceneChildProps | ISceneChildProps)} key + * @param {*} [value] + * @memberof SceneChild + */ + setProp(key, value) { + if (typeof key === 'object') + Object.keys(key).forEach((k) => (this.props[k] = key[k])); + else + this.props[key] = value; + this.children.forEach(item => item.setProp(key, value)); } - - if (count) { - l = Math.min(count * stride + offset, a.length); - } else { - l = a.length; + /** + * Set a single or multiple props + * + * @param {(keyof ISceneChildProps | ISceneChildProps)} key + * @param {*} [value] + * @memberof ShapeBase + */ + setPropUnsafe(key, value) { + super.setPropUnsafe(key, value); + this.children.forEach(item => item.setPropUnsafe(key, value)); } - - for (i = offset; i < l; i += stride) { - vec[0] = a[i]; - vec[1] = a[i + 1]; - fn(vec, vec, arg); - a[i] = vec[0]; - a[i + 1] = vec[1]; + /** + * Return length of buffer + * + * @param {IPropArguments} propArguments + * @returns {number} + * @memberof Group + */ + getBufferLength(propArguments) { + return this.children.map(sceneChild => sceneChild.getBufferLength(propArguments)).reduce((p, c) => p + c, 0); } - - return a; - }; -}(); + /** + * return a single buffer binded from children + * + * @returns {Float32Array} + * @memberof Group + */ + getBuffer() { + const buffers = this.children + .map(item => item.getBuffer()) + .filter(b => b !== undefined); + const size = buffers.reduce((currLength, buffer) => currLength + buffer.length, 0); + if (size > 0) { + const result = new Float32Array(size); + result.set(buffers[0], 0); + for (let i = 1, offset = 0, len = buffers.length; i < len; i++) { + offset += buffers[i - 1].length; + result.set(buffers[i], offset); + } + return result; + } + return ShapeBase_1.ShapeBase.EMPTY_BUFFER; + } + /** + * return a single buffer binded from children + * + * @returns {(Array | undefined)} + * @memberof Group + */ + getIndexedBuffer() { + const indexed = this.children.map(item => item.getIndexedBuffer()).filter(b => b !== undefined); + return [].concat.apply([], indexed); + } + /** + * Call strem on children + * + * @param {(streamArguments: IStreamArguments) => void} callback + * @memberof Group + */ + stream(callback) { + this.children.forEach(item => item.stream(callback)); + } +} +exports.Group = Group; +//# sourceMappingURL=Group.js.map /***/ }), -/* 23 */ +/* 6 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Scene = void 0; -const SceneChild_1 = __webpack_require__(24); -const Group_1 = __webpack_require__(25); -const Shape_1 = __webpack_require__(34); +exports.ShapeBase = void 0; +const gl_matrix_1 = __webpack_require__(7); +const types_1 = __webpack_require__(18); +const glme = __webpack_require__(27); +const Vec2_1 = __webpack_require__(28); +const math_1 = __webpack_require__(29); +const Adapt_1 = __webpack_require__(30); const Utilities_1 = __webpack_require__(32); +const SceneChild_1 = __webpack_require__(4); +const tmpMatrix = gl_matrix_1.mat4.create(); +const transformMatrix = gl_matrix_1.mat4.create(); +const perspectiveMatrix = gl_matrix_1.mat4.create(); +const repetitionMatrix = gl_matrix_1.mat4.create(); /** - * Container for all SceneChild. - * The main purpose is to manage the drawing order and update the child buffers + * Main class for shape generation * - * @order 1 - * @category Core.Scene - * @class Scene + * @category Core.Abstract + * @abstract + * @class ShapeBase + * @order 4 + * @extends {SceneChild} */ -class Scene { +class ShapeBase extends SceneChild_1.SceneChild { /** - * Creates an instance of Scene. - * You can see the default values in the property definitions + * Creates an instance of ShapeBase + * + * @param {ISceneChildSettings} [settings={}] */ constructor(settings = {}) { + super(settings); /** - * Logical number, the drawer will take care of defining the unit of measure - */ - this.width = 400; - /** - * Logical number, the drawer will take care of defining the unit of measure - */ - this.height = 400; - /** - * Default background color (black) + * Flag used to determine if indexedBuffer has been generated + * + * @internal + * @ignore */ - this.background = 'hsla(0, 0%, 0%, 1)'; + this.bIndexed = false; /** - * Default ScenePrimitive stroke color (white) + * Array used for index a vertex buffer + * only for first level scene children + * + * @internal + * @ignore */ - this.color = 'hsla(0, 0%, 100%, 1)'; + this.indexedBuffer = []; /** - * Current time + * The bounding inside the scene + * + * @type {IShapeBounding} */ - this.currentTime = 0; - if (typeof settings.width !== 'undefined') - this.width = settings.width; - if (typeof settings.height !== 'undefined') - this.height = settings.height; - if (typeof settings.background !== 'undefined') - this.background = settings.background; - if (typeof settings.color !== 'undefined') - this.color = settings.color; - this.children = []; - this.center = [this.width / 2, this.height / 2]; + this.bounding = { + cx: 0, + cy: 0, + x: -1, + y: -1, + width: 2, + height: 2, + }; + this.props = { + distance: settings.distance, + repetitions: settings.repetitions, + rotateX: settings.rotateX, + rotateY: settings.rotateY, + rotateZ: settings.rotateZ, + skewX: settings.skewX, + skewY: settings.skewY, + squeezeX: settings.squeezeX, + squeezeY: settings.squeezeY, + displace: settings.displace, + translate: settings.translate, + scale: settings.scale, + transformOrigin: settings.transformOrigin, + perspective: settings.perspective, + perspectiveOrigin: settings.perspectiveOrigin, + }; this.anchor = settings.anchor && Array.isArray(settings.anchor) ? [ typeof settings.anchor[0] === 'number' - ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[0]) * 0.5) * this.width + ? Utilities_1.clamp(-1, 1, settings.anchor[0]) * -1 : settings.anchor[0] === 'left' - ? 0 + ? 1 : settings.anchor[0] === 'right' - ? this.width - : this.center[0], + ? -1 + : 0, typeof settings.anchor[1] === 'number' - ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[1]) * 0.5) * this.height + ? Utilities_1.clamp(-1, 1, settings.anchor[1]) * -1 : settings.anchor[1] === 'top' - ? 0 - : settings.anchor[1] === 'bottom' - ? this.height - : this.center[1], - ] - : [this.center[0], this.center[1]]; - } - /** - * Return width percentage - * - * @param {number} [percentage=100] - * @returns {number} - */ - getWidth(percentage = 100) { - return (this.width * percentage) / 100; - } - /** - * Return height percentage - * - * @param {number} [percentage=100] - * @returns {number} - */ - getHeight(percentage = 100) { - return (this.height * percentage) / 100; - } - /** - * Resize the scene size - * - * @param {number} width - * @param {number} [height=width] - * @memberof Scene - */ - resize(width, height = width) { - this.width = width; - this.height = height; - this.center = [this.width / 2, this.height / 2]; - const anchor = [this.width / this.anchor[0], this.height / this.anchor[1]]; - this.anchor = [this.width / anchor[0], this.height / anchor[1]]; - this.children.forEach(sceneChild => sceneChild.clearBuffer(true, false)); + ? 1 + : settings.anchor[1] === 'bottom' + ? -1 + : 0, + ] + : [0, 0]; + this.boundingType = + typeof settings.boundingType === 'string' + ? settings.boundingType === 'relative' + ? types_1.EBoundingType.Relative + : types_1.EBoundingType.Fixed + : settings.boundingType || types_1.EBoundingType.Fixed; + this.vertexCallback = settings.vertexCallback; } /** - * Update all children, generate a streamable buffer for drawing + * Check if the shape should be generated every time * - * @param {number} [atTime] time in ms - * @memberof Scene + * @returns {boolean} */ - update(atTime = 0) { - this.currentTime = atTime; - for (let i = 0, len = this.children.length; i < len; i++) { - this.children[i].generate(this.currentTime, true); - } + isStatic() { + const props = this.props; + return (typeof props.repetitions !== 'function' && + typeof props.distance !== 'function' && + typeof props.displace !== 'function' && + typeof props.scale !== 'function' && + typeof props.translate !== 'function' && + typeof props.skewX !== 'function' && + typeof props.skewY !== 'function' && + typeof props.squeezeX !== 'function' && + typeof props.squeezeY !== 'function' && + typeof props.rotateX !== 'function' && + typeof props.rotateY !== 'function' && + typeof props.rotateZ !== 'function' && + typeof props.transformOrigin !== 'function' && + typeof props.perspective !== 'function' && + typeof props.perspectiveOrigin !== 'function'); } /** - * Traverse the child buffer and use it with callback + * Check if the indexedBuffer array needs to be recreated every time, + * this can happen when a shape generates an array of vertices different in length at each repetition * - * @param {(streamArguments: IStreamArguments) => void} callback - * @memberof Scene + * @returns {boolean} */ - stream(callback) { - this.children.forEach(sceneChild => sceneChild.stream(callback)); + isStaticIndexed() { + return typeof this.props.repetitions !== 'function'; } - /* - |-------------------------------------------------------------------------- - | SceneChild - |-------------------------------------------------------------------------- - */ /** - * Return a list of children + * Return a prop value * - * @returns {Array} - * @memberof Scene + * @param {keyof ISceneChildProps} key + * @param {PropArguments} [propArguments] + * @param {*} [defaultValue] + * @returns {*} */ - getChildren() { - return this.children; + getProp(key, propArguments, defaultValue) { + let attribute = this.props[key]; + if (typeof attribute === 'function') { + attribute = attribute(propArguments); + } + return typeof attribute === 'undefined' || Number.isNaN(attribute) ? defaultValue : attribute; } /** - * Add SceneChild to Scene, pass `order` as last parameter for drawing priorities + * Set a single or multiple props * - * @param {Array} items - * @param {number} [order] - * @memberof Scene + * @param {(keyof ISceneChildProps | ISceneChildProps)} key + * @param {*} [value] + * @param {boolean} [bClearIndexed=false] */ - add(...items /**, order: number */) { - const order = typeof items[items.length - 1] === 'number' ? items[items.length - 1] : undefined; - const len = items.length - (typeof order === 'undefined' ? 0 : 1); - for (let i = 0; i < len; i++) { - const item = items[i]; - item.order = - typeof order !== 'undefined' - ? order + i - : typeof item.order !== 'undefined' - ? item.order - : this.children.length > 0 - ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1 - : 0; - Scene.propagateToChilden(item, this); - this.children.push(item); - item.clearBuffer(true, false); - item.generate(0, true); + setProp(key, value, bClearIndexed = false) { + if (typeof key === 'string') { + bClearIndexed = bClearIndexed || key == 'repetitions'; + this.props[key] = value; } - this.sortChildren(); + else { + bClearIndexed = bClearIndexed || 'repetitions' in key; + Object.keys(key).forEach((k) => (this.props[k] = key[k])); + } + this.clearBuffer(bClearIndexed, true); } /** - * Sort children by order + * Unset buffer * - * @memberof Scene + * @param {boolean} [bClearIndexed=false] + * @param {boolean} [bPropagateToParents=false] + * @param {boolean} [bPropagateToChildren=false] */ - sortChildren() { - this.children.sort((a, b) => a.order - b.order); - this.children = this.children.map((child, index) => { - child.order = index; - return child; - }); + clearBuffer(bClearIndexed = false, bPropagateToParents = true) { + this.buffer = undefined; + if (bClearIndexed) { + this.bIndexed = false; + this.indexedBuffer = []; + } + this.bStatic = this.isStatic(); + this.bStaticIndexed = this.isStaticIndexed(); + if (bPropagateToParents && this.scene && !this.scene.isFirstLevelChild(this)) { + const parents = this.scene.getParentsOfSceneChild(this); + parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */); + } } /** - * Find sceneChild from id or name in the whole scene + * Update the vertex array if the shape is not static and update the indexedBuffer if it is also not static * - * @param {string | number} idOrName - * @returns {(SceneChild | null)} - * @memberof Scene + * @param {number} generateId generation id + * @param {boolean} [bDirectSceneChild=false] adjust shape of center of scene + * @param {PropArguments} [parentPropArguments] */ - find(idOrName) { - const children = this.getChildren(); - for (let i = 0, len = children.length; i < len; i++) { - const result = children[i].find(idOrName); - if (result !== null) - return result; + generate(generateId = 0, bDirectSceneChild = false, parentPropArguments) { + var _a, _b; + if (this.buffer && this.bStatic) { + return; + } + this.generateId = generateId; + if (!this.bStaticIndexed || !this.bIndexed) + this.indexedBuffer = []; + const propArguments = ShapeBase.getEmptyPropArguments(this, parentPropArguments); + const repetition = propArguments.repetition; + const repetitions = this.getProp('repetitions', propArguments, 1); + const repetitionType = Array.isArray(repetitions) ? types_1.ERepetitionType.Matrix : types_1.ERepetitionType.Ring; + const repetitionCount = Array.isArray(repetitions) + ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) + : repetitions; + const repetitionRowCount = Array.isArray(repetitions) ? repetitions[0] : repetitionCount; + const repetitionColCount = Array.isArray(repetitions) ? (_b = repetitions[1]) !== null && _b !== void 0 ? _b : repetitions[0] : 1; + const rowRepetition = repetition.row; + rowRepetition.count = repetitionRowCount; + const colRepetition = repetition.col; + colRepetition.count = repetitionColCount; + repetition.count = repetitionCount; + repetition.col.count = repetitionColCount; + repetition.row.count = repetitionRowCount; + repetition.type = repetitionType; + let totalBufferLength = 0; + const buffers = []; + let currentIndex = 0; + const centerMatrix = gl_matrix_1.vec2.fromValues((repetitionColCount - 1) / 2, (repetitionRowCount - 1) / 2); + const sceneAnchor = this.scene ? [this.scene.anchor[0], this.scene.anchor[1], 0] : [0, 0, 0]; + const tmpTotalShapeBounding = [undefined, undefined, undefined, undefined]; + const tmpSingleRepetitionBounding = [undefined, undefined, undefined, undefined]; + for (let currentRowRepetition = 0; currentRowRepetition < repetitionRowCount; currentRowRepetition++) { + for (let currentColRepetition = 0; currentColRepetition < repetitionColCount; currentColRepetition++, currentIndex++) { + repetition.index = currentIndex + 1; + repetition.offset = repetitionCount > 1 ? currentIndex / (repetitionCount - 1) : 1; + repetition.angle = repetitionType === types_1.ERepetitionType.Ring ? (math_1.PI2 / repetitionCount) * currentIndex : 0; + colRepetition.index = currentColRepetition + 1; + colRepetition.offset = repetitionColCount > 1 ? currentColRepetition / (repetitionColCount - 1) : 1; + rowRepetition.index = currentRowRepetition + 1; + rowRepetition.offset = repetitionRowCount > 1 ? currentRowRepetition / (repetitionRowCount - 1) : 1; + // Generate primitives buffer recursively + const buffer = this.generateBuffer(generateId, propArguments); + const bufferLength = buffer.length; + const bounding = this.getShapeBounding(); + buffers[currentIndex] = new Float32Array(bufferLength); + totalBufferLength += bufferLength; + { + const distance = glme.toVec2(this.getProp('distance', propArguments, glme.VEC2_ZERO)); + const displace = this.getProp('displace', propArguments, 0); + const scale = glme.toVec3(this.getProp('scale', propArguments, glme.VEC2_ONE), 1); + const translate = glme.toVec3(this.getProp('translate', propArguments, glme.VEC2_ZERO), 0); + const skewX = this.getProp('skewX', propArguments, 0); + const skewY = this.getProp('skewY', propArguments, 0); + const squeezeX = this.getProp('squeezeX', propArguments, 0); + const squeezeY = this.getProp('squeezeY', propArguments, 0); + const rotateX = this.getProp('rotateX', propArguments, 0); + const rotateY = this.getProp('rotateY', propArguments, 0); + const rotateZ = this.getProp('rotateZ', propArguments, 0); + const perspective = Utilities_1.clamp(0, 1, this.getProp('perspective', propArguments, 0)); + const perspectiveOrigin = glme.toVec3(this.getProp('perspectiveOrigin', propArguments, glme.VEC2_ZERO), 0); + const transformOrigin = glme.toVec3(this.getProp('transformOrigin', propArguments, glme.VEC2_ZERO), 0); + let offset; + switch (repetitionType) { + case types_1.ERepetitionType.Ring: + offset = gl_matrix_1.vec3.fromValues(distance[0], 0, 0); + gl_matrix_1.vec3.rotateZ(offset, offset, glme.VEC3_ZERO, repetition.angle + displace); + break; + case types_1.ERepetitionType.Matrix: + offset = gl_matrix_1.vec3.fromValues(distance[1] * (currentColRepetition - centerMatrix[0]), distance[0] * (currentRowRepetition - centerMatrix[1]), 0); + break; + } + const perspectiveSize = perspective > 0 ? Math.max(bounding.width, bounding.height) / 2 : 1; + const perspectiveValue = perspective > 0 ? perspectiveSize + (1 - perspective) * (perspectiveSize * 10) : 0; + const bTransformOrigin = (this.boundingType === types_1.EBoundingType.Relative ? bounding.cx !== 0 || bounding.cy !== 0 : true) || + perspective !== 0 || + transformOrigin[0] !== 0 || + transformOrigin[1] !== 0; + const bPerspectiveOrigin = perspectiveOrigin[0] !== 0 || perspectiveOrigin[1] !== 0; + if (bTransformOrigin) { + if (this.boundingType === types_1.EBoundingType.Relative) { + transformOrigin[0] = transformOrigin[0] * (bounding.width / 2) + bounding.cx; + transformOrigin[1] = transformOrigin[1] * (bounding.height / 2) + bounding.cy; + } + else { + transformOrigin[0] *= bounding.width / 2; + transformOrigin[1] *= bounding.height / 2; + } + transformOrigin[2] = perspectiveValue; + } + /** + * Create Matrices + */ + { + /** + * Create Transformation matrix + */ + gl_matrix_1.mat4.identity(transformMatrix); + bTransformOrigin && gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, transformOrigin); + if (translate[0] !== 0 || translate[1] !== 0) + gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, translate); + if (skewX !== 0 || skewY !== 0) { + glme.fromSkew(tmpMatrix, [skewX, skewY]); + gl_matrix_1.mat4.multiply(transformMatrix, transformMatrix, tmpMatrix); + } + rotateX !== 0 && gl_matrix_1.mat4.rotateX(transformMatrix, transformMatrix, rotateX); + rotateY !== 0 && gl_matrix_1.mat4.rotateY(transformMatrix, transformMatrix, rotateY); + rotateZ !== 0 && gl_matrix_1.mat4.rotateZ(transformMatrix, transformMatrix, rotateZ); + if (scale[0] !== 1 || scale[1] !== 1) + gl_matrix_1.mat4.scale(transformMatrix, transformMatrix, scale); + bTransformOrigin && + gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, gl_matrix_1.vec3.scale(transformOrigin, transformOrigin, -1)); + /** + * Create Perspective matrix + */ + if (perspectiveValue > 0) { + if (bPerspectiveOrigin) { + if (this.boundingType === types_1.EBoundingType.Relative) { + perspectiveOrigin[0] = perspectiveOrigin[0] * (bounding.width / 2) + bounding.cx; + perspectiveOrigin[1] = perspectiveOrigin[1] * (bounding.height / 2) + bounding.cy; + } + else { + perspectiveOrigin[0] *= bounding.width / 2; + perspectiveOrigin[1] *= bounding.height / 2; + } + perspectiveOrigin[2] = 0; + } + gl_matrix_1.mat4.perspective(perspectiveMatrix, -Math.PI / 2, 1, 0, Infinity); + } + /** + * Create Repetition matrix + */ + gl_matrix_1.mat4.identity(repetitionMatrix); + gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, offset); + if (bDirectSceneChild) { + gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, sceneAnchor); + } + /** + * Apply anchor + */ + const shapeAnchor = [this.anchor[0] * (bounding.width / 2), this.anchor[1] * (bounding.height / 2), 0]; + gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, shapeAnchor); + if (repetitionType === types_1.ERepetitionType.Ring) + gl_matrix_1.mat4.rotateZ(repetitionMatrix, repetitionMatrix, repetition.angle + displace); + } + Adapt_1.Bounding.clear(tmpSingleRepetitionBounding); + // Apply matrices on vertex + for (let bufferIndex = 0; bufferIndex < bufferLength; bufferIndex += 2) { + const vertex = [buffer[bufferIndex], buffer[bufferIndex + 1], perspectiveValue]; + { + // Apply squeeze, can be insert into transformMatrix? + squeezeX !== 0 && Vec2_1.default.squeezeX(vertex, squeezeX); + squeezeY !== 0 && Vec2_1.default.squeezeY(vertex, squeezeY); + // Apply transforms + gl_matrix_1.vec3.transformMat4(vertex, vertex, transformMatrix); + // Apply perspective + if (perspectiveValue > 0) { + bPerspectiveOrigin && gl_matrix_1.vec3.add(vertex, vertex, perspectiveOrigin); + gl_matrix_1.vec3.transformMat4(vertex, vertex, perspectiveMatrix); + gl_matrix_1.vec3.scale(vertex, vertex, perspectiveValue); + bPerspectiveOrigin && gl_matrix_1.vec3.sub(vertex, vertex, perspectiveOrigin); + } + // apply repetition matrix + gl_matrix_1.vec3.transformMat4(vertex, vertex, repetitionMatrix); + // custom vertex manipulation + if (typeof this.vertexCallback !== 'undefined') { + const index = bufferIndex / 2; + const count = bufferLength / 2; + const vertexRepetition = { + index: index + 1, + count, + offset: count > 1 ? index / (count - 1) : 1, + }; + this.vertexCallback(vertex, vertexRepetition, propArguments); + } + } + buffers[currentIndex][bufferIndex] = vertex[0]; + buffers[currentIndex][bufferIndex + 1] = vertex[1]; + Adapt_1.Bounding.add(tmpSingleRepetitionBounding, vertex[0], vertex[1]); + Adapt_1.Bounding.add(tmpTotalShapeBounding, vertex[0], vertex[1]); + } + } + // Bounding.sum(tmpTotalShapeBounding, tmpSingleRepetitionBounding) + // After buffer creation, add a frame into indexedBuffer if not static or update bounding + const singleRepetitionBounding = { cx: 0, cy: 0, x: -1, y: -1, width: 2, height: 2 }; + Adapt_1.Bounding.bind(singleRepetitionBounding, tmpSingleRepetitionBounding); + if (!this.bStaticIndexed || !this.bIndexed) { + this.addIndex(bufferLength, repetition, singleRepetitionBounding); + } + } } - return null; - } - /** - * Get shape by index - * - * @param {number} index - * @returns {(SceneChild | null)} - * @memberof Scene - */ - get(index) { - return index >= 0 && index < this.children.length ? this.children[index] : null; - } - /** - * Remove a shape by index - * - * @param {number} index - * @memberof Scene - */ - remove(index) { - index >= 0 && index < this.children.length && this.children.splice(index, 1); + Adapt_1.Bounding.bind(this.bounding, tmpTotalShapeBounding); + this.buffer = new Float32Array(totalBufferLength); + for (let i = 0, offset = 0, len = buffers.length; i < len; offset += buffers[i].length, i++) + this.buffer.set(buffers[i], offset); + this.bIndexed = true; } /** - * Removes all children + * Return current shape (whit repetions) bounding * - * @memberof Scene + * @return {*} {IShapeBounding} */ - removeChildren() { - this.children = []; + getBounding() { + return this.bounding; } /** - * Remove sceneChild by id or name + * Get number of repetitions * - * @param {number | number} idOrName - * @memberof Scene + * @returns {number} */ - removeFromId(idOrName) { - for (let i = 0, len = this.children.length; i < len; i++) - if (this.children[i].id === idOrName || this.children[i].name === idOrName) { - this.children.splice(i, 1); - return; - } + getRepetitionCount() { + var _a; + const repetitions = this.getProp('repetitions', undefined, 1); + return Array.isArray(repetitions) ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) : repetitions; } /** - * Return true if sceneChild is direct children + * Return buffer * - * @param {SceneChild} sceneChild - * @returns {boolean} - * @memberof Scene + * @returns {(Float32Array | undefined)} */ - isFirstLevelChild(sceneChild) { - for (let i = 0, len = this.children.length; i < len; i++) - if (this.children[i].id === sceneChild.id) - return true; - const parents = this.getParentsOfSceneChild(sceneChild); - return parents.length === 1 && parents[0] instanceof Group_1.Group; + getBuffer() { + return this.buffer; } /** - * Returns the list of sceneChild hierarchy starting from the scene + * Return indexed buffer * - * @param {SceneChild} sceneChild - * @returns {Array} - * @memberof Scene + * @returns {(Array> | undefined)} */ - getParentsOfSceneChild(sceneChild) { - const result = Scene.getParentsOfSceneChild(this, sceneChild); - if (result) { - result.splice(0, 1); - return result; - } - return []; + getIndexedBuffer() { + return this.indexedBuffer; } /** - * Returns the list of sceneChild hierarchy starting from the scene + * Return number of encapsulation * - * @static - * @param {(Scene | SceneChild)} current - * @param {SceneChild} sceneChild - * @param {(Array)} [parents=[]] - * @returns {(Array | null)} - * @memberof Scene + * @param {IBufferIndex} index + * @returns {number} */ - static getParentsOfSceneChild(current, sceneChild, parents = []) { - let result; - if (current instanceof SceneChild_1.SceneChild) { - if (current.id == sceneChild.id) - return parents; - if (current instanceof Shape_1.Shape && current.shape) { - const tmpParents = parents.slice(); - tmpParents.push(current); - if ((result = Scene.getParentsOfSceneChild(current.shape, sceneChild, tmpParents))) - return result; - } - } - if (current instanceof Scene || current instanceof Group_1.Group) { - const children = current.getChildren(); - parents.push(current); - for (let i = 0, len = children.length; i < len; i++) { - const child = children[i]; - if ((result = Scene.getParentsOfSceneChild(child, sceneChild, parents))) - return result; - } - parents.pop(); + static getIndexParentLevel(index) { + if (typeof index.parent === 'undefined') + return 0; + let currentParent = index.parent; + let currentParentLevel = 1; + while (typeof currentParent.parent !== 'undefined') { + currentParentLevel++; + currentParent = currentParent.parent; } - return null; + return currentParentLevel; } /** - * Walk through the scene + * Stream buffer * - * @static - * @param {SceneChild} callbackk - * @param {(Scene | SceneChild)} current - * @memberof Scene + * @param {(TStreamCallback} callback */ - static walk(callback, current) { - if (current instanceof SceneChild_1.SceneChild) { - if (callback(current) === false) - return false; - if (current instanceof Shape_1.Shape && current.shape) - if (Scene.walk(callback, current.shape) === false) - return false; - } - if (current instanceof Scene || current instanceof Group_1.Group) { - const children = current.getChildren(); - for (let i = 0, len = children.length; i < len; i++) { - const child = children[i]; - if (Scene.walk(callback, child) === false) - return false; + stream(callback) { + if (this.buffer && this.indexedBuffer) { + for (let i = 0, j = 0, len = this.indexedBuffer.length; i < len; i++) { + const currentIndexing = this.indexedBuffer[i]; + callback({ + buffer: this.buffer, + frameLength: currentIndexing.frameLength, + frameBufferIndex: j, + currentIndexing: currentIndexing, + currentShapeIndex: i, + totalShapes: len, + }); + j += currentIndexing.frameLength; } } } /** - * Propagate scene to sceneChild (and children) + * Return empty propArguments * * @static - * @param {SceneChild} sceneChild - * @param {Scene} scene - * @memberof Scene + * @param {ShapeBase} shape + * @return {*} {PropArguments} */ - static propagateToChilden(sceneChild, scene) { - sceneChild.scene = scene; - if (sceneChild instanceof Group_1.Group) { - sceneChild.getChildren().forEach((item) => { - Scene.propagateToChilden(item, scene); - }); - } - else if (sceneChild instanceof Shape_1.Shape && sceneChild.shape) { - sceneChild.shape.scene = scene; - Scene.propagateToChilden(sceneChild.shape, scene); - } + static getEmptyPropArguments(shape, parentPropArguments) { + const repetition = { + type: types_1.ERepetitionType.Ring, + angle: 0, + index: 1, + offset: 1, + count: 1, + row: { index: 1, offset: 1, count: 1 }, + col: { index: 1, offset: 1, count: 1 }, + }; + return { + repetition, + shape, + parent: parentPropArguments, + }; } } -exports.Scene = Scene; -//# sourceMappingURL=Scene.js.map +exports.ShapeBase = ShapeBase; +/** + * Empty buffer + * + * @internal + * @ignore + */ +ShapeBase.EMPTY_BUFFER = new Float32Array(0); +/** + * Empty BaseRepetition + * + * @internal + * @ignore + */ +ShapeBase.getEmptySimpleRepetition = () => ({ + index: 1, + offset: 1, + count: 1, +}); +/** + * Empty Repetition + * + * @internal + * @ignore + */ +ShapeBase.getEmptyRepetition = () => ({ + type: types_1.ERepetitionType.Ring, + angle: 0, + ...ShapeBase.getEmptySimpleRepetition(), + row: ShapeBase.getEmptySimpleRepetition(), + col: ShapeBase.getEmptySimpleRepetition(), +}); +//# sourceMappingURL=ShapeBase.js.map + +/***/ }), +/* 7 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "glMatrix": () => (/* reexport module object */ _common_js__WEBPACK_IMPORTED_MODULE_0__), +/* harmony export */ "mat2": () => (/* reexport module object */ _mat2_js__WEBPACK_IMPORTED_MODULE_1__), +/* harmony export */ "mat2d": () => (/* reexport module object */ _mat2d_js__WEBPACK_IMPORTED_MODULE_2__), +/* harmony export */ "mat3": () => (/* reexport module object */ _mat3_js__WEBPACK_IMPORTED_MODULE_3__), +/* harmony export */ "mat4": () => (/* reexport module object */ _mat4_js__WEBPACK_IMPORTED_MODULE_4__), +/* harmony export */ "quat": () => (/* reexport module object */ _quat_js__WEBPACK_IMPORTED_MODULE_5__), +/* harmony export */ "quat2": () => (/* reexport module object */ _quat2_js__WEBPACK_IMPORTED_MODULE_6__), +/* harmony export */ "vec2": () => (/* reexport module object */ _vec2_js__WEBPACK_IMPORTED_MODULE_7__), +/* harmony export */ "vec3": () => (/* reexport module object */ _vec3_js__WEBPACK_IMPORTED_MODULE_8__), +/* harmony export */ "vec4": () => (/* reexport module object */ _vec4_js__WEBPACK_IMPORTED_MODULE_9__) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); +/* harmony import */ var _mat2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9); +/* harmony import */ var _mat2d_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10); +/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11); +/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12); +/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(13); +/* harmony import */ var _quat2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(16); +/* harmony import */ var _vec2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(17); +/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(15); +/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(14); + + + + + + + + + + + + +/***/ }), +/* 8 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "EPSILON": () => (/* binding */ EPSILON), +/* harmony export */ "ARRAY_TYPE": () => (/* binding */ ARRAY_TYPE), +/* harmony export */ "RANDOM": () => (/* binding */ RANDOM), +/* harmony export */ "setMatrixArrayType": () => (/* binding */ setMatrixArrayType), +/* harmony export */ "toRadian": () => (/* binding */ toRadian), +/* harmony export */ "equals": () => (/* binding */ equals) +/* harmony export */ }); +/** + * Common utilities + * @module glMatrix + */ +// Configuration Constants +var EPSILON = 0.000001; +var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array; +var RANDOM = Math.random; +/** + * Sets the type of array used when creating new vectors and matrices + * + * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array + */ + +function setMatrixArrayType(type) { + ARRAY_TYPE = type; +} +var degree = Math.PI / 180; +/** + * Convert Degree To Radian + * + * @param {Number} a Angle in Degrees + */ + +function toRadian(a) { + return a * degree; +} +/** + * Tests whether or not the arguments have approximately the same value, within an absolute + * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less + * than or equal to 1.0, and a relative tolerance is used for larger values) + * + * @param {Number} a The first number to test. + * @param {Number} b The second number to test. + * @returns {Boolean} True if the numbers are approximately equal, false otherwise. + */ + +function equals(a, b) { + return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b)); +} +if (!Math.hypot) Math.hypot = function () { + var y = 0, + i = arguments.length; + + while (i--) { + y += arguments[i] * arguments[i]; + } + + return Math.sqrt(y); +}; + +/***/ }), +/* 9 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "transpose": () => (/* binding */ transpose), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "adjoint": () => (/* binding */ adjoint), +/* harmony export */ "determinant": () => (/* binding */ determinant), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "rotate": () => (/* binding */ rotate), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), +/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "frob": () => (/* binding */ frob), +/* harmony export */ "LDU": () => (/* binding */ LDU), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), +/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "sub": () => (/* binding */ sub) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); + +/** + * 2x2 Matrix + * @module mat2 + */ + +/** + * Creates a new identity mat2 + * + * @returns {mat2} a new 2x2 matrix + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[1] = 0; + out[2] = 0; + } + + out[0] = 1; + out[3] = 1; + return out; +} +/** + * Creates a new mat2 initialized with values from an existing matrix + * + * @param {ReadonlyMat2} a matrix to clone + * @returns {mat2} a new 2x2 matrix + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; +} +/** + * Copy the values from one mat2 to another + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the source matrix + * @returns {mat2} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; +} +/** + * Set a mat2 to the identity matrix + * + * @param {mat2} out the receiving matrix + * @returns {mat2} out + */ + +function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; +} +/** + * Create a new mat2 with the given values + * + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m10 Component in column 1, row 0 position (index 2) + * @param {Number} m11 Component in column 1, row 1 position (index 3) + * @returns {mat2} out A new 2x2 matrix + */ + +function fromValues(m00, m01, m10, m11) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + out[0] = m00; + out[1] = m01; + out[2] = m10; + out[3] = m11; + return out; +} +/** + * Set the components of a mat2 to the given values + * + * @param {mat2} out the receiving matrix + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m10 Component in column 1, row 0 position (index 2) + * @param {Number} m11 Component in column 1, row 1 position (index 3) + * @returns {mat2} out + */ + +function set(out, m00, m01, m10, m11) { + out[0] = m00; + out[1] = m01; + out[2] = m10; + out[3] = m11; + return out; +} +/** + * Transpose the values of a mat2 + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the source matrix + * @returns {mat2} out + */ + +function transpose(out, a) { + // If we are transposing ourselves we can skip a few steps but have to cache + // some values + if (out === a) { + var a1 = a[1]; + out[1] = a[2]; + out[2] = a1; + } else { + out[0] = a[0]; + out[1] = a[2]; + out[2] = a[1]; + out[3] = a[3]; + } + + return out; +} +/** + * Inverts a mat2 + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the source matrix + * @returns {mat2} out + */ + +function invert(out, a) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; // Calculate the determinant + + var det = a0 * a3 - a2 * a1; + + if (!det) { + return null; + } + + det = 1.0 / det; + out[0] = a3 * det; + out[1] = -a1 * det; + out[2] = -a2 * det; + out[3] = a0 * det; + return out; +} +/** + * Calculates the adjugate of a mat2 + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the source matrix + * @returns {mat2} out + */ + +function adjoint(out, a) { + // Caching this value is nessecary if out == a + var a0 = a[0]; + out[0] = a[3]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a0; + return out; +} +/** + * Calculates the determinant of a mat2 + * + * @param {ReadonlyMat2} a the source matrix + * @returns {Number} determinant of a + */ + +function determinant(a) { + return a[0] * a[3] - a[2] * a[1]; +} +/** + * Multiplies two mat2's + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the first operand + * @param {ReadonlyMat2} b the second operand + * @returns {mat2} out + */ + +function multiply(out, a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + return out; +} +/** + * Rotates a mat2 by the given angle + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat2} out + */ + +function rotate(out, a, rad) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + return out; +} +/** + * Scales the mat2 by the dimensions in the given vec2 + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the matrix to rotate + * @param {ReadonlyVec2} v the vec2 to scale the matrix by + * @returns {mat2} out + **/ + +function scale(out, a, v) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var v0 = v[0], + v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + return out; +} +/** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * mat2.identity(dest); + * mat2.rotate(dest, dest, rad); + * + * @param {mat2} out mat2 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat2} out + */ + +function fromRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + return out; +} +/** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat2.identity(dest); + * mat2.scale(dest, dest, vec); + * + * @param {mat2} out mat2 receiving operation result + * @param {ReadonlyVec2} v Scaling vector + * @returns {mat2} out + */ + +function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + return out; +} +/** + * Returns a string representation of a mat2 + * + * @param {ReadonlyMat2} a matrix to represent as a string + * @returns {String} string representation of the matrix + */ + +function str(a) { + return "mat2(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; +} +/** + * Returns Frobenius norm of a mat2 + * + * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of + * @returns {Number} Frobenius norm + */ + +function frob(a) { + return Math.hypot(a[0], a[1], a[2], a[3]); +} +/** + * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix + * @param {ReadonlyMat2} L the lower triangular matrix + * @param {ReadonlyMat2} D the diagonal matrix + * @param {ReadonlyMat2} U the upper triangular matrix + * @param {ReadonlyMat2} a the input matrix to factorize + */ + +function LDU(L, D, U, a) { + L[2] = a[2] / a[0]; + U[0] = a[0]; + U[1] = a[1]; + U[3] = a[3] - L[2] * U[1]; + return [L, D, U]; +} +/** + * Adds two mat2's + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the first operand + * @param {ReadonlyMat2} b the second operand + * @returns {mat2} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; +} +/** + * Subtracts matrix b from matrix a + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the first operand + * @param {ReadonlyMat2} b the second operand + * @returns {mat2} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; +} +/** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyMat2} a The first matrix. + * @param {ReadonlyMat2} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; +} +/** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {ReadonlyMat2} a The first matrix. + * @param {ReadonlyMat2} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)); +} +/** + * Multiply each element of the matrix by a scalar. + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the matrix to scale + * @param {Number} b amount to scale the matrix's elements by + * @returns {mat2} out + */ + +function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + return out; +} +/** + * Adds two mat2's after multiplying each element of the second operand by a scalar value. + * + * @param {mat2} out the receiving vector + * @param {ReadonlyMat2} a the first operand + * @param {ReadonlyMat2} b the second operand + * @param {Number} scale the amount to scale b's elements by before adding + * @returns {mat2} out + */ + +function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; +} +/** + * Alias for {@link mat2.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link mat2.subtract} + * @function + */ + +var sub = subtract; + +/***/ }), +/* 10 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "determinant": () => (/* binding */ determinant), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "rotate": () => (/* binding */ rotate), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "translate": () => (/* binding */ translate), +/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), +/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), +/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "frob": () => (/* binding */ frob), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), +/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "sub": () => (/* binding */ sub) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); + +/** + * 2x3 Matrix + * @module mat2d + * @description + * A mat2d contains six elements defined as: + *
+ * [a, b,
+ *  c, d,
+ *  tx, ty]
+ * 
+ * This is a short form for the 3x3 matrix: + *
+ * [a, b, 0,
+ *  c, d, 0,
+ *  tx, ty, 1]
+ * 
+ * The last column is ignored so the array is shorter and operations are faster. + */ + +/** + * Creates a new identity mat2d + * + * @returns {mat2d} a new 2x3 matrix + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[1] = 0; + out[2] = 0; + out[4] = 0; + out[5] = 0; + } + + out[0] = 1; + out[3] = 1; + return out; +} +/** + * Creates a new mat2d initialized with values from an existing matrix + * + * @param {ReadonlyMat2d} a matrix to clone + * @returns {mat2d} a new 2x3 matrix + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + return out; +} +/** + * Copy the values from one mat2d to another + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the source matrix + * @returns {mat2d} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + return out; +} +/** + * Set a mat2d to the identity matrix + * + * @param {mat2d} out the receiving matrix + * @returns {mat2d} out + */ + +function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; +} +/** + * Create a new mat2d with the given values + * + * @param {Number} a Component A (index 0) + * @param {Number} b Component B (index 1) + * @param {Number} c Component C (index 2) + * @param {Number} d Component D (index 3) + * @param {Number} tx Component TX (index 4) + * @param {Number} ty Component TY (index 5) + * @returns {mat2d} A new mat2d + */ + +function fromValues(a, b, c, d, tx, ty) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); + out[0] = a; + out[1] = b; + out[2] = c; + out[3] = d; + out[4] = tx; + out[5] = ty; + return out; +} +/** + * Set the components of a mat2d to the given values + * + * @param {mat2d} out the receiving matrix + * @param {Number} a Component A (index 0) + * @param {Number} b Component B (index 1) + * @param {Number} c Component C (index 2) + * @param {Number} d Component D (index 3) + * @param {Number} tx Component TX (index 4) + * @param {Number} ty Component TY (index 5) + * @returns {mat2d} out + */ + +function set(out, a, b, c, d, tx, ty) { + out[0] = a; + out[1] = b; + out[2] = c; + out[3] = d; + out[4] = tx; + out[5] = ty; + return out; +} +/** + * Inverts a mat2d + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the source matrix + * @returns {mat2d} out + */ + +function invert(out, a) { + var aa = a[0], + ab = a[1], + ac = a[2], + ad = a[3]; + var atx = a[4], + aty = a[5]; + var det = aa * ad - ab * ac; + + if (!det) { + return null; + } + + det = 1.0 / det; + out[0] = ad * det; + out[1] = -ab * det; + out[2] = -ac * det; + out[3] = aa * det; + out[4] = (ac * aty - ad * atx) * det; + out[5] = (ab * atx - aa * aty) * det; + return out; +} +/** + * Calculates the determinant of a mat2d + * + * @param {ReadonlyMat2d} a the source matrix + * @returns {Number} determinant of a + */ + +function determinant(a) { + return a[0] * a[3] - a[1] * a[2]; +} +/** + * Multiplies two mat2d's + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the first operand + * @param {ReadonlyMat2d} b the second operand + * @returns {mat2d} out + */ + +function multiply(out, a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3], + b4 = b[4], + b5 = b[5]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + out[4] = a0 * b4 + a2 * b5 + a4; + out[5] = a1 * b4 + a3 * b5 + a5; + return out; +} +/** + * Rotates a mat2d by the given angle + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat2d} out + */ + +function rotate(out, a, rad) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5]; + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + out[4] = a4; + out[5] = a5; + return out; +} +/** + * Scales the mat2d by the dimensions in the given vec2 + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the matrix to translate + * @param {ReadonlyVec2} v the vec2 to scale the matrix by + * @returns {mat2d} out + **/ + +function scale(out, a, v) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5]; + var v0 = v[0], + v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + out[4] = a4; + out[5] = a5; + return out; +} +/** + * Translates the mat2d by the dimensions in the given vec2 + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the matrix to translate + * @param {ReadonlyVec2} v the vec2 to translate the matrix by + * @returns {mat2d} out + **/ + +function translate(out, a, v) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5]; + var v0 = v[0], + v1 = v[1]; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = a0 * v0 + a2 * v1 + a4; + out[5] = a1 * v0 + a3 * v1 + a5; + return out; +} +/** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * mat2d.identity(dest); + * mat2d.rotate(dest, dest, rad); + * + * @param {mat2d} out mat2d receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat2d} out + */ + +function fromRotation(out, rad) { + var s = Math.sin(rad), + c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + out[4] = 0; + out[5] = 0; + return out; +} +/** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat2d.identity(dest); + * mat2d.scale(dest, dest, vec); + * + * @param {mat2d} out mat2d receiving operation result + * @param {ReadonlyVec2} v Scaling vector + * @returns {mat2d} out + */ + +function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + out[4] = 0; + out[5] = 0; + return out; +} +/** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * mat2d.identity(dest); + * mat2d.translate(dest, dest, vec); + * + * @param {mat2d} out mat2d receiving operation result + * @param {ReadonlyVec2} v Translation vector + * @returns {mat2d} out + */ + +function fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = v[0]; + out[5] = v[1]; + return out; +} +/** + * Returns a string representation of a mat2d + * + * @param {ReadonlyMat2d} a matrix to represent as a string + * @returns {String} string representation of the matrix + */ + +function str(a) { + return "mat2d(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ")"; +} +/** + * Returns Frobenius norm of a mat2d + * + * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of + * @returns {Number} Frobenius norm + */ + +function frob(a) { + return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1); +} +/** + * Adds two mat2d's + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the first operand + * @param {ReadonlyMat2d} b the second operand + * @returns {mat2d} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + return out; +} +/** + * Subtracts matrix b from matrix a + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the first operand + * @param {ReadonlyMat2d} b the second operand + * @returns {mat2d} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + return out; +} +/** + * Multiply each element of the matrix by a scalar. + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the matrix to scale + * @param {Number} b amount to scale the matrix's elements by + * @returns {mat2d} out + */ + +function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + return out; +} +/** + * Adds two mat2d's after multiplying each element of the second operand by a scalar value. + * + * @param {mat2d} out the receiving vector + * @param {ReadonlyMat2d} a the first operand + * @param {ReadonlyMat2d} b the second operand + * @param {Number} scale the amount to scale b's elements by before adding + * @returns {mat2d} out + */ + +function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + return out; +} +/** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyMat2d} a The first matrix. + * @param {ReadonlyMat2d} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5]; +} +/** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {ReadonlyMat2d} a The first matrix. + * @param {ReadonlyMat2d} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3], + b4 = b[4], + b5 = b[5]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)); +} +/** + * Alias for {@link mat2d.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link mat2d.subtract} + * @function + */ + +var sub = subtract; + +/***/ }), +/* 11 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "fromMat4": () => (/* binding */ fromMat4), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "transpose": () => (/* binding */ transpose), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "adjoint": () => (/* binding */ adjoint), +/* harmony export */ "determinant": () => (/* binding */ determinant), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "translate": () => (/* binding */ translate), +/* harmony export */ "rotate": () => (/* binding */ rotate), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), +/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), +/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), +/* harmony export */ "fromMat2d": () => (/* binding */ fromMat2d), +/* harmony export */ "fromQuat": () => (/* binding */ fromQuat), +/* harmony export */ "normalFromMat4": () => (/* binding */ normalFromMat4), +/* harmony export */ "projection": () => (/* binding */ projection), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "frob": () => (/* binding */ frob), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), +/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "sub": () => (/* binding */ sub) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); + +/** + * 3x3 Matrix + * @module mat3 + */ + +/** + * Creates a new identity mat3 + * + * @returns {mat3} a new 3x3 matrix + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + } + + out[0] = 1; + out[4] = 1; + out[8] = 1; + return out; +} +/** + * Copies the upper-left 3x3 values into the given mat3. + * + * @param {mat3} out the receiving 3x3 matrix + * @param {ReadonlyMat4} a the source 4x4 matrix + * @returns {mat3} out + */ + +function fromMat4(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[4]; + out[4] = a[5]; + out[5] = a[6]; + out[6] = a[8]; + out[7] = a[9]; + out[8] = a[10]; + return out; +} +/** + * Creates a new mat3 initialized with values from an existing matrix + * + * @param {ReadonlyMat3} a matrix to clone + * @returns {mat3} a new 3x3 matrix + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; +} +/** + * Copy the values from one mat3 to another + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the source matrix + * @returns {mat3} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; +} +/** + * Create a new mat3 with the given values + * + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m02 Component in column 0, row 2 position (index 2) + * @param {Number} m10 Component in column 1, row 0 position (index 3) + * @param {Number} m11 Component in column 1, row 1 position (index 4) + * @param {Number} m12 Component in column 1, row 2 position (index 5) + * @param {Number} m20 Component in column 2, row 0 position (index 6) + * @param {Number} m21 Component in column 2, row 1 position (index 7) + * @param {Number} m22 Component in column 2, row 2 position (index 8) + * @returns {mat3} A new mat3 + */ + +function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m10; + out[4] = m11; + out[5] = m12; + out[6] = m20; + out[7] = m21; + out[8] = m22; + return out; +} +/** + * Set the components of a mat3 to the given values + * + * @param {mat3} out the receiving matrix + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m02 Component in column 0, row 2 position (index 2) + * @param {Number} m10 Component in column 1, row 0 position (index 3) + * @param {Number} m11 Component in column 1, row 1 position (index 4) + * @param {Number} m12 Component in column 1, row 2 position (index 5) + * @param {Number} m20 Component in column 2, row 0 position (index 6) + * @param {Number} m21 Component in column 2, row 1 position (index 7) + * @param {Number} m22 Component in column 2, row 2 position (index 8) + * @returns {mat3} out + */ + +function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) { + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m10; + out[4] = m11; + out[5] = m12; + out[6] = m20; + out[7] = m21; + out[8] = m22; + return out; +} +/** + * Set a mat3 to the identity matrix + * + * @param {mat3} out the receiving matrix + * @returns {mat3} out + */ + +function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; +} +/** + * Transpose the values of a mat3 + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the source matrix + * @returns {mat3} out + */ + +function transpose(out, a) { + // If we are transposing ourselves we can skip a few steps but have to cache some values + if (out === a) { + var a01 = a[1], + a02 = a[2], + a12 = a[5]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a01; + out[5] = a[7]; + out[6] = a02; + out[7] = a12; + } else { + out[0] = a[0]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a[1]; + out[4] = a[4]; + out[5] = a[7]; + out[6] = a[2]; + out[7] = a[5]; + out[8] = a[8]; + } + + return out; +} +/** + * Inverts a mat3 + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the source matrix + * @returns {mat3} out + */ + +function invert(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2]; + var a10 = a[3], + a11 = a[4], + a12 = a[5]; + var a20 = a[6], + a21 = a[7], + a22 = a[8]; + var b01 = a22 * a11 - a12 * a21; + var b11 = -a22 * a10 + a12 * a20; + var b21 = a21 * a10 - a11 * a20; // Calculate the determinant + + var det = a00 * b01 + a01 * b11 + a02 * b21; + + if (!det) { + return null; + } + + det = 1.0 / det; + out[0] = b01 * det; + out[1] = (-a22 * a01 + a02 * a21) * det; + out[2] = (a12 * a01 - a02 * a11) * det; + out[3] = b11 * det; + out[4] = (a22 * a00 - a02 * a20) * det; + out[5] = (-a12 * a00 + a02 * a10) * det; + out[6] = b21 * det; + out[7] = (-a21 * a00 + a01 * a20) * det; + out[8] = (a11 * a00 - a01 * a10) * det; + return out; +} +/** + * Calculates the adjugate of a mat3 + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the source matrix + * @returns {mat3} out + */ + +function adjoint(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2]; + var a10 = a[3], + a11 = a[4], + a12 = a[5]; + var a20 = a[6], + a21 = a[7], + a22 = a[8]; + out[0] = a11 * a22 - a12 * a21; + out[1] = a02 * a21 - a01 * a22; + out[2] = a01 * a12 - a02 * a11; + out[3] = a12 * a20 - a10 * a22; + out[4] = a00 * a22 - a02 * a20; + out[5] = a02 * a10 - a00 * a12; + out[6] = a10 * a21 - a11 * a20; + out[7] = a01 * a20 - a00 * a21; + out[8] = a00 * a11 - a01 * a10; + return out; +} +/** + * Calculates the determinant of a mat3 + * + * @param {ReadonlyMat3} a the source matrix + * @returns {Number} determinant of a + */ + +function determinant(a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2]; + var a10 = a[3], + a11 = a[4], + a12 = a[5]; + var a20 = a[6], + a21 = a[7], + a22 = a[8]; + return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); +} +/** + * Multiplies two mat3's + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the first operand + * @param {ReadonlyMat3} b the second operand + * @returns {mat3} out + */ + +function multiply(out, a, b) { + var a00 = a[0], + a01 = a[1], + a02 = a[2]; + var a10 = a[3], + a11 = a[4], + a12 = a[5]; + var a20 = a[6], + a21 = a[7], + a22 = a[8]; + var b00 = b[0], + b01 = b[1], + b02 = b[2]; + var b10 = b[3], + b11 = b[4], + b12 = b[5]; + var b20 = b[6], + b21 = b[7], + b22 = b[8]; + out[0] = b00 * a00 + b01 * a10 + b02 * a20; + out[1] = b00 * a01 + b01 * a11 + b02 * a21; + out[2] = b00 * a02 + b01 * a12 + b02 * a22; + out[3] = b10 * a00 + b11 * a10 + b12 * a20; + out[4] = b10 * a01 + b11 * a11 + b12 * a21; + out[5] = b10 * a02 + b11 * a12 + b12 * a22; + out[6] = b20 * a00 + b21 * a10 + b22 * a20; + out[7] = b20 * a01 + b21 * a11 + b22 * a21; + out[8] = b20 * a02 + b21 * a12 + b22 * a22; + return out; +} +/** + * Translate a mat3 by the given vector + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the matrix to translate + * @param {ReadonlyVec2} v vector to translate by + * @returns {mat3} out + */ + +function translate(out, a, v) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a10 = a[3], + a11 = a[4], + a12 = a[5], + a20 = a[6], + a21 = a[7], + a22 = a[8], + x = v[0], + y = v[1]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a10; + out[4] = a11; + out[5] = a12; + out[6] = x * a00 + y * a10 + a20; + out[7] = x * a01 + y * a11 + a21; + out[8] = x * a02 + y * a12 + a22; + return out; +} +/** + * Rotates a mat3 by the given angle + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat3} out + */ + +function rotate(out, a, rad) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a10 = a[3], + a11 = a[4], + a12 = a[5], + a20 = a[6], + a21 = a[7], + a22 = a[8], + s = Math.sin(rad), + c = Math.cos(rad); + out[0] = c * a00 + s * a10; + out[1] = c * a01 + s * a11; + out[2] = c * a02 + s * a12; + out[3] = c * a10 - s * a00; + out[4] = c * a11 - s * a01; + out[5] = c * a12 - s * a02; + out[6] = a20; + out[7] = a21; + out[8] = a22; + return out; +} +/** + * Scales the mat3 by the dimensions in the given vec2 + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the matrix to rotate + * @param {ReadonlyVec2} v the vec2 to scale the matrix by + * @returns {mat3} out + **/ + +function scale(out, a, v) { + var x = v[0], + y = v[1]; + out[0] = x * a[0]; + out[1] = x * a[1]; + out[2] = x * a[2]; + out[3] = y * a[3]; + out[4] = y * a[4]; + out[5] = y * a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; +} +/** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyVec2} v Translation vector + * @returns {mat3} out + */ + +function fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = v[0]; + out[7] = v[1]; + out[8] = 1; + return out; +} +/** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.rotate(dest, dest, rad); + * + * @param {mat3} out mat3 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat3} out + */ + +function fromRotation(out, rad) { + var s = Math.sin(rad), + c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = -s; + out[4] = c; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; +} +/** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyVec2} v Scaling vector + * @returns {mat3} out + */ + +function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = v[1]; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; +} +/** + * Copies the values from a mat2d into a mat3 + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat2d} a the matrix to copy + * @returns {mat3} out + **/ + +function fromMat2d(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = 0; + out[3] = a[2]; + out[4] = a[3]; + out[5] = 0; + out[6] = a[4]; + out[7] = a[5]; + out[8] = 1; + return out; +} +/** + * Calculates a 3x3 matrix from the given quaternion + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyQuat} q Quaternion to create matrix from + * + * @returns {mat3} out + */ + +function fromQuat(out, q) { + var x = q[0], + y = q[1], + z = q[2], + w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var yx = y * x2; + var yy = y * y2; + var zx = z * x2; + var zy = z * y2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + out[0] = 1 - yy - zz; + out[3] = yx - wz; + out[6] = zx + wy; + out[1] = yx + wz; + out[4] = 1 - xx - zz; + out[7] = zy - wx; + out[2] = zx - wy; + out[5] = zy + wx; + out[8] = 1 - xx - yy; + return out; +} +/** + * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from + * + * @returns {mat3} out + */ + +function normalFromMat4(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; // Calculate the determinant + + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) { + return null; + } + + det = 1.0 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + return out; +} +/** + * Generates a 2D projection matrix with the given bounds + * + * @param {mat3} out mat3 frustum matrix will be written into + * @param {number} width Width of your gl context + * @param {number} height Height of gl context + * @returns {mat3} out + */ + +function projection(out, width, height) { + out[0] = 2 / width; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = -2 / height; + out[5] = 0; + out[6] = -1; + out[7] = 1; + out[8] = 1; + return out; +} +/** + * Returns a string representation of a mat3 + * + * @param {ReadonlyMat3} a matrix to represent as a string + * @returns {String} string representation of the matrix + */ + +function str(a) { + return "mat3(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ")"; +} +/** + * Returns Frobenius norm of a mat3 + * + * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of + * @returns {Number} Frobenius norm + */ + +function frob(a) { + return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]); +} +/** + * Adds two mat3's + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the first operand + * @param {ReadonlyMat3} b the second operand + * @returns {mat3} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + return out; +} +/** + * Subtracts matrix b from matrix a + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the first operand + * @param {ReadonlyMat3} b the second operand + * @returns {mat3} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + return out; +} +/** + * Multiply each element of the matrix by a scalar. + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the matrix to scale + * @param {Number} b amount to scale the matrix's elements by + * @returns {mat3} out + */ + +function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + return out; +} +/** + * Adds two mat3's after multiplying each element of the second operand by a scalar value. + * + * @param {mat3} out the receiving vector + * @param {ReadonlyMat3} a the first operand + * @param {ReadonlyMat3} b the second operand + * @param {Number} scale the amount to scale b's elements by before adding + * @returns {mat3} out + */ + +function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + return out; +} +/** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyMat3} a The first matrix. + * @param {ReadonlyMat3} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8]; +} +/** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {ReadonlyMat3} a The first matrix. + * @param {ReadonlyMat3} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5], + a6 = a[6], + a7 = a[7], + a8 = a[8]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3], + b4 = b[4], + b5 = b[5], + b6 = b[6], + b7 = b[7], + b8 = b[8]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)); +} +/** + * Alias for {@link mat3.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link mat3.subtract} + * @function + */ + +var sub = subtract; + +/***/ }), +/* 12 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "transpose": () => (/* binding */ transpose), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "adjoint": () => (/* binding */ adjoint), +/* harmony export */ "determinant": () => (/* binding */ determinant), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "translate": () => (/* binding */ translate), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "rotate": () => (/* binding */ rotate), +/* harmony export */ "rotateX": () => (/* binding */ rotateX), +/* harmony export */ "rotateY": () => (/* binding */ rotateY), +/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), +/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), +/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), +/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), +/* harmony export */ "fromXRotation": () => (/* binding */ fromXRotation), +/* harmony export */ "fromYRotation": () => (/* binding */ fromYRotation), +/* harmony export */ "fromZRotation": () => (/* binding */ fromZRotation), +/* harmony export */ "fromRotationTranslation": () => (/* binding */ fromRotationTranslation), +/* harmony export */ "fromQuat2": () => (/* binding */ fromQuat2), +/* harmony export */ "getTranslation": () => (/* binding */ getTranslation), +/* harmony export */ "getScaling": () => (/* binding */ getScaling), +/* harmony export */ "getRotation": () => (/* binding */ getRotation), +/* harmony export */ "fromRotationTranslationScale": () => (/* binding */ fromRotationTranslationScale), +/* harmony export */ "fromRotationTranslationScaleOrigin": () => (/* binding */ fromRotationTranslationScaleOrigin), +/* harmony export */ "fromQuat": () => (/* binding */ fromQuat), +/* harmony export */ "frustum": () => (/* binding */ frustum), +/* harmony export */ "perspective": () => (/* binding */ perspective), +/* harmony export */ "perspectiveFromFieldOfView": () => (/* binding */ perspectiveFromFieldOfView), +/* harmony export */ "ortho": () => (/* binding */ ortho), +/* harmony export */ "lookAt": () => (/* binding */ lookAt), +/* harmony export */ "targetTo": () => (/* binding */ targetTo), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "frob": () => (/* binding */ frob), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), +/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "sub": () => (/* binding */ sub) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); + +/** + * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied. + * @module mat4 + */ + +/** + * Creates a new identity mat4 + * + * @returns {mat4} a new 4x4 matrix + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + } + + out[0] = 1; + out[5] = 1; + out[10] = 1; + out[15] = 1; + return out; +} +/** + * Creates a new mat4 initialized with values from an existing matrix + * + * @param {ReadonlyMat4} a matrix to clone + * @returns {mat4} a new 4x4 matrix + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; +} +/** + * Copy the values from one mat4 to another + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the source matrix + * @returns {mat4} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; +} +/** + * Create a new mat4 with the given values + * + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m02 Component in column 0, row 2 position (index 2) + * @param {Number} m03 Component in column 0, row 3 position (index 3) + * @param {Number} m10 Component in column 1, row 0 position (index 4) + * @param {Number} m11 Component in column 1, row 1 position (index 5) + * @param {Number} m12 Component in column 1, row 2 position (index 6) + * @param {Number} m13 Component in column 1, row 3 position (index 7) + * @param {Number} m20 Component in column 2, row 0 position (index 8) + * @param {Number} m21 Component in column 2, row 1 position (index 9) + * @param {Number} m22 Component in column 2, row 2 position (index 10) + * @param {Number} m23 Component in column 2, row 3 position (index 11) + * @param {Number} m30 Component in column 3, row 0 position (index 12) + * @param {Number} m31 Component in column 3, row 1 position (index 13) + * @param {Number} m32 Component in column 3, row 2 position (index 14) + * @param {Number} m33 Component in column 3, row 3 position (index 15) + * @returns {mat4} A new mat4 + */ + +function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m03; + out[4] = m10; + out[5] = m11; + out[6] = m12; + out[7] = m13; + out[8] = m20; + out[9] = m21; + out[10] = m22; + out[11] = m23; + out[12] = m30; + out[13] = m31; + out[14] = m32; + out[15] = m33; + return out; +} +/** + * Set the components of a mat4 to the given values + * + * @param {mat4} out the receiving matrix + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m02 Component in column 0, row 2 position (index 2) + * @param {Number} m03 Component in column 0, row 3 position (index 3) + * @param {Number} m10 Component in column 1, row 0 position (index 4) + * @param {Number} m11 Component in column 1, row 1 position (index 5) + * @param {Number} m12 Component in column 1, row 2 position (index 6) + * @param {Number} m13 Component in column 1, row 3 position (index 7) + * @param {Number} m20 Component in column 2, row 0 position (index 8) + * @param {Number} m21 Component in column 2, row 1 position (index 9) + * @param {Number} m22 Component in column 2, row 2 position (index 10) + * @param {Number} m23 Component in column 2, row 3 position (index 11) + * @param {Number} m30 Component in column 3, row 0 position (index 12) + * @param {Number} m31 Component in column 3, row 1 position (index 13) + * @param {Number} m32 Component in column 3, row 2 position (index 14) + * @param {Number} m33 Component in column 3, row 3 position (index 15) + * @returns {mat4} out + */ + +function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m03; + out[4] = m10; + out[5] = m11; + out[6] = m12; + out[7] = m13; + out[8] = m20; + out[9] = m21; + out[10] = m22; + out[11] = m23; + out[12] = m30; + out[13] = m31; + out[14] = m32; + out[15] = m33; + return out; +} +/** + * Set a mat4 to the identity matrix + * + * @param {mat4} out the receiving matrix + * @returns {mat4} out + */ + +function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Transpose the values of a mat4 + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the source matrix + * @returns {mat4} out + */ + +function transpose(out, a) { + // If we are transposing ourselves we can skip a few steps but have to cache some values + if (out === a) { + var a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a12 = a[6], + a13 = a[7]; + var a23 = a[11]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a01; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a02; + out[9] = a12; + out[11] = a[14]; + out[12] = a03; + out[13] = a13; + out[14] = a23; + } else { + out[0] = a[0]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a[1]; + out[5] = a[5]; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a[2]; + out[9] = a[6]; + out[10] = a[10]; + out[11] = a[14]; + out[12] = a[3]; + out[13] = a[7]; + out[14] = a[11]; + out[15] = a[15]; + } + + return out; +} +/** + * Inverts a mat4 + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the source matrix + * @returns {mat4} out + */ + +function invert(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; // Calculate the determinant + + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) { + return null; + } + + det = 1.0 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + return out; +} +/** + * Calculates the adjugate of a mat4 + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the source matrix + * @returns {mat4} out + */ + +function adjoint(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22); + out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); + out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12); + out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); + out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); + out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22); + out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); + out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12); + out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21); + out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); + out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11); + out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); + out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); + out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21); + out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); + out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11); + return out; +} +/** + * Calculates the determinant of a mat4 + * + * @param {ReadonlyMat4} a the source matrix + * @returns {Number} determinant of a + */ + +function determinant(a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; // Calculate the determinant + + return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; +} +/** + * Multiplies two mat4s + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the first operand + * @param {ReadonlyMat4} b the second operand + * @returns {mat4} out + */ + +function multiply(out, a, b) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; // Cache only the current line of the second matrix + + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + return out; +} +/** + * Translate a mat4 by the given vector + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to translate + * @param {ReadonlyVec3} v vector to translate by + * @returns {mat4} out + */ + +function translate(out, a, v) { + var x = v[0], + y = v[1], + z = v[2]; + var a00, a01, a02, a03; + var a10, a11, a12, a13; + var a20, a21, a22, a23; + + if (a === out) { + out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + } else { + a00 = a[0]; + a01 = a[1]; + a02 = a[2]; + a03 = a[3]; + a10 = a[4]; + a11 = a[5]; + a12 = a[6]; + a13 = a[7]; + a20 = a[8]; + a21 = a[9]; + a22 = a[10]; + a23 = a[11]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a03; + out[4] = a10; + out[5] = a11; + out[6] = a12; + out[7] = a13; + out[8] = a20; + out[9] = a21; + out[10] = a22; + out[11] = a23; + out[12] = a00 * x + a10 * y + a20 * z + a[12]; + out[13] = a01 * x + a11 * y + a21 * z + a[13]; + out[14] = a02 * x + a12 * y + a22 * z + a[14]; + out[15] = a03 * x + a13 * y + a23 * z + a[15]; + } + + return out; +} +/** + * Scales the mat4 by the dimensions in the given vec3 not using vectorization + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to scale + * @param {ReadonlyVec3} v the vec3 to scale the matrix by + * @returns {mat4} out + **/ + +function scale(out, a, v) { + var x = v[0], + y = v[1], + z = v[2]; + out[0] = a[0] * x; + out[1] = a[1] * x; + out[2] = a[2] * x; + out[3] = a[3] * x; + out[4] = a[4] * y; + out[5] = a[5] * y; + out[6] = a[6] * y; + out[7] = a[7] * y; + out[8] = a[8] * z; + out[9] = a[9] * z; + out[10] = a[10] * z; + out[11] = a[11] * z; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; +} +/** + * Rotates a mat4 by the given angle around the given axis + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @param {ReadonlyVec3} axis the axis to rotate around + * @returns {mat4} out + */ + +function rotate(out, a, rad, axis) { + var x = axis[0], + y = axis[1], + z = axis[2]; + var len = Math.hypot(x, y, z); + var s, c, t; + var a00, a01, a02, a03; + var a10, a11, a12, a13; + var a20, a21, a22, a23; + var b00, b01, b02; + var b10, b11, b12; + var b20, b21, b22; + + if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + return null; + } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + s = Math.sin(rad); + c = Math.cos(rad); + t = 1 - c; + a00 = a[0]; + a01 = a[1]; + a02 = a[2]; + a03 = a[3]; + a10 = a[4]; + a11 = a[5]; + a12 = a[6]; + a13 = a[7]; + a20 = a[8]; + a21 = a[9]; + a22 = a[10]; + a23 = a[11]; // Construct the elements of the rotation matrix + + b00 = x * x * t + c; + b01 = y * x * t + z * s; + b02 = z * x * t - y * s; + b10 = x * y * t - z * s; + b11 = y * y * t + c; + b12 = z * y * t + x * s; + b20 = x * z * t + y * s; + b21 = y * z * t - x * s; + b22 = z * z * t + c; // Perform rotation-specific matrix multiplication + + out[0] = a00 * b00 + a10 * b01 + a20 * b02; + out[1] = a01 * b00 + a11 * b01 + a21 * b02; + out[2] = a02 * b00 + a12 * b01 + a22 * b02; + out[3] = a03 * b00 + a13 * b01 + a23 * b02; + out[4] = a00 * b10 + a10 * b11 + a20 * b12; + out[5] = a01 * b10 + a11 * b11 + a21 * b12; + out[6] = a02 * b10 + a12 * b11 + a22 * b12; + out[7] = a03 * b10 + a13 * b11 + a23 * b12; + out[8] = a00 * b20 + a10 * b21 + a20 * b22; + out[9] = a01 * b20 + a11 * b21 + a21 * b22; + out[10] = a02 * b20 + a12 * b21 + a22 * b22; + out[11] = a03 * b20 + a13 * b21 + a23 * b22; + + if (a !== out) { + // If the source and destination differ, copy the unchanged last row + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + + return out; +} +/** + * Rotates a matrix by the given angle around the X axis + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function rotateX(out, a, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + if (a !== out) { + // If the source and destination differ, copy the unchanged rows + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } // Perform axis-specific matrix multiplication + + + out[4] = a10 * c + a20 * s; + out[5] = a11 * c + a21 * s; + out[6] = a12 * c + a22 * s; + out[7] = a13 * c + a23 * s; + out[8] = a20 * c - a10 * s; + out[9] = a21 * c - a11 * s; + out[10] = a22 * c - a12 * s; + out[11] = a23 * c - a13 * s; + return out; +} +/** + * Rotates a matrix by the given angle around the Y axis + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function rotateY(out, a, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + if (a !== out) { + // If the source and destination differ, copy the unchanged rows + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } // Perform axis-specific matrix multiplication + + + out[0] = a00 * c - a20 * s; + out[1] = a01 * c - a21 * s; + out[2] = a02 * c - a22 * s; + out[3] = a03 * c - a23 * s; + out[8] = a00 * s + a20 * c; + out[9] = a01 * s + a21 * c; + out[10] = a02 * s + a22 * c; + out[11] = a03 * s + a23 * c; + return out; +} +/** + * Rotates a matrix by the given angle around the Z axis + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function rotateZ(out, a, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + if (a !== out) { + // If the source and destination differ, copy the unchanged last row + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } // Perform axis-specific matrix multiplication + + + out[0] = a00 * c + a10 * s; + out[1] = a01 * c + a11 * s; + out[2] = a02 * c + a12 * s; + out[3] = a03 * c + a13 * s; + out[4] = a10 * c - a00 * s; + out[5] = a11 * c - a01 * s; + out[6] = a12 * c - a02 * s; + out[7] = a13 * c - a03 * s; + return out; +} +/** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * + * @param {mat4} out mat4 receiving operation result + * @param {ReadonlyVec3} v Translation vector + * @returns {mat4} out + */ + +function fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; +} +/** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * + * @param {mat4} out mat4 receiving operation result + * @param {ReadonlyVec3} v Scaling vector + * @returns {mat4} out + */ + +function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = v[1]; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = v[2]; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Creates a matrix from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @param {ReadonlyVec3} axis the axis to rotate around + * @returns {mat4} out + */ + +function fromRotation(out, rad, axis) { + var x = axis[0], + y = axis[1], + z = axis[2]; + var len = Math.hypot(x, y, z); + var s, c, t; + + if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + return null; + } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + s = Math.sin(rad); + c = Math.cos(rad); + t = 1 - c; // Perform rotation-specific matrix multiplication + + out[0] = x * x * t + c; + out[1] = y * x * t + z * s; + out[2] = z * x * t - y * s; + out[3] = 0; + out[4] = x * y * t - z * s; + out[5] = y * y * t + c; + out[6] = z * y * t + x * s; + out[7] = 0; + out[8] = x * z * t + y * s; + out[9] = y * z * t - x * s; + out[10] = z * z * t + c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function fromXRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); // Perform axis-specific matrix multiplication + + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = c; + out[6] = s; + out[7] = 0; + out[8] = 0; + out[9] = -s; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function fromYRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); // Perform axis-specific matrix multiplication + + out[0] = c; + out[1] = 0; + out[2] = -s; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = s; + out[9] = 0; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function fromZRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); // Perform axis-specific matrix multiplication + + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = 0; + out[4] = -s; + out[5] = c; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Creates a matrix from a quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * + * @param {mat4} out mat4 receiving operation result + * @param {quat4} q Rotation quaternion + * @param {ReadonlyVec3} v Translation vector + * @returns {mat4} out + */ + +function fromRotationTranslation(out, q, v) { + // Quaternion math + var x = q[0], + y = q[1], + z = q[2], + w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; +} +/** + * Creates a new mat4 from a dual quat. + * + * @param {mat4} out Matrix + * @param {ReadonlyQuat2} a Dual Quaternion + * @returns {mat4} mat4 receiving operation result + */ + +function fromQuat2(out, a) { + var translation = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + var bx = -a[0], + by = -a[1], + bz = -a[2], + bw = a[3], + ax = a[4], + ay = a[5], + az = a[6], + aw = a[7]; + var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense + + if (magnitude > 0) { + translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude; + translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude; + translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude; + } else { + translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + } + + fromRotationTranslation(out, a, translation); + return out; +} +/** + * Returns the translation vector component of a transformation + * matrix. If a matrix is built with fromRotationTranslation, + * the returned vector will be the same as the translation vector + * originally supplied. + * @param {vec3} out Vector to receive translation component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + +function getTranslation(out, mat) { + out[0] = mat[12]; + out[1] = mat[13]; + out[2] = mat[14]; + return out; +} +/** + * Returns the scaling factor component of a transformation + * matrix. If a matrix is built with fromRotationTranslationScale + * with a normalized Quaternion paramter, the returned vector will be + * the same as the scaling vector + * originally supplied. + * @param {vec3} out Vector to receive scaling factor component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + +function getScaling(out, mat) { + var m11 = mat[0]; + var m12 = mat[1]; + var m13 = mat[2]; + var m21 = mat[4]; + var m22 = mat[5]; + var m23 = mat[6]; + var m31 = mat[8]; + var m32 = mat[9]; + var m33 = mat[10]; + out[0] = Math.hypot(m11, m12, m13); + out[1] = Math.hypot(m21, m22, m23); + out[2] = Math.hypot(m31, m32, m33); + return out; +} +/** + * Returns a quaternion representing the rotational component + * of a transformation matrix. If a matrix is built with + * fromRotationTranslation, the returned quaternion will be the + * same as the quaternion originally supplied. + * @param {quat} out Quaternion to receive the rotation component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {quat} out + */ + +function getRotation(out, mat) { + var scaling = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + getScaling(scaling, mat); + var is1 = 1 / scaling[0]; + var is2 = 1 / scaling[1]; + var is3 = 1 / scaling[2]; + var sm11 = mat[0] * is1; + var sm12 = mat[1] * is2; + var sm13 = mat[2] * is3; + var sm21 = mat[4] * is1; + var sm22 = mat[5] * is2; + var sm23 = mat[6] * is3; + var sm31 = mat[8] * is1; + var sm32 = mat[9] * is2; + var sm33 = mat[10] * is3; + var trace = sm11 + sm22 + sm33; + var S = 0; + + if (trace > 0) { + S = Math.sqrt(trace + 1.0) * 2; + out[3] = 0.25 * S; + out[0] = (sm23 - sm32) / S; + out[1] = (sm31 - sm13) / S; + out[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2; + out[3] = (sm23 - sm32) / S; + out[0] = 0.25 * S; + out[1] = (sm12 + sm21) / S; + out[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2; + out[3] = (sm31 - sm13) / S; + out[0] = (sm12 + sm21) / S; + out[1] = 0.25 * S; + out[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2; + out[3] = (sm12 - sm21) / S; + out[0] = (sm31 + sm13) / S; + out[1] = (sm23 + sm32) / S; + out[2] = 0.25 * S; + } + + return out; +} +/** + * Creates a matrix from a quaternion rotation, vector translation and vector scale + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * + * @param {mat4} out mat4 receiving operation result + * @param {quat4} q Rotation quaternion + * @param {ReadonlyVec3} v Translation vector + * @param {ReadonlyVec3} s Scaling vector + * @returns {mat4} out + */ + +function fromRotationTranslationScale(out, q, v, s) { + // Quaternion math + var x = q[0], + y = q[1], + z = q[2], + w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + var sx = s[0]; + var sy = s[1]; + var sz = s[2]; + out[0] = (1 - (yy + zz)) * sx; + out[1] = (xy + wz) * sx; + out[2] = (xz - wy) * sx; + out[3] = 0; + out[4] = (xy - wz) * sy; + out[5] = (1 - (xx + zz)) * sy; + out[6] = (yz + wx) * sy; + out[7] = 0; + out[8] = (xz + wy) * sz; + out[9] = (yz - wx) * sz; + out[10] = (1 - (xx + yy)) * sz; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; +} +/** + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * + * @param {mat4} out mat4 receiving operation result + * @param {quat4} q Rotation quaternion + * @param {ReadonlyVec3} v Translation vector + * @param {ReadonlyVec3} s Scaling vector + * @param {ReadonlyVec3} o The origin vector around which to scale and rotate + * @returns {mat4} out + */ + +function fromRotationTranslationScaleOrigin(out, q, v, s, o) { + // Quaternion math + var x = q[0], + y = q[1], + z = q[2], + w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + var sx = s[0]; + var sy = s[1]; + var sz = s[2]; + var ox = o[0]; + var oy = o[1]; + var oz = o[2]; + var out0 = (1 - (yy + zz)) * sx; + var out1 = (xy + wz) * sx; + var out2 = (xz - wy) * sx; + var out4 = (xy - wz) * sy; + var out5 = (1 - (xx + zz)) * sy; + var out6 = (yz + wx) * sy; + var out8 = (xz + wy) * sz; + var out9 = (yz - wx) * sz; + var out10 = (1 - (xx + yy)) * sz; + out[0] = out0; + out[1] = out1; + out[2] = out2; + out[3] = 0; + out[4] = out4; + out[5] = out5; + out[6] = out6; + out[7] = 0; + out[8] = out8; + out[9] = out9; + out[10] = out10; + out[11] = 0; + out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz); + out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz); + out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz); + out[15] = 1; + return out; +} +/** + * Calculates a 4x4 matrix from the given quaternion + * + * @param {mat4} out mat4 receiving operation result + * @param {ReadonlyQuat} q Quaternion to create matrix from + * + * @returns {mat4} out + */ + +function fromQuat(out, q) { + var x = q[0], + y = q[1], + z = q[2], + w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var yx = y * x2; + var yy = y * y2; + var zx = z * x2; + var zy = z * y2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + out[0] = 1 - yy - zz; + out[1] = yx + wz; + out[2] = zx - wy; + out[3] = 0; + out[4] = yx - wz; + out[5] = 1 - xx - zz; + out[6] = zy + wx; + out[7] = 0; + out[8] = zx + wy; + out[9] = zy - wx; + out[10] = 1 - xx - yy; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Generates a frustum matrix with the given bounds + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {Number} left Left bound of the frustum + * @param {Number} right Right bound of the frustum + * @param {Number} bottom Bottom bound of the frustum + * @param {Number} top Top bound of the frustum + * @param {Number} near Near bound of the frustum + * @param {Number} far Far bound of the frustum + * @returns {mat4} out + */ + +function frustum(out, left, right, bottom, top, near, far) { + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + var nf = 1 / (near - far); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[10] = (far + near) * nf; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[14] = far * near * 2 * nf; + out[15] = 0; + return out; +} +/** + * Generates a perspective projection matrix with the given bounds. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {number} fovy Vertical field of view in radians + * @param {number} aspect Aspect ratio. typically viewport width/height + * @param {number} near Near bound of the frustum + * @param {number} far Far bound of the frustum, can be null or Infinity + * @returns {mat4} out + */ + +function perspective(out, fovy, aspect, near, far) { + var f = 1.0 / Math.tan(fovy / 2), + nf; + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + + if (far != null && far !== Infinity) { + nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + + return out; +} +/** + * Generates a perspective projection matrix with the given field of view. + * This is primarily useful for generating projection matrices to be used + * with the still experiemental WebVR API. + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param {number} near Near bound of the frustum + * @param {number} far Far bound of the frustum + * @returns {mat4} out + */ + +function perspectiveFromFieldOfView(out, fov, near, far) { + var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0); + var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0); + var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0); + var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0); + var xScale = 2.0 / (leftTan + rightTan); + var yScale = 2.0 / (upTan + downTan); + out[0] = xScale; + out[1] = 0.0; + out[2] = 0.0; + out[3] = 0.0; + out[4] = 0.0; + out[5] = yScale; + out[6] = 0.0; + out[7] = 0.0; + out[8] = -((leftTan - rightTan) * xScale * 0.5); + out[9] = (upTan - downTan) * yScale * 0.5; + out[10] = far / (near - far); + out[11] = -1.0; + out[12] = 0.0; + out[13] = 0.0; + out[14] = far * near / (near - far); + out[15] = 0.0; + return out; +} +/** + * Generates a orthogonal projection matrix with the given bounds + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {number} left Left bound of the frustum + * @param {number} right Right bound of the frustum + * @param {number} bottom Bottom bound of the frustum + * @param {number} top Top bound of the frustum + * @param {number} near Near bound of the frustum + * @param {number} far Far bound of the frustum + * @returns {mat4} out + */ + +function ortho(out, left, right, bottom, top, near, far) { + var lr = 1 / (left - right); + var bt = 1 / (bottom - top); + var nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 2 * nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = (far + near) * nf; + out[15] = 1; + return out; +} +/** + * Generates a look-at matrix with the given eye position, focal point, and up axis. + * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {ReadonlyVec3} eye Position of the viewer + * @param {ReadonlyVec3} center Point the viewer is looking at + * @param {ReadonlyVec3} up vec3 pointing up + * @returns {mat4} out + */ + +function lookAt(out, eye, center, up) { + var x0, x1, x2, y0, y1, y2, z0, z1, z2, len; + var eyex = eye[0]; + var eyey = eye[1]; + var eyez = eye[2]; + var upx = up[0]; + var upy = up[1]; + var upz = up[2]; + var centerx = center[0]; + var centery = center[1]; + var centerz = center[2]; + + if (Math.abs(eyex - centerx) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON && Math.abs(eyey - centery) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON && Math.abs(eyez - centerz) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + return identity(out); + } + + z0 = eyex - centerx; + z1 = eyey - centery; + z2 = eyez - centerz; + len = 1 / Math.hypot(z0, z1, z2); + z0 *= len; + z1 *= len; + z2 *= len; + x0 = upy * z2 - upz * z1; + x1 = upz * z0 - upx * z2; + x2 = upx * z1 - upy * z0; + len = Math.hypot(x0, x1, x2); + + if (!len) { + x0 = 0; + x1 = 0; + x2 = 0; + } else { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + + y0 = z1 * x2 - z2 * x1; + y1 = z2 * x0 - z0 * x2; + y2 = z0 * x1 - z1 * x0; + len = Math.hypot(y0, y1, y2); + + if (!len) { + y0 = 0; + y1 = 0; + y2 = 0; + } else { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + + out[0] = x0; + out[1] = y0; + out[2] = z0; + out[3] = 0; + out[4] = x1; + out[5] = y1; + out[6] = z1; + out[7] = 0; + out[8] = x2; + out[9] = y2; + out[10] = z2; + out[11] = 0; + out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); + out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); + out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); + out[15] = 1; + return out; +} +/** + * Generates a matrix that makes something look at something else. + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {ReadonlyVec3} eye Position of the viewer + * @param {ReadonlyVec3} center Point the viewer is looking at + * @param {ReadonlyVec3} up vec3 pointing up + * @returns {mat4} out + */ + +function targetTo(out, eye, target, up) { + var eyex = eye[0], + eyey = eye[1], + eyez = eye[2], + upx = up[0], + upy = up[1], + upz = up[2]; + var z0 = eyex - target[0], + z1 = eyey - target[1], + z2 = eyez - target[2]; + var len = z0 * z0 + z1 * z1 + z2 * z2; + + if (len > 0) { + len = 1 / Math.sqrt(len); + z0 *= len; + z1 *= len; + z2 *= len; + } + + var x0 = upy * z2 - upz * z1, + x1 = upz * z0 - upx * z2, + x2 = upx * z1 - upy * z0; + len = x0 * x0 + x1 * x1 + x2 * x2; + + if (len > 0) { + len = 1 / Math.sqrt(len); + x0 *= len; + x1 *= len; + x2 *= len; + } + + out[0] = x0; + out[1] = x1; + out[2] = x2; + out[3] = 0; + out[4] = z1 * x2 - z2 * x1; + out[5] = z2 * x0 - z0 * x2; + out[6] = z0 * x1 - z1 * x0; + out[7] = 0; + out[8] = z0; + out[9] = z1; + out[10] = z2; + out[11] = 0; + out[12] = eyex; + out[13] = eyey; + out[14] = eyez; + out[15] = 1; + return out; +} +/** + * Returns a string representation of a mat4 + * + * @param {ReadonlyMat4} a matrix to represent as a string + * @returns {String} string representation of the matrix + */ + +function str(a) { + return "mat4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ", " + a[9] + ", " + a[10] + ", " + a[11] + ", " + a[12] + ", " + a[13] + ", " + a[14] + ", " + a[15] + ")"; +} +/** + * Returns Frobenius norm of a mat4 + * + * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of + * @returns {Number} Frobenius norm + */ + +function frob(a) { + return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); +} +/** + * Adds two mat4's + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the first operand + * @param {ReadonlyMat4} b the second operand + * @returns {mat4} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + out[9] = a[9] + b[9]; + out[10] = a[10] + b[10]; + out[11] = a[11] + b[11]; + out[12] = a[12] + b[12]; + out[13] = a[13] + b[13]; + out[14] = a[14] + b[14]; + out[15] = a[15] + b[15]; + return out; +} +/** + * Subtracts matrix b from matrix a + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the first operand + * @param {ReadonlyMat4} b the second operand + * @returns {mat4} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + out[9] = a[9] - b[9]; + out[10] = a[10] - b[10]; + out[11] = a[11] - b[11]; + out[12] = a[12] - b[12]; + out[13] = a[13] - b[13]; + out[14] = a[14] - b[14]; + out[15] = a[15] - b[15]; + return out; +} +/** + * Multiply each element of the matrix by a scalar. + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to scale + * @param {Number} b amount to scale the matrix's elements by + * @returns {mat4} out + */ + +function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + out[9] = a[9] * b; + out[10] = a[10] * b; + out[11] = a[11] * b; + out[12] = a[12] * b; + out[13] = a[13] * b; + out[14] = a[14] * b; + out[15] = a[15] * b; + return out; +} +/** + * Adds two mat4's after multiplying each element of the second operand by a scalar value. + * + * @param {mat4} out the receiving vector + * @param {ReadonlyMat4} a the first operand + * @param {ReadonlyMat4} b the second operand + * @param {Number} scale the amount to scale b's elements by before adding + * @returns {mat4} out + */ + +function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + out[9] = a[9] + b[9] * scale; + out[10] = a[10] + b[10] * scale; + out[11] = a[11] + b[11] * scale; + out[12] = a[12] + b[12] * scale; + out[13] = a[13] + b[13] * scale; + out[14] = a[14] + b[14] * scale; + out[15] = a[15] + b[15] * scale; + return out; +} +/** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyMat4} a The first matrix. + * @param {ReadonlyMat4} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15]; +} +/** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {ReadonlyMat4} a The first matrix. + * @param {ReadonlyMat4} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var a4 = a[4], + a5 = a[5], + a6 = a[6], + a7 = a[7]; + var a8 = a[8], + a9 = a[9], + a10 = a[10], + a11 = a[11]; + var a12 = a[12], + a13 = a[13], + a14 = a[14], + a15 = a[15]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + var b4 = b[4], + b5 = b[5], + b6 = b[6], + b7 = b[7]; + var b8 = b[8], + b9 = b[9], + b10 = b[10], + b11 = b[11]; + var b12 = b[12], + b13 = b[13], + b14 = b[14], + b15 = b[15]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15)); +} +/** + * Alias for {@link mat4.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link mat4.subtract} + * @function + */ + +var sub = subtract; + +/***/ }), +/* 13 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "setAxisAngle": () => (/* binding */ setAxisAngle), +/* harmony export */ "getAxisAngle": () => (/* binding */ getAxisAngle), +/* harmony export */ "getAngle": () => (/* binding */ getAngle), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "rotateX": () => (/* binding */ rotateX), +/* harmony export */ "rotateY": () => (/* binding */ rotateY), +/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), +/* harmony export */ "calculateW": () => (/* binding */ calculateW), +/* harmony export */ "exp": () => (/* binding */ exp), +/* harmony export */ "ln": () => (/* binding */ ln), +/* harmony export */ "pow": () => (/* binding */ pow), +/* harmony export */ "slerp": () => (/* binding */ slerp), +/* harmony export */ "random": () => (/* binding */ random), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "conjugate": () => (/* binding */ conjugate), +/* harmony export */ "fromMat3": () => (/* binding */ fromMat3), +/* harmony export */ "fromEuler": () => (/* binding */ fromEuler), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "dot": () => (/* binding */ dot), +/* harmony export */ "lerp": () => (/* binding */ lerp), +/* harmony export */ "length": () => (/* binding */ length), +/* harmony export */ "len": () => (/* binding */ len), +/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), +/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), +/* harmony export */ "normalize": () => (/* binding */ normalize), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "rotationTo": () => (/* binding */ rotationTo), +/* harmony export */ "sqlerp": () => (/* binding */ sqlerp), +/* harmony export */ "setAxes": () => (/* binding */ setAxes) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); +/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11); +/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15); +/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14); + + + + +/** + * Quaternion + * @module quat + */ + +/** + * Creates a new identity quat + * + * @returns {quat} a new quaternion + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + } + + out[3] = 1; + return out; +} +/** + * Set a quat to the identity quaternion + * + * @param {quat} out the receiving quaternion + * @returns {quat} out + */ + +function identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; +} +/** + * Sets a quat from the given angle and rotation axis, + * then returns it. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyVec3} axis the axis around which to rotate + * @param {Number} rad the angle in radians + * @returns {quat} out + **/ + +function setAxisAngle(out, axis, rad) { + rad = rad * 0.5; + var s = Math.sin(rad); + out[0] = s * axis[0]; + out[1] = s * axis[1]; + out[2] = s * axis[2]; + out[3] = Math.cos(rad); + return out; +} +/** + * Gets the rotation axis and angle for a given + * quaternion. If a quaternion is created with + * setAxisAngle, this method will return the same + * values as providied in the original parameter list + * OR functionally equivalent values. + * Example: The quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @param {vec3} out_axis Vector receiving the axis of rotation + * @param {ReadonlyQuat} q Quaternion to be decomposed + * @return {Number} Angle, in radians, of the rotation + */ + +function getAxisAngle(out_axis, q) { + var rad = Math.acos(q[3]) * 2.0; + var s = Math.sin(rad / 2.0); + + if (s > _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + out_axis[0] = q[0] / s; + out_axis[1] = q[1] / s; + out_axis[2] = q[2] / s; + } else { + // If s is zero, return any axis (no rotation - axis does not matter) + out_axis[0] = 1; + out_axis[1] = 0; + out_axis[2] = 0; + } + + return rad; +} +/** + * Gets the angular distance between two unit quaternions + * + * @param {ReadonlyQuat} a Origin unit quaternion + * @param {ReadonlyQuat} b Destination unit quaternion + * @return {Number} Angle, in radians, between the two quaternions + */ + +function getAngle(a, b) { + var dotproduct = dot(a, b); + return Math.acos(2 * dotproduct * dotproduct - 1); +} +/** + * Multiplies two quat's + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @returns {quat} out + */ + +function multiply(out, a, b) { + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var bx = b[0], + by = b[1], + bz = b[2], + bw = b[3]; + out[0] = ax * bw + aw * bx + ay * bz - az * by; + out[1] = ay * bw + aw * by + az * bx - ax * bz; + out[2] = az * bw + aw * bz + ax * by - ay * bx; + out[3] = aw * bw - ax * bx - ay * by - az * bz; + return out; +} +/** + * Rotates a quaternion by the given angle about the X axis + * + * @param {quat} out quat receiving operation result + * @param {ReadonlyQuat} a quat to rotate + * @param {number} rad angle (in radians) to rotate + * @returns {quat} out + */ + +function rotateX(out, a, rad) { + rad *= 0.5; + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var bx = Math.sin(rad), + bw = Math.cos(rad); + out[0] = ax * bw + aw * bx; + out[1] = ay * bw + az * bx; + out[2] = az * bw - ay * bx; + out[3] = aw * bw - ax * bx; + return out; +} +/** + * Rotates a quaternion by the given angle about the Y axis + * + * @param {quat} out quat receiving operation result + * @param {ReadonlyQuat} a quat to rotate + * @param {number} rad angle (in radians) to rotate + * @returns {quat} out + */ + +function rotateY(out, a, rad) { + rad *= 0.5; + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var by = Math.sin(rad), + bw = Math.cos(rad); + out[0] = ax * bw - az * by; + out[1] = ay * bw + aw * by; + out[2] = az * bw + ax * by; + out[3] = aw * bw - ay * by; + return out; +} +/** + * Rotates a quaternion by the given angle about the Z axis + * + * @param {quat} out quat receiving operation result + * @param {ReadonlyQuat} a quat to rotate + * @param {number} rad angle (in radians) to rotate + * @returns {quat} out + */ + +function rotateZ(out, a, rad) { + rad *= 0.5; + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var bz = Math.sin(rad), + bw = Math.cos(rad); + out[0] = ax * bw + ay * bz; + out[1] = ay * bw - ax * bz; + out[2] = az * bw + aw * bz; + out[3] = aw * bw - az * bz; + return out; +} +/** + * Calculates the W component of a quat from the X, Y, and Z components. + * Assumes that quaternion is 1 unit in length. + * Any existing W component will be ignored. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate W component of + * @returns {quat} out + */ + +function calculateW(out, a) { + var x = a[0], + y = a[1], + z = a[2]; + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z)); + return out; +} +/** + * Calculate the exponential of a unit quaternion. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate the exponential of + * @returns {quat} out + */ + +function exp(out, a) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3]; + var r = Math.sqrt(x * x + y * y + z * z); + var et = Math.exp(w); + var s = r > 0 ? et * Math.sin(r) / r : 0; + out[0] = x * s; + out[1] = y * s; + out[2] = z * s; + out[3] = et * Math.cos(r); + return out; +} +/** + * Calculate the natural logarithm of a unit quaternion. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate the exponential of + * @returns {quat} out + */ + +function ln(out, a) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3]; + var r = Math.sqrt(x * x + y * y + z * z); + var t = r > 0 ? Math.atan2(r, w) / r : 0; + out[0] = x * t; + out[1] = y * t; + out[2] = z * t; + out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w); + return out; +} +/** + * Calculate the scalar power of a unit quaternion. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate the exponential of + * @param {Number} b amount to scale the quaternion by + * @returns {quat} out + */ + +function pow(out, a, b) { + ln(out, a); + scale(out, out, b); + exp(out, out); + return out; +} +/** + * Performs a spherical linear interpolation between two quat + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {quat} out + */ + +function slerp(out, a, b, t) { + // benchmarks: + // http://jsperf.com/quaternion-slerp-implementations + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var bx = b[0], + by = b[1], + bz = b[2], + bw = b[3]; + var omega, cosom, sinom, scale0, scale1; // calc cosine + + cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary) + + if (cosom < 0.0) { + cosom = -cosom; + bx = -bx; + by = -by; + bz = -bz; + bw = -bw; + } // calculate coefficients + + + if (1.0 - cosom > _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + // standard case (slerp) + omega = Math.acos(cosom); + sinom = Math.sin(omega); + scale0 = Math.sin((1.0 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } else { + // "from" and "to" quaternions are very close + // ... so we can do a linear interpolation + scale0 = 1.0 - t; + scale1 = t; + } // calculate final values + + + out[0] = scale0 * ax + scale1 * bx; + out[1] = scale0 * ay + scale1 * by; + out[2] = scale0 * az + scale1 * bz; + out[3] = scale0 * aw + scale1 * bw; + return out; +} +/** + * Generates a random unit quaternion + * + * @param {quat} out the receiving quaternion + * @returns {quat} out + */ + +function random(out) { + // Implementation of http://planning.cs.uiuc.edu/node198.html + // TODO: Calling random 3 times is probably not the fastest solution + var u1 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); + var u2 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); + var u3 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); + var sqrt1MinusU1 = Math.sqrt(1 - u1); + var sqrtU1 = Math.sqrt(u1); + out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2); + out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2); + out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3); + out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3); + return out; +} +/** + * Calculates the inverse of a quat + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate inverse of + * @returns {quat} out + */ + +function invert(out, a) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; + var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 + + out[0] = -a0 * invDot; + out[1] = -a1 * invDot; + out[2] = -a2 * invDot; + out[3] = a3 * invDot; + return out; +} +/** + * Calculates the conjugate of a quat + * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate conjugate of + * @returns {quat} out + */ + +function conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + return out; +} +/** + * Creates a quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant quaternion is not normalized, so you should be sure + * to renormalize the quaternion yourself where necessary. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyMat3} m rotation matrix + * @returns {quat} out + * @function + */ + +function fromMat3(out, m) { + // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes + // article "Quaternion Calculus and Fast Animation". + var fTrace = m[0] + m[4] + m[8]; + var fRoot; + + if (fTrace > 0.0) { + // |w| > 1/2, may as well choose w > 1/2 + fRoot = Math.sqrt(fTrace + 1.0); // 2w + + out[3] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; // 1/(4w) + + out[0] = (m[5] - m[7]) * fRoot; + out[1] = (m[6] - m[2]) * fRoot; + out[2] = (m[1] - m[3]) * fRoot; + } else { + // |w| <= 1/2 + var i = 0; + if (m[4] > m[0]) i = 1; + if (m[8] > m[i * 3 + i]) i = 2; + var j = (i + 1) % 3; + var k = (i + 2) % 3; + fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0); + out[i] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot; + out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; + out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; + } + + return out; +} +/** + * Creates a quaternion from the given euler angle x, y, z. + * + * @param {quat} out the receiving quaternion + * @param {x} Angle to rotate around X axis in degrees. + * @param {y} Angle to rotate around Y axis in degrees. + * @param {z} Angle to rotate around Z axis in degrees. + * @returns {quat} out + * @function + */ + +function fromEuler(out, x, y, z) { + var halfToRad = 0.5 * Math.PI / 180.0; + x *= halfToRad; + y *= halfToRad; + z *= halfToRad; + var sx = Math.sin(x); + var cx = Math.cos(x); + var sy = Math.sin(y); + var cy = Math.cos(y); + var sz = Math.sin(z); + var cz = Math.cos(z); + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + return out; +} +/** + * Returns a string representation of a quatenion + * + * @param {ReadonlyQuat} a vector to represent as a string + * @returns {String} string representation of the vector + */ + +function str(a) { + return "quat(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; +} +/** + * Creates a new quat initialized with values from an existing quaternion + * + * @param {ReadonlyQuat} a quaternion to clone + * @returns {quat} a new quaternion + * @function + */ + +var clone = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.clone; +/** + * Creates a new quat initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {quat} a new quaternion + * @function + */ + +var fromValues = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.fromValues; +/** + * Copy the values from one quat to another + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the source quaternion + * @returns {quat} out + * @function + */ -/***/ }), -/* 24 */ -/***/ ((__unused_webpack_module, exports) => { +var copy = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.copy; +/** + * Set the components of a quat to the given values + * + * @param {quat} out the receiving quaternion + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {quat} out + * @function + */ -"use strict"; +var set = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.set; +/** + * Adds two quat's + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @returns {quat} out + * @function + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SceneChild = void 0; -/** - * Autoincrement sceneChild default id - * - * @internal - * @ignore +var add = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.add; +/** + * Alias for {@link quat.multiply} + * @function */ -let __id = 0; -/** - * The element to be added into a scene. - * Preserve props, drawing order, generate and return buffers. - * The only implementations of this class are Group and ShapeBase - * - * @abstract - * @category Core.Abstract - * @order 2 - * @class SceneChild + +var mul = multiply; +/** + * Scales a quat by a scalar number + * + * @param {quat} out the receiving vector + * @param {ReadonlyQuat} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {quat} out + * @function */ -class SceneChild { - /** - * Creates an instance of SceneChild. - * Base values will be assigned in case they are not passed - * - * @param {ISceneChildSettings} settings - */ - constructor(settings) { - var _a; - /** - * Shape generation id - * used for prevent buffer calculation - * - * @internal - * @ignore - */ - this.generateId = -1; - this.id = (_a = settings.id) !== null && _a !== void 0 ? _a : ++__id; - this.type = settings.type || 'SceneChild'; - this.name = settings.name || this.type + '_' + this.id; - this.data = settings.data || {}; - this.props = {}; - } - /** - * Find this or form or children. - * Overridden by classes that extend it - * - * @param {string | number} idOrName - * @returns {(SceneChild | null)} - */ - find(idOrName) { - if (this.id === idOrName || this.name === idOrName) - return this; - return null; - } - /** - * Return the sceneChild properties - * - * @returns {Props} - */ - getProps() { - return this.props; - } - /** - * Return a sceneChild prop or default value - * - * @param {keyof Props} key - * @param {PropArguments} [propArguments] - * @param {*} [defaultValue] - * @returns {*} - */ - getProp(key, propArguments, defaultValue) { - var _a; - return ((_a = this.props[key]) !== null && _a !== void 0 ? _a : defaultValue); - } - /** - * Check SceneChild has prop - * - * @param {keyof Props} key - * @returns - */ - hasProp(key) { - return typeof this.props[key] !== 'undefined'; - } - /** - * Set a single or multiple props - * - * @param {(keyof ISceneChildProps | ISceneChildProps)} key - * @param {*} [value] - */ - setPropUnsafe(key, value) { - if (typeof key == 'string') - this.props[key] = value; - else - Object.keys(key).forEach((k) => (this.props[k] = key[k])); - } -} -exports.SceneChild = SceneChild; -//# sourceMappingURL=SceneChild.js.map -/***/ }), -/* 25 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +var scale = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.scale; +/** + * Calculates the dot product of two quat's + * + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @returns {Number} dot product of a and b + * @function + */ -"use strict"; +var dot = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.dot; +/** + * Performs a linear interpolation between two quat's + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {quat} out + * @function + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Group = void 0; -const Scene_1 = __webpack_require__(23); -const SceneChild_1 = __webpack_require__(24); -const ShapeBase_1 = __webpack_require__(26); -const Adapt_1 = __webpack_require__(30); -/** - * A SceneChild container, propagates properties to children - * - * @order 3 - * @category Core.Scene - * @extends {SceneChild} - * @example - * ```javascript - * // Group example - * - * const rect = new Urpflanze.Rect({ - * distance: 100 // <- if a property is set the group will not overwrite it - * }) - * const group = new Urpflanze.Group({ - * repetitions: 3, - * distance: 200 - * }) - * - * group.add(rect) - * group.add(new Urpflanze.Triangle()) - * ``` - * @class Group +var lerp = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.lerp; +/** + * Calculates the length of a quat + * + * @param {ReadonlyQuat} a vector to calculate length of + * @returns {Number} length of a + */ + +var length = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.length; +/** + * Alias for {@link quat.length} + * @function + */ + +var len = length; +/** + * Calculates the squared length of a quat + * + * @param {ReadonlyQuat} a vector to calculate squared length of + * @returns {Number} squared length of a + * @function + */ + +var squaredLength = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.squaredLength; +/** + * Alias for {@link quat.squaredLength} + * @function + */ + +var sqrLen = squaredLength; +/** + * Normalize a quat + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quaternion to normalize + * @returns {quat} out + * @function + */ + +var normalize = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.normalize; +/** + * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyQuat} a The first quaternion. + * @param {ReadonlyQuat} b The second quaternion. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +var exactEquals = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.exactEquals; +/** + * Returns whether or not the quaternions have approximately the same elements in the same position. + * + * @param {ReadonlyQuat} a The first vector. + * @param {ReadonlyQuat} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +var equals = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.equals; +/** + * Sets a quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * + * @param {quat} out the receiving quaternion. + * @param {ReadonlyVec3} a the initial vector + * @param {ReadonlyVec3} b the destination vector + * @returns {quat} out */ -class Group extends SceneChild_1.SceneChild { - /** - * Creates an instance of Group - * - * @param {ISceneChildSettings} [settings={}] - * @memberof Group - */ - constructor(settings = {}) { - settings.type = 'Group'; - super(settings); - this.children = []; - ['id', 'name', 'data', 'order', 'type'].forEach((prop) => { - if (prop in settings) - delete settings[prop]; - }); - this.props = settings; - } - /** - * Check group has static children - * - * @returns {boolean} - * @memberof Group - */ - isStatic() { - const children = this.children; - for (let i = 0, len = children.length; i < len; i++) - if (!children[i].isStatic()) - return false; - return true; - } - /** - * Check group has static children indexed - * - * @returns {boolean} - * @memberof Group - */ - isStaticIndexed() { - const children = this.children; - for (let i = 0, len = children.length; i < len; i++) - if (!children[i].isStaticIndexed()) - return false; - return true; - } - /** - * Add item to Group - * - * @param {Array} items - * @memberof Group - */ - add(...items) { - for (let i = 0, len = items.length; i < len; i++) { - const item = items[i]; - const rawItemProps = item.getProps(); - Object.keys(this.props).forEach((propKey) => { - if (typeof rawItemProps[propKey] === 'undefined') - item.setProp(propKey, this.props[propKey]); - }); - item.order = - typeof item.order !== 'undefined' - ? item.order - : this.children.length > 0 - ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1 - : 0; - this.scene && Scene_1.Scene.propagateToChilden(item, this.scene); - this.children.push(item); - } - this.sortChildren(); - } - /** - * Sort children - * - * @memberof Group - */ - sortChildren() { - this.children.sort((a, b) => a.order - b.order); - this.children = this.children.map((child, index) => { - child.order = index; - return child; - }); - this.clearBuffer(true); - } - /** - * Return shape children - * - * @returns {Array} - * @memberof Group - */ - getChildren() { - return this.children; - } - /** - * Find scene child from id or name - * - * @param {number | string} idOrName - * @returns {(SceneChild | null)} - * @memberof Group - */ - find(idOrName) { - if (this.id === idOrName || this.name === idOrName) - return this; - const children = this.getChildren(); - for (let i = 0, len = children.length; i < len; i++) { - const result = children[i].find(idOrName); - if (result !== null) - return result; - } - return null; - } - /** - * Get item from group - * - * @param {number} index - * @returns {(SceneChild | null)} - * @memberof Group - */ - get(index) { - return index >= 0 && index < this.children.length ? this.children[index] : null; - } - /** - * Remove item from group - * - * @param {number} index - * @returns {(false | Array)} - * @memberof Group - */ - remove(index) { - if (index >= 0 && index < this.children.length) { - const removed = this.children.splice(index, 1); - this.clearBuffer(true); - return removed; - } - return false; - } - /** - * Remove from id - * - * @param {number} id - * @memberof Scene - */ - removeFromId(id) { - for (let i = 0, len = this.children.length; i < len; i++) { - if (this.children[i].id == id) { - this.children.splice(i, 1); - return this.clearBuffer(true); - } - } - } - /** - * Generate children buffers - * - * @param {number} generateId - * @param {boolean} [bDirectSceneChild=false] - * @param {IPropArguments} [parentPropArguments] - * @memberof Group - */ - generate(generateId, bDirectSceneChild = false, parentPropArguments) { - this.generateId = generateId; - this.children.forEach(item => item.generate(generateId, bDirectSceneChild, parentPropArguments)); - } - /** - * Sum the children bounding - * - * @return {IShapeBounding} - */ - getBounding() { - const boundings = []; - const bounding = Adapt_1.Bounding.empty(); - if (this.children.length > 0) { - this.children.forEach(item => boundings.push(item.getBounding())); - for (let i = 0, len = this.children.length; i < len; i++) { - bounding.x = bounding.x > boundings[i].x ? boundings[i].x : bounding.x; - bounding.y = bounding.y > boundings[i].y ? boundings[i].y : bounding.y; - bounding.width = bounding.width < boundings[i].width ? boundings[i].width : bounding.width; - bounding.height = bounding.height < boundings[i].height ? boundings[i].height : bounding.height; - } - bounding.cx = bounding.x + bounding.width / 2; - bounding.cy = bounding.y + bounding.height / 2; - } - return bounding; - } - /** - * Chear children buffer - * - * @param {boolean} [bClearIndexed=false] - * @param {boolean} [bPropagateToParents=false] - * @memberof Group - */ - clearBuffer(bClearIndexed = false, bPropagateToParents = true) { - this.children.forEach(item => item.clearBuffer(bClearIndexed, false)); - if (this.scene && bPropagateToParents) { - const parents = this.scene.getParentsOfSceneChild(this); - parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */); - } - // if (bPropagateToParents && this.scene) - // { - // const parents = this.scene.getParentsOfSceneChild(this) - // parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, true, false) - // } - // if (bPropagateToChildren) - // { - // this.children.forEach(sceneChild => sceneChild.clearBuffer(bClearIndexed, false, true)) - // } - } - /** - * Set a single or multiple props - * - * @abstract - * @param {(keyof ISceneChildProps | ISceneChildProps)} key - * @param {*} [value] - * @memberof SceneChild - */ - setProp(key, value) { - if (typeof key === 'object') - Object.keys(key).forEach((k) => (this.props[k] = key[k])); - else - this.props[key] = value; - this.children.forEach(item => item.setProp(key, value)); - } - /** - * Set a single or multiple props - * - * @param {(keyof ISceneChildProps | ISceneChildProps)} key - * @param {*} [value] - * @memberof ShapeBase - */ - setPropUnsafe(key, value) { - super.setPropUnsafe(key, value); - this.children.forEach(item => item.setPropUnsafe(key, value)); - } - /** - * Return length of buffer - * - * @param {IPropArguments} propArguments - * @returns {number} - * @memberof Group - */ - getBufferLength(propArguments) { - return this.children.map(sceneChild => sceneChild.getBufferLength(propArguments)).reduce((p, c) => p + c, 0); + +var rotationTo = function () { + var tmpvec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.create(); + var xUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.fromValues(1, 0, 0); + var yUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.fromValues(0, 1, 0); + return function (out, a, b) { + var dot = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.dot(a, b); + + if (dot < -0.999999) { + _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, xUnitVec3, a); + if (_vec3_js__WEBPACK_IMPORTED_MODULE_2__.len(tmpvec3) < 0.000001) _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, yUnitVec3, a); + _vec3_js__WEBPACK_IMPORTED_MODULE_2__.normalize(tmpvec3, tmpvec3); + setAxisAngle(out, tmpvec3, Math.PI); + return out; + } else if (dot > 0.999999) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } else { + _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, a, b); + out[0] = tmpvec3[0]; + out[1] = tmpvec3[1]; + out[2] = tmpvec3[2]; + out[3] = 1 + dot; + return normalize(out, out); } - /** - * return a single buffer binded from children - * - * @returns {Float32Array} - * @memberof Group - */ - getBuffer() { - const buffers = this.children - .map(item => item.getBuffer()) - .filter(b => b !== undefined); - const size = buffers.reduce((currLength, buffer) => currLength + buffer.length, 0); - if (size > 0) { - const result = new Float32Array(size); - result.set(buffers[0], 0); - for (let i = 1, offset = 0, len = buffers.length; i < len; i++) { - offset += buffers[i - 1].length; - result.set(buffers[i], offset); - } - return result; - } - return ShapeBase_1.ShapeBase.EMPTY_BUFFER; + }; +}(); +/** + * Performs a spherical linear interpolation with two control points + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @param {ReadonlyQuat} c the third operand + * @param {ReadonlyQuat} d the fourth operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {quat} out + */ + +var sqlerp = function () { + var temp1 = create(); + var temp2 = create(); + return function (out, a, b, c, d, t) { + slerp(temp1, a, d, t); + slerp(temp2, b, c, t); + slerp(out, temp1, temp2, 2 * t * (1 - t)); + return out; + }; +}(); +/** + * Sets the specified quaternion with values corresponding to the given + * axes. Each axis is a vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * + * @param {ReadonlyVec3} view the vector representing the viewing direction + * @param {ReadonlyVec3} right the vector representing the local "right" direction + * @param {ReadonlyVec3} up the vector representing the local "up" direction + * @returns {quat} out + */ + +var setAxes = function () { + var matr = _mat3_js__WEBPACK_IMPORTED_MODULE_3__.create(); + return function (out, view, right, up) { + matr[0] = right[0]; + matr[3] = right[1]; + matr[6] = right[2]; + matr[1] = up[0]; + matr[4] = up[1]; + matr[7] = up[2]; + matr[2] = -view[0]; + matr[5] = -view[1]; + matr[8] = -view[2]; + return normalize(out, fromMat3(out, matr)); + }; +}(); + +/***/ }), +/* 14 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "divide": () => (/* binding */ divide), +/* harmony export */ "ceil": () => (/* binding */ ceil), +/* harmony export */ "floor": () => (/* binding */ floor), +/* harmony export */ "min": () => (/* binding */ min), +/* harmony export */ "max": () => (/* binding */ max), +/* harmony export */ "round": () => (/* binding */ round), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), +/* harmony export */ "distance": () => (/* binding */ distance), +/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), +/* harmony export */ "length": () => (/* binding */ length), +/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), +/* harmony export */ "negate": () => (/* binding */ negate), +/* harmony export */ "inverse": () => (/* binding */ inverse), +/* harmony export */ "normalize": () => (/* binding */ normalize), +/* harmony export */ "dot": () => (/* binding */ dot), +/* harmony export */ "cross": () => (/* binding */ cross), +/* harmony export */ "lerp": () => (/* binding */ lerp), +/* harmony export */ "random": () => (/* binding */ random), +/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), +/* harmony export */ "transformQuat": () => (/* binding */ transformQuat), +/* harmony export */ "zero": () => (/* binding */ zero), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "sub": () => (/* binding */ sub), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "div": () => (/* binding */ div), +/* harmony export */ "dist": () => (/* binding */ dist), +/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), +/* harmony export */ "len": () => (/* binding */ len), +/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), +/* harmony export */ "forEach": () => (/* binding */ forEach) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); + +/** + * 4 Dimensional Vector + * @module vec4 + */ + +/** + * Creates a new, empty vec4 + * + * @returns {vec4} a new 4D vector + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 0; + } + + return out; +} +/** + * Creates a new vec4 initialized with values from an existing vector + * + * @param {ReadonlyVec4} a vector to clone + * @returns {vec4} a new 4D vector + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; +} +/** + * Creates a new vec4 initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {vec4} a new 4D vector + */ + +function fromValues(x, y, z, w) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = w; + return out; +} +/** + * Copy the values from one vec4 to another + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the source vector + * @returns {vec4} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; +} +/** + * Set the components of a vec4 to the given values + * + * @param {vec4} out the receiving vector + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {vec4} out + */ + +function set(out, x, y, z, w) { + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = w; + return out; +} +/** + * Adds two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; +} +/** + * Subtracts vector b from vector a + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; +} +/** + * Multiplies two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + out[3] = a[3] * b[3]; + return out; +} +/** + * Divides two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + out[3] = a[3] / b[3]; + return out; +} +/** + * Math.ceil the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to ceil + * @returns {vec4} out + */ + +function ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + out[3] = Math.ceil(a[3]); + return out; +} +/** + * Math.floor the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to floor + * @returns {vec4} out + */ + +function floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + out[3] = Math.floor(a[3]); + return out; +} +/** + * Returns the minimum of two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + out[3] = Math.min(a[3], b[3]); + return out; +} +/** + * Returns the maximum of two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + out[3] = Math.max(a[3], b[3]); + return out; +} +/** + * Math.round the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to round + * @returns {vec4} out + */ + +function round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + out[2] = Math.round(a[2]); + out[3] = Math.round(a[3]); + return out; +} +/** + * Scales a vec4 by a scalar number + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {vec4} out + */ + +function scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + return out; +} +/** + * Adds two vec4's after scaling the second operand by a scalar value + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @param {Number} scale the amount to scale b by before adding + * @returns {vec4} out + */ + +function scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; +} +/** + * Calculates the euclidian distance between two vec4's + * + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {Number} distance between a and b + */ + +function distance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + var w = b[3] - a[3]; + return Math.hypot(x, y, z, w); +} +/** + * Calculates the squared euclidian distance between two vec4's + * + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {Number} squared distance between a and b + */ + +function squaredDistance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + var w = b[3] - a[3]; + return x * x + y * y + z * z + w * w; +} +/** + * Calculates the length of a vec4 + * + * @param {ReadonlyVec4} a vector to calculate length of + * @returns {Number} length of a + */ + +function length(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var w = a[3]; + return Math.hypot(x, y, z, w); +} +/** + * Calculates the squared length of a vec4 + * + * @param {ReadonlyVec4} a vector to calculate squared length of + * @returns {Number} squared length of a + */ + +function squaredLength(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var w = a[3]; + return x * x + y * y + z * z + w * w; +} +/** + * Negates the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to negate + * @returns {vec4} out + */ + +function negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = -a[3]; + return out; +} +/** + * Returns the inverse of the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to invert + * @returns {vec4} out + */ + +function inverse(out, a) { + out[0] = 1.0 / a[0]; + out[1] = 1.0 / a[1]; + out[2] = 1.0 / a[2]; + out[3] = 1.0 / a[3]; + return out; +} +/** + * Normalize a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to normalize + * @returns {vec4} out + */ + +function normalize(out, a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var w = a[3]; + var len = x * x + y * y + z * z + w * w; + + if (len > 0) { + len = 1 / Math.sqrt(len); + } + + out[0] = x * len; + out[1] = y * len; + out[2] = z * len; + out[3] = w * len; + return out; +} +/** + * Calculates the dot product of two vec4's + * + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {Number} dot product of a and b + */ + +function dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; +} +/** + * Returns the cross-product of three vectors in a 4-dimensional space + * + * @param {ReadonlyVec4} result the receiving vector + * @param {ReadonlyVec4} U the first vector + * @param {ReadonlyVec4} V the second vector + * @param {ReadonlyVec4} W the third vector + * @returns {vec4} result + */ + +function cross(out, u, v, w) { + var A = v[0] * w[1] - v[1] * w[0], + B = v[0] * w[2] - v[2] * w[0], + C = v[0] * w[3] - v[3] * w[0], + D = v[1] * w[2] - v[2] * w[1], + E = v[1] * w[3] - v[3] * w[1], + F = v[2] * w[3] - v[3] * w[2]; + var G = u[0]; + var H = u[1]; + var I = u[2]; + var J = u[3]; + out[0] = H * F - I * E + J * D; + out[1] = -(G * F) + I * C - J * B; + out[2] = G * E - H * C + J * A; + out[3] = -(G * D) + H * B - I * A; + return out; +} +/** + * Performs a linear interpolation between two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {vec4} out + */ + +function lerp(out, a, b, t) { + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var aw = a[3]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + out[3] = aw + t * (b[3] - aw); + return out; +} +/** + * Generates a random vector with the given scale + * + * @param {vec4} out the receiving vector + * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns {vec4} out + */ + +function random(out, scale) { + scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a + // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646. + // http://projecteuclid.org/euclid.aoms/1177692644; + + var v1, v2, v3, v4; + var s1, s2; + + do { + v1 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; + v2 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; + s1 = v1 * v1 + v2 * v2; + } while (s1 >= 1); + + do { + v3 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; + v4 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; + s2 = v3 * v3 + v4 * v4; + } while (s2 >= 1); + + var d = Math.sqrt((1 - s1) / s2); + out[0] = scale * v1; + out[1] = scale * v2; + out[2] = scale * v3 * d; + out[3] = scale * v4 * d; + return out; +} +/** + * Transforms the vec4 with a mat4. + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the vector to transform + * @param {ReadonlyMat4} m matrix to transform with + * @returns {vec4} out + */ + +function transformMat4(out, a, m) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3]; + out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + return out; +} +/** + * Transforms the vec4 with a quat + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the vector to transform + * @param {ReadonlyQuat} q quaternion to transform with + * @returns {vec4} out + */ + +function transformQuat(out, a, q) { + var x = a[0], + y = a[1], + z = a[2]; + var qx = q[0], + qy = q[1], + qz = q[2], + qw = q[3]; // calculate quat * vec + + var ix = qw * x + qy * z - qz * y; + var iy = qw * y + qz * x - qx * z; + var iz = qw * z + qx * y - qy * x; + var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat + + out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy; + out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz; + out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx; + out[3] = a[3]; + return out; +} +/** + * Set the components of a vec4 to zero + * + * @param {vec4} out the receiving vector + * @returns {vec4} out + */ + +function zero(out) { + out[0] = 0.0; + out[1] = 0.0; + out[2] = 0.0; + out[3] = 0.0; + return out; +} +/** + * Returns a string representation of a vector + * + * @param {ReadonlyVec4} a vector to represent as a string + * @returns {String} string representation of the vector + */ + +function str(a) { + return "vec4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; +} +/** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyVec4} a The first vector. + * @param {ReadonlyVec4} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; +} +/** + * Returns whether or not the vectors have approximately the same elements in the same position. + * + * @param {ReadonlyVec4} a The first vector. + * @param {ReadonlyVec4} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)); +} +/** + * Alias for {@link vec4.subtract} + * @function + */ + +var sub = subtract; +/** + * Alias for {@link vec4.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link vec4.divide} + * @function + */ + +var div = divide; +/** + * Alias for {@link vec4.distance} + * @function + */ + +var dist = distance; +/** + * Alias for {@link vec4.squaredDistance} + * @function + */ + +var sqrDist = squaredDistance; +/** + * Alias for {@link vec4.length} + * @function + */ + +var len = length; +/** + * Alias for {@link vec4.squaredLength} + * @function + */ + +var sqrLen = squaredLength; +/** + * Perform some operation over an array of vec4s. + * + * @param {Array} a the array of vectors to iterate over + * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed + * @param {Number} offset Number of elements to skip at the beginning of the array + * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array + * @param {Function} fn Function to call for each vector in the array + * @param {Object} [arg] additional argument to pass to fn + * @returns {Array} a + * @function + */ + +var forEach = function () { + var vec = create(); + return function (a, stride, offset, count, fn, arg) { + var i, l; + + if (!stride) { + stride = 4; } - /** - * return a single buffer binded from children - * - * @returns {(Array | undefined)} - * @memberof Group - */ - getIndexedBuffer() { - const indexed = this.children.map(item => item.getIndexedBuffer()).filter(b => b !== undefined); - return [].concat.apply([], indexed); + + if (!offset) { + offset = 0; } - /** - * Call strem on children - * - * @param {(streamArguments: IStreamArguments) => void} callback - * @memberof Group - */ - stream(callback) { - this.children.forEach(item => item.stream(callback)); + + if (count) { + l = Math.min(count * stride + offset, a.length); + } else { + l = a.length; + } + + for (i = offset; i < l; i += stride) { + vec[0] = a[i]; + vec[1] = a[i + 1]; + vec[2] = a[i + 2]; + vec[3] = a[i + 3]; + fn(vec, vec, arg); + a[i] = vec[0]; + a[i + 1] = vec[1]; + a[i + 2] = vec[2]; + a[i + 3] = vec[3]; } + + return a; + }; +}(); + +/***/ }), +/* 15 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "length": () => (/* binding */ length), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "divide": () => (/* binding */ divide), +/* harmony export */ "ceil": () => (/* binding */ ceil), +/* harmony export */ "floor": () => (/* binding */ floor), +/* harmony export */ "min": () => (/* binding */ min), +/* harmony export */ "max": () => (/* binding */ max), +/* harmony export */ "round": () => (/* binding */ round), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), +/* harmony export */ "distance": () => (/* binding */ distance), +/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), +/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), +/* harmony export */ "negate": () => (/* binding */ negate), +/* harmony export */ "inverse": () => (/* binding */ inverse), +/* harmony export */ "normalize": () => (/* binding */ normalize), +/* harmony export */ "dot": () => (/* binding */ dot), +/* harmony export */ "cross": () => (/* binding */ cross), +/* harmony export */ "lerp": () => (/* binding */ lerp), +/* harmony export */ "hermite": () => (/* binding */ hermite), +/* harmony export */ "bezier": () => (/* binding */ bezier), +/* harmony export */ "random": () => (/* binding */ random), +/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), +/* harmony export */ "transformMat3": () => (/* binding */ transformMat3), +/* harmony export */ "transformQuat": () => (/* binding */ transformQuat), +/* harmony export */ "rotateX": () => (/* binding */ rotateX), +/* harmony export */ "rotateY": () => (/* binding */ rotateY), +/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), +/* harmony export */ "angle": () => (/* binding */ angle), +/* harmony export */ "zero": () => (/* binding */ zero), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "sub": () => (/* binding */ sub), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "div": () => (/* binding */ div), +/* harmony export */ "dist": () => (/* binding */ dist), +/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), +/* harmony export */ "len": () => (/* binding */ len), +/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), +/* harmony export */ "forEach": () => (/* binding */ forEach) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); + +/** + * 3 Dimensional Vector + * @module vec3 + */ + +/** + * Creates a new, empty vec3 + * + * @returns {vec3} a new 3D vector + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + } + + return out; +} +/** + * Creates a new vec3 initialized with values from an existing vector + * + * @param {ReadonlyVec3} a vector to clone + * @returns {vec3} a new 3D vector + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + return out; +} +/** + * Calculates the length of a vec3 + * + * @param {ReadonlyVec3} a vector to calculate length of + * @returns {Number} length of a + */ + +function length(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + return Math.hypot(x, y, z); +} +/** + * Creates a new vec3 initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @returns {vec3} a new 3D vector + */ + +function fromValues(x, y, z) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + out[0] = x; + out[1] = y; + out[2] = z; + return out; +} +/** + * Copy the values from one vec3 to another + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the source vector + * @returns {vec3} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + return out; +} +/** + * Set the components of a vec3 to the given values + * + * @param {vec3} out the receiving vector + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @returns {vec3} out + */ + +function set(out, x, y, z) { + out[0] = x; + out[1] = y; + out[2] = z; + return out; +} +/** + * Adds two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + return out; +} +/** + * Subtracts vector b from vector a + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + return out; +} +/** + * Multiplies two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + return out; +} +/** + * Divides two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + return out; +} +/** + * Math.ceil the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to ceil + * @returns {vec3} out + */ + +function ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + return out; +} +/** + * Math.floor the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to floor + * @returns {vec3} out + */ + +function floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + return out; +} +/** + * Returns the minimum of two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + return out; +} +/** + * Returns the maximum of two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + return out; +} +/** + * Math.round the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to round + * @returns {vec3} out + */ + +function round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + out[2] = Math.round(a[2]); + return out; +} +/** + * Scales a vec3 by a scalar number + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {vec3} out + */ + +function scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + return out; +} +/** + * Adds two vec3's after scaling the second operand by a scalar value + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @param {Number} scale the amount to scale b by before adding + * @returns {vec3} out + */ + +function scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + return out; +} +/** + * Calculates the euclidian distance between two vec3's + * + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {Number} distance between a and b + */ + +function distance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + return Math.hypot(x, y, z); +} +/** + * Calculates the squared euclidian distance between two vec3's + * + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {Number} squared distance between a and b + */ + +function squaredDistance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + return x * x + y * y + z * z; +} +/** + * Calculates the squared length of a vec3 + * + * @param {ReadonlyVec3} a vector to calculate squared length of + * @returns {Number} squared length of a + */ + +function squaredLength(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + return x * x + y * y + z * z; +} +/** + * Negates the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to negate + * @returns {vec3} out + */ + +function negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + return out; +} +/** + * Returns the inverse of the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to invert + * @returns {vec3} out + */ + +function inverse(out, a) { + out[0] = 1.0 / a[0]; + out[1] = 1.0 / a[1]; + out[2] = 1.0 / a[2]; + return out; +} +/** + * Normalize a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to normalize + * @returns {vec3} out + */ + +function normalize(out, a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var len = x * x + y * y + z * z; + + if (len > 0) { + //TODO: evaluate use of glm_invsqrt here? + len = 1 / Math.sqrt(len); + } + + out[0] = a[0] * len; + out[1] = a[1] * len; + out[2] = a[2] * len; + return out; +} +/** + * Calculates the dot product of two vec3's + * + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {Number} dot product of a and b + */ + +function dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; +} +/** + * Computes the cross product of two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function cross(out, a, b) { + var ax = a[0], + ay = a[1], + az = a[2]; + var bx = b[0], + by = b[1], + bz = b[2]; + out[0] = ay * bz - az * by; + out[1] = az * bx - ax * bz; + out[2] = ax * by - ay * bx; + return out; +} +/** + * Performs a linear interpolation between two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {vec3} out + */ + +function lerp(out, a, b, t) { + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + return out; +} +/** + * Performs a hermite interpolation with two control points + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @param {ReadonlyVec3} c the third operand + * @param {ReadonlyVec3} d the fourth operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {vec3} out + */ + +function hermite(out, a, b, c, d, t) { + var factorTimes2 = t * t; + var factor1 = factorTimes2 * (2 * t - 3) + 1; + var factor2 = factorTimes2 * (t - 2) + t; + var factor3 = factorTimes2 * (t - 1); + var factor4 = factorTimes2 * (3 - 2 * t); + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; +} +/** + * Performs a bezier interpolation with two control points + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @param {ReadonlyVec3} c the third operand + * @param {ReadonlyVec3} d the fourth operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {vec3} out + */ + +function bezier(out, a, b, c, d, t) { + var inverseFactor = 1 - t; + var inverseFactorTimesTwo = inverseFactor * inverseFactor; + var factorTimes2 = t * t; + var factor1 = inverseFactorTimesTwo * inverseFactor; + var factor2 = 3 * t * inverseFactorTimesTwo; + var factor3 = 3 * factorTimes2 * inverseFactor; + var factor4 = factorTimes2 * t; + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; +} +/** + * Generates a random vector with the given scale + * + * @param {vec3} out the receiving vector + * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns {vec3} out + */ + +function random(out, scale) { + scale = scale || 1.0; + var r = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 * Math.PI; + var z = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 - 1.0; + var zScale = Math.sqrt(1.0 - z * z) * scale; + out[0] = Math.cos(r) * zScale; + out[1] = Math.sin(r) * zScale; + out[2] = z * scale; + return out; +} +/** + * Transforms the vec3 with a mat4. + * 4th vector component is implicitly '1' + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the vector to transform + * @param {ReadonlyMat4} m matrix to transform with + * @returns {vec3} out + */ + +function transformMat4(out, a, m) { + var x = a[0], + y = a[1], + z = a[2]; + var w = m[3] * x + m[7] * y + m[11] * z + m[15]; + w = w || 1.0; + out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w; + out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w; + out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w; + return out; +} +/** + * Transforms the vec3 with a mat3. + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the vector to transform + * @param {ReadonlyMat3} m the 3x3 matrix to transform with + * @returns {vec3} out + */ + +function transformMat3(out, a, m) { + var x = a[0], + y = a[1], + z = a[2]; + out[0] = x * m[0] + y * m[3] + z * m[6]; + out[1] = x * m[1] + y * m[4] + z * m[7]; + out[2] = x * m[2] + y * m[5] + z * m[8]; + return out; +} +/** + * Transforms the vec3 with a quat + * Can also be used for dual quaternions. (Multiply it with the real part) + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the vector to transform + * @param {ReadonlyQuat} q quaternion to transform with + * @returns {vec3} out + */ + +function transformQuat(out, a, q) { + // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed + var qx = q[0], + qy = q[1], + qz = q[2], + qw = q[3]; + var x = a[0], + y = a[1], + z = a[2]; // var qvec = [qx, qy, qz]; + // var uv = vec3.cross([], qvec, a); + + var uvx = qy * z - qz * y, + uvy = qz * x - qx * z, + uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv); + + var uuvx = qy * uvz - qz * uvy, + uuvy = qz * uvx - qx * uvz, + uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w); + + var w2 = qw * 2; + uvx *= w2; + uvy *= w2; + uvz *= w2; // vec3.scale(uuv, uuv, 2); + + uuvx *= 2; + uuvy *= 2; + uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv)); + + out[0] = x + uvx + uuvx; + out[1] = y + uvy + uuvy; + out[2] = z + uvz + uuvz; + return out; +} +/** + * Rotate a 3D vector around the x-axis + * @param {vec3} out The receiving vec3 + * @param {ReadonlyVec3} a The vec3 point to rotate + * @param {ReadonlyVec3} b The origin of the rotation + * @param {Number} rad The angle of rotation in radians + * @returns {vec3} out + */ + +function rotateX(out, a, b, rad) { + var p = [], + r = []; //Translate point to the origin + + p[0] = a[0] - b[0]; + p[1] = a[1] - b[1]; + p[2] = a[2] - b[2]; //perform rotation + + r[0] = p[0]; + r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad); + r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position + + out[0] = r[0] + b[0]; + out[1] = r[1] + b[1]; + out[2] = r[2] + b[2]; + return out; +} +/** + * Rotate a 3D vector around the y-axis + * @param {vec3} out The receiving vec3 + * @param {ReadonlyVec3} a The vec3 point to rotate + * @param {ReadonlyVec3} b The origin of the rotation + * @param {Number} rad The angle of rotation in radians + * @returns {vec3} out + */ + +function rotateY(out, a, b, rad) { + var p = [], + r = []; //Translate point to the origin + + p[0] = a[0] - b[0]; + p[1] = a[1] - b[1]; + p[2] = a[2] - b[2]; //perform rotation + + r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad); + r[1] = p[1]; + r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position + + out[0] = r[0] + b[0]; + out[1] = r[1] + b[1]; + out[2] = r[2] + b[2]; + return out; +} +/** + * Rotate a 3D vector around the z-axis + * @param {vec3} out The receiving vec3 + * @param {ReadonlyVec3} a The vec3 point to rotate + * @param {ReadonlyVec3} b The origin of the rotation + * @param {Number} rad The angle of rotation in radians + * @returns {vec3} out + */ + +function rotateZ(out, a, b, rad) { + var p = [], + r = []; //Translate point to the origin + + p[0] = a[0] - b[0]; + p[1] = a[1] - b[1]; + p[2] = a[2] - b[2]; //perform rotation + + r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad); + r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad); + r[2] = p[2]; //translate to correct position + + out[0] = r[0] + b[0]; + out[1] = r[1] + b[1]; + out[2] = r[2] + b[2]; + return out; +} +/** + * Get the angle between two 3D vectors + * @param {ReadonlyVec3} a The first operand + * @param {ReadonlyVec3} b The second operand + * @returns {Number} The angle in radians + */ + +function angle(a, b) { + var ax = a[0], + ay = a[1], + az = a[2], + bx = b[0], + by = b[1], + bz = b[2], + mag1 = Math.sqrt(ax * ax + ay * ay + az * az), + mag2 = Math.sqrt(bx * bx + by * by + bz * bz), + mag = mag1 * mag2, + cosine = mag && dot(a, b) / mag; + return Math.acos(Math.min(Math.max(cosine, -1), 1)); +} +/** + * Set the components of a vec3 to zero + * + * @param {vec3} out the receiving vector + * @returns {vec3} out + */ + +function zero(out) { + out[0] = 0.0; + out[1] = 0.0; + out[2] = 0.0; + return out; +} +/** + * Returns a string representation of a vector + * + * @param {ReadonlyVec3} a vector to represent as a string + * @returns {String} string representation of the vector + */ + +function str(a) { + return "vec3(" + a[0] + ", " + a[1] + ", " + a[2] + ")"; } -exports.Group = Group; -//# sourceMappingURL=Group.js.map +/** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyVec3} a The first vector. + * @param {ReadonlyVec3} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ -/***/ }), -/* 26 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; +} +/** + * Returns whether or not the vectors have approximately the same elements in the same position. + * + * @param {ReadonlyVec3} a The first vector. + * @param {ReadonlyVec3} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ -"use strict"; +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2]; + var b0 = b[0], + b1 = b[1], + b2 = b[2]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)); +} +/** + * Alias for {@link vec3.subtract} + * @function + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ShapeBase = void 0; -const gl_matrix_1 = __webpack_require__(12); -const types_1 = __webpack_require__(3); -const glme = __webpack_require__(27); -const Vec2_1 = __webpack_require__(28); -const math_1 = __webpack_require__(29); -const Adapt_1 = __webpack_require__(30); -const Utilities_1 = __webpack_require__(32); -const SceneChild_1 = __webpack_require__(24); -const tmpMatrix = gl_matrix_1.mat4.create(); -const transformMatrix = gl_matrix_1.mat4.create(); -const perspectiveMatrix = gl_matrix_1.mat4.create(); -const repetitionMatrix = gl_matrix_1.mat4.create(); -/** - * Main class for shape generation - * - * @category Core.Abstract - * @abstract - * @class ShapeBase - * @order 4 - * @extends {SceneChild} +var sub = subtract; +/** + * Alias for {@link vec3.multiply} + * @function */ -class ShapeBase extends SceneChild_1.SceneChild { - /** - * Creates an instance of ShapeBase - * - * @param {ISceneChildSettings} [settings={}] - */ - constructor(settings = {}) { - super(settings); - /** - * Flag used to determine if indexedBuffer has been generated - * - * @internal - * @ignore - */ - this.bIndexed = false; - /** - * Array used for index a vertex buffer - * only for first level scene children - * - * @internal - * @ignore - */ - this.indexedBuffer = []; - /** - * The bounding inside the scene - * - * @type {IShapeBounding} - */ - this.bounding = { - cx: 0, - cy: 0, - x: -1, - y: -1, - width: 2, - height: 2, - }; - this.props = { - distance: settings.distance, - repetitions: settings.repetitions, - rotateX: settings.rotateX, - rotateY: settings.rotateY, - rotateZ: settings.rotateZ, - skewX: settings.skewX, - skewY: settings.skewY, - squeezeX: settings.squeezeX, - squeezeY: settings.squeezeY, - displace: settings.displace, - translate: settings.translate, - scale: settings.scale, - transformOrigin: settings.transformOrigin, - perspective: settings.perspective, - perspectiveOrigin: settings.perspectiveOrigin, - }; - this.anchor = - settings.anchor && Array.isArray(settings.anchor) - ? [ - typeof settings.anchor[0] === 'number' - ? Utilities_1.clamp(-1, 1, settings.anchor[0]) * -1 - : settings.anchor[0] === 'left' - ? 1 - : settings.anchor[0] === 'right' - ? -1 - : 0, - typeof settings.anchor[1] === 'number' - ? Utilities_1.clamp(-1, 1, settings.anchor[1]) * -1 - : settings.anchor[1] === 'top' - ? 1 - : settings.anchor[1] === 'bottom' - ? -1 - : 0, - ] - : [0, 0]; - this.boundingType = - typeof settings.boundingType === 'string' - ? settings.boundingType === 'relative' - ? types_1.EBoundingType.Relative - : types_1.EBoundingType.Fixed - : settings.boundingType || types_1.EBoundingType.Fixed; - this.vertexCallback = settings.vertexCallback; - } - /** - * Check if the shape should be generated every time - * - * @returns {boolean} - */ - isStatic() { - const props = this.props; - return (typeof props.repetitions !== 'function' && - typeof props.distance !== 'function' && - typeof props.displace !== 'function' && - typeof props.scale !== 'function' && - typeof props.translate !== 'function' && - typeof props.skewX !== 'function' && - typeof props.skewY !== 'function' && - typeof props.squeezeX !== 'function' && - typeof props.squeezeY !== 'function' && - typeof props.rotateX !== 'function' && - typeof props.rotateY !== 'function' && - typeof props.rotateZ !== 'function' && - typeof props.transformOrigin !== 'function' && - typeof props.perspective !== 'function' && - typeof props.perspectiveOrigin !== 'function'); - } - /** - * Check if the indexedBuffer array needs to be recreated every time, - * this can happen when a shape generates an array of vertices different in length at each repetition - * - * @returns {boolean} - */ - isStaticIndexed() { - return typeof this.props.repetitions !== 'function'; - } - /** - * Return a prop value - * - * @param {keyof ISceneChildProps} key - * @param {PropArguments} [propArguments] - * @param {*} [defaultValue] - * @returns {*} - */ - getProp(key, propArguments, defaultValue) { - let attribute = this.props[key]; - if (typeof attribute === 'function') { - attribute = attribute(propArguments); - } - return typeof attribute === 'undefined' || Number.isNaN(attribute) ? defaultValue : attribute; - } - /** - * Set a single or multiple props - * - * @param {(keyof ISceneChildProps | ISceneChildProps)} key - * @param {*} [value] - * @param {boolean} [bClearIndexed=false] - */ - setProp(key, value, bClearIndexed = false) { - if (typeof key === 'string') { - bClearIndexed = bClearIndexed || key == 'repetitions'; - this.props[key] = value; - } - else { - bClearIndexed = bClearIndexed || 'repetitions' in key; - Object.keys(key).forEach((k) => (this.props[k] = key[k])); - } - this.clearBuffer(bClearIndexed, true); + +var mul = multiply; +/** + * Alias for {@link vec3.divide} + * @function + */ + +var div = divide; +/** + * Alias for {@link vec3.distance} + * @function + */ + +var dist = distance; +/** + * Alias for {@link vec3.squaredDistance} + * @function + */ + +var sqrDist = squaredDistance; +/** + * Alias for {@link vec3.length} + * @function + */ + +var len = length; +/** + * Alias for {@link vec3.squaredLength} + * @function + */ + +var sqrLen = squaredLength; +/** + * Perform some operation over an array of vec3s. + * + * @param {Array} a the array of vectors to iterate over + * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed + * @param {Number} offset Number of elements to skip at the beginning of the array + * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array + * @param {Function} fn Function to call for each vector in the array + * @param {Object} [arg] additional argument to pass to fn + * @returns {Array} a + * @function + */ + +var forEach = function () { + var vec = create(); + return function (a, stride, offset, count, fn, arg) { + var i, l; + + if (!stride) { + stride = 3; } - /** - * Unset buffer - * - * @param {boolean} [bClearIndexed=false] - * @param {boolean} [bPropagateToParents=false] - * @param {boolean} [bPropagateToChildren=false] - */ - clearBuffer(bClearIndexed = false, bPropagateToParents = true) { - this.buffer = undefined; - if (bClearIndexed) { - this.bIndexed = false; - this.indexedBuffer = []; - } - this.bStatic = this.isStatic(); - this.bStaticIndexed = this.isStaticIndexed(); - if (bPropagateToParents && this.scene && !this.scene.isFirstLevelChild(this)) { - const parents = this.scene.getParentsOfSceneChild(this); - parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */); - } + + if (!offset) { + offset = 0; } - /** - * Update the vertex array if the shape is not static and update the indexedBuffer if it is also not static - * - * @param {number} generateId generation id - * @param {boolean} [bDirectSceneChild=false] adjust shape of center of scene - * @param {PropArguments} [parentPropArguments] - */ - generate(generateId = 0, bDirectSceneChild = false, parentPropArguments) { - var _a, _b; - if (this.buffer && this.bStatic) { - return; - } - this.generateId = generateId; - if (!this.bStaticIndexed || !this.bIndexed) - this.indexedBuffer = []; - const propArguments = ShapeBase.getEmptyPropArguments(this, parentPropArguments); - const repetition = propArguments.repetition; - const repetitions = this.getProp('repetitions', propArguments, 1); - const repetitionType = Array.isArray(repetitions) ? types_1.ERepetitionType.Matrix : types_1.ERepetitionType.Ring; - const repetitionCount = Array.isArray(repetitions) - ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) - : repetitions; - const repetitionRowCount = Array.isArray(repetitions) ? repetitions[0] : repetitionCount; - const repetitionColCount = Array.isArray(repetitions) ? (_b = repetitions[1]) !== null && _b !== void 0 ? _b : repetitions[0] : 1; - const rowRepetition = repetition.row; - rowRepetition.count = repetitionRowCount; - const colRepetition = repetition.col; - colRepetition.count = repetitionColCount; - repetition.count = repetitionCount; - repetition.col.count = repetitionColCount; - repetition.row.count = repetitionRowCount; - repetition.type = repetitionType; - let totalBufferLength = 0; - const buffers = []; - let currentIndex = 0; - const centerMatrix = gl_matrix_1.vec2.fromValues((repetitionColCount - 1) / 2, (repetitionRowCount - 1) / 2); - const sceneAnchor = this.scene ? [this.scene.anchor[0], this.scene.anchor[1], 0] : [0, 0, 0]; - const tmpTotalShapeBounding = [undefined, undefined, undefined, undefined]; - const tmpSingleRepetitionBounding = [undefined, undefined, undefined, undefined]; - for (let currentRowRepetition = 0; currentRowRepetition < repetitionRowCount; currentRowRepetition++) { - for (let currentColRepetition = 0; currentColRepetition < repetitionColCount; currentColRepetition++, currentIndex++) { - repetition.index = currentIndex + 1; - repetition.offset = repetitionCount > 1 ? currentIndex / (repetitionCount - 1) : 1; - repetition.angle = repetitionType === types_1.ERepetitionType.Ring ? (math_1.PI2 / repetitionCount) * currentIndex : 0; - colRepetition.index = currentColRepetition + 1; - colRepetition.offset = repetitionColCount > 1 ? currentColRepetition / (repetitionColCount - 1) : 1; - rowRepetition.index = currentRowRepetition + 1; - rowRepetition.offset = repetitionRowCount > 1 ? currentRowRepetition / (repetitionRowCount - 1) : 1; - // Generate primitives buffer recursively - const buffer = this.generateBuffer(generateId, propArguments); - const bufferLength = buffer.length; - const bounding = this.getShapeBounding(); - buffers[currentIndex] = new Float32Array(bufferLength); - totalBufferLength += bufferLength; - { - const distance = glme.toVec2(this.getProp('distance', propArguments, glme.VEC2_ZERO)); - const displace = this.getProp('displace', propArguments, 0); - const scale = glme.toVec3(this.getProp('scale', propArguments, glme.VEC2_ONE), 1); - const translate = glme.toVec3(this.getProp('translate', propArguments, glme.VEC2_ZERO), 0); - const skewX = this.getProp('skewX', propArguments, 0); - const skewY = this.getProp('skewY', propArguments, 0); - const squeezeX = this.getProp('squeezeX', propArguments, 0); - const squeezeY = this.getProp('squeezeY', propArguments, 0); - const rotateX = this.getProp('rotateX', propArguments, 0); - const rotateY = this.getProp('rotateY', propArguments, 0); - const rotateZ = this.getProp('rotateZ', propArguments, 0); - const perspective = Utilities_1.clamp(0, 1, this.getProp('perspective', propArguments, 0)); - const perspectiveOrigin = glme.toVec3(this.getProp('perspectiveOrigin', propArguments, glme.VEC2_ZERO), 0); - const transformOrigin = glme.toVec3(this.getProp('transformOrigin', propArguments, glme.VEC2_ZERO), 0); - let offset; - switch (repetitionType) { - case types_1.ERepetitionType.Ring: - offset = gl_matrix_1.vec3.fromValues(distance[0], 0, 0); - gl_matrix_1.vec3.rotateZ(offset, offset, glme.VEC3_ZERO, repetition.angle + displace); - break; - case types_1.ERepetitionType.Matrix: - offset = gl_matrix_1.vec3.fromValues(distance[1] * (currentColRepetition - centerMatrix[0]), distance[0] * (currentRowRepetition - centerMatrix[1]), 0); - break; - } - const perspectiveSize = perspective > 0 ? Math.max(bounding.width, bounding.height) / 2 : 1; - const perspectiveValue = perspective > 0 ? perspectiveSize + (1 - perspective) * (perspectiveSize * 10) : 0; - const bTransformOrigin = (this.boundingType === types_1.EBoundingType.Relative ? bounding.cx !== 0 || bounding.cy !== 0 : true) || - perspective !== 0 || - transformOrigin[0] !== 0 || - transformOrigin[1] !== 0; - const bPerspectiveOrigin = perspectiveOrigin[0] !== 0 || perspectiveOrigin[1] !== 0; - if (bTransformOrigin) { - if (this.boundingType === types_1.EBoundingType.Relative) { - transformOrigin[0] = transformOrigin[0] * (bounding.width / 2) + bounding.cx; - transformOrigin[1] = transformOrigin[1] * (bounding.height / 2) + bounding.cy; - } - else { - transformOrigin[0] *= bounding.width / 2; - transformOrigin[1] *= bounding.height / 2; - } - transformOrigin[2] = perspectiveValue; - } - /** - * Create Matrices - */ - { - /** - * Create Transformation matrix - */ - gl_matrix_1.mat4.identity(transformMatrix); - bTransformOrigin && gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, transformOrigin); - if (translate[0] !== 0 || translate[1] !== 0) - gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, translate); - if (skewX !== 0 || skewY !== 0) { - glme.fromSkew(tmpMatrix, [skewX, skewY]); - gl_matrix_1.mat4.multiply(transformMatrix, transformMatrix, tmpMatrix); - } - rotateX !== 0 && gl_matrix_1.mat4.rotateX(transformMatrix, transformMatrix, rotateX); - rotateY !== 0 && gl_matrix_1.mat4.rotateY(transformMatrix, transformMatrix, rotateY); - rotateZ !== 0 && gl_matrix_1.mat4.rotateZ(transformMatrix, transformMatrix, rotateZ); - if (scale[0] !== 1 || scale[1] !== 1) - gl_matrix_1.mat4.scale(transformMatrix, transformMatrix, scale); - bTransformOrigin && - gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, gl_matrix_1.vec3.scale(transformOrigin, transformOrigin, -1)); - /** - * Create Perspective matrix - */ - if (perspectiveValue > 0) { - if (bPerspectiveOrigin) { - if (this.boundingType === types_1.EBoundingType.Relative) { - perspectiveOrigin[0] = perspectiveOrigin[0] * (bounding.width / 2) + bounding.cx; - perspectiveOrigin[1] = perspectiveOrigin[1] * (bounding.height / 2) + bounding.cy; - } - else { - perspectiveOrigin[0] *= bounding.width / 2; - perspectiveOrigin[1] *= bounding.height / 2; - } - perspectiveOrigin[2] = 0; - } - gl_matrix_1.mat4.perspective(perspectiveMatrix, -Math.PI / 2, 1, 0, Infinity); - } - /** - * Create Repetition matrix - */ - gl_matrix_1.mat4.identity(repetitionMatrix); - gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, offset); - if (bDirectSceneChild) { - gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, sceneAnchor); - } - /** - * Apply anchor - */ - const shapeAnchor = [this.anchor[0] * (bounding.width / 2), this.anchor[1] * (bounding.height / 2), 0]; - gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, shapeAnchor); - if (repetitionType === types_1.ERepetitionType.Ring) - gl_matrix_1.mat4.rotateZ(repetitionMatrix, repetitionMatrix, repetition.angle + displace); - } - Adapt_1.Bounding.clear(tmpSingleRepetitionBounding); - // Apply matrices on vertex - for (let bufferIndex = 0; bufferIndex < bufferLength; bufferIndex += 2) { - const vertex = [buffer[bufferIndex], buffer[bufferIndex + 1], perspectiveValue]; - { - // Apply squeeze, can be insert into transformMatrix? - squeezeX !== 0 && Vec2_1.default.squeezeX(vertex, squeezeX); - squeezeY !== 0 && Vec2_1.default.squeezeY(vertex, squeezeY); - // Apply transforms - gl_matrix_1.vec3.transformMat4(vertex, vertex, transformMatrix); - // Apply perspective - if (perspectiveValue > 0) { - bPerspectiveOrigin && gl_matrix_1.vec3.add(vertex, vertex, perspectiveOrigin); - gl_matrix_1.vec3.transformMat4(vertex, vertex, perspectiveMatrix); - gl_matrix_1.vec3.scale(vertex, vertex, perspectiveValue); - bPerspectiveOrigin && gl_matrix_1.vec3.sub(vertex, vertex, perspectiveOrigin); - } - // apply repetition matrix - gl_matrix_1.vec3.transformMat4(vertex, vertex, repetitionMatrix); - // custom vertex manipulation - if (typeof this.vertexCallback !== 'undefined') { - const index = bufferIndex / 2; - const count = bufferLength / 2; - const vertexRepetition = { - index: index + 1, - count, - offset: count > 1 ? index / (count - 1) : 1, - }; - this.vertexCallback(vertex, vertexRepetition, propArguments); - } - } - buffers[currentIndex][bufferIndex] = vertex[0]; - buffers[currentIndex][bufferIndex + 1] = vertex[1]; - Adapt_1.Bounding.add(tmpSingleRepetitionBounding, vertex[0], vertex[1]); - Adapt_1.Bounding.add(tmpTotalShapeBounding, vertex[0], vertex[1]); - } - } - // Bounding.sum(tmpTotalShapeBounding, tmpSingleRepetitionBounding) - // After buffer creation, add a frame into indexedBuffer if not static or update bounding - const singleRepetitionBounding = { cx: 0, cy: 0, x: -1, y: -1, width: 2, height: 2 }; - Adapt_1.Bounding.bind(singleRepetitionBounding, tmpSingleRepetitionBounding); - if (!this.bStaticIndexed || !this.bIndexed) { - this.addIndex(bufferLength, repetition, singleRepetitionBounding); - } - } - } - Adapt_1.Bounding.bind(this.bounding, tmpTotalShapeBounding); - this.buffer = new Float32Array(totalBufferLength); - for (let i = 0, offset = 0, len = buffers.length; i < len; offset += buffers[i].length, i++) - this.buffer.set(buffers[i], offset); - this.bIndexed = true; + + if (count) { + l = Math.min(count * stride + offset, a.length); + } else { + l = a.length; + } + + for (i = offset; i < l; i += stride) { + vec[0] = a[i]; + vec[1] = a[i + 1]; + vec[2] = a[i + 2]; + fn(vec, vec, arg); + a[i] = vec[0]; + a[i + 1] = vec[1]; + a[i + 2] = vec[2]; + } + + return a; + }; +}(); + +/***/ }), +/* 16 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "fromRotationTranslationValues": () => (/* binding */ fromRotationTranslationValues), +/* harmony export */ "fromRotationTranslation": () => (/* binding */ fromRotationTranslation), +/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), +/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), +/* harmony export */ "fromMat4": () => (/* binding */ fromMat4), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "getReal": () => (/* binding */ getReal), +/* harmony export */ "getDual": () => (/* binding */ getDual), +/* harmony export */ "setReal": () => (/* binding */ setReal), +/* harmony export */ "setDual": () => (/* binding */ setDual), +/* harmony export */ "getTranslation": () => (/* binding */ getTranslation), +/* harmony export */ "translate": () => (/* binding */ translate), +/* harmony export */ "rotateX": () => (/* binding */ rotateX), +/* harmony export */ "rotateY": () => (/* binding */ rotateY), +/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), +/* harmony export */ "rotateByQuatAppend": () => (/* binding */ rotateByQuatAppend), +/* harmony export */ "rotateByQuatPrepend": () => (/* binding */ rotateByQuatPrepend), +/* harmony export */ "rotateAroundAxis": () => (/* binding */ rotateAroundAxis), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "dot": () => (/* binding */ dot), +/* harmony export */ "lerp": () => (/* binding */ lerp), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "conjugate": () => (/* binding */ conjugate), +/* harmony export */ "length": () => (/* binding */ length), +/* harmony export */ "len": () => (/* binding */ len), +/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), +/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), +/* harmony export */ "normalize": () => (/* binding */ normalize), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); +/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13); +/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12); + + + +/** + * Dual Quaternion
+ * Format: [real, dual]
+ * Quaternion format: XYZW
+ * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
+ * @module quat2 + */ + +/** + * Creates a new identity dual quat + * + * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation] + */ + +function create() { + var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + dq[0] = 0; + dq[1] = 0; + dq[2] = 0; + dq[4] = 0; + dq[5] = 0; + dq[6] = 0; + dq[7] = 0; + } + + dq[3] = 1; + return dq; +} +/** + * Creates a new quat initialized with values from an existing quaternion + * + * @param {ReadonlyQuat2} a dual quaternion to clone + * @returns {quat2} new dual quaternion + * @function + */ + +function clone(a) { + var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); + dq[0] = a[0]; + dq[1] = a[1]; + dq[2] = a[2]; + dq[3] = a[3]; + dq[4] = a[4]; + dq[5] = a[5]; + dq[6] = a[6]; + dq[7] = a[7]; + return dq; +} +/** + * Creates a new dual quat initialized with the given values + * + * @param {Number} x1 X component + * @param {Number} y1 Y component + * @param {Number} z1 Z component + * @param {Number} w1 W component + * @param {Number} x2 X component + * @param {Number} y2 Y component + * @param {Number} z2 Z component + * @param {Number} w2 W component + * @returns {quat2} new dual quaternion + * @function + */ + +function fromValues(x1, y1, z1, w1, x2, y2, z2, w2) { + var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); + dq[0] = x1; + dq[1] = y1; + dq[2] = z1; + dq[3] = w1; + dq[4] = x2; + dq[5] = y2; + dq[6] = z2; + dq[7] = w2; + return dq; +} +/** + * Creates a new dual quat from the given values (quat and translation) + * + * @param {Number} x1 X component + * @param {Number} y1 Y component + * @param {Number} z1 Z component + * @param {Number} w1 W component + * @param {Number} x2 X component (translation) + * @param {Number} y2 Y component (translation) + * @param {Number} z2 Z component (translation) + * @returns {quat2} new dual quaternion + * @function + */ + +function fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) { + var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); + dq[0] = x1; + dq[1] = y1; + dq[2] = z1; + dq[3] = w1; + var ax = x2 * 0.5, + ay = y2 * 0.5, + az = z2 * 0.5; + dq[4] = ax * w1 + ay * z1 - az * y1; + dq[5] = ay * w1 + az * x1 - ax * z1; + dq[6] = az * w1 + ax * y1 - ay * x1; + dq[7] = -ax * x1 - ay * y1 - az * z1; + return dq; +} +/** + * Creates a dual quat from a quaternion and a translation + * + * @param {ReadonlyQuat2} dual quaternion receiving operation result + * @param {ReadonlyQuat} q a normalized quaternion + * @param {ReadonlyVec3} t tranlation vector + * @returns {quat2} dual quaternion receiving operation result + * @function + */ + +function fromRotationTranslation(out, q, t) { + var ax = t[0] * 0.5, + ay = t[1] * 0.5, + az = t[2] * 0.5, + bx = q[0], + by = q[1], + bz = q[2], + bw = q[3]; + out[0] = bx; + out[1] = by; + out[2] = bz; + out[3] = bw; + out[4] = ax * bw + ay * bz - az * by; + out[5] = ay * bw + az * bx - ax * bz; + out[6] = az * bw + ax * by - ay * bx; + out[7] = -ax * bx - ay * by - az * bz; + return out; +} +/** + * Creates a dual quat from a translation + * + * @param {ReadonlyQuat2} dual quaternion receiving operation result + * @param {ReadonlyVec3} t translation vector + * @returns {quat2} dual quaternion receiving operation result + * @function + */ + +function fromTranslation(out, t) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = t[0] * 0.5; + out[5] = t[1] * 0.5; + out[6] = t[2] * 0.5; + out[7] = 0; + return out; +} +/** + * Creates a dual quat from a quaternion + * + * @param {ReadonlyQuat2} dual quaternion receiving operation result + * @param {ReadonlyQuat} q the quaternion + * @returns {quat2} dual quaternion receiving operation result + * @function + */ + +function fromRotation(out, q) { + out[0] = q[0]; + out[1] = q[1]; + out[2] = q[2]; + out[3] = q[3]; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; +} +/** + * Creates a new dual quat from a matrix (4x4) + * + * @param {quat2} out the dual quaternion + * @param {ReadonlyMat4} a the matrix + * @returns {quat2} dual quat receiving operation result + * @function + */ + +function fromMat4(out, a) { + //TODO Optimize this + var outer = _quat_js__WEBPACK_IMPORTED_MODULE_1__.create(); + _mat4_js__WEBPACK_IMPORTED_MODULE_2__.getRotation(outer, a); + var t = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + _mat4_js__WEBPACK_IMPORTED_MODULE_2__.getTranslation(t, a); + fromRotationTranslation(out, outer, t); + return out; +} +/** + * Copy the values from one dual quat to another + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the source dual quaternion + * @returns {quat2} out + * @function + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + return out; +} +/** + * Set a dual quat to the identity dual quaternion + * + * @param {quat2} out the receiving quaternion + * @returns {quat2} out + */ + +function identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; +} +/** + * Set the components of a dual quat to the given values + * + * @param {quat2} out the receiving quaternion + * @param {Number} x1 X component + * @param {Number} y1 Y component + * @param {Number} z1 Z component + * @param {Number} w1 W component + * @param {Number} x2 X component + * @param {Number} y2 Y component + * @param {Number} z2 Z component + * @param {Number} w2 W component + * @returns {quat2} out + * @function + */ + +function set(out, x1, y1, z1, w1, x2, y2, z2, w2) { + out[0] = x1; + out[1] = y1; + out[2] = z1; + out[3] = w1; + out[4] = x2; + out[5] = y2; + out[6] = z2; + out[7] = w2; + return out; +} +/** + * Gets the real part of a dual quat + * @param {quat} out real part + * @param {ReadonlyQuat2} a Dual Quaternion + * @return {quat} real part + */ + +var getReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__.copy; +/** + * Gets the dual part of a dual quat + * @param {quat} out dual part + * @param {ReadonlyQuat2} a Dual Quaternion + * @return {quat} dual part + */ + +function getDual(out, a) { + out[0] = a[4]; + out[1] = a[5]; + out[2] = a[6]; + out[3] = a[7]; + return out; +} +/** + * Set the real component of a dual quat to the given quaternion + * + * @param {quat2} out the receiving quaternion + * @param {ReadonlyQuat} q a quaternion representing the real part + * @returns {quat2} out + * @function + */ + +var setReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__.copy; +/** + * Set the dual component of a dual quat to the given quaternion + * + * @param {quat2} out the receiving quaternion + * @param {ReadonlyQuat} q a quaternion representing the dual part + * @returns {quat2} out + * @function + */ + +function setDual(out, q) { + out[4] = q[0]; + out[5] = q[1]; + out[6] = q[2]; + out[7] = q[3]; + return out; +} +/** + * Gets the translation of a normalized dual quat + * @param {vec3} out translation + * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed + * @return {vec3} translation + */ + +function getTranslation(out, a) { + var ax = a[4], + ay = a[5], + az = a[6], + aw = a[7], + bx = -a[0], + by = -a[1], + bz = -a[2], + bw = a[3]; + out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + return out; +} +/** + * Translates a dual quat by the given vector + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to translate + * @param {ReadonlyVec3} v vector to translate by + * @returns {quat2} out + */ + +function translate(out, a, v) { + var ax1 = a[0], + ay1 = a[1], + az1 = a[2], + aw1 = a[3], + bx1 = v[0] * 0.5, + by1 = v[1] * 0.5, + bz1 = v[2] * 0.5, + ax2 = a[4], + ay2 = a[5], + az2 = a[6], + aw2 = a[7]; + out[0] = ax1; + out[1] = ay1; + out[2] = az1; + out[3] = aw1; + out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2; + out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2; + out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2; + out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2; + return out; +} +/** + * Rotates a dual quat around the X axis + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @param {number} rad how far should the rotation be + * @returns {quat2} out + */ + +function rotateX(out, a, rad) { + var bx = -a[0], + by = -a[1], + bz = -a[2], + bw = a[3], + ax = a[4], + ay = a[5], + az = a[6], + aw = a[7], + ax1 = ax * bw + aw * bx + ay * bz - az * by, + ay1 = ay * bw + aw * by + az * bx - ax * bz, + az1 = az * bw + aw * bz + ax * by - ay * bx, + aw1 = aw * bw - ax * bx - ay * by - az * bz; + _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateX(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; +} +/** + * Rotates a dual quat around the Y axis + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @param {number} rad how far should the rotation be + * @returns {quat2} out + */ + +function rotateY(out, a, rad) { + var bx = -a[0], + by = -a[1], + bz = -a[2], + bw = a[3], + ax = a[4], + ay = a[5], + az = a[6], + aw = a[7], + ax1 = ax * bw + aw * bx + ay * bz - az * by, + ay1 = ay * bw + aw * by + az * bx - ax * bz, + az1 = az * bw + aw * bz + ax * by - ay * bx, + aw1 = aw * bw - ax * bx - ay * by - az * bz; + _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateY(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; +} +/** + * Rotates a dual quat around the Z axis + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @param {number} rad how far should the rotation be + * @returns {quat2} out + */ + +function rotateZ(out, a, rad) { + var bx = -a[0], + by = -a[1], + bz = -a[2], + bw = a[3], + ax = a[4], + ay = a[5], + az = a[6], + aw = a[7], + ax1 = ax * bw + aw * bx + ay * bz - az * by, + ay1 = ay * bw + aw * by + az * bx - ax * bz, + az1 = az * bw + aw * bz + ax * by - ay * bx, + aw1 = aw * bw - ax * bx - ay * by - az * bz; + _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateZ(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; +} +/** + * Rotates a dual quat by a given quaternion (a * q) + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @param {ReadonlyQuat} q quaternion to rotate by + * @returns {quat2} out + */ + +function rotateByQuatAppend(out, a, q) { + var qx = q[0], + qy = q[1], + qz = q[2], + qw = q[3], + ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + out[0] = ax * qw + aw * qx + ay * qz - az * qy; + out[1] = ay * qw + aw * qy + az * qx - ax * qz; + out[2] = az * qw + aw * qz + ax * qy - ay * qx; + out[3] = aw * qw - ax * qx - ay * qy - az * qz; + ax = a[4]; + ay = a[5]; + az = a[6]; + aw = a[7]; + out[4] = ax * qw + aw * qx + ay * qz - az * qy; + out[5] = ay * qw + aw * qy + az * qx - ax * qz; + out[6] = az * qw + aw * qz + ax * qy - ay * qx; + out[7] = aw * qw - ax * qx - ay * qy - az * qz; + return out; +} +/** + * Rotates a dual quat by a given quaternion (q * a) + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat} q quaternion to rotate by + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @returns {quat2} out + */ + +function rotateByQuatPrepend(out, q, a) { + var qx = q[0], + qy = q[1], + qz = q[2], + qw = q[3], + bx = a[0], + by = a[1], + bz = a[2], + bw = a[3]; + out[0] = qx * bw + qw * bx + qy * bz - qz * by; + out[1] = qy * bw + qw * by + qz * bx - qx * bz; + out[2] = qz * bw + qw * bz + qx * by - qy * bx; + out[3] = qw * bw - qx * bx - qy * by - qz * bz; + bx = a[4]; + by = a[5]; + bz = a[6]; + bw = a[7]; + out[4] = qx * bw + qw * bx + qy * bz - qz * by; + out[5] = qy * bw + qw * by + qz * bx - qx * bz; + out[6] = qz * bw + qw * bz + qx * by - qy * bx; + out[7] = qw * bw - qx * bx - qy * by - qz * bz; + return out; +} +/** + * Rotates a dual quat around a given axis. Does the normalisation automatically + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @param {ReadonlyVec3} axis the axis to rotate around + * @param {Number} rad how far the rotation should be + * @returns {quat2} out + */ + +function rotateAroundAxis(out, a, axis, rad) { + //Special case for rad = 0 + if (Math.abs(rad) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + return copy(out, a); + } + + var axisLength = Math.hypot(axis[0], axis[1], axis[2]); + rad = rad * 0.5; + var s = Math.sin(rad); + var bx = s * axis[0] / axisLength; + var by = s * axis[1] / axisLength; + var bz = s * axis[2] / axisLength; + var bw = Math.cos(rad); + var ax1 = a[0], + ay1 = a[1], + az1 = a[2], + aw1 = a[3]; + out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + var ax = a[4], + ay = a[5], + az = a[6], + aw = a[7]; + out[4] = ax * bw + aw * bx + ay * bz - az * by; + out[5] = ay * bw + aw * by + az * bx - ax * bz; + out[6] = az * bw + aw * bz + ax * by - ay * bx; + out[7] = aw * bw - ax * bx - ay * by - az * bz; + return out; +} +/** + * Adds two dual quat's + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the first operand + * @param {ReadonlyQuat2} b the second operand + * @returns {quat2} out + * @function + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + return out; +} +/** + * Multiplies two dual quat's + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the first operand + * @param {ReadonlyQuat2} b the second operand + * @returns {quat2} out + */ + +function multiply(out, a, b) { + var ax0 = a[0], + ay0 = a[1], + az0 = a[2], + aw0 = a[3], + bx1 = b[4], + by1 = b[5], + bz1 = b[6], + bw1 = b[7], + ax1 = a[4], + ay1 = a[5], + az1 = a[6], + aw1 = a[7], + bx0 = b[0], + by0 = b[1], + bz0 = b[2], + bw0 = b[3]; + out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0; + out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0; + out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0; + out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0; + out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0; + out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0; + out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0; + out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0; + return out; +} +/** + * Alias for {@link quat2.multiply} + * @function + */ + +var mul = multiply; +/** + * Scales a dual quat by a scalar number + * + * @param {quat2} out the receiving dual quat + * @param {ReadonlyQuat2} a the dual quat to scale + * @param {Number} b amount to scale the dual quat by + * @returns {quat2} out + * @function + */ + +function scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + return out; +} +/** + * Calculates the dot product of two dual quat's (The dot product of the real parts) + * + * @param {ReadonlyQuat2} a the first operand + * @param {ReadonlyQuat2} b the second operand + * @returns {Number} dot product of a and b + * @function + */ + +var dot = _quat_js__WEBPACK_IMPORTED_MODULE_1__.dot; +/** + * Performs a linear interpolation between two dual quats's + * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5) + * + * @param {quat2} out the receiving dual quat + * @param {ReadonlyQuat2} a the first operand + * @param {ReadonlyQuat2} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {quat2} out + */ + +function lerp(out, a, b, t) { + var mt = 1 - t; + if (dot(a, b) < 0) t = -t; + out[0] = a[0] * mt + b[0] * t; + out[1] = a[1] * mt + b[1] * t; + out[2] = a[2] * mt + b[2] * t; + out[3] = a[3] * mt + b[3] * t; + out[4] = a[4] * mt + b[4] * t; + out[5] = a[5] * mt + b[5] * t; + out[6] = a[6] * mt + b[6] * t; + out[7] = a[7] * mt + b[7] * t; + return out; +} +/** + * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a dual quat to calculate inverse of + * @returns {quat2} out + */ + +function invert(out, a) { + var sqlen = squaredLength(a); + out[0] = -a[0] / sqlen; + out[1] = -a[1] / sqlen; + out[2] = -a[2] / sqlen; + out[3] = a[3] / sqlen; + out[4] = -a[4] / sqlen; + out[5] = -a[5] / sqlen; + out[6] = -a[6] / sqlen; + out[7] = a[7] / sqlen; + return out; +} +/** + * Calculates the conjugate of a dual quat + * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result. + * + * @param {quat2} out the receiving quaternion + * @param {ReadonlyQuat2} a quat to calculate conjugate of + * @returns {quat2} out + */ + +function conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + out[4] = -a[4]; + out[5] = -a[5]; + out[6] = -a[6]; + out[7] = a[7]; + return out; +} +/** + * Calculates the length of a dual quat + * + * @param {ReadonlyQuat2} a dual quat to calculate length of + * @returns {Number} length of a + * @function + */ + +var length = _quat_js__WEBPACK_IMPORTED_MODULE_1__.length; +/** + * Alias for {@link quat2.length} + * @function + */ + +var len = length; +/** + * Calculates the squared length of a dual quat + * + * @param {ReadonlyQuat2} a dual quat to calculate squared length of + * @returns {Number} squared length of a + * @function + */ + +var squaredLength = _quat_js__WEBPACK_IMPORTED_MODULE_1__.squaredLength; +/** + * Alias for {@link quat2.squaredLength} + * @function + */ + +var sqrLen = squaredLength; +/** + * Normalize a dual quat + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a dual quaternion to normalize + * @returns {quat2} out + * @function + */ + +function normalize(out, a) { + var magnitude = squaredLength(a); + + if (magnitude > 0) { + magnitude = Math.sqrt(magnitude); + var a0 = a[0] / magnitude; + var a1 = a[1] / magnitude; + var a2 = a[2] / magnitude; + var a3 = a[3] / magnitude; + var b0 = a[4]; + var b1 = a[5]; + var b2 = a[6]; + var b3 = a[7]; + var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = (b0 - a0 * a_dot_b) / magnitude; + out[5] = (b1 - a1 * a_dot_b) / magnitude; + out[6] = (b2 - a2 * a_dot_b) / magnitude; + out[7] = (b3 - a3 * a_dot_b) / magnitude; + } + + return out; +} +/** + * Returns a string representation of a dual quatenion + * + * @param {ReadonlyQuat2} a dual quaternion to represent as a string + * @returns {String} string representation of the dual quat + */ + +function str(a) { + return "quat2(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ")"; +} +/** + * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyQuat2} a the first dual quaternion. + * @param {ReadonlyQuat2} b the second dual quaternion. + * @returns {Boolean} true if the dual quaternions are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7]; +} +/** + * Returns whether or not the dual quaternions have approximately the same elements in the same position. + * + * @param {ReadonlyQuat2} a the first dual quat. + * @param {ReadonlyQuat2} b the second dual quat. + * @returns {Boolean} true if the dual quats are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5], + a6 = a[6], + a7 = a[7]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3], + b4 = b[4], + b5 = b[5], + b6 = b[6], + b7 = b[7]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)); +} + +/***/ }), +/* 17 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "divide": () => (/* binding */ divide), +/* harmony export */ "ceil": () => (/* binding */ ceil), +/* harmony export */ "floor": () => (/* binding */ floor), +/* harmony export */ "min": () => (/* binding */ min), +/* harmony export */ "max": () => (/* binding */ max), +/* harmony export */ "round": () => (/* binding */ round), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), +/* harmony export */ "distance": () => (/* binding */ distance), +/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), +/* harmony export */ "length": () => (/* binding */ length), +/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), +/* harmony export */ "negate": () => (/* binding */ negate), +/* harmony export */ "inverse": () => (/* binding */ inverse), +/* harmony export */ "normalize": () => (/* binding */ normalize), +/* harmony export */ "dot": () => (/* binding */ dot), +/* harmony export */ "cross": () => (/* binding */ cross), +/* harmony export */ "lerp": () => (/* binding */ lerp), +/* harmony export */ "random": () => (/* binding */ random), +/* harmony export */ "transformMat2": () => (/* binding */ transformMat2), +/* harmony export */ "transformMat2d": () => (/* binding */ transformMat2d), +/* harmony export */ "transformMat3": () => (/* binding */ transformMat3), +/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), +/* harmony export */ "rotate": () => (/* binding */ rotate), +/* harmony export */ "angle": () => (/* binding */ angle), +/* harmony export */ "zero": () => (/* binding */ zero), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "len": () => (/* binding */ len), +/* harmony export */ "sub": () => (/* binding */ sub), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "div": () => (/* binding */ div), +/* harmony export */ "dist": () => (/* binding */ dist), +/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), +/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), +/* harmony export */ "forEach": () => (/* binding */ forEach) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); + +/** + * 2 Dimensional Vector + * @module vec2 + */ + +/** + * Creates a new, empty vec2 + * + * @returns {vec2} a new 2D vector + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[0] = 0; + out[1] = 0; + } + + return out; +} +/** + * Creates a new vec2 initialized with values from an existing vector + * + * @param {ReadonlyVec2} a vector to clone + * @returns {vec2} a new 2D vector + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); + out[0] = a[0]; + out[1] = a[1]; + return out; +} +/** + * Creates a new vec2 initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @returns {vec2} a new 2D vector + */ + +function fromValues(x, y) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); + out[0] = x; + out[1] = y; + return out; +} +/** + * Copy the values from one vec2 to another + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the source vector + * @returns {vec2} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + return out; +} +/** + * Set the components of a vec2 to the given values + * + * @param {vec2} out the receiving vector + * @param {Number} x X component + * @param {Number} y Y component + * @returns {vec2} out + */ + +function set(out, x, y) { + out[0] = x; + out[1] = y; + return out; +} +/** + * Adds two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + return out; +} +/** + * Subtracts vector b from vector a + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + return out; +} +/** + * Multiplies two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + return out; +} +/** + * Divides two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + return out; +} +/** + * Math.ceil the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to ceil + * @returns {vec2} out + */ + +function ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + return out; +} +/** + * Math.floor the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to floor + * @returns {vec2} out + */ + +function floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + return out; +} +/** + * Returns the minimum of two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + return out; +} +/** + * Returns the maximum of two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + return out; +} +/** + * Math.round the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to round + * @returns {vec2} out + */ + +function round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + return out; +} +/** + * Scales a vec2 by a scalar number + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {vec2} out + */ + +function scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + return out; +} +/** + * Adds two vec2's after scaling the second operand by a scalar value + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @param {Number} scale the amount to scale b by before adding + * @returns {vec2} out + */ + +function scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + return out; +} +/** + * Calculates the euclidian distance between two vec2's + * + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {Number} distance between a and b + */ + +function distance(a, b) { + var x = b[0] - a[0], + y = b[1] - a[1]; + return Math.hypot(x, y); +} +/** + * Calculates the squared euclidian distance between two vec2's + * + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {Number} squared distance between a and b + */ + +function squaredDistance(a, b) { + var x = b[0] - a[0], + y = b[1] - a[1]; + return x * x + y * y; +} +/** + * Calculates the length of a vec2 + * + * @param {ReadonlyVec2} a vector to calculate length of + * @returns {Number} length of a + */ + +function length(a) { + var x = a[0], + y = a[1]; + return Math.hypot(x, y); +} +/** + * Calculates the squared length of a vec2 + * + * @param {ReadonlyVec2} a vector to calculate squared length of + * @returns {Number} squared length of a + */ + +function squaredLength(a) { + var x = a[0], + y = a[1]; + return x * x + y * y; +} +/** + * Negates the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to negate + * @returns {vec2} out + */ + +function negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + return out; +} +/** + * Returns the inverse of the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to invert + * @returns {vec2} out + */ + +function inverse(out, a) { + out[0] = 1.0 / a[0]; + out[1] = 1.0 / a[1]; + return out; +} +/** + * Normalize a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to normalize + * @returns {vec2} out + */ + +function normalize(out, a) { + var x = a[0], + y = a[1]; + var len = x * x + y * y; + + if (len > 0) { + //TODO: evaluate use of glm_invsqrt here? + len = 1 / Math.sqrt(len); + } + + out[0] = a[0] * len; + out[1] = a[1] * len; + return out; +} +/** + * Calculates the dot product of two vec2's + * + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {Number} dot product of a and b + */ + +function dot(a, b) { + return a[0] * b[0] + a[1] * b[1]; +} +/** + * Computes the cross product of two vec2's + * Note that the cross product must by definition produce a 3D vector + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec3} out + */ + +function cross(out, a, b) { + var z = a[0] * b[1] - a[1] * b[0]; + out[0] = out[1] = 0; + out[2] = z; + return out; +} +/** + * Performs a linear interpolation between two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {vec2} out + */ + +function lerp(out, a, b, t) { + var ax = a[0], + ay = a[1]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + return out; +} +/** + * Generates a random vector with the given scale + * + * @param {vec2} out the receiving vector + * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns {vec2} out + */ + +function random(out, scale) { + scale = scale || 1.0; + var r = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 * Math.PI; + out[0] = Math.cos(r) * scale; + out[1] = Math.sin(r) * scale; + return out; +} +/** + * Transforms the vec2 with a mat2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the vector to transform + * @param {ReadonlyMat2} m matrix to transform with + * @returns {vec2} out + */ + +function transformMat2(out, a, m) { + var x = a[0], + y = a[1]; + out[0] = m[0] * x + m[2] * y; + out[1] = m[1] * x + m[3] * y; + return out; +} +/** + * Transforms the vec2 with a mat2d + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the vector to transform + * @param {ReadonlyMat2d} m matrix to transform with + * @returns {vec2} out + */ + +function transformMat2d(out, a, m) { + var x = a[0], + y = a[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; +} +/** + * Transforms the vec2 with a mat3 + * 3rd vector component is implicitly '1' + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the vector to transform + * @param {ReadonlyMat3} m matrix to transform with + * @returns {vec2} out + */ + +function transformMat3(out, a, m) { + var x = a[0], + y = a[1]; + out[0] = m[0] * x + m[3] * y + m[6]; + out[1] = m[1] * x + m[4] * y + m[7]; + return out; +} +/** + * Transforms the vec2 with a mat4 + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the vector to transform + * @param {ReadonlyMat4} m matrix to transform with + * @returns {vec2} out + */ + +function transformMat4(out, a, m) { + var x = a[0]; + var y = a[1]; + out[0] = m[0] * x + m[4] * y + m[12]; + out[1] = m[1] * x + m[5] * y + m[13]; + return out; +} +/** + * Rotate a 2D vector + * @param {vec2} out The receiving vec2 + * @param {ReadonlyVec2} a The vec2 point to rotate + * @param {ReadonlyVec2} b The origin of the rotation + * @param {Number} rad The angle of rotation in radians + * @returns {vec2} out + */ + +function rotate(out, a, b, rad) { + //Translate point to the origin + var p0 = a[0] - b[0], + p1 = a[1] - b[1], + sinC = Math.sin(rad), + cosC = Math.cos(rad); //perform rotation and translate to correct position + + out[0] = p0 * cosC - p1 * sinC + b[0]; + out[1] = p0 * sinC + p1 * cosC + b[1]; + return out; +} +/** + * Get the angle between two 2D vectors + * @param {ReadonlyVec2} a The first operand + * @param {ReadonlyVec2} b The second operand + * @returns {Number} The angle in radians + */ + +function angle(a, b) { + var x1 = a[0], + y1 = a[1], + x2 = b[0], + y2 = b[1], + // mag is the product of the magnitudes of a and b + mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2), + // mag &&.. short circuits if mag == 0 + cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1 + + return Math.acos(Math.min(Math.max(cosine, -1), 1)); +} +/** + * Set the components of a vec2 to zero + * + * @param {vec2} out the receiving vector + * @returns {vec2} out + */ + +function zero(out) { + out[0] = 0.0; + out[1] = 0.0; + return out; +} +/** + * Returns a string representation of a vector + * + * @param {ReadonlyVec2} a vector to represent as a string + * @returns {String} string representation of the vector + */ + +function str(a) { + return "vec2(" + a[0] + ", " + a[1] + ")"; +} +/** + * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===) + * + * @param {ReadonlyVec2} a The first vector. + * @param {ReadonlyVec2} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1]; +} +/** + * Returns whether or not the vectors have approximately the same elements in the same position. + * + * @param {ReadonlyVec2} a The first vector. + * @param {ReadonlyVec2} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1]; + var b0 = b[0], + b1 = b[1]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)); +} +/** + * Alias for {@link vec2.length} + * @function + */ + +var len = length; +/** + * Alias for {@link vec2.subtract} + * @function + */ + +var sub = subtract; +/** + * Alias for {@link vec2.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link vec2.divide} + * @function + */ + +var div = divide; +/** + * Alias for {@link vec2.distance} + * @function + */ + +var dist = distance; +/** + * Alias for {@link vec2.squaredDistance} + * @function + */ + +var sqrDist = squaredDistance; +/** + * Alias for {@link vec2.squaredLength} + * @function + */ + +var sqrLen = squaredLength; +/** + * Perform some operation over an array of vec2s. + * + * @param {Array} a the array of vectors to iterate over + * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed + * @param {Number} offset Number of elements to skip at the beginning of the array + * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array + * @param {Function} fn Function to call for each vector in the array + * @param {Object} [arg] additional argument to pass to fn + * @returns {Array} a + * @function + */ + +var forEach = function () { + var vec = create(); + return function (a, stride, offset, count, fn, arg) { + var i, l; + + if (!stride) { + stride = 2; } - /** - * Return current shape (whit repetions) bounding - * - * @return {*} {IShapeBounding} - */ - getBounding() { - return this.bounding; + + if (!offset) { + offset = 0; } - /** - * Get number of repetitions - * - * @returns {number} - */ - getRepetitionCount() { - var _a; - const repetitions = this.getProp('repetitions', undefined, 1); - return Array.isArray(repetitions) ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) : repetitions; + + if (count) { + l = Math.min(count * stride + offset, a.length); + } else { + l = a.length; } - /** - * Return buffer - * - * @returns {(Float32Array | undefined)} - */ - getBuffer() { - return this.buffer; + + for (i = offset; i < l; i += stride) { + vec[0] = a[i]; + vec[1] = a[i + 1]; + fn(vec, vec, arg); + a[i] = vec[0]; + a[i + 1] = vec[1]; } + + return a; + }; +}(); + +/***/ }), +/* 18 */ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__webpack_require__(19), exports); +__exportStar(__webpack_require__(20), exports); +__exportStar(__webpack_require__(21), exports); +__exportStar(__webpack_require__(22), exports); +__exportStar(__webpack_require__(23), exports); +__exportStar(__webpack_require__(24), exports); +__exportStar(__webpack_require__(25), exports); +__exportStar(__webpack_require__(26), exports); +//# sourceMappingURL=index.js.map + +/***/ }), +/* 19 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=indexedBuffer.js.map + +/***/ }), +/* 20 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=propArguments.js.map + +/***/ }), +/* 21 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ERepetitionType = void 0; +/** + * Repetition type enumerator. + * + * @category Core.Repetition + * @internal + */ +var ERepetitionType; +(function (ERepetitionType) { /** - * Return indexed buffer - * - * @returns {(Array> | undefined)} + * Defines the type of repetition of the shape, + * in a circular way starting from the center of the scene + * @order 1 */ - getIndexedBuffer() { - return this.indexedBuffer; - } + ERepetitionType[ERepetitionType["Ring"] = 1] = "Ring"; /** - * Return number of encapsulation - * - * @param {IBufferIndex} index - * @returns {number} + * Defines the type of repetition of the shape, + * on a nxm grid starting from the center of the scene + * @order 2 */ - static getIndexParentLevel(index) { - if (typeof index.parent === 'undefined') - return 0; - let currentParent = index.parent; - let currentParentLevel = 1; - while (typeof currentParent.parent !== 'undefined') { - currentParentLevel++; - currentParent = currentParent.parent; - } - return currentParentLevel; - } + ERepetitionType[ERepetitionType["Matrix"] = 2] = "Matrix"; +})(ERepetitionType = exports.ERepetitionType || (exports.ERepetitionType = {})); +//# sourceMappingURL=repetitions.js.map + +/***/ }), +/* 22 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=scene-child.js.map + +/***/ }), +/* 23 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=scene.js.map + +/***/ }), +/* 24 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.EBoundingType = void 0; +var EBoundingType; +(function (EBoundingType) { /** - * Stream buffer - * - * @param {(TStreamCallback} callback + * Relative to the real bounding of the shape + * @order 2 */ - stream(callback) { - if (this.buffer && this.indexedBuffer) { - for (let i = 0, j = 0, len = this.indexedBuffer.length; i < len; i++) { - const currentIndexing = this.indexedBuffer[i]; - callback({ - buffer: this.buffer, - frameLength: currentIndexing.frameLength, - frameBufferIndex: j, - currentIndexing: currentIndexing, - currentShapeIndex: i, - totalShapes: len, - }); - j += currentIndexing.frameLength; - } - } - } + EBoundingType[EBoundingType["Relative"] = 1] = "Relative"; /** - * Return empty propArguments - * - * @static - * @param {ShapeBase} shape - * @return {*} {PropArguments} + * Fixed to te width and height of the shape + * @order 3 */ - static getEmptyPropArguments(shape, parentPropArguments) { - const repetition = { - type: types_1.ERepetitionType.Ring, - angle: 0, - index: 1, - offset: 1, - count: 1, - row: { index: 1, offset: 1, count: 1 }, - col: { index: 1, offset: 1, count: 1 }, - }; - return { - repetition, - shape, - parent: parentPropArguments, - }; - } -} -exports.ShapeBase = ShapeBase; -/** - * Empty buffer - * - * @internal - * @ignore - */ -ShapeBase.EMPTY_BUFFER = new Float32Array(0); -/** - * Empty BaseRepetition - * - * @internal - * @ignore - */ -ShapeBase.getEmptySimpleRepetition = () => ({ - index: 1, - offset: 1, - count: 1, -}); -/** - * Empty Repetition - * - * @internal - * @ignore - */ -ShapeBase.getEmptyRepetition = () => ({ - type: types_1.ERepetitionType.Ring, - angle: 0, - ...ShapeBase.getEmptySimpleRepetition(), - row: ShapeBase.getEmptySimpleRepetition(), - col: ShapeBase.getEmptySimpleRepetition(), -}); -//# sourceMappingURL=ShapeBase.js.map + EBoundingType[EBoundingType["Fixed"] = 2] = "Fixed"; +})(EBoundingType = exports.EBoundingType || (exports.EBoundingType = {})); +//# sourceMappingURL=shape-base.js.map + +/***/ }), +/* 25 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +////// +//# sourceMappingURL=shape-primitives.js.map + +/***/ }), +/* 26 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +// Shape +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=shapes.js.map /***/ }), /* 27 */ @@ -9227,7 +9290,7 @@ ShapeBase.getEmptyRepetition = () => ({ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.toVec3 = exports.toVec2 = exports.fromSkew = exports.VEC2_ONE = exports.VEC2_ZERO = exports.VEC3_ONE = exports.VEC3_ZERO = void 0; -const gl_matrix_1 = __webpack_require__(12); +const gl_matrix_1 = __webpack_require__(7); exports.VEC3_ZERO = [0, 0, 0]; exports.VEC3_ONE = [1, 1, 1]; exports.VEC2_ZERO = [0, 0]; @@ -9740,7 +9803,7 @@ exports.Modifier = Modifier; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.distributePointsInBuffer = exports.interpolate = exports.prepareBufferForInterpolation = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.relativeClamp = exports.clamp = exports.lerp = exports.toRadians = exports.toDegrees = exports.now = void 0; const SimplexNoise = __webpack_require__(33); -const repetitions_1 = __webpack_require__(6); +const repetitions_1 = __webpack_require__(21); const Vec2_1 = __webpack_require__(28); // isDef: (object: any): boolean => typeof object !== 'undefined' && object !== null, const measurement = typeof performance !== 'undefined' ? performance : Date; @@ -10586,9 +10649,9 @@ Better rank ordering method by Stefan Gustavson in 2012. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Shape = void 0; -const Scene_1 = __webpack_require__(23); -const SceneChild_1 = __webpack_require__(24); -const ShapeBase_1 = __webpack_require__(26); +const Scene_1 = __webpack_require__(3); +const SceneChild_1 = __webpack_require__(4); +const ShapeBase_1 = __webpack_require__(6); /** * Container of ShapeBase or Group, it applies transformations on each repetition * @@ -10773,7 +10836,7 @@ exports.Shape = Shape; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ShapePrimitive = void 0; const glme = __webpack_require__(27); -const ShapeBase_1 = __webpack_require__(26); +const ShapeBase_1 = __webpack_require__(6); const Modifier_1 = __webpack_require__(31); const Adapt_1 = __webpack_require__(30); /** @@ -10927,7 +10990,7 @@ exports.ShapeLoop = void 0; const math_1 = __webpack_require__(29); const Adapt_1 = __webpack_require__(30); const ShapePrimitive_1 = __webpack_require__(35); -const ShapeBase_1 = __webpack_require__(26); +const ShapeBase_1 = __webpack_require__(6); /** * Shape Loop * @@ -15472,18 +15535,100 @@ var __webpack_exports__ = {}; "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "Urpflanze": () => (/* reexport module object */ _modules_light__WEBPACK_IMPORTED_MODULE_0__), -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ "Animation": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Animation), +/* harmony export */ "Circle": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Circle), +/* harmony export */ "DrawerCanvas": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.DrawerCanvas), +/* harmony export */ "Group": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Group), +/* harmony export */ "Line": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Line), +/* harmony export */ "Lissajous": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Lissajous), +/* harmony export */ "Modifier": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Modifier), +/* harmony export */ "Modifiers": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Modifiers), +/* harmony export */ "PHI": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.PHI), +/* harmony export */ "PI2": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.PI2), +/* harmony export */ "Polygon": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Polygon), +/* harmony export */ "Rect": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Rect), +/* harmony export */ "Rose": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Rose), +/* harmony export */ "Scene": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Scene), +/* harmony export */ "SceneChild": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.SceneChild), +/* harmony export */ "Shape": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Shape), +/* harmony export */ "ShapeBase": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.ShapeBase), +/* harmony export */ "ShapeBuffer": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.ShapeBuffer), +/* harmony export */ "ShapeFollow": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.ShapeFollow), +/* harmony export */ "ShapeLoop": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.ShapeLoop), +/* harmony export */ "ShapePrimitive": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.ShapePrimitive), +/* harmony export */ "ShapeRecursive": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.ShapeRecursive), +/* harmony export */ "Spiral": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Spiral), +/* harmony export */ "Star": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Star), +/* harmony export */ "SuperShape": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.SuperShape), +/* harmony export */ "Triangle": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Triangle), +/* harmony export */ "Vec2": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Vec2), +/* harmony export */ "__esModule": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.__esModule), +/* harmony export */ "angle2FromRepetition": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.angle2FromRepetition), +/* harmony export */ "angleFromRepetition": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.angleFromRepetition), +/* harmony export */ "clamp": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.clamp), +/* harmony export */ "distanceFromRepetition": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.distanceFromRepetition), +/* harmony export */ "distributePointsInBuffer": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.distributePointsInBuffer), +/* harmony export */ "interpolate": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.interpolate), +/* harmony export */ "lerp": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.lerp), +/* harmony export */ "log": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.log), +/* harmony export */ "mod": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.mod), +/* harmony export */ "noise": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.noise), +/* harmony export */ "now": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.now), +/* harmony export */ "prepareBufferForInterpolation": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.prepareBufferForInterpolation), +/* harmony export */ "random": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.random), +/* harmony export */ "relativeClamp": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.relativeClamp), +/* harmony export */ "toDegrees": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.toDegrees), +/* harmony export */ "toRadians": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.toRadians) /* harmony export */ }); /* harmony import */ var _modules_light__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_modules_light__WEBPACK_IMPORTED_MODULE_0__); //# sourceMappingURL=index-light.js.map })(); -var __webpack_exports__Urpflanze = __webpack_exports__.Urpflanze; -var __webpack_exports__default = __webpack_exports__.default; -export { __webpack_exports__Urpflanze as Urpflanze, __webpack_exports__default as default }; +var __webpack_exports__Animation = __webpack_exports__.Animation; +var __webpack_exports__Circle = __webpack_exports__.Circle; +var __webpack_exports__DrawerCanvas = __webpack_exports__.DrawerCanvas; +var __webpack_exports__Group = __webpack_exports__.Group; +var __webpack_exports__Line = __webpack_exports__.Line; +var __webpack_exports__Lissajous = __webpack_exports__.Lissajous; +var __webpack_exports__Modifier = __webpack_exports__.Modifier; +var __webpack_exports__Modifiers = __webpack_exports__.Modifiers; +var __webpack_exports__PHI = __webpack_exports__.PHI; +var __webpack_exports__PI2 = __webpack_exports__.PI2; +var __webpack_exports__Polygon = __webpack_exports__.Polygon; +var __webpack_exports__Rect = __webpack_exports__.Rect; +var __webpack_exports__Rose = __webpack_exports__.Rose; +var __webpack_exports__Scene = __webpack_exports__.Scene; +var __webpack_exports__SceneChild = __webpack_exports__.SceneChild; +var __webpack_exports__Shape = __webpack_exports__.Shape; +var __webpack_exports__ShapeBase = __webpack_exports__.ShapeBase; +var __webpack_exports__ShapeBuffer = __webpack_exports__.ShapeBuffer; +var __webpack_exports__ShapeFollow = __webpack_exports__.ShapeFollow; +var __webpack_exports__ShapeLoop = __webpack_exports__.ShapeLoop; +var __webpack_exports__ShapePrimitive = __webpack_exports__.ShapePrimitive; +var __webpack_exports__ShapeRecursive = __webpack_exports__.ShapeRecursive; +var __webpack_exports__Spiral = __webpack_exports__.Spiral; +var __webpack_exports__Star = __webpack_exports__.Star; +var __webpack_exports__SuperShape = __webpack_exports__.SuperShape; +var __webpack_exports__Triangle = __webpack_exports__.Triangle; +var __webpack_exports__Vec2 = __webpack_exports__.Vec2; +var __webpack_exports___esModule = __webpack_exports__.__esModule; +var __webpack_exports__angle2FromRepetition = __webpack_exports__.angle2FromRepetition; +var __webpack_exports__angleFromRepetition = __webpack_exports__.angleFromRepetition; +var __webpack_exports__clamp = __webpack_exports__.clamp; +var __webpack_exports__distanceFromRepetition = __webpack_exports__.distanceFromRepetition; +var __webpack_exports__distributePointsInBuffer = __webpack_exports__.distributePointsInBuffer; +var __webpack_exports__interpolate = __webpack_exports__.interpolate; +var __webpack_exports__lerp = __webpack_exports__.lerp; +var __webpack_exports__log = __webpack_exports__.log; +var __webpack_exports__mod = __webpack_exports__.mod; +var __webpack_exports__noise = __webpack_exports__.noise; +var __webpack_exports__now = __webpack_exports__.now; +var __webpack_exports__prepareBufferForInterpolation = __webpack_exports__.prepareBufferForInterpolation; +var __webpack_exports__random = __webpack_exports__.random; +var __webpack_exports__relativeClamp = __webpack_exports__.relativeClamp; +var __webpack_exports__toDegrees = __webpack_exports__.toDegrees; +var __webpack_exports__toRadians = __webpack_exports__.toRadians; +export { __webpack_exports__Animation as Animation, __webpack_exports__Circle as Circle, __webpack_exports__DrawerCanvas as DrawerCanvas, __webpack_exports__Group as Group, __webpack_exports__Line as Line, __webpack_exports__Lissajous as Lissajous, __webpack_exports__Modifier as Modifier, __webpack_exports__Modifiers as Modifiers, __webpack_exports__PHI as PHI, __webpack_exports__PI2 as PI2, __webpack_exports__Polygon as Polygon, __webpack_exports__Rect as Rect, __webpack_exports__Rose as Rose, __webpack_exports__Scene as Scene, __webpack_exports__SceneChild as SceneChild, __webpack_exports__Shape as Shape, __webpack_exports__ShapeBase as ShapeBase, __webpack_exports__ShapeBuffer as ShapeBuffer, __webpack_exports__ShapeFollow as ShapeFollow, __webpack_exports__ShapeLoop as ShapeLoop, __webpack_exports__ShapePrimitive as ShapePrimitive, __webpack_exports__ShapeRecursive as ShapeRecursive, __webpack_exports__Spiral as Spiral, __webpack_exports__Star as Star, __webpack_exports__SuperShape as SuperShape, __webpack_exports__Triangle as Triangle, __webpack_exports__Vec2 as Vec2, __webpack_exports___esModule as __esModule, __webpack_exports__angle2FromRepetition as angle2FromRepetition, __webpack_exports__angleFromRepetition as angleFromRepetition, __webpack_exports__clamp as clamp, __webpack_exports__distanceFromRepetition as distanceFromRepetition, __webpack_exports__distributePointsInBuffer as distributePointsInBuffer, __webpack_exports__interpolate as interpolate, __webpack_exports__lerp as lerp, __webpack_exports__log as log, __webpack_exports__mod as mod, __webpack_exports__noise as noise, __webpack_exports__now as now, __webpack_exports__prepareBufferForInterpolation as prepareBufferForInterpolation, __webpack_exports__random as random, __webpack_exports__relativeClamp as relativeClamp, __webpack_exports__toDegrees as toDegrees, __webpack_exports__toRadians as toRadians }; //# sourceMappingURL=urpflanze-light.js.map \ No newline at end of file diff --git a/build/esm/urpflanze-light.js.map b/build/esm/urpflanze-light.js.map index 97a12ad..0d91af4 100644 --- a/build/esm/urpflanze-light.js.map +++ b/build/esm/urpflanze-light.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@urpflanze/js/./dist/esm/modules-light.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/indexedBuffer.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/propArguments.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/repetitions.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/scene-child.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/scene.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/shape-base.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/shape-primitives.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/shapes.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/index.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/common.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/mat2.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/mat2d.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/mat3.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/mat4.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/quat.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/vec4.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/vec3.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/quat2.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/vec2.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/Scene.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/SceneChild.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/Group.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeBase.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/math/gl-matrix-extensions.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/math/Vec2.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/math/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Adapt.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Modifier.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/Utilities.js","webpack://@urpflanze/js/./node_modules/simplex-noise/simplex-noise.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/Shape.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapePrimitive.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeLoop.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeBuffer.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeRecursive.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeFollow.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Line.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Triangle.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Rect.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Polygon.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Circle.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Star.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Rose.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Spiral.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Lissajous.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/SuperShape.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Mirror.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Smooth.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Close.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Solidify.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Subdivide.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Offset.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/types.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/utilities.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/createAnimation.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/createInterpolator.js","webpack://@urpflanze/js/./node_modules/@urpflanze/color/dist/cjs/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/color/dist/cjs/types.js","webpack://@urpflanze/js/./node_modules/@urpflanze/color/dist/cjs/conversions.js","webpack://@urpflanze/js/./node_modules/@urpflanze/color/dist/cjs/parsing.js","webpack://@urpflanze/js/./node_modules/@urpflanze/color/dist/cjs/htmlcolors.js","webpack://@urpflanze/js/./node_modules/bezier-easing/src/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/Easings.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/Animation.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/composeAnimations.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/browser/BrowserDrawerCanvas.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/DrawerCanvas.js","webpack://@urpflanze/js/./node_modules/canvas/browser.js","webpack://@urpflanze/js/./node_modules/canvas/lib/parse-font.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/Emitter.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/Timeline.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/utils.js","webpack://@urpflanze/js/webpack/bootstrap","webpack://@urpflanze/js/webpack/runtime/compat get default export","webpack://@urpflanze/js/webpack/runtime/define property getters","webpack://@urpflanze/js/webpack/runtime/hasOwnProperty shorthand","webpack://@urpflanze/js/webpack/runtime/make namespace object","webpack://@urpflanze/js/./dist/esm/index-light.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAyC;AACkB;AACyD;AACpH,yC;;;;;;;ACHa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,YAAY,GAAG,gCAAgC,GAAG,qCAAqC,GAAG,mBAAmB,GAAG,8BAA8B,GAAG,4BAA4B,GAAG,2BAA2B,GAAG,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,qBAAqB,GAAG,aAAa,GAAG,YAAY;AACjZ;AACA;AACA;AACA,aAAa,mBAAO,CAAC,CAAS;AAC9B;AACA,oBAAoB,mBAAO,CAAC,EAAW;AACvC;AACA;AACA;AACA;AACA,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAc;AACnC,aAAa,mBAAO,CAAC,EAAS;AAC9B;AACA,aAAa,mBAAO,CAAC,EAAoB;AACzC,aAAa,mBAAO,CAAC,EAAyB;AAC9C,aAAa,mBAAO,CAAC,EAAoB;AACzC,aAAa,mBAAO,CAAC,EAAsB;AAC3C,aAAa,mBAAO,CAAC,EAAgB;AACrC,aAAa,mBAAO,CAAC,EAAyB;AAC9C,aAAa,mBAAO,CAAC,EAAsB;AAC3C,aAAa,mBAAO,CAAC,EAA0B;AAC/C,aAAa,mBAAO,CAAC,EAA8B;AACnD,aAAa,mBAAO,CAAC,EAA0B;AAC/C,aAAa,mBAAO,CAAC,EAA6B;AAClD,aAAa,mBAAO,CAAC,EAA4B;AACjD,aAAa,mBAAO,CAAC,EAA0B;AAC/C,aAAa,mBAAO,CAAC,EAA0B;AAC/C,aAAa,mBAAO,CAAC,EAA4B;AACjD,aAAa,mBAAO,CAAC,EAA+B;AACpD,aAAa,mBAAO,CAAC,EAAgC;AACrD;AACA,aAAa,mBAAO,CAAC,EAAsB;AAC3C,aAAa,mBAAO,CAAC,EAAa;AAClC;AACA,kBAAkB,mBAAO,CAAC,EAAa;AACvC,wCAAuC,CAAC,qCAAqC,yBAAyB,EAAE,EAAE,EAAC;AAC3G,yCAAwC,CAAC,qCAAqC,0BAA0B,EAAE,EAAE,EAAC;AAC7G,iDAAgD,CAAC,qCAAqC,kCAAkC,EAAE,EAAE,EAAC;AAC7H,6CAA4C,CAAC,qCAAqC,8BAA8B,EAAE,EAAE,EAAC;AACrH,6CAA4C,CAAC,qCAAqC,8BAA8B,EAAE,EAAE,EAAC;AACrH,uCAAsC,CAAC,qCAAqC,wBAAwB,EAAE,EAAE,EAAC;AACzG,yCAAwC,CAAC,qCAAqC,0BAA0B,EAAE,EAAE,EAAC;AAC7G,0CAAyC,CAAC,qCAAqC,2BAA2B,EAAE,EAAE,EAAC;AAC/G,uDAAsD,CAAC,qCAAqC,wCAAwC,EAAE,EAAE,EAAC;AACzI,wDAAuD,CAAC,qCAAqC,yCAAyC,EAAE,EAAE,EAAC;AAC3I,0DAAyD,CAAC,qCAAqC,2CAA2C,EAAE,EAAE,EAAC;AAC/I,+CAA8C,CAAC,qCAAqC,gCAAgC,EAAE,EAAE,EAAC;AACzH,iEAAgE,CAAC,qCAAqC,kDAAkD,EAAE,EAAE,EAAC;AAC7J,4DAA2D,CAAC,qCAAqC,6CAA6C,EAAE,EAAE,EAAC;AACnJ,aAAa,mBAAO,CAAC,EAAa;AAClC,wCAAuC,CAAC,qCAAqC,uBAAuB,EAAE,EAAE,EAAC;AACzG,aAAa,mBAAO,CAAC,EAAQ;AAC7B,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,iC;;;;;;;ACtEa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,CAAiB;AACtC,aAAa,mBAAO,CAAC,CAAiB;AACtC,aAAa,mBAAO,CAAC,CAAe;AACpC,aAAa,mBAAO,CAAC,CAAe;AACpC,aAAa,mBAAO,CAAC,CAAS;AAC9B,aAAa,mBAAO,CAAC,CAAc;AACnC,aAAa,mBAAO,CAAC,EAAoB;AACzC,aAAa,mBAAO,CAAC,EAAU;AAC/B,iC;;;;;;;ACpBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD,uBAAuB,KAAK;AAC7E,uC;;;;;;;ACxBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C,qBAAqB,KAAK;AACvE,sC;;;;;;;AChBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA,4C;;;;;;;ACHa;AACb;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACHwC;AACN;AACE;AACF;AACA;AACA;AACE;AACF;AACA;AACA;;;;;;;;;;;;;;;;;ACTlC;AACA;AACA;AACA;AACA;AACO;AACA;AACA;AACP;AACA;AACA;AACA,WAAW,2CAA2C;AACtD;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjDwC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA,gBAAgB;;AAEhB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AAC7S;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC/aiC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACvd;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACreiC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACttB;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzwBiC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY,+CAAgB;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA,YAAY,+CAAgB;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP,wBAAwB,kDAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;;AAExD;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,YAAY,KAAK;AACjB;;AAEO;AACP,oBAAoB,kDAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,+CAAgB,+BAA+B,+CAAgB,+BAA+B,+CAAgB;AAC/I;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,uEAAuE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB;AAC/zC;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrxDiC;AACN;AACA;AACA;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,OAAO;AACnB;;AAEO;AACP;AACA;;AAEA,UAAU,+CAAgB;AAC1B;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,aAAa;AACzB,YAAY,aAAa;AACzB,YAAY,OAAO;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;;AAE1C,gDAAgD;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH,oBAAoB,+CAAgB;AACpC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA,WAAW,8CAAe;AAC1B,WAAW,8CAAe;AAC1B,WAAW,8CAAe;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,mCAAmC;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAoC;;AAEpC;AACA,wBAAwB;;AAExB;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,EAAE;AACb,WAAW,EAAE;AACb,WAAW,EAAE;AACb,aAAa,KAAK;AAClB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,YAAY,2CAAU;AAC7B;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,iBAAiB,gDAAe;AACvC;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,WAAW,0CAAS;AAC3B;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,YAAY,2CAAU;AAC7B;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,WAAW,0CAAS;AAC3B;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO,aAAa,4CAAW;AAC/B;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;AACA;;AAEO,oBAAoB,mDAAkB;AAC7C;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,gBAAgB,+CAAc;AACrC;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO,kBAAkB,iDAAgB;AACzC;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO,aAAa,4CAAW;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,4CAAW;AAC3B,kBAAkB,gDAAe;AACjC,kBAAkB,gDAAe;AACjC;AACA,cAAc,yCAAQ;;AAEtB;AACA,MAAM,2CAAU;AAChB,UAAU,yCAAQ,sBAAsB,2CAAU;AAClD,MAAM,+CAAc;AACpB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,MAAM,2CAAU;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,aAAa,4CAAW;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrsBuC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,uBAAuB;AACvB;AACA;;AAEA;AACA;;AAEA;AACA,SAAS,8CAAe;AACxB,SAAS,8CAAe;AACxB;AACA,GAAG;;AAEH;AACA,SAAS,8CAAe;AACxB,SAAS,8CAAe;AACxB;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;;AAEhB;AACA;AACA;AACA,qCAAqC;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AAC7S;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtpBuC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,UAAU,8CAAe;AACzB,UAAU,8CAAe;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;;AAEA;AACA;AACA,4BAA4B;;AAE5B;AACA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA,YAAY;;AAEZ;AACA;AACA,YAAY;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACxN;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClxBuC;AACN;AACA;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;;AAEO;AACP,eAAe,kDAAmB;;AAElC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA,cAAc,4CAAW;AACzB,EAAE,iDAAgB;AAClB,cAAc,kDAAmB;AACjC,EAAE,oDAAmB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO,cAAc,0CAAS;AAC9B;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO,cAAc,0CAAS;AAC9B;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA,sBAAsB,+CAAgB;AACtC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,aAAa,4CAAW;AAC/B;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,oBAAoB,mDAAkB;AAC7C;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACjoB,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACl0BwC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,UAAU,8CAAe;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA,2BAA2B;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;;AAE5C;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB;AACnI;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;AC/mBY;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,qBAAqB,mBAAO,CAAC,EAAc;AAC3C,gBAAgB,mBAAO,CAAC,EAAS;AACjC,gBAAgB,mBAAO,CAAC,EAAgB;AACxC,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB;AACpC,eAAe,WAAW;AAC1B,eAAe,4BAA4B;AAC3C,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,qBAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACxVa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,eAAe,cAAc;AAC7B,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0EAA0E;AACzF,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sC;;;;;;;AClGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,gBAAgB,mBAAO,CAAC,EAAS;AACjC,qBAAqB,mBAAO,CAAC,EAAc;AAC3C,oBAAoB,mBAAO,CAAC,EAAoB;AAChD,gBAAgB,mBAAO,CAAC,EAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,SAAS;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACxTa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,oBAAoB,mBAAO,CAAC,EAAW;AACvC,gBAAgB,mBAAO,CAAC,CAAU;AAClC,aAAa,mBAAO,CAAC,EAA8B;AACnD,eAAe,mBAAO,CAAC,EAAc;AACrC,eAAe,mBAAO,CAAC,EAAS;AAChC,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,oBAAoB,mBAAO,CAAC,EAAc;AAC1C,qBAAqB,mBAAO,CAAC,EAAe;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,cAAc;AAC7B,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0EAA0E;AACzF,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,2CAA2C;AACrF,8CAA8C,2CAA2C;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,4BAA4B;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,SAAS;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;AACA,mEAAmE,SAAS;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,gCAAgC;AAClD,kBAAkB,gCAAgC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qC;;;;;;;ACzgBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc,GAAG,cAAc,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,iBAAiB;AAChI,oBAAoB,mBAAO,CAAC,EAAW;AACvC,iBAAiB;AACjB,gBAAgB;AAChB,iBAAiB;AACjB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,gD;;;;;;;AC5Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,gBAAgB;AAChB;AACA,6BAA6B,OAAO,OAAO,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,gC;;;;;;;ACpNa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,iC;;;;;;;AClCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,GAAG,gBAAgB,GAAG,kBAAkB;AACrD,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC,kBAAkB,KAAK;AAC9D;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6BAA6B;AAC5C,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,iC;;;;;;;ACrKa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB;AACA;AACA,gBAAgB;AAChB,oC;;;;;;;ACNa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gCAAgC,GAAG,mBAAmB,GAAG,qCAAqC,GAAG,8BAA8B,GAAG,4BAA4B,GAAG,2BAA2B,GAAG,cAAc,GAAG,aAAa,GAAG,qBAAqB,GAAG,aAAa,GAAG,YAAY,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,WAAW;AAC1U,qBAAqB,mBAAO,CAAC,EAAe;AAC5C,sBAAsB,mBAAO,CAAC,CAAqB;AACnD,eAAe,mBAAO,CAAC,EAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,mBAAmB,iBAAiB;AACpC,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,gBAAgB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA,4BAA4B,qBAAqB;AACjD;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,eAAe;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yBAAyB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC,qC;;;;;;ACxWA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA,qBAAqB;AACrB;AACA,wBAAwB;AACxB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,4BAA4B;AAC5B;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,kCAAkC;AAClC;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA,6BAA6B;AAC7B;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA,mCAAmC;AACnC,qBAAqB;AACrB;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,yBAAyB;AACzB,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,iBAAiB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,gDAAgD;AAChD;AACA;;AAEA;AACA,MAAM,IAA2C,EAAE,mCAAO,YAAY,qBAAqB;AAAA,kGAAC;AAC5F;AACA,MAAM,IAA8B,EAAE,oBAAoB;AAC1D;AACA,OAAO,EAAsE;AAC7E;AACA,MAAM,IAA6B;AACnC;AACA;;AAEA,CAAC;;;;;;;;ACxdY;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,gBAAgB,mBAAO,CAAC,EAAU;AAClC,qBAAqB,mBAAO,CAAC,EAAe;AAC5C,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc,aAAa;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA,4DAA4D,SAAS;AACrE,wCAAwC;AACxC;AACA;AACA;AACA,yCAAyC,4BAA4B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,aAAa;AAC5B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACnLa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,sBAAsB;AACtB,aAAa,mBAAO,CAAC,EAA8B;AACnD,oBAAoB,mBAAO,CAAC,EAAa;AACzC,mBAAmB,mBAAO,CAAC,EAAuB;AAClD,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB,aAAa;AACpD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,0C;;;;;;;ACjJa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,eAAe,mBAAO,CAAC,EAAS;AAChC,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,yBAAyB,mBAAO,CAAC,EAA0B;AAC3D,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB,aAAa;AAC/C,eAAe,QAAQ;AACvB;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB;AACA;AACA;AACA,iDAAiD,eAAe;AAChE,sDAAsD,QAAQ;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA,eAAe,6BAA6B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,kBAAkB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,eAAe,sBAAsB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,8CAA8C;AAC9E;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,qC;;;;;;;AChOa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB;AACnB,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,yBAAyB,mBAAO,CAAC,EAA0B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB,aAAa;AACjD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,gCAAgC,8CAA8C;AAC9E;AACA;AACA;AACA;AACA,mBAAmB;AACnB,uC;;;;;;;ACnIa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,sBAAsB;AACtB,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB,aAAa;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,qDAAqD;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,6BAA6B;AACpD;AACA;AACA;AACA;AACA,sCAAsC,+BAA+B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iIAAiI,6DAA6D;AAC9L;AACA;AACA;AACA;AACA,4BAA4B,uEAAuE;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,SAAS;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,4BAA4B,8DAA8D;AAC1F,iBAAiB;AACjB;AACA;AACA,mFAAmF,gCAAgC;AACnH,wCAAwC;AACxC;AACA;AACA;AACA;AACA,4BAA4B,8DAA8D;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,oEAAoE,4BAA4B,iBAAiB,EAAE;AACnH;AACA;AACA;AACA,+BAA+B,gBAAgB;AAC/C;AACA,2DAA2D,SAAS;AACpE;AACA,+FAA+F,gCAAgC;AAC/H,oDAAoD;AACpD;AACA;AACA;AACA;AACA,wCAAwC,wDAAwD;AAChG;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;AACA,qDAAqD,4BAA4B;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA,sBAAsB;AACtB,0C;;;;;;;AChUa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB;AACnB,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB,aAAa;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,uDAAuD;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,SAAS;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,mFAAmF,gCAAgC;AACnH,uEAAuE,iCAAiC,4BAA4B,iBAAiB,EAAE;AACvJ,kDAAkD,SAAS;AAC3D;AACA,2FAA2F,gCAAgC;AAC3H,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA,iDAAiD,4BAA4B;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA,mBAAmB;AACnB,uC;;;;;;;AC3Na;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,YAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,SAAS;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,gC;;;;;;;AC5Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA,oC;;;;;;;AC1Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,gC;;;;;;;AC3Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,mC;;;;;;;ACxCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACpCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ,gC;;;;;;;AClDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc,aAAa;AAC1C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ,gC;;;;;;;ACtEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe,aAAa;AAC3C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kC;;;;;;;AC5Fa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB,aAAa;AAC/C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,qC;;;;;;;ACtDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB;AAClB,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sC;;;;;;;AC9Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,gBAAgB,mBAAO,CAAC,EAAS;AACjC,iBAAiB,mBAAO,CAAC,EAAU;AACnC,iBAAiB,mBAAO,CAAC,EAAU;AACnC,mBAAmB,mBAAO,CAAC,EAAY;AACvC,oBAAoB,mBAAO,CAAC,EAAa;AACzC,gBAAgB,mBAAO,CAAC,EAAS;AACjC,iBAAiB,mBAAO,CAAC,EAAU;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,iC;;;;;;;ACpBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACtDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,oBAAoB,mBAAO,CAAC,EAAc;AAC1C,gBAAgB,mBAAO,CAAC,EAAS;AACjC,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,SAAS;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACvEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;AC3Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,oC;;;;;;;ACvHa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,WAAW;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,qC;;;;;;;ACxDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,wBAAwB,yBAAyB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACfa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAa;AAClC,aAAa,mBAAO,CAAC,EAAmB;AACxC,aAAa,mBAAO,CAAC,EAAsB;AAC3C,aAAa,mBAAO,CAAC,EAAW;AAChC,aAAa,mBAAO,CAAC,EAAa;AAClC,iC;;;;;;;AClBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,2BAA2B,GAAG,2BAA2B,GAAG,YAAY,GAAG,YAAY,GAAG,mBAAmB,GAAG,aAAa;AAC7H;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,mBAAmB;AAC9B,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,EAAE,GAAG,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,mBAAmB;AAC9B,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,mBAAmB,cAAc,GAAG,cAAc,GAAG,cAAc,GAAG,MAAM;AAC5E;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA,mBAAmB,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,MAAM;AAC1C;AACA,2BAA2B;AAC3B,qC;;;;;;;AC9Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uBAAuB;AACvB,6BAA6B,mBAAO,CAAC,EAAsB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8DAA8D;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2C;;;;;;;ACpGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,0BAA0B,GAAG,mCAAmC;AAChE,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,wBAAwB,mBAAO,CAAC,EAAe;AAC/C,kBAAkB,mBAAO,CAAC,EAAW;AACrC,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,8C;;;;;;;ACxGa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAe;AACpC,aAAa,mBAAO,CAAC,EAAW;AAChC,iC;;;;;;;ACfa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6DAA6D;AAC5E;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,uC;;;;;;;ACzFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB,GAAG,4BAA4B;AACjD,qBAAqB,mBAAO,CAAC,EAAc;AAC3C,sBAAsB,mBAAO,CAAC,EAAe;AAC7C;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,6BAA6B,IAAI;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,mC;;;;;;;AC1Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,sC;;;;;;AClJA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,uBAAuB,oCAAoC;AAC3D,uBAAuB,8BAA8B;AACrD,uBAAuB,kBAAkB;;AAEzC;AACA,oCAAoC,8DAA8D;;AAElG;AACA,kCAAkC,sEAAsE;;AAExG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;;AAEA;AACA;AACA;AACA;;AAEA,UAAU,mEAAmE;AAC7E;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe;AACf,mC;;;;;;;AChca;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,wBAAwB,GAAG,cAAc,GAAG,YAAY,GAAG,eAAe,GAAG,cAAc,GAAG,8BAA8B;AAC5H,4BAA4B,mBAAO,CAAC,EAAqB;AACzD,0BAA0B,mBAAO,CAAC,EAAmB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB,qC;;;;;;;ACpEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yBAAyB;AACzB,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,0BAA0B,mBAAO,CAAC,EAAmB;AACrD,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA,WAAW,wBAAwB;AACnC,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6C;;;;;;;ACxDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,2BAA2B;AAC3B,uBAAuB,mBAAO,CAAC,EAAiB;AAChD,gBAAgB,mBAAO,CAAC,EAAU;AAClC;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,+C;;;;;;;AChGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,oBAAoB;AACpB,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,oBAAoB,mBAAO,CAAC,EAAoC;AAChE,eAAe,mBAAO,CAAC,EAA+B;AACtD,eAAe,mBAAO,CAAC,EAAoC;AAC3D,iBAAiB,mBAAO,CAAC,EAAQ;AACjC,kBAAkB,mBAAO,CAAC,EAAW;AACrC,mBAAmB,mBAAO,CAAC,EAAY;AACvC,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6BAA6B;AAC5C,eAAe,wBAAwB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,2BAA2B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,0BAA0B;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qGAAqG,uCAAuC;AAC5I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,KAAK;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oGAAoG,OAAO;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,eAAe,QAAQ;AACvB,eAAe,qBAAqB;AACpC,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB,eAAe,OAAO;AACtB,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW;AAC7E,8BAA8B,SAAS,GAAG,SAAS,IAAI,SAAS,IAAI,WAAW;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,wC;;;;;;ACvXA;;AAEA,kBAAkB,mBAAO,CAAC,EAAkB;;AAE5C,iBAAiB;;AAEjB,oBAAoB;AACpB,0DAA0D,+BAA+B;AACzF;;AAEA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA;AACA;;AAEA,gCAAgC,WAAW;AAC3C,iCAAiC,WAAW;;AAE5C;AACA,GAAG;AACH;;;;;;;;AClCY;;AAEZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACrGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,6CAA6C;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,8CAA8C;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,6BAA6B;AAC5C;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,mC;;;;;;;AC3Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,oBAAoB,mBAAO,CAAC,EAAoC;AAChE,eAAe,mBAAO,CAAC,EAA+B;AACtD,kBAAkB,mBAAO,CAAC,EAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,2BAA2B,aAAa;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oC;;;;;;;ACxRa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,eAAe,GAAG,gBAAgB,GAAG,aAAa;AAChE,aAAa;AACb;AACA;AACA,gBAAgB;AAChB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,+BAA+B;AAC1C,YAAY,EAAE,IAAI,WAAW,WAAW,eAAe,gBAAgB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,iC;;;;;SClDA;SACA;;SAEA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;;SAEA;SACA;;SAEA;SACA;SACA;;;;;UCtBA;UACA;UACA;UACA;UACA;UACA,gCAAgC,YAAY;UAC5C;UACA,E;;;;;UCPA;UACA;UACA;UACA;UACA,wCAAwC,yCAAyC;UACjF;UACA;UACA,E;;;;;UCPA,wF;;;;;UCAA;UACA;UACA;UACA,sDAAsD,kBAAkB;UACxE;UACA,+CAA+C,cAAc;UAC7D,E;;;;;;;;;;;;;;ACN6C;AACxB;AACrB,iEAAe,2CAAS,EAAC;AACzB,uC","file":"urpflanze-light.js","sourcesContent":["export * from '@urpflanze/core/dist/cjs';\nexport * as Animation from '@urpflanze/animation/dist/cjs';\nexport { BrowserDrawerCanvas as DrawerCanvas } from '@urpflanze/drawer-canvas/dist/cjs/browser/BrowserDrawerCanvas';\n//# sourceMappingURL=modules-light.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mod = exports.log = exports.PI2 = exports.PHI = exports.Vec2 = exports.distributePointsInBuffer = exports.prepareBufferForInterpolation = exports.interpolate = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.now = exports.toRadians = exports.toDegrees = exports.relativeClamp = exports.clamp = exports.lerp = void 0;\n/**\n * Types & Interface\n */\n__exportStar(require(\"./types\"), exports);\n// Set glMatrixArrayType\nconst gl_matrix_1 = require(\"gl-matrix\");\ngl_matrix_1.glMatrix.setMatrixArrayType(Array);\n/**\n * Core\n */\n__exportStar(require(\"./Scene\"), exports);\n__exportStar(require(\"./SceneChild\"), exports);\n__exportStar(require(\"./Group\"), exports);\n// Shapes\n__exportStar(require(\"./shapes/ShapeBase\"), exports);\n__exportStar(require(\"./shapes/ShapePrimitive\"), exports);\n__exportStar(require(\"./shapes/ShapeLoop\"), exports);\n__exportStar(require(\"./shapes/ShapeBuffer\"), exports);\n__exportStar(require(\"./shapes/Shape\"), exports);\n__exportStar(require(\"./shapes/ShapeRecursive\"), exports);\n__exportStar(require(\"./shapes/ShapeFollow\"), exports);\n__exportStar(require(\"./shapes/primitives/Line\"), exports);\n__exportStar(require(\"./shapes/primitives/Triangle\"), exports);\n__exportStar(require(\"./shapes/primitives/Rect\"), exports);\n__exportStar(require(\"./shapes/primitives/Polygon\"), exports);\n__exportStar(require(\"./shapes/primitives/Circle\"), exports);\n__exportStar(require(\"./shapes/primitives/Star\"), exports);\n__exportStar(require(\"./shapes/primitives/Rose\"), exports);\n__exportStar(require(\"./shapes/primitives/Spiral\"), exports);\n__exportStar(require(\"./shapes/primitives/Lissajous\"), exports);\n__exportStar(require(\"./shapes/primitives/SuperShape\"), exports);\n// Modifiers\n__exportStar(require(\"./modifiers/Modifier\"), exports);\n__exportStar(require(\"./modifiers\"), exports);\n// Utilities\nvar Utilities_1 = require(\"./Utilities\");\nObject.defineProperty(exports, \"lerp\", { enumerable: true, get: function () { return Utilities_1.lerp; } });\nObject.defineProperty(exports, \"clamp\", { enumerable: true, get: function () { return Utilities_1.clamp; } });\nObject.defineProperty(exports, \"relativeClamp\", { enumerable: true, get: function () { return Utilities_1.relativeClamp; } });\nObject.defineProperty(exports, \"toDegrees\", { enumerable: true, get: function () { return Utilities_1.toDegrees; } });\nObject.defineProperty(exports, \"toRadians\", { enumerable: true, get: function () { return Utilities_1.toRadians; } });\nObject.defineProperty(exports, \"now\", { enumerable: true, get: function () { return Utilities_1.now; } });\nObject.defineProperty(exports, \"noise\", { enumerable: true, get: function () { return Utilities_1.noise; } });\nObject.defineProperty(exports, \"random\", { enumerable: true, get: function () { return Utilities_1.random; } });\nObject.defineProperty(exports, \"angleFromRepetition\", { enumerable: true, get: function () { return Utilities_1.angleFromRepetition; } });\nObject.defineProperty(exports, \"angle2FromRepetition\", { enumerable: true, get: function () { return Utilities_1.angle2FromRepetition; } });\nObject.defineProperty(exports, \"distanceFromRepetition\", { enumerable: true, get: function () { return Utilities_1.distanceFromRepetition; } });\nObject.defineProperty(exports, \"interpolate\", { enumerable: true, get: function () { return Utilities_1.interpolate; } });\nObject.defineProperty(exports, \"prepareBufferForInterpolation\", { enumerable: true, get: function () { return Utilities_1.prepareBufferForInterpolation; } });\nObject.defineProperty(exports, \"distributePointsInBuffer\", { enumerable: true, get: function () { return Utilities_1.distributePointsInBuffer; } });\nvar Vec2_1 = require(\"./math/Vec2\");\nObject.defineProperty(exports, \"Vec2\", { enumerable: true, get: function () { return Vec2_1.default; } });\nvar math_1 = require(\"./math\");\nObject.defineProperty(exports, \"PHI\", { enumerable: true, get: function () { return math_1.PHI; } });\nObject.defineProperty(exports, \"PI2\", { enumerable: true, get: function () { return math_1.PI2; } });\nObject.defineProperty(exports, \"log\", { enumerable: true, get: function () { return math_1.log; } });\nObject.defineProperty(exports, \"mod\", { enumerable: true, get: function () { return math_1.mod; } });\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./indexedBuffer\"), exports);\n__exportStar(require(\"./propArguments\"), exports);\n__exportStar(require(\"./repetitions\"), exports);\n__exportStar(require(\"./scene-child\"), exports);\n__exportStar(require(\"./scene\"), exports);\n__exportStar(require(\"./shape-base\"), exports);\n__exportStar(require(\"./shape-primitives\"), exports);\n__exportStar(require(\"./shapes\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=indexedBuffer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=propArguments.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ERepetitionType = void 0;\n/**\n * Repetition type enumerator.\n *\n * @category Core.Repetition\n * @internal\n */\nvar ERepetitionType;\n(function (ERepetitionType) {\n /**\n * Defines the type of repetition of the shape,\n * in a circular way starting from the center of the scene\n * @order 1\n */\n ERepetitionType[ERepetitionType[\"Ring\"] = 1] = \"Ring\";\n /**\n * Defines the type of repetition of the shape,\n * on a nxm grid starting from the center of the scene\n * @order 2\n */\n ERepetitionType[ERepetitionType[\"Matrix\"] = 2] = \"Matrix\";\n})(ERepetitionType = exports.ERepetitionType || (exports.ERepetitionType = {}));\n//# sourceMappingURL=repetitions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=scene-child.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=scene.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EBoundingType = void 0;\nvar EBoundingType;\n(function (EBoundingType) {\n /**\n * Relative to the real bounding of the shape\n * @order 2\n */\n EBoundingType[EBoundingType[\"Relative\"] = 1] = \"Relative\";\n /**\n * Fixed to te width and height of the shape\n * @order 3\n */\n EBoundingType[EBoundingType[\"Fixed\"] = 2] = \"Fixed\";\n})(EBoundingType = exports.EBoundingType || (exports.EBoundingType = {}));\n//# sourceMappingURL=shape-base.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//////\n//# sourceMappingURL=shape-primitives.js.map","\"use strict\";\n// Shape\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=shapes.js.map","import * as glMatrix from \"./common.js\";\nimport * as mat2 from \"./mat2.js\";\nimport * as mat2d from \"./mat2d.js\";\nimport * as mat3 from \"./mat3.js\";\nimport * as mat4 from \"./mat4.js\";\nimport * as quat from \"./quat.js\";\nimport * as quat2 from \"./quat2.js\";\nimport * as vec2 from \"./vec2.js\";\nimport * as vec3 from \"./vec3.js\";\nimport * as vec4 from \"./vec4.js\";\nexport { glMatrix, mat2, mat2d, mat3, mat4, quat, quat2, vec2, vec3, vec4 };","/**\r\n * Common utilities\r\n * @module glMatrix\r\n */\n// Configuration Constants\nexport var EPSILON = 0.000001;\nexport var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexport var RANDOM = Math.random;\n/**\r\n * Sets the type of array used when creating new vectors and matrices\r\n *\r\n * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array\r\n */\n\nexport function setMatrixArrayType(type) {\n ARRAY_TYPE = type;\n}\nvar degree = Math.PI / 180;\n/**\r\n * Convert Degree To Radian\r\n *\r\n * @param {Number} a Angle in Degrees\r\n */\n\nexport function toRadian(a) {\n return a * degree;\n}\n/**\r\n * Tests whether or not the arguments have approximately the same value, within an absolute\r\n * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less\r\n * than or equal to 1.0, and a relative tolerance is used for larger values)\r\n *\r\n * @param {Number} a The first number to test.\r\n * @param {Number} b The second number to test.\r\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n}\nif (!Math.hypot) Math.hypot = function () {\n var y = 0,\n i = arguments.length;\n\n while (i--) {\n y += arguments[i] * arguments[i];\n }\n\n return Math.sqrt(y);\n};","import * as glMatrix from \"./common.js\";\n/**\r\n * 2x2 Matrix\r\n * @module mat2\r\n */\n\n/**\r\n * Creates a new identity mat2\r\n *\r\n * @returns {mat2} a new 2x2 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\r\n * Creates a new mat2 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat2} a matrix to clone\r\n * @returns {mat2} a new 2x2 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Copy the values from one mat2 to another\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set a mat2 to the identity matrix\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @returns {mat2} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\r\n * Create a new mat2 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\r\n * @returns {mat2} out A new 2x2 matrix\r\n */\n\nexport function fromValues(m00, m01, m10, m11) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\r\n * Set the components of a mat2 to the given values\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\r\n * @returns {mat2} out\r\n */\n\nexport function set(out, m00, m01, m10, m11) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\r\n * Transpose the values of a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache\n // some values\n if (out === a) {\n var a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3]; // Calculate the determinant\n\n var det = a0 * a3 - a2 * a1;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function adjoint(out, a) {\n // Caching this value is nessecary if out == a\n var a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat2\r\n *\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n}\n/**\r\n * Multiplies two mat2's\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n}\n/**\r\n * Rotates a mat2 by the given angle\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n}\n/**\r\n * Scales the mat2 by the dimensions in the given vec2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to rotate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat2} out\r\n **/\n\nexport function scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n *\r\n * @param {mat2} out mat2 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n *\r\n * @param {mat2} out mat2 receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat2} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n}\n/**\r\n * Returns a string representation of a mat2\r\n *\r\n * @param {ReadonlyMat2} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat2\r\n *\r\n * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3]);\n}\n/**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @param {ReadonlyMat2} L the lower triangular matrix\r\n * @param {ReadonlyMat2} D the diagonal matrix\r\n * @param {ReadonlyMat2} U the upper triangular matrix\r\n * @param {ReadonlyMat2} a the input matrix to factorize\r\n */\n\nexport function LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n}\n/**\r\n * Adds two mat2's\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat2} a The first matrix.\r\n * @param {ReadonlyMat2} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat2} a The first matrix.\r\n * @param {ReadonlyMat2} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat2} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\r\n * Adds two mat2's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat2} out the receiving vector\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat2} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\r\n * Alias for {@link mat2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat2.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 2x3 Matrix\r\n * @module mat2d\r\n * @description\r\n * A mat2d contains six elements defined as:\r\n *
\r\n * [a, b,\r\n *  c, d,\r\n *  tx, ty]\r\n * 
\r\n * This is a short form for the 3x3 matrix:\r\n *
\r\n * [a, b, 0,\r\n *  c, d, 0,\r\n *  tx, ty, 1]\r\n * 
\r\n * The last column is ignored so the array is shorter and operations are faster.\r\n */\n\n/**\r\n * Creates a new identity mat2d\r\n *\r\n * @returns {mat2d} a new 2x3 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(6);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[4] = 0;\n out[5] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\r\n * Creates a new mat2d initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat2d} a matrix to clone\r\n * @returns {mat2d} a new 2x3 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\r\n * Copy the values from one mat2d to another\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\r\n * Set a mat2d to the identity matrix\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Create a new mat2d with the given values\r\n *\r\n * @param {Number} a Component A (index 0)\r\n * @param {Number} b Component B (index 1)\r\n * @param {Number} c Component C (index 2)\r\n * @param {Number} d Component D (index 3)\r\n * @param {Number} tx Component TX (index 4)\r\n * @param {Number} ty Component TY (index 5)\r\n * @returns {mat2d} A new mat2d\r\n */\n\nexport function fromValues(a, b, c, d, tx, ty) {\n var out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\r\n * Set the components of a mat2d to the given values\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {Number} a Component A (index 0)\r\n * @param {Number} b Component B (index 1)\r\n * @param {Number} c Component C (index 2)\r\n * @param {Number} d Component D (index 3)\r\n * @param {Number} tx Component TX (index 4)\r\n * @param {Number} ty Component TY (index 5)\r\n * @returns {mat2d} out\r\n */\n\nexport function set(out, a, b, c, d, tx, ty) {\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\r\n * Inverts a mat2d\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function invert(out, a) {\n var aa = a[0],\n ab = a[1],\n ac = a[2],\n ad = a[3];\n var atx = a[4],\n aty = a[5];\n var det = aa * ad - ab * ac;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n}\n/**\r\n * Multiplies two mat2d's\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n}\n/**\r\n * Rotates a mat2d by the given angle\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2d} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\r\n * Scales the mat2d by the dimensions in the given vec2\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to translate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat2d} out\r\n **/\n\nexport function scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\r\n * Translates the mat2d by the dimensions in the given vec2\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to translate\r\n * @param {ReadonlyVec2} v the vec2 to translate the matrix by\r\n * @returns {mat2d} out\r\n **/\n\nexport function translate(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.rotate(dest, dest, rad);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2d} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.scale(dest, dest, vec);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat2d} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.translate(dest, dest, vec);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {ReadonlyVec2} v Translation vector\r\n * @returns {mat2d} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n}\n/**\r\n * Returns a string representation of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat2d(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1);\n}\n/**\r\n * Adds two mat2d's\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat2d} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n}\n/**\r\n * Adds two mat2d's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat2d} out the receiving vector\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat2d} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat2d} a The first matrix.\r\n * @param {ReadonlyMat2d} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat2d} a The first matrix.\r\n * @param {ReadonlyMat2d} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5));\n}\n/**\r\n * Alias for {@link mat2d.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat2d.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 3x3 Matrix\r\n * @module mat3\r\n */\n\n/**\r\n * Creates a new identity mat3\r\n *\r\n * @returns {mat3} a new 3x3 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(9);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n }\n\n out[0] = 1;\n out[4] = 1;\n out[8] = 1;\n return out;\n}\n/**\r\n * Copies the upper-left 3x3 values into the given mat3.\r\n *\r\n * @param {mat3} out the receiving 3x3 matrix\r\n * @param {ReadonlyMat4} a the source 4x4 matrix\r\n * @returns {mat3} out\r\n */\n\nexport function fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n}\n/**\r\n * Creates a new mat3 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat3} a matrix to clone\r\n * @returns {mat3} a new 3x3 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Copy the values from one mat3 to another\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Create a new mat3 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\r\n * @returns {mat3} A new mat3\r\n */\n\nexport function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\r\n * Set the components of a mat3 to the given values\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\r\n * @returns {mat3} out\r\n */\n\nexport function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\r\n * Set a mat3 to the identity matrix\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @returns {mat3} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Transpose the values of a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b01 = a22 * a11 - a12 * a21;\n var b11 = -a22 * a10 + a12 * a20;\n var b21 = a21 * a10 - a11 * a20; // Calculate the determinant\n\n var det = a00 * b01 + a01 * b11 + a02 * b21;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat3\r\n *\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n}\n/**\r\n * Multiplies two mat3's\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b00 = b[0],\n b01 = b[1],\n b02 = b[2];\n var b10 = b[3],\n b11 = b[4],\n b12 = b[5];\n var b20 = b[6],\n b21 = b[7],\n b22 = b[8];\n out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n return out;\n}\n/**\r\n * Translate a mat3 by the given vector\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to translate\r\n * @param {ReadonlyVec2} v vector to translate by\r\n * @returns {mat3} out\r\n */\n\nexport function translate(out, a, v) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n x = v[0],\n y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n}\n/**\r\n * Rotates a mat3 by the given angle\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat3} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n}\n/**\r\n * Scales the mat3 by the dimensions in the given vec2\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to rotate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat3} out\r\n **/\n\nexport function scale(out, a, v) {\n var x = v[0],\n y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyVec2} v Translation vector\r\n * @returns {mat3} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat3} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat3} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Copies the values from a mat2d into a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to copy\r\n * @returns {mat3} out\r\n **/\n\nexport function fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n}\n/**\r\n * Calculates a 3x3 matrix from the given quaternion\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyQuat} q Quaternion to create matrix from\r\n *\r\n * @returns {mat3} out\r\n */\n\nexport function fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n}\n/**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n *\r\n * @returns {mat3} out\r\n */\n\nexport function normalFromMat4(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n}\n/**\r\n * Generates a 2D projection matrix with the given bounds\r\n *\r\n * @param {mat3} out mat3 frustum matrix will be written into\r\n * @param {number} width Width of your gl context\r\n * @param {number} height Height of gl context\r\n * @returns {mat3} out\r\n */\n\nexport function projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n}\n/**\r\n * Returns a string representation of a mat3\r\n *\r\n * @param {ReadonlyMat3} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat3\r\n *\r\n * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);\n}\n/**\r\n * Adds two mat3's\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat3} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n}\n/**\r\n * Adds two mat3's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat3} out the receiving vector\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat3} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat3} a The first matrix.\r\n * @param {ReadonlyMat3} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat3} a The first matrix.\r\n * @param {ReadonlyMat3} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7],\n a8 = a[8];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7],\n b8 = b[8];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8));\n}\n/**\r\n * Alias for {@link mat3.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat3.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied.\r\n * @module mat4\r\n */\n\n/**\r\n * Creates a new identity mat4\r\n *\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(16);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n }\n\n out[0] = 1;\n out[5] = 1;\n out[10] = 1;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a new mat4 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat4} a matrix to clone\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Copy the values from one mat4 to another\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Create a new mat4 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} A new mat4\r\n */\n\nexport function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\r\n * Set the components of a mat4 to the given values\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} out\r\n */\n\nexport function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\r\n * Set a mat4 to the identity matrix\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @returns {mat4} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Transpose the values of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a12 = a[6],\n a13 = a[7];\n var a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22);\n out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\n out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12);\n out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\n out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\n out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22);\n out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\n out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12);\n out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21);\n out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\n out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11);\n out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\n out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\n out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21);\n out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\n out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11);\n return out;\n}\n/**\r\n * Calculates the determinant of a mat4\r\n *\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n}\n/**\r\n * Multiplies two mat4s\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15]; // Cache only the current line of the second matrix\n\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n/**\r\n * Translate a mat4 by the given vector\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to translate\r\n * @param {ReadonlyVec3} v vector to translate by\r\n * @returns {mat4} out\r\n */\n\nexport function translate(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n\n return out;\n}\n/**\r\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to scale\r\n * @param {ReadonlyVec3} v the vec3 to scale the matrix by\r\n * @returns {mat4} out\r\n **/\n\nexport function scale(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Rotates a mat4 by the given angle around the given axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nexport function rotate(out, a, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n var b00, b01, b02;\n var b10, b11, b12;\n var b20, b21, b22;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11]; // Construct the elements of the rotation matrix\n\n b00 = x * x * t + c;\n b01 = y * x * t + z * s;\n b02 = z * x * t - y * s;\n b10 = x * y * t - z * s;\n b11 = y * y * t + c;\n b12 = z * y * t + x * s;\n b20 = x * z * t + y * s;\n b21 = y * z * t - x * s;\n b22 = z * z * t + c; // Perform rotation-specific matrix multiplication\n\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the X axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateX(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Y axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateY(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Z axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyVec3} v Scaling vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotation(out, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c; // Perform rotation-specific matrix multiplication\n\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromXRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromYRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromZRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslation(out, q, v) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a new mat4 from a dual quat.\r\n *\r\n * @param {mat4} out Matrix\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @returns {mat4} mat4 receiving operation result\r\n */\n\nexport function fromQuat2(out, a) {\n var translation = new glMatrix.ARRAY_TYPE(3);\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense\n\n if (magnitude > 0) {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n\n fromRotationTranslation(out, a, translation);\n return out;\n}\n/**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nexport function getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n}\n/**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion paramter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nexport function getScaling(out, mat) {\n var m11 = mat[0];\n var m12 = mat[1];\n var m13 = mat[2];\n var m21 = mat[4];\n var m22 = mat[5];\n var m23 = mat[6];\n var m31 = mat[8];\n var m32 = mat[9];\n var m33 = mat[10];\n out[0] = Math.hypot(m11, m12, m13);\n out[1] = Math.hypot(m21, m22, m23);\n out[2] = Math.hypot(m31, m32, m33);\n return out;\n}\n/**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @param {quat} out Quaternion to receive the rotation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {quat} out\r\n */\n\nexport function getRotation(out, mat) {\n var scaling = new glMatrix.ARRAY_TYPE(3);\n getScaling(scaling, mat);\n var is1 = 1 / scaling[0];\n var is2 = 1 / scaling[1];\n var is3 = 1 / scaling[2];\n var sm11 = mat[0] * is1;\n var sm12 = mat[1] * is2;\n var sm13 = mat[2] * is3;\n var sm21 = mat[4] * is1;\n var sm22 = mat[5] * is2;\n var sm23 = mat[6] * is3;\n var sm31 = mat[8] * is1;\n var sm32 = mat[9] * is2;\n var sm33 = mat[10] * is3;\n var trace = sm11 + sm22 + sm33;\n var S = 0;\n\n if (trace > 0) {\n S = Math.sqrt(trace + 1.0) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @param {ReadonlyVec3} s Scaling vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslationScale(out, q, v, s) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @param {ReadonlyVec3} s Scaling vector\r\n * @param {ReadonlyVec3} o The origin vector around which to scale and rotate\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n var ox = o[0];\n var oy = o[1];\n var oz = o[2];\n var out0 = (1 - (yy + zz)) * sx;\n var out1 = (xy + wz) * sx;\n var out2 = (xz - wy) * sx;\n var out4 = (xy - wz) * sy;\n var out5 = (1 - (xx + zz)) * sy;\n var out6 = (yz + wx) * sy;\n var out8 = (xz + wy) * sz;\n var out9 = (yz - wx) * sz;\n var out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n}\n/**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyQuat} q Quaternion to create matrix from\r\n *\r\n * @returns {mat4} out\r\n */\n\nexport function fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a frustum matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Number} left Left bound of the frustum\r\n * @param {Number} right Right bound of the frustum\r\n * @param {Number} bottom Bottom bound of the frustum\r\n * @param {Number} top Top bound of the frustum\r\n * @param {Number} near Near bound of the frustum\r\n * @param {Number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function frustum(out, left, right, bottom, top, near, far) {\n var rl = 1 / (right - left);\n var tb = 1 / (top - bottom);\n var nf = 1 / (near - far);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near * 2 * nf;\n out[15] = 0;\n return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} fovy Vertical field of view in radians\r\n * @param {number} aspect Aspect ratio. typically viewport width/height\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum, can be null or Infinity\r\n * @returns {mat4} out\r\n */\n\nexport function perspective(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n\n return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function perspectiveFromFieldOfView(out, fov, near, far) {\n var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);\n var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);\n var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);\n var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);\n var xScale = 2.0 / (leftTan + rightTan);\n var yScale = 2.0 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n out[4] = 0.0;\n out[5] = yScale;\n out[6] = 0.0;\n out[7] = 0.0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1.0;\n out[12] = 0.0;\n out[13] = 0.0;\n out[14] = far * near / (near - far);\n out[15] = 0.0;\n return out;\n}\n/**\r\n * Generates a orthogonal projection matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} left Left bound of the frustum\r\n * @param {number} right Right bound of the frustum\r\n * @param {number} bottom Bottom bound of the frustum\r\n * @param {number} top Top bound of the frustum\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function ortho(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {ReadonlyVec3} eye Position of the viewer\r\n * @param {ReadonlyVec3} center Point the viewer is looking at\r\n * @param {ReadonlyVec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nexport function lookAt(out, eye, center, up) {\n var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;\n var eyex = eye[0];\n var eyey = eye[1];\n var eyez = eye[2];\n var upx = up[0];\n var upy = up[1];\n var upz = up[2];\n var centerx = center[0];\n var centery = center[1];\n var centerz = center[2];\n\n if (Math.abs(eyex - centerx) < glMatrix.EPSILON && Math.abs(eyey - centery) < glMatrix.EPSILON && Math.abs(eyez - centerz) < glMatrix.EPSILON) {\n return identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n len = 1 / Math.hypot(z0, z1, z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.hypot(x0, x1, x2);\n\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n len = Math.hypot(y0, y1, y2);\n\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a matrix that makes something look at something else.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {ReadonlyVec3} eye Position of the viewer\r\n * @param {ReadonlyVec3} center Point the viewer is looking at\r\n * @param {ReadonlyVec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nexport function targetTo(out, eye, target, up) {\n var eyex = eye[0],\n eyey = eye[1],\n eyez = eye[2],\n upx = up[0],\n upy = up[1],\n upz = up[2];\n var z0 = eyex - target[0],\n z1 = eyey - target[1],\n z2 = eyez - target[2];\n var len = z0 * z0 + z1 * z1 + z2 * z2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n\n var x0 = upy * z2 - upz * z1,\n x1 = upz * z0 - upx * z2,\n x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n}\n/**\r\n * Returns a string representation of a mat4\r\n *\r\n * @param {ReadonlyMat4} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \", \" + a[9] + \", \" + a[10] + \", \" + a[11] + \", \" + a[12] + \", \" + a[13] + \", \" + a[14] + \", \" + a[15] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat4\r\n *\r\n * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);\n}\n/**\r\n * Adds two mat4's\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat4} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n}\n/**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat4} out the receiving vector\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat4} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat4} a The first matrix.\r\n * @param {ReadonlyMat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat4} a The first matrix.\r\n * @param {ReadonlyMat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var a8 = a[8],\n a9 = a[9],\n a10 = a[10],\n a11 = a[11];\n var a12 = a[12],\n a13 = a[13],\n a14 = a[14],\n a15 = a[15];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n var b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n var b8 = b[8],\n b9 = b[9],\n b10 = b[10],\n b11 = b[11];\n var b12 = b[12],\n b13 = b[13],\n b14 = b[14],\n b15 = b[15];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15));\n}\n/**\r\n * Alias for {@link mat4.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat4.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\nimport * as mat3 from \"./mat3.js\";\nimport * as vec3 from \"./vec3.js\";\nimport * as vec4 from \"./vec4.js\";\n/**\r\n * Quaternion\r\n * @module quat\r\n */\n\n/**\r\n * Creates a new identity quat\r\n *\r\n * @returns {quat} a new quaternion\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n out[3] = 1;\n return out;\n}\n/**\r\n * Set a quat to the identity quaternion\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @returns {quat} out\r\n */\n\nexport function identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyVec3} axis the axis around which to rotate\r\n * @param {Number} rad the angle in radians\r\n * @returns {quat} out\r\n **/\n\nexport function setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n var s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n}\n/**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @param {vec3} out_axis Vector receiving the axis of rotation\r\n * @param {ReadonlyQuat} q Quaternion to be decomposed\r\n * @return {Number} Angle, in radians, of the rotation\r\n */\n\nexport function getAxisAngle(out_axis, q) {\n var rad = Math.acos(q[3]) * 2.0;\n var s = Math.sin(rad / 2.0);\n\n if (s > glMatrix.EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n // If s is zero, return any axis (no rotation - axis does not matter)\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n\n return rad;\n}\n/**\r\n * Gets the angular distance between two unit quaternions\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\n\nexport function getAngle(a, b) {\n var dotproduct = dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n}\n/**\r\n * Multiplies two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {quat} out\r\n */\n\nexport function multiply(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the X axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateX(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateY(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var by = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bz = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n}\n/**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate W component of\r\n * @returns {quat} out\r\n */\n\nexport function calculateW(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\n return out;\n}\n/**\r\n * Calculate the exponential of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @returns {quat} out\r\n */\n\nexport function exp(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var et = Math.exp(w);\n var s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n}\n/**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @returns {quat} out\r\n */\n\nexport function ln(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n}\n/**\r\n * Calculate the scalar power of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @param {Number} b amount to scale the quaternion by\r\n * @returns {quat} out\r\n */\n\nexport function pow(out, a, b) {\n ln(out, a);\n scale(out, out, b);\n exp(out, out);\n return out;\n}\n/**\r\n * Performs a spherical linear interpolation between two quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n */\n\nexport function slerp(out, a, b, t) {\n // benchmarks:\n // http://jsperf.com/quaternion-slerp-implementations\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n var omega, cosom, sinom, scale0, scale1; // calc cosine\n\n cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary)\n\n if (cosom < 0.0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n } // calculate coefficients\n\n\n if (1.0 - cosom > glMatrix.EPSILON) {\n // standard case (slerp)\n omega = Math.acos(cosom);\n sinom = Math.sin(omega);\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n // \"from\" and \"to\" quaternions are very close\n // ... so we can do a linear interpolation\n scale0 = 1.0 - t;\n scale1 = t;\n } // calculate final values\n\n\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n}\n/**\r\n * Generates a random unit quaternion\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @returns {quat} out\r\n */\n\nexport function random(out) {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n var u1 = glMatrix.RANDOM();\n var u2 = glMatrix.RANDOM();\n var u3 = glMatrix.RANDOM();\n var sqrt1MinusU1 = Math.sqrt(1 - u1);\n var sqrtU1 = Math.sqrt(u1);\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n}\n/**\r\n * Calculates the inverse of a quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate inverse of\r\n * @returns {quat} out\r\n */\n\nexport function invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\n\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n}\n/**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate conjugate of\r\n * @returns {quat} out\r\n */\n\nexport function conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyMat3} m rotation matrix\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport function fromMat3(out, m) {\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n var fTrace = m[0] + m[4] + m[8];\n var fRoot;\n\n if (fTrace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\n\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot; // 1/(4w)\n\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n // |w| <= 1/2\n var i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n var j = (i + 1) % 3;\n var k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n\n return out;\n}\n/**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {x} Angle to rotate around X axis in degrees.\r\n * @param {y} Angle to rotate around Y axis in degrees.\r\n * @param {z} Angle to rotate around Z axis in degrees.\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport function fromEuler(out, x, y, z) {\n var halfToRad = 0.5 * Math.PI / 180.0;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n var sx = Math.sin(x);\n var cx = Math.cos(x);\n var sy = Math.sin(y);\n var cy = Math.cos(y);\n var sz = Math.sin(z);\n var cz = Math.cos(z);\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n return out;\n}\n/**\r\n * Returns a string representation of a quatenion\r\n *\r\n * @param {ReadonlyQuat} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"quat(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n *\r\n * @param {ReadonlyQuat} a quaternion to clone\r\n * @returns {quat} a new quaternion\r\n * @function\r\n */\n\nexport var clone = vec4.clone;\n/**\r\n * Creates a new quat initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {quat} a new quaternion\r\n * @function\r\n */\n\nexport var fromValues = vec4.fromValues;\n/**\r\n * Copy the values from one quat to another\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the source quaternion\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var copy = vec4.copy;\n/**\r\n * Set the components of a quat to the given values\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var set = vec4.set;\n/**\r\n * Adds two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var add = vec4.add;\n/**\r\n * Alias for {@link quat.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Scales a quat by a scalar number\r\n *\r\n * @param {quat} out the receiving vector\r\n * @param {ReadonlyQuat} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var scale = vec4.scale;\n/**\r\n * Calculates the dot product of two quat's\r\n *\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {Number} dot product of a and b\r\n * @function\r\n */\n\nexport var dot = vec4.dot;\n/**\r\n * Performs a linear interpolation between two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var lerp = vec4.lerp;\n/**\r\n * Calculates the length of a quat\r\n *\r\n * @param {ReadonlyQuat} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport var length = vec4.length;\n/**\r\n * Alias for {@link quat.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Calculates the squared length of a quat\r\n *\r\n * @param {ReadonlyQuat} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n * @function\r\n */\n\nexport var squaredLength = vec4.squaredLength;\n/**\r\n * Alias for {@link quat.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Normalize a quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quaternion to normalize\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var normalize = vec4.normalize;\n/**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyQuat} a The first quaternion.\r\n * @param {ReadonlyQuat} b The second quaternion.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport var exactEquals = vec4.exactEquals;\n/**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyQuat} a The first vector.\r\n * @param {ReadonlyQuat} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport var equals = vec4.equals;\n/**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n *\r\n * @param {quat} out the receiving quaternion.\r\n * @param {ReadonlyVec3} a the initial vector\r\n * @param {ReadonlyVec3} b the destination vector\r\n * @returns {quat} out\r\n */\n\nexport var rotationTo = function () {\n var tmpvec3 = vec3.create();\n var xUnitVec3 = vec3.fromValues(1, 0, 0);\n var yUnitVec3 = vec3.fromValues(0, 1, 0);\n return function (out, a, b) {\n var dot = vec3.dot(a, b);\n\n if (dot < -0.999999) {\n vec3.cross(tmpvec3, xUnitVec3, a);\n if (vec3.len(tmpvec3) < 0.000001) vec3.cross(tmpvec3, yUnitVec3, a);\n vec3.normalize(tmpvec3, tmpvec3);\n setAxisAngle(out, tmpvec3, Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n vec3.cross(tmpvec3, a, b);\n out[0] = tmpvec3[0];\n out[1] = tmpvec3[1];\n out[2] = tmpvec3[2];\n out[3] = 1 + dot;\n return normalize(out, out);\n }\n };\n}();\n/**\r\n * Performs a spherical linear interpolation with two control points\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {ReadonlyQuat} c the third operand\r\n * @param {ReadonlyQuat} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n */\n\nexport var sqlerp = function () {\n var temp1 = create();\n var temp2 = create();\n return function (out, a, b, c, d, t) {\n slerp(temp1, a, d, t);\n slerp(temp2, b, c, t);\n slerp(out, temp1, temp2, 2 * t * (1 - t));\n return out;\n };\n}();\n/**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n *\r\n * @param {ReadonlyVec3} view the vector representing the viewing direction\r\n * @param {ReadonlyVec3} right the vector representing the local \"right\" direction\r\n * @param {ReadonlyVec3} up the vector representing the local \"up\" direction\r\n * @returns {quat} out\r\n */\n\nexport var setAxes = function () {\n var matr = mat3.create();\n return function (out, view, right, up) {\n matr[0] = right[0];\n matr[3] = right[1];\n matr[6] = right[2];\n matr[1] = up[0];\n matr[4] = up[1];\n matr[7] = up[2];\n matr[2] = -view[0];\n matr[5] = -view[1];\n matr[8] = -view[2];\n return normalize(out, fromMat3(out, matr));\n };\n}();","import * as glMatrix from \"./common.js\";\n/**\r\n * 4 Dimensional Vector\r\n * @module vec4\r\n */\n\n/**\r\n * Creates a new, empty vec4\r\n *\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec4 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec4} a vector to clone\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Creates a new vec4 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function fromValues(x, y, z, w) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\r\n * Copy the values from one vec4 to another\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the source vector\r\n * @returns {vec4} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set the components of a vec4 to the given values\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} out\r\n */\n\nexport function set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\r\n * Adds two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\r\n * Multiplies two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n}\n/**\r\n * Divides two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to ceil\r\n * @returns {vec4} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to floor\r\n * @returns {vec4} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n}\n/**\r\n * Math.round the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to round\r\n * @returns {vec4} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n}\n/**\r\n * Scales a vec4 by a scalar number\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec4} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\r\n * Adds two vec4's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec4} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Calculates the length of a vec4\r\n *\r\n * @param {ReadonlyVec4} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\r\n * Calculates the squared length of a vec4\r\n *\r\n * @param {ReadonlyVec4} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Negates the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to negate\r\n * @returns {vec4} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to invert\r\n * @returns {vec4} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n out[3] = 1.0 / a[3];\n return out;\n}\n/**\r\n * Normalize a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to normalize\r\n * @returns {vec4} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n var len = x * x + y * y + z * z + w * w;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n}\n/**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n *\r\n * @param {ReadonlyVec4} result the receiving vector\r\n * @param {ReadonlyVec4} U the first vector\r\n * @param {ReadonlyVec4} V the second vector\r\n * @param {ReadonlyVec4} W the third vector\r\n * @returns {vec4} result\r\n */\n\nexport function cross(out, u, v, w) {\n var A = v[0] * w[1] - v[1] * w[0],\n B = v[0] * w[2] - v[2] * w[0],\n C = v[0] * w[3] - v[3] * w[0],\n D = v[1] * w[2] - v[2] * w[1],\n E = v[1] * w[3] - v[3] * w[1],\n F = v[2] * w[3] - v[3] * w[2];\n var G = u[0];\n var H = u[1];\n var I = u[2];\n var J = u[3];\n out[0] = H * F - I * E + J * D;\n out[1] = -(G * F) + I * C - J * B;\n out[2] = G * E - H * C + J * A;\n out[3] = -(G * D) + H * B - I * A;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec4} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n var aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec4} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n\n var v1, v2, v3, v4;\n var s1, s2;\n\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n\n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n}\n/**\r\n * Transforms the vec4 with a mat4.\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec4} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n}\n/**\r\n * Transforms the vec4 with a quat\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to transform\r\n * @param {ReadonlyQuat} q quaternion to transform with\r\n * @returns {vec4} out\r\n */\n\nexport function transformQuat(out, a, q) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3]; // calculate quat * vec\n\n var ix = qw * x + qy * z - qz * y;\n var iy = qw * y + qz * x - qx * z;\n var iz = qw * z + qx * y - qy * x;\n var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set the components of a vec4 to zero\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @returns {vec4} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec4} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec4} a The first vector.\r\n * @param {ReadonlyVec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec4} a The first vector.\r\n * @param {ReadonlyVec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\r\n * Alias for {@link vec4.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec4.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec4.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec4.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec4.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec4.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec4.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec4s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 4;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n vec[3] = a[i + 3];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n a[i + 3] = vec[3];\n }\n\n return a;\n };\n}();","import * as glMatrix from \"./common.js\";\n/**\r\n * 3 Dimensional Vector\r\n * @module vec3\r\n */\n\n/**\r\n * Creates a new, empty vec3\r\n *\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(3);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec3} a vector to clone\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\r\n * Calculates the length of a vec3\r\n *\r\n * @param {ReadonlyVec3} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return Math.hypot(x, y, z);\n}\n/**\r\n * Creates a new vec3 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function fromValues(x, y, z) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\r\n * Copy the values from one vec3 to another\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the source vector\r\n * @returns {vec3} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\r\n * Set the components of a vec3 to the given values\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} out\r\n */\n\nexport function set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\r\n * Adds two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n}\n/**\r\n * Multiplies two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n}\n/**\r\n * Divides two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to ceil\r\n * @returns {vec3} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to floor\r\n * @returns {vec3} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n}\n/**\r\n * Math.round the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to round\r\n * @returns {vec3} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n return out;\n}\n/**\r\n * Scales a vec3 by a scalar number\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec3} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n return out;\n}\n/**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec3} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return Math.hypot(x, y, z);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return x * x + y * y + z * z;\n}\n/**\r\n * Calculates the squared length of a vec3\r\n *\r\n * @param {ReadonlyVec3} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return x * x + y * y + z * z;\n}\n/**\r\n * Negates the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to negate\r\n * @returns {vec3} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to invert\r\n * @returns {vec3} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n return out;\n}\n/**\r\n * Normalize a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to normalize\r\n * @returns {vec3} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var len = x * x + y * y + z * z;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n/**\r\n * Computes the cross product of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function cross(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2];\n var bx = b[0],\n by = b[1],\n bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n}\n/**\r\n * Performs a hermite interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {ReadonlyVec3} c the third operand\r\n * @param {ReadonlyVec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function hermite(out, a, b, c, d, t) {\n var factorTimes2 = t * t;\n var factor1 = factorTimes2 * (2 * t - 3) + 1;\n var factor2 = factorTimes2 * (t - 2) + t;\n var factor3 = factorTimes2 * (t - 1);\n var factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\r\n * Performs a bezier interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {ReadonlyVec3} c the third operand\r\n * @param {ReadonlyVec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function bezier(out, a, b, c, d, t) {\n var inverseFactor = 1 - t;\n var inverseFactorTimesTwo = inverseFactor * inverseFactor;\n var factorTimes2 = t * t;\n var factor1 = inverseFactorTimesTwo * inverseFactor;\n var factor2 = 3 * t * inverseFactorTimesTwo;\n var factor3 = 3 * factorTimes2 * inverseFactor;\n var factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec3} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n var z = glMatrix.RANDOM() * 2.0 - 1.0;\n var zScale = Math.sqrt(1.0 - z * z) * scale;\n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n}\n/**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n/**\r\n * Transforms the vec3 with a mat3.\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyMat3} m the 3x3 matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformMat3(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n}\n/**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyQuat} q quaternion to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformQuat(out, a, q) {\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3];\n var x = a[0],\n y = a[1],\n z = a[2]; // var qvec = [qx, qy, qz];\n // var uv = vec3.cross([], qvec, a);\n\n var uvx = qy * z - qz * y,\n uvy = qz * x - qx * z,\n uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv);\n\n var uuvx = qy * uvz - qz * uvy,\n uuvy = qz * uvx - qx * uvz,\n uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w);\n\n var w2 = qw * 2;\n uvx *= w2;\n uvy *= w2;\n uvz *= w2; // vec3.scale(uuv, uuv, 2);\n\n uuvx *= 2;\n uuvy *= 2;\n uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv));\n\n out[0] = x + uvx + uuvx;\n out[1] = y + uvy + uuvy;\n out[2] = z + uvz + uuvz;\n return out;\n}\n/**\r\n * Rotate a 3D vector around the x-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateX(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Rotate a 3D vector around the y-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateY(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Rotate a 3D vector around the z-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateZ(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2]; //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Get the angle between two 3D vectors\r\n * @param {ReadonlyVec3} a The first operand\r\n * @param {ReadonlyVec3} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nexport function angle(a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n bx = b[0],\n by = b[1],\n bz = b[2],\n mag1 = Math.sqrt(ax * ax + ay * ay + az * az),\n mag2 = Math.sqrt(bx * bx + by * by + bz * bz),\n mag = mag1 * mag2,\n cosine = mag && dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\r\n * Set the components of a vec3 to zero\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @returns {vec3} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec3} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \")\";\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec3} a The first vector.\r\n * @param {ReadonlyVec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec3} a The first vector.\r\n * @param {ReadonlyVec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2));\n}\n/**\r\n * Alias for {@link vec3.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec3.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec3.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec3.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec3.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec3.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec3.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec3s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 3;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n }\n\n return a;\n };\n}();","import * as glMatrix from \"./common.js\";\nimport * as quat from \"./quat.js\";\nimport * as mat4 from \"./mat4.js\";\n/**\r\n * Dual Quaternion
\r\n * Format: [real, dual]
\r\n * Quaternion format: XYZW
\r\n * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
\r\n * @module quat2\r\n */\n\n/**\r\n * Creates a new identity dual quat\r\n *\r\n * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation]\r\n */\n\nexport function create() {\n var dq = new glMatrix.ARRAY_TYPE(8);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n dq[0] = 0;\n dq[1] = 0;\n dq[2] = 0;\n dq[4] = 0;\n dq[5] = 0;\n dq[6] = 0;\n dq[7] = 0;\n }\n\n dq[3] = 1;\n return dq;\n}\n/**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n *\r\n * @param {ReadonlyQuat2} a dual quaternion to clone\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function clone(a) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = a[0];\n dq[1] = a[1];\n dq[2] = a[2];\n dq[3] = a[3];\n dq[4] = a[4];\n dq[5] = a[5];\n dq[6] = a[6];\n dq[7] = a[7];\n return dq;\n}\n/**\r\n * Creates a new dual quat initialized with the given values\r\n *\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component\r\n * @param {Number} y2 Y component\r\n * @param {Number} z2 Z component\r\n * @param {Number} w2 W component\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n dq[4] = x2;\n dq[5] = y2;\n dq[6] = z2;\n dq[7] = w2;\n return dq;\n}\n/**\r\n * Creates a new dual quat from the given values (quat and translation)\r\n *\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component (translation)\r\n * @param {Number} y2 Y component (translation)\r\n * @param {Number} z2 Z component (translation)\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n var ax = x2 * 0.5,\n ay = y2 * 0.5,\n az = z2 * 0.5;\n dq[4] = ax * w1 + ay * z1 - az * y1;\n dq[5] = ay * w1 + az * x1 - ax * z1;\n dq[6] = az * w1 + ax * y1 - ay * x1;\n dq[7] = -ax * x1 - ay * y1 - az * z1;\n return dq;\n}\n/**\r\n * Creates a dual quat from a quaternion and a translation\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyQuat} q a normalized quaternion\r\n * @param {ReadonlyVec3} t tranlation vector\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromRotationTranslation(out, q, t) {\n var ax = t[0] * 0.5,\n ay = t[1] * 0.5,\n az = t[2] * 0.5,\n bx = q[0],\n by = q[1],\n bz = q[2],\n bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Creates a dual quat from a translation\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyVec3} t translation vector\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n}\n/**\r\n * Creates a dual quat from a quaternion\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyQuat} q the quaternion\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\r\n * Creates a new dual quat from a matrix (4x4)\r\n *\r\n * @param {quat2} out the dual quaternion\r\n * @param {ReadonlyMat4} a the matrix\r\n * @returns {quat2} dual quat receiving operation result\r\n * @function\r\n */\n\nexport function fromMat4(out, a) {\n //TODO Optimize this\n var outer = quat.create();\n mat4.getRotation(outer, a);\n var t = new glMatrix.ARRAY_TYPE(3);\n mat4.getTranslation(t, a);\n fromRotationTranslation(out, outer, t);\n return out;\n}\n/**\r\n * Copy the values from one dual quat to another\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the source dual quaternion\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n}\n/**\r\n * Set a dual quat to the identity dual quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @returns {quat2} out\r\n */\n\nexport function identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\r\n * Set the components of a dual quat to the given values\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component\r\n * @param {Number} y2 Y component\r\n * @param {Number} z2 Z component\r\n * @param {Number} w2 W component\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n}\n/**\r\n * Gets the real part of a dual quat\r\n * @param {quat} out real part\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @return {quat} real part\r\n */\n\nexport var getReal = quat.copy;\n/**\r\n * Gets the dual part of a dual quat\r\n * @param {quat} out dual part\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @return {quat} dual part\r\n */\n\nexport function getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n}\n/**\r\n * Set the real component of a dual quat to the given quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat} q a quaternion representing the real part\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport var setReal = quat.copy;\n/**\r\n * Set the dual component of a dual quat to the given quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat} q a quaternion representing the dual part\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function setDual(out, q) {\n out[4] = q[0];\n out[5] = q[1];\n out[6] = q[2];\n out[7] = q[3];\n return out;\n}\n/**\r\n * Gets the translation of a normalized dual quat\r\n * @param {vec3} out translation\r\n * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed\r\n * @return {vec3} translation\r\n */\n\nexport function getTranslation(out, a) {\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n}\n/**\r\n * Translates a dual quat by the given vector\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to translate\r\n * @param {ReadonlyVec3} v vector to translate by\r\n * @returns {quat2} out\r\n */\n\nexport function translate(out, a, v) {\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3],\n bx1 = v[0] * 0.5,\n by1 = v[1] * 0.5,\n bz1 = v[2] * 0.5,\n ax2 = a[4],\n ay2 = a[5],\n az2 = a[6],\n aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n}\n/**\r\n * Rotates a dual quat around the X axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateX(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around the Y axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateY(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around the Z axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat by a given quaternion (a * q)\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {ReadonlyQuat} q quaternion to rotate by\r\n * @returns {quat2} out\r\n */\n\nexport function rotateByQuatAppend(out, a, q) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n}\n/**\r\n * Rotates a dual quat by a given quaternion (q * a)\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat} q quaternion to rotate by\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @returns {quat2} out\r\n */\n\nexport function rotateByQuatPrepend(out, q, a) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n bx = a[0],\n by = a[1],\n bz = a[2],\n bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around a given axis. Does the normalisation automatically\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @param {Number} rad how far the rotation should be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateAroundAxis(out, a, axis, rad) {\n //Special case for rad = 0\n if (Math.abs(rad) < glMatrix.EPSILON) {\n return copy(out, a);\n }\n\n var axisLength = Math.hypot(axis[0], axis[1], axis[2]);\n rad = rad * 0.5;\n var s = Math.sin(rad);\n var bx = s * axis[0] / axisLength;\n var by = s * axis[1] / axisLength;\n var bz = s * axis[2] / axisLength;\n var bw = Math.cos(rad);\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Adds two dual quat's\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n}\n/**\r\n * Multiplies two dual quat's\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {quat2} out\r\n */\n\nexport function multiply(out, a, b) {\n var ax0 = a[0],\n ay0 = a[1],\n az0 = a[2],\n aw0 = a[3],\n bx1 = b[4],\n by1 = b[5],\n bz1 = b[6],\n bw1 = b[7],\n ax1 = a[4],\n ay1 = a[5],\n az1 = a[6],\n aw1 = a[7],\n bx0 = b[0],\n by0 = b[1],\n bz0 = b[2],\n bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n}\n/**\r\n * Alias for {@link quat2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Scales a dual quat by a scalar number\r\n *\r\n * @param {quat2} out the receiving dual quat\r\n * @param {ReadonlyQuat2} a the dual quat to scale\r\n * @param {Number} b amount to scale the dual quat by\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n}\n/**\r\n * Calculates the dot product of two dual quat's (The dot product of the real parts)\r\n *\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {Number} dot product of a and b\r\n * @function\r\n */\n\nexport var dot = quat.dot;\n/**\r\n * Performs a linear interpolation between two dual quats's\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5)\r\n *\r\n * @param {quat2} out the receiving dual quat\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat2} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var mt = 1 - t;\n if (dot(a, b) < 0) t = -t;\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n}\n/**\r\n * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a dual quat to calculate inverse of\r\n * @returns {quat2} out\r\n */\n\nexport function invert(out, a) {\n var sqlen = squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n}\n/**\r\n * Calculates the conjugate of a dual quat\r\n * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result.\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat2} a quat to calculate conjugate of\r\n * @returns {quat2} out\r\n */\n\nexport function conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n}\n/**\r\n * Calculates the length of a dual quat\r\n *\r\n * @param {ReadonlyQuat2} a dual quat to calculate length of\r\n * @returns {Number} length of a\r\n * @function\r\n */\n\nexport var length = quat.length;\n/**\r\n * Alias for {@link quat2.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Calculates the squared length of a dual quat\r\n *\r\n * @param {ReadonlyQuat2} a dual quat to calculate squared length of\r\n * @returns {Number} squared length of a\r\n * @function\r\n */\n\nexport var squaredLength = quat.squaredLength;\n/**\r\n * Alias for {@link quat2.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Normalize a dual quat\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a dual quaternion to normalize\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function normalize(out, a) {\n var magnitude = squaredLength(a);\n\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n var a0 = a[0] / magnitude;\n var a1 = a[1] / magnitude;\n var a2 = a[2] / magnitude;\n var a3 = a[3] / magnitude;\n var b0 = a[4];\n var b1 = a[5];\n var b2 = a[6];\n var b3 = a[7];\n var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n\n return out;\n}\n/**\r\n * Returns a string representation of a dual quatenion\r\n *\r\n * @param {ReadonlyQuat2} a dual quaternion to represent as a string\r\n * @returns {String} string representation of the dual quat\r\n */\n\nexport function str(a) {\n return \"quat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \")\";\n}\n/**\r\n * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyQuat2} a the first dual quaternion.\r\n * @param {ReadonlyQuat2} b the second dual quaternion.\r\n * @returns {Boolean} true if the dual quaternions are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7];\n}\n/**\r\n * Returns whether or not the dual quaternions have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyQuat2} a the first dual quat.\r\n * @param {ReadonlyQuat2} b the second dual quat.\r\n * @returns {Boolean} true if the dual quats are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7));\n}","import * as glMatrix from \"./common.js\";\n/**\r\n * 2 Dimensional Vector\r\n * @module vec2\r\n */\n\n/**\r\n * Creates a new, empty vec2\r\n *\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(2);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec2 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec2} a vector to clone\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\r\n * Creates a new vec2 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function fromValues(x, y) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\r\n * Copy the values from one vec2 to another\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the source vector\r\n * @returns {vec2} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\r\n * Set the components of a vec2 to the given values\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} out\r\n */\n\nexport function set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\r\n * Adds two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n}\n/**\r\n * Multiplies two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n}\n/**\r\n * Divides two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to ceil\r\n * @returns {vec2} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to floor\r\n * @returns {vec2} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n}\n/**\r\n * Math.round the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to round\r\n * @returns {vec2} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n}\n/**\r\n * Scales a vec2 by a scalar number\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec2} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n}\n/**\r\n * Adds two vec2's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec2} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return Math.hypot(x, y);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return x * x + y * y;\n}\n/**\r\n * Calculates the length of a vec2\r\n *\r\n * @param {ReadonlyVec2} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0],\n y = a[1];\n return Math.hypot(x, y);\n}\n/**\r\n * Calculates the squared length of a vec2\r\n *\r\n * @param {ReadonlyVec2} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0],\n y = a[1];\n return x * x + y * y;\n}\n/**\r\n * Negates the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to negate\r\n * @returns {vec2} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to invert\r\n * @returns {vec2} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n return out;\n}\n/**\r\n * Normalize a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to normalize\r\n * @returns {vec2} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0],\n y = a[1];\n var len = x * x + y * y;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n}\n/**\r\n * Computes the cross product of two vec2's\r\n * Note that the cross product must by definition produce a 3D vector\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function cross(out, a, b) {\n var z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec2} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0],\n ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec2} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n out[0] = Math.cos(r) * scale;\n out[1] = Math.sin(r) * scale;\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat2} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat2(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat2d\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat2d} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat2d(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat3\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat3} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat3(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat4\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0];\n var y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n}\n/**\r\n * Rotate a 2D vector\r\n * @param {vec2} out The receiving vec2\r\n * @param {ReadonlyVec2} a The vec2 point to rotate\r\n * @param {ReadonlyVec2} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec2} out\r\n */\n\nexport function rotate(out, a, b, rad) {\n //Translate point to the origin\n var p0 = a[0] - b[0],\n p1 = a[1] - b[1],\n sinC = Math.sin(rad),\n cosC = Math.cos(rad); //perform rotation and translate to correct position\n\n out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n}\n/**\r\n * Get the angle between two 2D vectors\r\n * @param {ReadonlyVec2} a The first operand\r\n * @param {ReadonlyVec2} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nexport function angle(a, b) {\n var x1 = a[0],\n y1 = a[1],\n x2 = b[0],\n y2 = b[1],\n // mag is the product of the magnitudes of a and b\n mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2),\n // mag &&.. short circuits if mag == 0\n cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\n\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\r\n * Set the components of a vec2 to zero\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @returns {vec2} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec2} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec2(\" + a[0] + \", \" + a[1] + \")\";\n}\n/**\r\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec2} a The first vector.\r\n * @param {ReadonlyVec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec2} a The first vector.\r\n * @param {ReadonlyVec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1];\n var b0 = b[0],\n b1 = b[1];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1));\n}\n/**\r\n * Alias for {@link vec2.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec2.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec2.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec2.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec2.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec2.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec2s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 2;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n }\n\n return a;\n };\n}();","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Scene = void 0;\nconst SceneChild_1 = require(\"./SceneChild\");\nconst Group_1 = require(\"./Group\");\nconst Shape_1 = require(\"./shapes/Shape\");\nconst Utilities_1 = require(\"./Utilities\");\n/**\n * Container for all SceneChild.\n * The main purpose is to manage the drawing order and update the child buffers\n *\n * @order 1\n * @category Core.Scene\n * @class Scene\n */\nclass Scene {\n /**\n * Creates an instance of Scene.\n * You can see the default values in the property definitions\n */\n constructor(settings = {}) {\n /**\n * Logical number, the drawer will take care of defining the unit of measure\n */\n this.width = 400;\n /**\n * Logical number, the drawer will take care of defining the unit of measure\n */\n this.height = 400;\n /**\n * Default background color (black)\n */\n this.background = 'hsla(0, 0%, 0%, 1)';\n /**\n * Default ScenePrimitive stroke color (white)\n */\n this.color = 'hsla(0, 0%, 100%, 1)';\n /**\n * Current time\n */\n this.currentTime = 0;\n if (typeof settings.width !== 'undefined')\n this.width = settings.width;\n if (typeof settings.height !== 'undefined')\n this.height = settings.height;\n if (typeof settings.background !== 'undefined')\n this.background = settings.background;\n if (typeof settings.color !== 'undefined')\n this.color = settings.color;\n this.children = [];\n this.center = [this.width / 2, this.height / 2];\n this.anchor =\n settings.anchor && Array.isArray(settings.anchor)\n ? [\n typeof settings.anchor[0] === 'number'\n ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[0]) * 0.5) * this.width\n : settings.anchor[0] === 'left'\n ? 0\n : settings.anchor[0] === 'right'\n ? this.width\n : this.center[0],\n typeof settings.anchor[1] === 'number'\n ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[1]) * 0.5) * this.height\n : settings.anchor[1] === 'top'\n ? 0\n : settings.anchor[1] === 'bottom'\n ? this.height\n : this.center[1],\n ]\n : [this.center[0], this.center[1]];\n }\n /**\n * Return width percentage\n *\n * @param {number} [percentage=100]\n * @returns {number}\n */\n getWidth(percentage = 100) {\n return (this.width * percentage) / 100;\n }\n /**\n * Return height percentage\n *\n * @param {number} [percentage=100]\n * @returns {number}\n */\n getHeight(percentage = 100) {\n return (this.height * percentage) / 100;\n }\n /**\n * Resize the scene size\n *\n * @param {number} width\n * @param {number} [height=width]\n * @memberof Scene\n */\n resize(width, height = width) {\n this.width = width;\n this.height = height;\n this.center = [this.width / 2, this.height / 2];\n const anchor = [this.width / this.anchor[0], this.height / this.anchor[1]];\n this.anchor = [this.width / anchor[0], this.height / anchor[1]];\n this.children.forEach(sceneChild => sceneChild.clearBuffer(true, false));\n }\n /**\n * Update all children, generate a streamable buffer for drawing\n *\n * @param {number} [atTime] time in ms\n * @memberof Scene\n */\n update(atTime = 0) {\n this.currentTime = atTime;\n for (let i = 0, len = this.children.length; i < len; i++) {\n this.children[i].generate(this.currentTime, true);\n }\n }\n /**\n * Traverse the child buffer and use it with callback\n *\n * @param {(streamArguments: IStreamArguments) => void} callback\n * @memberof Scene\n */\n stream(callback) {\n this.children.forEach(sceneChild => sceneChild.stream(callback));\n }\n /*\n |--------------------------------------------------------------------------\n | SceneChild\n |--------------------------------------------------------------------------\n */\n /**\n * Return a list of children\n *\n * @returns {Array}\n * @memberof Scene\n */\n getChildren() {\n return this.children;\n }\n /**\n * Add SceneChild to Scene, pass `order` as last parameter for drawing priorities\n *\n * @param {Array} items\n * @param {number} [order]\n * @memberof Scene\n */\n add(...items /**, order: number */) {\n const order = typeof items[items.length - 1] === 'number' ? items[items.length - 1] : undefined;\n const len = items.length - (typeof order === 'undefined' ? 0 : 1);\n for (let i = 0; i < len; i++) {\n const item = items[i];\n item.order =\n typeof order !== 'undefined'\n ? order + i\n : typeof item.order !== 'undefined'\n ? item.order\n : this.children.length > 0\n ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1\n : 0;\n Scene.propagateToChilden(item, this);\n this.children.push(item);\n item.clearBuffer(true, false);\n item.generate(0, true);\n }\n this.sortChildren();\n }\n /**\n * Sort children by order\n *\n * @memberof Scene\n */\n sortChildren() {\n this.children.sort((a, b) => a.order - b.order);\n this.children = this.children.map((child, index) => {\n child.order = index;\n return child;\n });\n }\n /**\n * Find sceneChild from id or name in the whole scene\n *\n * @param {string | number} idOrName\n * @returns {(SceneChild | null)}\n * @memberof Scene\n */\n find(idOrName) {\n const children = this.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const result = children[i].find(idOrName);\n if (result !== null)\n return result;\n }\n return null;\n }\n /**\n * Get shape by index\n *\n * @param {number} index\n * @returns {(SceneChild | null)}\n * @memberof Scene\n */\n get(index) {\n return index >= 0 && index < this.children.length ? this.children[index] : null;\n }\n /**\n * Remove a shape by index\n *\n * @param {number} index\n * @memberof Scene\n */\n remove(index) {\n index >= 0 && index < this.children.length && this.children.splice(index, 1);\n }\n /**\n * Removes all children\n *\n * @memberof Scene\n */\n removeChildren() {\n this.children = [];\n }\n /**\n * Remove sceneChild by id or name\n *\n * @param {number | number} idOrName\n * @memberof Scene\n */\n removeFromId(idOrName) {\n for (let i = 0, len = this.children.length; i < len; i++)\n if (this.children[i].id === idOrName || this.children[i].name === idOrName) {\n this.children.splice(i, 1);\n return;\n }\n }\n /**\n * Return true if sceneChild is direct children\n *\n * @param {SceneChild} sceneChild\n * @returns {boolean}\n * @memberof Scene\n */\n isFirstLevelChild(sceneChild) {\n for (let i = 0, len = this.children.length; i < len; i++)\n if (this.children[i].id === sceneChild.id)\n return true;\n const parents = this.getParentsOfSceneChild(sceneChild);\n return parents.length === 1 && parents[0] instanceof Group_1.Group;\n }\n /**\n * Returns the list of sceneChild hierarchy starting from the scene\n *\n * @param {SceneChild} sceneChild\n * @returns {Array}\n * @memberof Scene\n */\n getParentsOfSceneChild(sceneChild) {\n const result = Scene.getParentsOfSceneChild(this, sceneChild);\n if (result) {\n result.splice(0, 1);\n return result;\n }\n return [];\n }\n /**\n * Returns the list of sceneChild hierarchy starting from the scene\n *\n * @static\n * @param {(Scene | SceneChild)} current\n * @param {SceneChild} sceneChild\n * @param {(Array)} [parents=[]]\n * @returns {(Array | null)}\n * @memberof Scene\n */\n static getParentsOfSceneChild(current, sceneChild, parents = []) {\n let result;\n if (current instanceof SceneChild_1.SceneChild) {\n if (current.id == sceneChild.id)\n return parents;\n if (current instanceof Shape_1.Shape && current.shape) {\n const tmpParents = parents.slice();\n tmpParents.push(current);\n if ((result = Scene.getParentsOfSceneChild(current.shape, sceneChild, tmpParents)))\n return result;\n }\n }\n if (current instanceof Scene || current instanceof Group_1.Group) {\n const children = current.getChildren();\n parents.push(current);\n for (let i = 0, len = children.length; i < len; i++) {\n const child = children[i];\n if ((result = Scene.getParentsOfSceneChild(child, sceneChild, parents)))\n return result;\n }\n parents.pop();\n }\n return null;\n }\n /**\n * Walk through the scene\n *\n * @static\n * @param {SceneChild} callbackk\n * @param {(Scene | SceneChild)} current\n * @memberof Scene\n */\n static walk(callback, current) {\n if (current instanceof SceneChild_1.SceneChild) {\n if (callback(current) === false)\n return false;\n if (current instanceof Shape_1.Shape && current.shape)\n if (Scene.walk(callback, current.shape) === false)\n return false;\n }\n if (current instanceof Scene || current instanceof Group_1.Group) {\n const children = current.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const child = children[i];\n if (Scene.walk(callback, child) === false)\n return false;\n }\n }\n }\n /**\n * Propagate scene to sceneChild (and children)\n *\n * @static\n * @param {SceneChild} sceneChild\n * @param {Scene} scene\n * @memberof Scene\n */\n static propagateToChilden(sceneChild, scene) {\n sceneChild.scene = scene;\n if (sceneChild instanceof Group_1.Group) {\n sceneChild.getChildren().forEach((item) => {\n Scene.propagateToChilden(item, scene);\n });\n }\n else if (sceneChild instanceof Shape_1.Shape && sceneChild.shape) {\n sceneChild.shape.scene = scene;\n Scene.propagateToChilden(sceneChild.shape, scene);\n }\n }\n}\nexports.Scene = Scene;\n//# sourceMappingURL=Scene.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SceneChild = void 0;\n/**\n * Autoincrement sceneChild default id\n *\n * @internal\n * @ignore\n */\nlet __id = 0;\n/**\n * The element to be added into a scene.\n * Preserve props, drawing order, generate and return buffers.\n * The only implementations of this class are Group and ShapeBase\n *\n * @abstract\n * @category Core.Abstract\n * @order 2\n * @class SceneChild\n */\nclass SceneChild {\n /**\n * Creates an instance of SceneChild.\n * Base values will be assigned in case they are not passed\n *\n * @param {ISceneChildSettings} settings\n */\n constructor(settings) {\n var _a;\n /**\n * Shape generation id\n * used for prevent buffer calculation\n *\n * @internal\n * @ignore\n */\n this.generateId = -1;\n this.id = (_a = settings.id) !== null && _a !== void 0 ? _a : ++__id;\n this.type = settings.type || 'SceneChild';\n this.name = settings.name || this.type + '_' + this.id;\n this.data = settings.data || {};\n this.props = {};\n }\n /**\n * Find this or form or children.\n * Overridden by classes that extend it\n *\n * @param {string | number} idOrName\n * @returns {(SceneChild | null)}\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n return null;\n }\n /**\n * Return the sceneChild properties\n *\n * @returns {Props}\n */\n getProps() {\n return this.props;\n }\n /**\n * Return a sceneChild prop or default value\n *\n * @param {keyof Props} key\n * @param {PropArguments} [propArguments]\n * @param {*} [defaultValue]\n * @returns {*}\n */\n getProp(key, propArguments, defaultValue) {\n var _a;\n return ((_a = this.props[key]) !== null && _a !== void 0 ? _a : defaultValue);\n }\n /**\n * Check SceneChild has prop\n *\n * @param {keyof Props} key\n * @returns\n */\n hasProp(key) {\n return typeof this.props[key] !== 'undefined';\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n */\n setPropUnsafe(key, value) {\n if (typeof key == 'string')\n this.props[key] = value;\n else\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n }\n}\nexports.SceneChild = SceneChild;\n//# sourceMappingURL=SceneChild.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Group = void 0;\nconst Scene_1 = require(\"./Scene\");\nconst SceneChild_1 = require(\"./SceneChild\");\nconst ShapeBase_1 = require(\"./shapes/ShapeBase\");\nconst Adapt_1 = require(\"./modifiers/Adapt\");\n/**\n * A SceneChild container, propagates properties to children\n *\n * @order 3\n * @category Core.Scene\n * @extends {SceneChild}\n * @example\n * ```javascript\n * // Group example\n *\n * const rect = new Urpflanze.Rect({\n * \tdistance: 100 // <- if a property is set the group will not overwrite it\n * })\n * const group = new Urpflanze.Group({\n * \trepetitions: 3,\n * \tdistance: 200\n * })\n *\n * group.add(rect)\n * group.add(new Urpflanze.Triangle())\n * ```\n * @class Group\n */\nclass Group extends SceneChild_1.SceneChild {\n /**\n * Creates an instance of Group\n *\n * @param {ISceneChildSettings} [settings={}]\n * @memberof Group\n */\n constructor(settings = {}) {\n settings.type = 'Group';\n super(settings);\n this.children = [];\n ['id', 'name', 'data', 'order', 'type'].forEach((prop) => {\n if (prop in settings)\n delete settings[prop];\n });\n this.props = settings;\n }\n /**\n * Check group has static children\n *\n * @returns {boolean}\n * @memberof Group\n */\n isStatic() {\n const children = this.children;\n for (let i = 0, len = children.length; i < len; i++)\n if (!children[i].isStatic())\n return false;\n return true;\n }\n /**\n * Check group has static children indexed\n *\n * @returns {boolean}\n * @memberof Group\n */\n isStaticIndexed() {\n const children = this.children;\n for (let i = 0, len = children.length; i < len; i++)\n if (!children[i].isStaticIndexed())\n return false;\n return true;\n }\n /**\n * Add item to Group\n *\n * @param {Array} items\n * @memberof Group\n */\n add(...items) {\n for (let i = 0, len = items.length; i < len; i++) {\n const item = items[i];\n const rawItemProps = item.getProps();\n Object.keys(this.props).forEach((propKey) => {\n if (typeof rawItemProps[propKey] === 'undefined')\n item.setProp(propKey, this.props[propKey]);\n });\n item.order =\n typeof item.order !== 'undefined'\n ? item.order\n : this.children.length > 0\n ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1\n : 0;\n this.scene && Scene_1.Scene.propagateToChilden(item, this.scene);\n this.children.push(item);\n }\n this.sortChildren();\n }\n /**\n * Sort children\n *\n * @memberof Group\n */\n sortChildren() {\n this.children.sort((a, b) => a.order - b.order);\n this.children = this.children.map((child, index) => {\n child.order = index;\n return child;\n });\n this.clearBuffer(true);\n }\n /**\n * Return shape children\n *\n * @returns {Array}\n * @memberof Group\n */\n getChildren() {\n return this.children;\n }\n /**\n * Find scene child from id or name\n *\n * @param {number | string} idOrName\n * @returns {(SceneChild | null)}\n * @memberof Group\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n const children = this.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const result = children[i].find(idOrName);\n if (result !== null)\n return result;\n }\n return null;\n }\n /**\n * Get item from group\n *\n * @param {number} index\n * @returns {(SceneChild | null)}\n * @memberof Group\n */\n get(index) {\n return index >= 0 && index < this.children.length ? this.children[index] : null;\n }\n /**\n * Remove item from group\n *\n * @param {number} index\n * @returns {(false | Array)}\n * @memberof Group\n */\n remove(index) {\n if (index >= 0 && index < this.children.length) {\n const removed = this.children.splice(index, 1);\n this.clearBuffer(true);\n return removed;\n }\n return false;\n }\n /**\n * Remove from id\n *\n * @param {number} id\n * @memberof Scene\n */\n removeFromId(id) {\n for (let i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i].id == id) {\n this.children.splice(i, 1);\n return this.clearBuffer(true);\n }\n }\n }\n /**\n * Generate children buffers\n *\n * @param {number} generateId\n * @param {boolean} [bDirectSceneChild=false]\n * @param {IPropArguments} [parentPropArguments]\n * @memberof Group\n */\n generate(generateId, bDirectSceneChild = false, parentPropArguments) {\n this.generateId = generateId;\n this.children.forEach(item => item.generate(generateId, bDirectSceneChild, parentPropArguments));\n }\n /**\n * Sum the children bounding\n *\n * @return {IShapeBounding}\n */\n getBounding() {\n const boundings = [];\n const bounding = Adapt_1.Bounding.empty();\n if (this.children.length > 0) {\n this.children.forEach(item => boundings.push(item.getBounding()));\n for (let i = 0, len = this.children.length; i < len; i++) {\n bounding.x = bounding.x > boundings[i].x ? boundings[i].x : bounding.x;\n bounding.y = bounding.y > boundings[i].y ? boundings[i].y : bounding.y;\n bounding.width = bounding.width < boundings[i].width ? boundings[i].width : bounding.width;\n bounding.height = bounding.height < boundings[i].height ? boundings[i].height : bounding.height;\n }\n bounding.cx = bounding.x + bounding.width / 2;\n bounding.cy = bounding.y + bounding.height / 2;\n }\n return bounding;\n }\n /**\n * Chear children buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @memberof Group\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.children.forEach(item => item.clearBuffer(bClearIndexed, false));\n if (this.scene && bPropagateToParents) {\n const parents = this.scene.getParentsOfSceneChild(this);\n parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */);\n }\n // if (bPropagateToParents && this.scene)\n // {\n // const parents = this.scene.getParentsOfSceneChild(this)\n // parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, true, false)\n // }\n // if (bPropagateToChildren)\n // {\n // this.children.forEach(sceneChild => sceneChild.clearBuffer(bClearIndexed, false, true))\n // }\n }\n /**\n * Set a single or multiple props\n *\n * @abstract\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @memberof SceneChild\n */\n setProp(key, value) {\n if (typeof key === 'object')\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n else\n this.props[key] = value;\n this.children.forEach(item => item.setProp(key, value));\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @memberof ShapeBase\n */\n setPropUnsafe(key, value) {\n super.setPropUnsafe(key, value);\n this.children.forEach(item => item.setPropUnsafe(key, value));\n }\n /**\n * Return length of buffer\n *\n * @param {IPropArguments} propArguments\n * @returns {number}\n * @memberof Group\n */\n getBufferLength(propArguments) {\n return this.children.map(sceneChild => sceneChild.getBufferLength(propArguments)).reduce((p, c) => p + c, 0);\n }\n /**\n * return a single buffer binded from children\n *\n * @returns {Float32Array}\n * @memberof Group\n */\n getBuffer() {\n const buffers = this.children\n .map(item => item.getBuffer())\n .filter(b => b !== undefined);\n const size = buffers.reduce((currLength, buffer) => currLength + buffer.length, 0);\n if (size > 0) {\n const result = new Float32Array(size);\n result.set(buffers[0], 0);\n for (let i = 1, offset = 0, len = buffers.length; i < len; i++) {\n offset += buffers[i - 1].length;\n result.set(buffers[i], offset);\n }\n return result;\n }\n return ShapeBase_1.ShapeBase.EMPTY_BUFFER;\n }\n /**\n * return a single buffer binded from children\n *\n * @returns {(Array | undefined)}\n * @memberof Group\n */\n getIndexedBuffer() {\n const indexed = this.children.map(item => item.getIndexedBuffer()).filter(b => b !== undefined);\n return [].concat.apply([], indexed);\n }\n /**\n * Call strem on children\n *\n * @param {(streamArguments: IStreamArguments) => void} callback\n * @memberof Group\n */\n stream(callback) {\n this.children.forEach(item => item.stream(callback));\n }\n}\nexports.Group = Group;\n//# sourceMappingURL=Group.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeBase = void 0;\nconst gl_matrix_1 = require(\"gl-matrix\");\nconst types_1 = require(\"../types\");\nconst glme = require(\"../math/gl-matrix-extensions\");\nconst Vec2_1 = require(\"../math/Vec2\");\nconst math_1 = require(\"../math\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst Utilities_1 = require(\"../Utilities\");\nconst SceneChild_1 = require(\"../SceneChild\");\nconst tmpMatrix = gl_matrix_1.mat4.create();\nconst transformMatrix = gl_matrix_1.mat4.create();\nconst perspectiveMatrix = gl_matrix_1.mat4.create();\nconst repetitionMatrix = gl_matrix_1.mat4.create();\n/**\n * Main class for shape generation\n *\n * @category Core.Abstract\n * @abstract\n * @class ShapeBase\n * @order 4\n * @extends {SceneChild}\n */\nclass ShapeBase extends SceneChild_1.SceneChild {\n /**\n * Creates an instance of ShapeBase\n *\n * @param {ISceneChildSettings} [settings={}]\n */\n constructor(settings = {}) {\n super(settings);\n /**\n * Flag used to determine if indexedBuffer has been generated\n *\n * @internal\n * @ignore\n */\n this.bIndexed = false;\n /**\n * Array used for index a vertex buffer\n * only for first level scene children\n *\n * @internal\n * @ignore\n */\n this.indexedBuffer = [];\n /**\n * The bounding inside the scene\n *\n * @type {IShapeBounding}\n */\n this.bounding = {\n cx: 0,\n cy: 0,\n x: -1,\n y: -1,\n width: 2,\n height: 2,\n };\n this.props = {\n distance: settings.distance,\n repetitions: settings.repetitions,\n rotateX: settings.rotateX,\n rotateY: settings.rotateY,\n rotateZ: settings.rotateZ,\n skewX: settings.skewX,\n skewY: settings.skewY,\n squeezeX: settings.squeezeX,\n squeezeY: settings.squeezeY,\n displace: settings.displace,\n translate: settings.translate,\n scale: settings.scale,\n transformOrigin: settings.transformOrigin,\n perspective: settings.perspective,\n perspectiveOrigin: settings.perspectiveOrigin,\n };\n this.anchor =\n settings.anchor && Array.isArray(settings.anchor)\n ? [\n typeof settings.anchor[0] === 'number'\n ? Utilities_1.clamp(-1, 1, settings.anchor[0]) * -1\n : settings.anchor[0] === 'left'\n ? 1\n : settings.anchor[0] === 'right'\n ? -1\n : 0,\n typeof settings.anchor[1] === 'number'\n ? Utilities_1.clamp(-1, 1, settings.anchor[1]) * -1\n : settings.anchor[1] === 'top'\n ? 1\n : settings.anchor[1] === 'bottom'\n ? -1\n : 0,\n ]\n : [0, 0];\n this.boundingType =\n typeof settings.boundingType === 'string'\n ? settings.boundingType === 'relative'\n ? types_1.EBoundingType.Relative\n : types_1.EBoundingType.Fixed\n : settings.boundingType || types_1.EBoundingType.Fixed;\n this.vertexCallback = settings.vertexCallback;\n }\n /**\n * Check if the shape should be generated every time\n *\n * @returns {boolean}\n */\n isStatic() {\n const props = this.props;\n return (typeof props.repetitions !== 'function' &&\n typeof props.distance !== 'function' &&\n typeof props.displace !== 'function' &&\n typeof props.scale !== 'function' &&\n typeof props.translate !== 'function' &&\n typeof props.skewX !== 'function' &&\n typeof props.skewY !== 'function' &&\n typeof props.squeezeX !== 'function' &&\n typeof props.squeezeY !== 'function' &&\n typeof props.rotateX !== 'function' &&\n typeof props.rotateY !== 'function' &&\n typeof props.rotateZ !== 'function' &&\n typeof props.transformOrigin !== 'function' &&\n typeof props.perspective !== 'function' &&\n typeof props.perspectiveOrigin !== 'function');\n }\n /**\n * Check if the indexedBuffer array needs to be recreated every time,\n * this can happen when a shape generates an array of vertices different in length at each repetition\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return typeof this.props.repetitions !== 'function';\n }\n /**\n * Return a prop value\n *\n * @param {keyof ISceneChildProps} key\n * @param {PropArguments} [propArguments]\n * @param {*} [defaultValue]\n * @returns {*}\n */\n getProp(key, propArguments, defaultValue) {\n let attribute = this.props[key];\n if (typeof attribute === 'function') {\n attribute = attribute(propArguments);\n }\n return typeof attribute === 'undefined' || Number.isNaN(attribute) ? defaultValue : attribute;\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @param {boolean} [bClearIndexed=false]\n */\n setProp(key, value, bClearIndexed = false) {\n if (typeof key === 'string') {\n bClearIndexed = bClearIndexed || key == 'repetitions';\n this.props[key] = value;\n }\n else {\n bClearIndexed = bClearIndexed || 'repetitions' in key;\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n }\n this.clearBuffer(bClearIndexed, true);\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.buffer = undefined;\n if (bClearIndexed) {\n this.bIndexed = false;\n this.indexedBuffer = [];\n }\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n if (bPropagateToParents && this.scene && !this.scene.isFirstLevelChild(this)) {\n const parents = this.scene.getParentsOfSceneChild(this);\n parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */);\n }\n }\n /**\n * Update the vertex array if the shape is not static and update the indexedBuffer if it is also not static\n *\n * @param {number} generateId generation id\n * @param {boolean} [bDirectSceneChild=false] adjust shape of center of scene\n * @param {PropArguments} [parentPropArguments]\n */\n generate(generateId = 0, bDirectSceneChild = false, parentPropArguments) {\n var _a, _b;\n if (this.buffer && this.bStatic) {\n return;\n }\n this.generateId = generateId;\n if (!this.bStaticIndexed || !this.bIndexed)\n this.indexedBuffer = [];\n const propArguments = ShapeBase.getEmptyPropArguments(this, parentPropArguments);\n const repetition = propArguments.repetition;\n const repetitions = this.getProp('repetitions', propArguments, 1);\n const repetitionType = Array.isArray(repetitions) ? types_1.ERepetitionType.Matrix : types_1.ERepetitionType.Ring;\n const repetitionCount = Array.isArray(repetitions)\n ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0])\n : repetitions;\n const repetitionRowCount = Array.isArray(repetitions) ? repetitions[0] : repetitionCount;\n const repetitionColCount = Array.isArray(repetitions) ? (_b = repetitions[1]) !== null && _b !== void 0 ? _b : repetitions[0] : 1;\n const rowRepetition = repetition.row;\n rowRepetition.count = repetitionRowCount;\n const colRepetition = repetition.col;\n colRepetition.count = repetitionColCount;\n repetition.count = repetitionCount;\n repetition.col.count = repetitionColCount;\n repetition.row.count = repetitionRowCount;\n repetition.type = repetitionType;\n let totalBufferLength = 0;\n const buffers = [];\n let currentIndex = 0;\n const centerMatrix = gl_matrix_1.vec2.fromValues((repetitionColCount - 1) / 2, (repetitionRowCount - 1) / 2);\n const sceneAnchor = this.scene ? [this.scene.anchor[0], this.scene.anchor[1], 0] : [0, 0, 0];\n const tmpTotalShapeBounding = [undefined, undefined, undefined, undefined];\n const tmpSingleRepetitionBounding = [undefined, undefined, undefined, undefined];\n for (let currentRowRepetition = 0; currentRowRepetition < repetitionRowCount; currentRowRepetition++) {\n for (let currentColRepetition = 0; currentColRepetition < repetitionColCount; currentColRepetition++, currentIndex++) {\n repetition.index = currentIndex + 1;\n repetition.offset = repetitionCount > 1 ? currentIndex / (repetitionCount - 1) : 1;\n repetition.angle = repetitionType === types_1.ERepetitionType.Ring ? (math_1.PI2 / repetitionCount) * currentIndex : 0;\n colRepetition.index = currentColRepetition + 1;\n colRepetition.offset = repetitionColCount > 1 ? currentColRepetition / (repetitionColCount - 1) : 1;\n rowRepetition.index = currentRowRepetition + 1;\n rowRepetition.offset = repetitionRowCount > 1 ? currentRowRepetition / (repetitionRowCount - 1) : 1;\n // Generate primitives buffer recursively\n const buffer = this.generateBuffer(generateId, propArguments);\n const bufferLength = buffer.length;\n const bounding = this.getShapeBounding();\n buffers[currentIndex] = new Float32Array(bufferLength);\n totalBufferLength += bufferLength;\n {\n const distance = glme.toVec2(this.getProp('distance', propArguments, glme.VEC2_ZERO));\n const displace = this.getProp('displace', propArguments, 0);\n const scale = glme.toVec3(this.getProp('scale', propArguments, glme.VEC2_ONE), 1);\n const translate = glme.toVec3(this.getProp('translate', propArguments, glme.VEC2_ZERO), 0);\n const skewX = this.getProp('skewX', propArguments, 0);\n const skewY = this.getProp('skewY', propArguments, 0);\n const squeezeX = this.getProp('squeezeX', propArguments, 0);\n const squeezeY = this.getProp('squeezeY', propArguments, 0);\n const rotateX = this.getProp('rotateX', propArguments, 0);\n const rotateY = this.getProp('rotateY', propArguments, 0);\n const rotateZ = this.getProp('rotateZ', propArguments, 0);\n const perspective = Utilities_1.clamp(0, 1, this.getProp('perspective', propArguments, 0));\n const perspectiveOrigin = glme.toVec3(this.getProp('perspectiveOrigin', propArguments, glme.VEC2_ZERO), 0);\n const transformOrigin = glme.toVec3(this.getProp('transformOrigin', propArguments, glme.VEC2_ZERO), 0);\n let offset;\n switch (repetitionType) {\n case types_1.ERepetitionType.Ring:\n offset = gl_matrix_1.vec3.fromValues(distance[0], 0, 0);\n gl_matrix_1.vec3.rotateZ(offset, offset, glme.VEC3_ZERO, repetition.angle + displace);\n break;\n case types_1.ERepetitionType.Matrix:\n offset = gl_matrix_1.vec3.fromValues(distance[1] * (currentColRepetition - centerMatrix[0]), distance[0] * (currentRowRepetition - centerMatrix[1]), 0);\n break;\n }\n const perspectiveSize = perspective > 0 ? Math.max(bounding.width, bounding.height) / 2 : 1;\n const perspectiveValue = perspective > 0 ? perspectiveSize + (1 - perspective) * (perspectiveSize * 10) : 0;\n const bTransformOrigin = (this.boundingType === types_1.EBoundingType.Relative ? bounding.cx !== 0 || bounding.cy !== 0 : true) ||\n perspective !== 0 ||\n transformOrigin[0] !== 0 ||\n transformOrigin[1] !== 0;\n const bPerspectiveOrigin = perspectiveOrigin[0] !== 0 || perspectiveOrigin[1] !== 0;\n if (bTransformOrigin) {\n if (this.boundingType === types_1.EBoundingType.Relative) {\n transformOrigin[0] = transformOrigin[0] * (bounding.width / 2) + bounding.cx;\n transformOrigin[1] = transformOrigin[1] * (bounding.height / 2) + bounding.cy;\n }\n else {\n transformOrigin[0] *= bounding.width / 2;\n transformOrigin[1] *= bounding.height / 2;\n }\n transformOrigin[2] = perspectiveValue;\n }\n /**\n * Create Matrices\n */\n {\n /**\n * Create Transformation matrix\n */\n gl_matrix_1.mat4.identity(transformMatrix);\n bTransformOrigin && gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, transformOrigin);\n if (translate[0] !== 0 || translate[1] !== 0)\n gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, translate);\n if (skewX !== 0 || skewY !== 0) {\n glme.fromSkew(tmpMatrix, [skewX, skewY]);\n gl_matrix_1.mat4.multiply(transformMatrix, transformMatrix, tmpMatrix);\n }\n rotateX !== 0 && gl_matrix_1.mat4.rotateX(transformMatrix, transformMatrix, rotateX);\n rotateY !== 0 && gl_matrix_1.mat4.rotateY(transformMatrix, transformMatrix, rotateY);\n rotateZ !== 0 && gl_matrix_1.mat4.rotateZ(transformMatrix, transformMatrix, rotateZ);\n if (scale[0] !== 1 || scale[1] !== 1)\n gl_matrix_1.mat4.scale(transformMatrix, transformMatrix, scale);\n bTransformOrigin &&\n gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, gl_matrix_1.vec3.scale(transformOrigin, transformOrigin, -1));\n /**\n * Create Perspective matrix\n */\n if (perspectiveValue > 0) {\n if (bPerspectiveOrigin) {\n if (this.boundingType === types_1.EBoundingType.Relative) {\n perspectiveOrigin[0] = perspectiveOrigin[0] * (bounding.width / 2) + bounding.cx;\n perspectiveOrigin[1] = perspectiveOrigin[1] * (bounding.height / 2) + bounding.cy;\n }\n else {\n perspectiveOrigin[0] *= bounding.width / 2;\n perspectiveOrigin[1] *= bounding.height / 2;\n }\n perspectiveOrigin[2] = 0;\n }\n gl_matrix_1.mat4.perspective(perspectiveMatrix, -Math.PI / 2, 1, 0, Infinity);\n }\n /**\n * Create Repetition matrix\n */\n gl_matrix_1.mat4.identity(repetitionMatrix);\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, offset);\n if (bDirectSceneChild) {\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, sceneAnchor);\n }\n /**\n * Apply anchor\n */\n const shapeAnchor = [this.anchor[0] * (bounding.width / 2), this.anchor[1] * (bounding.height / 2), 0];\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, shapeAnchor);\n if (repetitionType === types_1.ERepetitionType.Ring)\n gl_matrix_1.mat4.rotateZ(repetitionMatrix, repetitionMatrix, repetition.angle + displace);\n }\n Adapt_1.Bounding.clear(tmpSingleRepetitionBounding);\n // Apply matrices on vertex\n for (let bufferIndex = 0; bufferIndex < bufferLength; bufferIndex += 2) {\n const vertex = [buffer[bufferIndex], buffer[bufferIndex + 1], perspectiveValue];\n {\n // Apply squeeze, can be insert into transformMatrix?\n squeezeX !== 0 && Vec2_1.default.squeezeX(vertex, squeezeX);\n squeezeY !== 0 && Vec2_1.default.squeezeY(vertex, squeezeY);\n // Apply transforms\n gl_matrix_1.vec3.transformMat4(vertex, vertex, transformMatrix);\n // Apply perspective\n if (perspectiveValue > 0) {\n bPerspectiveOrigin && gl_matrix_1.vec3.add(vertex, vertex, perspectiveOrigin);\n gl_matrix_1.vec3.transformMat4(vertex, vertex, perspectiveMatrix);\n gl_matrix_1.vec3.scale(vertex, vertex, perspectiveValue);\n bPerspectiveOrigin && gl_matrix_1.vec3.sub(vertex, vertex, perspectiveOrigin);\n }\n // apply repetition matrix\n gl_matrix_1.vec3.transformMat4(vertex, vertex, repetitionMatrix);\n // custom vertex manipulation\n if (typeof this.vertexCallback !== 'undefined') {\n const index = bufferIndex / 2;\n const count = bufferLength / 2;\n const vertexRepetition = {\n index: index + 1,\n count,\n offset: count > 1 ? index / (count - 1) : 1,\n };\n this.vertexCallback(vertex, vertexRepetition, propArguments);\n }\n }\n buffers[currentIndex][bufferIndex] = vertex[0];\n buffers[currentIndex][bufferIndex + 1] = vertex[1];\n Adapt_1.Bounding.add(tmpSingleRepetitionBounding, vertex[0], vertex[1]);\n Adapt_1.Bounding.add(tmpTotalShapeBounding, vertex[0], vertex[1]);\n }\n }\n // Bounding.sum(tmpTotalShapeBounding, tmpSingleRepetitionBounding)\n // After buffer creation, add a frame into indexedBuffer if not static or update bounding\n const singleRepetitionBounding = { cx: 0, cy: 0, x: -1, y: -1, width: 2, height: 2 };\n Adapt_1.Bounding.bind(singleRepetitionBounding, tmpSingleRepetitionBounding);\n if (!this.bStaticIndexed || !this.bIndexed) {\n this.addIndex(bufferLength, repetition, singleRepetitionBounding);\n }\n }\n }\n Adapt_1.Bounding.bind(this.bounding, tmpTotalShapeBounding);\n this.buffer = new Float32Array(totalBufferLength);\n for (let i = 0, offset = 0, len = buffers.length; i < len; offset += buffers[i].length, i++)\n this.buffer.set(buffers[i], offset);\n this.bIndexed = true;\n }\n /**\n * Return current shape (whit repetions) bounding\n *\n * @return {*} {IShapeBounding}\n */\n getBounding() {\n return this.bounding;\n }\n /**\n * Get number of repetitions\n *\n * @returns {number}\n */\n getRepetitionCount() {\n var _a;\n const repetitions = this.getProp('repetitions', undefined, 1);\n return Array.isArray(repetitions) ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) : repetitions;\n }\n /**\n * Return buffer\n *\n * @returns {(Float32Array | undefined)}\n */\n getBuffer() {\n return this.buffer;\n }\n /**\n * Return indexed buffer\n *\n * @returns {(Array> | undefined)}\n */\n getIndexedBuffer() {\n return this.indexedBuffer;\n }\n /**\n * Return number of encapsulation\n *\n * @param {IBufferIndex} index\n * @returns {number}\n */\n static getIndexParentLevel(index) {\n if (typeof index.parent === 'undefined')\n return 0;\n let currentParent = index.parent;\n let currentParentLevel = 1;\n while (typeof currentParent.parent !== 'undefined') {\n currentParentLevel++;\n currentParent = currentParent.parent;\n }\n return currentParentLevel;\n }\n /**\n * Stream buffer\n *\n * @param {(TStreamCallback} callback\n */\n stream(callback) {\n if (this.buffer && this.indexedBuffer) {\n for (let i = 0, j = 0, len = this.indexedBuffer.length; i < len; i++) {\n const currentIndexing = this.indexedBuffer[i];\n callback({\n buffer: this.buffer,\n frameLength: currentIndexing.frameLength,\n frameBufferIndex: j,\n currentIndexing: currentIndexing,\n currentShapeIndex: i,\n totalShapes: len,\n });\n j += currentIndexing.frameLength;\n }\n }\n }\n /**\n * Return empty propArguments\n *\n * @static\n * @param {ShapeBase} shape\n * @return {*} {PropArguments}\n */\n static getEmptyPropArguments(shape, parentPropArguments) {\n const repetition = {\n type: types_1.ERepetitionType.Ring,\n angle: 0,\n index: 1,\n offset: 1,\n count: 1,\n row: { index: 1, offset: 1, count: 1 },\n col: { index: 1, offset: 1, count: 1 },\n };\n return {\n repetition,\n shape,\n parent: parentPropArguments,\n };\n }\n}\nexports.ShapeBase = ShapeBase;\n/**\n * Empty buffer\n *\n * @internal\n * @ignore\n */\nShapeBase.EMPTY_BUFFER = new Float32Array(0);\n/**\n * Empty BaseRepetition\n *\n * @internal\n * @ignore\n */\nShapeBase.getEmptySimpleRepetition = () => ({\n index: 1,\n offset: 1,\n count: 1,\n});\n/**\n * Empty Repetition\n *\n * @internal\n * @ignore\n */\nShapeBase.getEmptyRepetition = () => ({\n type: types_1.ERepetitionType.Ring,\n angle: 0,\n ...ShapeBase.getEmptySimpleRepetition(),\n row: ShapeBase.getEmptySimpleRepetition(),\n col: ShapeBase.getEmptySimpleRepetition(),\n});\n//# sourceMappingURL=ShapeBase.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toVec3 = exports.toVec2 = exports.fromSkew = exports.VEC2_ONE = exports.VEC2_ZERO = exports.VEC3_ONE = exports.VEC3_ZERO = void 0;\nconst gl_matrix_1 = require(\"gl-matrix\");\nexports.VEC3_ZERO = [0, 0, 0];\nexports.VEC3_ONE = [1, 1, 1];\nexports.VEC2_ZERO = [0, 0];\nexports.VEC2_ONE = [1, 1];\ngl_matrix_1.glMatrix.setMatrixArrayType(Array);\n/**\n * Skew matrix\n *\n * @internal\n * @ignore\n */\nfunction fromSkew(out, skew) {\n out[0] = 1;\n out[1] = Math.tan(skew[1]);\n out[2] = 0;\n out[3] = 0;\n out[4] = Math.tan(skew[0]);\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\nexports.fromSkew = fromSkew;\n/**\n * number to vec 2\n *\n * @internal\n * @ignore\n */\nfunction toVec2(x) {\n if (Array.isArray(x))\n return [x[0], x[1]];\n return [x, x];\n}\nexports.toVec2 = toVec2;\n/**\n * number to vec 3\n *\n * @internal\n * @ignore\n */\nfunction toVec3(x, defaultZValue = 0) {\n if (Array.isArray(x)) {\n return [x[0], x[1], defaultZValue];\n }\n return [x, x, defaultZValue];\n}\nexports.toVec3 = toVec3;\n//# sourceMappingURL=gl-matrix-extensions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Temporany matrix\n *\n * @internal\n * @ignore\n */\nconst MATRIX = new Array(4);\n/**\n * Vec2 operation\n *\n * @category Core.Utilities\n */\nconst Vec2 = {\n /**\n * from new vertex\n *\n * @param {Array | number} [x=0]\n * @param {number} [y]\n * @returns {Array}\n */\n from: (x = 0, y) => {\n const out = new Array(2);\n if (typeof x === 'number') {\n out[0] = x;\n out[1] = y !== null && y !== void 0 ? y : x;\n }\n else {\n out[0] = x[0];\n out[1] = x[1];\n }\n return out;\n },\n normalize: (v) => {\n const len = Vec2.length(v);\n return len !== 0 ? [v[0] / len, v[1] / len] : [0, 0];\n },\n /**\n * Distance between two points\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n distance: (a, b) => Math.hypot(a[0] - b[0], a[1] - b[1]),\n /**\n * dot product\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n dot: (a, b) => a[0] * b[0] + a[1] * b[1],\n /**\n * length of point\n *\n * @param {Array} vec\n * @returns {number}\n */\n length: (vec) => Math.hypot(vec[0], vec[1]),\n /**\n * angle between two point\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n angle: (a, b) => {\n a = Vec2.normalize(a);\n b = Vec2.normalize(b);\n return Math.acos(Vec2.dot(a, b));\n },\n /**\n * skewX point\n *\n * @param {Array} vec\n * @param {number} m\n */\n skewX: (vec, m) => {\n vec[0] += Math.tan(m) * vec[1];\n },\n /**\n * skewY point\n *\n * @param {Array} vec\n * @param {number} m\n */\n skewY: (vec, m) => {\n vec[1] += Math.tan(m) * vec[0];\n },\n /**\n * squeezeX point\n *\n * @param {Array} vec\n * @param {number} m\n */\n squeezeX: (vec, m) => {\n vec[1] += vec[1] * (vec[0] * -m);\n },\n /**\n * squeezeY point\n *\n * @param {Array} vec\n * @param {number} m\n */\n squeezeY: (vec, m) => {\n vec[0] += vec[0] * (vec[1] * m);\n },\n /**\n * Rotate point\n *\n * @param {Array} vec\n * @param {Array} MATRIX\n * @param {Array} fromPoint\n * @internal\n */\n rotate: (vec, MATRIX, fromPoint) => {\n const p0 = vec[0] - fromPoint[0];\n const p1 = vec[1] - fromPoint[1];\n vec[0] = p0 * MATRIX[0] + p1 * MATRIX[1] + fromPoint[0];\n vec[1] = p0 * MATRIX[2] + p1 * MATRIX[3] + fromPoint[1];\n },\n /**\n * RotateX point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateX: (vec, fromPoint, rad) => {\n MATRIX[0] = 1;\n MATRIX[1] = 0;\n MATRIX[2] = 0;\n MATRIX[3] = Math.cos(rad);\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * RotateY point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateY: (vec, fromPoint, rad) => {\n MATRIX[0] = Math.cos(rad);\n MATRIX[1] = 0;\n MATRIX[2] = 0;\n MATRIX[3] = 1;\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * RotateZ point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateZ: (vec, fromPoint, rad) => {\n MATRIX[0] = Math.cos(rad);\n MATRIX[1] = -Math.sin(rad);\n MATRIX[2] = Math.sin(rad);\n MATRIX[3] = Math.cos(rad);\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * Translate vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n translate: (vec, to) => {\n vec[0] += to[0];\n vec[1] += to[1];\n },\n /**\n * Scale vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n scale: (vec, to) => {\n vec[0] *= to[0];\n vec[1] *= to[1];\n },\n /**\n * Scale vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n divide: (vec, to) => {\n vec[0] /= to[0];\n vec[1] /= to[1];\n },\n /**\n * Vec to string\n *\n * @param {Array} vec\n * @return {string}\n */\n toString: (vec) => `x: ${vec[0]}, y: ${vec[1]}`,\n /**\n * Vertex [0, 0]\n */\n ZERO: Array.from([0, 0]),\n /**\n * Vertex [1, 1]\n */\n ONE: Array.from([1, 1]),\n};\nexports.default = Vec2;\n//# sourceMappingURL=Vec2.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mod = exports.PHI = exports.PI2 = exports.log = void 0;\n/**\n * Return logarith value and base\n *\n * @category Core.Utilities\n *\n * @param n number\n * @param base number\n */\nconst log = (n, base) => Math.log(n) / Math.log(base);\nexports.log = log;\n/**\n * @category Core.Utilities\n */\nexports.PI2 = Math.PI * 2;\n/**\n * @category Core.Utilities\n */\nexports.PHI = (1 + Math.sqrt(5)) / 2;\n/**\n * Return a positive module of positive or negative value\n *\n * @category Core.Utilities\n *\n * @param value number\n * @param base number\n */\nconst mod = (value, base) => {\n const result = value % base;\n return result < 0 ? result + base : result;\n};\nexports.mod = mod;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Adapt = exports.Bounding = exports.EAdaptMode = void 0;\nconst Modifier_1 = require(\"./Modifier\");\n/**\n *\n *\n * @category Core.Enums\n */\nvar EAdaptMode;\n(function (EAdaptMode) {\n /**\n * The buffer is not changed\n * @order 1\n */\n EAdaptMode[EAdaptMode[\"None\"] = 0] = \"None\";\n /**\n * The buffer is scaled in a range between [-1, -1] and [1,1]\n * @order 2\n */\n EAdaptMode[EAdaptMode[\"Scale\"] = 2] = \"Scale\";\n /**\n * The buffer is scaled in a range between [-1, -1] and [1,1] and is centered\n * @order 3\n */\n EAdaptMode[EAdaptMode[\"Center\"] = 4] = \"Center\";\n /**\n * The buffer is adapted centrally and expanded in a range between [-1, -1] and [1,1]\n * @order 4\n */\n EAdaptMode[EAdaptMode[\"Fill\"] = 8] = \"Fill\";\n})(EAdaptMode = exports.EAdaptMode || (exports.EAdaptMode = {}));\n/**\n * @internal\n * @ignore\n */\nexports.Bounding = {\n empty: () => ({\n cx: 0,\n cy: 0,\n x: -1,\n y: -1,\n width: 2,\n height: 2,\n }),\n clear: (tmpBounding) => {\n tmpBounding[0] = undefined;\n tmpBounding[1] = undefined;\n tmpBounding[2] = undefined;\n tmpBounding[3] = undefined;\n },\n add: (tmpBounding, x, y) => {\n if (typeof tmpBounding[0] === 'undefined' || x < tmpBounding[0])\n tmpBounding[0] = x;\n if (typeof tmpBounding[2] === 'undefined' || x > tmpBounding[2])\n tmpBounding[2] = x;\n if (typeof tmpBounding[1] === 'undefined' || y < tmpBounding[1])\n tmpBounding[1] = y;\n if (typeof tmpBounding[3] === 'undefined' || y > tmpBounding[3])\n tmpBounding[3] = y;\n },\n sum: (dest, bounding) => {\n if (typeof bounding[0] !== 'undefined' &&\n typeof bounding[1] !== 'undefined' &&\n typeof bounding[2] !== 'undefined' &&\n typeof bounding[3] !== 'undefined') {\n if (typeof dest[0] === 'undefined' ||\n typeof dest[1] === 'undefined' ||\n typeof dest[2] === 'undefined' ||\n typeof dest[3] === 'undefined') {\n dest[0] = bounding[0];\n dest[1] = bounding[1];\n dest[2] = bounding[2];\n dest[3] = bounding[3];\n }\n else {\n if (dest[0] < bounding[0])\n dest[0] = bounding[0];\n if (dest[2] > bounding[2])\n dest[2] = bounding[2];\n if (dest[1] < bounding[1])\n dest[1] = bounding[1];\n if (dest[3] > bounding[3])\n dest[3] = bounding[3];\n }\n }\n else {\n console.warn('[Urplfanze:Bounding] cannot sum bounding');\n }\n },\n bind: (bounding, tmpBounding) => {\n if (typeof tmpBounding[0] !== 'undefined' &&\n typeof tmpBounding[1] !== 'undefined' &&\n typeof tmpBounding[2] !== 'undefined' &&\n typeof tmpBounding[3] !== 'undefined') {\n bounding.x = tmpBounding[0];\n bounding.y = tmpBounding[1];\n bounding.width = tmpBounding[2] - tmpBounding[0];\n bounding.height = tmpBounding[3] - tmpBounding[1];\n bounding.cx = bounding.x + bounding.width / 2;\n bounding.cy = bounding.y + bounding.height / 2;\n }\n else {\n console.warn('[Urplfanze:Bounding] cannot bind bounding');\n }\n },\n};\nclass Adapt extends Modifier_1.Modifier {\n constructor(args) {\n super();\n this.mode = args.mode || EAdaptMode.Fill;\n this.rect = args.rect;\n }\n apply(buffer, bClosed) {\n return Adapt.adapt(buffer, this.mode, this.rect);\n }\n /**\n * Return adapted buffer between [-1,-1] and [1,1]\n *\n * @public\n * @static\n * @param {Float32Array} input\n * @param {EAdaptMode} mode\n * @returns {Float32Array}\n * @memberof ShapeBuffer\n */\n static adapt(input, mode, rect) {\n if (mode === EAdaptMode.None)\n return Float32Array.from(input);\n const output = new Float32Array(input.length);\n if (!rect) {\n rect = Adapt.getBounding(input);\n }\n const scale = rect.width >= 2 || rect.height >= 2 || (mode >= EAdaptMode.Fill && (rect.width < 2 || rect.height < 2))\n ? 2 / Math.max(rect.width, rect.height)\n : 1;\n const translateX = mode >= EAdaptMode.Center ? rect.cx : 0;\n const translateY = mode >= EAdaptMode.Center ? rect.cy : 0;\n for (let i = 0, len = input.length; i < len; i += 2) {\n output[i] = (input[i] - translateX) * scale;\n output[i + 1] = (input[i + 1] - translateY) * scale;\n }\n return output;\n }\n /**\n * Get buffer bounding\n *\n * @static\n * @param {Float32Array | Array} buffer\n * @returns {IShapeBounding}\n * @memberof ShapePrimitive\n */\n static getBounding(buffer, bounding) {\n if (typeof bounding === 'undefined')\n bounding = exports.Bounding.empty();\n const tmp_bounding = [undefined, undefined, undefined, undefined];\n for (let i = 0, len = buffer.length; i < len; i += 2) {\n exports.Bounding.add(tmp_bounding, buffer[i], buffer[i + 1]);\n }\n exports.Bounding.bind(bounding, tmp_bounding);\n return bounding;\n }\n}\nexports.Adapt = Adapt;\nAdapt.MODES = EAdaptMode;\n//# sourceMappingURL=Adapt.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Modifier = void 0;\nclass Modifier {\n}\nexports.Modifier = Modifier;\n//# sourceMappingURL=Modifier.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.distributePointsInBuffer = exports.interpolate = exports.prepareBufferForInterpolation = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.relativeClamp = exports.clamp = exports.lerp = exports.toRadians = exports.toDegrees = exports.now = void 0;\nconst SimplexNoise = require(\"simplex-noise\");\nconst repetitions_1 = require(\"./types/repetitions\");\nconst Vec2_1 = require(\"./math/Vec2\");\n// isDef: (object: any): boolean => typeof object !== 'undefined' && object !== null,\nconst measurement = typeof performance !== 'undefined' ? performance : Date;\n/**\n * Get current timestamp in milliseconds\n *\n * @category Utilities\n * @returns {number}\n */\nfunction now() {\n return measurement.now();\n}\nexports.now = now;\n// aOr: (...args: Array): any => {\n// \tfor (let i = 0; i < args.length; i++) if (Utilities.isDef(args[i])) return args[i]\n// },\n/**\n * Convert number from radians to degrees\n *\n * @category Utilities\n *\n * @example\n * ```javascript\n * Urpflanze.toDegrees(Math.PI) // 180\n * ```\n *\n * @param {number} radians\n * @returns {number}\n */\nfunction toDegrees(radians) {\n return (radians * 180) / Math.PI;\n}\nexports.toDegrees = toDegrees;\n/**\n * Convert angle from degrees to radians\n * @example\n * ```javascript\n * Urpflanze.toRadians(180) // 3.141592653589793\n * ```\n *\n * @category Utilities\n * @param {number} degrees\n * @returns {number}\n */\nfunction toRadians(degrees) {\n return (degrees * Math.PI) / 180;\n}\nexports.toRadians = toRadians;\n// perf: (name: string, callback: any, log: boolean = false): number => {\n// \tconst t1 = now()\n// \tcallback()\n// \tconst t2 = now()\n// \tlog && console.log('perf ' + name + ': ' + (t2 - t1))\n// \treturn t2 - t1\n// }\n/**\n * Linear interpolation from `a` when `i` as 0 an `b` when `i' as 1\n *\n * @category Utilities\n * @param {number} a\n * @param {number} b\n * @param {number} i\n * @returns {number}\n */\nfunction lerp(a, b, i) {\n return (1 - i) * a + i * b;\n}\nexports.lerp = lerp;\n/**\n * Return number between min and max\n *\n * @category Utilities\n * @example\n * ```javascript\n * Urpflanze.clamp(0, 1, 1.2) // 1\n * Urpflanze.clamp(0, 1, -2) // 0\n * ```\n * @param {number} min\n * @param {number} max\n * @param {number} value\n * @returns {number}\n */\nfunction clamp(min, max, value) {\n return value <= min ? min : value >= max ? max : value;\n}\nexports.clamp = clamp;\n/**\n * Map number between refMin e refMax from min and max\n *\n * @category Utilities\n *\n * @example\n * ```javascript\n * Urpflanze.relativeClamp(0, 1, 0.5, 100, 200) // 150\n * ```\n *\n * @param {number} refMin\n * @param {number} refMax\n * @param {number} value\n * @param {number} toMin\n * @param {number} toMax\n * @returns {number}\n */\nfunction relativeClamp(refMin, refMax, value, toMin, toMax) {\n return clamp(toMin, toMax, ((value - refMin) / (refMax - refMin)) * (toMax - toMin) + toMin);\n}\nexports.relativeClamp = relativeClamp;\n/**\n * @internal\n * @ignore\n */\nconst noises = {\n random: new SimplexNoise(Math.random),\n};\n/**\n * SimplexNoise\n * Use 'random' as seed property for random seed.\n * Return value between -1 and 1\n *\n * @category Utilities\n *\n * @param {string} [seed='random']\n * @param {number} [x=0]\n * @param {number} [y=0]\n * @param {number} [z=0]\n * @returns {number} between -1 and 1\n */\nfunction noise(seed = 'random', x = 0, y = 0, z = 0) {\n if (typeof noises[seed] === 'undefined') {\n noises[seed] = new SimplexNoise(seed);\n }\n return noises[seed].noise3D(x, y, z);\n}\nexports.noise = noise;\n/**\n * Random number generator\n */\nconst randoms = {};\n/**\n * random number generator\n * @param seed\n * @returns\n */\nfunction random(seed, min = 0, max = 1, decimals) {\n const key = seed + '';\n if (typeof randoms[key] === 'undefined') {\n const seed = xmur3(key);\n randoms[key] = sfc32(seed(), seed(), seed(), seed());\n }\n const value = min + randoms[key]() * (max - min);\n return typeof decimals !== 'undefined' ? Math.round(value * 10 ** decimals) / 10 ** decimals : value;\n}\nexports.random = random;\n/**\n *\n * @internal\n * @param str\n * @returns\n */\nfunction xmur3(str) {\n let i = 0, h = 1779033703 ^ str.length;\n for (; i < str.length; i++)\n (h = Math.imul(h ^ str.charCodeAt(i), 3432918353)), (h = (h << 13) | (h >>> 19));\n return function () {\n h = Math.imul(h ^ (h >>> 16), 2246822507);\n h = Math.imul(h ^ (h >>> 13), 3266489909);\n return (h ^= h >>> 16) >>> 0;\n };\n}\n/**\n * @internal\n * @param a\n * @param b\n * @param c\n * @param d\n * @returns\n */\nfunction sfc32(a, b, c, d) {\n return function () {\n a >>>= 0;\n b >>>= 0;\n c >>>= 0;\n d >>>= 0;\n let t = (a + b) | 0;\n a = b ^ (b >>> 9);\n b = (c + (c << 3)) | 0;\n c = (c << 21) | (c >>> 11);\n d = (d + 1) | 0;\n t = (t + d) | 0;\n c = (c + t) | 0;\n return (t >>> 0) / 4294967296;\n };\n}\n/**\n * Return angle (atan) from offset (or center) for matrix repetition.\n * Offset is array between [-1, -1] and [1, 1].\n * The return value is between -Math.PI / 2 and Math.PI / 2\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter\n * @returns {number} between -Math.PI / 2 and Math.PI / 2\n */\nfunction angleFromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [(repetition.col.count - 1) / 2, (repetition.row.count - 1) / 2];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const x = repetition.col.index - 1 - centerMatrix[0];\n const y = repetition.row.index - 1 - centerMatrix[1];\n return x === 0 ? 0 : Math.atan(y / x);\n }\n return (repetition.angle - Math.PI) / 2;\n}\nexports.angleFromRepetition = angleFromRepetition;\n/**\n * Return angle (atan2, 4 quadrants) from offset (or center) for matrix repetition.\n * Offset is array between [-1, -1] and [1, 1].\n * The return value is between -Math.PI an Math.PI\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter\n * @returns {number} between -Math.PI an Math.PI\n */\nfunction angle2FromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [(repetition.col.count - 1) / 2, (repetition.row.count - 1) / 2];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const x = repetition.col.index - 1 - centerMatrix[0];\n const y = repetition.row.index - 1 - centerMatrix[1];\n return x === 0 ? 0 : Math.atan2(y, x);\n }\n return repetition.angle - Math.PI;\n}\nexports.angle2FromRepetition = angle2FromRepetition;\n/**\n * Return distance from offset (or center) for matrix repetition.\n * The return value is between 0 and 1\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter offset relative to distance prop\n * @returns {number} between 0 and 1\n */\nfunction distanceFromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [0.5, 0.5];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const current = [repetition.col.offset, repetition.row.offset];\n return Vec2_1.default.distance(current, centerMatrix);\n }\n return 1;\n}\nexports.distanceFromRepetition = distanceFromRepetition;\n/// Interpolation\n/**\n *\n * @param from\n * @param to\n * @returns\n */\nfunction prepareBufferForInterpolation(from, to) {\n const fromBufferLength = from.length;\n const toBufferLength = to.length;\n if (fromBufferLength === toBufferLength) {\n return [from, to];\n }\n const maxBufferLength = fromBufferLength > toBufferLength ? fromBufferLength : toBufferLength;\n const difference = Math.abs(fromBufferLength - toBufferLength);\n const minBufferLength = maxBufferLength - difference;\n /////\n const b = fromBufferLength < toBufferLength ? to : from;\n const t = fromBufferLength < toBufferLength ? from : to;\n const a = distributePointsInBuffer(t, Math.floor(difference / 2));\n // a[maxBufferLength - 2] = t[minBufferLength - 2]\n // a[maxBufferLength - 1] = t[minBufferLength - 1]\n return fromBufferLength > toBufferLength ? [b, a] : [a, b];\n}\nexports.prepareBufferForInterpolation = prepareBufferForInterpolation;\n/**\n *\n * @param from\n * @param to\n * @param offset\n * @returns\n */\nfunction interpolate(from, to, initialOffset = 0.5) {\n const [a, b] = prepareBufferForInterpolation(from, to);\n const maxBufferLength = Math.max(a.length, b.length);\n const offset = typeof initialOffset === 'number' ? [initialOffset] : initialOffset;\n const maxPoints = maxBufferLength / 2;\n if (offset.length !== maxPoints) {\n const tl = offset.length;\n for (let i = 0; i < maxPoints; i++) {\n offset[i] = offset[i % tl];\n }\n }\n ////\n const result = new Float32Array(maxBufferLength);\n for (let i = 0, off = 0; i < maxBufferLength; i += 2, off++) {\n result[i] = (1 - offset[off]) * a[i] + offset[off] * b[i];\n result[i + 1] = (1 - offset[off]) * a[i + 1] + offset[off] * b[i + 1];\n }\n return result;\n}\nexports.interpolate = interpolate;\nfunction distributePointsInBuffer(buffer, count) {\n const bufferLen = buffer.length;\n const pointsLen = bufferLen / 2;\n const finalBufferLength = (pointsLen + count) * 2;\n const edges = pointsLen - 1;\n if (edges > 1) {\n const lastPoint = bufferLen - 2;\n const newPointsOnEdge = Math.floor(count / edges);\n const bufferWithPointsEveryEdge = bufferLen + newPointsOnEdge * lastPoint;\n let remainingPoints = (finalBufferLength - bufferWithPointsEveryEdge) / 2;\n const edgeRemainingIndex = Math.round(edges / remainingPoints);\n const result = new Float32Array(finalBufferLength);\n for (let i = 0, edgeIndex = 0, r = 0; i < lastPoint; i += 2, edgeIndex++, r += 2) {\n const ax = buffer[i];\n const ay = buffer[i + 1];\n const bx = buffer[i + 2];\n const by = buffer[i + 3];\n result[r] = ax;\n result[r + 1] = ay;\n const addReminingPoints = remainingPoints > 0 && (edgeIndex % edgeRemainingIndex === 0 || i === lastPoint - 2);\n const currentPointsOnEdge = newPointsOnEdge + (addReminingPoints ? 1 : 0);\n const newPointOffset = 1 / (currentPointsOnEdge + 1);\n for (let h = 0; h < currentPointsOnEdge; h++, r += 2) {\n const o = newPointOffset * (h + 1);\n result[r + 2] = (1 - o) * ax + o * bx;\n result[r + 3] = (1 - o) * ay + o * by;\n }\n if (addReminingPoints) {\n remainingPoints--;\n }\n }\n result[finalBufferLength - 2] = buffer[bufferLen - 2];\n result[finalBufferLength - 1] = buffer[bufferLen - 1];\n return result;\n }\n const result = new Float32Array(finalBufferLength);\n for (let i = 0; i < finalBufferLength; i += 2) {\n result[i] = buffer[i % bufferLen];\n result[i + 1] = buffer[(i + 1) % bufferLen];\n }\n return result;\n}\nexports.distributePointsInBuffer = distributePointsInBuffer;\n//# sourceMappingURL=Utilities.js.map","/*\n * A fast javascript implementation of simplex noise by Jonas Wagner\n\nBased on a speed-improved simplex noise algorithm for 2D, 3D and 4D in Java.\nWhich is based on example code by Stefan Gustavson (stegu@itn.liu.se).\nWith Optimisations by Peter Eastman (peastman@drizzle.stanford.edu).\nBetter rank ordering method by Stefan Gustavson in 2012.\n\n\n Copyright (c) 2018 Jonas Wagner\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n(function() {\n 'use strict';\n\n var F2 = 0.5 * (Math.sqrt(3.0) - 1.0);\n var G2 = (3.0 - Math.sqrt(3.0)) / 6.0;\n var F3 = 1.0 / 3.0;\n var G3 = 1.0 / 6.0;\n var F4 = (Math.sqrt(5.0) - 1.0) / 4.0;\n var G4 = (5.0 - Math.sqrt(5.0)) / 20.0;\n\n function SimplexNoise(randomOrSeed) {\n var random;\n if (typeof randomOrSeed == 'function') {\n random = randomOrSeed;\n }\n else if (randomOrSeed) {\n random = alea(randomOrSeed);\n } else {\n random = Math.random;\n }\n this.p = buildPermutationTable(random);\n this.perm = new Uint8Array(512);\n this.permMod12 = new Uint8Array(512);\n for (var i = 0; i < 512; i++) {\n this.perm[i] = this.p[i & 255];\n this.permMod12[i] = this.perm[i] % 12;\n }\n\n }\n SimplexNoise.prototype = {\n grad3: new Float32Array([1, 1, 0,\n -1, 1, 0,\n 1, -1, 0,\n\n -1, -1, 0,\n 1, 0, 1,\n -1, 0, 1,\n\n 1, 0, -1,\n -1, 0, -1,\n 0, 1, 1,\n\n 0, -1, 1,\n 0, 1, -1,\n 0, -1, -1]),\n grad4: new Float32Array([0, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1,\n 0, -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1,\n 1, 0, 1, 1, 1, 0, 1, -1, 1, 0, -1, 1, 1, 0, -1, -1,\n -1, 0, 1, 1, -1, 0, 1, -1, -1, 0, -1, 1, -1, 0, -1, -1,\n 1, 1, 0, 1, 1, 1, 0, -1, 1, -1, 0, 1, 1, -1, 0, -1,\n -1, 1, 0, 1, -1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, -1,\n 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0,\n -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1, 0]),\n noise2D: function(xin, yin) {\n var permMod12 = this.permMod12;\n var perm = this.perm;\n var grad3 = this.grad3;\n var n0 = 0; // Noise contributions from the three corners\n var n1 = 0;\n var n2 = 0;\n // Skew the input space to determine which simplex cell we're in\n var s = (xin + yin) * F2; // Hairy factor for 2D\n var i = Math.floor(xin + s);\n var j = Math.floor(yin + s);\n var t = (i + j) * G2;\n var X0 = i - t; // Unskew the cell origin back to (x,y) space\n var Y0 = j - t;\n var x0 = xin - X0; // The x,y distances from the cell origin\n var y0 = yin - Y0;\n // For the 2D case, the simplex shape is an equilateral triangle.\n // Determine which simplex we are in.\n var i1, j1; // Offsets for second (middle) corner of simplex in (i,j) coords\n if (x0 > y0) {\n i1 = 1;\n j1 = 0;\n } // lower triangle, XY order: (0,0)->(1,0)->(1,1)\n else {\n i1 = 0;\n j1 = 1;\n } // upper triangle, YX order: (0,0)->(0,1)->(1,1)\n // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and\n // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where\n // c = (3-sqrt(3))/6\n var x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords\n var y1 = y0 - j1 + G2;\n var x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords\n var y2 = y0 - 1.0 + 2.0 * G2;\n // Work out the hashed gradient indices of the three simplex corners\n var ii = i & 255;\n var jj = j & 255;\n // Calculate the contribution from the three corners\n var t0 = 0.5 - x0 * x0 - y0 * y0;\n if (t0 >= 0) {\n var gi0 = permMod12[ii + perm[jj]] * 3;\n t0 *= t0;\n n0 = t0 * t0 * (grad3[gi0] * x0 + grad3[gi0 + 1] * y0); // (x,y) of grad3 used for 2D gradient\n }\n var t1 = 0.5 - x1 * x1 - y1 * y1;\n if (t1 >= 0) {\n var gi1 = permMod12[ii + i1 + perm[jj + j1]] * 3;\n t1 *= t1;\n n1 = t1 * t1 * (grad3[gi1] * x1 + grad3[gi1 + 1] * y1);\n }\n var t2 = 0.5 - x2 * x2 - y2 * y2;\n if (t2 >= 0) {\n var gi2 = permMod12[ii + 1 + perm[jj + 1]] * 3;\n t2 *= t2;\n n2 = t2 * t2 * (grad3[gi2] * x2 + grad3[gi2 + 1] * y2);\n }\n // Add contributions from each corner to get the final noise value.\n // The result is scaled to return values in the interval [-1,1].\n return 70.0 * (n0 + n1 + n2);\n },\n // 3D simplex noise\n noise3D: function(xin, yin, zin) {\n var permMod12 = this.permMod12;\n var perm = this.perm;\n var grad3 = this.grad3;\n var n0, n1, n2, n3; // Noise contributions from the four corners\n // Skew the input space to determine which simplex cell we're in\n var s = (xin + yin + zin) * F3; // Very nice and simple skew factor for 3D\n var i = Math.floor(xin + s);\n var j = Math.floor(yin + s);\n var k = Math.floor(zin + s);\n var t = (i + j + k) * G3;\n var X0 = i - t; // Unskew the cell origin back to (x,y,z) space\n var Y0 = j - t;\n var Z0 = k - t;\n var x0 = xin - X0; // The x,y,z distances from the cell origin\n var y0 = yin - Y0;\n var z0 = zin - Z0;\n // For the 3D case, the simplex shape is a slightly irregular tetrahedron.\n // Determine which simplex we are in.\n var i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords\n var i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords\n if (x0 >= y0) {\n if (y0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 1;\n k2 = 0;\n } // X Y Z order\n else if (x0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n } // X Z Y order\n else {\n i1 = 0;\n j1 = 0;\n k1 = 1;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n } // Z X Y order\n }\n else { // x0 y0) rankx++;\n else ranky++;\n if (x0 > z0) rankx++;\n else rankz++;\n if (x0 > w0) rankx++;\n else rankw++;\n if (y0 > z0) ranky++;\n else rankz++;\n if (y0 > w0) ranky++;\n else rankw++;\n if (z0 > w0) rankz++;\n else rankw++;\n var i1, j1, k1, l1; // The integer offsets for the second simplex corner\n var i2, j2, k2, l2; // The integer offsets for the third simplex corner\n var i3, j3, k3, l3; // The integer offsets for the fourth simplex corner\n // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order.\n // Many values of c will never occur, since e.g. x>y>z>w makes x= 3 ? 1 : 0;\n j1 = ranky >= 3 ? 1 : 0;\n k1 = rankz >= 3 ? 1 : 0;\n l1 = rankw >= 3 ? 1 : 0;\n // Rank 2 denotes the second largest coordinate.\n i2 = rankx >= 2 ? 1 : 0;\n j2 = ranky >= 2 ? 1 : 0;\n k2 = rankz >= 2 ? 1 : 0;\n l2 = rankw >= 2 ? 1 : 0;\n // Rank 1 denotes the second smallest coordinate.\n i3 = rankx >= 1 ? 1 : 0;\n j3 = ranky >= 1 ? 1 : 0;\n k3 = rankz >= 1 ? 1 : 0;\n l3 = rankw >= 1 ? 1 : 0;\n // The fifth corner has all coordinate offsets = 1, so no need to compute that.\n var x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords\n var y1 = y0 - j1 + G4;\n var z1 = z0 - k1 + G4;\n var w1 = w0 - l1 + G4;\n var x2 = x0 - i2 + 2.0 * G4; // Offsets for third corner in (x,y,z,w) coords\n var y2 = y0 - j2 + 2.0 * G4;\n var z2 = z0 - k2 + 2.0 * G4;\n var w2 = w0 - l2 + 2.0 * G4;\n var x3 = x0 - i3 + 3.0 * G4; // Offsets for fourth corner in (x,y,z,w) coords\n var y3 = y0 - j3 + 3.0 * G4;\n var z3 = z0 - k3 + 3.0 * G4;\n var w3 = w0 - l3 + 3.0 * G4;\n var x4 = x0 - 1.0 + 4.0 * G4; // Offsets for last corner in (x,y,z,w) coords\n var y4 = y0 - 1.0 + 4.0 * G4;\n var z4 = z0 - 1.0 + 4.0 * G4;\n var w4 = w0 - 1.0 + 4.0 * G4;\n // Work out the hashed gradient indices of the five simplex corners\n var ii = i & 255;\n var jj = j & 255;\n var kk = k & 255;\n var ll = l & 255;\n // Calculate the contribution from the five corners\n var t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0;\n if (t0 < 0) n0 = 0.0;\n else {\n var gi0 = (perm[ii + perm[jj + perm[kk + perm[ll]]]] % 32) * 4;\n t0 *= t0;\n n0 = t0 * t0 * (grad4[gi0] * x0 + grad4[gi0 + 1] * y0 + grad4[gi0 + 2] * z0 + grad4[gi0 + 3] * w0);\n }\n var t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1;\n if (t1 < 0) n1 = 0.0;\n else {\n var gi1 = (perm[ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]]] % 32) * 4;\n t1 *= t1;\n n1 = t1 * t1 * (grad4[gi1] * x1 + grad4[gi1 + 1] * y1 + grad4[gi1 + 2] * z1 + grad4[gi1 + 3] * w1);\n }\n var t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2;\n if (t2 < 0) n2 = 0.0;\n else {\n var gi2 = (perm[ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]]] % 32) * 4;\n t2 *= t2;\n n2 = t2 * t2 * (grad4[gi2] * x2 + grad4[gi2 + 1] * y2 + grad4[gi2 + 2] * z2 + grad4[gi2 + 3] * w2);\n }\n var t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3;\n if (t3 < 0) n3 = 0.0;\n else {\n var gi3 = (perm[ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]]] % 32) * 4;\n t3 *= t3;\n n3 = t3 * t3 * (grad4[gi3] * x3 + grad4[gi3 + 1] * y3 + grad4[gi3 + 2] * z3 + grad4[gi3 + 3] * w3);\n }\n var t4 = 0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4;\n if (t4 < 0) n4 = 0.0;\n else {\n var gi4 = (perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32) * 4;\n t4 *= t4;\n n4 = t4 * t4 * (grad4[gi4] * x4 + grad4[gi4 + 1] * y4 + grad4[gi4 + 2] * z4 + grad4[gi4 + 3] * w4);\n }\n // Sum up and scale the result to cover the range [-1,1]\n return 27.0 * (n0 + n1 + n2 + n3 + n4);\n }\n };\n\n function buildPermutationTable(random) {\n var i;\n var p = new Uint8Array(256);\n for (i = 0; i < 256; i++) {\n p[i] = i;\n }\n for (i = 0; i < 255; i++) {\n var r = i + ~~(random() * (256 - i));\n var aux = p[i];\n p[i] = p[r];\n p[r] = aux;\n }\n return p;\n }\n SimplexNoise._buildPermutationTable = buildPermutationTable;\n\n function alea() {\n // Johannes Baagøe , 2010\n var s0 = 0;\n var s1 = 0;\n var s2 = 0;\n var c = 1;\n\n var mash = masher();\n s0 = mash(' ');\n s1 = mash(' ');\n s2 = mash(' ');\n\n for (var i = 0; i < arguments.length; i++) {\n s0 -= mash(arguments[i]);\n if (s0 < 0) {\n s0 += 1;\n }\n s1 -= mash(arguments[i]);\n if (s1 < 0) {\n s1 += 1;\n }\n s2 -= mash(arguments[i]);\n if (s2 < 0) {\n s2 += 1;\n }\n }\n mash = null;\n return function() {\n var t = 2091639 * s0 + c * 2.3283064365386963e-10; // 2^-32\n s0 = s1;\n s1 = s2;\n return s2 = t - (c = t | 0);\n };\n }\n function masher() {\n var n = 0xefc8249d;\n return function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n }\n\n // amd\n if (typeof define !== 'undefined' && define.amd) define(function() {return SimplexNoise;});\n // common js\n if (typeof exports !== 'undefined') exports.SimplexNoise = SimplexNoise;\n // browser\n else if (typeof window !== 'undefined') window.SimplexNoise = SimplexNoise;\n // nodejs\n if (typeof module !== 'undefined') {\n module.exports = SimplexNoise;\n }\n\n})();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Shape = void 0;\nconst Scene_1 = require(\"../Scene\");\nconst SceneChild_1 = require(\"../SceneChild\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\n/**\n * Container of ShapeBase or Group, it applies transformations on each repetition\n *\n * @category Core.Shapes\n */\nclass Shape extends ShapeBase_1.ShapeBase {\n /**\n * Creates an instance of Shape.\n *\n * @param {ShapeSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'Shape';\n super(settings);\n if (settings.shape instanceof SceneChild_1.SceneChild) {\n this.shape = settings.shape;\n }\n else {\n console.warn(\"[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\\nYou passed:\", settings.shape);\n }\n this.shapeUseParent = !!settings.shapeUseParent;\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n */\n isStatic() {\n // return super.isStatic() && !this.shapeUseParent\n return super.isStatic() && (this.shape ? this.shape.isStatic() : true);\n }\n /**\n * Check if shape has static index\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return super.isStaticIndexed() && (this.shape ? this.shape.isStaticIndexed() : true);\n }\n /**\n * Find shape by id or name\n *\n * @param {number | string} idOrName\n * @returns {(SceneChild | null)}\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n if (this.shape)\n return this.shape.find(idOrName);\n return null;\n }\n /**\n * Return length of buffer\n *\n * @param {PropArguments} propArguments\n * @returns {number}\n */\n getBufferLength(propArguments) {\n if (this.bStatic && this.buffer && this.buffer.length > 0)\n return this.buffer.length;\n const childBufferLength = this.shape ? this.shape.getBufferLength(propArguments) : 0;\n return childBufferLength * this.getRepetitionCount();\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape) {\n if (this.shapeUseParent || this.shape.generateId !== generateId) {\n if (this.shapeUseParent) {\n this.shape.clearBuffer(true, false);\n }\n this.shape.generate(generateId, false, propArguments);\n }\n return this.shape.getBuffer();\n }\n return Shape.EMPTY_BUFFER;\n }\n /**\n * Return bounding\n *\n * @param {boolean} bDirectSceneChild\n * @returns {IShapeBounding}\n */\n getShapeBounding() {\n if (this.shape) {\n return this.shape.getBounding();\n }\n return this.bounding; // empty bounding defined in ShapeBase\n }\n /**\n * Add to indexed buffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n const parentBufferIndex = {\n shape: this,\n frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n };\n for (let i = 0, len = childIndexedBuffer.length; i < len; i++) {\n const currentIndexed = { ...childIndexedBuffer[i] };\n const parent = currentIndexed.parent\n ? Shape.setIndexedParent(currentIndexed.parent, parentBufferIndex)\n : parentBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n }\n }\n }\n /**\n * Set parent of indexed\n *\n * @static\n * @param {(IBufferIndex )} current\n * @param {IBufferIndex} parent\n * @returns {(IBufferIndex )}\n */\n static setIndexedParent(current, parent) {\n const index = {\n ...current,\n };\n index.parent = current.parent ? Shape.setIndexedParent(current.parent, parent) : parent;\n return index;\n }\n /**\n * Set shape\n *\n * @param {(SceneChild | undefined)} [shape]\n */\n setShape(shape) {\n if (typeof shape === 'undefined') {\n this.shape = undefined;\n this.clearBuffer(true, true);\n }\n else {\n this.scene && Scene_1.Scene.propagateToChilden(shape, this.scene);\n this.shape = shape;\n this.shape.clearBuffer(true, true);\n }\n }\n}\nexports.Shape = Shape;\n//# sourceMappingURL=Shape.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapePrimitive = void 0;\nconst glme = require(\"../math/gl-matrix-extensions\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\nconst Modifier_1 = require(\"../modifiers/Modifier\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\n/**\n * @category Core.Abstract\n */\nclass ShapePrimitive extends ShapeBase_1.ShapeBase {\n /**\n * Creates an instance of ShapePrimitive.\n *\n * @param {IShapePrimitiveSettings} [settings={}]\n */\n constructor(settings = {}) {\n var _a;\n super(settings);\n /**\n * Contain the bounding of the last generated buffer\n *\n * @type {IShapeBounding}\n */\n this.currentGenerationPrimitiveBounding = Adapt_1.Bounding.empty();\n this.props.sideLength =\n typeof settings.sideLength === 'undefined'\n ? undefined\n : typeof settings.sideLength === 'function'\n ? settings.sideLength\n : glme.toVec2(settings.sideLength);\n this.drawer = settings.drawer || {};\n this.modifiers = settings.modifiers;\n this.bClosed = (_a = settings.bClosed) !== null && _a !== void 0 ? _a : true;\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n * @memberof ShapePrimitive\n */\n isStatic() {\n return typeof this.props.sideLength !== 'function' && super.isStatic();\n }\n /**\n * Return sideLength for current repetition\n *\n * @param propArguments\n * @returns\n */\n getRepetitionSideLength(propArguments) {\n if (this.bStatic) {\n // not set default value into constructor because it can be overridden by group\n if (typeof this.props.sideLength === 'undefined') {\n this.props.sideLength = [50, 50];\n }\n else if (typeof this.props.sideLength === 'number') {\n this.props.sideLength = [this.props.sideLength, this.props.sideLength];\n }\n return this.props.sideLength;\n }\n return glme.toVec2(this.getProp('sideLength', propArguments, [50, 50]));\n }\n /**\n * Apply modifiers on single repetition buffer\n *\n * @param buffer\n * @returns\n */\n applyModifiers(buffer, propArguments) {\n if (typeof this.modifiers === 'undefined')\n return buffer;\n let modified = buffer;\n const modifiers = Array.isArray(this.modifiers) ? this.modifiers : [this.modifiers];\n for (let i = 0, len = modifiers.length; i < len; i++) {\n const modifier = modifiers[i] instanceof Modifier_1.Modifier\n ? modifiers[i]\n : modifiers[i](propArguments);\n //@ts-ignore\n modified = modifier.apply(modified, this.bClosed, this);\n }\n return modified;\n }\n /**\n * Return a bounding of generated buffer if is direct scene child\n *\n * @returns {IShapeBounding}\n * @memberof ShapePrimitive\n */\n getShapeBounding() {\n return this.currentGenerationPrimitiveBounding;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n const index = {\n shape: this,\n frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n };\n this.indexedBuffer.push(index);\n }\n /**\n * Return bClosed\n *\n * @returns {boolean}\n * @memberof ShapePrimitive\n */\n isClosed() {\n return this.bClosed;\n }\n /**\n * Set bClosed\n *\n * @param {boolean} bClosed\n * @memberof ShapePrimitive\n */\n setClosed(bClosed) {\n this.bClosed = bClosed;\n }\n}\nexports.ShapePrimitive = ShapePrimitive;\n//# sourceMappingURL=ShapePrimitive.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeLoop = void 0;\nconst math_1 = require(\"../math\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst ShapePrimitive_1 = require(\"../shapes/ShapePrimitive\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\n/**\n * Shape Loop\n *\n * @category Core.Shapes\n * @public\n * @class ShapeLoop\n * @extends {ShapePrimitive}\n */\nclass ShapeLoop extends ShapePrimitive_1.ShapePrimitive {\n /**\n * Creates an instance of ShapeLoop.\n *\n * @param {IShapeLoopSettings} [settings={}]\n * @param {boolean} [bPreventGeneration=false]\n */\n constructor(settings = {}, bPreventGeneration = false) {\n settings.type = settings.type || 'ShapeLoop';\n super(settings);\n this.loopDependencies = (settings.loopDependencies || []).concat('sideLength');\n this.props.loop = settings.loop;\n if (!bPreventGeneration) {\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: math_1.PI2 / 10,\n vertex: () => [0, 0],\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n }\n /**\n * Check if currentOrSingleLoopBuffer is static\n *\n * @returns {boolean}\n */\n isStaticLoop() {\n if (this.loopDependencies.includes('propArguments'))\n return false;\n for (let i = 0, len = this.loopDependencies.length; i < len; i++)\n if (typeof this.props[this.loopDependencies[i]] === 'function')\n return false;\n return true;\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n */\n isStatic() {\n return this.bStaticLoop && super.isStatic();\n }\n /**\n * Check if shape has static indexed\n * The number of vertices is defined by number of loop iteration\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n // return this.bStaticLoop && super.isStaticIndexed()\n return (super.isStaticIndexed() &&\n (typeof this.props.loop !== 'undefined'\n ? typeof this.props.loop.start !== 'function' &&\n typeof this.props.loop.end !== 'function' &&\n typeof this.props.loop.inc !== 'function'\n : true));\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.bStaticLoop = this.isStaticLoop();\n if (bClearIndexed) {\n this.currentOrSingleLoopBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n * Set single or multiple props\n *\n * @param {(Props)} key\n * @param {*} [value]\n * @param {boolean} [bClearIndexed=false]\n */\n setProp(key, value) {\n let bClearIndexed = false;\n const keys = (typeof key === 'string' ? { [key]: value } : key);\n for (let i = this.loopDependencies.length - 1; i >= 0; i--) {\n if (this.loopDependencies[i] in keys) {\n // this.props.loop = undefined\n bClearIndexed = true;\n break;\n }\n }\n if ('loop' in keys) {\n keys.loop = { ...this.props.loop, ...keys.loop };\n bClearIndexed = true;\n }\n super.setProp(keys, value, bClearIndexed);\n }\n /**\n * Return length of buffer\n *\n * @param {PropArguments} [propArguments]\n * @returns {number}\n */\n getBufferLength(propArguments) {\n if (this.bStatic && typeof this.buffer !== 'undefined')\n return this.buffer.length;\n if (this.bStaticLoop && typeof this.currentOrSingleLoopBuffer !== 'undefined')\n return this.currentOrSingleLoopBuffer.length * this.getRepetitionCount();\n const { count } = this.getLoop(propArguments || ShapeBase_1.ShapeBase.getEmptyPropArguments(this));\n return this.getRepetitionCount() * count * 2;\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (!this.bStaticLoop)\n return this.generateLoopBuffer(propArguments);\n if (typeof this.props.sideLength === 'function' || typeof this.currentOrSingleLoopBuffer === 'undefined')\n this.currentOrSingleLoopBuffer = this.generateLoopBuffer(propArguments);\n return this.currentOrSingleLoopBuffer;\n }\n /**\n * Generate loop buffer\n *\n * @protected\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateLoopBuffer(propArguments) {\n const { start, inc, /*end,*/ count } = this.getLoop(propArguments);\n const sideLength = this.getRepetitionSideLength(propArguments);\n const getVertex = (this.props.loop && this.props.loop.vertex ? this.props.loop.vertex : this.loop.vertex);\n const shapeLoop = {\n index: 0,\n offset: 0,\n current: 0,\n count: count,\n };\n const vertexLength = shapeLoop.count;\n const bufferLength = vertexLength * 2;\n const currentOrSingleLoopBuffer = new Float32Array(bufferLength);\n for (let i = 0, j = 0; i < vertexLength; i++, j += 2) {\n const current = start + inc * i;\n const offset = shapeLoop.count > 1 ? i / (shapeLoop.count - 1) : 1;\n // const angle = (end - start) * offset + start\n shapeLoop.current = current;\n shapeLoop.index = i + 1;\n shapeLoop.offset = offset;\n const vertex = getVertex(shapeLoop, propArguments);\n currentOrSingleLoopBuffer[j] = vertex[0];\n currentOrSingleLoopBuffer[j + 1] = vertex[1];\n // currentOrSingleLoopBuffer[j] *= sideLength[0]\n // currentOrSingleLoopBuffer[j + 1] *= sideLength[1]\n // Bounding.add(tmpBounding, currentOrSingleLoopBuffer[j], currentOrSingleLoopBuffer[j + 1])\n }\n const tmpBounding = [undefined, undefined, undefined, undefined];\n const buffer = this.applyModifiers(currentOrSingleLoopBuffer, propArguments);\n for (let i = 0, len = buffer.length; i < len; i += 2) {\n buffer[i] = buffer[i] * sideLength[0];\n buffer[i + 1] = buffer[i + 1] * sideLength[1];\n Adapt_1.Bounding.add(tmpBounding, buffer[i], buffer[i + 1]);\n }\n Adapt_1.Bounding.bind(this.currentGenerationPrimitiveBounding, tmpBounding);\n return buffer;\n }\n /**\n * Return information about a client loop gnerator\n *\n * @public\n * @param {PropArguments} propArguments\n * @returns {ShapeLoopInformation}\n */\n getLoop(propArguments) {\n var _a, _b, _c, _d, _e, _f;\n let start = (_b = (_a = this.props.loop) === null || _a === void 0 ? void 0 : _a.start) !== null && _b !== void 0 ? _b : this.loop.start;\n let end = (_d = (_c = this.props.loop) === null || _c === void 0 ? void 0 : _c.end) !== null && _d !== void 0 ? _d : this.loop.end;\n let inc = (_f = (_e = this.props.loop) === null || _e === void 0 ? void 0 : _e.inc) !== null && _f !== void 0 ? _f : this.loop.inc;\n start = (typeof start === 'function' ? start(propArguments) : start);\n end = (typeof end === 'function' ? end(propArguments) : end);\n inc = (typeof inc === 'function' ? inc(propArguments) : inc);\n const count = Math.ceil((end - start) / inc);\n return { start, end, inc, count: count <= 0 ? 0 : count };\n }\n /**\n * Set shape from loop generator\n *\n * @param {(IShapeLoopGenerator)} [shape]\n */\n setShape(loop) {\n this.setProp('loop', loop);\n }\n /**\n * Get static buffer\n *\n * @param sideLength\n * @returns\n */\n static getBuffer(props) {\n const shape = new this({ ...props, sideLength: props.sideLength || 1 });\n shape.generate();\n return shape.getBuffer() || new Float32Array();\n }\n}\nexports.ShapeLoop = ShapeLoop;\nShapeLoop.PId2 = Math.PI / 2;\n//# sourceMappingURL=ShapeLoop.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeBuffer = void 0;\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst ShapePrimitive_1 = require(\"../shapes/ShapePrimitive\");\n/**\n * @category Core.Shapes\n */\nclass ShapeBuffer extends ShapePrimitive_1.ShapePrimitive {\n /**\n * Creates an instance of ShapeBuffer.\n *\n * @param {IShapeBufferSettings} [settings={}]\n */\n constructor(settings = {}) {\n var _a, _b;\n settings.type = settings.type || 'ShapeBuffer';\n settings.adaptMode = (_a = settings.adaptMode) !== null && _a !== void 0 ? _a : Adapt_1.EAdaptMode.Scale;\n super(settings);\n this.adaptMode = (_b = settings.adaptMode) !== null && _b !== void 0 ? _b : Adapt_1.EAdaptMode.Fill;\n if (typeof settings.shape === 'undefined') {\n console.warn('[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property');\n this.shape = ShapeBuffer.EMPTY_BUFFER;\n }\n else {\n this.shape = typeof settings.shape !== 'function' ? Adapt_1.Adapt.adapt(settings.shape, this.adaptMode) : settings.shape;\n }\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n /**\n * Check shape is static\n *\n * @returns boolean\n */\n isStatic() {\n return typeof this.shape !== 'function' && super.isStatic();\n }\n /**\n * Check shape is static indexed\n *\n * @returns boolean\n */\n isStaticIndexed() {\n return typeof this.shape !== 'function' && super.isStaticIndexed();\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n this.shapeBuffer = undefined;\n }\n /**\n * Apply sideLength on .shape buffer and calculate bounding\n *\n * @protected\n */\n bindBuffer(propArguments) {\n const sideLength = this.getRepetitionSideLength(propArguments);\n const shapeBuffer = this.applyModifiers(Float32Array.from(typeof this.shape === 'function' ? this.shape(propArguments) : this.shape), propArguments);\n const tmpBounding = [undefined, undefined, undefined, undefined];\n for (let i = 0, len = shapeBuffer.length; i < len; i += 2) {\n shapeBuffer[i] = shapeBuffer[i] * sideLength[0];\n shapeBuffer[i + 1] = shapeBuffer[i + 1] * sideLength[1];\n Adapt_1.Bounding.add(tmpBounding, shapeBuffer[i], shapeBuffer[i + 1]);\n }\n Adapt_1.Bounding.bind(this.currentGenerationPrimitiveBounding, tmpBounding);\n this.shapeBuffer = shapeBuffer;\n }\n /**\n * Return length of buffer\n *\n * @param {IPropArguments} propArguments\n * @returns {number}\n */\n getBufferLength( /*propArguments?: IPropArguments*/) {\n if (this.buffer && this.buffer.length > 0)\n return this.buffer.length;\n return this.shape.length * this.getRepetitionCount();\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (typeof this.shapeBuffer === 'undefined' ||\n typeof this.props.sideLength === 'function' ||\n typeof this.shape === 'function') {\n this.bindBuffer(propArguments);\n }\n return this.shapeBuffer;\n }\n /**\n * Set shape\n *\n * @param {(Float32Array)} [shape]\n */\n setShape(shape) {\n this.shape = Adapt_1.Adapt.adapt(shape, this.adaptMode);\n this.clearBuffer(true);\n }\n /**\n * Return adaptMode\n *\n * @returns {EAdaptMode}\n * @memberof ShapeBase\n */\n getAdaptMode() {\n return this.adaptMode;\n }\n /**\n * Get static buffer\n *\n * @param sideLength\n * @returns\n */\n static getBuffer(props = {}) {\n const shape = new this({ ...props, sideLength: props.sideLength || 1 });\n shape.generate();\n return shape.getBuffer() || new Float32Array();\n }\n}\nexports.ShapeBuffer = ShapeBuffer;\n//# sourceMappingURL=ShapeBuffer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeRecursive = void 0;\nconst Shape_1 = require(\"./Shape\");\n/**\n * @category Core.Shapes\n */\nclass ShapeRecursive extends Shape_1.Shape {\n /**\n * Creates an instance of ShapeRecursive.\n *\n * @param {IShapeRecursiveSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'ShapeRecursive';\n super(settings);\n this.props.recursions = settings.recursions || 1;\n this.props.recursionScale = settings.recursionScale || 2;\n this.props.recursionVertex = settings.recursionVertex || 0;\n // this.bInner = settings.bInner ?? false\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n this.shapeUseRecursion = !!settings.shapeUseRecursion;\n // this.currentGenerationRecursiveBounding = Bounding.empty()\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n if (bClearIndexed) {\n this.shapeRecursiveBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n * Set type of recursion\n *\n * @param {boolean} inner\n */\n // public setRecursionnInner(inner: boolean): void {\n // \tthis.bInner = inner\n // \tthis.clearBuffer(true)\n // }\n /**\n *\n * @returns {boolean}\n */\n isStatic() {\n return (typeof this.props.recursions !== 'function' &&\n typeof this.props.recursionScale !== 'function' &&\n typeof this.props.recursionVertex !== 'function' &&\n super.isStatic());\n }\n /**\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return (typeof this.props.recursions !== 'function' &&\n typeof this.props.recursionVertex !== 'function' &&\n super.isStaticIndexed());\n }\n /**\n * Return a buffer of children shape with recursion\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape) {\n if (typeof this.shapeRecursiveBuffer === 'undefined' ||\n this.shapeUseParent ||\n this.shape.generateId !== generateId) {\n this.bindBuffer(generateId, propArguments);\n }\n return this.shapeRecursiveBuffer;\n }\n return Shape_1.Shape.EMPTY_BUFFER;\n }\n /**\n * Generate Recoursive shape buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n */\n bindBuffer(generateId, propArguments) {\n const recursions = Math.floor(this.getProp('recursions', propArguments, 1));\n const recursionVertex = Math.floor(this.getProp('recursionVertex', propArguments, 0));\n const recursionScale = this.getProp('recursionScale', propArguments, 2);\n const childShape = this.shape;\n let currentRecursionRepetition = {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: 1 },\n };\n const recursionPropArguments = {\n ...propArguments,\n recursion: currentRecursionRepetition,\n };\n childShape.generate(generateId, false, recursionPropArguments);\n const firstGenerationChildBuffer = childShape.getBuffer();\n if (recursions <= 1) {\n // this.currentGenerationRecursiveBounding = this.shape.getBounding()\n this.shapeRecursiveBuffer = firstGenerationChildBuffer;\n return;\n }\n let shapeBuffer = firstGenerationChildBuffer;\n const storedRecursion = [currentRecursionRepetition];\n let paretRecursionIndex = 0, added = 1;\n // const tmpBounding = [undefined, undefined, undefined, undefined]\n const singleShapeBufferLength = shapeBuffer.length;\n const realVertexCount = singleShapeBufferLength / 2;\n const singleShapeVertexCount = recursionVertex <= 0 ? realVertexCount : Math.min(recursionVertex, realVertexCount);\n const recursionOffsetMultiplier = recursionVertex === 0 ? 1 : realVertexCount / Math.min(recursionVertex, realVertexCount);\n const recusiveShapeBuffer = new Float32Array(ShapeRecursive.summmation(recursions, singleShapeVertexCount) * singleShapeBufferLength);\n for (let i = 0; i < singleShapeBufferLength; i += 2) {\n recusiveShapeBuffer[i] = shapeBuffer[i];\n recusiveShapeBuffer[i + 1] = shapeBuffer[i + 1];\n // Bounding.add(tmpBounding, recusiveShapeBuffer[i], recusiveShapeBuffer[i + 1])\n }\n for (let currentRecursion = 1; currentRecursion < recursions; currentRecursion++) {\n const level_offset = recursions > 1 ? currentRecursion / (recursions - 1) : 1;\n const currentRecursionVertexCount = ShapeRecursive.summmation(currentRecursion, singleShapeVertexCount);\n const recursionBufferStartIndex = currentRecursionVertexCount * singleShapeBufferLength;\n const parentRecursion = currentRecursion - 1;\n const parentRecursionBufferStartIndex = parentRecursion === 0\n ? 0\n : ShapeRecursive.summmation(parentRecursion, singleShapeVertexCount) * singleShapeBufferLength;\n for (let currentShapeRecursionRepetition = 0, totalRecursionRepetitions = singleShapeVertexCount ** currentRecursion; currentShapeRecursionRepetition < totalRecursionRepetitions; currentShapeRecursionRepetition++, added++) {\n currentRecursionRepetition = {\n index: currentShapeRecursionRepetition + 1,\n offset: totalRecursionRepetitions > 1 ? currentShapeRecursionRepetition / (totalRecursionRepetitions - 1) : 1,\n count: totalRecursionRepetitions,\n level: { index: currentRecursion + 1, offset: level_offset, count: recursions },\n parent: storedRecursion[paretRecursionIndex],\n };\n storedRecursion.push(currentRecursionRepetition);\n if (this.shapeUseRecursion) {\n recursionPropArguments.recursion = currentRecursionRepetition;\n childShape.generate(generateId, false, recursionPropArguments);\n shapeBuffer = childShape.getBuffer();\n }\n const shapeVertexBufferIndex = recursionBufferStartIndex + currentShapeRecursionRepetition * singleShapeBufferLength;\n // const centerVertexIndex = parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2\n const centerVertexIndex = Math.floor(parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2 * recursionOffsetMultiplier);\n const centerX = recusiveShapeBuffer[centerVertexIndex];\n const centerY = recusiveShapeBuffer[centerVertexIndex + 1];\n const currentRecursionScale = recursionScale ** currentRecursion;\n for (let i = 0, len = singleShapeBufferLength; i < len; i += 2) {\n // if (this.bInner) {\n // \tconst parentCurrentVertex =\n // \t\tparentRecursionBufferStartIndex +\n // \t\tMath.floor(currentShapeRecursionRepetition / singleShapeVertexCount) *\n // \t\t\tsingleShapeVertexCount *\n // \t\t\trecursionOffsetMultiplier *\n // \t\t\t2\n // \tconst parentX = recusiveShapeBuffer[parentCurrentVertex + i]\n // \tconst parentY = recusiveShapeBuffer[parentCurrentVertex + i + 1]\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i] = (centerX - parentX) / recursionScale + parentX\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = (centerY - parentY) / recursionScale + parentY\n // const parentX = shapeBuffer[i] / recursionScale ** currentRecursion\n // const parentY = shapeBuffer[i + 1] / recursionScale ** currentRecursion\n // recusiveShapeBuffer[shapeVertexBufferIndex + i] = (centerX - parentX) / recursionScale + parentX\n // recusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = (centerY - parentY) / recursionScale + parentY\n // } else {\n const parentXScaled = shapeBuffer[i] / currentRecursionScale;\n const parentYScaled = shapeBuffer[i + 1] / currentRecursionScale;\n recusiveShapeBuffer[shapeVertexBufferIndex + i] = centerX + parentXScaled;\n recusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = centerY + parentYScaled;\n // }\n // Bounding.add(\n // \ttmpBounding,\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i],\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i + 1]\n // )\n }\n if (added % singleShapeVertexCount === 0) {\n paretRecursionIndex += 1;\n }\n }\n }\n // Bounding.bind(this.currentGenerationRecursiveBounding, tmpBounding)\n this.shapeRecursiveBuffer = recusiveShapeBuffer;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const propArguments = { repetition, shape: this };\n const recursions = Math.floor(this.getProp('recursions', propArguments, 1));\n const recursionVertex = Math.floor(this.getProp('recursionVertex', propArguments, 0));\n // const realFrameLength = ShapeRecursive.summmation(recursions, this.shape.getBufferLength() / 2)\n const bufferIndex = {\n shape: this,\n frameLength: frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n recursion: {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: recursions },\n },\n };\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentRecursionRepetition = {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: recursions },\n };\n const recursionBufferIndex = {\n ...bufferIndex,\n recursion: currentRecursionRepetition,\n };\n const parent = (currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, recursionBufferIndex)\n : recursionBufferIndex);\n this.indexedBuffer.push({\n ...currentIndexed,\n parent,\n });\n }\n if (recursions > 1) {\n const realVertexCount = this.shape.getBufferLength({ ...propArguments, parent: { ...bufferIndex } }) / 2;\n const vertexCount = recursionVertex <= 0 ? realVertexCount : Math.min(recursionVertex, realVertexCount);\n const storedRecursion = this.indexedBuffer.map(indexed => [indexed.parent.recursion]);\n let paretRecursionIndex = 0, added = 1;\n for (let i = 1; i < recursions; i++) {\n const level_offset = recursions > 1 ? i / (recursions - 1) : 1;\n for (let j = 0, len = vertexCount ** i; j < len; j++, added++) {\n const recursionOffset = len > 1 ? j / (len - 1) : 1;\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentRecursionRepetition = {\n index: j + 1,\n offset: recursionOffset,\n count: len,\n level: { index: i + 1, offset: level_offset, count: recursions },\n parent: storedRecursion[childIndexed][paretRecursionIndex],\n };\n const recursionBufferIndex = { ...bufferIndex, recursion: currentRecursionRepetition };\n const parent = currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, recursionBufferIndex)\n : recursionBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n storedRecursion[childIndexed].push(currentRecursionRepetition);\n if (added % vertexCount === 0) {\n paretRecursionIndex += 1;\n }\n }\n }\n }\n }\n }\n }\n /**\n * Retturn summation value\n *\n * @static\n * @param {number} recursion\n * @param {number} vertexCount\n * @returns {number}\n */\n static summmation(recursion, vertexCount) {\n if (recursion === 1)\n return 1;\n let result = 1;\n for (let i = 1; i < recursion; i++)\n result += vertexCount ** i;\n return result;\n }\n /**\n * Empty recursion repetition\n *\n * @static\n * @return {*} {IRecursionRepetition}\n */\n static getEmptyRecursion() {\n return {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: 1, count: 1 },\n };\n }\n}\nexports.ShapeRecursive = ShapeRecursive;\n//# sourceMappingURL=ShapeRecursive.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeFollow = void 0;\nconst Shape_1 = require(\"./Shape\");\n/**\n * @category Core.Shapes\n */\nclass ShapeFollow extends Shape_1.Shape {\n /**\n * Creates an instance of ShapeFollow.\n *\n * @param {IShapeFollowSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'ShapeFollow';\n super(settings);\n this.follow = settings.follow || settings.shape;\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n this.shapeUseFollow = !!settings.shapeUseFollow;\n // this.currentGenerationRecursiveBounding = Bounding.empty()\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n if (bClearIndexed) {\n this.shapeFollowBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n *\n * @returns {boolean}\n */\n isStatic() {\n return (this.follow ? this.follow.isStatic() : true) && super.isStatic();\n }\n /**\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return (this.follow ? this.follow.isStaticIndexed() : true) && super.isStaticIndexed();\n }\n /**\n * Return a buffer of children shape with recursion\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape && this.follow) {\n if (typeof this.shapeFollowBuffer === 'undefined' ||\n this.shapeUseParent ||\n this.shape.generateId !== generateId ||\n this.follow.generateId !== generateId) {\n this.bindBuffer(generateId, propArguments);\n }\n return this.shapeFollowBuffer;\n }\n return Shape_1.Shape.EMPTY_BUFFER;\n }\n /**\n * Generate Recoursive shape buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n */\n bindBuffer(generateId, propArguments) {\n const followShape = this.follow;\n followShape.generate(generateId, false, propArguments);\n const followBuffer = followShape.getBuffer();\n // const followIndexed = followShape.getIndexedBuffer() as Array\n const followPropArguments = {\n ...propArguments,\n follow: {\n index: 1,\n offset: 1,\n count: 1,\n },\n // follow_repetition: followIndexed[0].repetition,\n };\n const childShape = this.shape;\n childShape.generate(generateId, false, followPropArguments);\n let shapeBuffer = childShape.getBuffer();\n // const tmpBounding = [undefined, undefined, undefined, undefined]\n const singleShapeBufferLength = shapeBuffer.length;\n const followShapeBuffer = new Float32Array(singleShapeBufferLength * (followBuffer.length / 2));\n const totalFollowVertexCount = followBuffer.length / 2;\n for (let currentShapeFollowRepetition = 0; currentShapeFollowRepetition < totalFollowVertexCount; currentShapeFollowRepetition++) {\n const currentFollowRepetition = {\n index: currentShapeFollowRepetition + 1,\n offset: totalFollowVertexCount > 1 ? currentShapeFollowRepetition / (totalFollowVertexCount - 1) : 1,\n count: totalFollowVertexCount,\n };\n if (this.shapeUseFollow) {\n followPropArguments.follow = currentFollowRepetition;\n // followPropArguments.follow_repetition = followIndexed[currentShapeFollowRepetition].repetition\n childShape.generate(generateId, false, followPropArguments);\n shapeBuffer = childShape.getBuffer();\n }\n const shapeVertexBufferIndex = currentShapeFollowRepetition * singleShapeBufferLength;\n // const centerVertexIndex = parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2\n const centerVertexIndex = currentShapeFollowRepetition * 2;\n const centerX = followBuffer[centerVertexIndex];\n const centerY = followBuffer[centerVertexIndex + 1];\n for (let i = 0, len = shapeBuffer.length; i < len; i += 2) {\n followShapeBuffer[shapeVertexBufferIndex + i] = centerX + shapeBuffer[i];\n followShapeBuffer[shapeVertexBufferIndex + i + 1] = centerY + shapeBuffer[i + 1];\n // Bounding.add(\n // \ttmpBounding,\n // \tfollowShapeBuffer[shapeVertexBufferIndex + i],\n // \tfollowShapeBuffer[shapeVertexBufferIndex + i + 1]\n // )\n }\n }\n // Bounding.bind(this.currentGenerationRecursiveBounding, tmpBounding)\n this.shapeFollowBuffer = followShapeBuffer;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const propArguments = { repetition, shape: this };\n const bufferIndex = {\n shape: this,\n frameLength: frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n follow: {\n index: 1,\n offset: 1,\n count: 1,\n },\n };\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const vertexCount = this.follow.getBuffer().length / 2; // this.follow.getBufferLength({ ...propArguments, parent: { ...bufferIndex } }) / 2\n for (let j = 0, len = vertexCount; j < len; j++) {\n const followOffset = len > 1 ? j / (len - 1) : 1;\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentFollowRepetition = {\n index: j + 1,\n offset: followOffset,\n count: len,\n };\n const followBufferIndex = { ...bufferIndex, follow: currentFollowRepetition };\n const parent = currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, followBufferIndex)\n : followBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n }\n }\n }\n }\n }\n /**\n * Retturn summation value\n *\n * @static\n * @param {number} recursion\n * @param {number} vertexCount\n * @returns {number}\n */\n static summmation(recursion, vertexCount) {\n if (recursion === 1)\n return 1;\n let result = 1;\n for (let i = 1; i < recursion; i++)\n result += vertexCount ** i;\n return result;\n }\n /**\n * Empty recursion repetition\n *\n * @static\n * @return {*} {IRecursionRepetition}\n */\n static getEmptyRecursion() {\n return {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: 1, count: 1 },\n };\n }\n}\nexports.ShapeFollow = ShapeFollow;\n//# sourceMappingURL=ShapeFollow.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Line = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n *\n * @category Core.Primitives\n * @class Line\n * @extends {ShapeBuffer}\n */\nclass Line extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Two point, based on ShapeBuffer\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Line\n */\n constructor(settings = {}) {\n settings.type = 'Line';\n settings.shape = Line.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n settings.bClosed = false;\n super(settings);\n }\n /**\n * @link https://gist.github.com/pborissow/5c92b77a804688385c77749d1187ba07\n */\n static toPolygon(buffer, thickness) {\n const solidified = [];\n //Convert thickness into an array as needed\n if (!Array.isArray(thickness)) {\n const _thickness = thickness;\n const points = buffer.length / 2;\n thickness = new Array(points);\n for (let i = 0; i < points; i++) {\n thickness[i] = _thickness;\n }\n }\n function getOffsets(ax, ay, bx, by, thickness) {\n const dx = bx - ax, dy = by - ay, len = Math.sqrt(dx * dx + dy * dy), scale = thickness / (2 * len);\n return [-scale * dy, scale * dx];\n }\n function getIntersection(a1, b1, a2, b2) {\n // directional constants\n const k1 = (b1[1] - a1[1]) / (b1[0] - a1[0]), k2 = (b2[1] - a2[1]) / (b2[0] - a2[0]);\n // if the directional constants are equal, the lines are parallel\n if (Math.abs(k1 - k2) < 0.00001) {\n return;\n }\n // y offset constants for both lines\n const m1 = a1[1] - k1 * a1[0];\n const m2 = a2[1] - k2 * a2[0];\n // compute x\n const x = (m1 - m2) / (k2 - k1);\n // use y = k * x + m to get y coordinate\n const y = k1 * x + m1;\n return [x, y];\n }\n let bFirst, bLast, prevA = [\n [0, 0],\n [0, 0],\n ], prevB = [\n [0, 0],\n [0, 0],\n ];\n for (let i = 0, len = buffer.length - 2; i < len; i += 2) {\n bFirst = i === 0;\n bLast = i === len - 2;\n const off = getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], thickness[i]);\n const p0a = [buffer[i] + off[0], buffer[i + 1] + off[1]];\n const p1a = [buffer[i + 2] + off[0], buffer[i + 3] + off[1]];\n const p0b = [buffer[i] - off[0], buffer[i + 1] - off[1]];\n const p1b = [buffer[i + 2] - off[0], buffer[i + 3] - off[1]];\n if (!bFirst) {\n const interA = getIntersection(prevA[0], prevA[1], p0a, p1a);\n if (interA) {\n solidified.unshift(interA[1]);\n solidified.unshift(interA[0]);\n }\n const interB = getIntersection(prevB[0], prevB[1], p0b, p1b);\n if (interB) {\n solidified.push(interB[0]);\n solidified.push(interB[1]);\n }\n }\n if (bFirst) {\n solidified.unshift(p0a[1]);\n solidified.unshift(p0a[0]);\n solidified.push(p0b[0]);\n solidified.push(p0b[1]);\n }\n if (bLast) {\n solidified.unshift(p1a[1]);\n solidified.unshift(p1a[0]);\n solidified.push(p1b[0]);\n solidified.push(p1b[1]);\n }\n if (!bLast) {\n prevA = [p0a, p1a];\n prevB = [p0b, p1b];\n }\n }\n return Float32Array.from(solidified);\n }\n}\nexports.Line = Line;\nLine.buffer = [-1, 0, 1, 0];\n//# sourceMappingURL=Line.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Triangle = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n * Triangle ShapeBuffer\n *\n * @category Core.Primitives\n */\nclass Triangle extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Creates an instance of Triangleeee.\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Triangle\n */\n constructor(settings = {}) {\n settings.type = 'Triangle';\n settings.shape = Triangle.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n super(settings);\n }\n}\nexports.Triangle = Triangle;\nTriangle.buffer = [1, 0, -1, 1, -1, -1];\n//# sourceMappingURL=Triangle.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Rect = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n *\n * @category Core.Primitives\n * @class Rect\n * @extends {ShapeBuffer}\n */\nclass Rect extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Creates an instance of Rect.\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Rect\n */\n constructor(settings = {}) {\n settings.type = 'Rect';\n settings.shape = Rect.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n super(settings);\n }\n}\nexports.Rect = Rect;\nRect.buffer = [1, 1, -1, 1, -1, -1, 1, -1];\n//# sourceMappingURL=Rect.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Polygon = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Polygon shape\n *\n * @category Core.Primitives\n * @class Polygon\n * @extends {ShapeLoop}\n */\nclass Polygon extends ShapeLoop_1.ShapeLoop {\n /**\n * Is based on ShapeLoop and you can pass `sideNumber` property to define\n * a number of sides.\n *\n * @param settings\n */\n constructor(settings = {}) {\n settings.type = settings.type || 'Polygon';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['sideNumber']);\n super(settings, true);\n this.props.sideNumber = settings.sideNumber;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: (propArguments) => {\n return math_1.PI2 / this.getProp('sideNumber', propArguments, 5);\n },\n vertex: shapeLoopRepetition => {\n return [Math.cos(shapeLoopRepetition.current), Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n}\nexports.Polygon = Polygon;\n//# sourceMappingURL=Polygon.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Circle = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n *\n * @category Core.Primitives\n * @class Circle\n * @extends {ShapeLoop}\n */\nclass Circle extends ShapeLoop_1.ShapeLoop {\n /**\n * Based on ShapeLoop, the number of point (resolution) is based on sideLength.\n *\n * @param {ShapeLoopSettings} [settings={}]\n * @memberof Circle\n */\n constructor(settings = {}) {\n settings.type = 'Circle';\n super(settings, true);\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const sideLength = this.getRepetitionSideLength(propArguments);\n return (1 / Math.pow(sideLength[0] * sideLength[1], 0.25)) * ShapeLoop_1.ShapeLoop.PId2;\n },\n vertex: shapeLoopRepetition => [Math.cos(shapeLoopRepetition.current), Math.sin(shapeLoopRepetition.current)],\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n}\nexports.Circle = Circle;\n//# sourceMappingURL=Circle.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Star = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Polygon shape\n *\n * @category Core.Primitives\n * @class Polygon\n * @extends {ShapeLoop}\n */\nclass Star extends ShapeLoop_1.ShapeLoop {\n /**\n * Is based on ShapeLoop and you can pass `spikes` property to define\n * a number of spikes and `innerRadius`\n *\n * @param settings\n */\n constructor(settings = {}) {\n settings.type = settings.type || 'Polygon';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['spikes', 'innerRadius']);\n super(settings, true);\n this.props.spikes = settings.spikes;\n this.props.innerRadius = settings.innerRadius;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: (propArguments) => {\n // dyamic binding in `generateLoopBuffer`\n return this.inc;\n },\n vertex: shapeLoopRepetition => {\n const angle = (Math.PI / this.spikes) * shapeLoopRepetition.index;\n const radius = shapeLoopRepetition.index % 2 === 0 ? 1 : this.innerRadius;\n return [Math.cos(angle) * radius, Math.sin(angle) * radius];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.spikes = this.getProp('spikes', propArguments, 5);\n this.innerRadius = this.getProp('innerRadius', propArguments, 0.5);\n this.inc = Math.PI / this.spikes;\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.Star = Star;\n//# sourceMappingURL=Star.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Rose = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Rose shape\n *\n * @category Core.Primitives\n * @class Rose\n * @extends {ShapeLoop}\n */\nclass Rose extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Rose.\n *\n * @param {IRoseSettings} [settings={}]\n * @memberof Rose\n */\n constructor(settings = {}) {\n var _a, _b;\n settings.type = 'Rose';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['n', 'd']);\n super(settings, true);\n this.props.n = (_a = settings.n) !== null && _a !== void 0 ? _a : 1;\n this.props.d = (_b = settings.d) !== null && _b !== void 0 ? _b : 2;\n this.loop = {\n start: 0,\n end: (propArguments) => Rose.getFinalAngleFromK(this.getProp('n', propArguments), this.getProp('d', propArguments)),\n inc: (propArguments) => {\n const n = this.getProp('n', propArguments);\n const d = this.getProp('d', propArguments);\n const sideLength = this.getRepetitionSideLength(propArguments);\n const sides = Math.pow(sideLength[0] * sideLength[1], 0.45);\n const k = d < n ? n / d : 1.5;\n return math_1.PI2 / (sides * k);\n },\n vertex: (shapeLoopRepetition) => {\n const f = Math.cos(this.k * shapeLoopRepetition.current);\n return [f * Math.cos(shapeLoopRepetition.current), f * Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.k = this.getProp('n', propArguments) / this.getProp('d', propArguments);\n return super.generateLoopBuffer(propArguments);\n }\n /**\n * Return end angle of rose\n *\n * @static\n * @param {number} n\n * @param {number} d\n * @returns {number}\n * @memberof Rose\n */\n static getFinalAngleFromK(n, d) {\n if (n == d)\n return math_1.PI2;\n const k = n / d;\n const p = n * d;\n if (!Number.isInteger(k) && k % 0.5 == 0)\n return 4 * Math.PI;\n return Math.PI * d * (p % 2 == 0 ? 2 : 1);\n }\n}\nexports.Rose = Rose;\n//# sourceMappingURL=Rose.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Spiral = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n * Spiral shape\n *\n * @category Core.Primitives\n * @class Spiral\n * @extends {ShapeLoop}\n */\nclass Spiral extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Spiral.\n *\n * @param {SpiralSettings} [settings={}]\n * @memberof Spiral\n */\n constructor(settings = {}) {\n var _a, _b, _c;\n settings.type = 'Spiral';\n settings.bClosed = false;\n settings.loopDependencies = (settings.loopDependencies || []).concat(['twists', 'twistsStart', 'spiral']);\n super(settings, true);\n this.props.spiral = (_a = settings.spiral) !== null && _a !== void 0 ? _a : Spiral.types.ARCHIMEDE;\n this.props.twists = (_b = settings.twists) !== null && _b !== void 0 ? _b : 2;\n this.props.twistsStart = (_c = settings.twistsStart) !== null && _c !== void 0 ? _c : 0;\n this.loop = {\n start: (propArguments) => math_1.PI2 * this.getProp('twistsStart', propArguments),\n end: (propArguments) => math_1.PI2 *\n (this.getProp('twistsStart', propArguments) + this.getProp('twists', propArguments)),\n inc: (propArguments) => {\n const twists = this.getProp('twists', propArguments);\n const rep = math_1.PI2 * twists;\n const sideLength = this.getRepetitionSideLength(propArguments);\n const radius = 4 + Math.sqrt(sideLength[0] * sideLength[1]);\n return rep / (radius * twists);\n },\n vertex: (shapeLoopRepetition) => {\n const r = this.r(shapeLoopRepetition.current);\n return [r * Math.cos(shapeLoopRepetition.current), r * Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.spiral = this.getProp('spiral', propArguments);\n this.r = Spiral.getRFromTSpiralType(this.spiral);\n return super.generateLoopBuffer(propArguments);\n }\n /**\n * Point position and scale factor for spiral types\n *\n * @static\n * @param {TSpiralType} spiral\n * @returns {number}\n * @memberof Spiral\n */\n static getRFromTSpiralType(spiral) {\n switch (spiral) {\n case Spiral.types.ARCHIMEDE:\n return angle => angle / 10;\n case Spiral.types.HYPERBOLIC:\n return angle => (1 / angle) * 3;\n case Spiral.types.FERMAT:\n return angle => angle ** 0.5 / 3;\n case Spiral.types.LITUUS:\n return angle => angle ** -0.5;\n case Spiral.types.LOGARITHMIC:\n return angle => Math.E ** (angle * 0.2) / 10;\n }\n return angle => angle;\n }\n}\nexports.Spiral = Spiral;\n/**\n * Spural types\n *\n * @static\n * @type {{ [name in TSpiralType]: TSpiralType }}\n * @memberof Spiral\n */\nSpiral.types = {\n ARCHIMEDE: 'ARCHIMEDE',\n HYPERBOLIC: 'HYPERBOLIC',\n FERMAT: 'FERMAT',\n LITUUS: 'LITUUS',\n LOGARITHMIC: 'LOGARITHMIC',\n};\n//# sourceMappingURL=Spiral.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Lissajous = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Lissajous shape\n *\n * @category Core.Primitives\n * @class Lissajous\n * @extends {ShapeLoop}\n */\nclass Lissajous extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Lissajous.\n *\n * @param {ILissajousSettings} [settings={}]\n * @memberof Lissajous\n */\n constructor(settings = {}) {\n settings.type = 'Lissajous';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['wx', 'wy', 'wz']);\n super(settings, true);\n this.props.wx = settings.wx || 1;\n this.props.wy = settings.wy || 2;\n this.props.wz = settings.wz || 0;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const wx = this.getProp('wx', propArguments);\n const wy = this.getProp('wy', propArguments);\n const ratio = wx == wy ? ShapeLoop_1.ShapeLoop.PId2 : 0.5 - Math.min(49, wx + wy) * 0.01;\n const sideLength = this.getRepetitionSideLength(propArguments);\n return (1 / Math.pow(sideLength[0] * sideLength[1], 0.25)) * ratio;\n },\n vertex: (shapeLoopRepetition) => {\n return this.wx === this.wy\n ? [Math.cos(shapeLoopRepetition.current + this.wz), Math.sin(shapeLoopRepetition.current)]\n : [Math.cos(this.wx * shapeLoopRepetition.current + this.wz), Math.sin(this.wy * shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.wx = this.getProp('wx', propArguments, 1);\n this.wy = this.getProp('wy', propArguments, 2);\n this.wz = this.getProp('wz', propArguments, 2);\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.Lissajous = Lissajous;\n//# sourceMappingURL=Lissajous.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SuperShape = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n * ShperShape\n *\n * @category Core.Primitives\n * @class SuperShape\n * @extends {ShapeLoop}\n */\nclass SuperShape extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of SuperShape.\n *\n * @param {ISuperShapeSettings} [settings={}]\n * @memberof SuperShape\n */\n constructor(settings = {}) {\n var _a, _b, _c, _d, _e, _f;\n settings.type = 'SuperShape';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['a', 'b', 'm', 'n1', 'n2', 'n3']);\n super(settings, true);\n this.props.a = (_a = settings.a) !== null && _a !== void 0 ? _a : 1;\n this.props.b = (_b = settings.b) !== null && _b !== void 0 ? _b : 1;\n this.props.m = (_c = settings.m) !== null && _c !== void 0 ? _c : 6;\n this.props.n1 = (_d = settings.n1) !== null && _d !== void 0 ? _d : 1;\n this.props.n2 = (_e = settings.n2) !== null && _e !== void 0 ? _e : 1;\n this.props.n3 = (_f = settings.n3) !== null && _f !== void 0 ? _f : 1;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const sideLength = this.getRepetitionSideLength(propArguments);\n return Math.PI / Math.pow(sideLength[0] * sideLength[1], 0.5);\n },\n vertex: (shapeLoopRepetition) => {\n const angle = shapeLoopRepetition.current;\n const m = (this.m * angle) / 4;\n const a = Math.abs(Math.cos(m) / this.a) ** this.n2;\n const b = Math.abs(Math.sin(m) / this.b) ** this.n3;\n const raux = (a + b) ** (1 / this.n1);\n const r = raux === 0 ? 1 : 1 / raux;\n return [r * Math.cos(angle), r * Math.sin(angle)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.a = this.getProp('a', propArguments);\n this.b = this.getProp('b', propArguments);\n this.m = this.getProp('m', propArguments);\n this.n1 = this.getProp('n1', propArguments);\n this.n2 = this.getProp('n2', propArguments);\n this.n3 = this.getProp('n3', propArguments);\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.SuperShape = SuperShape;\n//# sourceMappingURL=SuperShape.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Modifiers = void 0;\nconst Adapt_1 = require(\"./Adapt\");\nconst Mirror_1 = require(\"./Mirror\");\nconst Smooth_1 = require(\"./Smooth\");\nconst Solidify_1 = require(\"./Solidify\");\nconst Subdivide_1 = require(\"./Subdivide\");\nconst Close_1 = require(\"./Close\");\nconst Offset_1 = require(\"./Offset\");\nconst Modifiers = {\n Adapt: Adapt_1.Adapt,\n Mirror: Mirror_1.Mirror,\n Smooth: Smooth_1.Smooth,\n Solidify: Solidify_1.Solidify,\n Subdivide: Subdivide_1.Subdivide,\n Close: Close_1.Close,\n Offset: Offset_1.Offset,\n};\nexports.Modifiers = Modifiers;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Mirror = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Mirror extends Modifier_1.Modifier {\n constructor(args = { x: true, y: true }) {\n super();\n this.x = args.x === true;\n this.y = args.y === true;\n }\n apply(buffer, bClosed) {\n const bufferLength = buffer.length;\n const mirror = new Float32Array(bufferLength * (this.x ? 2 : 1) * (this.y ? 2 : 1));\n const sideLengthX = 1;\n const sideLengthY = 1;\n if (this.x && this.y) {\n const bufferLengthX2 = bufferLength + bufferLength;\n const bufferLengthX3 = bufferLengthX2 + bufferLength;\n // |1|2|\n // |4|3|\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i] - sideLengthX;\n mirror[i + 1] = buffer[i + 1] - sideLengthY;\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i] * -1 + sideLengthX;\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1] - sideLengthY;\n mirror[bufferLengthX2 + i] = buffer[i] * -1 + sideLengthX;\n mirror[bufferLengthX2 + i + 1] = buffer[i + 1] * -1 + sideLengthY;\n mirror[bufferLengthX3 + i] = buffer[bufferLength - 2 - i] - sideLengthX;\n mirror[bufferLengthX3 + i + 1] = buffer[bufferLength - 2 - i + 1] * -1 + sideLengthY;\n }\n }\n else if (this.x) {\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i] - sideLengthX;\n mirror[i + 1] = buffer[i + 1];\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i] * -1 + sideLengthX;\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1];\n }\n }\n else if (this.y) {\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i];\n mirror[i + 1] = buffer[i + 1] - sideLengthY;\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i];\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1] * -1 + sideLengthY;\n }\n }\n else {\n return buffer;\n }\n return mirror;\n }\n}\nexports.Mirror = Mirror;\n//# sourceMappingURL=Mirror.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Smooth = void 0;\nconst Utilities_1 = require(\"../Utilities\");\nconst Close_1 = require(\"./Close\");\nconst Modifier_1 = require(\"./Modifier\");\nclass Smooth extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.level = args.level || 1;\n const tension = Array.isArray(args.tension) ? args.tension : [args.tension];\n this.tension = new Array(this.level).fill(0.5).map((v, i) => Utilities_1.clamp(0, 1, tension[i] || v));\n this.level = this.level < 1 ? 1 : this.level;\n this.closed = args.closed === true;\n }\n apply(buffer, bClosed) {\n if (bClosed && !Close_1.Close.isClosed(buffer)) {\n const bufferLen = buffer.length;\n const mofified = new Float32Array(bufferLen + 2);\n mofified.set(buffer, 0);\n mofified[bufferLen] = buffer[0];\n mofified[bufferLen + 1] = buffer[1];\n buffer = mofified;\n }\n let smoothed = buffer;\n for (let i = 0, len = this.level; i < len; i++)\n smoothed = Smooth.smooth(smoothed, this.tension[i], bClosed || this.closed);\n return smoothed;\n }\n /**\n * Chaikin smooth\n *\n * the tension factor defines a scale between corner cutting distance in segment half length,\n * i.e. between 0.05 and 0.45. The opposite corner will be cut by the inverse\n * (i.e. 1-cutting distance) to keep symmetry.\n * with a tension value of 0.5 this amounts to 0.25 = 1/4 and 0.75 = 3/4,\n * the original Chaikin values\n *\n * @link https://www.codeproject.com/Articles/1093960/D-Polyline-Vertex-Smoothing\n * @param buffer\n */\n static smooth(buffer, tension = 0.5, bClosed = false) {\n const bufferLength = buffer.length;\n const smoothed = new Float32Array((buffer.length - (bClosed ? 1 : 0)) * 2);\n if (!bClosed) {\n smoothed[0] = buffer[0];\n smoothed[1] = buffer[1];\n }\n const cutdist = 0.05 + tension * 0.4;\n const ncutdist = 1 - cutdist;\n let smoothedLength = bClosed ? 0 : 2;\n for (let i = 0, len = bufferLength - 2; i < len; i += 2, smoothedLength += 4) {\n // q\n smoothed[smoothedLength] = ncutdist * buffer[i] + cutdist * buffer[i + 2];\n smoothed[smoothedLength + 1] = ncutdist * buffer[i + 1] + cutdist * buffer[i + 3];\n // r\n smoothed[smoothedLength + 2] = cutdist * buffer[i] + ncutdist * buffer[i + 2];\n smoothed[smoothedLength + 3] = cutdist * buffer[i + 1] + ncutdist * buffer[i + 3];\n }\n if (!bClosed) {\n smoothed[smoothedLength] = buffer[bufferLength - 2];\n smoothed[smoothedLength + 1] = buffer[bufferLength - 1];\n }\n else {\n smoothed[smoothedLength] = smoothed[0];\n smoothed[smoothedLength + 1] = smoothed[1];\n }\n return smoothed;\n }\n}\nexports.Smooth = Smooth;\n//# sourceMappingURL=Smooth.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Close = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Close extends Modifier_1.Modifier {\n constructor() {\n super();\n }\n apply(buffer, bClosed, shape) {\n return Close.call(buffer);\n }\n static call(buffer) {\n const len = buffer.length;\n if (Close.isClosed(buffer))\n return buffer;\n const result = new Float32Array(len + 2);\n result.set(buffer, 0);\n result[len] = result[0];\n result[len + 1] = result[1];\n return result;\n }\n static isClosed(buffer) {\n const len = buffer.length;\n return buffer[0] === buffer[len - 2] && buffer[1] === buffer[len - 1];\n }\n}\nexports.Close = Close;\n//# sourceMappingURL=Close.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Solidify = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Solidify extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.closed = args.closed === true;\n this.thickness = args.thickness || 0.2;\n this.error = args.error;\n }\n apply(buffer, bClosed) {\n return Solidify.solidify(buffer, this.thickness, this.closed, this.error);\n }\n /**\n * @link https://gist.github.com/kekscom/4194148\n */\n static solidify(buffer, thickness, bClosed = false, error) {\n const solidified = [];\n thickness = typeof thickness === 'number' ? [thickness] : thickness;\n const thicknessLength = thickness.length;\n let bFirst, bLast, prevA = [\n [0, 0],\n [0, 0],\n ], prevB = [\n [0, 0],\n [0, 0],\n ];\n for (let i = 0, t = 0, len = buffer.length - 2; i < len; i += 2, t++) {\n bFirst = i === 0;\n bLast = i === len - 2;\n const currentThicknessRep = {\n index: i + 1,\n offset: i / len,\n count: len,\n };\n const nextThicknessRep = {\n index: i + 2,\n offset: (i + 1) / len,\n count: len,\n };\n const currentThickness = typeof thickness === 'function' ? thickness(currentThicknessRep) : thickness[t % thicknessLength];\n const nextThickness = typeof thickness === 'function' ? thickness(nextThicknessRep) : thickness[(t + 1) % thicknessLength];\n const off = Solidify.getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], currentThickness);\n const off2 = Solidify.getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], nextThickness);\n const p0a = [buffer[i] + off[0], buffer[i + 1] + off[1]];\n const p1a = [buffer[i + 2] + off2[0], buffer[i + 3] + off2[1]];\n const p0b = [buffer[i] - off[0], buffer[i + 1] - off[1]];\n const p1b = [buffer[i + 2] - off2[0], buffer[i + 3] - off2[1]];\n if (!bFirst) {\n const interA = Solidify.getIntersection(prevA[0], prevA[1], p0a, p1a, error);\n if (interA) {\n solidified.unshift(interA[1]);\n solidified.unshift(interA[0]);\n }\n const interB = Solidify.getIntersection(prevB[0], prevB[1], p0b, p1b, error);\n if (interB) {\n solidified.push(interB[0]);\n solidified.push(interB[1]);\n }\n }\n if (bFirst) {\n solidified.unshift(p0a[1]);\n solidified.unshift(p0a[0]);\n solidified.push(p0b[0]);\n solidified.push(p0b[1]);\n }\n if (bLast) {\n solidified.unshift(p1a[1]);\n solidified.unshift(p1a[0]);\n solidified.push(p1b[0]);\n solidified.push(p1b[1]);\n }\n if (!bLast) {\n prevA = [p0a, p1a];\n prevB = [p0b, p1b];\n }\n }\n if (bClosed) {\n const centerIndex = buffer.length - 2;\n const lastIndex = solidified.length - 2;\n const x = 0.5 * solidified[0] + solidified[centerIndex] * 0.5;\n const y = 0.5 * solidified[1] + solidified[centerIndex + 1] * 0.5;\n const x2 = 0.5 * solidified[centerIndex + 2] + solidified[lastIndex] * 0.5;\n const y2 = 0.5 * solidified[centerIndex + 3] + solidified[lastIndex + 1] * 0.5;\n solidified[0] = x;\n solidified[1] = y;\n solidified[centerIndex] = x;\n solidified[centerIndex + 1] = y;\n solidified[centerIndex + 2] = x2;\n solidified[centerIndex + 3] = y2;\n solidified[lastIndex] = x2;\n solidified[lastIndex + 1] = y2;\n }\n return Float32Array.from(solidified);\n }\n static getOffsets(ax, ay, bx, by, thickness) {\n const dx = bx - ax, dy = by - ay, len = Math.sqrt(dx * dx + dy * dy), scale = thickness / (2 * len);\n return [-scale * dy, scale * dx];\n }\n static getIntersection(a1, b1, a2, b2, error = 0.00001) {\n // directional constants\n const k1 = (b1[1] - a1[1]) / (b1[0] - a1[0]), k2 = (b2[1] - a2[1]) / (b2[0] - a2[0]);\n // if the directional constants are equal, the lines are parallel\n // if (Math.abs(k1 - k2) < 0.00001) {\n if (Math.abs(k1 - k2) < error) {\n return;\n }\n // y offset constants for both lines\n const m1 = a1[1] - k1 * a1[0];\n const m2 = a2[1] - k2 * a2[0];\n // compute x\n const x = (m1 - m2) / (k2 - k1);\n // use y = k * x + m to get y coordinate\n const y = k1 * x + m1;\n return [x, y];\n }\n}\nexports.Solidify = Solidify;\n//# sourceMappingURL=Solidify.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Subdivide = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Subdivide extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.level = args.level || 1;\n this.level = this.level < 1 ? 1 : this.level;\n }\n apply(buffer, bClosed) {\n const level = this.level;\n let subdivided = buffer;\n if (subdivided && subdivided.length > 0) {\n for (let i = 0; i < level; i++)\n subdivided = Subdivide.subdivide(subdivided, bClosed);\n }\n return subdivided;\n }\n /**\n * Subdivide buffer\n *\n * @static\n * @param {Float32Array} shape\n * @param {boolean} [bClosed=true]\n * @returns {(Float32Array)}\n */\n static subdivide(buffer, bClosed = false) {\n const bufferLength = buffer.length;\n const subdivided = new Float32Array(bufferLength * 2 - (bClosed ? 0 : 2));\n for (let i = 0; i < bufferLength; i += 2) {\n if (i === 0) {\n subdivided[0] = buffer[0];\n subdivided[1] = buffer[1];\n }\n else {\n const px = buffer[i - 2];\n const py = buffer[i - 1];\n const x = buffer[i];\n const y = buffer[i + 1];\n const nx = (x + px) / 2;\n const ny = (y + py) / 2;\n subdivided[(i - 1) * 2] = nx;\n subdivided[(i - 1) * 2 + 1] = ny;\n subdivided[i * 2] = x;\n subdivided[i * 2 + 1] = y;\n }\n }\n if (bClosed) {\n subdivided[(bufferLength - 1) * 2] = (buffer[0] + buffer[bufferLength - 2]) / 2;\n subdivided[(bufferLength - 1) * 2 + 1] = (buffer[1] + buffer[bufferLength - 1]) / 2;\n }\n return subdivided;\n }\n}\nexports.Subdivide = Subdivide;\n//# sourceMappingURL=Subdivide.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Offset = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Offset extends Modifier_1.Modifier {\n constructor(args = { from: 0, to: undefined }) {\n super();\n this.from = args.from;\n this.to = args.to;\n }\n apply(buffer, bClosed) {\n return buffer.subarray(this.from, this.to ? (this.to < 0 ? buffer.length + this.to : this.to) : undefined);\n }\n}\nexports.Offset = Offset;\n//# sourceMappingURL=Offset.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./utilities\"), exports);\n__exportStar(require(\"./createAnimation\"), exports);\n__exportStar(require(\"./createInterpolator\"), exports);\n__exportStar(require(\"./Easings\"), exports);\n__exportStar(require(\"./Animation\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.interpolateColorHSL = exports.interpolateColorRGB = exports.cosp = exports.sinp = exports.clockOffset = exports.clock = void 0;\n/**\n * Return time (from 0 to duration) in milliseconds\n *\n * @export\n * @param {number} time Current time\n * @param {number} duration Clock duration\n * @param {(number | boolean)} [loop=true]\n * @param {('normal' | 'reverse' | 'alternate')} [direction='alternate']\n * @param {number} [delay=0]\n * @param {number} [afterDelay=0]\n * @return {*} {number} Between 0 and duration\n */\nfunction clock(time, duration, loop = true, direction = 'alternate', delay = 0, afterDelay = 0) {\n const totalDuration = direction === 'normal'\n ? duration + delay\n : direction === 'reverse'\n ? duration + delay\n : duration * 2 + delay + afterDelay;\n if ((typeof loop === 'number' && time >= totalDuration * loop) || (loop === false && time >= totalDuration)) {\n return direction === 'normal' ? duration : 0;\n }\n time %= totalDuration;\n if ((time -= delay) <= 0) {\n return 0;\n }\n if (direction === 'alternate') {\n if (time <= duration) {\n // normal\n return time;\n }\n else {\n // reverse\n time -= duration;\n if ((time -= afterDelay) >= 0) {\n return duration - (time >= duration ? duration : time);\n }\n return duration;\n }\n }\n else {\n return time >= duration ? duration : time;\n }\n}\nexports.clock = clock;\n/**\n * Return offset between 0 and 1 from current time based on duration and other parameters\n *\n * @export\n * @param {number} time\n * @param {number} duration\n * @param {(number | boolean)} [loop=true]\n * @param {('normal' | 'reverse' | 'alternate')} [direction='alternate']\n * @param {number} [delay=0]\n * @param {number} [afterDelay=0]\n * @return {*} {number}\n */\nfunction clockOffset(time, duration, loop = true, direction = 'alternate', delay = 0, afterDelay = 0) {\n return clock(time, duration, loop, direction, delay, afterDelay) / duration;\n}\nexports.clockOffset = clockOffset;\nconst PI2 = Math.PI * 2;\n/**\n * Return sin of period 'durate' in time 'time'\n *\n * @export\n * @param {number} time\n * @param {number} durate\n * @param {number} phase\n * @param {boolean} [normalize=false]\n * @return {*} {number}\n */\nfunction sinp(time, durate, phase = 0, normalize = false) {\n const value = Math.sin((time * PI2) / durate + phase);\n return normalize ? 0.5 + value * 0.5 : value;\n}\nexports.sinp = sinp;\n/**\n * Return cos of period 'durate' in time 'time'\n *\n * @export\n * @param {number} time\n * @param {number} durate\n * @param {number} phase\n * @param {boolean} [normalize=false]\n * @return {*} {number}\n */\nfunction cosp(time, durate, phase = 0, normalize = false) {\n const value = Math.cos((time * PI2) / durate + phase);\n return normalize ? 0.5 + value * 0.5 : value;\n}\nexports.cosp = cosp;\nfunction interpolateColorRGB(start, end, offset) {\n const r = start.r + offset * (end.r - start.r);\n const g = start.g + offset * (end.g - start.g);\n const b = start.b + offset * (end.b - start.b);\n const alpha = start.alpha + offset * (end.alpha - start.alpha);\n return `rgba(${Math.floor(r)},${Math.floor(g)},${Math.floor(b)},${alpha})`;\n}\nexports.interpolateColorRGB = interpolateColorRGB;\nfunction interpolateColorHSL(start, end, offset) {\n const h = start.h + offset * (end.h - start.h);\n const s = start.s + offset * (end.s - start.s);\n const l = start.l + offset * (end.l - start.l);\n const alpha = start.alpha + offset * (end.alpha - start.alpha);\n return `hsla(${h},${s}%,${l}%,${alpha})`;\n}\nexports.interpolateColorHSL = interpolateColorHSL;\n//# sourceMappingURL=utilities.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createAnimation = void 0;\nconst createInterpolator_1 = require(\"./createInterpolator\");\n/**\n * Create TAnimation from object\n *\n * @param simpleAnimation\n * @returns\n */\nfunction createAnimation(simpleAnimation) {\n const interpolate = createInterpolator_1.createInterpolationCallback(simpleAnimation);\n if (typeof interpolate === 'undefined')\n return undefined;\n const delay = simpleAnimation.delay || 0;\n const afterDelay = simpleAnimation.afterDelay || 0;\n const direction = simpleAnimation.direction || 'normal';\n const duration = simpleAnimation.duration || 1000;\n const totalDuration = direction === 'normal'\n ? duration + delay\n : direction === 'reverse'\n ? duration + delay\n : duration * 2 + delay + afterDelay;\n const loop = typeof simpleAnimation.loop === 'number' ? simpleAnimation.loop : !!simpleAnimation.loop;\n const bindedValues = {\n delay,\n afterDelay,\n direction,\n duration,\n totalDuration,\n loop,\n };\n const animationFunction = createInterpolator_1.createInterpolator(simpleAnimation.interpolator);\n const animation = {\n loop: 0,\n offset: 0,\n loopDuration: totalDuration,\n direction: direction === 'alternate' ? 'normal' : direction,\n started: false,\n ended: false,\n value: undefined,\n };\n animation.update = createUpdate(animation, bindedValues, animationFunction, interpolate);\n return animation;\n}\nexports.createAnimation = createAnimation;\n/**\n *\n * @internal\n * @param animation\n * @param bindedValues\n * @param animationFunction\n * @param interpolate\n * @returns\n */\nfunction createUpdate(animation, bindedValues, animationFunction, interpolate) {\n const { loop, totalDuration, delay, afterDelay, direction, duration } = bindedValues;\n return (time) => {\n // Check animation is ended\n if ((typeof loop === 'number' && time >= totalDuration * loop) ||\n (loop === false && time >= bindedValues.totalDuration)) {\n animation.started = false;\n animation.ended = true;\n animation.offset = animationFunction(direction === 'normal' ? duration : 0, duration);\n animation.value = interpolate(animation.offset);\n return;\n }\n animation.loop = Math.ceil(time / totalDuration);\n time %= totalDuration;\n if ((time -= delay) <= 0) {\n animation.started = false;\n animation.offset = animationFunction(0, duration);\n animation.value = interpolate(animation.offset);\n return;\n }\n animation.started = true;\n if (direction === 'alternate') {\n if (time <= duration) {\n animation.direction = 'normal';\n animation.offset = animationFunction(time, duration);\n }\n else {\n animation.direction = 'reverse';\n time -= duration;\n // wait afterDelay\n if ((time -= afterDelay) >= 0) {\n animation.offset = 1 - animationFunction(time >= duration ? duration : time, duration);\n }\n else {\n animation.offset = 1;\n }\n }\n }\n else {\n const animationValue = animationFunction(time >= duration ? duration : time, duration);\n animation.offset = direction === 'normal' ? animationValue : 1 - animationValue;\n }\n animation.value = interpolate(animation.offset);\n };\n}\n//# sourceMappingURL=createAnimation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createInterpolator = exports.createInterpolationCallback = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst bezier_easing_1 = require(\"bezier-easing\");\nconst Easings_1 = require(\"./Easings\");\nconst utilities_1 = require(\"./utilities\");\n/**\n * Return a callback for value interpolation passing offset from 0 to 1\n *\n * @param simpleAnimation\n * @returns\n */\nfunction createInterpolationCallback(simpleAnimation) {\n const from = Array.isArray(simpleAnimation.from) ? simpleAnimation.from : [simpleAnimation.from];\n const to = Array.isArray(simpleAnimation.to) ? simpleAnimation.to : [simpleAnimation.to];\n const round = simpleAnimation.round;\n const colorInterpolation = simpleAnimation.colorTransitionMode === 'hue' ? utilities_1.interpolateColorHSL : utilities_1.interpolateColorRGB;\n if (from.length !== to.length)\n return undefined;\n const callbacks = [];\n for (let i = 0, len = from.length; i < len; i++) {\n if (typeof from[i] !== typeof to[i]) {\n console.warn('[@urpflanze/animation]: `from` and `to` values mismatch');\n return undefined;\n }\n else {\n if (typeof from[i] !== 'string') {\n const a = from[i], b = to[i];\n callbacks.push(typeof round !== 'undefined'\n ? (offset) => offset === 1 ? b : offset === 0 ? a : Math.round((a + offset * (b - a)) * round) / round\n : (offset) => (offset === 1 ? b : offset === 0 ? a : a + offset * (b - a)));\n }\n else {\n const a = from[i];\n const b = to[i];\n const parsed_a = color_1.parseColorAndConvert(a);\n const parsed_b = color_1.parseColorAndConvert(b);\n if (typeof parsed_a !== 'undefined' && typeof parsed_b !== 'undefined') {\n callbacks.push((offset) => offset === 1 ? b : offset === 0 ? a : colorInterpolation(parsed_a, parsed_b, offset));\n }\n }\n }\n }\n return (offset) => {\n const values = callbacks.map(c => c(offset));\n return values.length === 1 ? values[0] : values;\n };\n}\nexports.createInterpolationCallback = createInterpolationCallback;\n/**\n * Return a callback for calculate offset (0 to 1) from elapsed time and animation duration\n *\n * @param type\n * @returns\n */\nfunction createInterpolator(type) {\n var _a, _b;\n switch (typeof type) {\n case 'function':\n return (elapsed, duration) => type(elapsed / duration, elapsed);\n case 'string':\n switch (type) {\n case 'wave':\n return (elapsed, duration) => 0.5 + Math.sin((elapsed * Math.PI * 2) / duration + Math.PI * 1.5) * 0.5;\n default: {\n if (type in Easings_1.Easings) {\n const easing = Easings_1.Easings[type];\n return (elapsed, duration) => easing(elapsed, 0, 1, duration);\n }\n return (elapsed, duration) => Easings_1.Easings.linear(elapsed, 0, 1, duration);\n }\n }\n case 'object':\n switch (type.type) {\n case 'wave': {\n const phase = Math.PI * 1.5 + (((_a = type.params) === null || _a === void 0 ? void 0 : _a.phase) || 0);\n return (elapsed, duration) => {\n return 0.5 + Math.sin((elapsed * Math.PI * 2) / duration + phase) * 0.5;\n };\n }\n case 'elasticIn':\n case 'elasticOut':\n case 'elasticInOut': {\n const easing = Easings_1.Easings[type.type];\n const { amplitude, period } = type.params || {};\n return (elapsed, duration) => easing(elapsed, 0, 1, duration, amplitude, period);\n }\n case 'backIn':\n case 'backOut':\n case 'backInOut': {\n const easing = Easings_1.Easings[type.type];\n const overshoot = ((_b = type.params) === null || _b === void 0 ? void 0 : _b.overshoot) || undefined;\n return (elapsed, duration) => easing(elapsed, 0, 1, duration, overshoot);\n }\n case 'cubicBezier': {\n const easing = bezier_easing_1.default(type.params[0], type.params[1], type.params[2], type.params[3]);\n return (elapsed, duration) => easing(elapsed / duration);\n }\n }\n }\n return (elapsed, duration) => Easings_1.Easings.linear(elapsed, 0, 1, duration);\n}\nexports.createInterpolator = createInterpolator;\n//# sourceMappingURL=createInterpolator.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./conversions\"), exports);\n__exportStar(require(\"./parsing\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.rgbToHsl = exports.hslToRgb = exports.rgbToHex = void 0;\n/**\n * Convert rgb to hex\n *\n * @param r number between 0 - 255\n * @param g number between 0 - 255\n * @param b number between 0 - 255\n * @returns #ffffff\n */\nfunction rgbToHex(r, g, b) {\n return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;\n}\nexports.rgbToHex = rgbToHex;\n/**\n * Convert hsl (0-360, 0-100, 0-100) color to rgb(0-255, 0-255, 0-255)\n *\n * @param {number} h number between 0 - 360\n * @param {number} s number between 0 - 100\n * @param {number} l number between 0 - 100\n * @returns {[number, number, number]} [0-255, 0-255, 0-255]\n */\nfunction hslToRgb(h, s, l) {\n h /= 360;\n s /= 100;\n l /= 100;\n let r, g, b;\n if (s == 0) {\n r = g = b = l; // achromatic\n }\n else {\n const hue2rgb = (p, q, t) => {\n t += t < 0 ? 1 : t > 1 ? -1 : 0;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n };\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return [(0.5 + r * 255) << 0, (0.5 + g * 255) << 0, (0.5 + b * 255) << 0];\n}\nexports.hslToRgb = hslToRgb;\n/**\n * Convert rbg (0-255, 0-255, 0-255) to hsl (0-360, 0-100, 0-100)\n *\n * @param {number} r number between 0 - 255\n * @param {number} g number between 0 - 255\n * @param {number} b number between 0 - 255\n * @returns {[number, number, number]} (0-360, 0-100, 0-100)\n */\nfunction rgbToHsl(r, g, b) {\n r /= 255;\n g /= 255;\n b /= 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s;\n if (max === min) {\n h = s = 0;\n }\n else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h = h / 6;\n }\n return [(0.5 + h * 360) << 0, (0.5 + s * 100) << 0, (0.5 + l * 100) << 0];\n}\nexports.rgbToHsl = rgbToHsl;\n//# sourceMappingURL=conversions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseColor = exports.parseColorAndConvert = void 0;\nconst htmlcolors_1 = require(\"./htmlcolors\");\nconst conversions_1 = require(\"./conversions\");\n/**\n * Convert color to IConvertedColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IConvertedColor | undefined)}\n */\nfunction parseColorAndConvert(color) {\n const parsed = parseColor(color);\n if (parsed) {\n if (parsed.type === 'hsl') {\n const [r, g, b] = conversions_1.hslToRgb(parsed.a, parsed.b, parsed.c);\n return {\n r,\n g,\n b,\n h: parsed.a,\n s: parsed.b,\n l: parsed.c,\n alpha: parsed.alpha,\n };\n }\n else {\n const [h, s, l] = conversions_1.rgbToHsl(parsed.a, parsed.b, parsed.c);\n return {\n h,\n s,\n l,\n r: parsed.a,\n g: parsed.b,\n b: parsed.c,\n alpha: parsed.alpha,\n };\n }\n }\n}\nexports.parseColorAndConvert = parseColorAndConvert;\n/**\n * Convert color to IColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IColor | undefined)}\n */\nfunction parseColor(color) {\n if (typeof color === 'number') {\n if (color > 0xffffff) {\n return {\n type: 'rgb',\n a: (color >> 24) & 255,\n b: (color >> 16) & 255,\n c: (color >> 8) & 255,\n alpha: (color & 255) / 255,\n };\n }\n else {\n return { type: 'rgb', a: (color >> 16) & 255, b: (color >> 8) & 255, c: color & 255, alpha: 1 };\n }\n }\n color = color.replace(/\\s/g, '');\n if (htmlcolors_1.default[color])\n color = htmlcolors_1.default[color];\n let match = /^#([0-9a-f]{3,8})$/i.exec(color);\n if (match) {\n const hex = match[1];\n if (hex.length === 3) {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[0], 16),\n b: parseInt(hex[1] + hex[1], 16),\n c: parseInt(hex[2] + hex[2], 16),\n alpha: 1,\n };\n }\n else {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[1], 16),\n b: parseInt(hex[2] + hex[3], 16),\n c: parseInt(hex[4] + hex[5], 16),\n alpha: hex.length > 6 ? parseInt(hex.substring(6), 16) / 255 : 1,\n };\n }\n }\n match = /^((hsl|rgb)a?)\\((\\d+),(\\d+)%?,(\\d+)%?,?(.+)?\\)$/i.exec(color);\n if (match) {\n const [, , type, a, b, c, alpha] = match;\n return {\n type: type,\n a: +a,\n b: +b,\n c: +c,\n alpha: alpha ? +alpha : 1,\n };\n }\n}\nexports.parseColor = parseColor;\n//# sourceMappingURL=parsing.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst colors = {\n aliceblue: '#f0f8ff',\n antiquewhite: '#faebd7',\n aqua: '#00ffff',\n aquamarine: '#7fffd4',\n azure: '#f0ffff',\n beige: '#f5f5dc',\n bisque: '#ffe4c4',\n black: '#000000',\n blanchedalmond: '#ffebcd',\n blue: '#0000ff',\n blueviolet: '#8a2be2',\n brown: '#a52a2a',\n burlywood: '#deb887',\n cadetblue: '#5f9ea0',\n chartreuse: '#7fff00',\n chocolate: '#d2691e',\n coral: '#ff7f50',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyan: '#00ffff',\n darkblue: '#00008b',\n darkcyan: '#008b8b',\n darkgoldenrod: '#b8860b',\n darkgray: '#a9a9a9',\n darkgreen: '#006400',\n darkkhaki: '#bdb76b',\n darkmagenta: '#8b008b',\n darkolivegreen: '#556b2f',\n darkorange: '#ff8c00',\n darkorchid: '#9932cc',\n darkred: '#8b0000',\n darksalmon: '#e9967a',\n darkseagreen: '#8fbc8f',\n darkslateblue: '#483d8b',\n darkslategray: '#2f4f4f',\n darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n gold: '#ffd700',\n goldenrod: '#daa520',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n indianred: '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n lavender: '#e6e6fa',\n lavenderblush: '#fff0f5',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrodyellow: '#fafad2',\n lightgrey: '#d3d3d3',\n lightgreen: '#90ee90',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\n maroon: '#800000',\n mediumaquamarine: '#66cdaa',\n mediumblue: '#0000cd',\n mediumorchid: '#ba55d3',\n mediumpurple: '#9370d8',\n mediumseagreen: '#3cb371',\n mediumslateblue: '#7b68ee',\n mediumspringgreen: '#00fa9a',\n mediumturquoise: '#48d1cc',\n mediumvioletred: '#c71585',\n midnightblue: '#191970',\n mintcream: '#f5fffa',\n mistyrose: '#ffe4e1',\n moccasin: '#ffe4b5',\n navajowhite: '#ffdead',\n navy: '#000080',\n oldlace: '#fdf5e6',\n olive: '#808000',\n olivedrab: '#6b8e23',\n orange: '#ffa500',\n orangered: '#ff4500',\n orchid: '#da70d6',\n palegoldenrod: '#eee8aa',\n palegreen: '#98fb98',\n paleturquoise: '#afeeee',\n palevioletred: '#d87093',\n papayawhip: '#ffefd5',\n peachpuff: '#ffdab9',\n peru: '#cd853f',\n pink: '#ffc0cb',\n plum: '#dda0dd',\n powderblue: '#b0e0e6',\n purple: '#800080',\n rebeccapurple: '#663399',\n red: '#ff0000',\n rosybrown: '#bc8f8f',\n royalblue: '#4169e1',\n saddlebrown: '#8b4513',\n salmon: '#fa8072',\n sandybrown: '#f4a460',\n seagreen: '#2e8b57',\n seashell: '#fff5ee',\n sienna: '#a0522d',\n silver: '#c0c0c0',\n skyblue: '#87ceeb',\n slateblue: '#6a5acd',\n slategray: '#708090',\n snow: '#fffafa',\n springgreen: '#00ff7f',\n steelblue: '#4682b4',\n tan: '#d2b48c',\n teal: '#008080',\n thistle: '#d8bfd8',\n tomato: '#ff6347',\n turquoise: '#40e0d0',\n violet: '#ee82ee',\n wheat: '#f5deb3',\n white: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32',\n};\nexports.default = colors;\n//# sourceMappingURL=htmlcolors.js.map","/**\n * https://github.com/gre/bezier-easing\n * BezierEasing - use bezier curve for transition easing function\n * by Gaëtan Renaudeau 2014 - 2015 – MIT License\n */\n\n// These values are established by empiricism with tests (tradeoff: performance VS precision)\nvar NEWTON_ITERATIONS = 4;\nvar NEWTON_MIN_SLOPE = 0.001;\nvar SUBDIVISION_PRECISION = 0.0000001;\nvar SUBDIVISION_MAX_ITERATIONS = 10;\n\nvar kSplineTableSize = 11;\nvar kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\nvar float32ArraySupported = typeof Float32Array === 'function';\n\nfunction A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\nfunction B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\nfunction C (aA1) { return 3.0 * aA1; }\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nfunction calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }\n\n// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\nfunction getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); }\n\nfunction binarySubdivide (aX, aA, aB, mX1, mX2) {\n var currentX, currentT, i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n return currentT;\n}\n\nfunction newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {\n for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n if (currentSlope === 0.0) {\n return aGuessT;\n }\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n}\n\nfunction LinearEasing (x) {\n return x;\n}\n\nmodule.exports = function bezier (mX1, mY1, mX2, mY2) {\n if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {\n throw new Error('bezier x values must be in [0, 1] range');\n }\n\n if (mX1 === mY1 && mX2 === mY2) {\n return LinearEasing;\n }\n\n // Precompute samples table\n var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n for (var i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n\n function getTForX (aX) {\n var intervalStart = 0.0;\n var currentSample = 1;\n var lastSample = kSplineTableSize - 1;\n\n for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n --currentSample;\n\n // Interpolate to provide an initial guess for t\n var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n var guessForT = intervalStart + dist * kSampleStepSize;\n\n var initialSlope = getSlope(guessForT, mX1, mX2);\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if (initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n }\n\n return function BezierEasing (x) {\n // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n if (x === 0) {\n return 0;\n }\n if (x === 1) {\n return 1;\n }\n return calcBezier(getTForX(x), mY1, mY2);\n };\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Easings = void 0;\n/**\n * Easing functions\n *\n * @category Services.Animation\n */\nconst Easings = {\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n linear: (timeOrOffset, start, end, duration = 1) => (end * timeOrOffset) / duration + start,\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return -end * timeOrOffset * (timeOrOffset - 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset + start;\n timeOrOffset--;\n return (-end / 2) * (timeOrOffset * (timeOrOffset - 2) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * (timeOrOffset * timeOrOffset * timeOrOffset + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return -end * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (-end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset - 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalIn: (timeOrOffset, start, end, duration = 1) => {\n return -end * Math.cos((timeOrOffset / duration) * (Math.PI / 2)) + end + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalOut: (timeOrOffset, start, end, duration = 1) => {\n return end * Math.sin((timeOrOffset / duration) * (Math.PI / 2)) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalInOut: (timeOrOffset, start, end, duration = 1) => {\n return (-end / 2) * (Math.cos((Math.PI * timeOrOffset) / duration) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialIn: (timeOrOffset, start, end, duration = 1) => {\n return end * Math.pow(2, 10 * (timeOrOffset / duration - 1)) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialOut: (timeOrOffset, start, end, duration = 1) => {\n return end * (-Math.pow(2, (-10 * timeOrOffset) / duration) + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * Math.pow(2, 10 * (timeOrOffset - 1)) + start;\n timeOrOffset--;\n return (end / 2) * (-Math.pow(2, -10 * timeOrOffset) + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return -end * (Math.sqrt(1 - timeOrOffset * timeOrOffset) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * Math.sqrt(1 - timeOrOffset * timeOrOffset) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (-end / 2) * (Math.sqrt(1 - timeOrOffset * timeOrOffset) - 1) + start;\n timeOrOffset -= 2;\n return (end / 2) * (Math.sqrt(1 - timeOrOffset * timeOrOffset) + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticIn: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration) === 1) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n return (-(amplitude *\n Math.pow(2, 10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period)) + start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticOut: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration) === 1) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n return (amplitude * Math.pow(2, -10 * timeOrOffset) * Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period) +\n end +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticInOut: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration / 2) === 2) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n if (timeOrOffset < 1) {\n return (-0.5 *\n (amplitude *\n Math.pow(2, 10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period)) +\n start);\n }\n return (amplitude *\n Math.pow(2, -10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period) *\n 0.5 +\n end +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} overshoot (optional)\n * @return {number}\n */\n backIn: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n return end * (timeOrOffset /= duration) * timeOrOffset * ((overshoot + 1) * timeOrOffset - overshoot) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} s overshoot (optional)\n * @return {number}\n */\n backOut: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n return (end *\n ((timeOrOffset = timeOrOffset / duration - 1) * timeOrOffset * ((overshoot + 1) * timeOrOffset + overshoot) +\n 1) +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} overshoot (optional)\n * @return {number}\n */\n backInOut: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n if ((timeOrOffset /= duration / 2) < 1) {\n return (end / 2) * (timeOrOffset * timeOrOffset * (((overshoot *= 1.525) + 1) * timeOrOffset - overshoot)) + start;\n }\n return ((end / 2) * ((timeOrOffset -= 2) * timeOrOffset * (((overshoot *= 1.525) + 1) * timeOrOffset + overshoot) + 2) +\n start);\n },\n /**\n * @param {number} t current time\n * @param {number} b start value\n * @param {number} c end value\n * @param {number} d duration\n * @return {number}\n */\n bounceIn: (timeOrOffset, start, end, duration = 1) => {\n return end - Easings.bounceOut(duration - timeOrOffset, 0, end, duration) + start;\n },\n /**\n * @param {number} t current time\n * @param {number} b start value\n * @param {number} c end value\n * @param {number} d duration\n * @return {number}\n */\n bounceOut: (timeOrOffset, start, end, duration = 1) => {\n if ((timeOrOffset /= duration) < 1 / 2.75) {\n return end * (7.5625 * timeOrOffset * timeOrOffset) + start;\n }\n else if (timeOrOffset < 2 / 2.75) {\n return end * (7.5625 * (timeOrOffset -= 1.5 / 2.75) * timeOrOffset + 0.75) + start;\n }\n else if (timeOrOffset < 2.5 / 2.75) {\n return end * (7.5625 * (timeOrOffset -= 2.25 / 2.75) * timeOrOffset + 0.9375) + start;\n }\n return end * (7.5625 * (timeOrOffset -= 2.625 / 2.75) * timeOrOffset + 0.984375) + start;\n },\n /**\n *\n *\n * @param {number} time\n * @param {number} start\n * @param {number} end\n * @param {number} duration\n * @returns\n */\n bounceInOut: (timeOrOffset, start, end, duration = 1) => {\n if (timeOrOffset < duration / 2) {\n return Easings.bounceIn(timeOrOffset * 2, 0, end, duration) * 0.5 + start;\n }\n return Easings.bounceOut(timeOrOffset * 2 - duration, 0, end, duration) * 0.5 + end * 0.5 + start;\n },\n};\nexports.Easings = Easings;\n//# sourceMappingURL=Easings.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UncontrolledLoop = exports.Static = exports.Loop = exports.Compose = exports.Simple = exports.resolveSimpleAnimation = void 0;\nconst composeAnimations_1 = require(\"./composeAnimations\");\nconst createAnimation_1 = require(\"./createAnimation\");\nfunction resolveSimpleAnimation(simpleAnimation) {\n const animation = createAnimation_1.createAnimation(simpleAnimation);\n if (animation) {\n return (propArgumentsOrCurrentTime) => {\n var _a;\n const currentTime = typeof propArgumentsOrCurrentTime === 'number'\n ? propArgumentsOrCurrentTime\n : ((_a = propArgumentsOrCurrentTime.shape.scene) === null || _a === void 0 ? void 0 : _a.currentTime) || 0;\n animation.update(currentTime);\n return animation.value;\n };\n }\n}\nexports.resolveSimpleAnimation = resolveSimpleAnimation;\n// Alias\nexports.Simple = resolveSimpleAnimation;\n// Compose multiple animations\nconst Compose = (animations) => {\n const composed = composeAnimations_1.composeAnimations(animations);\n if (composed) {\n return (propArgumentsOrCurrentTime) => {\n var _a;\n const currentTime = typeof propArgumentsOrCurrentTime === 'number'\n ? propArgumentsOrCurrentTime\n : ((_a = propArgumentsOrCurrentTime.shape.scene) === null || _a === void 0 ? void 0 : _a.currentTime) || 0;\n return composed(currentTime);\n };\n }\n};\nexports.Compose = Compose;\nconst Loop = (loopAnimation) => {\n const simpleAnimation = loopAnimation;\n if (typeof simpleAnimation.interpolator === 'undefined') {\n simpleAnimation.interpolator = 'wave';\n }\n if (simpleAnimation.interpolator) {\n if (typeof simpleAnimation.interpolator === 'string') {\n if (simpleAnimation.interpolator !== 'wave') {\n simpleAnimation.direction = 'alternate';\n }\n }\n else if (typeof simpleAnimation.interpolator === 'object' && simpleAnimation.interpolator.type !== 'wave') {\n simpleAnimation.direction = 'alternate';\n }\n }\n simpleAnimation.loop = true;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.Loop = Loop;\nconst Static = (staticAnimation) => {\n const simpleAnimation = staticAnimation;\n simpleAnimation.direction = 'normal';\n simpleAnimation.loop = false;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.Static = Static;\nconst UncontrolledLoop = (uncontrolledLoopAnimation) => {\n const simpleAnimation = uncontrolledLoopAnimation;\n simpleAnimation.direction = 'normal';\n simpleAnimation.loop = true;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.UncontrolledLoop = UncontrolledLoop;\n//# sourceMappingURL=Animation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.composeAnimations = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst createAnimation_1 = require(\"./createAnimation\");\nconst utilities_1 = require(\"./utilities\");\n/**\n *\n *\n * @export\n * @param {Array} simpleAnimations\n * @return {*} {(((currentTime: number) => string | number | Array | undefined) | undefined)}\n */\nfunction composeAnimations(simpleAnimations) {\n const animations = simpleAnimations.map(createAnimation_1.createAnimation).filter(a => typeof a !== 'undefined');\n const animationsLength = animations.length;\n if (animationsLength > 0) {\n return (currentTime) => {\n let value = undefined;\n for (let i = 0; i < animationsLength; i++) {\n const animation = animations[i];\n animation.update(currentTime);\n value = typeof value === 'undefined' ? animation.value : interpolate(value, animation.value);\n }\n return value;\n };\n }\n}\nexports.composeAnimations = composeAnimations;\nfunction interpolate(a, b, offset = 0.5) {\n const from = Array.isArray(a) ? a : [a];\n const to = Array.isArray(b) ? b : [b];\n const results = [];\n for (let i = 0, len = from.length; i < len; i++) {\n if (typeof from[i] !== typeof to[i]) {\n console.error('[@urpflanze/animation]: cannot interpolate');\n return undefined;\n }\n else {\n if (typeof from[i] !== 'string') {\n const a = from[i], b = to[i];\n results.push(a + offset * (b - a));\n }\n else {\n const a = from[i];\n const b = to[i];\n const parsed_a = color_1.parseColorAndConvert(a);\n const parsed_b = color_1.parseColorAndConvert(b);\n if (typeof parsed_a !== 'undefined' && typeof parsed_b !== 'undefined') {\n results.push(utilities_1.interpolateColorRGB(parsed_a, parsed_b, offset));\n }\n }\n }\n }\n return results.length === 1 ? results[0] : results;\n}\n//# sourceMappingURL=composeAnimations.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BrowserDrawerCanvas = void 0;\nconst DrawerCanvas_1 = require(\"../DrawerCanvas\");\nconst utils_1 = require(\"../utils\");\n/**\n *\n * @category DrawerCanvas\n * @class BrowserDrawerCanvas\n * @extends {DrawerCanvas}\n */\nclass BrowserDrawerCanvas extends DrawerCanvas_1.DrawerCanvas {\n constructor(scene, canvasOrContainer, drawerOptions, duration = 60000, framerate = 60) {\n super(scene, canvasOrContainer, drawerOptions, duration, framerate);\n this.dpi = 1;\n this.dpi = (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.dpi) || 1;\n this.draw_id = null;\n this.redraw_id = null;\n this.animation_id = null;\n this.draw = this.draw.bind(this);\n this.animate = this.animate.bind(this);\n this.startAnimation = this.startAnimation.bind(this);\n this.resize(this.drawerOptions.width, this.drawerOptions.height);\n }\n resize(width, height, sceneFit, dpi = this.dpi) {\n this.drawerOptions.width = width * dpi;\n this.drawerOptions.height = height * dpi;\n if (this.canvas) {\n this.canvas.width = width * dpi;\n this.canvas.height = height * dpi;\n if (utils_1.bBrowser && this.canvas instanceof HTMLCanvasElement) {\n this.canvas.style.width = width + 'px';\n this.canvas.style.height = height + 'px';\n }\n }\n if (typeof sceneFit !== 'undefined') {\n this.drawerOptions.sceneFit = sceneFit;\n }\n this.dispatch('drawer-canvas:resize');\n }\n /**\n * Internal tick animation\n */\n animate(timestamp) {\n if (this.timeline.bSequenceStarted()) {\n this.animation_id = requestAnimationFrame(this.animate);\n if (this.timeline.tick(timestamp))\n this.draw();\n }\n }\n /**\n * Start animation drawing\n */\n startAnimation() {\n this.stopAnimation();\n this.timeline.start();\n this.animation_id = requestAnimationFrame(this.animate);\n }\n /**\n * Stop animation drawing\n */\n stopAnimation() {\n this.timeline.stop();\n if (this.animation_id)\n cancelAnimationFrame(this.animation_id);\n }\n /**\n * Pause animation drawing\n */\n pauseAnimation() {\n this.timeline.pause();\n if (this.animation_id)\n cancelAnimationFrame(this.animation_id);\n }\n /**\n * Play animation drawing\n */\n playAnimation() {\n this.timeline.start();\n requestAnimationFrame(this.animate);\n }\n redraw() {\n if (!this.timeline.bSequenceStarted()) {\n this.draw_id && cancelAnimationFrame(this.draw_id);\n if (typeof this.drawerOptions.ghosts === undefined || this.drawerOptions.ghosts === 0)\n this.timeline.stop();\n this.draw_id = requestAnimationFrame(this.draw);\n }\n else if (typeof this.drawerOptions.ghosts === undefined || this.drawerOptions.ghosts === 0) {\n this.stopAnimation();\n this.redraw_id && cancelAnimationFrame(this.redraw_id);\n this.redraw_id = requestAnimationFrame(this.startAnimation);\n }\n }\n}\nexports.BrowserDrawerCanvas = BrowserDrawerCanvas;\n//# sourceMappingURL=BrowserDrawerCanvas.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DrawerCanvas = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nconst math_1 = require(\"@urpflanze/core/dist/cjs/math\");\nconst Vec2_1 = require(\"@urpflanze/core/dist/cjs/math/Vec2\");\nconst canvas_1 = require(\"canvas\");\nconst Emitter_1 = require(\"./Emitter\");\nconst Timeline_1 = require(\"./Timeline\");\nconst utils_1 = require(\"./utils\");\n/**\n *\n * @category DrawerCanvas\n * @extends {Emitter}\n */\nclass DrawerCanvas extends Emitter_1.Emitter {\n constructor(scene, canvasOrContainer, drawerOptions, duration = 60000, framerate = 60) {\n var _a, _b, _c, _d, _e;\n super();\n this.drawerOptions = {\n width: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.width) || (scene === null || scene === void 0 ? void 0 : scene.width) || 400,\n height: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.height) || (scene === null || scene === void 0 ? void 0 : scene.height) || 400,\n clear: (_a = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.clear) !== null && _a !== void 0 ? _a : true,\n time: (_b = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.time) !== null && _b !== void 0 ? _b : 0,\n simmetricLines: (_c = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.simmetricLines) !== null && _c !== void 0 ? _c : 0,\n noBackground: (_d = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.noBackground) !== null && _d !== void 0 ? _d : false,\n ghosts: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghosts) || 0,\n ghostAlpha: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostAlpha) === false ? false : true,\n ghostSkipTime: (_e = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostSkipTime) !== null && _e !== void 0 ? _e : 30,\n ghostSkipFunction: drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostSkipFunction,\n sceneFit: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.sceneFit) || 'contain',\n backgroundImage: drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.backgroundImage,\n backgroundImageFit: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.backgroundImageFit) || 'cover',\n };\n this.timeline = new Timeline_1.Timeline(duration, framerate);\n this.timeline.setTime(this.drawerOptions.time);\n this.draw_id = null;\n this.redraw_id = null;\n this.animation_id = null;\n if (scene) {\n this.setScene(scene);\n }\n if (!utils_1.bWorker || (utils_1.bWorker && canvasOrContainer instanceof OffscreenCanvas))\n this.setCanvas(canvasOrContainer);\n }\n /**\n * Return option value or default\n *\n * @param {K keyof IDrawerCanvasOptions} name\n * @param {IDrawerCanvasOptions[K]} defaultValue\n */\n getOption(name, defaultValue) {\n var _a;\n return (_a = this.drawerOptions[name]) !== null && _a !== void 0 ? _a : defaultValue;\n }\n /**\n * Create instance of canvas (HTMLCanvasElement in browser o Canvas in Node)\n */\n setCanvas(canvasOrContainer) {\n if (utils_1.bWorker) {\n if (canvasOrContainer instanceof OffscreenCanvas) {\n this.canvas = canvasOrContainer;\n }\n else {\n console.error('Cannot set cavas');\n }\n }\n else {\n if (utils_1.bBrowser) {\n const canvas = canvas_1.createCanvas(this.drawerOptions.width, this.drawerOptions.height);\n if (canvasOrContainer instanceof HTMLElement &&\n !(canvasOrContainer instanceof HTMLCanvasElement || canvasOrContainer instanceof OffscreenCanvas)) {\n this.canvas = canvas;\n while (canvasOrContainer.lastChild)\n canvasOrContainer.removeChild(canvasOrContainer.lastChild);\n canvasOrContainer.appendChild(canvas);\n }\n else {\n this.canvas = typeof canvasOrContainer === 'undefined' ? canvas : canvasOrContainer;\n }\n }\n else {\n this.canvas = canvas_1.createCanvas(this.drawerOptions.width, this.drawerOptions.height);\n }\n }\n if (this.canvas) {\n this.canvas.width = this.drawerOptions.width;\n this.canvas.height = this.drawerOptions.height;\n this.context = this.canvas.getContext('2d', {\n alpha: true,\n // desynchronized: true,\n });\n }\n }\n /**\n * Return instance of canvas\n *\n * @returns canvas\n */\n getCanvas() {\n return this.canvas;\n }\n setScene(scene) {\n this.scene = scene;\n }\n draw() {\n if (this.context === null || typeof this.scene === 'undefined')\n return 0;\n const start_time = Utilities_1.now();\n const timeline = this.timeline;\n const drawAtTime = timeline.getTime();\n const drawerOptions = {\n ...this.drawerOptions,\n ghostIndex: undefined,\n clear: this.drawerOptions.clear || timeline.getCurrentFrame() <= 1,\n time: drawAtTime,\n };\n const currentFrame = timeline.getFrameAtTime(drawAtTime);\n this.dispatch('drawer-canvas:before_draw', {\n currentFrame: currentFrame,\n currentTime: drawAtTime,\n });\n if (drawerOptions.simmetricLines > 0) {\n if (drawerOptions.clear) {\n DrawerCanvas.clear(this.context, drawerOptions.width, drawerOptions.height, drawerOptions.noBackground ? false : this.scene.background, drawerOptions.backgroundImage, drawerOptions.backgroundImageFit);\n }\n DrawerCanvas.drawSimmetricLines(this.context, drawerOptions.simmetricLines, drawerOptions.width, drawerOptions.height, this.scene.color);\n drawerOptions.clear = false;\n }\n if (drawerOptions.ghosts) {\n const ghostDrawerOptions = {\n ...drawerOptions,\n };\n const drawAtTime = timeline.getTime();\n const sequenceDuration = timeline.getDuration();\n const ghostRepetition = {\n offset: 0,\n index: 0,\n count: drawerOptions.ghosts,\n };\n for (let i = 1; i <= drawerOptions.ghosts; i++) {\n ghostRepetition.index = i;\n ghostRepetition.offset = ghostRepetition.index / ghostRepetition.count;\n const ghostTime = drawAtTime -\n (drawerOptions.ghostSkipFunction\n ? drawerOptions.ghostSkipFunction(ghostRepetition, drawAtTime)\n : i * drawerOptions.ghostSkipTime);\n ghostDrawerOptions.ghostIndex = i;\n ghostDrawerOptions.time = math_1.mod(ghostTime, sequenceDuration);\n ghostDrawerOptions.clear = drawerOptions.clear && ghostDrawerOptions.ghostIndex === 1;\n this.realDraw(ghostDrawerOptions);\n }\n drawerOptions.clear = false;\n }\n this.realDraw(drawerOptions);\n return Utilities_1.now() - start_time;\n }\n realDraw(options) {\n var _a;\n const width = this.drawerOptions.width;\n const height = this.drawerOptions.height;\n const context = this.context;\n const scene = this.scene;\n const time = (_a = options.time) !== null && _a !== void 0 ? _a : 0;\n const bGhost = typeof options.ghosts !== 'undefined' &&\n options.ghosts > 0 &&\n typeof options.ghostIndex !== 'undefined' &&\n options.ghostIndex > 0;\n const ghostMultiplier = bGhost ? 1 - options.ghostIndex / (options.ghosts + 0.5) : 0;\n const ghostAlpha = options.ghostAlpha === true;\n const sceneFit = utils_1.fit(scene.width, scene.height, width, height, this.drawerOptions.sceneFit);\n const translateX = sceneFit.x;\n const translateY = sceneFit.y;\n options.clear &&\n DrawerCanvas.clear(context, width, height, options.noBackground ? false : scene.background, options.backgroundImage, options.backgroundImageFit);\n let logFillColorWarn = false;\n let logStrokeColorWarn = false;\n scene.currentTime = time;\n const sceneChilds = scene.getChildren();\n for (let i = 0, len = sceneChilds.length; i < len; i++) {\n const sceneChild = sceneChilds[i];\n if (!sceneChild.data ||\n (!(sceneChild.data.visible === false) && !(bGhost && sceneChild.data.disableGhost === true))) {\n sceneChilds[i].generate(time, true);\n const childIndexedBuffer = sceneChilds[i].getIndexedBuffer() || [];\n const childBuffer = sceneChilds[i].getBuffer() || [];\n let childVertexIndex = 0;\n for (let currentBufferIndex = 0, len = childIndexedBuffer.length; currentBufferIndex < len; currentBufferIndex++) {\n const currentIndexing = childIndexedBuffer[currentBufferIndex];\n const shape = currentIndexing.shape;\n const propArguments = {\n canvasContext: context,\n ...currentIndexing,\n };\n const composite = DrawerCanvas.getStreamDrawerProp(shape, 'composite', propArguments, 'source-over');\n context.globalCompositeOperation = composite;\n context.beginPath();\n context.moveTo(childBuffer[childVertexIndex] * sceneFit.scale + translateX, childBuffer[childVertexIndex + 1] * sceneFit.scale + translateY);\n childVertexIndex += 2;\n for (let currentFrameLength = childVertexIndex + currentIndexing.frameLength - 2; childVertexIndex < currentFrameLength; childVertexIndex += 2)\n context.lineTo(childBuffer[childVertexIndex] * sceneFit.scale + translateX, childBuffer[childVertexIndex + 1] * sceneFit.scale + translateY);\n if (shape.isClosed())\n context.closePath();\n const alpha = DrawerCanvas.getStreamDrawerProp(shape, 'opacity', propArguments, 1);\n context.globalAlpha = alpha;\n const shadowColor = DrawerCanvas.getStreamDrawerProp(shape, 'shadowColor', propArguments);\n const shadowBlur = DrawerCanvas.getStreamDrawerProp(shape, 'shadowBlur', propArguments);\n const shadowOffsetX = DrawerCanvas.getStreamDrawerProp(shape, 'shadowOffsetX', propArguments);\n const shadowOffsetY = DrawerCanvas.getStreamDrawerProp(shape, 'shadowOffsetY', propArguments);\n context.shadowColor = shadowColor;\n context.shadowBlur = shadowBlur;\n shadowOffsetX && (context.shadowOffsetX = shadowOffsetX);\n shadowOffsetY && (context.shadowOffsetY = shadowOffsetY);\n let fill = DrawerCanvas.getStreamDrawerProp(shape, 'fill', propArguments);\n if (typeof fill !== 'undefined') {\n if (bGhost && ghostAlpha) {\n const color = DrawerCanvas.ghostifyColor(fill, ghostMultiplier);\n if (color) {\n fill = color;\n }\n else if (!logFillColorWarn) {\n console.warn(`[Urpflanze:DrawerCanvas] Unable ghost fill color '${fill}',\n\t\t\t\t\t\t\t\tplease enter a rgba or hsla color`);\n logFillColorWarn = true;\n }\n }\n context.fillStyle = fill;\n context.fill();\n }\n let stroke = DrawerCanvas.getStreamDrawerProp(shape, 'stroke', propArguments, typeof fill === 'undefined' ? scene.color : undefined);\n let lineWidth = DrawerCanvas.getStreamDrawerProp(shape, 'lineWidth', propArguments, 1);\n if (stroke) {\n if (bGhost && ghostAlpha) {\n const color = DrawerCanvas.ghostifyColor(stroke, ghostMultiplier);\n if (color) {\n stroke = color;\n }\n else if (!logStrokeColorWarn) {\n console.warn(`[Urpflanze:DrawerCanvas] Unable ghost stroke color '${stroke}',\n\t\t\t\t\t\t\t\tplease enter a rgba or hsla color`);\n logStrokeColorWarn = true;\n }\n lineWidth *= ghostMultiplier;\n }\n const lineJoin = DrawerCanvas.getStreamDrawerProp(shape, 'lineJoin', propArguments);\n const lineCap = DrawerCanvas.getStreamDrawerProp(shape, 'lineCap', propArguments);\n const lineDash = DrawerCanvas.getStreamDrawerProp(shape, 'lineDash', propArguments);\n const lineDashOffset = DrawerCanvas.getStreamDrawerProp(shape, 'lineDashOffset', propArguments);\n const miterLimit = DrawerCanvas.getStreamDrawerProp(shape, 'miterLimit', propArguments);\n context.setLineDash.call(context, lineDash || []);\n context.lineJoin = lineJoin;\n context.lineCap = lineCap;\n context.lineDashOffset = lineDashOffset;\n context.miterLimit = miterLimit;\n context.lineWidth = lineWidth * sceneFit.scale;\n context.strokeStyle = stroke;\n context.stroke();\n }\n }\n context.restore();\n }\n }\n }\n /**\n * Return a drawer value\n *\n * @static\n * @template T\n * @param {ShapePrimitive} shape\n * @param {keyof T} key\n * @param {IDrawerPropArguments} propArguments\n * @param {*} [defaultValue]\n * @returns {*}\n */\n static getStreamDrawerProp(shape, key, propArguments, defaultValue) {\n let attribute = shape.drawer[key];\n if (typeof attribute === 'function') {\n attribute = attribute(propArguments);\n }\n return attribute !== null && attribute !== void 0 ? attribute : defaultValue;\n }\n /**\n * Create color based on ghostMultiplier\n *\n * @static\n * @param {any} color\n * @param {number} ghostMultiplier\n * @return {*} {(string | undefined)}\n */\n static ghostifyColor(color, ghostMultiplier) {\n if (typeof color === 'string' || typeof color === 'number') {\n const parsed = color_1.parseColor(color);\n if (parsed) {\n const ghostAlpha = parsed.alpha * ghostMultiplier;\n return parsed.type === 'rgb'\n ? `rgba(${parsed.a},${parsed.b},${parsed.c},${ghostAlpha})`\n : `hsla(${parsed.a},${parsed.b}%,${parsed.c}%,${ghostAlpha})`;\n }\n }\n return color;\n }\n /**\n * Clear canvas, draw background or image (and fit)\n *\n * @param context\n * @param width\n * @param height\n * @param background\n * @param backgroundImage\n * @param backgroundImageFit\n */\n static clear(context, width, height, background, backgroundImage, backgroundImageFit) {\n if (typeof background === 'boolean' && background === false) {\n context.clearRect(0, 0, width, height);\n }\n else {\n context.globalCompositeOperation = 'source-over';\n context.fillStyle = background; // or true\n context.fillRect(0, 0, width, height);\n if (backgroundImage) {\n const sourceWidth = backgroundImage instanceof SVGImageElement ? backgroundImage.width.baseVal.value : backgroundImage.width;\n const sourceHeight = backgroundImage instanceof SVGImageElement ? backgroundImage.height.baseVal.value : backgroundImage.height;\n const fitRect = utils_1.fit(sourceWidth, sourceHeight, width, height, backgroundImageFit);\n context.drawImage(backgroundImage, fitRect.x, fitRect.y, fitRect.width, fitRect.height);\n }\n }\n }\n /**\n * Draw utility lines\n *\n * @param context\n * @param simmetricLines\n * @param width\n * @param height\n * @param color\n */\n static drawSimmetricLines(context, simmetricLines, width, height, color) {\n const offset = Math.PI / simmetricLines;\n const size = Math.max(width, height);\n const sizeMin = Math.min(width, height);\n const k = width < height ? 1 : 0;\n const centerX = [size / 2, size / 2];\n const centerY = [sizeMin / 2, sizeMin / 2];\n for (let i = 0; i < simmetricLines; i++) {\n const a = [-size, -size];\n const b = [size * 2, size * 2];\n const rotate = i * offset + Math.PI / 4;\n Vec2_1.default.rotateZ(a, i % 2 === k ? centerX : centerY, rotate);\n Vec2_1.default.rotateZ(b, i % 2 === k ? centerX : centerY, rotate);\n context.beginPath();\n context.strokeStyle = color;\n context.lineWidth = 1;\n context.moveTo(a[0], a[1]);\n context.lineTo(b[0], b[1]);\n context.stroke();\n }\n }\n}\nexports.DrawerCanvas = DrawerCanvas;\n// const sourceRatio = sourceWidth / sourceHeight\n// let x = 0,\n// \ty = 0,\n// \tbgWidth = width,\n// \tbgHeight = height\n// if (sourceRatio !== ratio) {\n// \tif (options.backgroundImageFit === 'contain') {\n// \t\tbgWidth = ratio > sourceRatio ? (sourceWidth * height) / sourceHeight : width\n// \t\tbgHeight = ratio > sourceRatio ? height : (sourceHeight * width) / sourceWidth\n// \t} else {\n// \t\tbgWidth = ratio < sourceRatio ? (sourceWidth * height) / sourceHeight : width\n// \t\tbgHeight = ratio < sourceRatio ? height : (sourceHeight * width) / sourceWidth\n// \t}\n// \tx = (width - bgWidth) / 2\n// \ty = (height - bgHeight) / 2\n//# sourceMappingURL=DrawerCanvas.js.map","/* globals document, ImageData */\n\nconst parseFont = require('./lib/parse-font')\n\nexports.parseFont = parseFont\n\nexports.createCanvas = function (width, height) {\n return Object.assign(document.createElement('canvas'), { width: width, height: height })\n}\n\nexports.createImageData = function (array, width, height) {\n // Browser implementation of ImageData looks at the number of arguments passed\n switch (arguments.length) {\n case 0: return new ImageData()\n case 1: return new ImageData(array)\n case 2: return new ImageData(array, width)\n default: return new ImageData(array, width, height)\n }\n}\n\nexports.loadImage = function (src, options) {\n return new Promise(function (resolve, reject) {\n const image = Object.assign(document.createElement('img'), options)\n\n function cleanup () {\n image.onload = null\n image.onerror = null\n }\n\n image.onload = function () { cleanup(); resolve(image) }\n image.onerror = function () { cleanup(); reject(new Error('Failed to load the image \"' + src + '\"')) }\n\n image.src = src\n })\n}\n","'use strict'\n\n/**\n * Font RegExp helpers.\n */\n\nconst weights = 'bold|bolder|lighter|[1-9]00'\n , styles = 'italic|oblique'\n , variants = 'small-caps'\n , stretches = 'ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded'\n , units = 'px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q'\n , string = '\\'([^\\']+)\\'|\"([^\"]+)\"|[\\\\w\\\\s-]+'\n\n// [ [ <‘font-style’> || || <‘font-weight’> || <‘font-stretch’> ]?\n// <‘font-size’> [ / <‘line-height’> ]? <‘font-family’> ]\n// https://drafts.csswg.org/css-fonts-3/#font-prop\nconst weightRe = new RegExp('(' + weights + ') +', 'i')\nconst styleRe = new RegExp('(' + styles + ') +', 'i')\nconst variantRe = new RegExp('(' + variants + ') +', 'i')\nconst stretchRe = new RegExp('(' + stretches + ') +', 'i')\nconst sizeFamilyRe = new RegExp(\n '([\\\\d\\\\.]+)(' + units + ') *'\n + '((?:' + string + ')( *, *(?:' + string + '))*)')\n\n/**\n * Cache font parsing.\n */\n\nconst cache = {}\n\nconst defaultHeight = 16 // pt, common browser default\n\n/**\n * Parse font `str`.\n *\n * @param {String} str\n * @return {Object} Parsed font. `size` is in device units. `unit` is the unit\n * appearing in the input string.\n * @api private\n */\n\nmodule.exports = function (str) {\n // Cached\n if (cache[str]) return cache[str]\n\n // Try for required properties first.\n const sizeFamily = sizeFamilyRe.exec(str)\n if (!sizeFamily) return // invalid\n\n // Default values and required properties\n const font = {\n weight: 'normal',\n style: 'normal',\n stretch: 'normal',\n variant: 'normal',\n size: parseFloat(sizeFamily[1]),\n unit: sizeFamily[2],\n family: sizeFamily[3].replace(/[\"']/g, '').replace(/ *, */g, ',')\n }\n\n // Optional, unordered properties.\n let weight, style, variant, stretch\n // Stop search at `sizeFamily.index`\n let substr = str.substring(0, sizeFamily.index)\n if ((weight = weightRe.exec(substr))) font.weight = weight[1]\n if ((style = styleRe.exec(substr))) font.style = style[1]\n if ((variant = variantRe.exec(substr))) font.variant = variant[1]\n if ((stretch = stretchRe.exec(substr))) font.stretch = stretch[1]\n\n // Convert to device units. (`font.unit` is the original unit)\n // TODO: ch, ex\n switch (font.unit) {\n case 'pt':\n font.size /= 0.75\n break\n case 'pc':\n font.size *= 16\n break\n case 'in':\n font.size *= 96\n break\n case 'cm':\n font.size *= 96.0 / 2.54\n break\n case 'mm':\n font.size *= 96.0 / 25.4\n break\n case '%':\n // TODO disabled because existing unit tests assume 100\n // font.size *= defaultHeight / 100 / 0.75\n break\n case 'em':\n case 'rem':\n font.size *= defaultHeight / 0.75\n break\n case 'q':\n font.size *= 96 / 25.4 / 4\n break\n }\n\n return (cache[str] = font)\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Emitter = void 0;\n/**\n * Class used for emit and dispatch events\n *\n * @category Emitter\n * @abstract\n * @class Emitter\n * @template EventTypes\n */\nclass Emitter {\n constructor() {\n this.callbacks = {};\n }\n /**\n * Attach callback at event\n *\n * @param {keyof EventTypes} e\n * @param {(value: EventTypes[keyof EventTypes]) => any} callback\n * @memberof Emitter\n */\n attach(e, callback) {\n if (!(e in this.callbacks)) {\n this.callbacks[e] = [];\n }\n this.callbacks[e].push(callback);\n }\n /**\n * Remove callbach listener at event\n *\n * @param {keyof EventTypes} e\n * @param {(value: EventTypes[keyof EventTypes]) => void} callback\n * @memberof Emitter\n */\n detach(e, callback) {\n if (e in this.callbacks) {\n const index = this.callbacks[e].indexOf(callback);\n if (index >= 0) {\n this.callbacks[e].splice(index, 1);\n }\n }\n }\n /**\n * Dispatch event\n *\n * @param {keyof EventTypes} e\n * @param {EventTypes[keyof EventTypes]} [params]\n * @memberof Emitter\n */\n dispatch(e, params) {\n if (e in this.callbacks && this.callbacks[e].length > 0) {\n for (let i = 0, len = this.callbacks[e].length; i < len; i++)\n if (this.callbacks[e][i](params) === false)\n break;\n }\n }\n}\nexports.Emitter = Emitter;\n//# sourceMappingURL=Emitter.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Timeline = void 0;\nconst Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nconst math_1 = require(\"@urpflanze/core/dist/cjs/math\");\nconst Emitter_1 = require(\"./Emitter\");\n/**\n * Is used for sequence time management.\n * It is necessary to set the duration and the number of frames per second (frame rate).\n *\n * @category Timeline\n * @class Timeline\n * @extends {Emitter}\n */\nclass Timeline extends Emitter_1.Emitter {\n constructor(duration = 60000, framerate = 30) {\n super();\n this.fps_samples_size = 30;\n this.fps_samples = [];\n this.fps_samples_index = 0;\n this.paused_time = 0;\n this.sequence = {\n duration,\n framerate,\n frames: Math.round((duration / 1000) * framerate),\n };\n this.tick_time = 1000 / this.sequence.framerate;\n this.fps = this.sequence.framerate;\n this.b_sequence_started = false;\n this.currentFrame = 0;\n this.currentTime = 0;\n this.last_tick = 0;\n this.start_time = 0;\n }\n //#region sequence meta\n /**\n * Return the sequence\n *\n * @returns {Sequence}\n */\n getSequence() {\n return { ...this.sequence };\n }\n /**\n * Set Sequence\n *\n * @param {number} duration in ms\n * @param {number} framerate\n * @param {number} atTime\n */\n setSequence(duration, framerate, atTime) {\n this.sequence.duration = duration;\n this.sequence.framerate = framerate;\n this.tick_time = 1000 / this.sequence.framerate;\n this.sequence.frames = Math.round((this.sequence.duration / 1000) * this.sequence.framerate);\n if (typeof atTime !== 'undefined') {\n this.setTime(atTime);\n }\n else {\n this.dispatch('timeline:update_sequence', this.getSequence());\n }\n }\n /**\n * Set duration of timeline\n *\n * @param {number} framerate\n */\n setDuration(duration) {\n this.setSequence(duration, this.sequence.framerate);\n }\n /**\n * Get timeline duration\n *\n * @returns {number}\n */\n getDuration() {\n return this.sequence.duration;\n }\n /**\n * Return framerate\n *\n * @returns {number}\n */\n getFramerate() {\n return this.sequence.framerate;\n }\n /**\n * Set a framerate\n *\n * @param {number} framerate\n */\n setFramerate(framerate) {\n this.setSequence(this.sequence.duration, framerate);\n }\n /**\n * Get number of frames based on duration and framerate\n *\n * @returns {number}\n */\n getFramesCount() {\n return this.sequence.frames;\n }\n //#endregion meta\n //#region change status\n bSequenceStarted() {\n return this.b_sequence_started;\n }\n /**\n * Start the sequence\n *\n */\n start() {\n if (!this.b_sequence_started) {\n this.b_sequence_started = true;\n this.start_time = this.paused_time;\n this.dispatch('timeline:change_status', Timeline.START);\n }\n }\n /**\n * Pause the sequence\n *\n */\n pause() {\n if (this.b_sequence_started) {\n this.paused_time = Utilities_1.now();\n this.b_sequence_started = false;\n this.dispatch('timeline:change_status', Timeline.PAUSE);\n }\n }\n /**\n * Stop the sequence and reset\n *\n */\n stop() {\n if (this.b_sequence_started) {\n this.b_sequence_started = false;\n this.currentTime = 0;\n this.currentFrame = 0;\n this.start_time = 0;\n this.paused_time = 0;\n this.dispatch('timeline:change_status', Timeline.STOP);\n }\n }\n /**\n * Animation tick\n *\n * @param {number} timestamp current timestamp\n * @returns {boolean}\n */\n tick(timestamp) {\n if (this.b_sequence_started) {\n if (!this.start_time) {\n this.start_time = timestamp;\n this.last_tick = -this.tick_time;\n }\n const currentTime = timestamp - this.start_time;\n const elapsed = currentTime - this.last_tick;\n if (elapsed >= this.tick_time) {\n this.calculateFPS(1 / (elapsed / 1000));\n this.last_tick = currentTime;\n this.currentTime = (currentTime - (elapsed % this.tick_time)) % this.sequence.duration;\n this.currentFrame = this.getFrameAtTime(this.currentTime);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n return true;\n }\n }\n return false;\n }\n /**\n * Calculate fps\n *\n * @private\n * @param {number} currentFPS\n */\n calculateFPS(currentFPS) {\n const samples = this.fps_samples.length;\n if (samples > 0) {\n let average = 0;\n for (let i = 0; i < samples; i++)\n average += this.fps_samples[i];\n this.fps = Math.round(average / samples);\n }\n this.fps_samples[this.fps_samples_index] = Math.round(currentFPS);\n this.fps_samples_index = (this.fps_samples_index + 1) % this.fps_samples_size;\n }\n //#endregion\n //#region Frame and Time\n /**\n * Return current animation frame\n *\n * @returns {number}\n */\n getCurrentFrame() {\n return this.currentFrame;\n }\n /**\n * get the time at specific frame number\n *\n * @param {number} frame\n * @returns {number}\n */\n getFrameTime(frame) {\n frame = math_1.mod(frame, this.sequence.frames);\n return (frame * this.tick_time) % this.sequence.duration;\n }\n /**\n * Return frame number at time\n *\n * @param {number} time\n * @returns {number}\n */\n getFrameAtTime(time) {\n return Math.round((time % this.sequence.duration) / this.tick_time);\n }\n /**\n * set current frame\n *\n * @param {number} frame\n */\n setFrame(frame) {\n this.currentFrame = math_1.mod(frame, this.sequence.frames);\n this.currentTime = this.getFrameTime(this.currentFrame);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n }\n /**\n * Return tick time (based on framerate)\n *\n * @returns {number}\n */\n getTickTime() {\n return this.tick_time;\n }\n /**\n * Return the current time\n *\n * @returns {number}\n */\n getTime() {\n return this.currentTime;\n }\n /**\n * Set animation at time\n *\n * @param {number} time\n */\n setTime(time) {\n time = math_1.mod(time, this.sequence.duration);\n this.currentTime = time;\n this.currentFrame = this.getFrameAtTime(time);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n }\n}\nexports.Timeline = Timeline;\n/**\n * Animation status started\n * @internal\n */\nTimeline.START = 'start';\n/**\n * Animation status paused\n * @internal\n */\nTimeline.PAUSE = 'pause';\n/**\n * Animation status stop\n * @internal\n */\nTimeline.STOP = 'stop';\n//# sourceMappingURL=Timeline.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fit = exports.bWorker = exports.bBrowser = exports.bNode = void 0;\nexports.bNode = typeof process !== 'undefined' &&\n typeof process.versions !== 'undefined' &&\n typeof process.versions.node !== 'undefined';\nexports.bBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';\nexports.bWorker = typeof self === 'object' && ['ServiceWorkerGlobalScope', 'DedicatedWorkerGlobalScope'].includes(self.constructor.name);\n/**\n * Utiltites\n *\n * @category Utilities\n * @export\n * @param {number} sourceWidth\n * @param {number} sourceHeight\n * @param {number} destWidth\n * @param {number} destHeight\n * @param {('cover' | 'contain' | 'none')} [fit='none']\n * @return {*} {{ x: number; y: number; width: number; height: number; scale: number }}\n */\nfunction fit(sourceWidth, sourceHeight, destWidth, destHeight, fit = 'none') {\n let x = 0, y = 0, scale = 1, finalWidth = sourceWidth, finalHeight = sourceHeight;\n const ratio = destWidth / destHeight;\n const sourceRatio = sourceWidth / sourceHeight;\n if (fit === 'contain') {\n finalWidth = ratio > sourceRatio ? (sourceWidth * destHeight) / sourceHeight : destWidth;\n finalHeight = ratio > sourceRatio ? destHeight : (sourceHeight * destWidth) / sourceWidth;\n scale = Math.max(finalWidth, finalHeight) / Math.max(sourceWidth, sourceHeight);\n }\n else if (fit === 'cover') {\n finalWidth = ratio < sourceRatio ? (sourceWidth * destHeight) / sourceHeight : destWidth;\n finalHeight = ratio < sourceRatio ? destHeight : (sourceHeight * destWidth) / sourceWidth;\n // scale = Math.min(sourceWidth, sourceHeight) / Math.min(finalWidth, finalHeight)\n scale = Math.max(finalWidth, finalHeight) / Math.max(sourceWidth, sourceHeight);\n }\n else {\n // finalWidth = sourceWidth\n // finalHeight = sourceHeight\n }\n x = (destWidth - finalWidth) / 2;\n y = (destHeight - finalHeight) / 2;\n return {\n x,\n y,\n width: finalWidth,\n height: finalHeight,\n scale,\n };\n}\nexports.fit = fit;\n//# sourceMappingURL=utils.js.map","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import * as Urpflanze from './modules-light';\nexport { Urpflanze };\nexport default Urpflanze;\n//# sourceMappingURL=index-light.js.map"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@urpflanze/js/./dist/esm/modules-light.js","webpack://@urpflanze/js/./dist/esm/core.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/Scene.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/SceneChild.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/Group.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeBase.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/index.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/common.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/mat2.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/mat2d.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/mat3.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/mat4.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/quat.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/vec4.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/vec3.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/quat2.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/vec2.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/indexedBuffer.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/propArguments.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/repetitions.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/scene-child.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/scene.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/shape-base.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/shape-primitives.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/shapes.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/math/gl-matrix-extensions.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/math/Vec2.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/math/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Adapt.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Modifier.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/Utilities.js","webpack://@urpflanze/js/./node_modules/simplex-noise/simplex-noise.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/Shape.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapePrimitive.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeLoop.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeBuffer.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeRecursive.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeFollow.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Line.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Triangle.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Rect.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Polygon.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Circle.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Star.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Rose.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Spiral.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Lissajous.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/SuperShape.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Mirror.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Smooth.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Close.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Solidify.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Subdivide.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Offset.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/types.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/utilities.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/createAnimation.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/createInterpolator.js","webpack://@urpflanze/js/./node_modules/@urpflanze/color/dist/cjs/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/color/dist/cjs/types.js","webpack://@urpflanze/js/./node_modules/@urpflanze/color/dist/cjs/conversions.js","webpack://@urpflanze/js/./node_modules/@urpflanze/color/dist/cjs/parsing.js","webpack://@urpflanze/js/./node_modules/@urpflanze/color/dist/cjs/htmlcolors.js","webpack://@urpflanze/js/./node_modules/bezier-easing/src/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/Easings.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/Animation.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/composeAnimations.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/browser/BrowserDrawerCanvas.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/DrawerCanvas.js","webpack://@urpflanze/js/./node_modules/canvas/browser.js","webpack://@urpflanze/js/./node_modules/canvas/lib/parse-font.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/Emitter.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/Timeline.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/utils.js","webpack://@urpflanze/js/webpack/bootstrap","webpack://@urpflanze/js/webpack/runtime/compat get default export","webpack://@urpflanze/js/webpack/runtime/define property getters","webpack://@urpflanze/js/webpack/runtime/hasOwnProperty shorthand","webpack://@urpflanze/js/webpack/runtime/make namespace object","webpack://@urpflanze/js/./dist/esm/index-light.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAuB;AACoC;AACyD;AACpH,yC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACH+C;AACK;AACL;AACW;AACK;AACL;AACE;AACN;AACS;AACH;AACI;AACI;AACJ;AACG;AACD;AACF;AACA;AACE;AACG;AACC;AACV;AACT;AACiN;AAC/L;AACF;AACnE,gC;;;;;;;ACzBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,qBAAqB,mBAAO,CAAC,CAAc;AAC3C,gBAAgB,mBAAO,CAAC,CAAS;AACjC,gBAAgB,mBAAO,CAAC,EAAgB;AACxC,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB;AACpC,eAAe,WAAW;AAC1B,eAAe,4BAA4B;AAC3C,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,qBAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACxVa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,eAAe,cAAc;AAC7B,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0EAA0E;AACzF,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sC;;;;;;;AClGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,gBAAgB,mBAAO,CAAC,CAAS;AACjC,qBAAqB,mBAAO,CAAC,CAAc;AAC3C,oBAAoB,mBAAO,CAAC,CAAoB;AAChD,gBAAgB,mBAAO,CAAC,EAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,SAAS;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACxTa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,oBAAoB,mBAAO,CAAC,CAAW;AACvC,gBAAgB,mBAAO,CAAC,EAAU;AAClC,aAAa,mBAAO,CAAC,EAA8B;AACnD,eAAe,mBAAO,CAAC,EAAc;AACrC,eAAe,mBAAO,CAAC,EAAS;AAChC,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,oBAAoB,mBAAO,CAAC,EAAc;AAC1C,qBAAqB,mBAAO,CAAC,CAAe;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,cAAc;AAC7B,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0EAA0E;AACzF,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,2CAA2C;AACrF,8CAA8C,2CAA2C;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,4BAA4B;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,SAAS;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;AACA,mEAAmE,SAAS;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,gCAAgC;AAClD,kBAAkB,gCAAgC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzgBwC;AACN;AACE;AACF;AACA;AACA;AACE;AACF;AACA;AACA;;;;;;;;;;;;;;;;;ACTlC;AACA;AACA;AACA;AACA;AACO;AACA;AACA;AACP;AACA;AACA;AACA,WAAW,2CAA2C;AACtD;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjDwC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA,gBAAgB;;AAEhB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AAC7S;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC/aiC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACvd;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACreiC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACttB;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzwBiC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY,+CAAgB;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA,YAAY,+CAAgB;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP,wBAAwB,kDAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;;AAExD;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,YAAY,KAAK;AACjB;;AAEO;AACP,oBAAoB,kDAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,+CAAgB,+BAA+B,+CAAgB,+BAA+B,+CAAgB;AAC/I;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,uEAAuE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB;AAC/zC;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrxDiC;AACN;AACA;AACA;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,OAAO;AACnB;;AAEO;AACP;AACA;;AAEA,UAAU,+CAAgB;AAC1B;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,aAAa;AACzB,YAAY,aAAa;AACzB,YAAY,OAAO;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;;AAE1C,gDAAgD;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH,oBAAoB,+CAAgB;AACpC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA,WAAW,8CAAe;AAC1B,WAAW,8CAAe;AAC1B,WAAW,8CAAe;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,mCAAmC;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAoC;;AAEpC;AACA,wBAAwB;;AAExB;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,EAAE;AACb,WAAW,EAAE;AACb,WAAW,EAAE;AACb,aAAa,KAAK;AAClB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,YAAY,2CAAU;AAC7B;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,iBAAiB,gDAAe;AACvC;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,WAAW,0CAAS;AAC3B;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,YAAY,2CAAU;AAC7B;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,WAAW,0CAAS;AAC3B;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO,aAAa,4CAAW;AAC/B;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;AACA;;AAEO,oBAAoB,mDAAkB;AAC7C;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,gBAAgB,+CAAc;AACrC;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO,kBAAkB,iDAAgB;AACzC;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO,aAAa,4CAAW;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,4CAAW;AAC3B,kBAAkB,gDAAe;AACjC,kBAAkB,gDAAe;AACjC;AACA,cAAc,yCAAQ;;AAEtB;AACA,MAAM,2CAAU;AAChB,UAAU,yCAAQ,sBAAsB,2CAAU;AAClD,MAAM,+CAAc;AACpB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,MAAM,2CAAU;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,aAAa,4CAAW;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrsBuC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,uBAAuB;AACvB;AACA;;AAEA;AACA;;AAEA;AACA,SAAS,8CAAe;AACxB,SAAS,8CAAe;AACxB;AACA,GAAG;;AAEH;AACA,SAAS,8CAAe;AACxB,SAAS,8CAAe;AACxB;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;;AAEhB;AACA;AACA;AACA,qCAAqC;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AAC7S;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtpBuC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,UAAU,8CAAe;AACzB,UAAU,8CAAe;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;;AAEA;AACA;AACA,4BAA4B;;AAE5B;AACA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA,YAAY;;AAEZ;AACA;AACA,YAAY;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACxN;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClxBuC;AACN;AACA;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;;AAEO;AACP,eAAe,kDAAmB;;AAElC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA,cAAc,4CAAW;AACzB,EAAE,iDAAgB;AAClB,cAAc,kDAAmB;AACjC,EAAE,oDAAmB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO,cAAc,0CAAS;AAC9B;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO,cAAc,0CAAS;AAC9B;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA,sBAAsB,+CAAgB;AACtC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,aAAa,4CAAW;AAC/B;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,oBAAoB,mDAAkB;AAC7C;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACjoB,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACl0BwC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,UAAU,8CAAe;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA,2BAA2B;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;;AAE5C;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB;AACnI;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;AC/mBY;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAiB;AACtC,aAAa,mBAAO,CAAC,EAAiB;AACtC,aAAa,mBAAO,CAAC,EAAe;AACpC,aAAa,mBAAO,CAAC,EAAe;AACpC,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAc;AACnC,aAAa,mBAAO,CAAC,EAAoB;AACzC,aAAa,mBAAO,CAAC,EAAU;AAC/B,iC;;;;;;;ACpBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD,uBAAuB,KAAK;AAC7E,uC;;;;;;;ACxBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C,qBAAqB,KAAK;AACvE,sC;;;;;;;AChBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA,4C;;;;;;;ACHa;AACb;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kC;;;;;;;ACHa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc,GAAG,cAAc,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,iBAAiB;AAChI,oBAAoB,mBAAO,CAAC,CAAW;AACvC,iBAAiB;AACjB,gBAAgB;AAChB,iBAAiB;AACjB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,gD;;;;;;;AC5Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,gBAAgB;AAChB;AACA,6BAA6B,OAAO,OAAO,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,gC;;;;;;;ACpNa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,iC;;;;;;;AClCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,GAAG,gBAAgB,GAAG,kBAAkB;AACrD,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC,kBAAkB,KAAK;AAC9D;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6BAA6B;AAC5C,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,iC;;;;;;;ACrKa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB;AACA;AACA,gBAAgB;AAChB,oC;;;;;;;ACNa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gCAAgC,GAAG,mBAAmB,GAAG,qCAAqC,GAAG,8BAA8B,GAAG,4BAA4B,GAAG,2BAA2B,GAAG,cAAc,GAAG,aAAa,GAAG,qBAAqB,GAAG,aAAa,GAAG,YAAY,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,WAAW;AAC1U,qBAAqB,mBAAO,CAAC,EAAe;AAC5C,sBAAsB,mBAAO,CAAC,EAAqB;AACnD,eAAe,mBAAO,CAAC,EAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,mBAAmB,iBAAiB;AACpC,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,gBAAgB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA,4BAA4B,qBAAqB;AACjD;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,eAAe;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yBAAyB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC,qC;;;;;;ACxWA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA,qBAAqB;AACrB;AACA,wBAAwB;AACxB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,4BAA4B;AAC5B;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,kCAAkC;AAClC;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA,6BAA6B;AAC7B;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA,mCAAmC;AACnC,qBAAqB;AACrB;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,yBAAyB;AACzB,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,iBAAiB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,gDAAgD;AAChD;AACA;;AAEA;AACA,MAAM,IAA2C,EAAE,mCAAO,YAAY,qBAAqB;AAAA,kGAAC;AAC5F;AACA,MAAM,IAA8B,EAAE,oBAAoB;AAC1D;AACA,OAAO,EAAsE;AAC7E;AACA,MAAM,IAA6B;AACnC;AACA;;AAEA,CAAC;;;;;;;;ACxdY;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,gBAAgB,mBAAO,CAAC,CAAU;AAClC,qBAAqB,mBAAO,CAAC,CAAe;AAC5C,oBAAoB,mBAAO,CAAC,CAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc,aAAa;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA,4DAA4D,SAAS;AACrE,wCAAwC;AACxC;AACA;AACA;AACA,yCAAyC,4BAA4B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,aAAa;AAC5B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACnLa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,sBAAsB;AACtB,aAAa,mBAAO,CAAC,EAA8B;AACnD,oBAAoB,mBAAO,CAAC,CAAa;AACzC,mBAAmB,mBAAO,CAAC,EAAuB;AAClD,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB,aAAa;AACpD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,0C;;;;;;;ACjJa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,eAAe,mBAAO,CAAC,EAAS;AAChC,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,yBAAyB,mBAAO,CAAC,EAA0B;AAC3D,oBAAoB,mBAAO,CAAC,CAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB,aAAa;AAC/C,eAAe,QAAQ;AACvB;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB;AACA;AACA;AACA,iDAAiD,eAAe;AAChE,sDAAsD,QAAQ;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA,eAAe,6BAA6B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,kBAAkB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,eAAe,sBAAsB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,8CAA8C;AAC9E;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,qC;;;;;;;AChOa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB;AACnB,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,yBAAyB,mBAAO,CAAC,EAA0B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB,aAAa;AACjD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,gCAAgC,8CAA8C;AAC9E;AACA;AACA;AACA;AACA,mBAAmB;AACnB,uC;;;;;;;ACnIa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,sBAAsB;AACtB,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB,aAAa;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,qDAAqD;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,6BAA6B;AACpD;AACA;AACA;AACA;AACA,sCAAsC,+BAA+B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iIAAiI,6DAA6D;AAC9L;AACA;AACA;AACA;AACA,4BAA4B,uEAAuE;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,SAAS;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,4BAA4B,8DAA8D;AAC1F,iBAAiB;AACjB;AACA;AACA,mFAAmF,gCAAgC;AACnH,wCAAwC;AACxC;AACA;AACA;AACA;AACA,4BAA4B,8DAA8D;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,oEAAoE,4BAA4B,iBAAiB,EAAE;AACnH;AACA;AACA;AACA,+BAA+B,gBAAgB;AAC/C;AACA,2DAA2D,SAAS;AACpE;AACA,+FAA+F,gCAAgC;AAC/H,oDAAoD;AACpD;AACA;AACA;AACA;AACA,wCAAwC,wDAAwD;AAChG;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;AACA,qDAAqD,4BAA4B;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA,sBAAsB;AACtB,0C;;;;;;;AChUa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB;AACnB,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB,aAAa;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,uDAAuD;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,SAAS;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,mFAAmF,gCAAgC;AACnH,uEAAuE,iCAAiC,4BAA4B,iBAAiB,EAAE;AACvJ,kDAAkD,SAAS;AAC3D;AACA,2FAA2F,gCAAgC;AAC3H,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA,iDAAiD,4BAA4B;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA,mBAAmB;AACnB,uC;;;;;;;AC3Na;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,YAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,SAAS;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,gC;;;;;;;AC5Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA,oC;;;;;;;AC1Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,gC;;;;;;;AC3Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,mC;;;;;;;ACxCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACpCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ,gC;;;;;;;AClDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc,aAAa;AAC1C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ,gC;;;;;;;ACtEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe,aAAa;AAC3C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kC;;;;;;;AC5Fa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB,aAAa;AAC/C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,qC;;;;;;;ACtDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB;AAClB,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sC;;;;;;;AC9Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,gBAAgB,mBAAO,CAAC,EAAS;AACjC,iBAAiB,mBAAO,CAAC,EAAU;AACnC,iBAAiB,mBAAO,CAAC,EAAU;AACnC,mBAAmB,mBAAO,CAAC,EAAY;AACvC,oBAAoB,mBAAO,CAAC,EAAa;AACzC,gBAAgB,mBAAO,CAAC,EAAS;AACjC,iBAAiB,mBAAO,CAAC,EAAU;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,iC;;;;;;;ACpBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACtDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,oBAAoB,mBAAO,CAAC,EAAc;AAC1C,gBAAgB,mBAAO,CAAC,EAAS;AACjC,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,SAAS;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACvEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;AC3Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,oC;;;;;;;ACvHa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,WAAW;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,qC;;;;;;;ACxDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,wBAAwB,yBAAyB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACfa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAa;AAClC,aAAa,mBAAO,CAAC,EAAmB;AACxC,aAAa,mBAAO,CAAC,EAAsB;AAC3C,aAAa,mBAAO,CAAC,EAAW;AAChC,aAAa,mBAAO,CAAC,EAAa;AAClC,iC;;;;;;;AClBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,2BAA2B,GAAG,2BAA2B,GAAG,YAAY,GAAG,YAAY,GAAG,mBAAmB,GAAG,aAAa;AAC7H;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,mBAAmB;AAC9B,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,EAAE,GAAG,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,mBAAmB;AAC9B,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,mBAAmB,cAAc,GAAG,cAAc,GAAG,cAAc,GAAG,MAAM;AAC5E;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA,mBAAmB,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,MAAM;AAC1C;AACA,2BAA2B;AAC3B,qC;;;;;;;AC9Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uBAAuB;AACvB,6BAA6B,mBAAO,CAAC,EAAsB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8DAA8D;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2C;;;;;;;ACpGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,0BAA0B,GAAG,mCAAmC;AAChE,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,wBAAwB,mBAAO,CAAC,EAAe;AAC/C,kBAAkB,mBAAO,CAAC,EAAW;AACrC,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,8C;;;;;;;ACxGa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAe;AACpC,aAAa,mBAAO,CAAC,EAAW;AAChC,iC;;;;;;;ACfa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6DAA6D;AAC5E;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,uC;;;;;;;ACzFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB,GAAG,4BAA4B;AACjD,qBAAqB,mBAAO,CAAC,EAAc;AAC3C,sBAAsB,mBAAO,CAAC,EAAe;AAC7C;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,6BAA6B,IAAI;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,mC;;;;;;;AC1Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,sC;;;;;;AClJA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,uBAAuB,oCAAoC;AAC3D,uBAAuB,8BAA8B;AACrD,uBAAuB,kBAAkB;;AAEzC;AACA,oCAAoC,8DAA8D;;AAElG;AACA,kCAAkC,sEAAsE;;AAExG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;;AAEA;AACA;AACA;AACA;;AAEA,UAAU,mEAAmE;AAC7E;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe;AACf,mC;;;;;;;AChca;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,wBAAwB,GAAG,cAAc,GAAG,YAAY,GAAG,eAAe,GAAG,cAAc,GAAG,8BAA8B;AAC5H,4BAA4B,mBAAO,CAAC,EAAqB;AACzD,0BAA0B,mBAAO,CAAC,EAAmB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB,qC;;;;;;;ACpEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yBAAyB;AACzB,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,0BAA0B,mBAAO,CAAC,EAAmB;AACrD,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA,WAAW,wBAAwB;AACnC,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6C;;;;;;;ACxDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,2BAA2B;AAC3B,uBAAuB,mBAAO,CAAC,EAAiB;AAChD,gBAAgB,mBAAO,CAAC,EAAU;AAClC;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,+C;;;;;;;AChGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,oBAAoB;AACpB,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,oBAAoB,mBAAO,CAAC,EAAoC;AAChE,eAAe,mBAAO,CAAC,EAA+B;AACtD,eAAe,mBAAO,CAAC,EAAoC;AAC3D,iBAAiB,mBAAO,CAAC,EAAQ;AACjC,kBAAkB,mBAAO,CAAC,EAAW;AACrC,mBAAmB,mBAAO,CAAC,EAAY;AACvC,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6BAA6B;AAC5C,eAAe,wBAAwB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,2BAA2B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,0BAA0B;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qGAAqG,uCAAuC;AAC5I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,KAAK;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oGAAoG,OAAO;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,eAAe,QAAQ;AACvB,eAAe,qBAAqB;AACpC,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB,eAAe,OAAO;AACtB,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW;AAC7E,8BAA8B,SAAS,GAAG,SAAS,IAAI,SAAS,IAAI,WAAW;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,wC;;;;;;ACvXA;;AAEA,kBAAkB,mBAAO,CAAC,EAAkB;;AAE5C,iBAAiB;;AAEjB,oBAAoB;AACpB,0DAA0D,+BAA+B;AACzF;;AAEA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA;AACA;;AAEA,gCAAgC,WAAW;AAC3C,iCAAiC,WAAW;;AAE5C;AACA,GAAG;AACH;;;;;;;;AClCY;;AAEZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACrGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,6CAA6C;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,8CAA8C;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,6BAA6B;AAC5C;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,mC;;;;;;;AC3Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,oBAAoB,mBAAO,CAAC,EAAoC;AAChE,eAAe,mBAAO,CAAC,EAA+B;AACtD,kBAAkB,mBAAO,CAAC,EAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,2BAA2B,aAAa;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oC;;;;;;;ACxRa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,eAAe,GAAG,gBAAgB,GAAG,aAAa;AAChE,aAAa;AACb;AACA;AACA,gBAAgB;AAChB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,+BAA+B;AAC1C,YAAY,EAAE,IAAI,WAAW,WAAW,eAAe,gBAAgB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,iC;;;;;SClDA;SACA;;SAEA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;;SAEA;SACA;;SAEA;SACA;SACA;;;;;UCtBA;UACA;UACA;UACA;UACA;UACA,gCAAgC,YAAY;UAC5C;UACA,E;;;;;UCPA;UACA;UACA;UACA;UACA,wCAAwC,yCAAyC;UACjF;UACA;UACA,E;;;;;UCPA,wF;;;;;UCAA;UACA;UACA;UACA,sDAAsD,kBAAkB;UACxE;UACA,+CAA+C,cAAc;UAC7D,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACNgC;AAChC,uC","file":"urpflanze-light.js","sourcesContent":["export * from './core';\nexport * as Animation from '@urpflanze/animation/dist/cjs';\nexport { BrowserDrawerCanvas as DrawerCanvas } from '@urpflanze/drawer-canvas/dist/cjs/browser/BrowserDrawerCanvas';\n//# sourceMappingURL=modules-light.js.map","export * from '@urpflanze/core/dist/cjs/Scene';\nexport * from '@urpflanze/core/dist/cjs/SceneChild';\nexport * from '@urpflanze/core/dist/cjs/Group';\nexport * from '@urpflanze/core/dist/cjs/shapes/ShapeBase';\nexport * from '@urpflanze/core/dist/cjs/shapes/ShapePrimitive';\nexport * from '@urpflanze/core/dist/cjs/shapes/ShapeLoop';\nexport * from '@urpflanze/core/dist/cjs/shapes/ShapeBuffer';\nexport * from '@urpflanze/core/dist/cjs/shapes/Shape';\nexport * from '@urpflanze/core/dist/cjs/shapes/ShapeRecursive';\nexport * from '@urpflanze/core/dist/cjs/shapes/ShapeFollow';\nexport * from '@urpflanze/core/dist/cjs/shapes/primitives/Line';\nexport * from '@urpflanze/core/dist/cjs/shapes/primitives/Triangle';\nexport * from '@urpflanze/core/dist/cjs/shapes/primitives/Rect';\nexport * from '@urpflanze/core/dist/cjs/shapes/primitives/Polygon';\nexport * from '@urpflanze/core/dist/cjs/shapes/primitives/Circle';\nexport * from '@urpflanze/core/dist/cjs/shapes/primitives/Star';\nexport * from '@urpflanze/core/dist/cjs/shapes/primitives/Rose';\nexport * from '@urpflanze/core/dist/cjs/shapes/primitives/Spiral';\nexport * from '@urpflanze/core/dist/cjs/shapes/primitives/Lissajous';\nexport * from '@urpflanze/core/dist/cjs/shapes/primitives/SuperShape';\nexport * from '@urpflanze/core/dist/cjs/modifiers/Modifier';\nexport * from '@urpflanze/core/dist/cjs/modifiers';\nexport { lerp, clamp, relativeClamp, toDegrees, toRadians, now, noise, random, angleFromRepetition, angle2FromRepetition, distanceFromRepetition, interpolate, prepareBufferForInterpolation, distributePointsInBuffer, } from '@urpflanze/core/dist/cjs/Utilities';\nexport { default as Vec2 } from '@urpflanze/core/dist/cjs/math/Vec2';\nexport { PHI, PI2, log, mod } from '@urpflanze/core/dist/cjs/math';\n//# sourceMappingURL=core.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Scene = void 0;\nconst SceneChild_1 = require(\"./SceneChild\");\nconst Group_1 = require(\"./Group\");\nconst Shape_1 = require(\"./shapes/Shape\");\nconst Utilities_1 = require(\"./Utilities\");\n/**\n * Container for all SceneChild.\n * The main purpose is to manage the drawing order and update the child buffers\n *\n * @order 1\n * @category Core.Scene\n * @class Scene\n */\nclass Scene {\n /**\n * Creates an instance of Scene.\n * You can see the default values in the property definitions\n */\n constructor(settings = {}) {\n /**\n * Logical number, the drawer will take care of defining the unit of measure\n */\n this.width = 400;\n /**\n * Logical number, the drawer will take care of defining the unit of measure\n */\n this.height = 400;\n /**\n * Default background color (black)\n */\n this.background = 'hsla(0, 0%, 0%, 1)';\n /**\n * Default ScenePrimitive stroke color (white)\n */\n this.color = 'hsla(0, 0%, 100%, 1)';\n /**\n * Current time\n */\n this.currentTime = 0;\n if (typeof settings.width !== 'undefined')\n this.width = settings.width;\n if (typeof settings.height !== 'undefined')\n this.height = settings.height;\n if (typeof settings.background !== 'undefined')\n this.background = settings.background;\n if (typeof settings.color !== 'undefined')\n this.color = settings.color;\n this.children = [];\n this.center = [this.width / 2, this.height / 2];\n this.anchor =\n settings.anchor && Array.isArray(settings.anchor)\n ? [\n typeof settings.anchor[0] === 'number'\n ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[0]) * 0.5) * this.width\n : settings.anchor[0] === 'left'\n ? 0\n : settings.anchor[0] === 'right'\n ? this.width\n : this.center[0],\n typeof settings.anchor[1] === 'number'\n ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[1]) * 0.5) * this.height\n : settings.anchor[1] === 'top'\n ? 0\n : settings.anchor[1] === 'bottom'\n ? this.height\n : this.center[1],\n ]\n : [this.center[0], this.center[1]];\n }\n /**\n * Return width percentage\n *\n * @param {number} [percentage=100]\n * @returns {number}\n */\n getWidth(percentage = 100) {\n return (this.width * percentage) / 100;\n }\n /**\n * Return height percentage\n *\n * @param {number} [percentage=100]\n * @returns {number}\n */\n getHeight(percentage = 100) {\n return (this.height * percentage) / 100;\n }\n /**\n * Resize the scene size\n *\n * @param {number} width\n * @param {number} [height=width]\n * @memberof Scene\n */\n resize(width, height = width) {\n this.width = width;\n this.height = height;\n this.center = [this.width / 2, this.height / 2];\n const anchor = [this.width / this.anchor[0], this.height / this.anchor[1]];\n this.anchor = [this.width / anchor[0], this.height / anchor[1]];\n this.children.forEach(sceneChild => sceneChild.clearBuffer(true, false));\n }\n /**\n * Update all children, generate a streamable buffer for drawing\n *\n * @param {number} [atTime] time in ms\n * @memberof Scene\n */\n update(atTime = 0) {\n this.currentTime = atTime;\n for (let i = 0, len = this.children.length; i < len; i++) {\n this.children[i].generate(this.currentTime, true);\n }\n }\n /**\n * Traverse the child buffer and use it with callback\n *\n * @param {(streamArguments: IStreamArguments) => void} callback\n * @memberof Scene\n */\n stream(callback) {\n this.children.forEach(sceneChild => sceneChild.stream(callback));\n }\n /*\n |--------------------------------------------------------------------------\n | SceneChild\n |--------------------------------------------------------------------------\n */\n /**\n * Return a list of children\n *\n * @returns {Array}\n * @memberof Scene\n */\n getChildren() {\n return this.children;\n }\n /**\n * Add SceneChild to Scene, pass `order` as last parameter for drawing priorities\n *\n * @param {Array} items\n * @param {number} [order]\n * @memberof Scene\n */\n add(...items /**, order: number */) {\n const order = typeof items[items.length - 1] === 'number' ? items[items.length - 1] : undefined;\n const len = items.length - (typeof order === 'undefined' ? 0 : 1);\n for (let i = 0; i < len; i++) {\n const item = items[i];\n item.order =\n typeof order !== 'undefined'\n ? order + i\n : typeof item.order !== 'undefined'\n ? item.order\n : this.children.length > 0\n ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1\n : 0;\n Scene.propagateToChilden(item, this);\n this.children.push(item);\n item.clearBuffer(true, false);\n item.generate(0, true);\n }\n this.sortChildren();\n }\n /**\n * Sort children by order\n *\n * @memberof Scene\n */\n sortChildren() {\n this.children.sort((a, b) => a.order - b.order);\n this.children = this.children.map((child, index) => {\n child.order = index;\n return child;\n });\n }\n /**\n * Find sceneChild from id or name in the whole scene\n *\n * @param {string | number} idOrName\n * @returns {(SceneChild | null)}\n * @memberof Scene\n */\n find(idOrName) {\n const children = this.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const result = children[i].find(idOrName);\n if (result !== null)\n return result;\n }\n return null;\n }\n /**\n * Get shape by index\n *\n * @param {number} index\n * @returns {(SceneChild | null)}\n * @memberof Scene\n */\n get(index) {\n return index >= 0 && index < this.children.length ? this.children[index] : null;\n }\n /**\n * Remove a shape by index\n *\n * @param {number} index\n * @memberof Scene\n */\n remove(index) {\n index >= 0 && index < this.children.length && this.children.splice(index, 1);\n }\n /**\n * Removes all children\n *\n * @memberof Scene\n */\n removeChildren() {\n this.children = [];\n }\n /**\n * Remove sceneChild by id or name\n *\n * @param {number | number} idOrName\n * @memberof Scene\n */\n removeFromId(idOrName) {\n for (let i = 0, len = this.children.length; i < len; i++)\n if (this.children[i].id === idOrName || this.children[i].name === idOrName) {\n this.children.splice(i, 1);\n return;\n }\n }\n /**\n * Return true if sceneChild is direct children\n *\n * @param {SceneChild} sceneChild\n * @returns {boolean}\n * @memberof Scene\n */\n isFirstLevelChild(sceneChild) {\n for (let i = 0, len = this.children.length; i < len; i++)\n if (this.children[i].id === sceneChild.id)\n return true;\n const parents = this.getParentsOfSceneChild(sceneChild);\n return parents.length === 1 && parents[0] instanceof Group_1.Group;\n }\n /**\n * Returns the list of sceneChild hierarchy starting from the scene\n *\n * @param {SceneChild} sceneChild\n * @returns {Array}\n * @memberof Scene\n */\n getParentsOfSceneChild(sceneChild) {\n const result = Scene.getParentsOfSceneChild(this, sceneChild);\n if (result) {\n result.splice(0, 1);\n return result;\n }\n return [];\n }\n /**\n * Returns the list of sceneChild hierarchy starting from the scene\n *\n * @static\n * @param {(Scene | SceneChild)} current\n * @param {SceneChild} sceneChild\n * @param {(Array)} [parents=[]]\n * @returns {(Array | null)}\n * @memberof Scene\n */\n static getParentsOfSceneChild(current, sceneChild, parents = []) {\n let result;\n if (current instanceof SceneChild_1.SceneChild) {\n if (current.id == sceneChild.id)\n return parents;\n if (current instanceof Shape_1.Shape && current.shape) {\n const tmpParents = parents.slice();\n tmpParents.push(current);\n if ((result = Scene.getParentsOfSceneChild(current.shape, sceneChild, tmpParents)))\n return result;\n }\n }\n if (current instanceof Scene || current instanceof Group_1.Group) {\n const children = current.getChildren();\n parents.push(current);\n for (let i = 0, len = children.length; i < len; i++) {\n const child = children[i];\n if ((result = Scene.getParentsOfSceneChild(child, sceneChild, parents)))\n return result;\n }\n parents.pop();\n }\n return null;\n }\n /**\n * Walk through the scene\n *\n * @static\n * @param {SceneChild} callbackk\n * @param {(Scene | SceneChild)} current\n * @memberof Scene\n */\n static walk(callback, current) {\n if (current instanceof SceneChild_1.SceneChild) {\n if (callback(current) === false)\n return false;\n if (current instanceof Shape_1.Shape && current.shape)\n if (Scene.walk(callback, current.shape) === false)\n return false;\n }\n if (current instanceof Scene || current instanceof Group_1.Group) {\n const children = current.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const child = children[i];\n if (Scene.walk(callback, child) === false)\n return false;\n }\n }\n }\n /**\n * Propagate scene to sceneChild (and children)\n *\n * @static\n * @param {SceneChild} sceneChild\n * @param {Scene} scene\n * @memberof Scene\n */\n static propagateToChilden(sceneChild, scene) {\n sceneChild.scene = scene;\n if (sceneChild instanceof Group_1.Group) {\n sceneChild.getChildren().forEach((item) => {\n Scene.propagateToChilden(item, scene);\n });\n }\n else if (sceneChild instanceof Shape_1.Shape && sceneChild.shape) {\n sceneChild.shape.scene = scene;\n Scene.propagateToChilden(sceneChild.shape, scene);\n }\n }\n}\nexports.Scene = Scene;\n//# sourceMappingURL=Scene.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SceneChild = void 0;\n/**\n * Autoincrement sceneChild default id\n *\n * @internal\n * @ignore\n */\nlet __id = 0;\n/**\n * The element to be added into a scene.\n * Preserve props, drawing order, generate and return buffers.\n * The only implementations of this class are Group and ShapeBase\n *\n * @abstract\n * @category Core.Abstract\n * @order 2\n * @class SceneChild\n */\nclass SceneChild {\n /**\n * Creates an instance of SceneChild.\n * Base values will be assigned in case they are not passed\n *\n * @param {ISceneChildSettings} settings\n */\n constructor(settings) {\n var _a;\n /**\n * Shape generation id\n * used for prevent buffer calculation\n *\n * @internal\n * @ignore\n */\n this.generateId = -1;\n this.id = (_a = settings.id) !== null && _a !== void 0 ? _a : ++__id;\n this.type = settings.type || 'SceneChild';\n this.name = settings.name || this.type + '_' + this.id;\n this.data = settings.data || {};\n this.props = {};\n }\n /**\n * Find this or form or children.\n * Overridden by classes that extend it\n *\n * @param {string | number} idOrName\n * @returns {(SceneChild | null)}\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n return null;\n }\n /**\n * Return the sceneChild properties\n *\n * @returns {Props}\n */\n getProps() {\n return this.props;\n }\n /**\n * Return a sceneChild prop or default value\n *\n * @param {keyof Props} key\n * @param {PropArguments} [propArguments]\n * @param {*} [defaultValue]\n * @returns {*}\n */\n getProp(key, propArguments, defaultValue) {\n var _a;\n return ((_a = this.props[key]) !== null && _a !== void 0 ? _a : defaultValue);\n }\n /**\n * Check SceneChild has prop\n *\n * @param {keyof Props} key\n * @returns\n */\n hasProp(key) {\n return typeof this.props[key] !== 'undefined';\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n */\n setPropUnsafe(key, value) {\n if (typeof key == 'string')\n this.props[key] = value;\n else\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n }\n}\nexports.SceneChild = SceneChild;\n//# sourceMappingURL=SceneChild.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Group = void 0;\nconst Scene_1 = require(\"./Scene\");\nconst SceneChild_1 = require(\"./SceneChild\");\nconst ShapeBase_1 = require(\"./shapes/ShapeBase\");\nconst Adapt_1 = require(\"./modifiers/Adapt\");\n/**\n * A SceneChild container, propagates properties to children\n *\n * @order 3\n * @category Core.Scene\n * @extends {SceneChild}\n * @example\n * ```javascript\n * // Group example\n *\n * const rect = new Urpflanze.Rect({\n * \tdistance: 100 // <- if a property is set the group will not overwrite it\n * })\n * const group = new Urpflanze.Group({\n * \trepetitions: 3,\n * \tdistance: 200\n * })\n *\n * group.add(rect)\n * group.add(new Urpflanze.Triangle())\n * ```\n * @class Group\n */\nclass Group extends SceneChild_1.SceneChild {\n /**\n * Creates an instance of Group\n *\n * @param {ISceneChildSettings} [settings={}]\n * @memberof Group\n */\n constructor(settings = {}) {\n settings.type = 'Group';\n super(settings);\n this.children = [];\n ['id', 'name', 'data', 'order', 'type'].forEach((prop) => {\n if (prop in settings)\n delete settings[prop];\n });\n this.props = settings;\n }\n /**\n * Check group has static children\n *\n * @returns {boolean}\n * @memberof Group\n */\n isStatic() {\n const children = this.children;\n for (let i = 0, len = children.length; i < len; i++)\n if (!children[i].isStatic())\n return false;\n return true;\n }\n /**\n * Check group has static children indexed\n *\n * @returns {boolean}\n * @memberof Group\n */\n isStaticIndexed() {\n const children = this.children;\n for (let i = 0, len = children.length; i < len; i++)\n if (!children[i].isStaticIndexed())\n return false;\n return true;\n }\n /**\n * Add item to Group\n *\n * @param {Array} items\n * @memberof Group\n */\n add(...items) {\n for (let i = 0, len = items.length; i < len; i++) {\n const item = items[i];\n const rawItemProps = item.getProps();\n Object.keys(this.props).forEach((propKey) => {\n if (typeof rawItemProps[propKey] === 'undefined')\n item.setProp(propKey, this.props[propKey]);\n });\n item.order =\n typeof item.order !== 'undefined'\n ? item.order\n : this.children.length > 0\n ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1\n : 0;\n this.scene && Scene_1.Scene.propagateToChilden(item, this.scene);\n this.children.push(item);\n }\n this.sortChildren();\n }\n /**\n * Sort children\n *\n * @memberof Group\n */\n sortChildren() {\n this.children.sort((a, b) => a.order - b.order);\n this.children = this.children.map((child, index) => {\n child.order = index;\n return child;\n });\n this.clearBuffer(true);\n }\n /**\n * Return shape children\n *\n * @returns {Array}\n * @memberof Group\n */\n getChildren() {\n return this.children;\n }\n /**\n * Find scene child from id or name\n *\n * @param {number | string} idOrName\n * @returns {(SceneChild | null)}\n * @memberof Group\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n const children = this.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const result = children[i].find(idOrName);\n if (result !== null)\n return result;\n }\n return null;\n }\n /**\n * Get item from group\n *\n * @param {number} index\n * @returns {(SceneChild | null)}\n * @memberof Group\n */\n get(index) {\n return index >= 0 && index < this.children.length ? this.children[index] : null;\n }\n /**\n * Remove item from group\n *\n * @param {number} index\n * @returns {(false | Array)}\n * @memberof Group\n */\n remove(index) {\n if (index >= 0 && index < this.children.length) {\n const removed = this.children.splice(index, 1);\n this.clearBuffer(true);\n return removed;\n }\n return false;\n }\n /**\n * Remove from id\n *\n * @param {number} id\n * @memberof Scene\n */\n removeFromId(id) {\n for (let i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i].id == id) {\n this.children.splice(i, 1);\n return this.clearBuffer(true);\n }\n }\n }\n /**\n * Generate children buffers\n *\n * @param {number} generateId\n * @param {boolean} [bDirectSceneChild=false]\n * @param {IPropArguments} [parentPropArguments]\n * @memberof Group\n */\n generate(generateId, bDirectSceneChild = false, parentPropArguments) {\n this.generateId = generateId;\n this.children.forEach(item => item.generate(generateId, bDirectSceneChild, parentPropArguments));\n }\n /**\n * Sum the children bounding\n *\n * @return {IShapeBounding}\n */\n getBounding() {\n const boundings = [];\n const bounding = Adapt_1.Bounding.empty();\n if (this.children.length > 0) {\n this.children.forEach(item => boundings.push(item.getBounding()));\n for (let i = 0, len = this.children.length; i < len; i++) {\n bounding.x = bounding.x > boundings[i].x ? boundings[i].x : bounding.x;\n bounding.y = bounding.y > boundings[i].y ? boundings[i].y : bounding.y;\n bounding.width = bounding.width < boundings[i].width ? boundings[i].width : bounding.width;\n bounding.height = bounding.height < boundings[i].height ? boundings[i].height : bounding.height;\n }\n bounding.cx = bounding.x + bounding.width / 2;\n bounding.cy = bounding.y + bounding.height / 2;\n }\n return bounding;\n }\n /**\n * Chear children buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @memberof Group\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.children.forEach(item => item.clearBuffer(bClearIndexed, false));\n if (this.scene && bPropagateToParents) {\n const parents = this.scene.getParentsOfSceneChild(this);\n parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */);\n }\n // if (bPropagateToParents && this.scene)\n // {\n // const parents = this.scene.getParentsOfSceneChild(this)\n // parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, true, false)\n // }\n // if (bPropagateToChildren)\n // {\n // this.children.forEach(sceneChild => sceneChild.clearBuffer(bClearIndexed, false, true))\n // }\n }\n /**\n * Set a single or multiple props\n *\n * @abstract\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @memberof SceneChild\n */\n setProp(key, value) {\n if (typeof key === 'object')\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n else\n this.props[key] = value;\n this.children.forEach(item => item.setProp(key, value));\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @memberof ShapeBase\n */\n setPropUnsafe(key, value) {\n super.setPropUnsafe(key, value);\n this.children.forEach(item => item.setPropUnsafe(key, value));\n }\n /**\n * Return length of buffer\n *\n * @param {IPropArguments} propArguments\n * @returns {number}\n * @memberof Group\n */\n getBufferLength(propArguments) {\n return this.children.map(sceneChild => sceneChild.getBufferLength(propArguments)).reduce((p, c) => p + c, 0);\n }\n /**\n * return a single buffer binded from children\n *\n * @returns {Float32Array}\n * @memberof Group\n */\n getBuffer() {\n const buffers = this.children\n .map(item => item.getBuffer())\n .filter(b => b !== undefined);\n const size = buffers.reduce((currLength, buffer) => currLength + buffer.length, 0);\n if (size > 0) {\n const result = new Float32Array(size);\n result.set(buffers[0], 0);\n for (let i = 1, offset = 0, len = buffers.length; i < len; i++) {\n offset += buffers[i - 1].length;\n result.set(buffers[i], offset);\n }\n return result;\n }\n return ShapeBase_1.ShapeBase.EMPTY_BUFFER;\n }\n /**\n * return a single buffer binded from children\n *\n * @returns {(Array | undefined)}\n * @memberof Group\n */\n getIndexedBuffer() {\n const indexed = this.children.map(item => item.getIndexedBuffer()).filter(b => b !== undefined);\n return [].concat.apply([], indexed);\n }\n /**\n * Call strem on children\n *\n * @param {(streamArguments: IStreamArguments) => void} callback\n * @memberof Group\n */\n stream(callback) {\n this.children.forEach(item => item.stream(callback));\n }\n}\nexports.Group = Group;\n//# sourceMappingURL=Group.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeBase = void 0;\nconst gl_matrix_1 = require(\"gl-matrix\");\nconst types_1 = require(\"../types\");\nconst glme = require(\"../math/gl-matrix-extensions\");\nconst Vec2_1 = require(\"../math/Vec2\");\nconst math_1 = require(\"../math\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst Utilities_1 = require(\"../Utilities\");\nconst SceneChild_1 = require(\"../SceneChild\");\nconst tmpMatrix = gl_matrix_1.mat4.create();\nconst transformMatrix = gl_matrix_1.mat4.create();\nconst perspectiveMatrix = gl_matrix_1.mat4.create();\nconst repetitionMatrix = gl_matrix_1.mat4.create();\n/**\n * Main class for shape generation\n *\n * @category Core.Abstract\n * @abstract\n * @class ShapeBase\n * @order 4\n * @extends {SceneChild}\n */\nclass ShapeBase extends SceneChild_1.SceneChild {\n /**\n * Creates an instance of ShapeBase\n *\n * @param {ISceneChildSettings} [settings={}]\n */\n constructor(settings = {}) {\n super(settings);\n /**\n * Flag used to determine if indexedBuffer has been generated\n *\n * @internal\n * @ignore\n */\n this.bIndexed = false;\n /**\n * Array used for index a vertex buffer\n * only for first level scene children\n *\n * @internal\n * @ignore\n */\n this.indexedBuffer = [];\n /**\n * The bounding inside the scene\n *\n * @type {IShapeBounding}\n */\n this.bounding = {\n cx: 0,\n cy: 0,\n x: -1,\n y: -1,\n width: 2,\n height: 2,\n };\n this.props = {\n distance: settings.distance,\n repetitions: settings.repetitions,\n rotateX: settings.rotateX,\n rotateY: settings.rotateY,\n rotateZ: settings.rotateZ,\n skewX: settings.skewX,\n skewY: settings.skewY,\n squeezeX: settings.squeezeX,\n squeezeY: settings.squeezeY,\n displace: settings.displace,\n translate: settings.translate,\n scale: settings.scale,\n transformOrigin: settings.transformOrigin,\n perspective: settings.perspective,\n perspectiveOrigin: settings.perspectiveOrigin,\n };\n this.anchor =\n settings.anchor && Array.isArray(settings.anchor)\n ? [\n typeof settings.anchor[0] === 'number'\n ? Utilities_1.clamp(-1, 1, settings.anchor[0]) * -1\n : settings.anchor[0] === 'left'\n ? 1\n : settings.anchor[0] === 'right'\n ? -1\n : 0,\n typeof settings.anchor[1] === 'number'\n ? Utilities_1.clamp(-1, 1, settings.anchor[1]) * -1\n : settings.anchor[1] === 'top'\n ? 1\n : settings.anchor[1] === 'bottom'\n ? -1\n : 0,\n ]\n : [0, 0];\n this.boundingType =\n typeof settings.boundingType === 'string'\n ? settings.boundingType === 'relative'\n ? types_1.EBoundingType.Relative\n : types_1.EBoundingType.Fixed\n : settings.boundingType || types_1.EBoundingType.Fixed;\n this.vertexCallback = settings.vertexCallback;\n }\n /**\n * Check if the shape should be generated every time\n *\n * @returns {boolean}\n */\n isStatic() {\n const props = this.props;\n return (typeof props.repetitions !== 'function' &&\n typeof props.distance !== 'function' &&\n typeof props.displace !== 'function' &&\n typeof props.scale !== 'function' &&\n typeof props.translate !== 'function' &&\n typeof props.skewX !== 'function' &&\n typeof props.skewY !== 'function' &&\n typeof props.squeezeX !== 'function' &&\n typeof props.squeezeY !== 'function' &&\n typeof props.rotateX !== 'function' &&\n typeof props.rotateY !== 'function' &&\n typeof props.rotateZ !== 'function' &&\n typeof props.transformOrigin !== 'function' &&\n typeof props.perspective !== 'function' &&\n typeof props.perspectiveOrigin !== 'function');\n }\n /**\n * Check if the indexedBuffer array needs to be recreated every time,\n * this can happen when a shape generates an array of vertices different in length at each repetition\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return typeof this.props.repetitions !== 'function';\n }\n /**\n * Return a prop value\n *\n * @param {keyof ISceneChildProps} key\n * @param {PropArguments} [propArguments]\n * @param {*} [defaultValue]\n * @returns {*}\n */\n getProp(key, propArguments, defaultValue) {\n let attribute = this.props[key];\n if (typeof attribute === 'function') {\n attribute = attribute(propArguments);\n }\n return typeof attribute === 'undefined' || Number.isNaN(attribute) ? defaultValue : attribute;\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @param {boolean} [bClearIndexed=false]\n */\n setProp(key, value, bClearIndexed = false) {\n if (typeof key === 'string') {\n bClearIndexed = bClearIndexed || key == 'repetitions';\n this.props[key] = value;\n }\n else {\n bClearIndexed = bClearIndexed || 'repetitions' in key;\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n }\n this.clearBuffer(bClearIndexed, true);\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.buffer = undefined;\n if (bClearIndexed) {\n this.bIndexed = false;\n this.indexedBuffer = [];\n }\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n if (bPropagateToParents && this.scene && !this.scene.isFirstLevelChild(this)) {\n const parents = this.scene.getParentsOfSceneChild(this);\n parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */);\n }\n }\n /**\n * Update the vertex array if the shape is not static and update the indexedBuffer if it is also not static\n *\n * @param {number} generateId generation id\n * @param {boolean} [bDirectSceneChild=false] adjust shape of center of scene\n * @param {PropArguments} [parentPropArguments]\n */\n generate(generateId = 0, bDirectSceneChild = false, parentPropArguments) {\n var _a, _b;\n if (this.buffer && this.bStatic) {\n return;\n }\n this.generateId = generateId;\n if (!this.bStaticIndexed || !this.bIndexed)\n this.indexedBuffer = [];\n const propArguments = ShapeBase.getEmptyPropArguments(this, parentPropArguments);\n const repetition = propArguments.repetition;\n const repetitions = this.getProp('repetitions', propArguments, 1);\n const repetitionType = Array.isArray(repetitions) ? types_1.ERepetitionType.Matrix : types_1.ERepetitionType.Ring;\n const repetitionCount = Array.isArray(repetitions)\n ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0])\n : repetitions;\n const repetitionRowCount = Array.isArray(repetitions) ? repetitions[0] : repetitionCount;\n const repetitionColCount = Array.isArray(repetitions) ? (_b = repetitions[1]) !== null && _b !== void 0 ? _b : repetitions[0] : 1;\n const rowRepetition = repetition.row;\n rowRepetition.count = repetitionRowCount;\n const colRepetition = repetition.col;\n colRepetition.count = repetitionColCount;\n repetition.count = repetitionCount;\n repetition.col.count = repetitionColCount;\n repetition.row.count = repetitionRowCount;\n repetition.type = repetitionType;\n let totalBufferLength = 0;\n const buffers = [];\n let currentIndex = 0;\n const centerMatrix = gl_matrix_1.vec2.fromValues((repetitionColCount - 1) / 2, (repetitionRowCount - 1) / 2);\n const sceneAnchor = this.scene ? [this.scene.anchor[0], this.scene.anchor[1], 0] : [0, 0, 0];\n const tmpTotalShapeBounding = [undefined, undefined, undefined, undefined];\n const tmpSingleRepetitionBounding = [undefined, undefined, undefined, undefined];\n for (let currentRowRepetition = 0; currentRowRepetition < repetitionRowCount; currentRowRepetition++) {\n for (let currentColRepetition = 0; currentColRepetition < repetitionColCount; currentColRepetition++, currentIndex++) {\n repetition.index = currentIndex + 1;\n repetition.offset = repetitionCount > 1 ? currentIndex / (repetitionCount - 1) : 1;\n repetition.angle = repetitionType === types_1.ERepetitionType.Ring ? (math_1.PI2 / repetitionCount) * currentIndex : 0;\n colRepetition.index = currentColRepetition + 1;\n colRepetition.offset = repetitionColCount > 1 ? currentColRepetition / (repetitionColCount - 1) : 1;\n rowRepetition.index = currentRowRepetition + 1;\n rowRepetition.offset = repetitionRowCount > 1 ? currentRowRepetition / (repetitionRowCount - 1) : 1;\n // Generate primitives buffer recursively\n const buffer = this.generateBuffer(generateId, propArguments);\n const bufferLength = buffer.length;\n const bounding = this.getShapeBounding();\n buffers[currentIndex] = new Float32Array(bufferLength);\n totalBufferLength += bufferLength;\n {\n const distance = glme.toVec2(this.getProp('distance', propArguments, glme.VEC2_ZERO));\n const displace = this.getProp('displace', propArguments, 0);\n const scale = glme.toVec3(this.getProp('scale', propArguments, glme.VEC2_ONE), 1);\n const translate = glme.toVec3(this.getProp('translate', propArguments, glme.VEC2_ZERO), 0);\n const skewX = this.getProp('skewX', propArguments, 0);\n const skewY = this.getProp('skewY', propArguments, 0);\n const squeezeX = this.getProp('squeezeX', propArguments, 0);\n const squeezeY = this.getProp('squeezeY', propArguments, 0);\n const rotateX = this.getProp('rotateX', propArguments, 0);\n const rotateY = this.getProp('rotateY', propArguments, 0);\n const rotateZ = this.getProp('rotateZ', propArguments, 0);\n const perspective = Utilities_1.clamp(0, 1, this.getProp('perspective', propArguments, 0));\n const perspectiveOrigin = glme.toVec3(this.getProp('perspectiveOrigin', propArguments, glme.VEC2_ZERO), 0);\n const transformOrigin = glme.toVec3(this.getProp('transformOrigin', propArguments, glme.VEC2_ZERO), 0);\n let offset;\n switch (repetitionType) {\n case types_1.ERepetitionType.Ring:\n offset = gl_matrix_1.vec3.fromValues(distance[0], 0, 0);\n gl_matrix_1.vec3.rotateZ(offset, offset, glme.VEC3_ZERO, repetition.angle + displace);\n break;\n case types_1.ERepetitionType.Matrix:\n offset = gl_matrix_1.vec3.fromValues(distance[1] * (currentColRepetition - centerMatrix[0]), distance[0] * (currentRowRepetition - centerMatrix[1]), 0);\n break;\n }\n const perspectiveSize = perspective > 0 ? Math.max(bounding.width, bounding.height) / 2 : 1;\n const perspectiveValue = perspective > 0 ? perspectiveSize + (1 - perspective) * (perspectiveSize * 10) : 0;\n const bTransformOrigin = (this.boundingType === types_1.EBoundingType.Relative ? bounding.cx !== 0 || bounding.cy !== 0 : true) ||\n perspective !== 0 ||\n transformOrigin[0] !== 0 ||\n transformOrigin[1] !== 0;\n const bPerspectiveOrigin = perspectiveOrigin[0] !== 0 || perspectiveOrigin[1] !== 0;\n if (bTransformOrigin) {\n if (this.boundingType === types_1.EBoundingType.Relative) {\n transformOrigin[0] = transformOrigin[0] * (bounding.width / 2) + bounding.cx;\n transformOrigin[1] = transformOrigin[1] * (bounding.height / 2) + bounding.cy;\n }\n else {\n transformOrigin[0] *= bounding.width / 2;\n transformOrigin[1] *= bounding.height / 2;\n }\n transformOrigin[2] = perspectiveValue;\n }\n /**\n * Create Matrices\n */\n {\n /**\n * Create Transformation matrix\n */\n gl_matrix_1.mat4.identity(transformMatrix);\n bTransformOrigin && gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, transformOrigin);\n if (translate[0] !== 0 || translate[1] !== 0)\n gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, translate);\n if (skewX !== 0 || skewY !== 0) {\n glme.fromSkew(tmpMatrix, [skewX, skewY]);\n gl_matrix_1.mat4.multiply(transformMatrix, transformMatrix, tmpMatrix);\n }\n rotateX !== 0 && gl_matrix_1.mat4.rotateX(transformMatrix, transformMatrix, rotateX);\n rotateY !== 0 && gl_matrix_1.mat4.rotateY(transformMatrix, transformMatrix, rotateY);\n rotateZ !== 0 && gl_matrix_1.mat4.rotateZ(transformMatrix, transformMatrix, rotateZ);\n if (scale[0] !== 1 || scale[1] !== 1)\n gl_matrix_1.mat4.scale(transformMatrix, transformMatrix, scale);\n bTransformOrigin &&\n gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, gl_matrix_1.vec3.scale(transformOrigin, transformOrigin, -1));\n /**\n * Create Perspective matrix\n */\n if (perspectiveValue > 0) {\n if (bPerspectiveOrigin) {\n if (this.boundingType === types_1.EBoundingType.Relative) {\n perspectiveOrigin[0] = perspectiveOrigin[0] * (bounding.width / 2) + bounding.cx;\n perspectiveOrigin[1] = perspectiveOrigin[1] * (bounding.height / 2) + bounding.cy;\n }\n else {\n perspectiveOrigin[0] *= bounding.width / 2;\n perspectiveOrigin[1] *= bounding.height / 2;\n }\n perspectiveOrigin[2] = 0;\n }\n gl_matrix_1.mat4.perspective(perspectiveMatrix, -Math.PI / 2, 1, 0, Infinity);\n }\n /**\n * Create Repetition matrix\n */\n gl_matrix_1.mat4.identity(repetitionMatrix);\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, offset);\n if (bDirectSceneChild) {\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, sceneAnchor);\n }\n /**\n * Apply anchor\n */\n const shapeAnchor = [this.anchor[0] * (bounding.width / 2), this.anchor[1] * (bounding.height / 2), 0];\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, shapeAnchor);\n if (repetitionType === types_1.ERepetitionType.Ring)\n gl_matrix_1.mat4.rotateZ(repetitionMatrix, repetitionMatrix, repetition.angle + displace);\n }\n Adapt_1.Bounding.clear(tmpSingleRepetitionBounding);\n // Apply matrices on vertex\n for (let bufferIndex = 0; bufferIndex < bufferLength; bufferIndex += 2) {\n const vertex = [buffer[bufferIndex], buffer[bufferIndex + 1], perspectiveValue];\n {\n // Apply squeeze, can be insert into transformMatrix?\n squeezeX !== 0 && Vec2_1.default.squeezeX(vertex, squeezeX);\n squeezeY !== 0 && Vec2_1.default.squeezeY(vertex, squeezeY);\n // Apply transforms\n gl_matrix_1.vec3.transformMat4(vertex, vertex, transformMatrix);\n // Apply perspective\n if (perspectiveValue > 0) {\n bPerspectiveOrigin && gl_matrix_1.vec3.add(vertex, vertex, perspectiveOrigin);\n gl_matrix_1.vec3.transformMat4(vertex, vertex, perspectiveMatrix);\n gl_matrix_1.vec3.scale(vertex, vertex, perspectiveValue);\n bPerspectiveOrigin && gl_matrix_1.vec3.sub(vertex, vertex, perspectiveOrigin);\n }\n // apply repetition matrix\n gl_matrix_1.vec3.transformMat4(vertex, vertex, repetitionMatrix);\n // custom vertex manipulation\n if (typeof this.vertexCallback !== 'undefined') {\n const index = bufferIndex / 2;\n const count = bufferLength / 2;\n const vertexRepetition = {\n index: index + 1,\n count,\n offset: count > 1 ? index / (count - 1) : 1,\n };\n this.vertexCallback(vertex, vertexRepetition, propArguments);\n }\n }\n buffers[currentIndex][bufferIndex] = vertex[0];\n buffers[currentIndex][bufferIndex + 1] = vertex[1];\n Adapt_1.Bounding.add(tmpSingleRepetitionBounding, vertex[0], vertex[1]);\n Adapt_1.Bounding.add(tmpTotalShapeBounding, vertex[0], vertex[1]);\n }\n }\n // Bounding.sum(tmpTotalShapeBounding, tmpSingleRepetitionBounding)\n // After buffer creation, add a frame into indexedBuffer if not static or update bounding\n const singleRepetitionBounding = { cx: 0, cy: 0, x: -1, y: -1, width: 2, height: 2 };\n Adapt_1.Bounding.bind(singleRepetitionBounding, tmpSingleRepetitionBounding);\n if (!this.bStaticIndexed || !this.bIndexed) {\n this.addIndex(bufferLength, repetition, singleRepetitionBounding);\n }\n }\n }\n Adapt_1.Bounding.bind(this.bounding, tmpTotalShapeBounding);\n this.buffer = new Float32Array(totalBufferLength);\n for (let i = 0, offset = 0, len = buffers.length; i < len; offset += buffers[i].length, i++)\n this.buffer.set(buffers[i], offset);\n this.bIndexed = true;\n }\n /**\n * Return current shape (whit repetions) bounding\n *\n * @return {*} {IShapeBounding}\n */\n getBounding() {\n return this.bounding;\n }\n /**\n * Get number of repetitions\n *\n * @returns {number}\n */\n getRepetitionCount() {\n var _a;\n const repetitions = this.getProp('repetitions', undefined, 1);\n return Array.isArray(repetitions) ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) : repetitions;\n }\n /**\n * Return buffer\n *\n * @returns {(Float32Array | undefined)}\n */\n getBuffer() {\n return this.buffer;\n }\n /**\n * Return indexed buffer\n *\n * @returns {(Array> | undefined)}\n */\n getIndexedBuffer() {\n return this.indexedBuffer;\n }\n /**\n * Return number of encapsulation\n *\n * @param {IBufferIndex} index\n * @returns {number}\n */\n static getIndexParentLevel(index) {\n if (typeof index.parent === 'undefined')\n return 0;\n let currentParent = index.parent;\n let currentParentLevel = 1;\n while (typeof currentParent.parent !== 'undefined') {\n currentParentLevel++;\n currentParent = currentParent.parent;\n }\n return currentParentLevel;\n }\n /**\n * Stream buffer\n *\n * @param {(TStreamCallback} callback\n */\n stream(callback) {\n if (this.buffer && this.indexedBuffer) {\n for (let i = 0, j = 0, len = this.indexedBuffer.length; i < len; i++) {\n const currentIndexing = this.indexedBuffer[i];\n callback({\n buffer: this.buffer,\n frameLength: currentIndexing.frameLength,\n frameBufferIndex: j,\n currentIndexing: currentIndexing,\n currentShapeIndex: i,\n totalShapes: len,\n });\n j += currentIndexing.frameLength;\n }\n }\n }\n /**\n * Return empty propArguments\n *\n * @static\n * @param {ShapeBase} shape\n * @return {*} {PropArguments}\n */\n static getEmptyPropArguments(shape, parentPropArguments) {\n const repetition = {\n type: types_1.ERepetitionType.Ring,\n angle: 0,\n index: 1,\n offset: 1,\n count: 1,\n row: { index: 1, offset: 1, count: 1 },\n col: { index: 1, offset: 1, count: 1 },\n };\n return {\n repetition,\n shape,\n parent: parentPropArguments,\n };\n }\n}\nexports.ShapeBase = ShapeBase;\n/**\n * Empty buffer\n *\n * @internal\n * @ignore\n */\nShapeBase.EMPTY_BUFFER = new Float32Array(0);\n/**\n * Empty BaseRepetition\n *\n * @internal\n * @ignore\n */\nShapeBase.getEmptySimpleRepetition = () => ({\n index: 1,\n offset: 1,\n count: 1,\n});\n/**\n * Empty Repetition\n *\n * @internal\n * @ignore\n */\nShapeBase.getEmptyRepetition = () => ({\n type: types_1.ERepetitionType.Ring,\n angle: 0,\n ...ShapeBase.getEmptySimpleRepetition(),\n row: ShapeBase.getEmptySimpleRepetition(),\n col: ShapeBase.getEmptySimpleRepetition(),\n});\n//# sourceMappingURL=ShapeBase.js.map","import * as glMatrix from \"./common.js\";\nimport * as mat2 from \"./mat2.js\";\nimport * as mat2d from \"./mat2d.js\";\nimport * as mat3 from \"./mat3.js\";\nimport * as mat4 from \"./mat4.js\";\nimport * as quat from \"./quat.js\";\nimport * as quat2 from \"./quat2.js\";\nimport * as vec2 from \"./vec2.js\";\nimport * as vec3 from \"./vec3.js\";\nimport * as vec4 from \"./vec4.js\";\nexport { glMatrix, mat2, mat2d, mat3, mat4, quat, quat2, vec2, vec3, vec4 };","/**\r\n * Common utilities\r\n * @module glMatrix\r\n */\n// Configuration Constants\nexport var EPSILON = 0.000001;\nexport var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexport var RANDOM = Math.random;\n/**\r\n * Sets the type of array used when creating new vectors and matrices\r\n *\r\n * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array\r\n */\n\nexport function setMatrixArrayType(type) {\n ARRAY_TYPE = type;\n}\nvar degree = Math.PI / 180;\n/**\r\n * Convert Degree To Radian\r\n *\r\n * @param {Number} a Angle in Degrees\r\n */\n\nexport function toRadian(a) {\n return a * degree;\n}\n/**\r\n * Tests whether or not the arguments have approximately the same value, within an absolute\r\n * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less\r\n * than or equal to 1.0, and a relative tolerance is used for larger values)\r\n *\r\n * @param {Number} a The first number to test.\r\n * @param {Number} b The second number to test.\r\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n}\nif (!Math.hypot) Math.hypot = function () {\n var y = 0,\n i = arguments.length;\n\n while (i--) {\n y += arguments[i] * arguments[i];\n }\n\n return Math.sqrt(y);\n};","import * as glMatrix from \"./common.js\";\n/**\r\n * 2x2 Matrix\r\n * @module mat2\r\n */\n\n/**\r\n * Creates a new identity mat2\r\n *\r\n * @returns {mat2} a new 2x2 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\r\n * Creates a new mat2 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat2} a matrix to clone\r\n * @returns {mat2} a new 2x2 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Copy the values from one mat2 to another\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set a mat2 to the identity matrix\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @returns {mat2} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\r\n * Create a new mat2 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\r\n * @returns {mat2} out A new 2x2 matrix\r\n */\n\nexport function fromValues(m00, m01, m10, m11) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\r\n * Set the components of a mat2 to the given values\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\r\n * @returns {mat2} out\r\n */\n\nexport function set(out, m00, m01, m10, m11) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\r\n * Transpose the values of a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache\n // some values\n if (out === a) {\n var a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3]; // Calculate the determinant\n\n var det = a0 * a3 - a2 * a1;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function adjoint(out, a) {\n // Caching this value is nessecary if out == a\n var a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat2\r\n *\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n}\n/**\r\n * Multiplies two mat2's\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n}\n/**\r\n * Rotates a mat2 by the given angle\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n}\n/**\r\n * Scales the mat2 by the dimensions in the given vec2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to rotate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat2} out\r\n **/\n\nexport function scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n *\r\n * @param {mat2} out mat2 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n *\r\n * @param {mat2} out mat2 receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat2} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n}\n/**\r\n * Returns a string representation of a mat2\r\n *\r\n * @param {ReadonlyMat2} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat2\r\n *\r\n * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3]);\n}\n/**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @param {ReadonlyMat2} L the lower triangular matrix\r\n * @param {ReadonlyMat2} D the diagonal matrix\r\n * @param {ReadonlyMat2} U the upper triangular matrix\r\n * @param {ReadonlyMat2} a the input matrix to factorize\r\n */\n\nexport function LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n}\n/**\r\n * Adds two mat2's\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat2} a The first matrix.\r\n * @param {ReadonlyMat2} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat2} a The first matrix.\r\n * @param {ReadonlyMat2} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat2} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\r\n * Adds two mat2's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat2} out the receiving vector\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat2} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\r\n * Alias for {@link mat2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat2.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 2x3 Matrix\r\n * @module mat2d\r\n * @description\r\n * A mat2d contains six elements defined as:\r\n *
\r\n * [a, b,\r\n *  c, d,\r\n *  tx, ty]\r\n * 
\r\n * This is a short form for the 3x3 matrix:\r\n *
\r\n * [a, b, 0,\r\n *  c, d, 0,\r\n *  tx, ty, 1]\r\n * 
\r\n * The last column is ignored so the array is shorter and operations are faster.\r\n */\n\n/**\r\n * Creates a new identity mat2d\r\n *\r\n * @returns {mat2d} a new 2x3 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(6);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[4] = 0;\n out[5] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\r\n * Creates a new mat2d initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat2d} a matrix to clone\r\n * @returns {mat2d} a new 2x3 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\r\n * Copy the values from one mat2d to another\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\r\n * Set a mat2d to the identity matrix\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Create a new mat2d with the given values\r\n *\r\n * @param {Number} a Component A (index 0)\r\n * @param {Number} b Component B (index 1)\r\n * @param {Number} c Component C (index 2)\r\n * @param {Number} d Component D (index 3)\r\n * @param {Number} tx Component TX (index 4)\r\n * @param {Number} ty Component TY (index 5)\r\n * @returns {mat2d} A new mat2d\r\n */\n\nexport function fromValues(a, b, c, d, tx, ty) {\n var out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\r\n * Set the components of a mat2d to the given values\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {Number} a Component A (index 0)\r\n * @param {Number} b Component B (index 1)\r\n * @param {Number} c Component C (index 2)\r\n * @param {Number} d Component D (index 3)\r\n * @param {Number} tx Component TX (index 4)\r\n * @param {Number} ty Component TY (index 5)\r\n * @returns {mat2d} out\r\n */\n\nexport function set(out, a, b, c, d, tx, ty) {\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\r\n * Inverts a mat2d\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function invert(out, a) {\n var aa = a[0],\n ab = a[1],\n ac = a[2],\n ad = a[3];\n var atx = a[4],\n aty = a[5];\n var det = aa * ad - ab * ac;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n}\n/**\r\n * Multiplies two mat2d's\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n}\n/**\r\n * Rotates a mat2d by the given angle\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2d} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\r\n * Scales the mat2d by the dimensions in the given vec2\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to translate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat2d} out\r\n **/\n\nexport function scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\r\n * Translates the mat2d by the dimensions in the given vec2\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to translate\r\n * @param {ReadonlyVec2} v the vec2 to translate the matrix by\r\n * @returns {mat2d} out\r\n **/\n\nexport function translate(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.rotate(dest, dest, rad);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2d} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.scale(dest, dest, vec);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat2d} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.translate(dest, dest, vec);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {ReadonlyVec2} v Translation vector\r\n * @returns {mat2d} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n}\n/**\r\n * Returns a string representation of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat2d(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1);\n}\n/**\r\n * Adds two mat2d's\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat2d} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n}\n/**\r\n * Adds two mat2d's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat2d} out the receiving vector\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat2d} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat2d} a The first matrix.\r\n * @param {ReadonlyMat2d} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat2d} a The first matrix.\r\n * @param {ReadonlyMat2d} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5));\n}\n/**\r\n * Alias for {@link mat2d.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat2d.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 3x3 Matrix\r\n * @module mat3\r\n */\n\n/**\r\n * Creates a new identity mat3\r\n *\r\n * @returns {mat3} a new 3x3 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(9);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n }\n\n out[0] = 1;\n out[4] = 1;\n out[8] = 1;\n return out;\n}\n/**\r\n * Copies the upper-left 3x3 values into the given mat3.\r\n *\r\n * @param {mat3} out the receiving 3x3 matrix\r\n * @param {ReadonlyMat4} a the source 4x4 matrix\r\n * @returns {mat3} out\r\n */\n\nexport function fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n}\n/**\r\n * Creates a new mat3 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat3} a matrix to clone\r\n * @returns {mat3} a new 3x3 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Copy the values from one mat3 to another\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Create a new mat3 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\r\n * @returns {mat3} A new mat3\r\n */\n\nexport function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\r\n * Set the components of a mat3 to the given values\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\r\n * @returns {mat3} out\r\n */\n\nexport function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\r\n * Set a mat3 to the identity matrix\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @returns {mat3} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Transpose the values of a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b01 = a22 * a11 - a12 * a21;\n var b11 = -a22 * a10 + a12 * a20;\n var b21 = a21 * a10 - a11 * a20; // Calculate the determinant\n\n var det = a00 * b01 + a01 * b11 + a02 * b21;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat3\r\n *\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n}\n/**\r\n * Multiplies two mat3's\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b00 = b[0],\n b01 = b[1],\n b02 = b[2];\n var b10 = b[3],\n b11 = b[4],\n b12 = b[5];\n var b20 = b[6],\n b21 = b[7],\n b22 = b[8];\n out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n return out;\n}\n/**\r\n * Translate a mat3 by the given vector\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to translate\r\n * @param {ReadonlyVec2} v vector to translate by\r\n * @returns {mat3} out\r\n */\n\nexport function translate(out, a, v) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n x = v[0],\n y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n}\n/**\r\n * Rotates a mat3 by the given angle\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat3} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n}\n/**\r\n * Scales the mat3 by the dimensions in the given vec2\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to rotate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat3} out\r\n **/\n\nexport function scale(out, a, v) {\n var x = v[0],\n y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyVec2} v Translation vector\r\n * @returns {mat3} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat3} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat3} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Copies the values from a mat2d into a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to copy\r\n * @returns {mat3} out\r\n **/\n\nexport function fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n}\n/**\r\n * Calculates a 3x3 matrix from the given quaternion\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyQuat} q Quaternion to create matrix from\r\n *\r\n * @returns {mat3} out\r\n */\n\nexport function fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n}\n/**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n *\r\n * @returns {mat3} out\r\n */\n\nexport function normalFromMat4(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n}\n/**\r\n * Generates a 2D projection matrix with the given bounds\r\n *\r\n * @param {mat3} out mat3 frustum matrix will be written into\r\n * @param {number} width Width of your gl context\r\n * @param {number} height Height of gl context\r\n * @returns {mat3} out\r\n */\n\nexport function projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n}\n/**\r\n * Returns a string representation of a mat3\r\n *\r\n * @param {ReadonlyMat3} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat3\r\n *\r\n * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);\n}\n/**\r\n * Adds two mat3's\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat3} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n}\n/**\r\n * Adds two mat3's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat3} out the receiving vector\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat3} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat3} a The first matrix.\r\n * @param {ReadonlyMat3} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat3} a The first matrix.\r\n * @param {ReadonlyMat3} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7],\n a8 = a[8];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7],\n b8 = b[8];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8));\n}\n/**\r\n * Alias for {@link mat3.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat3.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied.\r\n * @module mat4\r\n */\n\n/**\r\n * Creates a new identity mat4\r\n *\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(16);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n }\n\n out[0] = 1;\n out[5] = 1;\n out[10] = 1;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a new mat4 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat4} a matrix to clone\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Copy the values from one mat4 to another\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Create a new mat4 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} A new mat4\r\n */\n\nexport function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\r\n * Set the components of a mat4 to the given values\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} out\r\n */\n\nexport function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\r\n * Set a mat4 to the identity matrix\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @returns {mat4} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Transpose the values of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a12 = a[6],\n a13 = a[7];\n var a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22);\n out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\n out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12);\n out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\n out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\n out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22);\n out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\n out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12);\n out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21);\n out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\n out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11);\n out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\n out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\n out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21);\n out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\n out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11);\n return out;\n}\n/**\r\n * Calculates the determinant of a mat4\r\n *\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n}\n/**\r\n * Multiplies two mat4s\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15]; // Cache only the current line of the second matrix\n\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n/**\r\n * Translate a mat4 by the given vector\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to translate\r\n * @param {ReadonlyVec3} v vector to translate by\r\n * @returns {mat4} out\r\n */\n\nexport function translate(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n\n return out;\n}\n/**\r\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to scale\r\n * @param {ReadonlyVec3} v the vec3 to scale the matrix by\r\n * @returns {mat4} out\r\n **/\n\nexport function scale(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Rotates a mat4 by the given angle around the given axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nexport function rotate(out, a, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n var b00, b01, b02;\n var b10, b11, b12;\n var b20, b21, b22;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11]; // Construct the elements of the rotation matrix\n\n b00 = x * x * t + c;\n b01 = y * x * t + z * s;\n b02 = z * x * t - y * s;\n b10 = x * y * t - z * s;\n b11 = y * y * t + c;\n b12 = z * y * t + x * s;\n b20 = x * z * t + y * s;\n b21 = y * z * t - x * s;\n b22 = z * z * t + c; // Perform rotation-specific matrix multiplication\n\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the X axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateX(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Y axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateY(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Z axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyVec3} v Scaling vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotation(out, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c; // Perform rotation-specific matrix multiplication\n\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromXRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromYRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromZRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslation(out, q, v) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a new mat4 from a dual quat.\r\n *\r\n * @param {mat4} out Matrix\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @returns {mat4} mat4 receiving operation result\r\n */\n\nexport function fromQuat2(out, a) {\n var translation = new glMatrix.ARRAY_TYPE(3);\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense\n\n if (magnitude > 0) {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n\n fromRotationTranslation(out, a, translation);\n return out;\n}\n/**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nexport function getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n}\n/**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion paramter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nexport function getScaling(out, mat) {\n var m11 = mat[0];\n var m12 = mat[1];\n var m13 = mat[2];\n var m21 = mat[4];\n var m22 = mat[5];\n var m23 = mat[6];\n var m31 = mat[8];\n var m32 = mat[9];\n var m33 = mat[10];\n out[0] = Math.hypot(m11, m12, m13);\n out[1] = Math.hypot(m21, m22, m23);\n out[2] = Math.hypot(m31, m32, m33);\n return out;\n}\n/**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @param {quat} out Quaternion to receive the rotation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {quat} out\r\n */\n\nexport function getRotation(out, mat) {\n var scaling = new glMatrix.ARRAY_TYPE(3);\n getScaling(scaling, mat);\n var is1 = 1 / scaling[0];\n var is2 = 1 / scaling[1];\n var is3 = 1 / scaling[2];\n var sm11 = mat[0] * is1;\n var sm12 = mat[1] * is2;\n var sm13 = mat[2] * is3;\n var sm21 = mat[4] * is1;\n var sm22 = mat[5] * is2;\n var sm23 = mat[6] * is3;\n var sm31 = mat[8] * is1;\n var sm32 = mat[9] * is2;\n var sm33 = mat[10] * is3;\n var trace = sm11 + sm22 + sm33;\n var S = 0;\n\n if (trace > 0) {\n S = Math.sqrt(trace + 1.0) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @param {ReadonlyVec3} s Scaling vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslationScale(out, q, v, s) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @param {ReadonlyVec3} s Scaling vector\r\n * @param {ReadonlyVec3} o The origin vector around which to scale and rotate\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n var ox = o[0];\n var oy = o[1];\n var oz = o[2];\n var out0 = (1 - (yy + zz)) * sx;\n var out1 = (xy + wz) * sx;\n var out2 = (xz - wy) * sx;\n var out4 = (xy - wz) * sy;\n var out5 = (1 - (xx + zz)) * sy;\n var out6 = (yz + wx) * sy;\n var out8 = (xz + wy) * sz;\n var out9 = (yz - wx) * sz;\n var out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n}\n/**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyQuat} q Quaternion to create matrix from\r\n *\r\n * @returns {mat4} out\r\n */\n\nexport function fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a frustum matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Number} left Left bound of the frustum\r\n * @param {Number} right Right bound of the frustum\r\n * @param {Number} bottom Bottom bound of the frustum\r\n * @param {Number} top Top bound of the frustum\r\n * @param {Number} near Near bound of the frustum\r\n * @param {Number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function frustum(out, left, right, bottom, top, near, far) {\n var rl = 1 / (right - left);\n var tb = 1 / (top - bottom);\n var nf = 1 / (near - far);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near * 2 * nf;\n out[15] = 0;\n return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} fovy Vertical field of view in radians\r\n * @param {number} aspect Aspect ratio. typically viewport width/height\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum, can be null or Infinity\r\n * @returns {mat4} out\r\n */\n\nexport function perspective(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n\n return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function perspectiveFromFieldOfView(out, fov, near, far) {\n var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);\n var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);\n var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);\n var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);\n var xScale = 2.0 / (leftTan + rightTan);\n var yScale = 2.0 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n out[4] = 0.0;\n out[5] = yScale;\n out[6] = 0.0;\n out[7] = 0.0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1.0;\n out[12] = 0.0;\n out[13] = 0.0;\n out[14] = far * near / (near - far);\n out[15] = 0.0;\n return out;\n}\n/**\r\n * Generates a orthogonal projection matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} left Left bound of the frustum\r\n * @param {number} right Right bound of the frustum\r\n * @param {number} bottom Bottom bound of the frustum\r\n * @param {number} top Top bound of the frustum\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function ortho(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {ReadonlyVec3} eye Position of the viewer\r\n * @param {ReadonlyVec3} center Point the viewer is looking at\r\n * @param {ReadonlyVec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nexport function lookAt(out, eye, center, up) {\n var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;\n var eyex = eye[0];\n var eyey = eye[1];\n var eyez = eye[2];\n var upx = up[0];\n var upy = up[1];\n var upz = up[2];\n var centerx = center[0];\n var centery = center[1];\n var centerz = center[2];\n\n if (Math.abs(eyex - centerx) < glMatrix.EPSILON && Math.abs(eyey - centery) < glMatrix.EPSILON && Math.abs(eyez - centerz) < glMatrix.EPSILON) {\n return identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n len = 1 / Math.hypot(z0, z1, z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.hypot(x0, x1, x2);\n\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n len = Math.hypot(y0, y1, y2);\n\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a matrix that makes something look at something else.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {ReadonlyVec3} eye Position of the viewer\r\n * @param {ReadonlyVec3} center Point the viewer is looking at\r\n * @param {ReadonlyVec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nexport function targetTo(out, eye, target, up) {\n var eyex = eye[0],\n eyey = eye[1],\n eyez = eye[2],\n upx = up[0],\n upy = up[1],\n upz = up[2];\n var z0 = eyex - target[0],\n z1 = eyey - target[1],\n z2 = eyez - target[2];\n var len = z0 * z0 + z1 * z1 + z2 * z2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n\n var x0 = upy * z2 - upz * z1,\n x1 = upz * z0 - upx * z2,\n x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n}\n/**\r\n * Returns a string representation of a mat4\r\n *\r\n * @param {ReadonlyMat4} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \", \" + a[9] + \", \" + a[10] + \", \" + a[11] + \", \" + a[12] + \", \" + a[13] + \", \" + a[14] + \", \" + a[15] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat4\r\n *\r\n * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);\n}\n/**\r\n * Adds two mat4's\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat4} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n}\n/**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat4} out the receiving vector\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat4} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat4} a The first matrix.\r\n * @param {ReadonlyMat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat4} a The first matrix.\r\n * @param {ReadonlyMat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var a8 = a[8],\n a9 = a[9],\n a10 = a[10],\n a11 = a[11];\n var a12 = a[12],\n a13 = a[13],\n a14 = a[14],\n a15 = a[15];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n var b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n var b8 = b[8],\n b9 = b[9],\n b10 = b[10],\n b11 = b[11];\n var b12 = b[12],\n b13 = b[13],\n b14 = b[14],\n b15 = b[15];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15));\n}\n/**\r\n * Alias for {@link mat4.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat4.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\nimport * as mat3 from \"./mat3.js\";\nimport * as vec3 from \"./vec3.js\";\nimport * as vec4 from \"./vec4.js\";\n/**\r\n * Quaternion\r\n * @module quat\r\n */\n\n/**\r\n * Creates a new identity quat\r\n *\r\n * @returns {quat} a new quaternion\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n out[3] = 1;\n return out;\n}\n/**\r\n * Set a quat to the identity quaternion\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @returns {quat} out\r\n */\n\nexport function identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyVec3} axis the axis around which to rotate\r\n * @param {Number} rad the angle in radians\r\n * @returns {quat} out\r\n **/\n\nexport function setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n var s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n}\n/**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @param {vec3} out_axis Vector receiving the axis of rotation\r\n * @param {ReadonlyQuat} q Quaternion to be decomposed\r\n * @return {Number} Angle, in radians, of the rotation\r\n */\n\nexport function getAxisAngle(out_axis, q) {\n var rad = Math.acos(q[3]) * 2.0;\n var s = Math.sin(rad / 2.0);\n\n if (s > glMatrix.EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n // If s is zero, return any axis (no rotation - axis does not matter)\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n\n return rad;\n}\n/**\r\n * Gets the angular distance between two unit quaternions\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\n\nexport function getAngle(a, b) {\n var dotproduct = dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n}\n/**\r\n * Multiplies two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {quat} out\r\n */\n\nexport function multiply(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the X axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateX(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateY(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var by = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bz = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n}\n/**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate W component of\r\n * @returns {quat} out\r\n */\n\nexport function calculateW(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\n return out;\n}\n/**\r\n * Calculate the exponential of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @returns {quat} out\r\n */\n\nexport function exp(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var et = Math.exp(w);\n var s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n}\n/**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @returns {quat} out\r\n */\n\nexport function ln(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n}\n/**\r\n * Calculate the scalar power of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @param {Number} b amount to scale the quaternion by\r\n * @returns {quat} out\r\n */\n\nexport function pow(out, a, b) {\n ln(out, a);\n scale(out, out, b);\n exp(out, out);\n return out;\n}\n/**\r\n * Performs a spherical linear interpolation between two quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n */\n\nexport function slerp(out, a, b, t) {\n // benchmarks:\n // http://jsperf.com/quaternion-slerp-implementations\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n var omega, cosom, sinom, scale0, scale1; // calc cosine\n\n cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary)\n\n if (cosom < 0.0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n } // calculate coefficients\n\n\n if (1.0 - cosom > glMatrix.EPSILON) {\n // standard case (slerp)\n omega = Math.acos(cosom);\n sinom = Math.sin(omega);\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n // \"from\" and \"to\" quaternions are very close\n // ... so we can do a linear interpolation\n scale0 = 1.0 - t;\n scale1 = t;\n } // calculate final values\n\n\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n}\n/**\r\n * Generates a random unit quaternion\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @returns {quat} out\r\n */\n\nexport function random(out) {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n var u1 = glMatrix.RANDOM();\n var u2 = glMatrix.RANDOM();\n var u3 = glMatrix.RANDOM();\n var sqrt1MinusU1 = Math.sqrt(1 - u1);\n var sqrtU1 = Math.sqrt(u1);\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n}\n/**\r\n * Calculates the inverse of a quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate inverse of\r\n * @returns {quat} out\r\n */\n\nexport function invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\n\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n}\n/**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate conjugate of\r\n * @returns {quat} out\r\n */\n\nexport function conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyMat3} m rotation matrix\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport function fromMat3(out, m) {\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n var fTrace = m[0] + m[4] + m[8];\n var fRoot;\n\n if (fTrace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\n\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot; // 1/(4w)\n\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n // |w| <= 1/2\n var i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n var j = (i + 1) % 3;\n var k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n\n return out;\n}\n/**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {x} Angle to rotate around X axis in degrees.\r\n * @param {y} Angle to rotate around Y axis in degrees.\r\n * @param {z} Angle to rotate around Z axis in degrees.\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport function fromEuler(out, x, y, z) {\n var halfToRad = 0.5 * Math.PI / 180.0;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n var sx = Math.sin(x);\n var cx = Math.cos(x);\n var sy = Math.sin(y);\n var cy = Math.cos(y);\n var sz = Math.sin(z);\n var cz = Math.cos(z);\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n return out;\n}\n/**\r\n * Returns a string representation of a quatenion\r\n *\r\n * @param {ReadonlyQuat} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"quat(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n *\r\n * @param {ReadonlyQuat} a quaternion to clone\r\n * @returns {quat} a new quaternion\r\n * @function\r\n */\n\nexport var clone = vec4.clone;\n/**\r\n * Creates a new quat initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {quat} a new quaternion\r\n * @function\r\n */\n\nexport var fromValues = vec4.fromValues;\n/**\r\n * Copy the values from one quat to another\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the source quaternion\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var copy = vec4.copy;\n/**\r\n * Set the components of a quat to the given values\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var set = vec4.set;\n/**\r\n * Adds two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var add = vec4.add;\n/**\r\n * Alias for {@link quat.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Scales a quat by a scalar number\r\n *\r\n * @param {quat} out the receiving vector\r\n * @param {ReadonlyQuat} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var scale = vec4.scale;\n/**\r\n * Calculates the dot product of two quat's\r\n *\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {Number} dot product of a and b\r\n * @function\r\n */\n\nexport var dot = vec4.dot;\n/**\r\n * Performs a linear interpolation between two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var lerp = vec4.lerp;\n/**\r\n * Calculates the length of a quat\r\n *\r\n * @param {ReadonlyQuat} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport var length = vec4.length;\n/**\r\n * Alias for {@link quat.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Calculates the squared length of a quat\r\n *\r\n * @param {ReadonlyQuat} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n * @function\r\n */\n\nexport var squaredLength = vec4.squaredLength;\n/**\r\n * Alias for {@link quat.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Normalize a quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quaternion to normalize\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var normalize = vec4.normalize;\n/**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyQuat} a The first quaternion.\r\n * @param {ReadonlyQuat} b The second quaternion.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport var exactEquals = vec4.exactEquals;\n/**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyQuat} a The first vector.\r\n * @param {ReadonlyQuat} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport var equals = vec4.equals;\n/**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n *\r\n * @param {quat} out the receiving quaternion.\r\n * @param {ReadonlyVec3} a the initial vector\r\n * @param {ReadonlyVec3} b the destination vector\r\n * @returns {quat} out\r\n */\n\nexport var rotationTo = function () {\n var tmpvec3 = vec3.create();\n var xUnitVec3 = vec3.fromValues(1, 0, 0);\n var yUnitVec3 = vec3.fromValues(0, 1, 0);\n return function (out, a, b) {\n var dot = vec3.dot(a, b);\n\n if (dot < -0.999999) {\n vec3.cross(tmpvec3, xUnitVec3, a);\n if (vec3.len(tmpvec3) < 0.000001) vec3.cross(tmpvec3, yUnitVec3, a);\n vec3.normalize(tmpvec3, tmpvec3);\n setAxisAngle(out, tmpvec3, Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n vec3.cross(tmpvec3, a, b);\n out[0] = tmpvec3[0];\n out[1] = tmpvec3[1];\n out[2] = tmpvec3[2];\n out[3] = 1 + dot;\n return normalize(out, out);\n }\n };\n}();\n/**\r\n * Performs a spherical linear interpolation with two control points\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {ReadonlyQuat} c the third operand\r\n * @param {ReadonlyQuat} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n */\n\nexport var sqlerp = function () {\n var temp1 = create();\n var temp2 = create();\n return function (out, a, b, c, d, t) {\n slerp(temp1, a, d, t);\n slerp(temp2, b, c, t);\n slerp(out, temp1, temp2, 2 * t * (1 - t));\n return out;\n };\n}();\n/**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n *\r\n * @param {ReadonlyVec3} view the vector representing the viewing direction\r\n * @param {ReadonlyVec3} right the vector representing the local \"right\" direction\r\n * @param {ReadonlyVec3} up the vector representing the local \"up\" direction\r\n * @returns {quat} out\r\n */\n\nexport var setAxes = function () {\n var matr = mat3.create();\n return function (out, view, right, up) {\n matr[0] = right[0];\n matr[3] = right[1];\n matr[6] = right[2];\n matr[1] = up[0];\n matr[4] = up[1];\n matr[7] = up[2];\n matr[2] = -view[0];\n matr[5] = -view[1];\n matr[8] = -view[2];\n return normalize(out, fromMat3(out, matr));\n };\n}();","import * as glMatrix from \"./common.js\";\n/**\r\n * 4 Dimensional Vector\r\n * @module vec4\r\n */\n\n/**\r\n * Creates a new, empty vec4\r\n *\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec4 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec4} a vector to clone\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Creates a new vec4 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function fromValues(x, y, z, w) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\r\n * Copy the values from one vec4 to another\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the source vector\r\n * @returns {vec4} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set the components of a vec4 to the given values\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} out\r\n */\n\nexport function set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\r\n * Adds two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\r\n * Multiplies two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n}\n/**\r\n * Divides two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to ceil\r\n * @returns {vec4} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to floor\r\n * @returns {vec4} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n}\n/**\r\n * Math.round the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to round\r\n * @returns {vec4} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n}\n/**\r\n * Scales a vec4 by a scalar number\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec4} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\r\n * Adds two vec4's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec4} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Calculates the length of a vec4\r\n *\r\n * @param {ReadonlyVec4} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\r\n * Calculates the squared length of a vec4\r\n *\r\n * @param {ReadonlyVec4} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Negates the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to negate\r\n * @returns {vec4} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to invert\r\n * @returns {vec4} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n out[3] = 1.0 / a[3];\n return out;\n}\n/**\r\n * Normalize a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to normalize\r\n * @returns {vec4} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n var len = x * x + y * y + z * z + w * w;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n}\n/**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n *\r\n * @param {ReadonlyVec4} result the receiving vector\r\n * @param {ReadonlyVec4} U the first vector\r\n * @param {ReadonlyVec4} V the second vector\r\n * @param {ReadonlyVec4} W the third vector\r\n * @returns {vec4} result\r\n */\n\nexport function cross(out, u, v, w) {\n var A = v[0] * w[1] - v[1] * w[0],\n B = v[0] * w[2] - v[2] * w[0],\n C = v[0] * w[3] - v[3] * w[0],\n D = v[1] * w[2] - v[2] * w[1],\n E = v[1] * w[3] - v[3] * w[1],\n F = v[2] * w[3] - v[3] * w[2];\n var G = u[0];\n var H = u[1];\n var I = u[2];\n var J = u[3];\n out[0] = H * F - I * E + J * D;\n out[1] = -(G * F) + I * C - J * B;\n out[2] = G * E - H * C + J * A;\n out[3] = -(G * D) + H * B - I * A;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec4} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n var aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec4} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n\n var v1, v2, v3, v4;\n var s1, s2;\n\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n\n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n}\n/**\r\n * Transforms the vec4 with a mat4.\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec4} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n}\n/**\r\n * Transforms the vec4 with a quat\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to transform\r\n * @param {ReadonlyQuat} q quaternion to transform with\r\n * @returns {vec4} out\r\n */\n\nexport function transformQuat(out, a, q) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3]; // calculate quat * vec\n\n var ix = qw * x + qy * z - qz * y;\n var iy = qw * y + qz * x - qx * z;\n var iz = qw * z + qx * y - qy * x;\n var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set the components of a vec4 to zero\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @returns {vec4} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec4} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec4} a The first vector.\r\n * @param {ReadonlyVec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec4} a The first vector.\r\n * @param {ReadonlyVec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\r\n * Alias for {@link vec4.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec4.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec4.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec4.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec4.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec4.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec4.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec4s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 4;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n vec[3] = a[i + 3];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n a[i + 3] = vec[3];\n }\n\n return a;\n };\n}();","import * as glMatrix from \"./common.js\";\n/**\r\n * 3 Dimensional Vector\r\n * @module vec3\r\n */\n\n/**\r\n * Creates a new, empty vec3\r\n *\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(3);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec3} a vector to clone\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\r\n * Calculates the length of a vec3\r\n *\r\n * @param {ReadonlyVec3} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return Math.hypot(x, y, z);\n}\n/**\r\n * Creates a new vec3 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function fromValues(x, y, z) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\r\n * Copy the values from one vec3 to another\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the source vector\r\n * @returns {vec3} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\r\n * Set the components of a vec3 to the given values\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} out\r\n */\n\nexport function set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\r\n * Adds two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n}\n/**\r\n * Multiplies two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n}\n/**\r\n * Divides two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to ceil\r\n * @returns {vec3} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to floor\r\n * @returns {vec3} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n}\n/**\r\n * Math.round the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to round\r\n * @returns {vec3} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n return out;\n}\n/**\r\n * Scales a vec3 by a scalar number\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec3} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n return out;\n}\n/**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec3} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return Math.hypot(x, y, z);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return x * x + y * y + z * z;\n}\n/**\r\n * Calculates the squared length of a vec3\r\n *\r\n * @param {ReadonlyVec3} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return x * x + y * y + z * z;\n}\n/**\r\n * Negates the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to negate\r\n * @returns {vec3} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to invert\r\n * @returns {vec3} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n return out;\n}\n/**\r\n * Normalize a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to normalize\r\n * @returns {vec3} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var len = x * x + y * y + z * z;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n/**\r\n * Computes the cross product of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function cross(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2];\n var bx = b[0],\n by = b[1],\n bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n}\n/**\r\n * Performs a hermite interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {ReadonlyVec3} c the third operand\r\n * @param {ReadonlyVec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function hermite(out, a, b, c, d, t) {\n var factorTimes2 = t * t;\n var factor1 = factorTimes2 * (2 * t - 3) + 1;\n var factor2 = factorTimes2 * (t - 2) + t;\n var factor3 = factorTimes2 * (t - 1);\n var factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\r\n * Performs a bezier interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {ReadonlyVec3} c the third operand\r\n * @param {ReadonlyVec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function bezier(out, a, b, c, d, t) {\n var inverseFactor = 1 - t;\n var inverseFactorTimesTwo = inverseFactor * inverseFactor;\n var factorTimes2 = t * t;\n var factor1 = inverseFactorTimesTwo * inverseFactor;\n var factor2 = 3 * t * inverseFactorTimesTwo;\n var factor3 = 3 * factorTimes2 * inverseFactor;\n var factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec3} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n var z = glMatrix.RANDOM() * 2.0 - 1.0;\n var zScale = Math.sqrt(1.0 - z * z) * scale;\n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n}\n/**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n/**\r\n * Transforms the vec3 with a mat3.\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyMat3} m the 3x3 matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformMat3(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n}\n/**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyQuat} q quaternion to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformQuat(out, a, q) {\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3];\n var x = a[0],\n y = a[1],\n z = a[2]; // var qvec = [qx, qy, qz];\n // var uv = vec3.cross([], qvec, a);\n\n var uvx = qy * z - qz * y,\n uvy = qz * x - qx * z,\n uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv);\n\n var uuvx = qy * uvz - qz * uvy,\n uuvy = qz * uvx - qx * uvz,\n uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w);\n\n var w2 = qw * 2;\n uvx *= w2;\n uvy *= w2;\n uvz *= w2; // vec3.scale(uuv, uuv, 2);\n\n uuvx *= 2;\n uuvy *= 2;\n uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv));\n\n out[0] = x + uvx + uuvx;\n out[1] = y + uvy + uuvy;\n out[2] = z + uvz + uuvz;\n return out;\n}\n/**\r\n * Rotate a 3D vector around the x-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateX(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Rotate a 3D vector around the y-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateY(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Rotate a 3D vector around the z-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateZ(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2]; //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Get the angle between two 3D vectors\r\n * @param {ReadonlyVec3} a The first operand\r\n * @param {ReadonlyVec3} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nexport function angle(a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n bx = b[0],\n by = b[1],\n bz = b[2],\n mag1 = Math.sqrt(ax * ax + ay * ay + az * az),\n mag2 = Math.sqrt(bx * bx + by * by + bz * bz),\n mag = mag1 * mag2,\n cosine = mag && dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\r\n * Set the components of a vec3 to zero\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @returns {vec3} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec3} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \")\";\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec3} a The first vector.\r\n * @param {ReadonlyVec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec3} a The first vector.\r\n * @param {ReadonlyVec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2));\n}\n/**\r\n * Alias for {@link vec3.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec3.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec3.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec3.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec3.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec3.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec3.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec3s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 3;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n }\n\n return a;\n };\n}();","import * as glMatrix from \"./common.js\";\nimport * as quat from \"./quat.js\";\nimport * as mat4 from \"./mat4.js\";\n/**\r\n * Dual Quaternion
\r\n * Format: [real, dual]
\r\n * Quaternion format: XYZW
\r\n * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
\r\n * @module quat2\r\n */\n\n/**\r\n * Creates a new identity dual quat\r\n *\r\n * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation]\r\n */\n\nexport function create() {\n var dq = new glMatrix.ARRAY_TYPE(8);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n dq[0] = 0;\n dq[1] = 0;\n dq[2] = 0;\n dq[4] = 0;\n dq[5] = 0;\n dq[6] = 0;\n dq[7] = 0;\n }\n\n dq[3] = 1;\n return dq;\n}\n/**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n *\r\n * @param {ReadonlyQuat2} a dual quaternion to clone\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function clone(a) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = a[0];\n dq[1] = a[1];\n dq[2] = a[2];\n dq[3] = a[3];\n dq[4] = a[4];\n dq[5] = a[5];\n dq[6] = a[6];\n dq[7] = a[7];\n return dq;\n}\n/**\r\n * Creates a new dual quat initialized with the given values\r\n *\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component\r\n * @param {Number} y2 Y component\r\n * @param {Number} z2 Z component\r\n * @param {Number} w2 W component\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n dq[4] = x2;\n dq[5] = y2;\n dq[6] = z2;\n dq[7] = w2;\n return dq;\n}\n/**\r\n * Creates a new dual quat from the given values (quat and translation)\r\n *\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component (translation)\r\n * @param {Number} y2 Y component (translation)\r\n * @param {Number} z2 Z component (translation)\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n var ax = x2 * 0.5,\n ay = y2 * 0.5,\n az = z2 * 0.5;\n dq[4] = ax * w1 + ay * z1 - az * y1;\n dq[5] = ay * w1 + az * x1 - ax * z1;\n dq[6] = az * w1 + ax * y1 - ay * x1;\n dq[7] = -ax * x1 - ay * y1 - az * z1;\n return dq;\n}\n/**\r\n * Creates a dual quat from a quaternion and a translation\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyQuat} q a normalized quaternion\r\n * @param {ReadonlyVec3} t tranlation vector\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromRotationTranslation(out, q, t) {\n var ax = t[0] * 0.5,\n ay = t[1] * 0.5,\n az = t[2] * 0.5,\n bx = q[0],\n by = q[1],\n bz = q[2],\n bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Creates a dual quat from a translation\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyVec3} t translation vector\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n}\n/**\r\n * Creates a dual quat from a quaternion\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyQuat} q the quaternion\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\r\n * Creates a new dual quat from a matrix (4x4)\r\n *\r\n * @param {quat2} out the dual quaternion\r\n * @param {ReadonlyMat4} a the matrix\r\n * @returns {quat2} dual quat receiving operation result\r\n * @function\r\n */\n\nexport function fromMat4(out, a) {\n //TODO Optimize this\n var outer = quat.create();\n mat4.getRotation(outer, a);\n var t = new glMatrix.ARRAY_TYPE(3);\n mat4.getTranslation(t, a);\n fromRotationTranslation(out, outer, t);\n return out;\n}\n/**\r\n * Copy the values from one dual quat to another\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the source dual quaternion\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n}\n/**\r\n * Set a dual quat to the identity dual quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @returns {quat2} out\r\n */\n\nexport function identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\r\n * Set the components of a dual quat to the given values\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component\r\n * @param {Number} y2 Y component\r\n * @param {Number} z2 Z component\r\n * @param {Number} w2 W component\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n}\n/**\r\n * Gets the real part of a dual quat\r\n * @param {quat} out real part\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @return {quat} real part\r\n */\n\nexport var getReal = quat.copy;\n/**\r\n * Gets the dual part of a dual quat\r\n * @param {quat} out dual part\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @return {quat} dual part\r\n */\n\nexport function getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n}\n/**\r\n * Set the real component of a dual quat to the given quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat} q a quaternion representing the real part\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport var setReal = quat.copy;\n/**\r\n * Set the dual component of a dual quat to the given quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat} q a quaternion representing the dual part\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function setDual(out, q) {\n out[4] = q[0];\n out[5] = q[1];\n out[6] = q[2];\n out[7] = q[3];\n return out;\n}\n/**\r\n * Gets the translation of a normalized dual quat\r\n * @param {vec3} out translation\r\n * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed\r\n * @return {vec3} translation\r\n */\n\nexport function getTranslation(out, a) {\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n}\n/**\r\n * Translates a dual quat by the given vector\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to translate\r\n * @param {ReadonlyVec3} v vector to translate by\r\n * @returns {quat2} out\r\n */\n\nexport function translate(out, a, v) {\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3],\n bx1 = v[0] * 0.5,\n by1 = v[1] * 0.5,\n bz1 = v[2] * 0.5,\n ax2 = a[4],\n ay2 = a[5],\n az2 = a[6],\n aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n}\n/**\r\n * Rotates a dual quat around the X axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateX(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around the Y axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateY(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around the Z axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat by a given quaternion (a * q)\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {ReadonlyQuat} q quaternion to rotate by\r\n * @returns {quat2} out\r\n */\n\nexport function rotateByQuatAppend(out, a, q) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n}\n/**\r\n * Rotates a dual quat by a given quaternion (q * a)\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat} q quaternion to rotate by\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @returns {quat2} out\r\n */\n\nexport function rotateByQuatPrepend(out, q, a) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n bx = a[0],\n by = a[1],\n bz = a[2],\n bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around a given axis. Does the normalisation automatically\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @param {Number} rad how far the rotation should be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateAroundAxis(out, a, axis, rad) {\n //Special case for rad = 0\n if (Math.abs(rad) < glMatrix.EPSILON) {\n return copy(out, a);\n }\n\n var axisLength = Math.hypot(axis[0], axis[1], axis[2]);\n rad = rad * 0.5;\n var s = Math.sin(rad);\n var bx = s * axis[0] / axisLength;\n var by = s * axis[1] / axisLength;\n var bz = s * axis[2] / axisLength;\n var bw = Math.cos(rad);\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Adds two dual quat's\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n}\n/**\r\n * Multiplies two dual quat's\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {quat2} out\r\n */\n\nexport function multiply(out, a, b) {\n var ax0 = a[0],\n ay0 = a[1],\n az0 = a[2],\n aw0 = a[3],\n bx1 = b[4],\n by1 = b[5],\n bz1 = b[6],\n bw1 = b[7],\n ax1 = a[4],\n ay1 = a[5],\n az1 = a[6],\n aw1 = a[7],\n bx0 = b[0],\n by0 = b[1],\n bz0 = b[2],\n bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n}\n/**\r\n * Alias for {@link quat2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Scales a dual quat by a scalar number\r\n *\r\n * @param {quat2} out the receiving dual quat\r\n * @param {ReadonlyQuat2} a the dual quat to scale\r\n * @param {Number} b amount to scale the dual quat by\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n}\n/**\r\n * Calculates the dot product of two dual quat's (The dot product of the real parts)\r\n *\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {Number} dot product of a and b\r\n * @function\r\n */\n\nexport var dot = quat.dot;\n/**\r\n * Performs a linear interpolation between two dual quats's\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5)\r\n *\r\n * @param {quat2} out the receiving dual quat\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat2} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var mt = 1 - t;\n if (dot(a, b) < 0) t = -t;\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n}\n/**\r\n * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a dual quat to calculate inverse of\r\n * @returns {quat2} out\r\n */\n\nexport function invert(out, a) {\n var sqlen = squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n}\n/**\r\n * Calculates the conjugate of a dual quat\r\n * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result.\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat2} a quat to calculate conjugate of\r\n * @returns {quat2} out\r\n */\n\nexport function conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n}\n/**\r\n * Calculates the length of a dual quat\r\n *\r\n * @param {ReadonlyQuat2} a dual quat to calculate length of\r\n * @returns {Number} length of a\r\n * @function\r\n */\n\nexport var length = quat.length;\n/**\r\n * Alias for {@link quat2.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Calculates the squared length of a dual quat\r\n *\r\n * @param {ReadonlyQuat2} a dual quat to calculate squared length of\r\n * @returns {Number} squared length of a\r\n * @function\r\n */\n\nexport var squaredLength = quat.squaredLength;\n/**\r\n * Alias for {@link quat2.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Normalize a dual quat\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a dual quaternion to normalize\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function normalize(out, a) {\n var magnitude = squaredLength(a);\n\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n var a0 = a[0] / magnitude;\n var a1 = a[1] / magnitude;\n var a2 = a[2] / magnitude;\n var a3 = a[3] / magnitude;\n var b0 = a[4];\n var b1 = a[5];\n var b2 = a[6];\n var b3 = a[7];\n var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n\n return out;\n}\n/**\r\n * Returns a string representation of a dual quatenion\r\n *\r\n * @param {ReadonlyQuat2} a dual quaternion to represent as a string\r\n * @returns {String} string representation of the dual quat\r\n */\n\nexport function str(a) {\n return \"quat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \")\";\n}\n/**\r\n * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyQuat2} a the first dual quaternion.\r\n * @param {ReadonlyQuat2} b the second dual quaternion.\r\n * @returns {Boolean} true if the dual quaternions are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7];\n}\n/**\r\n * Returns whether or not the dual quaternions have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyQuat2} a the first dual quat.\r\n * @param {ReadonlyQuat2} b the second dual quat.\r\n * @returns {Boolean} true if the dual quats are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7));\n}","import * as glMatrix from \"./common.js\";\n/**\r\n * 2 Dimensional Vector\r\n * @module vec2\r\n */\n\n/**\r\n * Creates a new, empty vec2\r\n *\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(2);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec2 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec2} a vector to clone\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\r\n * Creates a new vec2 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function fromValues(x, y) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\r\n * Copy the values from one vec2 to another\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the source vector\r\n * @returns {vec2} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\r\n * Set the components of a vec2 to the given values\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} out\r\n */\n\nexport function set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\r\n * Adds two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n}\n/**\r\n * Multiplies two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n}\n/**\r\n * Divides two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to ceil\r\n * @returns {vec2} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to floor\r\n * @returns {vec2} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n}\n/**\r\n * Math.round the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to round\r\n * @returns {vec2} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n}\n/**\r\n * Scales a vec2 by a scalar number\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec2} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n}\n/**\r\n * Adds two vec2's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec2} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return Math.hypot(x, y);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return x * x + y * y;\n}\n/**\r\n * Calculates the length of a vec2\r\n *\r\n * @param {ReadonlyVec2} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0],\n y = a[1];\n return Math.hypot(x, y);\n}\n/**\r\n * Calculates the squared length of a vec2\r\n *\r\n * @param {ReadonlyVec2} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0],\n y = a[1];\n return x * x + y * y;\n}\n/**\r\n * Negates the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to negate\r\n * @returns {vec2} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to invert\r\n * @returns {vec2} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n return out;\n}\n/**\r\n * Normalize a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to normalize\r\n * @returns {vec2} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0],\n y = a[1];\n var len = x * x + y * y;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n}\n/**\r\n * Computes the cross product of two vec2's\r\n * Note that the cross product must by definition produce a 3D vector\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function cross(out, a, b) {\n var z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec2} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0],\n ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec2} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n out[0] = Math.cos(r) * scale;\n out[1] = Math.sin(r) * scale;\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat2} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat2(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat2d\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat2d} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat2d(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat3\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat3} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat3(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat4\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0];\n var y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n}\n/**\r\n * Rotate a 2D vector\r\n * @param {vec2} out The receiving vec2\r\n * @param {ReadonlyVec2} a The vec2 point to rotate\r\n * @param {ReadonlyVec2} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec2} out\r\n */\n\nexport function rotate(out, a, b, rad) {\n //Translate point to the origin\n var p0 = a[0] - b[0],\n p1 = a[1] - b[1],\n sinC = Math.sin(rad),\n cosC = Math.cos(rad); //perform rotation and translate to correct position\n\n out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n}\n/**\r\n * Get the angle between two 2D vectors\r\n * @param {ReadonlyVec2} a The first operand\r\n * @param {ReadonlyVec2} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nexport function angle(a, b) {\n var x1 = a[0],\n y1 = a[1],\n x2 = b[0],\n y2 = b[1],\n // mag is the product of the magnitudes of a and b\n mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2),\n // mag &&.. short circuits if mag == 0\n cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\n\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\r\n * Set the components of a vec2 to zero\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @returns {vec2} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec2} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec2(\" + a[0] + \", \" + a[1] + \")\";\n}\n/**\r\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec2} a The first vector.\r\n * @param {ReadonlyVec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec2} a The first vector.\r\n * @param {ReadonlyVec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1];\n var b0 = b[0],\n b1 = b[1];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1));\n}\n/**\r\n * Alias for {@link vec2.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec2.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec2.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec2.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec2.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec2.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec2s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 2;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n }\n\n return a;\n };\n}();","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./indexedBuffer\"), exports);\n__exportStar(require(\"./propArguments\"), exports);\n__exportStar(require(\"./repetitions\"), exports);\n__exportStar(require(\"./scene-child\"), exports);\n__exportStar(require(\"./scene\"), exports);\n__exportStar(require(\"./shape-base\"), exports);\n__exportStar(require(\"./shape-primitives\"), exports);\n__exportStar(require(\"./shapes\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=indexedBuffer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=propArguments.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ERepetitionType = void 0;\n/**\n * Repetition type enumerator.\n *\n * @category Core.Repetition\n * @internal\n */\nvar ERepetitionType;\n(function (ERepetitionType) {\n /**\n * Defines the type of repetition of the shape,\n * in a circular way starting from the center of the scene\n * @order 1\n */\n ERepetitionType[ERepetitionType[\"Ring\"] = 1] = \"Ring\";\n /**\n * Defines the type of repetition of the shape,\n * on a nxm grid starting from the center of the scene\n * @order 2\n */\n ERepetitionType[ERepetitionType[\"Matrix\"] = 2] = \"Matrix\";\n})(ERepetitionType = exports.ERepetitionType || (exports.ERepetitionType = {}));\n//# sourceMappingURL=repetitions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=scene-child.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=scene.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EBoundingType = void 0;\nvar EBoundingType;\n(function (EBoundingType) {\n /**\n * Relative to the real bounding of the shape\n * @order 2\n */\n EBoundingType[EBoundingType[\"Relative\"] = 1] = \"Relative\";\n /**\n * Fixed to te width and height of the shape\n * @order 3\n */\n EBoundingType[EBoundingType[\"Fixed\"] = 2] = \"Fixed\";\n})(EBoundingType = exports.EBoundingType || (exports.EBoundingType = {}));\n//# sourceMappingURL=shape-base.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//////\n//# sourceMappingURL=shape-primitives.js.map","\"use strict\";\n// Shape\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=shapes.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toVec3 = exports.toVec2 = exports.fromSkew = exports.VEC2_ONE = exports.VEC2_ZERO = exports.VEC3_ONE = exports.VEC3_ZERO = void 0;\nconst gl_matrix_1 = require(\"gl-matrix\");\nexports.VEC3_ZERO = [0, 0, 0];\nexports.VEC3_ONE = [1, 1, 1];\nexports.VEC2_ZERO = [0, 0];\nexports.VEC2_ONE = [1, 1];\ngl_matrix_1.glMatrix.setMatrixArrayType(Array);\n/**\n * Skew matrix\n *\n * @internal\n * @ignore\n */\nfunction fromSkew(out, skew) {\n out[0] = 1;\n out[1] = Math.tan(skew[1]);\n out[2] = 0;\n out[3] = 0;\n out[4] = Math.tan(skew[0]);\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\nexports.fromSkew = fromSkew;\n/**\n * number to vec 2\n *\n * @internal\n * @ignore\n */\nfunction toVec2(x) {\n if (Array.isArray(x))\n return [x[0], x[1]];\n return [x, x];\n}\nexports.toVec2 = toVec2;\n/**\n * number to vec 3\n *\n * @internal\n * @ignore\n */\nfunction toVec3(x, defaultZValue = 0) {\n if (Array.isArray(x)) {\n return [x[0], x[1], defaultZValue];\n }\n return [x, x, defaultZValue];\n}\nexports.toVec3 = toVec3;\n//# sourceMappingURL=gl-matrix-extensions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Temporany matrix\n *\n * @internal\n * @ignore\n */\nconst MATRIX = new Array(4);\n/**\n * Vec2 operation\n *\n * @category Core.Utilities\n */\nconst Vec2 = {\n /**\n * from new vertex\n *\n * @param {Array | number} [x=0]\n * @param {number} [y]\n * @returns {Array}\n */\n from: (x = 0, y) => {\n const out = new Array(2);\n if (typeof x === 'number') {\n out[0] = x;\n out[1] = y !== null && y !== void 0 ? y : x;\n }\n else {\n out[0] = x[0];\n out[1] = x[1];\n }\n return out;\n },\n normalize: (v) => {\n const len = Vec2.length(v);\n return len !== 0 ? [v[0] / len, v[1] / len] : [0, 0];\n },\n /**\n * Distance between two points\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n distance: (a, b) => Math.hypot(a[0] - b[0], a[1] - b[1]),\n /**\n * dot product\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n dot: (a, b) => a[0] * b[0] + a[1] * b[1],\n /**\n * length of point\n *\n * @param {Array} vec\n * @returns {number}\n */\n length: (vec) => Math.hypot(vec[0], vec[1]),\n /**\n * angle between two point\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n angle: (a, b) => {\n a = Vec2.normalize(a);\n b = Vec2.normalize(b);\n return Math.acos(Vec2.dot(a, b));\n },\n /**\n * skewX point\n *\n * @param {Array} vec\n * @param {number} m\n */\n skewX: (vec, m) => {\n vec[0] += Math.tan(m) * vec[1];\n },\n /**\n * skewY point\n *\n * @param {Array} vec\n * @param {number} m\n */\n skewY: (vec, m) => {\n vec[1] += Math.tan(m) * vec[0];\n },\n /**\n * squeezeX point\n *\n * @param {Array} vec\n * @param {number} m\n */\n squeezeX: (vec, m) => {\n vec[1] += vec[1] * (vec[0] * -m);\n },\n /**\n * squeezeY point\n *\n * @param {Array} vec\n * @param {number} m\n */\n squeezeY: (vec, m) => {\n vec[0] += vec[0] * (vec[1] * m);\n },\n /**\n * Rotate point\n *\n * @param {Array} vec\n * @param {Array} MATRIX\n * @param {Array} fromPoint\n * @internal\n */\n rotate: (vec, MATRIX, fromPoint) => {\n const p0 = vec[0] - fromPoint[0];\n const p1 = vec[1] - fromPoint[1];\n vec[0] = p0 * MATRIX[0] + p1 * MATRIX[1] + fromPoint[0];\n vec[1] = p0 * MATRIX[2] + p1 * MATRIX[3] + fromPoint[1];\n },\n /**\n * RotateX point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateX: (vec, fromPoint, rad) => {\n MATRIX[0] = 1;\n MATRIX[1] = 0;\n MATRIX[2] = 0;\n MATRIX[3] = Math.cos(rad);\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * RotateY point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateY: (vec, fromPoint, rad) => {\n MATRIX[0] = Math.cos(rad);\n MATRIX[1] = 0;\n MATRIX[2] = 0;\n MATRIX[3] = 1;\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * RotateZ point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateZ: (vec, fromPoint, rad) => {\n MATRIX[0] = Math.cos(rad);\n MATRIX[1] = -Math.sin(rad);\n MATRIX[2] = Math.sin(rad);\n MATRIX[3] = Math.cos(rad);\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * Translate vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n translate: (vec, to) => {\n vec[0] += to[0];\n vec[1] += to[1];\n },\n /**\n * Scale vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n scale: (vec, to) => {\n vec[0] *= to[0];\n vec[1] *= to[1];\n },\n /**\n * Scale vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n divide: (vec, to) => {\n vec[0] /= to[0];\n vec[1] /= to[1];\n },\n /**\n * Vec to string\n *\n * @param {Array} vec\n * @return {string}\n */\n toString: (vec) => `x: ${vec[0]}, y: ${vec[1]}`,\n /**\n * Vertex [0, 0]\n */\n ZERO: Array.from([0, 0]),\n /**\n * Vertex [1, 1]\n */\n ONE: Array.from([1, 1]),\n};\nexports.default = Vec2;\n//# sourceMappingURL=Vec2.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mod = exports.PHI = exports.PI2 = exports.log = void 0;\n/**\n * Return logarith value and base\n *\n * @category Core.Utilities\n *\n * @param n number\n * @param base number\n */\nconst log = (n, base) => Math.log(n) / Math.log(base);\nexports.log = log;\n/**\n * @category Core.Utilities\n */\nexports.PI2 = Math.PI * 2;\n/**\n * @category Core.Utilities\n */\nexports.PHI = (1 + Math.sqrt(5)) / 2;\n/**\n * Return a positive module of positive or negative value\n *\n * @category Core.Utilities\n *\n * @param value number\n * @param base number\n */\nconst mod = (value, base) => {\n const result = value % base;\n return result < 0 ? result + base : result;\n};\nexports.mod = mod;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Adapt = exports.Bounding = exports.EAdaptMode = void 0;\nconst Modifier_1 = require(\"./Modifier\");\n/**\n *\n *\n * @category Core.Enums\n */\nvar EAdaptMode;\n(function (EAdaptMode) {\n /**\n * The buffer is not changed\n * @order 1\n */\n EAdaptMode[EAdaptMode[\"None\"] = 0] = \"None\";\n /**\n * The buffer is scaled in a range between [-1, -1] and [1,1]\n * @order 2\n */\n EAdaptMode[EAdaptMode[\"Scale\"] = 2] = \"Scale\";\n /**\n * The buffer is scaled in a range between [-1, -1] and [1,1] and is centered\n * @order 3\n */\n EAdaptMode[EAdaptMode[\"Center\"] = 4] = \"Center\";\n /**\n * The buffer is adapted centrally and expanded in a range between [-1, -1] and [1,1]\n * @order 4\n */\n EAdaptMode[EAdaptMode[\"Fill\"] = 8] = \"Fill\";\n})(EAdaptMode = exports.EAdaptMode || (exports.EAdaptMode = {}));\n/**\n * @internal\n * @ignore\n */\nexports.Bounding = {\n empty: () => ({\n cx: 0,\n cy: 0,\n x: -1,\n y: -1,\n width: 2,\n height: 2,\n }),\n clear: (tmpBounding) => {\n tmpBounding[0] = undefined;\n tmpBounding[1] = undefined;\n tmpBounding[2] = undefined;\n tmpBounding[3] = undefined;\n },\n add: (tmpBounding, x, y) => {\n if (typeof tmpBounding[0] === 'undefined' || x < tmpBounding[0])\n tmpBounding[0] = x;\n if (typeof tmpBounding[2] === 'undefined' || x > tmpBounding[2])\n tmpBounding[2] = x;\n if (typeof tmpBounding[1] === 'undefined' || y < tmpBounding[1])\n tmpBounding[1] = y;\n if (typeof tmpBounding[3] === 'undefined' || y > tmpBounding[3])\n tmpBounding[3] = y;\n },\n sum: (dest, bounding) => {\n if (typeof bounding[0] !== 'undefined' &&\n typeof bounding[1] !== 'undefined' &&\n typeof bounding[2] !== 'undefined' &&\n typeof bounding[3] !== 'undefined') {\n if (typeof dest[0] === 'undefined' ||\n typeof dest[1] === 'undefined' ||\n typeof dest[2] === 'undefined' ||\n typeof dest[3] === 'undefined') {\n dest[0] = bounding[0];\n dest[1] = bounding[1];\n dest[2] = bounding[2];\n dest[3] = bounding[3];\n }\n else {\n if (dest[0] < bounding[0])\n dest[0] = bounding[0];\n if (dest[2] > bounding[2])\n dest[2] = bounding[2];\n if (dest[1] < bounding[1])\n dest[1] = bounding[1];\n if (dest[3] > bounding[3])\n dest[3] = bounding[3];\n }\n }\n else {\n console.warn('[Urplfanze:Bounding] cannot sum bounding');\n }\n },\n bind: (bounding, tmpBounding) => {\n if (typeof tmpBounding[0] !== 'undefined' &&\n typeof tmpBounding[1] !== 'undefined' &&\n typeof tmpBounding[2] !== 'undefined' &&\n typeof tmpBounding[3] !== 'undefined') {\n bounding.x = tmpBounding[0];\n bounding.y = tmpBounding[1];\n bounding.width = tmpBounding[2] - tmpBounding[0];\n bounding.height = tmpBounding[3] - tmpBounding[1];\n bounding.cx = bounding.x + bounding.width / 2;\n bounding.cy = bounding.y + bounding.height / 2;\n }\n else {\n console.warn('[Urplfanze:Bounding] cannot bind bounding');\n }\n },\n};\nclass Adapt extends Modifier_1.Modifier {\n constructor(args) {\n super();\n this.mode = args.mode || EAdaptMode.Fill;\n this.rect = args.rect;\n }\n apply(buffer, bClosed) {\n return Adapt.adapt(buffer, this.mode, this.rect);\n }\n /**\n * Return adapted buffer between [-1,-1] and [1,1]\n *\n * @public\n * @static\n * @param {Float32Array} input\n * @param {EAdaptMode} mode\n * @returns {Float32Array}\n * @memberof ShapeBuffer\n */\n static adapt(input, mode, rect) {\n if (mode === EAdaptMode.None)\n return Float32Array.from(input);\n const output = new Float32Array(input.length);\n if (!rect) {\n rect = Adapt.getBounding(input);\n }\n const scale = rect.width >= 2 || rect.height >= 2 || (mode >= EAdaptMode.Fill && (rect.width < 2 || rect.height < 2))\n ? 2 / Math.max(rect.width, rect.height)\n : 1;\n const translateX = mode >= EAdaptMode.Center ? rect.cx : 0;\n const translateY = mode >= EAdaptMode.Center ? rect.cy : 0;\n for (let i = 0, len = input.length; i < len; i += 2) {\n output[i] = (input[i] - translateX) * scale;\n output[i + 1] = (input[i + 1] - translateY) * scale;\n }\n return output;\n }\n /**\n * Get buffer bounding\n *\n * @static\n * @param {Float32Array | Array} buffer\n * @returns {IShapeBounding}\n * @memberof ShapePrimitive\n */\n static getBounding(buffer, bounding) {\n if (typeof bounding === 'undefined')\n bounding = exports.Bounding.empty();\n const tmp_bounding = [undefined, undefined, undefined, undefined];\n for (let i = 0, len = buffer.length; i < len; i += 2) {\n exports.Bounding.add(tmp_bounding, buffer[i], buffer[i + 1]);\n }\n exports.Bounding.bind(bounding, tmp_bounding);\n return bounding;\n }\n}\nexports.Adapt = Adapt;\nAdapt.MODES = EAdaptMode;\n//# sourceMappingURL=Adapt.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Modifier = void 0;\nclass Modifier {\n}\nexports.Modifier = Modifier;\n//# sourceMappingURL=Modifier.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.distributePointsInBuffer = exports.interpolate = exports.prepareBufferForInterpolation = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.relativeClamp = exports.clamp = exports.lerp = exports.toRadians = exports.toDegrees = exports.now = void 0;\nconst SimplexNoise = require(\"simplex-noise\");\nconst repetitions_1 = require(\"./types/repetitions\");\nconst Vec2_1 = require(\"./math/Vec2\");\n// isDef: (object: any): boolean => typeof object !== 'undefined' && object !== null,\nconst measurement = typeof performance !== 'undefined' ? performance : Date;\n/**\n * Get current timestamp in milliseconds\n *\n * @category Utilities\n * @returns {number}\n */\nfunction now() {\n return measurement.now();\n}\nexports.now = now;\n// aOr: (...args: Array): any => {\n// \tfor (let i = 0; i < args.length; i++) if (Utilities.isDef(args[i])) return args[i]\n// },\n/**\n * Convert number from radians to degrees\n *\n * @category Utilities\n *\n * @example\n * ```javascript\n * Urpflanze.toDegrees(Math.PI) // 180\n * ```\n *\n * @param {number} radians\n * @returns {number}\n */\nfunction toDegrees(radians) {\n return (radians * 180) / Math.PI;\n}\nexports.toDegrees = toDegrees;\n/**\n * Convert angle from degrees to radians\n * @example\n * ```javascript\n * Urpflanze.toRadians(180) // 3.141592653589793\n * ```\n *\n * @category Utilities\n * @param {number} degrees\n * @returns {number}\n */\nfunction toRadians(degrees) {\n return (degrees * Math.PI) / 180;\n}\nexports.toRadians = toRadians;\n// perf: (name: string, callback: any, log: boolean = false): number => {\n// \tconst t1 = now()\n// \tcallback()\n// \tconst t2 = now()\n// \tlog && console.log('perf ' + name + ': ' + (t2 - t1))\n// \treturn t2 - t1\n// }\n/**\n * Linear interpolation from `a` when `i` as 0 an `b` when `i' as 1\n *\n * @category Utilities\n * @param {number} a\n * @param {number} b\n * @param {number} i\n * @returns {number}\n */\nfunction lerp(a, b, i) {\n return (1 - i) * a + i * b;\n}\nexports.lerp = lerp;\n/**\n * Return number between min and max\n *\n * @category Utilities\n * @example\n * ```javascript\n * Urpflanze.clamp(0, 1, 1.2) // 1\n * Urpflanze.clamp(0, 1, -2) // 0\n * ```\n * @param {number} min\n * @param {number} max\n * @param {number} value\n * @returns {number}\n */\nfunction clamp(min, max, value) {\n return value <= min ? min : value >= max ? max : value;\n}\nexports.clamp = clamp;\n/**\n * Map number between refMin e refMax from min and max\n *\n * @category Utilities\n *\n * @example\n * ```javascript\n * Urpflanze.relativeClamp(0, 1, 0.5, 100, 200) // 150\n * ```\n *\n * @param {number} refMin\n * @param {number} refMax\n * @param {number} value\n * @param {number} toMin\n * @param {number} toMax\n * @returns {number}\n */\nfunction relativeClamp(refMin, refMax, value, toMin, toMax) {\n return clamp(toMin, toMax, ((value - refMin) / (refMax - refMin)) * (toMax - toMin) + toMin);\n}\nexports.relativeClamp = relativeClamp;\n/**\n * @internal\n * @ignore\n */\nconst noises = {\n random: new SimplexNoise(Math.random),\n};\n/**\n * SimplexNoise\n * Use 'random' as seed property for random seed.\n * Return value between -1 and 1\n *\n * @category Utilities\n *\n * @param {string} [seed='random']\n * @param {number} [x=0]\n * @param {number} [y=0]\n * @param {number} [z=0]\n * @returns {number} between -1 and 1\n */\nfunction noise(seed = 'random', x = 0, y = 0, z = 0) {\n if (typeof noises[seed] === 'undefined') {\n noises[seed] = new SimplexNoise(seed);\n }\n return noises[seed].noise3D(x, y, z);\n}\nexports.noise = noise;\n/**\n * Random number generator\n */\nconst randoms = {};\n/**\n * random number generator\n * @param seed\n * @returns\n */\nfunction random(seed, min = 0, max = 1, decimals) {\n const key = seed + '';\n if (typeof randoms[key] === 'undefined') {\n const seed = xmur3(key);\n randoms[key] = sfc32(seed(), seed(), seed(), seed());\n }\n const value = min + randoms[key]() * (max - min);\n return typeof decimals !== 'undefined' ? Math.round(value * 10 ** decimals) / 10 ** decimals : value;\n}\nexports.random = random;\n/**\n *\n * @internal\n * @param str\n * @returns\n */\nfunction xmur3(str) {\n let i = 0, h = 1779033703 ^ str.length;\n for (; i < str.length; i++)\n (h = Math.imul(h ^ str.charCodeAt(i), 3432918353)), (h = (h << 13) | (h >>> 19));\n return function () {\n h = Math.imul(h ^ (h >>> 16), 2246822507);\n h = Math.imul(h ^ (h >>> 13), 3266489909);\n return (h ^= h >>> 16) >>> 0;\n };\n}\n/**\n * @internal\n * @param a\n * @param b\n * @param c\n * @param d\n * @returns\n */\nfunction sfc32(a, b, c, d) {\n return function () {\n a >>>= 0;\n b >>>= 0;\n c >>>= 0;\n d >>>= 0;\n let t = (a + b) | 0;\n a = b ^ (b >>> 9);\n b = (c + (c << 3)) | 0;\n c = (c << 21) | (c >>> 11);\n d = (d + 1) | 0;\n t = (t + d) | 0;\n c = (c + t) | 0;\n return (t >>> 0) / 4294967296;\n };\n}\n/**\n * Return angle (atan) from offset (or center) for matrix repetition.\n * Offset is array between [-1, -1] and [1, 1].\n * The return value is between -Math.PI / 2 and Math.PI / 2\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter\n * @returns {number} between -Math.PI / 2 and Math.PI / 2\n */\nfunction angleFromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [(repetition.col.count - 1) / 2, (repetition.row.count - 1) / 2];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const x = repetition.col.index - 1 - centerMatrix[0];\n const y = repetition.row.index - 1 - centerMatrix[1];\n return x === 0 ? 0 : Math.atan(y / x);\n }\n return (repetition.angle - Math.PI) / 2;\n}\nexports.angleFromRepetition = angleFromRepetition;\n/**\n * Return angle (atan2, 4 quadrants) from offset (or center) for matrix repetition.\n * Offset is array between [-1, -1] and [1, 1].\n * The return value is between -Math.PI an Math.PI\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter\n * @returns {number} between -Math.PI an Math.PI\n */\nfunction angle2FromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [(repetition.col.count - 1) / 2, (repetition.row.count - 1) / 2];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const x = repetition.col.index - 1 - centerMatrix[0];\n const y = repetition.row.index - 1 - centerMatrix[1];\n return x === 0 ? 0 : Math.atan2(y, x);\n }\n return repetition.angle - Math.PI;\n}\nexports.angle2FromRepetition = angle2FromRepetition;\n/**\n * Return distance from offset (or center) for matrix repetition.\n * The return value is between 0 and 1\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter offset relative to distance prop\n * @returns {number} between 0 and 1\n */\nfunction distanceFromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [0.5, 0.5];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const current = [repetition.col.offset, repetition.row.offset];\n return Vec2_1.default.distance(current, centerMatrix);\n }\n return 1;\n}\nexports.distanceFromRepetition = distanceFromRepetition;\n/// Interpolation\n/**\n *\n * @param from\n * @param to\n * @returns\n */\nfunction prepareBufferForInterpolation(from, to) {\n const fromBufferLength = from.length;\n const toBufferLength = to.length;\n if (fromBufferLength === toBufferLength) {\n return [from, to];\n }\n const maxBufferLength = fromBufferLength > toBufferLength ? fromBufferLength : toBufferLength;\n const difference = Math.abs(fromBufferLength - toBufferLength);\n const minBufferLength = maxBufferLength - difference;\n /////\n const b = fromBufferLength < toBufferLength ? to : from;\n const t = fromBufferLength < toBufferLength ? from : to;\n const a = distributePointsInBuffer(t, Math.floor(difference / 2));\n // a[maxBufferLength - 2] = t[minBufferLength - 2]\n // a[maxBufferLength - 1] = t[minBufferLength - 1]\n return fromBufferLength > toBufferLength ? [b, a] : [a, b];\n}\nexports.prepareBufferForInterpolation = prepareBufferForInterpolation;\n/**\n *\n * @param from\n * @param to\n * @param offset\n * @returns\n */\nfunction interpolate(from, to, initialOffset = 0.5) {\n const [a, b] = prepareBufferForInterpolation(from, to);\n const maxBufferLength = Math.max(a.length, b.length);\n const offset = typeof initialOffset === 'number' ? [initialOffset] : initialOffset;\n const maxPoints = maxBufferLength / 2;\n if (offset.length !== maxPoints) {\n const tl = offset.length;\n for (let i = 0; i < maxPoints; i++) {\n offset[i] = offset[i % tl];\n }\n }\n ////\n const result = new Float32Array(maxBufferLength);\n for (let i = 0, off = 0; i < maxBufferLength; i += 2, off++) {\n result[i] = (1 - offset[off]) * a[i] + offset[off] * b[i];\n result[i + 1] = (1 - offset[off]) * a[i + 1] + offset[off] * b[i + 1];\n }\n return result;\n}\nexports.interpolate = interpolate;\nfunction distributePointsInBuffer(buffer, count) {\n const bufferLen = buffer.length;\n const pointsLen = bufferLen / 2;\n const finalBufferLength = (pointsLen + count) * 2;\n const edges = pointsLen - 1;\n if (edges > 1) {\n const lastPoint = bufferLen - 2;\n const newPointsOnEdge = Math.floor(count / edges);\n const bufferWithPointsEveryEdge = bufferLen + newPointsOnEdge * lastPoint;\n let remainingPoints = (finalBufferLength - bufferWithPointsEveryEdge) / 2;\n const edgeRemainingIndex = Math.round(edges / remainingPoints);\n const result = new Float32Array(finalBufferLength);\n for (let i = 0, edgeIndex = 0, r = 0; i < lastPoint; i += 2, edgeIndex++, r += 2) {\n const ax = buffer[i];\n const ay = buffer[i + 1];\n const bx = buffer[i + 2];\n const by = buffer[i + 3];\n result[r] = ax;\n result[r + 1] = ay;\n const addReminingPoints = remainingPoints > 0 && (edgeIndex % edgeRemainingIndex === 0 || i === lastPoint - 2);\n const currentPointsOnEdge = newPointsOnEdge + (addReminingPoints ? 1 : 0);\n const newPointOffset = 1 / (currentPointsOnEdge + 1);\n for (let h = 0; h < currentPointsOnEdge; h++, r += 2) {\n const o = newPointOffset * (h + 1);\n result[r + 2] = (1 - o) * ax + o * bx;\n result[r + 3] = (1 - o) * ay + o * by;\n }\n if (addReminingPoints) {\n remainingPoints--;\n }\n }\n result[finalBufferLength - 2] = buffer[bufferLen - 2];\n result[finalBufferLength - 1] = buffer[bufferLen - 1];\n return result;\n }\n const result = new Float32Array(finalBufferLength);\n for (let i = 0; i < finalBufferLength; i += 2) {\n result[i] = buffer[i % bufferLen];\n result[i + 1] = buffer[(i + 1) % bufferLen];\n }\n return result;\n}\nexports.distributePointsInBuffer = distributePointsInBuffer;\n//# sourceMappingURL=Utilities.js.map","/*\n * A fast javascript implementation of simplex noise by Jonas Wagner\n\nBased on a speed-improved simplex noise algorithm for 2D, 3D and 4D in Java.\nWhich is based on example code by Stefan Gustavson (stegu@itn.liu.se).\nWith Optimisations by Peter Eastman (peastman@drizzle.stanford.edu).\nBetter rank ordering method by Stefan Gustavson in 2012.\n\n\n Copyright (c) 2018 Jonas Wagner\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n(function() {\n 'use strict';\n\n var F2 = 0.5 * (Math.sqrt(3.0) - 1.0);\n var G2 = (3.0 - Math.sqrt(3.0)) / 6.0;\n var F3 = 1.0 / 3.0;\n var G3 = 1.0 / 6.0;\n var F4 = (Math.sqrt(5.0) - 1.0) / 4.0;\n var G4 = (5.0 - Math.sqrt(5.0)) / 20.0;\n\n function SimplexNoise(randomOrSeed) {\n var random;\n if (typeof randomOrSeed == 'function') {\n random = randomOrSeed;\n }\n else if (randomOrSeed) {\n random = alea(randomOrSeed);\n } else {\n random = Math.random;\n }\n this.p = buildPermutationTable(random);\n this.perm = new Uint8Array(512);\n this.permMod12 = new Uint8Array(512);\n for (var i = 0; i < 512; i++) {\n this.perm[i] = this.p[i & 255];\n this.permMod12[i] = this.perm[i] % 12;\n }\n\n }\n SimplexNoise.prototype = {\n grad3: new Float32Array([1, 1, 0,\n -1, 1, 0,\n 1, -1, 0,\n\n -1, -1, 0,\n 1, 0, 1,\n -1, 0, 1,\n\n 1, 0, -1,\n -1, 0, -1,\n 0, 1, 1,\n\n 0, -1, 1,\n 0, 1, -1,\n 0, -1, -1]),\n grad4: new Float32Array([0, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1,\n 0, -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1,\n 1, 0, 1, 1, 1, 0, 1, -1, 1, 0, -1, 1, 1, 0, -1, -1,\n -1, 0, 1, 1, -1, 0, 1, -1, -1, 0, -1, 1, -1, 0, -1, -1,\n 1, 1, 0, 1, 1, 1, 0, -1, 1, -1, 0, 1, 1, -1, 0, -1,\n -1, 1, 0, 1, -1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, -1,\n 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0,\n -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1, 0]),\n noise2D: function(xin, yin) {\n var permMod12 = this.permMod12;\n var perm = this.perm;\n var grad3 = this.grad3;\n var n0 = 0; // Noise contributions from the three corners\n var n1 = 0;\n var n2 = 0;\n // Skew the input space to determine which simplex cell we're in\n var s = (xin + yin) * F2; // Hairy factor for 2D\n var i = Math.floor(xin + s);\n var j = Math.floor(yin + s);\n var t = (i + j) * G2;\n var X0 = i - t; // Unskew the cell origin back to (x,y) space\n var Y0 = j - t;\n var x0 = xin - X0; // The x,y distances from the cell origin\n var y0 = yin - Y0;\n // For the 2D case, the simplex shape is an equilateral triangle.\n // Determine which simplex we are in.\n var i1, j1; // Offsets for second (middle) corner of simplex in (i,j) coords\n if (x0 > y0) {\n i1 = 1;\n j1 = 0;\n } // lower triangle, XY order: (0,0)->(1,0)->(1,1)\n else {\n i1 = 0;\n j1 = 1;\n } // upper triangle, YX order: (0,0)->(0,1)->(1,1)\n // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and\n // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where\n // c = (3-sqrt(3))/6\n var x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords\n var y1 = y0 - j1 + G2;\n var x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords\n var y2 = y0 - 1.0 + 2.0 * G2;\n // Work out the hashed gradient indices of the three simplex corners\n var ii = i & 255;\n var jj = j & 255;\n // Calculate the contribution from the three corners\n var t0 = 0.5 - x0 * x0 - y0 * y0;\n if (t0 >= 0) {\n var gi0 = permMod12[ii + perm[jj]] * 3;\n t0 *= t0;\n n0 = t0 * t0 * (grad3[gi0] * x0 + grad3[gi0 + 1] * y0); // (x,y) of grad3 used for 2D gradient\n }\n var t1 = 0.5 - x1 * x1 - y1 * y1;\n if (t1 >= 0) {\n var gi1 = permMod12[ii + i1 + perm[jj + j1]] * 3;\n t1 *= t1;\n n1 = t1 * t1 * (grad3[gi1] * x1 + grad3[gi1 + 1] * y1);\n }\n var t2 = 0.5 - x2 * x2 - y2 * y2;\n if (t2 >= 0) {\n var gi2 = permMod12[ii + 1 + perm[jj + 1]] * 3;\n t2 *= t2;\n n2 = t2 * t2 * (grad3[gi2] * x2 + grad3[gi2 + 1] * y2);\n }\n // Add contributions from each corner to get the final noise value.\n // The result is scaled to return values in the interval [-1,1].\n return 70.0 * (n0 + n1 + n2);\n },\n // 3D simplex noise\n noise3D: function(xin, yin, zin) {\n var permMod12 = this.permMod12;\n var perm = this.perm;\n var grad3 = this.grad3;\n var n0, n1, n2, n3; // Noise contributions from the four corners\n // Skew the input space to determine which simplex cell we're in\n var s = (xin + yin + zin) * F3; // Very nice and simple skew factor for 3D\n var i = Math.floor(xin + s);\n var j = Math.floor(yin + s);\n var k = Math.floor(zin + s);\n var t = (i + j + k) * G3;\n var X0 = i - t; // Unskew the cell origin back to (x,y,z) space\n var Y0 = j - t;\n var Z0 = k - t;\n var x0 = xin - X0; // The x,y,z distances from the cell origin\n var y0 = yin - Y0;\n var z0 = zin - Z0;\n // For the 3D case, the simplex shape is a slightly irregular tetrahedron.\n // Determine which simplex we are in.\n var i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords\n var i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords\n if (x0 >= y0) {\n if (y0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 1;\n k2 = 0;\n } // X Y Z order\n else if (x0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n } // X Z Y order\n else {\n i1 = 0;\n j1 = 0;\n k1 = 1;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n } // Z X Y order\n }\n else { // x0 y0) rankx++;\n else ranky++;\n if (x0 > z0) rankx++;\n else rankz++;\n if (x0 > w0) rankx++;\n else rankw++;\n if (y0 > z0) ranky++;\n else rankz++;\n if (y0 > w0) ranky++;\n else rankw++;\n if (z0 > w0) rankz++;\n else rankw++;\n var i1, j1, k1, l1; // The integer offsets for the second simplex corner\n var i2, j2, k2, l2; // The integer offsets for the third simplex corner\n var i3, j3, k3, l3; // The integer offsets for the fourth simplex corner\n // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order.\n // Many values of c will never occur, since e.g. x>y>z>w makes x= 3 ? 1 : 0;\n j1 = ranky >= 3 ? 1 : 0;\n k1 = rankz >= 3 ? 1 : 0;\n l1 = rankw >= 3 ? 1 : 0;\n // Rank 2 denotes the second largest coordinate.\n i2 = rankx >= 2 ? 1 : 0;\n j2 = ranky >= 2 ? 1 : 0;\n k2 = rankz >= 2 ? 1 : 0;\n l2 = rankw >= 2 ? 1 : 0;\n // Rank 1 denotes the second smallest coordinate.\n i3 = rankx >= 1 ? 1 : 0;\n j3 = ranky >= 1 ? 1 : 0;\n k3 = rankz >= 1 ? 1 : 0;\n l3 = rankw >= 1 ? 1 : 0;\n // The fifth corner has all coordinate offsets = 1, so no need to compute that.\n var x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords\n var y1 = y0 - j1 + G4;\n var z1 = z0 - k1 + G4;\n var w1 = w0 - l1 + G4;\n var x2 = x0 - i2 + 2.0 * G4; // Offsets for third corner in (x,y,z,w) coords\n var y2 = y0 - j2 + 2.0 * G4;\n var z2 = z0 - k2 + 2.0 * G4;\n var w2 = w0 - l2 + 2.0 * G4;\n var x3 = x0 - i3 + 3.0 * G4; // Offsets for fourth corner in (x,y,z,w) coords\n var y3 = y0 - j3 + 3.0 * G4;\n var z3 = z0 - k3 + 3.0 * G4;\n var w3 = w0 - l3 + 3.0 * G4;\n var x4 = x0 - 1.0 + 4.0 * G4; // Offsets for last corner in (x,y,z,w) coords\n var y4 = y0 - 1.0 + 4.0 * G4;\n var z4 = z0 - 1.0 + 4.0 * G4;\n var w4 = w0 - 1.0 + 4.0 * G4;\n // Work out the hashed gradient indices of the five simplex corners\n var ii = i & 255;\n var jj = j & 255;\n var kk = k & 255;\n var ll = l & 255;\n // Calculate the contribution from the five corners\n var t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0;\n if (t0 < 0) n0 = 0.0;\n else {\n var gi0 = (perm[ii + perm[jj + perm[kk + perm[ll]]]] % 32) * 4;\n t0 *= t0;\n n0 = t0 * t0 * (grad4[gi0] * x0 + grad4[gi0 + 1] * y0 + grad4[gi0 + 2] * z0 + grad4[gi0 + 3] * w0);\n }\n var t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1;\n if (t1 < 0) n1 = 0.0;\n else {\n var gi1 = (perm[ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]]] % 32) * 4;\n t1 *= t1;\n n1 = t1 * t1 * (grad4[gi1] * x1 + grad4[gi1 + 1] * y1 + grad4[gi1 + 2] * z1 + grad4[gi1 + 3] * w1);\n }\n var t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2;\n if (t2 < 0) n2 = 0.0;\n else {\n var gi2 = (perm[ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]]] % 32) * 4;\n t2 *= t2;\n n2 = t2 * t2 * (grad4[gi2] * x2 + grad4[gi2 + 1] * y2 + grad4[gi2 + 2] * z2 + grad4[gi2 + 3] * w2);\n }\n var t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3;\n if (t3 < 0) n3 = 0.0;\n else {\n var gi3 = (perm[ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]]] % 32) * 4;\n t3 *= t3;\n n3 = t3 * t3 * (grad4[gi3] * x3 + grad4[gi3 + 1] * y3 + grad4[gi3 + 2] * z3 + grad4[gi3 + 3] * w3);\n }\n var t4 = 0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4;\n if (t4 < 0) n4 = 0.0;\n else {\n var gi4 = (perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32) * 4;\n t4 *= t4;\n n4 = t4 * t4 * (grad4[gi4] * x4 + grad4[gi4 + 1] * y4 + grad4[gi4 + 2] * z4 + grad4[gi4 + 3] * w4);\n }\n // Sum up and scale the result to cover the range [-1,1]\n return 27.0 * (n0 + n1 + n2 + n3 + n4);\n }\n };\n\n function buildPermutationTable(random) {\n var i;\n var p = new Uint8Array(256);\n for (i = 0; i < 256; i++) {\n p[i] = i;\n }\n for (i = 0; i < 255; i++) {\n var r = i + ~~(random() * (256 - i));\n var aux = p[i];\n p[i] = p[r];\n p[r] = aux;\n }\n return p;\n }\n SimplexNoise._buildPermutationTable = buildPermutationTable;\n\n function alea() {\n // Johannes Baagøe , 2010\n var s0 = 0;\n var s1 = 0;\n var s2 = 0;\n var c = 1;\n\n var mash = masher();\n s0 = mash(' ');\n s1 = mash(' ');\n s2 = mash(' ');\n\n for (var i = 0; i < arguments.length; i++) {\n s0 -= mash(arguments[i]);\n if (s0 < 0) {\n s0 += 1;\n }\n s1 -= mash(arguments[i]);\n if (s1 < 0) {\n s1 += 1;\n }\n s2 -= mash(arguments[i]);\n if (s2 < 0) {\n s2 += 1;\n }\n }\n mash = null;\n return function() {\n var t = 2091639 * s0 + c * 2.3283064365386963e-10; // 2^-32\n s0 = s1;\n s1 = s2;\n return s2 = t - (c = t | 0);\n };\n }\n function masher() {\n var n = 0xefc8249d;\n return function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n }\n\n // amd\n if (typeof define !== 'undefined' && define.amd) define(function() {return SimplexNoise;});\n // common js\n if (typeof exports !== 'undefined') exports.SimplexNoise = SimplexNoise;\n // browser\n else if (typeof window !== 'undefined') window.SimplexNoise = SimplexNoise;\n // nodejs\n if (typeof module !== 'undefined') {\n module.exports = SimplexNoise;\n }\n\n})();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Shape = void 0;\nconst Scene_1 = require(\"../Scene\");\nconst SceneChild_1 = require(\"../SceneChild\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\n/**\n * Container of ShapeBase or Group, it applies transformations on each repetition\n *\n * @category Core.Shapes\n */\nclass Shape extends ShapeBase_1.ShapeBase {\n /**\n * Creates an instance of Shape.\n *\n * @param {ShapeSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'Shape';\n super(settings);\n if (settings.shape instanceof SceneChild_1.SceneChild) {\n this.shape = settings.shape;\n }\n else {\n console.warn(\"[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\\nYou passed:\", settings.shape);\n }\n this.shapeUseParent = !!settings.shapeUseParent;\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n */\n isStatic() {\n // return super.isStatic() && !this.shapeUseParent\n return super.isStatic() && (this.shape ? this.shape.isStatic() : true);\n }\n /**\n * Check if shape has static index\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return super.isStaticIndexed() && (this.shape ? this.shape.isStaticIndexed() : true);\n }\n /**\n * Find shape by id or name\n *\n * @param {number | string} idOrName\n * @returns {(SceneChild | null)}\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n if (this.shape)\n return this.shape.find(idOrName);\n return null;\n }\n /**\n * Return length of buffer\n *\n * @param {PropArguments} propArguments\n * @returns {number}\n */\n getBufferLength(propArguments) {\n if (this.bStatic && this.buffer && this.buffer.length > 0)\n return this.buffer.length;\n const childBufferLength = this.shape ? this.shape.getBufferLength(propArguments) : 0;\n return childBufferLength * this.getRepetitionCount();\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape) {\n if (this.shapeUseParent || this.shape.generateId !== generateId) {\n if (this.shapeUseParent) {\n this.shape.clearBuffer(true, false);\n }\n this.shape.generate(generateId, false, propArguments);\n }\n return this.shape.getBuffer();\n }\n return Shape.EMPTY_BUFFER;\n }\n /**\n * Return bounding\n *\n * @param {boolean} bDirectSceneChild\n * @returns {IShapeBounding}\n */\n getShapeBounding() {\n if (this.shape) {\n return this.shape.getBounding();\n }\n return this.bounding; // empty bounding defined in ShapeBase\n }\n /**\n * Add to indexed buffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n const parentBufferIndex = {\n shape: this,\n frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n };\n for (let i = 0, len = childIndexedBuffer.length; i < len; i++) {\n const currentIndexed = { ...childIndexedBuffer[i] };\n const parent = currentIndexed.parent\n ? Shape.setIndexedParent(currentIndexed.parent, parentBufferIndex)\n : parentBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n }\n }\n }\n /**\n * Set parent of indexed\n *\n * @static\n * @param {(IBufferIndex )} current\n * @param {IBufferIndex} parent\n * @returns {(IBufferIndex )}\n */\n static setIndexedParent(current, parent) {\n const index = {\n ...current,\n };\n index.parent = current.parent ? Shape.setIndexedParent(current.parent, parent) : parent;\n return index;\n }\n /**\n * Set shape\n *\n * @param {(SceneChild | undefined)} [shape]\n */\n setShape(shape) {\n if (typeof shape === 'undefined') {\n this.shape = undefined;\n this.clearBuffer(true, true);\n }\n else {\n this.scene && Scene_1.Scene.propagateToChilden(shape, this.scene);\n this.shape = shape;\n this.shape.clearBuffer(true, true);\n }\n }\n}\nexports.Shape = Shape;\n//# sourceMappingURL=Shape.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapePrimitive = void 0;\nconst glme = require(\"../math/gl-matrix-extensions\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\nconst Modifier_1 = require(\"../modifiers/Modifier\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\n/**\n * @category Core.Abstract\n */\nclass ShapePrimitive extends ShapeBase_1.ShapeBase {\n /**\n * Creates an instance of ShapePrimitive.\n *\n * @param {IShapePrimitiveSettings} [settings={}]\n */\n constructor(settings = {}) {\n var _a;\n super(settings);\n /**\n * Contain the bounding of the last generated buffer\n *\n * @type {IShapeBounding}\n */\n this.currentGenerationPrimitiveBounding = Adapt_1.Bounding.empty();\n this.props.sideLength =\n typeof settings.sideLength === 'undefined'\n ? undefined\n : typeof settings.sideLength === 'function'\n ? settings.sideLength\n : glme.toVec2(settings.sideLength);\n this.drawer = settings.drawer || {};\n this.modifiers = settings.modifiers;\n this.bClosed = (_a = settings.bClosed) !== null && _a !== void 0 ? _a : true;\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n * @memberof ShapePrimitive\n */\n isStatic() {\n return typeof this.props.sideLength !== 'function' && super.isStatic();\n }\n /**\n * Return sideLength for current repetition\n *\n * @param propArguments\n * @returns\n */\n getRepetitionSideLength(propArguments) {\n if (this.bStatic) {\n // not set default value into constructor because it can be overridden by group\n if (typeof this.props.sideLength === 'undefined') {\n this.props.sideLength = [50, 50];\n }\n else if (typeof this.props.sideLength === 'number') {\n this.props.sideLength = [this.props.sideLength, this.props.sideLength];\n }\n return this.props.sideLength;\n }\n return glme.toVec2(this.getProp('sideLength', propArguments, [50, 50]));\n }\n /**\n * Apply modifiers on single repetition buffer\n *\n * @param buffer\n * @returns\n */\n applyModifiers(buffer, propArguments) {\n if (typeof this.modifiers === 'undefined')\n return buffer;\n let modified = buffer;\n const modifiers = Array.isArray(this.modifiers) ? this.modifiers : [this.modifiers];\n for (let i = 0, len = modifiers.length; i < len; i++) {\n const modifier = modifiers[i] instanceof Modifier_1.Modifier\n ? modifiers[i]\n : modifiers[i](propArguments);\n //@ts-ignore\n modified = modifier.apply(modified, this.bClosed, this);\n }\n return modified;\n }\n /**\n * Return a bounding of generated buffer if is direct scene child\n *\n * @returns {IShapeBounding}\n * @memberof ShapePrimitive\n */\n getShapeBounding() {\n return this.currentGenerationPrimitiveBounding;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n const index = {\n shape: this,\n frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n };\n this.indexedBuffer.push(index);\n }\n /**\n * Return bClosed\n *\n * @returns {boolean}\n * @memberof ShapePrimitive\n */\n isClosed() {\n return this.bClosed;\n }\n /**\n * Set bClosed\n *\n * @param {boolean} bClosed\n * @memberof ShapePrimitive\n */\n setClosed(bClosed) {\n this.bClosed = bClosed;\n }\n}\nexports.ShapePrimitive = ShapePrimitive;\n//# sourceMappingURL=ShapePrimitive.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeLoop = void 0;\nconst math_1 = require(\"../math\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst ShapePrimitive_1 = require(\"../shapes/ShapePrimitive\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\n/**\n * Shape Loop\n *\n * @category Core.Shapes\n * @public\n * @class ShapeLoop\n * @extends {ShapePrimitive}\n */\nclass ShapeLoop extends ShapePrimitive_1.ShapePrimitive {\n /**\n * Creates an instance of ShapeLoop.\n *\n * @param {IShapeLoopSettings} [settings={}]\n * @param {boolean} [bPreventGeneration=false]\n */\n constructor(settings = {}, bPreventGeneration = false) {\n settings.type = settings.type || 'ShapeLoop';\n super(settings);\n this.loopDependencies = (settings.loopDependencies || []).concat('sideLength');\n this.props.loop = settings.loop;\n if (!bPreventGeneration) {\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: math_1.PI2 / 10,\n vertex: () => [0, 0],\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n }\n /**\n * Check if currentOrSingleLoopBuffer is static\n *\n * @returns {boolean}\n */\n isStaticLoop() {\n if (this.loopDependencies.includes('propArguments'))\n return false;\n for (let i = 0, len = this.loopDependencies.length; i < len; i++)\n if (typeof this.props[this.loopDependencies[i]] === 'function')\n return false;\n return true;\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n */\n isStatic() {\n return this.bStaticLoop && super.isStatic();\n }\n /**\n * Check if shape has static indexed\n * The number of vertices is defined by number of loop iteration\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n // return this.bStaticLoop && super.isStaticIndexed()\n return (super.isStaticIndexed() &&\n (typeof this.props.loop !== 'undefined'\n ? typeof this.props.loop.start !== 'function' &&\n typeof this.props.loop.end !== 'function' &&\n typeof this.props.loop.inc !== 'function'\n : true));\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.bStaticLoop = this.isStaticLoop();\n if (bClearIndexed) {\n this.currentOrSingleLoopBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n * Set single or multiple props\n *\n * @param {(Props)} key\n * @param {*} [value]\n * @param {boolean} [bClearIndexed=false]\n */\n setProp(key, value) {\n let bClearIndexed = false;\n const keys = (typeof key === 'string' ? { [key]: value } : key);\n for (let i = this.loopDependencies.length - 1; i >= 0; i--) {\n if (this.loopDependencies[i] in keys) {\n // this.props.loop = undefined\n bClearIndexed = true;\n break;\n }\n }\n if ('loop' in keys) {\n keys.loop = { ...this.props.loop, ...keys.loop };\n bClearIndexed = true;\n }\n super.setProp(keys, value, bClearIndexed);\n }\n /**\n * Return length of buffer\n *\n * @param {PropArguments} [propArguments]\n * @returns {number}\n */\n getBufferLength(propArguments) {\n if (this.bStatic && typeof this.buffer !== 'undefined')\n return this.buffer.length;\n if (this.bStaticLoop && typeof this.currentOrSingleLoopBuffer !== 'undefined')\n return this.currentOrSingleLoopBuffer.length * this.getRepetitionCount();\n const { count } = this.getLoop(propArguments || ShapeBase_1.ShapeBase.getEmptyPropArguments(this));\n return this.getRepetitionCount() * count * 2;\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (!this.bStaticLoop)\n return this.generateLoopBuffer(propArguments);\n if (typeof this.props.sideLength === 'function' || typeof this.currentOrSingleLoopBuffer === 'undefined')\n this.currentOrSingleLoopBuffer = this.generateLoopBuffer(propArguments);\n return this.currentOrSingleLoopBuffer;\n }\n /**\n * Generate loop buffer\n *\n * @protected\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateLoopBuffer(propArguments) {\n const { start, inc, /*end,*/ count } = this.getLoop(propArguments);\n const sideLength = this.getRepetitionSideLength(propArguments);\n const getVertex = (this.props.loop && this.props.loop.vertex ? this.props.loop.vertex : this.loop.vertex);\n const shapeLoop = {\n index: 0,\n offset: 0,\n current: 0,\n count: count,\n };\n const vertexLength = shapeLoop.count;\n const bufferLength = vertexLength * 2;\n const currentOrSingleLoopBuffer = new Float32Array(bufferLength);\n for (let i = 0, j = 0; i < vertexLength; i++, j += 2) {\n const current = start + inc * i;\n const offset = shapeLoop.count > 1 ? i / (shapeLoop.count - 1) : 1;\n // const angle = (end - start) * offset + start\n shapeLoop.current = current;\n shapeLoop.index = i + 1;\n shapeLoop.offset = offset;\n const vertex = getVertex(shapeLoop, propArguments);\n currentOrSingleLoopBuffer[j] = vertex[0];\n currentOrSingleLoopBuffer[j + 1] = vertex[1];\n // currentOrSingleLoopBuffer[j] *= sideLength[0]\n // currentOrSingleLoopBuffer[j + 1] *= sideLength[1]\n // Bounding.add(tmpBounding, currentOrSingleLoopBuffer[j], currentOrSingleLoopBuffer[j + 1])\n }\n const tmpBounding = [undefined, undefined, undefined, undefined];\n const buffer = this.applyModifiers(currentOrSingleLoopBuffer, propArguments);\n for (let i = 0, len = buffer.length; i < len; i += 2) {\n buffer[i] = buffer[i] * sideLength[0];\n buffer[i + 1] = buffer[i + 1] * sideLength[1];\n Adapt_1.Bounding.add(tmpBounding, buffer[i], buffer[i + 1]);\n }\n Adapt_1.Bounding.bind(this.currentGenerationPrimitiveBounding, tmpBounding);\n return buffer;\n }\n /**\n * Return information about a client loop gnerator\n *\n * @public\n * @param {PropArguments} propArguments\n * @returns {ShapeLoopInformation}\n */\n getLoop(propArguments) {\n var _a, _b, _c, _d, _e, _f;\n let start = (_b = (_a = this.props.loop) === null || _a === void 0 ? void 0 : _a.start) !== null && _b !== void 0 ? _b : this.loop.start;\n let end = (_d = (_c = this.props.loop) === null || _c === void 0 ? void 0 : _c.end) !== null && _d !== void 0 ? _d : this.loop.end;\n let inc = (_f = (_e = this.props.loop) === null || _e === void 0 ? void 0 : _e.inc) !== null && _f !== void 0 ? _f : this.loop.inc;\n start = (typeof start === 'function' ? start(propArguments) : start);\n end = (typeof end === 'function' ? end(propArguments) : end);\n inc = (typeof inc === 'function' ? inc(propArguments) : inc);\n const count = Math.ceil((end - start) / inc);\n return { start, end, inc, count: count <= 0 ? 0 : count };\n }\n /**\n * Set shape from loop generator\n *\n * @param {(IShapeLoopGenerator)} [shape]\n */\n setShape(loop) {\n this.setProp('loop', loop);\n }\n /**\n * Get static buffer\n *\n * @param sideLength\n * @returns\n */\n static getBuffer(props) {\n const shape = new this({ ...props, sideLength: props.sideLength || 1 });\n shape.generate();\n return shape.getBuffer() || new Float32Array();\n }\n}\nexports.ShapeLoop = ShapeLoop;\nShapeLoop.PId2 = Math.PI / 2;\n//# sourceMappingURL=ShapeLoop.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeBuffer = void 0;\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst ShapePrimitive_1 = require(\"../shapes/ShapePrimitive\");\n/**\n * @category Core.Shapes\n */\nclass ShapeBuffer extends ShapePrimitive_1.ShapePrimitive {\n /**\n * Creates an instance of ShapeBuffer.\n *\n * @param {IShapeBufferSettings} [settings={}]\n */\n constructor(settings = {}) {\n var _a, _b;\n settings.type = settings.type || 'ShapeBuffer';\n settings.adaptMode = (_a = settings.adaptMode) !== null && _a !== void 0 ? _a : Adapt_1.EAdaptMode.Scale;\n super(settings);\n this.adaptMode = (_b = settings.adaptMode) !== null && _b !== void 0 ? _b : Adapt_1.EAdaptMode.Fill;\n if (typeof settings.shape === 'undefined') {\n console.warn('[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property');\n this.shape = ShapeBuffer.EMPTY_BUFFER;\n }\n else {\n this.shape = typeof settings.shape !== 'function' ? Adapt_1.Adapt.adapt(settings.shape, this.adaptMode) : settings.shape;\n }\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n /**\n * Check shape is static\n *\n * @returns boolean\n */\n isStatic() {\n return typeof this.shape !== 'function' && super.isStatic();\n }\n /**\n * Check shape is static indexed\n *\n * @returns boolean\n */\n isStaticIndexed() {\n return typeof this.shape !== 'function' && super.isStaticIndexed();\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n this.shapeBuffer = undefined;\n }\n /**\n * Apply sideLength on .shape buffer and calculate bounding\n *\n * @protected\n */\n bindBuffer(propArguments) {\n const sideLength = this.getRepetitionSideLength(propArguments);\n const shapeBuffer = this.applyModifiers(Float32Array.from(typeof this.shape === 'function' ? this.shape(propArguments) : this.shape), propArguments);\n const tmpBounding = [undefined, undefined, undefined, undefined];\n for (let i = 0, len = shapeBuffer.length; i < len; i += 2) {\n shapeBuffer[i] = shapeBuffer[i] * sideLength[0];\n shapeBuffer[i + 1] = shapeBuffer[i + 1] * sideLength[1];\n Adapt_1.Bounding.add(tmpBounding, shapeBuffer[i], shapeBuffer[i + 1]);\n }\n Adapt_1.Bounding.bind(this.currentGenerationPrimitiveBounding, tmpBounding);\n this.shapeBuffer = shapeBuffer;\n }\n /**\n * Return length of buffer\n *\n * @param {IPropArguments} propArguments\n * @returns {number}\n */\n getBufferLength( /*propArguments?: IPropArguments*/) {\n if (this.buffer && this.buffer.length > 0)\n return this.buffer.length;\n return this.shape.length * this.getRepetitionCount();\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (typeof this.shapeBuffer === 'undefined' ||\n typeof this.props.sideLength === 'function' ||\n typeof this.shape === 'function') {\n this.bindBuffer(propArguments);\n }\n return this.shapeBuffer;\n }\n /**\n * Set shape\n *\n * @param {(Float32Array)} [shape]\n */\n setShape(shape) {\n this.shape = Adapt_1.Adapt.adapt(shape, this.adaptMode);\n this.clearBuffer(true);\n }\n /**\n * Return adaptMode\n *\n * @returns {EAdaptMode}\n * @memberof ShapeBase\n */\n getAdaptMode() {\n return this.adaptMode;\n }\n /**\n * Get static buffer\n *\n * @param sideLength\n * @returns\n */\n static getBuffer(props = {}) {\n const shape = new this({ ...props, sideLength: props.sideLength || 1 });\n shape.generate();\n return shape.getBuffer() || new Float32Array();\n }\n}\nexports.ShapeBuffer = ShapeBuffer;\n//# sourceMappingURL=ShapeBuffer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeRecursive = void 0;\nconst Shape_1 = require(\"./Shape\");\n/**\n * @category Core.Shapes\n */\nclass ShapeRecursive extends Shape_1.Shape {\n /**\n * Creates an instance of ShapeRecursive.\n *\n * @param {IShapeRecursiveSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'ShapeRecursive';\n super(settings);\n this.props.recursions = settings.recursions || 1;\n this.props.recursionScale = settings.recursionScale || 2;\n this.props.recursionVertex = settings.recursionVertex || 0;\n // this.bInner = settings.bInner ?? false\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n this.shapeUseRecursion = !!settings.shapeUseRecursion;\n // this.currentGenerationRecursiveBounding = Bounding.empty()\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n if (bClearIndexed) {\n this.shapeRecursiveBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n * Set type of recursion\n *\n * @param {boolean} inner\n */\n // public setRecursionnInner(inner: boolean): void {\n // \tthis.bInner = inner\n // \tthis.clearBuffer(true)\n // }\n /**\n *\n * @returns {boolean}\n */\n isStatic() {\n return (typeof this.props.recursions !== 'function' &&\n typeof this.props.recursionScale !== 'function' &&\n typeof this.props.recursionVertex !== 'function' &&\n super.isStatic());\n }\n /**\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return (typeof this.props.recursions !== 'function' &&\n typeof this.props.recursionVertex !== 'function' &&\n super.isStaticIndexed());\n }\n /**\n * Return a buffer of children shape with recursion\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape) {\n if (typeof this.shapeRecursiveBuffer === 'undefined' ||\n this.shapeUseParent ||\n this.shape.generateId !== generateId) {\n this.bindBuffer(generateId, propArguments);\n }\n return this.shapeRecursiveBuffer;\n }\n return Shape_1.Shape.EMPTY_BUFFER;\n }\n /**\n * Generate Recoursive shape buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n */\n bindBuffer(generateId, propArguments) {\n const recursions = Math.floor(this.getProp('recursions', propArguments, 1));\n const recursionVertex = Math.floor(this.getProp('recursionVertex', propArguments, 0));\n const recursionScale = this.getProp('recursionScale', propArguments, 2);\n const childShape = this.shape;\n let currentRecursionRepetition = {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: 1 },\n };\n const recursionPropArguments = {\n ...propArguments,\n recursion: currentRecursionRepetition,\n };\n childShape.generate(generateId, false, recursionPropArguments);\n const firstGenerationChildBuffer = childShape.getBuffer();\n if (recursions <= 1) {\n // this.currentGenerationRecursiveBounding = this.shape.getBounding()\n this.shapeRecursiveBuffer = firstGenerationChildBuffer;\n return;\n }\n let shapeBuffer = firstGenerationChildBuffer;\n const storedRecursion = [currentRecursionRepetition];\n let paretRecursionIndex = 0, added = 1;\n // const tmpBounding = [undefined, undefined, undefined, undefined]\n const singleShapeBufferLength = shapeBuffer.length;\n const realVertexCount = singleShapeBufferLength / 2;\n const singleShapeVertexCount = recursionVertex <= 0 ? realVertexCount : Math.min(recursionVertex, realVertexCount);\n const recursionOffsetMultiplier = recursionVertex === 0 ? 1 : realVertexCount / Math.min(recursionVertex, realVertexCount);\n const recusiveShapeBuffer = new Float32Array(ShapeRecursive.summmation(recursions, singleShapeVertexCount) * singleShapeBufferLength);\n for (let i = 0; i < singleShapeBufferLength; i += 2) {\n recusiveShapeBuffer[i] = shapeBuffer[i];\n recusiveShapeBuffer[i + 1] = shapeBuffer[i + 1];\n // Bounding.add(tmpBounding, recusiveShapeBuffer[i], recusiveShapeBuffer[i + 1])\n }\n for (let currentRecursion = 1; currentRecursion < recursions; currentRecursion++) {\n const level_offset = recursions > 1 ? currentRecursion / (recursions - 1) : 1;\n const currentRecursionVertexCount = ShapeRecursive.summmation(currentRecursion, singleShapeVertexCount);\n const recursionBufferStartIndex = currentRecursionVertexCount * singleShapeBufferLength;\n const parentRecursion = currentRecursion - 1;\n const parentRecursionBufferStartIndex = parentRecursion === 0\n ? 0\n : ShapeRecursive.summmation(parentRecursion, singleShapeVertexCount) * singleShapeBufferLength;\n for (let currentShapeRecursionRepetition = 0, totalRecursionRepetitions = singleShapeVertexCount ** currentRecursion; currentShapeRecursionRepetition < totalRecursionRepetitions; currentShapeRecursionRepetition++, added++) {\n currentRecursionRepetition = {\n index: currentShapeRecursionRepetition + 1,\n offset: totalRecursionRepetitions > 1 ? currentShapeRecursionRepetition / (totalRecursionRepetitions - 1) : 1,\n count: totalRecursionRepetitions,\n level: { index: currentRecursion + 1, offset: level_offset, count: recursions },\n parent: storedRecursion[paretRecursionIndex],\n };\n storedRecursion.push(currentRecursionRepetition);\n if (this.shapeUseRecursion) {\n recursionPropArguments.recursion = currentRecursionRepetition;\n childShape.generate(generateId, false, recursionPropArguments);\n shapeBuffer = childShape.getBuffer();\n }\n const shapeVertexBufferIndex = recursionBufferStartIndex + currentShapeRecursionRepetition * singleShapeBufferLength;\n // const centerVertexIndex = parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2\n const centerVertexIndex = Math.floor(parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2 * recursionOffsetMultiplier);\n const centerX = recusiveShapeBuffer[centerVertexIndex];\n const centerY = recusiveShapeBuffer[centerVertexIndex + 1];\n const currentRecursionScale = recursionScale ** currentRecursion;\n for (let i = 0, len = singleShapeBufferLength; i < len; i += 2) {\n // if (this.bInner) {\n // \tconst parentCurrentVertex =\n // \t\tparentRecursionBufferStartIndex +\n // \t\tMath.floor(currentShapeRecursionRepetition / singleShapeVertexCount) *\n // \t\t\tsingleShapeVertexCount *\n // \t\t\trecursionOffsetMultiplier *\n // \t\t\t2\n // \tconst parentX = recusiveShapeBuffer[parentCurrentVertex + i]\n // \tconst parentY = recusiveShapeBuffer[parentCurrentVertex + i + 1]\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i] = (centerX - parentX) / recursionScale + parentX\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = (centerY - parentY) / recursionScale + parentY\n // const parentX = shapeBuffer[i] / recursionScale ** currentRecursion\n // const parentY = shapeBuffer[i + 1] / recursionScale ** currentRecursion\n // recusiveShapeBuffer[shapeVertexBufferIndex + i] = (centerX - parentX) / recursionScale + parentX\n // recusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = (centerY - parentY) / recursionScale + parentY\n // } else {\n const parentXScaled = shapeBuffer[i] / currentRecursionScale;\n const parentYScaled = shapeBuffer[i + 1] / currentRecursionScale;\n recusiveShapeBuffer[shapeVertexBufferIndex + i] = centerX + parentXScaled;\n recusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = centerY + parentYScaled;\n // }\n // Bounding.add(\n // \ttmpBounding,\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i],\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i + 1]\n // )\n }\n if (added % singleShapeVertexCount === 0) {\n paretRecursionIndex += 1;\n }\n }\n }\n // Bounding.bind(this.currentGenerationRecursiveBounding, tmpBounding)\n this.shapeRecursiveBuffer = recusiveShapeBuffer;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const propArguments = { repetition, shape: this };\n const recursions = Math.floor(this.getProp('recursions', propArguments, 1));\n const recursionVertex = Math.floor(this.getProp('recursionVertex', propArguments, 0));\n // const realFrameLength = ShapeRecursive.summmation(recursions, this.shape.getBufferLength() / 2)\n const bufferIndex = {\n shape: this,\n frameLength: frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n recursion: {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: recursions },\n },\n };\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentRecursionRepetition = {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: recursions },\n };\n const recursionBufferIndex = {\n ...bufferIndex,\n recursion: currentRecursionRepetition,\n };\n const parent = (currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, recursionBufferIndex)\n : recursionBufferIndex);\n this.indexedBuffer.push({\n ...currentIndexed,\n parent,\n });\n }\n if (recursions > 1) {\n const realVertexCount = this.shape.getBufferLength({ ...propArguments, parent: { ...bufferIndex } }) / 2;\n const vertexCount = recursionVertex <= 0 ? realVertexCount : Math.min(recursionVertex, realVertexCount);\n const storedRecursion = this.indexedBuffer.map(indexed => [indexed.parent.recursion]);\n let paretRecursionIndex = 0, added = 1;\n for (let i = 1; i < recursions; i++) {\n const level_offset = recursions > 1 ? i / (recursions - 1) : 1;\n for (let j = 0, len = vertexCount ** i; j < len; j++, added++) {\n const recursionOffset = len > 1 ? j / (len - 1) : 1;\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentRecursionRepetition = {\n index: j + 1,\n offset: recursionOffset,\n count: len,\n level: { index: i + 1, offset: level_offset, count: recursions },\n parent: storedRecursion[childIndexed][paretRecursionIndex],\n };\n const recursionBufferIndex = { ...bufferIndex, recursion: currentRecursionRepetition };\n const parent = currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, recursionBufferIndex)\n : recursionBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n storedRecursion[childIndexed].push(currentRecursionRepetition);\n if (added % vertexCount === 0) {\n paretRecursionIndex += 1;\n }\n }\n }\n }\n }\n }\n }\n /**\n * Retturn summation value\n *\n * @static\n * @param {number} recursion\n * @param {number} vertexCount\n * @returns {number}\n */\n static summmation(recursion, vertexCount) {\n if (recursion === 1)\n return 1;\n let result = 1;\n for (let i = 1; i < recursion; i++)\n result += vertexCount ** i;\n return result;\n }\n /**\n * Empty recursion repetition\n *\n * @static\n * @return {*} {IRecursionRepetition}\n */\n static getEmptyRecursion() {\n return {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: 1, count: 1 },\n };\n }\n}\nexports.ShapeRecursive = ShapeRecursive;\n//# sourceMappingURL=ShapeRecursive.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeFollow = void 0;\nconst Shape_1 = require(\"./Shape\");\n/**\n * @category Core.Shapes\n */\nclass ShapeFollow extends Shape_1.Shape {\n /**\n * Creates an instance of ShapeFollow.\n *\n * @param {IShapeFollowSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'ShapeFollow';\n super(settings);\n this.follow = settings.follow || settings.shape;\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n this.shapeUseFollow = !!settings.shapeUseFollow;\n // this.currentGenerationRecursiveBounding = Bounding.empty()\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n if (bClearIndexed) {\n this.shapeFollowBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n *\n * @returns {boolean}\n */\n isStatic() {\n return (this.follow ? this.follow.isStatic() : true) && super.isStatic();\n }\n /**\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return (this.follow ? this.follow.isStaticIndexed() : true) && super.isStaticIndexed();\n }\n /**\n * Return a buffer of children shape with recursion\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape && this.follow) {\n if (typeof this.shapeFollowBuffer === 'undefined' ||\n this.shapeUseParent ||\n this.shape.generateId !== generateId ||\n this.follow.generateId !== generateId) {\n this.bindBuffer(generateId, propArguments);\n }\n return this.shapeFollowBuffer;\n }\n return Shape_1.Shape.EMPTY_BUFFER;\n }\n /**\n * Generate Recoursive shape buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n */\n bindBuffer(generateId, propArguments) {\n const followShape = this.follow;\n followShape.generate(generateId, false, propArguments);\n const followBuffer = followShape.getBuffer();\n // const followIndexed = followShape.getIndexedBuffer() as Array\n const followPropArguments = {\n ...propArguments,\n follow: {\n index: 1,\n offset: 1,\n count: 1,\n },\n // follow_repetition: followIndexed[0].repetition,\n };\n const childShape = this.shape;\n childShape.generate(generateId, false, followPropArguments);\n let shapeBuffer = childShape.getBuffer();\n // const tmpBounding = [undefined, undefined, undefined, undefined]\n const singleShapeBufferLength = shapeBuffer.length;\n const followShapeBuffer = new Float32Array(singleShapeBufferLength * (followBuffer.length / 2));\n const totalFollowVertexCount = followBuffer.length / 2;\n for (let currentShapeFollowRepetition = 0; currentShapeFollowRepetition < totalFollowVertexCount; currentShapeFollowRepetition++) {\n const currentFollowRepetition = {\n index: currentShapeFollowRepetition + 1,\n offset: totalFollowVertexCount > 1 ? currentShapeFollowRepetition / (totalFollowVertexCount - 1) : 1,\n count: totalFollowVertexCount,\n };\n if (this.shapeUseFollow) {\n followPropArguments.follow = currentFollowRepetition;\n // followPropArguments.follow_repetition = followIndexed[currentShapeFollowRepetition].repetition\n childShape.generate(generateId, false, followPropArguments);\n shapeBuffer = childShape.getBuffer();\n }\n const shapeVertexBufferIndex = currentShapeFollowRepetition * singleShapeBufferLength;\n // const centerVertexIndex = parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2\n const centerVertexIndex = currentShapeFollowRepetition * 2;\n const centerX = followBuffer[centerVertexIndex];\n const centerY = followBuffer[centerVertexIndex + 1];\n for (let i = 0, len = shapeBuffer.length; i < len; i += 2) {\n followShapeBuffer[shapeVertexBufferIndex + i] = centerX + shapeBuffer[i];\n followShapeBuffer[shapeVertexBufferIndex + i + 1] = centerY + shapeBuffer[i + 1];\n // Bounding.add(\n // \ttmpBounding,\n // \tfollowShapeBuffer[shapeVertexBufferIndex + i],\n // \tfollowShapeBuffer[shapeVertexBufferIndex + i + 1]\n // )\n }\n }\n // Bounding.bind(this.currentGenerationRecursiveBounding, tmpBounding)\n this.shapeFollowBuffer = followShapeBuffer;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const propArguments = { repetition, shape: this };\n const bufferIndex = {\n shape: this,\n frameLength: frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n follow: {\n index: 1,\n offset: 1,\n count: 1,\n },\n };\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const vertexCount = this.follow.getBuffer().length / 2; // this.follow.getBufferLength({ ...propArguments, parent: { ...bufferIndex } }) / 2\n for (let j = 0, len = vertexCount; j < len; j++) {\n const followOffset = len > 1 ? j / (len - 1) : 1;\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentFollowRepetition = {\n index: j + 1,\n offset: followOffset,\n count: len,\n };\n const followBufferIndex = { ...bufferIndex, follow: currentFollowRepetition };\n const parent = currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, followBufferIndex)\n : followBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n }\n }\n }\n }\n }\n /**\n * Retturn summation value\n *\n * @static\n * @param {number} recursion\n * @param {number} vertexCount\n * @returns {number}\n */\n static summmation(recursion, vertexCount) {\n if (recursion === 1)\n return 1;\n let result = 1;\n for (let i = 1; i < recursion; i++)\n result += vertexCount ** i;\n return result;\n }\n /**\n * Empty recursion repetition\n *\n * @static\n * @return {*} {IRecursionRepetition}\n */\n static getEmptyRecursion() {\n return {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: 1, count: 1 },\n };\n }\n}\nexports.ShapeFollow = ShapeFollow;\n//# sourceMappingURL=ShapeFollow.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Line = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n *\n * @category Core.Primitives\n * @class Line\n * @extends {ShapeBuffer}\n */\nclass Line extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Two point, based on ShapeBuffer\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Line\n */\n constructor(settings = {}) {\n settings.type = 'Line';\n settings.shape = Line.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n settings.bClosed = false;\n super(settings);\n }\n /**\n * @link https://gist.github.com/pborissow/5c92b77a804688385c77749d1187ba07\n */\n static toPolygon(buffer, thickness) {\n const solidified = [];\n //Convert thickness into an array as needed\n if (!Array.isArray(thickness)) {\n const _thickness = thickness;\n const points = buffer.length / 2;\n thickness = new Array(points);\n for (let i = 0; i < points; i++) {\n thickness[i] = _thickness;\n }\n }\n function getOffsets(ax, ay, bx, by, thickness) {\n const dx = bx - ax, dy = by - ay, len = Math.sqrt(dx * dx + dy * dy), scale = thickness / (2 * len);\n return [-scale * dy, scale * dx];\n }\n function getIntersection(a1, b1, a2, b2) {\n // directional constants\n const k1 = (b1[1] - a1[1]) / (b1[0] - a1[0]), k2 = (b2[1] - a2[1]) / (b2[0] - a2[0]);\n // if the directional constants are equal, the lines are parallel\n if (Math.abs(k1 - k2) < 0.00001) {\n return;\n }\n // y offset constants for both lines\n const m1 = a1[1] - k1 * a1[0];\n const m2 = a2[1] - k2 * a2[0];\n // compute x\n const x = (m1 - m2) / (k2 - k1);\n // use y = k * x + m to get y coordinate\n const y = k1 * x + m1;\n return [x, y];\n }\n let bFirst, bLast, prevA = [\n [0, 0],\n [0, 0],\n ], prevB = [\n [0, 0],\n [0, 0],\n ];\n for (let i = 0, len = buffer.length - 2; i < len; i += 2) {\n bFirst = i === 0;\n bLast = i === len - 2;\n const off = getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], thickness[i]);\n const p0a = [buffer[i] + off[0], buffer[i + 1] + off[1]];\n const p1a = [buffer[i + 2] + off[0], buffer[i + 3] + off[1]];\n const p0b = [buffer[i] - off[0], buffer[i + 1] - off[1]];\n const p1b = [buffer[i + 2] - off[0], buffer[i + 3] - off[1]];\n if (!bFirst) {\n const interA = getIntersection(prevA[0], prevA[1], p0a, p1a);\n if (interA) {\n solidified.unshift(interA[1]);\n solidified.unshift(interA[0]);\n }\n const interB = getIntersection(prevB[0], prevB[1], p0b, p1b);\n if (interB) {\n solidified.push(interB[0]);\n solidified.push(interB[1]);\n }\n }\n if (bFirst) {\n solidified.unshift(p0a[1]);\n solidified.unshift(p0a[0]);\n solidified.push(p0b[0]);\n solidified.push(p0b[1]);\n }\n if (bLast) {\n solidified.unshift(p1a[1]);\n solidified.unshift(p1a[0]);\n solidified.push(p1b[0]);\n solidified.push(p1b[1]);\n }\n if (!bLast) {\n prevA = [p0a, p1a];\n prevB = [p0b, p1b];\n }\n }\n return Float32Array.from(solidified);\n }\n}\nexports.Line = Line;\nLine.buffer = [-1, 0, 1, 0];\n//# sourceMappingURL=Line.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Triangle = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n * Triangle ShapeBuffer\n *\n * @category Core.Primitives\n */\nclass Triangle extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Creates an instance of Triangleeee.\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Triangle\n */\n constructor(settings = {}) {\n settings.type = 'Triangle';\n settings.shape = Triangle.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n super(settings);\n }\n}\nexports.Triangle = Triangle;\nTriangle.buffer = [1, 0, -1, 1, -1, -1];\n//# sourceMappingURL=Triangle.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Rect = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n *\n * @category Core.Primitives\n * @class Rect\n * @extends {ShapeBuffer}\n */\nclass Rect extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Creates an instance of Rect.\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Rect\n */\n constructor(settings = {}) {\n settings.type = 'Rect';\n settings.shape = Rect.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n super(settings);\n }\n}\nexports.Rect = Rect;\nRect.buffer = [1, 1, -1, 1, -1, -1, 1, -1];\n//# sourceMappingURL=Rect.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Polygon = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Polygon shape\n *\n * @category Core.Primitives\n * @class Polygon\n * @extends {ShapeLoop}\n */\nclass Polygon extends ShapeLoop_1.ShapeLoop {\n /**\n * Is based on ShapeLoop and you can pass `sideNumber` property to define\n * a number of sides.\n *\n * @param settings\n */\n constructor(settings = {}) {\n settings.type = settings.type || 'Polygon';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['sideNumber']);\n super(settings, true);\n this.props.sideNumber = settings.sideNumber;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: (propArguments) => {\n return math_1.PI2 / this.getProp('sideNumber', propArguments, 5);\n },\n vertex: shapeLoopRepetition => {\n return [Math.cos(shapeLoopRepetition.current), Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n}\nexports.Polygon = Polygon;\n//# sourceMappingURL=Polygon.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Circle = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n *\n * @category Core.Primitives\n * @class Circle\n * @extends {ShapeLoop}\n */\nclass Circle extends ShapeLoop_1.ShapeLoop {\n /**\n * Based on ShapeLoop, the number of point (resolution) is based on sideLength.\n *\n * @param {ShapeLoopSettings} [settings={}]\n * @memberof Circle\n */\n constructor(settings = {}) {\n settings.type = 'Circle';\n super(settings, true);\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const sideLength = this.getRepetitionSideLength(propArguments);\n return (1 / Math.pow(sideLength[0] * sideLength[1], 0.25)) * ShapeLoop_1.ShapeLoop.PId2;\n },\n vertex: shapeLoopRepetition => [Math.cos(shapeLoopRepetition.current), Math.sin(shapeLoopRepetition.current)],\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n}\nexports.Circle = Circle;\n//# sourceMappingURL=Circle.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Star = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Polygon shape\n *\n * @category Core.Primitives\n * @class Polygon\n * @extends {ShapeLoop}\n */\nclass Star extends ShapeLoop_1.ShapeLoop {\n /**\n * Is based on ShapeLoop and you can pass `spikes` property to define\n * a number of spikes and `innerRadius`\n *\n * @param settings\n */\n constructor(settings = {}) {\n settings.type = settings.type || 'Polygon';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['spikes', 'innerRadius']);\n super(settings, true);\n this.props.spikes = settings.spikes;\n this.props.innerRadius = settings.innerRadius;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: (propArguments) => {\n // dyamic binding in `generateLoopBuffer`\n return this.inc;\n },\n vertex: shapeLoopRepetition => {\n const angle = (Math.PI / this.spikes) * shapeLoopRepetition.index;\n const radius = shapeLoopRepetition.index % 2 === 0 ? 1 : this.innerRadius;\n return [Math.cos(angle) * radius, Math.sin(angle) * radius];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.spikes = this.getProp('spikes', propArguments, 5);\n this.innerRadius = this.getProp('innerRadius', propArguments, 0.5);\n this.inc = Math.PI / this.spikes;\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.Star = Star;\n//# sourceMappingURL=Star.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Rose = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Rose shape\n *\n * @category Core.Primitives\n * @class Rose\n * @extends {ShapeLoop}\n */\nclass Rose extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Rose.\n *\n * @param {IRoseSettings} [settings={}]\n * @memberof Rose\n */\n constructor(settings = {}) {\n var _a, _b;\n settings.type = 'Rose';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['n', 'd']);\n super(settings, true);\n this.props.n = (_a = settings.n) !== null && _a !== void 0 ? _a : 1;\n this.props.d = (_b = settings.d) !== null && _b !== void 0 ? _b : 2;\n this.loop = {\n start: 0,\n end: (propArguments) => Rose.getFinalAngleFromK(this.getProp('n', propArguments), this.getProp('d', propArguments)),\n inc: (propArguments) => {\n const n = this.getProp('n', propArguments);\n const d = this.getProp('d', propArguments);\n const sideLength = this.getRepetitionSideLength(propArguments);\n const sides = Math.pow(sideLength[0] * sideLength[1], 0.45);\n const k = d < n ? n / d : 1.5;\n return math_1.PI2 / (sides * k);\n },\n vertex: (shapeLoopRepetition) => {\n const f = Math.cos(this.k * shapeLoopRepetition.current);\n return [f * Math.cos(shapeLoopRepetition.current), f * Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.k = this.getProp('n', propArguments) / this.getProp('d', propArguments);\n return super.generateLoopBuffer(propArguments);\n }\n /**\n * Return end angle of rose\n *\n * @static\n * @param {number} n\n * @param {number} d\n * @returns {number}\n * @memberof Rose\n */\n static getFinalAngleFromK(n, d) {\n if (n == d)\n return math_1.PI2;\n const k = n / d;\n const p = n * d;\n if (!Number.isInteger(k) && k % 0.5 == 0)\n return 4 * Math.PI;\n return Math.PI * d * (p % 2 == 0 ? 2 : 1);\n }\n}\nexports.Rose = Rose;\n//# sourceMappingURL=Rose.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Spiral = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n * Spiral shape\n *\n * @category Core.Primitives\n * @class Spiral\n * @extends {ShapeLoop}\n */\nclass Spiral extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Spiral.\n *\n * @param {SpiralSettings} [settings={}]\n * @memberof Spiral\n */\n constructor(settings = {}) {\n var _a, _b, _c;\n settings.type = 'Spiral';\n settings.bClosed = false;\n settings.loopDependencies = (settings.loopDependencies || []).concat(['twists', 'twistsStart', 'spiral']);\n super(settings, true);\n this.props.spiral = (_a = settings.spiral) !== null && _a !== void 0 ? _a : Spiral.types.ARCHIMEDE;\n this.props.twists = (_b = settings.twists) !== null && _b !== void 0 ? _b : 2;\n this.props.twistsStart = (_c = settings.twistsStart) !== null && _c !== void 0 ? _c : 0;\n this.loop = {\n start: (propArguments) => math_1.PI2 * this.getProp('twistsStart', propArguments),\n end: (propArguments) => math_1.PI2 *\n (this.getProp('twistsStart', propArguments) + this.getProp('twists', propArguments)),\n inc: (propArguments) => {\n const twists = this.getProp('twists', propArguments);\n const rep = math_1.PI2 * twists;\n const sideLength = this.getRepetitionSideLength(propArguments);\n const radius = 4 + Math.sqrt(sideLength[0] * sideLength[1]);\n return rep / (radius * twists);\n },\n vertex: (shapeLoopRepetition) => {\n const r = this.r(shapeLoopRepetition.current);\n return [r * Math.cos(shapeLoopRepetition.current), r * Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.spiral = this.getProp('spiral', propArguments);\n this.r = Spiral.getRFromTSpiralType(this.spiral);\n return super.generateLoopBuffer(propArguments);\n }\n /**\n * Point position and scale factor for spiral types\n *\n * @static\n * @param {TSpiralType} spiral\n * @returns {number}\n * @memberof Spiral\n */\n static getRFromTSpiralType(spiral) {\n switch (spiral) {\n case Spiral.types.ARCHIMEDE:\n return angle => angle / 10;\n case Spiral.types.HYPERBOLIC:\n return angle => (1 / angle) * 3;\n case Spiral.types.FERMAT:\n return angle => angle ** 0.5 / 3;\n case Spiral.types.LITUUS:\n return angle => angle ** -0.5;\n case Spiral.types.LOGARITHMIC:\n return angle => Math.E ** (angle * 0.2) / 10;\n }\n return angle => angle;\n }\n}\nexports.Spiral = Spiral;\n/**\n * Spural types\n *\n * @static\n * @type {{ [name in TSpiralType]: TSpiralType }}\n * @memberof Spiral\n */\nSpiral.types = {\n ARCHIMEDE: 'ARCHIMEDE',\n HYPERBOLIC: 'HYPERBOLIC',\n FERMAT: 'FERMAT',\n LITUUS: 'LITUUS',\n LOGARITHMIC: 'LOGARITHMIC',\n};\n//# sourceMappingURL=Spiral.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Lissajous = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Lissajous shape\n *\n * @category Core.Primitives\n * @class Lissajous\n * @extends {ShapeLoop}\n */\nclass Lissajous extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Lissajous.\n *\n * @param {ILissajousSettings} [settings={}]\n * @memberof Lissajous\n */\n constructor(settings = {}) {\n settings.type = 'Lissajous';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['wx', 'wy', 'wz']);\n super(settings, true);\n this.props.wx = settings.wx || 1;\n this.props.wy = settings.wy || 2;\n this.props.wz = settings.wz || 0;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const wx = this.getProp('wx', propArguments);\n const wy = this.getProp('wy', propArguments);\n const ratio = wx == wy ? ShapeLoop_1.ShapeLoop.PId2 : 0.5 - Math.min(49, wx + wy) * 0.01;\n const sideLength = this.getRepetitionSideLength(propArguments);\n return (1 / Math.pow(sideLength[0] * sideLength[1], 0.25)) * ratio;\n },\n vertex: (shapeLoopRepetition) => {\n return this.wx === this.wy\n ? [Math.cos(shapeLoopRepetition.current + this.wz), Math.sin(shapeLoopRepetition.current)]\n : [Math.cos(this.wx * shapeLoopRepetition.current + this.wz), Math.sin(this.wy * shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.wx = this.getProp('wx', propArguments, 1);\n this.wy = this.getProp('wy', propArguments, 2);\n this.wz = this.getProp('wz', propArguments, 2);\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.Lissajous = Lissajous;\n//# sourceMappingURL=Lissajous.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SuperShape = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n * ShperShape\n *\n * @category Core.Primitives\n * @class SuperShape\n * @extends {ShapeLoop}\n */\nclass SuperShape extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of SuperShape.\n *\n * @param {ISuperShapeSettings} [settings={}]\n * @memberof SuperShape\n */\n constructor(settings = {}) {\n var _a, _b, _c, _d, _e, _f;\n settings.type = 'SuperShape';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['a', 'b', 'm', 'n1', 'n2', 'n3']);\n super(settings, true);\n this.props.a = (_a = settings.a) !== null && _a !== void 0 ? _a : 1;\n this.props.b = (_b = settings.b) !== null && _b !== void 0 ? _b : 1;\n this.props.m = (_c = settings.m) !== null && _c !== void 0 ? _c : 6;\n this.props.n1 = (_d = settings.n1) !== null && _d !== void 0 ? _d : 1;\n this.props.n2 = (_e = settings.n2) !== null && _e !== void 0 ? _e : 1;\n this.props.n3 = (_f = settings.n3) !== null && _f !== void 0 ? _f : 1;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const sideLength = this.getRepetitionSideLength(propArguments);\n return Math.PI / Math.pow(sideLength[0] * sideLength[1], 0.5);\n },\n vertex: (shapeLoopRepetition) => {\n const angle = shapeLoopRepetition.current;\n const m = (this.m * angle) / 4;\n const a = Math.abs(Math.cos(m) / this.a) ** this.n2;\n const b = Math.abs(Math.sin(m) / this.b) ** this.n3;\n const raux = (a + b) ** (1 / this.n1);\n const r = raux === 0 ? 1 : 1 / raux;\n return [r * Math.cos(angle), r * Math.sin(angle)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.a = this.getProp('a', propArguments);\n this.b = this.getProp('b', propArguments);\n this.m = this.getProp('m', propArguments);\n this.n1 = this.getProp('n1', propArguments);\n this.n2 = this.getProp('n2', propArguments);\n this.n3 = this.getProp('n3', propArguments);\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.SuperShape = SuperShape;\n//# sourceMappingURL=SuperShape.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Modifiers = void 0;\nconst Adapt_1 = require(\"./Adapt\");\nconst Mirror_1 = require(\"./Mirror\");\nconst Smooth_1 = require(\"./Smooth\");\nconst Solidify_1 = require(\"./Solidify\");\nconst Subdivide_1 = require(\"./Subdivide\");\nconst Close_1 = require(\"./Close\");\nconst Offset_1 = require(\"./Offset\");\nconst Modifiers = {\n Adapt: Adapt_1.Adapt,\n Mirror: Mirror_1.Mirror,\n Smooth: Smooth_1.Smooth,\n Solidify: Solidify_1.Solidify,\n Subdivide: Subdivide_1.Subdivide,\n Close: Close_1.Close,\n Offset: Offset_1.Offset,\n};\nexports.Modifiers = Modifiers;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Mirror = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Mirror extends Modifier_1.Modifier {\n constructor(args = { x: true, y: true }) {\n super();\n this.x = args.x === true;\n this.y = args.y === true;\n }\n apply(buffer, bClosed) {\n const bufferLength = buffer.length;\n const mirror = new Float32Array(bufferLength * (this.x ? 2 : 1) * (this.y ? 2 : 1));\n const sideLengthX = 1;\n const sideLengthY = 1;\n if (this.x && this.y) {\n const bufferLengthX2 = bufferLength + bufferLength;\n const bufferLengthX3 = bufferLengthX2 + bufferLength;\n // |1|2|\n // |4|3|\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i] - sideLengthX;\n mirror[i + 1] = buffer[i + 1] - sideLengthY;\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i] * -1 + sideLengthX;\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1] - sideLengthY;\n mirror[bufferLengthX2 + i] = buffer[i] * -1 + sideLengthX;\n mirror[bufferLengthX2 + i + 1] = buffer[i + 1] * -1 + sideLengthY;\n mirror[bufferLengthX3 + i] = buffer[bufferLength - 2 - i] - sideLengthX;\n mirror[bufferLengthX3 + i + 1] = buffer[bufferLength - 2 - i + 1] * -1 + sideLengthY;\n }\n }\n else if (this.x) {\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i] - sideLengthX;\n mirror[i + 1] = buffer[i + 1];\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i] * -1 + sideLengthX;\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1];\n }\n }\n else if (this.y) {\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i];\n mirror[i + 1] = buffer[i + 1] - sideLengthY;\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i];\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1] * -1 + sideLengthY;\n }\n }\n else {\n return buffer;\n }\n return mirror;\n }\n}\nexports.Mirror = Mirror;\n//# sourceMappingURL=Mirror.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Smooth = void 0;\nconst Utilities_1 = require(\"../Utilities\");\nconst Close_1 = require(\"./Close\");\nconst Modifier_1 = require(\"./Modifier\");\nclass Smooth extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.level = args.level || 1;\n const tension = Array.isArray(args.tension) ? args.tension : [args.tension];\n this.tension = new Array(this.level).fill(0.5).map((v, i) => Utilities_1.clamp(0, 1, tension[i] || v));\n this.level = this.level < 1 ? 1 : this.level;\n this.closed = args.closed === true;\n }\n apply(buffer, bClosed) {\n if (bClosed && !Close_1.Close.isClosed(buffer)) {\n const bufferLen = buffer.length;\n const mofified = new Float32Array(bufferLen + 2);\n mofified.set(buffer, 0);\n mofified[bufferLen] = buffer[0];\n mofified[bufferLen + 1] = buffer[1];\n buffer = mofified;\n }\n let smoothed = buffer;\n for (let i = 0, len = this.level; i < len; i++)\n smoothed = Smooth.smooth(smoothed, this.tension[i], bClosed || this.closed);\n return smoothed;\n }\n /**\n * Chaikin smooth\n *\n * the tension factor defines a scale between corner cutting distance in segment half length,\n * i.e. between 0.05 and 0.45. The opposite corner will be cut by the inverse\n * (i.e. 1-cutting distance) to keep symmetry.\n * with a tension value of 0.5 this amounts to 0.25 = 1/4 and 0.75 = 3/4,\n * the original Chaikin values\n *\n * @link https://www.codeproject.com/Articles/1093960/D-Polyline-Vertex-Smoothing\n * @param buffer\n */\n static smooth(buffer, tension = 0.5, bClosed = false) {\n const bufferLength = buffer.length;\n const smoothed = new Float32Array((buffer.length - (bClosed ? 1 : 0)) * 2);\n if (!bClosed) {\n smoothed[0] = buffer[0];\n smoothed[1] = buffer[1];\n }\n const cutdist = 0.05 + tension * 0.4;\n const ncutdist = 1 - cutdist;\n let smoothedLength = bClosed ? 0 : 2;\n for (let i = 0, len = bufferLength - 2; i < len; i += 2, smoothedLength += 4) {\n // q\n smoothed[smoothedLength] = ncutdist * buffer[i] + cutdist * buffer[i + 2];\n smoothed[smoothedLength + 1] = ncutdist * buffer[i + 1] + cutdist * buffer[i + 3];\n // r\n smoothed[smoothedLength + 2] = cutdist * buffer[i] + ncutdist * buffer[i + 2];\n smoothed[smoothedLength + 3] = cutdist * buffer[i + 1] + ncutdist * buffer[i + 3];\n }\n if (!bClosed) {\n smoothed[smoothedLength] = buffer[bufferLength - 2];\n smoothed[smoothedLength + 1] = buffer[bufferLength - 1];\n }\n else {\n smoothed[smoothedLength] = smoothed[0];\n smoothed[smoothedLength + 1] = smoothed[1];\n }\n return smoothed;\n }\n}\nexports.Smooth = Smooth;\n//# sourceMappingURL=Smooth.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Close = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Close extends Modifier_1.Modifier {\n constructor() {\n super();\n }\n apply(buffer, bClosed, shape) {\n return Close.call(buffer);\n }\n static call(buffer) {\n const len = buffer.length;\n if (Close.isClosed(buffer))\n return buffer;\n const result = new Float32Array(len + 2);\n result.set(buffer, 0);\n result[len] = result[0];\n result[len + 1] = result[1];\n return result;\n }\n static isClosed(buffer) {\n const len = buffer.length;\n return buffer[0] === buffer[len - 2] && buffer[1] === buffer[len - 1];\n }\n}\nexports.Close = Close;\n//# sourceMappingURL=Close.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Solidify = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Solidify extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.closed = args.closed === true;\n this.thickness = args.thickness || 0.2;\n this.error = args.error;\n }\n apply(buffer, bClosed) {\n return Solidify.solidify(buffer, this.thickness, this.closed, this.error);\n }\n /**\n * @link https://gist.github.com/kekscom/4194148\n */\n static solidify(buffer, thickness, bClosed = false, error) {\n const solidified = [];\n thickness = typeof thickness === 'number' ? [thickness] : thickness;\n const thicknessLength = thickness.length;\n let bFirst, bLast, prevA = [\n [0, 0],\n [0, 0],\n ], prevB = [\n [0, 0],\n [0, 0],\n ];\n for (let i = 0, t = 0, len = buffer.length - 2; i < len; i += 2, t++) {\n bFirst = i === 0;\n bLast = i === len - 2;\n const currentThicknessRep = {\n index: i + 1,\n offset: i / len,\n count: len,\n };\n const nextThicknessRep = {\n index: i + 2,\n offset: (i + 1) / len,\n count: len,\n };\n const currentThickness = typeof thickness === 'function' ? thickness(currentThicknessRep) : thickness[t % thicknessLength];\n const nextThickness = typeof thickness === 'function' ? thickness(nextThicknessRep) : thickness[(t + 1) % thicknessLength];\n const off = Solidify.getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], currentThickness);\n const off2 = Solidify.getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], nextThickness);\n const p0a = [buffer[i] + off[0], buffer[i + 1] + off[1]];\n const p1a = [buffer[i + 2] + off2[0], buffer[i + 3] + off2[1]];\n const p0b = [buffer[i] - off[0], buffer[i + 1] - off[1]];\n const p1b = [buffer[i + 2] - off2[0], buffer[i + 3] - off2[1]];\n if (!bFirst) {\n const interA = Solidify.getIntersection(prevA[0], prevA[1], p0a, p1a, error);\n if (interA) {\n solidified.unshift(interA[1]);\n solidified.unshift(interA[0]);\n }\n const interB = Solidify.getIntersection(prevB[0], prevB[1], p0b, p1b, error);\n if (interB) {\n solidified.push(interB[0]);\n solidified.push(interB[1]);\n }\n }\n if (bFirst) {\n solidified.unshift(p0a[1]);\n solidified.unshift(p0a[0]);\n solidified.push(p0b[0]);\n solidified.push(p0b[1]);\n }\n if (bLast) {\n solidified.unshift(p1a[1]);\n solidified.unshift(p1a[0]);\n solidified.push(p1b[0]);\n solidified.push(p1b[1]);\n }\n if (!bLast) {\n prevA = [p0a, p1a];\n prevB = [p0b, p1b];\n }\n }\n if (bClosed) {\n const centerIndex = buffer.length - 2;\n const lastIndex = solidified.length - 2;\n const x = 0.5 * solidified[0] + solidified[centerIndex] * 0.5;\n const y = 0.5 * solidified[1] + solidified[centerIndex + 1] * 0.5;\n const x2 = 0.5 * solidified[centerIndex + 2] + solidified[lastIndex] * 0.5;\n const y2 = 0.5 * solidified[centerIndex + 3] + solidified[lastIndex + 1] * 0.5;\n solidified[0] = x;\n solidified[1] = y;\n solidified[centerIndex] = x;\n solidified[centerIndex + 1] = y;\n solidified[centerIndex + 2] = x2;\n solidified[centerIndex + 3] = y2;\n solidified[lastIndex] = x2;\n solidified[lastIndex + 1] = y2;\n }\n return Float32Array.from(solidified);\n }\n static getOffsets(ax, ay, bx, by, thickness) {\n const dx = bx - ax, dy = by - ay, len = Math.sqrt(dx * dx + dy * dy), scale = thickness / (2 * len);\n return [-scale * dy, scale * dx];\n }\n static getIntersection(a1, b1, a2, b2, error = 0.00001) {\n // directional constants\n const k1 = (b1[1] - a1[1]) / (b1[0] - a1[0]), k2 = (b2[1] - a2[1]) / (b2[0] - a2[0]);\n // if the directional constants are equal, the lines are parallel\n // if (Math.abs(k1 - k2) < 0.00001) {\n if (Math.abs(k1 - k2) < error) {\n return;\n }\n // y offset constants for both lines\n const m1 = a1[1] - k1 * a1[0];\n const m2 = a2[1] - k2 * a2[0];\n // compute x\n const x = (m1 - m2) / (k2 - k1);\n // use y = k * x + m to get y coordinate\n const y = k1 * x + m1;\n return [x, y];\n }\n}\nexports.Solidify = Solidify;\n//# sourceMappingURL=Solidify.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Subdivide = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Subdivide extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.level = args.level || 1;\n this.level = this.level < 1 ? 1 : this.level;\n }\n apply(buffer, bClosed) {\n const level = this.level;\n let subdivided = buffer;\n if (subdivided && subdivided.length > 0) {\n for (let i = 0; i < level; i++)\n subdivided = Subdivide.subdivide(subdivided, bClosed);\n }\n return subdivided;\n }\n /**\n * Subdivide buffer\n *\n * @static\n * @param {Float32Array} shape\n * @param {boolean} [bClosed=true]\n * @returns {(Float32Array)}\n */\n static subdivide(buffer, bClosed = false) {\n const bufferLength = buffer.length;\n const subdivided = new Float32Array(bufferLength * 2 - (bClosed ? 0 : 2));\n for (let i = 0; i < bufferLength; i += 2) {\n if (i === 0) {\n subdivided[0] = buffer[0];\n subdivided[1] = buffer[1];\n }\n else {\n const px = buffer[i - 2];\n const py = buffer[i - 1];\n const x = buffer[i];\n const y = buffer[i + 1];\n const nx = (x + px) / 2;\n const ny = (y + py) / 2;\n subdivided[(i - 1) * 2] = nx;\n subdivided[(i - 1) * 2 + 1] = ny;\n subdivided[i * 2] = x;\n subdivided[i * 2 + 1] = y;\n }\n }\n if (bClosed) {\n subdivided[(bufferLength - 1) * 2] = (buffer[0] + buffer[bufferLength - 2]) / 2;\n subdivided[(bufferLength - 1) * 2 + 1] = (buffer[1] + buffer[bufferLength - 1]) / 2;\n }\n return subdivided;\n }\n}\nexports.Subdivide = Subdivide;\n//# sourceMappingURL=Subdivide.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Offset = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Offset extends Modifier_1.Modifier {\n constructor(args = { from: 0, to: undefined }) {\n super();\n this.from = args.from;\n this.to = args.to;\n }\n apply(buffer, bClosed) {\n return buffer.subarray(this.from, this.to ? (this.to < 0 ? buffer.length + this.to : this.to) : undefined);\n }\n}\nexports.Offset = Offset;\n//# sourceMappingURL=Offset.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./utilities\"), exports);\n__exportStar(require(\"./createAnimation\"), exports);\n__exportStar(require(\"./createInterpolator\"), exports);\n__exportStar(require(\"./Easings\"), exports);\n__exportStar(require(\"./Animation\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.interpolateColorHSL = exports.interpolateColorRGB = exports.cosp = exports.sinp = exports.clockOffset = exports.clock = void 0;\n/**\n * Return time (from 0 to duration) in milliseconds\n *\n * @export\n * @param {number} time Current time\n * @param {number} duration Clock duration\n * @param {(number | boolean)} [loop=true]\n * @param {('normal' | 'reverse' | 'alternate')} [direction='alternate']\n * @param {number} [delay=0]\n * @param {number} [afterDelay=0]\n * @return {*} {number} Between 0 and duration\n */\nfunction clock(time, duration, loop = true, direction = 'alternate', delay = 0, afterDelay = 0) {\n const totalDuration = direction === 'normal'\n ? duration + delay\n : direction === 'reverse'\n ? duration + delay\n : duration * 2 + delay + afterDelay;\n if ((typeof loop === 'number' && time >= totalDuration * loop) || (loop === false && time >= totalDuration)) {\n return direction === 'normal' ? duration : 0;\n }\n time %= totalDuration;\n if ((time -= delay) <= 0) {\n return 0;\n }\n if (direction === 'alternate') {\n if (time <= duration) {\n // normal\n return time;\n }\n else {\n // reverse\n time -= duration;\n if ((time -= afterDelay) >= 0) {\n return duration - (time >= duration ? duration : time);\n }\n return duration;\n }\n }\n else {\n return time >= duration ? duration : time;\n }\n}\nexports.clock = clock;\n/**\n * Return offset between 0 and 1 from current time based on duration and other parameters\n *\n * @export\n * @param {number} time\n * @param {number} duration\n * @param {(number | boolean)} [loop=true]\n * @param {('normal' | 'reverse' | 'alternate')} [direction='alternate']\n * @param {number} [delay=0]\n * @param {number} [afterDelay=0]\n * @return {*} {number}\n */\nfunction clockOffset(time, duration, loop = true, direction = 'alternate', delay = 0, afterDelay = 0) {\n return clock(time, duration, loop, direction, delay, afterDelay) / duration;\n}\nexports.clockOffset = clockOffset;\nconst PI2 = Math.PI * 2;\n/**\n * Return sin of period 'durate' in time 'time'\n *\n * @export\n * @param {number} time\n * @param {number} durate\n * @param {number} phase\n * @param {boolean} [normalize=false]\n * @return {*} {number}\n */\nfunction sinp(time, durate, phase = 0, normalize = false) {\n const value = Math.sin((time * PI2) / durate + phase);\n return normalize ? 0.5 + value * 0.5 : value;\n}\nexports.sinp = sinp;\n/**\n * Return cos of period 'durate' in time 'time'\n *\n * @export\n * @param {number} time\n * @param {number} durate\n * @param {number} phase\n * @param {boolean} [normalize=false]\n * @return {*} {number}\n */\nfunction cosp(time, durate, phase = 0, normalize = false) {\n const value = Math.cos((time * PI2) / durate + phase);\n return normalize ? 0.5 + value * 0.5 : value;\n}\nexports.cosp = cosp;\nfunction interpolateColorRGB(start, end, offset) {\n const r = start.r + offset * (end.r - start.r);\n const g = start.g + offset * (end.g - start.g);\n const b = start.b + offset * (end.b - start.b);\n const alpha = start.alpha + offset * (end.alpha - start.alpha);\n return `rgba(${Math.floor(r)},${Math.floor(g)},${Math.floor(b)},${alpha})`;\n}\nexports.interpolateColorRGB = interpolateColorRGB;\nfunction interpolateColorHSL(start, end, offset) {\n const h = start.h + offset * (end.h - start.h);\n const s = start.s + offset * (end.s - start.s);\n const l = start.l + offset * (end.l - start.l);\n const alpha = start.alpha + offset * (end.alpha - start.alpha);\n return `hsla(${h},${s}%,${l}%,${alpha})`;\n}\nexports.interpolateColorHSL = interpolateColorHSL;\n//# sourceMappingURL=utilities.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createAnimation = void 0;\nconst createInterpolator_1 = require(\"./createInterpolator\");\n/**\n * Create TAnimation from object\n *\n * @param simpleAnimation\n * @returns\n */\nfunction createAnimation(simpleAnimation) {\n const interpolate = createInterpolator_1.createInterpolationCallback(simpleAnimation);\n if (typeof interpolate === 'undefined')\n return undefined;\n const delay = simpleAnimation.delay || 0;\n const afterDelay = simpleAnimation.afterDelay || 0;\n const direction = simpleAnimation.direction || 'normal';\n const duration = simpleAnimation.duration || 1000;\n const totalDuration = direction === 'normal'\n ? duration + delay\n : direction === 'reverse'\n ? duration + delay\n : duration * 2 + delay + afterDelay;\n const loop = typeof simpleAnimation.loop === 'number' ? simpleAnimation.loop : !!simpleAnimation.loop;\n const bindedValues = {\n delay,\n afterDelay,\n direction,\n duration,\n totalDuration,\n loop,\n };\n const animationFunction = createInterpolator_1.createInterpolator(simpleAnimation.interpolator);\n const animation = {\n loop: 0,\n offset: 0,\n loopDuration: totalDuration,\n direction: direction === 'alternate' ? 'normal' : direction,\n started: false,\n ended: false,\n value: undefined,\n };\n animation.update = createUpdate(animation, bindedValues, animationFunction, interpolate);\n return animation;\n}\nexports.createAnimation = createAnimation;\n/**\n *\n * @internal\n * @param animation\n * @param bindedValues\n * @param animationFunction\n * @param interpolate\n * @returns\n */\nfunction createUpdate(animation, bindedValues, animationFunction, interpolate) {\n const { loop, totalDuration, delay, afterDelay, direction, duration } = bindedValues;\n return (time) => {\n // Check animation is ended\n if ((typeof loop === 'number' && time >= totalDuration * loop) ||\n (loop === false && time >= bindedValues.totalDuration)) {\n animation.started = false;\n animation.ended = true;\n animation.offset = animationFunction(direction === 'normal' ? duration : 0, duration);\n animation.value = interpolate(animation.offset);\n return;\n }\n animation.loop = Math.ceil(time / totalDuration);\n time %= totalDuration;\n if ((time -= delay) <= 0) {\n animation.started = false;\n animation.offset = animationFunction(0, duration);\n animation.value = interpolate(animation.offset);\n return;\n }\n animation.started = true;\n if (direction === 'alternate') {\n if (time <= duration) {\n animation.direction = 'normal';\n animation.offset = animationFunction(time, duration);\n }\n else {\n animation.direction = 'reverse';\n time -= duration;\n // wait afterDelay\n if ((time -= afterDelay) >= 0) {\n animation.offset = 1 - animationFunction(time >= duration ? duration : time, duration);\n }\n else {\n animation.offset = 1;\n }\n }\n }\n else {\n const animationValue = animationFunction(time >= duration ? duration : time, duration);\n animation.offset = direction === 'normal' ? animationValue : 1 - animationValue;\n }\n animation.value = interpolate(animation.offset);\n };\n}\n//# sourceMappingURL=createAnimation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createInterpolator = exports.createInterpolationCallback = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst bezier_easing_1 = require(\"bezier-easing\");\nconst Easings_1 = require(\"./Easings\");\nconst utilities_1 = require(\"./utilities\");\n/**\n * Return a callback for value interpolation passing offset from 0 to 1\n *\n * @param simpleAnimation\n * @returns\n */\nfunction createInterpolationCallback(simpleAnimation) {\n const from = Array.isArray(simpleAnimation.from) ? simpleAnimation.from : [simpleAnimation.from];\n const to = Array.isArray(simpleAnimation.to) ? simpleAnimation.to : [simpleAnimation.to];\n const round = simpleAnimation.round;\n const colorInterpolation = simpleAnimation.colorTransitionMode === 'hue' ? utilities_1.interpolateColorHSL : utilities_1.interpolateColorRGB;\n if (from.length !== to.length)\n return undefined;\n const callbacks = [];\n for (let i = 0, len = from.length; i < len; i++) {\n if (typeof from[i] !== typeof to[i]) {\n console.warn('[@urpflanze/animation]: `from` and `to` values mismatch');\n return undefined;\n }\n else {\n if (typeof from[i] !== 'string') {\n const a = from[i], b = to[i];\n callbacks.push(typeof round !== 'undefined'\n ? (offset) => offset === 1 ? b : offset === 0 ? a : Math.round((a + offset * (b - a)) * round) / round\n : (offset) => (offset === 1 ? b : offset === 0 ? a : a + offset * (b - a)));\n }\n else {\n const a = from[i];\n const b = to[i];\n const parsed_a = color_1.parseColorAndConvert(a);\n const parsed_b = color_1.parseColorAndConvert(b);\n if (typeof parsed_a !== 'undefined' && typeof parsed_b !== 'undefined') {\n callbacks.push((offset) => offset === 1 ? b : offset === 0 ? a : colorInterpolation(parsed_a, parsed_b, offset));\n }\n }\n }\n }\n return (offset) => {\n const values = callbacks.map(c => c(offset));\n return values.length === 1 ? values[0] : values;\n };\n}\nexports.createInterpolationCallback = createInterpolationCallback;\n/**\n * Return a callback for calculate offset (0 to 1) from elapsed time and animation duration\n *\n * @param type\n * @returns\n */\nfunction createInterpolator(type) {\n var _a, _b;\n switch (typeof type) {\n case 'function':\n return (elapsed, duration) => type(elapsed / duration, elapsed);\n case 'string':\n switch (type) {\n case 'wave':\n return (elapsed, duration) => 0.5 + Math.sin((elapsed * Math.PI * 2) / duration + Math.PI * 1.5) * 0.5;\n default: {\n if (type in Easings_1.Easings) {\n const easing = Easings_1.Easings[type];\n return (elapsed, duration) => easing(elapsed, 0, 1, duration);\n }\n return (elapsed, duration) => Easings_1.Easings.linear(elapsed, 0, 1, duration);\n }\n }\n case 'object':\n switch (type.type) {\n case 'wave': {\n const phase = Math.PI * 1.5 + (((_a = type.params) === null || _a === void 0 ? void 0 : _a.phase) || 0);\n return (elapsed, duration) => {\n return 0.5 + Math.sin((elapsed * Math.PI * 2) / duration + phase) * 0.5;\n };\n }\n case 'elasticIn':\n case 'elasticOut':\n case 'elasticInOut': {\n const easing = Easings_1.Easings[type.type];\n const { amplitude, period } = type.params || {};\n return (elapsed, duration) => easing(elapsed, 0, 1, duration, amplitude, period);\n }\n case 'backIn':\n case 'backOut':\n case 'backInOut': {\n const easing = Easings_1.Easings[type.type];\n const overshoot = ((_b = type.params) === null || _b === void 0 ? void 0 : _b.overshoot) || undefined;\n return (elapsed, duration) => easing(elapsed, 0, 1, duration, overshoot);\n }\n case 'cubicBezier': {\n const easing = bezier_easing_1.default(type.params[0], type.params[1], type.params[2], type.params[3]);\n return (elapsed, duration) => easing(elapsed / duration);\n }\n }\n }\n return (elapsed, duration) => Easings_1.Easings.linear(elapsed, 0, 1, duration);\n}\nexports.createInterpolator = createInterpolator;\n//# sourceMappingURL=createInterpolator.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./conversions\"), exports);\n__exportStar(require(\"./parsing\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.rgbToHsl = exports.hslToRgb = exports.rgbToHex = void 0;\n/**\n * Convert rgb to hex\n *\n * @param r number between 0 - 255\n * @param g number between 0 - 255\n * @param b number between 0 - 255\n * @returns #ffffff\n */\nfunction rgbToHex(r, g, b) {\n return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;\n}\nexports.rgbToHex = rgbToHex;\n/**\n * Convert hsl (0-360, 0-100, 0-100) color to rgb(0-255, 0-255, 0-255)\n *\n * @param {number} h number between 0 - 360\n * @param {number} s number between 0 - 100\n * @param {number} l number between 0 - 100\n * @returns {[number, number, number]} [0-255, 0-255, 0-255]\n */\nfunction hslToRgb(h, s, l) {\n h /= 360;\n s /= 100;\n l /= 100;\n let r, g, b;\n if (s == 0) {\n r = g = b = l; // achromatic\n }\n else {\n const hue2rgb = (p, q, t) => {\n t += t < 0 ? 1 : t > 1 ? -1 : 0;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n };\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return [(0.5 + r * 255) << 0, (0.5 + g * 255) << 0, (0.5 + b * 255) << 0];\n}\nexports.hslToRgb = hslToRgb;\n/**\n * Convert rbg (0-255, 0-255, 0-255) to hsl (0-360, 0-100, 0-100)\n *\n * @param {number} r number between 0 - 255\n * @param {number} g number between 0 - 255\n * @param {number} b number between 0 - 255\n * @returns {[number, number, number]} (0-360, 0-100, 0-100)\n */\nfunction rgbToHsl(r, g, b) {\n r /= 255;\n g /= 255;\n b /= 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s;\n if (max === min) {\n h = s = 0;\n }\n else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h = h / 6;\n }\n return [(0.5 + h * 360) << 0, (0.5 + s * 100) << 0, (0.5 + l * 100) << 0];\n}\nexports.rgbToHsl = rgbToHsl;\n//# sourceMappingURL=conversions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseColor = exports.parseColorAndConvert = void 0;\nconst htmlcolors_1 = require(\"./htmlcolors\");\nconst conversions_1 = require(\"./conversions\");\n/**\n * Convert color to IConvertedColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IConvertedColor | undefined)}\n */\nfunction parseColorAndConvert(color) {\n const parsed = parseColor(color);\n if (parsed) {\n if (parsed.type === 'hsl') {\n const [r, g, b] = conversions_1.hslToRgb(parsed.a, parsed.b, parsed.c);\n return {\n r,\n g,\n b,\n h: parsed.a,\n s: parsed.b,\n l: parsed.c,\n alpha: parsed.alpha,\n };\n }\n else {\n const [h, s, l] = conversions_1.rgbToHsl(parsed.a, parsed.b, parsed.c);\n return {\n h,\n s,\n l,\n r: parsed.a,\n g: parsed.b,\n b: parsed.c,\n alpha: parsed.alpha,\n };\n }\n }\n}\nexports.parseColorAndConvert = parseColorAndConvert;\n/**\n * Convert color to IColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IColor | undefined)}\n */\nfunction parseColor(color) {\n if (typeof color === 'number') {\n if (color > 0xffffff) {\n return {\n type: 'rgb',\n a: (color >> 24) & 255,\n b: (color >> 16) & 255,\n c: (color >> 8) & 255,\n alpha: (color & 255) / 255,\n };\n }\n else {\n return { type: 'rgb', a: (color >> 16) & 255, b: (color >> 8) & 255, c: color & 255, alpha: 1 };\n }\n }\n color = color.replace(/\\s/g, '');\n if (htmlcolors_1.default[color])\n color = htmlcolors_1.default[color];\n let match = /^#([0-9a-f]{3,8})$/i.exec(color);\n if (match) {\n const hex = match[1];\n if (hex.length === 3) {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[0], 16),\n b: parseInt(hex[1] + hex[1], 16),\n c: parseInt(hex[2] + hex[2], 16),\n alpha: 1,\n };\n }\n else {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[1], 16),\n b: parseInt(hex[2] + hex[3], 16),\n c: parseInt(hex[4] + hex[5], 16),\n alpha: hex.length > 6 ? parseInt(hex.substring(6), 16) / 255 : 1,\n };\n }\n }\n match = /^((hsl|rgb)a?)\\((\\d+),(\\d+)%?,(\\d+)%?,?(.+)?\\)$/i.exec(color);\n if (match) {\n const [, , type, a, b, c, alpha] = match;\n return {\n type: type,\n a: +a,\n b: +b,\n c: +c,\n alpha: alpha ? +alpha : 1,\n };\n }\n}\nexports.parseColor = parseColor;\n//# sourceMappingURL=parsing.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst colors = {\n aliceblue: '#f0f8ff',\n antiquewhite: '#faebd7',\n aqua: '#00ffff',\n aquamarine: '#7fffd4',\n azure: '#f0ffff',\n beige: '#f5f5dc',\n bisque: '#ffe4c4',\n black: '#000000',\n blanchedalmond: '#ffebcd',\n blue: '#0000ff',\n blueviolet: '#8a2be2',\n brown: '#a52a2a',\n burlywood: '#deb887',\n cadetblue: '#5f9ea0',\n chartreuse: '#7fff00',\n chocolate: '#d2691e',\n coral: '#ff7f50',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyan: '#00ffff',\n darkblue: '#00008b',\n darkcyan: '#008b8b',\n darkgoldenrod: '#b8860b',\n darkgray: '#a9a9a9',\n darkgreen: '#006400',\n darkkhaki: '#bdb76b',\n darkmagenta: '#8b008b',\n darkolivegreen: '#556b2f',\n darkorange: '#ff8c00',\n darkorchid: '#9932cc',\n darkred: '#8b0000',\n darksalmon: '#e9967a',\n darkseagreen: '#8fbc8f',\n darkslateblue: '#483d8b',\n darkslategray: '#2f4f4f',\n darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n gold: '#ffd700',\n goldenrod: '#daa520',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n indianred: '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n lavender: '#e6e6fa',\n lavenderblush: '#fff0f5',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrodyellow: '#fafad2',\n lightgrey: '#d3d3d3',\n lightgreen: '#90ee90',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\n maroon: '#800000',\n mediumaquamarine: '#66cdaa',\n mediumblue: '#0000cd',\n mediumorchid: '#ba55d3',\n mediumpurple: '#9370d8',\n mediumseagreen: '#3cb371',\n mediumslateblue: '#7b68ee',\n mediumspringgreen: '#00fa9a',\n mediumturquoise: '#48d1cc',\n mediumvioletred: '#c71585',\n midnightblue: '#191970',\n mintcream: '#f5fffa',\n mistyrose: '#ffe4e1',\n moccasin: '#ffe4b5',\n navajowhite: '#ffdead',\n navy: '#000080',\n oldlace: '#fdf5e6',\n olive: '#808000',\n olivedrab: '#6b8e23',\n orange: '#ffa500',\n orangered: '#ff4500',\n orchid: '#da70d6',\n palegoldenrod: '#eee8aa',\n palegreen: '#98fb98',\n paleturquoise: '#afeeee',\n palevioletred: '#d87093',\n papayawhip: '#ffefd5',\n peachpuff: '#ffdab9',\n peru: '#cd853f',\n pink: '#ffc0cb',\n plum: '#dda0dd',\n powderblue: '#b0e0e6',\n purple: '#800080',\n rebeccapurple: '#663399',\n red: '#ff0000',\n rosybrown: '#bc8f8f',\n royalblue: '#4169e1',\n saddlebrown: '#8b4513',\n salmon: '#fa8072',\n sandybrown: '#f4a460',\n seagreen: '#2e8b57',\n seashell: '#fff5ee',\n sienna: '#a0522d',\n silver: '#c0c0c0',\n skyblue: '#87ceeb',\n slateblue: '#6a5acd',\n slategray: '#708090',\n snow: '#fffafa',\n springgreen: '#00ff7f',\n steelblue: '#4682b4',\n tan: '#d2b48c',\n teal: '#008080',\n thistle: '#d8bfd8',\n tomato: '#ff6347',\n turquoise: '#40e0d0',\n violet: '#ee82ee',\n wheat: '#f5deb3',\n white: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32',\n};\nexports.default = colors;\n//# sourceMappingURL=htmlcolors.js.map","/**\n * https://github.com/gre/bezier-easing\n * BezierEasing - use bezier curve for transition easing function\n * by Gaëtan Renaudeau 2014 - 2015 – MIT License\n */\n\n// These values are established by empiricism with tests (tradeoff: performance VS precision)\nvar NEWTON_ITERATIONS = 4;\nvar NEWTON_MIN_SLOPE = 0.001;\nvar SUBDIVISION_PRECISION = 0.0000001;\nvar SUBDIVISION_MAX_ITERATIONS = 10;\n\nvar kSplineTableSize = 11;\nvar kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\nvar float32ArraySupported = typeof Float32Array === 'function';\n\nfunction A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\nfunction B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\nfunction C (aA1) { return 3.0 * aA1; }\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nfunction calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }\n\n// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\nfunction getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); }\n\nfunction binarySubdivide (aX, aA, aB, mX1, mX2) {\n var currentX, currentT, i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n return currentT;\n}\n\nfunction newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {\n for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n if (currentSlope === 0.0) {\n return aGuessT;\n }\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n}\n\nfunction LinearEasing (x) {\n return x;\n}\n\nmodule.exports = function bezier (mX1, mY1, mX2, mY2) {\n if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {\n throw new Error('bezier x values must be in [0, 1] range');\n }\n\n if (mX1 === mY1 && mX2 === mY2) {\n return LinearEasing;\n }\n\n // Precompute samples table\n var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n for (var i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n\n function getTForX (aX) {\n var intervalStart = 0.0;\n var currentSample = 1;\n var lastSample = kSplineTableSize - 1;\n\n for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n --currentSample;\n\n // Interpolate to provide an initial guess for t\n var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n var guessForT = intervalStart + dist * kSampleStepSize;\n\n var initialSlope = getSlope(guessForT, mX1, mX2);\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if (initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n }\n\n return function BezierEasing (x) {\n // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n if (x === 0) {\n return 0;\n }\n if (x === 1) {\n return 1;\n }\n return calcBezier(getTForX(x), mY1, mY2);\n };\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Easings = void 0;\n/**\n * Easing functions\n *\n * @category Services.Animation\n */\nconst Easings = {\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n linear: (timeOrOffset, start, end, duration = 1) => (end * timeOrOffset) / duration + start,\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return -end * timeOrOffset * (timeOrOffset - 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset + start;\n timeOrOffset--;\n return (-end / 2) * (timeOrOffset * (timeOrOffset - 2) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * (timeOrOffset * timeOrOffset * timeOrOffset + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return -end * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (-end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset - 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalIn: (timeOrOffset, start, end, duration = 1) => {\n return -end * Math.cos((timeOrOffset / duration) * (Math.PI / 2)) + end + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalOut: (timeOrOffset, start, end, duration = 1) => {\n return end * Math.sin((timeOrOffset / duration) * (Math.PI / 2)) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalInOut: (timeOrOffset, start, end, duration = 1) => {\n return (-end / 2) * (Math.cos((Math.PI * timeOrOffset) / duration) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialIn: (timeOrOffset, start, end, duration = 1) => {\n return end * Math.pow(2, 10 * (timeOrOffset / duration - 1)) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialOut: (timeOrOffset, start, end, duration = 1) => {\n return end * (-Math.pow(2, (-10 * timeOrOffset) / duration) + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * Math.pow(2, 10 * (timeOrOffset - 1)) + start;\n timeOrOffset--;\n return (end / 2) * (-Math.pow(2, -10 * timeOrOffset) + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return -end * (Math.sqrt(1 - timeOrOffset * timeOrOffset) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * Math.sqrt(1 - timeOrOffset * timeOrOffset) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (-end / 2) * (Math.sqrt(1 - timeOrOffset * timeOrOffset) - 1) + start;\n timeOrOffset -= 2;\n return (end / 2) * (Math.sqrt(1 - timeOrOffset * timeOrOffset) + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticIn: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration) === 1) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n return (-(amplitude *\n Math.pow(2, 10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period)) + start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticOut: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration) === 1) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n return (amplitude * Math.pow(2, -10 * timeOrOffset) * Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period) +\n end +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticInOut: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration / 2) === 2) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n if (timeOrOffset < 1) {\n return (-0.5 *\n (amplitude *\n Math.pow(2, 10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period)) +\n start);\n }\n return (amplitude *\n Math.pow(2, -10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period) *\n 0.5 +\n end +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} overshoot (optional)\n * @return {number}\n */\n backIn: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n return end * (timeOrOffset /= duration) * timeOrOffset * ((overshoot + 1) * timeOrOffset - overshoot) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} s overshoot (optional)\n * @return {number}\n */\n backOut: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n return (end *\n ((timeOrOffset = timeOrOffset / duration - 1) * timeOrOffset * ((overshoot + 1) * timeOrOffset + overshoot) +\n 1) +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} overshoot (optional)\n * @return {number}\n */\n backInOut: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n if ((timeOrOffset /= duration / 2) < 1) {\n return (end / 2) * (timeOrOffset * timeOrOffset * (((overshoot *= 1.525) + 1) * timeOrOffset - overshoot)) + start;\n }\n return ((end / 2) * ((timeOrOffset -= 2) * timeOrOffset * (((overshoot *= 1.525) + 1) * timeOrOffset + overshoot) + 2) +\n start);\n },\n /**\n * @param {number} t current time\n * @param {number} b start value\n * @param {number} c end value\n * @param {number} d duration\n * @return {number}\n */\n bounceIn: (timeOrOffset, start, end, duration = 1) => {\n return end - Easings.bounceOut(duration - timeOrOffset, 0, end, duration) + start;\n },\n /**\n * @param {number} t current time\n * @param {number} b start value\n * @param {number} c end value\n * @param {number} d duration\n * @return {number}\n */\n bounceOut: (timeOrOffset, start, end, duration = 1) => {\n if ((timeOrOffset /= duration) < 1 / 2.75) {\n return end * (7.5625 * timeOrOffset * timeOrOffset) + start;\n }\n else if (timeOrOffset < 2 / 2.75) {\n return end * (7.5625 * (timeOrOffset -= 1.5 / 2.75) * timeOrOffset + 0.75) + start;\n }\n else if (timeOrOffset < 2.5 / 2.75) {\n return end * (7.5625 * (timeOrOffset -= 2.25 / 2.75) * timeOrOffset + 0.9375) + start;\n }\n return end * (7.5625 * (timeOrOffset -= 2.625 / 2.75) * timeOrOffset + 0.984375) + start;\n },\n /**\n *\n *\n * @param {number} time\n * @param {number} start\n * @param {number} end\n * @param {number} duration\n * @returns\n */\n bounceInOut: (timeOrOffset, start, end, duration = 1) => {\n if (timeOrOffset < duration / 2) {\n return Easings.bounceIn(timeOrOffset * 2, 0, end, duration) * 0.5 + start;\n }\n return Easings.bounceOut(timeOrOffset * 2 - duration, 0, end, duration) * 0.5 + end * 0.5 + start;\n },\n};\nexports.Easings = Easings;\n//# sourceMappingURL=Easings.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UncontrolledLoop = exports.Static = exports.Loop = exports.Compose = exports.Simple = exports.resolveSimpleAnimation = void 0;\nconst composeAnimations_1 = require(\"./composeAnimations\");\nconst createAnimation_1 = require(\"./createAnimation\");\nfunction resolveSimpleAnimation(simpleAnimation) {\n const animation = createAnimation_1.createAnimation(simpleAnimation);\n if (animation) {\n return (propArgumentsOrCurrentTime) => {\n var _a;\n const currentTime = typeof propArgumentsOrCurrentTime === 'number'\n ? propArgumentsOrCurrentTime\n : ((_a = propArgumentsOrCurrentTime.shape.scene) === null || _a === void 0 ? void 0 : _a.currentTime) || 0;\n animation.update(currentTime);\n return animation.value;\n };\n }\n}\nexports.resolveSimpleAnimation = resolveSimpleAnimation;\n// Alias\nexports.Simple = resolveSimpleAnimation;\n// Compose multiple animations\nconst Compose = (animations) => {\n const composed = composeAnimations_1.composeAnimations(animations);\n if (composed) {\n return (propArgumentsOrCurrentTime) => {\n var _a;\n const currentTime = typeof propArgumentsOrCurrentTime === 'number'\n ? propArgumentsOrCurrentTime\n : ((_a = propArgumentsOrCurrentTime.shape.scene) === null || _a === void 0 ? void 0 : _a.currentTime) || 0;\n return composed(currentTime);\n };\n }\n};\nexports.Compose = Compose;\nconst Loop = (loopAnimation) => {\n const simpleAnimation = loopAnimation;\n if (typeof simpleAnimation.interpolator === 'undefined') {\n simpleAnimation.interpolator = 'wave';\n }\n if (simpleAnimation.interpolator) {\n if (typeof simpleAnimation.interpolator === 'string') {\n if (simpleAnimation.interpolator !== 'wave') {\n simpleAnimation.direction = 'alternate';\n }\n }\n else if (typeof simpleAnimation.interpolator === 'object' && simpleAnimation.interpolator.type !== 'wave') {\n simpleAnimation.direction = 'alternate';\n }\n }\n simpleAnimation.loop = true;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.Loop = Loop;\nconst Static = (staticAnimation) => {\n const simpleAnimation = staticAnimation;\n simpleAnimation.direction = 'normal';\n simpleAnimation.loop = false;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.Static = Static;\nconst UncontrolledLoop = (uncontrolledLoopAnimation) => {\n const simpleAnimation = uncontrolledLoopAnimation;\n simpleAnimation.direction = 'normal';\n simpleAnimation.loop = true;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.UncontrolledLoop = UncontrolledLoop;\n//# sourceMappingURL=Animation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.composeAnimations = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst createAnimation_1 = require(\"./createAnimation\");\nconst utilities_1 = require(\"./utilities\");\n/**\n *\n *\n * @export\n * @param {Array} simpleAnimations\n * @return {*} {(((currentTime: number) => string | number | Array | undefined) | undefined)}\n */\nfunction composeAnimations(simpleAnimations) {\n const animations = simpleAnimations.map(createAnimation_1.createAnimation).filter(a => typeof a !== 'undefined');\n const animationsLength = animations.length;\n if (animationsLength > 0) {\n return (currentTime) => {\n let value = undefined;\n for (let i = 0; i < animationsLength; i++) {\n const animation = animations[i];\n animation.update(currentTime);\n value = typeof value === 'undefined' ? animation.value : interpolate(value, animation.value);\n }\n return value;\n };\n }\n}\nexports.composeAnimations = composeAnimations;\nfunction interpolate(a, b, offset = 0.5) {\n const from = Array.isArray(a) ? a : [a];\n const to = Array.isArray(b) ? b : [b];\n const results = [];\n for (let i = 0, len = from.length; i < len; i++) {\n if (typeof from[i] !== typeof to[i]) {\n console.error('[@urpflanze/animation]: cannot interpolate');\n return undefined;\n }\n else {\n if (typeof from[i] !== 'string') {\n const a = from[i], b = to[i];\n results.push(a + offset * (b - a));\n }\n else {\n const a = from[i];\n const b = to[i];\n const parsed_a = color_1.parseColorAndConvert(a);\n const parsed_b = color_1.parseColorAndConvert(b);\n if (typeof parsed_a !== 'undefined' && typeof parsed_b !== 'undefined') {\n results.push(utilities_1.interpolateColorRGB(parsed_a, parsed_b, offset));\n }\n }\n }\n }\n return results.length === 1 ? results[0] : results;\n}\n//# sourceMappingURL=composeAnimations.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BrowserDrawerCanvas = void 0;\nconst DrawerCanvas_1 = require(\"../DrawerCanvas\");\nconst utils_1 = require(\"../utils\");\n/**\n *\n * @category DrawerCanvas\n * @class BrowserDrawerCanvas\n * @extends {DrawerCanvas}\n */\nclass BrowserDrawerCanvas extends DrawerCanvas_1.DrawerCanvas {\n constructor(scene, canvasOrContainer, drawerOptions, duration = 60000, framerate = 60) {\n super(scene, canvasOrContainer, drawerOptions, duration, framerate);\n this.dpi = 1;\n this.dpi = (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.dpi) || 1;\n this.draw_id = null;\n this.redraw_id = null;\n this.animation_id = null;\n this.draw = this.draw.bind(this);\n this.animate = this.animate.bind(this);\n this.startAnimation = this.startAnimation.bind(this);\n this.resize(this.drawerOptions.width, this.drawerOptions.height);\n }\n resize(width, height, sceneFit, dpi = this.dpi) {\n this.drawerOptions.width = width * dpi;\n this.drawerOptions.height = height * dpi;\n if (this.canvas) {\n this.canvas.width = width * dpi;\n this.canvas.height = height * dpi;\n if (utils_1.bBrowser && this.canvas instanceof HTMLCanvasElement) {\n this.canvas.style.width = width + 'px';\n this.canvas.style.height = height + 'px';\n }\n }\n if (typeof sceneFit !== 'undefined') {\n this.drawerOptions.sceneFit = sceneFit;\n }\n this.dispatch('drawer-canvas:resize');\n }\n /**\n * Internal tick animation\n */\n animate(timestamp) {\n if (this.timeline.bSequenceStarted()) {\n this.animation_id = requestAnimationFrame(this.animate);\n if (this.timeline.tick(timestamp))\n this.draw();\n }\n }\n /**\n * Start animation drawing\n */\n startAnimation() {\n this.stopAnimation();\n this.timeline.start();\n this.animation_id = requestAnimationFrame(this.animate);\n }\n /**\n * Stop animation drawing\n */\n stopAnimation() {\n this.timeline.stop();\n if (this.animation_id)\n cancelAnimationFrame(this.animation_id);\n }\n /**\n * Pause animation drawing\n */\n pauseAnimation() {\n this.timeline.pause();\n if (this.animation_id)\n cancelAnimationFrame(this.animation_id);\n }\n /**\n * Play animation drawing\n */\n playAnimation() {\n this.timeline.start();\n requestAnimationFrame(this.animate);\n }\n redraw() {\n if (!this.timeline.bSequenceStarted()) {\n this.draw_id && cancelAnimationFrame(this.draw_id);\n if (typeof this.drawerOptions.ghosts === undefined || this.drawerOptions.ghosts === 0)\n this.timeline.stop();\n this.draw_id = requestAnimationFrame(this.draw);\n }\n else if (typeof this.drawerOptions.ghosts === undefined || this.drawerOptions.ghosts === 0) {\n this.stopAnimation();\n this.redraw_id && cancelAnimationFrame(this.redraw_id);\n this.redraw_id = requestAnimationFrame(this.startAnimation);\n }\n }\n}\nexports.BrowserDrawerCanvas = BrowserDrawerCanvas;\n//# sourceMappingURL=BrowserDrawerCanvas.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DrawerCanvas = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nconst math_1 = require(\"@urpflanze/core/dist/cjs/math\");\nconst Vec2_1 = require(\"@urpflanze/core/dist/cjs/math/Vec2\");\nconst canvas_1 = require(\"canvas\");\nconst Emitter_1 = require(\"./Emitter\");\nconst Timeline_1 = require(\"./Timeline\");\nconst utils_1 = require(\"./utils\");\n/**\n *\n * @category DrawerCanvas\n * @extends {Emitter}\n */\nclass DrawerCanvas extends Emitter_1.Emitter {\n constructor(scene, canvasOrContainer, drawerOptions, duration = 60000, framerate = 60) {\n var _a, _b, _c, _d, _e;\n super();\n this.drawerOptions = {\n width: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.width) || (scene === null || scene === void 0 ? void 0 : scene.width) || 400,\n height: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.height) || (scene === null || scene === void 0 ? void 0 : scene.height) || 400,\n clear: (_a = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.clear) !== null && _a !== void 0 ? _a : true,\n time: (_b = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.time) !== null && _b !== void 0 ? _b : 0,\n simmetricLines: (_c = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.simmetricLines) !== null && _c !== void 0 ? _c : 0,\n noBackground: (_d = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.noBackground) !== null && _d !== void 0 ? _d : false,\n ghosts: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghosts) || 0,\n ghostAlpha: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostAlpha) === false ? false : true,\n ghostSkipTime: (_e = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostSkipTime) !== null && _e !== void 0 ? _e : 30,\n ghostSkipFunction: drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostSkipFunction,\n sceneFit: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.sceneFit) || 'contain',\n backgroundImage: drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.backgroundImage,\n backgroundImageFit: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.backgroundImageFit) || 'cover',\n };\n this.timeline = new Timeline_1.Timeline(duration, framerate);\n this.timeline.setTime(this.drawerOptions.time);\n this.draw_id = null;\n this.redraw_id = null;\n this.animation_id = null;\n if (scene) {\n this.setScene(scene);\n }\n if (!utils_1.bWorker || (utils_1.bWorker && canvasOrContainer instanceof OffscreenCanvas))\n this.setCanvas(canvasOrContainer);\n }\n /**\n * Return option value or default\n *\n * @param {K keyof IDrawerCanvasOptions} name\n * @param {IDrawerCanvasOptions[K]} defaultValue\n */\n getOption(name, defaultValue) {\n var _a;\n return (_a = this.drawerOptions[name]) !== null && _a !== void 0 ? _a : defaultValue;\n }\n /**\n * Create instance of canvas (HTMLCanvasElement in browser o Canvas in Node)\n */\n setCanvas(canvasOrContainer) {\n if (utils_1.bWorker) {\n if (canvasOrContainer instanceof OffscreenCanvas) {\n this.canvas = canvasOrContainer;\n }\n else {\n console.error('Cannot set cavas');\n }\n }\n else {\n if (utils_1.bBrowser) {\n const canvas = canvas_1.createCanvas(this.drawerOptions.width, this.drawerOptions.height);\n if (canvasOrContainer instanceof HTMLElement &&\n !(canvasOrContainer instanceof HTMLCanvasElement || canvasOrContainer instanceof OffscreenCanvas)) {\n this.canvas = canvas;\n while (canvasOrContainer.lastChild)\n canvasOrContainer.removeChild(canvasOrContainer.lastChild);\n canvasOrContainer.appendChild(canvas);\n }\n else {\n this.canvas = typeof canvasOrContainer === 'undefined' ? canvas : canvasOrContainer;\n }\n }\n else {\n this.canvas = canvas_1.createCanvas(this.drawerOptions.width, this.drawerOptions.height);\n }\n }\n if (this.canvas) {\n this.canvas.width = this.drawerOptions.width;\n this.canvas.height = this.drawerOptions.height;\n this.context = this.canvas.getContext('2d', {\n alpha: true,\n // desynchronized: true,\n });\n }\n }\n /**\n * Return instance of canvas\n *\n * @returns canvas\n */\n getCanvas() {\n return this.canvas;\n }\n setScene(scene) {\n this.scene = scene;\n }\n draw() {\n if (this.context === null || typeof this.scene === 'undefined')\n return 0;\n const start_time = Utilities_1.now();\n const timeline = this.timeline;\n const drawAtTime = timeline.getTime();\n const drawerOptions = {\n ...this.drawerOptions,\n ghostIndex: undefined,\n clear: this.drawerOptions.clear || timeline.getCurrentFrame() <= 1,\n time: drawAtTime,\n };\n const currentFrame = timeline.getFrameAtTime(drawAtTime);\n this.dispatch('drawer-canvas:before_draw', {\n currentFrame: currentFrame,\n currentTime: drawAtTime,\n });\n if (drawerOptions.simmetricLines > 0) {\n if (drawerOptions.clear) {\n DrawerCanvas.clear(this.context, drawerOptions.width, drawerOptions.height, drawerOptions.noBackground ? false : this.scene.background, drawerOptions.backgroundImage, drawerOptions.backgroundImageFit);\n }\n DrawerCanvas.drawSimmetricLines(this.context, drawerOptions.simmetricLines, drawerOptions.width, drawerOptions.height, this.scene.color);\n drawerOptions.clear = false;\n }\n if (drawerOptions.ghosts) {\n const ghostDrawerOptions = {\n ...drawerOptions,\n };\n const drawAtTime = timeline.getTime();\n const sequenceDuration = timeline.getDuration();\n const ghostRepetition = {\n offset: 0,\n index: 0,\n count: drawerOptions.ghosts,\n };\n for (let i = 1; i <= drawerOptions.ghosts; i++) {\n ghostRepetition.index = i;\n ghostRepetition.offset = ghostRepetition.index / ghostRepetition.count;\n const ghostTime = drawAtTime -\n (drawerOptions.ghostSkipFunction\n ? drawerOptions.ghostSkipFunction(ghostRepetition, drawAtTime)\n : i * drawerOptions.ghostSkipTime);\n ghostDrawerOptions.ghostIndex = i;\n ghostDrawerOptions.time = math_1.mod(ghostTime, sequenceDuration);\n ghostDrawerOptions.clear = drawerOptions.clear && ghostDrawerOptions.ghostIndex === 1;\n this.realDraw(ghostDrawerOptions);\n }\n drawerOptions.clear = false;\n }\n this.realDraw(drawerOptions);\n return Utilities_1.now() - start_time;\n }\n realDraw(options) {\n var _a;\n const width = this.drawerOptions.width;\n const height = this.drawerOptions.height;\n const context = this.context;\n const scene = this.scene;\n const time = (_a = options.time) !== null && _a !== void 0 ? _a : 0;\n const bGhost = typeof options.ghosts !== 'undefined' &&\n options.ghosts > 0 &&\n typeof options.ghostIndex !== 'undefined' &&\n options.ghostIndex > 0;\n const ghostMultiplier = bGhost ? 1 - options.ghostIndex / (options.ghosts + 0.5) : 0;\n const ghostAlpha = options.ghostAlpha === true;\n const sceneFit = utils_1.fit(scene.width, scene.height, width, height, this.drawerOptions.sceneFit);\n const translateX = sceneFit.x;\n const translateY = sceneFit.y;\n options.clear &&\n DrawerCanvas.clear(context, width, height, options.noBackground ? false : scene.background, options.backgroundImage, options.backgroundImageFit);\n let logFillColorWarn = false;\n let logStrokeColorWarn = false;\n scene.currentTime = time;\n const sceneChilds = scene.getChildren();\n for (let i = 0, len = sceneChilds.length; i < len; i++) {\n const sceneChild = sceneChilds[i];\n if (!sceneChild.data ||\n (!(sceneChild.data.visible === false) && !(bGhost && sceneChild.data.disableGhost === true))) {\n sceneChilds[i].generate(time, true);\n const childIndexedBuffer = sceneChilds[i].getIndexedBuffer() || [];\n const childBuffer = sceneChilds[i].getBuffer() || [];\n let childVertexIndex = 0;\n for (let currentBufferIndex = 0, len = childIndexedBuffer.length; currentBufferIndex < len; currentBufferIndex++) {\n const currentIndexing = childIndexedBuffer[currentBufferIndex];\n const shape = currentIndexing.shape;\n const propArguments = {\n canvasContext: context,\n ...currentIndexing,\n };\n const composite = DrawerCanvas.getStreamDrawerProp(shape, 'composite', propArguments, 'source-over');\n context.globalCompositeOperation = composite;\n context.beginPath();\n context.moveTo(childBuffer[childVertexIndex] * sceneFit.scale + translateX, childBuffer[childVertexIndex + 1] * sceneFit.scale + translateY);\n childVertexIndex += 2;\n for (let currentFrameLength = childVertexIndex + currentIndexing.frameLength - 2; childVertexIndex < currentFrameLength; childVertexIndex += 2)\n context.lineTo(childBuffer[childVertexIndex] * sceneFit.scale + translateX, childBuffer[childVertexIndex + 1] * sceneFit.scale + translateY);\n if (shape.isClosed())\n context.closePath();\n const alpha = DrawerCanvas.getStreamDrawerProp(shape, 'opacity', propArguments, 1);\n context.globalAlpha = alpha;\n const shadowColor = DrawerCanvas.getStreamDrawerProp(shape, 'shadowColor', propArguments);\n const shadowBlur = DrawerCanvas.getStreamDrawerProp(shape, 'shadowBlur', propArguments);\n const shadowOffsetX = DrawerCanvas.getStreamDrawerProp(shape, 'shadowOffsetX', propArguments);\n const shadowOffsetY = DrawerCanvas.getStreamDrawerProp(shape, 'shadowOffsetY', propArguments);\n context.shadowColor = shadowColor;\n context.shadowBlur = shadowBlur;\n shadowOffsetX && (context.shadowOffsetX = shadowOffsetX);\n shadowOffsetY && (context.shadowOffsetY = shadowOffsetY);\n let fill = DrawerCanvas.getStreamDrawerProp(shape, 'fill', propArguments);\n if (typeof fill !== 'undefined') {\n if (bGhost && ghostAlpha) {\n const color = DrawerCanvas.ghostifyColor(fill, ghostMultiplier);\n if (color) {\n fill = color;\n }\n else if (!logFillColorWarn) {\n console.warn(`[Urpflanze:DrawerCanvas] Unable ghost fill color '${fill}',\n\t\t\t\t\t\t\t\tplease enter a rgba or hsla color`);\n logFillColorWarn = true;\n }\n }\n context.fillStyle = fill;\n context.fill();\n }\n let stroke = DrawerCanvas.getStreamDrawerProp(shape, 'stroke', propArguments, typeof fill === 'undefined' ? scene.color : undefined);\n let lineWidth = DrawerCanvas.getStreamDrawerProp(shape, 'lineWidth', propArguments, 1);\n if (stroke) {\n if (bGhost && ghostAlpha) {\n const color = DrawerCanvas.ghostifyColor(stroke, ghostMultiplier);\n if (color) {\n stroke = color;\n }\n else if (!logStrokeColorWarn) {\n console.warn(`[Urpflanze:DrawerCanvas] Unable ghost stroke color '${stroke}',\n\t\t\t\t\t\t\t\tplease enter a rgba or hsla color`);\n logStrokeColorWarn = true;\n }\n lineWidth *= ghostMultiplier;\n }\n const lineJoin = DrawerCanvas.getStreamDrawerProp(shape, 'lineJoin', propArguments);\n const lineCap = DrawerCanvas.getStreamDrawerProp(shape, 'lineCap', propArguments);\n const lineDash = DrawerCanvas.getStreamDrawerProp(shape, 'lineDash', propArguments);\n const lineDashOffset = DrawerCanvas.getStreamDrawerProp(shape, 'lineDashOffset', propArguments);\n const miterLimit = DrawerCanvas.getStreamDrawerProp(shape, 'miterLimit', propArguments);\n context.setLineDash.call(context, lineDash || []);\n context.lineJoin = lineJoin;\n context.lineCap = lineCap;\n context.lineDashOffset = lineDashOffset;\n context.miterLimit = miterLimit;\n context.lineWidth = lineWidth * sceneFit.scale;\n context.strokeStyle = stroke;\n context.stroke();\n }\n }\n context.restore();\n }\n }\n }\n /**\n * Return a drawer value\n *\n * @static\n * @template T\n * @param {ShapePrimitive} shape\n * @param {keyof T} key\n * @param {IDrawerPropArguments} propArguments\n * @param {*} [defaultValue]\n * @returns {*}\n */\n static getStreamDrawerProp(shape, key, propArguments, defaultValue) {\n let attribute = shape.drawer[key];\n if (typeof attribute === 'function') {\n attribute = attribute(propArguments);\n }\n return attribute !== null && attribute !== void 0 ? attribute : defaultValue;\n }\n /**\n * Create color based on ghostMultiplier\n *\n * @static\n * @param {any} color\n * @param {number} ghostMultiplier\n * @return {*} {(string | undefined)}\n */\n static ghostifyColor(color, ghostMultiplier) {\n if (typeof color === 'string' || typeof color === 'number') {\n const parsed = color_1.parseColor(color);\n if (parsed) {\n const ghostAlpha = parsed.alpha * ghostMultiplier;\n return parsed.type === 'rgb'\n ? `rgba(${parsed.a},${parsed.b},${parsed.c},${ghostAlpha})`\n : `hsla(${parsed.a},${parsed.b}%,${parsed.c}%,${ghostAlpha})`;\n }\n }\n return color;\n }\n /**\n * Clear canvas, draw background or image (and fit)\n *\n * @param context\n * @param width\n * @param height\n * @param background\n * @param backgroundImage\n * @param backgroundImageFit\n */\n static clear(context, width, height, background, backgroundImage, backgroundImageFit) {\n if (typeof background === 'boolean' && background === false) {\n context.clearRect(0, 0, width, height);\n }\n else {\n context.globalCompositeOperation = 'source-over';\n context.fillStyle = background; // or true\n context.fillRect(0, 0, width, height);\n if (backgroundImage) {\n const sourceWidth = backgroundImage instanceof SVGImageElement ? backgroundImage.width.baseVal.value : backgroundImage.width;\n const sourceHeight = backgroundImage instanceof SVGImageElement ? backgroundImage.height.baseVal.value : backgroundImage.height;\n const fitRect = utils_1.fit(sourceWidth, sourceHeight, width, height, backgroundImageFit);\n context.drawImage(backgroundImage, fitRect.x, fitRect.y, fitRect.width, fitRect.height);\n }\n }\n }\n /**\n * Draw utility lines\n *\n * @param context\n * @param simmetricLines\n * @param width\n * @param height\n * @param color\n */\n static drawSimmetricLines(context, simmetricLines, width, height, color) {\n const offset = Math.PI / simmetricLines;\n const size = Math.max(width, height);\n const sizeMin = Math.min(width, height);\n const k = width < height ? 1 : 0;\n const centerX = [size / 2, size / 2];\n const centerY = [sizeMin / 2, sizeMin / 2];\n for (let i = 0; i < simmetricLines; i++) {\n const a = [-size, -size];\n const b = [size * 2, size * 2];\n const rotate = i * offset + Math.PI / 4;\n Vec2_1.default.rotateZ(a, i % 2 === k ? centerX : centerY, rotate);\n Vec2_1.default.rotateZ(b, i % 2 === k ? centerX : centerY, rotate);\n context.beginPath();\n context.strokeStyle = color;\n context.lineWidth = 1;\n context.moveTo(a[0], a[1]);\n context.lineTo(b[0], b[1]);\n context.stroke();\n }\n }\n}\nexports.DrawerCanvas = DrawerCanvas;\n// const sourceRatio = sourceWidth / sourceHeight\n// let x = 0,\n// \ty = 0,\n// \tbgWidth = width,\n// \tbgHeight = height\n// if (sourceRatio !== ratio) {\n// \tif (options.backgroundImageFit === 'contain') {\n// \t\tbgWidth = ratio > sourceRatio ? (sourceWidth * height) / sourceHeight : width\n// \t\tbgHeight = ratio > sourceRatio ? height : (sourceHeight * width) / sourceWidth\n// \t} else {\n// \t\tbgWidth = ratio < sourceRatio ? (sourceWidth * height) / sourceHeight : width\n// \t\tbgHeight = ratio < sourceRatio ? height : (sourceHeight * width) / sourceWidth\n// \t}\n// \tx = (width - bgWidth) / 2\n// \ty = (height - bgHeight) / 2\n//# sourceMappingURL=DrawerCanvas.js.map","/* globals document, ImageData */\n\nconst parseFont = require('./lib/parse-font')\n\nexports.parseFont = parseFont\n\nexports.createCanvas = function (width, height) {\n return Object.assign(document.createElement('canvas'), { width: width, height: height })\n}\n\nexports.createImageData = function (array, width, height) {\n // Browser implementation of ImageData looks at the number of arguments passed\n switch (arguments.length) {\n case 0: return new ImageData()\n case 1: return new ImageData(array)\n case 2: return new ImageData(array, width)\n default: return new ImageData(array, width, height)\n }\n}\n\nexports.loadImage = function (src, options) {\n return new Promise(function (resolve, reject) {\n const image = Object.assign(document.createElement('img'), options)\n\n function cleanup () {\n image.onload = null\n image.onerror = null\n }\n\n image.onload = function () { cleanup(); resolve(image) }\n image.onerror = function () { cleanup(); reject(new Error('Failed to load the image \"' + src + '\"')) }\n\n image.src = src\n })\n}\n","'use strict'\n\n/**\n * Font RegExp helpers.\n */\n\nconst weights = 'bold|bolder|lighter|[1-9]00'\n , styles = 'italic|oblique'\n , variants = 'small-caps'\n , stretches = 'ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded'\n , units = 'px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q'\n , string = '\\'([^\\']+)\\'|\"([^\"]+)\"|[\\\\w\\\\s-]+'\n\n// [ [ <‘font-style’> || || <‘font-weight’> || <‘font-stretch’> ]?\n// <‘font-size’> [ / <‘line-height’> ]? <‘font-family’> ]\n// https://drafts.csswg.org/css-fonts-3/#font-prop\nconst weightRe = new RegExp('(' + weights + ') +', 'i')\nconst styleRe = new RegExp('(' + styles + ') +', 'i')\nconst variantRe = new RegExp('(' + variants + ') +', 'i')\nconst stretchRe = new RegExp('(' + stretches + ') +', 'i')\nconst sizeFamilyRe = new RegExp(\n '([\\\\d\\\\.]+)(' + units + ') *'\n + '((?:' + string + ')( *, *(?:' + string + '))*)')\n\n/**\n * Cache font parsing.\n */\n\nconst cache = {}\n\nconst defaultHeight = 16 // pt, common browser default\n\n/**\n * Parse font `str`.\n *\n * @param {String} str\n * @return {Object} Parsed font. `size` is in device units. `unit` is the unit\n * appearing in the input string.\n * @api private\n */\n\nmodule.exports = function (str) {\n // Cached\n if (cache[str]) return cache[str]\n\n // Try for required properties first.\n const sizeFamily = sizeFamilyRe.exec(str)\n if (!sizeFamily) return // invalid\n\n // Default values and required properties\n const font = {\n weight: 'normal',\n style: 'normal',\n stretch: 'normal',\n variant: 'normal',\n size: parseFloat(sizeFamily[1]),\n unit: sizeFamily[2],\n family: sizeFamily[3].replace(/[\"']/g, '').replace(/ *, */g, ',')\n }\n\n // Optional, unordered properties.\n let weight, style, variant, stretch\n // Stop search at `sizeFamily.index`\n let substr = str.substring(0, sizeFamily.index)\n if ((weight = weightRe.exec(substr))) font.weight = weight[1]\n if ((style = styleRe.exec(substr))) font.style = style[1]\n if ((variant = variantRe.exec(substr))) font.variant = variant[1]\n if ((stretch = stretchRe.exec(substr))) font.stretch = stretch[1]\n\n // Convert to device units. (`font.unit` is the original unit)\n // TODO: ch, ex\n switch (font.unit) {\n case 'pt':\n font.size /= 0.75\n break\n case 'pc':\n font.size *= 16\n break\n case 'in':\n font.size *= 96\n break\n case 'cm':\n font.size *= 96.0 / 2.54\n break\n case 'mm':\n font.size *= 96.0 / 25.4\n break\n case '%':\n // TODO disabled because existing unit tests assume 100\n // font.size *= defaultHeight / 100 / 0.75\n break\n case 'em':\n case 'rem':\n font.size *= defaultHeight / 0.75\n break\n case 'q':\n font.size *= 96 / 25.4 / 4\n break\n }\n\n return (cache[str] = font)\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Emitter = void 0;\n/**\n * Class used for emit and dispatch events\n *\n * @category Emitter\n * @abstract\n * @class Emitter\n * @template EventTypes\n */\nclass Emitter {\n constructor() {\n this.callbacks = {};\n }\n /**\n * Attach callback at event\n *\n * @param {keyof EventTypes} e\n * @param {(value: EventTypes[keyof EventTypes]) => any} callback\n * @memberof Emitter\n */\n attach(e, callback) {\n if (!(e in this.callbacks)) {\n this.callbacks[e] = [];\n }\n this.callbacks[e].push(callback);\n }\n /**\n * Remove callbach listener at event\n *\n * @param {keyof EventTypes} e\n * @param {(value: EventTypes[keyof EventTypes]) => void} callback\n * @memberof Emitter\n */\n detach(e, callback) {\n if (e in this.callbacks) {\n const index = this.callbacks[e].indexOf(callback);\n if (index >= 0) {\n this.callbacks[e].splice(index, 1);\n }\n }\n }\n /**\n * Dispatch event\n *\n * @param {keyof EventTypes} e\n * @param {EventTypes[keyof EventTypes]} [params]\n * @memberof Emitter\n */\n dispatch(e, params) {\n if (e in this.callbacks && this.callbacks[e].length > 0) {\n for (let i = 0, len = this.callbacks[e].length; i < len; i++)\n if (this.callbacks[e][i](params) === false)\n break;\n }\n }\n}\nexports.Emitter = Emitter;\n//# sourceMappingURL=Emitter.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Timeline = void 0;\nconst Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nconst math_1 = require(\"@urpflanze/core/dist/cjs/math\");\nconst Emitter_1 = require(\"./Emitter\");\n/**\n * Is used for sequence time management.\n * It is necessary to set the duration and the number of frames per second (frame rate).\n *\n * @category Timeline\n * @class Timeline\n * @extends {Emitter}\n */\nclass Timeline extends Emitter_1.Emitter {\n constructor(duration = 60000, framerate = 30) {\n super();\n this.fps_samples_size = 30;\n this.fps_samples = [];\n this.fps_samples_index = 0;\n this.paused_time = 0;\n this.sequence = {\n duration,\n framerate,\n frames: Math.round((duration / 1000) * framerate),\n };\n this.tick_time = 1000 / this.sequence.framerate;\n this.fps = this.sequence.framerate;\n this.b_sequence_started = false;\n this.currentFrame = 0;\n this.currentTime = 0;\n this.last_tick = 0;\n this.start_time = 0;\n }\n //#region sequence meta\n /**\n * Return the sequence\n *\n * @returns {Sequence}\n */\n getSequence() {\n return { ...this.sequence };\n }\n /**\n * Set Sequence\n *\n * @param {number} duration in ms\n * @param {number} framerate\n * @param {number} atTime\n */\n setSequence(duration, framerate, atTime) {\n this.sequence.duration = duration;\n this.sequence.framerate = framerate;\n this.tick_time = 1000 / this.sequence.framerate;\n this.sequence.frames = Math.round((this.sequence.duration / 1000) * this.sequence.framerate);\n if (typeof atTime !== 'undefined') {\n this.setTime(atTime);\n }\n else {\n this.dispatch('timeline:update_sequence', this.getSequence());\n }\n }\n /**\n * Set duration of timeline\n *\n * @param {number} framerate\n */\n setDuration(duration) {\n this.setSequence(duration, this.sequence.framerate);\n }\n /**\n * Get timeline duration\n *\n * @returns {number}\n */\n getDuration() {\n return this.sequence.duration;\n }\n /**\n * Return framerate\n *\n * @returns {number}\n */\n getFramerate() {\n return this.sequence.framerate;\n }\n /**\n * Set a framerate\n *\n * @param {number} framerate\n */\n setFramerate(framerate) {\n this.setSequence(this.sequence.duration, framerate);\n }\n /**\n * Get number of frames based on duration and framerate\n *\n * @returns {number}\n */\n getFramesCount() {\n return this.sequence.frames;\n }\n //#endregion meta\n //#region change status\n bSequenceStarted() {\n return this.b_sequence_started;\n }\n /**\n * Start the sequence\n *\n */\n start() {\n if (!this.b_sequence_started) {\n this.b_sequence_started = true;\n this.start_time = this.paused_time;\n this.dispatch('timeline:change_status', Timeline.START);\n }\n }\n /**\n * Pause the sequence\n *\n */\n pause() {\n if (this.b_sequence_started) {\n this.paused_time = Utilities_1.now();\n this.b_sequence_started = false;\n this.dispatch('timeline:change_status', Timeline.PAUSE);\n }\n }\n /**\n * Stop the sequence and reset\n *\n */\n stop() {\n if (this.b_sequence_started) {\n this.b_sequence_started = false;\n this.currentTime = 0;\n this.currentFrame = 0;\n this.start_time = 0;\n this.paused_time = 0;\n this.dispatch('timeline:change_status', Timeline.STOP);\n }\n }\n /**\n * Animation tick\n *\n * @param {number} timestamp current timestamp\n * @returns {boolean}\n */\n tick(timestamp) {\n if (this.b_sequence_started) {\n if (!this.start_time) {\n this.start_time = timestamp;\n this.last_tick = -this.tick_time;\n }\n const currentTime = timestamp - this.start_time;\n const elapsed = currentTime - this.last_tick;\n if (elapsed >= this.tick_time) {\n this.calculateFPS(1 / (elapsed / 1000));\n this.last_tick = currentTime;\n this.currentTime = (currentTime - (elapsed % this.tick_time)) % this.sequence.duration;\n this.currentFrame = this.getFrameAtTime(this.currentTime);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n return true;\n }\n }\n return false;\n }\n /**\n * Calculate fps\n *\n * @private\n * @param {number} currentFPS\n */\n calculateFPS(currentFPS) {\n const samples = this.fps_samples.length;\n if (samples > 0) {\n let average = 0;\n for (let i = 0; i < samples; i++)\n average += this.fps_samples[i];\n this.fps = Math.round(average / samples);\n }\n this.fps_samples[this.fps_samples_index] = Math.round(currentFPS);\n this.fps_samples_index = (this.fps_samples_index + 1) % this.fps_samples_size;\n }\n //#endregion\n //#region Frame and Time\n /**\n * Return current animation frame\n *\n * @returns {number}\n */\n getCurrentFrame() {\n return this.currentFrame;\n }\n /**\n * get the time at specific frame number\n *\n * @param {number} frame\n * @returns {number}\n */\n getFrameTime(frame) {\n frame = math_1.mod(frame, this.sequence.frames);\n return (frame * this.tick_time) % this.sequence.duration;\n }\n /**\n * Return frame number at time\n *\n * @param {number} time\n * @returns {number}\n */\n getFrameAtTime(time) {\n return Math.round((time % this.sequence.duration) / this.tick_time);\n }\n /**\n * set current frame\n *\n * @param {number} frame\n */\n setFrame(frame) {\n this.currentFrame = math_1.mod(frame, this.sequence.frames);\n this.currentTime = this.getFrameTime(this.currentFrame);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n }\n /**\n * Return tick time (based on framerate)\n *\n * @returns {number}\n */\n getTickTime() {\n return this.tick_time;\n }\n /**\n * Return the current time\n *\n * @returns {number}\n */\n getTime() {\n return this.currentTime;\n }\n /**\n * Set animation at time\n *\n * @param {number} time\n */\n setTime(time) {\n time = math_1.mod(time, this.sequence.duration);\n this.currentTime = time;\n this.currentFrame = this.getFrameAtTime(time);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n }\n}\nexports.Timeline = Timeline;\n/**\n * Animation status started\n * @internal\n */\nTimeline.START = 'start';\n/**\n * Animation status paused\n * @internal\n */\nTimeline.PAUSE = 'pause';\n/**\n * Animation status stop\n * @internal\n */\nTimeline.STOP = 'stop';\n//# sourceMappingURL=Timeline.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fit = exports.bWorker = exports.bBrowser = exports.bNode = void 0;\nexports.bNode = typeof process !== 'undefined' &&\n typeof process.versions !== 'undefined' &&\n typeof process.versions.node !== 'undefined';\nexports.bBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';\nexports.bWorker = typeof self === 'object' && ['ServiceWorkerGlobalScope', 'DedicatedWorkerGlobalScope'].includes(self.constructor.name);\n/**\n * Utiltites\n *\n * @category Utilities\n * @export\n * @param {number} sourceWidth\n * @param {number} sourceHeight\n * @param {number} destWidth\n * @param {number} destHeight\n * @param {('cover' | 'contain' | 'none')} [fit='none']\n * @return {*} {{ x: number; y: number; width: number; height: number; scale: number }}\n */\nfunction fit(sourceWidth, sourceHeight, destWidth, destHeight, fit = 'none') {\n let x = 0, y = 0, scale = 1, finalWidth = sourceWidth, finalHeight = sourceHeight;\n const ratio = destWidth / destHeight;\n const sourceRatio = sourceWidth / sourceHeight;\n if (fit === 'contain') {\n finalWidth = ratio > sourceRatio ? (sourceWidth * destHeight) / sourceHeight : destWidth;\n finalHeight = ratio > sourceRatio ? destHeight : (sourceHeight * destWidth) / sourceWidth;\n scale = Math.max(finalWidth, finalHeight) / Math.max(sourceWidth, sourceHeight);\n }\n else if (fit === 'cover') {\n finalWidth = ratio < sourceRatio ? (sourceWidth * destHeight) / sourceHeight : destWidth;\n finalHeight = ratio < sourceRatio ? destHeight : (sourceHeight * destWidth) / sourceWidth;\n // scale = Math.min(sourceWidth, sourceHeight) / Math.min(finalWidth, finalHeight)\n scale = Math.max(finalWidth, finalHeight) / Math.max(sourceWidth, sourceHeight);\n }\n else {\n // finalWidth = sourceWidth\n // finalHeight = sourceHeight\n }\n x = (destWidth - finalWidth) / 2;\n y = (destHeight - finalHeight) / 2;\n return {\n x,\n y,\n width: finalWidth,\n height: finalHeight,\n scale,\n };\n}\nexports.fit = fit;\n//# sourceMappingURL=utils.js.map","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export * from './modules-light';\n//# sourceMappingURL=index-light.js.map"],"sourceRoot":""} \ No newline at end of file diff --git a/build/esm/urpflanze-light.min.js b/build/esm/urpflanze-light.min.js index 5739b2d..f332dcd 100644 --- a/build/esm/urpflanze-light.min.js +++ b/build/esm/urpflanze-light.min.js @@ -1,2 +1,2 @@ /*! For license information please see urpflanze-light.min.js.LICENSE.txt */ -var t={2894:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.UncontrolledLoop=e.Static=e.Loop=e.Compose=e.Simple=e.resolveSimpleAnimation=void 0;const n=r(4825),i=r(2765);function a(t){const e=i.createAnimation(t);if(e)return t=>{var r;const n="number"==typeof t?t:(null===(r=t.shape.scene)||void 0===r?void 0:r.currentTime)||0;return e.update(n),e.value}}e.resolveSimpleAnimation=a,e.Simple=a,e.Compose=t=>{const e=n.composeAnimations(t);if(e)return t=>{var r;const n="number"==typeof t?t:(null===(r=t.shape.scene)||void 0===r?void 0:r.currentTime)||0;return e(n)}},e.Loop=t=>{const e=t;return void 0===e.interpolator&&(e.interpolator="wave"),e.interpolator&&("string"==typeof e.interpolator?"wave"!==e.interpolator&&(e.direction="alternate"):"object"==typeof e.interpolator&&"wave"!==e.interpolator.type&&(e.direction="alternate")),e.loop=!0,a(e)},e.Static=t=>{const e=t;return e.direction="normal",e.loop=!1,a(e)},e.UncontrolledLoop=t=>{const e=t;return e.direction="normal",e.loop=!0,a(e)}},9727:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=void 0;const r={linear:(t,e,r,n=1)=>r*t/n+e,quadraticIn:(t,e,r,n=1)=>r*(t/=n)*t+e,quadraticOut:(t,e,r,n=1)=>-r*(t/=n)*(t-2)+e,quadraticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t+e:-r/2*(--t*(t-2)-1)+e,cubicIn:(t,e,r,n=1)=>r*(t/=n)*t*t+e,cubicOut:(t,e,r,n=1)=>(t/=n,r*(--t*t*t+1)+e),cubicInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t+e:r/2*((t-=2)*t*t+2)+e,quarticIn:(t,e,r,n=1)=>r*(t/=n)*t*t*t+e,quarticOut:(t,e,r,n=1)=>(t/=n,-r*(--t*t*t*t-1)+e),quarticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t*t+e:-r/2*((t-=2)*t*t*t-2)+e,quinticIn:(t,e,r,n=1)=>r*(t/=n)*t*t*t*t+e,quinticOut:(t,e,r,n=1)=>(t/=n,r*(--t*t*t*t*t+1)+e),quinticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t*t*t+e:r/2*((t-=2)*t*t*t*t+2)+e,sinusoidalIn:(t,e,r,n=1)=>-r*Math.cos(t/n*(Math.PI/2))+r+e,sinusoidalOut:(t,e,r,n=1)=>r*Math.sin(t/n*(Math.PI/2))+e,sinusoidalInOut:(t,e,r,n=1)=>-r/2*(Math.cos(Math.PI*t/n)-1)+e,exponentialIn:(t,e,r,n=1)=>r*Math.pow(2,10*(t/n-1))+e,exponentialOut:(t,e,r,n=1)=>r*(1-Math.pow(2,-10*t/n))+e,exponentialInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*Math.pow(2,10*(t-1))+e:(t--,r/2*(2-Math.pow(2,-10*t))+e),circularIn:(t,e,r,n=1)=>(t/=n,-r*(Math.sqrt(1-t*t)-1)+e),circularOut:(t,e,r,n=1)=>(t/=n,t--,r*Math.sqrt(1-t*t)+e),circularInOut:(t,e,r,n=1)=>(t/=n/2)<1?-r/2*(Math.sqrt(1-t*t)-1)+e:(t-=2,r/2*(Math.sqrt(1-t*t)+1)+e),elasticIn:(t,e,r,n=1,i=1,a=.5)=>{if(0===t)return e;if(1==(t/=n))return e+r;a*=n;let o=0;return i{if(0===t)return e;if(1==(t/=n))return e+r;a*=n;let o=0;return i{if(0===t)return e;if(2==(t/=n/2))return e+r;a*=n;let o=0;return ir*(t/=n)*t*((i+1)*t-i)+e,backOut:(t,e,r,n=1,i=1.70158)=>r*((t=t/n-1)*t*((i+1)*t+i)+1)+e,backInOut:(t,e,r,n=1,i=1.70158)=>(t/=n/2)<1?r/2*(t*t*((1+(i*=1.525))*t-i))+e:r/2*((t-=2)*t*((1+(i*=1.525))*t+i)+2)+e,bounceIn:(t,e,n,i=1)=>n-r.bounceOut(i-t,0,n,i)+e,bounceOut:(t,e,r,n=1)=>(t/=n)<1/2.75?r*(7.5625*t*t)+e:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+e:r*(7.5625*(t-=2.625/2.75)*t+.984375)+e,bounceInOut:(t,e,n,i=1)=>t{Object.defineProperty(e,"__esModule",{value:!0}),e.composeAnimations=void 0;const n=r(7358),i=r(2765),a=r(8782);function o(t,e,r=.5){const i=Array.isArray(t)?t:[t],o=Array.isArray(e)?e:[e],s=[];for(let t=0,e=i.length;tvoid 0!==t)),r=e.length;if(r>0)return t=>{let n;for(let i=0;i{Object.defineProperty(e,"__esModule",{value:!0}),e.createAnimation=void 0;const n=r(9298);e.createAnimation=function(t){const e=n.createInterpolationCallback(t);if(void 0===e)return;const r=t.delay||0,i=t.afterDelay||0,a=t.direction||"normal",o=t.duration||1e3,s="normal"===a||"reverse"===a?o+r:2*o+r+i,h={delay:r,afterDelay:i,direction:a,duration:o,totalDuration:s,loop:"number"==typeof t.loop?t.loop:!!t.loop},c=n.createInterpolator(t.interpolator),u={loop:0,offset:0,loopDuration:s,direction:"alternate"===a?"normal":a,started:!1,ended:!1,value:void 0};return u.update=function(t,e,r,n){const{loop:i,totalDuration:a,delay:o,afterDelay:s,direction:h,duration:c}=e;return u=>{if("number"==typeof i&&u>=a*i||!1===i&&u>=e.totalDuration)return t.started=!1,t.ended=!0,t.offset=r("normal"===h?c:0,c),void(t.value=n(t.offset));if(t.loop=Math.ceil(u/a),u%=a,(u-=o)<=0)return t.started=!1,t.offset=r(0,c),void(t.value=n(t.offset));if(t.started=!0,"alternate"===h)u<=c?(t.direction="normal",t.offset=r(u,c)):(t.direction="reverse",u-=c,(u-=s)>=0?t.offset=1-r(u>=c?c:u,c):t.offset=1);else{const e=r(u>=c?c:u,c);t.offset="normal"===h?e:1-e}t.value=n(t.offset)}}(u,h,c,e),u}},9298:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createInterpolator=e.createInterpolationCallback=void 0;const n=r(7358),i=r(3431),a=r(9727),o=r(8782);e.createInterpolationCallback=function(t){const e=Array.isArray(t.from)?t.from:[t.from],r=Array.isArray(t.to)?t.to:[t.to],i=t.round,a="hue"===t.colorTransitionMode?o.interpolateColorHSL:o.interpolateColorRGB;if(e.length!==r.length)return;const s=[];for(let t=0,o=e.length;t1===t?a:0===t?n:Math.round((n+t*(a-n))*i)/i:t=>1===t?a:0===t?n:n+t*(a-n))}else{const i=e[t],o=r[t],h=n.parseColorAndConvert(i),c=n.parseColorAndConvert(o);void 0!==h&&void 0!==c&&s.push((t=>1===t?o:0===t?i:a(h,c,t)))}}return t=>{const e=s.map((e=>e(t)));return 1===e.length?e[0]:e}},e.createInterpolator=function(t){var e,r;switch(typeof t){case"function":return(e,r)=>t(e/r,e);case"string":switch(t){case"wave":return(t,e)=>.5+.5*Math.sin(t*Math.PI*2/e+1.5*Math.PI);default:if(t in a.Easings){const e=a.Easings[t];return(t,r)=>e(t,0,1,r)}return(t,e)=>a.Easings.linear(t,0,1,e)}case"object":switch(t.type){case"wave":{const r=1.5*Math.PI+((null===(e=t.params)||void 0===e?void 0:e.phase)||0);return(t,e)=>.5+.5*Math.sin(t*Math.PI*2/e+r)}case"elasticIn":case"elasticOut":case"elasticInOut":{const e=a.Easings[t.type],{amplitude:r,period:n}=t.params||{};return(t,i)=>e(t,0,1,i,r,n)}case"backIn":case"backOut":case"backInOut":{const e=a.Easings[t.type],n=(null===(r=t.params)||void 0===r?void 0:r.overshoot)||void 0;return(t,r)=>e(t,0,1,r,n)}case"cubicBezier":{const e=i.default(t.params[0],t.params[1],t.params[2],t.params[3]);return(t,r)=>e(t/r)}}}return(t,e)=>a.Easings.linear(t,0,1,e)}},7518:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(5240),e),i(r(8782),e),i(r(2765),e),i(r(9298),e),i(r(9727),e),i(r(2894),e)},5240:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},8782:(t,e)=>{function r(t,e,r=!0,n="alternate",i=0,a=0){const o="normal"===n||"reverse"===n?e+i:2*e+i+a;return"number"==typeof r&&t>=o*r||!1===r&&t>=o?"normal"===n?e:0:(t%=o,(t-=i)<=0?0:"alternate"===n?t<=e?t:(t-=e,(t-=a)>=0?e-(t>=e?e:t):e):t>=e?e:t)}Object.defineProperty(e,"__esModule",{value:!0}),e.interpolateColorHSL=e.interpolateColorRGB=e.cosp=e.sinp=e.clockOffset=e.clock=void 0,e.clock=r,e.clockOffset=function(t,e,n=!0,i="alternate",a=0,o=0){return r(t,e,n,i,a,o)/e};const n=2*Math.PI;e.sinp=function(t,e,r=0,i=!1){const a=Math.sin(t*n/e+r);return i?.5+.5*a:a},e.cosp=function(t,e,r=0,i=!1){const a=Math.cos(t*n/e+r);return i?.5+.5*a:a},e.interpolateColorRGB=function(t,e,r){const n=t.r+r*(e.r-t.r),i=t.g+r*(e.g-t.g),a=t.b+r*(e.b-t.b),o=t.alpha+r*(e.alpha-t.alpha);return`rgba(${Math.floor(n)},${Math.floor(i)},${Math.floor(a)},${o})`},e.interpolateColorHSL=function(t,e,r){return`hsla(${t.h+r*(e.h-t.h)},${t.s+r*(e.s-t.s)}%,${t.l+r*(e.l-t.l)}%,${t.alpha+r*(e.alpha-t.alpha)})`}},814:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.rgbToHsl=e.hslToRgb=e.rgbToHex=void 0,e.rgbToHex=function(t,e,r){return`#${((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}`},e.hslToRgb=function(t,e,r){let n,i,a;if(t/=360,r/=100,0==(e/=100))n=i=a=r;else{const o=(t,e,r)=>(r+=r<0?1:r>1?-1:0)<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,s=r<.5?r*(1+e):r+e-r*e,h=2*r-s;n=o(h,s,t+1/3),i=o(h,s,t),a=o(h,s,t-1/3)}return[.5+255*n<<0,.5+255*i<<0,.5+255*a<<0]},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;const n=Math.max(t,e,r),i=Math.min(t,e,r),a=(n+i)/2;let o,s;if(n===i)o=s=0;else{const h=n-i;switch(s=a>.5?h/(2-n-i):h/(n+i),n){case t:o=(e-r)/h+(e{Object.defineProperty(e,"__esModule",{value:!0}),e.default={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",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",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",rebeccapurple:"#663399",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",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},7358:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(6097),e),i(r(814),e),i(r(5576),e)},5576:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.parseColorAndConvert=void 0;const n=r(4947),i=r(814);function a(t){if("number"==typeof t)return t>16777215?{type:"rgb",a:t>>24&255,b:t>>16&255,c:t>>8&255,alpha:(255&t)/255}:{type:"rgb",a:t>>16&255,b:t>>8&255,c:255&t,alpha:1};t=t.replace(/\s/g,""),n.default[t]&&(t=n.default[t]);let e=/^#([0-9a-f]{3,8})$/i.exec(t);if(e){const t=e[1];return 3===t.length?{type:"rgb",a:parseInt(t[0]+t[0],16),b:parseInt(t[1]+t[1],16),c:parseInt(t[2]+t[2],16),alpha:1}:{type:"rgb",a:parseInt(t[0]+t[1],16),b:parseInt(t[2]+t[3],16),c:parseInt(t[4]+t[5],16),alpha:t.length>6?parseInt(t.substring(6),16)/255:1}}if(e=/^((hsl|rgb)a?)\((\d+),(\d+)%?,(\d+)%?,?(.+)?\)$/i.exec(t),e){const[,,t,r,n,i,a]=e;return{type:t,a:+r,b:+n,c:+i,alpha:a?+a:1}}}e.parseColorAndConvert=function(t){const e=a(t);if(e){if("hsl"===e.type){const[t,r,n]=i.hslToRgb(e.a,e.b,e.c);return{r:t,g:r,b:n,h:e.a,s:e.b,l:e.c,alpha:e.alpha}}{const[t,r,n]=i.rgbToHsl(e.a,e.b,e.c);return{h:t,s:r,l:n,r:e.a,g:e.b,b:e.c,alpha:e.alpha}}}},e.parseColor=a},6097:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2513:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Group=void 0;const n=r(1378),i=r(541),a=r(2648),o=r(5511);class s extends i.SceneChild{constructor(t={}){t.type="Group",super(t),this.children=[],["id","name","data","order","type"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=o.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){"object"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=s},1378:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Scene=void 0;const n=r(541),i=r(2513),a=r(6448),o=r(313);class s{constructor(t={}){this.width=400,this.height=400,this.background="hsla(0, 0%, 0%, 1)",this.color="hsla(0, 0%, 100%, 1)",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?(.5+.5*o.clamp(-1,1,t.anchor[0]))*this.width:"left"===t.anchor[0]?0:"right"===t.anchor[0]?this.width:this.center[0],"number"==typeof t.anchor[1]?(.5+.5*o.clamp(-1,1,t.anchor[1]))*this.height:"top"===t.anchor[1]?0:"bottom"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e="number"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,s.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{s.propagateToChilden(t,e)})):t instanceof a.Shape&&t.shape&&(t.shape.scene=e,s.propagateToChilden(t.shape,e))}}e.Scene=s},541:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||"SceneChild",this.name=t.name||this.type+"_"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){"string"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},313:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(21),i=r(2769),a=r(795),o="undefined"!=typeof performance?performance:Date;function s(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return o.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=s,e.relativeClamp=function(t,e,r,n,i){return s(n,i,(r-t)/(e-t)*(i-n)+n)};const h={random:new n(Math.random)};e.noise=function(t="random",e=0,r=0,i=0){return void 0===h[t]&&(h[t]=new n(t)),h[t].noise3D(e,r,i)};const c={};function u(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),a=rn?[a,o]:[o,a]}function l(t,e){const r=t.length,n=r/2,i=2*(n+e),a=n-1;if(a>1){const n=r-2,o=Math.floor(e/a);let s=(i-(r+o*n))/2;const h=Math.round(a/s),c=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%h==0||e===n-2),p=o+(d?1:0),g=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);c[i]=(a=t(),o=t(),s=t(),h=t(),function(){let t=(a>>>=0)+(o>>>=0)|0;return a=o^o>>>9,o=(s>>>=0)+(s<<3)|0,t=t+(h=1+(h>>>=0)|0)|0,s=(s=s<<21|s>>>11)+t|0,(t>>>0)/4294967296})}var a,o,s,h;const u=e+c[i]()*(r-e);return void 0!==n?Math.round(u*10**n)/10**n:u},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return a.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=u,e.interpolate=function(t,e,r=.5){const[n,i]=u(t,e),a=Math.max(n.length,i.length),o="number"==typeof r?[r]:r,s=a/2;if(o.length!==s){const t=o.length;for(let e=0;e{Object.defineProperty(e,"__esModule",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return"number"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},8721:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(887);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},3792:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},5511:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(9958);var i;!function(t){t[t.None=0]="None",t[t.Scale=2]="Scale",t[t.Center=4]="Center",t[t.Fill=8]="Fill"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn("[Urplfanze:Bounding] cannot sum bounding")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn("[Urplfanze:Bounding] cannot bind bounding")}};class a extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return a.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=a.getBounding(t));const o=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,s=e>=i.Center?r.cx:0,h=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{Object.defineProperty(e,"__esModule",{value:!0}),e.Close=void 0;const n=r(9958);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},1740:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Mirror=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let a=0;a{Object.defineProperty(e,"__esModule",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},3315:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Offset=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i},4660:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Smooth=void 0;const n=r(313),i=r(8301),a=r(9958);class o extends a.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Solidify=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const a=[],o=(e="number"==typeof e?[e]:e).length;let s,h,c=[[0,0],[0,0]],u=[[0,0],[0,0]];for(let r=0,l=0,f=t.length-2;r{Object.defineProperty(e,"__esModule",{value:!0}),e.Subdivide=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Modifiers=void 0;const n=r(5511),i=r(1740),a=r(4660),o=r(5838),s=r(5588),h=r(8301),c=r(3315),u={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:a.Smooth,Solidify:o.Solidify,Subdivide:s.Subdivide,Close:h.Close,Offset:c.Offset};e.Modifiers=u},6448:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=void 0;const n=r(1378),i=r(541),a=r(2648);class o extends a.ShapeBase{constructor(t){t.type=t.type||"Shape",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn("[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\nYou passed:",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):o.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBase=void 0;const n=r(887),i=r(3757),a=r(8721),o=r(795),s=r(3792),h=r(5511),c=r(313),u=r(541),l=n.mat4.create(),f=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class g extends u.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?-1*c.clamp(-1,1,t.anchor[0]):"left"===t.anchor[0]?1:"right"===t.anchor[0]?-1:0,"number"==typeof t.anchor[1]?-1*c.clamp(-1,1,t.anchor[1]):"top"===t.anchor[1]?1:"bottom"===t.anchor[1]?-1:0]:[0,0],this.boundingType="string"==typeof t.boundingType?"relative"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return"function"!=typeof t.repetitions&&"function"!=typeof t.distance&&"function"!=typeof t.displace&&"function"!=typeof t.scale&&"function"!=typeof t.translate&&"function"!=typeof t.skewX&&"function"!=typeof t.skewY&&"function"!=typeof t.squeezeX&&"function"!=typeof t.squeezeY&&"function"!=typeof t.rotateX&&"function"!=typeof t.rotateY&&"function"!=typeof t.rotateZ&&"function"!=typeof t.transformOrigin&&"function"!=typeof t.perspective&&"function"!=typeof t.perspectiveOrigin}isStaticIndexed(){return"function"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return"function"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){"string"==typeof t?(r=r||"repetitions"==t,this.props[t]=e):(r=r||"repetitions"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var u,m;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const v=g.getEmptyPropArguments(this,r),M=v.repetition,b=this.getProp("repetitions",v,1),y=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,x=Array.isArray(b)?b[0]*(null!==(u=b[1])&&void 0!==u?u:b[0]):b,w=Array.isArray(b)?b[0]:x,S=Array.isArray(b)?null!==(m=b[1])&&void 0!==m?m:b[0]:1,P=M.row;P.count=w;const I=M.col;I.count=S,M.count=x,M.col.count=S,M.row.count=w,M.type=y;let _=0;const O=[];let B=0;const A=n.vec2.fromValues((S-1)/2,(w-1)/2),C=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],R=[void 0,void 0,void 0,void 0],k=[void 0,void 0,void 0,void 0];for(let r=0;r1?B/(x-1):1,M.angle=y===i.ERepetitionType.Ring?s.PI2/x*B:0,I.index=u+1,I.offset=S>1?u/(S-1):1,P.index=r+1,P.offset=w>1?r/(w-1):1;const g=this.generateBuffer(t,v),m=g.length,b=this.getShapeBounding();O[B]=new Float32Array(m),_+=m;{const t=a.toVec2(this.getProp("distance",v,a.VEC2_ZERO)),s=this.getProp("displace",v,0),x=a.toVec3(this.getProp("scale",v,a.VEC2_ONE),1),w=a.toVec3(this.getProp("translate",v,a.VEC2_ZERO),0),S=this.getProp("skewX",v,0),P=this.getProp("skewY",v,0),I=this.getProp("squeezeX",v,0),_=this.getProp("squeezeY",v,0),E=this.getProp("rotateX",v,0),F=this.getProp("rotateY",v,0),q=this.getProp("rotateZ",v,0),L=c.clamp(0,1,this.getProp("perspective",v,0)),T=a.toVec3(this.getProp("perspectiveOrigin",v,a.VEC2_ZERO),0),j=a.toVec3(this.getProp("transformOrigin",v,a.VEC2_ZERO),0);let D;switch(y){case i.ERepetitionType.Ring:D=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(D,D,a.VEC3_ZERO,M.angle+s);break;case i.ERepetitionType.Matrix:D=n.vec3.fromValues(t[1]*(u-A[0]),t[0]*(r-A[1]),0)}const z=L>0?Math.max(b.width,b.height)/2:1,V=L>0?z+10*z*(1-L):0,U=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==L||0!==j[0]||0!==j[1],Y=0!==T[0]||0!==T[1];U&&(this.boundingType===i.EBoundingType.Relative?(j[0]=j[0]*(b.width/2)+b.cx,j[1]=j[1]*(b.height/2)+b.cy):(j[0]*=b.width/2,j[1]*=b.height/2),j[2]=V);{n.mat4.identity(f),U&&n.mat4.translate(f,f,j),0===w[0]&&0===w[1]||n.mat4.translate(f,f,w),0===S&&0===P||(a.fromSkew(l,[S,P]),n.mat4.multiply(f,f,l)),0!==E&&n.mat4.rotateX(f,f,E),0!==F&&n.mat4.rotateY(f,f,F),0!==q&&n.mat4.rotateZ(f,f,q),1===x[0]&&1===x[1]||n.mat4.scale(f,f,x),U&&n.mat4.translate(f,f,n.vec3.scale(j,j,-1)),V>0&&(Y&&(this.boundingType===i.EBoundingType.Relative?(T[0]=T[0]*(b.width/2)+b.cx,T[1]=T[1]*(b.height/2)+b.cy):(T[0]*=b.width/2,T[1]*=b.height/2),T[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,D),e&&n.mat4.translate(p,p,C);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),y===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,M.angle+s)}h.Bounding.clear(k);for(let t=0;t0&&(Y&&n.vec3.add(e,e,T),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,V),Y&&n.vec3.sub(e,e,T)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=m/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,v)}O[B][t]=e[0],O[B][t+1]=e[1],h.Bounding.add(k,e[0],e[1]),h.Bounding.add(R,e[0],e[1])}}const E={cx:0,cy:0,x:-1,y:-1,width:2,height:2};h.Bounding.bind(E,k),this.bStaticIndexed&&this.bIndexed||this.addIndex(m,M,E)}h.Bounding.bind(this.bounding,R),this.buffer=new Float32Array(_);for(let t=0,e=0,r=O.length;t({index:1,offset:1,count:1}),g.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...g.getEmptySimpleRepetition(),row:g.getEmptySimpleRepetition(),col:g.getEmptySimpleRepetition()})},7439:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBuffer=void 0;const n=r(5511),i=r(3674);class a extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||"ShapeBuffer",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn("[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property"),this.shape=a.EMPTY_BUFFER):this.shape="function"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return"function"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from("function"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,a=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&"function"!=typeof this.props.sideLength&&"function"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=a},5382:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeFollow=void 0;const n=r(6448);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeFollow",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},a=this.shape;a.generate(t,!1,i);let o=a.getBuffer();const s=o.length,h=new Float32Array(s*(n.length/2)),c=n.length/2;for(let e=0;e1?e/(c-1):1,count:c};this.shapeUseFollow&&(i.follow=r,a.generate(t,!1,i),o=a.getBuffer());const u=e*s,l=2*e,f=n[l],d=n[l+1];for(let t=0,e=o.length;t1?t/(e-1):1;for(let o=0,s=a.length;o{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeLoop=void 0;const n=r(3792),i=r(5511),a=r(3674),o=r(2648);class s extends a.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||"ShapeLoop",super(t),this.loopDependencies=(t.loopDependencies||[]).concat("sideLength"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes("propArguments"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}"loop"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||o.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?("function"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),a=this.getRepetitionSideLength(t),o=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,s={index:0,offset:0,current:0,count:n},h=s.count,c=new Float32Array(2*h);for(let n=0,i=0;n1?n/(s.count-1):1;s.current=a,s.index=n+1,s.offset=h;const u=o(s,t);c[i]=u[0],c[i+1]=u[1]}const u=[void 0,void 0,void 0,void 0],l=this.applyModifiers(c,t);for(let t=0,e=l.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapePrimitive=void 0;const n=r(8721),i=r(2648),a=r(9958),o=r(5511);class s extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=o.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:"function"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return"function"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:"number"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp("sideLength",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeRecursive=void 0;const n=r(6448);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeRecursive",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionScale&&"function"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp("recursions",e,1)),n=Math.floor(this.getProp("recursionVertex",e,0)),a=this.getProp("recursionScale",e,2),o=this.shape;let s={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const h={...e,recursion:s};o.generate(t,!1,h);const c=o.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=c);let u=c;const l=[s];let f=0,d=1;const p=u.length,g=p/2,m=n<=0?g:Math.min(n,g),v=0===n?1:g/Math.min(n,g),M=new Float32Array(i.summmation(r,m)*p);for(let t=0;t1?e/(r-1):1,c=i.summmation(e,m)*p,g=e-1,b=0===g?0:i.summmation(g,m)*p;for(let i=0,g=m**e;i1?i/(g-1):1,count:g,level:{index:e+1,offset:n,count:r},parent:l[f]},l.push(s),this.shapeUseRecursion&&(h.recursion=s,o.generate(t,!1,h),u=o.getBuffer());const y=c+i*p,x=Math.floor(b+2*i*v),w=M[x],S=M[x+1],P=a**e;for(let t=0,e=p;t1?0:1,count:a}}},h=this.shape.getIndexedBuffer()||[];for(let t=0,e=h.length;t1?0:1,count:a}},i={...s,recursion:r},o=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:o})}if(a>1){const t=this.shape.getBufferLength({...i,parent:{...s}})/2,e=o<=0?t:Math.min(o,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let c=0,u=1;for(let t=1;t1?t/(a-1):1;for(let o=0,l=e**t;o1?o/(l-1):1;for(let d=0,p=h.length;d{Object.defineProperty(e,"__esModule",{value:!0}),e.Circle=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){t.type="Circle",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=a},6329:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Line=void 0;const n=r(5511),i=r(7439);class a extends i.ShapeBuffer{constructor(t={}){t.type="Line",t.shape=a.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Lissajous=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){t.type="Lissajous",t.loopDependencies=(t.loopDependencies||[]).concat(["wx","wy","wz"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp("wx",t),r=this.getProp("wy",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),a=this.getRepetitionSideLength(t);return 1/Math.pow(a[0]*a[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp("wx",t,1),this.wy=this.getProp("wy",t,2),this.wz=this.getProp("wz",t,2),super.generateLoopBuffer(t)}}e.Lissajous=a},2982:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Polygon=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["sideNumber"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp("sideNumber",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=a},5510:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Rect=void 0;const n=r(5511),i=r(7439);class a extends i.ShapeBuffer{constructor(t={}){t.type="Rect",t.shape=a.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=a,a.buffer=[1,1,-1,1,-1,-1,1,-1]},894:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Rose=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){var e,r;t.type="Rose",t.loopDependencies=(t.loopDependencies||[]).concat(["n","d"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>a.getFinalAngleFromK(this.getProp("n",t),this.getProp("d",t)),inc:t=>{const e=this.getProp("n",t),r=this.getProp("d",t),i=this.getRepetitionSideLength(t),a=Math.pow(i[0]*i[1],.45),o=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp("n",t)/this.getProp("d",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=a},5719:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Spiral=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type="Spiral",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat(["twists","twistsStart","spiral"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:a.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp("twistsStart",t),end:t=>n.PI2*(this.getProp("twistsStart",t)+this.getProp("twists",t)),inc:t=>{const e=this.getProp("twists",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp("spiral",t),this.r=a.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case a.types.ARCHIMEDE:return t=>t/10;case a.types.HYPERBOLIC:return t=>1/t*3;case a.types.FERMAT:return t=>t**.5/3;case a.types.LITUUS:return t=>t**-.5;case a.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=a,a.types={ARCHIMEDE:"ARCHIMEDE",HYPERBOLIC:"HYPERBOLIC",FERMAT:"FERMAT",LITUUS:"LITUUS",LOGARITHMIC:"LOGARITHMIC"}},9667:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Star=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["spikes","innerRadius"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp("spikes",t,5),this.innerRadius=this.getProp("innerRadius",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=a},3977:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SuperShape=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){var e,r,i,a,o,s;t.type="SuperShape",t.loopDependencies=(t.loopDependencies||[]).concat(["a","b","m","n1","n2","n3"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(a=t.n1)&&void 0!==a?a:1,this.props.n2=null!==(o=t.n2)&&void 0!==o?o:1,this.props.n3=null!==(s=t.n3)&&void 0!==s?s:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp("a",t),this.b=this.getProp("b",t),this.m=this.getProp("m",t),this.n1=this.getProp("n1",t),this.n2=this.getProp("n2",t),this.n3=this.getProp("n3",t),super.generateLoopBuffer(t)}}e.SuperShape=a},4233:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Triangle=void 0;const n=r(5511),i=r(7439);class a extends i.ShapeBuffer{constructor(t={}){t.type="Triangle",t.shape=a.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=a,a.buffer=[1,0,-1,1,-1,-1]},3757:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(7678),e),i(r(7066),e),i(r(2769),e),i(r(7266),e),i(r(3647),e),i(r(4526),e),i(r(1618),e),i(r(6787),e)},7678:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},7066:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2769:(t,e)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]="Ring",r[r.Matrix=2]="Matrix"},7266:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},3647:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4526:(t,e)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]="Relative",r[r.Fixed=2]="Fixed"},1618:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6787:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},9962:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DrawerCanvas=void 0;const n=r(7358),i=r(313),a=r(3792),o=r(795),s=r(292),h=r(1189),c=r(8909),u=r(9724);class l extends h.Emitter{constructor(t,e,r,n=6e4,i=60){var a,o,s,h,l;super(),this.drawerOptions={width:(null==r?void 0:r.width)||(null==t?void 0:t.width)||400,height:(null==r?void 0:r.height)||(null==t?void 0:t.height)||400,clear:null===(a=null==r?void 0:r.clear)||void 0===a||a,time:null!==(o=null==r?void 0:r.time)&&void 0!==o?o:0,simmetricLines:null!==(s=null==r?void 0:r.simmetricLines)&&void 0!==s?s:0,noBackground:null!==(h=null==r?void 0:r.noBackground)&&void 0!==h&&h,ghosts:(null==r?void 0:r.ghosts)||0,ghostAlpha:!1!==(null==r?void 0:r.ghostAlpha),ghostSkipTime:null!==(l=null==r?void 0:r.ghostSkipTime)&&void 0!==l?l:30,ghostSkipFunction:null==r?void 0:r.ghostSkipFunction,sceneFit:(null==r?void 0:r.sceneFit)||"contain",backgroundImage:null==r?void 0:r.backgroundImage,backgroundImageFit:(null==r?void 0:r.backgroundImageFit)||"cover"},this.timeline=new c.Timeline(n,i),this.timeline.setTime(this.drawerOptions.time),this.draw_id=null,this.redraw_id=null,this.animation_id=null,t&&this.setScene(t),(!u.bWorker||u.bWorker&&e instanceof OffscreenCanvas)&&this.setCanvas(e)}getOption(t,e){var r;return null!==(r=this.drawerOptions[t])&&void 0!==r?r:e}setCanvas(t){if(u.bWorker)t instanceof OffscreenCanvas?this.canvas=t:console.error("Cannot set cavas");else if(u.bBrowser){const e=s.createCanvas(this.drawerOptions.width,this.drawerOptions.height);if(t instanceof HTMLElement&&!(t instanceof HTMLCanvasElement||t instanceof OffscreenCanvas)){for(this.canvas=e;t.lastChild;)t.removeChild(t.lastChild);t.appendChild(e)}else this.canvas=void 0===t?e:t}else this.canvas=s.createCanvas(this.drawerOptions.width,this.drawerOptions.height);this.canvas&&(this.canvas.width=this.drawerOptions.width,this.canvas.height=this.drawerOptions.height,this.context=this.canvas.getContext("2d",{alpha:!0}))}getCanvas(){return this.canvas}setScene(t){this.scene=t}draw(){if(null===this.context||void 0===this.scene)return 0;const t=i.now(),e=this.timeline,r=e.getTime(),n={...this.drawerOptions,ghostIndex:void 0,clear:this.drawerOptions.clear||e.getCurrentFrame()<=1,time:r},o=e.getFrameAtTime(r);if(this.dispatch("drawer-canvas:before_draw",{currentFrame:o,currentTime:r}),n.simmetricLines>0&&(n.clear&&l.clear(this.context,n.width,n.height,!n.noBackground&&this.scene.background,n.backgroundImage,n.backgroundImageFit),l.drawSimmetricLines(this.context,n.simmetricLines,n.width,n.height,this.scene.color),n.clear=!1),n.ghosts){const t={...n},r=e.getTime(),i=e.getDuration(),o={offset:0,index:0,count:n.ghosts};for(let e=1;e<=n.ghosts;e++){o.index=e,o.offset=o.index/o.count;const s=r-(n.ghostSkipFunction?n.ghostSkipFunction(o,r):e*n.ghostSkipTime);t.ghostIndex=e,t.time=a.mod(s,i),t.clear=n.clear&&1===t.ghostIndex,this.realDraw(t)}n.clear=!1}return this.realDraw(n),i.now()-t}realDraw(t){var e;const r=this.drawerOptions.width,n=this.drawerOptions.height,i=this.context,a=this.scene,o=null!==(e=t.time)&&void 0!==e?e:0,s=void 0!==t.ghosts&&t.ghosts>0&&void 0!==t.ghostIndex&&t.ghostIndex>0,h=s?1-t.ghostIndex/(t.ghosts+.5):0,c=!0===t.ghostAlpha,f=u.fit(a.width,a.height,r,n,this.drawerOptions.sceneFit),d=f.x,p=f.y;t.clear&&l.clear(i,r,n,!t.noBackground&&a.background,t.backgroundImage,t.backgroundImageFit);let g=!1,m=!1;a.currentTime=o;const v=a.getChildren();for(let t=0,e=v.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=void 0,e.Emitter=class{constructor(){this.callbacks={}}attach(t,e){t in this.callbacks||(this.callbacks[t]=[]),this.callbacks[t].push(e)}detach(t,e){if(t in this.callbacks){const r=this.callbacks[t].indexOf(e);r>=0&&this.callbacks[t].splice(r,1)}}dispatch(t,e){if(t in this.callbacks&&this.callbacks[t].length>0)for(let r=0,n=this.callbacks[t].length;r{Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=void 0;const n=r(313),i=r(3792),a=r(1189);class o extends a.Emitter{constructor(t=6e4,e=30){super(),this.fps_samples_size=30,this.fps_samples=[],this.fps_samples_index=0,this.paused_time=0,this.sequence={duration:t,framerate:e,frames:Math.round(t/1e3*e)},this.tick_time=1e3/this.sequence.framerate,this.fps=this.sequence.framerate,this.b_sequence_started=!1,this.currentFrame=0,this.currentTime=0,this.last_tick=0,this.start_time=0}getSequence(){return{...this.sequence}}setSequence(t,e,r){this.sequence.duration=t,this.sequence.framerate=e,this.tick_time=1e3/this.sequence.framerate,this.sequence.frames=Math.round(this.sequence.duration/1e3*this.sequence.framerate),void 0!==r?this.setTime(r):this.dispatch("timeline:update_sequence",this.getSequence())}setDuration(t){this.setSequence(t,this.sequence.framerate)}getDuration(){return this.sequence.duration}getFramerate(){return this.sequence.framerate}setFramerate(t){this.setSequence(this.sequence.duration,t)}getFramesCount(){return this.sequence.frames}bSequenceStarted(){return this.b_sequence_started}start(){this.b_sequence_started||(this.b_sequence_started=!0,this.start_time=this.paused_time,this.dispatch("timeline:change_status",o.START))}pause(){this.b_sequence_started&&(this.paused_time=n.now(),this.b_sequence_started=!1,this.dispatch("timeline:change_status",o.PAUSE))}stop(){this.b_sequence_started&&(this.b_sequence_started=!1,this.currentTime=0,this.currentFrame=0,this.start_time=0,this.paused_time=0,this.dispatch("timeline:change_status",o.STOP))}tick(t){if(this.b_sequence_started){this.start_time||(this.start_time=t,this.last_tick=-this.tick_time);const e=t-this.start_time,r=e-this.last_tick;if(r>=this.tick_time)return this.calculateFPS(1/(r/1e3)),this.last_tick=e,this.currentTime=(e-r%this.tick_time)%this.sequence.duration,this.currentFrame=this.getFrameAtTime(this.currentTime),this.dispatch("timeline:progress",{currentFrame:this.currentFrame,currentTime:this.currentTime,fps:this.fps}),!0}return!1}calculateFPS(t){const e=this.fps_samples.length;if(e>0){let t=0;for(let r=0;r{e.T=void 0;const n=r(9962),i=r(9724);class a extends n.DrawerCanvas{constructor(t,e,r,n=6e4,i=60){super(t,e,r,n,i),this.dpi=1,this.dpi=(null==r?void 0:r.dpi)||1,this.draw_id=null,this.redraw_id=null,this.animation_id=null,this.draw=this.draw.bind(this),this.animate=this.animate.bind(this),this.startAnimation=this.startAnimation.bind(this),this.resize(this.drawerOptions.width,this.drawerOptions.height)}resize(t,e,r,n=this.dpi){this.drawerOptions.width=t*n,this.drawerOptions.height=e*n,this.canvas&&(this.canvas.width=t*n,this.canvas.height=e*n,i.bBrowser&&this.canvas instanceof HTMLCanvasElement&&(this.canvas.style.width=t+"px",this.canvas.style.height=e+"px")),void 0!==r&&(this.drawerOptions.sceneFit=r),this.dispatch("drawer-canvas:resize")}animate(t){this.timeline.bSequenceStarted()&&(this.animation_id=requestAnimationFrame(this.animate),this.timeline.tick(t)&&this.draw())}startAnimation(){this.stopAnimation(),this.timeline.start(),this.animation_id=requestAnimationFrame(this.animate)}stopAnimation(){this.timeline.stop(),this.animation_id&&cancelAnimationFrame(this.animation_id)}pauseAnimation(){this.timeline.pause(),this.animation_id&&cancelAnimationFrame(this.animation_id)}playAnimation(){this.timeline.start(),requestAnimationFrame(this.animate)}redraw(){this.timeline.bSequenceStarted()?void 0!==typeof this.drawerOptions.ghosts&&0!==this.drawerOptions.ghosts||(this.stopAnimation(),this.redraw_id&&cancelAnimationFrame(this.redraw_id),this.redraw_id=requestAnimationFrame(this.startAnimation)):(this.draw_id&&cancelAnimationFrame(this.draw_id),void 0!==typeof this.drawerOptions.ghosts&&0!==this.drawerOptions.ghosts||this.timeline.stop(),this.draw_id=requestAnimationFrame(this.draw))}}e.T=a},9724:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fit=e.bWorker=e.bBrowser=e.bNode=void 0,e.bNode="undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node,e.bBrowser="undefined"!=typeof window&&void 0!==window.document,e.bWorker="object"==typeof self&&["ServiceWorkerGlobalScope","DedicatedWorkerGlobalScope"].includes(self.constructor.name),e.fit=function(t,e,r,n,i="none"){let a=0,o=0,s=1,h=t,c=e;const u=r/n,l=t/e;return"contain"===i?(h=u>l?t*n/e:r,c=u>l?n:e*r/t,s=Math.max(h,c)/Math.max(t,e)):"cover"===i&&(h=u{var e=.1,r="function"==typeof Float32Array;function n(t,e){return 1-3*e+3*t}function i(t,e){return 3*e-6*t}function a(t){return 3*t}function o(t,e,r){return((n(e,r)*t+i(e,r))*t+a(e))*t}function s(t,e,r){return 3*n(e,r)*t*t+2*i(e,r)*t+a(e)}function h(t){return t}t.exports=function(t,n,i,a){if(!(0<=t&&t<=1&&0<=i&&i<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===n&&i===a)return h;for(var c=r?new Float32Array(11):new Array(11),u=0;u<11;++u)c[u]=o(u*e,t,i);return function(r){return 0===r?0:1===r?1:o(function(r){for(var n=0,a=1;10!==a&&c[a]<=r;++a)n+=e;--a;var h=n+(r-c[a])/(c[a+1]-c[a])*e,u=s(h,t,i);return u>=.001?function(t,e,r,n){for(var i=0;i<4;++i){var a=s(e,r,n);if(0===a)return e;e-=(o(e,r,n)-t)/a}return e}(r,h,t,i):0===u?h:function(t,e,r,n,i){var a,s,h=0;do{(a=o(s=e+(r-e)/2,n,i)-t)>0?r=s:e=s}while(Math.abs(a)>1e-7&&++h<10);return s}(r,n,n+e,t,i)}(r),n,a)}}},292:(t,e,r)=>{const n=r(9850);e.parseFont=n,e.createCanvas=function(t,e){return Object.assign(document.createElement("canvas"),{width:t,height:e})},e.createImageData=function(t,e,r){switch(arguments.length){case 0:return new ImageData;case 1:return new ImageData(t);case 2:return new ImageData(t,e);default:return new ImageData(t,e,r)}},e.loadImage=function(t,e){return new Promise((function(r,n){const i=Object.assign(document.createElement("img"),e);function a(){i.onload=null,i.onerror=null}i.onload=function(){a(),r(i)},i.onerror=function(){a(),n(new Error('Failed to load the image "'+t+'"'))},i.src=t}))}},9850:t=>{const e="'([^']+)'|\"([^\"]+)\"|[\\w\\s-]+",r=new RegExp("(bold|bolder|lighter|[1-9]00) +","i"),n=new RegExp("(italic|oblique) +","i"),i=new RegExp("(small-caps) +","i"),a=new RegExp("(ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded) +","i"),o=new RegExp("([\\d\\.]+)(px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q) *((?:"+e+")( *, *(?:"+e+"))*)"),s={};t.exports=function(t){if(s[t])return s[t];const e=o.exec(t);if(!e)return;const h={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(e[1]),unit:e[2],family:e[3].replace(/["']/g,"").replace(/ *, */g,",")};let c,u,l,f,d=t.substring(0,e.index);switch((c=r.exec(d))&&(h.weight=c[1]),(u=n.exec(d))&&(h.style=u[1]),(l=i.exec(d))&&(h.variant=l[1]),(f=a.exec(d))&&(h.stretch=f[1]),h.unit){case"pt":h.size/=.75;break;case"pc":h.size*=16;break;case"in":h.size*=96;break;case"cm":h.size*=96/2.54;break;case"mm":h.size*=96/25.4;break;case"%":break;case"em":case"rem":h.size*=16/.75;break;case"q":h.size*=96/25.4/4}return s[t]=h}},887:(t,e,r)=>{r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>a,mat3:()=>o,mat4:()=>s,quat:()=>u,quat2:()=>l,vec2:()=>f,vec3:()=>h,vec4:()=>c});var n={};r.r(n),r.d(n,{ARRAY_TYPE:()=>p,EPSILON:()=>d,RANDOM:()=>g,equals:()=>b,setMatrixArrayType:()=>m,toRadian:()=>M});var i={};r.r(i),r.d(i,{LDU:()=>T,add:()=>j,adjoint:()=>B,clone:()=>x,copy:()=>w,create:()=>y,determinant:()=>A,equals:()=>V,exactEquals:()=>z,frob:()=>L,fromRotation:()=>E,fromScaling:()=>F,fromValues:()=>P,identity:()=>S,invert:()=>O,mul:()=>H,multiply:()=>C,multiplyScalar:()=>U,multiplyScalarAndAdd:()=>Y,rotate:()=>R,scale:()=>k,set:()=>I,str:()=>q,sub:()=>Z,subtract:()=>D,transpose:()=>_});var a={};r.r(a),r.d(a,{add:()=>ct,clone:()=>X,copy:()=>G,create:()=>N,determinant:()=>K,equals:()=>pt,exactEquals:()=>dt,frob:()=>ht,fromRotation:()=>it,fromScaling:()=>at,fromTranslation:()=>ot,fromValues:()=>W,identity:()=>$,invert:()=>J,mul:()=>gt,multiply:()=>tt,multiplyScalar:()=>lt,multiplyScalarAndAdd:()=>ft,rotate:()=>et,scale:()=>rt,set:()=>Q,str:()=>st,sub:()=>mt,subtract:()=>ut,translate:()=>nt});var o={};r.r(o),r.d(o,{add:()=>Vt,adjoint:()=>_t,clone:()=>bt,copy:()=>yt,create:()=>vt,determinant:()=>Ot,equals:()=>Nt,exactEquals:()=>Zt,frob:()=>zt,fromMat2d:()=>qt,fromMat4:()=>Mt,fromQuat:()=>Lt,fromRotation:()=>Et,fromScaling:()=>Ft,fromTranslation:()=>kt,fromValues:()=>xt,identity:()=>St,invert:()=>It,mul:()=>Xt,multiply:()=>Bt,multiplyScalar:()=>Yt,multiplyScalarAndAdd:()=>Ht,normalFromMat4:()=>Tt,projection:()=>jt,rotate:()=>Ct,scale:()=>Rt,set:()=>wt,str:()=>Dt,sub:()=>Gt,subtract:()=>Ut,translate:()=>At,transpose:()=>Pt});var s={};r.r(s),r.d(s,{add:()=>Fe,adjoint:()=>ne,clone:()=>Wt,copy:()=>Qt,create:()=>$t,determinant:()=>ie,equals:()=>De,exactEquals:()=>je,frob:()=>Ee,fromQuat:()=>Ie,fromQuat2:()=>be,fromRotation:()=>pe,fromRotationTranslation:()=>Me,fromRotationTranslationScale:()=>Se,fromRotationTranslationScaleOrigin:()=>Pe,fromScaling:()=>de,fromTranslation:()=>fe,fromValues:()=>Jt,fromXRotation:()=>ge,fromYRotation:()=>me,fromZRotation:()=>ve,frustum:()=>_e,getRotation:()=>we,getScaling:()=>xe,getTranslation:()=>ye,identity:()=>te,invert:()=>re,lookAt:()=>Ce,mul:()=>ze,multiply:()=>ae,multiplyScalar:()=>Le,multiplyScalarAndAdd:()=>Te,ortho:()=>Ae,perspective:()=>Oe,perspectiveFromFieldOfView:()=>Be,rotate:()=>he,rotateX:()=>ce,rotateY:()=>ue,rotateZ:()=>le,scale:()=>se,set:()=>Kt,str:()=>ke,sub:()=>Ve,subtract:()=>qe,targetTo:()=>Re,translate:()=>oe,transpose:()=>ee});var h={};r.r(h),r.d(h,{add:()=>Ge,angle:()=>Sr,bezier:()=>gr,ceil:()=>Je,clone:()=>Ye,copy:()=>Ne,create:()=>Ue,cross:()=>fr,dist:()=>kr,distance:()=>ar,div:()=>Rr,divide:()=>Qe,dot:()=>lr,equals:()=>Or,exactEquals:()=>_r,floor:()=>Ke,forEach:()=>Lr,fromValues:()=>Ze,hermite:()=>pr,inverse:()=>cr,len:()=>Fr,length:()=>He,lerp:()=>dr,max:()=>er,min:()=>tr,mul:()=>Cr,multiply:()=>We,negate:()=>hr,normalize:()=>ur,random:()=>mr,rotateX:()=>yr,rotateY:()=>xr,rotateZ:()=>wr,round:()=>rr,scale:()=>nr,scaleAndAdd:()=>ir,set:()=>Xe,sqrDist:()=>Er,sqrLen:()=>qr,squaredDistance:()=>or,squaredLength:()=>sr,str:()=>Ir,sub:()=>Ar,subtract:()=>$e,transformMat3:()=>Mr,transformMat4:()=>vr,transformQuat:()=>br,zero:()=>Pr});var c={};r.r(c),r.d(c,{add:()=>Ur,ceil:()=>Nr,clone:()=>jr,copy:()=>zr,create:()=>Tr,cross:()=>hn,dist:()=>yn,distance:()=>Kr,div:()=>bn,divide:()=>Zr,dot:()=>sn,equals:()=>mn,exactEquals:()=>gn,floor:()=>Xr,forEach:()=>Pn,fromValues:()=>Dr,inverse:()=>an,len:()=>wn,length:()=>en,lerp:()=>cn,max:()=>$r,min:()=>Gr,mul:()=>Mn,multiply:()=>Hr,negate:()=>nn,normalize:()=>on,random:()=>un,round:()=>Wr,scale:()=>Qr,scaleAndAdd:()=>Jr,set:()=>Vr,sqrDist:()=>xn,sqrLen:()=>Sn,squaredDistance:()=>tn,squaredLength:()=>rn,str:()=>pn,sub:()=>vn,subtract:()=>Yr,transformMat4:()=>ln,transformQuat:()=>fn,zero:()=>dn});var u={};r.r(u),r.d(u,{add:()=>ei,calculateW:()=>Fn,clone:()=>Qn,conjugate:()=>Vn,copy:()=>Kn,create:()=>In,dot:()=>ii,equals:()=>fi,exactEquals:()=>li,exp:()=>qn,fromEuler:()=>Yn,fromMat3:()=>Un,fromValues:()=>Jn,getAngle:()=>An,getAxisAngle:()=>Bn,identity:()=>_n,invert:()=>zn,len:()=>si,length:()=>oi,lerp:()=>ai,ln:()=>Ln,mul:()=>ri,multiply:()=>Cn,normalize:()=>ui,pow:()=>Tn,random:()=>Dn,rotateX:()=>Rn,rotateY:()=>kn,rotateZ:()=>En,rotationTo:()=>di,scale:()=>ni,set:()=>ti,setAxes:()=>gi,setAxisAngle:()=>On,slerp:()=>jn,sqlerp:()=>pi,sqrLen:()=>ci,squaredLength:()=>hi,str:()=>Hn});var l={};r.r(l),r.d(l,{add:()=>Di,clone:()=>vi,conjugate:()=>Ni,copy:()=>Pi,create:()=>mi,dot:()=>Yi,equals:()=>ta,exactEquals:()=>Ki,fromMat4:()=>Si,fromRotation:()=>wi,fromRotationTranslation:()=>yi,fromRotationTranslationValues:()=>bi,fromTranslation:()=>xi,fromValues:()=>Mi,getDual:()=>Bi,getReal:()=>Oi,getTranslation:()=>Ri,identity:()=>Ii,invert:()=>Zi,len:()=>Gi,length:()=>Xi,lerp:()=>Hi,mul:()=>Vi,multiply:()=>zi,normalize:()=>Qi,rotateAroundAxis:()=>ji,rotateByQuatAppend:()=>Li,rotateByQuatPrepend:()=>Ti,rotateX:()=>Ei,rotateY:()=>Fi,rotateZ:()=>qi,scale:()=>Ui,set:()=>_i,setDual:()=>Ci,setReal:()=>Ai,sqrLen:()=>Wi,squaredLength:()=>$i,str:()=>Ji,translate:()=>ki});var f={};r.r(f),r.d(f,{add:()=>oa,angle:()=>Ea,ceil:()=>ua,clone:()=>ra,copy:()=>ia,create:()=>ea,cross:()=>Ia,dist:()=>Ua,distance:()=>va,div:()=>Va,divide:()=>ca,dot:()=>Pa,equals:()=>Ta,exactEquals:()=>La,floor:()=>la,forEach:()=>Za,fromValues:()=>na,inverse:()=>wa,len:()=>ja,length:()=>ba,lerp:()=>_a,max:()=>da,min:()=>fa,mul:()=>za,multiply:()=>ha,negate:()=>xa,normalize:()=>Sa,random:()=>Oa,rotate:()=>ka,round:()=>pa,scale:()=>ga,scaleAndAdd:()=>ma,set:()=>aa,sqrDist:()=>Ya,sqrLen:()=>Ha,squaredDistance:()=>Ma,squaredLength:()=>ya,str:()=>qa,sub:()=>Da,subtract:()=>sa,transformMat2:()=>Ba,transformMat2d:()=>Aa,transformMat3:()=>Ca,transformMat4:()=>Ra,zero:()=>Fa});var d=1e-6,p="undefined"!=typeof Float32Array?Float32Array:Array,g=Math.random;function m(t){p=t}var v=Math.PI/180;function M(t){return t*v}function b(t,e){return Math.abs(t-e)<=d*Math.max(1,Math.abs(t),Math.abs(e))}function y(){var t=new p(4);return p!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function x(t){var e=new p(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function w(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function S(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function P(t,e,r,n){var i=new p(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function I(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function _(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function O(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*a-i*n;return o?(o=1/o,t[0]=a*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}function B(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function A(t){return t[0]*t[3]-t[2]*t[1]}function C(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],h=r[1],c=r[2],u=r[3];return t[0]=n*s+a*h,t[1]=i*s+o*h,t[2]=n*c+a*u,t[3]=i*c+o*u,t}function R(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),h=Math.cos(r);return t[0]=n*h+a*s,t[1]=i*h+o*s,t[2]=n*-s+a*h,t[3]=i*-s+o*h,t}function k(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],h=r[1];return t[0]=n*s,t[1]=i*s,t[2]=a*h,t[3]=o*h,t}function E(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function F(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function q(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function L(t){return Math.hypot(t[0],t[1],t[2],t[3])}function T(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function j(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function D(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function z(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function V(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],h=e[2],c=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-h)<=d*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-c)<=d*Math.max(1,Math.abs(a),Math.abs(c))}function U(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Y(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var H=C,Z=D;function N(){var t=new p(6);return p!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function X(t){var e=new p(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function G(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function $(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function W(t,e,r,n,i,a){var o=new p(6);return o[0]=t,o[1]=e,o[2]=r,o[3]=n,o[4]=i,o[5]=a,o}function Q(t,e,r,n,i,a,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t}function J(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],h=r*a-n*i;return h?(h=1/h,t[0]=a*h,t[1]=-n*h,t[2]=-i*h,t[3]=r*h,t[4]=(i*s-a*o)*h,t[5]=(n*o-r*s)*h,t):null}function K(t){return t[0]*t[3]-t[1]*t[2]}function tt(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],h=e[5],c=r[0],u=r[1],l=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*c+a*u,t[1]=i*c+o*u,t[2]=n*l+a*f,t[3]=i*l+o*f,t[4]=n*d+a*p+s,t[5]=i*d+o*p+h,t}function et(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],h=e[5],c=Math.sin(r),u=Math.cos(r);return t[0]=n*u+a*c,t[1]=i*u+o*c,t[2]=n*-c+a*u,t[3]=i*-c+o*u,t[4]=s,t[5]=h,t}function rt(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],h=e[5],c=r[0],u=r[1];return t[0]=n*c,t[1]=i*c,t[2]=a*u,t[3]=o*u,t[4]=s,t[5]=h,t}function nt(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],h=e[5],c=r[0],u=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=n*c+a*u+s,t[5]=i*c+o*u+h,t}function it(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function at(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function ot(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function st(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function ht(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function ct(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function ut(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function lt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function ft(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function dt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function pt(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],h=e[0],c=e[1],u=e[2],l=e[3],f=e[4],p=e[5];return Math.abs(r-h)<=d*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(n-c)<=d*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-l)<=d*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(o-f)<=d*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(s-p)<=d*Math.max(1,Math.abs(s),Math.abs(p))}var gt=tt,mt=ut;function vt(){var t=new p(9);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Mt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function bt(t){var e=new p(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function xt(t,e,r,n,i,a,o,s,h){var c=new p(9);return c[0]=t,c[1]=e,c[2]=r,c[3]=n,c[4]=i,c[5]=a,c[6]=o,c[7]=s,c[8]=h,c}function wt(t,e,r,n,i,a,o,s,h,c){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=h,t[8]=c,t}function St(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Pt(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function It(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],h=e[6],c=e[7],u=e[8],l=u*o-s*c,f=-u*a+s*h,d=c*a-o*h,p=r*l+n*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-u*n+i*c)*p,t[2]=(s*n-i*o)*p,t[3]=f*p,t[4]=(u*r-i*h)*p,t[5]=(-s*r+i*a)*p,t[6]=d*p,t[7]=(-c*r+n*h)*p,t[8]=(o*r-n*a)*p,t):null}function _t(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],h=e[6],c=e[7],u=e[8];return t[0]=o*u-s*c,t[1]=i*c-n*u,t[2]=n*s-i*o,t[3]=s*h-a*u,t[4]=r*u-i*h,t[5]=i*a-r*s,t[6]=a*c-o*h,t[7]=n*h-r*c,t[8]=r*o-n*a,t}function Ot(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],h=t[7],c=t[8];return e*(c*a-o*h)+r*(-c*i+o*s)+n*(h*i-a*s)}function Bt(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],h=e[5],c=e[6],u=e[7],l=e[8],f=r[0],d=r[1],p=r[2],g=r[3],m=r[4],v=r[5],M=r[6],b=r[7],y=r[8];return t[0]=f*n+d*o+p*c,t[1]=f*i+d*s+p*u,t[2]=f*a+d*h+p*l,t[3]=g*n+m*o+v*c,t[4]=g*i+m*s+v*u,t[5]=g*a+m*h+v*l,t[6]=M*n+b*o+y*c,t[7]=M*i+b*s+y*u,t[8]=M*a+b*h+y*l,t}function At(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],h=e[5],c=e[6],u=e[7],l=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=h,t[6]=f*n+d*o+c,t[7]=f*i+d*s+u,t[8]=f*a+d*h+l,t}function Ct(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],h=e[5],c=e[6],u=e[7],l=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*s,t[2]=d*a+f*h,t[3]=d*o-f*n,t[4]=d*s-f*i,t[5]=d*h-f*a,t[6]=c,t[7]=u,t[8]=l,t}function Rt(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function kt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function Et(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Ft(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function qt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function Lt(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,h=i+i,c=r*o,u=n*o,l=n*s,f=i*o,d=i*s,p=i*h,g=a*o,m=a*s,v=a*h;return t[0]=1-l-p,t[3]=u-v,t[6]=f+m,t[1]=u+v,t[4]=1-c-p,t[7]=d-g,t[2]=f-m,t[5]=d+g,t[8]=1-c-l,t}function Tt(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],h=e[6],c=e[7],u=e[8],l=e[9],f=e[10],d=e[11],p=e[12],g=e[13],m=e[14],v=e[15],M=r*s-n*o,b=r*h-i*o,y=r*c-a*o,x=n*h-i*s,w=n*c-a*s,S=i*c-a*h,P=u*g-l*p,I=u*m-f*p,_=u*v-d*p,O=l*m-f*g,B=l*v-d*g,A=f*v-d*m,C=M*A-b*B+y*O+x*_-w*I+S*P;return C?(C=1/C,t[0]=(s*A-h*B+c*O)*C,t[1]=(h*_-o*A-c*I)*C,t[2]=(o*B-s*_+c*P)*C,t[3]=(i*B-n*A-a*O)*C,t[4]=(r*A-i*_+a*I)*C,t[5]=(n*_-r*B-a*P)*C,t[6]=(g*S-m*w+v*x)*C,t[7]=(m*y-p*S-v*b)*C,t[8]=(p*w-g*y+v*M)*C,t):null}function jt(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function Dt(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function zt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Vt(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function Ut(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function Yt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function Ht(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function Zt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function Nt(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],h=t[6],c=t[7],u=t[8],l=e[0],f=e[1],p=e[2],g=e[3],m=e[4],v=e[5],M=e[6],b=e[7],y=e[8];return Math.abs(r-l)<=d*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(n-f)<=d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-p)<=d*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(a-g)<=d*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(o-m)<=d*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(s-v)<=d*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(h-M)<=d*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(c-b)<=d*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(u-y)<=d*Math.max(1,Math.abs(u),Math.abs(y))}var Xt=Bt,Gt=Ut;function $t(){var t=new p(16);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Wt(t){var e=new p(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Qt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Jt(t,e,r,n,i,a,o,s,h,c,u,l,f,d,g,m){var v=new p(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=n,v[4]=i,v[5]=a,v[6]=o,v[7]=s,v[8]=h,v[9]=c,v[10]=u,v[11]=l,v[12]=f,v[13]=d,v[14]=g,v[15]=m,v}function Kt(t,e,r,n,i,a,o,s,h,c,u,l,f,d,p,g,m){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=h,t[8]=c,t[9]=u,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=g,t[15]=m,t}function te(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ee(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function re(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],h=e[6],c=e[7],u=e[8],l=e[9],f=e[10],d=e[11],p=e[12],g=e[13],m=e[14],v=e[15],M=r*s-n*o,b=r*h-i*o,y=r*c-a*o,x=n*h-i*s,w=n*c-a*s,S=i*c-a*h,P=u*g-l*p,I=u*m-f*p,_=u*v-d*p,O=l*m-f*g,B=l*v-d*g,A=f*v-d*m,C=M*A-b*B+y*O+x*_-w*I+S*P;return C?(C=1/C,t[0]=(s*A-h*B+c*O)*C,t[1]=(i*B-n*A-a*O)*C,t[2]=(g*S-m*w+v*x)*C,t[3]=(f*w-l*S-d*x)*C,t[4]=(h*_-o*A-c*I)*C,t[5]=(r*A-i*_+a*I)*C,t[6]=(m*y-p*S-v*b)*C,t[7]=(u*S-f*y+d*b)*C,t[8]=(o*B-s*_+c*P)*C,t[9]=(n*_-r*B-a*P)*C,t[10]=(p*w-g*y+v*M)*C,t[11]=(l*y-u*w-d*M)*C,t[12]=(s*I-o*O-h*P)*C,t[13]=(r*O-n*I+i*P)*C,t[14]=(g*b-p*x-m*M)*C,t[15]=(u*x-l*b+f*M)*C,t):null}function ne(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],h=e[6],c=e[7],u=e[8],l=e[9],f=e[10],d=e[11],p=e[12],g=e[13],m=e[14],v=e[15];return t[0]=s*(f*v-d*m)-l*(h*v-c*m)+g*(h*d-c*f),t[1]=-(n*(f*v-d*m)-l*(i*v-a*m)+g*(i*d-a*f)),t[2]=n*(h*v-c*m)-s*(i*v-a*m)+g*(i*c-a*h),t[3]=-(n*(h*d-c*f)-s*(i*d-a*f)+l*(i*c-a*h)),t[4]=-(o*(f*v-d*m)-u*(h*v-c*m)+p*(h*d-c*f)),t[5]=r*(f*v-d*m)-u*(i*v-a*m)+p*(i*d-a*f),t[6]=-(r*(h*v-c*m)-o*(i*v-a*m)+p*(i*c-a*h)),t[7]=r*(h*d-c*f)-o*(i*d-a*f)+u*(i*c-a*h),t[8]=o*(l*v-d*g)-u*(s*v-c*g)+p*(s*d-c*l),t[9]=-(r*(l*v-d*g)-u*(n*v-a*g)+p*(n*d-a*l)),t[10]=r*(s*v-c*g)-o*(n*v-a*g)+p*(n*c-a*s),t[11]=-(r*(s*d-c*l)-o*(n*d-a*l)+u*(n*c-a*s)),t[12]=-(o*(l*m-f*g)-u*(s*m-h*g)+p*(s*f-h*l)),t[13]=r*(l*m-f*g)-u*(n*m-i*g)+p*(n*f-i*l),t[14]=-(r*(s*m-h*g)-o*(n*m-i*g)+p*(n*h-i*s)),t[15]=r*(s*f-h*l)-o*(n*f-i*l)+u*(n*h-i*s),t}function ie(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],h=t[7],c=t[8],u=t[9],l=t[10],f=t[11],d=t[12],p=t[13],g=t[14],m=t[15];return(e*o-r*a)*(l*m-f*g)-(e*s-n*a)*(u*m-f*p)+(e*h-i*a)*(u*g-l*p)+(r*s-n*o)*(c*m-f*d)-(r*h-i*o)*(c*g-l*d)+(n*h-i*s)*(c*p-u*d)}function ae(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],h=e[5],c=e[6],u=e[7],l=e[8],f=e[9],d=e[10],p=e[11],g=e[12],m=e[13],v=e[14],M=e[15],b=r[0],y=r[1],x=r[2],w=r[3];return t[0]=b*n+y*s+x*l+w*g,t[1]=b*i+y*h+x*f+w*m,t[2]=b*a+y*c+x*d+w*v,t[3]=b*o+y*u+x*p+w*M,b=r[4],y=r[5],x=r[6],w=r[7],t[4]=b*n+y*s+x*l+w*g,t[5]=b*i+y*h+x*f+w*m,t[6]=b*a+y*c+x*d+w*v,t[7]=b*o+y*u+x*p+w*M,b=r[8],y=r[9],x=r[10],w=r[11],t[8]=b*n+y*s+x*l+w*g,t[9]=b*i+y*h+x*f+w*m,t[10]=b*a+y*c+x*d+w*v,t[11]=b*o+y*u+x*p+w*M,b=r[12],y=r[13],x=r[14],w=r[15],t[12]=b*n+y*s+x*l+w*g,t[13]=b*i+y*h+x*f+w*m,t[14]=b*a+y*c+x*d+w*v,t[15]=b*o+y*u+x*p+w*M,t}function oe(t,e,r){var n,i,a,o,s,h,c,u,l,f,d,p,g=r[0],m=r[1],v=r[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*v+e[12],t[13]=e[1]*g+e[5]*m+e[9]*v+e[13],t[14]=e[2]*g+e[6]*m+e[10]*v+e[14],t[15]=e[3]*g+e[7]*m+e[11]*v+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],h=e[5],c=e[6],u=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=h,t[6]=c,t[7]=u,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*g+s*m+l*v+e[12],t[13]=i*g+h*m+f*v+e[13],t[14]=a*g+c*m+d*v+e[14],t[15]=o*g+u*m+p*v+e[15]),t}function se(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function he(t,e,r,n){var i,a,o,s,h,c,u,l,f,p,g,m,v,M,b,y,x,w,S,P,I,_,O,B,A=n[0],C=n[1],R=n[2],k=Math.hypot(A,C,R);return k0?(r[0]=2*(s*o+u*n+h*a-c*i)/l,r[1]=2*(h*o+u*i+c*n-s*a)/l,r[2]=2*(c*o+u*a+s*i-h*n)/l):(r[0]=2*(s*o+u*n+h*a-c*i),r[1]=2*(h*o+u*i+c*n-s*a),r[2]=2*(c*o+u*a+s*i-h*n)),Me(t,e,r),t}function ye(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function xe(t,e){var r=e[0],n=e[1],i=e[2],a=e[4],o=e[5],s=e[6],h=e[8],c=e[9],u=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(a,o,s),t[2]=Math.hypot(h,c,u),t}function we(t,e){var r=new p(3);xe(r,e);var n=1/r[0],i=1/r[1],a=1/r[2],o=e[0]*n,s=e[1]*i,h=e[2]*a,c=e[4]*n,u=e[5]*i,l=e[6]*a,f=e[8]*n,d=e[9]*i,g=e[10]*a,m=o+u+g,v=0;return m>0?(v=2*Math.sqrt(m+1),t[3]=.25*v,t[0]=(l-d)/v,t[1]=(f-h)/v,t[2]=(s-c)/v):o>u&&o>g?(v=2*Math.sqrt(1+o-u-g),t[3]=(l-d)/v,t[0]=.25*v,t[1]=(s+c)/v,t[2]=(f+h)/v):u>g?(v=2*Math.sqrt(1+u-o-g),t[3]=(f-h)/v,t[0]=(s+c)/v,t[1]=.25*v,t[2]=(l+d)/v):(v=2*Math.sqrt(1+g-o-u),t[3]=(s-c)/v,t[0]=(f+h)/v,t[1]=(l+d)/v,t[2]=.25*v),t}function Se(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],h=i+i,c=a+a,u=o+o,l=i*h,f=i*c,d=i*u,p=a*c,g=a*u,m=o*u,v=s*h,M=s*c,b=s*u,y=n[0],x=n[1],w=n[2];return t[0]=(1-(p+m))*y,t[1]=(f+b)*y,t[2]=(d-M)*y,t[3]=0,t[4]=(f-b)*x,t[5]=(1-(l+m))*x,t[6]=(g+v)*x,t[7]=0,t[8]=(d+M)*w,t[9]=(g-v)*w,t[10]=(1-(l+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function Pe(t,e,r,n,i){var a=e[0],o=e[1],s=e[2],h=e[3],c=a+a,u=o+o,l=s+s,f=a*c,d=a*u,p=a*l,g=o*u,m=o*l,v=s*l,M=h*c,b=h*u,y=h*l,x=n[0],w=n[1],S=n[2],P=i[0],I=i[1],_=i[2],O=(1-(g+v))*x,B=(d+y)*x,A=(p-b)*x,C=(d-y)*w,R=(1-(f+v))*w,k=(m+M)*w,E=(p+b)*S,F=(m-M)*S,q=(1-(f+g))*S;return t[0]=O,t[1]=B,t[2]=A,t[3]=0,t[4]=C,t[5]=R,t[6]=k,t[7]=0,t[8]=E,t[9]=F,t[10]=q,t[11]=0,t[12]=r[0]+P-(O*P+C*I+E*_),t[13]=r[1]+I-(B*P+R*I+F*_),t[14]=r[2]+_-(A*P+k*I+q*_),t[15]=1,t}function Ie(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,h=i+i,c=r*o,u=n*o,l=n*s,f=i*o,d=i*s,p=i*h,g=a*o,m=a*s,v=a*h;return t[0]=1-l-p,t[1]=u+v,t[2]=f-m,t[3]=0,t[4]=u-v,t[5]=1-c-p,t[6]=d+g,t[7]=0,t[8]=f+m,t[9]=d-g,t[10]=1-c-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function _e(t,e,r,n,i,a,o){var s=1/(r-e),h=1/(i-n),c=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*h,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*h,t[10]=(o+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t}function Oe(t,e,r,n,i){var a,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(a=1/(n-i),t[10]=(i+n)*a,t[14]=2*i*n*a):(t[10]=-1,t[14]=-2*n),t}function Be(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),h=2/(o+s),c=2/(i+a);return t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-s)*h*.5,t[9]=(i-a)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function Ae(t,e,r,n,i,a,o){var s=1/(e-r),h=1/(n-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*h,t[14]=(o+a)*c,t[15]=1,t}function Ce(t,e,r,n){var i,a,o,s,h,c,u,l,f,p,g=e[0],m=e[1],v=e[2],M=n[0],b=n[1],y=n[2],x=r[0],w=r[1],S=r[2];return Math.abs(g-x)0&&(u*=d=1/Math.sqrt(d),l*=d,f*=d);var p=h*f-c*l,g=c*u-s*f,m=s*l-h*u;return(d=p*p+g*g+m*m)>0&&(p*=d=1/Math.sqrt(d),g*=d,m*=d),t[0]=p,t[1]=g,t[2]=m,t[3]=0,t[4]=l*m-f*g,t[5]=f*p-u*m,t[6]=u*g-l*p,t[7]=0,t[8]=u,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=a,t[14]=o,t[15]=1,t}function ke(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Ee(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Fe(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function qe(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function Le(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function Te(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function je(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function De(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],h=t[6],c=t[7],u=t[8],l=t[9],f=t[10],p=t[11],g=t[12],m=t[13],v=t[14],M=t[15],b=e[0],y=e[1],x=e[2],w=e[3],S=e[4],P=e[5],I=e[6],_=e[7],O=e[8],B=e[9],A=e[10],C=e[11],R=e[12],k=e[13],E=e[14],F=e[15];return Math.abs(r-b)<=d*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-y)<=d*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-x)<=d*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-w)<=d*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(o-S)<=d*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(s-P)<=d*Math.max(1,Math.abs(s),Math.abs(P))&&Math.abs(h-I)<=d*Math.max(1,Math.abs(h),Math.abs(I))&&Math.abs(c-_)<=d*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-O)<=d*Math.max(1,Math.abs(u),Math.abs(O))&&Math.abs(l-B)<=d*Math.max(1,Math.abs(l),Math.abs(B))&&Math.abs(f-A)<=d*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(p-C)<=d*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(g-R)<=d*Math.max(1,Math.abs(g),Math.abs(R))&&Math.abs(m-k)<=d*Math.max(1,Math.abs(m),Math.abs(k))&&Math.abs(v-E)<=d*Math.max(1,Math.abs(v),Math.abs(E))&&Math.abs(M-F)<=d*Math.max(1,Math.abs(M),Math.abs(F))}var ze=ae,Ve=qe;function Ue(){var t=new p(3);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ye(t){var e=new p(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function He(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function Ze(t,e,r){var n=new p(3);return n[0]=t,n[1]=e,n[2]=r,n}function Ne(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Xe(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function Ge(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function $e(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function We(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function Qe(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function Je(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Ke(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function tr(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function er(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function rr(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function nr(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function ir(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function ar(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function or(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function sr(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function hr(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function cr(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function ur(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function lr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function fr(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],h=r[2];return t[0]=i*h-a*s,t[1]=a*o-n*h,t[2]=n*s-i*o,t}function dr(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t}function pr(t,e,r,n,i,a){var o=a*a,s=o*(2*a-3)+1,h=o*(a-2)+a,c=o*(a-1),u=o*(3-2*a);return t[0]=e[0]*s+r[0]*h+n[0]*c+i[0]*u,t[1]=e[1]*s+r[1]*h+n[1]*c+i[1]*u,t[2]=e[2]*s+r[2]*h+n[2]*c+i[2]*u,t}function gr(t,e,r,n,i,a){var o=1-a,s=o*o,h=a*a,c=s*o,u=3*a*s,l=3*h*o,f=h*a;return t[0]=e[0]*c+r[0]*u+n[0]*l+i[0]*f,t[1]=e[1]*c+r[1]*u+n[1]*l+i[1]*f,t[2]=e[2]*c+r[2]*u+n[2]*l+i[2]*f,t}function mr(t,e){e=e||1;var r=2*g()*Math.PI,n=2*g()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}function vr(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t}function Mr(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t}function br(t,e,r){var n=r[0],i=r[1],a=r[2],o=r[3],s=e[0],h=e[1],c=e[2],u=i*c-a*h,l=a*s-n*c,f=n*h-i*s,d=i*f-a*l,p=a*u-n*f,g=n*l-i*u,m=2*o;return u*=m,l*=m,f*=m,d*=2,p*=2,g*=2,t[0]=s+u+d,t[1]=h+l+p,t[2]=c+f+g,t}function yr(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t}function xr(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t}function wr(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t}function Sr(t,e){var r=t[0],n=t[1],i=t[2],a=e[0],o=e[1],s=e[2],h=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(a*a+o*o+s*s),c=h&&lr(t,e)/h;return Math.acos(Math.min(Math.max(c,-1),1))}function Pr(t){return t[0]=0,t[1]=0,t[2]=0,t}function Ir(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function _r(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Or(t,e){var r=t[0],n=t[1],i=t[2],a=e[0],o=e[1],s=e[2];return Math.abs(r-a)<=d*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-o)<=d*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=d*Math.max(1,Math.abs(i),Math.abs(s))}var Br,Ar=$e,Cr=We,Rr=Qe,kr=ar,Er=or,Fr=He,qr=sr,Lr=(Br=Ue(),function(t,e,r,n,i,a){var o,s;for(e||(e=3),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,o=r;o0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o,t}function sn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function hn(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],a=r[0]*n[2]-r[2]*n[0],o=r[0]*n[3]-r[3]*n[0],s=r[1]*n[2]-r[2]*n[1],h=r[1]*n[3]-r[3]*n[1],c=r[2]*n[3]-r[3]*n[2],u=e[0],l=e[1],f=e[2],d=e[3];return t[0]=l*c-f*h+d*s,t[1]=-u*c+f*o-d*a,t[2]=u*h-l*o+d*i,t[3]=-u*s+l*a-f*i,t}function cn(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}function un(t,e){var r,n,i,a,o,s;e=e||1;do{o=(r=2*g()-1)*r+(n=2*g()-1)*n}while(o>=1);do{s=(i=2*g()-1)*i+(a=2*g()-1)*a}while(s>=1);var h=Math.sqrt((1-o)/s);return t[0]=e*r,t[1]=e*n,t[2]=e*i*h,t[3]=e*a*h,t}function ln(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}function fn(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],h=r[2],c=r[3],u=c*n+s*a-h*i,l=c*i+h*n-o*a,f=c*a+o*i-s*n,d=-o*n-s*i-h*a;return t[0]=u*c+d*-o+l*-h-f*-s,t[1]=l*c+d*-s+f*-o-u*-h,t[2]=f*c+d*-h+u*-s-l*-o,t[3]=e[3],t}function dn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function pn(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function gn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function mn(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],h=e[2],c=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-h)<=d*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-c)<=d*Math.max(1,Math.abs(a),Math.abs(c))}var vn=Yr,Mn=Hr,bn=Zr,yn=Kr,xn=tn,wn=en,Sn=rn,Pn=function(){var t=Tr();return function(e,r,n,i,a,o){var s,h;for(r||(r=4),n||(n=0),h=i?Math.min(i*r+n,e.length):e.length,s=n;sd?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r}function An(t,e){var r=ii(t,e);return Math.acos(2*r*r-1)}function Cn(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],h=r[1],c=r[2],u=r[3];return t[0]=n*u+o*s+i*c-a*h,t[1]=i*u+o*h+a*s-n*c,t[2]=a*u+o*c+n*h-i*s,t[3]=o*u-n*s-i*h-a*c,t}function Rn(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),h=Math.cos(r);return t[0]=n*h+o*s,t[1]=i*h+a*s,t[2]=a*h-i*s,t[3]=o*h-n*s,t}function kn(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),h=Math.cos(r);return t[0]=n*h-a*s,t[1]=i*h+o*s,t[2]=a*h+n*s,t[3]=o*h-i*s,t}function En(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),h=Math.cos(r);return t[0]=n*h+i*s,t[1]=i*h-n*s,t[2]=a*h+o*s,t[3]=o*h-a*s,t}function Fn(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function qn(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=Math.sqrt(r*r+n*n+i*i),s=Math.exp(a),h=o>0?s*Math.sin(o)/o:0;return t[0]=r*h,t[1]=n*h,t[2]=i*h,t[3]=s*Math.cos(o),t}function Ln(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=Math.sqrt(r*r+n*n+i*i),s=o>0?Math.atan2(o,a)/o:0;return t[0]=r*s,t[1]=n*s,t[2]=i*s,t[3]=.5*Math.log(r*r+n*n+i*i+a*a),t}function Tn(t,e,r){return Ln(t,e),ni(t,t,r),qn(t,t),t}function jn(t,e,r,n){var i,a,o,s,h,c=e[0],u=e[1],l=e[2],f=e[3],p=r[0],g=r[1],m=r[2],v=r[3];return(a=c*p+u*g+l*m+f*v)<0&&(a=-a,p=-p,g=-g,m=-m,v=-v),1-a>d?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,h=Math.sin(n*i)/o):(s=1-n,h=n),t[0]=s*c+h*p,t[1]=s*u+h*g,t[2]=s*l+h*m,t[3]=s*f+h*v,t}function Dn(t){var e=g(),r=g(),n=g(),i=Math.sqrt(1-e),a=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*r),t[1]=i*Math.cos(2*Math.PI*r),t[2]=a*Math.sin(2*Math.PI*n),t[3]=a*Math.cos(2*Math.PI*n),t}function zn(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=a*s,t}function Vn(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Un(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*a+o]-e[3*o+a])*r,t[a]=(e[3*a+i]+e[3*i+a])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t}function Yn(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var a=Math.sin(e),o=Math.cos(e),s=Math.sin(r),h=Math.cos(r),c=Math.sin(n),u=Math.cos(n);return t[0]=a*h*u-o*s*c,t[1]=o*s*u+a*h*c,t[2]=o*h*c-a*s*u,t[3]=o*h*u+a*s*c,t}function Hn(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var Zn,Nn,Xn,Gn,$n,Wn,Qn=jr,Jn=Dr,Kn=zr,ti=Vr,ei=Ur,ri=Cn,ni=Qr,ii=sn,ai=cn,oi=en,si=oi,hi=rn,ci=hi,ui=on,li=gn,fi=mn,di=(Zn=Ue(),Nn=Ze(1,0,0),Xn=Ze(0,1,0),function(t,e,r){var n=lr(e,r);return n<-.999999?(fr(Zn,Nn,e),Fr(Zn)<1e-6&&fr(Zn,Xn,e),ur(Zn,Zn),On(t,Zn,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(fr(Zn,e,r),t[0]=Zn[0],t[1]=Zn[1],t[2]=Zn[2],t[3]=1+n,ui(t,t))}),pi=(Gn=In(),$n=In(),function(t,e,r,n,i,a){return jn(Gn,e,i,a),jn($n,r,n,a),jn(t,Gn,$n,2*a*(1-a)),t}),gi=(Wn=vt(),function(t,e,r,n){return Wn[0]=r[0],Wn[3]=r[1],Wn[6]=r[2],Wn[1]=n[0],Wn[4]=n[1],Wn[7]=n[2],Wn[2]=-e[0],Wn[5]=-e[1],Wn[8]=-e[2],ui(t,Un(t,Wn))});function mi(){var t=new p(8);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function vi(t){var e=new p(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function Mi(t,e,r,n,i,a,o,s){var h=new p(8);return h[0]=t,h[1]=e,h[2]=r,h[3]=n,h[4]=i,h[5]=a,h[6]=o,h[7]=s,h}function bi(t,e,r,n,i,a,o){var s=new p(8);s[0]=t,s[1]=e,s[2]=r,s[3]=n;var h=.5*i,c=.5*a,u=.5*o;return s[4]=h*n+c*r-u*e,s[5]=c*n+u*t-h*r,s[6]=u*n+h*e-c*t,s[7]=-h*t-c*e-u*r,s}function yi(t,e,r){var n=.5*r[0],i=.5*r[1],a=.5*r[2],o=e[0],s=e[1],h=e[2],c=e[3];return t[0]=o,t[1]=s,t[2]=h,t[3]=c,t[4]=n*c+i*h-a*s,t[5]=i*c+a*o-n*h,t[6]=a*c+n*s-i*o,t[7]=-n*o-i*s-a*h,t}function xi(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function wi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Si(t,e){var r=In();we(r,e);var n=new p(3);return ye(n,e),yi(t,r,n),t}function Pi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function Ii(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function _i(t,e,r,n,i,a,o,s,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=h,t}var Oi=Kn;function Bi(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var Ai=Kn;function Ci(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function Ri(t,e){var r=e[4],n=e[5],i=e[6],a=e[7],o=-e[0],s=-e[1],h=-e[2],c=e[3];return t[0]=2*(r*c+a*o+n*h-i*s),t[1]=2*(n*c+a*s+i*o-r*h),t[2]=2*(i*c+a*h+r*s-n*o),t}function ki(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=.5*r[0],h=.5*r[1],c=.5*r[2],u=e[4],l=e[5],f=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=o*s+i*c-a*h+u,t[5]=o*h+a*s-n*c+l,t[6]=o*c+n*h-i*s+f,t[7]=-n*s-i*h-a*c+d,t}function Ei(t,e,r){var n=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],h=e[5],c=e[6],u=e[7],l=s*o+u*n+h*a-c*i,f=h*o+u*i+c*n-s*a,d=c*o+u*a+s*i-h*n,p=u*o-s*n-h*i-c*a;return Rn(t,e,r),n=t[0],i=t[1],a=t[2],o=t[3],t[4]=l*o+p*n+f*a-d*i,t[5]=f*o+p*i+d*n-l*a,t[6]=d*o+p*a+l*i-f*n,t[7]=p*o-l*n-f*i-d*a,t}function Fi(t,e,r){var n=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],h=e[5],c=e[6],u=e[7],l=s*o+u*n+h*a-c*i,f=h*o+u*i+c*n-s*a,d=c*o+u*a+s*i-h*n,p=u*o-s*n-h*i-c*a;return kn(t,e,r),n=t[0],i=t[1],a=t[2],o=t[3],t[4]=l*o+p*n+f*a-d*i,t[5]=f*o+p*i+d*n-l*a,t[6]=d*o+p*a+l*i-f*n,t[7]=p*o-l*n-f*i-d*a,t}function qi(t,e,r){var n=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],h=e[5],c=e[6],u=e[7],l=s*o+u*n+h*a-c*i,f=h*o+u*i+c*n-s*a,d=c*o+u*a+s*i-h*n,p=u*o-s*n-h*i-c*a;return En(t,e,r),n=t[0],i=t[1],a=t[2],o=t[3],t[4]=l*o+p*n+f*a-d*i,t[5]=f*o+p*i+d*n-l*a,t[6]=d*o+p*a+l*i-f*n,t[7]=p*o-l*n-f*i-d*a,t}function Li(t,e,r){var n=r[0],i=r[1],a=r[2],o=r[3],s=e[0],h=e[1],c=e[2],u=e[3];return t[0]=s*o+u*n+h*a-c*i,t[1]=h*o+u*i+c*n-s*a,t[2]=c*o+u*a+s*i-h*n,t[3]=u*o-s*n-h*i-c*a,s=e[4],h=e[5],c=e[6],u=e[7],t[4]=s*o+u*n+h*a-c*i,t[5]=h*o+u*i+c*n-s*a,t[6]=c*o+u*a+s*i-h*n,t[7]=u*o-s*n-h*i-c*a,t}function Ti(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],h=r[1],c=r[2],u=r[3];return t[0]=n*u+o*s+i*c-a*h,t[1]=i*u+o*h+a*s-n*c,t[2]=a*u+o*c+n*h-i*s,t[3]=o*u-n*s-i*h-a*c,s=r[4],h=r[5],c=r[6],u=r[7],t[4]=n*u+o*s+i*c-a*h,t[5]=i*u+o*h+a*s-n*c,t[6]=a*u+o*c+n*h-i*s,t[7]=o*u-n*s-i*h-a*c,t}function ji(t,e,r,n){if(Math.abs(n)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,a=e[2]/r,o=e[3]/r,s=e[4],h=e[5],c=e[6],u=e[7],l=n*s+i*h+a*c+o*u;t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=(s-n*l)/r,t[5]=(h-i*l)/r,t[6]=(c-a*l)/r,t[7]=(u-o*l)/r}return t}function Ji(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function Ki(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function ta(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],h=t[6],c=t[7],u=e[0],l=e[1],f=e[2],p=e[3],g=e[4],m=e[5],v=e[6],M=e[7];return Math.abs(r-u)<=d*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-l)<=d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-f)<=d*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(a-p)<=d*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(o-g)<=d*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(s-m)<=d*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(h-v)<=d*Math.max(1,Math.abs(h),Math.abs(v))&&Math.abs(c-M)<=d*Math.max(1,Math.abs(c),Math.abs(M))}function ea(){var t=new p(2);return p!=Float32Array&&(t[0]=0,t[1]=0),t}function ra(t){var e=new p(2);return e[0]=t[0],e[1]=t[1],e}function na(t,e){var r=new p(2);return r[0]=t,r[1]=e,r}function ia(t,e){return t[0]=e[0],t[1]=e[1],t}function aa(t,e,r){return t[0]=e,t[1]=r,t}function oa(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function sa(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function ha(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function ca(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function ua(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function la(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function fa(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function da(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function pa(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function ga(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function ma(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function va(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function Ma(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function ba(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function ya(t){var e=t[0],r=t[1];return e*e+r*r}function xa(t,e){return t[0]=-e[0],t[1]=-e[1],t}function wa(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function Sa(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function Pa(t,e){return t[0]*e[0]+t[1]*e[1]}function Ia(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function _a(t,e,r,n){var i=e[0],a=e[1];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t}function Oa(t,e){e=e||1;var r=2*g()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function Ba(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function Aa(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function Ca(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function Ra(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function ka(t,e,r,n){var i=e[0]-r[0],a=e[1]-r[1],o=Math.sin(n),s=Math.cos(n);return t[0]=i*s-a*o+r[0],t[1]=i*o+a*s+r[1],t}function Ea(t,e){var r=t[0],n=t[1],i=e[0],a=e[1],o=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+a*a),s=o&&(r*i+n*a)/o;return Math.acos(Math.min(Math.max(s,-1),1))}function Fa(t){return t[0]=0,t[1]=0,t}function qa(t){return"vec2("+t[0]+", "+t[1]+")"}function La(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ta(t,e){var r=t[0],n=t[1],i=e[0],a=e[1];return Math.abs(r-i)<=d*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))}var ja=ba,Da=sa,za=ha,Va=ca,Ua=va,Ya=Ma,Ha=ya,Za=function(){var t=ea();return function(e,r,n,i,a,o){var s,h;for(r||(r=2),n||(n=0),h=i?Math.min(i*r+n,e.length):e.length,s=n;s{var n;!function(){var i=.5*(Math.sqrt(3)-1),a=(3-Math.sqrt(3))/6,o=1/6,s=(Math.sqrt(5)-1)/4,h=(5-Math.sqrt(5))/20;function c(t){var e;e="function"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=l();t=i(" "),e=i(" "),r=i(" ");for(var a=0;a>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}c.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,o=this.permMod12,s=this.perm,h=this.grad3,c=0,u=0,l=0,f=(t+e)*i,d=Math.floor(t+f),p=Math.floor(e+f),g=(d+p)*a,m=t-(d-g),v=e-(p-g);m>v?(r=1,n=0):(r=0,n=1);var M=m-r+a,b=v-n+a,y=m-1+2*a,x=v-1+2*a,w=255&d,S=255&p,P=.5-m*m-v*v;if(P>=0){var I=3*o[w+s[S]];c=(P*=P)*P*(h[I]*m+h[I+1]*v)}var _=.5-M*M-b*b;if(_>=0){var O=3*o[w+r+s[S+n]];u=(_*=_)*_*(h[O]*M+h[O+1]*b)}var B=.5-y*y-x*x;if(B>=0){var A=3*o[w+1+s[S+1]];l=(B*=B)*B*(h[A]*y+h[A+1]*x)}return 70*(c+u+l)},noise3D:function(t,e,r){var n,i,a,s,h,c,u,l,f,d,p=this.permMod12,g=this.perm,m=this.grad3,v=.3333333333333333*(t+e+r),M=Math.floor(t+v),b=Math.floor(e+v),y=Math.floor(r+v),x=(M+b+y)*o,w=t-(M-x),S=e-(b-x),P=r-(y-x);w>=S?S>=P?(h=1,c=0,u=0,l=1,f=1,d=0):w>=P?(h=1,c=0,u=0,l=1,f=0,d=1):(h=0,c=0,u=1,l=1,f=0,d=1):Sk?q++:L++,R>E?q++:T++,R>F?q++:j++,k>E?L++:T++,k>F?L++:j++,E>F?T++:j++;var D=R-(l=q>=3?1:0)+h,z=k-(f=L>=3?1:0)+h,V=E-(d=T>=3?1:0)+h,U=F-(p=j>=3?1:0)+h,Y=R-(g=q>=2?1:0)+2*h,H=k-(m=L>=2?1:0)+2*h,Z=E-(v=T>=2?1:0)+2*h,N=F-(M=j>=2?1:0)+2*h,X=R-(b=q>=1?1:0)+3*h,G=k-(y=L>=1?1:0)+3*h,$=E-(x=T>=1?1:0)+3*h,W=F-(w=j>=1?1:0)+3*h,Q=R-1+4*h,J=k-1+4*h,K=E-1+4*h,tt=F-1+4*h,et=255&_,rt=255&O,nt=255&B,it=255&A,at=.6-R*R-k*k-E*E-F*F;if(at<0)i=0;else{var ot=S[et+S[rt+S[nt+S[it]]]]%32*4;i=(at*=at)*at*(P[ot]*R+P[ot+1]*k+P[ot+2]*E+P[ot+3]*F)}var st=.6-D*D-z*z-V*V-U*U;if(st<0)a=0;else{var ht=S[et+l+S[rt+f+S[nt+d+S[it+p]]]]%32*4;a=(st*=st)*st*(P[ht]*D+P[ht+1]*z+P[ht+2]*V+P[ht+3]*U)}var ct=.6-Y*Y-H*H-Z*Z-N*N;if(ct<0)o=0;else{var ut=S[et+g+S[rt+m+S[nt+v+S[it+M]]]]%32*4;o=(ct*=ct)*ct*(P[ut]*Y+P[ut+1]*H+P[ut+2]*Z+P[ut+3]*N)}var lt=.6-X*X-G*G-$*$-W*W;if(lt<0)c=0;else{var ft=S[et+b+S[rt+y+S[nt+x+S[it+w]]]]%32*4;c=(lt*=lt)*lt*(P[ft]*X+P[ft+1]*G+P[ft+2]*$+P[ft+3]*W)}var dt=.6-Q*Q-J*J-K*K-tt*tt;if(dt<0)u=0;else{var pt=S[et+1+S[rt+1+S[nt+1+S[it+1]]]]%32*4;u=(dt*=dt)*dt*(P[pt]*Q+P[pt+1]*J+P[pt+2]*K+P[pt+3]*tt)}return 27*(i+a+o+c+u)}},c._buildPermutationTable=u,void 0===(n=function(){return c}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=c,t.exports=c}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n].call(a.exports,a,a.exports,r),a.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{r.d(n,{p:()=>t,Z:()=>a});var t={};r.r(t),r.d(t,{Animation:()=>e,DrawerCanvas:()=>i.T}),r(1714);var e=r(7518),i=r(2251);const a=t})();var i=n.p,a=n.Z;export{i as Urpflanze,a as default}; \ No newline at end of file +var t={2894:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.UncontrolledLoop=e.Static=e.Loop=e.Compose=e.Simple=e.resolveSimpleAnimation=void 0;const n=r(4825),i=r(2765);function a(t){const e=i.createAnimation(t);if(e)return t=>{var r;const n="number"==typeof t?t:(null===(r=t.shape.scene)||void 0===r?void 0:r.currentTime)||0;return e.update(n),e.value}}e.resolveSimpleAnimation=a,e.Simple=a,e.Compose=t=>{const e=n.composeAnimations(t);if(e)return t=>{var r;const n="number"==typeof t?t:(null===(r=t.shape.scene)||void 0===r?void 0:r.currentTime)||0;return e(n)}},e.Loop=t=>{const e=t;return void 0===e.interpolator&&(e.interpolator="wave"),e.interpolator&&("string"==typeof e.interpolator?"wave"!==e.interpolator&&(e.direction="alternate"):"object"==typeof e.interpolator&&"wave"!==e.interpolator.type&&(e.direction="alternate")),e.loop=!0,a(e)},e.Static=t=>{const e=t;return e.direction="normal",e.loop=!1,a(e)},e.UncontrolledLoop=t=>{const e=t;return e.direction="normal",e.loop=!0,a(e)}},9727:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=void 0;const r={linear:(t,e,r,n=1)=>r*t/n+e,quadraticIn:(t,e,r,n=1)=>r*(t/=n)*t+e,quadraticOut:(t,e,r,n=1)=>-r*(t/=n)*(t-2)+e,quadraticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t+e:-r/2*(--t*(t-2)-1)+e,cubicIn:(t,e,r,n=1)=>r*(t/=n)*t*t+e,cubicOut:(t,e,r,n=1)=>(t/=n,r*(--t*t*t+1)+e),cubicInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t+e:r/2*((t-=2)*t*t+2)+e,quarticIn:(t,e,r,n=1)=>r*(t/=n)*t*t*t+e,quarticOut:(t,e,r,n=1)=>(t/=n,-r*(--t*t*t*t-1)+e),quarticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t*t+e:-r/2*((t-=2)*t*t*t-2)+e,quinticIn:(t,e,r,n=1)=>r*(t/=n)*t*t*t*t+e,quinticOut:(t,e,r,n=1)=>(t/=n,r*(--t*t*t*t*t+1)+e),quinticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t*t*t+e:r/2*((t-=2)*t*t*t*t+2)+e,sinusoidalIn:(t,e,r,n=1)=>-r*Math.cos(t/n*(Math.PI/2))+r+e,sinusoidalOut:(t,e,r,n=1)=>r*Math.sin(t/n*(Math.PI/2))+e,sinusoidalInOut:(t,e,r,n=1)=>-r/2*(Math.cos(Math.PI*t/n)-1)+e,exponentialIn:(t,e,r,n=1)=>r*Math.pow(2,10*(t/n-1))+e,exponentialOut:(t,e,r,n=1)=>r*(1-Math.pow(2,-10*t/n))+e,exponentialInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*Math.pow(2,10*(t-1))+e:(t--,r/2*(2-Math.pow(2,-10*t))+e),circularIn:(t,e,r,n=1)=>(t/=n,-r*(Math.sqrt(1-t*t)-1)+e),circularOut:(t,e,r,n=1)=>(t/=n,t--,r*Math.sqrt(1-t*t)+e),circularInOut:(t,e,r,n=1)=>(t/=n/2)<1?-r/2*(Math.sqrt(1-t*t)-1)+e:(t-=2,r/2*(Math.sqrt(1-t*t)+1)+e),elasticIn:(t,e,r,n=1,i=1,a=.5)=>{if(0===t)return e;if(1==(t/=n))return e+r;a*=n;let o=0;return i{if(0===t)return e;if(1==(t/=n))return e+r;a*=n;let o=0;return i{if(0===t)return e;if(2==(t/=n/2))return e+r;a*=n;let o=0;return ir*(t/=n)*t*((i+1)*t-i)+e,backOut:(t,e,r,n=1,i=1.70158)=>r*((t=t/n-1)*t*((i+1)*t+i)+1)+e,backInOut:(t,e,r,n=1,i=1.70158)=>(t/=n/2)<1?r/2*(t*t*((1+(i*=1.525))*t-i))+e:r/2*((t-=2)*t*((1+(i*=1.525))*t+i)+2)+e,bounceIn:(t,e,n,i=1)=>n-r.bounceOut(i-t,0,n,i)+e,bounceOut:(t,e,r,n=1)=>(t/=n)<1/2.75?r*(7.5625*t*t)+e:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+e:r*(7.5625*(t-=2.625/2.75)*t+.984375)+e,bounceInOut:(t,e,n,i=1)=>t{Object.defineProperty(e,"__esModule",{value:!0}),e.composeAnimations=void 0;const n=r(7358),i=r(2765),a=r(8782);function o(t,e,r=.5){const i=Array.isArray(t)?t:[t],o=Array.isArray(e)?e:[e],s=[];for(let t=0,e=i.length;tvoid 0!==t)),r=e.length;if(r>0)return t=>{let n;for(let i=0;i{Object.defineProperty(e,"__esModule",{value:!0}),e.createAnimation=void 0;const n=r(9298);e.createAnimation=function(t){const e=n.createInterpolationCallback(t);if(void 0===e)return;const r=t.delay||0,i=t.afterDelay||0,a=t.direction||"normal",o=t.duration||1e3,s="normal"===a||"reverse"===a?o+r:2*o+r+i,h={delay:r,afterDelay:i,direction:a,duration:o,totalDuration:s,loop:"number"==typeof t.loop?t.loop:!!t.loop},c=n.createInterpolator(t.interpolator),u={loop:0,offset:0,loopDuration:s,direction:"alternate"===a?"normal":a,started:!1,ended:!1,value:void 0};return u.update=function(t,e,r,n){const{loop:i,totalDuration:a,delay:o,afterDelay:s,direction:h,duration:c}=e;return u=>{if("number"==typeof i&&u>=a*i||!1===i&&u>=e.totalDuration)return t.started=!1,t.ended=!0,t.offset=r("normal"===h?c:0,c),void(t.value=n(t.offset));if(t.loop=Math.ceil(u/a),u%=a,(u-=o)<=0)return t.started=!1,t.offset=r(0,c),void(t.value=n(t.offset));if(t.started=!0,"alternate"===h)u<=c?(t.direction="normal",t.offset=r(u,c)):(t.direction="reverse",u-=c,(u-=s)>=0?t.offset=1-r(u>=c?c:u,c):t.offset=1);else{const e=r(u>=c?c:u,c);t.offset="normal"===h?e:1-e}t.value=n(t.offset)}}(u,h,c,e),u}},9298:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createInterpolator=e.createInterpolationCallback=void 0;const n=r(7358),i=r(3431),a=r(9727),o=r(8782);e.createInterpolationCallback=function(t){const e=Array.isArray(t.from)?t.from:[t.from],r=Array.isArray(t.to)?t.to:[t.to],i=t.round,a="hue"===t.colorTransitionMode?o.interpolateColorHSL:o.interpolateColorRGB;if(e.length!==r.length)return;const s=[];for(let t=0,o=e.length;t1===t?a:0===t?n:Math.round((n+t*(a-n))*i)/i:t=>1===t?a:0===t?n:n+t*(a-n))}else{const i=e[t],o=r[t],h=n.parseColorAndConvert(i),c=n.parseColorAndConvert(o);void 0!==h&&void 0!==c&&s.push((t=>1===t?o:0===t?i:a(h,c,t)))}}return t=>{const e=s.map((e=>e(t)));return 1===e.length?e[0]:e}},e.createInterpolator=function(t){var e,r;switch(typeof t){case"function":return(e,r)=>t(e/r,e);case"string":switch(t){case"wave":return(t,e)=>.5+.5*Math.sin(t*Math.PI*2/e+1.5*Math.PI);default:if(t in a.Easings){const e=a.Easings[t];return(t,r)=>e(t,0,1,r)}return(t,e)=>a.Easings.linear(t,0,1,e)}case"object":switch(t.type){case"wave":{const r=1.5*Math.PI+((null===(e=t.params)||void 0===e?void 0:e.phase)||0);return(t,e)=>.5+.5*Math.sin(t*Math.PI*2/e+r)}case"elasticIn":case"elasticOut":case"elasticInOut":{const e=a.Easings[t.type],{amplitude:r,period:n}=t.params||{};return(t,i)=>e(t,0,1,i,r,n)}case"backIn":case"backOut":case"backInOut":{const e=a.Easings[t.type],n=(null===(r=t.params)||void 0===r?void 0:r.overshoot)||void 0;return(t,r)=>e(t,0,1,r,n)}case"cubicBezier":{const e=i.default(t.params[0],t.params[1],t.params[2],t.params[3]);return(t,r)=>e(t/r)}}}return(t,e)=>a.Easings.linear(t,0,1,e)}},7518:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(5240),e),i(r(8782),e),i(r(2765),e),i(r(9298),e),i(r(9727),e),i(r(2894),e)},5240:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},8782:(t,e)=>{function r(t,e,r=!0,n="alternate",i=0,a=0){const o="normal"===n||"reverse"===n?e+i:2*e+i+a;return"number"==typeof r&&t>=o*r||!1===r&&t>=o?"normal"===n?e:0:(t%=o,(t-=i)<=0?0:"alternate"===n?t<=e?t:(t-=e,(t-=a)>=0?e-(t>=e?e:t):e):t>=e?e:t)}Object.defineProperty(e,"__esModule",{value:!0}),e.interpolateColorHSL=e.interpolateColorRGB=e.cosp=e.sinp=e.clockOffset=e.clock=void 0,e.clock=r,e.clockOffset=function(t,e,n=!0,i="alternate",a=0,o=0){return r(t,e,n,i,a,o)/e};const n=2*Math.PI;e.sinp=function(t,e,r=0,i=!1){const a=Math.sin(t*n/e+r);return i?.5+.5*a:a},e.cosp=function(t,e,r=0,i=!1){const a=Math.cos(t*n/e+r);return i?.5+.5*a:a},e.interpolateColorRGB=function(t,e,r){const n=t.r+r*(e.r-t.r),i=t.g+r*(e.g-t.g),a=t.b+r*(e.b-t.b),o=t.alpha+r*(e.alpha-t.alpha);return`rgba(${Math.floor(n)},${Math.floor(i)},${Math.floor(a)},${o})`},e.interpolateColorHSL=function(t,e,r){return`hsla(${t.h+r*(e.h-t.h)},${t.s+r*(e.s-t.s)}%,${t.l+r*(e.l-t.l)}%,${t.alpha+r*(e.alpha-t.alpha)})`}},814:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.rgbToHsl=e.hslToRgb=e.rgbToHex=void 0,e.rgbToHex=function(t,e,r){return`#${((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}`},e.hslToRgb=function(t,e,r){let n,i,a;if(t/=360,r/=100,0==(e/=100))n=i=a=r;else{const o=(t,e,r)=>(r+=r<0?1:r>1?-1:0)<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,s=r<.5?r*(1+e):r+e-r*e,h=2*r-s;n=o(h,s,t+1/3),i=o(h,s,t),a=o(h,s,t-1/3)}return[.5+255*n<<0,.5+255*i<<0,.5+255*a<<0]},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;const n=Math.max(t,e,r),i=Math.min(t,e,r),a=(n+i)/2;let o,s;if(n===i)o=s=0;else{const h=n-i;switch(s=a>.5?h/(2-n-i):h/(n+i),n){case t:o=(e-r)/h+(e{Object.defineProperty(e,"__esModule",{value:!0}),e.default={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",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",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",rebeccapurple:"#663399",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",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},7358:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(6097),e),i(r(814),e),i(r(5576),e)},5576:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.parseColorAndConvert=void 0;const n=r(4947),i=r(814);function a(t){if("number"==typeof t)return t>16777215?{type:"rgb",a:t>>24&255,b:t>>16&255,c:t>>8&255,alpha:(255&t)/255}:{type:"rgb",a:t>>16&255,b:t>>8&255,c:255&t,alpha:1};t=t.replace(/\s/g,""),n.default[t]&&(t=n.default[t]);let e=/^#([0-9a-f]{3,8})$/i.exec(t);if(e){const t=e[1];return 3===t.length?{type:"rgb",a:parseInt(t[0]+t[0],16),b:parseInt(t[1]+t[1],16),c:parseInt(t[2]+t[2],16),alpha:1}:{type:"rgb",a:parseInt(t[0]+t[1],16),b:parseInt(t[2]+t[3],16),c:parseInt(t[4]+t[5],16),alpha:t.length>6?parseInt(t.substring(6),16)/255:1}}if(e=/^((hsl|rgb)a?)\((\d+),(\d+)%?,(\d+)%?,?(.+)?\)$/i.exec(t),e){const[,,t,r,n,i,a]=e;return{type:t,a:+r,b:+n,c:+i,alpha:a?+a:1}}}e.parseColorAndConvert=function(t){const e=a(t);if(e){if("hsl"===e.type){const[t,r,n]=i.hslToRgb(e.a,e.b,e.c);return{r:t,g:r,b:n,h:e.a,s:e.b,l:e.c,alpha:e.alpha}}{const[t,r,n]=i.rgbToHsl(e.a,e.b,e.c);return{h:t,s:r,l:n,r:e.a,g:e.b,b:e.c,alpha:e.alpha}}}},e.parseColor=a},6097:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2513:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Group=void 0;const n=r(1378),i=r(541),a=r(2648),o=r(5511);class s extends i.SceneChild{constructor(t={}){t.type="Group",super(t),this.children=[],["id","name","data","order","type"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=o.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){"object"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=s},1378:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Scene=void 0;const n=r(541),i=r(2513),a=r(6448),o=r(313);class s{constructor(t={}){this.width=400,this.height=400,this.background="hsla(0, 0%, 0%, 1)",this.color="hsla(0, 0%, 100%, 1)",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?(.5+.5*o.clamp(-1,1,t.anchor[0]))*this.width:"left"===t.anchor[0]?0:"right"===t.anchor[0]?this.width:this.center[0],"number"==typeof t.anchor[1]?(.5+.5*o.clamp(-1,1,t.anchor[1]))*this.height:"top"===t.anchor[1]?0:"bottom"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e="number"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,s.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{s.propagateToChilden(t,e)})):t instanceof a.Shape&&t.shape&&(t.shape.scene=e,s.propagateToChilden(t.shape,e))}}e.Scene=s},541:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||"SceneChild",this.name=t.name||this.type+"_"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){"string"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},313:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(21),i=r(2769),a=r(795),o="undefined"!=typeof performance?performance:Date;function s(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return o.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=s,e.relativeClamp=function(t,e,r,n,i){return s(n,i,(r-t)/(e-t)*(i-n)+n)};const h={random:new n(Math.random)};e.noise=function(t="random",e=0,r=0,i=0){return void 0===h[t]&&(h[t]=new n(t)),h[t].noise3D(e,r,i)};const c={};function u(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),a=rn?[a,o]:[o,a]}function l(t,e){const r=t.length,n=r/2,i=2*(n+e),a=n-1;if(a>1){const n=r-2,o=Math.floor(e/a);let s=(i-(r+o*n))/2;const h=Math.round(a/s),c=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%h==0||e===n-2),p=o+(d?1:0),g=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);c[i]=(a=t(),o=t(),s=t(),h=t(),function(){let t=(a>>>=0)+(o>>>=0)|0;return a=o^o>>>9,o=(s>>>=0)+(s<<3)|0,t=t+(h=1+(h>>>=0)|0)|0,s=(s=s<<21|s>>>11)+t|0,(t>>>0)/4294967296})}var a,o,s,h;const u=e+c[i]()*(r-e);return void 0!==n?Math.round(u*10**n)/10**n:u},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return a.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=u,e.interpolate=function(t,e,r=.5){const[n,i]=u(t,e),a=Math.max(n.length,i.length),o="number"==typeof r?[r]:r,s=a/2;if(o.length!==s){const t=o.length;for(let e=0;e{Object.defineProperty(e,"__esModule",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return"number"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},8721:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(887);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},3792:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},5511:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(9958);var i;!function(t){t[t.None=0]="None",t[t.Scale=2]="Scale",t[t.Center=4]="Center",t[t.Fill=8]="Fill"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn("[Urplfanze:Bounding] cannot sum bounding")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn("[Urplfanze:Bounding] cannot bind bounding")}};class a extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return a.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=a.getBounding(t));const o=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,s=e>=i.Center?r.cx:0,h=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{Object.defineProperty(e,"__esModule",{value:!0}),e.Close=void 0;const n=r(9958);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},1740:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Mirror=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let a=0;a{Object.defineProperty(e,"__esModule",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},3315:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Offset=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i},4660:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Smooth=void 0;const n=r(313),i=r(8301),a=r(9958);class o extends a.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Solidify=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const a=[],o=(e="number"==typeof e?[e]:e).length;let s,h,c=[[0,0],[0,0]],u=[[0,0],[0,0]];for(let r=0,l=0,f=t.length-2;r{Object.defineProperty(e,"__esModule",{value:!0}),e.Subdivide=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{e.q=void 0;const n=r(5511),i=r(1740),a=r(4660),o=r(5838),s=r(5588),h=r(8301),c=r(3315),u={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:a.Smooth,Solidify:o.Solidify,Subdivide:s.Subdivide,Close:h.Close,Offset:c.Offset};e.q=u},6448:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=void 0;const n=r(1378),i=r(541),a=r(2648);class o extends a.ShapeBase{constructor(t){t.type=t.type||"Shape",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn("[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\nYou passed:",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):o.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBase=void 0;const n=r(887),i=r(3757),a=r(8721),o=r(795),s=r(3792),h=r(5511),c=r(313),u=r(541),l=n.mat4.create(),f=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class g extends u.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?-1*c.clamp(-1,1,t.anchor[0]):"left"===t.anchor[0]?1:"right"===t.anchor[0]?-1:0,"number"==typeof t.anchor[1]?-1*c.clamp(-1,1,t.anchor[1]):"top"===t.anchor[1]?1:"bottom"===t.anchor[1]?-1:0]:[0,0],this.boundingType="string"==typeof t.boundingType?"relative"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return"function"!=typeof t.repetitions&&"function"!=typeof t.distance&&"function"!=typeof t.displace&&"function"!=typeof t.scale&&"function"!=typeof t.translate&&"function"!=typeof t.skewX&&"function"!=typeof t.skewY&&"function"!=typeof t.squeezeX&&"function"!=typeof t.squeezeY&&"function"!=typeof t.rotateX&&"function"!=typeof t.rotateY&&"function"!=typeof t.rotateZ&&"function"!=typeof t.transformOrigin&&"function"!=typeof t.perspective&&"function"!=typeof t.perspectiveOrigin}isStaticIndexed(){return"function"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return"function"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){"string"==typeof t?(r=r||"repetitions"==t,this.props[t]=e):(r=r||"repetitions"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var u,m;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const v=g.getEmptyPropArguments(this,r),M=v.repetition,b=this.getProp("repetitions",v,1),y=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,x=Array.isArray(b)?b[0]*(null!==(u=b[1])&&void 0!==u?u:b[0]):b,w=Array.isArray(b)?b[0]:x,S=Array.isArray(b)?null!==(m=b[1])&&void 0!==m?m:b[0]:1,P=M.row;P.count=w;const I=M.col;I.count=S,M.count=x,M.col.count=S,M.row.count=w,M.type=y;let _=0;const B=[];let O=0;const A=n.vec2.fromValues((S-1)/2,(w-1)/2),C=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],q=[void 0,void 0,void 0,void 0],k=[void 0,void 0,void 0,void 0];for(let r=0;r1?O/(x-1):1,M.angle=y===i.ERepetitionType.Ring?s.PI2/x*O:0,I.index=u+1,I.offset=S>1?u/(S-1):1,P.index=r+1,P.offset=w>1?r/(w-1):1;const g=this.generateBuffer(t,v),m=g.length,b=this.getShapeBounding();B[O]=new Float32Array(m),_+=m;{const t=a.toVec2(this.getProp("distance",v,a.VEC2_ZERO)),s=this.getProp("displace",v,0),x=a.toVec3(this.getProp("scale",v,a.VEC2_ONE),1),w=a.toVec3(this.getProp("translate",v,a.VEC2_ZERO),0),S=this.getProp("skewX",v,0),P=this.getProp("skewY",v,0),I=this.getProp("squeezeX",v,0),_=this.getProp("squeezeY",v,0),R=this.getProp("rotateX",v,0),E=this.getProp("rotateY",v,0),F=this.getProp("rotateZ",v,0),L=c.clamp(0,1,this.getProp("perspective",v,0)),T=a.toVec3(this.getProp("perspectiveOrigin",v,a.VEC2_ZERO),0),D=a.toVec3(this.getProp("transformOrigin",v,a.VEC2_ZERO),0);let j;switch(y){case i.ERepetitionType.Ring:j=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(j,j,a.VEC3_ZERO,M.angle+s);break;case i.ERepetitionType.Matrix:j=n.vec3.fromValues(t[1]*(u-A[0]),t[0]*(r-A[1]),0)}const z=L>0?Math.max(b.width,b.height)/2:1,U=L>0?z+10*z*(1-L):0,V=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==L||0!==D[0]||0!==D[1],Y=0!==T[0]||0!==T[1];V&&(this.boundingType===i.EBoundingType.Relative?(D[0]=D[0]*(b.width/2)+b.cx,D[1]=D[1]*(b.height/2)+b.cy):(D[0]*=b.width/2,D[1]*=b.height/2),D[2]=U);{n.mat4.identity(f),V&&n.mat4.translate(f,f,D),0===w[0]&&0===w[1]||n.mat4.translate(f,f,w),0===S&&0===P||(a.fromSkew(l,[S,P]),n.mat4.multiply(f,f,l)),0!==R&&n.mat4.rotateX(f,f,R),0!==E&&n.mat4.rotateY(f,f,E),0!==F&&n.mat4.rotateZ(f,f,F),1===x[0]&&1===x[1]||n.mat4.scale(f,f,x),V&&n.mat4.translate(f,f,n.vec3.scale(D,D,-1)),U>0&&(Y&&(this.boundingType===i.EBoundingType.Relative?(T[0]=T[0]*(b.width/2)+b.cx,T[1]=T[1]*(b.height/2)+b.cy):(T[0]*=b.width/2,T[1]*=b.height/2),T[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,j),e&&n.mat4.translate(p,p,C);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),y===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,M.angle+s)}h.Bounding.clear(k);for(let t=0;t0&&(Y&&n.vec3.add(e,e,T),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,U),Y&&n.vec3.sub(e,e,T)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=m/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,v)}B[O][t]=e[0],B[O][t+1]=e[1],h.Bounding.add(k,e[0],e[1]),h.Bounding.add(q,e[0],e[1])}}const R={cx:0,cy:0,x:-1,y:-1,width:2,height:2};h.Bounding.bind(R,k),this.bStaticIndexed&&this.bIndexed||this.addIndex(m,M,R)}h.Bounding.bind(this.bounding,q),this.buffer=new Float32Array(_);for(let t=0,e=0,r=B.length;t({index:1,offset:1,count:1}),g.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...g.getEmptySimpleRepetition(),row:g.getEmptySimpleRepetition(),col:g.getEmptySimpleRepetition()})},7439:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBuffer=void 0;const n=r(5511),i=r(3674);class a extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||"ShapeBuffer",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn("[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property"),this.shape=a.EMPTY_BUFFER):this.shape="function"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return"function"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from("function"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,a=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&"function"!=typeof this.props.sideLength&&"function"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=a},5382:(t,e,r)=>{e.S=void 0;const n=r(6448);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeFollow",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},a=this.shape;a.generate(t,!1,i);let o=a.getBuffer();const s=o.length,h=new Float32Array(s*(n.length/2)),c=n.length/2;for(let e=0;e1?e/(c-1):1,count:c};this.shapeUseFollow&&(i.follow=r,a.generate(t,!1,i),o=a.getBuffer());const u=e*s,l=2*e,f=n[l],d=n[l+1];for(let t=0,e=o.length;t1?t/(e-1):1;for(let o=0,s=a.length;o{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeLoop=void 0;const n=r(3792),i=r(5511),a=r(3674),o=r(2648);class s extends a.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||"ShapeLoop",super(t),this.loopDependencies=(t.loopDependencies||[]).concat("sideLength"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes("propArguments"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}"loop"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||o.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?("function"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),a=this.getRepetitionSideLength(t),o=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,s={index:0,offset:0,current:0,count:n},h=s.count,c=new Float32Array(2*h);for(let n=0,i=0;n1?n/(s.count-1):1;s.current=a,s.index=n+1,s.offset=h;const u=o(s,t);c[i]=u[0],c[i+1]=u[1]}const u=[void 0,void 0,void 0,void 0],l=this.applyModifiers(c,t);for(let t=0,e=l.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapePrimitive=void 0;const n=r(8721),i=r(2648),a=r(9958),o=r(5511);class s extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=o.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:"function"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return"function"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:"number"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp("sideLength",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{e.v=void 0;const n=r(6448);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeRecursive",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionScale&&"function"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp("recursions",e,1)),n=Math.floor(this.getProp("recursionVertex",e,0)),a=this.getProp("recursionScale",e,2),o=this.shape;let s={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const h={...e,recursion:s};o.generate(t,!1,h);const c=o.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=c);let u=c;const l=[s];let f=0,d=1;const p=u.length,g=p/2,m=n<=0?g:Math.min(n,g),v=0===n?1:g/Math.min(n,g),M=new Float32Array(i.summmation(r,m)*p);for(let t=0;t1?e/(r-1):1,c=i.summmation(e,m)*p,g=e-1,b=0===g?0:i.summmation(g,m)*p;for(let i=0,g=m**e;i1?i/(g-1):1,count:g,level:{index:e+1,offset:n,count:r},parent:l[f]},l.push(s),this.shapeUseRecursion&&(h.recursion=s,o.generate(t,!1,h),u=o.getBuffer());const y=c+i*p,x=Math.floor(b+2*i*v),w=M[x],S=M[x+1],P=a**e;for(let t=0,e=p;t1?0:1,count:a}}},h=this.shape.getIndexedBuffer()||[];for(let t=0,e=h.length;t1?0:1,count:a}},i={...s,recursion:r},o=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:o})}if(a>1){const t=this.shape.getBufferLength({...i,parent:{...s}})/2,e=o<=0?t:Math.min(o,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let c=0,u=1;for(let t=1;t1?t/(a-1):1;for(let o=0,l=e**t;o1?o/(l-1):1;for(let d=0,p=h.length;d{e.C=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){t.type="Circle",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.C=a},6329:(t,e,r)=>{e.x=void 0;const n=r(5511),i=r(7439);class a extends i.ShapeBuffer{constructor(t={}){t.type="Line",t.shape=a.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{e.O=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){t.type="Lissajous",t.loopDependencies=(t.loopDependencies||[]).concat(["wx","wy","wz"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp("wx",t),r=this.getProp("wy",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),a=this.getRepetitionSideLength(t);return 1/Math.pow(a[0]*a[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp("wx",t,1),this.wy=this.getProp("wy",t,2),this.wz=this.getProp("wz",t,2),super.generateLoopBuffer(t)}}e.O=a},2982:(t,e,r)=>{e.m=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["sideNumber"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp("sideNumber",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.m=a},5510:(t,e,r)=>{e.U=void 0;const n=r(5511),i=r(7439);class a extends i.ShapeBuffer{constructor(t={}){t.type="Rect",t.shape=a.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.U=a,a.buffer=[1,1,-1,1,-1,-1,1,-1]},894:(t,e,r)=>{e.h=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){var e,r;t.type="Rose",t.loopDependencies=(t.loopDependencies||[]).concat(["n","d"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>a.getFinalAngleFromK(this.getProp("n",t),this.getProp("d",t)),inc:t=>{const e=this.getProp("n",t),r=this.getProp("d",t),i=this.getRepetitionSideLength(t),a=Math.pow(i[0]*i[1],.45),o=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp("n",t)/this.getProp("d",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.h=a},5719:(t,e,r)=>{e.r=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type="Spiral",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat(["twists","twistsStart","spiral"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:a.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp("twistsStart",t),end:t=>n.PI2*(this.getProp("twistsStart",t)+this.getProp("twists",t)),inc:t=>{const e=this.getProp("twists",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp("spiral",t),this.r=a.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case a.types.ARCHIMEDE:return t=>t/10;case a.types.HYPERBOLIC:return t=>1/t*3;case a.types.FERMAT:return t=>t**.5/3;case a.types.LITUUS:return t=>t**-.5;case a.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.r=a,a.types={ARCHIMEDE:"ARCHIMEDE",HYPERBOLIC:"HYPERBOLIC",FERMAT:"FERMAT",LITUUS:"LITUUS",LOGARITHMIC:"LOGARITHMIC"}},9667:(t,e,r)=>{e.U=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["spikes","innerRadius"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp("spikes",t,5),this.innerRadius=this.getProp("innerRadius",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.U=a},3977:(t,e,r)=>{e.y=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){var e,r,i,a,o,s;t.type="SuperShape",t.loopDependencies=(t.loopDependencies||[]).concat(["a","b","m","n1","n2","n3"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(a=t.n1)&&void 0!==a?a:1,this.props.n2=null!==(o=t.n2)&&void 0!==o?o:1,this.props.n3=null!==(s=t.n3)&&void 0!==s?s:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp("a",t),this.b=this.getProp("b",t),this.m=this.getProp("m",t),this.n1=this.getProp("n1",t),this.n2=this.getProp("n2",t),this.n3=this.getProp("n3",t),super.generateLoopBuffer(t)}}e.y=a},4233:(t,e,r)=>{e.C=void 0;const n=r(5511),i=r(7439);class a extends i.ShapeBuffer{constructor(t={}){t.type="Triangle",t.shape=a.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.C=a,a.buffer=[1,0,-1,1,-1,-1]},3757:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(7678),e),i(r(7066),e),i(r(2769),e),i(r(7266),e),i(r(3647),e),i(r(4526),e),i(r(1618),e),i(r(6787),e)},7678:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},7066:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2769:(t,e)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]="Ring",r[r.Matrix=2]="Matrix"},7266:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},3647:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4526:(t,e)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]="Relative",r[r.Fixed=2]="Fixed"},1618:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6787:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},9962:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DrawerCanvas=void 0;const n=r(7358),i=r(313),a=r(3792),o=r(795),s=r(292),h=r(1189),c=r(8909),u=r(9724);class l extends h.Emitter{constructor(t,e,r,n=6e4,i=60){var a,o,s,h,l;super(),this.drawerOptions={width:(null==r?void 0:r.width)||(null==t?void 0:t.width)||400,height:(null==r?void 0:r.height)||(null==t?void 0:t.height)||400,clear:null===(a=null==r?void 0:r.clear)||void 0===a||a,time:null!==(o=null==r?void 0:r.time)&&void 0!==o?o:0,simmetricLines:null!==(s=null==r?void 0:r.simmetricLines)&&void 0!==s?s:0,noBackground:null!==(h=null==r?void 0:r.noBackground)&&void 0!==h&&h,ghosts:(null==r?void 0:r.ghosts)||0,ghostAlpha:!1!==(null==r?void 0:r.ghostAlpha),ghostSkipTime:null!==(l=null==r?void 0:r.ghostSkipTime)&&void 0!==l?l:30,ghostSkipFunction:null==r?void 0:r.ghostSkipFunction,sceneFit:(null==r?void 0:r.sceneFit)||"contain",backgroundImage:null==r?void 0:r.backgroundImage,backgroundImageFit:(null==r?void 0:r.backgroundImageFit)||"cover"},this.timeline=new c.Timeline(n,i),this.timeline.setTime(this.drawerOptions.time),this.draw_id=null,this.redraw_id=null,this.animation_id=null,t&&this.setScene(t),(!u.bWorker||u.bWorker&&e instanceof OffscreenCanvas)&&this.setCanvas(e)}getOption(t,e){var r;return null!==(r=this.drawerOptions[t])&&void 0!==r?r:e}setCanvas(t){if(u.bWorker)t instanceof OffscreenCanvas?this.canvas=t:console.error("Cannot set cavas");else if(u.bBrowser){const e=s.createCanvas(this.drawerOptions.width,this.drawerOptions.height);if(t instanceof HTMLElement&&!(t instanceof HTMLCanvasElement||t instanceof OffscreenCanvas)){for(this.canvas=e;t.lastChild;)t.removeChild(t.lastChild);t.appendChild(e)}else this.canvas=void 0===t?e:t}else this.canvas=s.createCanvas(this.drawerOptions.width,this.drawerOptions.height);this.canvas&&(this.canvas.width=this.drawerOptions.width,this.canvas.height=this.drawerOptions.height,this.context=this.canvas.getContext("2d",{alpha:!0}))}getCanvas(){return this.canvas}setScene(t){this.scene=t}draw(){if(null===this.context||void 0===this.scene)return 0;const t=i.now(),e=this.timeline,r=e.getTime(),n={...this.drawerOptions,ghostIndex:void 0,clear:this.drawerOptions.clear||e.getCurrentFrame()<=1,time:r},o=e.getFrameAtTime(r);if(this.dispatch("drawer-canvas:before_draw",{currentFrame:o,currentTime:r}),n.simmetricLines>0&&(n.clear&&l.clear(this.context,n.width,n.height,!n.noBackground&&this.scene.background,n.backgroundImage,n.backgroundImageFit),l.drawSimmetricLines(this.context,n.simmetricLines,n.width,n.height,this.scene.color),n.clear=!1),n.ghosts){const t={...n},r=e.getTime(),i=e.getDuration(),o={offset:0,index:0,count:n.ghosts};for(let e=1;e<=n.ghosts;e++){o.index=e,o.offset=o.index/o.count;const s=r-(n.ghostSkipFunction?n.ghostSkipFunction(o,r):e*n.ghostSkipTime);t.ghostIndex=e,t.time=a.mod(s,i),t.clear=n.clear&&1===t.ghostIndex,this.realDraw(t)}n.clear=!1}return this.realDraw(n),i.now()-t}realDraw(t){var e;const r=this.drawerOptions.width,n=this.drawerOptions.height,i=this.context,a=this.scene,o=null!==(e=t.time)&&void 0!==e?e:0,s=void 0!==t.ghosts&&t.ghosts>0&&void 0!==t.ghostIndex&&t.ghostIndex>0,h=s?1-t.ghostIndex/(t.ghosts+.5):0,c=!0===t.ghostAlpha,f=u.fit(a.width,a.height,r,n,this.drawerOptions.sceneFit),d=f.x,p=f.y;t.clear&&l.clear(i,r,n,!t.noBackground&&a.background,t.backgroundImage,t.backgroundImageFit);let g=!1,m=!1;a.currentTime=o;const v=a.getChildren();for(let t=0,e=v.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=void 0,e.Emitter=class{constructor(){this.callbacks={}}attach(t,e){t in this.callbacks||(this.callbacks[t]=[]),this.callbacks[t].push(e)}detach(t,e){if(t in this.callbacks){const r=this.callbacks[t].indexOf(e);r>=0&&this.callbacks[t].splice(r,1)}}dispatch(t,e){if(t in this.callbacks&&this.callbacks[t].length>0)for(let r=0,n=this.callbacks[t].length;r{Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=void 0;const n=r(313),i=r(3792),a=r(1189);class o extends a.Emitter{constructor(t=6e4,e=30){super(),this.fps_samples_size=30,this.fps_samples=[],this.fps_samples_index=0,this.paused_time=0,this.sequence={duration:t,framerate:e,frames:Math.round(t/1e3*e)},this.tick_time=1e3/this.sequence.framerate,this.fps=this.sequence.framerate,this.b_sequence_started=!1,this.currentFrame=0,this.currentTime=0,this.last_tick=0,this.start_time=0}getSequence(){return{...this.sequence}}setSequence(t,e,r){this.sequence.duration=t,this.sequence.framerate=e,this.tick_time=1e3/this.sequence.framerate,this.sequence.frames=Math.round(this.sequence.duration/1e3*this.sequence.framerate),void 0!==r?this.setTime(r):this.dispatch("timeline:update_sequence",this.getSequence())}setDuration(t){this.setSequence(t,this.sequence.framerate)}getDuration(){return this.sequence.duration}getFramerate(){return this.sequence.framerate}setFramerate(t){this.setSequence(this.sequence.duration,t)}getFramesCount(){return this.sequence.frames}bSequenceStarted(){return this.b_sequence_started}start(){this.b_sequence_started||(this.b_sequence_started=!0,this.start_time=this.paused_time,this.dispatch("timeline:change_status",o.START))}pause(){this.b_sequence_started&&(this.paused_time=n.now(),this.b_sequence_started=!1,this.dispatch("timeline:change_status",o.PAUSE))}stop(){this.b_sequence_started&&(this.b_sequence_started=!1,this.currentTime=0,this.currentFrame=0,this.start_time=0,this.paused_time=0,this.dispatch("timeline:change_status",o.STOP))}tick(t){if(this.b_sequence_started){this.start_time||(this.start_time=t,this.last_tick=-this.tick_time);const e=t-this.start_time,r=e-this.last_tick;if(r>=this.tick_time)return this.calculateFPS(1/(r/1e3)),this.last_tick=e,this.currentTime=(e-r%this.tick_time)%this.sequence.duration,this.currentFrame=this.getFrameAtTime(this.currentTime),this.dispatch("timeline:progress",{currentFrame:this.currentFrame,currentTime:this.currentTime,fps:this.fps}),!0}return!1}calculateFPS(t){const e=this.fps_samples.length;if(e>0){let t=0;for(let r=0;r{e.T=void 0;const n=r(9962),i=r(9724);class a extends n.DrawerCanvas{constructor(t,e,r,n=6e4,i=60){super(t,e,r,n,i),this.dpi=1,this.dpi=(null==r?void 0:r.dpi)||1,this.draw_id=null,this.redraw_id=null,this.animation_id=null,this.draw=this.draw.bind(this),this.animate=this.animate.bind(this),this.startAnimation=this.startAnimation.bind(this),this.resize(this.drawerOptions.width,this.drawerOptions.height)}resize(t,e,r,n=this.dpi){this.drawerOptions.width=t*n,this.drawerOptions.height=e*n,this.canvas&&(this.canvas.width=t*n,this.canvas.height=e*n,i.bBrowser&&this.canvas instanceof HTMLCanvasElement&&(this.canvas.style.width=t+"px",this.canvas.style.height=e+"px")),void 0!==r&&(this.drawerOptions.sceneFit=r),this.dispatch("drawer-canvas:resize")}animate(t){this.timeline.bSequenceStarted()&&(this.animation_id=requestAnimationFrame(this.animate),this.timeline.tick(t)&&this.draw())}startAnimation(){this.stopAnimation(),this.timeline.start(),this.animation_id=requestAnimationFrame(this.animate)}stopAnimation(){this.timeline.stop(),this.animation_id&&cancelAnimationFrame(this.animation_id)}pauseAnimation(){this.timeline.pause(),this.animation_id&&cancelAnimationFrame(this.animation_id)}playAnimation(){this.timeline.start(),requestAnimationFrame(this.animate)}redraw(){this.timeline.bSequenceStarted()?void 0!==typeof this.drawerOptions.ghosts&&0!==this.drawerOptions.ghosts||(this.stopAnimation(),this.redraw_id&&cancelAnimationFrame(this.redraw_id),this.redraw_id=requestAnimationFrame(this.startAnimation)):(this.draw_id&&cancelAnimationFrame(this.draw_id),void 0!==typeof this.drawerOptions.ghosts&&0!==this.drawerOptions.ghosts||this.timeline.stop(),this.draw_id=requestAnimationFrame(this.draw))}}e.T=a},9724:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fit=e.bWorker=e.bBrowser=e.bNode=void 0,e.bNode="undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node,e.bBrowser="undefined"!=typeof window&&void 0!==window.document,e.bWorker="object"==typeof self&&["ServiceWorkerGlobalScope","DedicatedWorkerGlobalScope"].includes(self.constructor.name),e.fit=function(t,e,r,n,i="none"){let a=0,o=0,s=1,h=t,c=e;const u=r/n,l=t/e;return"contain"===i?(h=u>l?t*n/e:r,c=u>l?n:e*r/t,s=Math.max(h,c)/Math.max(t,e)):"cover"===i&&(h=u{var e=.1,r="function"==typeof Float32Array;function n(t,e){return 1-3*e+3*t}function i(t,e){return 3*e-6*t}function a(t){return 3*t}function o(t,e,r){return((n(e,r)*t+i(e,r))*t+a(e))*t}function s(t,e,r){return 3*n(e,r)*t*t+2*i(e,r)*t+a(e)}function h(t){return t}t.exports=function(t,n,i,a){if(!(0<=t&&t<=1&&0<=i&&i<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===n&&i===a)return h;for(var c=r?new Float32Array(11):new Array(11),u=0;u<11;++u)c[u]=o(u*e,t,i);return function(r){return 0===r?0:1===r?1:o(function(r){for(var n=0,a=1;10!==a&&c[a]<=r;++a)n+=e;--a;var h=n+(r-c[a])/(c[a+1]-c[a])*e,u=s(h,t,i);return u>=.001?function(t,e,r,n){for(var i=0;i<4;++i){var a=s(e,r,n);if(0===a)return e;e-=(o(e,r,n)-t)/a}return e}(r,h,t,i):0===u?h:function(t,e,r,n,i){var a,s,h=0;do{(a=o(s=e+(r-e)/2,n,i)-t)>0?r=s:e=s}while(Math.abs(a)>1e-7&&++h<10);return s}(r,n,n+e,t,i)}(r),n,a)}}},292:(t,e,r)=>{const n=r(9850);e.parseFont=n,e.createCanvas=function(t,e){return Object.assign(document.createElement("canvas"),{width:t,height:e})},e.createImageData=function(t,e,r){switch(arguments.length){case 0:return new ImageData;case 1:return new ImageData(t);case 2:return new ImageData(t,e);default:return new ImageData(t,e,r)}},e.loadImage=function(t,e){return new Promise((function(r,n){const i=Object.assign(document.createElement("img"),e);function a(){i.onload=null,i.onerror=null}i.onload=function(){a(),r(i)},i.onerror=function(){a(),n(new Error('Failed to load the image "'+t+'"'))},i.src=t}))}},9850:t=>{const e="'([^']+)'|\"([^\"]+)\"|[\\w\\s-]+",r=new RegExp("(bold|bolder|lighter|[1-9]00) +","i"),n=new RegExp("(italic|oblique) +","i"),i=new RegExp("(small-caps) +","i"),a=new RegExp("(ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded) +","i"),o=new RegExp("([\\d\\.]+)(px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q) *((?:"+e+")( *, *(?:"+e+"))*)"),s={};t.exports=function(t){if(s[t])return s[t];const e=o.exec(t);if(!e)return;const h={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(e[1]),unit:e[2],family:e[3].replace(/["']/g,"").replace(/ *, */g,",")};let c,u,l,f,d=t.substring(0,e.index);switch((c=r.exec(d))&&(h.weight=c[1]),(u=n.exec(d))&&(h.style=u[1]),(l=i.exec(d))&&(h.variant=l[1]),(f=a.exec(d))&&(h.stretch=f[1]),h.unit){case"pt":h.size/=.75;break;case"pc":h.size*=16;break;case"in":h.size*=96;break;case"cm":h.size*=96/2.54;break;case"mm":h.size*=96/25.4;break;case"%":break;case"em":case"rem":h.size*=16/.75;break;case"q":h.size*=96/25.4/4}return s[t]=h}},887:(t,e,r)=>{r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>a,mat3:()=>o,mat4:()=>s,quat:()=>u,quat2:()=>l,vec2:()=>f,vec3:()=>h,vec4:()=>c});var n={};r.r(n),r.d(n,{ARRAY_TYPE:()=>p,EPSILON:()=>d,RANDOM:()=>g,equals:()=>b,setMatrixArrayType:()=>m,toRadian:()=>M});var i={};r.r(i),r.d(i,{LDU:()=>T,add:()=>D,adjoint:()=>O,clone:()=>x,copy:()=>w,create:()=>y,determinant:()=>A,equals:()=>U,exactEquals:()=>z,frob:()=>L,fromRotation:()=>R,fromScaling:()=>E,fromValues:()=>P,identity:()=>S,invert:()=>B,mul:()=>X,multiply:()=>C,multiplyScalar:()=>V,multiplyScalarAndAdd:()=>Y,rotate:()=>q,scale:()=>k,set:()=>I,str:()=>F,sub:()=>Z,subtract:()=>j,transpose:()=>_});var a={};r.r(a),r.d(a,{add:()=>ct,clone:()=>N,copy:()=>H,create:()=>G,determinant:()=>K,equals:()=>pt,exactEquals:()=>dt,frob:()=>ht,fromRotation:()=>it,fromScaling:()=>at,fromTranslation:()=>ot,fromValues:()=>W,identity:()=>$,invert:()=>J,mul:()=>gt,multiply:()=>tt,multiplyScalar:()=>lt,multiplyScalarAndAdd:()=>ft,rotate:()=>et,scale:()=>rt,set:()=>Q,str:()=>st,sub:()=>mt,subtract:()=>ut,translate:()=>nt});var o={};r.r(o),r.d(o,{add:()=>Ut,adjoint:()=>_t,clone:()=>bt,copy:()=>yt,create:()=>vt,determinant:()=>Bt,equals:()=>Gt,exactEquals:()=>Zt,frob:()=>zt,fromMat2d:()=>Ft,fromMat4:()=>Mt,fromQuat:()=>Lt,fromRotation:()=>Rt,fromScaling:()=>Et,fromTranslation:()=>kt,fromValues:()=>xt,identity:()=>St,invert:()=>It,mul:()=>Nt,multiply:()=>Ot,multiplyScalar:()=>Yt,multiplyScalarAndAdd:()=>Xt,normalFromMat4:()=>Tt,projection:()=>Dt,rotate:()=>Ct,scale:()=>qt,set:()=>wt,str:()=>jt,sub:()=>Ht,subtract:()=>Vt,translate:()=>At,transpose:()=>Pt});var s={};r.r(s),r.d(s,{add:()=>Ee,adjoint:()=>ne,clone:()=>Wt,copy:()=>Qt,create:()=>$t,determinant:()=>ie,equals:()=>je,exactEquals:()=>De,frob:()=>Re,fromQuat:()=>Ie,fromQuat2:()=>be,fromRotation:()=>pe,fromRotationTranslation:()=>Me,fromRotationTranslationScale:()=>Se,fromRotationTranslationScaleOrigin:()=>Pe,fromScaling:()=>de,fromTranslation:()=>fe,fromValues:()=>Jt,fromXRotation:()=>ge,fromYRotation:()=>me,fromZRotation:()=>ve,frustum:()=>_e,getRotation:()=>we,getScaling:()=>xe,getTranslation:()=>ye,identity:()=>te,invert:()=>re,lookAt:()=>Ce,mul:()=>ze,multiply:()=>ae,multiplyScalar:()=>Le,multiplyScalarAndAdd:()=>Te,ortho:()=>Ae,perspective:()=>Be,perspectiveFromFieldOfView:()=>Oe,rotate:()=>he,rotateX:()=>ce,rotateY:()=>ue,rotateZ:()=>le,scale:()=>se,set:()=>Kt,str:()=>ke,sub:()=>Ue,subtract:()=>Fe,targetTo:()=>qe,translate:()=>oe,transpose:()=>ee});var h={};r.r(h),r.d(h,{add:()=>He,angle:()=>Sr,bezier:()=>gr,ceil:()=>Je,clone:()=>Ye,copy:()=>Ge,create:()=>Ve,cross:()=>fr,dist:()=>kr,distance:()=>ar,div:()=>qr,divide:()=>Qe,dot:()=>lr,equals:()=>Br,exactEquals:()=>_r,floor:()=>Ke,forEach:()=>Lr,fromValues:()=>Ze,hermite:()=>pr,inverse:()=>cr,len:()=>Er,length:()=>Xe,lerp:()=>dr,max:()=>er,min:()=>tr,mul:()=>Cr,multiply:()=>We,negate:()=>hr,normalize:()=>ur,random:()=>mr,rotateX:()=>yr,rotateY:()=>xr,rotateZ:()=>wr,round:()=>rr,scale:()=>nr,scaleAndAdd:()=>ir,set:()=>Ne,sqrDist:()=>Rr,sqrLen:()=>Fr,squaredDistance:()=>or,squaredLength:()=>sr,str:()=>Ir,sub:()=>Ar,subtract:()=>$e,transformMat3:()=>Mr,transformMat4:()=>vr,transformQuat:()=>br,zero:()=>Pr});var c={};r.r(c),r.d(c,{add:()=>Vr,ceil:()=>Gr,clone:()=>Dr,copy:()=>zr,create:()=>Tr,cross:()=>hn,dist:()=>yn,distance:()=>Kr,div:()=>bn,divide:()=>Zr,dot:()=>sn,equals:()=>mn,exactEquals:()=>gn,floor:()=>Nr,forEach:()=>Pn,fromValues:()=>jr,inverse:()=>an,len:()=>wn,length:()=>en,lerp:()=>cn,max:()=>$r,min:()=>Hr,mul:()=>Mn,multiply:()=>Xr,negate:()=>nn,normalize:()=>on,random:()=>un,round:()=>Wr,scale:()=>Qr,scaleAndAdd:()=>Jr,set:()=>Ur,sqrDist:()=>xn,sqrLen:()=>Sn,squaredDistance:()=>tn,squaredLength:()=>rn,str:()=>pn,sub:()=>vn,subtract:()=>Yr,transformMat4:()=>ln,transformQuat:()=>fn,zero:()=>dn});var u={};r.r(u),r.d(u,{add:()=>ei,calculateW:()=>En,clone:()=>Qn,conjugate:()=>Un,copy:()=>Kn,create:()=>In,dot:()=>ii,equals:()=>fi,exactEquals:()=>li,exp:()=>Fn,fromEuler:()=>Yn,fromMat3:()=>Vn,fromValues:()=>Jn,getAngle:()=>An,getAxisAngle:()=>On,identity:()=>_n,invert:()=>zn,len:()=>si,length:()=>oi,lerp:()=>ai,ln:()=>Ln,mul:()=>ri,multiply:()=>Cn,normalize:()=>ui,pow:()=>Tn,random:()=>jn,rotateX:()=>qn,rotateY:()=>kn,rotateZ:()=>Rn,rotationTo:()=>di,scale:()=>ni,set:()=>ti,setAxes:()=>gi,setAxisAngle:()=>Bn,slerp:()=>Dn,sqlerp:()=>pi,sqrLen:()=>ci,squaredLength:()=>hi,str:()=>Xn});var l={};r.r(l),r.d(l,{add:()=>ji,clone:()=>vi,conjugate:()=>Gi,copy:()=>Pi,create:()=>mi,dot:()=>Yi,equals:()=>ta,exactEquals:()=>Ki,fromMat4:()=>Si,fromRotation:()=>wi,fromRotationTranslation:()=>yi,fromRotationTranslationValues:()=>bi,fromTranslation:()=>xi,fromValues:()=>Mi,getDual:()=>Oi,getReal:()=>Bi,getTranslation:()=>qi,identity:()=>Ii,invert:()=>Zi,len:()=>Hi,length:()=>Ni,lerp:()=>Xi,mul:()=>Ui,multiply:()=>zi,normalize:()=>Qi,rotateAroundAxis:()=>Di,rotateByQuatAppend:()=>Li,rotateByQuatPrepend:()=>Ti,rotateX:()=>Ri,rotateY:()=>Ei,rotateZ:()=>Fi,scale:()=>Vi,set:()=>_i,setDual:()=>Ci,setReal:()=>Ai,sqrLen:()=>Wi,squaredLength:()=>$i,str:()=>Ji,translate:()=>ki});var f={};r.r(f),r.d(f,{add:()=>oa,angle:()=>Ra,ceil:()=>ua,clone:()=>ra,copy:()=>ia,create:()=>ea,cross:()=>Ia,dist:()=>Va,distance:()=>va,div:()=>Ua,divide:()=>ca,dot:()=>Pa,equals:()=>Ta,exactEquals:()=>La,floor:()=>la,forEach:()=>Za,fromValues:()=>na,inverse:()=>wa,len:()=>Da,length:()=>ba,lerp:()=>_a,max:()=>da,min:()=>fa,mul:()=>za,multiply:()=>ha,negate:()=>xa,normalize:()=>Sa,random:()=>Ba,rotate:()=>ka,round:()=>pa,scale:()=>ga,scaleAndAdd:()=>ma,set:()=>aa,sqrDist:()=>Ya,sqrLen:()=>Xa,squaredDistance:()=>Ma,squaredLength:()=>ya,str:()=>Fa,sub:()=>ja,subtract:()=>sa,transformMat2:()=>Oa,transformMat2d:()=>Aa,transformMat3:()=>Ca,transformMat4:()=>qa,zero:()=>Ea});var d=1e-6,p="undefined"!=typeof Float32Array?Float32Array:Array,g=Math.random;function m(t){p=t}var v=Math.PI/180;function M(t){return t*v}function b(t,e){return Math.abs(t-e)<=d*Math.max(1,Math.abs(t),Math.abs(e))}function y(){var t=new p(4);return p!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function x(t){var e=new p(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function w(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function S(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function P(t,e,r,n){var i=new p(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function I(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function _(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function B(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*a-i*n;return o?(o=1/o,t[0]=a*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}function O(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function A(t){return t[0]*t[3]-t[2]*t[1]}function C(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],h=r[1],c=r[2],u=r[3];return t[0]=n*s+a*h,t[1]=i*s+o*h,t[2]=n*c+a*u,t[3]=i*c+o*u,t}function q(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),h=Math.cos(r);return t[0]=n*h+a*s,t[1]=i*h+o*s,t[2]=n*-s+a*h,t[3]=i*-s+o*h,t}function k(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],h=r[1];return t[0]=n*s,t[1]=i*s,t[2]=a*h,t[3]=o*h,t}function R(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function E(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function F(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function L(t){return Math.hypot(t[0],t[1],t[2],t[3])}function T(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function D(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function j(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function z(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function U(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],h=e[2],c=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-h)<=d*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-c)<=d*Math.max(1,Math.abs(a),Math.abs(c))}function V(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Y(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var X=C,Z=j;function G(){var t=new p(6);return p!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function N(t){var e=new p(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function H(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function $(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function W(t,e,r,n,i,a){var o=new p(6);return o[0]=t,o[1]=e,o[2]=r,o[3]=n,o[4]=i,o[5]=a,o}function Q(t,e,r,n,i,a,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t}function J(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],h=r*a-n*i;return h?(h=1/h,t[0]=a*h,t[1]=-n*h,t[2]=-i*h,t[3]=r*h,t[4]=(i*s-a*o)*h,t[5]=(n*o-r*s)*h,t):null}function K(t){return t[0]*t[3]-t[1]*t[2]}function tt(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],h=e[5],c=r[0],u=r[1],l=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*c+a*u,t[1]=i*c+o*u,t[2]=n*l+a*f,t[3]=i*l+o*f,t[4]=n*d+a*p+s,t[5]=i*d+o*p+h,t}function et(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],h=e[5],c=Math.sin(r),u=Math.cos(r);return t[0]=n*u+a*c,t[1]=i*u+o*c,t[2]=n*-c+a*u,t[3]=i*-c+o*u,t[4]=s,t[5]=h,t}function rt(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],h=e[5],c=r[0],u=r[1];return t[0]=n*c,t[1]=i*c,t[2]=a*u,t[3]=o*u,t[4]=s,t[5]=h,t}function nt(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],h=e[5],c=r[0],u=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=n*c+a*u+s,t[5]=i*c+o*u+h,t}function it(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function at(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function ot(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function st(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function ht(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function ct(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function ut(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function lt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function ft(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function dt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function pt(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],h=e[0],c=e[1],u=e[2],l=e[3],f=e[4],p=e[5];return Math.abs(r-h)<=d*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(n-c)<=d*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-l)<=d*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(o-f)<=d*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(s-p)<=d*Math.max(1,Math.abs(s),Math.abs(p))}var gt=tt,mt=ut;function vt(){var t=new p(9);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Mt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function bt(t){var e=new p(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function xt(t,e,r,n,i,a,o,s,h){var c=new p(9);return c[0]=t,c[1]=e,c[2]=r,c[3]=n,c[4]=i,c[5]=a,c[6]=o,c[7]=s,c[8]=h,c}function wt(t,e,r,n,i,a,o,s,h,c){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=h,t[8]=c,t}function St(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Pt(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function It(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],h=e[6],c=e[7],u=e[8],l=u*o-s*c,f=-u*a+s*h,d=c*a-o*h,p=r*l+n*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-u*n+i*c)*p,t[2]=(s*n-i*o)*p,t[3]=f*p,t[4]=(u*r-i*h)*p,t[5]=(-s*r+i*a)*p,t[6]=d*p,t[7]=(-c*r+n*h)*p,t[8]=(o*r-n*a)*p,t):null}function _t(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],h=e[6],c=e[7],u=e[8];return t[0]=o*u-s*c,t[1]=i*c-n*u,t[2]=n*s-i*o,t[3]=s*h-a*u,t[4]=r*u-i*h,t[5]=i*a-r*s,t[6]=a*c-o*h,t[7]=n*h-r*c,t[8]=r*o-n*a,t}function Bt(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],h=t[7],c=t[8];return e*(c*a-o*h)+r*(-c*i+o*s)+n*(h*i-a*s)}function Ot(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],h=e[5],c=e[6],u=e[7],l=e[8],f=r[0],d=r[1],p=r[2],g=r[3],m=r[4],v=r[5],M=r[6],b=r[7],y=r[8];return t[0]=f*n+d*o+p*c,t[1]=f*i+d*s+p*u,t[2]=f*a+d*h+p*l,t[3]=g*n+m*o+v*c,t[4]=g*i+m*s+v*u,t[5]=g*a+m*h+v*l,t[6]=M*n+b*o+y*c,t[7]=M*i+b*s+y*u,t[8]=M*a+b*h+y*l,t}function At(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],h=e[5],c=e[6],u=e[7],l=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=h,t[6]=f*n+d*o+c,t[7]=f*i+d*s+u,t[8]=f*a+d*h+l,t}function Ct(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],h=e[5],c=e[6],u=e[7],l=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*s,t[2]=d*a+f*h,t[3]=d*o-f*n,t[4]=d*s-f*i,t[5]=d*h-f*a,t[6]=c,t[7]=u,t[8]=l,t}function qt(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function kt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function Rt(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Et(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Ft(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function Lt(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,h=i+i,c=r*o,u=n*o,l=n*s,f=i*o,d=i*s,p=i*h,g=a*o,m=a*s,v=a*h;return t[0]=1-l-p,t[3]=u-v,t[6]=f+m,t[1]=u+v,t[4]=1-c-p,t[7]=d-g,t[2]=f-m,t[5]=d+g,t[8]=1-c-l,t}function Tt(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],h=e[6],c=e[7],u=e[8],l=e[9],f=e[10],d=e[11],p=e[12],g=e[13],m=e[14],v=e[15],M=r*s-n*o,b=r*h-i*o,y=r*c-a*o,x=n*h-i*s,w=n*c-a*s,S=i*c-a*h,P=u*g-l*p,I=u*m-f*p,_=u*v-d*p,B=l*m-f*g,O=l*v-d*g,A=f*v-d*m,C=M*A-b*O+y*B+x*_-w*I+S*P;return C?(C=1/C,t[0]=(s*A-h*O+c*B)*C,t[1]=(h*_-o*A-c*I)*C,t[2]=(o*O-s*_+c*P)*C,t[3]=(i*O-n*A-a*B)*C,t[4]=(r*A-i*_+a*I)*C,t[5]=(n*_-r*O-a*P)*C,t[6]=(g*S-m*w+v*x)*C,t[7]=(m*y-p*S-v*b)*C,t[8]=(p*w-g*y+v*M)*C,t):null}function Dt(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function jt(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function zt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Ut(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function Vt(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function Yt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function Xt(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function Zt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function Gt(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],h=t[6],c=t[7],u=t[8],l=e[0],f=e[1],p=e[2],g=e[3],m=e[4],v=e[5],M=e[6],b=e[7],y=e[8];return Math.abs(r-l)<=d*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(n-f)<=d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-p)<=d*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(a-g)<=d*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(o-m)<=d*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(s-v)<=d*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(h-M)<=d*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(c-b)<=d*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(u-y)<=d*Math.max(1,Math.abs(u),Math.abs(y))}var Nt=Ot,Ht=Vt;function $t(){var t=new p(16);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Wt(t){var e=new p(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Qt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Jt(t,e,r,n,i,a,o,s,h,c,u,l,f,d,g,m){var v=new p(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=n,v[4]=i,v[5]=a,v[6]=o,v[7]=s,v[8]=h,v[9]=c,v[10]=u,v[11]=l,v[12]=f,v[13]=d,v[14]=g,v[15]=m,v}function Kt(t,e,r,n,i,a,o,s,h,c,u,l,f,d,p,g,m){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=h,t[8]=c,t[9]=u,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=g,t[15]=m,t}function te(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ee(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function re(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],h=e[6],c=e[7],u=e[8],l=e[9],f=e[10],d=e[11],p=e[12],g=e[13],m=e[14],v=e[15],M=r*s-n*o,b=r*h-i*o,y=r*c-a*o,x=n*h-i*s,w=n*c-a*s,S=i*c-a*h,P=u*g-l*p,I=u*m-f*p,_=u*v-d*p,B=l*m-f*g,O=l*v-d*g,A=f*v-d*m,C=M*A-b*O+y*B+x*_-w*I+S*P;return C?(C=1/C,t[0]=(s*A-h*O+c*B)*C,t[1]=(i*O-n*A-a*B)*C,t[2]=(g*S-m*w+v*x)*C,t[3]=(f*w-l*S-d*x)*C,t[4]=(h*_-o*A-c*I)*C,t[5]=(r*A-i*_+a*I)*C,t[6]=(m*y-p*S-v*b)*C,t[7]=(u*S-f*y+d*b)*C,t[8]=(o*O-s*_+c*P)*C,t[9]=(n*_-r*O-a*P)*C,t[10]=(p*w-g*y+v*M)*C,t[11]=(l*y-u*w-d*M)*C,t[12]=(s*I-o*B-h*P)*C,t[13]=(r*B-n*I+i*P)*C,t[14]=(g*b-p*x-m*M)*C,t[15]=(u*x-l*b+f*M)*C,t):null}function ne(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],h=e[6],c=e[7],u=e[8],l=e[9],f=e[10],d=e[11],p=e[12],g=e[13],m=e[14],v=e[15];return t[0]=s*(f*v-d*m)-l*(h*v-c*m)+g*(h*d-c*f),t[1]=-(n*(f*v-d*m)-l*(i*v-a*m)+g*(i*d-a*f)),t[2]=n*(h*v-c*m)-s*(i*v-a*m)+g*(i*c-a*h),t[3]=-(n*(h*d-c*f)-s*(i*d-a*f)+l*(i*c-a*h)),t[4]=-(o*(f*v-d*m)-u*(h*v-c*m)+p*(h*d-c*f)),t[5]=r*(f*v-d*m)-u*(i*v-a*m)+p*(i*d-a*f),t[6]=-(r*(h*v-c*m)-o*(i*v-a*m)+p*(i*c-a*h)),t[7]=r*(h*d-c*f)-o*(i*d-a*f)+u*(i*c-a*h),t[8]=o*(l*v-d*g)-u*(s*v-c*g)+p*(s*d-c*l),t[9]=-(r*(l*v-d*g)-u*(n*v-a*g)+p*(n*d-a*l)),t[10]=r*(s*v-c*g)-o*(n*v-a*g)+p*(n*c-a*s),t[11]=-(r*(s*d-c*l)-o*(n*d-a*l)+u*(n*c-a*s)),t[12]=-(o*(l*m-f*g)-u*(s*m-h*g)+p*(s*f-h*l)),t[13]=r*(l*m-f*g)-u*(n*m-i*g)+p*(n*f-i*l),t[14]=-(r*(s*m-h*g)-o*(n*m-i*g)+p*(n*h-i*s)),t[15]=r*(s*f-h*l)-o*(n*f-i*l)+u*(n*h-i*s),t}function ie(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],h=t[7],c=t[8],u=t[9],l=t[10],f=t[11],d=t[12],p=t[13],g=t[14],m=t[15];return(e*o-r*a)*(l*m-f*g)-(e*s-n*a)*(u*m-f*p)+(e*h-i*a)*(u*g-l*p)+(r*s-n*o)*(c*m-f*d)-(r*h-i*o)*(c*g-l*d)+(n*h-i*s)*(c*p-u*d)}function ae(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],h=e[5],c=e[6],u=e[7],l=e[8],f=e[9],d=e[10],p=e[11],g=e[12],m=e[13],v=e[14],M=e[15],b=r[0],y=r[1],x=r[2],w=r[3];return t[0]=b*n+y*s+x*l+w*g,t[1]=b*i+y*h+x*f+w*m,t[2]=b*a+y*c+x*d+w*v,t[3]=b*o+y*u+x*p+w*M,b=r[4],y=r[5],x=r[6],w=r[7],t[4]=b*n+y*s+x*l+w*g,t[5]=b*i+y*h+x*f+w*m,t[6]=b*a+y*c+x*d+w*v,t[7]=b*o+y*u+x*p+w*M,b=r[8],y=r[9],x=r[10],w=r[11],t[8]=b*n+y*s+x*l+w*g,t[9]=b*i+y*h+x*f+w*m,t[10]=b*a+y*c+x*d+w*v,t[11]=b*o+y*u+x*p+w*M,b=r[12],y=r[13],x=r[14],w=r[15],t[12]=b*n+y*s+x*l+w*g,t[13]=b*i+y*h+x*f+w*m,t[14]=b*a+y*c+x*d+w*v,t[15]=b*o+y*u+x*p+w*M,t}function oe(t,e,r){var n,i,a,o,s,h,c,u,l,f,d,p,g=r[0],m=r[1],v=r[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*v+e[12],t[13]=e[1]*g+e[5]*m+e[9]*v+e[13],t[14]=e[2]*g+e[6]*m+e[10]*v+e[14],t[15]=e[3]*g+e[7]*m+e[11]*v+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],h=e[5],c=e[6],u=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=h,t[6]=c,t[7]=u,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*g+s*m+l*v+e[12],t[13]=i*g+h*m+f*v+e[13],t[14]=a*g+c*m+d*v+e[14],t[15]=o*g+u*m+p*v+e[15]),t}function se(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function he(t,e,r,n){var i,a,o,s,h,c,u,l,f,p,g,m,v,M,b,y,x,w,S,P,I,_,B,O,A=n[0],C=n[1],q=n[2],k=Math.hypot(A,C,q);return k0?(r[0]=2*(s*o+u*n+h*a-c*i)/l,r[1]=2*(h*o+u*i+c*n-s*a)/l,r[2]=2*(c*o+u*a+s*i-h*n)/l):(r[0]=2*(s*o+u*n+h*a-c*i),r[1]=2*(h*o+u*i+c*n-s*a),r[2]=2*(c*o+u*a+s*i-h*n)),Me(t,e,r),t}function ye(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function xe(t,e){var r=e[0],n=e[1],i=e[2],a=e[4],o=e[5],s=e[6],h=e[8],c=e[9],u=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(a,o,s),t[2]=Math.hypot(h,c,u),t}function we(t,e){var r=new p(3);xe(r,e);var n=1/r[0],i=1/r[1],a=1/r[2],o=e[0]*n,s=e[1]*i,h=e[2]*a,c=e[4]*n,u=e[5]*i,l=e[6]*a,f=e[8]*n,d=e[9]*i,g=e[10]*a,m=o+u+g,v=0;return m>0?(v=2*Math.sqrt(m+1),t[3]=.25*v,t[0]=(l-d)/v,t[1]=(f-h)/v,t[2]=(s-c)/v):o>u&&o>g?(v=2*Math.sqrt(1+o-u-g),t[3]=(l-d)/v,t[0]=.25*v,t[1]=(s+c)/v,t[2]=(f+h)/v):u>g?(v=2*Math.sqrt(1+u-o-g),t[3]=(f-h)/v,t[0]=(s+c)/v,t[1]=.25*v,t[2]=(l+d)/v):(v=2*Math.sqrt(1+g-o-u),t[3]=(s-c)/v,t[0]=(f+h)/v,t[1]=(l+d)/v,t[2]=.25*v),t}function Se(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],h=i+i,c=a+a,u=o+o,l=i*h,f=i*c,d=i*u,p=a*c,g=a*u,m=o*u,v=s*h,M=s*c,b=s*u,y=n[0],x=n[1],w=n[2];return t[0]=(1-(p+m))*y,t[1]=(f+b)*y,t[2]=(d-M)*y,t[3]=0,t[4]=(f-b)*x,t[5]=(1-(l+m))*x,t[6]=(g+v)*x,t[7]=0,t[8]=(d+M)*w,t[9]=(g-v)*w,t[10]=(1-(l+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function Pe(t,e,r,n,i){var a=e[0],o=e[1],s=e[2],h=e[3],c=a+a,u=o+o,l=s+s,f=a*c,d=a*u,p=a*l,g=o*u,m=o*l,v=s*l,M=h*c,b=h*u,y=h*l,x=n[0],w=n[1],S=n[2],P=i[0],I=i[1],_=i[2],B=(1-(g+v))*x,O=(d+y)*x,A=(p-b)*x,C=(d-y)*w,q=(1-(f+v))*w,k=(m+M)*w,R=(p+b)*S,E=(m-M)*S,F=(1-(f+g))*S;return t[0]=B,t[1]=O,t[2]=A,t[3]=0,t[4]=C,t[5]=q,t[6]=k,t[7]=0,t[8]=R,t[9]=E,t[10]=F,t[11]=0,t[12]=r[0]+P-(B*P+C*I+R*_),t[13]=r[1]+I-(O*P+q*I+E*_),t[14]=r[2]+_-(A*P+k*I+F*_),t[15]=1,t}function Ie(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,h=i+i,c=r*o,u=n*o,l=n*s,f=i*o,d=i*s,p=i*h,g=a*o,m=a*s,v=a*h;return t[0]=1-l-p,t[1]=u+v,t[2]=f-m,t[3]=0,t[4]=u-v,t[5]=1-c-p,t[6]=d+g,t[7]=0,t[8]=f+m,t[9]=d-g,t[10]=1-c-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function _e(t,e,r,n,i,a,o){var s=1/(r-e),h=1/(i-n),c=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*h,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*h,t[10]=(o+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t}function Be(t,e,r,n,i){var a,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(a=1/(n-i),t[10]=(i+n)*a,t[14]=2*i*n*a):(t[10]=-1,t[14]=-2*n),t}function Oe(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),h=2/(o+s),c=2/(i+a);return t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-s)*h*.5,t[9]=(i-a)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function Ae(t,e,r,n,i,a,o){var s=1/(e-r),h=1/(n-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*h,t[14]=(o+a)*c,t[15]=1,t}function Ce(t,e,r,n){var i,a,o,s,h,c,u,l,f,p,g=e[0],m=e[1],v=e[2],M=n[0],b=n[1],y=n[2],x=r[0],w=r[1],S=r[2];return Math.abs(g-x)0&&(u*=d=1/Math.sqrt(d),l*=d,f*=d);var p=h*f-c*l,g=c*u-s*f,m=s*l-h*u;return(d=p*p+g*g+m*m)>0&&(p*=d=1/Math.sqrt(d),g*=d,m*=d),t[0]=p,t[1]=g,t[2]=m,t[3]=0,t[4]=l*m-f*g,t[5]=f*p-u*m,t[6]=u*g-l*p,t[7]=0,t[8]=u,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=a,t[14]=o,t[15]=1,t}function ke(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Re(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Ee(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Fe(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function Le(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function Te(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function De(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function je(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],h=t[6],c=t[7],u=t[8],l=t[9],f=t[10],p=t[11],g=t[12],m=t[13],v=t[14],M=t[15],b=e[0],y=e[1],x=e[2],w=e[3],S=e[4],P=e[5],I=e[6],_=e[7],B=e[8],O=e[9],A=e[10],C=e[11],q=e[12],k=e[13],R=e[14],E=e[15];return Math.abs(r-b)<=d*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-y)<=d*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-x)<=d*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-w)<=d*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(o-S)<=d*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(s-P)<=d*Math.max(1,Math.abs(s),Math.abs(P))&&Math.abs(h-I)<=d*Math.max(1,Math.abs(h),Math.abs(I))&&Math.abs(c-_)<=d*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-B)<=d*Math.max(1,Math.abs(u),Math.abs(B))&&Math.abs(l-O)<=d*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(f-A)<=d*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(p-C)<=d*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(g-q)<=d*Math.max(1,Math.abs(g),Math.abs(q))&&Math.abs(m-k)<=d*Math.max(1,Math.abs(m),Math.abs(k))&&Math.abs(v-R)<=d*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(M-E)<=d*Math.max(1,Math.abs(M),Math.abs(E))}var ze=ae,Ue=Fe;function Ve(){var t=new p(3);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ye(t){var e=new p(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Xe(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function Ze(t,e,r){var n=new p(3);return n[0]=t,n[1]=e,n[2]=r,n}function Ge(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Ne(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function He(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function $e(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function We(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function Qe(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function Je(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Ke(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function tr(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function er(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function rr(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function nr(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function ir(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function ar(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function or(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function sr(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function hr(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function cr(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function ur(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function lr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function fr(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],h=r[2];return t[0]=i*h-a*s,t[1]=a*o-n*h,t[2]=n*s-i*o,t}function dr(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t}function pr(t,e,r,n,i,a){var o=a*a,s=o*(2*a-3)+1,h=o*(a-2)+a,c=o*(a-1),u=o*(3-2*a);return t[0]=e[0]*s+r[0]*h+n[0]*c+i[0]*u,t[1]=e[1]*s+r[1]*h+n[1]*c+i[1]*u,t[2]=e[2]*s+r[2]*h+n[2]*c+i[2]*u,t}function gr(t,e,r,n,i,a){var o=1-a,s=o*o,h=a*a,c=s*o,u=3*a*s,l=3*h*o,f=h*a;return t[0]=e[0]*c+r[0]*u+n[0]*l+i[0]*f,t[1]=e[1]*c+r[1]*u+n[1]*l+i[1]*f,t[2]=e[2]*c+r[2]*u+n[2]*l+i[2]*f,t}function mr(t,e){e=e||1;var r=2*g()*Math.PI,n=2*g()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}function vr(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t}function Mr(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t}function br(t,e,r){var n=r[0],i=r[1],a=r[2],o=r[3],s=e[0],h=e[1],c=e[2],u=i*c-a*h,l=a*s-n*c,f=n*h-i*s,d=i*f-a*l,p=a*u-n*f,g=n*l-i*u,m=2*o;return u*=m,l*=m,f*=m,d*=2,p*=2,g*=2,t[0]=s+u+d,t[1]=h+l+p,t[2]=c+f+g,t}function yr(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t}function xr(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t}function wr(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t}function Sr(t,e){var r=t[0],n=t[1],i=t[2],a=e[0],o=e[1],s=e[2],h=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(a*a+o*o+s*s),c=h&&lr(t,e)/h;return Math.acos(Math.min(Math.max(c,-1),1))}function Pr(t){return t[0]=0,t[1]=0,t[2]=0,t}function Ir(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function _r(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Br(t,e){var r=t[0],n=t[1],i=t[2],a=e[0],o=e[1],s=e[2];return Math.abs(r-a)<=d*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-o)<=d*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=d*Math.max(1,Math.abs(i),Math.abs(s))}var Or,Ar=$e,Cr=We,qr=Qe,kr=ar,Rr=or,Er=Xe,Fr=sr,Lr=(Or=Ve(),function(t,e,r,n,i,a){var o,s;for(e||(e=3),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,o=r;o0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o,t}function sn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function hn(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],a=r[0]*n[2]-r[2]*n[0],o=r[0]*n[3]-r[3]*n[0],s=r[1]*n[2]-r[2]*n[1],h=r[1]*n[3]-r[3]*n[1],c=r[2]*n[3]-r[3]*n[2],u=e[0],l=e[1],f=e[2],d=e[3];return t[0]=l*c-f*h+d*s,t[1]=-u*c+f*o-d*a,t[2]=u*h-l*o+d*i,t[3]=-u*s+l*a-f*i,t}function cn(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}function un(t,e){var r,n,i,a,o,s;e=e||1;do{o=(r=2*g()-1)*r+(n=2*g()-1)*n}while(o>=1);do{s=(i=2*g()-1)*i+(a=2*g()-1)*a}while(s>=1);var h=Math.sqrt((1-o)/s);return t[0]=e*r,t[1]=e*n,t[2]=e*i*h,t[3]=e*a*h,t}function ln(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}function fn(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],h=r[2],c=r[3],u=c*n+s*a-h*i,l=c*i+h*n-o*a,f=c*a+o*i-s*n,d=-o*n-s*i-h*a;return t[0]=u*c+d*-o+l*-h-f*-s,t[1]=l*c+d*-s+f*-o-u*-h,t[2]=f*c+d*-h+u*-s-l*-o,t[3]=e[3],t}function dn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function pn(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function gn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function mn(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],h=e[2],c=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-h)<=d*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-c)<=d*Math.max(1,Math.abs(a),Math.abs(c))}var vn=Yr,Mn=Xr,bn=Zr,yn=Kr,xn=tn,wn=en,Sn=rn,Pn=function(){var t=Tr();return function(e,r,n,i,a,o){var s,h;for(r||(r=4),n||(n=0),h=i?Math.min(i*r+n,e.length):e.length,s=n;sd?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r}function An(t,e){var r=ii(t,e);return Math.acos(2*r*r-1)}function Cn(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],h=r[1],c=r[2],u=r[3];return t[0]=n*u+o*s+i*c-a*h,t[1]=i*u+o*h+a*s-n*c,t[2]=a*u+o*c+n*h-i*s,t[3]=o*u-n*s-i*h-a*c,t}function qn(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),h=Math.cos(r);return t[0]=n*h+o*s,t[1]=i*h+a*s,t[2]=a*h-i*s,t[3]=o*h-n*s,t}function kn(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),h=Math.cos(r);return t[0]=n*h-a*s,t[1]=i*h+o*s,t[2]=a*h+n*s,t[3]=o*h-i*s,t}function Rn(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),h=Math.cos(r);return t[0]=n*h+i*s,t[1]=i*h-n*s,t[2]=a*h+o*s,t[3]=o*h-a*s,t}function En(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function Fn(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=Math.sqrt(r*r+n*n+i*i),s=Math.exp(a),h=o>0?s*Math.sin(o)/o:0;return t[0]=r*h,t[1]=n*h,t[2]=i*h,t[3]=s*Math.cos(o),t}function Ln(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=Math.sqrt(r*r+n*n+i*i),s=o>0?Math.atan2(o,a)/o:0;return t[0]=r*s,t[1]=n*s,t[2]=i*s,t[3]=.5*Math.log(r*r+n*n+i*i+a*a),t}function Tn(t,e,r){return Ln(t,e),ni(t,t,r),Fn(t,t),t}function Dn(t,e,r,n){var i,a,o,s,h,c=e[0],u=e[1],l=e[2],f=e[3],p=r[0],g=r[1],m=r[2],v=r[3];return(a=c*p+u*g+l*m+f*v)<0&&(a=-a,p=-p,g=-g,m=-m,v=-v),1-a>d?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,h=Math.sin(n*i)/o):(s=1-n,h=n),t[0]=s*c+h*p,t[1]=s*u+h*g,t[2]=s*l+h*m,t[3]=s*f+h*v,t}function jn(t){var e=g(),r=g(),n=g(),i=Math.sqrt(1-e),a=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*r),t[1]=i*Math.cos(2*Math.PI*r),t[2]=a*Math.sin(2*Math.PI*n),t[3]=a*Math.cos(2*Math.PI*n),t}function zn(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=a*s,t}function Un(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Vn(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*a+o]-e[3*o+a])*r,t[a]=(e[3*a+i]+e[3*i+a])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t}function Yn(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var a=Math.sin(e),o=Math.cos(e),s=Math.sin(r),h=Math.cos(r),c=Math.sin(n),u=Math.cos(n);return t[0]=a*h*u-o*s*c,t[1]=o*s*u+a*h*c,t[2]=o*h*c-a*s*u,t[3]=o*h*u+a*s*c,t}function Xn(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var Zn,Gn,Nn,Hn,$n,Wn,Qn=Dr,Jn=jr,Kn=zr,ti=Ur,ei=Vr,ri=Cn,ni=Qr,ii=sn,ai=cn,oi=en,si=oi,hi=rn,ci=hi,ui=on,li=gn,fi=mn,di=(Zn=Ve(),Gn=Ze(1,0,0),Nn=Ze(0,1,0),function(t,e,r){var n=lr(e,r);return n<-.999999?(fr(Zn,Gn,e),Er(Zn)<1e-6&&fr(Zn,Nn,e),ur(Zn,Zn),Bn(t,Zn,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(fr(Zn,e,r),t[0]=Zn[0],t[1]=Zn[1],t[2]=Zn[2],t[3]=1+n,ui(t,t))}),pi=(Hn=In(),$n=In(),function(t,e,r,n,i,a){return Dn(Hn,e,i,a),Dn($n,r,n,a),Dn(t,Hn,$n,2*a*(1-a)),t}),gi=(Wn=vt(),function(t,e,r,n){return Wn[0]=r[0],Wn[3]=r[1],Wn[6]=r[2],Wn[1]=n[0],Wn[4]=n[1],Wn[7]=n[2],Wn[2]=-e[0],Wn[5]=-e[1],Wn[8]=-e[2],ui(t,Vn(t,Wn))});function mi(){var t=new p(8);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function vi(t){var e=new p(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function Mi(t,e,r,n,i,a,o,s){var h=new p(8);return h[0]=t,h[1]=e,h[2]=r,h[3]=n,h[4]=i,h[5]=a,h[6]=o,h[7]=s,h}function bi(t,e,r,n,i,a,o){var s=new p(8);s[0]=t,s[1]=e,s[2]=r,s[3]=n;var h=.5*i,c=.5*a,u=.5*o;return s[4]=h*n+c*r-u*e,s[5]=c*n+u*t-h*r,s[6]=u*n+h*e-c*t,s[7]=-h*t-c*e-u*r,s}function yi(t,e,r){var n=.5*r[0],i=.5*r[1],a=.5*r[2],o=e[0],s=e[1],h=e[2],c=e[3];return t[0]=o,t[1]=s,t[2]=h,t[3]=c,t[4]=n*c+i*h-a*s,t[5]=i*c+a*o-n*h,t[6]=a*c+n*s-i*o,t[7]=-n*o-i*s-a*h,t}function xi(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function wi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Si(t,e){var r=In();we(r,e);var n=new p(3);return ye(n,e),yi(t,r,n),t}function Pi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function Ii(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function _i(t,e,r,n,i,a,o,s,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=h,t}var Bi=Kn;function Oi(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var Ai=Kn;function Ci(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function qi(t,e){var r=e[4],n=e[5],i=e[6],a=e[7],o=-e[0],s=-e[1],h=-e[2],c=e[3];return t[0]=2*(r*c+a*o+n*h-i*s),t[1]=2*(n*c+a*s+i*o-r*h),t[2]=2*(i*c+a*h+r*s-n*o),t}function ki(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=.5*r[0],h=.5*r[1],c=.5*r[2],u=e[4],l=e[5],f=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=o*s+i*c-a*h+u,t[5]=o*h+a*s-n*c+l,t[6]=o*c+n*h-i*s+f,t[7]=-n*s-i*h-a*c+d,t}function Ri(t,e,r){var n=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],h=e[5],c=e[6],u=e[7],l=s*o+u*n+h*a-c*i,f=h*o+u*i+c*n-s*a,d=c*o+u*a+s*i-h*n,p=u*o-s*n-h*i-c*a;return qn(t,e,r),n=t[0],i=t[1],a=t[2],o=t[3],t[4]=l*o+p*n+f*a-d*i,t[5]=f*o+p*i+d*n-l*a,t[6]=d*o+p*a+l*i-f*n,t[7]=p*o-l*n-f*i-d*a,t}function Ei(t,e,r){var n=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],h=e[5],c=e[6],u=e[7],l=s*o+u*n+h*a-c*i,f=h*o+u*i+c*n-s*a,d=c*o+u*a+s*i-h*n,p=u*o-s*n-h*i-c*a;return kn(t,e,r),n=t[0],i=t[1],a=t[2],o=t[3],t[4]=l*o+p*n+f*a-d*i,t[5]=f*o+p*i+d*n-l*a,t[6]=d*o+p*a+l*i-f*n,t[7]=p*o-l*n-f*i-d*a,t}function Fi(t,e,r){var n=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],h=e[5],c=e[6],u=e[7],l=s*o+u*n+h*a-c*i,f=h*o+u*i+c*n-s*a,d=c*o+u*a+s*i-h*n,p=u*o-s*n-h*i-c*a;return Rn(t,e,r),n=t[0],i=t[1],a=t[2],o=t[3],t[4]=l*o+p*n+f*a-d*i,t[5]=f*o+p*i+d*n-l*a,t[6]=d*o+p*a+l*i-f*n,t[7]=p*o-l*n-f*i-d*a,t}function Li(t,e,r){var n=r[0],i=r[1],a=r[2],o=r[3],s=e[0],h=e[1],c=e[2],u=e[3];return t[0]=s*o+u*n+h*a-c*i,t[1]=h*o+u*i+c*n-s*a,t[2]=c*o+u*a+s*i-h*n,t[3]=u*o-s*n-h*i-c*a,s=e[4],h=e[5],c=e[6],u=e[7],t[4]=s*o+u*n+h*a-c*i,t[5]=h*o+u*i+c*n-s*a,t[6]=c*o+u*a+s*i-h*n,t[7]=u*o-s*n-h*i-c*a,t}function Ti(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],h=r[1],c=r[2],u=r[3];return t[0]=n*u+o*s+i*c-a*h,t[1]=i*u+o*h+a*s-n*c,t[2]=a*u+o*c+n*h-i*s,t[3]=o*u-n*s-i*h-a*c,s=r[4],h=r[5],c=r[6],u=r[7],t[4]=n*u+o*s+i*c-a*h,t[5]=i*u+o*h+a*s-n*c,t[6]=a*u+o*c+n*h-i*s,t[7]=o*u-n*s-i*h-a*c,t}function Di(t,e,r,n){if(Math.abs(n)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,a=e[2]/r,o=e[3]/r,s=e[4],h=e[5],c=e[6],u=e[7],l=n*s+i*h+a*c+o*u;t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=(s-n*l)/r,t[5]=(h-i*l)/r,t[6]=(c-a*l)/r,t[7]=(u-o*l)/r}return t}function Ji(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function Ki(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function ta(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],h=t[6],c=t[7],u=e[0],l=e[1],f=e[2],p=e[3],g=e[4],m=e[5],v=e[6],M=e[7];return Math.abs(r-u)<=d*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-l)<=d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-f)<=d*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(a-p)<=d*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(o-g)<=d*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(s-m)<=d*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(h-v)<=d*Math.max(1,Math.abs(h),Math.abs(v))&&Math.abs(c-M)<=d*Math.max(1,Math.abs(c),Math.abs(M))}function ea(){var t=new p(2);return p!=Float32Array&&(t[0]=0,t[1]=0),t}function ra(t){var e=new p(2);return e[0]=t[0],e[1]=t[1],e}function na(t,e){var r=new p(2);return r[0]=t,r[1]=e,r}function ia(t,e){return t[0]=e[0],t[1]=e[1],t}function aa(t,e,r){return t[0]=e,t[1]=r,t}function oa(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function sa(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function ha(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function ca(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function ua(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function la(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function fa(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function da(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function pa(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function ga(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function ma(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function va(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function Ma(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function ba(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function ya(t){var e=t[0],r=t[1];return e*e+r*r}function xa(t,e){return t[0]=-e[0],t[1]=-e[1],t}function wa(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function Sa(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function Pa(t,e){return t[0]*e[0]+t[1]*e[1]}function Ia(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function _a(t,e,r,n){var i=e[0],a=e[1];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t}function Ba(t,e){e=e||1;var r=2*g()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function Oa(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function Aa(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function Ca(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function qa(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function ka(t,e,r,n){var i=e[0]-r[0],a=e[1]-r[1],o=Math.sin(n),s=Math.cos(n);return t[0]=i*s-a*o+r[0],t[1]=i*o+a*s+r[1],t}function Ra(t,e){var r=t[0],n=t[1],i=e[0],a=e[1],o=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+a*a),s=o&&(r*i+n*a)/o;return Math.acos(Math.min(Math.max(s,-1),1))}function Ea(t){return t[0]=0,t[1]=0,t}function Fa(t){return"vec2("+t[0]+", "+t[1]+")"}function La(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ta(t,e){var r=t[0],n=t[1],i=e[0],a=e[1];return Math.abs(r-i)<=d*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))}var Da=ba,ja=sa,za=ha,Ua=ca,Va=va,Ya=Ma,Xa=ya,Za=function(){var t=ea();return function(e,r,n,i,a,o){var s,h;for(r||(r=2),n||(n=0),h=i?Math.min(i*r+n,e.length):e.length,s=n;s{var n;!function(){var i=.5*(Math.sqrt(3)-1),a=(3-Math.sqrt(3))/6,o=1/6,s=(Math.sqrt(5)-1)/4,h=(5-Math.sqrt(5))/20;function c(t){var e;e="function"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=l();t=i(" "),e=i(" "),r=i(" ");for(var a=0;a>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}c.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,o=this.permMod12,s=this.perm,h=this.grad3,c=0,u=0,l=0,f=(t+e)*i,d=Math.floor(t+f),p=Math.floor(e+f),g=(d+p)*a,m=t-(d-g),v=e-(p-g);m>v?(r=1,n=0):(r=0,n=1);var M=m-r+a,b=v-n+a,y=m-1+2*a,x=v-1+2*a,w=255&d,S=255&p,P=.5-m*m-v*v;if(P>=0){var I=3*o[w+s[S]];c=(P*=P)*P*(h[I]*m+h[I+1]*v)}var _=.5-M*M-b*b;if(_>=0){var B=3*o[w+r+s[S+n]];u=(_*=_)*_*(h[B]*M+h[B+1]*b)}var O=.5-y*y-x*x;if(O>=0){var A=3*o[w+1+s[S+1]];l=(O*=O)*O*(h[A]*y+h[A+1]*x)}return 70*(c+u+l)},noise3D:function(t,e,r){var n,i,a,s,h,c,u,l,f,d,p=this.permMod12,g=this.perm,m=this.grad3,v=.3333333333333333*(t+e+r),M=Math.floor(t+v),b=Math.floor(e+v),y=Math.floor(r+v),x=(M+b+y)*o,w=t-(M-x),S=e-(b-x),P=r-(y-x);w>=S?S>=P?(h=1,c=0,u=0,l=1,f=1,d=0):w>=P?(h=1,c=0,u=0,l=1,f=0,d=1):(h=0,c=0,u=1,l=1,f=0,d=1):Sk?F++:L++,q>R?F++:T++,q>E?F++:D++,k>R?L++:T++,k>E?L++:D++,R>E?T++:D++;var j=q-(l=F>=3?1:0)+h,z=k-(f=L>=3?1:0)+h,U=R-(d=T>=3?1:0)+h,V=E-(p=D>=3?1:0)+h,Y=q-(g=F>=2?1:0)+2*h,X=k-(m=L>=2?1:0)+2*h,Z=R-(v=T>=2?1:0)+2*h,G=E-(M=D>=2?1:0)+2*h,N=q-(b=F>=1?1:0)+3*h,H=k-(y=L>=1?1:0)+3*h,$=R-(x=T>=1?1:0)+3*h,W=E-(w=D>=1?1:0)+3*h,Q=q-1+4*h,J=k-1+4*h,K=R-1+4*h,tt=E-1+4*h,et=255&_,rt=255&B,nt=255&O,it=255&A,at=.6-q*q-k*k-R*R-E*E;if(at<0)i=0;else{var ot=S[et+S[rt+S[nt+S[it]]]]%32*4;i=(at*=at)*at*(P[ot]*q+P[ot+1]*k+P[ot+2]*R+P[ot+3]*E)}var st=.6-j*j-z*z-U*U-V*V;if(st<0)a=0;else{var ht=S[et+l+S[rt+f+S[nt+d+S[it+p]]]]%32*4;a=(st*=st)*st*(P[ht]*j+P[ht+1]*z+P[ht+2]*U+P[ht+3]*V)}var ct=.6-Y*Y-X*X-Z*Z-G*G;if(ct<0)o=0;else{var ut=S[et+g+S[rt+m+S[nt+v+S[it+M]]]]%32*4;o=(ct*=ct)*ct*(P[ut]*Y+P[ut+1]*X+P[ut+2]*Z+P[ut+3]*G)}var lt=.6-N*N-H*H-$*$-W*W;if(lt<0)c=0;else{var ft=S[et+b+S[rt+y+S[nt+x+S[it+w]]]]%32*4;c=(lt*=lt)*lt*(P[ft]*N+P[ft+1]*H+P[ft+2]*$+P[ft+3]*W)}var dt=.6-Q*Q-J*J-K*K-tt*tt;if(dt<0)u=0;else{var pt=S[et+1+S[rt+1+S[nt+1+S[it+1]]]]%32*4;u=(dt*=dt)*dt*(P[pt]*Q+P[pt+1]*J+P[pt+2]*K+P[pt+3]*tt)}return 27*(i+a+o+c+u)}},c._buildPermutationTable=u,void 0===(n=function(){return c}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=c,t.exports=c}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n].call(a.exports,a,a.exports,r),a.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{r.d(n,{fw:()=>B,Cd:()=>m.C,YG:()=>O.T,ZA:()=>i.Group,x1:()=>f.x,O7:()=>y.O,Dg:()=>w.Modifier,qn:()=>S.q,Q_:()=>_.PHI,yo:()=>_.PI2,mg:()=>g.m,UL:()=>p.U,he:()=>M.h,xs:()=>t.Scene,YM:()=>e.SceneChild,bn:()=>c.Shape,pK:()=>a.ShapeBase,rR:()=>h.ShapeBuffer,Sj:()=>l.S,Xc:()=>s.ShapeLoop,Gx:()=>o.ShapePrimitive,vI:()=>u.v,rU:()=>b.r,Ux:()=>v.U,yq:()=>x.y,CJ:()=>d.C,Sg:()=>I.default,X$:()=>t.__esModule,B7:()=>P.angle2FromRepetition,aT:()=>P.angleFromRepetition,uZ:()=>P.clamp,db:()=>P.distanceFromRepetition,NZ:()=>P.distributePointsInBuffer,sX:()=>P.interpolate,t7:()=>P.lerp,cM:()=>_.log,wQ:()=>_.mod,tF:()=>P.noise,zO:()=>P.now,tm:()=>P.prepareBufferForInterpolation,MX:()=>P.random,Sr:()=>P.relativeClamp,yx:()=>P.toDegrees,Yr:()=>P.toRadians});var t=r(1378),e=r(541),i=r(2513),a=r(2648),o=r(3674),s=r(6951),h=r(7439),c=r(6448),u=r(8563),l=r(5382),f=r(6329),d=r(4233),p=r(5510),g=r(2982),m=r(7520),v=r(9667),M=r(894),b=r(5719),y=r(1451),x=r(3977),w=r(9958),S=r(9514),P=r(313),I=r(795),_=r(3792),B=r(7518),O=r(2251)})();var i=n.fw,a=n.Cd,o=n.YG,s=n.ZA,h=n.x1,c=n.O7,u=n.Dg,l=n.qn,f=n.Q_,d=n.yo,p=n.mg,g=n.UL,m=n.he,v=n.xs,M=n.YM,b=n.bn,y=n.pK,x=n.rR,w=n.Sj,S=n.Xc,P=n.Gx,I=n.vI,_=n.rU,B=n.Ux,O=n.yq,A=n.CJ,C=n.Sg,q=n.X$,k=n.B7,R=n.aT,E=n.uZ,F=n.db,L=n.NZ,T=n.sX,D=n.t7,j=n.cM,z=n.wQ,U=n.tF,V=n.zO,Y=n.tm,X=n.MX,Z=n.Sr,G=n.yx,N=n.Yr;export{i as Animation,a as Circle,o as DrawerCanvas,s as Group,h as Line,c as Lissajous,u as Modifier,l as Modifiers,f as PHI,d as PI2,p as Polygon,g as Rect,m as Rose,v as Scene,M as SceneChild,b as Shape,y as ShapeBase,x as ShapeBuffer,w as ShapeFollow,S as ShapeLoop,P as ShapePrimitive,I as ShapeRecursive,_ as Spiral,B as Star,O as SuperShape,A as Triangle,C as Vec2,q as __esModule,k as angle2FromRepetition,R as angleFromRepetition,E as clamp,F as distanceFromRepetition,L as distributePointsInBuffer,T as interpolate,D as lerp,j as log,z as mod,U as noise,V as now,Y as prepareBufferForInterpolation,X as random,Z as relativeClamp,G as toDegrees,N as toRadians}; \ No newline at end of file diff --git a/build/esm/urpflanze-light.min.js.LICENSE.txt b/build/esm/urpflanze-light.min.js.LICENSE.txt index cd9329a..b1d6200 100644 --- a/build/esm/urpflanze-light.min.js.LICENSE.txt +++ b/build/esm/urpflanze-light.min.js.LICENSE.txt @@ -1,5 +1,5 @@ /*! - * @license UrpflanzeJS v"1.0.2" + * @license UrpflanzeJS v"1.0.3" * urpflanze-light.min.js * * Github: https://github.com/urpflanze-org/urpflanze diff --git a/build/esm/urpflanze.js b/build/esm/urpflanze.js index fff0b5a..d5df1ae 100644 --- a/build/esm/urpflanze.js +++ b/build/esm/urpflanze.js @@ -1,5 +1,5 @@ /*! - * @license UrpflanzeJS v"1.0.2" + * @license UrpflanzeJS v"1.0.3" * urpflanze.js * * Github: https://github.com/urpflanze-org/urpflanze @@ -15,6 +15,50 @@ "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "Animation": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Animation), +/* harmony export */ "Circle": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Circle), +/* harmony export */ "DrawerCanvas": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.DrawerCanvas), +/* harmony export */ "Group": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Group), +/* harmony export */ "Line": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Line), +/* harmony export */ "Lissajous": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Lissajous), +/* harmony export */ "Modifier": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Modifier), +/* harmony export */ "Modifiers": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Modifiers), +/* harmony export */ "PHI": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.PHI), +/* harmony export */ "PI2": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.PI2), +/* harmony export */ "Polygon": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Polygon), +/* harmony export */ "Rect": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Rect), +/* harmony export */ "Rose": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Rose), +/* harmony export */ "Scene": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Scene), +/* harmony export */ "SceneChild": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.SceneChild), +/* harmony export */ "Shape": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Shape), +/* harmony export */ "ShapeBase": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.ShapeBase), +/* harmony export */ "ShapeBuffer": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.ShapeBuffer), +/* harmony export */ "ShapeFollow": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.ShapeFollow), +/* harmony export */ "ShapeLoop": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.ShapeLoop), +/* harmony export */ "ShapePrimitive": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.ShapePrimitive), +/* harmony export */ "ShapeRecursive": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.ShapeRecursive), +/* harmony export */ "Spiral": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Spiral), +/* harmony export */ "Star": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Star), +/* harmony export */ "SuperShape": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.SuperShape), +/* harmony export */ "Triangle": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Triangle), +/* harmony export */ "Vec2": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.Vec2), +/* harmony export */ "__esModule": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.__esModule), +/* harmony export */ "angle2FromRepetition": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.angle2FromRepetition), +/* harmony export */ "angleFromRepetition": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.angleFromRepetition), +/* harmony export */ "clamp": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.clamp), +/* harmony export */ "distanceFromRepetition": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.distanceFromRepetition), +/* harmony export */ "distributePointsInBuffer": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.distributePointsInBuffer), +/* harmony export */ "interpolate": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.interpolate), +/* harmony export */ "lerp": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.lerp), +/* harmony export */ "log": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.log), +/* harmony export */ "mod": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.mod), +/* harmony export */ "noise": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.noise), +/* harmony export */ "now": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.now), +/* harmony export */ "prepareBufferForInterpolation": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.prepareBufferForInterpolation), +/* harmony export */ "random": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.random), +/* harmony export */ "relativeClamp": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.relativeClamp), +/* harmony export */ "toDegrees": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.toDegrees), +/* harmony export */ "toRadians": () => (/* reexport safe */ _modules_light__WEBPACK_IMPORTED_MODULE_0__.toRadians), /* harmony export */ "Color": () => (/* reexport module object */ _urpflanze_color_dist_cjs__WEBPACK_IMPORTED_MODULE_1__), /* harmony export */ "Renderer": () => (/* reexport safe */ _urpflanze_drawer_canvas_dist_cjs__WEBPACK_IMPORTED_MODULE_2__.Renderer), /* harmony export */ "Timeline": () => (/* reexport safe */ _urpflanze_drawer_canvas_dist_cjs__WEBPACK_IMPORTED_MODULE_2__.Timeline), @@ -23,12 +67,6 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "SVGImporter": () => (/* reexport safe */ _urpflanze_svg_importer__WEBPACK_IMPORTED_MODULE_5__.SVGImporter) /* harmony export */ }); /* harmony import */ var _modules_light__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); -/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; -/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _modules_light__WEBPACK_IMPORTED_MODULE_0__) if(["default","Color","Renderer","Timeline","GCODEExporter","SVGExporter","SVGImporter"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _modules_light__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__] -/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); -/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; -/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _modules_light__WEBPACK_IMPORTED_MODULE_0__) if(["default","Color","Renderer","Timeline","GCODEExporter","SVGExporter","SVGImporter","Animation","DrawerCanvas"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _modules_light__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__] -/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); /* harmony import */ var _urpflanze_color_dist_cjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(63); /* harmony import */ var _urpflanze_color_dist_cjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_urpflanze_color_dist_cjs__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _urpflanze_drawer_canvas_dist_cjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79); @@ -45,7 +83,6 @@ __webpack_require__.r(__webpack_exports__); - //# sourceMappingURL=modules.js.map /***/ }), @@ -55,14 +92,52 @@ __webpack_require__.r(__webpack_exports__); "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "Circle": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Circle), +/* harmony export */ "Group": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Group), +/* harmony export */ "Line": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Line), +/* harmony export */ "Lissajous": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Lissajous), +/* harmony export */ "Modifier": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Modifier), +/* harmony export */ "Modifiers": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Modifiers), +/* harmony export */ "PHI": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.PHI), +/* harmony export */ "PI2": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.PI2), +/* harmony export */ "Polygon": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Polygon), +/* harmony export */ "Rect": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Rect), +/* harmony export */ "Rose": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Rose), +/* harmony export */ "Scene": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Scene), +/* harmony export */ "SceneChild": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.SceneChild), +/* harmony export */ "Shape": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Shape), +/* harmony export */ "ShapeBase": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.ShapeBase), +/* harmony export */ "ShapeBuffer": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.ShapeBuffer), +/* harmony export */ "ShapeFollow": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.ShapeFollow), +/* harmony export */ "ShapeLoop": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.ShapeLoop), +/* harmony export */ "ShapePrimitive": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.ShapePrimitive), +/* harmony export */ "ShapeRecursive": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.ShapeRecursive), +/* harmony export */ "Spiral": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Spiral), +/* harmony export */ "Star": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Star), +/* harmony export */ "SuperShape": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.SuperShape), +/* harmony export */ "Triangle": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Triangle), +/* harmony export */ "Vec2": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.Vec2), +/* harmony export */ "__esModule": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.__esModule), +/* harmony export */ "angle2FromRepetition": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.angle2FromRepetition), +/* harmony export */ "angleFromRepetition": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.angleFromRepetition), +/* harmony export */ "clamp": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.clamp), +/* harmony export */ "distanceFromRepetition": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.distanceFromRepetition), +/* harmony export */ "distributePointsInBuffer": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.distributePointsInBuffer), +/* harmony export */ "interpolate": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.interpolate), +/* harmony export */ "lerp": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.lerp), +/* harmony export */ "log": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.log), +/* harmony export */ "mod": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.mod), +/* harmony export */ "noise": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.noise), +/* harmony export */ "now": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.now), +/* harmony export */ "prepareBufferForInterpolation": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.prepareBufferForInterpolation), +/* harmony export */ "random": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.random), +/* harmony export */ "relativeClamp": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.relativeClamp), +/* harmony export */ "toDegrees": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.toDegrees), +/* harmony export */ "toRadians": () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.toRadians), /* harmony export */ "Animation": () => (/* reexport module object */ _urpflanze_animation_dist_cjs__WEBPACK_IMPORTED_MODULE_1__), /* harmony export */ "DrawerCanvas": () => (/* reexport safe */ _urpflanze_drawer_canvas_dist_cjs_browser_BrowserDrawerCanvas__WEBPACK_IMPORTED_MODULE_2__.BrowserDrawerCanvas) /* harmony export */ }); -/* harmony import */ var _urpflanze_core_dist_cjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); -/* harmony import */ var _urpflanze_core_dist_cjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_urpflanze_core_dist_cjs__WEBPACK_IMPORTED_MODULE_0__); -/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; -/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _urpflanze_core_dist_cjs__WEBPACK_IMPORTED_MODULE_0__) if(["default","Animation","DrawerCanvas"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _urpflanze_core_dist_cjs__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__] -/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); +/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); /* harmony import */ var _urpflanze_animation_dist_cjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(58); /* harmony import */ var _urpflanze_animation_dist_cjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_urpflanze_animation_dist_cjs__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _urpflanze_drawer_canvas_dist_cjs_browser_BrowserDrawerCanvas__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(72); @@ -73,9191 +148,9216 @@ __webpack_require__.r(__webpack_exports__); /***/ }), /* 3 */ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "Scene": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Scene__WEBPACK_IMPORTED_MODULE_0__.Scene), +/* harmony export */ "__esModule": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Scene__WEBPACK_IMPORTED_MODULE_0__.__esModule), +/* harmony export */ "SceneChild": () => (/* reexport safe */ _urpflanze_core_dist_cjs_SceneChild__WEBPACK_IMPORTED_MODULE_1__.SceneChild), +/* harmony export */ "Group": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Group__WEBPACK_IMPORTED_MODULE_2__.Group), +/* harmony export */ "ShapeBase": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_ShapeBase__WEBPACK_IMPORTED_MODULE_3__.ShapeBase), +/* harmony export */ "ShapePrimitive": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_ShapePrimitive__WEBPACK_IMPORTED_MODULE_4__.ShapePrimitive), +/* harmony export */ "ShapeLoop": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_ShapeLoop__WEBPACK_IMPORTED_MODULE_5__.ShapeLoop), +/* harmony export */ "ShapeBuffer": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_ShapeBuffer__WEBPACK_IMPORTED_MODULE_6__.ShapeBuffer), +/* harmony export */ "Shape": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_Shape__WEBPACK_IMPORTED_MODULE_7__.Shape), +/* harmony export */ "ShapeRecursive": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_ShapeRecursive__WEBPACK_IMPORTED_MODULE_8__.ShapeRecursive), +/* harmony export */ "ShapeFollow": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_ShapeFollow__WEBPACK_IMPORTED_MODULE_9__.ShapeFollow), +/* harmony export */ "Line": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_primitives_Line__WEBPACK_IMPORTED_MODULE_10__.Line), +/* harmony export */ "Triangle": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_primitives_Triangle__WEBPACK_IMPORTED_MODULE_11__.Triangle), +/* harmony export */ "Rect": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_primitives_Rect__WEBPACK_IMPORTED_MODULE_12__.Rect), +/* harmony export */ "Polygon": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_primitives_Polygon__WEBPACK_IMPORTED_MODULE_13__.Polygon), +/* harmony export */ "Circle": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_primitives_Circle__WEBPACK_IMPORTED_MODULE_14__.Circle), +/* harmony export */ "Star": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_primitives_Star__WEBPACK_IMPORTED_MODULE_15__.Star), +/* harmony export */ "Rose": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_primitives_Rose__WEBPACK_IMPORTED_MODULE_16__.Rose), +/* harmony export */ "Spiral": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_primitives_Spiral__WEBPACK_IMPORTED_MODULE_17__.Spiral), +/* harmony export */ "Lissajous": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_primitives_Lissajous__WEBPACK_IMPORTED_MODULE_18__.Lissajous), +/* harmony export */ "SuperShape": () => (/* reexport safe */ _urpflanze_core_dist_cjs_shapes_primitives_SuperShape__WEBPACK_IMPORTED_MODULE_19__.SuperShape), +/* harmony export */ "Modifier": () => (/* reexport safe */ _urpflanze_core_dist_cjs_modifiers_Modifier__WEBPACK_IMPORTED_MODULE_20__.Modifier), +/* harmony export */ "Modifiers": () => (/* reexport safe */ _urpflanze_core_dist_cjs_modifiers__WEBPACK_IMPORTED_MODULE_21__.Modifiers), +/* harmony export */ "lerp": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.lerp), +/* harmony export */ "clamp": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.clamp), +/* harmony export */ "relativeClamp": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.relativeClamp), +/* harmony export */ "toDegrees": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.toDegrees), +/* harmony export */ "toRadians": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.toRadians), +/* harmony export */ "now": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.now), +/* harmony export */ "noise": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.noise), +/* harmony export */ "random": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.random), +/* harmony export */ "angleFromRepetition": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.angleFromRepetition), +/* harmony export */ "angle2FromRepetition": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.angle2FromRepetition), +/* harmony export */ "distanceFromRepetition": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.distanceFromRepetition), +/* harmony export */ "interpolate": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.interpolate), +/* harmony export */ "prepareBufferForInterpolation": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.prepareBufferForInterpolation), +/* harmony export */ "distributePointsInBuffer": () => (/* reexport safe */ _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__.distributePointsInBuffer), +/* harmony export */ "Vec2": () => (/* reexport safe */ _urpflanze_core_dist_cjs_math_Vec2__WEBPACK_IMPORTED_MODULE_23__.default), +/* harmony export */ "PHI": () => (/* reexport safe */ _urpflanze_core_dist_cjs_math__WEBPACK_IMPORTED_MODULE_24__.PHI), +/* harmony export */ "PI2": () => (/* reexport safe */ _urpflanze_core_dist_cjs_math__WEBPACK_IMPORTED_MODULE_24__.PI2), +/* harmony export */ "log": () => (/* reexport safe */ _urpflanze_core_dist_cjs_math__WEBPACK_IMPORTED_MODULE_24__.log), +/* harmony export */ "mod": () => (/* reexport safe */ _urpflanze_core_dist_cjs_math__WEBPACK_IMPORTED_MODULE_24__.mod) +/* harmony export */ }); +/* harmony import */ var _urpflanze_core_dist_cjs_Scene__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); +/* harmony import */ var _urpflanze_core_dist_cjs_SceneChild__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5); +/* harmony import */ var _urpflanze_core_dist_cjs_Group__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_ShapeBase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_ShapePrimitive__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(36); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_ShapeLoop__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(37); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_ShapeBuffer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(38); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_Shape__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(35); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_ShapeRecursive__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(39); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_ShapeFollow__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(40); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_primitives_Line__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(41); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_primitives_Triangle__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(42); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_primitives_Rect__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(43); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_primitives_Polygon__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(44); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_primitives_Circle__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(45); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_primitives_Star__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(46); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_primitives_Rose__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(47); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_primitives_Spiral__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(48); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_primitives_Lissajous__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(49); +/* harmony import */ var _urpflanze_core_dist_cjs_shapes_primitives_SuperShape__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(50); +/* harmony import */ var _urpflanze_core_dist_cjs_modifiers_Modifier__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(32); +/* harmony import */ var _urpflanze_core_dist_cjs_modifiers__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(51); +/* harmony import */ var _urpflanze_core_dist_cjs_Utilities__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(33); +/* harmony import */ var _urpflanze_core_dist_cjs_math_Vec2__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(29); +/* harmony import */ var _urpflanze_core_dist_cjs_math__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(30); -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.mod = exports.log = exports.PI2 = exports.PHI = exports.Vec2 = exports.distributePointsInBuffer = exports.prepareBufferForInterpolation = exports.interpolate = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.now = exports.toRadians = exports.toDegrees = exports.relativeClamp = exports.clamp = exports.lerp = void 0; -/** - * Types & Interface - */ -__exportStar(__webpack_require__(4), exports); -// Set glMatrixArrayType -const gl_matrix_1 = __webpack_require__(13); -gl_matrix_1.glMatrix.setMatrixArrayType(Array); -/** - * Core - */ -__exportStar(__webpack_require__(24), exports); -__exportStar(__webpack_require__(25), exports); -__exportStar(__webpack_require__(26), exports); -// Shapes -__exportStar(__webpack_require__(27), exports); -__exportStar(__webpack_require__(36), exports); -__exportStar(__webpack_require__(37), exports); -__exportStar(__webpack_require__(38), exports); -__exportStar(__webpack_require__(35), exports); -__exportStar(__webpack_require__(39), exports); -__exportStar(__webpack_require__(40), exports); -__exportStar(__webpack_require__(41), exports); -__exportStar(__webpack_require__(42), exports); -__exportStar(__webpack_require__(43), exports); -__exportStar(__webpack_require__(44), exports); -__exportStar(__webpack_require__(45), exports); -__exportStar(__webpack_require__(46), exports); -__exportStar(__webpack_require__(47), exports); -__exportStar(__webpack_require__(48), exports); -__exportStar(__webpack_require__(49), exports); -__exportStar(__webpack_require__(50), exports); -// Modifiers -__exportStar(__webpack_require__(32), exports); -__exportStar(__webpack_require__(51), exports); -// Utilities -var Utilities_1 = __webpack_require__(33); -Object.defineProperty(exports, "lerp", ({ enumerable: true, get: function () { return Utilities_1.lerp; } })); -Object.defineProperty(exports, "clamp", ({ enumerable: true, get: function () { return Utilities_1.clamp; } })); -Object.defineProperty(exports, "relativeClamp", ({ enumerable: true, get: function () { return Utilities_1.relativeClamp; } })); -Object.defineProperty(exports, "toDegrees", ({ enumerable: true, get: function () { return Utilities_1.toDegrees; } })); -Object.defineProperty(exports, "toRadians", ({ enumerable: true, get: function () { return Utilities_1.toRadians; } })); -Object.defineProperty(exports, "now", ({ enumerable: true, get: function () { return Utilities_1.now; } })); -Object.defineProperty(exports, "noise", ({ enumerable: true, get: function () { return Utilities_1.noise; } })); -Object.defineProperty(exports, "random", ({ enumerable: true, get: function () { return Utilities_1.random; } })); -Object.defineProperty(exports, "angleFromRepetition", ({ enumerable: true, get: function () { return Utilities_1.angleFromRepetition; } })); -Object.defineProperty(exports, "angle2FromRepetition", ({ enumerable: true, get: function () { return Utilities_1.angle2FromRepetition; } })); -Object.defineProperty(exports, "distanceFromRepetition", ({ enumerable: true, get: function () { return Utilities_1.distanceFromRepetition; } })); -Object.defineProperty(exports, "interpolate", ({ enumerable: true, get: function () { return Utilities_1.interpolate; } })); -Object.defineProperty(exports, "prepareBufferForInterpolation", ({ enumerable: true, get: function () { return Utilities_1.prepareBufferForInterpolation; } })); -Object.defineProperty(exports, "distributePointsInBuffer", ({ enumerable: true, get: function () { return Utilities_1.distributePointsInBuffer; } })); -var Vec2_1 = __webpack_require__(29); -Object.defineProperty(exports, "Vec2", ({ enumerable: true, get: function () { return Vec2_1.default; } })); -var math_1 = __webpack_require__(30); -Object.defineProperty(exports, "PHI", ({ enumerable: true, get: function () { return math_1.PHI; } })); -Object.defineProperty(exports, "PI2", ({ enumerable: true, get: function () { return math_1.PI2; } })); -Object.defineProperty(exports, "log", ({ enumerable: true, get: function () { return math_1.log; } })); -Object.defineProperty(exports, "mod", ({ enumerable: true, get: function () { return math_1.mod; } })); -//# sourceMappingURL=index.js.map -/***/ }), -/* 4 */ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__webpack_require__(5), exports); -__exportStar(__webpack_require__(6), exports); -__exportStar(__webpack_require__(7), exports); -__exportStar(__webpack_require__(8), exports); -__exportStar(__webpack_require__(9), exports); -__exportStar(__webpack_require__(10), exports); -__exportStar(__webpack_require__(11), exports); -__exportStar(__webpack_require__(12), exports); -//# sourceMappingURL=index.js.map -/***/ }), -/* 5 */ -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=indexedBuffer.js.map -/***/ }), -/* 6 */ -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=propArguments.js.map -/***/ }), -/* 7 */ -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ERepetitionType = void 0; -/** - * Repetition type enumerator. - * - * @category Core.Repetition - * @internal - */ -var ERepetitionType; -(function (ERepetitionType) { - /** - * Defines the type of repetition of the shape, - * in a circular way starting from the center of the scene - * @order 1 - */ - ERepetitionType[ERepetitionType["Ring"] = 1] = "Ring"; - /** - * Defines the type of repetition of the shape, - * on a nxm grid starting from the center of the scene - * @order 2 - */ - ERepetitionType[ERepetitionType["Matrix"] = 2] = "Matrix"; -})(ERepetitionType = exports.ERepetitionType || (exports.ERepetitionType = {})); -//# sourceMappingURL=repetitions.js.map -/***/ }), -/* 8 */ -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=scene-child.js.map -/***/ }), -/* 9 */ -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=scene.js.map -/***/ }), -/* 10 */ -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EBoundingType = void 0; -var EBoundingType; -(function (EBoundingType) { - /** - * Relative to the real bounding of the shape - * @order 2 - */ - EBoundingType[EBoundingType["Relative"] = 1] = "Relative"; - /** - * Fixed to te width and height of the shape - * @order 3 - */ - EBoundingType[EBoundingType["Fixed"] = 2] = "Fixed"; -})(EBoundingType = exports.EBoundingType || (exports.EBoundingType = {})); -//# sourceMappingURL=shape-base.js.map -/***/ }), -/* 11 */ -/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -////// -//# sourceMappingURL=shape-primitives.js.map +//# sourceMappingURL=core.js.map /***/ }), -/* 12 */ -/***/ ((__unused_webpack_module, exports) => { +/* 4 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; -// Shape Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=shapes.js.map - -/***/ }), -/* 13 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "glMatrix": () => (/* reexport module object */ _common_js__WEBPACK_IMPORTED_MODULE_0__), -/* harmony export */ "mat2": () => (/* reexport module object */ _mat2_js__WEBPACK_IMPORTED_MODULE_1__), -/* harmony export */ "mat2d": () => (/* reexport module object */ _mat2d_js__WEBPACK_IMPORTED_MODULE_2__), -/* harmony export */ "mat3": () => (/* reexport module object */ _mat3_js__WEBPACK_IMPORTED_MODULE_3__), -/* harmony export */ "mat4": () => (/* reexport module object */ _mat4_js__WEBPACK_IMPORTED_MODULE_4__), -/* harmony export */ "quat": () => (/* reexport module object */ _quat_js__WEBPACK_IMPORTED_MODULE_5__), -/* harmony export */ "quat2": () => (/* reexport module object */ _quat2_js__WEBPACK_IMPORTED_MODULE_6__), -/* harmony export */ "vec2": () => (/* reexport module object */ _vec2_js__WEBPACK_IMPORTED_MODULE_7__), -/* harmony export */ "vec3": () => (/* reexport module object */ _vec3_js__WEBPACK_IMPORTED_MODULE_8__), -/* harmony export */ "vec4": () => (/* reexport module object */ _vec4_js__WEBPACK_IMPORTED_MODULE_9__) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); -/* harmony import */ var _mat2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15); -/* harmony import */ var _mat2d_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16); -/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17); -/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(18); -/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(19); -/* harmony import */ var _quat2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(22); -/* harmony import */ var _vec2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(23); -/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(21); -/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(20); - - - - - - - - - - - - -/***/ }), -/* 14 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "EPSILON": () => (/* binding */ EPSILON), -/* harmony export */ "ARRAY_TYPE": () => (/* binding */ ARRAY_TYPE), -/* harmony export */ "RANDOM": () => (/* binding */ RANDOM), -/* harmony export */ "setMatrixArrayType": () => (/* binding */ setMatrixArrayType), -/* harmony export */ "toRadian": () => (/* binding */ toRadian), -/* harmony export */ "equals": () => (/* binding */ equals) -/* harmony export */ }); -/** - * Common utilities - * @module glMatrix - */ -// Configuration Constants -var EPSILON = 0.000001; -var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array; -var RANDOM = Math.random; -/** - * Sets the type of array used when creating new vectors and matrices - * - * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array - */ - -function setMatrixArrayType(type) { - ARRAY_TYPE = type; -} -var degree = Math.PI / 180; -/** - * Convert Degree To Radian - * - * @param {Number} a Angle in Degrees - */ - -function toRadian(a) { - return a * degree; -} -/** - * Tests whether or not the arguments have approximately the same value, within an absolute - * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less - * than or equal to 1.0, and a relative tolerance is used for larger values) - * - * @param {Number} a The first number to test. - * @param {Number} b The second number to test. - * @returns {Boolean} True if the numbers are approximately equal, false otherwise. +exports.Scene = void 0; +const SceneChild_1 = __webpack_require__(5); +const Group_1 = __webpack_require__(6); +const Shape_1 = __webpack_require__(35); +const Utilities_1 = __webpack_require__(33); +/** + * Container for all SceneChild. + * The main purpose is to manage the drawing order and update the child buffers + * + * @order 1 + * @category Core.Scene + * @class Scene */ - -function equals(a, b) { - return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b)); -} -if (!Math.hypot) Math.hypot = function () { - var y = 0, - i = arguments.length; - - while (i--) { - y += arguments[i] * arguments[i]; - } - - return Math.sqrt(y); -}; - -/***/ }), -/* 15 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "transpose": () => (/* binding */ transpose), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "adjoint": () => (/* binding */ adjoint), -/* harmony export */ "determinant": () => (/* binding */ determinant), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "rotate": () => (/* binding */ rotate), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), -/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "frob": () => (/* binding */ frob), -/* harmony export */ "LDU": () => (/* binding */ LDU), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), -/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "sub": () => (/* binding */ sub) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); - -/** - * 2x2 Matrix - * @module mat2 - */ - -/** - * Creates a new identity mat2 - * - * @returns {mat2} a new 2x2 matrix - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[1] = 0; - out[2] = 0; - } - - out[0] = 1; - out[3] = 1; - return out; -} -/** - * Creates a new mat2 initialized with values from an existing matrix - * - * @param {ReadonlyMat2} a matrix to clone - * @returns {mat2} a new 2x2 matrix - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - return out; -} -/** - * Copy the values from one mat2 to another - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the source matrix - * @returns {mat2} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - return out; -} -/** - * Set a mat2 to the identity matrix - * - * @param {mat2} out the receiving matrix - * @returns {mat2} out - */ - -function identity(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 1; - return out; -} -/** - * Create a new mat2 with the given values - * - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m10 Component in column 1, row 0 position (index 2) - * @param {Number} m11 Component in column 1, row 1 position (index 3) - * @returns {mat2} out A new 2x2 matrix - */ - -function fromValues(m00, m01, m10, m11) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - out[0] = m00; - out[1] = m01; - out[2] = m10; - out[3] = m11; - return out; -} -/** - * Set the components of a mat2 to the given values - * - * @param {mat2} out the receiving matrix - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m10 Component in column 1, row 0 position (index 2) - * @param {Number} m11 Component in column 1, row 1 position (index 3) - * @returns {mat2} out - */ - -function set(out, m00, m01, m10, m11) { - out[0] = m00; - out[1] = m01; - out[2] = m10; - out[3] = m11; - return out; -} -/** - * Transpose the values of a mat2 - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the source matrix - * @returns {mat2} out - */ - -function transpose(out, a) { - // If we are transposing ourselves we can skip a few steps but have to cache - // some values - if (out === a) { - var a1 = a[1]; - out[1] = a[2]; - out[2] = a1; - } else { - out[0] = a[0]; - out[1] = a[2]; - out[2] = a[1]; - out[3] = a[3]; - } - - return out; -} -/** - * Inverts a mat2 - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the source matrix - * @returns {mat2} out - */ - -function invert(out, a) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; // Calculate the determinant - - var det = a0 * a3 - a2 * a1; - - if (!det) { - return null; - } - - det = 1.0 / det; - out[0] = a3 * det; - out[1] = -a1 * det; - out[2] = -a2 * det; - out[3] = a0 * det; - return out; -} -/** - * Calculates the adjugate of a mat2 - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the source matrix - * @returns {mat2} out - */ - -function adjoint(out, a) { - // Caching this value is nessecary if out == a - var a0 = a[0]; - out[0] = a[3]; - out[1] = -a[1]; - out[2] = -a[2]; - out[3] = a0; - return out; -} -/** - * Calculates the determinant of a mat2 - * - * @param {ReadonlyMat2} a the source matrix - * @returns {Number} determinant of a - */ - -function determinant(a) { - return a[0] * a[3] - a[2] * a[1]; -} -/** - * Multiplies two mat2's - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the first operand - * @param {ReadonlyMat2} b the second operand - * @returns {mat2} out - */ - -function multiply(out, a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3]; - out[0] = a0 * b0 + a2 * b1; - out[1] = a1 * b0 + a3 * b1; - out[2] = a0 * b2 + a2 * b3; - out[3] = a1 * b2 + a3 * b3; - return out; -} -/** - * Rotates a mat2 by the given angle - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat2} out - */ - -function rotate(out, a, rad) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var s = Math.sin(rad); - var c = Math.cos(rad); - out[0] = a0 * c + a2 * s; - out[1] = a1 * c + a3 * s; - out[2] = a0 * -s + a2 * c; - out[3] = a1 * -s + a3 * c; - return out; -} -/** - * Scales the mat2 by the dimensions in the given vec2 - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the matrix to rotate - * @param {ReadonlyVec2} v the vec2 to scale the matrix by - * @returns {mat2} out - **/ - -function scale(out, a, v) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var v0 = v[0], - v1 = v[1]; - out[0] = a0 * v0; - out[1] = a1 * v0; - out[2] = a2 * v1; - out[3] = a3 * v1; - return out; -} -/** - * Creates a matrix from a given angle - * This is equivalent to (but much faster than): - * - * mat2.identity(dest); - * mat2.rotate(dest, dest, rad); - * - * @param {mat2} out mat2 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat2} out - */ - -function fromRotation(out, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); - out[0] = c; - out[1] = s; - out[2] = -s; - out[3] = c; - return out; -} -/** - * Creates a matrix from a vector scaling - * This is equivalent to (but much faster than): - * - * mat2.identity(dest); - * mat2.scale(dest, dest, vec); - * - * @param {mat2} out mat2 receiving operation result - * @param {ReadonlyVec2} v Scaling vector - * @returns {mat2} out - */ - -function fromScaling(out, v) { - out[0] = v[0]; - out[1] = 0; - out[2] = 0; - out[3] = v[1]; - return out; -} -/** - * Returns a string representation of a mat2 - * - * @param {ReadonlyMat2} a matrix to represent as a string - * @returns {String} string representation of the matrix - */ - -function str(a) { - return "mat2(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; -} -/** - * Returns Frobenius norm of a mat2 - * - * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of - * @returns {Number} Frobenius norm - */ - -function frob(a) { - return Math.hypot(a[0], a[1], a[2], a[3]); -} -/** - * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix - * @param {ReadonlyMat2} L the lower triangular matrix - * @param {ReadonlyMat2} D the diagonal matrix - * @param {ReadonlyMat2} U the upper triangular matrix - * @param {ReadonlyMat2} a the input matrix to factorize - */ - -function LDU(L, D, U, a) { - L[2] = a[2] / a[0]; - U[0] = a[0]; - U[1] = a[1]; - U[3] = a[3] - L[2] * U[1]; - return [L, D, U]; -} -/** - * Adds two mat2's - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the first operand - * @param {ReadonlyMat2} b the second operand - * @returns {mat2} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - return out; -} -/** - * Subtracts matrix b from matrix a - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the first operand - * @param {ReadonlyMat2} b the second operand - * @returns {mat2} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - out[3] = a[3] - b[3]; - return out; -} -/** - * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyMat2} a The first matrix. - * @param {ReadonlyMat2} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; -} -/** - * Returns whether or not the matrices have approximately the same elements in the same position. - * - * @param {ReadonlyMat2} a The first matrix. - * @param {ReadonlyMat2} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)); -} -/** - * Multiply each element of the matrix by a scalar. - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the matrix to scale - * @param {Number} b amount to scale the matrix's elements by - * @returns {mat2} out - */ - -function multiplyScalar(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - return out; -} -/** - * Adds two mat2's after multiplying each element of the second operand by a scalar value. - * - * @param {mat2} out the receiving vector - * @param {ReadonlyMat2} a the first operand - * @param {ReadonlyMat2} b the second operand - * @param {Number} scale the amount to scale b's elements by before adding - * @returns {mat2} out - */ - -function multiplyScalarAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - out[3] = a[3] + b[3] * scale; - return out; -} -/** - * Alias for {@link mat2.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link mat2.subtract} - * @function - */ - -var sub = subtract; - -/***/ }), -/* 16 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "determinant": () => (/* binding */ determinant), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "rotate": () => (/* binding */ rotate), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "translate": () => (/* binding */ translate), -/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), -/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), -/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "frob": () => (/* binding */ frob), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), -/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "sub": () => (/* binding */ sub) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); - -/** - * 2x3 Matrix - * @module mat2d - * @description - * A mat2d contains six elements defined as: - *
- * [a, b,
- *  c, d,
- *  tx, ty]
- * 
- * This is a short form for the 3x3 matrix: - *
- * [a, b, 0,
- *  c, d, 0,
- *  tx, ty, 1]
- * 
- * The last column is ignored so the array is shorter and operations are faster. - */ - -/** - * Creates a new identity mat2d - * - * @returns {mat2d} a new 2x3 matrix - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[1] = 0; - out[2] = 0; - out[4] = 0; - out[5] = 0; - } - - out[0] = 1; - out[3] = 1; - return out; -} -/** - * Creates a new mat2d initialized with values from an existing matrix - * - * @param {ReadonlyMat2d} a matrix to clone - * @returns {mat2d} a new 2x3 matrix - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - return out; -} -/** - * Copy the values from one mat2d to another - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the source matrix - * @returns {mat2d} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - return out; -} -/** - * Set a mat2d to the identity matrix - * - * @param {mat2d} out the receiving matrix - * @returns {mat2d} out - */ - -function identity(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 1; - out[4] = 0; - out[5] = 0; - return out; -} -/** - * Create a new mat2d with the given values - * - * @param {Number} a Component A (index 0) - * @param {Number} b Component B (index 1) - * @param {Number} c Component C (index 2) - * @param {Number} d Component D (index 3) - * @param {Number} tx Component TX (index 4) - * @param {Number} ty Component TY (index 5) - * @returns {mat2d} A new mat2d - */ - -function fromValues(a, b, c, d, tx, ty) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); - out[0] = a; - out[1] = b; - out[2] = c; - out[3] = d; - out[4] = tx; - out[5] = ty; - return out; -} -/** - * Set the components of a mat2d to the given values - * - * @param {mat2d} out the receiving matrix - * @param {Number} a Component A (index 0) - * @param {Number} b Component B (index 1) - * @param {Number} c Component C (index 2) - * @param {Number} d Component D (index 3) - * @param {Number} tx Component TX (index 4) - * @param {Number} ty Component TY (index 5) - * @returns {mat2d} out - */ - -function set(out, a, b, c, d, tx, ty) { - out[0] = a; - out[1] = b; - out[2] = c; - out[3] = d; - out[4] = tx; - out[5] = ty; - return out; -} -/** - * Inverts a mat2d - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the source matrix - * @returns {mat2d} out - */ - -function invert(out, a) { - var aa = a[0], - ab = a[1], - ac = a[2], - ad = a[3]; - var atx = a[4], - aty = a[5]; - var det = aa * ad - ab * ac; - - if (!det) { - return null; - } - - det = 1.0 / det; - out[0] = ad * det; - out[1] = -ab * det; - out[2] = -ac * det; - out[3] = aa * det; - out[4] = (ac * aty - ad * atx) * det; - out[5] = (ab * atx - aa * aty) * det; - return out; -} -/** - * Calculates the determinant of a mat2d - * - * @param {ReadonlyMat2d} a the source matrix - * @returns {Number} determinant of a - */ - -function determinant(a) { - return a[0] * a[3] - a[1] * a[2]; -} -/** - * Multiplies two mat2d's - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the first operand - * @param {ReadonlyMat2d} b the second operand - * @returns {mat2d} out - */ - -function multiply(out, a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3], - b4 = b[4], - b5 = b[5]; - out[0] = a0 * b0 + a2 * b1; - out[1] = a1 * b0 + a3 * b1; - out[2] = a0 * b2 + a2 * b3; - out[3] = a1 * b2 + a3 * b3; - out[4] = a0 * b4 + a2 * b5 + a4; - out[5] = a1 * b4 + a3 * b5 + a5; - return out; -} -/** - * Rotates a mat2d by the given angle - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat2d} out - */ - -function rotate(out, a, rad) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5]; - var s = Math.sin(rad); - var c = Math.cos(rad); - out[0] = a0 * c + a2 * s; - out[1] = a1 * c + a3 * s; - out[2] = a0 * -s + a2 * c; - out[3] = a1 * -s + a3 * c; - out[4] = a4; - out[5] = a5; - return out; -} -/** - * Scales the mat2d by the dimensions in the given vec2 - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the matrix to translate - * @param {ReadonlyVec2} v the vec2 to scale the matrix by - * @returns {mat2d} out - **/ - -function scale(out, a, v) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5]; - var v0 = v[0], - v1 = v[1]; - out[0] = a0 * v0; - out[1] = a1 * v0; - out[2] = a2 * v1; - out[3] = a3 * v1; - out[4] = a4; - out[5] = a5; - return out; -} -/** - * Translates the mat2d by the dimensions in the given vec2 - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the matrix to translate - * @param {ReadonlyVec2} v the vec2 to translate the matrix by - * @returns {mat2d} out - **/ - -function translate(out, a, v) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5]; - var v0 = v[0], - v1 = v[1]; - out[0] = a0; - out[1] = a1; - out[2] = a2; - out[3] = a3; - out[4] = a0 * v0 + a2 * v1 + a4; - out[5] = a1 * v0 + a3 * v1 + a5; - return out; -} -/** - * Creates a matrix from a given angle - * This is equivalent to (but much faster than): - * - * mat2d.identity(dest); - * mat2d.rotate(dest, dest, rad); - * - * @param {mat2d} out mat2d receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat2d} out - */ - -function fromRotation(out, rad) { - var s = Math.sin(rad), - c = Math.cos(rad); - out[0] = c; - out[1] = s; - out[2] = -s; - out[3] = c; - out[4] = 0; - out[5] = 0; - return out; -} -/** - * Creates a matrix from a vector scaling - * This is equivalent to (but much faster than): - * - * mat2d.identity(dest); - * mat2d.scale(dest, dest, vec); - * - * @param {mat2d} out mat2d receiving operation result - * @param {ReadonlyVec2} v Scaling vector - * @returns {mat2d} out - */ - -function fromScaling(out, v) { - out[0] = v[0]; - out[1] = 0; - out[2] = 0; - out[3] = v[1]; - out[4] = 0; - out[5] = 0; - return out; -} -/** - * Creates a matrix from a vector translation - * This is equivalent to (but much faster than): - * - * mat2d.identity(dest); - * mat2d.translate(dest, dest, vec); - * - * @param {mat2d} out mat2d receiving operation result - * @param {ReadonlyVec2} v Translation vector - * @returns {mat2d} out - */ - -function fromTranslation(out, v) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 1; - out[4] = v[0]; - out[5] = v[1]; - return out; -} -/** - * Returns a string representation of a mat2d - * - * @param {ReadonlyMat2d} a matrix to represent as a string - * @returns {String} string representation of the matrix - */ - -function str(a) { - return "mat2d(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ")"; -} -/** - * Returns Frobenius norm of a mat2d - * - * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of - * @returns {Number} Frobenius norm - */ - -function frob(a) { - return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1); -} -/** - * Adds two mat2d's - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the first operand - * @param {ReadonlyMat2d} b the second operand - * @returns {mat2d} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - out[4] = a[4] + b[4]; - out[5] = a[5] + b[5]; - return out; -} -/** - * Subtracts matrix b from matrix a - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the first operand - * @param {ReadonlyMat2d} b the second operand - * @returns {mat2d} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - out[3] = a[3] - b[3]; - out[4] = a[4] - b[4]; - out[5] = a[5] - b[5]; - return out; -} -/** - * Multiply each element of the matrix by a scalar. - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the matrix to scale - * @param {Number} b amount to scale the matrix's elements by - * @returns {mat2d} out - */ - -function multiplyScalar(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - out[4] = a[4] * b; - out[5] = a[5] * b; - return out; -} -/** - * Adds two mat2d's after multiplying each element of the second operand by a scalar value. - * - * @param {mat2d} out the receiving vector - * @param {ReadonlyMat2d} a the first operand - * @param {ReadonlyMat2d} b the second operand - * @param {Number} scale the amount to scale b's elements by before adding - * @returns {mat2d} out - */ - -function multiplyScalarAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - out[3] = a[3] + b[3] * scale; - out[4] = a[4] + b[4] * scale; - out[5] = a[5] + b[5] * scale; - return out; -} -/** - * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyMat2d} a The first matrix. - * @param {ReadonlyMat2d} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5]; -} -/** - * Returns whether or not the matrices have approximately the same elements in the same position. - * - * @param {ReadonlyMat2d} a The first matrix. - * @param {ReadonlyMat2d} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3], - b4 = b[4], - b5 = b[5]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)); -} -/** - * Alias for {@link mat2d.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link mat2d.subtract} - * @function - */ - -var sub = subtract; - -/***/ }), -/* 17 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "fromMat4": () => (/* binding */ fromMat4), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "transpose": () => (/* binding */ transpose), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "adjoint": () => (/* binding */ adjoint), -/* harmony export */ "determinant": () => (/* binding */ determinant), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "translate": () => (/* binding */ translate), -/* harmony export */ "rotate": () => (/* binding */ rotate), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), -/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), -/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), -/* harmony export */ "fromMat2d": () => (/* binding */ fromMat2d), -/* harmony export */ "fromQuat": () => (/* binding */ fromQuat), -/* harmony export */ "normalFromMat4": () => (/* binding */ normalFromMat4), -/* harmony export */ "projection": () => (/* binding */ projection), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "frob": () => (/* binding */ frob), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), -/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "sub": () => (/* binding */ sub) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); - -/** - * 3x3 Matrix - * @module mat3 - */ - -/** - * Creates a new identity mat3 - * - * @returns {mat3} a new 3x3 matrix - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[5] = 0; - out[6] = 0; - out[7] = 0; - } - - out[0] = 1; - out[4] = 1; - out[8] = 1; - return out; -} -/** - * Copies the upper-left 3x3 values into the given mat3. - * - * @param {mat3} out the receiving 3x3 matrix - * @param {ReadonlyMat4} a the source 4x4 matrix - * @returns {mat3} out - */ - -function fromMat4(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[4]; - out[4] = a[5]; - out[5] = a[6]; - out[6] = a[8]; - out[7] = a[9]; - out[8] = a[10]; - return out; -} -/** - * Creates a new mat3 initialized with values from an existing matrix - * - * @param {ReadonlyMat3} a matrix to clone - * @returns {mat3} a new 3x3 matrix - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - return out; -} -/** - * Copy the values from one mat3 to another - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the source matrix - * @returns {mat3} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - return out; -} -/** - * Create a new mat3 with the given values - * - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m02 Component in column 0, row 2 position (index 2) - * @param {Number} m10 Component in column 1, row 0 position (index 3) - * @param {Number} m11 Component in column 1, row 1 position (index 4) - * @param {Number} m12 Component in column 1, row 2 position (index 5) - * @param {Number} m20 Component in column 2, row 0 position (index 6) - * @param {Number} m21 Component in column 2, row 1 position (index 7) - * @param {Number} m22 Component in column 2, row 2 position (index 8) - * @returns {mat3} A new mat3 - */ - -function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); - out[0] = m00; - out[1] = m01; - out[2] = m02; - out[3] = m10; - out[4] = m11; - out[5] = m12; - out[6] = m20; - out[7] = m21; - out[8] = m22; - return out; -} -/** - * Set the components of a mat3 to the given values - * - * @param {mat3} out the receiving matrix - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m02 Component in column 0, row 2 position (index 2) - * @param {Number} m10 Component in column 1, row 0 position (index 3) - * @param {Number} m11 Component in column 1, row 1 position (index 4) - * @param {Number} m12 Component in column 1, row 2 position (index 5) - * @param {Number} m20 Component in column 2, row 0 position (index 6) - * @param {Number} m21 Component in column 2, row 1 position (index 7) - * @param {Number} m22 Component in column 2, row 2 position (index 8) - * @returns {mat3} out - */ - -function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) { - out[0] = m00; - out[1] = m01; - out[2] = m02; - out[3] = m10; - out[4] = m11; - out[5] = m12; - out[6] = m20; - out[7] = m21; - out[8] = m22; - return out; -} -/** - * Set a mat3 to the identity matrix - * - * @param {mat3} out the receiving matrix - * @returns {mat3} out - */ - -function identity(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 1; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 1; - return out; -} -/** - * Transpose the values of a mat3 - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the source matrix - * @returns {mat3} out - */ - -function transpose(out, a) { - // If we are transposing ourselves we can skip a few steps but have to cache some values - if (out === a) { - var a01 = a[1], - a02 = a[2], - a12 = a[5]; - out[1] = a[3]; - out[2] = a[6]; - out[3] = a01; - out[5] = a[7]; - out[6] = a02; - out[7] = a12; - } else { - out[0] = a[0]; - out[1] = a[3]; - out[2] = a[6]; - out[3] = a[1]; - out[4] = a[4]; - out[5] = a[7]; - out[6] = a[2]; - out[7] = a[5]; - out[8] = a[8]; - } - - return out; -} -/** - * Inverts a mat3 - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the source matrix - * @returns {mat3} out - */ - -function invert(out, a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2]; - var a10 = a[3], - a11 = a[4], - a12 = a[5]; - var a20 = a[6], - a21 = a[7], - a22 = a[8]; - var b01 = a22 * a11 - a12 * a21; - var b11 = -a22 * a10 + a12 * a20; - var b21 = a21 * a10 - a11 * a20; // Calculate the determinant - - var det = a00 * b01 + a01 * b11 + a02 * b21; - - if (!det) { - return null; - } - - det = 1.0 / det; - out[0] = b01 * det; - out[1] = (-a22 * a01 + a02 * a21) * det; - out[2] = (a12 * a01 - a02 * a11) * det; - out[3] = b11 * det; - out[4] = (a22 * a00 - a02 * a20) * det; - out[5] = (-a12 * a00 + a02 * a10) * det; - out[6] = b21 * det; - out[7] = (-a21 * a00 + a01 * a20) * det; - out[8] = (a11 * a00 - a01 * a10) * det; - return out; -} -/** - * Calculates the adjugate of a mat3 - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the source matrix - * @returns {mat3} out - */ - -function adjoint(out, a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2]; - var a10 = a[3], - a11 = a[4], - a12 = a[5]; - var a20 = a[6], - a21 = a[7], - a22 = a[8]; - out[0] = a11 * a22 - a12 * a21; - out[1] = a02 * a21 - a01 * a22; - out[2] = a01 * a12 - a02 * a11; - out[3] = a12 * a20 - a10 * a22; - out[4] = a00 * a22 - a02 * a20; - out[5] = a02 * a10 - a00 * a12; - out[6] = a10 * a21 - a11 * a20; - out[7] = a01 * a20 - a00 * a21; - out[8] = a00 * a11 - a01 * a10; - return out; -} -/** - * Calculates the determinant of a mat3 - * - * @param {ReadonlyMat3} a the source matrix - * @returns {Number} determinant of a - */ - -function determinant(a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2]; - var a10 = a[3], - a11 = a[4], - a12 = a[5]; - var a20 = a[6], - a21 = a[7], - a22 = a[8]; - return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); -} -/** - * Multiplies two mat3's - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the first operand - * @param {ReadonlyMat3} b the second operand - * @returns {mat3} out - */ - -function multiply(out, a, b) { - var a00 = a[0], - a01 = a[1], - a02 = a[2]; - var a10 = a[3], - a11 = a[4], - a12 = a[5]; - var a20 = a[6], - a21 = a[7], - a22 = a[8]; - var b00 = b[0], - b01 = b[1], - b02 = b[2]; - var b10 = b[3], - b11 = b[4], - b12 = b[5]; - var b20 = b[6], - b21 = b[7], - b22 = b[8]; - out[0] = b00 * a00 + b01 * a10 + b02 * a20; - out[1] = b00 * a01 + b01 * a11 + b02 * a21; - out[2] = b00 * a02 + b01 * a12 + b02 * a22; - out[3] = b10 * a00 + b11 * a10 + b12 * a20; - out[4] = b10 * a01 + b11 * a11 + b12 * a21; - out[5] = b10 * a02 + b11 * a12 + b12 * a22; - out[6] = b20 * a00 + b21 * a10 + b22 * a20; - out[7] = b20 * a01 + b21 * a11 + b22 * a21; - out[8] = b20 * a02 + b21 * a12 + b22 * a22; - return out; -} -/** - * Translate a mat3 by the given vector - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the matrix to translate - * @param {ReadonlyVec2} v vector to translate by - * @returns {mat3} out - */ - -function translate(out, a, v) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a10 = a[3], - a11 = a[4], - a12 = a[5], - a20 = a[6], - a21 = a[7], - a22 = a[8], - x = v[0], - y = v[1]; - out[0] = a00; - out[1] = a01; - out[2] = a02; - out[3] = a10; - out[4] = a11; - out[5] = a12; - out[6] = x * a00 + y * a10 + a20; - out[7] = x * a01 + y * a11 + a21; - out[8] = x * a02 + y * a12 + a22; - return out; -} -/** - * Rotates a mat3 by the given angle - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat3} out - */ - -function rotate(out, a, rad) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a10 = a[3], - a11 = a[4], - a12 = a[5], - a20 = a[6], - a21 = a[7], - a22 = a[8], - s = Math.sin(rad), - c = Math.cos(rad); - out[0] = c * a00 + s * a10; - out[1] = c * a01 + s * a11; - out[2] = c * a02 + s * a12; - out[3] = c * a10 - s * a00; - out[4] = c * a11 - s * a01; - out[5] = c * a12 - s * a02; - out[6] = a20; - out[7] = a21; - out[8] = a22; - return out; -} -/** - * Scales the mat3 by the dimensions in the given vec2 - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the matrix to rotate - * @param {ReadonlyVec2} v the vec2 to scale the matrix by - * @returns {mat3} out - **/ - -function scale(out, a, v) { - var x = v[0], - y = v[1]; - out[0] = x * a[0]; - out[1] = x * a[1]; - out[2] = x * a[2]; - out[3] = y * a[3]; - out[4] = y * a[4]; - out[5] = y * a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - return out; -} -/** - * Creates a matrix from a vector translation - * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.translate(dest, dest, vec); - * - * @param {mat3} out mat3 receiving operation result - * @param {ReadonlyVec2} v Translation vector - * @returns {mat3} out - */ - -function fromTranslation(out, v) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 1; - out[5] = 0; - out[6] = v[0]; - out[7] = v[1]; - out[8] = 1; - return out; -} -/** - * Creates a matrix from a given angle - * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.rotate(dest, dest, rad); - * - * @param {mat3} out mat3 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat3} out - */ - -function fromRotation(out, rad) { - var s = Math.sin(rad), - c = Math.cos(rad); - out[0] = c; - out[1] = s; - out[2] = 0; - out[3] = -s; - out[4] = c; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 1; - return out; -} -/** - * Creates a matrix from a vector scaling - * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.scale(dest, dest, vec); - * - * @param {mat3} out mat3 receiving operation result - * @param {ReadonlyVec2} v Scaling vector - * @returns {mat3} out - */ - -function fromScaling(out, v) { - out[0] = v[0]; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = v[1]; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 1; - return out; -} -/** - * Copies the values from a mat2d into a mat3 - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat2d} a the matrix to copy - * @returns {mat3} out - **/ - -function fromMat2d(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = 0; - out[3] = a[2]; - out[4] = a[3]; - out[5] = 0; - out[6] = a[4]; - out[7] = a[5]; - out[8] = 1; - return out; -} -/** - * Calculates a 3x3 matrix from the given quaternion - * - * @param {mat3} out mat3 receiving operation result - * @param {ReadonlyQuat} q Quaternion to create matrix from - * - * @returns {mat3} out - */ - -function fromQuat(out, q) { - var x = q[0], - y = q[1], - z = q[2], - w = q[3]; - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - var xx = x * x2; - var yx = y * x2; - var yy = y * y2; - var zx = z * x2; - var zy = z * y2; - var zz = z * z2; - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - out[0] = 1 - yy - zz; - out[3] = yx - wz; - out[6] = zx + wy; - out[1] = yx + wz; - out[4] = 1 - xx - zz; - out[7] = zy - wx; - out[2] = zx - wy; - out[5] = zy + wx; - out[8] = 1 - xx - yy; - return out; -} -/** - * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix - * - * @param {mat3} out mat3 receiving operation result - * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from - * - * @returns {mat3} out - */ - -function normalFromMat4(out, a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7]; - var a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; - var a30 = a[12], - a31 = a[13], - a32 = a[14], - a33 = a[15]; - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; // Calculate the determinant - - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) { - return null; - } - - det = 1.0 / det; - out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - return out; -} -/** - * Generates a 2D projection matrix with the given bounds - * - * @param {mat3} out mat3 frustum matrix will be written into - * @param {number} width Width of your gl context - * @param {number} height Height of gl context - * @returns {mat3} out - */ - -function projection(out, width, height) { - out[0] = 2 / width; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = -2 / height; - out[5] = 0; - out[6] = -1; - out[7] = 1; - out[8] = 1; - return out; -} -/** - * Returns a string representation of a mat3 - * - * @param {ReadonlyMat3} a matrix to represent as a string - * @returns {String} string representation of the matrix - */ - -function str(a) { - return "mat3(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ")"; -} -/** - * Returns Frobenius norm of a mat3 - * - * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of - * @returns {Number} Frobenius norm - */ - -function frob(a) { - return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]); -} -/** - * Adds two mat3's - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the first operand - * @param {ReadonlyMat3} b the second operand - * @returns {mat3} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - out[4] = a[4] + b[4]; - out[5] = a[5] + b[5]; - out[6] = a[6] + b[6]; - out[7] = a[7] + b[7]; - out[8] = a[8] + b[8]; - return out; -} -/** - * Subtracts matrix b from matrix a - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the first operand - * @param {ReadonlyMat3} b the second operand - * @returns {mat3} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - out[3] = a[3] - b[3]; - out[4] = a[4] - b[4]; - out[5] = a[5] - b[5]; - out[6] = a[6] - b[6]; - out[7] = a[7] - b[7]; - out[8] = a[8] - b[8]; - return out; -} -/** - * Multiply each element of the matrix by a scalar. - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the matrix to scale - * @param {Number} b amount to scale the matrix's elements by - * @returns {mat3} out - */ - -function multiplyScalar(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - out[4] = a[4] * b; - out[5] = a[5] * b; - out[6] = a[6] * b; - out[7] = a[7] * b; - out[8] = a[8] * b; - return out; -} -/** - * Adds two mat3's after multiplying each element of the second operand by a scalar value. - * - * @param {mat3} out the receiving vector - * @param {ReadonlyMat3} a the first operand - * @param {ReadonlyMat3} b the second operand - * @param {Number} scale the amount to scale b's elements by before adding - * @returns {mat3} out - */ - -function multiplyScalarAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - out[3] = a[3] + b[3] * scale; - out[4] = a[4] + b[4] * scale; - out[5] = a[5] + b[5] * scale; - out[6] = a[6] + b[6] * scale; - out[7] = a[7] + b[7] * scale; - out[8] = a[8] + b[8] * scale; - return out; -} -/** - * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyMat3} a The first matrix. - * @param {ReadonlyMat3} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8]; -} -/** - * Returns whether or not the matrices have approximately the same elements in the same position. - * - * @param {ReadonlyMat3} a The first matrix. - * @param {ReadonlyMat3} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5], - a6 = a[6], - a7 = a[7], - a8 = a[8]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3], - b4 = b[4], - b5 = b[5], - b6 = b[6], - b7 = b[7], - b8 = b[8]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)); -} -/** - * Alias for {@link mat3.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link mat3.subtract} - * @function - */ - -var sub = subtract; - -/***/ }), -/* 18 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "transpose": () => (/* binding */ transpose), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "adjoint": () => (/* binding */ adjoint), -/* harmony export */ "determinant": () => (/* binding */ determinant), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "translate": () => (/* binding */ translate), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "rotate": () => (/* binding */ rotate), -/* harmony export */ "rotateX": () => (/* binding */ rotateX), -/* harmony export */ "rotateY": () => (/* binding */ rotateY), -/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), -/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), -/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), -/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), -/* harmony export */ "fromXRotation": () => (/* binding */ fromXRotation), -/* harmony export */ "fromYRotation": () => (/* binding */ fromYRotation), -/* harmony export */ "fromZRotation": () => (/* binding */ fromZRotation), -/* harmony export */ "fromRotationTranslation": () => (/* binding */ fromRotationTranslation), -/* harmony export */ "fromQuat2": () => (/* binding */ fromQuat2), -/* harmony export */ "getTranslation": () => (/* binding */ getTranslation), -/* harmony export */ "getScaling": () => (/* binding */ getScaling), -/* harmony export */ "getRotation": () => (/* binding */ getRotation), -/* harmony export */ "fromRotationTranslationScale": () => (/* binding */ fromRotationTranslationScale), -/* harmony export */ "fromRotationTranslationScaleOrigin": () => (/* binding */ fromRotationTranslationScaleOrigin), -/* harmony export */ "fromQuat": () => (/* binding */ fromQuat), -/* harmony export */ "frustum": () => (/* binding */ frustum), -/* harmony export */ "perspective": () => (/* binding */ perspective), -/* harmony export */ "perspectiveFromFieldOfView": () => (/* binding */ perspectiveFromFieldOfView), -/* harmony export */ "ortho": () => (/* binding */ ortho), -/* harmony export */ "lookAt": () => (/* binding */ lookAt), -/* harmony export */ "targetTo": () => (/* binding */ targetTo), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "frob": () => (/* binding */ frob), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), -/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "sub": () => (/* binding */ sub) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); - -/** - * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied. - * @module mat4 - */ - -/** - * Creates a new identity mat4 - * - * @returns {mat4} a new 4x4 matrix - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - } - - out[0] = 1; - out[5] = 1; - out[10] = 1; - out[15] = 1; - return out; -} -/** - * Creates a new mat4 initialized with values from an existing matrix - * - * @param {ReadonlyMat4} a matrix to clone - * @returns {mat4} a new 4x4 matrix - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - return out; -} -/** - * Copy the values from one mat4 to another - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the source matrix - * @returns {mat4} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - return out; -} -/** - * Create a new mat4 with the given values - * - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m02 Component in column 0, row 2 position (index 2) - * @param {Number} m03 Component in column 0, row 3 position (index 3) - * @param {Number} m10 Component in column 1, row 0 position (index 4) - * @param {Number} m11 Component in column 1, row 1 position (index 5) - * @param {Number} m12 Component in column 1, row 2 position (index 6) - * @param {Number} m13 Component in column 1, row 3 position (index 7) - * @param {Number} m20 Component in column 2, row 0 position (index 8) - * @param {Number} m21 Component in column 2, row 1 position (index 9) - * @param {Number} m22 Component in column 2, row 2 position (index 10) - * @param {Number} m23 Component in column 2, row 3 position (index 11) - * @param {Number} m30 Component in column 3, row 0 position (index 12) - * @param {Number} m31 Component in column 3, row 1 position (index 13) - * @param {Number} m32 Component in column 3, row 2 position (index 14) - * @param {Number} m33 Component in column 3, row 3 position (index 15) - * @returns {mat4} A new mat4 - */ - -function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); - out[0] = m00; - out[1] = m01; - out[2] = m02; - out[3] = m03; - out[4] = m10; - out[5] = m11; - out[6] = m12; - out[7] = m13; - out[8] = m20; - out[9] = m21; - out[10] = m22; - out[11] = m23; - out[12] = m30; - out[13] = m31; - out[14] = m32; - out[15] = m33; - return out; -} -/** - * Set the components of a mat4 to the given values - * - * @param {mat4} out the receiving matrix - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m02 Component in column 0, row 2 position (index 2) - * @param {Number} m03 Component in column 0, row 3 position (index 3) - * @param {Number} m10 Component in column 1, row 0 position (index 4) - * @param {Number} m11 Component in column 1, row 1 position (index 5) - * @param {Number} m12 Component in column 1, row 2 position (index 6) - * @param {Number} m13 Component in column 1, row 3 position (index 7) - * @param {Number} m20 Component in column 2, row 0 position (index 8) - * @param {Number} m21 Component in column 2, row 1 position (index 9) - * @param {Number} m22 Component in column 2, row 2 position (index 10) - * @param {Number} m23 Component in column 2, row 3 position (index 11) - * @param {Number} m30 Component in column 3, row 0 position (index 12) - * @param {Number} m31 Component in column 3, row 1 position (index 13) - * @param {Number} m32 Component in column 3, row 2 position (index 14) - * @param {Number} m33 Component in column 3, row 3 position (index 15) - * @returns {mat4} out - */ - -function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { - out[0] = m00; - out[1] = m01; - out[2] = m02; - out[3] = m03; - out[4] = m10; - out[5] = m11; - out[6] = m12; - out[7] = m13; - out[8] = m20; - out[9] = m21; - out[10] = m22; - out[11] = m23; - out[12] = m30; - out[13] = m31; - out[14] = m32; - out[15] = m33; - return out; -} -/** - * Set a mat4 to the identity matrix - * - * @param {mat4} out the receiving matrix - * @returns {mat4} out - */ - -function identity(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Transpose the values of a mat4 - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the source matrix - * @returns {mat4} out - */ - -function transpose(out, a) { - // If we are transposing ourselves we can skip a few steps but have to cache some values - if (out === a) { - var a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a12 = a[6], - a13 = a[7]; - var a23 = a[11]; - out[1] = a[4]; - out[2] = a[8]; - out[3] = a[12]; - out[4] = a01; - out[6] = a[9]; - out[7] = a[13]; - out[8] = a02; - out[9] = a12; - out[11] = a[14]; - out[12] = a03; - out[13] = a13; - out[14] = a23; - } else { - out[0] = a[0]; - out[1] = a[4]; - out[2] = a[8]; - out[3] = a[12]; - out[4] = a[1]; - out[5] = a[5]; - out[6] = a[9]; - out[7] = a[13]; - out[8] = a[2]; - out[9] = a[6]; - out[10] = a[10]; - out[11] = a[14]; - out[12] = a[3]; - out[13] = a[7]; - out[14] = a[11]; - out[15] = a[15]; - } - - return out; -} -/** - * Inverts a mat4 - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the source matrix - * @returns {mat4} out - */ - -function invert(out, a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7]; - var a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; - var a30 = a[12], - a31 = a[13], - a32 = a[14], - a33 = a[15]; - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; // Calculate the determinant - - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) { - return null; - } - - det = 1.0 / det; - out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; - out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; - out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; - out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; - out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; - out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; - out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; - return out; -} -/** - * Calculates the adjugate of a mat4 - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the source matrix - * @returns {mat4} out - */ - -function adjoint(out, a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7]; - var a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; - var a30 = a[12], - a31 = a[13], - a32 = a[14], - a33 = a[15]; - out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22); - out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); - out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12); - out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); - out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); - out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22); - out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); - out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12); - out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21); - out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); - out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11); - out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); - out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); - out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21); - out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); - out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11); - return out; -} -/** - * Calculates the determinant of a mat4 - * - * @param {ReadonlyMat4} a the source matrix - * @returns {Number} determinant of a - */ - -function determinant(a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7]; - var a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; - var a30 = a[12], - a31 = a[13], - a32 = a[14], - a33 = a[15]; - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; // Calculate the determinant - - return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; -} -/** - * Multiplies two mat4s - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the first operand - * @param {ReadonlyMat4} b the second operand - * @returns {mat4} out - */ - -function multiply(out, a, b) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7]; - var a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; - var a30 = a[12], - a31 = a[13], - a32 = a[14], - a33 = a[15]; // Cache only the current line of the second matrix - - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3]; - out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - b0 = b[4]; - b1 = b[5]; - b2 = b[6]; - b3 = b[7]; - out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - b0 = b[8]; - b1 = b[9]; - b2 = b[10]; - b3 = b[11]; - out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - b0 = b[12]; - b1 = b[13]; - b2 = b[14]; - b3 = b[15]; - out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - return out; -} -/** - * Translate a mat4 by the given vector - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to translate - * @param {ReadonlyVec3} v vector to translate by - * @returns {mat4} out - */ - -function translate(out, a, v) { - var x = v[0], - y = v[1], - z = v[2]; - var a00, a01, a02, a03; - var a10, a11, a12, a13; - var a20, a21, a22, a23; - - if (a === out) { - out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - } else { - a00 = a[0]; - a01 = a[1]; - a02 = a[2]; - a03 = a[3]; - a10 = a[4]; - a11 = a[5]; - a12 = a[6]; - a13 = a[7]; - a20 = a[8]; - a21 = a[9]; - a22 = a[10]; - a23 = a[11]; - out[0] = a00; - out[1] = a01; - out[2] = a02; - out[3] = a03; - out[4] = a10; - out[5] = a11; - out[6] = a12; - out[7] = a13; - out[8] = a20; - out[9] = a21; - out[10] = a22; - out[11] = a23; - out[12] = a00 * x + a10 * y + a20 * z + a[12]; - out[13] = a01 * x + a11 * y + a21 * z + a[13]; - out[14] = a02 * x + a12 * y + a22 * z + a[14]; - out[15] = a03 * x + a13 * y + a23 * z + a[15]; - } - - return out; -} -/** - * Scales the mat4 by the dimensions in the given vec3 not using vectorization - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to scale - * @param {ReadonlyVec3} v the vec3 to scale the matrix by - * @returns {mat4} out - **/ - -function scale(out, a, v) { - var x = v[0], - y = v[1], - z = v[2]; - out[0] = a[0] * x; - out[1] = a[1] * x; - out[2] = a[2] * x; - out[3] = a[3] * x; - out[4] = a[4] * y; - out[5] = a[5] * y; - out[6] = a[6] * y; - out[7] = a[7] * y; - out[8] = a[8] * z; - out[9] = a[9] * z; - out[10] = a[10] * z; - out[11] = a[11] * z; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - return out; -} -/** - * Rotates a mat4 by the given angle around the given axis - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @param {ReadonlyVec3} axis the axis to rotate around - * @returns {mat4} out - */ - -function rotate(out, a, rad, axis) { - var x = axis[0], - y = axis[1], - z = axis[2]; - var len = Math.hypot(x, y, z); - var s, c, t; - var a00, a01, a02, a03; - var a10, a11, a12, a13; - var a20, a21, a22, a23; - var b00, b01, b02; - var b10, b11, b12; - var b20, b21, b22; - - if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - return null; - } - - len = 1 / len; - x *= len; - y *= len; - z *= len; - s = Math.sin(rad); - c = Math.cos(rad); - t = 1 - c; - a00 = a[0]; - a01 = a[1]; - a02 = a[2]; - a03 = a[3]; - a10 = a[4]; - a11 = a[5]; - a12 = a[6]; - a13 = a[7]; - a20 = a[8]; - a21 = a[9]; - a22 = a[10]; - a23 = a[11]; // Construct the elements of the rotation matrix - - b00 = x * x * t + c; - b01 = y * x * t + z * s; - b02 = z * x * t - y * s; - b10 = x * y * t - z * s; - b11 = y * y * t + c; - b12 = z * y * t + x * s; - b20 = x * z * t + y * s; - b21 = y * z * t - x * s; - b22 = z * z * t + c; // Perform rotation-specific matrix multiplication - - out[0] = a00 * b00 + a10 * b01 + a20 * b02; - out[1] = a01 * b00 + a11 * b01 + a21 * b02; - out[2] = a02 * b00 + a12 * b01 + a22 * b02; - out[3] = a03 * b00 + a13 * b01 + a23 * b02; - out[4] = a00 * b10 + a10 * b11 + a20 * b12; - out[5] = a01 * b10 + a11 * b11 + a21 * b12; - out[6] = a02 * b10 + a12 * b11 + a22 * b12; - out[7] = a03 * b10 + a13 * b11 + a23 * b12; - out[8] = a00 * b20 + a10 * b21 + a20 * b22; - out[9] = a01 * b20 + a11 * b21 + a21 * b22; - out[10] = a02 * b20 + a12 * b21 + a22 * b22; - out[11] = a03 * b20 + a13 * b21 + a23 * b22; - - if (a !== out) { - // If the source and destination differ, copy the unchanged last row - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - } - - return out; -} -/** - * Rotates a matrix by the given angle around the X axis - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function rotateX(out, a, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - if (a !== out) { - // If the source and destination differ, copy the unchanged rows - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - } // Perform axis-specific matrix multiplication - - - out[4] = a10 * c + a20 * s; - out[5] = a11 * c + a21 * s; - out[6] = a12 * c + a22 * s; - out[7] = a13 * c + a23 * s; - out[8] = a20 * c - a10 * s; - out[9] = a21 * c - a11 * s; - out[10] = a22 * c - a12 * s; - out[11] = a23 * c - a13 * s; - return out; -} -/** - * Rotates a matrix by the given angle around the Y axis - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function rotateY(out, a, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - if (a !== out) { - // If the source and destination differ, copy the unchanged rows - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - } // Perform axis-specific matrix multiplication - - - out[0] = a00 * c - a20 * s; - out[1] = a01 * c - a21 * s; - out[2] = a02 * c - a22 * s; - out[3] = a03 * c - a23 * s; - out[8] = a00 * s + a20 * c; - out[9] = a01 * s + a21 * c; - out[10] = a02 * s + a22 * c; - out[11] = a03 * s + a23 * c; - return out; -} -/** - * Rotates a matrix by the given angle around the Z axis - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function rotateZ(out, a, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - if (a !== out) { - // If the source and destination differ, copy the unchanged last row - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - } // Perform axis-specific matrix multiplication - - - out[0] = a00 * c + a10 * s; - out[1] = a01 * c + a11 * s; - out[2] = a02 * c + a12 * s; - out[3] = a03 * c + a13 * s; - out[4] = a10 * c - a00 * s; - out[5] = a11 * c - a01 * s; - out[6] = a12 * c - a02 * s; - out[7] = a13 * c - a03 * s; - return out; -} -/** - * Creates a matrix from a vector translation - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, dest, vec); - * - * @param {mat4} out mat4 receiving operation result - * @param {ReadonlyVec3} v Translation vector - * @returns {mat4} out - */ - -function fromTranslation(out, v) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = v[0]; - out[13] = v[1]; - out[14] = v[2]; - out[15] = 1; - return out; -} -/** - * Creates a matrix from a vector scaling - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.scale(dest, dest, vec); - * - * @param {mat4} out mat4 receiving operation result - * @param {ReadonlyVec3} v Scaling vector - * @returns {mat4} out - */ - -function fromScaling(out, v) { - out[0] = v[0]; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = v[1]; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = v[2]; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Creates a matrix from a given angle around a given axis - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotate(dest, dest, rad, axis); - * - * @param {mat4} out mat4 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @param {ReadonlyVec3} axis the axis to rotate around - * @returns {mat4} out - */ - -function fromRotation(out, rad, axis) { - var x = axis[0], - y = axis[1], - z = axis[2]; - var len = Math.hypot(x, y, z); - var s, c, t; - - if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - return null; - } - - len = 1 / len; - x *= len; - y *= len; - z *= len; - s = Math.sin(rad); - c = Math.cos(rad); - t = 1 - c; // Perform rotation-specific matrix multiplication - - out[0] = x * x * t + c; - out[1] = y * x * t + z * s; - out[2] = z * x * t - y * s; - out[3] = 0; - out[4] = x * y * t - z * s; - out[5] = y * y * t + c; - out[6] = z * y * t + x * s; - out[7] = 0; - out[8] = x * z * t + y * s; - out[9] = y * z * t - x * s; - out[10] = z * z * t + c; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Creates a matrix from the given angle around the X axis - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateX(dest, dest, rad); - * - * @param {mat4} out mat4 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function fromXRotation(out, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); // Perform axis-specific matrix multiplication - - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = c; - out[6] = s; - out[7] = 0; - out[8] = 0; - out[9] = -s; - out[10] = c; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Creates a matrix from the given angle around the Y axis - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateY(dest, dest, rad); - * - * @param {mat4} out mat4 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function fromYRotation(out, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); // Perform axis-specific matrix multiplication - - out[0] = c; - out[1] = 0; - out[2] = -s; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = s; - out[9] = 0; - out[10] = c; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Creates a matrix from the given angle around the Z axis - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateZ(dest, dest, rad); - * - * @param {mat4} out mat4 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function fromZRotation(out, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); // Perform axis-specific matrix multiplication - - out[0] = c; - out[1] = s; - out[2] = 0; - out[3] = 0; - out[4] = -s; - out[5] = c; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Creates a matrix from a quaternion rotation and vector translation - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * - * @param {mat4} out mat4 receiving operation result - * @param {quat4} q Rotation quaternion - * @param {ReadonlyVec3} v Translation vector - * @returns {mat4} out - */ - -function fromRotationTranslation(out, q, v) { - // Quaternion math - var x = q[0], - y = q[1], - z = q[2], - w = q[3]; - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - out[0] = 1 - (yy + zz); - out[1] = xy + wz; - out[2] = xz - wy; - out[3] = 0; - out[4] = xy - wz; - out[5] = 1 - (xx + zz); - out[6] = yz + wx; - out[7] = 0; - out[8] = xz + wy; - out[9] = yz - wx; - out[10] = 1 - (xx + yy); - out[11] = 0; - out[12] = v[0]; - out[13] = v[1]; - out[14] = v[2]; - out[15] = 1; - return out; -} -/** - * Creates a new mat4 from a dual quat. - * - * @param {mat4} out Matrix - * @param {ReadonlyQuat2} a Dual Quaternion - * @returns {mat4} mat4 receiving operation result - */ - -function fromQuat2(out, a) { - var translation = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - var bx = -a[0], - by = -a[1], - bz = -a[2], - bw = a[3], - ax = a[4], - ay = a[5], - az = a[6], - aw = a[7]; - var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense - - if (magnitude > 0) { - translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude; - translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude; - translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude; - } else { - translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; - translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; - translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; - } - - fromRotationTranslation(out, a, translation); - return out; -} -/** - * Returns the translation vector component of a transformation - * matrix. If a matrix is built with fromRotationTranslation, - * the returned vector will be the same as the translation vector - * originally supplied. - * @param {vec3} out Vector to receive translation component - * @param {ReadonlyMat4} mat Matrix to be decomposed (input) - * @return {vec3} out - */ - -function getTranslation(out, mat) { - out[0] = mat[12]; - out[1] = mat[13]; - out[2] = mat[14]; - return out; -} -/** - * Returns the scaling factor component of a transformation - * matrix. If a matrix is built with fromRotationTranslationScale - * with a normalized Quaternion paramter, the returned vector will be - * the same as the scaling vector - * originally supplied. - * @param {vec3} out Vector to receive scaling factor component - * @param {ReadonlyMat4} mat Matrix to be decomposed (input) - * @return {vec3} out - */ - -function getScaling(out, mat) { - var m11 = mat[0]; - var m12 = mat[1]; - var m13 = mat[2]; - var m21 = mat[4]; - var m22 = mat[5]; - var m23 = mat[6]; - var m31 = mat[8]; - var m32 = mat[9]; - var m33 = mat[10]; - out[0] = Math.hypot(m11, m12, m13); - out[1] = Math.hypot(m21, m22, m23); - out[2] = Math.hypot(m31, m32, m33); - return out; -} -/** - * Returns a quaternion representing the rotational component - * of a transformation matrix. If a matrix is built with - * fromRotationTranslation, the returned quaternion will be the - * same as the quaternion originally supplied. - * @param {quat} out Quaternion to receive the rotation component - * @param {ReadonlyMat4} mat Matrix to be decomposed (input) - * @return {quat} out - */ - -function getRotation(out, mat) { - var scaling = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - getScaling(scaling, mat); - var is1 = 1 / scaling[0]; - var is2 = 1 / scaling[1]; - var is3 = 1 / scaling[2]; - var sm11 = mat[0] * is1; - var sm12 = mat[1] * is2; - var sm13 = mat[2] * is3; - var sm21 = mat[4] * is1; - var sm22 = mat[5] * is2; - var sm23 = mat[6] * is3; - var sm31 = mat[8] * is1; - var sm32 = mat[9] * is2; - var sm33 = mat[10] * is3; - var trace = sm11 + sm22 + sm33; - var S = 0; - - if (trace > 0) { - S = Math.sqrt(trace + 1.0) * 2; - out[3] = 0.25 * S; - out[0] = (sm23 - sm32) / S; - out[1] = (sm31 - sm13) / S; - out[2] = (sm12 - sm21) / S; - } else if (sm11 > sm22 && sm11 > sm33) { - S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2; - out[3] = (sm23 - sm32) / S; - out[0] = 0.25 * S; - out[1] = (sm12 + sm21) / S; - out[2] = (sm31 + sm13) / S; - } else if (sm22 > sm33) { - S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2; - out[3] = (sm31 - sm13) / S; - out[0] = (sm12 + sm21) / S; - out[1] = 0.25 * S; - out[2] = (sm23 + sm32) / S; - } else { - S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2; - out[3] = (sm12 - sm21) / S; - out[0] = (sm31 + sm13) / S; - out[1] = (sm23 + sm32) / S; - out[2] = 0.25 * S; - } - - return out; -} -/** - * Creates a matrix from a quaternion rotation, vector translation and vector scale - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale) - * - * @param {mat4} out mat4 receiving operation result - * @param {quat4} q Rotation quaternion - * @param {ReadonlyVec3} v Translation vector - * @param {ReadonlyVec3} s Scaling vector - * @returns {mat4} out - */ - -function fromRotationTranslationScale(out, q, v, s) { - // Quaternion math - var x = q[0], - y = q[1], - z = q[2], - w = q[3]; - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - var sx = s[0]; - var sy = s[1]; - var sz = s[2]; - out[0] = (1 - (yy + zz)) * sx; - out[1] = (xy + wz) * sx; - out[2] = (xz - wy) * sx; - out[3] = 0; - out[4] = (xy - wz) * sy; - out[5] = (1 - (xx + zz)) * sy; - out[6] = (yz + wx) * sy; - out[7] = 0; - out[8] = (xz + wy) * sz; - out[9] = (yz - wx) * sz; - out[10] = (1 - (xx + yy)) * sz; - out[11] = 0; - out[12] = v[0]; - out[13] = v[1]; - out[14] = v[2]; - out[15] = 1; - return out; -} -/** - * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * mat4.translate(dest, origin); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale) - * mat4.translate(dest, negativeOrigin); - * - * @param {mat4} out mat4 receiving operation result - * @param {quat4} q Rotation quaternion - * @param {ReadonlyVec3} v Translation vector - * @param {ReadonlyVec3} s Scaling vector - * @param {ReadonlyVec3} o The origin vector around which to scale and rotate - * @returns {mat4} out - */ - -function fromRotationTranslationScaleOrigin(out, q, v, s, o) { - // Quaternion math - var x = q[0], - y = q[1], - z = q[2], - w = q[3]; - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - var sx = s[0]; - var sy = s[1]; - var sz = s[2]; - var ox = o[0]; - var oy = o[1]; - var oz = o[2]; - var out0 = (1 - (yy + zz)) * sx; - var out1 = (xy + wz) * sx; - var out2 = (xz - wy) * sx; - var out4 = (xy - wz) * sy; - var out5 = (1 - (xx + zz)) * sy; - var out6 = (yz + wx) * sy; - var out8 = (xz + wy) * sz; - var out9 = (yz - wx) * sz; - var out10 = (1 - (xx + yy)) * sz; - out[0] = out0; - out[1] = out1; - out[2] = out2; - out[3] = 0; - out[4] = out4; - out[5] = out5; - out[6] = out6; - out[7] = 0; - out[8] = out8; - out[9] = out9; - out[10] = out10; - out[11] = 0; - out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz); - out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz); - out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz); - out[15] = 1; - return out; -} -/** - * Calculates a 4x4 matrix from the given quaternion - * - * @param {mat4} out mat4 receiving operation result - * @param {ReadonlyQuat} q Quaternion to create matrix from - * - * @returns {mat4} out - */ - -function fromQuat(out, q) { - var x = q[0], - y = q[1], - z = q[2], - w = q[3]; - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - var xx = x * x2; - var yx = y * x2; - var yy = y * y2; - var zx = z * x2; - var zy = z * y2; - var zz = z * z2; - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - out[0] = 1 - yy - zz; - out[1] = yx + wz; - out[2] = zx - wy; - out[3] = 0; - out[4] = yx - wz; - out[5] = 1 - xx - zz; - out[6] = zy + wx; - out[7] = 0; - out[8] = zx + wy; - out[9] = zy - wx; - out[10] = 1 - xx - yy; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Generates a frustum matrix with the given bounds - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {Number} left Left bound of the frustum - * @param {Number} right Right bound of the frustum - * @param {Number} bottom Bottom bound of the frustum - * @param {Number} top Top bound of the frustum - * @param {Number} near Near bound of the frustum - * @param {Number} far Far bound of the frustum - * @returns {mat4} out - */ - -function frustum(out, left, right, bottom, top, near, far) { - var rl = 1 / (right - left); - var tb = 1 / (top - bottom); - var nf = 1 / (near - far); - out[0] = near * 2 * rl; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = near * 2 * tb; - out[6] = 0; - out[7] = 0; - out[8] = (right + left) * rl; - out[9] = (top + bottom) * tb; - out[10] = (far + near) * nf; - out[11] = -1; - out[12] = 0; - out[13] = 0; - out[14] = far * near * 2 * nf; - out[15] = 0; - return out; -} -/** - * Generates a perspective projection matrix with the given bounds. - * Passing null/undefined/no value for far will generate infinite projection matrix. - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {number} fovy Vertical field of view in radians - * @param {number} aspect Aspect ratio. typically viewport width/height - * @param {number} near Near bound of the frustum - * @param {number} far Far bound of the frustum, can be null or Infinity - * @returns {mat4} out - */ - -function perspective(out, fovy, aspect, near, far) { - var f = 1.0 / Math.tan(fovy / 2), - nf; - out[0] = f / aspect; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = f; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[11] = -1; - out[12] = 0; - out[13] = 0; - out[15] = 0; - - if (far != null && far !== Infinity) { - nf = 1 / (near - far); - out[10] = (far + near) * nf; - out[14] = 2 * far * near * nf; - } else { - out[10] = -1; - out[14] = -2 * near; - } - - return out; -} -/** - * Generates a perspective projection matrix with the given field of view. - * This is primarily useful for generating projection matrices to be used - * with the still experiemental WebVR API. - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees - * @param {number} near Near bound of the frustum - * @param {number} far Far bound of the frustum - * @returns {mat4} out - */ - -function perspectiveFromFieldOfView(out, fov, near, far) { - var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0); - var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0); - var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0); - var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0); - var xScale = 2.0 / (leftTan + rightTan); - var yScale = 2.0 / (upTan + downTan); - out[0] = xScale; - out[1] = 0.0; - out[2] = 0.0; - out[3] = 0.0; - out[4] = 0.0; - out[5] = yScale; - out[6] = 0.0; - out[7] = 0.0; - out[8] = -((leftTan - rightTan) * xScale * 0.5); - out[9] = (upTan - downTan) * yScale * 0.5; - out[10] = far / (near - far); - out[11] = -1.0; - out[12] = 0.0; - out[13] = 0.0; - out[14] = far * near / (near - far); - out[15] = 0.0; - return out; -} -/** - * Generates a orthogonal projection matrix with the given bounds - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {number} left Left bound of the frustum - * @param {number} right Right bound of the frustum - * @param {number} bottom Bottom bound of the frustum - * @param {number} top Top bound of the frustum - * @param {number} near Near bound of the frustum - * @param {number} far Far bound of the frustum - * @returns {mat4} out - */ - -function ortho(out, left, right, bottom, top, near, far) { - var lr = 1 / (left - right); - var bt = 1 / (bottom - top); - var nf = 1 / (near - far); - out[0] = -2 * lr; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = -2 * bt; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 2 * nf; - out[11] = 0; - out[12] = (left + right) * lr; - out[13] = (top + bottom) * bt; - out[14] = (far + near) * nf; - out[15] = 1; - return out; -} -/** - * Generates a look-at matrix with the given eye position, focal point, and up axis. - * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {ReadonlyVec3} eye Position of the viewer - * @param {ReadonlyVec3} center Point the viewer is looking at - * @param {ReadonlyVec3} up vec3 pointing up - * @returns {mat4} out - */ - -function lookAt(out, eye, center, up) { - var x0, x1, x2, y0, y1, y2, z0, z1, z2, len; - var eyex = eye[0]; - var eyey = eye[1]; - var eyez = eye[2]; - var upx = up[0]; - var upy = up[1]; - var upz = up[2]; - var centerx = center[0]; - var centery = center[1]; - var centerz = center[2]; - - if (Math.abs(eyex - centerx) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON && Math.abs(eyey - centery) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON && Math.abs(eyez - centerz) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - return identity(out); - } - - z0 = eyex - centerx; - z1 = eyey - centery; - z2 = eyez - centerz; - len = 1 / Math.hypot(z0, z1, z2); - z0 *= len; - z1 *= len; - z2 *= len; - x0 = upy * z2 - upz * z1; - x1 = upz * z0 - upx * z2; - x2 = upx * z1 - upy * z0; - len = Math.hypot(x0, x1, x2); - - if (!len) { - x0 = 0; - x1 = 0; - x2 = 0; - } else { - len = 1 / len; - x0 *= len; - x1 *= len; - x2 *= len; - } - - y0 = z1 * x2 - z2 * x1; - y1 = z2 * x0 - z0 * x2; - y2 = z0 * x1 - z1 * x0; - len = Math.hypot(y0, y1, y2); - - if (!len) { - y0 = 0; - y1 = 0; - y2 = 0; - } else { - len = 1 / len; - y0 *= len; - y1 *= len; - y2 *= len; - } - - out[0] = x0; - out[1] = y0; - out[2] = z0; - out[3] = 0; - out[4] = x1; - out[5] = y1; - out[6] = z1; - out[7] = 0; - out[8] = x2; - out[9] = y2; - out[10] = z2; - out[11] = 0; - out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); - out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); - out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); - out[15] = 1; - return out; -} -/** - * Generates a matrix that makes something look at something else. - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {ReadonlyVec3} eye Position of the viewer - * @param {ReadonlyVec3} center Point the viewer is looking at - * @param {ReadonlyVec3} up vec3 pointing up - * @returns {mat4} out - */ - -function targetTo(out, eye, target, up) { - var eyex = eye[0], - eyey = eye[1], - eyez = eye[2], - upx = up[0], - upy = up[1], - upz = up[2]; - var z0 = eyex - target[0], - z1 = eyey - target[1], - z2 = eyez - target[2]; - var len = z0 * z0 + z1 * z1 + z2 * z2; - - if (len > 0) { - len = 1 / Math.sqrt(len); - z0 *= len; - z1 *= len; - z2 *= len; - } - - var x0 = upy * z2 - upz * z1, - x1 = upz * z0 - upx * z2, - x2 = upx * z1 - upy * z0; - len = x0 * x0 + x1 * x1 + x2 * x2; - - if (len > 0) { - len = 1 / Math.sqrt(len); - x0 *= len; - x1 *= len; - x2 *= len; - } - - out[0] = x0; - out[1] = x1; - out[2] = x2; - out[3] = 0; - out[4] = z1 * x2 - z2 * x1; - out[5] = z2 * x0 - z0 * x2; - out[6] = z0 * x1 - z1 * x0; - out[7] = 0; - out[8] = z0; - out[9] = z1; - out[10] = z2; - out[11] = 0; - out[12] = eyex; - out[13] = eyey; - out[14] = eyez; - out[15] = 1; - return out; -} -/** - * Returns a string representation of a mat4 - * - * @param {ReadonlyMat4} a matrix to represent as a string - * @returns {String} string representation of the matrix - */ - -function str(a) { - return "mat4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ", " + a[9] + ", " + a[10] + ", " + a[11] + ", " + a[12] + ", " + a[13] + ", " + a[14] + ", " + a[15] + ")"; -} -/** - * Returns Frobenius norm of a mat4 - * - * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of - * @returns {Number} Frobenius norm - */ - -function frob(a) { - return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); -} -/** - * Adds two mat4's - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the first operand - * @param {ReadonlyMat4} b the second operand - * @returns {mat4} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - out[4] = a[4] + b[4]; - out[5] = a[5] + b[5]; - out[6] = a[6] + b[6]; - out[7] = a[7] + b[7]; - out[8] = a[8] + b[8]; - out[9] = a[9] + b[9]; - out[10] = a[10] + b[10]; - out[11] = a[11] + b[11]; - out[12] = a[12] + b[12]; - out[13] = a[13] + b[13]; - out[14] = a[14] + b[14]; - out[15] = a[15] + b[15]; - return out; -} -/** - * Subtracts matrix b from matrix a - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the first operand - * @param {ReadonlyMat4} b the second operand - * @returns {mat4} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - out[3] = a[3] - b[3]; - out[4] = a[4] - b[4]; - out[5] = a[5] - b[5]; - out[6] = a[6] - b[6]; - out[7] = a[7] - b[7]; - out[8] = a[8] - b[8]; - out[9] = a[9] - b[9]; - out[10] = a[10] - b[10]; - out[11] = a[11] - b[11]; - out[12] = a[12] - b[12]; - out[13] = a[13] - b[13]; - out[14] = a[14] - b[14]; - out[15] = a[15] - b[15]; - return out; -} -/** - * Multiply each element of the matrix by a scalar. - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to scale - * @param {Number} b amount to scale the matrix's elements by - * @returns {mat4} out - */ - -function multiplyScalar(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - out[4] = a[4] * b; - out[5] = a[5] * b; - out[6] = a[6] * b; - out[7] = a[7] * b; - out[8] = a[8] * b; - out[9] = a[9] * b; - out[10] = a[10] * b; - out[11] = a[11] * b; - out[12] = a[12] * b; - out[13] = a[13] * b; - out[14] = a[14] * b; - out[15] = a[15] * b; - return out; -} -/** - * Adds two mat4's after multiplying each element of the second operand by a scalar value. - * - * @param {mat4} out the receiving vector - * @param {ReadonlyMat4} a the first operand - * @param {ReadonlyMat4} b the second operand - * @param {Number} scale the amount to scale b's elements by before adding - * @returns {mat4} out - */ - -function multiplyScalarAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - out[3] = a[3] + b[3] * scale; - out[4] = a[4] + b[4] * scale; - out[5] = a[5] + b[5] * scale; - out[6] = a[6] + b[6] * scale; - out[7] = a[7] + b[7] * scale; - out[8] = a[8] + b[8] * scale; - out[9] = a[9] + b[9] * scale; - out[10] = a[10] + b[10] * scale; - out[11] = a[11] + b[11] * scale; - out[12] = a[12] + b[12] * scale; - out[13] = a[13] + b[13] * scale; - out[14] = a[14] + b[14] * scale; - out[15] = a[15] + b[15] * scale; - return out; -} -/** - * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyMat4} a The first matrix. - * @param {ReadonlyMat4} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15]; -} -/** - * Returns whether or not the matrices have approximately the same elements in the same position. - * - * @param {ReadonlyMat4} a The first matrix. - * @param {ReadonlyMat4} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var a4 = a[4], - a5 = a[5], - a6 = a[6], - a7 = a[7]; - var a8 = a[8], - a9 = a[9], - a10 = a[10], - a11 = a[11]; - var a12 = a[12], - a13 = a[13], - a14 = a[14], - a15 = a[15]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3]; - var b4 = b[4], - b5 = b[5], - b6 = b[6], - b7 = b[7]; - var b8 = b[8], - b9 = b[9], - b10 = b[10], - b11 = b[11]; - var b12 = b[12], - b13 = b[13], - b14 = b[14], - b15 = b[15]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15)); -} -/** - * Alias for {@link mat4.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link mat4.subtract} - * @function - */ - -var sub = subtract; - -/***/ }), -/* 19 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "setAxisAngle": () => (/* binding */ setAxisAngle), -/* harmony export */ "getAxisAngle": () => (/* binding */ getAxisAngle), -/* harmony export */ "getAngle": () => (/* binding */ getAngle), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "rotateX": () => (/* binding */ rotateX), -/* harmony export */ "rotateY": () => (/* binding */ rotateY), -/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), -/* harmony export */ "calculateW": () => (/* binding */ calculateW), -/* harmony export */ "exp": () => (/* binding */ exp), -/* harmony export */ "ln": () => (/* binding */ ln), -/* harmony export */ "pow": () => (/* binding */ pow), -/* harmony export */ "slerp": () => (/* binding */ slerp), -/* harmony export */ "random": () => (/* binding */ random), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "conjugate": () => (/* binding */ conjugate), -/* harmony export */ "fromMat3": () => (/* binding */ fromMat3), -/* harmony export */ "fromEuler": () => (/* binding */ fromEuler), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "dot": () => (/* binding */ dot), -/* harmony export */ "lerp": () => (/* binding */ lerp), -/* harmony export */ "length": () => (/* binding */ length), -/* harmony export */ "len": () => (/* binding */ len), -/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), -/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), -/* harmony export */ "normalize": () => (/* binding */ normalize), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "rotationTo": () => (/* binding */ rotationTo), -/* harmony export */ "sqlerp": () => (/* binding */ sqlerp), -/* harmony export */ "setAxes": () => (/* binding */ setAxes) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); -/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17); -/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(21); -/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20); - - - - -/** - * Quaternion - * @module quat - */ - -/** - * Creates a new identity quat - * - * @returns {quat} a new quaternion - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - } - - out[3] = 1; - return out; -} -/** - * Set a quat to the identity quaternion - * - * @param {quat} out the receiving quaternion - * @returns {quat} out - */ - -function identity(out) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 1; - return out; -} -/** - * Sets a quat from the given angle and rotation axis, - * then returns it. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyVec3} axis the axis around which to rotate - * @param {Number} rad the angle in radians - * @returns {quat} out - **/ - -function setAxisAngle(out, axis, rad) { - rad = rad * 0.5; - var s = Math.sin(rad); - out[0] = s * axis[0]; - out[1] = s * axis[1]; - out[2] = s * axis[2]; - out[3] = Math.cos(rad); - return out; -} -/** - * Gets the rotation axis and angle for a given - * quaternion. If a quaternion is created with - * setAxisAngle, this method will return the same - * values as providied in the original parameter list - * OR functionally equivalent values. - * Example: The quaternion formed by axis [0, 0, 1] and - * angle -90 is the same as the quaternion formed by - * [0, 0, 1] and 270. This method favors the latter. - * @param {vec3} out_axis Vector receiving the axis of rotation - * @param {ReadonlyQuat} q Quaternion to be decomposed - * @return {Number} Angle, in radians, of the rotation - */ - -function getAxisAngle(out_axis, q) { - var rad = Math.acos(q[3]) * 2.0; - var s = Math.sin(rad / 2.0); - - if (s > _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - out_axis[0] = q[0] / s; - out_axis[1] = q[1] / s; - out_axis[2] = q[2] / s; - } else { - // If s is zero, return any axis (no rotation - axis does not matter) - out_axis[0] = 1; - out_axis[1] = 0; - out_axis[2] = 0; - } - - return rad; -} -/** - * Gets the angular distance between two unit quaternions - * - * @param {ReadonlyQuat} a Origin unit quaternion - * @param {ReadonlyQuat} b Destination unit quaternion - * @return {Number} Angle, in radians, between the two quaternions - */ - -function getAngle(a, b) { - var dotproduct = dot(a, b); - return Math.acos(2 * dotproduct * dotproduct - 1); -} -/** - * Multiplies two quat's - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @returns {quat} out - */ - -function multiply(out, a, b) { - var ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - var bx = b[0], - by = b[1], - bz = b[2], - bw = b[3]; - out[0] = ax * bw + aw * bx + ay * bz - az * by; - out[1] = ay * bw + aw * by + az * bx - ax * bz; - out[2] = az * bw + aw * bz + ax * by - ay * bx; - out[3] = aw * bw - ax * bx - ay * by - az * bz; - return out; -} -/** - * Rotates a quaternion by the given angle about the X axis - * - * @param {quat} out quat receiving operation result - * @param {ReadonlyQuat} a quat to rotate - * @param {number} rad angle (in radians) to rotate - * @returns {quat} out - */ - -function rotateX(out, a, rad) { - rad *= 0.5; - var ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - var bx = Math.sin(rad), - bw = Math.cos(rad); - out[0] = ax * bw + aw * bx; - out[1] = ay * bw + az * bx; - out[2] = az * bw - ay * bx; - out[3] = aw * bw - ax * bx; - return out; -} -/** - * Rotates a quaternion by the given angle about the Y axis - * - * @param {quat} out quat receiving operation result - * @param {ReadonlyQuat} a quat to rotate - * @param {number} rad angle (in radians) to rotate - * @returns {quat} out - */ - -function rotateY(out, a, rad) { - rad *= 0.5; - var ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - var by = Math.sin(rad), - bw = Math.cos(rad); - out[0] = ax * bw - az * by; - out[1] = ay * bw + aw * by; - out[2] = az * bw + ax * by; - out[3] = aw * bw - ay * by; - return out; -} -/** - * Rotates a quaternion by the given angle about the Z axis - * - * @param {quat} out quat receiving operation result - * @param {ReadonlyQuat} a quat to rotate - * @param {number} rad angle (in radians) to rotate - * @returns {quat} out - */ - -function rotateZ(out, a, rad) { - rad *= 0.5; - var ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - var bz = Math.sin(rad), - bw = Math.cos(rad); - out[0] = ax * bw + ay * bz; - out[1] = ay * bw - ax * bz; - out[2] = az * bw + aw * bz; - out[3] = aw * bw - az * bz; - return out; -} -/** - * Calculates the W component of a quat from the X, Y, and Z components. - * Assumes that quaternion is 1 unit in length. - * Any existing W component will be ignored. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate W component of - * @returns {quat} out - */ - -function calculateW(out, a) { - var x = a[0], - y = a[1], - z = a[2]; - out[0] = x; - out[1] = y; - out[2] = z; - out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z)); - return out; -} -/** - * Calculate the exponential of a unit quaternion. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate the exponential of - * @returns {quat} out - */ - -function exp(out, a) { - var x = a[0], - y = a[1], - z = a[2], - w = a[3]; - var r = Math.sqrt(x * x + y * y + z * z); - var et = Math.exp(w); - var s = r > 0 ? et * Math.sin(r) / r : 0; - out[0] = x * s; - out[1] = y * s; - out[2] = z * s; - out[3] = et * Math.cos(r); - return out; -} -/** - * Calculate the natural logarithm of a unit quaternion. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate the exponential of - * @returns {quat} out - */ - -function ln(out, a) { - var x = a[0], - y = a[1], - z = a[2], - w = a[3]; - var r = Math.sqrt(x * x + y * y + z * z); - var t = r > 0 ? Math.atan2(r, w) / r : 0; - out[0] = x * t; - out[1] = y * t; - out[2] = z * t; - out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w); - return out; -} -/** - * Calculate the scalar power of a unit quaternion. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate the exponential of - * @param {Number} b amount to scale the quaternion by - * @returns {quat} out - */ - -function pow(out, a, b) { - ln(out, a); - scale(out, out, b); - exp(out, out); - return out; -} -/** - * Performs a spherical linear interpolation between two quat - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {quat} out - */ - -function slerp(out, a, b, t) { - // benchmarks: - // http://jsperf.com/quaternion-slerp-implementations - var ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - var bx = b[0], - by = b[1], - bz = b[2], - bw = b[3]; - var omega, cosom, sinom, scale0, scale1; // calc cosine - - cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary) - - if (cosom < 0.0) { - cosom = -cosom; - bx = -bx; - by = -by; - bz = -bz; - bw = -bw; - } // calculate coefficients - - - if (1.0 - cosom > _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - // standard case (slerp) - omega = Math.acos(cosom); - sinom = Math.sin(omega); - scale0 = Math.sin((1.0 - t) * omega) / sinom; - scale1 = Math.sin(t * omega) / sinom; - } else { - // "from" and "to" quaternions are very close - // ... so we can do a linear interpolation - scale0 = 1.0 - t; - scale1 = t; - } // calculate final values - - - out[0] = scale0 * ax + scale1 * bx; - out[1] = scale0 * ay + scale1 * by; - out[2] = scale0 * az + scale1 * bz; - out[3] = scale0 * aw + scale1 * bw; - return out; -} -/** - * Generates a random unit quaternion - * - * @param {quat} out the receiving quaternion - * @returns {quat} out - */ - -function random(out) { - // Implementation of http://planning.cs.uiuc.edu/node198.html - // TODO: Calling random 3 times is probably not the fastest solution - var u1 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); - var u2 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); - var u3 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); - var sqrt1MinusU1 = Math.sqrt(1 - u1); - var sqrtU1 = Math.sqrt(u1); - out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2); - out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2); - out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3); - out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3); - return out; -} -/** - * Calculates the inverse of a quat - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate inverse of - * @returns {quat} out - */ - -function invert(out, a) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; - var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 - - out[0] = -a0 * invDot; - out[1] = -a1 * invDot; - out[2] = -a2 * invDot; - out[3] = a3 * invDot; - return out; -} -/** - * Calculates the conjugate of a quat - * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate conjugate of - * @returns {quat} out - */ - -function conjugate(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - out[2] = -a[2]; - out[3] = a[3]; - return out; -} -/** - * Creates a quaternion from the given 3x3 rotation matrix. - * - * NOTE: The resultant quaternion is not normalized, so you should be sure - * to renormalize the quaternion yourself where necessary. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyMat3} m rotation matrix - * @returns {quat} out - * @function - */ - -function fromMat3(out, m) { - // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes - // article "Quaternion Calculus and Fast Animation". - var fTrace = m[0] + m[4] + m[8]; - var fRoot; - - if (fTrace > 0.0) { - // |w| > 1/2, may as well choose w > 1/2 - fRoot = Math.sqrt(fTrace + 1.0); // 2w - - out[3] = 0.5 * fRoot; - fRoot = 0.5 / fRoot; // 1/(4w) - - out[0] = (m[5] - m[7]) * fRoot; - out[1] = (m[6] - m[2]) * fRoot; - out[2] = (m[1] - m[3]) * fRoot; - } else { - // |w| <= 1/2 - var i = 0; - if (m[4] > m[0]) i = 1; - if (m[8] > m[i * 3 + i]) i = 2; - var j = (i + 1) % 3; - var k = (i + 2) % 3; - fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0); - out[i] = 0.5 * fRoot; - fRoot = 0.5 / fRoot; - out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot; - out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; - out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; - } - - return out; -} -/** - * Creates a quaternion from the given euler angle x, y, z. - * - * @param {quat} out the receiving quaternion - * @param {x} Angle to rotate around X axis in degrees. - * @param {y} Angle to rotate around Y axis in degrees. - * @param {z} Angle to rotate around Z axis in degrees. - * @returns {quat} out - * @function - */ - -function fromEuler(out, x, y, z) { - var halfToRad = 0.5 * Math.PI / 180.0; - x *= halfToRad; - y *= halfToRad; - z *= halfToRad; - var sx = Math.sin(x); - var cx = Math.cos(x); - var sy = Math.sin(y); - var cy = Math.cos(y); - var sz = Math.sin(z); - var cz = Math.cos(z); - out[0] = sx * cy * cz - cx * sy * sz; - out[1] = cx * sy * cz + sx * cy * sz; - out[2] = cx * cy * sz - sx * sy * cz; - out[3] = cx * cy * cz + sx * sy * sz; - return out; -} -/** - * Returns a string representation of a quatenion - * - * @param {ReadonlyQuat} a vector to represent as a string - * @returns {String} string representation of the vector - */ - -function str(a) { - return "quat(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; -} -/** - * Creates a new quat initialized with values from an existing quaternion - * - * @param {ReadonlyQuat} a quaternion to clone - * @returns {quat} a new quaternion - * @function - */ - -var clone = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.clone; -/** - * Creates a new quat initialized with the given values - * - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @param {Number} w W component - * @returns {quat} a new quaternion - * @function - */ - -var fromValues = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.fromValues; -/** - * Copy the values from one quat to another - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the source quaternion - * @returns {quat} out - * @function - */ - -var copy = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.copy; -/** - * Set the components of a quat to the given values - * - * @param {quat} out the receiving quaternion - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @param {Number} w W component - * @returns {quat} out - * @function - */ - -var set = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.set; -/** - * Adds two quat's - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @returns {quat} out - * @function - */ - -var add = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.add; -/** - * Alias for {@link quat.multiply} - * @function - */ - -var mul = multiply; -/** - * Scales a quat by a scalar number - * - * @param {quat} out the receiving vector - * @param {ReadonlyQuat} a the vector to scale - * @param {Number} b amount to scale the vector by - * @returns {quat} out - * @function - */ - -var scale = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.scale; -/** - * Calculates the dot product of two quat's - * - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @returns {Number} dot product of a and b - * @function - */ - -var dot = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.dot; -/** - * Performs a linear interpolation between two quat's - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {quat} out - * @function - */ - -var lerp = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.lerp; -/** - * Calculates the length of a quat - * - * @param {ReadonlyQuat} a vector to calculate length of - * @returns {Number} length of a - */ - -var length = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.length; -/** - * Alias for {@link quat.length} - * @function - */ - -var len = length; -/** - * Calculates the squared length of a quat - * - * @param {ReadonlyQuat} a vector to calculate squared length of - * @returns {Number} squared length of a - * @function - */ - -var squaredLength = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.squaredLength; -/** - * Alias for {@link quat.squaredLength} - * @function - */ - -var sqrLen = squaredLength; -/** - * Normalize a quat - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quaternion to normalize - * @returns {quat} out - * @function - */ - -var normalize = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.normalize; -/** - * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyQuat} a The first quaternion. - * @param {ReadonlyQuat} b The second quaternion. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -var exactEquals = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.exactEquals; -/** - * Returns whether or not the quaternions have approximately the same elements in the same position. - * - * @param {ReadonlyQuat} a The first vector. - * @param {ReadonlyQuat} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -var equals = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.equals; -/** - * Sets a quaternion to represent the shortest rotation from one - * vector to another. - * - * Both vectors are assumed to be unit length. - * - * @param {quat} out the receiving quaternion. - * @param {ReadonlyVec3} a the initial vector - * @param {ReadonlyVec3} b the destination vector - * @returns {quat} out - */ - -var rotationTo = function () { - var tmpvec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.create(); - var xUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.fromValues(1, 0, 0); - var yUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.fromValues(0, 1, 0); - return function (out, a, b) { - var dot = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.dot(a, b); - - if (dot < -0.999999) { - _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, xUnitVec3, a); - if (_vec3_js__WEBPACK_IMPORTED_MODULE_2__.len(tmpvec3) < 0.000001) _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, yUnitVec3, a); - _vec3_js__WEBPACK_IMPORTED_MODULE_2__.normalize(tmpvec3, tmpvec3); - setAxisAngle(out, tmpvec3, Math.PI); - return out; - } else if (dot > 0.999999) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 1; - return out; - } else { - _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, a, b); - out[0] = tmpvec3[0]; - out[1] = tmpvec3[1]; - out[2] = tmpvec3[2]; - out[3] = 1 + dot; - return normalize(out, out); - } - }; -}(); -/** - * Performs a spherical linear interpolation with two control points - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @param {ReadonlyQuat} c the third operand - * @param {ReadonlyQuat} d the fourth operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {quat} out - */ - -var sqlerp = function () { - var temp1 = create(); - var temp2 = create(); - return function (out, a, b, c, d, t) { - slerp(temp1, a, d, t); - slerp(temp2, b, c, t); - slerp(out, temp1, temp2, 2 * t * (1 - t)); - return out; - }; -}(); -/** - * Sets the specified quaternion with values corresponding to the given - * axes. Each axis is a vec3 and is expected to be unit length and - * perpendicular to all other specified axes. - * - * @param {ReadonlyVec3} view the vector representing the viewing direction - * @param {ReadonlyVec3} right the vector representing the local "right" direction - * @param {ReadonlyVec3} up the vector representing the local "up" direction - * @returns {quat} out - */ - -var setAxes = function () { - var matr = _mat3_js__WEBPACK_IMPORTED_MODULE_3__.create(); - return function (out, view, right, up) { - matr[0] = right[0]; - matr[3] = right[1]; - matr[6] = right[2]; - matr[1] = up[0]; - matr[4] = up[1]; - matr[7] = up[2]; - matr[2] = -view[0]; - matr[5] = -view[1]; - matr[8] = -view[2]; - return normalize(out, fromMat3(out, matr)); - }; -}(); - -/***/ }), -/* 20 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "divide": () => (/* binding */ divide), -/* harmony export */ "ceil": () => (/* binding */ ceil), -/* harmony export */ "floor": () => (/* binding */ floor), -/* harmony export */ "min": () => (/* binding */ min), -/* harmony export */ "max": () => (/* binding */ max), -/* harmony export */ "round": () => (/* binding */ round), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), -/* harmony export */ "distance": () => (/* binding */ distance), -/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), -/* harmony export */ "length": () => (/* binding */ length), -/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), -/* harmony export */ "negate": () => (/* binding */ negate), -/* harmony export */ "inverse": () => (/* binding */ inverse), -/* harmony export */ "normalize": () => (/* binding */ normalize), -/* harmony export */ "dot": () => (/* binding */ dot), -/* harmony export */ "cross": () => (/* binding */ cross), -/* harmony export */ "lerp": () => (/* binding */ lerp), -/* harmony export */ "random": () => (/* binding */ random), -/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), -/* harmony export */ "transformQuat": () => (/* binding */ transformQuat), -/* harmony export */ "zero": () => (/* binding */ zero), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "sub": () => (/* binding */ sub), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "div": () => (/* binding */ div), -/* harmony export */ "dist": () => (/* binding */ dist), -/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), -/* harmony export */ "len": () => (/* binding */ len), -/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), -/* harmony export */ "forEach": () => (/* binding */ forEach) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); - -/** - * 4 Dimensional Vector - * @module vec4 - */ - -/** - * Creates a new, empty vec4 - * - * @returns {vec4} a new 4D vector - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 0; - } - - return out; -} -/** - * Creates a new vec4 initialized with values from an existing vector - * - * @param {ReadonlyVec4} a vector to clone - * @returns {vec4} a new 4D vector - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - return out; -} -/** - * Creates a new vec4 initialized with the given values - * - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @param {Number} w W component - * @returns {vec4} a new 4D vector - */ - -function fromValues(x, y, z, w) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - out[0] = x; - out[1] = y; - out[2] = z; - out[3] = w; - return out; -} -/** - * Copy the values from one vec4 to another - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the source vector - * @returns {vec4} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - return out; -} -/** - * Set the components of a vec4 to the given values - * - * @param {vec4} out the receiving vector - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @param {Number} w W component - * @returns {vec4} out - */ - -function set(out, x, y, z, w) { - out[0] = x; - out[1] = y; - out[2] = z; - out[3] = w; - return out; -} -/** - * Adds two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - return out; -} -/** - * Subtracts vector b from vector a - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - out[3] = a[3] - b[3]; - return out; -} -/** - * Multiplies two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function multiply(out, a, b) { - out[0] = a[0] * b[0]; - out[1] = a[1] * b[1]; - out[2] = a[2] * b[2]; - out[3] = a[3] * b[3]; - return out; -} -/** - * Divides two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function divide(out, a, b) { - out[0] = a[0] / b[0]; - out[1] = a[1] / b[1]; - out[2] = a[2] / b[2]; - out[3] = a[3] / b[3]; - return out; -} -/** - * Math.ceil the components of a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to ceil - * @returns {vec4} out - */ - -function ceil(out, a) { - out[0] = Math.ceil(a[0]); - out[1] = Math.ceil(a[1]); - out[2] = Math.ceil(a[2]); - out[3] = Math.ceil(a[3]); - return out; -} -/** - * Math.floor the components of a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to floor - * @returns {vec4} out - */ - -function floor(out, a) { - out[0] = Math.floor(a[0]); - out[1] = Math.floor(a[1]); - out[2] = Math.floor(a[2]); - out[3] = Math.floor(a[3]); - return out; -} -/** - * Returns the minimum of two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function min(out, a, b) { - out[0] = Math.min(a[0], b[0]); - out[1] = Math.min(a[1], b[1]); - out[2] = Math.min(a[2], b[2]); - out[3] = Math.min(a[3], b[3]); - return out; -} -/** - * Returns the maximum of two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function max(out, a, b) { - out[0] = Math.max(a[0], b[0]); - out[1] = Math.max(a[1], b[1]); - out[2] = Math.max(a[2], b[2]); - out[3] = Math.max(a[3], b[3]); - return out; -} -/** - * Math.round the components of a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to round - * @returns {vec4} out - */ - -function round(out, a) { - out[0] = Math.round(a[0]); - out[1] = Math.round(a[1]); - out[2] = Math.round(a[2]); - out[3] = Math.round(a[3]); - return out; -} -/** - * Scales a vec4 by a scalar number - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the vector to scale - * @param {Number} b amount to scale the vector by - * @returns {vec4} out - */ - -function scale(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - return out; -} -/** - * Adds two vec4's after scaling the second operand by a scalar value - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @param {Number} scale the amount to scale b by before adding - * @returns {vec4} out - */ - -function scaleAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - out[3] = a[3] + b[3] * scale; - return out; -} -/** - * Calculates the euclidian distance between two vec4's - * - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {Number} distance between a and b - */ - -function distance(a, b) { - var x = b[0] - a[0]; - var y = b[1] - a[1]; - var z = b[2] - a[2]; - var w = b[3] - a[3]; - return Math.hypot(x, y, z, w); -} -/** - * Calculates the squared euclidian distance between two vec4's - * - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {Number} squared distance between a and b - */ - -function squaredDistance(a, b) { - var x = b[0] - a[0]; - var y = b[1] - a[1]; - var z = b[2] - a[2]; - var w = b[3] - a[3]; - return x * x + y * y + z * z + w * w; -} -/** - * Calculates the length of a vec4 - * - * @param {ReadonlyVec4} a vector to calculate length of - * @returns {Number} length of a - */ - -function length(a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - var w = a[3]; - return Math.hypot(x, y, z, w); -} -/** - * Calculates the squared length of a vec4 - * - * @param {ReadonlyVec4} a vector to calculate squared length of - * @returns {Number} squared length of a - */ - -function squaredLength(a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - var w = a[3]; - return x * x + y * y + z * z + w * w; -} -/** - * Negates the components of a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to negate - * @returns {vec4} out - */ - -function negate(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - out[2] = -a[2]; - out[3] = -a[3]; - return out; -} -/** - * Returns the inverse of the components of a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to invert - * @returns {vec4} out - */ - -function inverse(out, a) { - out[0] = 1.0 / a[0]; - out[1] = 1.0 / a[1]; - out[2] = 1.0 / a[2]; - out[3] = 1.0 / a[3]; - return out; -} -/** - * Normalize a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to normalize - * @returns {vec4} out - */ - -function normalize(out, a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - var w = a[3]; - var len = x * x + y * y + z * z + w * w; - - if (len > 0) { - len = 1 / Math.sqrt(len); - } - - out[0] = x * len; - out[1] = y * len; - out[2] = z * len; - out[3] = w * len; - return out; -} -/** - * Calculates the dot product of two vec4's - * - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {Number} dot product of a and b - */ - -function dot(a, b) { - return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; -} -/** - * Returns the cross-product of three vectors in a 4-dimensional space - * - * @param {ReadonlyVec4} result the receiving vector - * @param {ReadonlyVec4} U the first vector - * @param {ReadonlyVec4} V the second vector - * @param {ReadonlyVec4} W the third vector - * @returns {vec4} result - */ - -function cross(out, u, v, w) { - var A = v[0] * w[1] - v[1] * w[0], - B = v[0] * w[2] - v[2] * w[0], - C = v[0] * w[3] - v[3] * w[0], - D = v[1] * w[2] - v[2] * w[1], - E = v[1] * w[3] - v[3] * w[1], - F = v[2] * w[3] - v[3] * w[2]; - var G = u[0]; - var H = u[1]; - var I = u[2]; - var J = u[3]; - out[0] = H * F - I * E + J * D; - out[1] = -(G * F) + I * C - J * B; - out[2] = G * E - H * C + J * A; - out[3] = -(G * D) + H * B - I * A; - return out; -} -/** - * Performs a linear interpolation between two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {vec4} out - */ - -function lerp(out, a, b, t) { - var ax = a[0]; - var ay = a[1]; - var az = a[2]; - var aw = a[3]; - out[0] = ax + t * (b[0] - ax); - out[1] = ay + t * (b[1] - ay); - out[2] = az + t * (b[2] - az); - out[3] = aw + t * (b[3] - aw); - return out; -} -/** - * Generates a random vector with the given scale - * - * @param {vec4} out the receiving vector - * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned - * @returns {vec4} out - */ - -function random(out, scale) { - scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a - // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646. - // http://projecteuclid.org/euclid.aoms/1177692644; - - var v1, v2, v3, v4; - var s1, s2; - - do { - v1 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; - v2 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; - s1 = v1 * v1 + v2 * v2; - } while (s1 >= 1); - - do { - v3 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; - v4 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; - s2 = v3 * v3 + v4 * v4; - } while (s2 >= 1); - - var d = Math.sqrt((1 - s1) / s2); - out[0] = scale * v1; - out[1] = scale * v2; - out[2] = scale * v3 * d; - out[3] = scale * v4 * d; - return out; -} -/** - * Transforms the vec4 with a mat4. - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the vector to transform - * @param {ReadonlyMat4} m matrix to transform with - * @returns {vec4} out - */ - -function transformMat4(out, a, m) { - var x = a[0], - y = a[1], - z = a[2], - w = a[3]; - out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; - out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; - out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; - out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; - return out; -} -/** - * Transforms the vec4 with a quat - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the vector to transform - * @param {ReadonlyQuat} q quaternion to transform with - * @returns {vec4} out - */ - -function transformQuat(out, a, q) { - var x = a[0], - y = a[1], - z = a[2]; - var qx = q[0], - qy = q[1], - qz = q[2], - qw = q[3]; // calculate quat * vec - - var ix = qw * x + qy * z - qz * y; - var iy = qw * y + qz * x - qx * z; - var iz = qw * z + qx * y - qy * x; - var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat - - out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy; - out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz; - out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx; - out[3] = a[3]; - return out; -} -/** - * Set the components of a vec4 to zero - * - * @param {vec4} out the receiving vector - * @returns {vec4} out - */ - -function zero(out) { - out[0] = 0.0; - out[1] = 0.0; - out[2] = 0.0; - out[3] = 0.0; - return out; -} -/** - * Returns a string representation of a vector - * - * @param {ReadonlyVec4} a vector to represent as a string - * @returns {String} string representation of the vector - */ - -function str(a) { - return "vec4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; -} -/** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyVec4} a The first vector. - * @param {ReadonlyVec4} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; -} -/** - * Returns whether or not the vectors have approximately the same elements in the same position. - * - * @param {ReadonlyVec4} a The first vector. - * @param {ReadonlyVec4} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)); -} -/** - * Alias for {@link vec4.subtract} - * @function - */ - -var sub = subtract; -/** - * Alias for {@link vec4.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link vec4.divide} - * @function - */ - -var div = divide; -/** - * Alias for {@link vec4.distance} - * @function - */ - -var dist = distance; -/** - * Alias for {@link vec4.squaredDistance} - * @function - */ - -var sqrDist = squaredDistance; -/** - * Alias for {@link vec4.length} - * @function - */ - -var len = length; -/** - * Alias for {@link vec4.squaredLength} - * @function - */ - -var sqrLen = squaredLength; -/** - * Perform some operation over an array of vec4s. - * - * @param {Array} a the array of vectors to iterate over - * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed - * @param {Number} offset Number of elements to skip at the beginning of the array - * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array - * @param {Function} fn Function to call for each vector in the array - * @param {Object} [arg] additional argument to pass to fn - * @returns {Array} a - * @function - */ - -var forEach = function () { - var vec = create(); - return function (a, stride, offset, count, fn, arg) { - var i, l; - - if (!stride) { - stride = 4; - } - - if (!offset) { - offset = 0; - } - - if (count) { - l = Math.min(count * stride + offset, a.length); - } else { - l = a.length; - } - - for (i = offset; i < l; i += stride) { - vec[0] = a[i]; - vec[1] = a[i + 1]; - vec[2] = a[i + 2]; - vec[3] = a[i + 3]; - fn(vec, vec, arg); - a[i] = vec[0]; - a[i + 1] = vec[1]; - a[i + 2] = vec[2]; - a[i + 3] = vec[3]; - } - - return a; - }; -}(); - -/***/ }), -/* 21 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "length": () => (/* binding */ length), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "divide": () => (/* binding */ divide), -/* harmony export */ "ceil": () => (/* binding */ ceil), -/* harmony export */ "floor": () => (/* binding */ floor), -/* harmony export */ "min": () => (/* binding */ min), -/* harmony export */ "max": () => (/* binding */ max), -/* harmony export */ "round": () => (/* binding */ round), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), -/* harmony export */ "distance": () => (/* binding */ distance), -/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), -/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), -/* harmony export */ "negate": () => (/* binding */ negate), -/* harmony export */ "inverse": () => (/* binding */ inverse), -/* harmony export */ "normalize": () => (/* binding */ normalize), -/* harmony export */ "dot": () => (/* binding */ dot), -/* harmony export */ "cross": () => (/* binding */ cross), -/* harmony export */ "lerp": () => (/* binding */ lerp), -/* harmony export */ "hermite": () => (/* binding */ hermite), -/* harmony export */ "bezier": () => (/* binding */ bezier), -/* harmony export */ "random": () => (/* binding */ random), -/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), -/* harmony export */ "transformMat3": () => (/* binding */ transformMat3), -/* harmony export */ "transformQuat": () => (/* binding */ transformQuat), -/* harmony export */ "rotateX": () => (/* binding */ rotateX), -/* harmony export */ "rotateY": () => (/* binding */ rotateY), -/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), -/* harmony export */ "angle": () => (/* binding */ angle), -/* harmony export */ "zero": () => (/* binding */ zero), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "sub": () => (/* binding */ sub), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "div": () => (/* binding */ div), -/* harmony export */ "dist": () => (/* binding */ dist), -/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), -/* harmony export */ "len": () => (/* binding */ len), -/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), -/* harmony export */ "forEach": () => (/* binding */ forEach) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); - -/** - * 3 Dimensional Vector - * @module vec3 - */ - -/** - * Creates a new, empty vec3 - * - * @returns {vec3} a new 3D vector - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - } - - return out; -} -/** - * Creates a new vec3 initialized with values from an existing vector - * - * @param {ReadonlyVec3} a vector to clone - * @returns {vec3} a new 3D vector - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - return out; -} -/** - * Calculates the length of a vec3 - * - * @param {ReadonlyVec3} a vector to calculate length of - * @returns {Number} length of a - */ - -function length(a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - return Math.hypot(x, y, z); -} -/** - * Creates a new vec3 initialized with the given values - * - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @returns {vec3} a new 3D vector - */ - -function fromValues(x, y, z) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - out[0] = x; - out[1] = y; - out[2] = z; - return out; -} -/** - * Copy the values from one vec3 to another - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the source vector - * @returns {vec3} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - return out; -} -/** - * Set the components of a vec3 to the given values - * - * @param {vec3} out the receiving vector - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @returns {vec3} out - */ - -function set(out, x, y, z) { - out[0] = x; - out[1] = y; - out[2] = z; - return out; -} -/** - * Adds two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - return out; -} -/** - * Subtracts vector b from vector a - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - return out; -} -/** - * Multiplies two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function multiply(out, a, b) { - out[0] = a[0] * b[0]; - out[1] = a[1] * b[1]; - out[2] = a[2] * b[2]; - return out; -} -/** - * Divides two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function divide(out, a, b) { - out[0] = a[0] / b[0]; - out[1] = a[1] / b[1]; - out[2] = a[2] / b[2]; - return out; -} -/** - * Math.ceil the components of a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to ceil - * @returns {vec3} out - */ - -function ceil(out, a) { - out[0] = Math.ceil(a[0]); - out[1] = Math.ceil(a[1]); - out[2] = Math.ceil(a[2]); - return out; -} -/** - * Math.floor the components of a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to floor - * @returns {vec3} out - */ - -function floor(out, a) { - out[0] = Math.floor(a[0]); - out[1] = Math.floor(a[1]); - out[2] = Math.floor(a[2]); - return out; -} -/** - * Returns the minimum of two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function min(out, a, b) { - out[0] = Math.min(a[0], b[0]); - out[1] = Math.min(a[1], b[1]); - out[2] = Math.min(a[2], b[2]); - return out; -} -/** - * Returns the maximum of two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function max(out, a, b) { - out[0] = Math.max(a[0], b[0]); - out[1] = Math.max(a[1], b[1]); - out[2] = Math.max(a[2], b[2]); - return out; -} -/** - * Math.round the components of a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to round - * @returns {vec3} out - */ - -function round(out, a) { - out[0] = Math.round(a[0]); - out[1] = Math.round(a[1]); - out[2] = Math.round(a[2]); - return out; -} -/** - * Scales a vec3 by a scalar number - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the vector to scale - * @param {Number} b amount to scale the vector by - * @returns {vec3} out - */ - -function scale(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - return out; -} -/** - * Adds two vec3's after scaling the second operand by a scalar value - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @param {Number} scale the amount to scale b by before adding - * @returns {vec3} out - */ - -function scaleAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - return out; -} -/** - * Calculates the euclidian distance between two vec3's - * - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {Number} distance between a and b - */ - -function distance(a, b) { - var x = b[0] - a[0]; - var y = b[1] - a[1]; - var z = b[2] - a[2]; - return Math.hypot(x, y, z); -} -/** - * Calculates the squared euclidian distance between two vec3's - * - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {Number} squared distance between a and b - */ - -function squaredDistance(a, b) { - var x = b[0] - a[0]; - var y = b[1] - a[1]; - var z = b[2] - a[2]; - return x * x + y * y + z * z; -} -/** - * Calculates the squared length of a vec3 - * - * @param {ReadonlyVec3} a vector to calculate squared length of - * @returns {Number} squared length of a - */ - -function squaredLength(a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - return x * x + y * y + z * z; -} -/** - * Negates the components of a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to negate - * @returns {vec3} out - */ - -function negate(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - out[2] = -a[2]; - return out; -} -/** - * Returns the inverse of the components of a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to invert - * @returns {vec3} out - */ - -function inverse(out, a) { - out[0] = 1.0 / a[0]; - out[1] = 1.0 / a[1]; - out[2] = 1.0 / a[2]; - return out; -} -/** - * Normalize a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to normalize - * @returns {vec3} out - */ - -function normalize(out, a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - var len = x * x + y * y + z * z; - - if (len > 0) { - //TODO: evaluate use of glm_invsqrt here? - len = 1 / Math.sqrt(len); - } - - out[0] = a[0] * len; - out[1] = a[1] * len; - out[2] = a[2] * len; - return out; -} -/** - * Calculates the dot product of two vec3's - * - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {Number} dot product of a and b - */ - -function dot(a, b) { - return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; -} -/** - * Computes the cross product of two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function cross(out, a, b) { - var ax = a[0], - ay = a[1], - az = a[2]; - var bx = b[0], - by = b[1], - bz = b[2]; - out[0] = ay * bz - az * by; - out[1] = az * bx - ax * bz; - out[2] = ax * by - ay * bx; - return out; -} -/** - * Performs a linear interpolation between two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {vec3} out - */ - -function lerp(out, a, b, t) { - var ax = a[0]; - var ay = a[1]; - var az = a[2]; - out[0] = ax + t * (b[0] - ax); - out[1] = ay + t * (b[1] - ay); - out[2] = az + t * (b[2] - az); - return out; -} -/** - * Performs a hermite interpolation with two control points - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @param {ReadonlyVec3} c the third operand - * @param {ReadonlyVec3} d the fourth operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {vec3} out - */ - -function hermite(out, a, b, c, d, t) { - var factorTimes2 = t * t; - var factor1 = factorTimes2 * (2 * t - 3) + 1; - var factor2 = factorTimes2 * (t - 2) + t; - var factor3 = factorTimes2 * (t - 1); - var factor4 = factorTimes2 * (3 - 2 * t); - out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; - out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; - out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; - return out; -} -/** - * Performs a bezier interpolation with two control points - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @param {ReadonlyVec3} c the third operand - * @param {ReadonlyVec3} d the fourth operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {vec3} out - */ - -function bezier(out, a, b, c, d, t) { - var inverseFactor = 1 - t; - var inverseFactorTimesTwo = inverseFactor * inverseFactor; - var factorTimes2 = t * t; - var factor1 = inverseFactorTimesTwo * inverseFactor; - var factor2 = 3 * t * inverseFactorTimesTwo; - var factor3 = 3 * factorTimes2 * inverseFactor; - var factor4 = factorTimes2 * t; - out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; - out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; - out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; - return out; -} -/** - * Generates a random vector with the given scale - * - * @param {vec3} out the receiving vector - * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned - * @returns {vec3} out - */ - -function random(out, scale) { - scale = scale || 1.0; - var r = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 * Math.PI; - var z = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 - 1.0; - var zScale = Math.sqrt(1.0 - z * z) * scale; - out[0] = Math.cos(r) * zScale; - out[1] = Math.sin(r) * zScale; - out[2] = z * scale; - return out; -} -/** - * Transforms the vec3 with a mat4. - * 4th vector component is implicitly '1' - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the vector to transform - * @param {ReadonlyMat4} m matrix to transform with - * @returns {vec3} out - */ - -function transformMat4(out, a, m) { - var x = a[0], - y = a[1], - z = a[2]; - var w = m[3] * x + m[7] * y + m[11] * z + m[15]; - w = w || 1.0; - out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w; - out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w; - out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w; - return out; -} -/** - * Transforms the vec3 with a mat3. - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the vector to transform - * @param {ReadonlyMat3} m the 3x3 matrix to transform with - * @returns {vec3} out - */ - -function transformMat3(out, a, m) { - var x = a[0], - y = a[1], - z = a[2]; - out[0] = x * m[0] + y * m[3] + z * m[6]; - out[1] = x * m[1] + y * m[4] + z * m[7]; - out[2] = x * m[2] + y * m[5] + z * m[8]; - return out; -} -/** - * Transforms the vec3 with a quat - * Can also be used for dual quaternions. (Multiply it with the real part) - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the vector to transform - * @param {ReadonlyQuat} q quaternion to transform with - * @returns {vec3} out - */ - -function transformQuat(out, a, q) { - // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed - var qx = q[0], - qy = q[1], - qz = q[2], - qw = q[3]; - var x = a[0], - y = a[1], - z = a[2]; // var qvec = [qx, qy, qz]; - // var uv = vec3.cross([], qvec, a); - - var uvx = qy * z - qz * y, - uvy = qz * x - qx * z, - uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv); - - var uuvx = qy * uvz - qz * uvy, - uuvy = qz * uvx - qx * uvz, - uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w); - - var w2 = qw * 2; - uvx *= w2; - uvy *= w2; - uvz *= w2; // vec3.scale(uuv, uuv, 2); - - uuvx *= 2; - uuvy *= 2; - uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv)); - - out[0] = x + uvx + uuvx; - out[1] = y + uvy + uuvy; - out[2] = z + uvz + uuvz; - return out; -} -/** - * Rotate a 3D vector around the x-axis - * @param {vec3} out The receiving vec3 - * @param {ReadonlyVec3} a The vec3 point to rotate - * @param {ReadonlyVec3} b The origin of the rotation - * @param {Number} rad The angle of rotation in radians - * @returns {vec3} out - */ - -function rotateX(out, a, b, rad) { - var p = [], - r = []; //Translate point to the origin - - p[0] = a[0] - b[0]; - p[1] = a[1] - b[1]; - p[2] = a[2] - b[2]; //perform rotation - - r[0] = p[0]; - r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad); - r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position - - out[0] = r[0] + b[0]; - out[1] = r[1] + b[1]; - out[2] = r[2] + b[2]; - return out; -} -/** - * Rotate a 3D vector around the y-axis - * @param {vec3} out The receiving vec3 - * @param {ReadonlyVec3} a The vec3 point to rotate - * @param {ReadonlyVec3} b The origin of the rotation - * @param {Number} rad The angle of rotation in radians - * @returns {vec3} out - */ - -function rotateY(out, a, b, rad) { - var p = [], - r = []; //Translate point to the origin - - p[0] = a[0] - b[0]; - p[1] = a[1] - b[1]; - p[2] = a[2] - b[2]; //perform rotation - - r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad); - r[1] = p[1]; - r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position - - out[0] = r[0] + b[0]; - out[1] = r[1] + b[1]; - out[2] = r[2] + b[2]; - return out; -} -/** - * Rotate a 3D vector around the z-axis - * @param {vec3} out The receiving vec3 - * @param {ReadonlyVec3} a The vec3 point to rotate - * @param {ReadonlyVec3} b The origin of the rotation - * @param {Number} rad The angle of rotation in radians - * @returns {vec3} out - */ - -function rotateZ(out, a, b, rad) { - var p = [], - r = []; //Translate point to the origin - - p[0] = a[0] - b[0]; - p[1] = a[1] - b[1]; - p[2] = a[2] - b[2]; //perform rotation - - r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad); - r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad); - r[2] = p[2]; //translate to correct position - - out[0] = r[0] + b[0]; - out[1] = r[1] + b[1]; - out[2] = r[2] + b[2]; - return out; -} -/** - * Get the angle between two 3D vectors - * @param {ReadonlyVec3} a The first operand - * @param {ReadonlyVec3} b The second operand - * @returns {Number} The angle in radians - */ - -function angle(a, b) { - var ax = a[0], - ay = a[1], - az = a[2], - bx = b[0], - by = b[1], - bz = b[2], - mag1 = Math.sqrt(ax * ax + ay * ay + az * az), - mag2 = Math.sqrt(bx * bx + by * by + bz * bz), - mag = mag1 * mag2, - cosine = mag && dot(a, b) / mag; - return Math.acos(Math.min(Math.max(cosine, -1), 1)); -} -/** - * Set the components of a vec3 to zero - * - * @param {vec3} out the receiving vector - * @returns {vec3} out - */ - -function zero(out) { - out[0] = 0.0; - out[1] = 0.0; - out[2] = 0.0; - return out; -} -/** - * Returns a string representation of a vector - * - * @param {ReadonlyVec3} a vector to represent as a string - * @returns {String} string representation of the vector - */ - -function str(a) { - return "vec3(" + a[0] + ", " + a[1] + ", " + a[2] + ")"; -} -/** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyVec3} a The first vector. - * @param {ReadonlyVec3} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; -} -/** - * Returns whether or not the vectors have approximately the same elements in the same position. - * - * @param {ReadonlyVec3} a The first vector. - * @param {ReadonlyVec3} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2]; - var b0 = b[0], - b1 = b[1], - b2 = b[2]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)); -} -/** - * Alias for {@link vec3.subtract} - * @function - */ - -var sub = subtract; -/** - * Alias for {@link vec3.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link vec3.divide} - * @function - */ - -var div = divide; -/** - * Alias for {@link vec3.distance} - * @function - */ - -var dist = distance; -/** - * Alias for {@link vec3.squaredDistance} - * @function - */ - -var sqrDist = squaredDistance; -/** - * Alias for {@link vec3.length} - * @function - */ - -var len = length; -/** - * Alias for {@link vec3.squaredLength} - * @function - */ - -var sqrLen = squaredLength; -/** - * Perform some operation over an array of vec3s. - * - * @param {Array} a the array of vectors to iterate over - * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed - * @param {Number} offset Number of elements to skip at the beginning of the array - * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array - * @param {Function} fn Function to call for each vector in the array - * @param {Object} [arg] additional argument to pass to fn - * @returns {Array} a - * @function - */ - -var forEach = function () { - var vec = create(); - return function (a, stride, offset, count, fn, arg) { - var i, l; - - if (!stride) { - stride = 3; - } - - if (!offset) { - offset = 0; - } - - if (count) { - l = Math.min(count * stride + offset, a.length); - } else { - l = a.length; - } - - for (i = offset; i < l; i += stride) { - vec[0] = a[i]; - vec[1] = a[i + 1]; - vec[2] = a[i + 2]; - fn(vec, vec, arg); - a[i] = vec[0]; - a[i + 1] = vec[1]; - a[i + 2] = vec[2]; - } - - return a; - }; -}(); - -/***/ }), -/* 22 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "fromRotationTranslationValues": () => (/* binding */ fromRotationTranslationValues), -/* harmony export */ "fromRotationTranslation": () => (/* binding */ fromRotationTranslation), -/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), -/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), -/* harmony export */ "fromMat4": () => (/* binding */ fromMat4), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "getReal": () => (/* binding */ getReal), -/* harmony export */ "getDual": () => (/* binding */ getDual), -/* harmony export */ "setReal": () => (/* binding */ setReal), -/* harmony export */ "setDual": () => (/* binding */ setDual), -/* harmony export */ "getTranslation": () => (/* binding */ getTranslation), -/* harmony export */ "translate": () => (/* binding */ translate), -/* harmony export */ "rotateX": () => (/* binding */ rotateX), -/* harmony export */ "rotateY": () => (/* binding */ rotateY), -/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), -/* harmony export */ "rotateByQuatAppend": () => (/* binding */ rotateByQuatAppend), -/* harmony export */ "rotateByQuatPrepend": () => (/* binding */ rotateByQuatPrepend), -/* harmony export */ "rotateAroundAxis": () => (/* binding */ rotateAroundAxis), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "dot": () => (/* binding */ dot), -/* harmony export */ "lerp": () => (/* binding */ lerp), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "conjugate": () => (/* binding */ conjugate), -/* harmony export */ "length": () => (/* binding */ length), -/* harmony export */ "len": () => (/* binding */ len), -/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), -/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), -/* harmony export */ "normalize": () => (/* binding */ normalize), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); -/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19); -/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18); - - - -/** - * Dual Quaternion
- * Format: [real, dual]
- * Quaternion format: XYZW
- * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
- * @module quat2 - */ - -/** - * Creates a new identity dual quat - * - * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation] - */ - -function create() { - var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - dq[0] = 0; - dq[1] = 0; - dq[2] = 0; - dq[4] = 0; - dq[5] = 0; - dq[6] = 0; - dq[7] = 0; - } - - dq[3] = 1; - return dq; -} -/** - * Creates a new quat initialized with values from an existing quaternion - * - * @param {ReadonlyQuat2} a dual quaternion to clone - * @returns {quat2} new dual quaternion - * @function - */ - -function clone(a) { - var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); - dq[0] = a[0]; - dq[1] = a[1]; - dq[2] = a[2]; - dq[3] = a[3]; - dq[4] = a[4]; - dq[5] = a[5]; - dq[6] = a[6]; - dq[7] = a[7]; - return dq; -} -/** - * Creates a new dual quat initialized with the given values - * - * @param {Number} x1 X component - * @param {Number} y1 Y component - * @param {Number} z1 Z component - * @param {Number} w1 W component - * @param {Number} x2 X component - * @param {Number} y2 Y component - * @param {Number} z2 Z component - * @param {Number} w2 W component - * @returns {quat2} new dual quaternion - * @function - */ - -function fromValues(x1, y1, z1, w1, x2, y2, z2, w2) { - var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); - dq[0] = x1; - dq[1] = y1; - dq[2] = z1; - dq[3] = w1; - dq[4] = x2; - dq[5] = y2; - dq[6] = z2; - dq[7] = w2; - return dq; -} -/** - * Creates a new dual quat from the given values (quat and translation) - * - * @param {Number} x1 X component - * @param {Number} y1 Y component - * @param {Number} z1 Z component - * @param {Number} w1 W component - * @param {Number} x2 X component (translation) - * @param {Number} y2 Y component (translation) - * @param {Number} z2 Z component (translation) - * @returns {quat2} new dual quaternion - * @function - */ - -function fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) { - var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); - dq[0] = x1; - dq[1] = y1; - dq[2] = z1; - dq[3] = w1; - var ax = x2 * 0.5, - ay = y2 * 0.5, - az = z2 * 0.5; - dq[4] = ax * w1 + ay * z1 - az * y1; - dq[5] = ay * w1 + az * x1 - ax * z1; - dq[6] = az * w1 + ax * y1 - ay * x1; - dq[7] = -ax * x1 - ay * y1 - az * z1; - return dq; -} -/** - * Creates a dual quat from a quaternion and a translation - * - * @param {ReadonlyQuat2} dual quaternion receiving operation result - * @param {ReadonlyQuat} q a normalized quaternion - * @param {ReadonlyVec3} t tranlation vector - * @returns {quat2} dual quaternion receiving operation result - * @function - */ - -function fromRotationTranslation(out, q, t) { - var ax = t[0] * 0.5, - ay = t[1] * 0.5, - az = t[2] * 0.5, - bx = q[0], - by = q[1], - bz = q[2], - bw = q[3]; - out[0] = bx; - out[1] = by; - out[2] = bz; - out[3] = bw; - out[4] = ax * bw + ay * bz - az * by; - out[5] = ay * bw + az * bx - ax * bz; - out[6] = az * bw + ax * by - ay * bx; - out[7] = -ax * bx - ay * by - az * bz; - return out; -} -/** - * Creates a dual quat from a translation - * - * @param {ReadonlyQuat2} dual quaternion receiving operation result - * @param {ReadonlyVec3} t translation vector - * @returns {quat2} dual quaternion receiving operation result - * @function - */ - -function fromTranslation(out, t) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 1; - out[4] = t[0] * 0.5; - out[5] = t[1] * 0.5; - out[6] = t[2] * 0.5; - out[7] = 0; - return out; -} -/** - * Creates a dual quat from a quaternion - * - * @param {ReadonlyQuat2} dual quaternion receiving operation result - * @param {ReadonlyQuat} q the quaternion - * @returns {quat2} dual quaternion receiving operation result - * @function - */ - -function fromRotation(out, q) { - out[0] = q[0]; - out[1] = q[1]; - out[2] = q[2]; - out[3] = q[3]; - out[4] = 0; - out[5] = 0; - out[6] = 0; - out[7] = 0; - return out; -} -/** - * Creates a new dual quat from a matrix (4x4) - * - * @param {quat2} out the dual quaternion - * @param {ReadonlyMat4} a the matrix - * @returns {quat2} dual quat receiving operation result - * @function - */ - -function fromMat4(out, a) { - //TODO Optimize this - var outer = _quat_js__WEBPACK_IMPORTED_MODULE_1__.create(); - _mat4_js__WEBPACK_IMPORTED_MODULE_2__.getRotation(outer, a); - var t = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - _mat4_js__WEBPACK_IMPORTED_MODULE_2__.getTranslation(t, a); - fromRotationTranslation(out, outer, t); - return out; -} -/** - * Copy the values from one dual quat to another - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the source dual quaternion - * @returns {quat2} out - * @function - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - return out; -} -/** - * Set a dual quat to the identity dual quaternion - * - * @param {quat2} out the receiving quaternion - * @returns {quat2} out - */ - -function identity(out) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 1; - out[4] = 0; - out[5] = 0; - out[6] = 0; - out[7] = 0; - return out; -} -/** - * Set the components of a dual quat to the given values - * - * @param {quat2} out the receiving quaternion - * @param {Number} x1 X component - * @param {Number} y1 Y component - * @param {Number} z1 Z component - * @param {Number} w1 W component - * @param {Number} x2 X component - * @param {Number} y2 Y component - * @param {Number} z2 Z component - * @param {Number} w2 W component - * @returns {quat2} out - * @function - */ - -function set(out, x1, y1, z1, w1, x2, y2, z2, w2) { - out[0] = x1; - out[1] = y1; - out[2] = z1; - out[3] = w1; - out[4] = x2; - out[5] = y2; - out[6] = z2; - out[7] = w2; - return out; -} -/** - * Gets the real part of a dual quat - * @param {quat} out real part - * @param {ReadonlyQuat2} a Dual Quaternion - * @return {quat} real part - */ - -var getReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__.copy; -/** - * Gets the dual part of a dual quat - * @param {quat} out dual part - * @param {ReadonlyQuat2} a Dual Quaternion - * @return {quat} dual part - */ - -function getDual(out, a) { - out[0] = a[4]; - out[1] = a[5]; - out[2] = a[6]; - out[3] = a[7]; - return out; -} -/** - * Set the real component of a dual quat to the given quaternion - * - * @param {quat2} out the receiving quaternion - * @param {ReadonlyQuat} q a quaternion representing the real part - * @returns {quat2} out - * @function - */ - -var setReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__.copy; -/** - * Set the dual component of a dual quat to the given quaternion - * - * @param {quat2} out the receiving quaternion - * @param {ReadonlyQuat} q a quaternion representing the dual part - * @returns {quat2} out - * @function - */ - -function setDual(out, q) { - out[4] = q[0]; - out[5] = q[1]; - out[6] = q[2]; - out[7] = q[3]; - return out; -} -/** - * Gets the translation of a normalized dual quat - * @param {vec3} out translation - * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed - * @return {vec3} translation - */ - -function getTranslation(out, a) { - var ax = a[4], - ay = a[5], - az = a[6], - aw = a[7], - bx = -a[0], - by = -a[1], - bz = -a[2], - bw = a[3]; - out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; - out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; - out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; - return out; -} -/** - * Translates a dual quat by the given vector - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to translate - * @param {ReadonlyVec3} v vector to translate by - * @returns {quat2} out - */ - -function translate(out, a, v) { - var ax1 = a[0], - ay1 = a[1], - az1 = a[2], - aw1 = a[3], - bx1 = v[0] * 0.5, - by1 = v[1] * 0.5, - bz1 = v[2] * 0.5, - ax2 = a[4], - ay2 = a[5], - az2 = a[6], - aw2 = a[7]; - out[0] = ax1; - out[1] = ay1; - out[2] = az1; - out[3] = aw1; - out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2; - out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2; - out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2; - out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2; - return out; -} -/** - * Rotates a dual quat around the X axis - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @param {number} rad how far should the rotation be - * @returns {quat2} out - */ - -function rotateX(out, a, rad) { - var bx = -a[0], - by = -a[1], - bz = -a[2], - bw = a[3], - ax = a[4], - ay = a[5], - az = a[6], - aw = a[7], - ax1 = ax * bw + aw * bx + ay * bz - az * by, - ay1 = ay * bw + aw * by + az * bx - ax * bz, - az1 = az * bw + aw * bz + ax * by - ay * bx, - aw1 = aw * bw - ax * bx - ay * by - az * bz; - _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateX(out, a, rad); - bx = out[0]; - by = out[1]; - bz = out[2]; - bw = out[3]; - out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; - out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; - out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; - out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; - return out; -} -/** - * Rotates a dual quat around the Y axis - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @param {number} rad how far should the rotation be - * @returns {quat2} out - */ - -function rotateY(out, a, rad) { - var bx = -a[0], - by = -a[1], - bz = -a[2], - bw = a[3], - ax = a[4], - ay = a[5], - az = a[6], - aw = a[7], - ax1 = ax * bw + aw * bx + ay * bz - az * by, - ay1 = ay * bw + aw * by + az * bx - ax * bz, - az1 = az * bw + aw * bz + ax * by - ay * bx, - aw1 = aw * bw - ax * bx - ay * by - az * bz; - _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateY(out, a, rad); - bx = out[0]; - by = out[1]; - bz = out[2]; - bw = out[3]; - out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; - out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; - out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; - out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; - return out; -} -/** - * Rotates a dual quat around the Z axis - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @param {number} rad how far should the rotation be - * @returns {quat2} out - */ - -function rotateZ(out, a, rad) { - var bx = -a[0], - by = -a[1], - bz = -a[2], - bw = a[3], - ax = a[4], - ay = a[5], - az = a[6], - aw = a[7], - ax1 = ax * bw + aw * bx + ay * bz - az * by, - ay1 = ay * bw + aw * by + az * bx - ax * bz, - az1 = az * bw + aw * bz + ax * by - ay * bx, - aw1 = aw * bw - ax * bx - ay * by - az * bz; - _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateZ(out, a, rad); - bx = out[0]; - by = out[1]; - bz = out[2]; - bw = out[3]; - out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; - out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; - out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; - out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; - return out; -} -/** - * Rotates a dual quat by a given quaternion (a * q) - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @param {ReadonlyQuat} q quaternion to rotate by - * @returns {quat2} out - */ - -function rotateByQuatAppend(out, a, q) { - var qx = q[0], - qy = q[1], - qz = q[2], - qw = q[3], - ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - out[0] = ax * qw + aw * qx + ay * qz - az * qy; - out[1] = ay * qw + aw * qy + az * qx - ax * qz; - out[2] = az * qw + aw * qz + ax * qy - ay * qx; - out[3] = aw * qw - ax * qx - ay * qy - az * qz; - ax = a[4]; - ay = a[5]; - az = a[6]; - aw = a[7]; - out[4] = ax * qw + aw * qx + ay * qz - az * qy; - out[5] = ay * qw + aw * qy + az * qx - ax * qz; - out[6] = az * qw + aw * qz + ax * qy - ay * qx; - out[7] = aw * qw - ax * qx - ay * qy - az * qz; - return out; -} -/** - * Rotates a dual quat by a given quaternion (q * a) - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat} q quaternion to rotate by - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @returns {quat2} out - */ - -function rotateByQuatPrepend(out, q, a) { - var qx = q[0], - qy = q[1], - qz = q[2], - qw = q[3], - bx = a[0], - by = a[1], - bz = a[2], - bw = a[3]; - out[0] = qx * bw + qw * bx + qy * bz - qz * by; - out[1] = qy * bw + qw * by + qz * bx - qx * bz; - out[2] = qz * bw + qw * bz + qx * by - qy * bx; - out[3] = qw * bw - qx * bx - qy * by - qz * bz; - bx = a[4]; - by = a[5]; - bz = a[6]; - bw = a[7]; - out[4] = qx * bw + qw * bx + qy * bz - qz * by; - out[5] = qy * bw + qw * by + qz * bx - qx * bz; - out[6] = qz * bw + qw * bz + qx * by - qy * bx; - out[7] = qw * bw - qx * bx - qy * by - qz * bz; - return out; -} -/** - * Rotates a dual quat around a given axis. Does the normalisation automatically - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @param {ReadonlyVec3} axis the axis to rotate around - * @param {Number} rad how far the rotation should be - * @returns {quat2} out - */ - -function rotateAroundAxis(out, a, axis, rad) { - //Special case for rad = 0 - if (Math.abs(rad) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - return copy(out, a); - } - - var axisLength = Math.hypot(axis[0], axis[1], axis[2]); - rad = rad * 0.5; - var s = Math.sin(rad); - var bx = s * axis[0] / axisLength; - var by = s * axis[1] / axisLength; - var bz = s * axis[2] / axisLength; - var bw = Math.cos(rad); - var ax1 = a[0], - ay1 = a[1], - az1 = a[2], - aw1 = a[3]; - out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; - out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; - out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; - out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; - var ax = a[4], - ay = a[5], - az = a[6], - aw = a[7]; - out[4] = ax * bw + aw * bx + ay * bz - az * by; - out[5] = ay * bw + aw * by + az * bx - ax * bz; - out[6] = az * bw + aw * bz + ax * by - ay * bx; - out[7] = aw * bw - ax * bx - ay * by - az * bz; - return out; -} -/** - * Adds two dual quat's - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the first operand - * @param {ReadonlyQuat2} b the second operand - * @returns {quat2} out - * @function - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - out[4] = a[4] + b[4]; - out[5] = a[5] + b[5]; - out[6] = a[6] + b[6]; - out[7] = a[7] + b[7]; - return out; -} -/** - * Multiplies two dual quat's - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the first operand - * @param {ReadonlyQuat2} b the second operand - * @returns {quat2} out - */ - -function multiply(out, a, b) { - var ax0 = a[0], - ay0 = a[1], - az0 = a[2], - aw0 = a[3], - bx1 = b[4], - by1 = b[5], - bz1 = b[6], - bw1 = b[7], - ax1 = a[4], - ay1 = a[5], - az1 = a[6], - aw1 = a[7], - bx0 = b[0], - by0 = b[1], - bz0 = b[2], - bw0 = b[3]; - out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0; - out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0; - out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0; - out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0; - out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0; - out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0; - out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0; - out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0; - return out; -} -/** - * Alias for {@link quat2.multiply} - * @function - */ - -var mul = multiply; -/** - * Scales a dual quat by a scalar number - * - * @param {quat2} out the receiving dual quat - * @param {ReadonlyQuat2} a the dual quat to scale - * @param {Number} b amount to scale the dual quat by - * @returns {quat2} out - * @function - */ - -function scale(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - out[4] = a[4] * b; - out[5] = a[5] * b; - out[6] = a[6] * b; - out[7] = a[7] * b; - return out; -} -/** - * Calculates the dot product of two dual quat's (The dot product of the real parts) - * - * @param {ReadonlyQuat2} a the first operand - * @param {ReadonlyQuat2} b the second operand - * @returns {Number} dot product of a and b - * @function - */ - -var dot = _quat_js__WEBPACK_IMPORTED_MODULE_1__.dot; -/** - * Performs a linear interpolation between two dual quats's - * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5) - * - * @param {quat2} out the receiving dual quat - * @param {ReadonlyQuat2} a the first operand - * @param {ReadonlyQuat2} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {quat2} out - */ - -function lerp(out, a, b, t) { - var mt = 1 - t; - if (dot(a, b) < 0) t = -t; - out[0] = a[0] * mt + b[0] * t; - out[1] = a[1] * mt + b[1] * t; - out[2] = a[2] * mt + b[2] * t; - out[3] = a[3] * mt + b[3] * t; - out[4] = a[4] * mt + b[4] * t; - out[5] = a[5] * mt + b[5] * t; - out[6] = a[6] * mt + b[6] * t; - out[7] = a[7] * mt + b[7] * t; - return out; -} -/** - * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a dual quat to calculate inverse of - * @returns {quat2} out - */ - -function invert(out, a) { - var sqlen = squaredLength(a); - out[0] = -a[0] / sqlen; - out[1] = -a[1] / sqlen; - out[2] = -a[2] / sqlen; - out[3] = a[3] / sqlen; - out[4] = -a[4] / sqlen; - out[5] = -a[5] / sqlen; - out[6] = -a[6] / sqlen; - out[7] = a[7] / sqlen; - return out; -} -/** - * Calculates the conjugate of a dual quat - * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result. - * - * @param {quat2} out the receiving quaternion - * @param {ReadonlyQuat2} a quat to calculate conjugate of - * @returns {quat2} out - */ - -function conjugate(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - out[2] = -a[2]; - out[3] = a[3]; - out[4] = -a[4]; - out[5] = -a[5]; - out[6] = -a[6]; - out[7] = a[7]; - return out; -} -/** - * Calculates the length of a dual quat - * - * @param {ReadonlyQuat2} a dual quat to calculate length of - * @returns {Number} length of a - * @function - */ - -var length = _quat_js__WEBPACK_IMPORTED_MODULE_1__.length; -/** - * Alias for {@link quat2.length} - * @function - */ - -var len = length; -/** - * Calculates the squared length of a dual quat - * - * @param {ReadonlyQuat2} a dual quat to calculate squared length of - * @returns {Number} squared length of a - * @function - */ - -var squaredLength = _quat_js__WEBPACK_IMPORTED_MODULE_1__.squaredLength; -/** - * Alias for {@link quat2.squaredLength} - * @function - */ - -var sqrLen = squaredLength; -/** - * Normalize a dual quat - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a dual quaternion to normalize - * @returns {quat2} out - * @function - */ - -function normalize(out, a) { - var magnitude = squaredLength(a); - - if (magnitude > 0) { - magnitude = Math.sqrt(magnitude); - var a0 = a[0] / magnitude; - var a1 = a[1] / magnitude; - var a2 = a[2] / magnitude; - var a3 = a[3] / magnitude; - var b0 = a[4]; - var b1 = a[5]; - var b2 = a[6]; - var b3 = a[7]; - var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3; - out[0] = a0; - out[1] = a1; - out[2] = a2; - out[3] = a3; - out[4] = (b0 - a0 * a_dot_b) / magnitude; - out[5] = (b1 - a1 * a_dot_b) / magnitude; - out[6] = (b2 - a2 * a_dot_b) / magnitude; - out[7] = (b3 - a3 * a_dot_b) / magnitude; - } - - return out; -} -/** - * Returns a string representation of a dual quatenion - * - * @param {ReadonlyQuat2} a dual quaternion to represent as a string - * @returns {String} string representation of the dual quat - */ - -function str(a) { - return "quat2(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ")"; -} -/** - * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyQuat2} a the first dual quaternion. - * @param {ReadonlyQuat2} b the second dual quaternion. - * @returns {Boolean} true if the dual quaternions are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7]; -} -/** - * Returns whether or not the dual quaternions have approximately the same elements in the same position. - * - * @param {ReadonlyQuat2} a the first dual quat. - * @param {ReadonlyQuat2} b the second dual quat. - * @returns {Boolean} true if the dual quats are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5], - a6 = a[6], - a7 = a[7]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3], - b4 = b[4], - b5 = b[5], - b6 = b[6], - b7 = b[7]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)); -} - -/***/ }), -/* 23 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "divide": () => (/* binding */ divide), -/* harmony export */ "ceil": () => (/* binding */ ceil), -/* harmony export */ "floor": () => (/* binding */ floor), -/* harmony export */ "min": () => (/* binding */ min), -/* harmony export */ "max": () => (/* binding */ max), -/* harmony export */ "round": () => (/* binding */ round), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), -/* harmony export */ "distance": () => (/* binding */ distance), -/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), -/* harmony export */ "length": () => (/* binding */ length), -/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), -/* harmony export */ "negate": () => (/* binding */ negate), -/* harmony export */ "inverse": () => (/* binding */ inverse), -/* harmony export */ "normalize": () => (/* binding */ normalize), -/* harmony export */ "dot": () => (/* binding */ dot), -/* harmony export */ "cross": () => (/* binding */ cross), -/* harmony export */ "lerp": () => (/* binding */ lerp), -/* harmony export */ "random": () => (/* binding */ random), -/* harmony export */ "transformMat2": () => (/* binding */ transformMat2), -/* harmony export */ "transformMat2d": () => (/* binding */ transformMat2d), -/* harmony export */ "transformMat3": () => (/* binding */ transformMat3), -/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), -/* harmony export */ "rotate": () => (/* binding */ rotate), -/* harmony export */ "angle": () => (/* binding */ angle), -/* harmony export */ "zero": () => (/* binding */ zero), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "len": () => (/* binding */ len), -/* harmony export */ "sub": () => (/* binding */ sub), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "div": () => (/* binding */ div), -/* harmony export */ "dist": () => (/* binding */ dist), -/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), -/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), -/* harmony export */ "forEach": () => (/* binding */ forEach) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); - -/** - * 2 Dimensional Vector - * @module vec2 - */ - -/** - * Creates a new, empty vec2 - * - * @returns {vec2} a new 2D vector - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[0] = 0; - out[1] = 0; - } - - return out; -} -/** - * Creates a new vec2 initialized with values from an existing vector - * - * @param {ReadonlyVec2} a vector to clone - * @returns {vec2} a new 2D vector - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); - out[0] = a[0]; - out[1] = a[1]; - return out; -} -/** - * Creates a new vec2 initialized with the given values - * - * @param {Number} x X component - * @param {Number} y Y component - * @returns {vec2} a new 2D vector - */ - -function fromValues(x, y) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); - out[0] = x; - out[1] = y; - return out; -} -/** - * Copy the values from one vec2 to another - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the source vector - * @returns {vec2} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - return out; -} -/** - * Set the components of a vec2 to the given values - * - * @param {vec2} out the receiving vector - * @param {Number} x X component - * @param {Number} y Y component - * @returns {vec2} out - */ - -function set(out, x, y) { - out[0] = x; - out[1] = y; - return out; -} -/** - * Adds two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - return out; -} -/** - * Subtracts vector b from vector a - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - return out; -} -/** - * Multiplies two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function multiply(out, a, b) { - out[0] = a[0] * b[0]; - out[1] = a[1] * b[1]; - return out; -} -/** - * Divides two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function divide(out, a, b) { - out[0] = a[0] / b[0]; - out[1] = a[1] / b[1]; - return out; -} -/** - * Math.ceil the components of a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to ceil - * @returns {vec2} out - */ - -function ceil(out, a) { - out[0] = Math.ceil(a[0]); - out[1] = Math.ceil(a[1]); - return out; -} -/** - * Math.floor the components of a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to floor - * @returns {vec2} out - */ - -function floor(out, a) { - out[0] = Math.floor(a[0]); - out[1] = Math.floor(a[1]); - return out; -} -/** - * Returns the minimum of two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function min(out, a, b) { - out[0] = Math.min(a[0], b[0]); - out[1] = Math.min(a[1], b[1]); - return out; -} -/** - * Returns the maximum of two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function max(out, a, b) { - out[0] = Math.max(a[0], b[0]); - out[1] = Math.max(a[1], b[1]); - return out; -} -/** - * Math.round the components of a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to round - * @returns {vec2} out - */ - -function round(out, a) { - out[0] = Math.round(a[0]); - out[1] = Math.round(a[1]); - return out; -} -/** - * Scales a vec2 by a scalar number - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the vector to scale - * @param {Number} b amount to scale the vector by - * @returns {vec2} out - */ - -function scale(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - return out; -} -/** - * Adds two vec2's after scaling the second operand by a scalar value - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @param {Number} scale the amount to scale b by before adding - * @returns {vec2} out - */ - -function scaleAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - return out; -} -/** - * Calculates the euclidian distance between two vec2's - * - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {Number} distance between a and b - */ - -function distance(a, b) { - var x = b[0] - a[0], - y = b[1] - a[1]; - return Math.hypot(x, y); -} -/** - * Calculates the squared euclidian distance between two vec2's - * - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {Number} squared distance between a and b - */ - -function squaredDistance(a, b) { - var x = b[0] - a[0], - y = b[1] - a[1]; - return x * x + y * y; -} -/** - * Calculates the length of a vec2 - * - * @param {ReadonlyVec2} a vector to calculate length of - * @returns {Number} length of a - */ - -function length(a) { - var x = a[0], - y = a[1]; - return Math.hypot(x, y); -} -/** - * Calculates the squared length of a vec2 - * - * @param {ReadonlyVec2} a vector to calculate squared length of - * @returns {Number} squared length of a - */ - -function squaredLength(a) { - var x = a[0], - y = a[1]; - return x * x + y * y; -} -/** - * Negates the components of a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to negate - * @returns {vec2} out - */ - -function negate(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - return out; -} -/** - * Returns the inverse of the components of a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to invert - * @returns {vec2} out - */ - -function inverse(out, a) { - out[0] = 1.0 / a[0]; - out[1] = 1.0 / a[1]; - return out; -} -/** - * Normalize a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to normalize - * @returns {vec2} out - */ - -function normalize(out, a) { - var x = a[0], - y = a[1]; - var len = x * x + y * y; - - if (len > 0) { - //TODO: evaluate use of glm_invsqrt here? - len = 1 / Math.sqrt(len); - } - - out[0] = a[0] * len; - out[1] = a[1] * len; - return out; -} -/** - * Calculates the dot product of two vec2's - * - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {Number} dot product of a and b - */ - -function dot(a, b) { - return a[0] * b[0] + a[1] * b[1]; -} -/** - * Computes the cross product of two vec2's - * Note that the cross product must by definition produce a 3D vector - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec3} out - */ - -function cross(out, a, b) { - var z = a[0] * b[1] - a[1] * b[0]; - out[0] = out[1] = 0; - out[2] = z; - return out; -} -/** - * Performs a linear interpolation between two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {vec2} out - */ - -function lerp(out, a, b, t) { - var ax = a[0], - ay = a[1]; - out[0] = ax + t * (b[0] - ax); - out[1] = ay + t * (b[1] - ay); - return out; -} -/** - * Generates a random vector with the given scale - * - * @param {vec2} out the receiving vector - * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned - * @returns {vec2} out - */ - -function random(out, scale) { - scale = scale || 1.0; - var r = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 * Math.PI; - out[0] = Math.cos(r) * scale; - out[1] = Math.sin(r) * scale; - return out; -} -/** - * Transforms the vec2 with a mat2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the vector to transform - * @param {ReadonlyMat2} m matrix to transform with - * @returns {vec2} out - */ - -function transformMat2(out, a, m) { - var x = a[0], - y = a[1]; - out[0] = m[0] * x + m[2] * y; - out[1] = m[1] * x + m[3] * y; - return out; -} -/** - * Transforms the vec2 with a mat2d - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the vector to transform - * @param {ReadonlyMat2d} m matrix to transform with - * @returns {vec2} out - */ - -function transformMat2d(out, a, m) { - var x = a[0], - y = a[1]; - out[0] = m[0] * x + m[2] * y + m[4]; - out[1] = m[1] * x + m[3] * y + m[5]; - return out; -} -/** - * Transforms the vec2 with a mat3 - * 3rd vector component is implicitly '1' - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the vector to transform - * @param {ReadonlyMat3} m matrix to transform with - * @returns {vec2} out - */ - -function transformMat3(out, a, m) { - var x = a[0], - y = a[1]; - out[0] = m[0] * x + m[3] * y + m[6]; - out[1] = m[1] * x + m[4] * y + m[7]; - return out; -} -/** - * Transforms the vec2 with a mat4 - * 3rd vector component is implicitly '0' - * 4th vector component is implicitly '1' - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the vector to transform - * @param {ReadonlyMat4} m matrix to transform with - * @returns {vec2} out - */ - -function transformMat4(out, a, m) { - var x = a[0]; - var y = a[1]; - out[0] = m[0] * x + m[4] * y + m[12]; - out[1] = m[1] * x + m[5] * y + m[13]; - return out; -} -/** - * Rotate a 2D vector - * @param {vec2} out The receiving vec2 - * @param {ReadonlyVec2} a The vec2 point to rotate - * @param {ReadonlyVec2} b The origin of the rotation - * @param {Number} rad The angle of rotation in radians - * @returns {vec2} out - */ - -function rotate(out, a, b, rad) { - //Translate point to the origin - var p0 = a[0] - b[0], - p1 = a[1] - b[1], - sinC = Math.sin(rad), - cosC = Math.cos(rad); //perform rotation and translate to correct position - - out[0] = p0 * cosC - p1 * sinC + b[0]; - out[1] = p0 * sinC + p1 * cosC + b[1]; - return out; -} -/** - * Get the angle between two 2D vectors - * @param {ReadonlyVec2} a The first operand - * @param {ReadonlyVec2} b The second operand - * @returns {Number} The angle in radians - */ - -function angle(a, b) { - var x1 = a[0], - y1 = a[1], - x2 = b[0], - y2 = b[1], - // mag is the product of the magnitudes of a and b - mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2), - // mag &&.. short circuits if mag == 0 - cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1 - - return Math.acos(Math.min(Math.max(cosine, -1), 1)); -} -/** - * Set the components of a vec2 to zero - * - * @param {vec2} out the receiving vector - * @returns {vec2} out - */ - -function zero(out) { - out[0] = 0.0; - out[1] = 0.0; - return out; -} -/** - * Returns a string representation of a vector - * - * @param {ReadonlyVec2} a vector to represent as a string - * @returns {String} string representation of the vector - */ - -function str(a) { - return "vec2(" + a[0] + ", " + a[1] + ")"; -} -/** - * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===) - * - * @param {ReadonlyVec2} a The first vector. - * @param {ReadonlyVec2} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1]; -} -/** - * Returns whether or not the vectors have approximately the same elements in the same position. - * - * @param {ReadonlyVec2} a The first vector. - * @param {ReadonlyVec2} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1]; - var b0 = b[0], - b1 = b[1]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)); +class Scene { + /** + * Creates an instance of Scene. + * You can see the default values in the property definitions + */ + constructor(settings = {}) { + /** + * Logical number, the drawer will take care of defining the unit of measure + */ + this.width = 400; + /** + * Logical number, the drawer will take care of defining the unit of measure + */ + this.height = 400; + /** + * Default background color (black) + */ + this.background = 'hsla(0, 0%, 0%, 1)'; + /** + * Default ScenePrimitive stroke color (white) + */ + this.color = 'hsla(0, 0%, 100%, 1)'; + /** + * Current time + */ + this.currentTime = 0; + if (typeof settings.width !== 'undefined') + this.width = settings.width; + if (typeof settings.height !== 'undefined') + this.height = settings.height; + if (typeof settings.background !== 'undefined') + this.background = settings.background; + if (typeof settings.color !== 'undefined') + this.color = settings.color; + this.children = []; + this.center = [this.width / 2, this.height / 2]; + this.anchor = + settings.anchor && Array.isArray(settings.anchor) + ? [ + typeof settings.anchor[0] === 'number' + ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[0]) * 0.5) * this.width + : settings.anchor[0] === 'left' + ? 0 + : settings.anchor[0] === 'right' + ? this.width + : this.center[0], + typeof settings.anchor[1] === 'number' + ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[1]) * 0.5) * this.height + : settings.anchor[1] === 'top' + ? 0 + : settings.anchor[1] === 'bottom' + ? this.height + : this.center[1], + ] + : [this.center[0], this.center[1]]; + } + /** + * Return width percentage + * + * @param {number} [percentage=100] + * @returns {number} + */ + getWidth(percentage = 100) { + return (this.width * percentage) / 100; + } + /** + * Return height percentage + * + * @param {number} [percentage=100] + * @returns {number} + */ + getHeight(percentage = 100) { + return (this.height * percentage) / 100; + } + /** + * Resize the scene size + * + * @param {number} width + * @param {number} [height=width] + * @memberof Scene + */ + resize(width, height = width) { + this.width = width; + this.height = height; + this.center = [this.width / 2, this.height / 2]; + const anchor = [this.width / this.anchor[0], this.height / this.anchor[1]]; + this.anchor = [this.width / anchor[0], this.height / anchor[1]]; + this.children.forEach(sceneChild => sceneChild.clearBuffer(true, false)); + } + /** + * Update all children, generate a streamable buffer for drawing + * + * @param {number} [atTime] time in ms + * @memberof Scene + */ + update(atTime = 0) { + this.currentTime = atTime; + for (let i = 0, len = this.children.length; i < len; i++) { + this.children[i].generate(this.currentTime, true); + } + } + /** + * Traverse the child buffer and use it with callback + * + * @param {(streamArguments: IStreamArguments) => void} callback + * @memberof Scene + */ + stream(callback) { + this.children.forEach(sceneChild => sceneChild.stream(callback)); + } + /* + |-------------------------------------------------------------------------- + | SceneChild + |-------------------------------------------------------------------------- + */ + /** + * Return a list of children + * + * @returns {Array} + * @memberof Scene + */ + getChildren() { + return this.children; + } + /** + * Add SceneChild to Scene, pass `order` as last parameter for drawing priorities + * + * @param {Array} items + * @param {number} [order] + * @memberof Scene + */ + add(...items /**, order: number */) { + const order = typeof items[items.length - 1] === 'number' ? items[items.length - 1] : undefined; + const len = items.length - (typeof order === 'undefined' ? 0 : 1); + for (let i = 0; i < len; i++) { + const item = items[i]; + item.order = + typeof order !== 'undefined' + ? order + i + : typeof item.order !== 'undefined' + ? item.order + : this.children.length > 0 + ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1 + : 0; + Scene.propagateToChilden(item, this); + this.children.push(item); + item.clearBuffer(true, false); + item.generate(0, true); + } + this.sortChildren(); + } + /** + * Sort children by order + * + * @memberof Scene + */ + sortChildren() { + this.children.sort((a, b) => a.order - b.order); + this.children = this.children.map((child, index) => { + child.order = index; + return child; + }); + } + /** + * Find sceneChild from id or name in the whole scene + * + * @param {string | number} idOrName + * @returns {(SceneChild | null)} + * @memberof Scene + */ + find(idOrName) { + const children = this.getChildren(); + for (let i = 0, len = children.length; i < len; i++) { + const result = children[i].find(idOrName); + if (result !== null) + return result; + } + return null; + } + /** + * Get shape by index + * + * @param {number} index + * @returns {(SceneChild | null)} + * @memberof Scene + */ + get(index) { + return index >= 0 && index < this.children.length ? this.children[index] : null; + } + /** + * Remove a shape by index + * + * @param {number} index + * @memberof Scene + */ + remove(index) { + index >= 0 && index < this.children.length && this.children.splice(index, 1); + } + /** + * Removes all children + * + * @memberof Scene + */ + removeChildren() { + this.children = []; + } + /** + * Remove sceneChild by id or name + * + * @param {number | number} idOrName + * @memberof Scene + */ + removeFromId(idOrName) { + for (let i = 0, len = this.children.length; i < len; i++) + if (this.children[i].id === idOrName || this.children[i].name === idOrName) { + this.children.splice(i, 1); + return; + } + } + /** + * Return true if sceneChild is direct children + * + * @param {SceneChild} sceneChild + * @returns {boolean} + * @memberof Scene + */ + isFirstLevelChild(sceneChild) { + for (let i = 0, len = this.children.length; i < len; i++) + if (this.children[i].id === sceneChild.id) + return true; + const parents = this.getParentsOfSceneChild(sceneChild); + return parents.length === 1 && parents[0] instanceof Group_1.Group; + } + /** + * Returns the list of sceneChild hierarchy starting from the scene + * + * @param {SceneChild} sceneChild + * @returns {Array} + * @memberof Scene + */ + getParentsOfSceneChild(sceneChild) { + const result = Scene.getParentsOfSceneChild(this, sceneChild); + if (result) { + result.splice(0, 1); + return result; + } + return []; + } + /** + * Returns the list of sceneChild hierarchy starting from the scene + * + * @static + * @param {(Scene | SceneChild)} current + * @param {SceneChild} sceneChild + * @param {(Array)} [parents=[]] + * @returns {(Array | null)} + * @memberof Scene + */ + static getParentsOfSceneChild(current, sceneChild, parents = []) { + let result; + if (current instanceof SceneChild_1.SceneChild) { + if (current.id == sceneChild.id) + return parents; + if (current instanceof Shape_1.Shape && current.shape) { + const tmpParents = parents.slice(); + tmpParents.push(current); + if ((result = Scene.getParentsOfSceneChild(current.shape, sceneChild, tmpParents))) + return result; + } + } + if (current instanceof Scene || current instanceof Group_1.Group) { + const children = current.getChildren(); + parents.push(current); + for (let i = 0, len = children.length; i < len; i++) { + const child = children[i]; + if ((result = Scene.getParentsOfSceneChild(child, sceneChild, parents))) + return result; + } + parents.pop(); + } + return null; + } + /** + * Walk through the scene + * + * @static + * @param {SceneChild} callbackk + * @param {(Scene | SceneChild)} current + * @memberof Scene + */ + static walk(callback, current) { + if (current instanceof SceneChild_1.SceneChild) { + if (callback(current) === false) + return false; + if (current instanceof Shape_1.Shape && current.shape) + if (Scene.walk(callback, current.shape) === false) + return false; + } + if (current instanceof Scene || current instanceof Group_1.Group) { + const children = current.getChildren(); + for (let i = 0, len = children.length; i < len; i++) { + const child = children[i]; + if (Scene.walk(callback, child) === false) + return false; + } + } + } + /** + * Propagate scene to sceneChild (and children) + * + * @static + * @param {SceneChild} sceneChild + * @param {Scene} scene + * @memberof Scene + */ + static propagateToChilden(sceneChild, scene) { + sceneChild.scene = scene; + if (sceneChild instanceof Group_1.Group) { + sceneChild.getChildren().forEach((item) => { + Scene.propagateToChilden(item, scene); + }); + } + else if (sceneChild instanceof Shape_1.Shape && sceneChild.shape) { + sceneChild.shape.scene = scene; + Scene.propagateToChilden(sceneChild.shape, scene); + } + } } -/** - * Alias for {@link vec2.length} - * @function - */ +exports.Scene = Scene; +//# sourceMappingURL=Scene.js.map -var len = length; -/** - * Alias for {@link vec2.subtract} - * @function - */ +/***/ }), +/* 5 */ +/***/ ((__unused_webpack_module, exports) => { -var sub = subtract; -/** - * Alias for {@link vec2.multiply} - * @function - */ +"use strict"; -var mul = multiply; -/** - * Alias for {@link vec2.divide} - * @function +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SceneChild = void 0; +/** + * Autoincrement sceneChild default id + * + * @internal + * @ignore */ - -var div = divide; -/** - * Alias for {@link vec2.distance} - * @function +let __id = 0; +/** + * The element to be added into a scene. + * Preserve props, drawing order, generate and return buffers. + * The only implementations of this class are Group and ShapeBase + * + * @abstract + * @category Core.Abstract + * @order 2 + * @class SceneChild */ +class SceneChild { + /** + * Creates an instance of SceneChild. + * Base values will be assigned in case they are not passed + * + * @param {ISceneChildSettings} settings + */ + constructor(settings) { + var _a; + /** + * Shape generation id + * used for prevent buffer calculation + * + * @internal + * @ignore + */ + this.generateId = -1; + this.id = (_a = settings.id) !== null && _a !== void 0 ? _a : ++__id; + this.type = settings.type || 'SceneChild'; + this.name = settings.name || this.type + '_' + this.id; + this.data = settings.data || {}; + this.props = {}; + } + /** + * Find this or form or children. + * Overridden by classes that extend it + * + * @param {string | number} idOrName + * @returns {(SceneChild | null)} + */ + find(idOrName) { + if (this.id === idOrName || this.name === idOrName) + return this; + return null; + } + /** + * Return the sceneChild properties + * + * @returns {Props} + */ + getProps() { + return this.props; + } + /** + * Return a sceneChild prop or default value + * + * @param {keyof Props} key + * @param {PropArguments} [propArguments] + * @param {*} [defaultValue] + * @returns {*} + */ + getProp(key, propArguments, defaultValue) { + var _a; + return ((_a = this.props[key]) !== null && _a !== void 0 ? _a : defaultValue); + } + /** + * Check SceneChild has prop + * + * @param {keyof Props} key + * @returns + */ + hasProp(key) { + return typeof this.props[key] !== 'undefined'; + } + /** + * Set a single or multiple props + * + * @param {(keyof ISceneChildProps | ISceneChildProps)} key + * @param {*} [value] + */ + setPropUnsafe(key, value) { + if (typeof key == 'string') + this.props[key] = value; + else + Object.keys(key).forEach((k) => (this.props[k] = key[k])); + } +} +exports.SceneChild = SceneChild; +//# sourceMappingURL=SceneChild.js.map -var dist = distance; -/** - * Alias for {@link vec2.squaredDistance} - * @function - */ +/***/ }), +/* 6 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { -var sqrDist = squaredDistance; -/** - * Alias for {@link vec2.squaredLength} - * @function - */ +"use strict"; -var sqrLen = squaredLength; -/** - * Perform some operation over an array of vec2s. - * - * @param {Array} a the array of vectors to iterate over - * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed - * @param {Number} offset Number of elements to skip at the beginning of the array - * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array - * @param {Function} fn Function to call for each vector in the array - * @param {Object} [arg] additional argument to pass to fn - * @returns {Array} a - * @function +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Group = void 0; +const Scene_1 = __webpack_require__(4); +const SceneChild_1 = __webpack_require__(5); +const ShapeBase_1 = __webpack_require__(7); +const Adapt_1 = __webpack_require__(31); +/** + * A SceneChild container, propagates properties to children + * + * @order 3 + * @category Core.Scene + * @extends {SceneChild} + * @example + * ```javascript + * // Group example + * + * const rect = new Urpflanze.Rect({ + * distance: 100 // <- if a property is set the group will not overwrite it + * }) + * const group = new Urpflanze.Group({ + * repetitions: 3, + * distance: 200 + * }) + * + * group.add(rect) + * group.add(new Urpflanze.Triangle()) + * ``` + * @class Group */ - -var forEach = function () { - var vec = create(); - return function (a, stride, offset, count, fn, arg) { - var i, l; - - if (!stride) { - stride = 2; +class Group extends SceneChild_1.SceneChild { + /** + * Creates an instance of Group + * + * @param {ISceneChildSettings} [settings={}] + * @memberof Group + */ + constructor(settings = {}) { + settings.type = 'Group'; + super(settings); + this.children = []; + ['id', 'name', 'data', 'order', 'type'].forEach((prop) => { + if (prop in settings) + delete settings[prop]; + }); + this.props = settings; + } + /** + * Check group has static children + * + * @returns {boolean} + * @memberof Group + */ + isStatic() { + const children = this.children; + for (let i = 0, len = children.length; i < len; i++) + if (!children[i].isStatic()) + return false; + return true; + } + /** + * Check group has static children indexed + * + * @returns {boolean} + * @memberof Group + */ + isStaticIndexed() { + const children = this.children; + for (let i = 0, len = children.length; i < len; i++) + if (!children[i].isStaticIndexed()) + return false; + return true; + } + /** + * Add item to Group + * + * @param {Array} items + * @memberof Group + */ + add(...items) { + for (let i = 0, len = items.length; i < len; i++) { + const item = items[i]; + const rawItemProps = item.getProps(); + Object.keys(this.props).forEach((propKey) => { + if (typeof rawItemProps[propKey] === 'undefined') + item.setProp(propKey, this.props[propKey]); + }); + item.order = + typeof item.order !== 'undefined' + ? item.order + : this.children.length > 0 + ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1 + : 0; + this.scene && Scene_1.Scene.propagateToChilden(item, this.scene); + this.children.push(item); + } + this.sortChildren(); + } + /** + * Sort children + * + * @memberof Group + */ + sortChildren() { + this.children.sort((a, b) => a.order - b.order); + this.children = this.children.map((child, index) => { + child.order = index; + return child; + }); + this.clearBuffer(true); + } + /** + * Return shape children + * + * @returns {Array} + * @memberof Group + */ + getChildren() { + return this.children; + } + /** + * Find scene child from id or name + * + * @param {number | string} idOrName + * @returns {(SceneChild | null)} + * @memberof Group + */ + find(idOrName) { + if (this.id === idOrName || this.name === idOrName) + return this; + const children = this.getChildren(); + for (let i = 0, len = children.length; i < len; i++) { + const result = children[i].find(idOrName); + if (result !== null) + return result; + } + return null; + } + /** + * Get item from group + * + * @param {number} index + * @returns {(SceneChild | null)} + * @memberof Group + */ + get(index) { + return index >= 0 && index < this.children.length ? this.children[index] : null; + } + /** + * Remove item from group + * + * @param {number} index + * @returns {(false | Array)} + * @memberof Group + */ + remove(index) { + if (index >= 0 && index < this.children.length) { + const removed = this.children.splice(index, 1); + this.clearBuffer(true); + return removed; + } + return false; + } + /** + * Remove from id + * + * @param {number} id + * @memberof Scene + */ + removeFromId(id) { + for (let i = 0, len = this.children.length; i < len; i++) { + if (this.children[i].id == id) { + this.children.splice(i, 1); + return this.clearBuffer(true); + } + } + } + /** + * Generate children buffers + * + * @param {number} generateId + * @param {boolean} [bDirectSceneChild=false] + * @param {IPropArguments} [parentPropArguments] + * @memberof Group + */ + generate(generateId, bDirectSceneChild = false, parentPropArguments) { + this.generateId = generateId; + this.children.forEach(item => item.generate(generateId, bDirectSceneChild, parentPropArguments)); + } + /** + * Sum the children bounding + * + * @return {IShapeBounding} + */ + getBounding() { + const boundings = []; + const bounding = Adapt_1.Bounding.empty(); + if (this.children.length > 0) { + this.children.forEach(item => boundings.push(item.getBounding())); + for (let i = 0, len = this.children.length; i < len; i++) { + bounding.x = bounding.x > boundings[i].x ? boundings[i].x : bounding.x; + bounding.y = bounding.y > boundings[i].y ? boundings[i].y : bounding.y; + bounding.width = bounding.width < boundings[i].width ? boundings[i].width : bounding.width; + bounding.height = bounding.height < boundings[i].height ? boundings[i].height : bounding.height; + } + bounding.cx = bounding.x + bounding.width / 2; + bounding.cy = bounding.y + bounding.height / 2; + } + return bounding; + } + /** + * Chear children buffer + * + * @param {boolean} [bClearIndexed=false] + * @param {boolean} [bPropagateToParents=false] + * @memberof Group + */ + clearBuffer(bClearIndexed = false, bPropagateToParents = true) { + this.children.forEach(item => item.clearBuffer(bClearIndexed, false)); + if (this.scene && bPropagateToParents) { + const parents = this.scene.getParentsOfSceneChild(this); + parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */); + } + // if (bPropagateToParents && this.scene) + // { + // const parents = this.scene.getParentsOfSceneChild(this) + // parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, true, false) + // } + // if (bPropagateToChildren) + // { + // this.children.forEach(sceneChild => sceneChild.clearBuffer(bClearIndexed, false, true)) + // } } - - if (!offset) { - offset = 0; + /** + * Set a single or multiple props + * + * @abstract + * @param {(keyof ISceneChildProps | ISceneChildProps)} key + * @param {*} [value] + * @memberof SceneChild + */ + setProp(key, value) { + if (typeof key === 'object') + Object.keys(key).forEach((k) => (this.props[k] = key[k])); + else + this.props[key] = value; + this.children.forEach(item => item.setProp(key, value)); } - - if (count) { - l = Math.min(count * stride + offset, a.length); - } else { - l = a.length; + /** + * Set a single or multiple props + * + * @param {(keyof ISceneChildProps | ISceneChildProps)} key + * @param {*} [value] + * @memberof ShapeBase + */ + setPropUnsafe(key, value) { + super.setPropUnsafe(key, value); + this.children.forEach(item => item.setPropUnsafe(key, value)); } - - for (i = offset; i < l; i += stride) { - vec[0] = a[i]; - vec[1] = a[i + 1]; - fn(vec, vec, arg); - a[i] = vec[0]; - a[i + 1] = vec[1]; + /** + * Return length of buffer + * + * @param {IPropArguments} propArguments + * @returns {number} + * @memberof Group + */ + getBufferLength(propArguments) { + return this.children.map(sceneChild => sceneChild.getBufferLength(propArguments)).reduce((p, c) => p + c, 0); } - - return a; - }; -}(); + /** + * return a single buffer binded from children + * + * @returns {Float32Array} + * @memberof Group + */ + getBuffer() { + const buffers = this.children + .map(item => item.getBuffer()) + .filter(b => b !== undefined); + const size = buffers.reduce((currLength, buffer) => currLength + buffer.length, 0); + if (size > 0) { + const result = new Float32Array(size); + result.set(buffers[0], 0); + for (let i = 1, offset = 0, len = buffers.length; i < len; i++) { + offset += buffers[i - 1].length; + result.set(buffers[i], offset); + } + return result; + } + return ShapeBase_1.ShapeBase.EMPTY_BUFFER; + } + /** + * return a single buffer binded from children + * + * @returns {(Array | undefined)} + * @memberof Group + */ + getIndexedBuffer() { + const indexed = this.children.map(item => item.getIndexedBuffer()).filter(b => b !== undefined); + return [].concat.apply([], indexed); + } + /** + * Call strem on children + * + * @param {(streamArguments: IStreamArguments) => void} callback + * @memberof Group + */ + stream(callback) { + this.children.forEach(item => item.stream(callback)); + } +} +exports.Group = Group; +//# sourceMappingURL=Group.js.map /***/ }), -/* 24 */ +/* 7 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Scene = void 0; -const SceneChild_1 = __webpack_require__(25); -const Group_1 = __webpack_require__(26); -const Shape_1 = __webpack_require__(35); +exports.ShapeBase = void 0; +const gl_matrix_1 = __webpack_require__(8); +const types_1 = __webpack_require__(19); +const glme = __webpack_require__(28); +const Vec2_1 = __webpack_require__(29); +const math_1 = __webpack_require__(30); +const Adapt_1 = __webpack_require__(31); const Utilities_1 = __webpack_require__(33); +const SceneChild_1 = __webpack_require__(5); +const tmpMatrix = gl_matrix_1.mat4.create(); +const transformMatrix = gl_matrix_1.mat4.create(); +const perspectiveMatrix = gl_matrix_1.mat4.create(); +const repetitionMatrix = gl_matrix_1.mat4.create(); /** - * Container for all SceneChild. - * The main purpose is to manage the drawing order and update the child buffers + * Main class for shape generation * - * @order 1 - * @category Core.Scene - * @class Scene + * @category Core.Abstract + * @abstract + * @class ShapeBase + * @order 4 + * @extends {SceneChild} */ -class Scene { +class ShapeBase extends SceneChild_1.SceneChild { /** - * Creates an instance of Scene. - * You can see the default values in the property definitions + * Creates an instance of ShapeBase + * + * @param {ISceneChildSettings} [settings={}] */ constructor(settings = {}) { + super(settings); /** - * Logical number, the drawer will take care of defining the unit of measure - */ - this.width = 400; - /** - * Logical number, the drawer will take care of defining the unit of measure - */ - this.height = 400; - /** - * Default background color (black) + * Flag used to determine if indexedBuffer has been generated + * + * @internal + * @ignore */ - this.background = 'hsla(0, 0%, 0%, 1)'; + this.bIndexed = false; /** - * Default ScenePrimitive stroke color (white) + * Array used for index a vertex buffer + * only for first level scene children + * + * @internal + * @ignore */ - this.color = 'hsla(0, 0%, 100%, 1)'; + this.indexedBuffer = []; /** - * Current time + * The bounding inside the scene + * + * @type {IShapeBounding} */ - this.currentTime = 0; - if (typeof settings.width !== 'undefined') - this.width = settings.width; - if (typeof settings.height !== 'undefined') - this.height = settings.height; - if (typeof settings.background !== 'undefined') - this.background = settings.background; - if (typeof settings.color !== 'undefined') - this.color = settings.color; - this.children = []; - this.center = [this.width / 2, this.height / 2]; + this.bounding = { + cx: 0, + cy: 0, + x: -1, + y: -1, + width: 2, + height: 2, + }; + this.props = { + distance: settings.distance, + repetitions: settings.repetitions, + rotateX: settings.rotateX, + rotateY: settings.rotateY, + rotateZ: settings.rotateZ, + skewX: settings.skewX, + skewY: settings.skewY, + squeezeX: settings.squeezeX, + squeezeY: settings.squeezeY, + displace: settings.displace, + translate: settings.translate, + scale: settings.scale, + transformOrigin: settings.transformOrigin, + perspective: settings.perspective, + perspectiveOrigin: settings.perspectiveOrigin, + }; this.anchor = settings.anchor && Array.isArray(settings.anchor) ? [ typeof settings.anchor[0] === 'number' - ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[0]) * 0.5) * this.width + ? Utilities_1.clamp(-1, 1, settings.anchor[0]) * -1 : settings.anchor[0] === 'left' - ? 0 + ? 1 : settings.anchor[0] === 'right' - ? this.width - : this.center[0], + ? -1 + : 0, typeof settings.anchor[1] === 'number' - ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[1]) * 0.5) * this.height + ? Utilities_1.clamp(-1, 1, settings.anchor[1]) * -1 : settings.anchor[1] === 'top' - ? 0 - : settings.anchor[1] === 'bottom' - ? this.height - : this.center[1], - ] - : [this.center[0], this.center[1]]; - } - /** - * Return width percentage - * - * @param {number} [percentage=100] - * @returns {number} - */ - getWidth(percentage = 100) { - return (this.width * percentage) / 100; - } - /** - * Return height percentage - * - * @param {number} [percentage=100] - * @returns {number} - */ - getHeight(percentage = 100) { - return (this.height * percentage) / 100; - } - /** - * Resize the scene size - * - * @param {number} width - * @param {number} [height=width] - * @memberof Scene - */ - resize(width, height = width) { - this.width = width; - this.height = height; - this.center = [this.width / 2, this.height / 2]; - const anchor = [this.width / this.anchor[0], this.height / this.anchor[1]]; - this.anchor = [this.width / anchor[0], this.height / anchor[1]]; - this.children.forEach(sceneChild => sceneChild.clearBuffer(true, false)); + ? 1 + : settings.anchor[1] === 'bottom' + ? -1 + : 0, + ] + : [0, 0]; + this.boundingType = + typeof settings.boundingType === 'string' + ? settings.boundingType === 'relative' + ? types_1.EBoundingType.Relative + : types_1.EBoundingType.Fixed + : settings.boundingType || types_1.EBoundingType.Fixed; + this.vertexCallback = settings.vertexCallback; } /** - * Update all children, generate a streamable buffer for drawing + * Check if the shape should be generated every time * - * @param {number} [atTime] time in ms - * @memberof Scene + * @returns {boolean} */ - update(atTime = 0) { - this.currentTime = atTime; - for (let i = 0, len = this.children.length; i < len; i++) { - this.children[i].generate(this.currentTime, true); - } + isStatic() { + const props = this.props; + return (typeof props.repetitions !== 'function' && + typeof props.distance !== 'function' && + typeof props.displace !== 'function' && + typeof props.scale !== 'function' && + typeof props.translate !== 'function' && + typeof props.skewX !== 'function' && + typeof props.skewY !== 'function' && + typeof props.squeezeX !== 'function' && + typeof props.squeezeY !== 'function' && + typeof props.rotateX !== 'function' && + typeof props.rotateY !== 'function' && + typeof props.rotateZ !== 'function' && + typeof props.transformOrigin !== 'function' && + typeof props.perspective !== 'function' && + typeof props.perspectiveOrigin !== 'function'); } /** - * Traverse the child buffer and use it with callback + * Check if the indexedBuffer array needs to be recreated every time, + * this can happen when a shape generates an array of vertices different in length at each repetition * - * @param {(streamArguments: IStreamArguments) => void} callback - * @memberof Scene + * @returns {boolean} */ - stream(callback) { - this.children.forEach(sceneChild => sceneChild.stream(callback)); + isStaticIndexed() { + return typeof this.props.repetitions !== 'function'; } - /* - |-------------------------------------------------------------------------- - | SceneChild - |-------------------------------------------------------------------------- - */ /** - * Return a list of children + * Return a prop value * - * @returns {Array} - * @memberof Scene + * @param {keyof ISceneChildProps} key + * @param {PropArguments} [propArguments] + * @param {*} [defaultValue] + * @returns {*} */ - getChildren() { - return this.children; + getProp(key, propArguments, defaultValue) { + let attribute = this.props[key]; + if (typeof attribute === 'function') { + attribute = attribute(propArguments); + } + return typeof attribute === 'undefined' || Number.isNaN(attribute) ? defaultValue : attribute; } /** - * Add SceneChild to Scene, pass `order` as last parameter for drawing priorities + * Set a single or multiple props * - * @param {Array} items - * @param {number} [order] - * @memberof Scene + * @param {(keyof ISceneChildProps | ISceneChildProps)} key + * @param {*} [value] + * @param {boolean} [bClearIndexed=false] */ - add(...items /**, order: number */) { - const order = typeof items[items.length - 1] === 'number' ? items[items.length - 1] : undefined; - const len = items.length - (typeof order === 'undefined' ? 0 : 1); - for (let i = 0; i < len; i++) { - const item = items[i]; - item.order = - typeof order !== 'undefined' - ? order + i - : typeof item.order !== 'undefined' - ? item.order - : this.children.length > 0 - ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1 - : 0; - Scene.propagateToChilden(item, this); - this.children.push(item); - item.clearBuffer(true, false); - item.generate(0, true); + setProp(key, value, bClearIndexed = false) { + if (typeof key === 'string') { + bClearIndexed = bClearIndexed || key == 'repetitions'; + this.props[key] = value; } - this.sortChildren(); + else { + bClearIndexed = bClearIndexed || 'repetitions' in key; + Object.keys(key).forEach((k) => (this.props[k] = key[k])); + } + this.clearBuffer(bClearIndexed, true); } /** - * Sort children by order + * Unset buffer * - * @memberof Scene + * @param {boolean} [bClearIndexed=false] + * @param {boolean} [bPropagateToParents=false] + * @param {boolean} [bPropagateToChildren=false] */ - sortChildren() { - this.children.sort((a, b) => a.order - b.order); - this.children = this.children.map((child, index) => { - child.order = index; - return child; - }); + clearBuffer(bClearIndexed = false, bPropagateToParents = true) { + this.buffer = undefined; + if (bClearIndexed) { + this.bIndexed = false; + this.indexedBuffer = []; + } + this.bStatic = this.isStatic(); + this.bStaticIndexed = this.isStaticIndexed(); + if (bPropagateToParents && this.scene && !this.scene.isFirstLevelChild(this)) { + const parents = this.scene.getParentsOfSceneChild(this); + parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */); + } } /** - * Find sceneChild from id or name in the whole scene + * Update the vertex array if the shape is not static and update the indexedBuffer if it is also not static * - * @param {string | number} idOrName - * @returns {(SceneChild | null)} - * @memberof Scene + * @param {number} generateId generation id + * @param {boolean} [bDirectSceneChild=false] adjust shape of center of scene + * @param {PropArguments} [parentPropArguments] */ - find(idOrName) { - const children = this.getChildren(); - for (let i = 0, len = children.length; i < len; i++) { - const result = children[i].find(idOrName); - if (result !== null) - return result; + generate(generateId = 0, bDirectSceneChild = false, parentPropArguments) { + var _a, _b; + if (this.buffer && this.bStatic) { + return; + } + this.generateId = generateId; + if (!this.bStaticIndexed || !this.bIndexed) + this.indexedBuffer = []; + const propArguments = ShapeBase.getEmptyPropArguments(this, parentPropArguments); + const repetition = propArguments.repetition; + const repetitions = this.getProp('repetitions', propArguments, 1); + const repetitionType = Array.isArray(repetitions) ? types_1.ERepetitionType.Matrix : types_1.ERepetitionType.Ring; + const repetitionCount = Array.isArray(repetitions) + ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) + : repetitions; + const repetitionRowCount = Array.isArray(repetitions) ? repetitions[0] : repetitionCount; + const repetitionColCount = Array.isArray(repetitions) ? (_b = repetitions[1]) !== null && _b !== void 0 ? _b : repetitions[0] : 1; + const rowRepetition = repetition.row; + rowRepetition.count = repetitionRowCount; + const colRepetition = repetition.col; + colRepetition.count = repetitionColCount; + repetition.count = repetitionCount; + repetition.col.count = repetitionColCount; + repetition.row.count = repetitionRowCount; + repetition.type = repetitionType; + let totalBufferLength = 0; + const buffers = []; + let currentIndex = 0; + const centerMatrix = gl_matrix_1.vec2.fromValues((repetitionColCount - 1) / 2, (repetitionRowCount - 1) / 2); + const sceneAnchor = this.scene ? [this.scene.anchor[0], this.scene.anchor[1], 0] : [0, 0, 0]; + const tmpTotalShapeBounding = [undefined, undefined, undefined, undefined]; + const tmpSingleRepetitionBounding = [undefined, undefined, undefined, undefined]; + for (let currentRowRepetition = 0; currentRowRepetition < repetitionRowCount; currentRowRepetition++) { + for (let currentColRepetition = 0; currentColRepetition < repetitionColCount; currentColRepetition++, currentIndex++) { + repetition.index = currentIndex + 1; + repetition.offset = repetitionCount > 1 ? currentIndex / (repetitionCount - 1) : 1; + repetition.angle = repetitionType === types_1.ERepetitionType.Ring ? (math_1.PI2 / repetitionCount) * currentIndex : 0; + colRepetition.index = currentColRepetition + 1; + colRepetition.offset = repetitionColCount > 1 ? currentColRepetition / (repetitionColCount - 1) : 1; + rowRepetition.index = currentRowRepetition + 1; + rowRepetition.offset = repetitionRowCount > 1 ? currentRowRepetition / (repetitionRowCount - 1) : 1; + // Generate primitives buffer recursively + const buffer = this.generateBuffer(generateId, propArguments); + const bufferLength = buffer.length; + const bounding = this.getShapeBounding(); + buffers[currentIndex] = new Float32Array(bufferLength); + totalBufferLength += bufferLength; + { + const distance = glme.toVec2(this.getProp('distance', propArguments, glme.VEC2_ZERO)); + const displace = this.getProp('displace', propArguments, 0); + const scale = glme.toVec3(this.getProp('scale', propArguments, glme.VEC2_ONE), 1); + const translate = glme.toVec3(this.getProp('translate', propArguments, glme.VEC2_ZERO), 0); + const skewX = this.getProp('skewX', propArguments, 0); + const skewY = this.getProp('skewY', propArguments, 0); + const squeezeX = this.getProp('squeezeX', propArguments, 0); + const squeezeY = this.getProp('squeezeY', propArguments, 0); + const rotateX = this.getProp('rotateX', propArguments, 0); + const rotateY = this.getProp('rotateY', propArguments, 0); + const rotateZ = this.getProp('rotateZ', propArguments, 0); + const perspective = Utilities_1.clamp(0, 1, this.getProp('perspective', propArguments, 0)); + const perspectiveOrigin = glme.toVec3(this.getProp('perspectiveOrigin', propArguments, glme.VEC2_ZERO), 0); + const transformOrigin = glme.toVec3(this.getProp('transformOrigin', propArguments, glme.VEC2_ZERO), 0); + let offset; + switch (repetitionType) { + case types_1.ERepetitionType.Ring: + offset = gl_matrix_1.vec3.fromValues(distance[0], 0, 0); + gl_matrix_1.vec3.rotateZ(offset, offset, glme.VEC3_ZERO, repetition.angle + displace); + break; + case types_1.ERepetitionType.Matrix: + offset = gl_matrix_1.vec3.fromValues(distance[1] * (currentColRepetition - centerMatrix[0]), distance[0] * (currentRowRepetition - centerMatrix[1]), 0); + break; + } + const perspectiveSize = perspective > 0 ? Math.max(bounding.width, bounding.height) / 2 : 1; + const perspectiveValue = perspective > 0 ? perspectiveSize + (1 - perspective) * (perspectiveSize * 10) : 0; + const bTransformOrigin = (this.boundingType === types_1.EBoundingType.Relative ? bounding.cx !== 0 || bounding.cy !== 0 : true) || + perspective !== 0 || + transformOrigin[0] !== 0 || + transformOrigin[1] !== 0; + const bPerspectiveOrigin = perspectiveOrigin[0] !== 0 || perspectiveOrigin[1] !== 0; + if (bTransformOrigin) { + if (this.boundingType === types_1.EBoundingType.Relative) { + transformOrigin[0] = transformOrigin[0] * (bounding.width / 2) + bounding.cx; + transformOrigin[1] = transformOrigin[1] * (bounding.height / 2) + bounding.cy; + } + else { + transformOrigin[0] *= bounding.width / 2; + transformOrigin[1] *= bounding.height / 2; + } + transformOrigin[2] = perspectiveValue; + } + /** + * Create Matrices + */ + { + /** + * Create Transformation matrix + */ + gl_matrix_1.mat4.identity(transformMatrix); + bTransformOrigin && gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, transformOrigin); + if (translate[0] !== 0 || translate[1] !== 0) + gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, translate); + if (skewX !== 0 || skewY !== 0) { + glme.fromSkew(tmpMatrix, [skewX, skewY]); + gl_matrix_1.mat4.multiply(transformMatrix, transformMatrix, tmpMatrix); + } + rotateX !== 0 && gl_matrix_1.mat4.rotateX(transformMatrix, transformMatrix, rotateX); + rotateY !== 0 && gl_matrix_1.mat4.rotateY(transformMatrix, transformMatrix, rotateY); + rotateZ !== 0 && gl_matrix_1.mat4.rotateZ(transformMatrix, transformMatrix, rotateZ); + if (scale[0] !== 1 || scale[1] !== 1) + gl_matrix_1.mat4.scale(transformMatrix, transformMatrix, scale); + bTransformOrigin && + gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, gl_matrix_1.vec3.scale(transformOrigin, transformOrigin, -1)); + /** + * Create Perspective matrix + */ + if (perspectiveValue > 0) { + if (bPerspectiveOrigin) { + if (this.boundingType === types_1.EBoundingType.Relative) { + perspectiveOrigin[0] = perspectiveOrigin[0] * (bounding.width / 2) + bounding.cx; + perspectiveOrigin[1] = perspectiveOrigin[1] * (bounding.height / 2) + bounding.cy; + } + else { + perspectiveOrigin[0] *= bounding.width / 2; + perspectiveOrigin[1] *= bounding.height / 2; + } + perspectiveOrigin[2] = 0; + } + gl_matrix_1.mat4.perspective(perspectiveMatrix, -Math.PI / 2, 1, 0, Infinity); + } + /** + * Create Repetition matrix + */ + gl_matrix_1.mat4.identity(repetitionMatrix); + gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, offset); + if (bDirectSceneChild) { + gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, sceneAnchor); + } + /** + * Apply anchor + */ + const shapeAnchor = [this.anchor[0] * (bounding.width / 2), this.anchor[1] * (bounding.height / 2), 0]; + gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, shapeAnchor); + if (repetitionType === types_1.ERepetitionType.Ring) + gl_matrix_1.mat4.rotateZ(repetitionMatrix, repetitionMatrix, repetition.angle + displace); + } + Adapt_1.Bounding.clear(tmpSingleRepetitionBounding); + // Apply matrices on vertex + for (let bufferIndex = 0; bufferIndex < bufferLength; bufferIndex += 2) { + const vertex = [buffer[bufferIndex], buffer[bufferIndex + 1], perspectiveValue]; + { + // Apply squeeze, can be insert into transformMatrix? + squeezeX !== 0 && Vec2_1.default.squeezeX(vertex, squeezeX); + squeezeY !== 0 && Vec2_1.default.squeezeY(vertex, squeezeY); + // Apply transforms + gl_matrix_1.vec3.transformMat4(vertex, vertex, transformMatrix); + // Apply perspective + if (perspectiveValue > 0) { + bPerspectiveOrigin && gl_matrix_1.vec3.add(vertex, vertex, perspectiveOrigin); + gl_matrix_1.vec3.transformMat4(vertex, vertex, perspectiveMatrix); + gl_matrix_1.vec3.scale(vertex, vertex, perspectiveValue); + bPerspectiveOrigin && gl_matrix_1.vec3.sub(vertex, vertex, perspectiveOrigin); + } + // apply repetition matrix + gl_matrix_1.vec3.transformMat4(vertex, vertex, repetitionMatrix); + // custom vertex manipulation + if (typeof this.vertexCallback !== 'undefined') { + const index = bufferIndex / 2; + const count = bufferLength / 2; + const vertexRepetition = { + index: index + 1, + count, + offset: count > 1 ? index / (count - 1) : 1, + }; + this.vertexCallback(vertex, vertexRepetition, propArguments); + } + } + buffers[currentIndex][bufferIndex] = vertex[0]; + buffers[currentIndex][bufferIndex + 1] = vertex[1]; + Adapt_1.Bounding.add(tmpSingleRepetitionBounding, vertex[0], vertex[1]); + Adapt_1.Bounding.add(tmpTotalShapeBounding, vertex[0], vertex[1]); + } + } + // Bounding.sum(tmpTotalShapeBounding, tmpSingleRepetitionBounding) + // After buffer creation, add a frame into indexedBuffer if not static or update bounding + const singleRepetitionBounding = { cx: 0, cy: 0, x: -1, y: -1, width: 2, height: 2 }; + Adapt_1.Bounding.bind(singleRepetitionBounding, tmpSingleRepetitionBounding); + if (!this.bStaticIndexed || !this.bIndexed) { + this.addIndex(bufferLength, repetition, singleRepetitionBounding); + } + } } - return null; - } - /** - * Get shape by index - * - * @param {number} index - * @returns {(SceneChild | null)} - * @memberof Scene - */ - get(index) { - return index >= 0 && index < this.children.length ? this.children[index] : null; - } - /** - * Remove a shape by index - * - * @param {number} index - * @memberof Scene - */ - remove(index) { - index >= 0 && index < this.children.length && this.children.splice(index, 1); + Adapt_1.Bounding.bind(this.bounding, tmpTotalShapeBounding); + this.buffer = new Float32Array(totalBufferLength); + for (let i = 0, offset = 0, len = buffers.length; i < len; offset += buffers[i].length, i++) + this.buffer.set(buffers[i], offset); + this.bIndexed = true; } /** - * Removes all children + * Return current shape (whit repetions) bounding * - * @memberof Scene + * @return {*} {IShapeBounding} */ - removeChildren() { - this.children = []; + getBounding() { + return this.bounding; } /** - * Remove sceneChild by id or name + * Get number of repetitions * - * @param {number | number} idOrName - * @memberof Scene + * @returns {number} */ - removeFromId(idOrName) { - for (let i = 0, len = this.children.length; i < len; i++) - if (this.children[i].id === idOrName || this.children[i].name === idOrName) { - this.children.splice(i, 1); - return; - } + getRepetitionCount() { + var _a; + const repetitions = this.getProp('repetitions', undefined, 1); + return Array.isArray(repetitions) ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) : repetitions; } /** - * Return true if sceneChild is direct children + * Return buffer * - * @param {SceneChild} sceneChild - * @returns {boolean} - * @memberof Scene + * @returns {(Float32Array | undefined)} */ - isFirstLevelChild(sceneChild) { - for (let i = 0, len = this.children.length; i < len; i++) - if (this.children[i].id === sceneChild.id) - return true; - const parents = this.getParentsOfSceneChild(sceneChild); - return parents.length === 1 && parents[0] instanceof Group_1.Group; + getBuffer() { + return this.buffer; } /** - * Returns the list of sceneChild hierarchy starting from the scene + * Return indexed buffer * - * @param {SceneChild} sceneChild - * @returns {Array} - * @memberof Scene + * @returns {(Array> | undefined)} */ - getParentsOfSceneChild(sceneChild) { - const result = Scene.getParentsOfSceneChild(this, sceneChild); - if (result) { - result.splice(0, 1); - return result; - } - return []; + getIndexedBuffer() { + return this.indexedBuffer; } /** - * Returns the list of sceneChild hierarchy starting from the scene + * Return number of encapsulation * - * @static - * @param {(Scene | SceneChild)} current - * @param {SceneChild} sceneChild - * @param {(Array)} [parents=[]] - * @returns {(Array | null)} - * @memberof Scene + * @param {IBufferIndex} index + * @returns {number} */ - static getParentsOfSceneChild(current, sceneChild, parents = []) { - let result; - if (current instanceof SceneChild_1.SceneChild) { - if (current.id == sceneChild.id) - return parents; - if (current instanceof Shape_1.Shape && current.shape) { - const tmpParents = parents.slice(); - tmpParents.push(current); - if ((result = Scene.getParentsOfSceneChild(current.shape, sceneChild, tmpParents))) - return result; - } - } - if (current instanceof Scene || current instanceof Group_1.Group) { - const children = current.getChildren(); - parents.push(current); - for (let i = 0, len = children.length; i < len; i++) { - const child = children[i]; - if ((result = Scene.getParentsOfSceneChild(child, sceneChild, parents))) - return result; - } - parents.pop(); + static getIndexParentLevel(index) { + if (typeof index.parent === 'undefined') + return 0; + let currentParent = index.parent; + let currentParentLevel = 1; + while (typeof currentParent.parent !== 'undefined') { + currentParentLevel++; + currentParent = currentParent.parent; } - return null; + return currentParentLevel; } /** - * Walk through the scene + * Stream buffer * - * @static - * @param {SceneChild} callbackk - * @param {(Scene | SceneChild)} current - * @memberof Scene + * @param {(TStreamCallback} callback */ - static walk(callback, current) { - if (current instanceof SceneChild_1.SceneChild) { - if (callback(current) === false) - return false; - if (current instanceof Shape_1.Shape && current.shape) - if (Scene.walk(callback, current.shape) === false) - return false; - } - if (current instanceof Scene || current instanceof Group_1.Group) { - const children = current.getChildren(); - for (let i = 0, len = children.length; i < len; i++) { - const child = children[i]; - if (Scene.walk(callback, child) === false) - return false; + stream(callback) { + if (this.buffer && this.indexedBuffer) { + for (let i = 0, j = 0, len = this.indexedBuffer.length; i < len; i++) { + const currentIndexing = this.indexedBuffer[i]; + callback({ + buffer: this.buffer, + frameLength: currentIndexing.frameLength, + frameBufferIndex: j, + currentIndexing: currentIndexing, + currentShapeIndex: i, + totalShapes: len, + }); + j += currentIndexing.frameLength; } } } /** - * Propagate scene to sceneChild (and children) + * Return empty propArguments * * @static - * @param {SceneChild} sceneChild - * @param {Scene} scene - * @memberof Scene + * @param {ShapeBase} shape + * @return {*} {PropArguments} */ - static propagateToChilden(sceneChild, scene) { - sceneChild.scene = scene; - if (sceneChild instanceof Group_1.Group) { - sceneChild.getChildren().forEach((item) => { - Scene.propagateToChilden(item, scene); - }); - } - else if (sceneChild instanceof Shape_1.Shape && sceneChild.shape) { - sceneChild.shape.scene = scene; - Scene.propagateToChilden(sceneChild.shape, scene); - } + static getEmptyPropArguments(shape, parentPropArguments) { + const repetition = { + type: types_1.ERepetitionType.Ring, + angle: 0, + index: 1, + offset: 1, + count: 1, + row: { index: 1, offset: 1, count: 1 }, + col: { index: 1, offset: 1, count: 1 }, + }; + return { + repetition, + shape, + parent: parentPropArguments, + }; } } -exports.Scene = Scene; -//# sourceMappingURL=Scene.js.map +exports.ShapeBase = ShapeBase; +/** + * Empty buffer + * + * @internal + * @ignore + */ +ShapeBase.EMPTY_BUFFER = new Float32Array(0); +/** + * Empty BaseRepetition + * + * @internal + * @ignore + */ +ShapeBase.getEmptySimpleRepetition = () => ({ + index: 1, + offset: 1, + count: 1, +}); +/** + * Empty Repetition + * + * @internal + * @ignore + */ +ShapeBase.getEmptyRepetition = () => ({ + type: types_1.ERepetitionType.Ring, + angle: 0, + ...ShapeBase.getEmptySimpleRepetition(), + row: ShapeBase.getEmptySimpleRepetition(), + col: ShapeBase.getEmptySimpleRepetition(), +}); +//# sourceMappingURL=ShapeBase.js.map + +/***/ }), +/* 8 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "glMatrix": () => (/* reexport module object */ _common_js__WEBPACK_IMPORTED_MODULE_0__), +/* harmony export */ "mat2": () => (/* reexport module object */ _mat2_js__WEBPACK_IMPORTED_MODULE_1__), +/* harmony export */ "mat2d": () => (/* reexport module object */ _mat2d_js__WEBPACK_IMPORTED_MODULE_2__), +/* harmony export */ "mat3": () => (/* reexport module object */ _mat3_js__WEBPACK_IMPORTED_MODULE_3__), +/* harmony export */ "mat4": () => (/* reexport module object */ _mat4_js__WEBPACK_IMPORTED_MODULE_4__), +/* harmony export */ "quat": () => (/* reexport module object */ _quat_js__WEBPACK_IMPORTED_MODULE_5__), +/* harmony export */ "quat2": () => (/* reexport module object */ _quat2_js__WEBPACK_IMPORTED_MODULE_6__), +/* harmony export */ "vec2": () => (/* reexport module object */ _vec2_js__WEBPACK_IMPORTED_MODULE_7__), +/* harmony export */ "vec3": () => (/* reexport module object */ _vec3_js__WEBPACK_IMPORTED_MODULE_8__), +/* harmony export */ "vec4": () => (/* reexport module object */ _vec4_js__WEBPACK_IMPORTED_MODULE_9__) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); +/* harmony import */ var _mat2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10); +/* harmony import */ var _mat2d_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(11); +/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12); +/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13); +/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(14); +/* harmony import */ var _quat2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(17); +/* harmony import */ var _vec2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(18); +/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(16); +/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(15); + + + + + + + + + + + + +/***/ }), +/* 9 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "EPSILON": () => (/* binding */ EPSILON), +/* harmony export */ "ARRAY_TYPE": () => (/* binding */ ARRAY_TYPE), +/* harmony export */ "RANDOM": () => (/* binding */ RANDOM), +/* harmony export */ "setMatrixArrayType": () => (/* binding */ setMatrixArrayType), +/* harmony export */ "toRadian": () => (/* binding */ toRadian), +/* harmony export */ "equals": () => (/* binding */ equals) +/* harmony export */ }); +/** + * Common utilities + * @module glMatrix + */ +// Configuration Constants +var EPSILON = 0.000001; +var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array; +var RANDOM = Math.random; +/** + * Sets the type of array used when creating new vectors and matrices + * + * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array + */ + +function setMatrixArrayType(type) { + ARRAY_TYPE = type; +} +var degree = Math.PI / 180; +/** + * Convert Degree To Radian + * + * @param {Number} a Angle in Degrees + */ + +function toRadian(a) { + return a * degree; +} +/** + * Tests whether or not the arguments have approximately the same value, within an absolute + * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less + * than or equal to 1.0, and a relative tolerance is used for larger values) + * + * @param {Number} a The first number to test. + * @param {Number} b The second number to test. + * @returns {Boolean} True if the numbers are approximately equal, false otherwise. + */ + +function equals(a, b) { + return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b)); +} +if (!Math.hypot) Math.hypot = function () { + var y = 0, + i = arguments.length; + + while (i--) { + y += arguments[i] * arguments[i]; + } + + return Math.sqrt(y); +}; + +/***/ }), +/* 10 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "transpose": () => (/* binding */ transpose), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "adjoint": () => (/* binding */ adjoint), +/* harmony export */ "determinant": () => (/* binding */ determinant), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "rotate": () => (/* binding */ rotate), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), +/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "frob": () => (/* binding */ frob), +/* harmony export */ "LDU": () => (/* binding */ LDU), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), +/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "sub": () => (/* binding */ sub) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); + +/** + * 2x2 Matrix + * @module mat2 + */ + +/** + * Creates a new identity mat2 + * + * @returns {mat2} a new 2x2 matrix + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[1] = 0; + out[2] = 0; + } + + out[0] = 1; + out[3] = 1; + return out; +} +/** + * Creates a new mat2 initialized with values from an existing matrix + * + * @param {ReadonlyMat2} a matrix to clone + * @returns {mat2} a new 2x2 matrix + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; +} +/** + * Copy the values from one mat2 to another + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the source matrix + * @returns {mat2} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; +} +/** + * Set a mat2 to the identity matrix + * + * @param {mat2} out the receiving matrix + * @returns {mat2} out + */ + +function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; +} +/** + * Create a new mat2 with the given values + * + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m10 Component in column 1, row 0 position (index 2) + * @param {Number} m11 Component in column 1, row 1 position (index 3) + * @returns {mat2} out A new 2x2 matrix + */ + +function fromValues(m00, m01, m10, m11) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + out[0] = m00; + out[1] = m01; + out[2] = m10; + out[3] = m11; + return out; +} +/** + * Set the components of a mat2 to the given values + * + * @param {mat2} out the receiving matrix + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m10 Component in column 1, row 0 position (index 2) + * @param {Number} m11 Component in column 1, row 1 position (index 3) + * @returns {mat2} out + */ + +function set(out, m00, m01, m10, m11) { + out[0] = m00; + out[1] = m01; + out[2] = m10; + out[3] = m11; + return out; +} +/** + * Transpose the values of a mat2 + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the source matrix + * @returns {mat2} out + */ + +function transpose(out, a) { + // If we are transposing ourselves we can skip a few steps but have to cache + // some values + if (out === a) { + var a1 = a[1]; + out[1] = a[2]; + out[2] = a1; + } else { + out[0] = a[0]; + out[1] = a[2]; + out[2] = a[1]; + out[3] = a[3]; + } + + return out; +} +/** + * Inverts a mat2 + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the source matrix + * @returns {mat2} out + */ + +function invert(out, a) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; // Calculate the determinant + + var det = a0 * a3 - a2 * a1; + + if (!det) { + return null; + } + + det = 1.0 / det; + out[0] = a3 * det; + out[1] = -a1 * det; + out[2] = -a2 * det; + out[3] = a0 * det; + return out; +} +/** + * Calculates the adjugate of a mat2 + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the source matrix + * @returns {mat2} out + */ + +function adjoint(out, a) { + // Caching this value is nessecary if out == a + var a0 = a[0]; + out[0] = a[3]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a0; + return out; +} +/** + * Calculates the determinant of a mat2 + * + * @param {ReadonlyMat2} a the source matrix + * @returns {Number} determinant of a + */ + +function determinant(a) { + return a[0] * a[3] - a[2] * a[1]; +} +/** + * Multiplies two mat2's + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the first operand + * @param {ReadonlyMat2} b the second operand + * @returns {mat2} out + */ + +function multiply(out, a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + return out; +} +/** + * Rotates a mat2 by the given angle + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat2} out + */ + +function rotate(out, a, rad) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + return out; +} +/** + * Scales the mat2 by the dimensions in the given vec2 + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the matrix to rotate + * @param {ReadonlyVec2} v the vec2 to scale the matrix by + * @returns {mat2} out + **/ + +function scale(out, a, v) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var v0 = v[0], + v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + return out; +} +/** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * mat2.identity(dest); + * mat2.rotate(dest, dest, rad); + * + * @param {mat2} out mat2 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat2} out + */ + +function fromRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + return out; +} +/** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat2.identity(dest); + * mat2.scale(dest, dest, vec); + * + * @param {mat2} out mat2 receiving operation result + * @param {ReadonlyVec2} v Scaling vector + * @returns {mat2} out + */ + +function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + return out; +} +/** + * Returns a string representation of a mat2 + * + * @param {ReadonlyMat2} a matrix to represent as a string + * @returns {String} string representation of the matrix + */ + +function str(a) { + return "mat2(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; +} +/** + * Returns Frobenius norm of a mat2 + * + * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of + * @returns {Number} Frobenius norm + */ + +function frob(a) { + return Math.hypot(a[0], a[1], a[2], a[3]); +} +/** + * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix + * @param {ReadonlyMat2} L the lower triangular matrix + * @param {ReadonlyMat2} D the diagonal matrix + * @param {ReadonlyMat2} U the upper triangular matrix + * @param {ReadonlyMat2} a the input matrix to factorize + */ + +function LDU(L, D, U, a) { + L[2] = a[2] / a[0]; + U[0] = a[0]; + U[1] = a[1]; + U[3] = a[3] - L[2] * U[1]; + return [L, D, U]; +} +/** + * Adds two mat2's + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the first operand + * @param {ReadonlyMat2} b the second operand + * @returns {mat2} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; +} +/** + * Subtracts matrix b from matrix a + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the first operand + * @param {ReadonlyMat2} b the second operand + * @returns {mat2} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; +} +/** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyMat2} a The first matrix. + * @param {ReadonlyMat2} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; +} +/** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {ReadonlyMat2} a The first matrix. + * @param {ReadonlyMat2} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)); +} +/** + * Multiply each element of the matrix by a scalar. + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the matrix to scale + * @param {Number} b amount to scale the matrix's elements by + * @returns {mat2} out + */ + +function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + return out; +} +/** + * Adds two mat2's after multiplying each element of the second operand by a scalar value. + * + * @param {mat2} out the receiving vector + * @param {ReadonlyMat2} a the first operand + * @param {ReadonlyMat2} b the second operand + * @param {Number} scale the amount to scale b's elements by before adding + * @returns {mat2} out + */ + +function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; +} +/** + * Alias for {@link mat2.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link mat2.subtract} + * @function + */ + +var sub = subtract; + +/***/ }), +/* 11 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "determinant": () => (/* binding */ determinant), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "rotate": () => (/* binding */ rotate), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "translate": () => (/* binding */ translate), +/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), +/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), +/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "frob": () => (/* binding */ frob), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), +/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "sub": () => (/* binding */ sub) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); + +/** + * 2x3 Matrix + * @module mat2d + * @description + * A mat2d contains six elements defined as: + *
+ * [a, b,
+ *  c, d,
+ *  tx, ty]
+ * 
+ * This is a short form for the 3x3 matrix: + *
+ * [a, b, 0,
+ *  c, d, 0,
+ *  tx, ty, 1]
+ * 
+ * The last column is ignored so the array is shorter and operations are faster. + */ + +/** + * Creates a new identity mat2d + * + * @returns {mat2d} a new 2x3 matrix + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[1] = 0; + out[2] = 0; + out[4] = 0; + out[5] = 0; + } + + out[0] = 1; + out[3] = 1; + return out; +} +/** + * Creates a new mat2d initialized with values from an existing matrix + * + * @param {ReadonlyMat2d} a matrix to clone + * @returns {mat2d} a new 2x3 matrix + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + return out; +} +/** + * Copy the values from one mat2d to another + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the source matrix + * @returns {mat2d} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + return out; +} +/** + * Set a mat2d to the identity matrix + * + * @param {mat2d} out the receiving matrix + * @returns {mat2d} out + */ + +function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; +} +/** + * Create a new mat2d with the given values + * + * @param {Number} a Component A (index 0) + * @param {Number} b Component B (index 1) + * @param {Number} c Component C (index 2) + * @param {Number} d Component D (index 3) + * @param {Number} tx Component TX (index 4) + * @param {Number} ty Component TY (index 5) + * @returns {mat2d} A new mat2d + */ + +function fromValues(a, b, c, d, tx, ty) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); + out[0] = a; + out[1] = b; + out[2] = c; + out[3] = d; + out[4] = tx; + out[5] = ty; + return out; +} +/** + * Set the components of a mat2d to the given values + * + * @param {mat2d} out the receiving matrix + * @param {Number} a Component A (index 0) + * @param {Number} b Component B (index 1) + * @param {Number} c Component C (index 2) + * @param {Number} d Component D (index 3) + * @param {Number} tx Component TX (index 4) + * @param {Number} ty Component TY (index 5) + * @returns {mat2d} out + */ + +function set(out, a, b, c, d, tx, ty) { + out[0] = a; + out[1] = b; + out[2] = c; + out[3] = d; + out[4] = tx; + out[5] = ty; + return out; +} +/** + * Inverts a mat2d + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the source matrix + * @returns {mat2d} out + */ + +function invert(out, a) { + var aa = a[0], + ab = a[1], + ac = a[2], + ad = a[3]; + var atx = a[4], + aty = a[5]; + var det = aa * ad - ab * ac; + + if (!det) { + return null; + } + + det = 1.0 / det; + out[0] = ad * det; + out[1] = -ab * det; + out[2] = -ac * det; + out[3] = aa * det; + out[4] = (ac * aty - ad * atx) * det; + out[5] = (ab * atx - aa * aty) * det; + return out; +} +/** + * Calculates the determinant of a mat2d + * + * @param {ReadonlyMat2d} a the source matrix + * @returns {Number} determinant of a + */ + +function determinant(a) { + return a[0] * a[3] - a[1] * a[2]; +} +/** + * Multiplies two mat2d's + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the first operand + * @param {ReadonlyMat2d} b the second operand + * @returns {mat2d} out + */ + +function multiply(out, a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3], + b4 = b[4], + b5 = b[5]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + out[4] = a0 * b4 + a2 * b5 + a4; + out[5] = a1 * b4 + a3 * b5 + a5; + return out; +} +/** + * Rotates a mat2d by the given angle + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat2d} out + */ + +function rotate(out, a, rad) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5]; + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + out[4] = a4; + out[5] = a5; + return out; +} +/** + * Scales the mat2d by the dimensions in the given vec2 + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the matrix to translate + * @param {ReadonlyVec2} v the vec2 to scale the matrix by + * @returns {mat2d} out + **/ + +function scale(out, a, v) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5]; + var v0 = v[0], + v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + out[4] = a4; + out[5] = a5; + return out; +} +/** + * Translates the mat2d by the dimensions in the given vec2 + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the matrix to translate + * @param {ReadonlyVec2} v the vec2 to translate the matrix by + * @returns {mat2d} out + **/ + +function translate(out, a, v) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5]; + var v0 = v[0], + v1 = v[1]; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = a0 * v0 + a2 * v1 + a4; + out[5] = a1 * v0 + a3 * v1 + a5; + return out; +} +/** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * mat2d.identity(dest); + * mat2d.rotate(dest, dest, rad); + * + * @param {mat2d} out mat2d receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat2d} out + */ + +function fromRotation(out, rad) { + var s = Math.sin(rad), + c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + out[4] = 0; + out[5] = 0; + return out; +} +/** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat2d.identity(dest); + * mat2d.scale(dest, dest, vec); + * + * @param {mat2d} out mat2d receiving operation result + * @param {ReadonlyVec2} v Scaling vector + * @returns {mat2d} out + */ + +function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + out[4] = 0; + out[5] = 0; + return out; +} +/** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * mat2d.identity(dest); + * mat2d.translate(dest, dest, vec); + * + * @param {mat2d} out mat2d receiving operation result + * @param {ReadonlyVec2} v Translation vector + * @returns {mat2d} out + */ + +function fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = v[0]; + out[5] = v[1]; + return out; +} +/** + * Returns a string representation of a mat2d + * + * @param {ReadonlyMat2d} a matrix to represent as a string + * @returns {String} string representation of the matrix + */ + +function str(a) { + return "mat2d(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ")"; +} +/** + * Returns Frobenius norm of a mat2d + * + * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of + * @returns {Number} Frobenius norm + */ + +function frob(a) { + return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1); +} +/** + * Adds two mat2d's + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the first operand + * @param {ReadonlyMat2d} b the second operand + * @returns {mat2d} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + return out; +} +/** + * Subtracts matrix b from matrix a + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the first operand + * @param {ReadonlyMat2d} b the second operand + * @returns {mat2d} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + return out; +} +/** + * Multiply each element of the matrix by a scalar. + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the matrix to scale + * @param {Number} b amount to scale the matrix's elements by + * @returns {mat2d} out + */ + +function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + return out; +} +/** + * Adds two mat2d's after multiplying each element of the second operand by a scalar value. + * + * @param {mat2d} out the receiving vector + * @param {ReadonlyMat2d} a the first operand + * @param {ReadonlyMat2d} b the second operand + * @param {Number} scale the amount to scale b's elements by before adding + * @returns {mat2d} out + */ + +function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + return out; +} +/** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyMat2d} a The first matrix. + * @param {ReadonlyMat2d} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5]; +} +/** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {ReadonlyMat2d} a The first matrix. + * @param {ReadonlyMat2d} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3], + b4 = b[4], + b5 = b[5]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)); +} +/** + * Alias for {@link mat2d.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link mat2d.subtract} + * @function + */ + +var sub = subtract; + +/***/ }), +/* 12 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "fromMat4": () => (/* binding */ fromMat4), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "transpose": () => (/* binding */ transpose), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "adjoint": () => (/* binding */ adjoint), +/* harmony export */ "determinant": () => (/* binding */ determinant), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "translate": () => (/* binding */ translate), +/* harmony export */ "rotate": () => (/* binding */ rotate), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), +/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), +/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), +/* harmony export */ "fromMat2d": () => (/* binding */ fromMat2d), +/* harmony export */ "fromQuat": () => (/* binding */ fromQuat), +/* harmony export */ "normalFromMat4": () => (/* binding */ normalFromMat4), +/* harmony export */ "projection": () => (/* binding */ projection), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "frob": () => (/* binding */ frob), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), +/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "sub": () => (/* binding */ sub) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); + +/** + * 3x3 Matrix + * @module mat3 + */ + +/** + * Creates a new identity mat3 + * + * @returns {mat3} a new 3x3 matrix + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + } + + out[0] = 1; + out[4] = 1; + out[8] = 1; + return out; +} +/** + * Copies the upper-left 3x3 values into the given mat3. + * + * @param {mat3} out the receiving 3x3 matrix + * @param {ReadonlyMat4} a the source 4x4 matrix + * @returns {mat3} out + */ + +function fromMat4(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[4]; + out[4] = a[5]; + out[5] = a[6]; + out[6] = a[8]; + out[7] = a[9]; + out[8] = a[10]; + return out; +} +/** + * Creates a new mat3 initialized with values from an existing matrix + * + * @param {ReadonlyMat3} a matrix to clone + * @returns {mat3} a new 3x3 matrix + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; +} +/** + * Copy the values from one mat3 to another + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the source matrix + * @returns {mat3} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; +} +/** + * Create a new mat3 with the given values + * + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m02 Component in column 0, row 2 position (index 2) + * @param {Number} m10 Component in column 1, row 0 position (index 3) + * @param {Number} m11 Component in column 1, row 1 position (index 4) + * @param {Number} m12 Component in column 1, row 2 position (index 5) + * @param {Number} m20 Component in column 2, row 0 position (index 6) + * @param {Number} m21 Component in column 2, row 1 position (index 7) + * @param {Number} m22 Component in column 2, row 2 position (index 8) + * @returns {mat3} A new mat3 + */ + +function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m10; + out[4] = m11; + out[5] = m12; + out[6] = m20; + out[7] = m21; + out[8] = m22; + return out; +} +/** + * Set the components of a mat3 to the given values + * + * @param {mat3} out the receiving matrix + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m02 Component in column 0, row 2 position (index 2) + * @param {Number} m10 Component in column 1, row 0 position (index 3) + * @param {Number} m11 Component in column 1, row 1 position (index 4) + * @param {Number} m12 Component in column 1, row 2 position (index 5) + * @param {Number} m20 Component in column 2, row 0 position (index 6) + * @param {Number} m21 Component in column 2, row 1 position (index 7) + * @param {Number} m22 Component in column 2, row 2 position (index 8) + * @returns {mat3} out + */ + +function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) { + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m10; + out[4] = m11; + out[5] = m12; + out[6] = m20; + out[7] = m21; + out[8] = m22; + return out; +} +/** + * Set a mat3 to the identity matrix + * + * @param {mat3} out the receiving matrix + * @returns {mat3} out + */ + +function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; +} +/** + * Transpose the values of a mat3 + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the source matrix + * @returns {mat3} out + */ + +function transpose(out, a) { + // If we are transposing ourselves we can skip a few steps but have to cache some values + if (out === a) { + var a01 = a[1], + a02 = a[2], + a12 = a[5]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a01; + out[5] = a[7]; + out[6] = a02; + out[7] = a12; + } else { + out[0] = a[0]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a[1]; + out[4] = a[4]; + out[5] = a[7]; + out[6] = a[2]; + out[7] = a[5]; + out[8] = a[8]; + } + + return out; +} +/** + * Inverts a mat3 + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the source matrix + * @returns {mat3} out + */ + +function invert(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2]; + var a10 = a[3], + a11 = a[4], + a12 = a[5]; + var a20 = a[6], + a21 = a[7], + a22 = a[8]; + var b01 = a22 * a11 - a12 * a21; + var b11 = -a22 * a10 + a12 * a20; + var b21 = a21 * a10 - a11 * a20; // Calculate the determinant + + var det = a00 * b01 + a01 * b11 + a02 * b21; + + if (!det) { + return null; + } + + det = 1.0 / det; + out[0] = b01 * det; + out[1] = (-a22 * a01 + a02 * a21) * det; + out[2] = (a12 * a01 - a02 * a11) * det; + out[3] = b11 * det; + out[4] = (a22 * a00 - a02 * a20) * det; + out[5] = (-a12 * a00 + a02 * a10) * det; + out[6] = b21 * det; + out[7] = (-a21 * a00 + a01 * a20) * det; + out[8] = (a11 * a00 - a01 * a10) * det; + return out; +} +/** + * Calculates the adjugate of a mat3 + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the source matrix + * @returns {mat3} out + */ + +function adjoint(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2]; + var a10 = a[3], + a11 = a[4], + a12 = a[5]; + var a20 = a[6], + a21 = a[7], + a22 = a[8]; + out[0] = a11 * a22 - a12 * a21; + out[1] = a02 * a21 - a01 * a22; + out[2] = a01 * a12 - a02 * a11; + out[3] = a12 * a20 - a10 * a22; + out[4] = a00 * a22 - a02 * a20; + out[5] = a02 * a10 - a00 * a12; + out[6] = a10 * a21 - a11 * a20; + out[7] = a01 * a20 - a00 * a21; + out[8] = a00 * a11 - a01 * a10; + return out; +} +/** + * Calculates the determinant of a mat3 + * + * @param {ReadonlyMat3} a the source matrix + * @returns {Number} determinant of a + */ + +function determinant(a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2]; + var a10 = a[3], + a11 = a[4], + a12 = a[5]; + var a20 = a[6], + a21 = a[7], + a22 = a[8]; + return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); +} +/** + * Multiplies two mat3's + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the first operand + * @param {ReadonlyMat3} b the second operand + * @returns {mat3} out + */ + +function multiply(out, a, b) { + var a00 = a[0], + a01 = a[1], + a02 = a[2]; + var a10 = a[3], + a11 = a[4], + a12 = a[5]; + var a20 = a[6], + a21 = a[7], + a22 = a[8]; + var b00 = b[0], + b01 = b[1], + b02 = b[2]; + var b10 = b[3], + b11 = b[4], + b12 = b[5]; + var b20 = b[6], + b21 = b[7], + b22 = b[8]; + out[0] = b00 * a00 + b01 * a10 + b02 * a20; + out[1] = b00 * a01 + b01 * a11 + b02 * a21; + out[2] = b00 * a02 + b01 * a12 + b02 * a22; + out[3] = b10 * a00 + b11 * a10 + b12 * a20; + out[4] = b10 * a01 + b11 * a11 + b12 * a21; + out[5] = b10 * a02 + b11 * a12 + b12 * a22; + out[6] = b20 * a00 + b21 * a10 + b22 * a20; + out[7] = b20 * a01 + b21 * a11 + b22 * a21; + out[8] = b20 * a02 + b21 * a12 + b22 * a22; + return out; +} +/** + * Translate a mat3 by the given vector + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the matrix to translate + * @param {ReadonlyVec2} v vector to translate by + * @returns {mat3} out + */ + +function translate(out, a, v) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a10 = a[3], + a11 = a[4], + a12 = a[5], + a20 = a[6], + a21 = a[7], + a22 = a[8], + x = v[0], + y = v[1]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a10; + out[4] = a11; + out[5] = a12; + out[6] = x * a00 + y * a10 + a20; + out[7] = x * a01 + y * a11 + a21; + out[8] = x * a02 + y * a12 + a22; + return out; +} +/** + * Rotates a mat3 by the given angle + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat3} out + */ + +function rotate(out, a, rad) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a10 = a[3], + a11 = a[4], + a12 = a[5], + a20 = a[6], + a21 = a[7], + a22 = a[8], + s = Math.sin(rad), + c = Math.cos(rad); + out[0] = c * a00 + s * a10; + out[1] = c * a01 + s * a11; + out[2] = c * a02 + s * a12; + out[3] = c * a10 - s * a00; + out[4] = c * a11 - s * a01; + out[5] = c * a12 - s * a02; + out[6] = a20; + out[7] = a21; + out[8] = a22; + return out; +} +/** + * Scales the mat3 by the dimensions in the given vec2 + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the matrix to rotate + * @param {ReadonlyVec2} v the vec2 to scale the matrix by + * @returns {mat3} out + **/ + +function scale(out, a, v) { + var x = v[0], + y = v[1]; + out[0] = x * a[0]; + out[1] = x * a[1]; + out[2] = x * a[2]; + out[3] = y * a[3]; + out[4] = y * a[4]; + out[5] = y * a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; +} +/** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyVec2} v Translation vector + * @returns {mat3} out + */ + +function fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = v[0]; + out[7] = v[1]; + out[8] = 1; + return out; +} +/** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.rotate(dest, dest, rad); + * + * @param {mat3} out mat3 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat3} out + */ + +function fromRotation(out, rad) { + var s = Math.sin(rad), + c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = -s; + out[4] = c; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; +} +/** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyVec2} v Scaling vector + * @returns {mat3} out + */ + +function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = v[1]; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; +} +/** + * Copies the values from a mat2d into a mat3 + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat2d} a the matrix to copy + * @returns {mat3} out + **/ + +function fromMat2d(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = 0; + out[3] = a[2]; + out[4] = a[3]; + out[5] = 0; + out[6] = a[4]; + out[7] = a[5]; + out[8] = 1; + return out; +} +/** + * Calculates a 3x3 matrix from the given quaternion + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyQuat} q Quaternion to create matrix from + * + * @returns {mat3} out + */ + +function fromQuat(out, q) { + var x = q[0], + y = q[1], + z = q[2], + w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var yx = y * x2; + var yy = y * y2; + var zx = z * x2; + var zy = z * y2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + out[0] = 1 - yy - zz; + out[3] = yx - wz; + out[6] = zx + wy; + out[1] = yx + wz; + out[4] = 1 - xx - zz; + out[7] = zy - wx; + out[2] = zx - wy; + out[5] = zy + wx; + out[8] = 1 - xx - yy; + return out; +} +/** + * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from + * + * @returns {mat3} out + */ + +function normalFromMat4(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; // Calculate the determinant + + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) { + return null; + } + + det = 1.0 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + return out; +} +/** + * Generates a 2D projection matrix with the given bounds + * + * @param {mat3} out mat3 frustum matrix will be written into + * @param {number} width Width of your gl context + * @param {number} height Height of gl context + * @returns {mat3} out + */ + +function projection(out, width, height) { + out[0] = 2 / width; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = -2 / height; + out[5] = 0; + out[6] = -1; + out[7] = 1; + out[8] = 1; + return out; +} +/** + * Returns a string representation of a mat3 + * + * @param {ReadonlyMat3} a matrix to represent as a string + * @returns {String} string representation of the matrix + */ + +function str(a) { + return "mat3(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ")"; +} +/** + * Returns Frobenius norm of a mat3 + * + * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of + * @returns {Number} Frobenius norm + */ + +function frob(a) { + return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]); +} +/** + * Adds two mat3's + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the first operand + * @param {ReadonlyMat3} b the second operand + * @returns {mat3} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + return out; +} +/** + * Subtracts matrix b from matrix a + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the first operand + * @param {ReadonlyMat3} b the second operand + * @returns {mat3} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + return out; +} +/** + * Multiply each element of the matrix by a scalar. + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the matrix to scale + * @param {Number} b amount to scale the matrix's elements by + * @returns {mat3} out + */ + +function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + return out; +} +/** + * Adds two mat3's after multiplying each element of the second operand by a scalar value. + * + * @param {mat3} out the receiving vector + * @param {ReadonlyMat3} a the first operand + * @param {ReadonlyMat3} b the second operand + * @param {Number} scale the amount to scale b's elements by before adding + * @returns {mat3} out + */ + +function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + return out; +} +/** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyMat3} a The first matrix. + * @param {ReadonlyMat3} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8]; +} +/** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {ReadonlyMat3} a The first matrix. + * @param {ReadonlyMat3} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5], + a6 = a[6], + a7 = a[7], + a8 = a[8]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3], + b4 = b[4], + b5 = b[5], + b6 = b[6], + b7 = b[7], + b8 = b[8]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)); +} +/** + * Alias for {@link mat3.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link mat3.subtract} + * @function + */ + +var sub = subtract; + +/***/ }), +/* 13 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "transpose": () => (/* binding */ transpose), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "adjoint": () => (/* binding */ adjoint), +/* harmony export */ "determinant": () => (/* binding */ determinant), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "translate": () => (/* binding */ translate), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "rotate": () => (/* binding */ rotate), +/* harmony export */ "rotateX": () => (/* binding */ rotateX), +/* harmony export */ "rotateY": () => (/* binding */ rotateY), +/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), +/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), +/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), +/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), +/* harmony export */ "fromXRotation": () => (/* binding */ fromXRotation), +/* harmony export */ "fromYRotation": () => (/* binding */ fromYRotation), +/* harmony export */ "fromZRotation": () => (/* binding */ fromZRotation), +/* harmony export */ "fromRotationTranslation": () => (/* binding */ fromRotationTranslation), +/* harmony export */ "fromQuat2": () => (/* binding */ fromQuat2), +/* harmony export */ "getTranslation": () => (/* binding */ getTranslation), +/* harmony export */ "getScaling": () => (/* binding */ getScaling), +/* harmony export */ "getRotation": () => (/* binding */ getRotation), +/* harmony export */ "fromRotationTranslationScale": () => (/* binding */ fromRotationTranslationScale), +/* harmony export */ "fromRotationTranslationScaleOrigin": () => (/* binding */ fromRotationTranslationScaleOrigin), +/* harmony export */ "fromQuat": () => (/* binding */ fromQuat), +/* harmony export */ "frustum": () => (/* binding */ frustum), +/* harmony export */ "perspective": () => (/* binding */ perspective), +/* harmony export */ "perspectiveFromFieldOfView": () => (/* binding */ perspectiveFromFieldOfView), +/* harmony export */ "ortho": () => (/* binding */ ortho), +/* harmony export */ "lookAt": () => (/* binding */ lookAt), +/* harmony export */ "targetTo": () => (/* binding */ targetTo), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "frob": () => (/* binding */ frob), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), +/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "sub": () => (/* binding */ sub) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); + +/** + * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied. + * @module mat4 + */ + +/** + * Creates a new identity mat4 + * + * @returns {mat4} a new 4x4 matrix + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + } + + out[0] = 1; + out[5] = 1; + out[10] = 1; + out[15] = 1; + return out; +} +/** + * Creates a new mat4 initialized with values from an existing matrix + * + * @param {ReadonlyMat4} a matrix to clone + * @returns {mat4} a new 4x4 matrix + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; +} +/** + * Copy the values from one mat4 to another + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the source matrix + * @returns {mat4} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; +} +/** + * Create a new mat4 with the given values + * + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m02 Component in column 0, row 2 position (index 2) + * @param {Number} m03 Component in column 0, row 3 position (index 3) + * @param {Number} m10 Component in column 1, row 0 position (index 4) + * @param {Number} m11 Component in column 1, row 1 position (index 5) + * @param {Number} m12 Component in column 1, row 2 position (index 6) + * @param {Number} m13 Component in column 1, row 3 position (index 7) + * @param {Number} m20 Component in column 2, row 0 position (index 8) + * @param {Number} m21 Component in column 2, row 1 position (index 9) + * @param {Number} m22 Component in column 2, row 2 position (index 10) + * @param {Number} m23 Component in column 2, row 3 position (index 11) + * @param {Number} m30 Component in column 3, row 0 position (index 12) + * @param {Number} m31 Component in column 3, row 1 position (index 13) + * @param {Number} m32 Component in column 3, row 2 position (index 14) + * @param {Number} m33 Component in column 3, row 3 position (index 15) + * @returns {mat4} A new mat4 + */ + +function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m03; + out[4] = m10; + out[5] = m11; + out[6] = m12; + out[7] = m13; + out[8] = m20; + out[9] = m21; + out[10] = m22; + out[11] = m23; + out[12] = m30; + out[13] = m31; + out[14] = m32; + out[15] = m33; + return out; +} +/** + * Set the components of a mat4 to the given values + * + * @param {mat4} out the receiving matrix + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m02 Component in column 0, row 2 position (index 2) + * @param {Number} m03 Component in column 0, row 3 position (index 3) + * @param {Number} m10 Component in column 1, row 0 position (index 4) + * @param {Number} m11 Component in column 1, row 1 position (index 5) + * @param {Number} m12 Component in column 1, row 2 position (index 6) + * @param {Number} m13 Component in column 1, row 3 position (index 7) + * @param {Number} m20 Component in column 2, row 0 position (index 8) + * @param {Number} m21 Component in column 2, row 1 position (index 9) + * @param {Number} m22 Component in column 2, row 2 position (index 10) + * @param {Number} m23 Component in column 2, row 3 position (index 11) + * @param {Number} m30 Component in column 3, row 0 position (index 12) + * @param {Number} m31 Component in column 3, row 1 position (index 13) + * @param {Number} m32 Component in column 3, row 2 position (index 14) + * @param {Number} m33 Component in column 3, row 3 position (index 15) + * @returns {mat4} out + */ + +function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m03; + out[4] = m10; + out[5] = m11; + out[6] = m12; + out[7] = m13; + out[8] = m20; + out[9] = m21; + out[10] = m22; + out[11] = m23; + out[12] = m30; + out[13] = m31; + out[14] = m32; + out[15] = m33; + return out; +} +/** + * Set a mat4 to the identity matrix + * + * @param {mat4} out the receiving matrix + * @returns {mat4} out + */ + +function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Transpose the values of a mat4 + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the source matrix + * @returns {mat4} out + */ + +function transpose(out, a) { + // If we are transposing ourselves we can skip a few steps but have to cache some values + if (out === a) { + var a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a12 = a[6], + a13 = a[7]; + var a23 = a[11]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a01; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a02; + out[9] = a12; + out[11] = a[14]; + out[12] = a03; + out[13] = a13; + out[14] = a23; + } else { + out[0] = a[0]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a[1]; + out[5] = a[5]; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a[2]; + out[9] = a[6]; + out[10] = a[10]; + out[11] = a[14]; + out[12] = a[3]; + out[13] = a[7]; + out[14] = a[11]; + out[15] = a[15]; + } + + return out; +} +/** + * Inverts a mat4 + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the source matrix + * @returns {mat4} out + */ + +function invert(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; // Calculate the determinant + + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) { + return null; + } + + det = 1.0 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + return out; +} +/** + * Calculates the adjugate of a mat4 + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the source matrix + * @returns {mat4} out + */ + +function adjoint(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22); + out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); + out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12); + out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); + out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); + out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22); + out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); + out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12); + out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21); + out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); + out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11); + out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); + out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); + out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21); + out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); + out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11); + return out; +} +/** + * Calculates the determinant of a mat4 + * + * @param {ReadonlyMat4} a the source matrix + * @returns {Number} determinant of a + */ + +function determinant(a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; // Calculate the determinant + + return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; +} +/** + * Multiplies two mat4s + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the first operand + * @param {ReadonlyMat4} b the second operand + * @returns {mat4} out + */ + +function multiply(out, a, b) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; // Cache only the current line of the second matrix + + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + return out; +} +/** + * Translate a mat4 by the given vector + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to translate + * @param {ReadonlyVec3} v vector to translate by + * @returns {mat4} out + */ + +function translate(out, a, v) { + var x = v[0], + y = v[1], + z = v[2]; + var a00, a01, a02, a03; + var a10, a11, a12, a13; + var a20, a21, a22, a23; + + if (a === out) { + out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + } else { + a00 = a[0]; + a01 = a[1]; + a02 = a[2]; + a03 = a[3]; + a10 = a[4]; + a11 = a[5]; + a12 = a[6]; + a13 = a[7]; + a20 = a[8]; + a21 = a[9]; + a22 = a[10]; + a23 = a[11]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a03; + out[4] = a10; + out[5] = a11; + out[6] = a12; + out[7] = a13; + out[8] = a20; + out[9] = a21; + out[10] = a22; + out[11] = a23; + out[12] = a00 * x + a10 * y + a20 * z + a[12]; + out[13] = a01 * x + a11 * y + a21 * z + a[13]; + out[14] = a02 * x + a12 * y + a22 * z + a[14]; + out[15] = a03 * x + a13 * y + a23 * z + a[15]; + } + + return out; +} +/** + * Scales the mat4 by the dimensions in the given vec3 not using vectorization + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to scale + * @param {ReadonlyVec3} v the vec3 to scale the matrix by + * @returns {mat4} out + **/ + +function scale(out, a, v) { + var x = v[0], + y = v[1], + z = v[2]; + out[0] = a[0] * x; + out[1] = a[1] * x; + out[2] = a[2] * x; + out[3] = a[3] * x; + out[4] = a[4] * y; + out[5] = a[5] * y; + out[6] = a[6] * y; + out[7] = a[7] * y; + out[8] = a[8] * z; + out[9] = a[9] * z; + out[10] = a[10] * z; + out[11] = a[11] * z; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; +} +/** + * Rotates a mat4 by the given angle around the given axis + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @param {ReadonlyVec3} axis the axis to rotate around + * @returns {mat4} out + */ + +function rotate(out, a, rad, axis) { + var x = axis[0], + y = axis[1], + z = axis[2]; + var len = Math.hypot(x, y, z); + var s, c, t; + var a00, a01, a02, a03; + var a10, a11, a12, a13; + var a20, a21, a22, a23; + var b00, b01, b02; + var b10, b11, b12; + var b20, b21, b22; + + if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + return null; + } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + s = Math.sin(rad); + c = Math.cos(rad); + t = 1 - c; + a00 = a[0]; + a01 = a[1]; + a02 = a[2]; + a03 = a[3]; + a10 = a[4]; + a11 = a[5]; + a12 = a[6]; + a13 = a[7]; + a20 = a[8]; + a21 = a[9]; + a22 = a[10]; + a23 = a[11]; // Construct the elements of the rotation matrix + + b00 = x * x * t + c; + b01 = y * x * t + z * s; + b02 = z * x * t - y * s; + b10 = x * y * t - z * s; + b11 = y * y * t + c; + b12 = z * y * t + x * s; + b20 = x * z * t + y * s; + b21 = y * z * t - x * s; + b22 = z * z * t + c; // Perform rotation-specific matrix multiplication + + out[0] = a00 * b00 + a10 * b01 + a20 * b02; + out[1] = a01 * b00 + a11 * b01 + a21 * b02; + out[2] = a02 * b00 + a12 * b01 + a22 * b02; + out[3] = a03 * b00 + a13 * b01 + a23 * b02; + out[4] = a00 * b10 + a10 * b11 + a20 * b12; + out[5] = a01 * b10 + a11 * b11 + a21 * b12; + out[6] = a02 * b10 + a12 * b11 + a22 * b12; + out[7] = a03 * b10 + a13 * b11 + a23 * b12; + out[8] = a00 * b20 + a10 * b21 + a20 * b22; + out[9] = a01 * b20 + a11 * b21 + a21 * b22; + out[10] = a02 * b20 + a12 * b21 + a22 * b22; + out[11] = a03 * b20 + a13 * b21 + a23 * b22; + + if (a !== out) { + // If the source and destination differ, copy the unchanged last row + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + + return out; +} +/** + * Rotates a matrix by the given angle around the X axis + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function rotateX(out, a, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + if (a !== out) { + // If the source and destination differ, copy the unchanged rows + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } // Perform axis-specific matrix multiplication + + + out[4] = a10 * c + a20 * s; + out[5] = a11 * c + a21 * s; + out[6] = a12 * c + a22 * s; + out[7] = a13 * c + a23 * s; + out[8] = a20 * c - a10 * s; + out[9] = a21 * c - a11 * s; + out[10] = a22 * c - a12 * s; + out[11] = a23 * c - a13 * s; + return out; +} +/** + * Rotates a matrix by the given angle around the Y axis + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function rotateY(out, a, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + if (a !== out) { + // If the source and destination differ, copy the unchanged rows + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } // Perform axis-specific matrix multiplication + + + out[0] = a00 * c - a20 * s; + out[1] = a01 * c - a21 * s; + out[2] = a02 * c - a22 * s; + out[3] = a03 * c - a23 * s; + out[8] = a00 * s + a20 * c; + out[9] = a01 * s + a21 * c; + out[10] = a02 * s + a22 * c; + out[11] = a03 * s + a23 * c; + return out; +} +/** + * Rotates a matrix by the given angle around the Z axis + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function rotateZ(out, a, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + if (a !== out) { + // If the source and destination differ, copy the unchanged last row + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } // Perform axis-specific matrix multiplication + + + out[0] = a00 * c + a10 * s; + out[1] = a01 * c + a11 * s; + out[2] = a02 * c + a12 * s; + out[3] = a03 * c + a13 * s; + out[4] = a10 * c - a00 * s; + out[5] = a11 * c - a01 * s; + out[6] = a12 * c - a02 * s; + out[7] = a13 * c - a03 * s; + return out; +} +/** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * + * @param {mat4} out mat4 receiving operation result + * @param {ReadonlyVec3} v Translation vector + * @returns {mat4} out + */ + +function fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; +} +/** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * + * @param {mat4} out mat4 receiving operation result + * @param {ReadonlyVec3} v Scaling vector + * @returns {mat4} out + */ + +function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = v[1]; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = v[2]; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Creates a matrix from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @param {ReadonlyVec3} axis the axis to rotate around + * @returns {mat4} out + */ + +function fromRotation(out, rad, axis) { + var x = axis[0], + y = axis[1], + z = axis[2]; + var len = Math.hypot(x, y, z); + var s, c, t; + + if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + return null; + } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + s = Math.sin(rad); + c = Math.cos(rad); + t = 1 - c; // Perform rotation-specific matrix multiplication + + out[0] = x * x * t + c; + out[1] = y * x * t + z * s; + out[2] = z * x * t - y * s; + out[3] = 0; + out[4] = x * y * t - z * s; + out[5] = y * y * t + c; + out[6] = z * y * t + x * s; + out[7] = 0; + out[8] = x * z * t + y * s; + out[9] = y * z * t - x * s; + out[10] = z * z * t + c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function fromXRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); // Perform axis-specific matrix multiplication + + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = c; + out[6] = s; + out[7] = 0; + out[8] = 0; + out[9] = -s; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function fromYRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); // Perform axis-specific matrix multiplication + + out[0] = c; + out[1] = 0; + out[2] = -s; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = s; + out[9] = 0; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function fromZRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); // Perform axis-specific matrix multiplication + + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = 0; + out[4] = -s; + out[5] = c; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Creates a matrix from a quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * + * @param {mat4} out mat4 receiving operation result + * @param {quat4} q Rotation quaternion + * @param {ReadonlyVec3} v Translation vector + * @returns {mat4} out + */ + +function fromRotationTranslation(out, q, v) { + // Quaternion math + var x = q[0], + y = q[1], + z = q[2], + w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; +} +/** + * Creates a new mat4 from a dual quat. + * + * @param {mat4} out Matrix + * @param {ReadonlyQuat2} a Dual Quaternion + * @returns {mat4} mat4 receiving operation result + */ + +function fromQuat2(out, a) { + var translation = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + var bx = -a[0], + by = -a[1], + bz = -a[2], + bw = a[3], + ax = a[4], + ay = a[5], + az = a[6], + aw = a[7]; + var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense + + if (magnitude > 0) { + translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude; + translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude; + translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude; + } else { + translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + } + + fromRotationTranslation(out, a, translation); + return out; +} +/** + * Returns the translation vector component of a transformation + * matrix. If a matrix is built with fromRotationTranslation, + * the returned vector will be the same as the translation vector + * originally supplied. + * @param {vec3} out Vector to receive translation component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + +function getTranslation(out, mat) { + out[0] = mat[12]; + out[1] = mat[13]; + out[2] = mat[14]; + return out; +} +/** + * Returns the scaling factor component of a transformation + * matrix. If a matrix is built with fromRotationTranslationScale + * with a normalized Quaternion paramter, the returned vector will be + * the same as the scaling vector + * originally supplied. + * @param {vec3} out Vector to receive scaling factor component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + +function getScaling(out, mat) { + var m11 = mat[0]; + var m12 = mat[1]; + var m13 = mat[2]; + var m21 = mat[4]; + var m22 = mat[5]; + var m23 = mat[6]; + var m31 = mat[8]; + var m32 = mat[9]; + var m33 = mat[10]; + out[0] = Math.hypot(m11, m12, m13); + out[1] = Math.hypot(m21, m22, m23); + out[2] = Math.hypot(m31, m32, m33); + return out; +} +/** + * Returns a quaternion representing the rotational component + * of a transformation matrix. If a matrix is built with + * fromRotationTranslation, the returned quaternion will be the + * same as the quaternion originally supplied. + * @param {quat} out Quaternion to receive the rotation component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {quat} out + */ + +function getRotation(out, mat) { + var scaling = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + getScaling(scaling, mat); + var is1 = 1 / scaling[0]; + var is2 = 1 / scaling[1]; + var is3 = 1 / scaling[2]; + var sm11 = mat[0] * is1; + var sm12 = mat[1] * is2; + var sm13 = mat[2] * is3; + var sm21 = mat[4] * is1; + var sm22 = mat[5] * is2; + var sm23 = mat[6] * is3; + var sm31 = mat[8] * is1; + var sm32 = mat[9] * is2; + var sm33 = mat[10] * is3; + var trace = sm11 + sm22 + sm33; + var S = 0; + + if (trace > 0) { + S = Math.sqrt(trace + 1.0) * 2; + out[3] = 0.25 * S; + out[0] = (sm23 - sm32) / S; + out[1] = (sm31 - sm13) / S; + out[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2; + out[3] = (sm23 - sm32) / S; + out[0] = 0.25 * S; + out[1] = (sm12 + sm21) / S; + out[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2; + out[3] = (sm31 - sm13) / S; + out[0] = (sm12 + sm21) / S; + out[1] = 0.25 * S; + out[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2; + out[3] = (sm12 - sm21) / S; + out[0] = (sm31 + sm13) / S; + out[1] = (sm23 + sm32) / S; + out[2] = 0.25 * S; + } + + return out; +} +/** + * Creates a matrix from a quaternion rotation, vector translation and vector scale + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * + * @param {mat4} out mat4 receiving operation result + * @param {quat4} q Rotation quaternion + * @param {ReadonlyVec3} v Translation vector + * @param {ReadonlyVec3} s Scaling vector + * @returns {mat4} out + */ + +function fromRotationTranslationScale(out, q, v, s) { + // Quaternion math + var x = q[0], + y = q[1], + z = q[2], + w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + var sx = s[0]; + var sy = s[1]; + var sz = s[2]; + out[0] = (1 - (yy + zz)) * sx; + out[1] = (xy + wz) * sx; + out[2] = (xz - wy) * sx; + out[3] = 0; + out[4] = (xy - wz) * sy; + out[5] = (1 - (xx + zz)) * sy; + out[6] = (yz + wx) * sy; + out[7] = 0; + out[8] = (xz + wy) * sz; + out[9] = (yz - wx) * sz; + out[10] = (1 - (xx + yy)) * sz; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; +} +/** + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * + * @param {mat4} out mat4 receiving operation result + * @param {quat4} q Rotation quaternion + * @param {ReadonlyVec3} v Translation vector + * @param {ReadonlyVec3} s Scaling vector + * @param {ReadonlyVec3} o The origin vector around which to scale and rotate + * @returns {mat4} out + */ + +function fromRotationTranslationScaleOrigin(out, q, v, s, o) { + // Quaternion math + var x = q[0], + y = q[1], + z = q[2], + w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + var sx = s[0]; + var sy = s[1]; + var sz = s[2]; + var ox = o[0]; + var oy = o[1]; + var oz = o[2]; + var out0 = (1 - (yy + zz)) * sx; + var out1 = (xy + wz) * sx; + var out2 = (xz - wy) * sx; + var out4 = (xy - wz) * sy; + var out5 = (1 - (xx + zz)) * sy; + var out6 = (yz + wx) * sy; + var out8 = (xz + wy) * sz; + var out9 = (yz - wx) * sz; + var out10 = (1 - (xx + yy)) * sz; + out[0] = out0; + out[1] = out1; + out[2] = out2; + out[3] = 0; + out[4] = out4; + out[5] = out5; + out[6] = out6; + out[7] = 0; + out[8] = out8; + out[9] = out9; + out[10] = out10; + out[11] = 0; + out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz); + out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz); + out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz); + out[15] = 1; + return out; +} +/** + * Calculates a 4x4 matrix from the given quaternion + * + * @param {mat4} out mat4 receiving operation result + * @param {ReadonlyQuat} q Quaternion to create matrix from + * + * @returns {mat4} out + */ + +function fromQuat(out, q) { + var x = q[0], + y = q[1], + z = q[2], + w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var yx = y * x2; + var yy = y * y2; + var zx = z * x2; + var zy = z * y2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + out[0] = 1 - yy - zz; + out[1] = yx + wz; + out[2] = zx - wy; + out[3] = 0; + out[4] = yx - wz; + out[5] = 1 - xx - zz; + out[6] = zy + wx; + out[7] = 0; + out[8] = zx + wy; + out[9] = zy - wx; + out[10] = 1 - xx - yy; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Generates a frustum matrix with the given bounds + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {Number} left Left bound of the frustum + * @param {Number} right Right bound of the frustum + * @param {Number} bottom Bottom bound of the frustum + * @param {Number} top Top bound of the frustum + * @param {Number} near Near bound of the frustum + * @param {Number} far Far bound of the frustum + * @returns {mat4} out + */ + +function frustum(out, left, right, bottom, top, near, far) { + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + var nf = 1 / (near - far); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[10] = (far + near) * nf; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[14] = far * near * 2 * nf; + out[15] = 0; + return out; +} +/** + * Generates a perspective projection matrix with the given bounds. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {number} fovy Vertical field of view in radians + * @param {number} aspect Aspect ratio. typically viewport width/height + * @param {number} near Near bound of the frustum + * @param {number} far Far bound of the frustum, can be null or Infinity + * @returns {mat4} out + */ + +function perspective(out, fovy, aspect, near, far) { + var f = 1.0 / Math.tan(fovy / 2), + nf; + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + + if (far != null && far !== Infinity) { + nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + + return out; +} +/** + * Generates a perspective projection matrix with the given field of view. + * This is primarily useful for generating projection matrices to be used + * with the still experiemental WebVR API. + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param {number} near Near bound of the frustum + * @param {number} far Far bound of the frustum + * @returns {mat4} out + */ + +function perspectiveFromFieldOfView(out, fov, near, far) { + var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0); + var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0); + var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0); + var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0); + var xScale = 2.0 / (leftTan + rightTan); + var yScale = 2.0 / (upTan + downTan); + out[0] = xScale; + out[1] = 0.0; + out[2] = 0.0; + out[3] = 0.0; + out[4] = 0.0; + out[5] = yScale; + out[6] = 0.0; + out[7] = 0.0; + out[8] = -((leftTan - rightTan) * xScale * 0.5); + out[9] = (upTan - downTan) * yScale * 0.5; + out[10] = far / (near - far); + out[11] = -1.0; + out[12] = 0.0; + out[13] = 0.0; + out[14] = far * near / (near - far); + out[15] = 0.0; + return out; +} +/** + * Generates a orthogonal projection matrix with the given bounds + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {number} left Left bound of the frustum + * @param {number} right Right bound of the frustum + * @param {number} bottom Bottom bound of the frustum + * @param {number} top Top bound of the frustum + * @param {number} near Near bound of the frustum + * @param {number} far Far bound of the frustum + * @returns {mat4} out + */ + +function ortho(out, left, right, bottom, top, near, far) { + var lr = 1 / (left - right); + var bt = 1 / (bottom - top); + var nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 2 * nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = (far + near) * nf; + out[15] = 1; + return out; +} +/** + * Generates a look-at matrix with the given eye position, focal point, and up axis. + * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {ReadonlyVec3} eye Position of the viewer + * @param {ReadonlyVec3} center Point the viewer is looking at + * @param {ReadonlyVec3} up vec3 pointing up + * @returns {mat4} out + */ + +function lookAt(out, eye, center, up) { + var x0, x1, x2, y0, y1, y2, z0, z1, z2, len; + var eyex = eye[0]; + var eyey = eye[1]; + var eyez = eye[2]; + var upx = up[0]; + var upy = up[1]; + var upz = up[2]; + var centerx = center[0]; + var centery = center[1]; + var centerz = center[2]; + + if (Math.abs(eyex - centerx) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON && Math.abs(eyey - centery) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON && Math.abs(eyez - centerz) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + return identity(out); + } + + z0 = eyex - centerx; + z1 = eyey - centery; + z2 = eyez - centerz; + len = 1 / Math.hypot(z0, z1, z2); + z0 *= len; + z1 *= len; + z2 *= len; + x0 = upy * z2 - upz * z1; + x1 = upz * z0 - upx * z2; + x2 = upx * z1 - upy * z0; + len = Math.hypot(x0, x1, x2); + + if (!len) { + x0 = 0; + x1 = 0; + x2 = 0; + } else { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + + y0 = z1 * x2 - z2 * x1; + y1 = z2 * x0 - z0 * x2; + y2 = z0 * x1 - z1 * x0; + len = Math.hypot(y0, y1, y2); + + if (!len) { + y0 = 0; + y1 = 0; + y2 = 0; + } else { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + + out[0] = x0; + out[1] = y0; + out[2] = z0; + out[3] = 0; + out[4] = x1; + out[5] = y1; + out[6] = z1; + out[7] = 0; + out[8] = x2; + out[9] = y2; + out[10] = z2; + out[11] = 0; + out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); + out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); + out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); + out[15] = 1; + return out; +} +/** + * Generates a matrix that makes something look at something else. + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {ReadonlyVec3} eye Position of the viewer + * @param {ReadonlyVec3} center Point the viewer is looking at + * @param {ReadonlyVec3} up vec3 pointing up + * @returns {mat4} out + */ + +function targetTo(out, eye, target, up) { + var eyex = eye[0], + eyey = eye[1], + eyez = eye[2], + upx = up[0], + upy = up[1], + upz = up[2]; + var z0 = eyex - target[0], + z1 = eyey - target[1], + z2 = eyez - target[2]; + var len = z0 * z0 + z1 * z1 + z2 * z2; + + if (len > 0) { + len = 1 / Math.sqrt(len); + z0 *= len; + z1 *= len; + z2 *= len; + } + + var x0 = upy * z2 - upz * z1, + x1 = upz * z0 - upx * z2, + x2 = upx * z1 - upy * z0; + len = x0 * x0 + x1 * x1 + x2 * x2; + + if (len > 0) { + len = 1 / Math.sqrt(len); + x0 *= len; + x1 *= len; + x2 *= len; + } + + out[0] = x0; + out[1] = x1; + out[2] = x2; + out[3] = 0; + out[4] = z1 * x2 - z2 * x1; + out[5] = z2 * x0 - z0 * x2; + out[6] = z0 * x1 - z1 * x0; + out[7] = 0; + out[8] = z0; + out[9] = z1; + out[10] = z2; + out[11] = 0; + out[12] = eyex; + out[13] = eyey; + out[14] = eyez; + out[15] = 1; + return out; +} +/** + * Returns a string representation of a mat4 + * + * @param {ReadonlyMat4} a matrix to represent as a string + * @returns {String} string representation of the matrix + */ + +function str(a) { + return "mat4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ", " + a[9] + ", " + a[10] + ", " + a[11] + ", " + a[12] + ", " + a[13] + ", " + a[14] + ", " + a[15] + ")"; +} +/** + * Returns Frobenius norm of a mat4 + * + * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of + * @returns {Number} Frobenius norm + */ + +function frob(a) { + return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); +} +/** + * Adds two mat4's + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the first operand + * @param {ReadonlyMat4} b the second operand + * @returns {mat4} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + out[9] = a[9] + b[9]; + out[10] = a[10] + b[10]; + out[11] = a[11] + b[11]; + out[12] = a[12] + b[12]; + out[13] = a[13] + b[13]; + out[14] = a[14] + b[14]; + out[15] = a[15] + b[15]; + return out; +} +/** + * Subtracts matrix b from matrix a + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the first operand + * @param {ReadonlyMat4} b the second operand + * @returns {mat4} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + out[9] = a[9] - b[9]; + out[10] = a[10] - b[10]; + out[11] = a[11] - b[11]; + out[12] = a[12] - b[12]; + out[13] = a[13] - b[13]; + out[14] = a[14] - b[14]; + out[15] = a[15] - b[15]; + return out; +} +/** + * Multiply each element of the matrix by a scalar. + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to scale + * @param {Number} b amount to scale the matrix's elements by + * @returns {mat4} out + */ + +function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + out[9] = a[9] * b; + out[10] = a[10] * b; + out[11] = a[11] * b; + out[12] = a[12] * b; + out[13] = a[13] * b; + out[14] = a[14] * b; + out[15] = a[15] * b; + return out; +} +/** + * Adds two mat4's after multiplying each element of the second operand by a scalar value. + * + * @param {mat4} out the receiving vector + * @param {ReadonlyMat4} a the first operand + * @param {ReadonlyMat4} b the second operand + * @param {Number} scale the amount to scale b's elements by before adding + * @returns {mat4} out + */ + +function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + out[9] = a[9] + b[9] * scale; + out[10] = a[10] + b[10] * scale; + out[11] = a[11] + b[11] * scale; + out[12] = a[12] + b[12] * scale; + out[13] = a[13] + b[13] * scale; + out[14] = a[14] + b[14] * scale; + out[15] = a[15] + b[15] * scale; + return out; +} +/** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyMat4} a The first matrix. + * @param {ReadonlyMat4} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15]; +} +/** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {ReadonlyMat4} a The first matrix. + * @param {ReadonlyMat4} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var a4 = a[4], + a5 = a[5], + a6 = a[6], + a7 = a[7]; + var a8 = a[8], + a9 = a[9], + a10 = a[10], + a11 = a[11]; + var a12 = a[12], + a13 = a[13], + a14 = a[14], + a15 = a[15]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + var b4 = b[4], + b5 = b[5], + b6 = b[6], + b7 = b[7]; + var b8 = b[8], + b9 = b[9], + b10 = b[10], + b11 = b[11]; + var b12 = b[12], + b13 = b[13], + b14 = b[14], + b15 = b[15]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15)); +} +/** + * Alias for {@link mat4.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link mat4.subtract} + * @function + */ + +var sub = subtract; + +/***/ }), +/* 14 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "setAxisAngle": () => (/* binding */ setAxisAngle), +/* harmony export */ "getAxisAngle": () => (/* binding */ getAxisAngle), +/* harmony export */ "getAngle": () => (/* binding */ getAngle), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "rotateX": () => (/* binding */ rotateX), +/* harmony export */ "rotateY": () => (/* binding */ rotateY), +/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), +/* harmony export */ "calculateW": () => (/* binding */ calculateW), +/* harmony export */ "exp": () => (/* binding */ exp), +/* harmony export */ "ln": () => (/* binding */ ln), +/* harmony export */ "pow": () => (/* binding */ pow), +/* harmony export */ "slerp": () => (/* binding */ slerp), +/* harmony export */ "random": () => (/* binding */ random), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "conjugate": () => (/* binding */ conjugate), +/* harmony export */ "fromMat3": () => (/* binding */ fromMat3), +/* harmony export */ "fromEuler": () => (/* binding */ fromEuler), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "dot": () => (/* binding */ dot), +/* harmony export */ "lerp": () => (/* binding */ lerp), +/* harmony export */ "length": () => (/* binding */ length), +/* harmony export */ "len": () => (/* binding */ len), +/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), +/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), +/* harmony export */ "normalize": () => (/* binding */ normalize), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "rotationTo": () => (/* binding */ rotationTo), +/* harmony export */ "sqlerp": () => (/* binding */ sqlerp), +/* harmony export */ "setAxes": () => (/* binding */ setAxes) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); +/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12); +/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16); +/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15); + + + + +/** + * Quaternion + * @module quat + */ + +/** + * Creates a new identity quat + * + * @returns {quat} a new quaternion + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + } + + out[3] = 1; + return out; +} +/** + * Set a quat to the identity quaternion + * + * @param {quat} out the receiving quaternion + * @returns {quat} out + */ + +function identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; +} +/** + * Sets a quat from the given angle and rotation axis, + * then returns it. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyVec3} axis the axis around which to rotate + * @param {Number} rad the angle in radians + * @returns {quat} out + **/ + +function setAxisAngle(out, axis, rad) { + rad = rad * 0.5; + var s = Math.sin(rad); + out[0] = s * axis[0]; + out[1] = s * axis[1]; + out[2] = s * axis[2]; + out[3] = Math.cos(rad); + return out; +} +/** + * Gets the rotation axis and angle for a given + * quaternion. If a quaternion is created with + * setAxisAngle, this method will return the same + * values as providied in the original parameter list + * OR functionally equivalent values. + * Example: The quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @param {vec3} out_axis Vector receiving the axis of rotation + * @param {ReadonlyQuat} q Quaternion to be decomposed + * @return {Number} Angle, in radians, of the rotation + */ + +function getAxisAngle(out_axis, q) { + var rad = Math.acos(q[3]) * 2.0; + var s = Math.sin(rad / 2.0); + + if (s > _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + out_axis[0] = q[0] / s; + out_axis[1] = q[1] / s; + out_axis[2] = q[2] / s; + } else { + // If s is zero, return any axis (no rotation - axis does not matter) + out_axis[0] = 1; + out_axis[1] = 0; + out_axis[2] = 0; + } + + return rad; +} +/** + * Gets the angular distance between two unit quaternions + * + * @param {ReadonlyQuat} a Origin unit quaternion + * @param {ReadonlyQuat} b Destination unit quaternion + * @return {Number} Angle, in radians, between the two quaternions + */ + +function getAngle(a, b) { + var dotproduct = dot(a, b); + return Math.acos(2 * dotproduct * dotproduct - 1); +} +/** + * Multiplies two quat's + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @returns {quat} out + */ + +function multiply(out, a, b) { + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var bx = b[0], + by = b[1], + bz = b[2], + bw = b[3]; + out[0] = ax * bw + aw * bx + ay * bz - az * by; + out[1] = ay * bw + aw * by + az * bx - ax * bz; + out[2] = az * bw + aw * bz + ax * by - ay * bx; + out[3] = aw * bw - ax * bx - ay * by - az * bz; + return out; +} +/** + * Rotates a quaternion by the given angle about the X axis + * + * @param {quat} out quat receiving operation result + * @param {ReadonlyQuat} a quat to rotate + * @param {number} rad angle (in radians) to rotate + * @returns {quat} out + */ + +function rotateX(out, a, rad) { + rad *= 0.5; + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var bx = Math.sin(rad), + bw = Math.cos(rad); + out[0] = ax * bw + aw * bx; + out[1] = ay * bw + az * bx; + out[2] = az * bw - ay * bx; + out[3] = aw * bw - ax * bx; + return out; +} +/** + * Rotates a quaternion by the given angle about the Y axis + * + * @param {quat} out quat receiving operation result + * @param {ReadonlyQuat} a quat to rotate + * @param {number} rad angle (in radians) to rotate + * @returns {quat} out + */ + +function rotateY(out, a, rad) { + rad *= 0.5; + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var by = Math.sin(rad), + bw = Math.cos(rad); + out[0] = ax * bw - az * by; + out[1] = ay * bw + aw * by; + out[2] = az * bw + ax * by; + out[3] = aw * bw - ay * by; + return out; +} +/** + * Rotates a quaternion by the given angle about the Z axis + * + * @param {quat} out quat receiving operation result + * @param {ReadonlyQuat} a quat to rotate + * @param {number} rad angle (in radians) to rotate + * @returns {quat} out + */ + +function rotateZ(out, a, rad) { + rad *= 0.5; + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var bz = Math.sin(rad), + bw = Math.cos(rad); + out[0] = ax * bw + ay * bz; + out[1] = ay * bw - ax * bz; + out[2] = az * bw + aw * bz; + out[3] = aw * bw - az * bz; + return out; +} +/** + * Calculates the W component of a quat from the X, Y, and Z components. + * Assumes that quaternion is 1 unit in length. + * Any existing W component will be ignored. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate W component of + * @returns {quat} out + */ + +function calculateW(out, a) { + var x = a[0], + y = a[1], + z = a[2]; + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z)); + return out; +} +/** + * Calculate the exponential of a unit quaternion. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate the exponential of + * @returns {quat} out + */ + +function exp(out, a) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3]; + var r = Math.sqrt(x * x + y * y + z * z); + var et = Math.exp(w); + var s = r > 0 ? et * Math.sin(r) / r : 0; + out[0] = x * s; + out[1] = y * s; + out[2] = z * s; + out[3] = et * Math.cos(r); + return out; +} +/** + * Calculate the natural logarithm of a unit quaternion. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate the exponential of + * @returns {quat} out + */ + +function ln(out, a) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3]; + var r = Math.sqrt(x * x + y * y + z * z); + var t = r > 0 ? Math.atan2(r, w) / r : 0; + out[0] = x * t; + out[1] = y * t; + out[2] = z * t; + out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w); + return out; +} +/** + * Calculate the scalar power of a unit quaternion. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate the exponential of + * @param {Number} b amount to scale the quaternion by + * @returns {quat} out + */ + +function pow(out, a, b) { + ln(out, a); + scale(out, out, b); + exp(out, out); + return out; +} +/** + * Performs a spherical linear interpolation between two quat + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {quat} out + */ + +function slerp(out, a, b, t) { + // benchmarks: + // http://jsperf.com/quaternion-slerp-implementations + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var bx = b[0], + by = b[1], + bz = b[2], + bw = b[3]; + var omega, cosom, sinom, scale0, scale1; // calc cosine + + cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary) + + if (cosom < 0.0) { + cosom = -cosom; + bx = -bx; + by = -by; + bz = -bz; + bw = -bw; + } // calculate coefficients + + + if (1.0 - cosom > _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + // standard case (slerp) + omega = Math.acos(cosom); + sinom = Math.sin(omega); + scale0 = Math.sin((1.0 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } else { + // "from" and "to" quaternions are very close + // ... so we can do a linear interpolation + scale0 = 1.0 - t; + scale1 = t; + } // calculate final values + + + out[0] = scale0 * ax + scale1 * bx; + out[1] = scale0 * ay + scale1 * by; + out[2] = scale0 * az + scale1 * bz; + out[3] = scale0 * aw + scale1 * bw; + return out; +} +/** + * Generates a random unit quaternion + * + * @param {quat} out the receiving quaternion + * @returns {quat} out + */ + +function random(out) { + // Implementation of http://planning.cs.uiuc.edu/node198.html + // TODO: Calling random 3 times is probably not the fastest solution + var u1 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); + var u2 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); + var u3 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); + var sqrt1MinusU1 = Math.sqrt(1 - u1); + var sqrtU1 = Math.sqrt(u1); + out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2); + out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2); + out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3); + out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3); + return out; +} +/** + * Calculates the inverse of a quat + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate inverse of + * @returns {quat} out + */ + +function invert(out, a) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; + var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 + + out[0] = -a0 * invDot; + out[1] = -a1 * invDot; + out[2] = -a2 * invDot; + out[3] = a3 * invDot; + return out; +} +/** + * Calculates the conjugate of a quat + * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate conjugate of + * @returns {quat} out + */ + +function conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + return out; +} +/** + * Creates a quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant quaternion is not normalized, so you should be sure + * to renormalize the quaternion yourself where necessary. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyMat3} m rotation matrix + * @returns {quat} out + * @function + */ + +function fromMat3(out, m) { + // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes + // article "Quaternion Calculus and Fast Animation". + var fTrace = m[0] + m[4] + m[8]; + var fRoot; + + if (fTrace > 0.0) { + // |w| > 1/2, may as well choose w > 1/2 + fRoot = Math.sqrt(fTrace + 1.0); // 2w + + out[3] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; // 1/(4w) + + out[0] = (m[5] - m[7]) * fRoot; + out[1] = (m[6] - m[2]) * fRoot; + out[2] = (m[1] - m[3]) * fRoot; + } else { + // |w| <= 1/2 + var i = 0; + if (m[4] > m[0]) i = 1; + if (m[8] > m[i * 3 + i]) i = 2; + var j = (i + 1) % 3; + var k = (i + 2) % 3; + fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0); + out[i] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot; + out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; + out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; + } + + return out; +} +/** + * Creates a quaternion from the given euler angle x, y, z. + * + * @param {quat} out the receiving quaternion + * @param {x} Angle to rotate around X axis in degrees. + * @param {y} Angle to rotate around Y axis in degrees. + * @param {z} Angle to rotate around Z axis in degrees. + * @returns {quat} out + * @function + */ + +function fromEuler(out, x, y, z) { + var halfToRad = 0.5 * Math.PI / 180.0; + x *= halfToRad; + y *= halfToRad; + z *= halfToRad; + var sx = Math.sin(x); + var cx = Math.cos(x); + var sy = Math.sin(y); + var cy = Math.cos(y); + var sz = Math.sin(z); + var cz = Math.cos(z); + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + return out; +} +/** + * Returns a string representation of a quatenion + * + * @param {ReadonlyQuat} a vector to represent as a string + * @returns {String} string representation of the vector + */ + +function str(a) { + return "quat(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; +} +/** + * Creates a new quat initialized with values from an existing quaternion + * + * @param {ReadonlyQuat} a quaternion to clone + * @returns {quat} a new quaternion + * @function + */ + +var clone = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.clone; +/** + * Creates a new quat initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {quat} a new quaternion + * @function + */ + +var fromValues = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.fromValues; +/** + * Copy the values from one quat to another + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the source quaternion + * @returns {quat} out + * @function + */ -/***/ }), -/* 25 */ -/***/ ((__unused_webpack_module, exports) => { +var copy = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.copy; +/** + * Set the components of a quat to the given values + * + * @param {quat} out the receiving quaternion + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {quat} out + * @function + */ -"use strict"; +var set = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.set; +/** + * Adds two quat's + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @returns {quat} out + * @function + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SceneChild = void 0; -/** - * Autoincrement sceneChild default id - * - * @internal - * @ignore +var add = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.add; +/** + * Alias for {@link quat.multiply} + * @function */ -let __id = 0; -/** - * The element to be added into a scene. - * Preserve props, drawing order, generate and return buffers. - * The only implementations of this class are Group and ShapeBase - * - * @abstract - * @category Core.Abstract - * @order 2 - * @class SceneChild + +var mul = multiply; +/** + * Scales a quat by a scalar number + * + * @param {quat} out the receiving vector + * @param {ReadonlyQuat} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {quat} out + * @function */ -class SceneChild { - /** - * Creates an instance of SceneChild. - * Base values will be assigned in case they are not passed - * - * @param {ISceneChildSettings} settings - */ - constructor(settings) { - var _a; - /** - * Shape generation id - * used for prevent buffer calculation - * - * @internal - * @ignore - */ - this.generateId = -1; - this.id = (_a = settings.id) !== null && _a !== void 0 ? _a : ++__id; - this.type = settings.type || 'SceneChild'; - this.name = settings.name || this.type + '_' + this.id; - this.data = settings.data || {}; - this.props = {}; - } - /** - * Find this or form or children. - * Overridden by classes that extend it - * - * @param {string | number} idOrName - * @returns {(SceneChild | null)} - */ - find(idOrName) { - if (this.id === idOrName || this.name === idOrName) - return this; - return null; - } - /** - * Return the sceneChild properties - * - * @returns {Props} - */ - getProps() { - return this.props; - } - /** - * Return a sceneChild prop or default value - * - * @param {keyof Props} key - * @param {PropArguments} [propArguments] - * @param {*} [defaultValue] - * @returns {*} - */ - getProp(key, propArguments, defaultValue) { - var _a; - return ((_a = this.props[key]) !== null && _a !== void 0 ? _a : defaultValue); - } - /** - * Check SceneChild has prop - * - * @param {keyof Props} key - * @returns - */ - hasProp(key) { - return typeof this.props[key] !== 'undefined'; - } - /** - * Set a single or multiple props - * - * @param {(keyof ISceneChildProps | ISceneChildProps)} key - * @param {*} [value] - */ - setPropUnsafe(key, value) { - if (typeof key == 'string') - this.props[key] = value; - else - Object.keys(key).forEach((k) => (this.props[k] = key[k])); - } -} -exports.SceneChild = SceneChild; -//# sourceMappingURL=SceneChild.js.map -/***/ }), -/* 26 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +var scale = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.scale; +/** + * Calculates the dot product of two quat's + * + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @returns {Number} dot product of a and b + * @function + */ -"use strict"; +var dot = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.dot; +/** + * Performs a linear interpolation between two quat's + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {quat} out + * @function + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Group = void 0; -const Scene_1 = __webpack_require__(24); -const SceneChild_1 = __webpack_require__(25); -const ShapeBase_1 = __webpack_require__(27); -const Adapt_1 = __webpack_require__(31); -/** - * A SceneChild container, propagates properties to children - * - * @order 3 - * @category Core.Scene - * @extends {SceneChild} - * @example - * ```javascript - * // Group example - * - * const rect = new Urpflanze.Rect({ - * distance: 100 // <- if a property is set the group will not overwrite it - * }) - * const group = new Urpflanze.Group({ - * repetitions: 3, - * distance: 200 - * }) - * - * group.add(rect) - * group.add(new Urpflanze.Triangle()) - * ``` - * @class Group +var lerp = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.lerp; +/** + * Calculates the length of a quat + * + * @param {ReadonlyQuat} a vector to calculate length of + * @returns {Number} length of a + */ + +var length = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.length; +/** + * Alias for {@link quat.length} + * @function + */ + +var len = length; +/** + * Calculates the squared length of a quat + * + * @param {ReadonlyQuat} a vector to calculate squared length of + * @returns {Number} squared length of a + * @function + */ + +var squaredLength = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.squaredLength; +/** + * Alias for {@link quat.squaredLength} + * @function + */ + +var sqrLen = squaredLength; +/** + * Normalize a quat + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quaternion to normalize + * @returns {quat} out + * @function + */ + +var normalize = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.normalize; +/** + * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyQuat} a The first quaternion. + * @param {ReadonlyQuat} b The second quaternion. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +var exactEquals = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.exactEquals; +/** + * Returns whether or not the quaternions have approximately the same elements in the same position. + * + * @param {ReadonlyQuat} a The first vector. + * @param {ReadonlyQuat} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +var equals = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.equals; +/** + * Sets a quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * + * @param {quat} out the receiving quaternion. + * @param {ReadonlyVec3} a the initial vector + * @param {ReadonlyVec3} b the destination vector + * @returns {quat} out */ -class Group extends SceneChild_1.SceneChild { - /** - * Creates an instance of Group - * - * @param {ISceneChildSettings} [settings={}] - * @memberof Group - */ - constructor(settings = {}) { - settings.type = 'Group'; - super(settings); - this.children = []; - ['id', 'name', 'data', 'order', 'type'].forEach((prop) => { - if (prop in settings) - delete settings[prop]; - }); - this.props = settings; - } - /** - * Check group has static children - * - * @returns {boolean} - * @memberof Group - */ - isStatic() { - const children = this.children; - for (let i = 0, len = children.length; i < len; i++) - if (!children[i].isStatic()) - return false; - return true; - } - /** - * Check group has static children indexed - * - * @returns {boolean} - * @memberof Group - */ - isStaticIndexed() { - const children = this.children; - for (let i = 0, len = children.length; i < len; i++) - if (!children[i].isStaticIndexed()) - return false; - return true; - } - /** - * Add item to Group - * - * @param {Array} items - * @memberof Group - */ - add(...items) { - for (let i = 0, len = items.length; i < len; i++) { - const item = items[i]; - const rawItemProps = item.getProps(); - Object.keys(this.props).forEach((propKey) => { - if (typeof rawItemProps[propKey] === 'undefined') - item.setProp(propKey, this.props[propKey]); - }); - item.order = - typeof item.order !== 'undefined' - ? item.order - : this.children.length > 0 - ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1 - : 0; - this.scene && Scene_1.Scene.propagateToChilden(item, this.scene); - this.children.push(item); - } - this.sortChildren(); - } - /** - * Sort children - * - * @memberof Group - */ - sortChildren() { - this.children.sort((a, b) => a.order - b.order); - this.children = this.children.map((child, index) => { - child.order = index; - return child; - }); - this.clearBuffer(true); - } - /** - * Return shape children - * - * @returns {Array} - * @memberof Group - */ - getChildren() { - return this.children; - } - /** - * Find scene child from id or name - * - * @param {number | string} idOrName - * @returns {(SceneChild | null)} - * @memberof Group - */ - find(idOrName) { - if (this.id === idOrName || this.name === idOrName) - return this; - const children = this.getChildren(); - for (let i = 0, len = children.length; i < len; i++) { - const result = children[i].find(idOrName); - if (result !== null) - return result; - } - return null; - } - /** - * Get item from group - * - * @param {number} index - * @returns {(SceneChild | null)} - * @memberof Group - */ - get(index) { - return index >= 0 && index < this.children.length ? this.children[index] : null; - } - /** - * Remove item from group - * - * @param {number} index - * @returns {(false | Array)} - * @memberof Group - */ - remove(index) { - if (index >= 0 && index < this.children.length) { - const removed = this.children.splice(index, 1); - this.clearBuffer(true); - return removed; - } - return false; - } - /** - * Remove from id - * - * @param {number} id - * @memberof Scene - */ - removeFromId(id) { - for (let i = 0, len = this.children.length; i < len; i++) { - if (this.children[i].id == id) { - this.children.splice(i, 1); - return this.clearBuffer(true); - } - } - } - /** - * Generate children buffers - * - * @param {number} generateId - * @param {boolean} [bDirectSceneChild=false] - * @param {IPropArguments} [parentPropArguments] - * @memberof Group - */ - generate(generateId, bDirectSceneChild = false, parentPropArguments) { - this.generateId = generateId; - this.children.forEach(item => item.generate(generateId, bDirectSceneChild, parentPropArguments)); - } - /** - * Sum the children bounding - * - * @return {IShapeBounding} - */ - getBounding() { - const boundings = []; - const bounding = Adapt_1.Bounding.empty(); - if (this.children.length > 0) { - this.children.forEach(item => boundings.push(item.getBounding())); - for (let i = 0, len = this.children.length; i < len; i++) { - bounding.x = bounding.x > boundings[i].x ? boundings[i].x : bounding.x; - bounding.y = bounding.y > boundings[i].y ? boundings[i].y : bounding.y; - bounding.width = bounding.width < boundings[i].width ? boundings[i].width : bounding.width; - bounding.height = bounding.height < boundings[i].height ? boundings[i].height : bounding.height; - } - bounding.cx = bounding.x + bounding.width / 2; - bounding.cy = bounding.y + bounding.height / 2; - } - return bounding; - } - /** - * Chear children buffer - * - * @param {boolean} [bClearIndexed=false] - * @param {boolean} [bPropagateToParents=false] - * @memberof Group - */ - clearBuffer(bClearIndexed = false, bPropagateToParents = true) { - this.children.forEach(item => item.clearBuffer(bClearIndexed, false)); - if (this.scene && bPropagateToParents) { - const parents = this.scene.getParentsOfSceneChild(this); - parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */); - } - // if (bPropagateToParents && this.scene) - // { - // const parents = this.scene.getParentsOfSceneChild(this) - // parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, true, false) - // } - // if (bPropagateToChildren) - // { - // this.children.forEach(sceneChild => sceneChild.clearBuffer(bClearIndexed, false, true)) - // } - } - /** - * Set a single or multiple props - * - * @abstract - * @param {(keyof ISceneChildProps | ISceneChildProps)} key - * @param {*} [value] - * @memberof SceneChild - */ - setProp(key, value) { - if (typeof key === 'object') - Object.keys(key).forEach((k) => (this.props[k] = key[k])); - else - this.props[key] = value; - this.children.forEach(item => item.setProp(key, value)); - } - /** - * Set a single or multiple props - * - * @param {(keyof ISceneChildProps | ISceneChildProps)} key - * @param {*} [value] - * @memberof ShapeBase - */ - setPropUnsafe(key, value) { - super.setPropUnsafe(key, value); - this.children.forEach(item => item.setPropUnsafe(key, value)); - } - /** - * Return length of buffer - * - * @param {IPropArguments} propArguments - * @returns {number} - * @memberof Group - */ - getBufferLength(propArguments) { - return this.children.map(sceneChild => sceneChild.getBufferLength(propArguments)).reduce((p, c) => p + c, 0); + +var rotationTo = function () { + var tmpvec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.create(); + var xUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.fromValues(1, 0, 0); + var yUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.fromValues(0, 1, 0); + return function (out, a, b) { + var dot = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.dot(a, b); + + if (dot < -0.999999) { + _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, xUnitVec3, a); + if (_vec3_js__WEBPACK_IMPORTED_MODULE_2__.len(tmpvec3) < 0.000001) _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, yUnitVec3, a); + _vec3_js__WEBPACK_IMPORTED_MODULE_2__.normalize(tmpvec3, tmpvec3); + setAxisAngle(out, tmpvec3, Math.PI); + return out; + } else if (dot > 0.999999) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } else { + _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, a, b); + out[0] = tmpvec3[0]; + out[1] = tmpvec3[1]; + out[2] = tmpvec3[2]; + out[3] = 1 + dot; + return normalize(out, out); } - /** - * return a single buffer binded from children - * - * @returns {Float32Array} - * @memberof Group - */ - getBuffer() { - const buffers = this.children - .map(item => item.getBuffer()) - .filter(b => b !== undefined); - const size = buffers.reduce((currLength, buffer) => currLength + buffer.length, 0); - if (size > 0) { - const result = new Float32Array(size); - result.set(buffers[0], 0); - for (let i = 1, offset = 0, len = buffers.length; i < len; i++) { - offset += buffers[i - 1].length; - result.set(buffers[i], offset); - } - return result; - } - return ShapeBase_1.ShapeBase.EMPTY_BUFFER; + }; +}(); +/** + * Performs a spherical linear interpolation with two control points + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @param {ReadonlyQuat} c the third operand + * @param {ReadonlyQuat} d the fourth operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {quat} out + */ + +var sqlerp = function () { + var temp1 = create(); + var temp2 = create(); + return function (out, a, b, c, d, t) { + slerp(temp1, a, d, t); + slerp(temp2, b, c, t); + slerp(out, temp1, temp2, 2 * t * (1 - t)); + return out; + }; +}(); +/** + * Sets the specified quaternion with values corresponding to the given + * axes. Each axis is a vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * + * @param {ReadonlyVec3} view the vector representing the viewing direction + * @param {ReadonlyVec3} right the vector representing the local "right" direction + * @param {ReadonlyVec3} up the vector representing the local "up" direction + * @returns {quat} out + */ + +var setAxes = function () { + var matr = _mat3_js__WEBPACK_IMPORTED_MODULE_3__.create(); + return function (out, view, right, up) { + matr[0] = right[0]; + matr[3] = right[1]; + matr[6] = right[2]; + matr[1] = up[0]; + matr[4] = up[1]; + matr[7] = up[2]; + matr[2] = -view[0]; + matr[5] = -view[1]; + matr[8] = -view[2]; + return normalize(out, fromMat3(out, matr)); + }; +}(); + +/***/ }), +/* 15 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "divide": () => (/* binding */ divide), +/* harmony export */ "ceil": () => (/* binding */ ceil), +/* harmony export */ "floor": () => (/* binding */ floor), +/* harmony export */ "min": () => (/* binding */ min), +/* harmony export */ "max": () => (/* binding */ max), +/* harmony export */ "round": () => (/* binding */ round), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), +/* harmony export */ "distance": () => (/* binding */ distance), +/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), +/* harmony export */ "length": () => (/* binding */ length), +/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), +/* harmony export */ "negate": () => (/* binding */ negate), +/* harmony export */ "inverse": () => (/* binding */ inverse), +/* harmony export */ "normalize": () => (/* binding */ normalize), +/* harmony export */ "dot": () => (/* binding */ dot), +/* harmony export */ "cross": () => (/* binding */ cross), +/* harmony export */ "lerp": () => (/* binding */ lerp), +/* harmony export */ "random": () => (/* binding */ random), +/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), +/* harmony export */ "transformQuat": () => (/* binding */ transformQuat), +/* harmony export */ "zero": () => (/* binding */ zero), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "sub": () => (/* binding */ sub), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "div": () => (/* binding */ div), +/* harmony export */ "dist": () => (/* binding */ dist), +/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), +/* harmony export */ "len": () => (/* binding */ len), +/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), +/* harmony export */ "forEach": () => (/* binding */ forEach) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); + +/** + * 4 Dimensional Vector + * @module vec4 + */ + +/** + * Creates a new, empty vec4 + * + * @returns {vec4} a new 4D vector + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 0; + } + + return out; +} +/** + * Creates a new vec4 initialized with values from an existing vector + * + * @param {ReadonlyVec4} a vector to clone + * @returns {vec4} a new 4D vector + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; +} +/** + * Creates a new vec4 initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {vec4} a new 4D vector + */ + +function fromValues(x, y, z, w) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = w; + return out; +} +/** + * Copy the values from one vec4 to another + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the source vector + * @returns {vec4} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; +} +/** + * Set the components of a vec4 to the given values + * + * @param {vec4} out the receiving vector + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {vec4} out + */ + +function set(out, x, y, z, w) { + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = w; + return out; +} +/** + * Adds two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; +} +/** + * Subtracts vector b from vector a + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; +} +/** + * Multiplies two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + out[3] = a[3] * b[3]; + return out; +} +/** + * Divides two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + out[3] = a[3] / b[3]; + return out; +} +/** + * Math.ceil the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to ceil + * @returns {vec4} out + */ + +function ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + out[3] = Math.ceil(a[3]); + return out; +} +/** + * Math.floor the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to floor + * @returns {vec4} out + */ + +function floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + out[3] = Math.floor(a[3]); + return out; +} +/** + * Returns the minimum of two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + out[3] = Math.min(a[3], b[3]); + return out; +} +/** + * Returns the maximum of two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + out[3] = Math.max(a[3], b[3]); + return out; +} +/** + * Math.round the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to round + * @returns {vec4} out + */ + +function round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + out[2] = Math.round(a[2]); + out[3] = Math.round(a[3]); + return out; +} +/** + * Scales a vec4 by a scalar number + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {vec4} out + */ + +function scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + return out; +} +/** + * Adds two vec4's after scaling the second operand by a scalar value + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @param {Number} scale the amount to scale b by before adding + * @returns {vec4} out + */ + +function scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; +} +/** + * Calculates the euclidian distance between two vec4's + * + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {Number} distance between a and b + */ + +function distance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + var w = b[3] - a[3]; + return Math.hypot(x, y, z, w); +} +/** + * Calculates the squared euclidian distance between two vec4's + * + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {Number} squared distance between a and b + */ + +function squaredDistance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + var w = b[3] - a[3]; + return x * x + y * y + z * z + w * w; +} +/** + * Calculates the length of a vec4 + * + * @param {ReadonlyVec4} a vector to calculate length of + * @returns {Number} length of a + */ + +function length(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var w = a[3]; + return Math.hypot(x, y, z, w); +} +/** + * Calculates the squared length of a vec4 + * + * @param {ReadonlyVec4} a vector to calculate squared length of + * @returns {Number} squared length of a + */ + +function squaredLength(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var w = a[3]; + return x * x + y * y + z * z + w * w; +} +/** + * Negates the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to negate + * @returns {vec4} out + */ + +function negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = -a[3]; + return out; +} +/** + * Returns the inverse of the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to invert + * @returns {vec4} out + */ + +function inverse(out, a) { + out[0] = 1.0 / a[0]; + out[1] = 1.0 / a[1]; + out[2] = 1.0 / a[2]; + out[3] = 1.0 / a[3]; + return out; +} +/** + * Normalize a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to normalize + * @returns {vec4} out + */ + +function normalize(out, a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var w = a[3]; + var len = x * x + y * y + z * z + w * w; + + if (len > 0) { + len = 1 / Math.sqrt(len); + } + + out[0] = x * len; + out[1] = y * len; + out[2] = z * len; + out[3] = w * len; + return out; +} +/** + * Calculates the dot product of two vec4's + * + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {Number} dot product of a and b + */ + +function dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; +} +/** + * Returns the cross-product of three vectors in a 4-dimensional space + * + * @param {ReadonlyVec4} result the receiving vector + * @param {ReadonlyVec4} U the first vector + * @param {ReadonlyVec4} V the second vector + * @param {ReadonlyVec4} W the third vector + * @returns {vec4} result + */ + +function cross(out, u, v, w) { + var A = v[0] * w[1] - v[1] * w[0], + B = v[0] * w[2] - v[2] * w[0], + C = v[0] * w[3] - v[3] * w[0], + D = v[1] * w[2] - v[2] * w[1], + E = v[1] * w[3] - v[3] * w[1], + F = v[2] * w[3] - v[3] * w[2]; + var G = u[0]; + var H = u[1]; + var I = u[2]; + var J = u[3]; + out[0] = H * F - I * E + J * D; + out[1] = -(G * F) + I * C - J * B; + out[2] = G * E - H * C + J * A; + out[3] = -(G * D) + H * B - I * A; + return out; +} +/** + * Performs a linear interpolation between two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {vec4} out + */ + +function lerp(out, a, b, t) { + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var aw = a[3]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + out[3] = aw + t * (b[3] - aw); + return out; +} +/** + * Generates a random vector with the given scale + * + * @param {vec4} out the receiving vector + * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns {vec4} out + */ + +function random(out, scale) { + scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a + // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646. + // http://projecteuclid.org/euclid.aoms/1177692644; + + var v1, v2, v3, v4; + var s1, s2; + + do { + v1 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; + v2 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; + s1 = v1 * v1 + v2 * v2; + } while (s1 >= 1); + + do { + v3 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; + v4 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; + s2 = v3 * v3 + v4 * v4; + } while (s2 >= 1); + + var d = Math.sqrt((1 - s1) / s2); + out[0] = scale * v1; + out[1] = scale * v2; + out[2] = scale * v3 * d; + out[3] = scale * v4 * d; + return out; +} +/** + * Transforms the vec4 with a mat4. + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the vector to transform + * @param {ReadonlyMat4} m matrix to transform with + * @returns {vec4} out + */ + +function transformMat4(out, a, m) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3]; + out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + return out; +} +/** + * Transforms the vec4 with a quat + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the vector to transform + * @param {ReadonlyQuat} q quaternion to transform with + * @returns {vec4} out + */ + +function transformQuat(out, a, q) { + var x = a[0], + y = a[1], + z = a[2]; + var qx = q[0], + qy = q[1], + qz = q[2], + qw = q[3]; // calculate quat * vec + + var ix = qw * x + qy * z - qz * y; + var iy = qw * y + qz * x - qx * z; + var iz = qw * z + qx * y - qy * x; + var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat + + out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy; + out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz; + out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx; + out[3] = a[3]; + return out; +} +/** + * Set the components of a vec4 to zero + * + * @param {vec4} out the receiving vector + * @returns {vec4} out + */ + +function zero(out) { + out[0] = 0.0; + out[1] = 0.0; + out[2] = 0.0; + out[3] = 0.0; + return out; +} +/** + * Returns a string representation of a vector + * + * @param {ReadonlyVec4} a vector to represent as a string + * @returns {String} string representation of the vector + */ + +function str(a) { + return "vec4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; +} +/** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyVec4} a The first vector. + * @param {ReadonlyVec4} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; +} +/** + * Returns whether or not the vectors have approximately the same elements in the same position. + * + * @param {ReadonlyVec4} a The first vector. + * @param {ReadonlyVec4} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)); +} +/** + * Alias for {@link vec4.subtract} + * @function + */ + +var sub = subtract; +/** + * Alias for {@link vec4.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link vec4.divide} + * @function + */ + +var div = divide; +/** + * Alias for {@link vec4.distance} + * @function + */ + +var dist = distance; +/** + * Alias for {@link vec4.squaredDistance} + * @function + */ + +var sqrDist = squaredDistance; +/** + * Alias for {@link vec4.length} + * @function + */ + +var len = length; +/** + * Alias for {@link vec4.squaredLength} + * @function + */ + +var sqrLen = squaredLength; +/** + * Perform some operation over an array of vec4s. + * + * @param {Array} a the array of vectors to iterate over + * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed + * @param {Number} offset Number of elements to skip at the beginning of the array + * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array + * @param {Function} fn Function to call for each vector in the array + * @param {Object} [arg] additional argument to pass to fn + * @returns {Array} a + * @function + */ + +var forEach = function () { + var vec = create(); + return function (a, stride, offset, count, fn, arg) { + var i, l; + + if (!stride) { + stride = 4; } - /** - * return a single buffer binded from children - * - * @returns {(Array | undefined)} - * @memberof Group - */ - getIndexedBuffer() { - const indexed = this.children.map(item => item.getIndexedBuffer()).filter(b => b !== undefined); - return [].concat.apply([], indexed); + + if (!offset) { + offset = 0; } - /** - * Call strem on children - * - * @param {(streamArguments: IStreamArguments) => void} callback - * @memberof Group - */ - stream(callback) { - this.children.forEach(item => item.stream(callback)); + + if (count) { + l = Math.min(count * stride + offset, a.length); + } else { + l = a.length; + } + + for (i = offset; i < l; i += stride) { + vec[0] = a[i]; + vec[1] = a[i + 1]; + vec[2] = a[i + 2]; + vec[3] = a[i + 3]; + fn(vec, vec, arg); + a[i] = vec[0]; + a[i + 1] = vec[1]; + a[i + 2] = vec[2]; + a[i + 3] = vec[3]; } + + return a; + }; +}(); + +/***/ }), +/* 16 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "length": () => (/* binding */ length), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "divide": () => (/* binding */ divide), +/* harmony export */ "ceil": () => (/* binding */ ceil), +/* harmony export */ "floor": () => (/* binding */ floor), +/* harmony export */ "min": () => (/* binding */ min), +/* harmony export */ "max": () => (/* binding */ max), +/* harmony export */ "round": () => (/* binding */ round), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), +/* harmony export */ "distance": () => (/* binding */ distance), +/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), +/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), +/* harmony export */ "negate": () => (/* binding */ negate), +/* harmony export */ "inverse": () => (/* binding */ inverse), +/* harmony export */ "normalize": () => (/* binding */ normalize), +/* harmony export */ "dot": () => (/* binding */ dot), +/* harmony export */ "cross": () => (/* binding */ cross), +/* harmony export */ "lerp": () => (/* binding */ lerp), +/* harmony export */ "hermite": () => (/* binding */ hermite), +/* harmony export */ "bezier": () => (/* binding */ bezier), +/* harmony export */ "random": () => (/* binding */ random), +/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), +/* harmony export */ "transformMat3": () => (/* binding */ transformMat3), +/* harmony export */ "transformQuat": () => (/* binding */ transformQuat), +/* harmony export */ "rotateX": () => (/* binding */ rotateX), +/* harmony export */ "rotateY": () => (/* binding */ rotateY), +/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), +/* harmony export */ "angle": () => (/* binding */ angle), +/* harmony export */ "zero": () => (/* binding */ zero), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "sub": () => (/* binding */ sub), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "div": () => (/* binding */ div), +/* harmony export */ "dist": () => (/* binding */ dist), +/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), +/* harmony export */ "len": () => (/* binding */ len), +/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), +/* harmony export */ "forEach": () => (/* binding */ forEach) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); + +/** + * 3 Dimensional Vector + * @module vec3 + */ + +/** + * Creates a new, empty vec3 + * + * @returns {vec3} a new 3D vector + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + } + + return out; +} +/** + * Creates a new vec3 initialized with values from an existing vector + * + * @param {ReadonlyVec3} a vector to clone + * @returns {vec3} a new 3D vector + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + return out; +} +/** + * Calculates the length of a vec3 + * + * @param {ReadonlyVec3} a vector to calculate length of + * @returns {Number} length of a + */ + +function length(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + return Math.hypot(x, y, z); +} +/** + * Creates a new vec3 initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @returns {vec3} a new 3D vector + */ + +function fromValues(x, y, z) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + out[0] = x; + out[1] = y; + out[2] = z; + return out; +} +/** + * Copy the values from one vec3 to another + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the source vector + * @returns {vec3} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + return out; +} +/** + * Set the components of a vec3 to the given values + * + * @param {vec3} out the receiving vector + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @returns {vec3} out + */ + +function set(out, x, y, z) { + out[0] = x; + out[1] = y; + out[2] = z; + return out; +} +/** + * Adds two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + return out; +} +/** + * Subtracts vector b from vector a + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + return out; +} +/** + * Multiplies two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + return out; +} +/** + * Divides two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + return out; +} +/** + * Math.ceil the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to ceil + * @returns {vec3} out + */ + +function ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + return out; +} +/** + * Math.floor the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to floor + * @returns {vec3} out + */ + +function floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + return out; +} +/** + * Returns the minimum of two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + return out; +} +/** + * Returns the maximum of two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + return out; +} +/** + * Math.round the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to round + * @returns {vec3} out + */ + +function round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + out[2] = Math.round(a[2]); + return out; +} +/** + * Scales a vec3 by a scalar number + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {vec3} out + */ + +function scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + return out; +} +/** + * Adds two vec3's after scaling the second operand by a scalar value + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @param {Number} scale the amount to scale b by before adding + * @returns {vec3} out + */ + +function scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + return out; +} +/** + * Calculates the euclidian distance between two vec3's + * + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {Number} distance between a and b + */ + +function distance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + return Math.hypot(x, y, z); +} +/** + * Calculates the squared euclidian distance between two vec3's + * + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {Number} squared distance between a and b + */ + +function squaredDistance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + return x * x + y * y + z * z; +} +/** + * Calculates the squared length of a vec3 + * + * @param {ReadonlyVec3} a vector to calculate squared length of + * @returns {Number} squared length of a + */ + +function squaredLength(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + return x * x + y * y + z * z; +} +/** + * Negates the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to negate + * @returns {vec3} out + */ + +function negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + return out; +} +/** + * Returns the inverse of the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to invert + * @returns {vec3} out + */ + +function inverse(out, a) { + out[0] = 1.0 / a[0]; + out[1] = 1.0 / a[1]; + out[2] = 1.0 / a[2]; + return out; +} +/** + * Normalize a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to normalize + * @returns {vec3} out + */ + +function normalize(out, a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var len = x * x + y * y + z * z; + + if (len > 0) { + //TODO: evaluate use of glm_invsqrt here? + len = 1 / Math.sqrt(len); + } + + out[0] = a[0] * len; + out[1] = a[1] * len; + out[2] = a[2] * len; + return out; +} +/** + * Calculates the dot product of two vec3's + * + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {Number} dot product of a and b + */ + +function dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; +} +/** + * Computes the cross product of two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function cross(out, a, b) { + var ax = a[0], + ay = a[1], + az = a[2]; + var bx = b[0], + by = b[1], + bz = b[2]; + out[0] = ay * bz - az * by; + out[1] = az * bx - ax * bz; + out[2] = ax * by - ay * bx; + return out; +} +/** + * Performs a linear interpolation between two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {vec3} out + */ + +function lerp(out, a, b, t) { + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + return out; +} +/** + * Performs a hermite interpolation with two control points + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @param {ReadonlyVec3} c the third operand + * @param {ReadonlyVec3} d the fourth operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {vec3} out + */ + +function hermite(out, a, b, c, d, t) { + var factorTimes2 = t * t; + var factor1 = factorTimes2 * (2 * t - 3) + 1; + var factor2 = factorTimes2 * (t - 2) + t; + var factor3 = factorTimes2 * (t - 1); + var factor4 = factorTimes2 * (3 - 2 * t); + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; +} +/** + * Performs a bezier interpolation with two control points + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @param {ReadonlyVec3} c the third operand + * @param {ReadonlyVec3} d the fourth operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {vec3} out + */ + +function bezier(out, a, b, c, d, t) { + var inverseFactor = 1 - t; + var inverseFactorTimesTwo = inverseFactor * inverseFactor; + var factorTimes2 = t * t; + var factor1 = inverseFactorTimesTwo * inverseFactor; + var factor2 = 3 * t * inverseFactorTimesTwo; + var factor3 = 3 * factorTimes2 * inverseFactor; + var factor4 = factorTimes2 * t; + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; +} +/** + * Generates a random vector with the given scale + * + * @param {vec3} out the receiving vector + * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns {vec3} out + */ + +function random(out, scale) { + scale = scale || 1.0; + var r = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 * Math.PI; + var z = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 - 1.0; + var zScale = Math.sqrt(1.0 - z * z) * scale; + out[0] = Math.cos(r) * zScale; + out[1] = Math.sin(r) * zScale; + out[2] = z * scale; + return out; +} +/** + * Transforms the vec3 with a mat4. + * 4th vector component is implicitly '1' + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the vector to transform + * @param {ReadonlyMat4} m matrix to transform with + * @returns {vec3} out + */ + +function transformMat4(out, a, m) { + var x = a[0], + y = a[1], + z = a[2]; + var w = m[3] * x + m[7] * y + m[11] * z + m[15]; + w = w || 1.0; + out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w; + out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w; + out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w; + return out; +} +/** + * Transforms the vec3 with a mat3. + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the vector to transform + * @param {ReadonlyMat3} m the 3x3 matrix to transform with + * @returns {vec3} out + */ + +function transformMat3(out, a, m) { + var x = a[0], + y = a[1], + z = a[2]; + out[0] = x * m[0] + y * m[3] + z * m[6]; + out[1] = x * m[1] + y * m[4] + z * m[7]; + out[2] = x * m[2] + y * m[5] + z * m[8]; + return out; +} +/** + * Transforms the vec3 with a quat + * Can also be used for dual quaternions. (Multiply it with the real part) + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the vector to transform + * @param {ReadonlyQuat} q quaternion to transform with + * @returns {vec3} out + */ + +function transformQuat(out, a, q) { + // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed + var qx = q[0], + qy = q[1], + qz = q[2], + qw = q[3]; + var x = a[0], + y = a[1], + z = a[2]; // var qvec = [qx, qy, qz]; + // var uv = vec3.cross([], qvec, a); + + var uvx = qy * z - qz * y, + uvy = qz * x - qx * z, + uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv); + + var uuvx = qy * uvz - qz * uvy, + uuvy = qz * uvx - qx * uvz, + uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w); + + var w2 = qw * 2; + uvx *= w2; + uvy *= w2; + uvz *= w2; // vec3.scale(uuv, uuv, 2); + + uuvx *= 2; + uuvy *= 2; + uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv)); + + out[0] = x + uvx + uuvx; + out[1] = y + uvy + uuvy; + out[2] = z + uvz + uuvz; + return out; +} +/** + * Rotate a 3D vector around the x-axis + * @param {vec3} out The receiving vec3 + * @param {ReadonlyVec3} a The vec3 point to rotate + * @param {ReadonlyVec3} b The origin of the rotation + * @param {Number} rad The angle of rotation in radians + * @returns {vec3} out + */ + +function rotateX(out, a, b, rad) { + var p = [], + r = []; //Translate point to the origin + + p[0] = a[0] - b[0]; + p[1] = a[1] - b[1]; + p[2] = a[2] - b[2]; //perform rotation + + r[0] = p[0]; + r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad); + r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position + + out[0] = r[0] + b[0]; + out[1] = r[1] + b[1]; + out[2] = r[2] + b[2]; + return out; +} +/** + * Rotate a 3D vector around the y-axis + * @param {vec3} out The receiving vec3 + * @param {ReadonlyVec3} a The vec3 point to rotate + * @param {ReadonlyVec3} b The origin of the rotation + * @param {Number} rad The angle of rotation in radians + * @returns {vec3} out + */ + +function rotateY(out, a, b, rad) { + var p = [], + r = []; //Translate point to the origin + + p[0] = a[0] - b[0]; + p[1] = a[1] - b[1]; + p[2] = a[2] - b[2]; //perform rotation + + r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad); + r[1] = p[1]; + r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position + + out[0] = r[0] + b[0]; + out[1] = r[1] + b[1]; + out[2] = r[2] + b[2]; + return out; +} +/** + * Rotate a 3D vector around the z-axis + * @param {vec3} out The receiving vec3 + * @param {ReadonlyVec3} a The vec3 point to rotate + * @param {ReadonlyVec3} b The origin of the rotation + * @param {Number} rad The angle of rotation in radians + * @returns {vec3} out + */ + +function rotateZ(out, a, b, rad) { + var p = [], + r = []; //Translate point to the origin + + p[0] = a[0] - b[0]; + p[1] = a[1] - b[1]; + p[2] = a[2] - b[2]; //perform rotation + + r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad); + r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad); + r[2] = p[2]; //translate to correct position + + out[0] = r[0] + b[0]; + out[1] = r[1] + b[1]; + out[2] = r[2] + b[2]; + return out; +} +/** + * Get the angle between two 3D vectors + * @param {ReadonlyVec3} a The first operand + * @param {ReadonlyVec3} b The second operand + * @returns {Number} The angle in radians + */ + +function angle(a, b) { + var ax = a[0], + ay = a[1], + az = a[2], + bx = b[0], + by = b[1], + bz = b[2], + mag1 = Math.sqrt(ax * ax + ay * ay + az * az), + mag2 = Math.sqrt(bx * bx + by * by + bz * bz), + mag = mag1 * mag2, + cosine = mag && dot(a, b) / mag; + return Math.acos(Math.min(Math.max(cosine, -1), 1)); +} +/** + * Set the components of a vec3 to zero + * + * @param {vec3} out the receiving vector + * @returns {vec3} out + */ + +function zero(out) { + out[0] = 0.0; + out[1] = 0.0; + out[2] = 0.0; + return out; +} +/** + * Returns a string representation of a vector + * + * @param {ReadonlyVec3} a vector to represent as a string + * @returns {String} string representation of the vector + */ + +function str(a) { + return "vec3(" + a[0] + ", " + a[1] + ", " + a[2] + ")"; } -exports.Group = Group; -//# sourceMappingURL=Group.js.map +/** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyVec3} a The first vector. + * @param {ReadonlyVec3} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ -/***/ }), -/* 27 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; +} +/** + * Returns whether or not the vectors have approximately the same elements in the same position. + * + * @param {ReadonlyVec3} a The first vector. + * @param {ReadonlyVec3} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ -"use strict"; +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2]; + var b0 = b[0], + b1 = b[1], + b2 = b[2]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)); +} +/** + * Alias for {@link vec3.subtract} + * @function + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ShapeBase = void 0; -const gl_matrix_1 = __webpack_require__(13); -const types_1 = __webpack_require__(4); -const glme = __webpack_require__(28); -const Vec2_1 = __webpack_require__(29); -const math_1 = __webpack_require__(30); -const Adapt_1 = __webpack_require__(31); -const Utilities_1 = __webpack_require__(33); -const SceneChild_1 = __webpack_require__(25); -const tmpMatrix = gl_matrix_1.mat4.create(); -const transformMatrix = gl_matrix_1.mat4.create(); -const perspectiveMatrix = gl_matrix_1.mat4.create(); -const repetitionMatrix = gl_matrix_1.mat4.create(); -/** - * Main class for shape generation - * - * @category Core.Abstract - * @abstract - * @class ShapeBase - * @order 4 - * @extends {SceneChild} +var sub = subtract; +/** + * Alias for {@link vec3.multiply} + * @function */ -class ShapeBase extends SceneChild_1.SceneChild { - /** - * Creates an instance of ShapeBase - * - * @param {ISceneChildSettings} [settings={}] - */ - constructor(settings = {}) { - super(settings); - /** - * Flag used to determine if indexedBuffer has been generated - * - * @internal - * @ignore - */ - this.bIndexed = false; - /** - * Array used for index a vertex buffer - * only for first level scene children - * - * @internal - * @ignore - */ - this.indexedBuffer = []; - /** - * The bounding inside the scene - * - * @type {IShapeBounding} - */ - this.bounding = { - cx: 0, - cy: 0, - x: -1, - y: -1, - width: 2, - height: 2, - }; - this.props = { - distance: settings.distance, - repetitions: settings.repetitions, - rotateX: settings.rotateX, - rotateY: settings.rotateY, - rotateZ: settings.rotateZ, - skewX: settings.skewX, - skewY: settings.skewY, - squeezeX: settings.squeezeX, - squeezeY: settings.squeezeY, - displace: settings.displace, - translate: settings.translate, - scale: settings.scale, - transformOrigin: settings.transformOrigin, - perspective: settings.perspective, - perspectiveOrigin: settings.perspectiveOrigin, - }; - this.anchor = - settings.anchor && Array.isArray(settings.anchor) - ? [ - typeof settings.anchor[0] === 'number' - ? Utilities_1.clamp(-1, 1, settings.anchor[0]) * -1 - : settings.anchor[0] === 'left' - ? 1 - : settings.anchor[0] === 'right' - ? -1 - : 0, - typeof settings.anchor[1] === 'number' - ? Utilities_1.clamp(-1, 1, settings.anchor[1]) * -1 - : settings.anchor[1] === 'top' - ? 1 - : settings.anchor[1] === 'bottom' - ? -1 - : 0, - ] - : [0, 0]; - this.boundingType = - typeof settings.boundingType === 'string' - ? settings.boundingType === 'relative' - ? types_1.EBoundingType.Relative - : types_1.EBoundingType.Fixed - : settings.boundingType || types_1.EBoundingType.Fixed; - this.vertexCallback = settings.vertexCallback; - } - /** - * Check if the shape should be generated every time - * - * @returns {boolean} - */ - isStatic() { - const props = this.props; - return (typeof props.repetitions !== 'function' && - typeof props.distance !== 'function' && - typeof props.displace !== 'function' && - typeof props.scale !== 'function' && - typeof props.translate !== 'function' && - typeof props.skewX !== 'function' && - typeof props.skewY !== 'function' && - typeof props.squeezeX !== 'function' && - typeof props.squeezeY !== 'function' && - typeof props.rotateX !== 'function' && - typeof props.rotateY !== 'function' && - typeof props.rotateZ !== 'function' && - typeof props.transformOrigin !== 'function' && - typeof props.perspective !== 'function' && - typeof props.perspectiveOrigin !== 'function'); - } - /** - * Check if the indexedBuffer array needs to be recreated every time, - * this can happen when a shape generates an array of vertices different in length at each repetition - * - * @returns {boolean} - */ - isStaticIndexed() { - return typeof this.props.repetitions !== 'function'; - } - /** - * Return a prop value - * - * @param {keyof ISceneChildProps} key - * @param {PropArguments} [propArguments] - * @param {*} [defaultValue] - * @returns {*} - */ - getProp(key, propArguments, defaultValue) { - let attribute = this.props[key]; - if (typeof attribute === 'function') { - attribute = attribute(propArguments); - } - return typeof attribute === 'undefined' || Number.isNaN(attribute) ? defaultValue : attribute; - } - /** - * Set a single or multiple props - * - * @param {(keyof ISceneChildProps | ISceneChildProps)} key - * @param {*} [value] - * @param {boolean} [bClearIndexed=false] - */ - setProp(key, value, bClearIndexed = false) { - if (typeof key === 'string') { - bClearIndexed = bClearIndexed || key == 'repetitions'; - this.props[key] = value; - } - else { - bClearIndexed = bClearIndexed || 'repetitions' in key; - Object.keys(key).forEach((k) => (this.props[k] = key[k])); - } - this.clearBuffer(bClearIndexed, true); + +var mul = multiply; +/** + * Alias for {@link vec3.divide} + * @function + */ + +var div = divide; +/** + * Alias for {@link vec3.distance} + * @function + */ + +var dist = distance; +/** + * Alias for {@link vec3.squaredDistance} + * @function + */ + +var sqrDist = squaredDistance; +/** + * Alias for {@link vec3.length} + * @function + */ + +var len = length; +/** + * Alias for {@link vec3.squaredLength} + * @function + */ + +var sqrLen = squaredLength; +/** + * Perform some operation over an array of vec3s. + * + * @param {Array} a the array of vectors to iterate over + * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed + * @param {Number} offset Number of elements to skip at the beginning of the array + * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array + * @param {Function} fn Function to call for each vector in the array + * @param {Object} [arg] additional argument to pass to fn + * @returns {Array} a + * @function + */ + +var forEach = function () { + var vec = create(); + return function (a, stride, offset, count, fn, arg) { + var i, l; + + if (!stride) { + stride = 3; } - /** - * Unset buffer - * - * @param {boolean} [bClearIndexed=false] - * @param {boolean} [bPropagateToParents=false] - * @param {boolean} [bPropagateToChildren=false] - */ - clearBuffer(bClearIndexed = false, bPropagateToParents = true) { - this.buffer = undefined; - if (bClearIndexed) { - this.bIndexed = false; - this.indexedBuffer = []; - } - this.bStatic = this.isStatic(); - this.bStaticIndexed = this.isStaticIndexed(); - if (bPropagateToParents && this.scene && !this.scene.isFirstLevelChild(this)) { - const parents = this.scene.getParentsOfSceneChild(this); - parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */); - } + + if (!offset) { + offset = 0; } - /** - * Update the vertex array if the shape is not static and update the indexedBuffer if it is also not static - * - * @param {number} generateId generation id - * @param {boolean} [bDirectSceneChild=false] adjust shape of center of scene - * @param {PropArguments} [parentPropArguments] - */ - generate(generateId = 0, bDirectSceneChild = false, parentPropArguments) { - var _a, _b; - if (this.buffer && this.bStatic) { - return; - } - this.generateId = generateId; - if (!this.bStaticIndexed || !this.bIndexed) - this.indexedBuffer = []; - const propArguments = ShapeBase.getEmptyPropArguments(this, parentPropArguments); - const repetition = propArguments.repetition; - const repetitions = this.getProp('repetitions', propArguments, 1); - const repetitionType = Array.isArray(repetitions) ? types_1.ERepetitionType.Matrix : types_1.ERepetitionType.Ring; - const repetitionCount = Array.isArray(repetitions) - ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) - : repetitions; - const repetitionRowCount = Array.isArray(repetitions) ? repetitions[0] : repetitionCount; - const repetitionColCount = Array.isArray(repetitions) ? (_b = repetitions[1]) !== null && _b !== void 0 ? _b : repetitions[0] : 1; - const rowRepetition = repetition.row; - rowRepetition.count = repetitionRowCount; - const colRepetition = repetition.col; - colRepetition.count = repetitionColCount; - repetition.count = repetitionCount; - repetition.col.count = repetitionColCount; - repetition.row.count = repetitionRowCount; - repetition.type = repetitionType; - let totalBufferLength = 0; - const buffers = []; - let currentIndex = 0; - const centerMatrix = gl_matrix_1.vec2.fromValues((repetitionColCount - 1) / 2, (repetitionRowCount - 1) / 2); - const sceneAnchor = this.scene ? [this.scene.anchor[0], this.scene.anchor[1], 0] : [0, 0, 0]; - const tmpTotalShapeBounding = [undefined, undefined, undefined, undefined]; - const tmpSingleRepetitionBounding = [undefined, undefined, undefined, undefined]; - for (let currentRowRepetition = 0; currentRowRepetition < repetitionRowCount; currentRowRepetition++) { - for (let currentColRepetition = 0; currentColRepetition < repetitionColCount; currentColRepetition++, currentIndex++) { - repetition.index = currentIndex + 1; - repetition.offset = repetitionCount > 1 ? currentIndex / (repetitionCount - 1) : 1; - repetition.angle = repetitionType === types_1.ERepetitionType.Ring ? (math_1.PI2 / repetitionCount) * currentIndex : 0; - colRepetition.index = currentColRepetition + 1; - colRepetition.offset = repetitionColCount > 1 ? currentColRepetition / (repetitionColCount - 1) : 1; - rowRepetition.index = currentRowRepetition + 1; - rowRepetition.offset = repetitionRowCount > 1 ? currentRowRepetition / (repetitionRowCount - 1) : 1; - // Generate primitives buffer recursively - const buffer = this.generateBuffer(generateId, propArguments); - const bufferLength = buffer.length; - const bounding = this.getShapeBounding(); - buffers[currentIndex] = new Float32Array(bufferLength); - totalBufferLength += bufferLength; - { - const distance = glme.toVec2(this.getProp('distance', propArguments, glme.VEC2_ZERO)); - const displace = this.getProp('displace', propArguments, 0); - const scale = glme.toVec3(this.getProp('scale', propArguments, glme.VEC2_ONE), 1); - const translate = glme.toVec3(this.getProp('translate', propArguments, glme.VEC2_ZERO), 0); - const skewX = this.getProp('skewX', propArguments, 0); - const skewY = this.getProp('skewY', propArguments, 0); - const squeezeX = this.getProp('squeezeX', propArguments, 0); - const squeezeY = this.getProp('squeezeY', propArguments, 0); - const rotateX = this.getProp('rotateX', propArguments, 0); - const rotateY = this.getProp('rotateY', propArguments, 0); - const rotateZ = this.getProp('rotateZ', propArguments, 0); - const perspective = Utilities_1.clamp(0, 1, this.getProp('perspective', propArguments, 0)); - const perspectiveOrigin = glme.toVec3(this.getProp('perspectiveOrigin', propArguments, glme.VEC2_ZERO), 0); - const transformOrigin = glme.toVec3(this.getProp('transformOrigin', propArguments, glme.VEC2_ZERO), 0); - let offset; - switch (repetitionType) { - case types_1.ERepetitionType.Ring: - offset = gl_matrix_1.vec3.fromValues(distance[0], 0, 0); - gl_matrix_1.vec3.rotateZ(offset, offset, glme.VEC3_ZERO, repetition.angle + displace); - break; - case types_1.ERepetitionType.Matrix: - offset = gl_matrix_1.vec3.fromValues(distance[1] * (currentColRepetition - centerMatrix[0]), distance[0] * (currentRowRepetition - centerMatrix[1]), 0); - break; - } - const perspectiveSize = perspective > 0 ? Math.max(bounding.width, bounding.height) / 2 : 1; - const perspectiveValue = perspective > 0 ? perspectiveSize + (1 - perspective) * (perspectiveSize * 10) : 0; - const bTransformOrigin = (this.boundingType === types_1.EBoundingType.Relative ? bounding.cx !== 0 || bounding.cy !== 0 : true) || - perspective !== 0 || - transformOrigin[0] !== 0 || - transformOrigin[1] !== 0; - const bPerspectiveOrigin = perspectiveOrigin[0] !== 0 || perspectiveOrigin[1] !== 0; - if (bTransformOrigin) { - if (this.boundingType === types_1.EBoundingType.Relative) { - transformOrigin[0] = transformOrigin[0] * (bounding.width / 2) + bounding.cx; - transformOrigin[1] = transformOrigin[1] * (bounding.height / 2) + bounding.cy; - } - else { - transformOrigin[0] *= bounding.width / 2; - transformOrigin[1] *= bounding.height / 2; - } - transformOrigin[2] = perspectiveValue; - } - /** - * Create Matrices - */ - { - /** - * Create Transformation matrix - */ - gl_matrix_1.mat4.identity(transformMatrix); - bTransformOrigin && gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, transformOrigin); - if (translate[0] !== 0 || translate[1] !== 0) - gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, translate); - if (skewX !== 0 || skewY !== 0) { - glme.fromSkew(tmpMatrix, [skewX, skewY]); - gl_matrix_1.mat4.multiply(transformMatrix, transformMatrix, tmpMatrix); - } - rotateX !== 0 && gl_matrix_1.mat4.rotateX(transformMatrix, transformMatrix, rotateX); - rotateY !== 0 && gl_matrix_1.mat4.rotateY(transformMatrix, transformMatrix, rotateY); - rotateZ !== 0 && gl_matrix_1.mat4.rotateZ(transformMatrix, transformMatrix, rotateZ); - if (scale[0] !== 1 || scale[1] !== 1) - gl_matrix_1.mat4.scale(transformMatrix, transformMatrix, scale); - bTransformOrigin && - gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, gl_matrix_1.vec3.scale(transformOrigin, transformOrigin, -1)); - /** - * Create Perspective matrix - */ - if (perspectiveValue > 0) { - if (bPerspectiveOrigin) { - if (this.boundingType === types_1.EBoundingType.Relative) { - perspectiveOrigin[0] = perspectiveOrigin[0] * (bounding.width / 2) + bounding.cx; - perspectiveOrigin[1] = perspectiveOrigin[1] * (bounding.height / 2) + bounding.cy; - } - else { - perspectiveOrigin[0] *= bounding.width / 2; - perspectiveOrigin[1] *= bounding.height / 2; - } - perspectiveOrigin[2] = 0; - } - gl_matrix_1.mat4.perspective(perspectiveMatrix, -Math.PI / 2, 1, 0, Infinity); - } - /** - * Create Repetition matrix - */ - gl_matrix_1.mat4.identity(repetitionMatrix); - gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, offset); - if (bDirectSceneChild) { - gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, sceneAnchor); - } - /** - * Apply anchor - */ - const shapeAnchor = [this.anchor[0] * (bounding.width / 2), this.anchor[1] * (bounding.height / 2), 0]; - gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, shapeAnchor); - if (repetitionType === types_1.ERepetitionType.Ring) - gl_matrix_1.mat4.rotateZ(repetitionMatrix, repetitionMatrix, repetition.angle + displace); - } - Adapt_1.Bounding.clear(tmpSingleRepetitionBounding); - // Apply matrices on vertex - for (let bufferIndex = 0; bufferIndex < bufferLength; bufferIndex += 2) { - const vertex = [buffer[bufferIndex], buffer[bufferIndex + 1], perspectiveValue]; - { - // Apply squeeze, can be insert into transformMatrix? - squeezeX !== 0 && Vec2_1.default.squeezeX(vertex, squeezeX); - squeezeY !== 0 && Vec2_1.default.squeezeY(vertex, squeezeY); - // Apply transforms - gl_matrix_1.vec3.transformMat4(vertex, vertex, transformMatrix); - // Apply perspective - if (perspectiveValue > 0) { - bPerspectiveOrigin && gl_matrix_1.vec3.add(vertex, vertex, perspectiveOrigin); - gl_matrix_1.vec3.transformMat4(vertex, vertex, perspectiveMatrix); - gl_matrix_1.vec3.scale(vertex, vertex, perspectiveValue); - bPerspectiveOrigin && gl_matrix_1.vec3.sub(vertex, vertex, perspectiveOrigin); - } - // apply repetition matrix - gl_matrix_1.vec3.transformMat4(vertex, vertex, repetitionMatrix); - // custom vertex manipulation - if (typeof this.vertexCallback !== 'undefined') { - const index = bufferIndex / 2; - const count = bufferLength / 2; - const vertexRepetition = { - index: index + 1, - count, - offset: count > 1 ? index / (count - 1) : 1, - }; - this.vertexCallback(vertex, vertexRepetition, propArguments); - } - } - buffers[currentIndex][bufferIndex] = vertex[0]; - buffers[currentIndex][bufferIndex + 1] = vertex[1]; - Adapt_1.Bounding.add(tmpSingleRepetitionBounding, vertex[0], vertex[1]); - Adapt_1.Bounding.add(tmpTotalShapeBounding, vertex[0], vertex[1]); - } - } - // Bounding.sum(tmpTotalShapeBounding, tmpSingleRepetitionBounding) - // After buffer creation, add a frame into indexedBuffer if not static or update bounding - const singleRepetitionBounding = { cx: 0, cy: 0, x: -1, y: -1, width: 2, height: 2 }; - Adapt_1.Bounding.bind(singleRepetitionBounding, tmpSingleRepetitionBounding); - if (!this.bStaticIndexed || !this.bIndexed) { - this.addIndex(bufferLength, repetition, singleRepetitionBounding); - } - } - } - Adapt_1.Bounding.bind(this.bounding, tmpTotalShapeBounding); - this.buffer = new Float32Array(totalBufferLength); - for (let i = 0, offset = 0, len = buffers.length; i < len; offset += buffers[i].length, i++) - this.buffer.set(buffers[i], offset); - this.bIndexed = true; + + if (count) { + l = Math.min(count * stride + offset, a.length); + } else { + l = a.length; + } + + for (i = offset; i < l; i += stride) { + vec[0] = a[i]; + vec[1] = a[i + 1]; + vec[2] = a[i + 2]; + fn(vec, vec, arg); + a[i] = vec[0]; + a[i + 1] = vec[1]; + a[i + 2] = vec[2]; + } + + return a; + }; +}(); + +/***/ }), +/* 17 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "fromRotationTranslationValues": () => (/* binding */ fromRotationTranslationValues), +/* harmony export */ "fromRotationTranslation": () => (/* binding */ fromRotationTranslation), +/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), +/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), +/* harmony export */ "fromMat4": () => (/* binding */ fromMat4), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "getReal": () => (/* binding */ getReal), +/* harmony export */ "getDual": () => (/* binding */ getDual), +/* harmony export */ "setReal": () => (/* binding */ setReal), +/* harmony export */ "setDual": () => (/* binding */ setDual), +/* harmony export */ "getTranslation": () => (/* binding */ getTranslation), +/* harmony export */ "translate": () => (/* binding */ translate), +/* harmony export */ "rotateX": () => (/* binding */ rotateX), +/* harmony export */ "rotateY": () => (/* binding */ rotateY), +/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), +/* harmony export */ "rotateByQuatAppend": () => (/* binding */ rotateByQuatAppend), +/* harmony export */ "rotateByQuatPrepend": () => (/* binding */ rotateByQuatPrepend), +/* harmony export */ "rotateAroundAxis": () => (/* binding */ rotateAroundAxis), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "dot": () => (/* binding */ dot), +/* harmony export */ "lerp": () => (/* binding */ lerp), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "conjugate": () => (/* binding */ conjugate), +/* harmony export */ "length": () => (/* binding */ length), +/* harmony export */ "len": () => (/* binding */ len), +/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), +/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), +/* harmony export */ "normalize": () => (/* binding */ normalize), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); +/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14); +/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13); + + + +/** + * Dual Quaternion
+ * Format: [real, dual]
+ * Quaternion format: XYZW
+ * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
+ * @module quat2 + */ + +/** + * Creates a new identity dual quat + * + * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation] + */ + +function create() { + var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + dq[0] = 0; + dq[1] = 0; + dq[2] = 0; + dq[4] = 0; + dq[5] = 0; + dq[6] = 0; + dq[7] = 0; + } + + dq[3] = 1; + return dq; +} +/** + * Creates a new quat initialized with values from an existing quaternion + * + * @param {ReadonlyQuat2} a dual quaternion to clone + * @returns {quat2} new dual quaternion + * @function + */ + +function clone(a) { + var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); + dq[0] = a[0]; + dq[1] = a[1]; + dq[2] = a[2]; + dq[3] = a[3]; + dq[4] = a[4]; + dq[5] = a[5]; + dq[6] = a[6]; + dq[7] = a[7]; + return dq; +} +/** + * Creates a new dual quat initialized with the given values + * + * @param {Number} x1 X component + * @param {Number} y1 Y component + * @param {Number} z1 Z component + * @param {Number} w1 W component + * @param {Number} x2 X component + * @param {Number} y2 Y component + * @param {Number} z2 Z component + * @param {Number} w2 W component + * @returns {quat2} new dual quaternion + * @function + */ + +function fromValues(x1, y1, z1, w1, x2, y2, z2, w2) { + var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); + dq[0] = x1; + dq[1] = y1; + dq[2] = z1; + dq[3] = w1; + dq[4] = x2; + dq[5] = y2; + dq[6] = z2; + dq[7] = w2; + return dq; +} +/** + * Creates a new dual quat from the given values (quat and translation) + * + * @param {Number} x1 X component + * @param {Number} y1 Y component + * @param {Number} z1 Z component + * @param {Number} w1 W component + * @param {Number} x2 X component (translation) + * @param {Number} y2 Y component (translation) + * @param {Number} z2 Z component (translation) + * @returns {quat2} new dual quaternion + * @function + */ + +function fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) { + var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); + dq[0] = x1; + dq[1] = y1; + dq[2] = z1; + dq[3] = w1; + var ax = x2 * 0.5, + ay = y2 * 0.5, + az = z2 * 0.5; + dq[4] = ax * w1 + ay * z1 - az * y1; + dq[5] = ay * w1 + az * x1 - ax * z1; + dq[6] = az * w1 + ax * y1 - ay * x1; + dq[7] = -ax * x1 - ay * y1 - az * z1; + return dq; +} +/** + * Creates a dual quat from a quaternion and a translation + * + * @param {ReadonlyQuat2} dual quaternion receiving operation result + * @param {ReadonlyQuat} q a normalized quaternion + * @param {ReadonlyVec3} t tranlation vector + * @returns {quat2} dual quaternion receiving operation result + * @function + */ + +function fromRotationTranslation(out, q, t) { + var ax = t[0] * 0.5, + ay = t[1] * 0.5, + az = t[2] * 0.5, + bx = q[0], + by = q[1], + bz = q[2], + bw = q[3]; + out[0] = bx; + out[1] = by; + out[2] = bz; + out[3] = bw; + out[4] = ax * bw + ay * bz - az * by; + out[5] = ay * bw + az * bx - ax * bz; + out[6] = az * bw + ax * by - ay * bx; + out[7] = -ax * bx - ay * by - az * bz; + return out; +} +/** + * Creates a dual quat from a translation + * + * @param {ReadonlyQuat2} dual quaternion receiving operation result + * @param {ReadonlyVec3} t translation vector + * @returns {quat2} dual quaternion receiving operation result + * @function + */ + +function fromTranslation(out, t) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = t[0] * 0.5; + out[5] = t[1] * 0.5; + out[6] = t[2] * 0.5; + out[7] = 0; + return out; +} +/** + * Creates a dual quat from a quaternion + * + * @param {ReadonlyQuat2} dual quaternion receiving operation result + * @param {ReadonlyQuat} q the quaternion + * @returns {quat2} dual quaternion receiving operation result + * @function + */ + +function fromRotation(out, q) { + out[0] = q[0]; + out[1] = q[1]; + out[2] = q[2]; + out[3] = q[3]; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; +} +/** + * Creates a new dual quat from a matrix (4x4) + * + * @param {quat2} out the dual quaternion + * @param {ReadonlyMat4} a the matrix + * @returns {quat2} dual quat receiving operation result + * @function + */ + +function fromMat4(out, a) { + //TODO Optimize this + var outer = _quat_js__WEBPACK_IMPORTED_MODULE_1__.create(); + _mat4_js__WEBPACK_IMPORTED_MODULE_2__.getRotation(outer, a); + var t = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + _mat4_js__WEBPACK_IMPORTED_MODULE_2__.getTranslation(t, a); + fromRotationTranslation(out, outer, t); + return out; +} +/** + * Copy the values from one dual quat to another + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the source dual quaternion + * @returns {quat2} out + * @function + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + return out; +} +/** + * Set a dual quat to the identity dual quaternion + * + * @param {quat2} out the receiving quaternion + * @returns {quat2} out + */ + +function identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; +} +/** + * Set the components of a dual quat to the given values + * + * @param {quat2} out the receiving quaternion + * @param {Number} x1 X component + * @param {Number} y1 Y component + * @param {Number} z1 Z component + * @param {Number} w1 W component + * @param {Number} x2 X component + * @param {Number} y2 Y component + * @param {Number} z2 Z component + * @param {Number} w2 W component + * @returns {quat2} out + * @function + */ + +function set(out, x1, y1, z1, w1, x2, y2, z2, w2) { + out[0] = x1; + out[1] = y1; + out[2] = z1; + out[3] = w1; + out[4] = x2; + out[5] = y2; + out[6] = z2; + out[7] = w2; + return out; +} +/** + * Gets the real part of a dual quat + * @param {quat} out real part + * @param {ReadonlyQuat2} a Dual Quaternion + * @return {quat} real part + */ + +var getReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__.copy; +/** + * Gets the dual part of a dual quat + * @param {quat} out dual part + * @param {ReadonlyQuat2} a Dual Quaternion + * @return {quat} dual part + */ + +function getDual(out, a) { + out[0] = a[4]; + out[1] = a[5]; + out[2] = a[6]; + out[3] = a[7]; + return out; +} +/** + * Set the real component of a dual quat to the given quaternion + * + * @param {quat2} out the receiving quaternion + * @param {ReadonlyQuat} q a quaternion representing the real part + * @returns {quat2} out + * @function + */ + +var setReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__.copy; +/** + * Set the dual component of a dual quat to the given quaternion + * + * @param {quat2} out the receiving quaternion + * @param {ReadonlyQuat} q a quaternion representing the dual part + * @returns {quat2} out + * @function + */ + +function setDual(out, q) { + out[4] = q[0]; + out[5] = q[1]; + out[6] = q[2]; + out[7] = q[3]; + return out; +} +/** + * Gets the translation of a normalized dual quat + * @param {vec3} out translation + * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed + * @return {vec3} translation + */ + +function getTranslation(out, a) { + var ax = a[4], + ay = a[5], + az = a[6], + aw = a[7], + bx = -a[0], + by = -a[1], + bz = -a[2], + bw = a[3]; + out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + return out; +} +/** + * Translates a dual quat by the given vector + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to translate + * @param {ReadonlyVec3} v vector to translate by + * @returns {quat2} out + */ + +function translate(out, a, v) { + var ax1 = a[0], + ay1 = a[1], + az1 = a[2], + aw1 = a[3], + bx1 = v[0] * 0.5, + by1 = v[1] * 0.5, + bz1 = v[2] * 0.5, + ax2 = a[4], + ay2 = a[5], + az2 = a[6], + aw2 = a[7]; + out[0] = ax1; + out[1] = ay1; + out[2] = az1; + out[3] = aw1; + out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2; + out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2; + out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2; + out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2; + return out; +} +/** + * Rotates a dual quat around the X axis + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @param {number} rad how far should the rotation be + * @returns {quat2} out + */ + +function rotateX(out, a, rad) { + var bx = -a[0], + by = -a[1], + bz = -a[2], + bw = a[3], + ax = a[4], + ay = a[5], + az = a[6], + aw = a[7], + ax1 = ax * bw + aw * bx + ay * bz - az * by, + ay1 = ay * bw + aw * by + az * bx - ax * bz, + az1 = az * bw + aw * bz + ax * by - ay * bx, + aw1 = aw * bw - ax * bx - ay * by - az * bz; + _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateX(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; +} +/** + * Rotates a dual quat around the Y axis + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @param {number} rad how far should the rotation be + * @returns {quat2} out + */ + +function rotateY(out, a, rad) { + var bx = -a[0], + by = -a[1], + bz = -a[2], + bw = a[3], + ax = a[4], + ay = a[5], + az = a[6], + aw = a[7], + ax1 = ax * bw + aw * bx + ay * bz - az * by, + ay1 = ay * bw + aw * by + az * bx - ax * bz, + az1 = az * bw + aw * bz + ax * by - ay * bx, + aw1 = aw * bw - ax * bx - ay * by - az * bz; + _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateY(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; +} +/** + * Rotates a dual quat around the Z axis + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @param {number} rad how far should the rotation be + * @returns {quat2} out + */ + +function rotateZ(out, a, rad) { + var bx = -a[0], + by = -a[1], + bz = -a[2], + bw = a[3], + ax = a[4], + ay = a[5], + az = a[6], + aw = a[7], + ax1 = ax * bw + aw * bx + ay * bz - az * by, + ay1 = ay * bw + aw * by + az * bx - ax * bz, + az1 = az * bw + aw * bz + ax * by - ay * bx, + aw1 = aw * bw - ax * bx - ay * by - az * bz; + _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateZ(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; +} +/** + * Rotates a dual quat by a given quaternion (a * q) + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @param {ReadonlyQuat} q quaternion to rotate by + * @returns {quat2} out + */ + +function rotateByQuatAppend(out, a, q) { + var qx = q[0], + qy = q[1], + qz = q[2], + qw = q[3], + ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + out[0] = ax * qw + aw * qx + ay * qz - az * qy; + out[1] = ay * qw + aw * qy + az * qx - ax * qz; + out[2] = az * qw + aw * qz + ax * qy - ay * qx; + out[3] = aw * qw - ax * qx - ay * qy - az * qz; + ax = a[4]; + ay = a[5]; + az = a[6]; + aw = a[7]; + out[4] = ax * qw + aw * qx + ay * qz - az * qy; + out[5] = ay * qw + aw * qy + az * qx - ax * qz; + out[6] = az * qw + aw * qz + ax * qy - ay * qx; + out[7] = aw * qw - ax * qx - ay * qy - az * qz; + return out; +} +/** + * Rotates a dual quat by a given quaternion (q * a) + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat} q quaternion to rotate by + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @returns {quat2} out + */ + +function rotateByQuatPrepend(out, q, a) { + var qx = q[0], + qy = q[1], + qz = q[2], + qw = q[3], + bx = a[0], + by = a[1], + bz = a[2], + bw = a[3]; + out[0] = qx * bw + qw * bx + qy * bz - qz * by; + out[1] = qy * bw + qw * by + qz * bx - qx * bz; + out[2] = qz * bw + qw * bz + qx * by - qy * bx; + out[3] = qw * bw - qx * bx - qy * by - qz * bz; + bx = a[4]; + by = a[5]; + bz = a[6]; + bw = a[7]; + out[4] = qx * bw + qw * bx + qy * bz - qz * by; + out[5] = qy * bw + qw * by + qz * bx - qx * bz; + out[6] = qz * bw + qw * bz + qx * by - qy * bx; + out[7] = qw * bw - qx * bx - qy * by - qz * bz; + return out; +} +/** + * Rotates a dual quat around a given axis. Does the normalisation automatically + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @param {ReadonlyVec3} axis the axis to rotate around + * @param {Number} rad how far the rotation should be + * @returns {quat2} out + */ + +function rotateAroundAxis(out, a, axis, rad) { + //Special case for rad = 0 + if (Math.abs(rad) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + return copy(out, a); + } + + var axisLength = Math.hypot(axis[0], axis[1], axis[2]); + rad = rad * 0.5; + var s = Math.sin(rad); + var bx = s * axis[0] / axisLength; + var by = s * axis[1] / axisLength; + var bz = s * axis[2] / axisLength; + var bw = Math.cos(rad); + var ax1 = a[0], + ay1 = a[1], + az1 = a[2], + aw1 = a[3]; + out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + var ax = a[4], + ay = a[5], + az = a[6], + aw = a[7]; + out[4] = ax * bw + aw * bx + ay * bz - az * by; + out[5] = ay * bw + aw * by + az * bx - ax * bz; + out[6] = az * bw + aw * bz + ax * by - ay * bx; + out[7] = aw * bw - ax * bx - ay * by - az * bz; + return out; +} +/** + * Adds two dual quat's + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the first operand + * @param {ReadonlyQuat2} b the second operand + * @returns {quat2} out + * @function + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + return out; +} +/** + * Multiplies two dual quat's + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the first operand + * @param {ReadonlyQuat2} b the second operand + * @returns {quat2} out + */ + +function multiply(out, a, b) { + var ax0 = a[0], + ay0 = a[1], + az0 = a[2], + aw0 = a[3], + bx1 = b[4], + by1 = b[5], + bz1 = b[6], + bw1 = b[7], + ax1 = a[4], + ay1 = a[5], + az1 = a[6], + aw1 = a[7], + bx0 = b[0], + by0 = b[1], + bz0 = b[2], + bw0 = b[3]; + out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0; + out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0; + out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0; + out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0; + out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0; + out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0; + out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0; + out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0; + return out; +} +/** + * Alias for {@link quat2.multiply} + * @function + */ + +var mul = multiply; +/** + * Scales a dual quat by a scalar number + * + * @param {quat2} out the receiving dual quat + * @param {ReadonlyQuat2} a the dual quat to scale + * @param {Number} b amount to scale the dual quat by + * @returns {quat2} out + * @function + */ + +function scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + return out; +} +/** + * Calculates the dot product of two dual quat's (The dot product of the real parts) + * + * @param {ReadonlyQuat2} a the first operand + * @param {ReadonlyQuat2} b the second operand + * @returns {Number} dot product of a and b + * @function + */ + +var dot = _quat_js__WEBPACK_IMPORTED_MODULE_1__.dot; +/** + * Performs a linear interpolation between two dual quats's + * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5) + * + * @param {quat2} out the receiving dual quat + * @param {ReadonlyQuat2} a the first operand + * @param {ReadonlyQuat2} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {quat2} out + */ + +function lerp(out, a, b, t) { + var mt = 1 - t; + if (dot(a, b) < 0) t = -t; + out[0] = a[0] * mt + b[0] * t; + out[1] = a[1] * mt + b[1] * t; + out[2] = a[2] * mt + b[2] * t; + out[3] = a[3] * mt + b[3] * t; + out[4] = a[4] * mt + b[4] * t; + out[5] = a[5] * mt + b[5] * t; + out[6] = a[6] * mt + b[6] * t; + out[7] = a[7] * mt + b[7] * t; + return out; +} +/** + * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a dual quat to calculate inverse of + * @returns {quat2} out + */ + +function invert(out, a) { + var sqlen = squaredLength(a); + out[0] = -a[0] / sqlen; + out[1] = -a[1] / sqlen; + out[2] = -a[2] / sqlen; + out[3] = a[3] / sqlen; + out[4] = -a[4] / sqlen; + out[5] = -a[5] / sqlen; + out[6] = -a[6] / sqlen; + out[7] = a[7] / sqlen; + return out; +} +/** + * Calculates the conjugate of a dual quat + * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result. + * + * @param {quat2} out the receiving quaternion + * @param {ReadonlyQuat2} a quat to calculate conjugate of + * @returns {quat2} out + */ + +function conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + out[4] = -a[4]; + out[5] = -a[5]; + out[6] = -a[6]; + out[7] = a[7]; + return out; +} +/** + * Calculates the length of a dual quat + * + * @param {ReadonlyQuat2} a dual quat to calculate length of + * @returns {Number} length of a + * @function + */ + +var length = _quat_js__WEBPACK_IMPORTED_MODULE_1__.length; +/** + * Alias for {@link quat2.length} + * @function + */ + +var len = length; +/** + * Calculates the squared length of a dual quat + * + * @param {ReadonlyQuat2} a dual quat to calculate squared length of + * @returns {Number} squared length of a + * @function + */ + +var squaredLength = _quat_js__WEBPACK_IMPORTED_MODULE_1__.squaredLength; +/** + * Alias for {@link quat2.squaredLength} + * @function + */ + +var sqrLen = squaredLength; +/** + * Normalize a dual quat + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a dual quaternion to normalize + * @returns {quat2} out + * @function + */ + +function normalize(out, a) { + var magnitude = squaredLength(a); + + if (magnitude > 0) { + magnitude = Math.sqrt(magnitude); + var a0 = a[0] / magnitude; + var a1 = a[1] / magnitude; + var a2 = a[2] / magnitude; + var a3 = a[3] / magnitude; + var b0 = a[4]; + var b1 = a[5]; + var b2 = a[6]; + var b3 = a[7]; + var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = (b0 - a0 * a_dot_b) / magnitude; + out[5] = (b1 - a1 * a_dot_b) / magnitude; + out[6] = (b2 - a2 * a_dot_b) / magnitude; + out[7] = (b3 - a3 * a_dot_b) / magnitude; + } + + return out; +} +/** + * Returns a string representation of a dual quatenion + * + * @param {ReadonlyQuat2} a dual quaternion to represent as a string + * @returns {String} string representation of the dual quat + */ + +function str(a) { + return "quat2(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ")"; +} +/** + * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyQuat2} a the first dual quaternion. + * @param {ReadonlyQuat2} b the second dual quaternion. + * @returns {Boolean} true if the dual quaternions are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7]; +} +/** + * Returns whether or not the dual quaternions have approximately the same elements in the same position. + * + * @param {ReadonlyQuat2} a the first dual quat. + * @param {ReadonlyQuat2} b the second dual quat. + * @returns {Boolean} true if the dual quats are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5], + a6 = a[6], + a7 = a[7]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3], + b4 = b[4], + b5 = b[5], + b6 = b[6], + b7 = b[7]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)); +} + +/***/ }), +/* 18 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "divide": () => (/* binding */ divide), +/* harmony export */ "ceil": () => (/* binding */ ceil), +/* harmony export */ "floor": () => (/* binding */ floor), +/* harmony export */ "min": () => (/* binding */ min), +/* harmony export */ "max": () => (/* binding */ max), +/* harmony export */ "round": () => (/* binding */ round), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), +/* harmony export */ "distance": () => (/* binding */ distance), +/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), +/* harmony export */ "length": () => (/* binding */ length), +/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), +/* harmony export */ "negate": () => (/* binding */ negate), +/* harmony export */ "inverse": () => (/* binding */ inverse), +/* harmony export */ "normalize": () => (/* binding */ normalize), +/* harmony export */ "dot": () => (/* binding */ dot), +/* harmony export */ "cross": () => (/* binding */ cross), +/* harmony export */ "lerp": () => (/* binding */ lerp), +/* harmony export */ "random": () => (/* binding */ random), +/* harmony export */ "transformMat2": () => (/* binding */ transformMat2), +/* harmony export */ "transformMat2d": () => (/* binding */ transformMat2d), +/* harmony export */ "transformMat3": () => (/* binding */ transformMat3), +/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), +/* harmony export */ "rotate": () => (/* binding */ rotate), +/* harmony export */ "angle": () => (/* binding */ angle), +/* harmony export */ "zero": () => (/* binding */ zero), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "len": () => (/* binding */ len), +/* harmony export */ "sub": () => (/* binding */ sub), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "div": () => (/* binding */ div), +/* harmony export */ "dist": () => (/* binding */ dist), +/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), +/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), +/* harmony export */ "forEach": () => (/* binding */ forEach) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); + +/** + * 2 Dimensional Vector + * @module vec2 + */ + +/** + * Creates a new, empty vec2 + * + * @returns {vec2} a new 2D vector + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[0] = 0; + out[1] = 0; + } + + return out; +} +/** + * Creates a new vec2 initialized with values from an existing vector + * + * @param {ReadonlyVec2} a vector to clone + * @returns {vec2} a new 2D vector + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); + out[0] = a[0]; + out[1] = a[1]; + return out; +} +/** + * Creates a new vec2 initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @returns {vec2} a new 2D vector + */ + +function fromValues(x, y) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); + out[0] = x; + out[1] = y; + return out; +} +/** + * Copy the values from one vec2 to another + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the source vector + * @returns {vec2} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + return out; +} +/** + * Set the components of a vec2 to the given values + * + * @param {vec2} out the receiving vector + * @param {Number} x X component + * @param {Number} y Y component + * @returns {vec2} out + */ + +function set(out, x, y) { + out[0] = x; + out[1] = y; + return out; +} +/** + * Adds two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + return out; +} +/** + * Subtracts vector b from vector a + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + return out; +} +/** + * Multiplies two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + return out; +} +/** + * Divides two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + return out; +} +/** + * Math.ceil the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to ceil + * @returns {vec2} out + */ + +function ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + return out; +} +/** + * Math.floor the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to floor + * @returns {vec2} out + */ + +function floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + return out; +} +/** + * Returns the minimum of two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + return out; +} +/** + * Returns the maximum of two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + return out; +} +/** + * Math.round the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to round + * @returns {vec2} out + */ + +function round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + return out; +} +/** + * Scales a vec2 by a scalar number + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {vec2} out + */ + +function scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + return out; +} +/** + * Adds two vec2's after scaling the second operand by a scalar value + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @param {Number} scale the amount to scale b by before adding + * @returns {vec2} out + */ + +function scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + return out; +} +/** + * Calculates the euclidian distance between two vec2's + * + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {Number} distance between a and b + */ + +function distance(a, b) { + var x = b[0] - a[0], + y = b[1] - a[1]; + return Math.hypot(x, y); +} +/** + * Calculates the squared euclidian distance between two vec2's + * + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {Number} squared distance between a and b + */ + +function squaredDistance(a, b) { + var x = b[0] - a[0], + y = b[1] - a[1]; + return x * x + y * y; +} +/** + * Calculates the length of a vec2 + * + * @param {ReadonlyVec2} a vector to calculate length of + * @returns {Number} length of a + */ + +function length(a) { + var x = a[0], + y = a[1]; + return Math.hypot(x, y); +} +/** + * Calculates the squared length of a vec2 + * + * @param {ReadonlyVec2} a vector to calculate squared length of + * @returns {Number} squared length of a + */ + +function squaredLength(a) { + var x = a[0], + y = a[1]; + return x * x + y * y; +} +/** + * Negates the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to negate + * @returns {vec2} out + */ + +function negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + return out; +} +/** + * Returns the inverse of the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to invert + * @returns {vec2} out + */ + +function inverse(out, a) { + out[0] = 1.0 / a[0]; + out[1] = 1.0 / a[1]; + return out; +} +/** + * Normalize a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to normalize + * @returns {vec2} out + */ + +function normalize(out, a) { + var x = a[0], + y = a[1]; + var len = x * x + y * y; + + if (len > 0) { + //TODO: evaluate use of glm_invsqrt here? + len = 1 / Math.sqrt(len); + } + + out[0] = a[0] * len; + out[1] = a[1] * len; + return out; +} +/** + * Calculates the dot product of two vec2's + * + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {Number} dot product of a and b + */ + +function dot(a, b) { + return a[0] * b[0] + a[1] * b[1]; +} +/** + * Computes the cross product of two vec2's + * Note that the cross product must by definition produce a 3D vector + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec3} out + */ + +function cross(out, a, b) { + var z = a[0] * b[1] - a[1] * b[0]; + out[0] = out[1] = 0; + out[2] = z; + return out; +} +/** + * Performs a linear interpolation between two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {vec2} out + */ + +function lerp(out, a, b, t) { + var ax = a[0], + ay = a[1]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + return out; +} +/** + * Generates a random vector with the given scale + * + * @param {vec2} out the receiving vector + * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns {vec2} out + */ + +function random(out, scale) { + scale = scale || 1.0; + var r = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 * Math.PI; + out[0] = Math.cos(r) * scale; + out[1] = Math.sin(r) * scale; + return out; +} +/** + * Transforms the vec2 with a mat2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the vector to transform + * @param {ReadonlyMat2} m matrix to transform with + * @returns {vec2} out + */ + +function transformMat2(out, a, m) { + var x = a[0], + y = a[1]; + out[0] = m[0] * x + m[2] * y; + out[1] = m[1] * x + m[3] * y; + return out; +} +/** + * Transforms the vec2 with a mat2d + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the vector to transform + * @param {ReadonlyMat2d} m matrix to transform with + * @returns {vec2} out + */ + +function transformMat2d(out, a, m) { + var x = a[0], + y = a[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; +} +/** + * Transforms the vec2 with a mat3 + * 3rd vector component is implicitly '1' + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the vector to transform + * @param {ReadonlyMat3} m matrix to transform with + * @returns {vec2} out + */ + +function transformMat3(out, a, m) { + var x = a[0], + y = a[1]; + out[0] = m[0] * x + m[3] * y + m[6]; + out[1] = m[1] * x + m[4] * y + m[7]; + return out; +} +/** + * Transforms the vec2 with a mat4 + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the vector to transform + * @param {ReadonlyMat4} m matrix to transform with + * @returns {vec2} out + */ + +function transformMat4(out, a, m) { + var x = a[0]; + var y = a[1]; + out[0] = m[0] * x + m[4] * y + m[12]; + out[1] = m[1] * x + m[5] * y + m[13]; + return out; +} +/** + * Rotate a 2D vector + * @param {vec2} out The receiving vec2 + * @param {ReadonlyVec2} a The vec2 point to rotate + * @param {ReadonlyVec2} b The origin of the rotation + * @param {Number} rad The angle of rotation in radians + * @returns {vec2} out + */ + +function rotate(out, a, b, rad) { + //Translate point to the origin + var p0 = a[0] - b[0], + p1 = a[1] - b[1], + sinC = Math.sin(rad), + cosC = Math.cos(rad); //perform rotation and translate to correct position + + out[0] = p0 * cosC - p1 * sinC + b[0]; + out[1] = p0 * sinC + p1 * cosC + b[1]; + return out; +} +/** + * Get the angle between two 2D vectors + * @param {ReadonlyVec2} a The first operand + * @param {ReadonlyVec2} b The second operand + * @returns {Number} The angle in radians + */ + +function angle(a, b) { + var x1 = a[0], + y1 = a[1], + x2 = b[0], + y2 = b[1], + // mag is the product of the magnitudes of a and b + mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2), + // mag &&.. short circuits if mag == 0 + cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1 + + return Math.acos(Math.min(Math.max(cosine, -1), 1)); +} +/** + * Set the components of a vec2 to zero + * + * @param {vec2} out the receiving vector + * @returns {vec2} out + */ + +function zero(out) { + out[0] = 0.0; + out[1] = 0.0; + return out; +} +/** + * Returns a string representation of a vector + * + * @param {ReadonlyVec2} a vector to represent as a string + * @returns {String} string representation of the vector + */ + +function str(a) { + return "vec2(" + a[0] + ", " + a[1] + ")"; +} +/** + * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===) + * + * @param {ReadonlyVec2} a The first vector. + * @param {ReadonlyVec2} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1]; +} +/** + * Returns whether or not the vectors have approximately the same elements in the same position. + * + * @param {ReadonlyVec2} a The first vector. + * @param {ReadonlyVec2} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1]; + var b0 = b[0], + b1 = b[1]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)); +} +/** + * Alias for {@link vec2.length} + * @function + */ + +var len = length; +/** + * Alias for {@link vec2.subtract} + * @function + */ + +var sub = subtract; +/** + * Alias for {@link vec2.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link vec2.divide} + * @function + */ + +var div = divide; +/** + * Alias for {@link vec2.distance} + * @function + */ + +var dist = distance; +/** + * Alias for {@link vec2.squaredDistance} + * @function + */ + +var sqrDist = squaredDistance; +/** + * Alias for {@link vec2.squaredLength} + * @function + */ + +var sqrLen = squaredLength; +/** + * Perform some operation over an array of vec2s. + * + * @param {Array} a the array of vectors to iterate over + * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed + * @param {Number} offset Number of elements to skip at the beginning of the array + * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array + * @param {Function} fn Function to call for each vector in the array + * @param {Object} [arg] additional argument to pass to fn + * @returns {Array} a + * @function + */ + +var forEach = function () { + var vec = create(); + return function (a, stride, offset, count, fn, arg) { + var i, l; + + if (!stride) { + stride = 2; } - /** - * Return current shape (whit repetions) bounding - * - * @return {*} {IShapeBounding} - */ - getBounding() { - return this.bounding; + + if (!offset) { + offset = 0; } - /** - * Get number of repetitions - * - * @returns {number} - */ - getRepetitionCount() { - var _a; - const repetitions = this.getProp('repetitions', undefined, 1); - return Array.isArray(repetitions) ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) : repetitions; + + if (count) { + l = Math.min(count * stride + offset, a.length); + } else { + l = a.length; } - /** - * Return buffer - * - * @returns {(Float32Array | undefined)} - */ - getBuffer() { - return this.buffer; + + for (i = offset; i < l; i += stride) { + vec[0] = a[i]; + vec[1] = a[i + 1]; + fn(vec, vec, arg); + a[i] = vec[0]; + a[i + 1] = vec[1]; } + + return a; + }; +}(); + +/***/ }), +/* 19 */ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__webpack_require__(20), exports); +__exportStar(__webpack_require__(21), exports); +__exportStar(__webpack_require__(22), exports); +__exportStar(__webpack_require__(23), exports); +__exportStar(__webpack_require__(24), exports); +__exportStar(__webpack_require__(25), exports); +__exportStar(__webpack_require__(26), exports); +__exportStar(__webpack_require__(27), exports); +//# sourceMappingURL=index.js.map + +/***/ }), +/* 20 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=indexedBuffer.js.map + +/***/ }), +/* 21 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=propArguments.js.map + +/***/ }), +/* 22 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ERepetitionType = void 0; +/** + * Repetition type enumerator. + * + * @category Core.Repetition + * @internal + */ +var ERepetitionType; +(function (ERepetitionType) { /** - * Return indexed buffer - * - * @returns {(Array> | undefined)} + * Defines the type of repetition of the shape, + * in a circular way starting from the center of the scene + * @order 1 */ - getIndexedBuffer() { - return this.indexedBuffer; - } + ERepetitionType[ERepetitionType["Ring"] = 1] = "Ring"; /** - * Return number of encapsulation - * - * @param {IBufferIndex} index - * @returns {number} + * Defines the type of repetition of the shape, + * on a nxm grid starting from the center of the scene + * @order 2 */ - static getIndexParentLevel(index) { - if (typeof index.parent === 'undefined') - return 0; - let currentParent = index.parent; - let currentParentLevel = 1; - while (typeof currentParent.parent !== 'undefined') { - currentParentLevel++; - currentParent = currentParent.parent; - } - return currentParentLevel; - } + ERepetitionType[ERepetitionType["Matrix"] = 2] = "Matrix"; +})(ERepetitionType = exports.ERepetitionType || (exports.ERepetitionType = {})); +//# sourceMappingURL=repetitions.js.map + +/***/ }), +/* 23 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=scene-child.js.map + +/***/ }), +/* 24 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=scene.js.map + +/***/ }), +/* 25 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.EBoundingType = void 0; +var EBoundingType; +(function (EBoundingType) { /** - * Stream buffer - * - * @param {(TStreamCallback} callback + * Relative to the real bounding of the shape + * @order 2 */ - stream(callback) { - if (this.buffer && this.indexedBuffer) { - for (let i = 0, j = 0, len = this.indexedBuffer.length; i < len; i++) { - const currentIndexing = this.indexedBuffer[i]; - callback({ - buffer: this.buffer, - frameLength: currentIndexing.frameLength, - frameBufferIndex: j, - currentIndexing: currentIndexing, - currentShapeIndex: i, - totalShapes: len, - }); - j += currentIndexing.frameLength; - } - } - } + EBoundingType[EBoundingType["Relative"] = 1] = "Relative"; /** - * Return empty propArguments - * - * @static - * @param {ShapeBase} shape - * @return {*} {PropArguments} + * Fixed to te width and height of the shape + * @order 3 */ - static getEmptyPropArguments(shape, parentPropArguments) { - const repetition = { - type: types_1.ERepetitionType.Ring, - angle: 0, - index: 1, - offset: 1, - count: 1, - row: { index: 1, offset: 1, count: 1 }, - col: { index: 1, offset: 1, count: 1 }, - }; - return { - repetition, - shape, - parent: parentPropArguments, - }; - } -} -exports.ShapeBase = ShapeBase; -/** - * Empty buffer - * - * @internal - * @ignore - */ -ShapeBase.EMPTY_BUFFER = new Float32Array(0); -/** - * Empty BaseRepetition - * - * @internal - * @ignore - */ -ShapeBase.getEmptySimpleRepetition = () => ({ - index: 1, - offset: 1, - count: 1, -}); -/** - * Empty Repetition - * - * @internal - * @ignore - */ -ShapeBase.getEmptyRepetition = () => ({ - type: types_1.ERepetitionType.Ring, - angle: 0, - ...ShapeBase.getEmptySimpleRepetition(), - row: ShapeBase.getEmptySimpleRepetition(), - col: ShapeBase.getEmptySimpleRepetition(), -}); -//# sourceMappingURL=ShapeBase.js.map + EBoundingType[EBoundingType["Fixed"] = 2] = "Fixed"; +})(EBoundingType = exports.EBoundingType || (exports.EBoundingType = {})); +//# sourceMappingURL=shape-base.js.map + +/***/ }), +/* 26 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +////// +//# sourceMappingURL=shape-primitives.js.map + +/***/ }), +/* 27 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +// Shape +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=shapes.js.map /***/ }), /* 28 */ @@ -9267,7 +9367,7 @@ ShapeBase.getEmptyRepetition = () => ({ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.toVec3 = exports.toVec2 = exports.fromSkew = exports.VEC2_ONE = exports.VEC2_ZERO = exports.VEC3_ONE = exports.VEC3_ZERO = void 0; -const gl_matrix_1 = __webpack_require__(13); +const gl_matrix_1 = __webpack_require__(8); exports.VEC3_ZERO = [0, 0, 0]; exports.VEC3_ONE = [1, 1, 1]; exports.VEC2_ZERO = [0, 0]; @@ -9780,7 +9880,7 @@ exports.Modifier = Modifier; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.distributePointsInBuffer = exports.interpolate = exports.prepareBufferForInterpolation = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.relativeClamp = exports.clamp = exports.lerp = exports.toRadians = exports.toDegrees = exports.now = void 0; const SimplexNoise = __webpack_require__(34); -const repetitions_1 = __webpack_require__(7); +const repetitions_1 = __webpack_require__(22); const Vec2_1 = __webpack_require__(29); // isDef: (object: any): boolean => typeof object !== 'undefined' && object !== null, const measurement = typeof performance !== 'undefined' ? performance : Date; @@ -10626,9 +10726,9 @@ Better rank ordering method by Stefan Gustavson in 2012. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Shape = void 0; -const Scene_1 = __webpack_require__(24); -const SceneChild_1 = __webpack_require__(25); -const ShapeBase_1 = __webpack_require__(27); +const Scene_1 = __webpack_require__(4); +const SceneChild_1 = __webpack_require__(5); +const ShapeBase_1 = __webpack_require__(7); /** * Container of ShapeBase or Group, it applies transformations on each repetition * @@ -10813,7 +10913,7 @@ exports.Shape = Shape; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ShapePrimitive = void 0; const glme = __webpack_require__(28); -const ShapeBase_1 = __webpack_require__(27); +const ShapeBase_1 = __webpack_require__(7); const Modifier_1 = __webpack_require__(32); const Adapt_1 = __webpack_require__(31); /** @@ -10967,7 +11067,7 @@ exports.ShapeLoop = void 0; const math_1 = __webpack_require__(30); const Adapt_1 = __webpack_require__(31); const ShapePrimitive_1 = __webpack_require__(36); -const ShapeBase_1 = __webpack_require__(27); +const ShapeBase_1 = __webpack_require__(7); /** * Shape Loop * @@ -18034,18 +18134,112 @@ var __webpack_exports__ = {}; "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "Urpflanze": () => (/* reexport module object */ _modules__WEBPACK_IMPORTED_MODULE_0__), -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ "Animation": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.Animation), +/* harmony export */ "Circle": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.Circle), +/* harmony export */ "Color": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.Color), +/* harmony export */ "DrawerCanvas": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.DrawerCanvas), +/* harmony export */ "GCODEExporter": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.GCODEExporter), +/* harmony export */ "Group": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.Group), +/* harmony export */ "Line": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.Line), +/* harmony export */ "Lissajous": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.Lissajous), +/* harmony export */ "Modifier": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.Modifier), +/* harmony export */ "Modifiers": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.Modifiers), +/* harmony export */ "PHI": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.PHI), +/* harmony export */ "PI2": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.PI2), +/* harmony export */ "Polygon": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.Polygon), +/* harmony export */ "Rect": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.Rect), +/* harmony export */ "Renderer": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.Renderer), +/* harmony export */ "Rose": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.Rose), +/* harmony export */ "SVGExporter": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.SVGExporter), +/* harmony export */ "SVGImporter": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.SVGImporter), +/* harmony export */ "Scene": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.Scene), +/* harmony export */ "SceneChild": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.SceneChild), +/* harmony export */ "Shape": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.Shape), +/* harmony export */ "ShapeBase": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.ShapeBase), +/* harmony export */ "ShapeBuffer": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.ShapeBuffer), +/* harmony export */ "ShapeFollow": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.ShapeFollow), +/* harmony export */ "ShapeLoop": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.ShapeLoop), +/* harmony export */ "ShapePrimitive": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.ShapePrimitive), +/* harmony export */ "ShapeRecursive": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.ShapeRecursive), +/* harmony export */ "Spiral": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.Spiral), +/* harmony export */ "Star": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.Star), +/* harmony export */ "SuperShape": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.SuperShape), +/* harmony export */ "Timeline": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.Timeline), +/* harmony export */ "Triangle": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.Triangle), +/* harmony export */ "Vec2": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.Vec2), +/* harmony export */ "__esModule": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.__esModule), +/* harmony export */ "angle2FromRepetition": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.angle2FromRepetition), +/* harmony export */ "angleFromRepetition": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.angleFromRepetition), +/* harmony export */ "clamp": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.clamp), +/* harmony export */ "distanceFromRepetition": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.distanceFromRepetition), +/* harmony export */ "distributePointsInBuffer": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.distributePointsInBuffer), +/* harmony export */ "interpolate": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.interpolate), +/* harmony export */ "lerp": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.lerp), +/* harmony export */ "log": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.log), +/* harmony export */ "mod": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.mod), +/* harmony export */ "noise": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.noise), +/* harmony export */ "now": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.now), +/* harmony export */ "prepareBufferForInterpolation": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.prepareBufferForInterpolation), +/* harmony export */ "random": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.random), +/* harmony export */ "relativeClamp": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.relativeClamp), +/* harmony export */ "toDegrees": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.toDegrees), +/* harmony export */ "toRadians": () => (/* reexport safe */ _modules__WEBPACK_IMPORTED_MODULE_0__.toRadians) /* harmony export */ }); /* harmony import */ var _modules__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_modules__WEBPACK_IMPORTED_MODULE_0__); //# sourceMappingURL=index.js.map })(); -var __webpack_exports__Urpflanze = __webpack_exports__.Urpflanze; -var __webpack_exports__default = __webpack_exports__.default; -export { __webpack_exports__Urpflanze as Urpflanze, __webpack_exports__default as default }; +var __webpack_exports__Animation = __webpack_exports__.Animation; +var __webpack_exports__Circle = __webpack_exports__.Circle; +var __webpack_exports__Color = __webpack_exports__.Color; +var __webpack_exports__DrawerCanvas = __webpack_exports__.DrawerCanvas; +var __webpack_exports__GCODEExporter = __webpack_exports__.GCODEExporter; +var __webpack_exports__Group = __webpack_exports__.Group; +var __webpack_exports__Line = __webpack_exports__.Line; +var __webpack_exports__Lissajous = __webpack_exports__.Lissajous; +var __webpack_exports__Modifier = __webpack_exports__.Modifier; +var __webpack_exports__Modifiers = __webpack_exports__.Modifiers; +var __webpack_exports__PHI = __webpack_exports__.PHI; +var __webpack_exports__PI2 = __webpack_exports__.PI2; +var __webpack_exports__Polygon = __webpack_exports__.Polygon; +var __webpack_exports__Rect = __webpack_exports__.Rect; +var __webpack_exports__Renderer = __webpack_exports__.Renderer; +var __webpack_exports__Rose = __webpack_exports__.Rose; +var __webpack_exports__SVGExporter = __webpack_exports__.SVGExporter; +var __webpack_exports__SVGImporter = __webpack_exports__.SVGImporter; +var __webpack_exports__Scene = __webpack_exports__.Scene; +var __webpack_exports__SceneChild = __webpack_exports__.SceneChild; +var __webpack_exports__Shape = __webpack_exports__.Shape; +var __webpack_exports__ShapeBase = __webpack_exports__.ShapeBase; +var __webpack_exports__ShapeBuffer = __webpack_exports__.ShapeBuffer; +var __webpack_exports__ShapeFollow = __webpack_exports__.ShapeFollow; +var __webpack_exports__ShapeLoop = __webpack_exports__.ShapeLoop; +var __webpack_exports__ShapePrimitive = __webpack_exports__.ShapePrimitive; +var __webpack_exports__ShapeRecursive = __webpack_exports__.ShapeRecursive; +var __webpack_exports__Spiral = __webpack_exports__.Spiral; +var __webpack_exports__Star = __webpack_exports__.Star; +var __webpack_exports__SuperShape = __webpack_exports__.SuperShape; +var __webpack_exports__Timeline = __webpack_exports__.Timeline; +var __webpack_exports__Triangle = __webpack_exports__.Triangle; +var __webpack_exports__Vec2 = __webpack_exports__.Vec2; +var __webpack_exports___esModule = __webpack_exports__.__esModule; +var __webpack_exports__angle2FromRepetition = __webpack_exports__.angle2FromRepetition; +var __webpack_exports__angleFromRepetition = __webpack_exports__.angleFromRepetition; +var __webpack_exports__clamp = __webpack_exports__.clamp; +var __webpack_exports__distanceFromRepetition = __webpack_exports__.distanceFromRepetition; +var __webpack_exports__distributePointsInBuffer = __webpack_exports__.distributePointsInBuffer; +var __webpack_exports__interpolate = __webpack_exports__.interpolate; +var __webpack_exports__lerp = __webpack_exports__.lerp; +var __webpack_exports__log = __webpack_exports__.log; +var __webpack_exports__mod = __webpack_exports__.mod; +var __webpack_exports__noise = __webpack_exports__.noise; +var __webpack_exports__now = __webpack_exports__.now; +var __webpack_exports__prepareBufferForInterpolation = __webpack_exports__.prepareBufferForInterpolation; +var __webpack_exports__random = __webpack_exports__.random; +var __webpack_exports__relativeClamp = __webpack_exports__.relativeClamp; +var __webpack_exports__toDegrees = __webpack_exports__.toDegrees; +var __webpack_exports__toRadians = __webpack_exports__.toRadians; +export { __webpack_exports__Animation as Animation, __webpack_exports__Circle as Circle, __webpack_exports__Color as Color, __webpack_exports__DrawerCanvas as DrawerCanvas, __webpack_exports__GCODEExporter as GCODEExporter, __webpack_exports__Group as Group, __webpack_exports__Line as Line, __webpack_exports__Lissajous as Lissajous, __webpack_exports__Modifier as Modifier, __webpack_exports__Modifiers as Modifiers, __webpack_exports__PHI as PHI, __webpack_exports__PI2 as PI2, __webpack_exports__Polygon as Polygon, __webpack_exports__Rect as Rect, __webpack_exports__Renderer as Renderer, __webpack_exports__Rose as Rose, __webpack_exports__SVGExporter as SVGExporter, __webpack_exports__SVGImporter as SVGImporter, __webpack_exports__Scene as Scene, __webpack_exports__SceneChild as SceneChild, __webpack_exports__Shape as Shape, __webpack_exports__ShapeBase as ShapeBase, __webpack_exports__ShapeBuffer as ShapeBuffer, __webpack_exports__ShapeFollow as ShapeFollow, __webpack_exports__ShapeLoop as ShapeLoop, __webpack_exports__ShapePrimitive as ShapePrimitive, __webpack_exports__ShapeRecursive as ShapeRecursive, __webpack_exports__Spiral as Spiral, __webpack_exports__Star as Star, __webpack_exports__SuperShape as SuperShape, __webpack_exports__Timeline as Timeline, __webpack_exports__Triangle as Triangle, __webpack_exports__Vec2 as Vec2, __webpack_exports___esModule as __esModule, __webpack_exports__angle2FromRepetition as angle2FromRepetition, __webpack_exports__angleFromRepetition as angleFromRepetition, __webpack_exports__clamp as clamp, __webpack_exports__distanceFromRepetition as distanceFromRepetition, __webpack_exports__distributePointsInBuffer as distributePointsInBuffer, __webpack_exports__interpolate as interpolate, __webpack_exports__lerp as lerp, __webpack_exports__log as log, __webpack_exports__mod as mod, __webpack_exports__noise as noise, __webpack_exports__now as now, __webpack_exports__prepareBufferForInterpolation as prepareBufferForInterpolation, __webpack_exports__random as random, __webpack_exports__relativeClamp as relativeClamp, __webpack_exports__toDegrees as toDegrees, __webpack_exports__toRadians as toRadians }; //# sourceMappingURL=urpflanze.js.map \ No newline at end of file diff --git a/build/esm/urpflanze.js.map b/build/esm/urpflanze.js.map index e5197ac..c9c5b39 100644 --- a/build/esm/urpflanze.js.map +++ b/build/esm/urpflanze.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@urpflanze/js/./dist/esm/modules.js","webpack://@urpflanze/js/./dist/esm/modules-light.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/indexedBuffer.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/propArguments.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/repetitions.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/scene-child.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/scene.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/shape-base.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/shape-primitives.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/shapes.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/index.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/common.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/mat2.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/mat2d.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/mat3.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/mat4.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/quat.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/vec4.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/vec3.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/quat2.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/vec2.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/Scene.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/SceneChild.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/Group.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeBase.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/math/gl-matrix-extensions.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/math/Vec2.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/math/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Adapt.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Modifier.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/Utilities.js","webpack://@urpflanze/js/./node_modules/simplex-noise/simplex-noise.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/Shape.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapePrimitive.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeLoop.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeBuffer.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeRecursive.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeFollow.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Line.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Triangle.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Rect.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Polygon.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Circle.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Star.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Rose.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Spiral.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Lissajous.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/SuperShape.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Mirror.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Smooth.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Close.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Solidify.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Subdivide.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Offset.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/types.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/utilities.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/createAnimation.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/createInterpolator.js","webpack://@urpflanze/js/./node_modules/@urpflanze/color/dist/cjs/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/color/dist/cjs/types.js","webpack://@urpflanze/js/./node_modules/@urpflanze/color/dist/cjs/conversions.js","webpack://@urpflanze/js/./node_modules/@urpflanze/color/dist/cjs/parsing.js","webpack://@urpflanze/js/./node_modules/@urpflanze/color/dist/cjs/htmlcolors.js","webpack://@urpflanze/js/./node_modules/bezier-easing/src/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/Easings.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/Animation.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/composeAnimations.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/browser/BrowserDrawerCanvas.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/DrawerCanvas.js","webpack://@urpflanze/js/./node_modules/canvas/browser.js","webpack://@urpflanze/js/./node_modules/canvas/lib/parse-font.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/Emitter.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/Timeline.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/utils.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/Renderer.js","webpack://@urpflanze/js/./node_modules/@ffmpeg/ffmpeg/src/index.js","webpack://@urpflanze/js/./node_modules/regenerator-runtime/runtime.js","webpack://@urpflanze/js/./node_modules/@ffmpeg/ffmpeg/src/createFFmpeg.js","webpack://@urpflanze/js/./node_modules/@ffmpeg/ffmpeg/src/config.js","webpack://@urpflanze/js/./node_modules/@ffmpeg/ffmpeg/src/utils/log.js","webpack://@urpflanze/js/./node_modules/@ffmpeg/ffmpeg/src/utils/parseProgress.js","webpack://@urpflanze/js/./node_modules/@ffmpeg/ffmpeg/src/utils/parseArgs.js","webpack://@urpflanze/js/./node_modules/@ffmpeg/ffmpeg/src/browser/index.js","webpack://@urpflanze/js/./node_modules/@ffmpeg/ffmpeg/src/browser/defaultOptions.js","webpack://@urpflanze/js/./node_modules/resolve-url/resolve-url.js","webpack://@urpflanze/js/./node_modules/@ffmpeg/ffmpeg/src/browser/getCreateFFmpegCore.js","webpack://@urpflanze/js/./node_modules/@ffmpeg/ffmpeg/src/browser/fetchFile.js","webpack://@urpflanze/js/./node_modules/jszip/dist/jszip.min.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/browser/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/gcode-exporter/dist/cjs/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/gcode-exporter/dist/cjs/types.js","webpack://@urpflanze/js/./node_modules/@urpflanze/gcode-exporter/dist/cjs/GCODEExporter.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/build/umd/urpflanze.min.js","webpack://@urpflanze/js/./node_modules/simplify-js/simplify.js","webpack://@urpflanze/js/./node_modules/@urpflanze/gcode-exporter/dist/cjs/utilities.js","webpack://@urpflanze/js/./node_modules/@urpflanze/svg-exporter/dist/cjs/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/svg-exporter/dist/cjs/types.js","webpack://@urpflanze/js/./node_modules/@urpflanze/svg-exporter/dist/cjs/SVGExporter.js","webpack://@urpflanze/js/./node_modules/@urpflanze/svg-exporter/node_modules/@urpflanze/color/dist/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/svg-exporter/node_modules/@urpflanze/color/dist/types.js","webpack://@urpflanze/js/./node_modules/@urpflanze/svg-exporter/node_modules/@urpflanze/color/dist/conversions.js","webpack://@urpflanze/js/./node_modules/@urpflanze/svg-exporter/node_modules/@urpflanze/color/dist/parsing.js","webpack://@urpflanze/js/./node_modules/@urpflanze/svg-importer/build/umd/urpflanze-svg-importer.min.js","webpack://@urpflanze/js/webpack/bootstrap","webpack://@urpflanze/js/webpack/runtime/compat get default export","webpack://@urpflanze/js/webpack/runtime/define property getters","webpack://@urpflanze/js/webpack/runtime/global","webpack://@urpflanze/js/webpack/runtime/hasOwnProperty shorthand","webpack://@urpflanze/js/webpack/runtime/make namespace object","webpack://@urpflanze/js/./dist/esm/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAgC;AACA;AACmB;AACoB;AACJ;AACJ;AACT;AACtD,mC;;;;;;;;;;;;;;;;;;;;ACPyC;AACkB;AACyD;AACpH,yC;;;;;;;ACHa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,YAAY,GAAG,gCAAgC,GAAG,qCAAqC,GAAG,mBAAmB,GAAG,8BAA8B,GAAG,4BAA4B,GAAG,2BAA2B,GAAG,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,qBAAqB,GAAG,aAAa,GAAG,YAAY;AACjZ;AACA;AACA;AACA,aAAa,mBAAO,CAAC,CAAS;AAC9B;AACA,oBAAoB,mBAAO,CAAC,EAAW;AACvC;AACA;AACA;AACA;AACA,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAc;AACnC,aAAa,mBAAO,CAAC,EAAS;AAC9B;AACA,aAAa,mBAAO,CAAC,EAAoB;AACzC,aAAa,mBAAO,CAAC,EAAyB;AAC9C,aAAa,mBAAO,CAAC,EAAoB;AACzC,aAAa,mBAAO,CAAC,EAAsB;AAC3C,aAAa,mBAAO,CAAC,EAAgB;AACrC,aAAa,mBAAO,CAAC,EAAyB;AAC9C,aAAa,mBAAO,CAAC,EAAsB;AAC3C,aAAa,mBAAO,CAAC,EAA0B;AAC/C,aAAa,mBAAO,CAAC,EAA8B;AACnD,aAAa,mBAAO,CAAC,EAA0B;AAC/C,aAAa,mBAAO,CAAC,EAA6B;AAClD,aAAa,mBAAO,CAAC,EAA4B;AACjD,aAAa,mBAAO,CAAC,EAA0B;AAC/C,aAAa,mBAAO,CAAC,EAA0B;AAC/C,aAAa,mBAAO,CAAC,EAA4B;AACjD,aAAa,mBAAO,CAAC,EAA+B;AACpD,aAAa,mBAAO,CAAC,EAAgC;AACrD;AACA,aAAa,mBAAO,CAAC,EAAsB;AAC3C,aAAa,mBAAO,CAAC,EAAa;AAClC;AACA,kBAAkB,mBAAO,CAAC,EAAa;AACvC,wCAAuC,CAAC,qCAAqC,yBAAyB,EAAE,EAAE,EAAC;AAC3G,yCAAwC,CAAC,qCAAqC,0BAA0B,EAAE,EAAE,EAAC;AAC7G,iDAAgD,CAAC,qCAAqC,kCAAkC,EAAE,EAAE,EAAC;AAC7H,6CAA4C,CAAC,qCAAqC,8BAA8B,EAAE,EAAE,EAAC;AACrH,6CAA4C,CAAC,qCAAqC,8BAA8B,EAAE,EAAE,EAAC;AACrH,uCAAsC,CAAC,qCAAqC,wBAAwB,EAAE,EAAE,EAAC;AACzG,yCAAwC,CAAC,qCAAqC,0BAA0B,EAAE,EAAE,EAAC;AAC7G,0CAAyC,CAAC,qCAAqC,2BAA2B,EAAE,EAAE,EAAC;AAC/G,uDAAsD,CAAC,qCAAqC,wCAAwC,EAAE,EAAE,EAAC;AACzI,wDAAuD,CAAC,qCAAqC,yCAAyC,EAAE,EAAE,EAAC;AAC3I,0DAAyD,CAAC,qCAAqC,2CAA2C,EAAE,EAAE,EAAC;AAC/I,+CAA8C,CAAC,qCAAqC,gCAAgC,EAAE,EAAE,EAAC;AACzH,iEAAgE,CAAC,qCAAqC,kDAAkD,EAAE,EAAE,EAAC;AAC7J,4DAA2D,CAAC,qCAAqC,6CAA6C,EAAE,EAAE,EAAC;AACnJ,aAAa,mBAAO,CAAC,EAAa;AAClC,wCAAuC,CAAC,qCAAqC,uBAAuB,EAAE,EAAE,EAAC;AACzG,aAAa,mBAAO,CAAC,EAAQ;AAC7B,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,iC;;;;;;;ACtEa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,CAAiB;AACtC,aAAa,mBAAO,CAAC,CAAiB;AACtC,aAAa,mBAAO,CAAC,CAAe;AACpC,aAAa,mBAAO,CAAC,CAAe;AACpC,aAAa,mBAAO,CAAC,CAAS;AAC9B,aAAa,mBAAO,CAAC,EAAc;AACnC,aAAa,mBAAO,CAAC,EAAoB;AACzC,aAAa,mBAAO,CAAC,EAAU;AAC/B,iC;;;;;;;ACpBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD,uBAAuB,KAAK;AAC7E,uC;;;;;;;ACxBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C,qBAAqB,KAAK;AACvE,sC;;;;;;;AChBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA,4C;;;;;;;ACHa;AACb;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACHwC;AACN;AACE;AACF;AACA;AACA;AACE;AACF;AACA;AACA;;;;;;;;;;;;;;;;;ACTlC;AACA;AACA;AACA;AACA;AACO;AACA;AACA;AACP;AACA;AACA;AACA,WAAW,2CAA2C;AACtD;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjDwC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA,gBAAgB;;AAEhB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AAC7S;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC/aiC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACvd;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACreiC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACttB;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzwBiC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY,+CAAgB;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA,YAAY,+CAAgB;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP,wBAAwB,kDAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;;AAExD;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,YAAY,KAAK;AACjB;;AAEO;AACP,oBAAoB,kDAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,+CAAgB,+BAA+B,+CAAgB,+BAA+B,+CAAgB;AAC/I;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,uEAAuE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB;AAC/zC;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrxDiC;AACN;AACA;AACA;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,OAAO;AACnB;;AAEO;AACP;AACA;;AAEA,UAAU,+CAAgB;AAC1B;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,aAAa;AACzB,YAAY,aAAa;AACzB,YAAY,OAAO;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;;AAE1C,gDAAgD;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH,oBAAoB,+CAAgB;AACpC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA,WAAW,8CAAe;AAC1B,WAAW,8CAAe;AAC1B,WAAW,8CAAe;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,mCAAmC;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAoC;;AAEpC;AACA,wBAAwB;;AAExB;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,EAAE;AACb,WAAW,EAAE;AACb,WAAW,EAAE;AACb,aAAa,KAAK;AAClB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,YAAY,2CAAU;AAC7B;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,iBAAiB,gDAAe;AACvC;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,WAAW,0CAAS;AAC3B;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,YAAY,2CAAU;AAC7B;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,WAAW,0CAAS;AAC3B;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO,aAAa,4CAAW;AAC/B;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;AACA;;AAEO,oBAAoB,mDAAkB;AAC7C;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,gBAAgB,+CAAc;AACrC;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO,kBAAkB,iDAAgB;AACzC;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO,aAAa,4CAAW;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,4CAAW;AAC3B,kBAAkB,gDAAe;AACjC,kBAAkB,gDAAe;AACjC;AACA,cAAc,yCAAQ;;AAEtB;AACA,MAAM,2CAAU;AAChB,UAAU,yCAAQ,sBAAsB,2CAAU;AAClD,MAAM,+CAAc;AACpB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,MAAM,2CAAU;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,aAAa,4CAAW;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrsBuC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,uBAAuB;AACvB;AACA;;AAEA;AACA;;AAEA;AACA,SAAS,8CAAe;AACxB,SAAS,8CAAe;AACxB;AACA,GAAG;;AAEH;AACA,SAAS,8CAAe;AACxB,SAAS,8CAAe;AACxB;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;;AAEhB;AACA;AACA;AACA,qCAAqC;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AAC7S;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtpBuC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,UAAU,8CAAe;AACzB,UAAU,8CAAe;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;;AAEA;AACA;AACA,4BAA4B;;AAE5B;AACA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA,YAAY;;AAEZ;AACA;AACA,YAAY;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACxN;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClxBuC;AACN;AACA;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;;AAEO;AACP,eAAe,kDAAmB;;AAElC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA,cAAc,4CAAW;AACzB,EAAE,iDAAgB;AAClB,cAAc,kDAAmB;AACjC,EAAE,oDAAmB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO,cAAc,0CAAS;AAC9B;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO,cAAc,0CAAS;AAC9B;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA,sBAAsB,+CAAgB;AACtC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,aAAa,4CAAW;AAC/B;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,oBAAoB,mDAAkB;AAC7C;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACjoB,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACl0BwC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,UAAU,8CAAe;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA,2BAA2B;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;;AAE5C;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB;AACnI;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;AC/mBY;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,qBAAqB,mBAAO,CAAC,EAAc;AAC3C,gBAAgB,mBAAO,CAAC,EAAS;AACjC,gBAAgB,mBAAO,CAAC,EAAgB;AACxC,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB;AACpC,eAAe,WAAW;AAC1B,eAAe,4BAA4B;AAC3C,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,qBAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACxVa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,eAAe,cAAc;AAC7B,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0EAA0E;AACzF,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sC;;;;;;;AClGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,gBAAgB,mBAAO,CAAC,EAAS;AACjC,qBAAqB,mBAAO,CAAC,EAAc;AAC3C,oBAAoB,mBAAO,CAAC,EAAoB;AAChD,gBAAgB,mBAAO,CAAC,EAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,SAAS;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACxTa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,oBAAoB,mBAAO,CAAC,EAAW;AACvC,gBAAgB,mBAAO,CAAC,CAAU;AAClC,aAAa,mBAAO,CAAC,EAA8B;AACnD,eAAe,mBAAO,CAAC,EAAc;AACrC,eAAe,mBAAO,CAAC,EAAS;AAChC,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,oBAAoB,mBAAO,CAAC,EAAc;AAC1C,qBAAqB,mBAAO,CAAC,EAAe;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,cAAc;AAC7B,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0EAA0E;AACzF,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,2CAA2C;AACrF,8CAA8C,2CAA2C;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,4BAA4B;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,SAAS;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;AACA,mEAAmE,SAAS;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,gCAAgC;AAClD,kBAAkB,gCAAgC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qC;;;;;;;ACzgBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc,GAAG,cAAc,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,iBAAiB;AAChI,oBAAoB,mBAAO,CAAC,EAAW;AACvC,iBAAiB;AACjB,gBAAgB;AAChB,iBAAiB;AACjB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,gD;;;;;;;AC5Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,gBAAgB;AAChB;AACA,6BAA6B,OAAO,OAAO,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,gC;;;;;;;ACpNa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,iC;;;;;;;AClCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,GAAG,gBAAgB,GAAG,kBAAkB;AACrD,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC,kBAAkB,KAAK;AAC9D;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6BAA6B;AAC5C,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,iC;;;;;;;ACrKa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB;AACA;AACA,gBAAgB;AAChB,oC;;;;;;;ACNa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gCAAgC,GAAG,mBAAmB,GAAG,qCAAqC,GAAG,8BAA8B,GAAG,4BAA4B,GAAG,2BAA2B,GAAG,cAAc,GAAG,aAAa,GAAG,qBAAqB,GAAG,aAAa,GAAG,YAAY,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,WAAW;AAC1U,qBAAqB,mBAAO,CAAC,EAAe;AAC5C,sBAAsB,mBAAO,CAAC,CAAqB;AACnD,eAAe,mBAAO,CAAC,EAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,mBAAmB,iBAAiB;AACpC,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,gBAAgB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA,4BAA4B,qBAAqB;AACjD;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,eAAe;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yBAAyB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC,qC;;;;;;ACxWA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA,qBAAqB;AACrB;AACA,wBAAwB;AACxB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,4BAA4B;AAC5B;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,kCAAkC;AAClC;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA,6BAA6B;AAC7B;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA,mCAAmC;AACnC,qBAAqB;AACrB;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,yBAAyB;AACzB,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,iBAAiB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,gDAAgD;AAChD;AACA;;AAEA;AACA,MAAM,IAA2C,EAAE,mCAAO,YAAY,qBAAqB;AAAA,kGAAC;AAC5F;AACA,MAAM,IAA8B,EAAE,oBAAoB;AAC1D;AACA,OAAO,EAAsE;AAC7E;AACA,MAAM,IAA6B;AACnC;AACA;;AAEA,CAAC;;;;;;;;ACxdY;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,gBAAgB,mBAAO,CAAC,EAAU;AAClC,qBAAqB,mBAAO,CAAC,EAAe;AAC5C,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc,aAAa;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA,4DAA4D,SAAS;AACrE,wCAAwC;AACxC;AACA;AACA;AACA,yCAAyC,4BAA4B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,aAAa;AAC5B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACnLa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,sBAAsB;AACtB,aAAa,mBAAO,CAAC,EAA8B;AACnD,oBAAoB,mBAAO,CAAC,EAAa;AACzC,mBAAmB,mBAAO,CAAC,EAAuB;AAClD,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB,aAAa;AACpD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,0C;;;;;;;ACjJa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,eAAe,mBAAO,CAAC,EAAS;AAChC,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,yBAAyB,mBAAO,CAAC,EAA0B;AAC3D,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB,aAAa;AAC/C,eAAe,QAAQ;AACvB;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB;AACA;AACA;AACA,iDAAiD,eAAe;AAChE,sDAAsD,QAAQ;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA,eAAe,6BAA6B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,kBAAkB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,eAAe,sBAAsB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,8CAA8C;AAC9E;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,qC;;;;;;;AChOa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB;AACnB,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,yBAAyB,mBAAO,CAAC,EAA0B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB,aAAa;AACjD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,gCAAgC,8CAA8C;AAC9E;AACA;AACA;AACA;AACA,mBAAmB;AACnB,uC;;;;;;;ACnIa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,sBAAsB;AACtB,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB,aAAa;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,qDAAqD;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,6BAA6B;AACpD;AACA;AACA;AACA;AACA,sCAAsC,+BAA+B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iIAAiI,6DAA6D;AAC9L;AACA;AACA;AACA;AACA,4BAA4B,uEAAuE;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,SAAS;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,4BAA4B,8DAA8D;AAC1F,iBAAiB;AACjB;AACA;AACA,mFAAmF,gCAAgC;AACnH,wCAAwC;AACxC;AACA;AACA;AACA;AACA,4BAA4B,8DAA8D;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,oEAAoE,4BAA4B,iBAAiB,EAAE;AACnH;AACA;AACA;AACA,+BAA+B,gBAAgB;AAC/C;AACA,2DAA2D,SAAS;AACpE;AACA,+FAA+F,gCAAgC;AAC/H,oDAAoD;AACpD;AACA;AACA;AACA;AACA,wCAAwC,wDAAwD;AAChG;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;AACA,qDAAqD,4BAA4B;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA,sBAAsB;AACtB,0C;;;;;;;AChUa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB;AACnB,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB,aAAa;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,uDAAuD;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,SAAS;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,mFAAmF,gCAAgC;AACnH,uEAAuE,iCAAiC,4BAA4B,iBAAiB,EAAE;AACvJ,kDAAkD,SAAS;AAC3D;AACA,2FAA2F,gCAAgC;AAC3H,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA,iDAAiD,4BAA4B;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA,mBAAmB;AACnB,uC;;;;;;;AC3Na;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,YAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,SAAS;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,gC;;;;;;;AC5Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA,oC;;;;;;;AC1Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,gC;;;;;;;AC3Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,mC;;;;;;;ACxCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACpCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ,gC;;;;;;;AClDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc,aAAa;AAC1C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ,gC;;;;;;;ACtEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe,aAAa;AAC3C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kC;;;;;;;AC5Fa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB,aAAa;AAC/C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,qC;;;;;;;ACtDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB;AAClB,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sC;;;;;;;AC9Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,gBAAgB,mBAAO,CAAC,EAAS;AACjC,iBAAiB,mBAAO,CAAC,EAAU;AACnC,iBAAiB,mBAAO,CAAC,EAAU;AACnC,mBAAmB,mBAAO,CAAC,EAAY;AACvC,oBAAoB,mBAAO,CAAC,EAAa;AACzC,gBAAgB,mBAAO,CAAC,EAAS;AACjC,iBAAiB,mBAAO,CAAC,EAAU;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,iC;;;;;;;ACpBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACtDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,oBAAoB,mBAAO,CAAC,EAAc;AAC1C,gBAAgB,mBAAO,CAAC,EAAS;AACjC,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,SAAS;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACvEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;AC3Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,oC;;;;;;;ACvHa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,WAAW;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,qC;;;;;;;ACxDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,wBAAwB,yBAAyB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACfa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAa;AAClC,aAAa,mBAAO,CAAC,EAAmB;AACxC,aAAa,mBAAO,CAAC,EAAsB;AAC3C,aAAa,mBAAO,CAAC,EAAW;AAChC,aAAa,mBAAO,CAAC,EAAa;AAClC,iC;;;;;;;AClBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,2BAA2B,GAAG,2BAA2B,GAAG,YAAY,GAAG,YAAY,GAAG,mBAAmB,GAAG,aAAa;AAC7H;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,mBAAmB;AAC9B,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,EAAE,GAAG,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,mBAAmB;AAC9B,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,mBAAmB,cAAc,GAAG,cAAc,GAAG,cAAc,GAAG,MAAM;AAC5E;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA,mBAAmB,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,MAAM;AAC1C;AACA,2BAA2B;AAC3B,qC;;;;;;;AC9Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uBAAuB;AACvB,6BAA6B,mBAAO,CAAC,EAAsB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8DAA8D;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2C;;;;;;;ACpGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,0BAA0B,GAAG,mCAAmC;AAChE,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,wBAAwB,mBAAO,CAAC,EAAe;AAC/C,kBAAkB,mBAAO,CAAC,EAAW;AACrC,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,8C;;;;;;;ACxGa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAe;AACpC,aAAa,mBAAO,CAAC,EAAW;AAChC,iC;;;;;;;ACfa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6DAA6D;AAC5E;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,uC;;;;;;;ACzFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB,GAAG,4BAA4B;AACjD,qBAAqB,mBAAO,CAAC,EAAc;AAC3C,sBAAsB,mBAAO,CAAC,EAAe;AAC7C;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,6BAA6B,IAAI;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,mC;;;;;;;AC1Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,sC;;;;;;AClJA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,uBAAuB,oCAAoC;AAC3D,uBAAuB,8BAA8B;AACrD,uBAAuB,kBAAkB;;AAEzC;AACA,oCAAoC,8DAA8D;;AAElG;AACA,kCAAkC,sEAAsE;;AAExG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;;AAEA;AACA;AACA;AACA;;AAEA,UAAU,mEAAmE;AAC7E;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe;AACf,mC;;;;;;;AChca;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,wBAAwB,GAAG,cAAc,GAAG,YAAY,GAAG,eAAe,GAAG,cAAc,GAAG,8BAA8B;AAC5H,4BAA4B,mBAAO,CAAC,EAAqB;AACzD,0BAA0B,mBAAO,CAAC,EAAmB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB,qC;;;;;;;ACpEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yBAAyB;AACzB,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,0BAA0B,mBAAO,CAAC,EAAmB;AACrD,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA,WAAW,wBAAwB;AACnC,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6C;;;;;;;ACxDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,2BAA2B;AAC3B,uBAAuB,mBAAO,CAAC,EAAiB;AAChD,gBAAgB,mBAAO,CAAC,EAAU;AAClC;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,+C;;;;;;;AChGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,oBAAoB;AACpB,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,oBAAoB,mBAAO,CAAC,EAAoC;AAChE,eAAe,mBAAO,CAAC,EAA+B;AACtD,eAAe,mBAAO,CAAC,EAAoC;AAC3D,iBAAiB,mBAAO,CAAC,EAAQ;AACjC,kBAAkB,mBAAO,CAAC,EAAW;AACrC,mBAAmB,mBAAO,CAAC,EAAY;AACvC,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6BAA6B;AAC5C,eAAe,wBAAwB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,2BAA2B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,0BAA0B;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qGAAqG,uCAAuC;AAC5I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,KAAK;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oGAAoG,OAAO;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,eAAe,QAAQ;AACvB,eAAe,qBAAqB;AACpC,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB,eAAe,OAAO;AACtB,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW;AAC7E,8BAA8B,SAAS,GAAG,SAAS,IAAI,SAAS,IAAI,WAAW;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,wC;;;;;;ACvXA;;AAEA,kBAAkB,mBAAO,CAAC,EAAkB;;AAE5C,iBAAiB;;AAEjB,oBAAoB;AACpB,0DAA0D,+BAA+B;AACzF;;AAEA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA;AACA;;AAEA,gCAAgC,WAAW;AAC3C,iCAAiC,WAAW;;AAE5C;AACA,GAAG;AACH;;;;;;;;AClCY;;AAEZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACrGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,6CAA6C;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,8CAA8C;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,6BAA6B;AAC5C;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,mC;;;;;;;AC3Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,oBAAoB,mBAAO,CAAC,EAAoC;AAChE,eAAe,mBAAO,CAAC,EAA+B;AACtD,kBAAkB,mBAAO,CAAC,EAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,2BAA2B,aAAa;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oC;;;;;;;ACxRa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,eAAe,GAAG,gBAAgB,GAAG,aAAa;AAChE,aAAa;AACb;AACA;AACA,gBAAgB;AAChB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,+BAA+B;AAC1C,YAAY,EAAE,IAAI,WAAW,WAAW,eAAe,gBAAgB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,iC;;;;;;;AClDa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAY;AACjC,aAAa,mBAAO,CAAC,EAAgB;AACrC,aAAa,mBAAO,CAAC,EAA+B;AACpD,aAAa,mBAAO,CAAC,EAAY;AACjC,iC;;;;;;;AChBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,iBAAiB,mBAAO,CAAC,EAAgB;AACzC,oBAAoB,mBAAO,CAAC,EAAoC;AAChE,cAAc,mBAAO,CAAC,EAAO;AAC7B,kBAAkB,mBAAO,CAAC,EAAW;AACrC,kBAAkB,mBAAO,CAAC,EAAW;AACrC,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,sCAAsC;AACnF;AACA;AACA;AACA,yCAAyC,gBAAgB;AACzD,oCAAoC,6BAA6B;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,mDAAmD,qBAAqB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,yCAAyC;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,yCAAyC;AACxF,2BAA2B,qBAAqB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,mFAAmF;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,gBAAgB;AAChB,oC;;;;;;ACnRA,mBAAO,CAAC,EAA6B;AACrC,qBAAqB,mBAAO,CAAC,EAAgB;AAC7C,OAAO,YAAY,GAAG,mBAAO,CAAC,EAAQ;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,wBAAwB;AACxB;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,KAAK;AACL,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;;AAEA;AACA;AACA,wCAAwC,WAAW;AACnD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA,2BAA2B;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,SAAS;AACT;AACA;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC,cAAc;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,kBAAkB;AACnD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA,iBAAiB;;AAEjB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,8CAA8C,QAAQ;AACtD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA,WAAW;AACX;AACA;AACA;;AAEA,WAAW;AACX;AACA;AACA;;AAEA,WAAW;AACX;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,8CAA8C,QAAQ;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA,KAAK;;AAEL;AACA,8CAA8C,QAAQ;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,8CAA8C,QAAQ;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,CAAC;AACD;AACA;AACA;AACA;AACA,EAAE,KAA0B,oBAAoB,CAAE;AAClD;;AAEA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;;;;;;ACjvBA,OAAO,2BAA2B,GAAG,mBAAO,CAAC,EAAU;AACvD,OAAO,mCAAmC,GAAG,mBAAO,CAAC,EAAa;AAClE,sBAAsB,mBAAO,CAAC,EAAuB;AACrD,kBAAkB,mBAAO,CAAC,EAAmB;AAC7C,OAAO,sCAAsC,GAAG,mBAAO,CAAC,EAAQ;AAChE,OAAO,UAAU,GAAG,mBAAO,CAAC,EAAiB;;AAE7C;;AAEA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,gBAAgB;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,yBAAyB;AACtE,0CAA0C,yBAAyB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,gBAAgB;AACvD;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,OAAO,GAAG,uDAAuD,WAAW,iCAAiC;AACvI;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA,+CAA+C,QAAQ;AACvD,SAAS;AACT,gDAAgD,QAAQ;AACxD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,kCAAkC,QAAQ;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AClNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,gBAAgB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;ACjDA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,gBAAgB,gBAAgB;AAChC;AACA,oBAAoB,KAAK,IAAI,QAAQ;AACrC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACvBA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB,qBAAqB;AACrC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,gBAAgB,iBAAiB;AACjC,KAAK;AACL,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;;;;;ACRA,uBAAuB,mBAAO,CAAC,EAAkB;AACjD,4BAA4B,mBAAO,CAAC,EAAuB;AAC3D,kBAAkB,mBAAO,CAAC,EAAa;;AAEvC;AACA;AACA;AACA;AACA;;;;;;;ACRA,mBAAmB,mBAAO,CAAC,EAAa;AACxC,OAAO,kBAAkB,GAAG,mBAAO,CAAC,EAAoB;;AAExD;AACA;AACA;AACA;AACA,YAAY,KAAsC;AAClD;AACA,MAAM,CAAoG;AAC1G;;;;;;;ACVA;AACA;;AAEA;AACA,MAAM,IAA0C;AAChD,IAAI,oCAAO,OAAO;AAAA;AAAA;AAAA;AAAA,kGAAC;AACnB,GAAG,MAAM,EAIN;AACH,CAAC;;AAED;AACA;;AAEA;AACA,iEAAiE;AACjE;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,CAAC;;;;;;;;;;;;;;AC9CD;AACA,mBAAmB,mBAAO,CAAC,EAAa;AACxC,OAAO,MAAM,GAAG,mBAAO,CAAC,EAAc;;AAEtC;AACA;AACA;AACA;AACA;AACA,uBAAuB,IAAI;AAC3B;AACA,iBAAiB,IAAI,eAAe,eAAe;AACnD,gCAAgC,iBAAiB;AACjD;AACA,iBAAiB,IAAI,cAAc,QAAQ;AAC3C;AACA;;AAEA,yBAAyB,sBAAsB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;AC7DA,mBAAmB,mBAAO,CAAC,EAAa;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,UAAU,SAAS,OAAO,EAAE,EAAE;AACzD,mDAAmD,KAAK;AACxD;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;;;;;;ACtCA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,aAAa,GAAG,IAAoD,oBAAoB,KAAK,EAA8K,CAAC,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,MAAM,SAAmC,CAAC,gBAAgB,OAAC,OAAO,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,iBAAiB,eAAe,sBAAsB,oBAAoB,UAAU,SAAmC,KAAK,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,0GAA0G,qBAAqB,0EAA0E,WAAW,+OAA+O,kBAAkB,sBAAsB,wBAAwB,2GAA2G,2DAA2D,yJAAyJ,sDAAsD,WAAW,kMAAkM,UAAU,EAAE,4BAA4B,qBAAqB,aAAa,4GAA4G,sBAAsB,uGAAuG,aAAa,4BAA4B,mIAAmI,6BAA6B,6GAA6G,IAAI,gCAAgC,yPAAyP,oCAAoC,6IAA6I,aAAa,EAAE,+FAA+F,qBAAqB,aAAa,kCAAkC,SAAS,wCAAwC,kCAAkC,6BAA6B,qCAAqC,wBAAwB,EAAE,wCAAwC,qBAAqB,aAAa,gCAAgC,mBAAmB,MAAM,KAAK,IAAI,YAAY,IAAI,iCAAiC,OAAO,SAAS,GAAG,wBAAwB,sEAAsE,cAAc,MAAM,YAAY,IAAI,4BAA4B,WAAW,iCAAiC,cAAc,MAAM,YAAY,IAAI,uCAAuC,WAAW,oBAAoB,EAAE,aAAa,qBAAqB,aAAa,yKAAyK,GAAG,qBAAqB,aAAa,MAAM,0DAA0D,WAAW,EAAE,OAAO,qBAAqB,aAAa,yLAAyL,gBAAgB,kGAAkG,oEAAoE,mGAAmG,8BAA8B,0FAA0F,gCAAgC,+CAA+C,oCAAoC,oCAAoC,yCAAyC,EAAE,WAAW,8BAA8B,QAAQ,mBAAmB,GAAG,8BAA8B,0BAA0B,+BAA+B,yBAAyB,GAAG,EAAE,iDAAiD,qBAAqB,aAAa,gBAAgB,WAAW,QAAQ,IAAI,yCAAyC,SAAS,wBAAwB,gTAAgT,6CAA6C,iGAAiG,QAAQ,+BAA+B,cAAc,wXAAwX,SAAS,iKAAiK,4HAA4H,sGAAsG,oBAAoB,iRAAiR,6CAA6C,mEAAmE,yGAAyG,kBAAkB,8DAA8D,GAAG,sCAAsC,wEAAwE,oCAAoC,MAAM,8EAA8E,WAAW,wBAAwB,WAAW,EAAE,wBAAwB,sCAAsC,mBAAmB,gHAAgH,kDAAkD,8FAA8F,aAAa,EAAE,oBAAoB,wBAAwB,WAAW,EAAE,0BAA0B,uCAAuC,sBAAsB,8BAA8B,gCAAgC,yBAAyB,eAAe,8BAA8B,aAAa,EAAE,iOAAiO,WAAW,aAAa,aAAa,EAAE,0CAA0C,2IAA2I,0CAA0C,sBAAsB,WAAW,+BAA+B,kBAAkB,wBAAwB,sFAAsF,2BAA2B,WAAW,OAAO,+BAA+B,4LAA4L,+BAA+B,oBAAoB,4CAA4C,YAAY,WAAW,QAAQ,cAAc,UAAU,SAAS,6BAA6B,4BAA4B,4BAA4B,WAAW,gBAAgB,aAAa,EAAE,uFAAuF,qBAAqB,aAAa,kDAAkD,iCAAiC,6DAA6D,IAAI,wBAAwB,IAAI,oBAAoB,kBAAkB,gEAAgE,SAAS,8FAA8F,kBAAkB,8CAA8C,4GAA4G,UAAU,mBAAmB,SAAS,WAAW,UAAU,EAAE,wCAAwC,sBAAsB,aAAa,aAAa,qCAAqC,sIAAsI,aAAa,sDAAsD,YAAY,6DAA6D,UAAU,kJAAkJ,6BAA6B,wCAAwC,EAAE,uEAAuE,sBAAsB,aAAa,uHAAuH,cAAc,mCAAmC,oDAAoD,yBAAyB,KAAK,sBAAsB,6FAA6F,WAAW,EAAE,wBAAwB,WAAW,uBAAuB,EAAE,8FAA8F,6MAA6M,eAAe,mBAAmB,mBAAmB,uCAAuC,4BAA4B,WAAW,oBAAoB,wBAAwB,mBAAmB,kCAAkC,WAAW,KAAK,WAAW,qCAAqC,+MAA+M,EAAE,uDAAuD,GAAG,EAAE,sGAAsG,sBAAsB,aAAa,mDAAmD,gBAAgB,6FAA6F,oDAAoD,WAAW,iDAAiD,QAAQ,aAAa,WAAW,EAAE,yBAAyB,4CAA4C,sBAAsB,uCAAuC,EAAE,8BAA8B,gEAAgE,+BAA+B,iGAAiG,aAAa,EAAE,2CAA2C,sBAAsB,aAAa,oCAAoC,kBAAkB,8BAA8B,WAAW,0BAA0B,qCAAqC,yBAAyB,kBAAkB,sBAAsB,aAAa,EAAE,yDAAyD,sBAAsB,aAAa,EAAE,mCAAmC,sBAAsB,aAAa,WAAW,8DAA8D,sEAAsE,kFAAkF,uBAAuB,yBAAyB,uCAAuC,oBAAoB,mBAAmB,sBAAsB,0BAA0B,sBAAsB,6FAA6F,GAAG,sBAAsB,aAAa,kBAAkB,uCAAuC,IAAI,yUAAyU,iDAAiD,yBAAyB,+BAA+B,wBAAwB,mDAAmD,6SAA6S,mBAAmB,gBAAgB,cAAc,oCAAoC,2PAA2P,gFAAgF,uBAAuB,iBAAiB,cAAc,4DAA4D,OAAO,gBAAgB,8FAA8F,qBAAqB,UAAU,4JAA4J,oBAAoB,SAAS,kCAAkC,kBAAkB,IAAI,sBAAsB,qEAAqE,SAAS,QAAQ,iCAAiC,wBAAwB,EAAE,8BAA8B,wBAAwB,oBAAoB,kBAAkB,yCAAyC,wBAAwB,EAAE,kDAAkD,uBAAuB,oBAAoB,cAAc,oBAAoB,mFAAmF,yCAAyC,oCAAoC,MAAM,WAAW,iCAAiC,YAAY,sBAAsB,8FAA8F,oCAAoC,WAAW,IAAI,oBAAoB,EAAE,sJAAsJ,uKAAuK,+KAA+K,kCAAkC,6BAA6B,SAAS,4BAA4B,4CAA4C,6BAA6B,oDAAoD,kCAAkC,cAAc,iFAAiF,YAAY,EAAE,gNAAgN,sBAAsB,sBAAsB,EAAE,cAAc,sBAAsB,aAAa,wBAAwB,cAAc,eAAe,YAAY,mBAAmB,kBAAkB,2DAA2D,8BAA8B,8CAA8C,gGAAgG,KAAK,uGAAuG,SAAS,+CAA+C,+FAA+F,8CAA8C,kCAAkC,sCAAsC,mEAAmE,uBAAuB,aAAa,EAAE,gCAAgC,sBAAsB,aAAa,oBAAoB,cAAc,0DAA0D,aAAa,wBAAwB,8BAA8B,wBAAwB,6IAA6I,sBAAsB,gCAAgC,kBAAkB,4BAA4B,qBAAqB,qBAAqB,UAAU,yCAAyC,cAAc,4BAA4B,uBAAuB,wBAAwB,gDAAgD,uBAAuB,mCAAmC,oCAAoC,qBAAqB,sBAAsB,8FAA8F,aAAa,EAAE,cAAc,sBAAsB,aAAa,8BAA8B,cAAc,eAAe,6DAA6D,oBAAoB,mEAAmE,uBAAuB,aAAa,EAAE,sCAAsC,sBAAsB,aAAa,wBAAwB,cAAc,eAAe,2DAA2D,yCAAyC,8CAA8C,0CAA0C,+CAA+C,4BAA4B,kCAAkC,oBAAoB,mEAAmE,uBAAuB,aAAa,EAAE,gCAAgC,sBAAsB,aAAa,yBAAyB,cAAc,eAAe,6DAA6D,sDAAsD,sEAAsE,uBAAuB,aAAa,EAAE,iCAAiC,sBAAsB,aAAa,qIAAqI,sBAAsB,qBAAqB,0KAA0K,EAAE,qHAAqH,sBAAsB,aAAa,+LAA+L,GAAG,sBAAsB,aAAa,2CAA2C,cAAc,mDAAmD,qDAAqD,WAAW,qDAAqD,EAAE,aAAa,EAAE,mCAAmC,sBAAsB,aAAa,2CAA2C,aAAa,yDAAyD,iEAAiE,sEAAsE,aAAa,EAAE,gDAAgD,sBAAsB,aAAa,2CAA2C,cAAc,+EAA+E,qDAAqD,MAAM,wCAAwC,+CAA+C,sCAAsC,aAAa,EAAE,mCAAmC,sBAAsB,aAAa,2CAA2C,cAAc,0BAA0B,WAAW,kHAAkH,oGAAoG,aAAa,WAAW,EAAE,+CAA+C,8CAA8C,+BAA+B,kJAAkJ,uCAAuC,qJAAqJ,8BAA8B,2CAA2C,iDAAiD,0CAA0C,kBAAkB,iDAAiD,MAAM,oDAAoD,MAAM,6DAA6D,+BAA+B,aAAa,4CAA4C,EAAE,aAAa,EAAE,mCAAmC,sBAAsB,aAAa,cAAc,yCAAyC,iDAAiD,uEAAuE,wBAAwB,oBAAoB,aAAa,iBAAiB,oBAAoB,gBAAgB,4BAA4B,aAAa,IAAI,mDAAmD,SAAS,qBAAqB,SAAS,mBAAmB,gKAAgK,kBAAkB,uCAAuC,oBAAoB,iFAAiF,oBAAoB,kCAAkC,4BAA4B,uCAAuC,kBAAkB,gCAAgC,8BAA8B,iFAAiF,oEAAoE,WAAW,+BAA+B,kBAAkB,wBAAwB,QAAQ,2BAA2B,WAAW,OAAO,kBAAkB,mGAAmG,mBAAmB,4CAA4C,uBAAuB,4GAA4G,mBAAmB,0BAA0B,aAAa,8BAA8B,6DAA6D,4BAA4B,uHAAuH,iBAAiB,iFAAiF,qDAAqD,qBAAqB,0BAA0B,+CAA+C,aAAa,GAAG,sBAAsB,aAAa,+HAA+H,oBAAoB,2CAA2C,UAAU,kBAAkB,QAAQ,UAAU,4CAA4C,MAAM,wBAAwB,IAAI,kHAAkH,SAAS,mDAAmD,aAAa,uBAAuB,8CAA8C,yDAAyD,0BAA0B,kBAAkB,yBAAyB,UAAU,sBAAsB,IAAI,sBAAsB,UAAU,8DAA8D,gCAAgC,mCAAmC,iBAAiB,qBAAqB,QAAQ,WAAW,mBAAmB,UAAU,+BAA+B,sDAAsD,6CAA6C,WAAW,iCAAiC,SAAS,yCAAyC,8DAA8D,SAAS,KAAK,SAAS,KAAK,KAAK,WAAW,EAAE,QAAQ,kBAAkB,WAAW,+CAA+C,wBAAwB,+BAA+B,uBAAuB,OAAO,mBAAmB,yDAAyD,kBAAkB,iCAAiC,4BAA4B,qIAAqI,mBAAmB,2CAA2C,KAAK,aAAa,EAAE,+IAA+I,sBAAsB,aAAa,kPAAkP,KAAK,yBAAyB,IAAI,yBAAyB,uBAAuB,OAAO,SAAS,IAAI,6FAA6F,yDAAyD,SAAS,YAAY,IAAI,6CAA6C,SAAS,iBAAiB,EAAE,qBAAqB,sBAAsB,aAAa,gHAAgH,MAAM,wDAAwD,aAAa,+CAA+C,aAAa,4BAA4B,yCAAyC,2DAA2D,6BAA6B,QAAQ,IAAI,2JAA2J,wDAAwD,IAAI,6QAA6Q,SAAS,IAAI,0BAA0B,gFAAgF,wCAAwC,UAAU,IAAI,4BAA4B,uCAAuC,KAAK,2BAA2B,SAAS,sBAAsB,yFAAyF,sFAAsF,uDAAuD,sDAAsD,8DAA8D,wCAAwC,iBAAiB,QAAQ,qGAAqG,+BAA+B,mBAAmB,oBAAoB,MAAM,iDAAiD,sBAAsB,KAAK,qCAAqC,QAAQ,oJAAoJ,iCAAiC,EAAE,8BAA8B,iDAAiD,yCAAyC,sBAAsB,2EAA2E,WAAW,sCAAsC,EAAE,sBAAsB,EAAE,2EAA2E,sBAAsB,aAAa,sGAAsG,cAAc,SAAS,gBAAgB,YAAY,WAAW,6BAA6B,SAAS,wBAAwB,uBAAuB,IAAI,qBAAqB,OAAO,EAAE,SAAS,IAAI,6FAA6F,gCAAgC,SAAS,sDAAsD,OAAO,iCAAiC,wBAAwB,iDAAiD,KAAK,IAAI,6KAA6K,kBAAkB,6BAA6B,iBAAiB,WAAW,iCAAiC,SAAS,iBAAiB,sBAAsB,IAAI,kFAAkF,SAAS,UAAU,yBAAyB,IAAI,iFAAiF,SAAS,UAAU,KAAK,cAAc,kCAAkC,2GAA2G,IAAI,KAAK,iCAAiC,SAAS,kBAAkB,4BAA4B,gBAAgB,YAAY,WAAW,cAAc,SAAS,sBAAsB,SAAS,UAAU,2BAA2B,gCAAgC,yBAAyB,qCAAqC,wBAAwB,qCAAqC,wBAAwB,qCAAqC,UAAU,yCAAyC,gCAAgC,wBAAwB,yBAAyB,wBAAwB,2BAA2B,gBAAgB,mBAAmB,4BAA4B,mBAAmB,oDAAoD,sCAAsC,yBAAyB,wBAAwB,2CAA2C,eAAe,2BAA2B,gCAAgC,yBAAyB,gBAAgB,qCAAqC,2BAA2B,eAAe,2BAA2B,gCAAgC,yBAAyB,yCAAyC,wBAAwB,qCAAqC,cAAc,6BAA6B,uBAAuB,kBAAkB,qBAAqB,kBAAkB,yBAAyB,wPAAwP,4BAA4B,+EAA+E,qEAAqE,aAAa,QAAQ,iBAAiB,0EAA0E,SAAS,yBAAyB,aAAa,uBAAuB,EAAE,0BAA0B,cAAc,0CAA0C,qBAAqB,aAAa,QAAQ,mBAAmB,gGAAgG,SAAS,sCAAsC,6CAA6C,kLAAkL,qBAAqB,qBAAqB,mBAAmB,uBAAuB,kBAAkB,wBAAwB,IAAI,mBAAmB,uBAAuB,sTAAsT,GAAG,EAAE,sFAAsF,sBAAsB,aAAa,iHAAiH,cAAc,iCAAiC,aAAa,2BAA2B,0CAA0C,qBAAqB,gCAAgC,2GAA2G,2BAA2B,wBAAwB,wBAAwB,oCAAoC,iCAAiC,kCAAkC,sUAAsU,2GAA2G,mDAAmD,uCAAuC,2XAA2X,8CAA8C,IAAI,0GAA0G,uBAAuB,8CAA8C,2OAA2O,2BAA2B,QAAQ,QAAQ,oBAAoB,yKAAyK,2BAA2B,MAAM,gDAAgD,yDAAyD,WAAW,iBAAiB,oEAAoE,6NAA6N,6BAA6B,gEAAgE,0QAA0Q,wBAAwB,QAAQ,gWAAgW,mLAAmL,ybAAyb,mJAAmJ,gDAAgD,qDAAqD,UAAU,uEAAuE,6EAA6E,2BAA2B,iBAAiB,kBAAkB,2FAA2F,aAAa,EAAE,iGAAiG,sBAAsB,aAAa,2IAA2I,gBAAgB,kCAAkC,aAAa,uBAAuB,2BAA2B,oBAAoB,iCAAiC,2BAA2B,QAAQ,iUAAiU,yBAAyB,kEAAkE,YAAY,+KAA+K,gHAAgH,6BAA6B,8NAA8N,mBAAmB,ySAAyS,mHAAmH,8BAA8B,mDAAmD,4BAA4B,oOAAoO,kCAAkC,wBAAwB,mCAAmC,iUAAiU,6BAA6B,2CAA2C,0CAA0C,EAAE,YAAY,oEAAoE,uBAAuB,cAAc,uBAAuB,wCAAwC,kHAAkH,KAAK,uCAAuC,+BAA+B,KAAK,qCAAqC,oDAAoD,0CAA0C,kCAAkC,KAAK,wCAAwC,yDAAyD,sCAAsC,8BAA8B,MAAM,iBAAiB,uGAAuG,YAAY,yCAAyC,8BAA8B,MAAM,iBAAiB,0GAA0G,aAAa,aAAa,EAAE,sHAAsH,sBAAsB,aAAa,kBAAkB,oMAAoM,mEAAmE,kIAAkI,aAAa,2BAA2B,sBAAsB,IAAI,mDAAmD,iDAAiD,wEAAwE,wBAAwB,oFAAoF,SAAS,4BAA4B,qBAAqB,qBAAqB,4CAA4C,0BAA0B,8DAA8D,+BAA+B,2GAA2G,+BAA+B,sFAAsF,8BAA8B,oHAAoH,2FAA2F,8FAA8F,KAAK,WAAW,wBAAwB,YAAY,EAAE,mHAAmH,sBAAsB,aAAa,aAAa,uDAAuD,MAAM,mDAAmD,aAAa,iBAAiB,eAAe,gBAAgB,yIAAyI,yCAAyC,gCAAgC,iEAAiE,2CAA2C,YAAY,iBAAiB,KAAK,2BAA2B,iCAAiC,wBAAwB,SAAS,aAAa,QAAQ,KAAK,mBAAmB,EAAE,EAAE,kBAAkB,MAAM,QAAQ,WAAW,KAAK,sBAAsB,uBAAuB,2FAA2F,EAAE,GAAG,sBAAsB,aAAa,qBAAqB,cAAc,QAAQ,8CAA8C,cAAc,2EAA2E,gEAAgE,kBAAkB,wLAAwL,kBAAkB,aAAa,MAAM,IAAI,OAAO,SAAS,qBAAqB,qFAAqF,EAAE,cAAc,gBAAgB,yFAAyF,sBAAsB,gBAAgB,SAAS,cAAc,wBAAwB,cAAc,yBAAyB,mBAAmB,OAAO,EAAE,+BAA+B,gBAAgB,SAAS,IAAI,gCAAgC,SAAS,2BAA2B,SAAS,4CAA4C,oCAAoC,uBAAuB,6BAA6B,sCAAsC,SAAS,EAAE,aAAa,sCAAsC,QAAQ,EAAE,EAAE,+BAA+B,yBAAyB,gCAAgC,0FAA0F,8BAA8B,2FAA2F,uCAAuC,0BAA0B,4CAA4C,mCAAmC,sCAAsC,yBAAyB,2CAA2C,kCAAkC,yBAAyB,aAAa,iDAAiD,cAAc,YAAY,KAAK,sBAAsB,8BAA8B,MAAM,6BAA6B,SAAS,wBAAwB,sBAAsB,8BAA8B,MAAM,4BAA4B,SAAS,uBAAuB,oDAAoD,sBAAsB,kBAAkB,qBAAqB,mBAAmB,WAAW,8GAA8G,oBAAoB,8BAA8B,8CAA8C,MAAM,WAAW,SAAS,gBAAgB,8BAA8B,yCAAyC,aAAa,wBAAwB,GAAG,oBAAoB,8GAA8G,oBAAoB,8BAA8B,6BAA6B,MAAM,yCAAyC,yBAAyB,aAAa,wBAAwB,EAAE,UAAU,EAAE,aAAa,sBAAsB,aAAa,SAAS,kHAAkH,EAAE,wFAAwF,sBAAsB,aAAa,iKAAiK,cAAc,wCAAwC,uBAAuB,2EAA2E,MAAM,EAAE,mBAAmB,uMAAuM,oFAAoF,+BAA+B,kEAAkE,MAAM,wNAAwN,mBAAmB,gBAAgB,eAAe,4CAA4C,gBAAgB,+BAA+B,6CAA6C,uBAAuB,+KAA+K,GAAG,4IAA4I,2LAA2L,8CAA8C,mHAAmH,gCAAgC,oBAAoB,+BAA+B,+JAA+J,oDAAoD,cAAc,gBAAgB,sBAAsB,cAAc,kBAAkB,EAAE,sGAAsG,sBAAsB,aAAa,+LAA+L,cAAc,wCAAwC,uBAAuB,mCAAmC,MAAM,EAAE,mBAAmB,yVAAyV,6CAA6C,oCAAoC,4DAA4D,gBAAgB,eAAe,4CAA4C,gBAAgB,+BAA+B,oFAAoF,uBAAuB,sMAAsM,GAAG,8WAA8W,+XAA+X,2DAA2D,sLAAsL,gCAAgC,oBAAoB,+BAA+B,oKAAoK,oDAAoD,cAAc,gBAAgB,YAAY,EAAE,iJAAiJ,sBAAsB,aAAa,sGAAsG,qBAAqB,kDAAkD,SAAS,EAAE,gBAAgB,MAAM,kEAAkE,iDAAiD,SAAS,2BAA2B,iEAAiE,OAAO,6BAA6B,qDAAqD,iBAAiB,IAAI,kBAAkB,2BAA2B,gBAAgB,qBAAqB,IAAI,mBAAmB,yCAAyC,IAAI,kCAAkC,UAAU,IAAI,6BAA6B,YAAY,IAAI,kBAAkB,2BAA2B,8BAA8B,uBAAuB,oIAAoI,eAAe,GAAG,sBAAsB,aAAa,8BAA8B,IAAI,oCAAoC,SAAS,KAAK,IAAI,kDAAkD,SAAS,KAAK,8BAA8B,MAAM,wDAAwD,gBAAgB,oGAAoG,iBAAiB,IAAI,iCAAiC,SAAS,yCAAyC,6BAA6B,QAAQ,IAAI,2JAA2J,0BAA0B,IAAI,6QAA6Q,SAAS,6BAA6B,qBAAqB,6BAA6B,8CAA8C,IAAI,yBAAyB,SAAS,4BAA4B,2CAA2C,UAAU,IAAI,4BAA4B,uCAAuC,KAAK,2BAA2B,SAAS,sBAAsB,yFAAyF,cAAc,4BAA4B,MAAM,iDAAiD,sBAAsB,KAAK,sCAAsC,EAAE,cAAc,sBAAsB,aAAa,4BAA4B,yCAAyC,MAAM,EAAE,qBAAqB,yBAAyB,EAAE,kBAAkB,kBAAkB,GAAG,sBAAsB,aAAa,WAAW,+XAA+X,GAAG,sBAAsB,aAAa,iBAAiB,mBAAmB,MAAM,KAAK,IAAI,YAAY,IAAI,iCAAiC,OAAO,SAAS,GAAG,4BAA4B,cAAc,MAAM,YAAY,IAAI,4BAA4B,YAAY,GAAG,sBAAsB,aAAa,6KAA6K,gBAAgB,oBAAoB,cAAc,uBAAuB,cAAc,mBAAmB,OAAO,QAAQ,cAAc,0BAA0B,iNAAiN,gBAAgB,qHAAqH,gBAAgB,6BAA6B,gBAAgB,sEAAsE,gBAAgB,6LAA6L,oEAAoE,GAAG,+DAA+D,SAAS,IAAI,mJAAmJ,wBAAwB,kCAAkC,sBAAsB,4BAA4B,oCAAoC,cAAc,mCAAmC,GAAG,+DAA+D,wGAAwG,uCAAuC,EAAE,UAAU,uCAAuC,EAAE,KAAK,6BAA6B,sZAAsZ,sKAAsK,GAAG,0CAA0C,gBAAgB,aAAa,EAAE,kBAAkB,sCAAsC,yBAAyB,8XAA8X,qBAAqB,+KAA+K,EAAE,aAAa,iJAAiJ,wEAAwE,8CAA8C,sIAAsI,gBAAgB,eAAe,EAAE,kBAAkB,sCAAsC,yBAAyB,yeAAye,wIAAwI,oLAAoL,EAAE,kGAAkG,2BAA2B,iHAAiH,oDAAoD,yNAAyN,sBAAsB,mFAAmF,aAAa,8nCAA8nC,cAAc,MAAM,6MAA6M,cAAc,aAAa,yUAAyU,wBAAwB,eAAe,QAAQ,+GAA+G,aAAa,YAAY,ueAAue,+BAA+B,YAAY,sDAAsD,EAAE,mBAAmB,wCAAwC,yBAAyB,sCAAsC,sBAAsB,kHAAkH,iFAAiF,oHAAoH,0NAA0N,uBAAuB,yFAAyF,4DAA4D,yBAAyB,YAAY,4CAA4C,yGAAyG,mrBAAmrB,KAAK,2BAA2B,qLAAqL,oCAAoC,gBAAgB,0MAA0M,gDAAgD,0IAA0I,iBAAiB,mCAAmC,YAAY,GAAG,mKAAmK,IAAI,MAAM,oFAAoF,aAAa,8GAA8G,iBAAiB,sCAAsC,YAAY,GAAG,mKAAmK,IAAI,MAAM,0FAA0F,aAAa,mGAAmG,kBAAkB,iMAAiM,iDAAiD,yDAAyD,iDAAiD,2DAA2D,mCAAmC,WAAW,EAAE,4CAA4C,kBAAkB,MAAM,kIAAkI,0GAA0G,mCAAmC,4BAA4B,EAAE,mBAAmB,uCAAuC,yBAAyB,0GAA0G,eAAe,IAAI,2GAA2G,gFAAgF,mPAAmP,0GAA0G,2BAA2B,yFAAyF,mMAAmM,6SAA6S,0BAA0B,MAAM,kIAAkI,sCAAsC,+BAA+B,yBAAyB,uEAAuE,gRAAgR,eAAe,EAAE,qCAAqC,yHAAyH,EAAE,kCAAkC,8LAA8L,oDAAoD,EAAE,8EAA8E,sBAAsB,aAAa,qBAAqB,wIAAwI,GAAG,sBAAsB,aAAa,wBAAwB,sDAAsD,yPAAyP,KAAK,qDAAqD,QAAQ,EAAE,uDAAuD,KAAK,YAAY,cAAc,4BAA4B,WAAW,SAAS,UAAU,QAAQ,8CAA8C,QAAQ,6HAA6H,QAAQ,EAAE,4CAA4C,cAAc,4BAA4B,WAAW,wCAAwC,QAAQ,wFAAwF,gDAAgD,QAAQ,0BAA0B,sBAAsB,gDAAgD,QAAQ,kBAAkB,eAAe,SAAS,kBAAkB,EAAE,WAAW,aAAa,sBAAsB,SAAS,kBAAkB,EAAE,YAAY,WAAW,kBAAkB,EAAE,YAAY,oBAAoB,SAAS,kBAAkB,EAAE,UAAU,KAAK,IAAI,gDAAgD,wCAAwC,KAAK,UAAU,mDAAmD,EAAE,wCAAwC,OAAO,OAAO,gBAAgB,yIAAyI,GAAG,sBAAsB,aAAa,+HAA+H,cAAc,8DAA8D,aAAa,+fAA+f,cAAc,MAAM,0QAA0Q,cAAc,MAAM,mEAAmE,gBAAgB,QAAQ,mKAAmK,gBAAgB,QAAQ,8EAA8E,aAAa,cAAc,MAAM,MAAM,6CAA6C,MAAM,eAAe,KAAK,MAAM,eAAe,KAAK,MAAM,eAAe,KAAK,MAAM,eAAe,iCAAiC,OAAO,MAAM,KAAK,eAAe,4BAA4B,OAAO,OAAO,kDAAkD,oBAAoB,gBAAgB,kYAAkY,kFAAkF,eAAe,0CAA0C,2HAA2H,8DAA8D,0IAA0I,QAAQ,gBAAgB,sBAAsB,UAAU,MAAM,KAAK,KAAK,EAAE,iBAAiB,sBAAsB,wBAAwB,0EAA0E,MAAM,6EAA6E,yCAAyC,MAAM,cAAc,6CAA6C,MAAM,gDAAgD,mBAAmB,sCAAsC,MAAM,uDAAuD,MAAM,YAAY,KAAK,EAAE,iBAAiB,sBAAsB,+BAA+B,6CAA6C,MAAM,kBAAkB,2CAA2C,MAAM,8GAA8G,YAAY,KAAK,EAAE,iBAAiB,sBAAsB,yIAAyI,YAAY,KAAK,EAAE,iBAAiB,sBAAsB,8HAA8H,wBAAwB,KAAK,KAAK,EAAE,iBAAiB,sBAAsB,gHAAgH,iCAAiC,SAAS,oQAAoQ,oBAAoB,wBAAwB,iBAAiB,QAAQ,mFAAmF,EAAE,+DAA+D,gCAAgC,oBAAoB,wBAAwB,iBAAiB,QAAQ,sFAAsF,EAAE,+DAA+D,mCAAmC,SAAS,uBAAuB,KAAK,KAAK,EAAE,iBAAiB,sBAAsB,wBAAwB,sCAAsC,MAAM,MAAM,8EAA8E,MAAM,aAAa,KAAK,EAAE,iBAAiB,sBAAsB,qCAAqC,yGAAyG,4BAA4B,gCAAgC,mBAAmB,0BAA0B,MAAM,KAAK,IAAI,EAAE,iBAAiB,sBAAsB,mCAAmC,iBAAiB,MAAM,qCAAqC,YAAY,QAAQ,iBAAiB,MAAM,4CAA4C,YAAY,MAAM,4BAA4B,KAAK,EAAE,iBAAiB,sBAAsB,8BAA8B,+CAA+C,MAAM,kDAAkD,kBAAkB,uBAAuB,uCAAuC,sDAAsD,MAAM,UAAU,MAAM,aAAa,KAAK,EAAE,iBAAiB,sBAAsB,mHAAmH,sDAAsD,MAAM,mBAAmB,aAAa,eAAe,EAAE,KAAK,IAAI,EAAE,iBAAiB,sBAAsB,oCAAoC,KAAK,UAAU,uBAAuB,qCAAqC,eAAe,6DAA6D,2CAA2C,MAAM,mBAAmB,aAAa,sBAAsB,EAAE,KAAK,wEAAwE,EAAE,iBAAiB,sBAAsB,uCAAuC,KAAK,WAAW,UAAU,IAAI,EAAE,iBAAiB,sBAAsB,2BAA2B,4CAA4C,MAAM,yCAAyC,gBAAgB,UAAU,IAAI,EAAE,iBAAiB,sBAAsB,sCAAsC,KAAK,UAAU,IAAI,EAAE,iBAAiB,sBAAsB,yCAAyC,4BAA4B,4CAA4C,MAAM,KAAK,IAAI,qBAAqB,qBAAqB,oBAAoB,uDAAuD,MAAM,kBAAkB,eAAe,iEAAiE,8CAA8C,MAAM,wCAAwC,gBAAgB,yEAAyE,wCAAwC,MAAM,2BAA2B,kBAAkB,yBAAyB,iMAAiM,MAAM,aAAa,wEAAwE,EAAE,iBAAiB,sBAAsB,kBAAkB,gBAAgB,6EAA6E,EAAE,iBAAiB,sBAAsB,sBAAsB,2CAA2C,UAAU,MAAM,SAAS,oBAAoB,MAAM,SAAS,8CAA8C,MAAM,uBAAuB,oBAAoB,cAAc,IAAI,EAAE,iBAAiB,sBAAsB,mEAAmE,yBAAyB,aAAa,0EAA0E,EAAE,iBAAiB,sBAAsB,eAAe,gBAAgB,8EAA8E,EAAE,iBAAiB,sBAAsB,sBAAsB,+BAA+B,wCAAwC,MAAM,kCAAkC,oBAAoB,cAAc,IAAI,EAAE,iBAAiB,sBAAsB,mEAAmE,oBAAoB,gDAAgD,MAAM,UAAU,yBAAyB,qBAAqB,mCAAmC,gDAAgD,MAAM,iFAAiF,iCAAiC,gCAAgC,kBAAkB,EAAE,0BAA0B,MAAM,yBAAyB,8BAA8B,MAAM,mBAAmB,KAAK,KAAK,EAAE,iBAAiB,sBAAsB,qIAAqI,uCAAuC,MAAM,MAAM,UAAU,4BAA4B,KAAK,KAAK,EAAE,iBAAiB,sBAAsB,6BAA6B,yCAAyC,MAAM,MAAM,UAAU,YAAY,QAAQ,aAAa,QAAQ,iBAAiB,yBAAyB,8dAA8d,0BAA0B,yBAAyB,cAAc,gDAAgD,kCAAkC,MAAM,qEAAqE,sCAAsC,iBAAiB,wIAAwI,oDAAoD,EAAE,gFAAgF,sBAAsB,aAAa,sbAAsb,oCAAoC,iIAAiI,QAAQ,MAAM,WAAW,QAAQ,IAAI,gBAAgB,aAAa,eAAe,KAAK,sEAAsE,QAAQ,cAAc,KAAK,qBAAqB,MAAM,kCAAkC,gCAAgC,eAAe,KAAK,qBAAqB,QAAQ,IAAI,mCAAmC,+IAA+I,MAAM,EAAE,wFAAwF,yCAAyC,EAAE,aAAa,IAAI,OAAO,0CAA0C,eAAe,YAAY,mBAAmB,mCAAmC,yBAAyB,WAAW,+CAA+C,4BAA4B,oDAAoD,EAAE,qBAAqB,sBAAsB,aAAa,WAAW,4KAA4K,GAAG,sBAAsB,aAAa,2BAA2B,cAAc,mBAAmB,OAAO,QAAQ,kQAAkQ,KAAK,oBAAoB,KAAK,qBAAqB,KAAK,qBAAqB,KAAK,oBAAoB,KAAK,0BAA0B,sBAAsB,iHAAiH,gBAAgB,iDAAiD,cAAc,iCAAiC,gBAAgB,sEAAsE,kBAAkB,oJAAoJ,kBAAkB,qBAAqB,gBAAgB,YAAY,0BAA0B,EAAE,aAAa,kBAAkB,6BAA6B,QAAQ,KAAK,uBAAuB,QAAQ,KAAK,KAAK,eAAe,6BAA6B,cAAc,MAAM,QAAQ,MAAM,uBAAuB,QAAQ,KAAK,uBAAuB,QAAQ,KAAK,qBAAqB,mEAAmE,cAAc,uGAAuG,oBAAoB,gBAAgB,0CAA0C,kBAAkB,2BAA2B,iGAAiG,+BAA+B,YAAY,kBAAkB,gBAAgB,uBAAuB,0NAA0N,EAAE,WAAW,gBAAgB,kGAAkG,oCAAoC,IAAI,kEAAkE,KAAK,aAAa,gGAAgG,iCAAiC,KAAK,aAAa,QAAQ,wPAAwP,EAAE,6CAA6C,2KAA2K,QAAQ,KAAK,oBAAoB,+CAA+C,MAAM,wKAAwK,UAAU,GAAG,UAAU,kBAAkB,KAAK,wDAAwD,WAAW,QAAQ,MAAM,wBAAwB,MAAM,qFAAqF,wBAAwB,kBAAkB,gCAAgC,8CAA8C,KAAK,mMAAmM,kBAAkB,gCAAgC,2BAA2B,KAAK,2CAA2C,YAAY,wBAAwB,EAAE,6IAA6I,iDAAiD,KAAK,SAAS,oBAAoB,UAAU,6GAA6G,uBAAuB,eAAe,+BAA+B,UAAU,KAAK,mBAAmB,UAAU,aAAa,mBAAmB,KAAK,mBAAmB,UAAU,aAAa,UAAU,KAAK,sBAAsB,YAAY,iBAAiB,QAAQ,KAAK,WAAW,QAAQ,OAAO,uBAAuB,KAAK,OAAO,uBAAuB,KAAK,OAAO,uBAAuB,KAAK,OAAO,uBAAuB,mBAAmB,KAAK,6BAA6B,0EAA0E,+HAA+H,0DAA0D,YAAY,+DAA+D,mBAAmB,QAAQ,MAAM,iDAAiD,0EAA0E,SAAS,MAAM,qCAAqC,SAAS,+CAA+C,MAAM,8FAA8F,8BAA8B,KAAK,kCAAkC,oLAAoL,MAAM,2CAA2C,IAAI,+BAA+B,0CAA0C,2FAA2F,6BAA6B,kRAAkR,yBAAyB,MAAM,qKAAqK,EAAE,qBAAqB,sBAAsB,aAAa,qBAAqB,6LAA6L,GAAG,sBAAsB,aAAa,kEAAkE,gCAAgC,0CAA0C,GAAG,EAAE,GAAG,WAAW,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,gCAAgC,qBAAM,CAAC,qBAAM,mEAAmE,EAAE,GAAG,EAAE,GAAG,SAAS,E;;;;;;;ACZt1xG;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAa;AAClC,aAAa,mBAAO,CAAC,EAAiB;AACtC,aAAa,mBAAO,CAAC,EAAa;AAClC,aAAa,mBAAO,CAAC,EAAuB;AAC5C,8BAA8B,mBAAO,CAAC,EAAuB;AAC7D,eAAe;AACf,iC;;;;;;;AClBa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,qBAAqB;AACrB,aAAa,mBAAO,CAAC,EAAS;AAC9B,wBAAwB,mBAAO,CAAC,EAAiB;AACjD,iDAAgD,CAAC,qCAAqC,sCAAsC,EAAE,EAAE,EAAC;AACjI;AACA;AACA;AACA,iC;;;;;;;ACnBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,qBAAqB;AACrB,eAAe,mBAAO,CAAC,EAAiB;AACxC,sBAAsB,mBAAO,CAAC,GAAa;AAC3C,oBAAoB,mBAAO,CAAC,GAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,IAAI;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,+BAA+B,IAAI,+BAA+B;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,+BAA+B,IAAI,+BAA+B;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,+BAA+B,IAAI,+BAA+B,IAAI,SAAS;AACpG,qBAAqB,+BAA+B,IAAI,+BAA+B;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA,6EAA6E,0BAA0B;AACvG;AACA;AACA;AACA;AACA;AACA,8DAA8D,SAAS;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD,yBAAyB,iCAAiC;AAC1D;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yC;;;;;;ACrMA;AACA,eAAe,KAAiD,oBAAoB,CAAiH,CAAC,oBAAoB,YAAY,OAAO,cAAc,aAAa,sCAAsC,SAAS,iBAAiB,yCAAyC,6BAA6B,gBAAgB,EAAE,0FAA0F,oBAAoB,gBAAgB,WAAW,sBAAsB,uBAAuB,IAAI,iCAAiC,SAAS,kBAAkB,sBAAsB,uBAAuB,IAAI,wCAAwC,SAAS,UAAU,uBAAuB,IAAI,KAAK,4BAA4B,qCAAqC,0CAA0C,kMAAkM,oBAAoB,eAAe,0HAA0H,cAAc,qBAAqB,QAAQ,0CAA0C,2BAA2B,uBAAuB,IAAI,KAAK,qBAAqB,qBAAqB,YAAY,OAAO,0DAA0D,UAAU,iCAAiC,kCAAkC,8BAA8B,SAAS,gBAAgB,mCAAmC,IAAI,oFAAoF,mBAAmB,gEAAgE,cAAc,gCAAgC,2BAA2B,oDAAoD,mCAAmC,IAAI,yJAAyJ,uCAAuC,SAAS,uBAAuB,kEAAkE,gDAAgD,4CAA4C,aAAa,8HAA8H,mBAAmB,0EAA0E,mBAAmB,2EAA2E,YAAY,wGAAwG,QAAQ,4BAA4B,cAAc,2BAA2B,IAAI,mCAAmC,SAAS,gCAAgC,mBAAmB,6EAA6E,4BAA4B,UAAU,yCAAyC,UAAU,eAAe,aAAa,sCAAsC,SAAS,iBAAiB,yCAAyC,QAAQ,gBAAgB,EAAE,qtBAAqtB,gBAAgB,wBAAwB,iBAAiB,yBAAyB,cAAc,oEAAoE,+DAA+D,gGAAgG,YAAY,mBAAmB,mCAAmC,IAAI,mDAAmD,UAAU,wCAAwC,cAAc,qBAAqB,UAAU,wFAAwF,YAAY,IAAI,KAAK,aAAa,4NAA4N,oBAAoB,eAAe,qGAAqG,QAAQ,2BAA2B,uBAAuB,IAAI,KAAK,qBAAqB,qBAAqB,YAAY,OAAO,0DAA0D,UAAU,wDAAwD,iBAAiB,iBAAiB,gBAAgB,mCAAmC,IAAI,gGAAgG,qBAAqB,mCAAmC,IAAI,2CAA2C,uCAAuC,4CAA4C,0BAA0B,yCAAyC,8BAA8B,wCAAwC,MAAM,8BAA8B,uBAAuB,kCAAkC,kBAAkB,+DAA+D,yCAAyC,wBAAwB,UAAU,uBAAuB,IAAI,KAAK,aAAa,8CAA8C,QAAQ,YAAY,iBAAiB,8BAA8B,sBAAsB,kEAAkE,yCAAyC,wBAAwB,uBAAuB,IAAI,KAAK,aAAa,+BAA+B,+BAA+B,4DAA4D,0BAA0B,qFAAqF,UAAU,YAAY,aAAa,sCAAsC,SAAS,sBAAsB,QAAQ,mBAAmB,eAAe,MAAM,wJAAwJ,eAAe,QAAQ,4CAA4C,WAAW,kBAAkB,eAAe,MAAM,gDAAgD,WAAW,8BAA8B,mBAAmB,qFAAqF,eAAe,aAAa,sCAAsC,SAAS,sOAAsO,mFAAmF,kBAAkB,uBAAuB,iBAAiB,eAAe,yBAAyB,qBAAqB,yBAAyB,qBAAqB,wBAAwB,kBAAkB,+CAA+C,mCAAmC,SAAS,2BAA2B,yCAAyC,2DAA2D,WAAW,gBAAgB,4BAA4B,qBAAqB,6DAA6D,uBAAuB,gBAAgB,uCAAuC,QAAQ,8BAA8B,oBAAoB,8CAA8C,oBAAoB,IAAI,eAAe,wCAAwC,gBAAgB,qDAAqD,YAAY,IAAI,UAAU,gBAAgB,sCAAsC,OAAO,qCAAqC,4BAA4B,YAAY,IAAI,mCAAmC,SAAS,+BAA+B,aAAa,kBAAkB,oBAAoB,8BAA8B,KAAK,WAAW,6DAA6D,kBAAkB,0FAA0F,IAAI,yCAAyC,0BAA0B,sGAAsG,EAAE,YAAY,uBAAuB,8CAA8C,2CAA2C,sCAAsC,8CAA8C,gCAAgC,gDAAgD,8BAA8B,0BAA0B,4CAA4C,sCAAsC,8CAA8C,gCAAgC,gDAAgD,+BAA+B,uBAAuB,8CAA8C,sCAAsC,gBAAgB,gCAAgC,oCAAoC,+BAA+B,SAAS,oEAAoE,iFAAiF,iBAAiB,iBAAiB,YAAY,IAAI,gBAAgB,4BAA4B,gBAAgB,IAAI,yEAAyE,SAAS,8BAA8B,qBAAqB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,gkBAAgkB,aAAa,gCAAgC,6BAA6B,eAAe,mCAAmC,6BAA6B,gBAAgB,2CAA2C,6BAA6B,wBAAwB,uCAAuC,6BAA6B,oBAAoB,uCAAuC,6BAA6B,oBAAoB,iCAAiC,6BAA6B,cAAc,mCAAmC,6BAA6B,gBAAgB,oCAAoC,6BAA6B,iBAAiB,iDAAiD,6BAA6B,8BAA8B,kDAAkD,6BAA6B,+BAA+B,oDAAoD,6BAA6B,iCAAiC,yCAAyC,6BAA6B,sBAAsB,2DAA2D,6BAA6B,wCAAwC,sDAAsD,6BAA6B,mCAAmC,EAAE,aAAa,gCAAgC,6BAA6B,kBAAkB,EAAE,aAAa,+BAA+B,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,EAAE,aAAa,aAAa,sCAAsC,SAAS,EAAE,wBAAwB,eAAe,qBAAqB,2EAA2E,eAAe,oBAAoB,mCAAmC,qMAAqM,uBAAuB,eAAe,uBAAuB,kBAAkB,qBAAqB,kBAAkB,oBAAoB,kBAAkB,8BAA8B,gDAAgD,mBAAmB,sDAAsD,mBAAmB,sDAAsD,mBAAmB,qFAAqF,mBAAmB,sBAAsB,eAAe,sBAAsB,gBAAgB,sBAAsB,mBAAmB,KAAK,OAAO,KAAK,gDAAgD,YAAY,eAAe,aAAa,sCAAsC,SAAS,oFAAoF,eAAe,wIAAwI,yJAAyJ,sBAAsB,0CAA0C,0BAA0B,+CAA+C,aAAa,aAAa,sCAAsC,SAAS,6HAA6H,YAAY,kBAAkB,eAAe,aAAa,sCAAsC,SAAS,yCAAyC,eAAe,MAAM,aAAa,kFAAkF,iCAAiC,eAAe,YAAY,qCAAqC,YAAY,gDAAgD,eAAe,wIAAwI,aAAa,uTAAuT,cAAc,uNAAuN,2BAA2B,eAAe,kDAAkD,WAAW,sCAAsC,oBAAoB,0CAA0C,mCAAmC,wBAAwB,6IAA6I,uBAAuB,IAAI,yCAAyC,SAAS,wBAAwB,mCAAmC,sCAAsC,uBAAuB,IAAI,mCAAmC,+BAA+B,oBAAoB,eAAe,aAAa,sCAAsC,SAAS,iBAAiB,eAAe,2BAA2B,cAAc,QAAQ,aAAa,iBAAiB,eAAe,iBAAiB,0BAA0B,8BAA8B,0CAA0C,mBAAmB,iBAAiB,qCAAqC,UAAU,eAAe,aAAa,sCAAsC,SAAS,kBAAkB,eAAe,2BAA2B,eAAe,UAAU,EAAE,wCAAwC,WAAW,iEAAiE,mBAAmB,kBAAkB,YAAY,IAAI,6JAA6J,2BAA2B,IAAI,wEAAwE,KAAK,oBAAoB,YAAY,IAAI,wEAAwE,UAAU,WAAW,aAAa,aAAa,sCAAsC,SAAS,uCAAuC,cAAc,aAAa,sCAAsC,SAAS,kBAAkB,eAAe,2BAA2B,eAAe,iBAAiB,EAAE,sCAAsC,WAAW,gFAAgF,WAAW,eAAe,aAAa,sCAAsC,SAAS,kBAAkB,iCAAiC,2BAA2B,gBAAgB,EAAE,8BAA8B,uDAAuD,8IAA8I,WAAW,4BAA4B,yCAAyC,qCAAqC,QAAQ,yBAAyB,IAAI,iDAAiD,SAAS,2BAA2B,0DAA0D,yBAAyB,uBAAuB,YAAY,kBAAkB,IAAI,wGAAwG,gEAAgE,WAAW,eAAe,aAAa,sCAAsC,SAAS,oBAAoB,eAAe,2BAA2B,gBAAgB,EAAE,oFAAoF,WAAW,2DAA2D,4BAA4B,iDAAiD,wCAAwC,6BAA6B,IAAI,UAAU,kBAAkB,SAAS,6BAA6B,IAAI,iCAAiC,+QAA+Q,OAAO,2CAA2C,qCAAqC,2CAA2C,+BAA+B,mJAAmJ,MAAM,gHAAgH,gEAAgE,4BAA4B,6BAA6B,6CAA6C,iBAAiB,uCAAuC,0DAA0D,0BAA0B,8CAA8C,iBAAiB,aAAa,eAAe,aAAa,sCAAsC,SAAS,qBAAqB,eAAe,2BAA2B,gBAAgB,EAAE,mEAAmE,WAAW,mBAAmB,QAAQ,6BAA6B,IAAI,uBAAuB,SAAS,yBAAyB,iDAAiD,YAAY,IAAI,kCAAkC,KAAK,4DAA4D,gDAAgD,uEAAuE,cAAc,eAAe,aAAa,sCAAsC,SAAS,qBAAqB,uEAAuE,uHAAuH,cAAc,eAAe,aAAa,sCAAsC,SAAS,iBAAiB,gCAAgC,4BAA4B,eAAe,qTAAqT,WAAW,8DAA8D,kBAAkB,4EAA4E,QAAQ,0EAA0E,mBAAmB,iJAAiJ,oBAAoB,6LAA6L,mBAAmB,yDAAyD,gBAAgB,eAAe,6CAA6C,gEAAgE,2EAA2E,wDAAwD,MAAM,2DAA2D,uBAAuB,IAAI,KAAK,SAAS,QAAQ,6CAA6C,yBAAyB,cAAc,IAAI,6BAA6B,SAAS,MAAM,4DAA4D,YAAY,0JAA0J,UAAU,eAAe,aAAa,sCAAsC,SAAS,qBAAqB,oJAAoJ,6BAA6B,gBAAgB,EAAE,+DAA+D,qCAAqC,aAAa,kUAAkU,udAAud,WAAW,mBAAmB,ieAAie,kBAAkB,gDAAgD,eAAe,oBAAoB,qEAAqE,kBAAkB,2JAA2J,uBAAuB,8LAA8L,gDAAgD,4CAA4C,qBAAqB,QAAQ,oCAAoC,8EAA8E,qTAAqT,UAAU,cAAc,yDAAyD,QAAQ,WAAW,QAAQ,8KAA8K,YAAY,IAAI,gBAAgB,IAAI,SAAS,wJAAwJ,sEAAsE,+BAA+B,wjBAAwjB,MAAM,UAAU,oGAAoG,MAAM,iFAAiF,mLAAmL,sJAAsJ,6kBAA6kB,mEAAmE,kFAAkF,oBAAoB,YAAY,IAAI,MAAM,wBAAwB,wPAAwP,qBAAqB,wCAAwC,2BAA2B,qFAAqF,SAAS,sCAAsC,8EAA8E,iEAAiE,2BAA2B,IAAI,2CAA2C,iBAAiB,cAAc,qBAAqB,qBAAqB,MAAM,6CAA6C,oEAAoE,YAAY,mBAAmB,mBAAmB,0BAA0B,8BAA8B,8BAA8B,mBAAmB,KAAK,kBAAkB,gBAAgB,SAAS,UAAU,+EAA+E,IAAI,KAAK,8BAA8B,GAAG,oHAAoH,oBAAoB,kCAAkC,OAAO,YAAY,kEAAkE,yBAAyB,MAAM,0BAA0B,oBAAoB,kFAAkF,yBAAyB,6BAA6B,sIAAsI,EAAE,eAAe,aAAa,sCAAsC,SAAS,uBAAuB,wBAAwB,iCAAiC,gBAAgB,EAAE,QAAQ,2dAA2d,WAAW,sDAAsD,kBAAkB,6DAA6D,uBAAuB,+CAA+C,cAAc,2KAA2K,uBAAuB,IAAI,qEAAqE,8EAA8E,kBAAkB,wGAAwG,oBAAoB,+IAA+I,YAAY,gEAAgE,eAAe,sBAAsB,qBAAqB,EAAE,kBAAkB,gCAAgC,EAAE,qDAAqD,gBAAgB,eAAe,aAAa,sCAAsC,SAAS,uBAAuB,eAAe,wBAAwB,eAAe,mLAAmL,uBAAuB,0DAA0D,WAAW,+DAA+D,kBAAkB,6EAA6E,oBAAoB,iNAAiN,gBAAgB,oBAAoB,mBAAmB,yBAAyB,aAAa,0BAA0B,cAAc,mBAAmB,oBAAoB,iEAAiE,YAAY,IAAI,KAAK,SAAS,wCAAwC,qEAAqE,kCAAkC,uBAAuB,IAAI,qCAAqC,yBAAyB,gBAAgB,eAAe,SAAS,gEAAgE,2EAA2E,wDAAwD,MAAM,yDAAyD,SAAS,0BAA0B,qCAAqC,uBAAuB,IAAI,mDAAmD,IAAI,KAAK,sBAAsB,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,aAAa,4BAA4B,mDAAmD,yBAAyB,cAAc,KAAK,uBAAuB,kBAAkB,QAAQ,YAAY,IAAI,YAAY,SAAS,2BAA2B,OAAO,gCAAgC,4BAA4B,gBAAgB,eAAe,aAAa,sCAAsC,SAAS,qBAAqB,0CAA0C,iCAAiC,gBAAgB,OAAO,8IAA8I,gDAAgD,+GAA+G,eAAe,4DAA4D,2CAA2C,IAAI,wEAAwE,SAAS,WAAW,0CAA0C,kBAAkB,qLAAqL,uBAAuB,uGAAuG,aAAa,SAAS,4BAA4B,MAAM,GAAG,yCAAyC,KAAK,qCAAqC,KAAK,MAAM,qBAAqB,6BAA6B,4BAA4B,mBAAmB,gEAAgE,oIAAoI,MAAM,QAAQ,0DAA0D,qCAAqC,oBAAoB,mOAAmO,sBAAsB,MAAM,sBAAsB,wIAAwI,mCAAmC,mCAAmC,gBAAgB,IAAI,UAAU,0CAA0C,mCAAmC,eAAe,sBAAsB,iEAAiE,uBAAuB,IAAI,qEAAqE,oEAAoE,WAAW,gBAAgB,+RAA+R,0FAA0F,2BAA2B,OAAO,oCAAoC,YAAY,uBAAuB,oBAAoB,kBAAkB,gCAAgC,EAAE,qDAAqD,+BAA+B,eAAe,aAAa,sCAAsC,SAAS,0BAA0B,0CAA0C,4BAA4B,gBAAgB,EAAE,MAAM,mNAAmN,6EAA6E,WAAW,iEAAiE,2BAA2B,sQAAsQ,oBAAoB,oCAAoC,QAAQ,sEAAsE,uBAAuB,IAAI,0EAA0E,SAAS,mBAAmB,+CAA+C,gBAAgB,SAAS,gEAAgE,2EAA2E,wDAAwD,MAAM,2DAA2D,2BAA2B,WAAW,oBAAoB,aAAa,gBAAgB,mBAAmB,eAAe,aAAa,sCAAsC,SAAS,0BAA0B,eAAe,wBAAwB,eAAe,kSAAkS,uBAAuB,6DAA6D,WAAW,8JAA8J,kBAAkB,uHAAuH,oBAAoB,8KAA8K,gBAAgB,uJAAuJ,OAAO,gCAAgC,iCAAiC,SAAS,kBAAkB,mBAAmB,sBAAsB,iDAAiD,QAAQ,YAAY,YAAY,gHAAgH,YAAY,IAAI,6BAA6B,YAAY,IAAI,KAAK,gFAAgF,mBAAmB,IAAI,SAAS,GAAG,8CAA8C,2BAA2B,aAAa,sFAAsF,2DAA2D,gBAAgB,IAAI,MAAM,0BAA0B,wBAAwB,gBAAgB,4BAA4B,gBAAgB,eAAe,SAAS,wBAAwB,mGAAmG,gEAAgE,2EAA2E,wDAAwD,MAAM,yDAAyD,YAAY,gCAAgC,iCAAiC,qCAAqC,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,gCAAgC,gCAAgC,IAAI,iBAAiB,mDAAmD,yBAAyB,cAAc,EAAE,QAAQ,oCAAoC,aAAa,MAAM,+EAA+E,YAAY,YAAY,IAAI,KAAK,sBAAsB,mBAAmB,IAAI,SAAS,sBAAsB,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,kCAAkC,2BAA2B,gBAAgB,IAAI,iBAAiB,mDAAmD,yBAAyB,cAAc,mCAAmC,uBAAuB,kBAAkB,QAAQ,YAAY,IAAI,YAAY,SAAS,2BAA2B,OAAO,gCAAgC,4BAA4B,mBAAmB,eAAe,aAAa,sCAAsC,SAAS,kBAAkB,wBAAwB,4BAA4B,gBAAgB,EAAE,uCAAuC,0BAA0B,wCAAwC,kDAAkD,qDAAqD,+GAA+G,WAAW,eAAe,aAAa,sCAAsC,SAAS,gBAAgB,wBAAwB,8BAA8B,gBAAgB,EAAE,mFAAmF,sBAAsB,WAAW,sBAAsB,uBAAuB,eAAe,YAAY,IAAI,WAAW,sBAAsB,6CAA6C,iBAAiB,oBAAoB,0DAA0D,6BAA6B,8CAA8C,gBAAgB,wCAAwC,yBAAyB,IAAI,MAAM,kBAAkB,sJAAsJ,OAAO,yBAAyB,qCAAqC,yBAAyB,+BAA+B,mJAAmJ,6BAA6B,6BAA6B,eAAe,aAAa,sCAAsC,SAAS,qBAAqB,wBAAwB,4BAA4B,gBAAgB,EAAE,iLAAiL,0BAA0B,sIAAsI,mCAAmC,iJAAiJ,8GAA8G,sBAAsB,iIAAiI,cAAc,eAAe,aAAa,sCAAsC,SAAS,mBAAmB,wBAAwB,4BAA4B,gBAAgB,EAAE,sJAAsJ,kHAAkH,+GAA+G,YAAY,eAAe,aAAa,sCAAsC,SAAS,gBAAgB,wBAAwB,8BAA8B,gBAAgB,EAAE,uEAAuE,wCAAwC,eAAe,aAAa,sCAAsC,SAAS,gBAAgB,wBAAwB,4BAA4B,gBAAgB,EAAE,QAAQ,2LAA2L,qFAAqF,4HAA4H,mBAAmB,YAAY,mCAAmC,qDAAqD,8GAA8G,sBAAsB,kFAAkF,+BAA+B,qBAAqB,kBAAkB,sEAAsE,SAAS,cAAc,aAAa,sCAAsC,SAAS,kBAAkB,wBAAwB,4BAA4B,gBAAgB,EAAE,UAAU,sUAAsU,2HAA2H,6EAA6E,sCAAsC,YAAY,0BAA0B,qDAAqD,8GAA8G,sBAAsB,kHAAkH,8BAA8B,UAAU,sCAAsC,wCAAwC,sCAAsC,qCAAqC,qDAAqD,aAAa,oBAAoB,yGAAyG,eAAe,aAAa,sCAAsC,SAAS,gBAAgB,wBAAwB,4BAA4B,gBAAgB,EAAE,6LAA6L,6CAA6C,sEAAsE,qCAAqC,8GAA8G,sBAAsB,0JAA0J,SAAS,eAAe,aAAa,sCAAsC,SAAS,sBAAsB,wBAAwB,4BAA4B,gBAAgB,EAAE,gBAAgB,0YAA0Y,0BAA0B,wCAAwC,sCAAsC,YAAY,0IAA0I,qCAAqC,8GAA8G,sBAAsB,4MAA4M,eAAe,eAAe,aAAa,sCAAsC,SAAS,oBAAoB,wBAAwB,8BAA8B,gBAAgB,EAAE,2EAA2E,uCAAuC,oBAAoB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,kGAAkG,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,MAAM,sCAAsC,SAAS,sEAAsE,2CAA2C,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,MAAM,sCAAsC,SAAS,gEAAgE,iDAAiD,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,sCAAsC,SAAS,EAAE,eAAe,aAAa,cAAc,oHAAoH,EAAE,SAAS,cAAc,iGAAiG,EAAE,SAAS,cAAc,mXAAmX,EAAE,SAAS,cAAc,kYAAkY,EAAE,SAAS,cAAc,mgBAAmgB,EAAE,SAAS,cAAc,80BAA80B,EAAE,SAAS,cAAc,qrBAAqrB,EAAE,SAAS,cAAc,ykBAAykB,EAAE,SAAS,cAAc,wjBAAwjB,EAAE,SAAS,cAAc,kpBAAkpB,EAAE,SAAS,cAAc,+oBAA+oB,EAAE,+EAA+E,cAAc,IAAI,kBAAkB,cAAc,WAAW,gBAAgB,4DAA4D,aAAa,eAAe,wDAAwD,cAAc,eAAe,iDAAiD,gBAAgB,iDAAiD,cAAc,qCAAqC,oBAAoB,eAAe,qCAAqC,sBAAsB,qCAAqC,gBAAgB,UAAU,WAAW,iBAAiB,6CAA6C,SAAS,gBAAgB,0CAA0C,8DAA8D,gBAAgB,WAAW,gDAAgD,cAAc,2BAA2B,kBAAkB,4DAA4D,6DAA6D,kBAAkB,4DAA4D,+DAA+D,kBAAkB,8CAA8C,6CAA6C,gBAAgB,gCAAgC,sCAAsC,gBAAgB,2CAA2C,cAAc,qDAAqD,cAAc,uCAAuC,oBAAoB,sEAAsE,kBAAkB,qEAAqE,kBAAkB,qEAAqE,gBAAgB,0DAA0D,gBAAgB,4DAA4D,8NAA8N,kBAAkB,yDAAyD,oBAAoB,6EAA6E,mCAAmC,+BAA+B,IAAI,8BAA8B,oBAAoB,EAAE,YAAY,aAAa,eAAe,sEAAsE,cAAc,eAAe,qEAAqE,gBAAgB,qEAAqE,cAAc,mDAAmD,wBAAwB,eAAe,mDAAmD,0BAA0B,mDAAmD,gBAAgB,wDAAwD,gGAAgG,cAAc,2BAA2B,mBAAmB,wFAAwF,2FAA2F,mBAAmB,0EAA0E,6EAA6E,mBAAmB,4DAA4D,2DAA2D,mBAAmB,4DAA4D,mEAAmE,iBAAiB,gCAAgC,oDAAoD,iBAAiB,yDAAyD,iBAAiB,yDAAyD,eAAe,0EAA0E,eAAe,mDAAmD,mBAAmB,mGAAmG,mBAAmB,mGAAmG,mBAAmB,iFAAiF,qBAAqB,+GAA+G,iBAAiB,oFAAoF,iBAAiB,wFAAwF,0UAA0U,gBAAgB,cAAc,eAAe,2FAA2F,iBAAiB,oGAAoG,eAAe,eAAe,mGAAmG,iBAAiB,mGAAmG,+BAA+B,eAAe,wEAAwE,iCAAiC,wEAAwE,eAAe,wEAAwE,iBAAiB,UAAU,yBAAyB,mDAAmD,+FAA+F,SAAS,iBAAiB,gHAAgH,4JAA4J,iBAAiB,mEAAmE,8HAA8H,eAAe,mEAAmE,4CAA4C,mBAAmB,kIAAkI,kKAAkK,mBAAmB,iFAAiF,gGAAgG,mBAAmB,+FAA+F,4GAA4G,mBAAmB,kBAAkB,+GAA+G,iBAAiB,8EAA8E,iBAAiB,gCAAgC,yEAAyE,iBAAiB,8EAA8E,iBAAiB,0FAA0F,iBAAiB,wGAAwG,gGAAgG,iBAAiB,4QAA4Q,qNAAqN,mBAAmB,8EAA8E,eAAe,uGAAuG,eAAe,gEAAgE,mBAAmB,gJAAgJ,mBAAmB,gJAAgJ,mBAAmB,qHAAqH,qBAAqB,kKAAkK,iBAAiB,2HAA2H,iBAAiB,kIAAkI,4eAA4e,gBAAgB,cAAc,gBAAgB,kJAAkJ,eAAe,gBAAgB,qLAAqL,iBAAiB,qLAAqL,6CAA6C,gBAAgB,+HAA+H,+CAA+C,+HAA+H,eAAe,+HAA+H,iBAAiB,UAAU,+CAA+C,6GAA6G,iLAAiL,SAAS,iBAAiB,4QAA4Q,8WAA8W,iBAAiB,0HAA0H,urBAAurB,eAAe,0HAA0H,8HAA8H,mBAAmB,sJAAsJ,ybAAyb,mBAAmB,iDAAiD,qaAAqa,mBAAmB,yBAAyB,6MAA6M,qBAAqB,6FAA6F,4gBAA4gB,mBAAmB,0FAA0F,oNAAoN,mBAAmB,0FAA0F,oNAAoN,mBAAmB,wFAAwF,sNAAsN,iBAAiB,wIAAwI,iBAAiB,wIAAwI,mBAAmB,mDAAmD,iQAAiQ,iBAAiB,gCAAgC,gIAAgI,iBAAiB,gCAAgC,gIAAgI,iBAAiB,gCAAgC,gIAAgI,mBAAmB,wGAAwG,sKAAsK,iBAAiB,4FAA4F,uLAAuL,iBAAiB,0CAA0C,iBAAiB,oEAAoE,8EAA8E,iBAAiB,eAAe,QAAQ,6HAA6H,kUAAkU,qBAAqB,6HAA6H,0MAA0M,uBAAuB,wPAAwP,wLAAwL,iBAAiB,wGAAwG,uJAAuJ,2BAA2B,kCAAkC,gKAAgK,uBAAuB,wBAAwB,iMAAiM,qBAAqB,+KAA+K,iKAAiK,2BAA2B,kCAAkC,yJAAyJ,qBAAqB,uFAAuF,mcAAmc,qBAAqB,uFAAuF,qCAAqC,kCAAkC,mMAAmM,eAAe,mLAAmL,eAAe,yGAAyG,mBAAmB,2QAA2Q,mBAAmB,2QAA2Q,mBAAmB,qNAAqN,qBAAqB,2SAA2S,iBAAiB,kOAAkO,iBAAiB,gPAAgP,s2BAAs2B,gBAAgB,cAAc,eAAe,iDAAiD,eAAe,eAAe,uCAAuC,eAAe,yBAAyB,yBAAyB,mBAAmB,eAAe,8BAA8B,iBAAiB,uCAAuC,qBAAqB,8BAA8B,mBAAmB,sDAAsD,mBAAmB,sDAAsD,mBAAmB,sDAAsD,mBAAmB,sDAAsD,iBAAiB,wEAAwE,iBAAiB,2EAA2E,mBAAmB,oFAAoF,mBAAmB,oFAAoF,iBAAiB,2EAA2E,mBAAmB,6CAA6C,qBAAqB,4DAA4D,iBAAiB,wCAAwC,yBAAyB,iBAAiB,wCAAwC,mBAAmB,eAAe,yBAAyB,mBAAmB,iBAAiB,0CAA0C,iBAAiB,6CAA6C,iBAAiB,uCAAuC,qEAAqE,iBAAiB,qCAAqC,mBAAmB,8CAA8C,gDAAgD,qBAAqB,yBAAyB,+DAA+D,yBAAyB,0DAA0D,4GAA4G,yBAAyB,kDAAkD,4GAA4G,iBAAiB,OAAO,mDAAmD,wDAAwD,mBAAmB,uDAAuD,6HAA6H,mBAAmB,yBAAyB,uFAAuF,mBAAmB,uHAAuH,wEAAwE,qBAAqB,cAAc,2LAA2L,qBAAqB,cAAc,2LAA2L,qBAAqB,cAAc,2LAA2L,iBAAiB,6GAA6G,6CAA6C,eAAe,8BAA8B,eAAe,2CAA2C,iBAAiB,6CAA6C,iBAAiB,8CAA8C,wKAAwK,mFAAmF,QAAQ,gEAAgE,IAAI,0FAA0F,SAAS,EAAE,cAAc,eAAe,wDAAwD,eAAe,eAAe,iDAAiD,qBAAqB,eAAe,qCAAqC,iBAAiB,iDAAiD,uBAAuB,qCAAqC,mBAAmB,qEAAqE,mBAAmB,qEAAqE,mBAAmB,qEAAqE,mBAAmB,qEAAqE,iBAAiB,6FAA6F,iBAAiB,iGAAiG,mBAAmB,6GAA6G,mBAAmB,6GAA6G,iBAAiB,iGAAiG,mBAAmB,yDAAyD,qBAAqB,6EAA6E,iBAAiB,oDAAoD,2BAA2B,iBAAiB,oDAAoD,uBAAuB,eAAe,gCAAgC,2BAA2B,eAAe,gCAAgC,uBAAuB,iBAAiB,qDAAqD,iBAAiB,yDAAyD,iBAAiB,kDAAkD,qEAAqE,iBAAiB,+CAA+C,qBAAqB,oKAAoK,+EAA+E,qBAAqB,gCAAgC,iFAAiF,iBAAiB,gBAAgB,OAAO,GAAG,8BAA8B,YAAY,GAAG,8BAA8B,YAAY,yBAAyB,iDAAiD,mBAAmB,gCAAgC,mJAAmJ,mBAAmB,8GAA8G,2FAA2F,eAAe,qCAAqC,eAAe,qDAAqD,iBAAiB,0DAA0D,iBAAiB,4DAA4D,8NAA8N,4DAA4D,WAAW,6BAA6B,QAAQ,gEAAgE,IAAI,0GAA0G,UAAU,GAAG,cAAc,eAAe,wDAAwD,eAAe,qCAAqC,mBAAmB,MAAM,kBAAkB,8DAA8D,iBAAiB,wCAAwC,0EAA0E,iBAAiB,cAAc,0BAA0B,mBAAmB,4DAA4D,6FAA6F,mBAAmB,MAAM,4DAA4D,6DAA6D,mBAAmB,MAAM,4DAA4D,6DAA6D,mBAAmB,MAAM,4DAA4D,6DAA6D,iBAAiB,yBAAyB,sEAAsE,iBAAiB,+FAA+F,uDAAuD,iBAAiB,mFAAmF,sEAAsE,mBAAmB,mCAAmC,qBAAqB,sEAAsE,uMAAuM,eAAe,sDAAsD,6HAA6H,iBAAiB,4DAA4D,gDAAgD,iBAAiB,oDAAoD,iBAAiB,uBAAuB,kGAAkG,KAAK,QAAQ,sCAAsC,wBAAwB,4IAA4I,SAAS,qBAAqB,qBAAqB,eAAe,wFAAwF,6EAA6E,eAAe,qDAAqD,4KAA4K,cAAc,+LAA+L,4CAA4C,yDAAyD,gCAAgC,4HAA4H,EAAE,cAAc,eAAe,oFAAoF,eAAe,eAAe,yFAAyF,6BAA6B,eAAe,iEAAiE,2BAA2B,eAAe,4BAA4B,yBAAyB,8EAA8E,mBAAmB,8DAA8D,0GAA0G,iBAAiB,mFAAmF,iBAAiB,6EAA6E,iBAAiB,WAAW,QAAQ,eAAe,2BAA2B,iBAAiB,yFAAyF,eAAe,iEAAiE,+BAA+B,iEAAiE,UAAU,iBAAiB,iDAAiD,UAAU,iBAAiB,iDAAiD,iBAAiB,+DAA+D,oFAAoF,mBAAmB,0FAA0F,kHAAkH,mBAAmB,uIAAuI,mIAAmI,mBAAmB,uIAAuI,mIAAmI,mBAAmB,uIAAuI,mIAAmI,mBAAmB,4DAA4D,6MAA6M,mBAAmB,4DAA4D,6MAA6M,qBAAqB,gCAAgC,iCAAiC,MAAM,6FAA6F,oFAAoF,gCAAgC,6FAA6F,mBAAmB,iIAAiI,mBAAmB,oHAAoH,iPAAiP,UAAU,mBAAmB,yGAAyG,UAAU,qBAAqB,UAAU,mLAAmL,iBAAiB,YAAY,+GAA+G,iBAAiB,+FAA+F,4BAA4B,iBAAiB,YAAY,QAAQ,eAAe,sFAAsF,wFAAwF,SAAS,eAAe,8FAA8F,iBAAiB,8GAA8G,iBAAiB,oHAAoH,sbAAsb,cAAc,eAAe,0CAA0C,eAAe,eAAe,6BAA6B,iBAAiB,eAAe,uBAAuB,iBAAiB,6BAA6B,mBAAmB,uBAAuB,mBAAmB,uCAAuC,mBAAmB,uCAAuC,mBAAmB,uCAAuC,mBAAmB,uCAAuC,iBAAiB,mDAAmD,iBAAiB,qDAAqD,mBAAmB,2DAA2D,mBAAmB,2DAA2D,iBAAiB,qDAAqD,mBAAmB,iCAAiC,qBAAqB,2CAA2C,iBAAiB,4BAA4B,uBAAuB,iBAAiB,4BAA4B,eAAe,eAAe,kBAAkB,uBAAuB,eAAe,kBAAkB,eAAe,iBAAiB,+BAA+B,iBAAiB,iCAAiC,iBAAiB,4BAA4B,yDAAyD,iBAAiB,2BAA2B,mBAAmB,0BAA0B,4BAA4B,qBAAqB,kBAAkB,6CAA6C,iBAAiB,OAAO,oBAAoB,+CAA+C,mBAAmB,kBAAkB,+CAA+C,mBAAmB,kBAAkB,yDAAyD,mBAAmB,kBAAkB,yDAAyD,mBAAmB,kBAAkB,2DAA2D,qBAAqB,wDAAwD,6CAA6C,iBAAiB,yFAAyF,6CAA6C,eAAe,uBAAuB,eAAe,iCAAiC,iBAAiB,gCAAgC,iBAAiB,gCAAgC,kHAAkH,4DAA4D,WAAW,6BAA6B,QAAQ,gEAAgE,IAAI,0DAA0D,UAAU,GAAG,cAAc,MAAM,YAAY,aAAa,gGAAgG,cAAc,MAAM,sCAAsC,0BAA0B,2BAA2B,YAAY,mBAAmB,iGAAiG,yBAAyB,yCAAyC,4BAA4B,6FAA6F,YAAY,MAAM,iEAAiE,cAAc,4BAA4B,QAAQ,MAAM,WAAW,QAAQ,MAAM,KAAK,+BAA+B,iBAAiB,SAAS,aAAa,iBAAiB,mBAAmB,eAAe,YAAY,WAAW,KAAK,8CAA8C,6CAA6C,uCAAuC,aAAa,8cAA8c,0IAA0I,wBAAwB,qEAAqE,SAAS,kBAAkB,6BAA6B,iBAAiB,SAAS,sBAAsB,6BAA6B,iBAAiB,SAAS,sBAAsB,6BAA6B,kBAAkB,yBAAyB,8LAA8L,mLAAmL,8HAA8H,WAAW,KAAK,uBAAuB,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,oBAAoB,2BAA2B,2NAA2N,wEAAwE,2VAA2V,YAAY,KAAK,oCAAoC,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,4BAA4B,YAAY,KAAK,4CAA4C,uDAAuD,uBAAuB,mDAAmD,SAAS,4DAA4D,IAAI,MAAM,cAAc,WAAW,+BAA+B,YAAY,YAAY,oDAAoD,mBAAmB,+DAA+D,uBAAuB,EAAE,8DAA8D,4FAA4F,eAAe,wCAAwC,SAAS,EAAE,QAAQ,IAAI,G;;;;;;ACDr91G;AACA;AACA;AACA;AACA;;AAEA,cAAc;;AAEd;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,wCAAwC,SAAS;AACjD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,2BAA2B,UAAU;AACrC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,IAAI,IAA0C,EAAE,mCAAO,YAAY,iBAAiB,EAAE;AAAA,kGAAC;AACvF,KAAK,EAI2B;;AAEhC,CAAC;;;;;;;;AC1HY;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc,GAAG,aAAa;AAC9B;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,qC;;;;;;;ACZa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,GAAS;AAC9B,aAAa,mBAAO,CAAC,GAAe;AACpC,iC;;;;;;;ACda;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB;AACnB,gBAAgB,mBAAO,CAAC,GAAkB;AAC1C;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,KAAK;AACvC;AACA;AACA;AACA;AACA;AACA,qCAAqC,KAAK,YAAY,aAAa;AACnE;AACA,sCAAsC,KAAK,IAAI,+CAA+C;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,cAAc,IAAI;AAC9E,yCAAyC,YAAY,YAAY,aAAa,IAAI,oDAAoD;AACtI;AACA,qCAAqC,YAAY,GAAG,aAAa;AACjE;AACA,iCAAiC,WAAW;AAC5C,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA,6EAA6E,0BAA0B;AACvG;AACA;AACA;AACA,8EAA8E,wBAAwB;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,eAAe;AACpE;AACA,+DAA+D,cAAc,IAAI;AACjF;AACA,8BAA8B,kBAAkB,GAAG,4CAA4C;AAC/F,yCAAyC,EAAE,IAAI,oDAAoD;AACnG;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA,uC;;;;;;;ACnIa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,GAAS;AAC9B,aAAa,mBAAO,CAAC,GAAe;AACpC,aAAa,mBAAO,CAAC,GAAW;AAChC,iC;;;;;;;ACfa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6DAA6D;AAC5E;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,uC;;;;;;;ACzFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB,GAAG,4BAA4B;AACjD,sBAAsB,mBAAO,CAAC,GAAe;AAC7C;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,6BAA6B,IAAI;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,mC;;;;;;ACvGA;AACA,eAAe,KAAiD,oBAAoB,CAAqH,CAAC,oBAAoB,YAAY,OAAO,cAAc,aAAa,sCAAsC,SAAS,uBAAuB,8EAA8E,QAAQ,gBAAgB,uDAAuD,2BAA2B,wBAAwB,4BAA4B,mBAAmB,sBAAsB,8GAA8G,uDAAuD,kCAAkC,wBAAwB,gGAAgG,4BAA4B,mCAAmC,0BAA0B,WAAW,8BAA8B,2BAA2B,8DAA8D,EAAE,aAAa,4BAA4B,oBAAoB,6CAA6C,QAAQ,EAAE,6BAA6B,8CAA8C,gGAAgG,wBAAwB,6EAA6E,wQAAwQ,sEAAsE,mKAAmK,iJAAiJ,YAAY,WAAW,KAAK,0CAA0C,MAAM,yEAAyE,gIAAgI,QAAQ,iDAAiD,8CAA8C,EAAE,mCAAmC,qBAAqB,2BAA2B,0BAA0B,qBAAqB,MAAM,eAAe,KAAK,2CAA2C,yDAAyD,uBAAuB,2CAA2C,iDAAiD,gCAAgC,gBAAgB,sBAAsB,EAAE,8CAA8C,wBAAwB,wBAAwB,yDAAyD,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE,WAAW,IAAI,IAAI,IAAI,KAAK,IAAI,KAAK,EAAE,MAAM,qBAAqB,kCAAkC,iDAAiD,2DAA2D,gDAAgD,kBAAkB,4IAA4I,YAAY,uBAAuB,IAAI,KAAK,+BAA+B,MAAM,yCAAyC,4EAA4E,gBAAgB,uBAAuB,MAAM,kGAAkG,8BAA8B,WAAW,uBAAuB,IAAI,aAAa,gBAAgB,EAAE,yDAAyD,0BAA0B,wBAAwB,KAAK,yBAAyB,sDAAsD,2CAA2C,sHAAsH,sBAAsB,qEAAqE,QAAQ,YAAY,IAAI,MAAM,MAAM,QAAQ,cAAc,qCAAqC,uBAAuB,oDAAoD,oCAAoC,kBAAkB,8EAA8E,2BAA2B,kCAAkC,kBAAkB,kFAAkF,aAAa,SAAS,8BAA8B,GAAG,sDAAsD,0BAA0B,uCAAuC,8CAA8C,GAAG,GAAG,wBAAwB,kCAAkC,SAAS,uSAAuS,WAAW,sBAAsB,+DAA+D,8XAA8X,IAAI,2CAA2C,EAAE,aAAa,EAAE,+LAA+L,qBAAqB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,uBAAuB,eAAe,uCAAuC,6BAA6B,sBAAsB,8EAA8E,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,sCAAsC,SAAS,2HAA2H,SAAS,SAAS,2KAA2K,kEAAkE,+MAA+M,iBAAiB,WAAW,IAAI,GAAG,EAAE,wBAAwB,EAAE,GAAG,EAAE,SAAS,IAAI,GAAG,IAAI,4BAA4B,EAAE,GAAG,EAAE,SAAS,MAAM,GAAG,IAAI,UAAU,IAAI,YAAY,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,MAAM,UAAU,IAAI,YAAY,EAAE,GAAG,EAAE,SAAS,IAAI,GAAG,EAAE,qBAAqB,aAAa,YAAY,gTAAgT,WAAW,IAAI,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,IAAI,MAAM,EAAE,GAAG,EAAE,SAAS,IAAI,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,IAAI,GAAG,EAAE,iBAAiB,oCAAoC,0BAA0B,GAAG,0BAA0B,IAAI,0BAA0B,GAAG,0BAA0B,yBAAyB,WAAW,KAAK,WAAW,uBAAuB,SAAS,4JAA4J,cAAc,EAAE,EAAE,GAAG,EAAE,4EAA4E,eAAe,eAAe,aAAa,cAAc,swCAAswC,EAAE,UAAU,MAAM,gBAAgB,4CAA4C,uFAAuF,IAAI,gCAAgC,cAAc,gBAAgB,cAAc,aAAa,gBAAgB,MAAM,sBAAsB,QAAQ,IAAI,oBAAoB,SAAS,gBAAgB,MAAM,sBAAsB,QAAQ,IAAI,0BAA0B,SAAS,cAAc,yBAAyB,cAAc,sDAAsD,uBAAuB,GAAG,cAAc,2CAA2C,0BAA0B,GAAG,cAAc,4CAA4C,oBAAoB,uGAAuG,kBAAkB,gBAAgB,iBAAiB,8GAA8G,uEAAuE,gDAAgD,SAAS,MAAM,yBAAyB,UAAU,oHAAoH,YAAY,OAAO,4DAA4D,yBAAyB,wEAAwE,oKAAoK,OAAO,qDAAqD,SAAS,mGAAmG,0BAA0B,wBAAwB,WAAW,aAAa,wCAAwC,aAAa,wCAAwC,gBAAgB,wCAAwC,aAAa,gBAAgB,SAAS,UAAU,yBAAyB,kBAAkB,uCAAuC,mBAAmB,2BAA2B,kCAAkC,2BAA2B,+EAA+E,mDAAmD,qEAAqE,gBAAgB,yCAAyC,cAAc,kBAAkB,6CAA6C,8DAA8D,2BAA2B,0FAA0F,QAAQ,gBAAgB,IAAI,4BAA4B,uEAAuE,cAAc,YAAY,UAAU,cAAc,uBAAuB,cAAc,8BAA8B,KAAK,qBAAqB,qCAAqC,gBAAgB,QAAQ,0CAA0C,KAAK,sCAAsC,cAAc,sBAAsB,sBAAsB,0GAA0G,SAAS,oBAAoB,gCAAgC,qBAAqB,iCAAiC,iBAAiB,0CAA0C,iBAAiB,0CAA0C,oBAAoB,wBAAwB,iDAAiD,qBAAqB,wBAAwB,qDAAqD,kBAAkB,6CAA6C,iBAAiB,+CAA+C,oBAAoB,kBAAkB,wBAAwB,mCAAmC,mBAAmB,kBAAkB,wBAAwB,qCAAqC,0BAA0B,iCAAiC,yBAAyB,iCAAiC,EAAE,4EAA4E,EAAE,UAAU,EAAE,UAAU,EAAE,kGAAkG,EAAE,aAAa,EAAE,oJAAoJ,QAAQ,iKAAiK,eAAe,iEAAiE,4BAA4B,iBAAiB,mBAAmB,IAAI,2BAA2B,SAAS,mBAAmB,kFAAkF,SAAS,mBAAmB,2BAA2B,qCAAqC,sBAAsB,qCAAqC,sBAAsB,sBAAsB,uBAAuB,yCAAyC,YAAY,yBAAyB,8EAA8E,aAAa,mBAAmB,yBAAyB,8DAA8D,WAAW,kBAAkB,WAAW,kEAAkE,0BAA0B,iBAAiB,wBAAwB,2BAA2B,aAAa,KAAK,uBAAuB,qBAAqB,kBAAkB,aAAa,wBAAwB,SAAS,mDAAmD,+FAA+F,mFAAmF,iBAAiB,8BAA8B,iBAAiB,kCAAkC,oBAAoB,oCAAoC,WAAW,qBAAqB,sHAAsH,uBAAuB,WAAW,mCAAmC,SAAS,mDAAmD,+BAA+B,wCAAwC,SAAS,4BAA4B,2GAA2G,aAAa,WAAW,uBAAuB,wEAAwE,KAAK,gDAAgD,mBAAmB,YAAY,mBAAmB,wCAAwC,kCAAkC,KAAK,uCAAuC,YAAY,mBAAmB,sCAAsC,EAAE,SAAS,kBAAkB,gBAAgB,kBAAkB,yDAAyD,gBAAgB,2EAA2E,+BAA+B,MAAM,4BAA4B,MAAM,kBAAkB,wCAAwC,2BAA2B,eAAe,2GAA2G,qBAAqB,iBAAiB,sCAAsC,2BAA2B,eAAe,wCAAwC,2BAA2B,cAAc,oCAAoC,qBAAqB,cAAc,4CAA4C,2BAA2B,eAAe,gBAAgB,qBAAqB,iDAAiD,eAAe,iDAAiD,OAAO,MAAM,eAAe,oEAAoE,+FAA+F,MAAM,MAAM,eAAe,wGAAwG,4IAA4I,8BAA8B,0EAA0E,4FAA4F,4BAA4B,EAAE,sGAAsG,mCAAmC,EAAE,6BAA6B,sBAAsB,qBAAqB,sCAAsC,cAAc,sCAAsC,cAAc,sCAAsC,cAAc,sCAAsC,cAAc,sCAAsC,eAAe,yCAAyC,EAAE,4BAA4B,4BAA4B,MAAM,sBAAsB,yCAAyC,2EAA2E,oBAAoB,gCAAgC,EAAE,KAAK,+EAA+E,sDAAsD,2IAA2I,YAAY,oBAAoB,gCAAgC,GAAG,MAAM,oBAAoB,4BAA4B,YAAY,qBAAqB,YAAY,qBAAqB,YAAY,qBAAqB,YAAY,qBAAqB,YAAY,sBAAsB,gBAAgB,IAAI,sBAAsB,MAAM,MAAM,YAAY,YAAY,kDAAkD,MAAM,MAAM,YAAY,mCAAmC,kCAAkC,gDAAgD,MAAM,kCAAkC,iDAAiD,IAAI,YAAY,MAAM,2CAA2C,IAAI,YAAY,MAAM,uBAAuB,MAAM,QAAQ,oBAAoB,oCAAoC,kEAAkE,yFAAyF,4NAA4N,iCAAiC,uBAAuB,IAAI,YAAY,MAAM,0DAA0D,6FAA6F,qBAAqB,wBAAwB,MAAM,gBAAgB,sGAAsG,qBAAqB,YAAY,MAAM,UAAU,MAAM,4BAA4B,MAAM,kBAAkB,QAAQ,qCAAqC,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,QAAQ,6BAA6B,aAAa,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,WAAW,oBAAoB,MAAM,MAAM,eAAe,kaAAka,2BAA2B,WAAW,MAAM,eAAe,aAAa,oBAAoB,MAAM,0CAA0C,SAAS,kBAAkB,gBAAgB,QAAQ,oBAAoB,UAAU,0BAA0B,cAAc,qBAAqB,YAAY,EAAE,SAAS,0DAA0D,UAAU,sBAAsB,aAAa,kCAAkC,cAAc,kCAAkC,MAAM,QAAQ,MAAM,2DAA2D,mBAAmB,+BAA+B,SAAS,kBAAkB,gBAAgB,2BAA2B,0xBAA0xB,OAAO,+FAA+F,oBAAoB,OAAO,2CAA2C,uBAAuB,wEAAwE,6BAA6B,0HAA0H,6CAA6C,cAAc,mCAAmC,eAAe,oBAAoB,4DAA4D,QAAQ,oBAAoB,mBAAmB,mNAAmN,OAAO,oLAAoL,UAAU,qBAAqB,kBAAkB,sGAAsG,UAAU,+BAA+B,WAAW,4FAA4F,QAAQ,oCAAoC,gbAAgb,UAAU,+BAA+B,WAAW,sEAAsE,6CAA6C,0DAA0D,kEAAkE,aAAa,kCAAkC,cAAc,oCAAoC,sCAAsC,YAAY,iCAAiC,aAAa,oCAAoC,sCAAsC,cAAc,mCAAmC,mBAAmB,OAAO,mCAAmC,wBAAwB,MAAM,0HAA0H,eAAe,yCAAyC,sBAAsB,oCAAoC,MAAM,wBAAwB,MAAM,0FAA0F,aAAa,kCAAkC,kBAAkB,MAAM,wBAAwB,MAAM,uDAAuD,cAAc,wCAAwC,qBAAqB,kDAAkD,mCAAmC,sBAAsB,MAAM,kGAAkG,aAAa,0BAA0B,aAAa,0BAA0B,UAAU,kDAAkD,WAAW,kFAAkF,aAAa,uDAAuD,gCAAgC,QAAQ,yMAAyM,mCAAmC,yFAAyF,kBAAkB,iCAAiC,eAAe,oCAAoC,gBAAgB,sCAAsC,UAAU,OAAO,wDAAwD,cAAc,cAAc,sBAAsB,8GAA8G,4DAA4D,sBAAsB,UAAU,cAAc,kCAAkC,oDAAoD,sBAAsB,gBAAgB,eAAe,qCAAqC,eAAe,SAAS,kBAAkB,gBAAgB,YAAY,8EAA8E,QAAQ,2YAA2Y,WAAW,gBAAgB,SAAS,8IAA8I,uBAAuB,UAAU,6CAA6C,WAAW,wDAAwD,aAAa,+BAA+B,8BAA8B,yHAAyH,yFAAyF,wBAAwB,mBAAmB,MAAM,IAAI,kGAAkG,KAAK,aAAa,gBAAgB,sBAAsB,+EAA+E,SAAS,OAAO,MAAM,SAAS,GAAG,SAAS,iBAAiB,iFAAiF,WAAW,IAAI,iBAAiB,+BAA+B,0PAA0P,gEAAgE,oBAAoB,UAAU,0EAA0E,oCAAoC,iBAAiB,GAAG,yBAAyB,cAAc,uBAAuB,uBAAuB,gDAAgD,+BAA+B,QAAQ,aAAa,0FAA0F,WAAW,8CAA8C,EAAE,0CAA0C,iBAAiB,iEAAiE,YAAY,IAAI,sBAAsB,qEAAqE,yBAAyB,QAAQ,aAAa,SAAS,YAAY,eAAe,yBAAyB,kDAAkD,WAAW,eAAe,0BAA0B,eAAe,yBAAyB,2CAA2C,EAAE,uBAAuB,4CAA4C,sGAAsG,+CAA+C,aAAa,oBAAoB,6DAA6D,GAAG,qBAAqB,6BAA6B,8GAA8G,gDAAgD,QAAQ,iGAAiG,cAAc,kBAAkB,yCAAyC,gBAAgB,gEAAgE,WAAW,SAAS,oCAAoC,aAAa,KAAK,mBAAmB,OAAO,GAAG,qBAAqB,cAAc,mEAAmE,4BAA4B,wBAAwB,mBAAmB,oBAAoB,gBAAgB,sBAAsB,iBAAiB,qCAAqC,eAAe,kBAAkB,gDAAgD,0BAA0B,YAAY,iCAAiC,iBAAiB,YAAY,iBAAiB,YAAY,SAAS,yBAAyB,YAAY,6BAA6B,wBAAwB,eAAe,oBAAoB,UAAU,8BAA8B,KAAK,0QAA0Q,QAAQ,6CAA6C,uBAAuB,kBAAkB,4BAA4B,QAAQ,kCAAkC,QAAQ,2EAA2E,YAAY,+DAA+D,UAAU,6CAA6C,QAAQ,qBAAqB,WAAW,sBAAsB,UAAU,WAAW,0BAA0B,SAAS,kBAAkB,gBAAgB,WAAW,4BAA4B,UAAU,oDAAoD,UAAU,yWAAyW,SAAS,oDAAoD,QAAQ,oDAAoD,SAAS,oDAAoD,UAAU,6BAA6B,SAAS,uBAAuB,WAAW,mGAAmG,UAAU,mBAAmB,YAAY,oBAAoB,iBAAiB,gEAAgE,SAAS,kOAAkO,WAAW,wBAAwB,WAAW,gDAAgD,YAAY,IAAI,QAAQ,KAAK,0BAA0B,4CAA4C,YAAY,YAAY,6EAA6E,UAAU,wBAAwB,QAAQ,mBAAmB,IAAI,0CAA0C,YAAY,aAAa,gCAAgC,QAAQ,+BAA+B,OAAO,kCAAkC,iBAAiB,iBAAiB,iBAAiB,iBAAiB,OAAO,wBAAwB,UAAU,uBAAuB,MAAM,+EAA+E,SAAS,0DAA0D,OAAO,8BAA8B,WAAW,+IAA+I,sBAAsB,UAAU,WAAW,kCAAkC,sCAAsC,GAAG,2DAA2D,8BAA8B,SAAS,SAAS,8BAA8B,WAAW,wBAAwB,SAAS,6DAA6D,iBAAiB,0CAA0C,WAAW,0FAA0F,kBAAkB,6BAA6B,oEAAoE,yBAAyB,SAAS,uBAAuB,WAAW,iBAAiB,SAAS,oCAAoC,QAAQ,sBAAsB,2BAA2B,sBAAsB,4BAA4B,iBAAiB,6BAA6B,sBAAsB,QAAQ,WAAW,wEAAwE,mCAAmC,WAAW,YAAY,gCAAgC,aAAa,0BAA0B,mBAAmB,0BAA0B,kDAAkD,MAAM,2CAA2C,aAAa,6DAA6D,cAAc,4BAA4B,IAAI,oCAAoC,sBAAsB,yCAAyC,MAAM,qBAAqB,YAAY,IAAI,wBAAwB,wFAAwF,SAAS,uEAAuE,EAAE,2EAA2E,8CAA8C,KAAK,uFAAuF,0UAA0U,YAAY,kBAAkB,uBAAuB,qBAAqB,sCAAsC,cAAc,oBAAoB,iBAAiB,sBAAsB,gHAAgH,EAAE,YAAY,wBAAwB,MAAM,gEAAgE,MAAM,kEAAkE,OAAO,oBAAoB,mBAAmB,WAAW,wBAAwB,QAAQ,wCAAwC,QAAQ,wCAAwC,iBAAiB,YAAY,UAAU,6BAA6B,UAAU,sBAAsB,uBAAuB,OAAO,eAAe,WAAW,KAAK,oGAAoG,EAAE,SAAS,aAAa,iCAAiC,wBAAwB,sBAAsB,OAAO,0BAA0B,mBAAmB,WAAW,uBAAuB,UAAU,oBAAoB,4DAA4D,SAAS,4BAA4B,iBAAiB,kKAAkK,KAAK,wBAAwB,KAAK,yBAAyB,MAAM,gBAAgB,sCAAsC,IAAI,4DAA4D,oBAAoB,SAAS,4CAA4C,gBAAgB,qBAAqB,aAAa,IAAI,GAAG,iBAAiB,kBAAkB,oDAAoD,4CAA4C,gBAAgB,oBAAoB,eAAe,6DAA6D,sBAAsB,oBAAoB,mDAAmD,qBAAqB,yDAAyD,gBAAgB,kCAAkC,sBAAsB,mDAAmD,+CAA+C,4BAA4B,yCAAyC,kBAAkB,UAAU,mJAAmJ,8BAA8B,uCAAuC,WAAW,MAAM,iBAAiB,kCAAkC,oFAAoF,0BAA0B,KAAK,oEAAoE,YAAY,2BAA2B,2BAA2B,6BAA6B,uEAAuE,wBAAwB,uBAAuB,mBAAmB,KAAK,wBAAwB,kEAAkE,iBAAiB,qBAAqB,qBAAqB,KAAK,uBAAuB,uBAAuB,kBAAkB,KAAK,yBAAyB,kEAAkE,kBAAkB,qBAAqB,sBAAsB,KAAK,yBAAyB,uBAAuB,gBAAgB,KAAK,wBAAwB,uBAAuB,eAAe,KAAK,oCAAoC,mEAAmE,gBAAgB,KAAK,qBAAqB,+BAA+B,cAAc,uBAAuB,+FAA+F,YAAY,kBAAkB,kCAAkC,qBAAqB,8CAA8C,0BAA0B,mBAAmB,uBAAuB,6BAA6B,YAAY,qMAAqM,2MAA2M,wBAAwB,8CAA8C,GAAG,IAAI,gBAAgB,uBAAuB,mCAAmC,sBAAsB,yEAAyE,4BAA4B,4CAA4C,qBAAqB,IAAI,mCAAmC,4EAA4E,UAAU,wBAAwB,wBAAwB,mDAAmD,mEAAmE,oBAAoB,oCAAoC,yBAAyB,gCAAgC,iCAAiC,sBAAsB,wBAAwB,sBAAsB,EAAE,+CAA+C,iCAAiC,EAAE,oBAAoB,kBAAkB,6BAA6B,sDAAsD,QAAQ,yCAAyC,+DAA+D,qCAAqC,kBAAkB,kBAAkB,oBAAoB,mBAAmB,qBAAqB,UAAU,YAAY,UAAU,aAAa,aAAa,qBAAqB,eAAe,yBAAyB,eAAe,yBAAyB,eAAe,wDAAwD,eAAe,wDAAwD,eAAe,yBAAyB,eAAe,yBAAyB,eAAe,wDAAwD,eAAe,wDAAwD,cAAc,QAAQ,qEAAqE,oBAAoB,mBAAmB,wBAAwB,UAAU,oBAAoB,0EAA0E,wBAAwB,6BAA6B,4CAA4C,GAAG,kBAAkB,oBAAoB,mDAAmD,SAAS,WAAW,wEAAwE,+BAA+B,kDAAkD,0BAA0B,iBAAiB,+DAA+D,0BAA0B,aAAa,0BAA0B,EAAE,iBAAiB,+DAA+D,0BAA0B,aAAa,0BAA0B,EAAE,iBAAiB,WAAW,8BAA8B,oBAAoB,iBAAiB,mDAAmD,YAAY,iEAAiE,OAAO,cAAc,UAAU,yCAAyC,WAAW,kBAAkB,UAAU,iEAAiE,MAAM,+BAA+B,YAAY,WAAW,eAAe,mCAAmC,OAAO,0BAA0B,qCAAqC,IAAI,mBAAmB,oBAAoB,mBAAmB,wBAAwB,YAAY,gEAAgE,OAAO,cAAc,UAAU,yCAAyC,WAAW,kBAAkB,UAAU,iEAAiE,MAAM,+BAA+B,GAAG,WAAW,cAAc,kCAAkC,OAAO,2BAA2B,wCAAwC,uDAAuD,EAAE,IAAI,kBAAkB,oBAAoB,mBAAmB,sBAAsB,UAAU,kBAAkB,2BAA2B,gCAAgC,wBAAwB,yLAAyL,sCAAsC,MAAM,gCAAgC,mBAAmB,8HAA8H,SAAS,MAAM,gBAAgB,WAAW,uBAAuB,4CAA4C,IAAI,gBAAgB,oBAAoB,OAAO,8BAA8B,iCAAiC,4EAA4E,uBAAuB,UAAU,oBAAoB,8DAA8D,KAAK,wCAAwC,YAAY,eAAe,WAAW,kHAAkH,uBAAuB,IAAI,2BAA2B,SAAS,UAAU,MAAM,oBAAoB,oBAAoB,KAAK,gHAAgH,YAAY,SAAS,OAAO,yDAAyD,WAAW,WAAW,0BAA0B,IAAI,8BAA8B,mBAAmB,aAAa,kCAAkC,cAAc,kCAAkC,sBAAsB,IAAI,EAAE,mBAAmB,sDAAsD,aAAa,QAAQ,2CAA2C,wDAAwD,eAAe,wDAAwD,mBAAmB,oBAAoB,6CAA6C,oBAAoB,oBAAoB,+CAA+C,oBAAoB,mBAAmB,qBAAqB,QAAQ,qFAAqF,UAAU,kDAAkD,cAAc,2CAA2C,oBAAoB,kCAAkC,UAAU,oBAAoB,gEAAgE,YAAY,WAAW,uBAAuB,wEAAwE,IAAI,eAAe,oBAAoB,mBAAmB,uBAAuB,UAAU,mCAAmC,UAAU,6BAA6B,SAAS,0CAA0C,WAAW,4BAA4B,UAAU,iEAAiE,SAAS,mCAAmC,iBAAiB,mBAAmB,yDAAyD,GAAG,WAAW,aAAa,iCAAiC,OAAO,0BAA0B,gGAAgG,GAAG,SAAS,gBAAgB,iBAAiB,6HAA6H,iBAAiB,UAAU,gBAAgB,SAAS,kBAAkB,gCAAgC,iBAAiB,6BAA6B,iBAAiB,+BAA+B,0BAA0B,mBAAmB,uIAAuI,2BAA2B,4BAA4B,QAAQ,gDAAgD,sBAAsB,iBAAiB,sFAAsF,SAAS,OAAO,UAAU,oBAAoB,uBAAuB,2BAA2B,YAAY,uDAAuD,oBAAoB,eAAe,uBAAuB,QAAQ,cAAc,cAAc,8BAA8B,cAAc,6HAA6H,wBAAwB,oBAAoB,uBAAuB,sCAAsC,cAAc,+BAA+B,mCAAmC,kBAAkB,qBAAqB,+DAA+D,0EAA0E,MAAM,0DAA0D,EAAE,oBAAoB,kCAAkC,sCAAsC,cAAc,+BAA+B,mCAAmC,kBAAkB,YAAY,0BAA0B,0CAA0C,qIAAqI,MAAM,mDAAmD,EAAE,UAAU,wCAAwC,KAAK,kBAAkB,+CAA+C,iBAAiB,yCAAyC,iBAAiB,2BAA2B,iBAAiB,2BAA2B,iBAAiB,6DAA6D,iBAAiB,mDAAmD,iBAAiB,mDAAmD,iBAAiB,yCAAyC,mBAAmB,6BAA6B,iBAAiB,mEAAmE,2BAA2B,wBAAwB,IAAI,0BAA0B,uBAAuB,yBAAyB,8BAA8B,4CAA4C,4BAA4B,IAAI,4BAA4B,qBAAqB,sBAAsB,eAAe,6EAA6E,iBAAiB,qBAAqB,mBAAmB,mBAAmB,KAAK,gDAAgD,gCAAgC,mDAAmD,iBAAiB,+CAA+C,qHAAqH,eAAe,kDAAkD,qBAAqB,0CAA0C,gCAAgC,eAAe,8BAA8B,4DAA4D,yBAAyB,eAAe,sCAAsC,oBAAoB,OAAO,mFAAmF,UAAU,oBAAoB,gEAAgE,KAAK,uRAAuR,YAAY,gBAAgB,4FAA4F,aAAa,SAAS,kIAAkI,KAAK,8BAA8B,oHAAoH,eAAe,uBAAuB,KAAK,0CAA0C,MAAM,KAAK,kCAAkC,KAAK,uBAAuB,aAAa,SAAS,0BAA0B,0BAA0B,KAAK,0BAA0B,kCAAkC,SAAS,0BAA0B,KAAK,+BAA+B,aAAa,SAAS,yCAAyC,iEAAiE,IAAI,UAAU,oBAAoB,QAAQ,mFAAmF,KAAK,8qBAA8qB,YAAY,WAAW,mBAAmB,SAAS,uBAAuB,IAAI,2NAA2N,aAAa,QAAQ,aAAa,iBAAiB,mLAAmL,SAAS,eAAe,kHAAkH,MAAM,aAAa,8DAA8D,8DAA8D,IAAI,OAAO,mEAAmE,YAAY,MAAM,QAAQ,yDAAyD,WAAW,oDAAoD,MAAM,qDAAqD,QAAQ,8CAA8C,QAAQ,6BAA6B,wBAAwB,+TAA+T,mBAAmB,MAAM,SAAS,kBAAkB,gBAAgB,QAAQ,mDAAmD,UAAU,mBAAmB,UAAU,mBAAmB,SAAS,kBAAkB,gBAAgB,QAAQ,6BAA6B,yGAAyG,yCAAyC,UAAU,aAAa,0FAA0F,aAAa,kFAAkF,2CAA2C,SAAS,kBAAkB,gBAAgB,SAAS,iCAAiC,IAAI,4BAA4B,kEAAkE,+BAA+B,YAAY,QAAQ,sEAAsE,QAAQ,WAAW,kBAAkB,yCAAyC,4BAA4B,qEAAqE,UAAU,mBAAmB,UAAU,UAAU,eAAe,KAAK,SAAS,EAAE,0DAA0D,wBAAwB,UAAU,oBAAoB,kBAAkB,yBAAyB,cAAc,MAAM,MAAM,iEAAiE,cAAc,0BAA0B,EAAE,oBAAoB,mBAAmB,qBAAqB,QAAQ,yDAAyD,QAAQ,+BAA+B,UAAU,iEAAiE,UAAU,6CAA6C,QAAQ,8FAA8F,UAAU,oBAAoB,0DAA0D,SAAS,iEAAiE,KAAK,wDAAwD,KAAK,yDAAyD,8BAA8B,WAAW,oBAAoB,wCAAwC,IAAI,eAAe,QAAQ,gCAAgC,8DAA8D,kBAAkB,+BAA+B,oBAAoB,kDAAkD,kBAAkB,mGAAmG,oBAAoB,oBAAoB,iEAAiE,oBAAoB,mBAAmB,yBAAyB,GAAG,WAAW,uBAAuB,wCAAwC,IAAI,oCAAoC,oBAAoB,mBAAmB,0BAA0B,GAAG,WAAW,wBAAwB,wCAAwC,IAAI,qCAAqC,oBAAoB,mBAAmB,sBAAsB,MAAM,YAAY,KAAK,WAAW,sBAAsB,kCAAkC,IAAI,eAAe,SAAS,cAAc,iCAAiC,QAAQ,sCAAsC,OAAO,oCAAoC,QAAQ,2BAA2B,6BAA6B,oGAAoG,UAAU,4JAA4J,QAAQ,oBAAoB,wHAAwH,UAAU,mIAAmI,wBAAwB,MAAM,EAAE,oFAAoF,cAAc,OAAO,+CAA+C,aAAa,EAAE,oFAAoF,cAAc,8BAA8B,oFAAoF,gBAAgB,6BAA6B,iBAAiB,+BAA+B,oBAAoB,iCAAiC,UAAU,WAAW,2BAA2B,KAAK,uEAAuE,EAAE,WAAW,yBAAyB,KAAK,6BAA6B,UAAU,WAAW,KAAK,wBAAwB,KAAK,kGAAkG,gBAAgB,sCAAsC,OAAO,4CAA4C,eAAe,iBAAiB,qCAAqC,oBAAoB,kBAAkB,wTAAwT,SAAS,wBAAwB,SAAS,6DAA6D,aAAa,2DAA2D,+BAA+B,uBAAuB,4DAA4D,wBAAwB,oBAAoB,kDAAkD,qBAAqB,uDAAuD,QAAQ,wCAAwC,WAAW,oDAAoD,OAAO,qDAAqD,WAAW,qBAAqB,iCAAiC,oBAAoB,0BAA0B,gBAAgB,wCAAwC,QAAQ,0BAA0B,+CAA+C,4CAA4C,+BAA+B,wBAAwB,qCAAqC,qBAAqB,KAAK,8EAA8E,iCAAiC,wBAAwB,gCAAgC,uBAAuB,qDAAqD,yLAAyL,QAAQ,+BAA+B,UAAU,0DAA0D,SAAS,gDAAgD,OAAO,iCAAiC,QAAQ,4DAA4D,cAAc,sCAAsC,0FAA0F,aAAa,qEAAqE,gBAAgB,gJAAgJ,cAAc,2BAA2B,6BAA6B,SAAS,sDAAsD,0IAA0I,+BAA+B,IAAI,EAAE,oCAAoC,iCAAiC,SAAS,mCAAmC,IAAI,KAAK,oCAAoC,QAAQ,2BAA2B,yJAAyJ,4JAA4J,GAAG,SAAS,qBAAqB,gGAAgG,EAAE,oBAAoB,eAAe,yRAAyR,0QAA0Q,uBAAuB,iBAAiB,kLAAkL,kDAAkD,UAAU,kDAAkD,kBAAkB,0CAA0C,SAAS,6BAA6B,eAAe,gDAAgD,6HAA6H,iBAAiB,mCAAmC,2BAA2B,8HAA8H,SAAS,yBAAyB,WAAW,0DAA0D,UAAU,0BAA0B,QAAQ,oCAAoC,WAAW,uEAAuE,SAAS,sBAAsB,YAAY,uJAAuJ,SAAS,kCAAkC,YAAY,mEAAmE,iCAAiC,+CAA+C,oBAAoB,WAAW,oDAAoD,YAAY,6FAA6F,MAAM,YAAY,oBAAoB,sFAAsF,iCAAiC,aAAa,mEAAmE,6CAA6C,6CAA6C,YAAY,mFAAmF,eAAe,yBAAyB,mFAAmF,oDAAoD,QAAQ,2DAA2D,WAAW,mDAAmD,gBAAgB,8GAA8G,iCAAiC,QAAQ,6BAA6B,6BAA6B,gEAAgE,qBAAqB,4FAA4F,qDAAqD,4BAA4B,iDAAiD,SAAS,kKAAkK,QAAQ,6BAA6B,qBAAqB,yBAAyB,YAAY,yDAAyD,aAAa,wBAAwB,kCAAkC,eAAe,2DAA2D,IAAI,KAAK,gEAAgE,iEAAiE,sBAAsB,qBAAqB,mDAAmD,sBAAsB,wBAAwB,aAAa,QAAQ,SAAS,iCAAiC,IAAI,KAAK,+CAA+C,8CAA8C,SAAS,oBAAoB,qBAAqB,yCAAyC,qDAAqD,kCAAkC,oJAAoJ,wBAAwB,sBAAsB,UAAU,QAAQ,SAAS,gCAAgC,wCAAwC,6BAA6B,WAAW,aAAa,6DAA6D,EAAE,mDAAmD,cAAc,sEAAsE,qHAAqH,SAAS,cAAc,4BAA4B,OAAO,mCAAmC,eAAe,kDAAkD,eAAe,iCAAiC,8GAA8G,UAAU,8BAA8B,gEAAgE,WAAW,2CAA2C,SAAS,uBAAuB,QAAQ,WAAW,YAAY,sBAAsB,KAAK,wBAAwB,oIAAoI,KAAK,kBAAkB,uBAAuB,2BAA2B,YAAY,UAAU,8BAA8B,2DAA2D,GAAG,SAAS,eAAe,6CAA6C,4FAA4F,YAAY,2BAA2B,iCAAiC,8CAA8C,sBAAsB,6FAA6F,eAAe,+GAA+G,kBAAkB,wFAAwF,QAAQ,UAAU,kCAAkC,UAAU,iCAAiC,kBAAkB,+CAA+C,MAAM,EAAE,QAAQ,sCAAsC,mDAAmD,8BAA8B,+BAA+B,eAAe,qDAAqD,eAAe,6DAA6D,MAAM,aAAa,0DAA0D,6BAA6B,iCAAiC,mCAAmC,mCAAmC,WAAW,6CAA6C,0CAA0C,8BAA8B,gCAAgC,eAAe,+CAA+C,iBAAiB,YAAY,wCAAwC,kBAAkB,yFAAyF,2BAA2B,uCAAuC,4CAA4C,cAAc,8BAA8B,gHAAgH,eAAe,yBAAyB,MAAM,QAAQ,gDAAgD,cAAc,kBAAkB,+BAA+B,MAAM,sCAAsC,0GAA0G,cAAc,sFAAsF,gBAAgB,+EAA+E,eAAe,iFAAiF,eAAe,qEAAqE,QAAQ,gCAAgC,MAAM,gCAAgC,SAAS,qCAAqC,SAAS,qCAAqC,YAAY,wBAAwB,wBAAwB,kDAAkD,oCAAoC,WAAW,8BAA8B,0CAA0C,eAAe,2CAA2C,eAAe,kBAAkB,mCAAmC,mBAAmB,sCAAsC,oCAAoC,8BAA8B,4BAA4B,eAAe,2CAA2C,mCAAmC,mBAAmB,sCAAsC,OAAO,iCAAiC,OAAO,iCAAiC,WAAW,sBAAsB,aAAa,wBAAwB,WAAW,MAAM,kHAAkH,UAAU,oCAAoC,WAAW,qCAAqC,eAAe,oDAAoD,2CAA2C,mEAAmE,8BAA8B,8BAA8B,eAAe,4CAA4C,wCAAwC,YAAY,sCAAsC,kBAAkB,oDAAoD,WAAW,sCAAsC,4DAA4D,2JAA2J,QAAQ,0BAA0B,iBAAiB,oBAAoB,mBAAmB,qCAAqC,OAAO,6FAA6F,SAAS,0IAA0I,YAAY,gCAAgC,sBAAsB,0EAA0E,kBAAkB,kBAAkB,wBAAwB,wDAAwD,OAAO,wCAAwC,GAAG,WAAW,qBAAqB,wBAAwB,IAAI,iBAAiB,oBAAoB,mBAAmB,wBAAwB,GAAG,WAAW,qBAAqB,wBAAwB,IAAI,iBAAiB,QAAQ,iCAAiC,8FAA8F,mBAAmB,yCAAyC,6BAA6B,uDAAuD,6BAA6B,uDAAuD,kCAAkC,0BAA0B,8BAA8B,yDAAyD,8BAA8B,yDAAyD,oCAAoC,4BAA4B,gBAAgB,wBAAwB,gBAAgB,wBAAwB,qBAAqB,wBAAwB,mBAAmB,8BAA8B,oBAAoB,mBAAmB,kFAAkF,WAAW,4EAA4E,WAAW,yDAAyD,aAAa,QAAQ,yBAAyB,uBAAuB,yFAAyF,sGAAsG,wBAAwB,YAAY,WAAW,+DAA+D,QAAQ,eAAe,6BAA6B,QAAQ,KAAK,uBAAuB,IAAI,iIAAiI,SAAS,iEAAiE,iDAAiD,IAAI,uBAAuB,iCAAiC,YAAY,WAAW,uBAAuB,gCAAgC,2BAA2B,iCAAiC,IAAI,eAAe,oBAAoB,mBAAmB,qCAAqC,MAAM,yBAAyB,MAAM,yBAAyB,UAAU,qBAAqB,sBAAsB,kCAAkC,qHAAqH,sCAAsC,QAAQ,sKAAsK,YAAY,OAAO,wBAAwB,eAAe,qDAAqD,GAAG,OAAO,uBAAuB,iCAAiC,gBAAgB,oBAAoB,mBAAmB,uBAAuB,UAAU,wBAAwB,MAAM,wBAAwB,MAAM,kBAAkB,QAAQ,yCAAyC,MAAM,yCAAyC,KAAK,WAAW,wBAAwB,0CAA0C,IAAI,iBAAiB,oBAAoB,mBAAmB,yBAAyB,SAAS,2CAA2C,WAAW,kBAAkB,UAAU,+CAA+C,GAAG,WAAW,mBAAmB,+BAA+B,GAAG,UAAU,UAAU,mCAAmC,aAAa,sDAAsD,mDAAmD,UAAU,qCAAqC,mBAAmB,oBAAoB,mBAAmB,+BAA+B,GAAG,WAAW,+BAA+B,kCAAkC,IAAI,wBAAwB,QAAQ,mCAAmC,wCAAwC,MAAM,IAAI,WAAW,SAAS,OAAO,2FAA2F,gBAAgB,QAAQ,gBAAgB,uBAAuB,gBAAgB,uBAAuB,kCAAkC,+CAA+C,sCAAsC,sBAAsB,uBAAuB,kCAAkC,4DAA4D,wCAAwC,iDAAiD,qBAAqB,QAAQ,iCAAiC,+CAA+C,6BAA6B,sCAAsC,6BAA6B,wCAAwC,oBAAoB,mBAAmB,mBAAmB,YAAY,WAAW,oBAAoB,wBAAwB,IAAI,YAAY,oBAAoB,mBAAmB,kBAAkB,UAAU,6BAA6B,MAAM,8BAA8B,YAAY,WAAW,oBAAoB,8BAA8B,GAAG,UAAU,SAAS,sBAAsB,kBAAkB,mBAAmB,2BAA2B,mBAAmB,qCAAqC,WAAW,oBAAoB,gFAAgF,UAAU,sBAAsB,uDAAuD,YAAY,oBAAoB,mBAAmB,qBAAqB,SAAS,2CAA2C,WAAW,kBAAkB,UAAU,0CAA0C,GAAG,WAAW,mBAAmB,+BAA+B,GAAG,UAAU,SAAS,8BAA8B,aAAa,sDAAsD,8CAA8C,UAAU,gCAAgC,eAAe,oBAAoB,mBAAmB,qBAAqB,UAAU,iDAAiD,4DAA4D,iKAAiK,GAAG,UAAU,qBAAqB,wCAAwC,eAAe,oBAAoB,mBAAmB,sBAAsB,cAAc,qCAAqC,aAAa,EAAE,+BAA+B,wBAAwB,EAAE,UAAU,kCAAkC,eAAe,eAAe,UAAU,EAAE,oCAAoC,EAAE,YAAY,IAAI,QAAQ,SAAS,WAAW,kCAAkC,iBAAiB,qCAAqC,gBAAgB,oBAAoB,mBAAmB,yBAAyB,QAAQ,qBAAqB,wBAAwB,QAAQ,qBAAqB,WAAW,uCAAuC,QAAQ,+BAA+B,GAAG,WAAW,0BAA0B,mDAAmD,GAAG,OAAO,yBAAyB,eAAe,MAAM,0EAA0E,uBAAuB,uBAAuB,mBAAmB,cAAc,iCAAiC,OAAO,oBAAoB,+EAA+E,aAAa,kFAAkF,8CAA8C,oBAAoB,mBAAmB,oBAAoB,SAAS,0CAA0C,GAAG,WAAW,qBAAqB,iCAAiC,IAAI,cAAc,WAAW,sWAAsW,aAAa,aAAa,sCAAsC,SAAS,qEAAqE,UAAU,iDAAiD,EAAE,4BAA4B,UAAU,qCAAqC,KAAK,qHAAqH,yCAAyC,4CAA4C,4BAA4B,qBAAqB,oDAAoD,QAAQ,eAAe,KAAK,YAAY,mCAAmC,2BAA2B,MAAM,mBAAmB,MAAM,mBAAmB,KAAK,6CAA6C,aAAa,aAAa,sCAAsC,SAAS,aAAa,0vFAA0vF,qBAAqB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,sCAAsC,eAAe,aAAa,sCAAsC,SAAS,6CAA6C,wBAAwB,cAAc,yCAAyC,gEAAgE,EAAE,mDAAmD,qDAAqD,mBAAmB,IAAI,aAAa,MAAM,aAAa,qBAAqB,8FAA8F,EAAE,0IAA0I,mEAAmE,qBAAqB,OAAO,qCAAqC,mCAAmC,aAAa,MAAM,mBAAmB,qCAAqC,OAAO,8CAA8C,qCAAqC,OAAO,+CAA+C,gBAAgB,aAAa,aAAa,sCAAsC,SAAS,EAAE,SAAS,MAAM,oBAAoB,YAAY,uBAAuB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,0iBAA0iB,YAAY,gCAAgC,6BAA6B,eAAe,mCAAmC,6BAA6B,gBAAgB,2CAA2C,6BAA6B,wBAAwB,uCAAuC,6BAA6B,oBAAoB,uCAAuC,6BAA6B,oBAAoB,iCAAiC,6BAA6B,cAAc,mCAAmC,6BAA6B,gBAAgB,oCAAoC,6BAA6B,iBAAiB,iDAAiD,6BAA6B,8BAA8B,kDAAkD,6BAA6B,+BAA+B,oDAAoD,6BAA6B,iCAAiC,yCAAyC,6BAA6B,sBAAsB,2DAA2D,6BAA6B,wCAAwC,sDAAsD,6BAA6B,mCAAmC,EAAE,YAAY,gCAAgC,6BAA6B,kBAAkB,EAAE,YAAY,+BAA+B,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,EAAE,iBAAiB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,kFAAkF,SAAS,aAAa,sCAAsC,SAAS,EAAE,SAAS,aAAa,sCAAsC,SAAS,EAAE,SAAS,aAAa,MAAM,sCAAsC,SAAS,sEAAsE,2CAA2C,SAAS,aAAa,sCAAsC,SAAS,EAAE,SAAS,aAAa,sCAAsC,SAAS,EAAE,SAAS,aAAa,MAAM,sCAAsC,SAAS,gEAAgE,iDAAiD,SAAS,aAAa,sCAAsC,SAAS,EAAE,SAAS,aAAa,sCAAsC,SAAS,EAAE,WAAW,aAAa,cAAc,oHAAoH,EAAE,oFAAoF,WAAW,aAAa,cAAc,iGAAiG,EAAE,+EAA+E,cAAc,IAAI,kBAAkB,cAAc,WAAW,gBAAgB,4DAA4D,mCAAmC,+BAA+B,IAAI,8BAA8B,oBAAoB,EAAE,WAAW,aAAa,cAAc,mXAAmX,EAAE,YAAY,aAAa,0BAA0B,mEAAmE,cAAc,0BAA0B,iDAAiD,gBAAgB,iDAAiD,cAAc,qCAAqC,oBAAoB,0BAA0B,qCAAqC,sBAAsB,qCAAqC,gBAAgB,UAAU,WAAW,iBAAiB,6CAA6C,SAAS,gBAAgB,0CAA0C,8DAA8D,gBAAgB,WAAW,gDAAgD,cAAc,2BAA2B,kBAAkB,4DAA4D,6DAA6D,kBAAkB,4DAA4D,+DAA+D,kBAAkB,8CAA8C,6CAA6C,gBAAgB,gCAAgC,sCAAsC,gBAAgB,2CAA2C,cAAc,qDAAqD,cAAc,uCAAuC,oBAAoB,sEAAsE,kBAAkB,qEAAqE,kBAAkB,qEAAqE,gBAAgB,0DAA0D,gBAAgB,4DAA4D,8PAA8P,kBAAkB,yDAAyD,oBAAoB,6EAA6E,YAAY,WAAW,aAAa,cAAc,iXAAiX,EAAE,YAAY,aAAa,0BAA0B,iFAAiF,cAAc,0BAA0B,qEAAqE,gBAAgB,qEAAqE,cAAc,mDAAmD,wBAAwB,0BAA0B,mDAAmD,0BAA0B,mDAAmD,gBAAgB,wDAAwD,gGAAgG,cAAc,2BAA2B,kBAAkB,wFAAwF,2FAA2F,kBAAkB,0EAA0E,6EAA6E,kBAAkB,4DAA4D,2DAA2D,kBAAkB,4DAA4D,mEAAmE,gBAAgB,gCAAgC,oDAAoD,gBAAgB,yDAAyD,gBAAgB,yDAAyD,cAAc,0EAA0E,cAAc,mDAAmD,kBAAkB,mGAAmG,kBAAkB,mGAAmG,kBAAkB,iFAAiF,oBAAoB,+GAA+G,gBAAgB,oFAAoF,gBAAgB,wFAAwF,0XAA0X,YAAY,WAAW,aAAa,cAAc,meAAme,EAAE,YAAY,aAAa,0BAA0B,sGAAsG,gBAAgB,oGAAoG,cAAc,0BAA0B,mGAAmG,gBAAgB,mGAAmG,8BAA8B,0BAA0B,wEAAwE,gCAAgC,wEAAwE,cAAc,wEAAwE,gBAAgB,UAAU,yBAAyB,mDAAmD,+FAA+F,SAAS,gBAAgB,gHAAgH,4JAA4J,gBAAgB,mEAAmE,8HAA8H,cAAc,mEAAmE,4CAA4C,kBAAkB,kIAAkI,kKAAkK,kBAAkB,iFAAiF,gGAAgG,kBAAkB,+FAA+F,4GAA4G,kBAAkB,kBAAkB,+GAA+G,gBAAgB,8EAA8E,gBAAgB,gCAAgC,yEAAyE,gBAAgB,8EAA8E,gBAAgB,0FAA0F,gBAAgB,wGAAwG,gGAAgG,gBAAgB,4QAA4Q,qNAAqN,kBAAkB,8EAA8E,cAAc,uGAAuG,cAAc,gEAAgE,kBAAkB,gJAAgJ,kBAAkB,gJAAgJ,kBAAkB,qHAAqH,oBAAoB,kKAAkK,gBAAgB,2HAA2H,gBAAgB,kIAAkI,ojBAAojB,YAAY,WAAW,aAAa,cAAc,+xBAA+xB,EAAE,YAAY,aAAa,2BAA2B,6JAA6J,cAAc,2BAA2B,qLAAqL,gBAAgB,qLAAqL,4CAA4C,2BAA2B,+HAA+H,8CAA8C,+HAA+H,cAAc,+HAA+H,gBAAgB,UAAU,+CAA+C,6GAA6G,iLAAiL,SAAS,gBAAgB,4QAA4Q,8WAA8W,gBAAgB,0HAA0H,urBAAurB,cAAc,0HAA0H,8HAA8H,kBAAkB,sJAAsJ,ybAAyb,kBAAkB,iDAAiD,qaAAqa,kBAAkB,yBAAyB,6MAA6M,oBAAoB,6FAA6F,ohBAAohB,kBAAkB,0FAA0F,oNAAoN,kBAAkB,0FAA0F,oNAAoN,kBAAkB,wFAAwF,sNAAsN,gBAAgB,wIAAwI,gBAAgB,wIAAwI,kBAAkB,mDAAmD,yQAAyQ,gBAAgB,gCAAgC,gIAAgI,gBAAgB,gCAAgC,gIAAgI,gBAAgB,gCAAgC,gIAAgI,kBAAkB,wGAAwG,sKAAsK,gBAAgB,uGAAuG,sLAAsL,gBAAgB,0CAA0C,gBAAgB,oEAAoE,8EAA8E,gBAAgB,0BAA0B,OAAO,6HAA6H,kUAAkU,oBAAoB,6HAA6H,0MAA0M,sBAAsB,wPAAwP,wLAAwL,gBAAgB,wGAAwG,uJAAuJ,0BAA0B,kCAAkC,gKAAgK,sBAAsB,wBAAwB,iMAAiM,oBAAoB,+KAA+K,iKAAiK,0BAA0B,kCAAkC,yJAAyJ,oBAAoB,uFAAuF,0dAA0d,oBAAoB,uFAAuF,qCAAqC,kCAAkC,mMAAmM,cAAc,mLAAmL,cAAc,yGAAyG,kBAAkB,2QAA2Q,kBAAkB,2QAA2Q,kBAAkB,qNAAqN,oBAAoB,2SAA2S,gBAAgB,kOAAkO,gBAAgB,gPAAgP,s+BAAs+B,YAAY,WAAW,aAAa,cAAc,ihBAAihB,EAAE,oCAAoC,aAAa,0BAA0B,mEAAmE,cAAc,qCAAqC,kBAAkB,MAAM,kBAAkB,8DAA8D,gBAAgB,wCAAwC,kFAAkF,gBAAgB,aAAa,0BAA0B,kBAAkB,4DAA4D,6FAA6F,kBAAkB,MAAM,4DAA4D,6DAA6D,kBAAkB,MAAM,4DAA4D,6DAA6D,kBAAkB,MAAM,4DAA4D,6DAA6D,gBAAgB,yBAAyB,sEAAsE,gBAAgB,+FAA+F,uDAAuD,gBAAgB,mFAAmF,sEAAsE,kBAAkB,gCAAgC,oBAAoB,sEAAsE,+MAA+M,cAAc,2EAA2E,6HAA6H,gBAAgB,4DAA4D,gDAAgD,gBAAgB,oDAAoD,gBAAgB,uBAAuB,kGAAkG,KAAK,QAAQ,sCAAsC,wBAAwB,4IAA4I,SAAS,oBAAoB,qBAAqB,eAAe,wFAAwF,6EAA6E,cAAc,qDAAqD,2PAA2P,iBAAiB,4MAA4M,uCAAuC,kDAAkD,oCAAoC,gHAAgH,EAAE,WAAW,aAAa,cAAc,giBAAgiB,EAAE,YAAY,aAAa,0BAA0B,mEAAmE,cAAc,0BAA0B,iDAAiD,oBAAoB,0BAA0B,qCAAqC,gBAAgB,iDAAiD,sBAAsB,qCAAqC,kBAAkB,qEAAqE,kBAAkB,qEAAqE,kBAAkB,qEAAqE,kBAAkB,qEAAqE,gBAAgB,6FAA6F,gBAAgB,iGAAiG,kBAAkB,6GAA6G,kBAAkB,6GAA6G,gBAAgB,iGAAiG,kBAAkB,yDAAyD,oBAAoB,6EAA6E,gBAAgB,oDAAoD,2BAA2B,gBAAgB,oDAAoD,uBAAuB,cAAc,gCAAgC,2BAA2B,cAAc,gCAAgC,uBAAuB,gBAAgB,qDAAqD,gBAAgB,yDAAyD,gBAAgB,kDAAkD,qEAAqE,gBAAgB,+CAA+C,oBAAoB,oKAAoK,+EAA+E,oBAAoB,gCAAgC,iFAAiF,gBAAgB,gBAAgB,OAAO,GAAG,4CAA4C,YAAY,GAAG,4CAA4C,YAAY,yBAAyB,iDAAiD,kBAAkB,gCAAgC,mJAAmJ,kBAAkB,8GAA8G,2FAA2F,cAAc,qCAAqC,cAAc,qDAAqD,gBAAgB,0DAA0D,gBAAgB,4DAA4D,8PAA8P,iEAAiE,QAAQ,gEAAgE,IAAI,0GAA0G,SAAS,EAAE,WAAW,aAAa,cAAc,qoBAAqoB,EAAE,YAAY,aAAa,0BAA0B,4DAA4D,cAAc,0BAA0B,uCAAuC,cAAc,yBAAyB,yBAAyB,kBAAkB,0BAA0B,8BAA8B,gBAAgB,uCAAuC,oBAAoB,8BAA8B,kBAAkB,sDAAsD,kBAAkB,sDAAsD,kBAAkB,sDAAsD,kBAAkB,sDAAsD,gBAAgB,wEAAwE,gBAAgB,2EAA2E,kBAAkB,oFAAoF,kBAAkB,oFAAoF,gBAAgB,2EAA2E,kBAAkB,6CAA6C,oBAAoB,4DAA4D,gBAAgB,wCAAwC,yBAAyB,gBAAgB,wCAAwC,mBAAmB,cAAc,yBAAyB,mBAAmB,gBAAgB,0CAA0C,gBAAgB,6CAA6C,gBAAgB,uCAAuC,qEAAqE,gBAAgB,qCAAqC,kBAAkB,8CAA8C,gDAAgD,oBAAoB,yBAAyB,+DAA+D,wBAAwB,0DAA0D,4GAA4G,wBAAwB,kDAAkD,4GAA4G,gBAAgB,OAAO,iEAAiE,wDAAwD,kBAAkB,uDAAuD,6HAA6H,kBAAkB,yBAAyB,uFAAuF,kBAAkB,uHAAuH,wEAAwE,oBAAoB,cAAc,2LAA2L,oBAAoB,cAAc,2LAA2L,oBAAoB,cAAc,2LAA2L,gBAAgB,4GAA4G,6CAA6C,cAAc,8BAA8B,cAAc,2CAA2C,gBAAgB,6CAA6C,gBAAgB,8CAA8C,gMAAgM,iEAAiE,QAAQ,gEAAgE,IAAI,kFAAkF,SAAS,EAAE,WAAW,aAAa,cAAc,2mBAA2mB,EAAE,4BAA4B,aAAa,0BAA0B,+FAA+F,cAAc,0BAA0B,yFAAyF,4BAA4B,0BAA0B,iEAAiE,0BAA0B,0BAA0B,4BAA4B,yBAAyB,8EAA8E,kBAAkB,8DAA8D,0GAA0G,gBAAgB,mFAAmF,gBAAgB,6EAA6E,gBAAgB,iBAAiB,mBAAmB,0BAA0B,wCAAwC,gBAAgB,yFAAyF,cAAc,iEAAiE,8BAA8B,iEAAiE,aAAa,gBAAgB,iDAAiD,aAAa,gBAAgB,iDAAiD,gBAAgB,+DAA+D,oFAAoF,kBAAkB,0FAA0F,kHAAkH,kBAAkB,uIAAuI,0IAA0I,kBAAkB,uIAAuI,0IAA0I,kBAAkB,uIAAuI,0IAA0I,kBAAkB,4DAA4D,6MAA6M,kBAAkB,4DAA4D,6MAA6M,oBAAoB,uCAAuC,iCAAiC,MAAM,6FAA6F,oFAAoF,gCAAgC,6FAA6F,kBAAkB,iIAAiI,kBAAkB,oHAAoH,iPAAiP,QAAQ,kBAAkB,yGAAyG,YAAY,oBAAoB,UAAU,kLAAkL,gBAAgB,WAAW,+GAA+G,gBAAgB,+FAA+F,yCAAyC,gBAAgB,WAAW,QAAQ,eAAe,sFAAsF,wFAAwF,SAAS,cAAc,8FAA8F,gBAAgB,8GAA8G,gBAAgB,oHAAoH,ufAAuf,WAAW,aAAa,cAAc,kmBAAkmB,EAAE,YAAY,aAAa,0BAA0B,qDAAqD,cAAc,0BAA0B,6BAA6B,gBAAgB,0BAA0B,uBAAuB,gBAAgB,6BAA6B,kBAAkB,uBAAuB,kBAAkB,uCAAuC,kBAAkB,uCAAuC,kBAAkB,uCAAuC,kBAAkB,uCAAuC,gBAAgB,mDAAmD,gBAAgB,qDAAqD,kBAAkB,2DAA2D,kBAAkB,2DAA2D,gBAAgB,qDAAqD,kBAAkB,iCAAiC,oBAAoB,2CAA2C,gBAAgB,4BAA4B,uBAAuB,gBAAgB,4BAA4B,eAAe,cAAc,kBAAkB,uBAAuB,cAAc,kBAAkB,eAAe,gBAAgB,+BAA+B,gBAAgB,iCAAiC,gBAAgB,4BAA4B,yDAAyD,gBAAgB,2BAA2B,kBAAkB,0BAA0B,4BAA4B,oBAAoB,kBAAkB,6CAA6C,gBAAgB,OAAO,2BAA2B,+CAA+C,kBAAkB,kBAAkB,+CAA+C,kBAAkB,kBAAkB,yDAAyD,kBAAkB,kBAAkB,yDAAyD,kBAAkB,kBAAkB,2DAA2D,oBAAoB,wDAAwD,6CAA6C,gBAAgB,yFAAyF,6CAA6C,cAAc,uBAAuB,cAAc,iCAAiC,gBAAgB,gCAAgC,gBAAgB,gCAAgC,kIAAkI,iEAAiE,QAAQ,gEAAgE,IAAI,0DAA0D,SAAS,EAAE,WAAW,aAAa,sCAAsC,SAAS,iBAAiB,sCAAsC,QAAQ,gBAAgB,EAAE,qtBAAqtB,gBAAgB,wBAAwB,iBAAiB,yBAAyB,cAAc,oEAAoE,+DAA+D,gGAAgG,YAAY,mBAAmB,mCAAmC,IAAI,mDAAmD,UAAU,wCAAwC,cAAc,qBAAqB,UAAU,wFAAwF,YAAY,IAAI,KAAK,aAAa,4NAA4N,oBAAoB,eAAe,qGAAqG,QAAQ,2BAA2B,uBAAuB,IAAI,KAAK,qBAAqB,qBAAqB,YAAY,OAAO,0DAA0D,UAAU,wDAAwD,iBAAiB,iBAAiB,gBAAgB,mCAAmC,IAAI,gGAAgG,qBAAqB,mCAAmC,IAAI,2CAA2C,uCAAuC,4CAA4C,0BAA0B,yCAAyC,8BAA8B,wCAAwC,MAAM,8BAA8B,uBAAuB,kCAAkC,kBAAkB,+DAA+D,yCAAyC,wBAAwB,UAAU,uBAAuB,IAAI,KAAK,aAAa,8CAA8C,QAAQ,YAAY,iBAAiB,8BAA8B,sBAAsB,kEAAkE,yCAAyC,wBAAwB,uBAAuB,IAAI,KAAK,aAAa,+BAA+B,+BAA+B,4DAA4D,0BAA0B,qFAAqF,UAAU,SAAS,aAAa,sCAAsC,SAAS,sBAAsB,QAAQ,mBAAmB,eAAe,MAAM,wJAAwJ,eAAe,QAAQ,4CAA4C,WAAW,kBAAkB,eAAe,MAAM,gDAAgD,WAAW,8BAA8B,mBAAmB,qFAAqF,WAAW,aAAa,sCAAsC,SAAS,iBAAiB,sCAAsC,6BAA6B,gBAAgB,EAAE,0FAA0F,oBAAoB,gBAAgB,WAAW,sBAAsB,uBAAuB,IAAI,iCAAiC,SAAS,kBAAkB,sBAAsB,uBAAuB,IAAI,wCAAwC,SAAS,UAAU,uBAAuB,IAAI,KAAK,4BAA4B,qCAAqC,0CAA0C,kMAAkM,oBAAoB,eAAe,0HAA0H,cAAc,qBAAqB,QAAQ,0CAA0C,2BAA2B,uBAAuB,IAAI,KAAK,qBAAqB,qBAAqB,YAAY,OAAO,0DAA0D,UAAU,iCAAiC,kCAAkC,8BAA8B,SAAS,gBAAgB,mCAAmC,IAAI,oFAAoF,mBAAmB,gEAAgE,cAAc,gCAAgC,2BAA2B,oDAAoD,mCAAmC,IAAI,yJAAyJ,uCAAuC,SAAS,uBAAuB,kEAAkE,gDAAgD,4CAA4C,aAAa,8HAA8H,mBAAmB,0EAA0E,mBAAmB,2EAA2E,YAAY,wGAAwG,QAAQ,4BAA4B,cAAc,2BAA2B,IAAI,mCAAmC,SAAS,gCAAgC,mBAAmB,6EAA6E,4BAA4B,UAAU,yCAAyC,UAAU,WAAW,aAAa,sCAAsC,SAAS,qBAAqB,6IAA6I,6BAA6B,gBAAgB,EAAE,+DAA+D,qCAAqC,aAAa,kUAAkU,udAAud,WAAW,mBAAmB,ieAAie,kBAAkB,gDAAgD,eAAe,oBAAoB,qEAAqE,kBAAkB,2JAA2J,uBAAuB,8LAA8L,gDAAgD,4CAA4C,qBAAqB,QAAQ,oCAAoC,8EAA8E,qTAAqT,UAAU,cAAc,yDAAyD,QAAQ,WAAW,QAAQ,8KAA8K,YAAY,IAAI,gBAAgB,IAAI,SAAS,wJAAwJ,sEAAsE,+BAA+B,wjBAAwjB,MAAM,UAAU,oGAAoG,MAAM,iFAAiF,mLAAmL,sJAAsJ,6kBAA6kB,mEAAmE,kFAAkF,oBAAoB,YAAY,IAAI,MAAM,wBAAwB,wPAAwP,qBAAqB,wCAAwC,2BAA2B,qFAAqF,SAAS,sCAAsC,8EAA8E,iEAAiE,2BAA2B,IAAI,2CAA2C,iBAAiB,cAAc,qBAAqB,qBAAqB,MAAM,6CAA6C,oEAAoE,YAAY,mBAAmB,mBAAmB,0BAA0B,8BAA8B,8BAA8B,mBAAmB,KAAK,kBAAkB,gBAAgB,SAAS,UAAU,+EAA+E,IAAI,KAAK,8BAA8B,GAAG,oHAAoH,oBAAoB,kCAAkC,OAAO,YAAY,kEAAkE,yBAAyB,MAAM,0BAA0B,oBAAoB,kFAAkF,yBAAyB,6BAA6B,sIAAsI,EAAE,WAAW,aAAa,sCAAsC,SAAS,oFAAoF,cAAc,wIAAwI,yJAAyJ,sBAAsB,0CAA0C,0BAA0B,+CAA+C,SAAS,aAAa,sCAAsC,SAAS,EAAE,wBAAwB,eAAe,qBAAqB,2EAA2E,eAAe,oBAAoB,mCAAmC,qMAAqM,uBAAuB,eAAe,uBAAuB,kBAAkB,qBAAqB,kBAAkB,oBAAoB,kBAAkB,8BAA8B,gDAAgD,mBAAmB,sDAAsD,mBAAmB,sDAAsD,mBAAmB,qFAAqF,mBAAmB,sBAAsB,eAAe,sBAAsB,gBAAgB,sBAAsB,mBAAmB,KAAK,OAAO,KAAK,gDAAgD,YAAY,SAAS,aAAa,sCAAsC,SAAS,6HAA6H,YAAY,kBAAkB,WAAW,aAAa,sCAAsC,SAAS,yCAAyC,cAAc,MAAM,aAAa,kFAAkF,iCAAiC,eAAe,YAAY,qCAAqC,YAAY,gDAAgD,eAAe,wIAAwI,aAAa,uTAAuT,cAAc,uNAAuN,2BAA2B,eAAe,kDAAkD,WAAW,sCAAsC,oBAAoB,0CAA0C,mCAAmC,wBAAwB,6IAA6I,uBAAuB,IAAI,yCAAyC,SAAS,wBAAwB,mCAAmC,sCAAsC,uBAAuB,IAAI,mCAAmC,+BAA+B,oBAAoB,SAAS,aAAa,sCAAsC,SAAS,uCAAuC,WAAW,aAAa,sCAAsC,SAAS,sOAAsO,gFAAgF,kBAAkB,uBAAuB,iBAAiB,eAAe,yBAAyB,qBAAqB,yBAAyB,qBAAqB,wBAAwB,kBAAkB,+CAA+C,mCAAmC,SAAS,2BAA2B,yCAAyC,2DAA2D,WAAW,gBAAgB,4BAA4B,qBAAqB,6DAA6D,uBAAuB,gBAAgB,uCAAuC,QAAQ,8BAA8B,oBAAoB,8CAA8C,oBAAoB,IAAI,eAAe,wCAAwC,gBAAgB,qDAAqD,YAAY,IAAI,UAAU,gBAAgB,sCAAsC,OAAO,qCAAqC,4BAA4B,YAAY,IAAI,mCAAmC,SAAS,+BAA+B,aAAa,kBAAkB,oBAAoB,8BAA8B,KAAK,WAAW,6DAA6D,kBAAkB,0FAA0F,IAAI,yCAAyC,0BAA0B,sGAAsG,EAAE,YAAY,uBAAuB,8CAA8C,2CAA2C,sCAAsC,8CAA8C,gCAAgC,gDAAgD,8BAA8B,0BAA0B,4CAA4C,sCAAsC,8CAA8C,gCAAgC,gDAAgD,+BAA+B,uBAAuB,8CAA8C,sCAAsC,gBAAgB,gCAAgC,oCAAoC,+BAA+B,SAAS,oEAAoE,iFAAiF,iBAAiB,iBAAiB,YAAY,IAAI,gBAAgB,4BAA4B,gBAAgB,IAAI,yEAAyE,SAAS,8BAA8B,WAAW,MAAM,YAAY,aAAa,gGAAgG,cAAc,MAAM,sCAAsC,0BAA0B,2BAA2B,YAAY,mBAAmB,iGAAiG,yBAAyB,yCAAyC,4BAA4B,6FAA6F,YAAY,MAAM,iEAAiE,cAAc,4BAA4B,QAAQ,MAAM,WAAW,QAAQ,MAAM,KAAK,+BAA+B,iBAAiB,SAAS,aAAa,iBAAiB,mBAAmB,eAAe,YAAY,WAAW,KAAK,8CAA8C,6CAA6C,uCAAuC,aAAa,8cAA8c,0IAA0I,wBAAwB,qEAAqE,SAAS,kBAAkB,6BAA6B,iBAAiB,SAAS,sBAAsB,6BAA6B,iBAAiB,SAAS,sBAAsB,6BAA6B,kBAAkB,yBAAyB,8LAA8L,mLAAmL,8HAA8H,WAAW,KAAK,uBAAuB,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,oBAAoB,2BAA2B,2NAA2N,wEAAwE,2VAA2V,YAAY,KAAK,oCAAoC,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,4BAA4B,YAAY,KAAK,4CAA4C,uDAAuD,uBAAuB,mDAAmD,SAAS,4DAA4D,GAAG,WAAW,aAAa,sCAAsC,SAAS,iBAAiB,8BAA8B,4BAA4B,eAAe,qTAAqT,WAAW,8DAA8D,kBAAkB,4EAA4E,QAAQ,0EAA0E,mBAAmB,iJAAiJ,oBAAoB,6LAA6L,mBAAmB,yDAAyD,gBAAgB,eAAe,6CAA6C,gEAAgE,2EAA2E,wDAAwD,MAAM,2DAA2D,uBAAuB,IAAI,KAAK,SAAS,QAAQ,6CAA6C,yBAAyB,cAAc,IAAI,6BAA6B,SAAS,MAAM,4DAA4D,YAAY,0JAA0J,UAAU,WAAW,aAAa,sCAAsC,SAAS,0BAA0B,sCAAsC,4BAA4B,gBAAgB,EAAE,MAAM,mNAAmN,6EAA6E,WAAW,iEAAiE,2BAA2B,sQAAsQ,oBAAoB,oCAAoC,QAAQ,sEAAsE,uBAAuB,IAAI,0EAA0E,SAAS,mBAAmB,+CAA+C,gBAAgB,SAAS,gEAAgE,2EAA2E,wDAAwD,MAAM,2DAA2D,2BAA2B,WAAW,oBAAoB,aAAa,gBAAgB,mBAAmB,WAAW,aAAa,sCAAsC,SAAS,qBAAqB,sCAAsC,iCAAiC,gBAAgB,OAAO,8IAA8I,gDAAgD,+GAA+G,eAAe,4DAA4D,2CAA2C,IAAI,wEAAwE,SAAS,WAAW,0CAA0C,kBAAkB,qLAAqL,uBAAuB,uGAAuG,aAAa,SAAS,4BAA4B,MAAM,GAAG,yCAAyC,KAAK,qCAAqC,KAAK,MAAM,qBAAqB,6BAA6B,4BAA4B,mBAAmB,gEAAgE,oIAAoI,MAAM,QAAQ,0DAA0D,qCAAqC,oBAAoB,mOAAmO,sBAAsB,MAAM,sBAAsB,wIAAwI,mCAAmC,mCAAmC,gBAAgB,IAAI,UAAU,0CAA0C,mCAAmC,eAAe,sBAAsB,iEAAiE,uBAAuB,IAAI,qEAAqE,oEAAoE,WAAW,gBAAgB,+RAA+R,0FAA0F,2BAA2B,OAAO,oCAAoC,YAAY,uBAAuB,oBAAoB,kBAAkB,gCAAgC,EAAE,qDAAqD,+BAA+B,WAAW,aAAa,sCAAsC,SAAS,uBAAuB,sBAAsB,iCAAiC,gBAAgB,EAAE,QAAQ,2dAA2d,WAAW,sDAAsD,kBAAkB,6DAA6D,uBAAuB,+CAA+C,cAAc,2KAA2K,uBAAuB,IAAI,qEAAqE,8EAA8E,kBAAkB,wGAAwG,oBAAoB,+IAA+I,YAAY,gEAAgE,eAAe,sBAAsB,qBAAqB,EAAE,kBAAkB,gCAAgC,EAAE,qDAAqD,gBAAgB,WAAW,aAAa,sCAAsC,SAAS,0BAA0B,cAAc,wBAAwB,eAAe,kSAAkS,uBAAuB,6DAA6D,WAAW,8JAA8J,kBAAkB,uHAAuH,oBAAoB,8KAA8K,gBAAgB,uJAAuJ,OAAO,gCAAgC,iCAAiC,SAAS,kBAAkB,mBAAmB,sBAAsB,iDAAiD,QAAQ,YAAY,YAAY,gHAAgH,YAAY,IAAI,6BAA6B,YAAY,IAAI,KAAK,gFAAgF,mBAAmB,IAAI,SAAS,GAAG,8CAA8C,2BAA2B,aAAa,sFAAsF,2DAA2D,gBAAgB,IAAI,MAAM,0BAA0B,wBAAwB,gBAAgB,4BAA4B,gBAAgB,eAAe,SAAS,wBAAwB,mGAAmG,gEAAgE,2EAA2E,wDAAwD,MAAM,yDAAyD,YAAY,gCAAgC,iCAAiC,qCAAqC,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,gCAAgC,gCAAgC,IAAI,iBAAiB,mDAAmD,yBAAyB,cAAc,EAAE,QAAQ,oCAAoC,aAAa,MAAM,+EAA+E,YAAY,YAAY,IAAI,KAAK,sBAAsB,mBAAmB,IAAI,SAAS,sBAAsB,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,kCAAkC,2BAA2B,gBAAgB,IAAI,iBAAiB,mDAAmD,yBAAyB,cAAc,mCAAmC,uBAAuB,kBAAkB,QAAQ,YAAY,IAAI,YAAY,SAAS,2BAA2B,OAAO,gCAAgC,4BAA4B,mBAAmB,WAAW,aAAa,sCAAsC,SAAS,uBAAuB,cAAc,wBAAwB,eAAe,mLAAmL,uBAAuB,0DAA0D,WAAW,+DAA+D,kBAAkB,6EAA6E,oBAAoB,iNAAiN,gBAAgB,oBAAoB,mBAAmB,yBAAyB,aAAa,0BAA0B,cAAc,mBAAmB,oBAAoB,iEAAiE,YAAY,IAAI,KAAK,SAAS,wCAAwC,qEAAqE,kCAAkC,uBAAuB,IAAI,qCAAqC,yBAAyB,gBAAgB,eAAe,SAAS,gEAAgE,2EAA2E,wDAAwD,MAAM,yDAAyD,SAAS,0BAA0B,qCAAqC,uBAAuB,IAAI,mDAAmD,IAAI,KAAK,sBAAsB,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,aAAa,4BAA4B,mDAAmD,yBAAyB,cAAc,KAAK,uBAAuB,kBAAkB,QAAQ,YAAY,IAAI,YAAY,SAAS,2BAA2B,OAAO,gCAAgC,4BAA4B,gBAAgB,WAAW,aAAa,sCAAsC,SAAS,gBAAgB,sBAAsB,8BAA8B,gBAAgB,EAAE,mFAAmF,sBAAsB,WAAW,sBAAsB,uBAAuB,eAAe,YAAY,IAAI,WAAW,sBAAsB,6CAA6C,iBAAiB,oBAAoB,0DAA0D,6BAA6B,8CAA8C,gBAAgB,wCAAwC,yBAAyB,IAAI,MAAM,kBAAkB,sJAAsJ,OAAO,yBAAyB,qCAAqC,yBAAyB,+BAA+B,mJAAmJ,6BAA6B,6BAA6B,WAAW,aAAa,sCAAsC,SAAS,oBAAoB,sBAAsB,8BAA8B,gBAAgB,EAAE,2EAA2E,uCAAuC,WAAW,aAAa,sCAAsC,SAAS,gBAAgB,sBAAsB,8BAA8B,gBAAgB,EAAE,uEAAuE,wCAAwC,WAAW,aAAa,sCAAsC,SAAS,mBAAmB,sBAAsB,4BAA4B,gBAAgB,EAAE,sJAAsJ,kHAAkH,+GAA+G,YAAY,WAAW,aAAa,sCAAsC,SAAS,kBAAkB,sBAAsB,4BAA4B,gBAAgB,EAAE,uCAAuC,0BAA0B,wCAAwC,kDAAkD,qDAAqD,+GAA+G,WAAW,WAAW,aAAa,sCAAsC,SAAS,gBAAgB,sBAAsB,4BAA4B,gBAAgB,EAAE,6LAA6L,6CAA6C,sEAAsE,qCAAqC,8GAA8G,sBAAsB,0JAA0J,SAAS,WAAW,aAAa,sCAAsC,SAAS,gBAAgB,sBAAsB,4BAA4B,gBAAgB,EAAE,QAAQ,2LAA2L,qFAAqF,4HAA4H,mBAAmB,YAAY,mCAAmC,qDAAqD,8GAA8G,sBAAsB,kFAAkF,+BAA+B,qBAAqB,kBAAkB,sEAAsE,SAAS,WAAW,aAAa,sCAAsC,SAAS,kBAAkB,sBAAsB,4BAA4B,gBAAgB,EAAE,UAAU,sUAAsU,2HAA2H,6EAA6E,sCAAsC,YAAY,0BAA0B,qDAAqD,8GAA8G,sBAAsB,kHAAkH,8BAA8B,UAAU,sCAAsC,wCAAwC,sCAAsC,qCAAqC,qDAAqD,aAAa,oBAAoB,yGAAyG,WAAW,aAAa,sCAAsC,SAAS,qBAAqB,sBAAsB,4BAA4B,gBAAgB,EAAE,iLAAiL,0BAA0B,sIAAsI,mCAAmC,iJAAiJ,8GAA8G,sBAAsB,iIAAiI,cAAc,WAAW,aAAa,sCAAsC,SAAS,sBAAsB,sBAAsB,4BAA4B,gBAAgB,EAAE,gBAAgB,0YAA0Y,0BAA0B,wCAAwC,sCAAsC,YAAY,0IAA0I,qCAAqC,8GAA8G,sBAAsB,4MAA4M,eAAe,WAAW,aAAa,sCAAsC,SAAS,qBAAqB,iEAAiE,uHAAuH,cAAc,WAAW,aAAa,sCAAsC,SAAS,kBAAkB,cAAc,2BAA2B,eAAe,UAAU,EAAE,wCAAwC,WAAW,iEAAiE,mBAAmB,kBAAkB,YAAY,IAAI,6JAA6J,2BAA2B,IAAI,wEAAwE,KAAK,oBAAoB,YAAY,IAAI,wEAAwE,UAAU,WAAW,WAAW,aAAa,sCAAsC,SAAS,kBAAkB,8BAA8B,2BAA2B,gBAAgB,EAAE,8BAA8B,uDAAuD,8IAA8I,WAAW,4BAA4B,yCAAyC,qCAAqC,QAAQ,yBAAyB,IAAI,iDAAiD,SAAS,2BAA2B,0DAA0D,yBAAyB,uBAAuB,YAAY,kBAAkB,IAAI,wGAAwG,gEAAgE,WAAW,WAAW,aAAa,sCAAsC,SAAS,iBAAiB,cAAc,2BAA2B,cAAc,QAAQ,aAAa,iBAAiB,eAAe,iBAAiB,0BAA0B,8BAA8B,0CAA0C,mBAAmB,iBAAiB,qCAAqC,UAAU,WAAW,aAAa,sCAAsC,SAAS,oBAAoB,cAAc,2BAA2B,gBAAgB,EAAE,oFAAoF,WAAW,2DAA2D,4BAA4B,iDAAiD,wCAAwC,6BAA6B,IAAI,UAAU,kBAAkB,SAAS,6BAA6B,IAAI,iCAAiC,+QAA+Q,OAAO,2CAA2C,qCAAqC,2CAA2C,+BAA+B,mJAAmJ,MAAM,gHAAgH,gEAAgE,4BAA4B,6BAA6B,6CAA6C,iBAAiB,uCAAuC,0DAA0D,0BAA0B,8CAA8C,iBAAiB,aAAa,WAAW,aAAa,sCAAsC,SAAS,qBAAqB,cAAc,2BAA2B,gBAAgB,EAAE,mEAAmE,WAAW,mBAAmB,QAAQ,6BAA6B,IAAI,uBAAuB,SAAS,yBAAyB,iDAAiD,YAAY,IAAI,kCAAkC,KAAK,4DAA4D,gDAAgD,uEAAuE,cAAc,WAAW,aAAa,sCAAsC,SAAS,kBAAkB,cAAc,2BAA2B,eAAe,iBAAiB,EAAE,sCAAsC,WAAW,gFAAgF,WAAW,OAAO,cAAc,WAAW,+BAA+B,YAAY,YAAY,oDAAoD,mBAAmB,+DAA+D,uBAAuB,EAAE,8DAA8D,4FAA4F,eAAe,wCAAwC,SAAS,EAAE,MAAM,IAAI,eAAe,eAAe,MAAM,YAAY,aAAa,kBAAkB,gCAAgC,iBAAiB,sCAAsC,uCAAuC,8BAA8B,sBAAsB,oBAAoB,IAAI,KAAK,wBAAwB,eAAe,4DAA4D,gBAAgB,0BAA0B,mCAAmC,kBAAkB,wBAAwB,uBAAuB,6BAA6B,8CAA8C,IAAI,8EAA8E,0BAA0B,SAAS,uBAAuB,SAAS,+BAA+B,GAAG,eAAe,aAAa,iBAAiB,SAAS,aAAa,gBAAgB,oBAAoB,cAAc,6DAA6D,gBAAgB,oFAAoF,wCAAwC,sCAAsC,yFAAyF,yBAAyB,yBAAyB,4BAA4B,0BAA0B,uCAAuC,oCAAoC,uFAAuF,sBAAsB,6JAA6J,uDAAuD,oFAAoF,KAAK,YAAY,IAAI,wBAAwB,0BAA0B,YAAY,WAAW,MAAM,oDAAoD,4BAA4B,SAAS,IAAI,SAAS,aAAa,0BAA0B,kBAAkB,4CAA4C,8BAA8B,kCAAkC,kTAAkT,4DAA4D,yDAAyD,sOAAsO,qCAAqC,4CAA4C,aAAa,SAAS,aAAa,aAAa,qCAAqC,8BAA8B,+BAA+B,6GAA6G,qCAAqC,2EAA2E,iCAAiC,2EAA2E,oCAAoC,UAAU,2JAA2J,+BAA+B,0FAA0F,+BAA+B,0FAA0F,gCAAgC,gCAAgC,iEAAiE,oEAAoE,YAAY,oBAAoB,kLAAkL,QAAQ,kBAAkB,kCAAkC,MAAM,0IAA0I,aAAa,SAAS,aAAa,OAAO,4CAA4C,4FAA4F,cAAc,oBAAoB,cAAc,oHAAoH,cAAc,KAAK,mJAAmJ,WAAW,MAAM,cAAc,iCAAiC,mJAAmJ,cAAc,gDAAgD,qDAAqD,8FAA8F,WAAW,0JAA0J,KAAK,6BAA6B,UAAU,6BAA6B,WAAW,aAAa,wBAAwB,UAAU,6BAA6B,oBAAoB,iFAAiF,0JAA0J,KAAK,6BAA6B,KAAK,kDAAkD,yEAAyE,cAAc,QAAQ,2CAA2C,aAAa,iIAAiI,UAAU,mEAAmE,GAAG,cAAc,wBAAwB,gFAAgF,aAAa,0GAA0G,SAAS,sEAAsE,UAAU,EAAE,QAAQ,IAAI,KAAK,kDAAkD,iGAAiG,OAAO,wBAAwB,+EAA+E,KAAK,UAAU,2EAA2E,sBAAsB,uBAAuB,SAAS,yBAAyB,MAAM,yKAAyK,8BAA8B,eAAe,aAAa,gDAAgD,cAAc,wCAAwC,WAAW,wDAAwD,mBAAmB,sCAAsC,mBAAmB,gBAAgB,0DAA0D,iBAAiB,wCAAwC,+BAA+B,KAAK,uDAAuD,kCAAkC,aAAa,gDAAgD,YAAY,aAAa,kEAAkE,MAAM,kFAAkF,MAAM,kEAAkE,MAAM,kFAAkF,MAAM,mEAAmE,6IAA6I,iCAAiC,MAAM,4FAA4F,MAAM,sDAAsD,MAAM,iDAAiD,WAAW,+CAA+C,gBAAgB,MAAM,wCAAwC,QAAQ,wBAAwB,uFAAuF,gCAAgC,OAAO,qCAAqC,kCAAkC,iCAAiC,aAAa,uBAAuB,YAAY,uBAAuB,sIAAsI,kGAAkG,qCAAqC,qDAAqD,iCAAiC,yDAAyD,oCAAoC,uDAAuD,+BAA+B,4CAA4C,+BAA+B,4CAA4C,gCAAgC,6CAA6C,mCAAmC,oDAAoD,+BAA+B,sBAAsB,wEAAwE,gCAAgC,aAAa,uFAAuF,uFAAuF,qCAAqC,oJAAoJ,gNAAgN,uIAAuI,2BAA2B,IAAI,QAAQ,mCAAmC,8BAA8B,sBAAsB,sDAAsD,iBAAiB,gCAAgC,gCAAgC,aAAa,mEAAmE,4CAA4C,4CAA4C,qCAAqC,yDAAyD,kBAAkB,aAAa,WAAW,6BAA6B,cAAc,oBAAoB,kBAAkB,4BAA4B,4BAA4B,uCAAuC,+BAA+B,0BAA0B,6BAA6B,qCAAqC,gBAAgB,WAAW,mBAAmB,WAAW,4BAA4B,uCAAuC,+BAA+B,4CAA4C,6BAA6B,qCAAqC,gBAAgB,WAAW,mBAAmB,WAAW,8BAA8B,uCAAuC,sBAAsB,qLAAqL,4CAA4C,OAAO,QAAQ,gCAAgC,8BAA8B,uCAAuC,+BAA+B,sVAAsV,QAAQ,aAAa,cAAc,aAAa,gBAAgB,4DAA4D,uFAAuF,sBAAsB,gBAAgB,uCAAuC,kEAAkE,YAAY,MAAM,oDAAoD,0FAA0F,iGAAiG,mGAAmG,qDAAqD,qDAAqD,SAAS,MAAM,eAAe,aAAa,gBAAgB,uEAAuE,6CAA6C,gBAAgB,0BAA0B,cAAc,OAAO,6GAA6G,cAAc,uXAAuX,EAAE,+IAA+I,cAAc,mBAAmB,4CAA4C,EAAE,oBAAoB,OAAO,mHAAmH,aAAa,OAAO,yBAAyB,cAAc,MAAM,wBAAwB,aAAa,OAAO,wDAAwD,cAAc,kBAAkB,cAAc,+DAA+D,cAAc,+JAA+J,MAAM,kBAAkB,OAAO,yBAAyB,iBAAiB,iBAAiB,oHAAoH,EAAE,8CAA8C,+CAA+C,mBAAmB,2BAA2B,SAAS,kBAAkB,wBAAwB,iBAAiB,eAAe,MAAM,iBAAiB,MAAM,kBAAkB,uBAAuB,0BAA0B,2CAA2C,kBAAkB,sBAAsB,oBAAoB,YAAY,SAAS,yBAAyB,2CAA2C,gBAAgB,OAAO,yBAAyB,MAAM,MAAM,MAAM,gBAAgB,OAAO,+BAA+B,gBAAgB,sCAAsC,cAAc,YAAY,cAAc,YAAY,cAAc,gBAAgB,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,qBAAqB,OAAO,qIAAqI,gBAAgB,8WAA8W,aAAa,gCAAgC,IAAI,8BAA8B,KAAK,cAAc,sCAAsC,cAAc,eAAe,iFAAiF,2CAA2C,0EAA0E,oCAAoC,sEAAsE,oCAAoC,0EAA0E,yDAAyD,yEAAyE,oBAAoB,yEAAyE,oBAAoB,qFAAqF,sBAAsB,oDAAoD,oBAAoB,gKAAgK,gBAAgB,kBAAkB,UAAU,IAAI,gBAAgB,+QAA+Q,8CAA8C,0GAA0G,gBAAgB,WAAW,oBAAoB,4FAA4F,iBAAiB,gBAAgB,OAAO,oCAAoC,kBAAkB,OAAO,8CAA8C,cAAc,aAAa,cAAc,UAAU,MAAM,KAAK,OAAO,oCAAoC,IAAI,2DAA2D,gBAAgB,2DAA2D,gBAAgB,SAAS,2BAA2B,WAAW,SAAS,sCAAsC,WAAW,cAAc,qCAAqC,GAAG,cAAc,oBAAoB,+DAA+D,aAAa,YAAY,kBAAkB,MAAM,kBAAkB,sCAAsC,MAAM,kBAAkB,SAAS,aAAa,cAAc,oBAAoB,yBAAyB,MAAM,iBAAiB,SAAS,iDAAiD,aAAa,wBAAwB,aAAa,MAAM,oBAAoB,4CAA4C,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,kJAAkJ,gBAAgB,MAAM,kBAAkB,kDAAkD,oCAAoC,YAAY,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,SAAS,uBAAuB,wCAAwC,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,gBAAgB,sCAAsC,MAAM,kBAAkB,kDAAkD,sBAAsB,kCAAkC,aAAa,aAAa,aAAa,SAAS,uBAAuB,wCAAwC,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,gBAAgB,sCAAsC,MAAM,kBAAkB,kDAAkD,kBAAkB,kCAAkC,aAAa,aAAa,aAAa,SAAS,uBAAuB,wCAAwC,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,gBAAgB,kBAAkB,UAAU,0EAA0E,8BAA8B,MAAM,kBAAkB,kDAAkD,sBAAsB,+CAA+C,aAAa,aAAa,aAAa,SAAS,uBAAuB,kCAAkC,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,gBAAgB,gBAAgB,MAAM,kBAAkB,kDAAkD,qBAAqB,YAAY,aAAa,aAAa,aAAa,SAAS,uBAAuB,kCAAkC,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,gBAAgB,gBAAgB,MAAM,kBAAkB,kDAAkD,qBAAqB,YAAY,aAAa,aAAa,aAAa,SAAS,MAAM,aAAa,YAAY,mDAAmD,UAAU,yBAAyB,kBAAkB,+RAA+R,qIAAqI,sHAAsH,MAAM,wCAAwC,mEAAmE,aAAa,QAAQ,gDAAgD,aAAa,cAAc,8BAA8B,MAAM,kBAAkB,SAAS,UAAU,sCAAsC,MAAM,kBAAkB,YAAY,aAAa,6BAA6B,gBAAgB,MAAM,kBAAkB,UAAU,aAAa,SAAS,aAAa,QAAQ,8DAA8D,aAAa,cAAc,sKAAsK,aAAa,QAAQ,qEAAqE,cAAc,QAAQ,0BAA0B,MAAM,kBAAkB,SAAS,SAAS,cAAc,QAAQ,qEAAqE,cAAc,QAAQ,qEAAqE,WAAW,kBAAkB,qCAAqC,4BAA4B,WAAW,iCAAiC,0CAA0C,oEAAoE,cAAc,YAAY,eAAe,aAAa,mBAAmB,0CAA0C,yCAAyC,OAAO,oBAAoB,wBAAwB,mBAAmB,+BAA+B,iDAAiD,GAAG,oCAAoC,gBAAgB,sBAAsB,gBAAgB,qBAAqB,mBAAmB,qBAAqB,iBAAiB,6BAA6B,cAAc,kDAAkD,cAAc,2KAA2K,kBAAkB,gDAAgD,iBAAiB,GAAG,cAAc,qNAAqN,kBAAkB,gDAAgD,iBAAiB,GAAG,cAAc,oBAAoB,8BAA8B,mBAAmB,wBAAwB,YAAY,WAAW,mCAAmC,WAAW,iBAAiB,mBAAmB,+BAA+B,+DAA+D,wBAAwB,qCAAqC,gBAAgB,MAAM,cAAc,WAAW,+BAA+B,YAAY,YAAY,oDAAoD,mBAAmB,+DAA+D,uBAAuB,EAAE,8DAA8D,4FAA4F,eAAe,wCAAwC,SAAS,EAAE,QAAQ,IAAI,G;;;;;SCDz49N;SACA;;SAEA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;;SAEA;SACA;;SAEA;SACA;SACA;;;;;UCtBA;UACA;UACA;UACA;UACA;UACA,gCAAgC,YAAY;UAC5C;UACA,E;;;;;UCPA;UACA;UACA;UACA;UACA,wCAAwC,yCAAyC;UACjF;UACA;UACA,E;;;;;UCPA;UACA;UACA;UACA;UACA,EAAE;UACF;UACA;UACA,CAAC,I;;;;;UCPD,wF;;;;;UCAA;UACA;UACA;UACA,sDAAsD,kBAAkB;UACxE;UACA,+CAA+C,cAAc;UAC7D,E;;;;;;;;;;;;;;ACNuC;AAClB;AACrB,iEAAe,qCAAS,EAAC;AACzB,iC","file":"urpflanze.js","sourcesContent":["export * from './modules-light';\nexport * from './modules-light';\nexport * as Color from '@urpflanze/color/dist/cjs';\nexport { Renderer, Timeline } from '@urpflanze/drawer-canvas/dist/cjs';\nexport { GCODEExporter } from '@urpflanze/gcode-exporter/dist/cjs';\nexport { SVGExporter } from '@urpflanze/svg-exporter/dist/cjs';\nexport { SVGImporter } from '@urpflanze/svg-importer';\n//# sourceMappingURL=modules.js.map","export * from '@urpflanze/core/dist/cjs';\nexport * as Animation from '@urpflanze/animation/dist/cjs';\nexport { BrowserDrawerCanvas as DrawerCanvas } from '@urpflanze/drawer-canvas/dist/cjs/browser/BrowserDrawerCanvas';\n//# sourceMappingURL=modules-light.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mod = exports.log = exports.PI2 = exports.PHI = exports.Vec2 = exports.distributePointsInBuffer = exports.prepareBufferForInterpolation = exports.interpolate = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.now = exports.toRadians = exports.toDegrees = exports.relativeClamp = exports.clamp = exports.lerp = void 0;\n/**\n * Types & Interface\n */\n__exportStar(require(\"./types\"), exports);\n// Set glMatrixArrayType\nconst gl_matrix_1 = require(\"gl-matrix\");\ngl_matrix_1.glMatrix.setMatrixArrayType(Array);\n/**\n * Core\n */\n__exportStar(require(\"./Scene\"), exports);\n__exportStar(require(\"./SceneChild\"), exports);\n__exportStar(require(\"./Group\"), exports);\n// Shapes\n__exportStar(require(\"./shapes/ShapeBase\"), exports);\n__exportStar(require(\"./shapes/ShapePrimitive\"), exports);\n__exportStar(require(\"./shapes/ShapeLoop\"), exports);\n__exportStar(require(\"./shapes/ShapeBuffer\"), exports);\n__exportStar(require(\"./shapes/Shape\"), exports);\n__exportStar(require(\"./shapes/ShapeRecursive\"), exports);\n__exportStar(require(\"./shapes/ShapeFollow\"), exports);\n__exportStar(require(\"./shapes/primitives/Line\"), exports);\n__exportStar(require(\"./shapes/primitives/Triangle\"), exports);\n__exportStar(require(\"./shapes/primitives/Rect\"), exports);\n__exportStar(require(\"./shapes/primitives/Polygon\"), exports);\n__exportStar(require(\"./shapes/primitives/Circle\"), exports);\n__exportStar(require(\"./shapes/primitives/Star\"), exports);\n__exportStar(require(\"./shapes/primitives/Rose\"), exports);\n__exportStar(require(\"./shapes/primitives/Spiral\"), exports);\n__exportStar(require(\"./shapes/primitives/Lissajous\"), exports);\n__exportStar(require(\"./shapes/primitives/SuperShape\"), exports);\n// Modifiers\n__exportStar(require(\"./modifiers/Modifier\"), exports);\n__exportStar(require(\"./modifiers\"), exports);\n// Utilities\nvar Utilities_1 = require(\"./Utilities\");\nObject.defineProperty(exports, \"lerp\", { enumerable: true, get: function () { return Utilities_1.lerp; } });\nObject.defineProperty(exports, \"clamp\", { enumerable: true, get: function () { return Utilities_1.clamp; } });\nObject.defineProperty(exports, \"relativeClamp\", { enumerable: true, get: function () { return Utilities_1.relativeClamp; } });\nObject.defineProperty(exports, \"toDegrees\", { enumerable: true, get: function () { return Utilities_1.toDegrees; } });\nObject.defineProperty(exports, \"toRadians\", { enumerable: true, get: function () { return Utilities_1.toRadians; } });\nObject.defineProperty(exports, \"now\", { enumerable: true, get: function () { return Utilities_1.now; } });\nObject.defineProperty(exports, \"noise\", { enumerable: true, get: function () { return Utilities_1.noise; } });\nObject.defineProperty(exports, \"random\", { enumerable: true, get: function () { return Utilities_1.random; } });\nObject.defineProperty(exports, \"angleFromRepetition\", { enumerable: true, get: function () { return Utilities_1.angleFromRepetition; } });\nObject.defineProperty(exports, \"angle2FromRepetition\", { enumerable: true, get: function () { return Utilities_1.angle2FromRepetition; } });\nObject.defineProperty(exports, \"distanceFromRepetition\", { enumerable: true, get: function () { return Utilities_1.distanceFromRepetition; } });\nObject.defineProperty(exports, \"interpolate\", { enumerable: true, get: function () { return Utilities_1.interpolate; } });\nObject.defineProperty(exports, \"prepareBufferForInterpolation\", { enumerable: true, get: function () { return Utilities_1.prepareBufferForInterpolation; } });\nObject.defineProperty(exports, \"distributePointsInBuffer\", { enumerable: true, get: function () { return Utilities_1.distributePointsInBuffer; } });\nvar Vec2_1 = require(\"./math/Vec2\");\nObject.defineProperty(exports, \"Vec2\", { enumerable: true, get: function () { return Vec2_1.default; } });\nvar math_1 = require(\"./math\");\nObject.defineProperty(exports, \"PHI\", { enumerable: true, get: function () { return math_1.PHI; } });\nObject.defineProperty(exports, \"PI2\", { enumerable: true, get: function () { return math_1.PI2; } });\nObject.defineProperty(exports, \"log\", { enumerable: true, get: function () { return math_1.log; } });\nObject.defineProperty(exports, \"mod\", { enumerable: true, get: function () { return math_1.mod; } });\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./indexedBuffer\"), exports);\n__exportStar(require(\"./propArguments\"), exports);\n__exportStar(require(\"./repetitions\"), exports);\n__exportStar(require(\"./scene-child\"), exports);\n__exportStar(require(\"./scene\"), exports);\n__exportStar(require(\"./shape-base\"), exports);\n__exportStar(require(\"./shape-primitives\"), exports);\n__exportStar(require(\"./shapes\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=indexedBuffer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=propArguments.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ERepetitionType = void 0;\n/**\n * Repetition type enumerator.\n *\n * @category Core.Repetition\n * @internal\n */\nvar ERepetitionType;\n(function (ERepetitionType) {\n /**\n * Defines the type of repetition of the shape,\n * in a circular way starting from the center of the scene\n * @order 1\n */\n ERepetitionType[ERepetitionType[\"Ring\"] = 1] = \"Ring\";\n /**\n * Defines the type of repetition of the shape,\n * on a nxm grid starting from the center of the scene\n * @order 2\n */\n ERepetitionType[ERepetitionType[\"Matrix\"] = 2] = \"Matrix\";\n})(ERepetitionType = exports.ERepetitionType || (exports.ERepetitionType = {}));\n//# sourceMappingURL=repetitions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=scene-child.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=scene.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EBoundingType = void 0;\nvar EBoundingType;\n(function (EBoundingType) {\n /**\n * Relative to the real bounding of the shape\n * @order 2\n */\n EBoundingType[EBoundingType[\"Relative\"] = 1] = \"Relative\";\n /**\n * Fixed to te width and height of the shape\n * @order 3\n */\n EBoundingType[EBoundingType[\"Fixed\"] = 2] = \"Fixed\";\n})(EBoundingType = exports.EBoundingType || (exports.EBoundingType = {}));\n//# sourceMappingURL=shape-base.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//////\n//# sourceMappingURL=shape-primitives.js.map","\"use strict\";\n// Shape\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=shapes.js.map","import * as glMatrix from \"./common.js\";\nimport * as mat2 from \"./mat2.js\";\nimport * as mat2d from \"./mat2d.js\";\nimport * as mat3 from \"./mat3.js\";\nimport * as mat4 from \"./mat4.js\";\nimport * as quat from \"./quat.js\";\nimport * as quat2 from \"./quat2.js\";\nimport * as vec2 from \"./vec2.js\";\nimport * as vec3 from \"./vec3.js\";\nimport * as vec4 from \"./vec4.js\";\nexport { glMatrix, mat2, mat2d, mat3, mat4, quat, quat2, vec2, vec3, vec4 };","/**\r\n * Common utilities\r\n * @module glMatrix\r\n */\n// Configuration Constants\nexport var EPSILON = 0.000001;\nexport var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexport var RANDOM = Math.random;\n/**\r\n * Sets the type of array used when creating new vectors and matrices\r\n *\r\n * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array\r\n */\n\nexport function setMatrixArrayType(type) {\n ARRAY_TYPE = type;\n}\nvar degree = Math.PI / 180;\n/**\r\n * Convert Degree To Radian\r\n *\r\n * @param {Number} a Angle in Degrees\r\n */\n\nexport function toRadian(a) {\n return a * degree;\n}\n/**\r\n * Tests whether or not the arguments have approximately the same value, within an absolute\r\n * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less\r\n * than or equal to 1.0, and a relative tolerance is used for larger values)\r\n *\r\n * @param {Number} a The first number to test.\r\n * @param {Number} b The second number to test.\r\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n}\nif (!Math.hypot) Math.hypot = function () {\n var y = 0,\n i = arguments.length;\n\n while (i--) {\n y += arguments[i] * arguments[i];\n }\n\n return Math.sqrt(y);\n};","import * as glMatrix from \"./common.js\";\n/**\r\n * 2x2 Matrix\r\n * @module mat2\r\n */\n\n/**\r\n * Creates a new identity mat2\r\n *\r\n * @returns {mat2} a new 2x2 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\r\n * Creates a new mat2 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat2} a matrix to clone\r\n * @returns {mat2} a new 2x2 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Copy the values from one mat2 to another\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set a mat2 to the identity matrix\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @returns {mat2} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\r\n * Create a new mat2 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\r\n * @returns {mat2} out A new 2x2 matrix\r\n */\n\nexport function fromValues(m00, m01, m10, m11) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\r\n * Set the components of a mat2 to the given values\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\r\n * @returns {mat2} out\r\n */\n\nexport function set(out, m00, m01, m10, m11) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\r\n * Transpose the values of a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache\n // some values\n if (out === a) {\n var a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3]; // Calculate the determinant\n\n var det = a0 * a3 - a2 * a1;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function adjoint(out, a) {\n // Caching this value is nessecary if out == a\n var a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat2\r\n *\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n}\n/**\r\n * Multiplies two mat2's\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n}\n/**\r\n * Rotates a mat2 by the given angle\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n}\n/**\r\n * Scales the mat2 by the dimensions in the given vec2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to rotate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat2} out\r\n **/\n\nexport function scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n *\r\n * @param {mat2} out mat2 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n *\r\n * @param {mat2} out mat2 receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat2} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n}\n/**\r\n * Returns a string representation of a mat2\r\n *\r\n * @param {ReadonlyMat2} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat2\r\n *\r\n * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3]);\n}\n/**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @param {ReadonlyMat2} L the lower triangular matrix\r\n * @param {ReadonlyMat2} D the diagonal matrix\r\n * @param {ReadonlyMat2} U the upper triangular matrix\r\n * @param {ReadonlyMat2} a the input matrix to factorize\r\n */\n\nexport function LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n}\n/**\r\n * Adds two mat2's\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat2} a The first matrix.\r\n * @param {ReadonlyMat2} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat2} a The first matrix.\r\n * @param {ReadonlyMat2} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat2} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\r\n * Adds two mat2's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat2} out the receiving vector\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat2} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\r\n * Alias for {@link mat2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat2.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 2x3 Matrix\r\n * @module mat2d\r\n * @description\r\n * A mat2d contains six elements defined as:\r\n *
\r\n * [a, b,\r\n *  c, d,\r\n *  tx, ty]\r\n * 
\r\n * This is a short form for the 3x3 matrix:\r\n *
\r\n * [a, b, 0,\r\n *  c, d, 0,\r\n *  tx, ty, 1]\r\n * 
\r\n * The last column is ignored so the array is shorter and operations are faster.\r\n */\n\n/**\r\n * Creates a new identity mat2d\r\n *\r\n * @returns {mat2d} a new 2x3 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(6);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[4] = 0;\n out[5] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\r\n * Creates a new mat2d initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat2d} a matrix to clone\r\n * @returns {mat2d} a new 2x3 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\r\n * Copy the values from one mat2d to another\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\r\n * Set a mat2d to the identity matrix\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Create a new mat2d with the given values\r\n *\r\n * @param {Number} a Component A (index 0)\r\n * @param {Number} b Component B (index 1)\r\n * @param {Number} c Component C (index 2)\r\n * @param {Number} d Component D (index 3)\r\n * @param {Number} tx Component TX (index 4)\r\n * @param {Number} ty Component TY (index 5)\r\n * @returns {mat2d} A new mat2d\r\n */\n\nexport function fromValues(a, b, c, d, tx, ty) {\n var out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\r\n * Set the components of a mat2d to the given values\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {Number} a Component A (index 0)\r\n * @param {Number} b Component B (index 1)\r\n * @param {Number} c Component C (index 2)\r\n * @param {Number} d Component D (index 3)\r\n * @param {Number} tx Component TX (index 4)\r\n * @param {Number} ty Component TY (index 5)\r\n * @returns {mat2d} out\r\n */\n\nexport function set(out, a, b, c, d, tx, ty) {\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\r\n * Inverts a mat2d\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function invert(out, a) {\n var aa = a[0],\n ab = a[1],\n ac = a[2],\n ad = a[3];\n var atx = a[4],\n aty = a[5];\n var det = aa * ad - ab * ac;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n}\n/**\r\n * Multiplies two mat2d's\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n}\n/**\r\n * Rotates a mat2d by the given angle\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2d} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\r\n * Scales the mat2d by the dimensions in the given vec2\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to translate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat2d} out\r\n **/\n\nexport function scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\r\n * Translates the mat2d by the dimensions in the given vec2\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to translate\r\n * @param {ReadonlyVec2} v the vec2 to translate the matrix by\r\n * @returns {mat2d} out\r\n **/\n\nexport function translate(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.rotate(dest, dest, rad);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2d} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.scale(dest, dest, vec);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat2d} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.translate(dest, dest, vec);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {ReadonlyVec2} v Translation vector\r\n * @returns {mat2d} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n}\n/**\r\n * Returns a string representation of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat2d(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1);\n}\n/**\r\n * Adds two mat2d's\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat2d} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n}\n/**\r\n * Adds two mat2d's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat2d} out the receiving vector\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat2d} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat2d} a The first matrix.\r\n * @param {ReadonlyMat2d} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat2d} a The first matrix.\r\n * @param {ReadonlyMat2d} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5));\n}\n/**\r\n * Alias for {@link mat2d.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat2d.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 3x3 Matrix\r\n * @module mat3\r\n */\n\n/**\r\n * Creates a new identity mat3\r\n *\r\n * @returns {mat3} a new 3x3 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(9);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n }\n\n out[0] = 1;\n out[4] = 1;\n out[8] = 1;\n return out;\n}\n/**\r\n * Copies the upper-left 3x3 values into the given mat3.\r\n *\r\n * @param {mat3} out the receiving 3x3 matrix\r\n * @param {ReadonlyMat4} a the source 4x4 matrix\r\n * @returns {mat3} out\r\n */\n\nexport function fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n}\n/**\r\n * Creates a new mat3 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat3} a matrix to clone\r\n * @returns {mat3} a new 3x3 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Copy the values from one mat3 to another\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Create a new mat3 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\r\n * @returns {mat3} A new mat3\r\n */\n\nexport function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\r\n * Set the components of a mat3 to the given values\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\r\n * @returns {mat3} out\r\n */\n\nexport function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\r\n * Set a mat3 to the identity matrix\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @returns {mat3} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Transpose the values of a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b01 = a22 * a11 - a12 * a21;\n var b11 = -a22 * a10 + a12 * a20;\n var b21 = a21 * a10 - a11 * a20; // Calculate the determinant\n\n var det = a00 * b01 + a01 * b11 + a02 * b21;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat3\r\n *\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n}\n/**\r\n * Multiplies two mat3's\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b00 = b[0],\n b01 = b[1],\n b02 = b[2];\n var b10 = b[3],\n b11 = b[4],\n b12 = b[5];\n var b20 = b[6],\n b21 = b[7],\n b22 = b[8];\n out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n return out;\n}\n/**\r\n * Translate a mat3 by the given vector\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to translate\r\n * @param {ReadonlyVec2} v vector to translate by\r\n * @returns {mat3} out\r\n */\n\nexport function translate(out, a, v) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n x = v[0],\n y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n}\n/**\r\n * Rotates a mat3 by the given angle\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat3} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n}\n/**\r\n * Scales the mat3 by the dimensions in the given vec2\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to rotate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat3} out\r\n **/\n\nexport function scale(out, a, v) {\n var x = v[0],\n y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyVec2} v Translation vector\r\n * @returns {mat3} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat3} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat3} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Copies the values from a mat2d into a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to copy\r\n * @returns {mat3} out\r\n **/\n\nexport function fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n}\n/**\r\n * Calculates a 3x3 matrix from the given quaternion\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyQuat} q Quaternion to create matrix from\r\n *\r\n * @returns {mat3} out\r\n */\n\nexport function fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n}\n/**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n *\r\n * @returns {mat3} out\r\n */\n\nexport function normalFromMat4(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n}\n/**\r\n * Generates a 2D projection matrix with the given bounds\r\n *\r\n * @param {mat3} out mat3 frustum matrix will be written into\r\n * @param {number} width Width of your gl context\r\n * @param {number} height Height of gl context\r\n * @returns {mat3} out\r\n */\n\nexport function projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n}\n/**\r\n * Returns a string representation of a mat3\r\n *\r\n * @param {ReadonlyMat3} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat3\r\n *\r\n * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);\n}\n/**\r\n * Adds two mat3's\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat3} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n}\n/**\r\n * Adds two mat3's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat3} out the receiving vector\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat3} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat3} a The first matrix.\r\n * @param {ReadonlyMat3} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat3} a The first matrix.\r\n * @param {ReadonlyMat3} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7],\n a8 = a[8];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7],\n b8 = b[8];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8));\n}\n/**\r\n * Alias for {@link mat3.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat3.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied.\r\n * @module mat4\r\n */\n\n/**\r\n * Creates a new identity mat4\r\n *\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(16);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n }\n\n out[0] = 1;\n out[5] = 1;\n out[10] = 1;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a new mat4 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat4} a matrix to clone\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Copy the values from one mat4 to another\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Create a new mat4 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} A new mat4\r\n */\n\nexport function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\r\n * Set the components of a mat4 to the given values\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} out\r\n */\n\nexport function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\r\n * Set a mat4 to the identity matrix\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @returns {mat4} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Transpose the values of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a12 = a[6],\n a13 = a[7];\n var a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22);\n out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\n out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12);\n out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\n out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\n out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22);\n out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\n out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12);\n out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21);\n out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\n out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11);\n out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\n out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\n out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21);\n out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\n out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11);\n return out;\n}\n/**\r\n * Calculates the determinant of a mat4\r\n *\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n}\n/**\r\n * Multiplies two mat4s\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15]; // Cache only the current line of the second matrix\n\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n/**\r\n * Translate a mat4 by the given vector\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to translate\r\n * @param {ReadonlyVec3} v vector to translate by\r\n * @returns {mat4} out\r\n */\n\nexport function translate(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n\n return out;\n}\n/**\r\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to scale\r\n * @param {ReadonlyVec3} v the vec3 to scale the matrix by\r\n * @returns {mat4} out\r\n **/\n\nexport function scale(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Rotates a mat4 by the given angle around the given axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nexport function rotate(out, a, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n var b00, b01, b02;\n var b10, b11, b12;\n var b20, b21, b22;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11]; // Construct the elements of the rotation matrix\n\n b00 = x * x * t + c;\n b01 = y * x * t + z * s;\n b02 = z * x * t - y * s;\n b10 = x * y * t - z * s;\n b11 = y * y * t + c;\n b12 = z * y * t + x * s;\n b20 = x * z * t + y * s;\n b21 = y * z * t - x * s;\n b22 = z * z * t + c; // Perform rotation-specific matrix multiplication\n\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the X axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateX(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Y axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateY(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Z axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyVec3} v Scaling vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotation(out, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c; // Perform rotation-specific matrix multiplication\n\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromXRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromYRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromZRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslation(out, q, v) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a new mat4 from a dual quat.\r\n *\r\n * @param {mat4} out Matrix\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @returns {mat4} mat4 receiving operation result\r\n */\n\nexport function fromQuat2(out, a) {\n var translation = new glMatrix.ARRAY_TYPE(3);\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense\n\n if (magnitude > 0) {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n\n fromRotationTranslation(out, a, translation);\n return out;\n}\n/**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nexport function getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n}\n/**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion paramter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nexport function getScaling(out, mat) {\n var m11 = mat[0];\n var m12 = mat[1];\n var m13 = mat[2];\n var m21 = mat[4];\n var m22 = mat[5];\n var m23 = mat[6];\n var m31 = mat[8];\n var m32 = mat[9];\n var m33 = mat[10];\n out[0] = Math.hypot(m11, m12, m13);\n out[1] = Math.hypot(m21, m22, m23);\n out[2] = Math.hypot(m31, m32, m33);\n return out;\n}\n/**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @param {quat} out Quaternion to receive the rotation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {quat} out\r\n */\n\nexport function getRotation(out, mat) {\n var scaling = new glMatrix.ARRAY_TYPE(3);\n getScaling(scaling, mat);\n var is1 = 1 / scaling[0];\n var is2 = 1 / scaling[1];\n var is3 = 1 / scaling[2];\n var sm11 = mat[0] * is1;\n var sm12 = mat[1] * is2;\n var sm13 = mat[2] * is3;\n var sm21 = mat[4] * is1;\n var sm22 = mat[5] * is2;\n var sm23 = mat[6] * is3;\n var sm31 = mat[8] * is1;\n var sm32 = mat[9] * is2;\n var sm33 = mat[10] * is3;\n var trace = sm11 + sm22 + sm33;\n var S = 0;\n\n if (trace > 0) {\n S = Math.sqrt(trace + 1.0) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @param {ReadonlyVec3} s Scaling vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslationScale(out, q, v, s) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @param {ReadonlyVec3} s Scaling vector\r\n * @param {ReadonlyVec3} o The origin vector around which to scale and rotate\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n var ox = o[0];\n var oy = o[1];\n var oz = o[2];\n var out0 = (1 - (yy + zz)) * sx;\n var out1 = (xy + wz) * sx;\n var out2 = (xz - wy) * sx;\n var out4 = (xy - wz) * sy;\n var out5 = (1 - (xx + zz)) * sy;\n var out6 = (yz + wx) * sy;\n var out8 = (xz + wy) * sz;\n var out9 = (yz - wx) * sz;\n var out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n}\n/**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyQuat} q Quaternion to create matrix from\r\n *\r\n * @returns {mat4} out\r\n */\n\nexport function fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a frustum matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Number} left Left bound of the frustum\r\n * @param {Number} right Right bound of the frustum\r\n * @param {Number} bottom Bottom bound of the frustum\r\n * @param {Number} top Top bound of the frustum\r\n * @param {Number} near Near bound of the frustum\r\n * @param {Number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function frustum(out, left, right, bottom, top, near, far) {\n var rl = 1 / (right - left);\n var tb = 1 / (top - bottom);\n var nf = 1 / (near - far);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near * 2 * nf;\n out[15] = 0;\n return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} fovy Vertical field of view in radians\r\n * @param {number} aspect Aspect ratio. typically viewport width/height\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum, can be null or Infinity\r\n * @returns {mat4} out\r\n */\n\nexport function perspective(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n\n return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function perspectiveFromFieldOfView(out, fov, near, far) {\n var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);\n var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);\n var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);\n var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);\n var xScale = 2.0 / (leftTan + rightTan);\n var yScale = 2.0 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n out[4] = 0.0;\n out[5] = yScale;\n out[6] = 0.0;\n out[7] = 0.0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1.0;\n out[12] = 0.0;\n out[13] = 0.0;\n out[14] = far * near / (near - far);\n out[15] = 0.0;\n return out;\n}\n/**\r\n * Generates a orthogonal projection matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} left Left bound of the frustum\r\n * @param {number} right Right bound of the frustum\r\n * @param {number} bottom Bottom bound of the frustum\r\n * @param {number} top Top bound of the frustum\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function ortho(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {ReadonlyVec3} eye Position of the viewer\r\n * @param {ReadonlyVec3} center Point the viewer is looking at\r\n * @param {ReadonlyVec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nexport function lookAt(out, eye, center, up) {\n var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;\n var eyex = eye[0];\n var eyey = eye[1];\n var eyez = eye[2];\n var upx = up[0];\n var upy = up[1];\n var upz = up[2];\n var centerx = center[0];\n var centery = center[1];\n var centerz = center[2];\n\n if (Math.abs(eyex - centerx) < glMatrix.EPSILON && Math.abs(eyey - centery) < glMatrix.EPSILON && Math.abs(eyez - centerz) < glMatrix.EPSILON) {\n return identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n len = 1 / Math.hypot(z0, z1, z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.hypot(x0, x1, x2);\n\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n len = Math.hypot(y0, y1, y2);\n\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a matrix that makes something look at something else.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {ReadonlyVec3} eye Position of the viewer\r\n * @param {ReadonlyVec3} center Point the viewer is looking at\r\n * @param {ReadonlyVec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nexport function targetTo(out, eye, target, up) {\n var eyex = eye[0],\n eyey = eye[1],\n eyez = eye[2],\n upx = up[0],\n upy = up[1],\n upz = up[2];\n var z0 = eyex - target[0],\n z1 = eyey - target[1],\n z2 = eyez - target[2];\n var len = z0 * z0 + z1 * z1 + z2 * z2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n\n var x0 = upy * z2 - upz * z1,\n x1 = upz * z0 - upx * z2,\n x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n}\n/**\r\n * Returns a string representation of a mat4\r\n *\r\n * @param {ReadonlyMat4} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \", \" + a[9] + \", \" + a[10] + \", \" + a[11] + \", \" + a[12] + \", \" + a[13] + \", \" + a[14] + \", \" + a[15] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat4\r\n *\r\n * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);\n}\n/**\r\n * Adds two mat4's\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat4} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n}\n/**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat4} out the receiving vector\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat4} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat4} a The first matrix.\r\n * @param {ReadonlyMat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat4} a The first matrix.\r\n * @param {ReadonlyMat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var a8 = a[8],\n a9 = a[9],\n a10 = a[10],\n a11 = a[11];\n var a12 = a[12],\n a13 = a[13],\n a14 = a[14],\n a15 = a[15];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n var b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n var b8 = b[8],\n b9 = b[9],\n b10 = b[10],\n b11 = b[11];\n var b12 = b[12],\n b13 = b[13],\n b14 = b[14],\n b15 = b[15];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15));\n}\n/**\r\n * Alias for {@link mat4.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat4.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\nimport * as mat3 from \"./mat3.js\";\nimport * as vec3 from \"./vec3.js\";\nimport * as vec4 from \"./vec4.js\";\n/**\r\n * Quaternion\r\n * @module quat\r\n */\n\n/**\r\n * Creates a new identity quat\r\n *\r\n * @returns {quat} a new quaternion\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n out[3] = 1;\n return out;\n}\n/**\r\n * Set a quat to the identity quaternion\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @returns {quat} out\r\n */\n\nexport function identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyVec3} axis the axis around which to rotate\r\n * @param {Number} rad the angle in radians\r\n * @returns {quat} out\r\n **/\n\nexport function setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n var s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n}\n/**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @param {vec3} out_axis Vector receiving the axis of rotation\r\n * @param {ReadonlyQuat} q Quaternion to be decomposed\r\n * @return {Number} Angle, in radians, of the rotation\r\n */\n\nexport function getAxisAngle(out_axis, q) {\n var rad = Math.acos(q[3]) * 2.0;\n var s = Math.sin(rad / 2.0);\n\n if (s > glMatrix.EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n // If s is zero, return any axis (no rotation - axis does not matter)\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n\n return rad;\n}\n/**\r\n * Gets the angular distance between two unit quaternions\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\n\nexport function getAngle(a, b) {\n var dotproduct = dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n}\n/**\r\n * Multiplies two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {quat} out\r\n */\n\nexport function multiply(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the X axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateX(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateY(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var by = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bz = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n}\n/**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate W component of\r\n * @returns {quat} out\r\n */\n\nexport function calculateW(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\n return out;\n}\n/**\r\n * Calculate the exponential of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @returns {quat} out\r\n */\n\nexport function exp(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var et = Math.exp(w);\n var s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n}\n/**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @returns {quat} out\r\n */\n\nexport function ln(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n}\n/**\r\n * Calculate the scalar power of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @param {Number} b amount to scale the quaternion by\r\n * @returns {quat} out\r\n */\n\nexport function pow(out, a, b) {\n ln(out, a);\n scale(out, out, b);\n exp(out, out);\n return out;\n}\n/**\r\n * Performs a spherical linear interpolation between two quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n */\n\nexport function slerp(out, a, b, t) {\n // benchmarks:\n // http://jsperf.com/quaternion-slerp-implementations\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n var omega, cosom, sinom, scale0, scale1; // calc cosine\n\n cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary)\n\n if (cosom < 0.0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n } // calculate coefficients\n\n\n if (1.0 - cosom > glMatrix.EPSILON) {\n // standard case (slerp)\n omega = Math.acos(cosom);\n sinom = Math.sin(omega);\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n // \"from\" and \"to\" quaternions are very close\n // ... so we can do a linear interpolation\n scale0 = 1.0 - t;\n scale1 = t;\n } // calculate final values\n\n\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n}\n/**\r\n * Generates a random unit quaternion\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @returns {quat} out\r\n */\n\nexport function random(out) {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n var u1 = glMatrix.RANDOM();\n var u2 = glMatrix.RANDOM();\n var u3 = glMatrix.RANDOM();\n var sqrt1MinusU1 = Math.sqrt(1 - u1);\n var sqrtU1 = Math.sqrt(u1);\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n}\n/**\r\n * Calculates the inverse of a quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate inverse of\r\n * @returns {quat} out\r\n */\n\nexport function invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\n\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n}\n/**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate conjugate of\r\n * @returns {quat} out\r\n */\n\nexport function conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyMat3} m rotation matrix\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport function fromMat3(out, m) {\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n var fTrace = m[0] + m[4] + m[8];\n var fRoot;\n\n if (fTrace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\n\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot; // 1/(4w)\n\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n // |w| <= 1/2\n var i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n var j = (i + 1) % 3;\n var k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n\n return out;\n}\n/**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {x} Angle to rotate around X axis in degrees.\r\n * @param {y} Angle to rotate around Y axis in degrees.\r\n * @param {z} Angle to rotate around Z axis in degrees.\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport function fromEuler(out, x, y, z) {\n var halfToRad = 0.5 * Math.PI / 180.0;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n var sx = Math.sin(x);\n var cx = Math.cos(x);\n var sy = Math.sin(y);\n var cy = Math.cos(y);\n var sz = Math.sin(z);\n var cz = Math.cos(z);\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n return out;\n}\n/**\r\n * Returns a string representation of a quatenion\r\n *\r\n * @param {ReadonlyQuat} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"quat(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n *\r\n * @param {ReadonlyQuat} a quaternion to clone\r\n * @returns {quat} a new quaternion\r\n * @function\r\n */\n\nexport var clone = vec4.clone;\n/**\r\n * Creates a new quat initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {quat} a new quaternion\r\n * @function\r\n */\n\nexport var fromValues = vec4.fromValues;\n/**\r\n * Copy the values from one quat to another\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the source quaternion\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var copy = vec4.copy;\n/**\r\n * Set the components of a quat to the given values\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var set = vec4.set;\n/**\r\n * Adds two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var add = vec4.add;\n/**\r\n * Alias for {@link quat.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Scales a quat by a scalar number\r\n *\r\n * @param {quat} out the receiving vector\r\n * @param {ReadonlyQuat} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var scale = vec4.scale;\n/**\r\n * Calculates the dot product of two quat's\r\n *\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {Number} dot product of a and b\r\n * @function\r\n */\n\nexport var dot = vec4.dot;\n/**\r\n * Performs a linear interpolation between two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var lerp = vec4.lerp;\n/**\r\n * Calculates the length of a quat\r\n *\r\n * @param {ReadonlyQuat} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport var length = vec4.length;\n/**\r\n * Alias for {@link quat.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Calculates the squared length of a quat\r\n *\r\n * @param {ReadonlyQuat} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n * @function\r\n */\n\nexport var squaredLength = vec4.squaredLength;\n/**\r\n * Alias for {@link quat.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Normalize a quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quaternion to normalize\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var normalize = vec4.normalize;\n/**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyQuat} a The first quaternion.\r\n * @param {ReadonlyQuat} b The second quaternion.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport var exactEquals = vec4.exactEquals;\n/**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyQuat} a The first vector.\r\n * @param {ReadonlyQuat} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport var equals = vec4.equals;\n/**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n *\r\n * @param {quat} out the receiving quaternion.\r\n * @param {ReadonlyVec3} a the initial vector\r\n * @param {ReadonlyVec3} b the destination vector\r\n * @returns {quat} out\r\n */\n\nexport var rotationTo = function () {\n var tmpvec3 = vec3.create();\n var xUnitVec3 = vec3.fromValues(1, 0, 0);\n var yUnitVec3 = vec3.fromValues(0, 1, 0);\n return function (out, a, b) {\n var dot = vec3.dot(a, b);\n\n if (dot < -0.999999) {\n vec3.cross(tmpvec3, xUnitVec3, a);\n if (vec3.len(tmpvec3) < 0.000001) vec3.cross(tmpvec3, yUnitVec3, a);\n vec3.normalize(tmpvec3, tmpvec3);\n setAxisAngle(out, tmpvec3, Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n vec3.cross(tmpvec3, a, b);\n out[0] = tmpvec3[0];\n out[1] = tmpvec3[1];\n out[2] = tmpvec3[2];\n out[3] = 1 + dot;\n return normalize(out, out);\n }\n };\n}();\n/**\r\n * Performs a spherical linear interpolation with two control points\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {ReadonlyQuat} c the third operand\r\n * @param {ReadonlyQuat} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n */\n\nexport var sqlerp = function () {\n var temp1 = create();\n var temp2 = create();\n return function (out, a, b, c, d, t) {\n slerp(temp1, a, d, t);\n slerp(temp2, b, c, t);\n slerp(out, temp1, temp2, 2 * t * (1 - t));\n return out;\n };\n}();\n/**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n *\r\n * @param {ReadonlyVec3} view the vector representing the viewing direction\r\n * @param {ReadonlyVec3} right the vector representing the local \"right\" direction\r\n * @param {ReadonlyVec3} up the vector representing the local \"up\" direction\r\n * @returns {quat} out\r\n */\n\nexport var setAxes = function () {\n var matr = mat3.create();\n return function (out, view, right, up) {\n matr[0] = right[0];\n matr[3] = right[1];\n matr[6] = right[2];\n matr[1] = up[0];\n matr[4] = up[1];\n matr[7] = up[2];\n matr[2] = -view[0];\n matr[5] = -view[1];\n matr[8] = -view[2];\n return normalize(out, fromMat3(out, matr));\n };\n}();","import * as glMatrix from \"./common.js\";\n/**\r\n * 4 Dimensional Vector\r\n * @module vec4\r\n */\n\n/**\r\n * Creates a new, empty vec4\r\n *\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec4 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec4} a vector to clone\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Creates a new vec4 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function fromValues(x, y, z, w) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\r\n * Copy the values from one vec4 to another\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the source vector\r\n * @returns {vec4} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set the components of a vec4 to the given values\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} out\r\n */\n\nexport function set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\r\n * Adds two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\r\n * Multiplies two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n}\n/**\r\n * Divides two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to ceil\r\n * @returns {vec4} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to floor\r\n * @returns {vec4} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n}\n/**\r\n * Math.round the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to round\r\n * @returns {vec4} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n}\n/**\r\n * Scales a vec4 by a scalar number\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec4} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\r\n * Adds two vec4's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec4} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Calculates the length of a vec4\r\n *\r\n * @param {ReadonlyVec4} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\r\n * Calculates the squared length of a vec4\r\n *\r\n * @param {ReadonlyVec4} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Negates the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to negate\r\n * @returns {vec4} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to invert\r\n * @returns {vec4} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n out[3] = 1.0 / a[3];\n return out;\n}\n/**\r\n * Normalize a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to normalize\r\n * @returns {vec4} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n var len = x * x + y * y + z * z + w * w;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n}\n/**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n *\r\n * @param {ReadonlyVec4} result the receiving vector\r\n * @param {ReadonlyVec4} U the first vector\r\n * @param {ReadonlyVec4} V the second vector\r\n * @param {ReadonlyVec4} W the third vector\r\n * @returns {vec4} result\r\n */\n\nexport function cross(out, u, v, w) {\n var A = v[0] * w[1] - v[1] * w[0],\n B = v[0] * w[2] - v[2] * w[0],\n C = v[0] * w[3] - v[3] * w[0],\n D = v[1] * w[2] - v[2] * w[1],\n E = v[1] * w[3] - v[3] * w[1],\n F = v[2] * w[3] - v[3] * w[2];\n var G = u[0];\n var H = u[1];\n var I = u[2];\n var J = u[3];\n out[0] = H * F - I * E + J * D;\n out[1] = -(G * F) + I * C - J * B;\n out[2] = G * E - H * C + J * A;\n out[3] = -(G * D) + H * B - I * A;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec4} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n var aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec4} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n\n var v1, v2, v3, v4;\n var s1, s2;\n\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n\n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n}\n/**\r\n * Transforms the vec4 with a mat4.\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec4} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n}\n/**\r\n * Transforms the vec4 with a quat\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to transform\r\n * @param {ReadonlyQuat} q quaternion to transform with\r\n * @returns {vec4} out\r\n */\n\nexport function transformQuat(out, a, q) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3]; // calculate quat * vec\n\n var ix = qw * x + qy * z - qz * y;\n var iy = qw * y + qz * x - qx * z;\n var iz = qw * z + qx * y - qy * x;\n var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set the components of a vec4 to zero\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @returns {vec4} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec4} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec4} a The first vector.\r\n * @param {ReadonlyVec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec4} a The first vector.\r\n * @param {ReadonlyVec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\r\n * Alias for {@link vec4.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec4.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec4.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec4.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec4.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec4.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec4.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec4s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 4;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n vec[3] = a[i + 3];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n a[i + 3] = vec[3];\n }\n\n return a;\n };\n}();","import * as glMatrix from \"./common.js\";\n/**\r\n * 3 Dimensional Vector\r\n * @module vec3\r\n */\n\n/**\r\n * Creates a new, empty vec3\r\n *\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(3);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec3} a vector to clone\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\r\n * Calculates the length of a vec3\r\n *\r\n * @param {ReadonlyVec3} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return Math.hypot(x, y, z);\n}\n/**\r\n * Creates a new vec3 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function fromValues(x, y, z) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\r\n * Copy the values from one vec3 to another\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the source vector\r\n * @returns {vec3} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\r\n * Set the components of a vec3 to the given values\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} out\r\n */\n\nexport function set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\r\n * Adds two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n}\n/**\r\n * Multiplies two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n}\n/**\r\n * Divides two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to ceil\r\n * @returns {vec3} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to floor\r\n * @returns {vec3} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n}\n/**\r\n * Math.round the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to round\r\n * @returns {vec3} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n return out;\n}\n/**\r\n * Scales a vec3 by a scalar number\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec3} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n return out;\n}\n/**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec3} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return Math.hypot(x, y, z);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return x * x + y * y + z * z;\n}\n/**\r\n * Calculates the squared length of a vec3\r\n *\r\n * @param {ReadonlyVec3} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return x * x + y * y + z * z;\n}\n/**\r\n * Negates the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to negate\r\n * @returns {vec3} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to invert\r\n * @returns {vec3} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n return out;\n}\n/**\r\n * Normalize a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to normalize\r\n * @returns {vec3} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var len = x * x + y * y + z * z;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n/**\r\n * Computes the cross product of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function cross(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2];\n var bx = b[0],\n by = b[1],\n bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n}\n/**\r\n * Performs a hermite interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {ReadonlyVec3} c the third operand\r\n * @param {ReadonlyVec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function hermite(out, a, b, c, d, t) {\n var factorTimes2 = t * t;\n var factor1 = factorTimes2 * (2 * t - 3) + 1;\n var factor2 = factorTimes2 * (t - 2) + t;\n var factor3 = factorTimes2 * (t - 1);\n var factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\r\n * Performs a bezier interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {ReadonlyVec3} c the third operand\r\n * @param {ReadonlyVec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function bezier(out, a, b, c, d, t) {\n var inverseFactor = 1 - t;\n var inverseFactorTimesTwo = inverseFactor * inverseFactor;\n var factorTimes2 = t * t;\n var factor1 = inverseFactorTimesTwo * inverseFactor;\n var factor2 = 3 * t * inverseFactorTimesTwo;\n var factor3 = 3 * factorTimes2 * inverseFactor;\n var factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec3} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n var z = glMatrix.RANDOM() * 2.0 - 1.0;\n var zScale = Math.sqrt(1.0 - z * z) * scale;\n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n}\n/**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n/**\r\n * Transforms the vec3 with a mat3.\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyMat3} m the 3x3 matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformMat3(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n}\n/**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyQuat} q quaternion to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformQuat(out, a, q) {\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3];\n var x = a[0],\n y = a[1],\n z = a[2]; // var qvec = [qx, qy, qz];\n // var uv = vec3.cross([], qvec, a);\n\n var uvx = qy * z - qz * y,\n uvy = qz * x - qx * z,\n uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv);\n\n var uuvx = qy * uvz - qz * uvy,\n uuvy = qz * uvx - qx * uvz,\n uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w);\n\n var w2 = qw * 2;\n uvx *= w2;\n uvy *= w2;\n uvz *= w2; // vec3.scale(uuv, uuv, 2);\n\n uuvx *= 2;\n uuvy *= 2;\n uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv));\n\n out[0] = x + uvx + uuvx;\n out[1] = y + uvy + uuvy;\n out[2] = z + uvz + uuvz;\n return out;\n}\n/**\r\n * Rotate a 3D vector around the x-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateX(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Rotate a 3D vector around the y-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateY(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Rotate a 3D vector around the z-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateZ(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2]; //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Get the angle between two 3D vectors\r\n * @param {ReadonlyVec3} a The first operand\r\n * @param {ReadonlyVec3} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nexport function angle(a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n bx = b[0],\n by = b[1],\n bz = b[2],\n mag1 = Math.sqrt(ax * ax + ay * ay + az * az),\n mag2 = Math.sqrt(bx * bx + by * by + bz * bz),\n mag = mag1 * mag2,\n cosine = mag && dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\r\n * Set the components of a vec3 to zero\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @returns {vec3} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec3} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \")\";\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec3} a The first vector.\r\n * @param {ReadonlyVec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec3} a The first vector.\r\n * @param {ReadonlyVec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2));\n}\n/**\r\n * Alias for {@link vec3.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec3.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec3.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec3.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec3.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec3.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec3.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec3s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 3;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n }\n\n return a;\n };\n}();","import * as glMatrix from \"./common.js\";\nimport * as quat from \"./quat.js\";\nimport * as mat4 from \"./mat4.js\";\n/**\r\n * Dual Quaternion
\r\n * Format: [real, dual]
\r\n * Quaternion format: XYZW
\r\n * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
\r\n * @module quat2\r\n */\n\n/**\r\n * Creates a new identity dual quat\r\n *\r\n * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation]\r\n */\n\nexport function create() {\n var dq = new glMatrix.ARRAY_TYPE(8);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n dq[0] = 0;\n dq[1] = 0;\n dq[2] = 0;\n dq[4] = 0;\n dq[5] = 0;\n dq[6] = 0;\n dq[7] = 0;\n }\n\n dq[3] = 1;\n return dq;\n}\n/**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n *\r\n * @param {ReadonlyQuat2} a dual quaternion to clone\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function clone(a) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = a[0];\n dq[1] = a[1];\n dq[2] = a[2];\n dq[3] = a[3];\n dq[4] = a[4];\n dq[5] = a[5];\n dq[6] = a[6];\n dq[7] = a[7];\n return dq;\n}\n/**\r\n * Creates a new dual quat initialized with the given values\r\n *\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component\r\n * @param {Number} y2 Y component\r\n * @param {Number} z2 Z component\r\n * @param {Number} w2 W component\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n dq[4] = x2;\n dq[5] = y2;\n dq[6] = z2;\n dq[7] = w2;\n return dq;\n}\n/**\r\n * Creates a new dual quat from the given values (quat and translation)\r\n *\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component (translation)\r\n * @param {Number} y2 Y component (translation)\r\n * @param {Number} z2 Z component (translation)\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n var ax = x2 * 0.5,\n ay = y2 * 0.5,\n az = z2 * 0.5;\n dq[4] = ax * w1 + ay * z1 - az * y1;\n dq[5] = ay * w1 + az * x1 - ax * z1;\n dq[6] = az * w1 + ax * y1 - ay * x1;\n dq[7] = -ax * x1 - ay * y1 - az * z1;\n return dq;\n}\n/**\r\n * Creates a dual quat from a quaternion and a translation\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyQuat} q a normalized quaternion\r\n * @param {ReadonlyVec3} t tranlation vector\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromRotationTranslation(out, q, t) {\n var ax = t[0] * 0.5,\n ay = t[1] * 0.5,\n az = t[2] * 0.5,\n bx = q[0],\n by = q[1],\n bz = q[2],\n bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Creates a dual quat from a translation\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyVec3} t translation vector\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n}\n/**\r\n * Creates a dual quat from a quaternion\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyQuat} q the quaternion\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\r\n * Creates a new dual quat from a matrix (4x4)\r\n *\r\n * @param {quat2} out the dual quaternion\r\n * @param {ReadonlyMat4} a the matrix\r\n * @returns {quat2} dual quat receiving operation result\r\n * @function\r\n */\n\nexport function fromMat4(out, a) {\n //TODO Optimize this\n var outer = quat.create();\n mat4.getRotation(outer, a);\n var t = new glMatrix.ARRAY_TYPE(3);\n mat4.getTranslation(t, a);\n fromRotationTranslation(out, outer, t);\n return out;\n}\n/**\r\n * Copy the values from one dual quat to another\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the source dual quaternion\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n}\n/**\r\n * Set a dual quat to the identity dual quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @returns {quat2} out\r\n */\n\nexport function identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\r\n * Set the components of a dual quat to the given values\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component\r\n * @param {Number} y2 Y component\r\n * @param {Number} z2 Z component\r\n * @param {Number} w2 W component\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n}\n/**\r\n * Gets the real part of a dual quat\r\n * @param {quat} out real part\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @return {quat} real part\r\n */\n\nexport var getReal = quat.copy;\n/**\r\n * Gets the dual part of a dual quat\r\n * @param {quat} out dual part\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @return {quat} dual part\r\n */\n\nexport function getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n}\n/**\r\n * Set the real component of a dual quat to the given quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat} q a quaternion representing the real part\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport var setReal = quat.copy;\n/**\r\n * Set the dual component of a dual quat to the given quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat} q a quaternion representing the dual part\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function setDual(out, q) {\n out[4] = q[0];\n out[5] = q[1];\n out[6] = q[2];\n out[7] = q[3];\n return out;\n}\n/**\r\n * Gets the translation of a normalized dual quat\r\n * @param {vec3} out translation\r\n * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed\r\n * @return {vec3} translation\r\n */\n\nexport function getTranslation(out, a) {\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n}\n/**\r\n * Translates a dual quat by the given vector\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to translate\r\n * @param {ReadonlyVec3} v vector to translate by\r\n * @returns {quat2} out\r\n */\n\nexport function translate(out, a, v) {\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3],\n bx1 = v[0] * 0.5,\n by1 = v[1] * 0.5,\n bz1 = v[2] * 0.5,\n ax2 = a[4],\n ay2 = a[5],\n az2 = a[6],\n aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n}\n/**\r\n * Rotates a dual quat around the X axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateX(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around the Y axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateY(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around the Z axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat by a given quaternion (a * q)\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {ReadonlyQuat} q quaternion to rotate by\r\n * @returns {quat2} out\r\n */\n\nexport function rotateByQuatAppend(out, a, q) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n}\n/**\r\n * Rotates a dual quat by a given quaternion (q * a)\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat} q quaternion to rotate by\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @returns {quat2} out\r\n */\n\nexport function rotateByQuatPrepend(out, q, a) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n bx = a[0],\n by = a[1],\n bz = a[2],\n bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around a given axis. Does the normalisation automatically\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @param {Number} rad how far the rotation should be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateAroundAxis(out, a, axis, rad) {\n //Special case for rad = 0\n if (Math.abs(rad) < glMatrix.EPSILON) {\n return copy(out, a);\n }\n\n var axisLength = Math.hypot(axis[0], axis[1], axis[2]);\n rad = rad * 0.5;\n var s = Math.sin(rad);\n var bx = s * axis[0] / axisLength;\n var by = s * axis[1] / axisLength;\n var bz = s * axis[2] / axisLength;\n var bw = Math.cos(rad);\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Adds two dual quat's\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n}\n/**\r\n * Multiplies two dual quat's\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {quat2} out\r\n */\n\nexport function multiply(out, a, b) {\n var ax0 = a[0],\n ay0 = a[1],\n az0 = a[2],\n aw0 = a[3],\n bx1 = b[4],\n by1 = b[5],\n bz1 = b[6],\n bw1 = b[7],\n ax1 = a[4],\n ay1 = a[5],\n az1 = a[6],\n aw1 = a[7],\n bx0 = b[0],\n by0 = b[1],\n bz0 = b[2],\n bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n}\n/**\r\n * Alias for {@link quat2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Scales a dual quat by a scalar number\r\n *\r\n * @param {quat2} out the receiving dual quat\r\n * @param {ReadonlyQuat2} a the dual quat to scale\r\n * @param {Number} b amount to scale the dual quat by\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n}\n/**\r\n * Calculates the dot product of two dual quat's (The dot product of the real parts)\r\n *\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {Number} dot product of a and b\r\n * @function\r\n */\n\nexport var dot = quat.dot;\n/**\r\n * Performs a linear interpolation between two dual quats's\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5)\r\n *\r\n * @param {quat2} out the receiving dual quat\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat2} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var mt = 1 - t;\n if (dot(a, b) < 0) t = -t;\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n}\n/**\r\n * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a dual quat to calculate inverse of\r\n * @returns {quat2} out\r\n */\n\nexport function invert(out, a) {\n var sqlen = squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n}\n/**\r\n * Calculates the conjugate of a dual quat\r\n * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result.\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat2} a quat to calculate conjugate of\r\n * @returns {quat2} out\r\n */\n\nexport function conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n}\n/**\r\n * Calculates the length of a dual quat\r\n *\r\n * @param {ReadonlyQuat2} a dual quat to calculate length of\r\n * @returns {Number} length of a\r\n * @function\r\n */\n\nexport var length = quat.length;\n/**\r\n * Alias for {@link quat2.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Calculates the squared length of a dual quat\r\n *\r\n * @param {ReadonlyQuat2} a dual quat to calculate squared length of\r\n * @returns {Number} squared length of a\r\n * @function\r\n */\n\nexport var squaredLength = quat.squaredLength;\n/**\r\n * Alias for {@link quat2.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Normalize a dual quat\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a dual quaternion to normalize\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function normalize(out, a) {\n var magnitude = squaredLength(a);\n\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n var a0 = a[0] / magnitude;\n var a1 = a[1] / magnitude;\n var a2 = a[2] / magnitude;\n var a3 = a[3] / magnitude;\n var b0 = a[4];\n var b1 = a[5];\n var b2 = a[6];\n var b3 = a[7];\n var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n\n return out;\n}\n/**\r\n * Returns a string representation of a dual quatenion\r\n *\r\n * @param {ReadonlyQuat2} a dual quaternion to represent as a string\r\n * @returns {String} string representation of the dual quat\r\n */\n\nexport function str(a) {\n return \"quat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \")\";\n}\n/**\r\n * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyQuat2} a the first dual quaternion.\r\n * @param {ReadonlyQuat2} b the second dual quaternion.\r\n * @returns {Boolean} true if the dual quaternions are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7];\n}\n/**\r\n * Returns whether or not the dual quaternions have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyQuat2} a the first dual quat.\r\n * @param {ReadonlyQuat2} b the second dual quat.\r\n * @returns {Boolean} true if the dual quats are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7));\n}","import * as glMatrix from \"./common.js\";\n/**\r\n * 2 Dimensional Vector\r\n * @module vec2\r\n */\n\n/**\r\n * Creates a new, empty vec2\r\n *\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(2);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec2 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec2} a vector to clone\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\r\n * Creates a new vec2 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function fromValues(x, y) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\r\n * Copy the values from one vec2 to another\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the source vector\r\n * @returns {vec2} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\r\n * Set the components of a vec2 to the given values\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} out\r\n */\n\nexport function set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\r\n * Adds two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n}\n/**\r\n * Multiplies two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n}\n/**\r\n * Divides two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to ceil\r\n * @returns {vec2} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to floor\r\n * @returns {vec2} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n}\n/**\r\n * Math.round the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to round\r\n * @returns {vec2} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n}\n/**\r\n * Scales a vec2 by a scalar number\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec2} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n}\n/**\r\n * Adds two vec2's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec2} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return Math.hypot(x, y);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return x * x + y * y;\n}\n/**\r\n * Calculates the length of a vec2\r\n *\r\n * @param {ReadonlyVec2} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0],\n y = a[1];\n return Math.hypot(x, y);\n}\n/**\r\n * Calculates the squared length of a vec2\r\n *\r\n * @param {ReadonlyVec2} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0],\n y = a[1];\n return x * x + y * y;\n}\n/**\r\n * Negates the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to negate\r\n * @returns {vec2} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to invert\r\n * @returns {vec2} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n return out;\n}\n/**\r\n * Normalize a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to normalize\r\n * @returns {vec2} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0],\n y = a[1];\n var len = x * x + y * y;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n}\n/**\r\n * Computes the cross product of two vec2's\r\n * Note that the cross product must by definition produce a 3D vector\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function cross(out, a, b) {\n var z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec2} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0],\n ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec2} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n out[0] = Math.cos(r) * scale;\n out[1] = Math.sin(r) * scale;\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat2} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat2(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat2d\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat2d} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat2d(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat3\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat3} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat3(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat4\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0];\n var y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n}\n/**\r\n * Rotate a 2D vector\r\n * @param {vec2} out The receiving vec2\r\n * @param {ReadonlyVec2} a The vec2 point to rotate\r\n * @param {ReadonlyVec2} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec2} out\r\n */\n\nexport function rotate(out, a, b, rad) {\n //Translate point to the origin\n var p0 = a[0] - b[0],\n p1 = a[1] - b[1],\n sinC = Math.sin(rad),\n cosC = Math.cos(rad); //perform rotation and translate to correct position\n\n out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n}\n/**\r\n * Get the angle between two 2D vectors\r\n * @param {ReadonlyVec2} a The first operand\r\n * @param {ReadonlyVec2} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nexport function angle(a, b) {\n var x1 = a[0],\n y1 = a[1],\n x2 = b[0],\n y2 = b[1],\n // mag is the product of the magnitudes of a and b\n mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2),\n // mag &&.. short circuits if mag == 0\n cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\n\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\r\n * Set the components of a vec2 to zero\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @returns {vec2} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec2} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec2(\" + a[0] + \", \" + a[1] + \")\";\n}\n/**\r\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec2} a The first vector.\r\n * @param {ReadonlyVec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec2} a The first vector.\r\n * @param {ReadonlyVec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1];\n var b0 = b[0],\n b1 = b[1];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1));\n}\n/**\r\n * Alias for {@link vec2.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec2.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec2.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec2.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec2.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec2.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec2s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 2;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n }\n\n return a;\n };\n}();","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Scene = void 0;\nconst SceneChild_1 = require(\"./SceneChild\");\nconst Group_1 = require(\"./Group\");\nconst Shape_1 = require(\"./shapes/Shape\");\nconst Utilities_1 = require(\"./Utilities\");\n/**\n * Container for all SceneChild.\n * The main purpose is to manage the drawing order and update the child buffers\n *\n * @order 1\n * @category Core.Scene\n * @class Scene\n */\nclass Scene {\n /**\n * Creates an instance of Scene.\n * You can see the default values in the property definitions\n */\n constructor(settings = {}) {\n /**\n * Logical number, the drawer will take care of defining the unit of measure\n */\n this.width = 400;\n /**\n * Logical number, the drawer will take care of defining the unit of measure\n */\n this.height = 400;\n /**\n * Default background color (black)\n */\n this.background = 'hsla(0, 0%, 0%, 1)';\n /**\n * Default ScenePrimitive stroke color (white)\n */\n this.color = 'hsla(0, 0%, 100%, 1)';\n /**\n * Current time\n */\n this.currentTime = 0;\n if (typeof settings.width !== 'undefined')\n this.width = settings.width;\n if (typeof settings.height !== 'undefined')\n this.height = settings.height;\n if (typeof settings.background !== 'undefined')\n this.background = settings.background;\n if (typeof settings.color !== 'undefined')\n this.color = settings.color;\n this.children = [];\n this.center = [this.width / 2, this.height / 2];\n this.anchor =\n settings.anchor && Array.isArray(settings.anchor)\n ? [\n typeof settings.anchor[0] === 'number'\n ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[0]) * 0.5) * this.width\n : settings.anchor[0] === 'left'\n ? 0\n : settings.anchor[0] === 'right'\n ? this.width\n : this.center[0],\n typeof settings.anchor[1] === 'number'\n ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[1]) * 0.5) * this.height\n : settings.anchor[1] === 'top'\n ? 0\n : settings.anchor[1] === 'bottom'\n ? this.height\n : this.center[1],\n ]\n : [this.center[0], this.center[1]];\n }\n /**\n * Return width percentage\n *\n * @param {number} [percentage=100]\n * @returns {number}\n */\n getWidth(percentage = 100) {\n return (this.width * percentage) / 100;\n }\n /**\n * Return height percentage\n *\n * @param {number} [percentage=100]\n * @returns {number}\n */\n getHeight(percentage = 100) {\n return (this.height * percentage) / 100;\n }\n /**\n * Resize the scene size\n *\n * @param {number} width\n * @param {number} [height=width]\n * @memberof Scene\n */\n resize(width, height = width) {\n this.width = width;\n this.height = height;\n this.center = [this.width / 2, this.height / 2];\n const anchor = [this.width / this.anchor[0], this.height / this.anchor[1]];\n this.anchor = [this.width / anchor[0], this.height / anchor[1]];\n this.children.forEach(sceneChild => sceneChild.clearBuffer(true, false));\n }\n /**\n * Update all children, generate a streamable buffer for drawing\n *\n * @param {number} [atTime] time in ms\n * @memberof Scene\n */\n update(atTime = 0) {\n this.currentTime = atTime;\n for (let i = 0, len = this.children.length; i < len; i++) {\n this.children[i].generate(this.currentTime, true);\n }\n }\n /**\n * Traverse the child buffer and use it with callback\n *\n * @param {(streamArguments: IStreamArguments) => void} callback\n * @memberof Scene\n */\n stream(callback) {\n this.children.forEach(sceneChild => sceneChild.stream(callback));\n }\n /*\n |--------------------------------------------------------------------------\n | SceneChild\n |--------------------------------------------------------------------------\n */\n /**\n * Return a list of children\n *\n * @returns {Array}\n * @memberof Scene\n */\n getChildren() {\n return this.children;\n }\n /**\n * Add SceneChild to Scene, pass `order` as last parameter for drawing priorities\n *\n * @param {Array} items\n * @param {number} [order]\n * @memberof Scene\n */\n add(...items /**, order: number */) {\n const order = typeof items[items.length - 1] === 'number' ? items[items.length - 1] : undefined;\n const len = items.length - (typeof order === 'undefined' ? 0 : 1);\n for (let i = 0; i < len; i++) {\n const item = items[i];\n item.order =\n typeof order !== 'undefined'\n ? order + i\n : typeof item.order !== 'undefined'\n ? item.order\n : this.children.length > 0\n ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1\n : 0;\n Scene.propagateToChilden(item, this);\n this.children.push(item);\n item.clearBuffer(true, false);\n item.generate(0, true);\n }\n this.sortChildren();\n }\n /**\n * Sort children by order\n *\n * @memberof Scene\n */\n sortChildren() {\n this.children.sort((a, b) => a.order - b.order);\n this.children = this.children.map((child, index) => {\n child.order = index;\n return child;\n });\n }\n /**\n * Find sceneChild from id or name in the whole scene\n *\n * @param {string | number} idOrName\n * @returns {(SceneChild | null)}\n * @memberof Scene\n */\n find(idOrName) {\n const children = this.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const result = children[i].find(idOrName);\n if (result !== null)\n return result;\n }\n return null;\n }\n /**\n * Get shape by index\n *\n * @param {number} index\n * @returns {(SceneChild | null)}\n * @memberof Scene\n */\n get(index) {\n return index >= 0 && index < this.children.length ? this.children[index] : null;\n }\n /**\n * Remove a shape by index\n *\n * @param {number} index\n * @memberof Scene\n */\n remove(index) {\n index >= 0 && index < this.children.length && this.children.splice(index, 1);\n }\n /**\n * Removes all children\n *\n * @memberof Scene\n */\n removeChildren() {\n this.children = [];\n }\n /**\n * Remove sceneChild by id or name\n *\n * @param {number | number} idOrName\n * @memberof Scene\n */\n removeFromId(idOrName) {\n for (let i = 0, len = this.children.length; i < len; i++)\n if (this.children[i].id === idOrName || this.children[i].name === idOrName) {\n this.children.splice(i, 1);\n return;\n }\n }\n /**\n * Return true if sceneChild is direct children\n *\n * @param {SceneChild} sceneChild\n * @returns {boolean}\n * @memberof Scene\n */\n isFirstLevelChild(sceneChild) {\n for (let i = 0, len = this.children.length; i < len; i++)\n if (this.children[i].id === sceneChild.id)\n return true;\n const parents = this.getParentsOfSceneChild(sceneChild);\n return parents.length === 1 && parents[0] instanceof Group_1.Group;\n }\n /**\n * Returns the list of sceneChild hierarchy starting from the scene\n *\n * @param {SceneChild} sceneChild\n * @returns {Array}\n * @memberof Scene\n */\n getParentsOfSceneChild(sceneChild) {\n const result = Scene.getParentsOfSceneChild(this, sceneChild);\n if (result) {\n result.splice(0, 1);\n return result;\n }\n return [];\n }\n /**\n * Returns the list of sceneChild hierarchy starting from the scene\n *\n * @static\n * @param {(Scene | SceneChild)} current\n * @param {SceneChild} sceneChild\n * @param {(Array)} [parents=[]]\n * @returns {(Array | null)}\n * @memberof Scene\n */\n static getParentsOfSceneChild(current, sceneChild, parents = []) {\n let result;\n if (current instanceof SceneChild_1.SceneChild) {\n if (current.id == sceneChild.id)\n return parents;\n if (current instanceof Shape_1.Shape && current.shape) {\n const tmpParents = parents.slice();\n tmpParents.push(current);\n if ((result = Scene.getParentsOfSceneChild(current.shape, sceneChild, tmpParents)))\n return result;\n }\n }\n if (current instanceof Scene || current instanceof Group_1.Group) {\n const children = current.getChildren();\n parents.push(current);\n for (let i = 0, len = children.length; i < len; i++) {\n const child = children[i];\n if ((result = Scene.getParentsOfSceneChild(child, sceneChild, parents)))\n return result;\n }\n parents.pop();\n }\n return null;\n }\n /**\n * Walk through the scene\n *\n * @static\n * @param {SceneChild} callbackk\n * @param {(Scene | SceneChild)} current\n * @memberof Scene\n */\n static walk(callback, current) {\n if (current instanceof SceneChild_1.SceneChild) {\n if (callback(current) === false)\n return false;\n if (current instanceof Shape_1.Shape && current.shape)\n if (Scene.walk(callback, current.shape) === false)\n return false;\n }\n if (current instanceof Scene || current instanceof Group_1.Group) {\n const children = current.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const child = children[i];\n if (Scene.walk(callback, child) === false)\n return false;\n }\n }\n }\n /**\n * Propagate scene to sceneChild (and children)\n *\n * @static\n * @param {SceneChild} sceneChild\n * @param {Scene} scene\n * @memberof Scene\n */\n static propagateToChilden(sceneChild, scene) {\n sceneChild.scene = scene;\n if (sceneChild instanceof Group_1.Group) {\n sceneChild.getChildren().forEach((item) => {\n Scene.propagateToChilden(item, scene);\n });\n }\n else if (sceneChild instanceof Shape_1.Shape && sceneChild.shape) {\n sceneChild.shape.scene = scene;\n Scene.propagateToChilden(sceneChild.shape, scene);\n }\n }\n}\nexports.Scene = Scene;\n//# sourceMappingURL=Scene.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SceneChild = void 0;\n/**\n * Autoincrement sceneChild default id\n *\n * @internal\n * @ignore\n */\nlet __id = 0;\n/**\n * The element to be added into a scene.\n * Preserve props, drawing order, generate and return buffers.\n * The only implementations of this class are Group and ShapeBase\n *\n * @abstract\n * @category Core.Abstract\n * @order 2\n * @class SceneChild\n */\nclass SceneChild {\n /**\n * Creates an instance of SceneChild.\n * Base values will be assigned in case they are not passed\n *\n * @param {ISceneChildSettings} settings\n */\n constructor(settings) {\n var _a;\n /**\n * Shape generation id\n * used for prevent buffer calculation\n *\n * @internal\n * @ignore\n */\n this.generateId = -1;\n this.id = (_a = settings.id) !== null && _a !== void 0 ? _a : ++__id;\n this.type = settings.type || 'SceneChild';\n this.name = settings.name || this.type + '_' + this.id;\n this.data = settings.data || {};\n this.props = {};\n }\n /**\n * Find this or form or children.\n * Overridden by classes that extend it\n *\n * @param {string | number} idOrName\n * @returns {(SceneChild | null)}\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n return null;\n }\n /**\n * Return the sceneChild properties\n *\n * @returns {Props}\n */\n getProps() {\n return this.props;\n }\n /**\n * Return a sceneChild prop or default value\n *\n * @param {keyof Props} key\n * @param {PropArguments} [propArguments]\n * @param {*} [defaultValue]\n * @returns {*}\n */\n getProp(key, propArguments, defaultValue) {\n var _a;\n return ((_a = this.props[key]) !== null && _a !== void 0 ? _a : defaultValue);\n }\n /**\n * Check SceneChild has prop\n *\n * @param {keyof Props} key\n * @returns\n */\n hasProp(key) {\n return typeof this.props[key] !== 'undefined';\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n */\n setPropUnsafe(key, value) {\n if (typeof key == 'string')\n this.props[key] = value;\n else\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n }\n}\nexports.SceneChild = SceneChild;\n//# sourceMappingURL=SceneChild.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Group = void 0;\nconst Scene_1 = require(\"./Scene\");\nconst SceneChild_1 = require(\"./SceneChild\");\nconst ShapeBase_1 = require(\"./shapes/ShapeBase\");\nconst Adapt_1 = require(\"./modifiers/Adapt\");\n/**\n * A SceneChild container, propagates properties to children\n *\n * @order 3\n * @category Core.Scene\n * @extends {SceneChild}\n * @example\n * ```javascript\n * // Group example\n *\n * const rect = new Urpflanze.Rect({\n * \tdistance: 100 // <- if a property is set the group will not overwrite it\n * })\n * const group = new Urpflanze.Group({\n * \trepetitions: 3,\n * \tdistance: 200\n * })\n *\n * group.add(rect)\n * group.add(new Urpflanze.Triangle())\n * ```\n * @class Group\n */\nclass Group extends SceneChild_1.SceneChild {\n /**\n * Creates an instance of Group\n *\n * @param {ISceneChildSettings} [settings={}]\n * @memberof Group\n */\n constructor(settings = {}) {\n settings.type = 'Group';\n super(settings);\n this.children = [];\n ['id', 'name', 'data', 'order', 'type'].forEach((prop) => {\n if (prop in settings)\n delete settings[prop];\n });\n this.props = settings;\n }\n /**\n * Check group has static children\n *\n * @returns {boolean}\n * @memberof Group\n */\n isStatic() {\n const children = this.children;\n for (let i = 0, len = children.length; i < len; i++)\n if (!children[i].isStatic())\n return false;\n return true;\n }\n /**\n * Check group has static children indexed\n *\n * @returns {boolean}\n * @memberof Group\n */\n isStaticIndexed() {\n const children = this.children;\n for (let i = 0, len = children.length; i < len; i++)\n if (!children[i].isStaticIndexed())\n return false;\n return true;\n }\n /**\n * Add item to Group\n *\n * @param {Array} items\n * @memberof Group\n */\n add(...items) {\n for (let i = 0, len = items.length; i < len; i++) {\n const item = items[i];\n const rawItemProps = item.getProps();\n Object.keys(this.props).forEach((propKey) => {\n if (typeof rawItemProps[propKey] === 'undefined')\n item.setProp(propKey, this.props[propKey]);\n });\n item.order =\n typeof item.order !== 'undefined'\n ? item.order\n : this.children.length > 0\n ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1\n : 0;\n this.scene && Scene_1.Scene.propagateToChilden(item, this.scene);\n this.children.push(item);\n }\n this.sortChildren();\n }\n /**\n * Sort children\n *\n * @memberof Group\n */\n sortChildren() {\n this.children.sort((a, b) => a.order - b.order);\n this.children = this.children.map((child, index) => {\n child.order = index;\n return child;\n });\n this.clearBuffer(true);\n }\n /**\n * Return shape children\n *\n * @returns {Array}\n * @memberof Group\n */\n getChildren() {\n return this.children;\n }\n /**\n * Find scene child from id or name\n *\n * @param {number | string} idOrName\n * @returns {(SceneChild | null)}\n * @memberof Group\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n const children = this.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const result = children[i].find(idOrName);\n if (result !== null)\n return result;\n }\n return null;\n }\n /**\n * Get item from group\n *\n * @param {number} index\n * @returns {(SceneChild | null)}\n * @memberof Group\n */\n get(index) {\n return index >= 0 && index < this.children.length ? this.children[index] : null;\n }\n /**\n * Remove item from group\n *\n * @param {number} index\n * @returns {(false | Array)}\n * @memberof Group\n */\n remove(index) {\n if (index >= 0 && index < this.children.length) {\n const removed = this.children.splice(index, 1);\n this.clearBuffer(true);\n return removed;\n }\n return false;\n }\n /**\n * Remove from id\n *\n * @param {number} id\n * @memberof Scene\n */\n removeFromId(id) {\n for (let i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i].id == id) {\n this.children.splice(i, 1);\n return this.clearBuffer(true);\n }\n }\n }\n /**\n * Generate children buffers\n *\n * @param {number} generateId\n * @param {boolean} [bDirectSceneChild=false]\n * @param {IPropArguments} [parentPropArguments]\n * @memberof Group\n */\n generate(generateId, bDirectSceneChild = false, parentPropArguments) {\n this.generateId = generateId;\n this.children.forEach(item => item.generate(generateId, bDirectSceneChild, parentPropArguments));\n }\n /**\n * Sum the children bounding\n *\n * @return {IShapeBounding}\n */\n getBounding() {\n const boundings = [];\n const bounding = Adapt_1.Bounding.empty();\n if (this.children.length > 0) {\n this.children.forEach(item => boundings.push(item.getBounding()));\n for (let i = 0, len = this.children.length; i < len; i++) {\n bounding.x = bounding.x > boundings[i].x ? boundings[i].x : bounding.x;\n bounding.y = bounding.y > boundings[i].y ? boundings[i].y : bounding.y;\n bounding.width = bounding.width < boundings[i].width ? boundings[i].width : bounding.width;\n bounding.height = bounding.height < boundings[i].height ? boundings[i].height : bounding.height;\n }\n bounding.cx = bounding.x + bounding.width / 2;\n bounding.cy = bounding.y + bounding.height / 2;\n }\n return bounding;\n }\n /**\n * Chear children buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @memberof Group\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.children.forEach(item => item.clearBuffer(bClearIndexed, false));\n if (this.scene && bPropagateToParents) {\n const parents = this.scene.getParentsOfSceneChild(this);\n parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */);\n }\n // if (bPropagateToParents && this.scene)\n // {\n // const parents = this.scene.getParentsOfSceneChild(this)\n // parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, true, false)\n // }\n // if (bPropagateToChildren)\n // {\n // this.children.forEach(sceneChild => sceneChild.clearBuffer(bClearIndexed, false, true))\n // }\n }\n /**\n * Set a single or multiple props\n *\n * @abstract\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @memberof SceneChild\n */\n setProp(key, value) {\n if (typeof key === 'object')\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n else\n this.props[key] = value;\n this.children.forEach(item => item.setProp(key, value));\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @memberof ShapeBase\n */\n setPropUnsafe(key, value) {\n super.setPropUnsafe(key, value);\n this.children.forEach(item => item.setPropUnsafe(key, value));\n }\n /**\n * Return length of buffer\n *\n * @param {IPropArguments} propArguments\n * @returns {number}\n * @memberof Group\n */\n getBufferLength(propArguments) {\n return this.children.map(sceneChild => sceneChild.getBufferLength(propArguments)).reduce((p, c) => p + c, 0);\n }\n /**\n * return a single buffer binded from children\n *\n * @returns {Float32Array}\n * @memberof Group\n */\n getBuffer() {\n const buffers = this.children\n .map(item => item.getBuffer())\n .filter(b => b !== undefined);\n const size = buffers.reduce((currLength, buffer) => currLength + buffer.length, 0);\n if (size > 0) {\n const result = new Float32Array(size);\n result.set(buffers[0], 0);\n for (let i = 1, offset = 0, len = buffers.length; i < len; i++) {\n offset += buffers[i - 1].length;\n result.set(buffers[i], offset);\n }\n return result;\n }\n return ShapeBase_1.ShapeBase.EMPTY_BUFFER;\n }\n /**\n * return a single buffer binded from children\n *\n * @returns {(Array | undefined)}\n * @memberof Group\n */\n getIndexedBuffer() {\n const indexed = this.children.map(item => item.getIndexedBuffer()).filter(b => b !== undefined);\n return [].concat.apply([], indexed);\n }\n /**\n * Call strem on children\n *\n * @param {(streamArguments: IStreamArguments) => void} callback\n * @memberof Group\n */\n stream(callback) {\n this.children.forEach(item => item.stream(callback));\n }\n}\nexports.Group = Group;\n//# sourceMappingURL=Group.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeBase = void 0;\nconst gl_matrix_1 = require(\"gl-matrix\");\nconst types_1 = require(\"../types\");\nconst glme = require(\"../math/gl-matrix-extensions\");\nconst Vec2_1 = require(\"../math/Vec2\");\nconst math_1 = require(\"../math\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst Utilities_1 = require(\"../Utilities\");\nconst SceneChild_1 = require(\"../SceneChild\");\nconst tmpMatrix = gl_matrix_1.mat4.create();\nconst transformMatrix = gl_matrix_1.mat4.create();\nconst perspectiveMatrix = gl_matrix_1.mat4.create();\nconst repetitionMatrix = gl_matrix_1.mat4.create();\n/**\n * Main class for shape generation\n *\n * @category Core.Abstract\n * @abstract\n * @class ShapeBase\n * @order 4\n * @extends {SceneChild}\n */\nclass ShapeBase extends SceneChild_1.SceneChild {\n /**\n * Creates an instance of ShapeBase\n *\n * @param {ISceneChildSettings} [settings={}]\n */\n constructor(settings = {}) {\n super(settings);\n /**\n * Flag used to determine if indexedBuffer has been generated\n *\n * @internal\n * @ignore\n */\n this.bIndexed = false;\n /**\n * Array used for index a vertex buffer\n * only for first level scene children\n *\n * @internal\n * @ignore\n */\n this.indexedBuffer = [];\n /**\n * The bounding inside the scene\n *\n * @type {IShapeBounding}\n */\n this.bounding = {\n cx: 0,\n cy: 0,\n x: -1,\n y: -1,\n width: 2,\n height: 2,\n };\n this.props = {\n distance: settings.distance,\n repetitions: settings.repetitions,\n rotateX: settings.rotateX,\n rotateY: settings.rotateY,\n rotateZ: settings.rotateZ,\n skewX: settings.skewX,\n skewY: settings.skewY,\n squeezeX: settings.squeezeX,\n squeezeY: settings.squeezeY,\n displace: settings.displace,\n translate: settings.translate,\n scale: settings.scale,\n transformOrigin: settings.transformOrigin,\n perspective: settings.perspective,\n perspectiveOrigin: settings.perspectiveOrigin,\n };\n this.anchor =\n settings.anchor && Array.isArray(settings.anchor)\n ? [\n typeof settings.anchor[0] === 'number'\n ? Utilities_1.clamp(-1, 1, settings.anchor[0]) * -1\n : settings.anchor[0] === 'left'\n ? 1\n : settings.anchor[0] === 'right'\n ? -1\n : 0,\n typeof settings.anchor[1] === 'number'\n ? Utilities_1.clamp(-1, 1, settings.anchor[1]) * -1\n : settings.anchor[1] === 'top'\n ? 1\n : settings.anchor[1] === 'bottom'\n ? -1\n : 0,\n ]\n : [0, 0];\n this.boundingType =\n typeof settings.boundingType === 'string'\n ? settings.boundingType === 'relative'\n ? types_1.EBoundingType.Relative\n : types_1.EBoundingType.Fixed\n : settings.boundingType || types_1.EBoundingType.Fixed;\n this.vertexCallback = settings.vertexCallback;\n }\n /**\n * Check if the shape should be generated every time\n *\n * @returns {boolean}\n */\n isStatic() {\n const props = this.props;\n return (typeof props.repetitions !== 'function' &&\n typeof props.distance !== 'function' &&\n typeof props.displace !== 'function' &&\n typeof props.scale !== 'function' &&\n typeof props.translate !== 'function' &&\n typeof props.skewX !== 'function' &&\n typeof props.skewY !== 'function' &&\n typeof props.squeezeX !== 'function' &&\n typeof props.squeezeY !== 'function' &&\n typeof props.rotateX !== 'function' &&\n typeof props.rotateY !== 'function' &&\n typeof props.rotateZ !== 'function' &&\n typeof props.transformOrigin !== 'function' &&\n typeof props.perspective !== 'function' &&\n typeof props.perspectiveOrigin !== 'function');\n }\n /**\n * Check if the indexedBuffer array needs to be recreated every time,\n * this can happen when a shape generates an array of vertices different in length at each repetition\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return typeof this.props.repetitions !== 'function';\n }\n /**\n * Return a prop value\n *\n * @param {keyof ISceneChildProps} key\n * @param {PropArguments} [propArguments]\n * @param {*} [defaultValue]\n * @returns {*}\n */\n getProp(key, propArguments, defaultValue) {\n let attribute = this.props[key];\n if (typeof attribute === 'function') {\n attribute = attribute(propArguments);\n }\n return typeof attribute === 'undefined' || Number.isNaN(attribute) ? defaultValue : attribute;\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @param {boolean} [bClearIndexed=false]\n */\n setProp(key, value, bClearIndexed = false) {\n if (typeof key === 'string') {\n bClearIndexed = bClearIndexed || key == 'repetitions';\n this.props[key] = value;\n }\n else {\n bClearIndexed = bClearIndexed || 'repetitions' in key;\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n }\n this.clearBuffer(bClearIndexed, true);\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.buffer = undefined;\n if (bClearIndexed) {\n this.bIndexed = false;\n this.indexedBuffer = [];\n }\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n if (bPropagateToParents && this.scene && !this.scene.isFirstLevelChild(this)) {\n const parents = this.scene.getParentsOfSceneChild(this);\n parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */);\n }\n }\n /**\n * Update the vertex array if the shape is not static and update the indexedBuffer if it is also not static\n *\n * @param {number} generateId generation id\n * @param {boolean} [bDirectSceneChild=false] adjust shape of center of scene\n * @param {PropArguments} [parentPropArguments]\n */\n generate(generateId = 0, bDirectSceneChild = false, parentPropArguments) {\n var _a, _b;\n if (this.buffer && this.bStatic) {\n return;\n }\n this.generateId = generateId;\n if (!this.bStaticIndexed || !this.bIndexed)\n this.indexedBuffer = [];\n const propArguments = ShapeBase.getEmptyPropArguments(this, parentPropArguments);\n const repetition = propArguments.repetition;\n const repetitions = this.getProp('repetitions', propArguments, 1);\n const repetitionType = Array.isArray(repetitions) ? types_1.ERepetitionType.Matrix : types_1.ERepetitionType.Ring;\n const repetitionCount = Array.isArray(repetitions)\n ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0])\n : repetitions;\n const repetitionRowCount = Array.isArray(repetitions) ? repetitions[0] : repetitionCount;\n const repetitionColCount = Array.isArray(repetitions) ? (_b = repetitions[1]) !== null && _b !== void 0 ? _b : repetitions[0] : 1;\n const rowRepetition = repetition.row;\n rowRepetition.count = repetitionRowCount;\n const colRepetition = repetition.col;\n colRepetition.count = repetitionColCount;\n repetition.count = repetitionCount;\n repetition.col.count = repetitionColCount;\n repetition.row.count = repetitionRowCount;\n repetition.type = repetitionType;\n let totalBufferLength = 0;\n const buffers = [];\n let currentIndex = 0;\n const centerMatrix = gl_matrix_1.vec2.fromValues((repetitionColCount - 1) / 2, (repetitionRowCount - 1) / 2);\n const sceneAnchor = this.scene ? [this.scene.anchor[0], this.scene.anchor[1], 0] : [0, 0, 0];\n const tmpTotalShapeBounding = [undefined, undefined, undefined, undefined];\n const tmpSingleRepetitionBounding = [undefined, undefined, undefined, undefined];\n for (let currentRowRepetition = 0; currentRowRepetition < repetitionRowCount; currentRowRepetition++) {\n for (let currentColRepetition = 0; currentColRepetition < repetitionColCount; currentColRepetition++, currentIndex++) {\n repetition.index = currentIndex + 1;\n repetition.offset = repetitionCount > 1 ? currentIndex / (repetitionCount - 1) : 1;\n repetition.angle = repetitionType === types_1.ERepetitionType.Ring ? (math_1.PI2 / repetitionCount) * currentIndex : 0;\n colRepetition.index = currentColRepetition + 1;\n colRepetition.offset = repetitionColCount > 1 ? currentColRepetition / (repetitionColCount - 1) : 1;\n rowRepetition.index = currentRowRepetition + 1;\n rowRepetition.offset = repetitionRowCount > 1 ? currentRowRepetition / (repetitionRowCount - 1) : 1;\n // Generate primitives buffer recursively\n const buffer = this.generateBuffer(generateId, propArguments);\n const bufferLength = buffer.length;\n const bounding = this.getShapeBounding();\n buffers[currentIndex] = new Float32Array(bufferLength);\n totalBufferLength += bufferLength;\n {\n const distance = glme.toVec2(this.getProp('distance', propArguments, glme.VEC2_ZERO));\n const displace = this.getProp('displace', propArguments, 0);\n const scale = glme.toVec3(this.getProp('scale', propArguments, glme.VEC2_ONE), 1);\n const translate = glme.toVec3(this.getProp('translate', propArguments, glme.VEC2_ZERO), 0);\n const skewX = this.getProp('skewX', propArguments, 0);\n const skewY = this.getProp('skewY', propArguments, 0);\n const squeezeX = this.getProp('squeezeX', propArguments, 0);\n const squeezeY = this.getProp('squeezeY', propArguments, 0);\n const rotateX = this.getProp('rotateX', propArguments, 0);\n const rotateY = this.getProp('rotateY', propArguments, 0);\n const rotateZ = this.getProp('rotateZ', propArguments, 0);\n const perspective = Utilities_1.clamp(0, 1, this.getProp('perspective', propArguments, 0));\n const perspectiveOrigin = glme.toVec3(this.getProp('perspectiveOrigin', propArguments, glme.VEC2_ZERO), 0);\n const transformOrigin = glme.toVec3(this.getProp('transformOrigin', propArguments, glme.VEC2_ZERO), 0);\n let offset;\n switch (repetitionType) {\n case types_1.ERepetitionType.Ring:\n offset = gl_matrix_1.vec3.fromValues(distance[0], 0, 0);\n gl_matrix_1.vec3.rotateZ(offset, offset, glme.VEC3_ZERO, repetition.angle + displace);\n break;\n case types_1.ERepetitionType.Matrix:\n offset = gl_matrix_1.vec3.fromValues(distance[1] * (currentColRepetition - centerMatrix[0]), distance[0] * (currentRowRepetition - centerMatrix[1]), 0);\n break;\n }\n const perspectiveSize = perspective > 0 ? Math.max(bounding.width, bounding.height) / 2 : 1;\n const perspectiveValue = perspective > 0 ? perspectiveSize + (1 - perspective) * (perspectiveSize * 10) : 0;\n const bTransformOrigin = (this.boundingType === types_1.EBoundingType.Relative ? bounding.cx !== 0 || bounding.cy !== 0 : true) ||\n perspective !== 0 ||\n transformOrigin[0] !== 0 ||\n transformOrigin[1] !== 0;\n const bPerspectiveOrigin = perspectiveOrigin[0] !== 0 || perspectiveOrigin[1] !== 0;\n if (bTransformOrigin) {\n if (this.boundingType === types_1.EBoundingType.Relative) {\n transformOrigin[0] = transformOrigin[0] * (bounding.width / 2) + bounding.cx;\n transformOrigin[1] = transformOrigin[1] * (bounding.height / 2) + bounding.cy;\n }\n else {\n transformOrigin[0] *= bounding.width / 2;\n transformOrigin[1] *= bounding.height / 2;\n }\n transformOrigin[2] = perspectiveValue;\n }\n /**\n * Create Matrices\n */\n {\n /**\n * Create Transformation matrix\n */\n gl_matrix_1.mat4.identity(transformMatrix);\n bTransformOrigin && gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, transformOrigin);\n if (translate[0] !== 0 || translate[1] !== 0)\n gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, translate);\n if (skewX !== 0 || skewY !== 0) {\n glme.fromSkew(tmpMatrix, [skewX, skewY]);\n gl_matrix_1.mat4.multiply(transformMatrix, transformMatrix, tmpMatrix);\n }\n rotateX !== 0 && gl_matrix_1.mat4.rotateX(transformMatrix, transformMatrix, rotateX);\n rotateY !== 0 && gl_matrix_1.mat4.rotateY(transformMatrix, transformMatrix, rotateY);\n rotateZ !== 0 && gl_matrix_1.mat4.rotateZ(transformMatrix, transformMatrix, rotateZ);\n if (scale[0] !== 1 || scale[1] !== 1)\n gl_matrix_1.mat4.scale(transformMatrix, transformMatrix, scale);\n bTransformOrigin &&\n gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, gl_matrix_1.vec3.scale(transformOrigin, transformOrigin, -1));\n /**\n * Create Perspective matrix\n */\n if (perspectiveValue > 0) {\n if (bPerspectiveOrigin) {\n if (this.boundingType === types_1.EBoundingType.Relative) {\n perspectiveOrigin[0] = perspectiveOrigin[0] * (bounding.width / 2) + bounding.cx;\n perspectiveOrigin[1] = perspectiveOrigin[1] * (bounding.height / 2) + bounding.cy;\n }\n else {\n perspectiveOrigin[0] *= bounding.width / 2;\n perspectiveOrigin[1] *= bounding.height / 2;\n }\n perspectiveOrigin[2] = 0;\n }\n gl_matrix_1.mat4.perspective(perspectiveMatrix, -Math.PI / 2, 1, 0, Infinity);\n }\n /**\n * Create Repetition matrix\n */\n gl_matrix_1.mat4.identity(repetitionMatrix);\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, offset);\n if (bDirectSceneChild) {\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, sceneAnchor);\n }\n /**\n * Apply anchor\n */\n const shapeAnchor = [this.anchor[0] * (bounding.width / 2), this.anchor[1] * (bounding.height / 2), 0];\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, shapeAnchor);\n if (repetitionType === types_1.ERepetitionType.Ring)\n gl_matrix_1.mat4.rotateZ(repetitionMatrix, repetitionMatrix, repetition.angle + displace);\n }\n Adapt_1.Bounding.clear(tmpSingleRepetitionBounding);\n // Apply matrices on vertex\n for (let bufferIndex = 0; bufferIndex < bufferLength; bufferIndex += 2) {\n const vertex = [buffer[bufferIndex], buffer[bufferIndex + 1], perspectiveValue];\n {\n // Apply squeeze, can be insert into transformMatrix?\n squeezeX !== 0 && Vec2_1.default.squeezeX(vertex, squeezeX);\n squeezeY !== 0 && Vec2_1.default.squeezeY(vertex, squeezeY);\n // Apply transforms\n gl_matrix_1.vec3.transformMat4(vertex, vertex, transformMatrix);\n // Apply perspective\n if (perspectiveValue > 0) {\n bPerspectiveOrigin && gl_matrix_1.vec3.add(vertex, vertex, perspectiveOrigin);\n gl_matrix_1.vec3.transformMat4(vertex, vertex, perspectiveMatrix);\n gl_matrix_1.vec3.scale(vertex, vertex, perspectiveValue);\n bPerspectiveOrigin && gl_matrix_1.vec3.sub(vertex, vertex, perspectiveOrigin);\n }\n // apply repetition matrix\n gl_matrix_1.vec3.transformMat4(vertex, vertex, repetitionMatrix);\n // custom vertex manipulation\n if (typeof this.vertexCallback !== 'undefined') {\n const index = bufferIndex / 2;\n const count = bufferLength / 2;\n const vertexRepetition = {\n index: index + 1,\n count,\n offset: count > 1 ? index / (count - 1) : 1,\n };\n this.vertexCallback(vertex, vertexRepetition, propArguments);\n }\n }\n buffers[currentIndex][bufferIndex] = vertex[0];\n buffers[currentIndex][bufferIndex + 1] = vertex[1];\n Adapt_1.Bounding.add(tmpSingleRepetitionBounding, vertex[0], vertex[1]);\n Adapt_1.Bounding.add(tmpTotalShapeBounding, vertex[0], vertex[1]);\n }\n }\n // Bounding.sum(tmpTotalShapeBounding, tmpSingleRepetitionBounding)\n // After buffer creation, add a frame into indexedBuffer if not static or update bounding\n const singleRepetitionBounding = { cx: 0, cy: 0, x: -1, y: -1, width: 2, height: 2 };\n Adapt_1.Bounding.bind(singleRepetitionBounding, tmpSingleRepetitionBounding);\n if (!this.bStaticIndexed || !this.bIndexed) {\n this.addIndex(bufferLength, repetition, singleRepetitionBounding);\n }\n }\n }\n Adapt_1.Bounding.bind(this.bounding, tmpTotalShapeBounding);\n this.buffer = new Float32Array(totalBufferLength);\n for (let i = 0, offset = 0, len = buffers.length; i < len; offset += buffers[i].length, i++)\n this.buffer.set(buffers[i], offset);\n this.bIndexed = true;\n }\n /**\n * Return current shape (whit repetions) bounding\n *\n * @return {*} {IShapeBounding}\n */\n getBounding() {\n return this.bounding;\n }\n /**\n * Get number of repetitions\n *\n * @returns {number}\n */\n getRepetitionCount() {\n var _a;\n const repetitions = this.getProp('repetitions', undefined, 1);\n return Array.isArray(repetitions) ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) : repetitions;\n }\n /**\n * Return buffer\n *\n * @returns {(Float32Array | undefined)}\n */\n getBuffer() {\n return this.buffer;\n }\n /**\n * Return indexed buffer\n *\n * @returns {(Array> | undefined)}\n */\n getIndexedBuffer() {\n return this.indexedBuffer;\n }\n /**\n * Return number of encapsulation\n *\n * @param {IBufferIndex} index\n * @returns {number}\n */\n static getIndexParentLevel(index) {\n if (typeof index.parent === 'undefined')\n return 0;\n let currentParent = index.parent;\n let currentParentLevel = 1;\n while (typeof currentParent.parent !== 'undefined') {\n currentParentLevel++;\n currentParent = currentParent.parent;\n }\n return currentParentLevel;\n }\n /**\n * Stream buffer\n *\n * @param {(TStreamCallback} callback\n */\n stream(callback) {\n if (this.buffer && this.indexedBuffer) {\n for (let i = 0, j = 0, len = this.indexedBuffer.length; i < len; i++) {\n const currentIndexing = this.indexedBuffer[i];\n callback({\n buffer: this.buffer,\n frameLength: currentIndexing.frameLength,\n frameBufferIndex: j,\n currentIndexing: currentIndexing,\n currentShapeIndex: i,\n totalShapes: len,\n });\n j += currentIndexing.frameLength;\n }\n }\n }\n /**\n * Return empty propArguments\n *\n * @static\n * @param {ShapeBase} shape\n * @return {*} {PropArguments}\n */\n static getEmptyPropArguments(shape, parentPropArguments) {\n const repetition = {\n type: types_1.ERepetitionType.Ring,\n angle: 0,\n index: 1,\n offset: 1,\n count: 1,\n row: { index: 1, offset: 1, count: 1 },\n col: { index: 1, offset: 1, count: 1 },\n };\n return {\n repetition,\n shape,\n parent: parentPropArguments,\n };\n }\n}\nexports.ShapeBase = ShapeBase;\n/**\n * Empty buffer\n *\n * @internal\n * @ignore\n */\nShapeBase.EMPTY_BUFFER = new Float32Array(0);\n/**\n * Empty BaseRepetition\n *\n * @internal\n * @ignore\n */\nShapeBase.getEmptySimpleRepetition = () => ({\n index: 1,\n offset: 1,\n count: 1,\n});\n/**\n * Empty Repetition\n *\n * @internal\n * @ignore\n */\nShapeBase.getEmptyRepetition = () => ({\n type: types_1.ERepetitionType.Ring,\n angle: 0,\n ...ShapeBase.getEmptySimpleRepetition(),\n row: ShapeBase.getEmptySimpleRepetition(),\n col: ShapeBase.getEmptySimpleRepetition(),\n});\n//# sourceMappingURL=ShapeBase.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toVec3 = exports.toVec2 = exports.fromSkew = exports.VEC2_ONE = exports.VEC2_ZERO = exports.VEC3_ONE = exports.VEC3_ZERO = void 0;\nconst gl_matrix_1 = require(\"gl-matrix\");\nexports.VEC3_ZERO = [0, 0, 0];\nexports.VEC3_ONE = [1, 1, 1];\nexports.VEC2_ZERO = [0, 0];\nexports.VEC2_ONE = [1, 1];\ngl_matrix_1.glMatrix.setMatrixArrayType(Array);\n/**\n * Skew matrix\n *\n * @internal\n * @ignore\n */\nfunction fromSkew(out, skew) {\n out[0] = 1;\n out[1] = Math.tan(skew[1]);\n out[2] = 0;\n out[3] = 0;\n out[4] = Math.tan(skew[0]);\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\nexports.fromSkew = fromSkew;\n/**\n * number to vec 2\n *\n * @internal\n * @ignore\n */\nfunction toVec2(x) {\n if (Array.isArray(x))\n return [x[0], x[1]];\n return [x, x];\n}\nexports.toVec2 = toVec2;\n/**\n * number to vec 3\n *\n * @internal\n * @ignore\n */\nfunction toVec3(x, defaultZValue = 0) {\n if (Array.isArray(x)) {\n return [x[0], x[1], defaultZValue];\n }\n return [x, x, defaultZValue];\n}\nexports.toVec3 = toVec3;\n//# sourceMappingURL=gl-matrix-extensions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Temporany matrix\n *\n * @internal\n * @ignore\n */\nconst MATRIX = new Array(4);\n/**\n * Vec2 operation\n *\n * @category Core.Utilities\n */\nconst Vec2 = {\n /**\n * from new vertex\n *\n * @param {Array | number} [x=0]\n * @param {number} [y]\n * @returns {Array}\n */\n from: (x = 0, y) => {\n const out = new Array(2);\n if (typeof x === 'number') {\n out[0] = x;\n out[1] = y !== null && y !== void 0 ? y : x;\n }\n else {\n out[0] = x[0];\n out[1] = x[1];\n }\n return out;\n },\n normalize: (v) => {\n const len = Vec2.length(v);\n return len !== 0 ? [v[0] / len, v[1] / len] : [0, 0];\n },\n /**\n * Distance between two points\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n distance: (a, b) => Math.hypot(a[0] - b[0], a[1] - b[1]),\n /**\n * dot product\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n dot: (a, b) => a[0] * b[0] + a[1] * b[1],\n /**\n * length of point\n *\n * @param {Array} vec\n * @returns {number}\n */\n length: (vec) => Math.hypot(vec[0], vec[1]),\n /**\n * angle between two point\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n angle: (a, b) => {\n a = Vec2.normalize(a);\n b = Vec2.normalize(b);\n return Math.acos(Vec2.dot(a, b));\n },\n /**\n * skewX point\n *\n * @param {Array} vec\n * @param {number} m\n */\n skewX: (vec, m) => {\n vec[0] += Math.tan(m) * vec[1];\n },\n /**\n * skewY point\n *\n * @param {Array} vec\n * @param {number} m\n */\n skewY: (vec, m) => {\n vec[1] += Math.tan(m) * vec[0];\n },\n /**\n * squeezeX point\n *\n * @param {Array} vec\n * @param {number} m\n */\n squeezeX: (vec, m) => {\n vec[1] += vec[1] * (vec[0] * -m);\n },\n /**\n * squeezeY point\n *\n * @param {Array} vec\n * @param {number} m\n */\n squeezeY: (vec, m) => {\n vec[0] += vec[0] * (vec[1] * m);\n },\n /**\n * Rotate point\n *\n * @param {Array} vec\n * @param {Array} MATRIX\n * @param {Array} fromPoint\n * @internal\n */\n rotate: (vec, MATRIX, fromPoint) => {\n const p0 = vec[0] - fromPoint[0];\n const p1 = vec[1] - fromPoint[1];\n vec[0] = p0 * MATRIX[0] + p1 * MATRIX[1] + fromPoint[0];\n vec[1] = p0 * MATRIX[2] + p1 * MATRIX[3] + fromPoint[1];\n },\n /**\n * RotateX point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateX: (vec, fromPoint, rad) => {\n MATRIX[0] = 1;\n MATRIX[1] = 0;\n MATRIX[2] = 0;\n MATRIX[3] = Math.cos(rad);\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * RotateY point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateY: (vec, fromPoint, rad) => {\n MATRIX[0] = Math.cos(rad);\n MATRIX[1] = 0;\n MATRIX[2] = 0;\n MATRIX[3] = 1;\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * RotateZ point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateZ: (vec, fromPoint, rad) => {\n MATRIX[0] = Math.cos(rad);\n MATRIX[1] = -Math.sin(rad);\n MATRIX[2] = Math.sin(rad);\n MATRIX[3] = Math.cos(rad);\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * Translate vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n translate: (vec, to) => {\n vec[0] += to[0];\n vec[1] += to[1];\n },\n /**\n * Scale vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n scale: (vec, to) => {\n vec[0] *= to[0];\n vec[1] *= to[1];\n },\n /**\n * Scale vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n divide: (vec, to) => {\n vec[0] /= to[0];\n vec[1] /= to[1];\n },\n /**\n * Vec to string\n *\n * @param {Array} vec\n * @return {string}\n */\n toString: (vec) => `x: ${vec[0]}, y: ${vec[1]}`,\n /**\n * Vertex [0, 0]\n */\n ZERO: Array.from([0, 0]),\n /**\n * Vertex [1, 1]\n */\n ONE: Array.from([1, 1]),\n};\nexports.default = Vec2;\n//# sourceMappingURL=Vec2.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mod = exports.PHI = exports.PI2 = exports.log = void 0;\n/**\n * Return logarith value and base\n *\n * @category Core.Utilities\n *\n * @param n number\n * @param base number\n */\nconst log = (n, base) => Math.log(n) / Math.log(base);\nexports.log = log;\n/**\n * @category Core.Utilities\n */\nexports.PI2 = Math.PI * 2;\n/**\n * @category Core.Utilities\n */\nexports.PHI = (1 + Math.sqrt(5)) / 2;\n/**\n * Return a positive module of positive or negative value\n *\n * @category Core.Utilities\n *\n * @param value number\n * @param base number\n */\nconst mod = (value, base) => {\n const result = value % base;\n return result < 0 ? result + base : result;\n};\nexports.mod = mod;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Adapt = exports.Bounding = exports.EAdaptMode = void 0;\nconst Modifier_1 = require(\"./Modifier\");\n/**\n *\n *\n * @category Core.Enums\n */\nvar EAdaptMode;\n(function (EAdaptMode) {\n /**\n * The buffer is not changed\n * @order 1\n */\n EAdaptMode[EAdaptMode[\"None\"] = 0] = \"None\";\n /**\n * The buffer is scaled in a range between [-1, -1] and [1,1]\n * @order 2\n */\n EAdaptMode[EAdaptMode[\"Scale\"] = 2] = \"Scale\";\n /**\n * The buffer is scaled in a range between [-1, -1] and [1,1] and is centered\n * @order 3\n */\n EAdaptMode[EAdaptMode[\"Center\"] = 4] = \"Center\";\n /**\n * The buffer is adapted centrally and expanded in a range between [-1, -1] and [1,1]\n * @order 4\n */\n EAdaptMode[EAdaptMode[\"Fill\"] = 8] = \"Fill\";\n})(EAdaptMode = exports.EAdaptMode || (exports.EAdaptMode = {}));\n/**\n * @internal\n * @ignore\n */\nexports.Bounding = {\n empty: () => ({\n cx: 0,\n cy: 0,\n x: -1,\n y: -1,\n width: 2,\n height: 2,\n }),\n clear: (tmpBounding) => {\n tmpBounding[0] = undefined;\n tmpBounding[1] = undefined;\n tmpBounding[2] = undefined;\n tmpBounding[3] = undefined;\n },\n add: (tmpBounding, x, y) => {\n if (typeof tmpBounding[0] === 'undefined' || x < tmpBounding[0])\n tmpBounding[0] = x;\n if (typeof tmpBounding[2] === 'undefined' || x > tmpBounding[2])\n tmpBounding[2] = x;\n if (typeof tmpBounding[1] === 'undefined' || y < tmpBounding[1])\n tmpBounding[1] = y;\n if (typeof tmpBounding[3] === 'undefined' || y > tmpBounding[3])\n tmpBounding[3] = y;\n },\n sum: (dest, bounding) => {\n if (typeof bounding[0] !== 'undefined' &&\n typeof bounding[1] !== 'undefined' &&\n typeof bounding[2] !== 'undefined' &&\n typeof bounding[3] !== 'undefined') {\n if (typeof dest[0] === 'undefined' ||\n typeof dest[1] === 'undefined' ||\n typeof dest[2] === 'undefined' ||\n typeof dest[3] === 'undefined') {\n dest[0] = bounding[0];\n dest[1] = bounding[1];\n dest[2] = bounding[2];\n dest[3] = bounding[3];\n }\n else {\n if (dest[0] < bounding[0])\n dest[0] = bounding[0];\n if (dest[2] > bounding[2])\n dest[2] = bounding[2];\n if (dest[1] < bounding[1])\n dest[1] = bounding[1];\n if (dest[3] > bounding[3])\n dest[3] = bounding[3];\n }\n }\n else {\n console.warn('[Urplfanze:Bounding] cannot sum bounding');\n }\n },\n bind: (bounding, tmpBounding) => {\n if (typeof tmpBounding[0] !== 'undefined' &&\n typeof tmpBounding[1] !== 'undefined' &&\n typeof tmpBounding[2] !== 'undefined' &&\n typeof tmpBounding[3] !== 'undefined') {\n bounding.x = tmpBounding[0];\n bounding.y = tmpBounding[1];\n bounding.width = tmpBounding[2] - tmpBounding[0];\n bounding.height = tmpBounding[3] - tmpBounding[1];\n bounding.cx = bounding.x + bounding.width / 2;\n bounding.cy = bounding.y + bounding.height / 2;\n }\n else {\n console.warn('[Urplfanze:Bounding] cannot bind bounding');\n }\n },\n};\nclass Adapt extends Modifier_1.Modifier {\n constructor(args) {\n super();\n this.mode = args.mode || EAdaptMode.Fill;\n this.rect = args.rect;\n }\n apply(buffer, bClosed) {\n return Adapt.adapt(buffer, this.mode, this.rect);\n }\n /**\n * Return adapted buffer between [-1,-1] and [1,1]\n *\n * @public\n * @static\n * @param {Float32Array} input\n * @param {EAdaptMode} mode\n * @returns {Float32Array}\n * @memberof ShapeBuffer\n */\n static adapt(input, mode, rect) {\n if (mode === EAdaptMode.None)\n return Float32Array.from(input);\n const output = new Float32Array(input.length);\n if (!rect) {\n rect = Adapt.getBounding(input);\n }\n const scale = rect.width >= 2 || rect.height >= 2 || (mode >= EAdaptMode.Fill && (rect.width < 2 || rect.height < 2))\n ? 2 / Math.max(rect.width, rect.height)\n : 1;\n const translateX = mode >= EAdaptMode.Center ? rect.cx : 0;\n const translateY = mode >= EAdaptMode.Center ? rect.cy : 0;\n for (let i = 0, len = input.length; i < len; i += 2) {\n output[i] = (input[i] - translateX) * scale;\n output[i + 1] = (input[i + 1] - translateY) * scale;\n }\n return output;\n }\n /**\n * Get buffer bounding\n *\n * @static\n * @param {Float32Array | Array} buffer\n * @returns {IShapeBounding}\n * @memberof ShapePrimitive\n */\n static getBounding(buffer, bounding) {\n if (typeof bounding === 'undefined')\n bounding = exports.Bounding.empty();\n const tmp_bounding = [undefined, undefined, undefined, undefined];\n for (let i = 0, len = buffer.length; i < len; i += 2) {\n exports.Bounding.add(tmp_bounding, buffer[i], buffer[i + 1]);\n }\n exports.Bounding.bind(bounding, tmp_bounding);\n return bounding;\n }\n}\nexports.Adapt = Adapt;\nAdapt.MODES = EAdaptMode;\n//# sourceMappingURL=Adapt.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Modifier = void 0;\nclass Modifier {\n}\nexports.Modifier = Modifier;\n//# sourceMappingURL=Modifier.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.distributePointsInBuffer = exports.interpolate = exports.prepareBufferForInterpolation = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.relativeClamp = exports.clamp = exports.lerp = exports.toRadians = exports.toDegrees = exports.now = void 0;\nconst SimplexNoise = require(\"simplex-noise\");\nconst repetitions_1 = require(\"./types/repetitions\");\nconst Vec2_1 = require(\"./math/Vec2\");\n// isDef: (object: any): boolean => typeof object !== 'undefined' && object !== null,\nconst measurement = typeof performance !== 'undefined' ? performance : Date;\n/**\n * Get current timestamp in milliseconds\n *\n * @category Utilities\n * @returns {number}\n */\nfunction now() {\n return measurement.now();\n}\nexports.now = now;\n// aOr: (...args: Array): any => {\n// \tfor (let i = 0; i < args.length; i++) if (Utilities.isDef(args[i])) return args[i]\n// },\n/**\n * Convert number from radians to degrees\n *\n * @category Utilities\n *\n * @example\n * ```javascript\n * Urpflanze.toDegrees(Math.PI) // 180\n * ```\n *\n * @param {number} radians\n * @returns {number}\n */\nfunction toDegrees(radians) {\n return (radians * 180) / Math.PI;\n}\nexports.toDegrees = toDegrees;\n/**\n * Convert angle from degrees to radians\n * @example\n * ```javascript\n * Urpflanze.toRadians(180) // 3.141592653589793\n * ```\n *\n * @category Utilities\n * @param {number} degrees\n * @returns {number}\n */\nfunction toRadians(degrees) {\n return (degrees * Math.PI) / 180;\n}\nexports.toRadians = toRadians;\n// perf: (name: string, callback: any, log: boolean = false): number => {\n// \tconst t1 = now()\n// \tcallback()\n// \tconst t2 = now()\n// \tlog && console.log('perf ' + name + ': ' + (t2 - t1))\n// \treturn t2 - t1\n// }\n/**\n * Linear interpolation from `a` when `i` as 0 an `b` when `i' as 1\n *\n * @category Utilities\n * @param {number} a\n * @param {number} b\n * @param {number} i\n * @returns {number}\n */\nfunction lerp(a, b, i) {\n return (1 - i) * a + i * b;\n}\nexports.lerp = lerp;\n/**\n * Return number between min and max\n *\n * @category Utilities\n * @example\n * ```javascript\n * Urpflanze.clamp(0, 1, 1.2) // 1\n * Urpflanze.clamp(0, 1, -2) // 0\n * ```\n * @param {number} min\n * @param {number} max\n * @param {number} value\n * @returns {number}\n */\nfunction clamp(min, max, value) {\n return value <= min ? min : value >= max ? max : value;\n}\nexports.clamp = clamp;\n/**\n * Map number between refMin e refMax from min and max\n *\n * @category Utilities\n *\n * @example\n * ```javascript\n * Urpflanze.relativeClamp(0, 1, 0.5, 100, 200) // 150\n * ```\n *\n * @param {number} refMin\n * @param {number} refMax\n * @param {number} value\n * @param {number} toMin\n * @param {number} toMax\n * @returns {number}\n */\nfunction relativeClamp(refMin, refMax, value, toMin, toMax) {\n return clamp(toMin, toMax, ((value - refMin) / (refMax - refMin)) * (toMax - toMin) + toMin);\n}\nexports.relativeClamp = relativeClamp;\n/**\n * @internal\n * @ignore\n */\nconst noises = {\n random: new SimplexNoise(Math.random),\n};\n/**\n * SimplexNoise\n * Use 'random' as seed property for random seed.\n * Return value between -1 and 1\n *\n * @category Utilities\n *\n * @param {string} [seed='random']\n * @param {number} [x=0]\n * @param {number} [y=0]\n * @param {number} [z=0]\n * @returns {number} between -1 and 1\n */\nfunction noise(seed = 'random', x = 0, y = 0, z = 0) {\n if (typeof noises[seed] === 'undefined') {\n noises[seed] = new SimplexNoise(seed);\n }\n return noises[seed].noise3D(x, y, z);\n}\nexports.noise = noise;\n/**\n * Random number generator\n */\nconst randoms = {};\n/**\n * random number generator\n * @param seed\n * @returns\n */\nfunction random(seed, min = 0, max = 1, decimals) {\n const key = seed + '';\n if (typeof randoms[key] === 'undefined') {\n const seed = xmur3(key);\n randoms[key] = sfc32(seed(), seed(), seed(), seed());\n }\n const value = min + randoms[key]() * (max - min);\n return typeof decimals !== 'undefined' ? Math.round(value * 10 ** decimals) / 10 ** decimals : value;\n}\nexports.random = random;\n/**\n *\n * @internal\n * @param str\n * @returns\n */\nfunction xmur3(str) {\n let i = 0, h = 1779033703 ^ str.length;\n for (; i < str.length; i++)\n (h = Math.imul(h ^ str.charCodeAt(i), 3432918353)), (h = (h << 13) | (h >>> 19));\n return function () {\n h = Math.imul(h ^ (h >>> 16), 2246822507);\n h = Math.imul(h ^ (h >>> 13), 3266489909);\n return (h ^= h >>> 16) >>> 0;\n };\n}\n/**\n * @internal\n * @param a\n * @param b\n * @param c\n * @param d\n * @returns\n */\nfunction sfc32(a, b, c, d) {\n return function () {\n a >>>= 0;\n b >>>= 0;\n c >>>= 0;\n d >>>= 0;\n let t = (a + b) | 0;\n a = b ^ (b >>> 9);\n b = (c + (c << 3)) | 0;\n c = (c << 21) | (c >>> 11);\n d = (d + 1) | 0;\n t = (t + d) | 0;\n c = (c + t) | 0;\n return (t >>> 0) / 4294967296;\n };\n}\n/**\n * Return angle (atan) from offset (or center) for matrix repetition.\n * Offset is array between [-1, -1] and [1, 1].\n * The return value is between -Math.PI / 2 and Math.PI / 2\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter\n * @returns {number} between -Math.PI / 2 and Math.PI / 2\n */\nfunction angleFromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [(repetition.col.count - 1) / 2, (repetition.row.count - 1) / 2];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const x = repetition.col.index - 1 - centerMatrix[0];\n const y = repetition.row.index - 1 - centerMatrix[1];\n return x === 0 ? 0 : Math.atan(y / x);\n }\n return (repetition.angle - Math.PI) / 2;\n}\nexports.angleFromRepetition = angleFromRepetition;\n/**\n * Return angle (atan2, 4 quadrants) from offset (or center) for matrix repetition.\n * Offset is array between [-1, -1] and [1, 1].\n * The return value is between -Math.PI an Math.PI\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter\n * @returns {number} between -Math.PI an Math.PI\n */\nfunction angle2FromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [(repetition.col.count - 1) / 2, (repetition.row.count - 1) / 2];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const x = repetition.col.index - 1 - centerMatrix[0];\n const y = repetition.row.index - 1 - centerMatrix[1];\n return x === 0 ? 0 : Math.atan2(y, x);\n }\n return repetition.angle - Math.PI;\n}\nexports.angle2FromRepetition = angle2FromRepetition;\n/**\n * Return distance from offset (or center) for matrix repetition.\n * The return value is between 0 and 1\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter offset relative to distance prop\n * @returns {number} between 0 and 1\n */\nfunction distanceFromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [0.5, 0.5];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const current = [repetition.col.offset, repetition.row.offset];\n return Vec2_1.default.distance(current, centerMatrix);\n }\n return 1;\n}\nexports.distanceFromRepetition = distanceFromRepetition;\n/// Interpolation\n/**\n *\n * @param from\n * @param to\n * @returns\n */\nfunction prepareBufferForInterpolation(from, to) {\n const fromBufferLength = from.length;\n const toBufferLength = to.length;\n if (fromBufferLength === toBufferLength) {\n return [from, to];\n }\n const maxBufferLength = fromBufferLength > toBufferLength ? fromBufferLength : toBufferLength;\n const difference = Math.abs(fromBufferLength - toBufferLength);\n const minBufferLength = maxBufferLength - difference;\n /////\n const b = fromBufferLength < toBufferLength ? to : from;\n const t = fromBufferLength < toBufferLength ? from : to;\n const a = distributePointsInBuffer(t, Math.floor(difference / 2));\n // a[maxBufferLength - 2] = t[minBufferLength - 2]\n // a[maxBufferLength - 1] = t[minBufferLength - 1]\n return fromBufferLength > toBufferLength ? [b, a] : [a, b];\n}\nexports.prepareBufferForInterpolation = prepareBufferForInterpolation;\n/**\n *\n * @param from\n * @param to\n * @param offset\n * @returns\n */\nfunction interpolate(from, to, initialOffset = 0.5) {\n const [a, b] = prepareBufferForInterpolation(from, to);\n const maxBufferLength = Math.max(a.length, b.length);\n const offset = typeof initialOffset === 'number' ? [initialOffset] : initialOffset;\n const maxPoints = maxBufferLength / 2;\n if (offset.length !== maxPoints) {\n const tl = offset.length;\n for (let i = 0; i < maxPoints; i++) {\n offset[i] = offset[i % tl];\n }\n }\n ////\n const result = new Float32Array(maxBufferLength);\n for (let i = 0, off = 0; i < maxBufferLength; i += 2, off++) {\n result[i] = (1 - offset[off]) * a[i] + offset[off] * b[i];\n result[i + 1] = (1 - offset[off]) * a[i + 1] + offset[off] * b[i + 1];\n }\n return result;\n}\nexports.interpolate = interpolate;\nfunction distributePointsInBuffer(buffer, count) {\n const bufferLen = buffer.length;\n const pointsLen = bufferLen / 2;\n const finalBufferLength = (pointsLen + count) * 2;\n const edges = pointsLen - 1;\n if (edges > 1) {\n const lastPoint = bufferLen - 2;\n const newPointsOnEdge = Math.floor(count / edges);\n const bufferWithPointsEveryEdge = bufferLen + newPointsOnEdge * lastPoint;\n let remainingPoints = (finalBufferLength - bufferWithPointsEveryEdge) / 2;\n const edgeRemainingIndex = Math.round(edges / remainingPoints);\n const result = new Float32Array(finalBufferLength);\n for (let i = 0, edgeIndex = 0, r = 0; i < lastPoint; i += 2, edgeIndex++, r += 2) {\n const ax = buffer[i];\n const ay = buffer[i + 1];\n const bx = buffer[i + 2];\n const by = buffer[i + 3];\n result[r] = ax;\n result[r + 1] = ay;\n const addReminingPoints = remainingPoints > 0 && (edgeIndex % edgeRemainingIndex === 0 || i === lastPoint - 2);\n const currentPointsOnEdge = newPointsOnEdge + (addReminingPoints ? 1 : 0);\n const newPointOffset = 1 / (currentPointsOnEdge + 1);\n for (let h = 0; h < currentPointsOnEdge; h++, r += 2) {\n const o = newPointOffset * (h + 1);\n result[r + 2] = (1 - o) * ax + o * bx;\n result[r + 3] = (1 - o) * ay + o * by;\n }\n if (addReminingPoints) {\n remainingPoints--;\n }\n }\n result[finalBufferLength - 2] = buffer[bufferLen - 2];\n result[finalBufferLength - 1] = buffer[bufferLen - 1];\n return result;\n }\n const result = new Float32Array(finalBufferLength);\n for (let i = 0; i < finalBufferLength; i += 2) {\n result[i] = buffer[i % bufferLen];\n result[i + 1] = buffer[(i + 1) % bufferLen];\n }\n return result;\n}\nexports.distributePointsInBuffer = distributePointsInBuffer;\n//# sourceMappingURL=Utilities.js.map","/*\n * A fast javascript implementation of simplex noise by Jonas Wagner\n\nBased on a speed-improved simplex noise algorithm for 2D, 3D and 4D in Java.\nWhich is based on example code by Stefan Gustavson (stegu@itn.liu.se).\nWith Optimisations by Peter Eastman (peastman@drizzle.stanford.edu).\nBetter rank ordering method by Stefan Gustavson in 2012.\n\n\n Copyright (c) 2018 Jonas Wagner\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n(function() {\n 'use strict';\n\n var F2 = 0.5 * (Math.sqrt(3.0) - 1.0);\n var G2 = (3.0 - Math.sqrt(3.0)) / 6.0;\n var F3 = 1.0 / 3.0;\n var G3 = 1.0 / 6.0;\n var F4 = (Math.sqrt(5.0) - 1.0) / 4.0;\n var G4 = (5.0 - Math.sqrt(5.0)) / 20.0;\n\n function SimplexNoise(randomOrSeed) {\n var random;\n if (typeof randomOrSeed == 'function') {\n random = randomOrSeed;\n }\n else if (randomOrSeed) {\n random = alea(randomOrSeed);\n } else {\n random = Math.random;\n }\n this.p = buildPermutationTable(random);\n this.perm = new Uint8Array(512);\n this.permMod12 = new Uint8Array(512);\n for (var i = 0; i < 512; i++) {\n this.perm[i] = this.p[i & 255];\n this.permMod12[i] = this.perm[i] % 12;\n }\n\n }\n SimplexNoise.prototype = {\n grad3: new Float32Array([1, 1, 0,\n -1, 1, 0,\n 1, -1, 0,\n\n -1, -1, 0,\n 1, 0, 1,\n -1, 0, 1,\n\n 1, 0, -1,\n -1, 0, -1,\n 0, 1, 1,\n\n 0, -1, 1,\n 0, 1, -1,\n 0, -1, -1]),\n grad4: new Float32Array([0, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1,\n 0, -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1,\n 1, 0, 1, 1, 1, 0, 1, -1, 1, 0, -1, 1, 1, 0, -1, -1,\n -1, 0, 1, 1, -1, 0, 1, -1, -1, 0, -1, 1, -1, 0, -1, -1,\n 1, 1, 0, 1, 1, 1, 0, -1, 1, -1, 0, 1, 1, -1, 0, -1,\n -1, 1, 0, 1, -1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, -1,\n 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0,\n -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1, 0]),\n noise2D: function(xin, yin) {\n var permMod12 = this.permMod12;\n var perm = this.perm;\n var grad3 = this.grad3;\n var n0 = 0; // Noise contributions from the three corners\n var n1 = 0;\n var n2 = 0;\n // Skew the input space to determine which simplex cell we're in\n var s = (xin + yin) * F2; // Hairy factor for 2D\n var i = Math.floor(xin + s);\n var j = Math.floor(yin + s);\n var t = (i + j) * G2;\n var X0 = i - t; // Unskew the cell origin back to (x,y) space\n var Y0 = j - t;\n var x0 = xin - X0; // The x,y distances from the cell origin\n var y0 = yin - Y0;\n // For the 2D case, the simplex shape is an equilateral triangle.\n // Determine which simplex we are in.\n var i1, j1; // Offsets for second (middle) corner of simplex in (i,j) coords\n if (x0 > y0) {\n i1 = 1;\n j1 = 0;\n } // lower triangle, XY order: (0,0)->(1,0)->(1,1)\n else {\n i1 = 0;\n j1 = 1;\n } // upper triangle, YX order: (0,0)->(0,1)->(1,1)\n // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and\n // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where\n // c = (3-sqrt(3))/6\n var x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords\n var y1 = y0 - j1 + G2;\n var x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords\n var y2 = y0 - 1.0 + 2.0 * G2;\n // Work out the hashed gradient indices of the three simplex corners\n var ii = i & 255;\n var jj = j & 255;\n // Calculate the contribution from the three corners\n var t0 = 0.5 - x0 * x0 - y0 * y0;\n if (t0 >= 0) {\n var gi0 = permMod12[ii + perm[jj]] * 3;\n t0 *= t0;\n n0 = t0 * t0 * (grad3[gi0] * x0 + grad3[gi0 + 1] * y0); // (x,y) of grad3 used for 2D gradient\n }\n var t1 = 0.5 - x1 * x1 - y1 * y1;\n if (t1 >= 0) {\n var gi1 = permMod12[ii + i1 + perm[jj + j1]] * 3;\n t1 *= t1;\n n1 = t1 * t1 * (grad3[gi1] * x1 + grad3[gi1 + 1] * y1);\n }\n var t2 = 0.5 - x2 * x2 - y2 * y2;\n if (t2 >= 0) {\n var gi2 = permMod12[ii + 1 + perm[jj + 1]] * 3;\n t2 *= t2;\n n2 = t2 * t2 * (grad3[gi2] * x2 + grad3[gi2 + 1] * y2);\n }\n // Add contributions from each corner to get the final noise value.\n // The result is scaled to return values in the interval [-1,1].\n return 70.0 * (n0 + n1 + n2);\n },\n // 3D simplex noise\n noise3D: function(xin, yin, zin) {\n var permMod12 = this.permMod12;\n var perm = this.perm;\n var grad3 = this.grad3;\n var n0, n1, n2, n3; // Noise contributions from the four corners\n // Skew the input space to determine which simplex cell we're in\n var s = (xin + yin + zin) * F3; // Very nice and simple skew factor for 3D\n var i = Math.floor(xin + s);\n var j = Math.floor(yin + s);\n var k = Math.floor(zin + s);\n var t = (i + j + k) * G3;\n var X0 = i - t; // Unskew the cell origin back to (x,y,z) space\n var Y0 = j - t;\n var Z0 = k - t;\n var x0 = xin - X0; // The x,y,z distances from the cell origin\n var y0 = yin - Y0;\n var z0 = zin - Z0;\n // For the 3D case, the simplex shape is a slightly irregular tetrahedron.\n // Determine which simplex we are in.\n var i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords\n var i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords\n if (x0 >= y0) {\n if (y0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 1;\n k2 = 0;\n } // X Y Z order\n else if (x0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n } // X Z Y order\n else {\n i1 = 0;\n j1 = 0;\n k1 = 1;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n } // Z X Y order\n }\n else { // x0 y0) rankx++;\n else ranky++;\n if (x0 > z0) rankx++;\n else rankz++;\n if (x0 > w0) rankx++;\n else rankw++;\n if (y0 > z0) ranky++;\n else rankz++;\n if (y0 > w0) ranky++;\n else rankw++;\n if (z0 > w0) rankz++;\n else rankw++;\n var i1, j1, k1, l1; // The integer offsets for the second simplex corner\n var i2, j2, k2, l2; // The integer offsets for the third simplex corner\n var i3, j3, k3, l3; // The integer offsets for the fourth simplex corner\n // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order.\n // Many values of c will never occur, since e.g. x>y>z>w makes x= 3 ? 1 : 0;\n j1 = ranky >= 3 ? 1 : 0;\n k1 = rankz >= 3 ? 1 : 0;\n l1 = rankw >= 3 ? 1 : 0;\n // Rank 2 denotes the second largest coordinate.\n i2 = rankx >= 2 ? 1 : 0;\n j2 = ranky >= 2 ? 1 : 0;\n k2 = rankz >= 2 ? 1 : 0;\n l2 = rankw >= 2 ? 1 : 0;\n // Rank 1 denotes the second smallest coordinate.\n i3 = rankx >= 1 ? 1 : 0;\n j3 = ranky >= 1 ? 1 : 0;\n k3 = rankz >= 1 ? 1 : 0;\n l3 = rankw >= 1 ? 1 : 0;\n // The fifth corner has all coordinate offsets = 1, so no need to compute that.\n var x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords\n var y1 = y0 - j1 + G4;\n var z1 = z0 - k1 + G4;\n var w1 = w0 - l1 + G4;\n var x2 = x0 - i2 + 2.0 * G4; // Offsets for third corner in (x,y,z,w) coords\n var y2 = y0 - j2 + 2.0 * G4;\n var z2 = z0 - k2 + 2.0 * G4;\n var w2 = w0 - l2 + 2.0 * G4;\n var x3 = x0 - i3 + 3.0 * G4; // Offsets for fourth corner in (x,y,z,w) coords\n var y3 = y0 - j3 + 3.0 * G4;\n var z3 = z0 - k3 + 3.0 * G4;\n var w3 = w0 - l3 + 3.0 * G4;\n var x4 = x0 - 1.0 + 4.0 * G4; // Offsets for last corner in (x,y,z,w) coords\n var y4 = y0 - 1.0 + 4.0 * G4;\n var z4 = z0 - 1.0 + 4.0 * G4;\n var w4 = w0 - 1.0 + 4.0 * G4;\n // Work out the hashed gradient indices of the five simplex corners\n var ii = i & 255;\n var jj = j & 255;\n var kk = k & 255;\n var ll = l & 255;\n // Calculate the contribution from the five corners\n var t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0;\n if (t0 < 0) n0 = 0.0;\n else {\n var gi0 = (perm[ii + perm[jj + perm[kk + perm[ll]]]] % 32) * 4;\n t0 *= t0;\n n0 = t0 * t0 * (grad4[gi0] * x0 + grad4[gi0 + 1] * y0 + grad4[gi0 + 2] * z0 + grad4[gi0 + 3] * w0);\n }\n var t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1;\n if (t1 < 0) n1 = 0.0;\n else {\n var gi1 = (perm[ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]]] % 32) * 4;\n t1 *= t1;\n n1 = t1 * t1 * (grad4[gi1] * x1 + grad4[gi1 + 1] * y1 + grad4[gi1 + 2] * z1 + grad4[gi1 + 3] * w1);\n }\n var t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2;\n if (t2 < 0) n2 = 0.0;\n else {\n var gi2 = (perm[ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]]] % 32) * 4;\n t2 *= t2;\n n2 = t2 * t2 * (grad4[gi2] * x2 + grad4[gi2 + 1] * y2 + grad4[gi2 + 2] * z2 + grad4[gi2 + 3] * w2);\n }\n var t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3;\n if (t3 < 0) n3 = 0.0;\n else {\n var gi3 = (perm[ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]]] % 32) * 4;\n t3 *= t3;\n n3 = t3 * t3 * (grad4[gi3] * x3 + grad4[gi3 + 1] * y3 + grad4[gi3 + 2] * z3 + grad4[gi3 + 3] * w3);\n }\n var t4 = 0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4;\n if (t4 < 0) n4 = 0.0;\n else {\n var gi4 = (perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32) * 4;\n t4 *= t4;\n n4 = t4 * t4 * (grad4[gi4] * x4 + grad4[gi4 + 1] * y4 + grad4[gi4 + 2] * z4 + grad4[gi4 + 3] * w4);\n }\n // Sum up and scale the result to cover the range [-1,1]\n return 27.0 * (n0 + n1 + n2 + n3 + n4);\n }\n };\n\n function buildPermutationTable(random) {\n var i;\n var p = new Uint8Array(256);\n for (i = 0; i < 256; i++) {\n p[i] = i;\n }\n for (i = 0; i < 255; i++) {\n var r = i + ~~(random() * (256 - i));\n var aux = p[i];\n p[i] = p[r];\n p[r] = aux;\n }\n return p;\n }\n SimplexNoise._buildPermutationTable = buildPermutationTable;\n\n function alea() {\n // Johannes Baagøe , 2010\n var s0 = 0;\n var s1 = 0;\n var s2 = 0;\n var c = 1;\n\n var mash = masher();\n s0 = mash(' ');\n s1 = mash(' ');\n s2 = mash(' ');\n\n for (var i = 0; i < arguments.length; i++) {\n s0 -= mash(arguments[i]);\n if (s0 < 0) {\n s0 += 1;\n }\n s1 -= mash(arguments[i]);\n if (s1 < 0) {\n s1 += 1;\n }\n s2 -= mash(arguments[i]);\n if (s2 < 0) {\n s2 += 1;\n }\n }\n mash = null;\n return function() {\n var t = 2091639 * s0 + c * 2.3283064365386963e-10; // 2^-32\n s0 = s1;\n s1 = s2;\n return s2 = t - (c = t | 0);\n };\n }\n function masher() {\n var n = 0xefc8249d;\n return function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n }\n\n // amd\n if (typeof define !== 'undefined' && define.amd) define(function() {return SimplexNoise;});\n // common js\n if (typeof exports !== 'undefined') exports.SimplexNoise = SimplexNoise;\n // browser\n else if (typeof window !== 'undefined') window.SimplexNoise = SimplexNoise;\n // nodejs\n if (typeof module !== 'undefined') {\n module.exports = SimplexNoise;\n }\n\n})();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Shape = void 0;\nconst Scene_1 = require(\"../Scene\");\nconst SceneChild_1 = require(\"../SceneChild\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\n/**\n * Container of ShapeBase or Group, it applies transformations on each repetition\n *\n * @category Core.Shapes\n */\nclass Shape extends ShapeBase_1.ShapeBase {\n /**\n * Creates an instance of Shape.\n *\n * @param {ShapeSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'Shape';\n super(settings);\n if (settings.shape instanceof SceneChild_1.SceneChild) {\n this.shape = settings.shape;\n }\n else {\n console.warn(\"[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\\nYou passed:\", settings.shape);\n }\n this.shapeUseParent = !!settings.shapeUseParent;\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n */\n isStatic() {\n // return super.isStatic() && !this.shapeUseParent\n return super.isStatic() && (this.shape ? this.shape.isStatic() : true);\n }\n /**\n * Check if shape has static index\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return super.isStaticIndexed() && (this.shape ? this.shape.isStaticIndexed() : true);\n }\n /**\n * Find shape by id or name\n *\n * @param {number | string} idOrName\n * @returns {(SceneChild | null)}\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n if (this.shape)\n return this.shape.find(idOrName);\n return null;\n }\n /**\n * Return length of buffer\n *\n * @param {PropArguments} propArguments\n * @returns {number}\n */\n getBufferLength(propArguments) {\n if (this.bStatic && this.buffer && this.buffer.length > 0)\n return this.buffer.length;\n const childBufferLength = this.shape ? this.shape.getBufferLength(propArguments) : 0;\n return childBufferLength * this.getRepetitionCount();\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape) {\n if (this.shapeUseParent || this.shape.generateId !== generateId) {\n if (this.shapeUseParent) {\n this.shape.clearBuffer(true, false);\n }\n this.shape.generate(generateId, false, propArguments);\n }\n return this.shape.getBuffer();\n }\n return Shape.EMPTY_BUFFER;\n }\n /**\n * Return bounding\n *\n * @param {boolean} bDirectSceneChild\n * @returns {IShapeBounding}\n */\n getShapeBounding() {\n if (this.shape) {\n return this.shape.getBounding();\n }\n return this.bounding; // empty bounding defined in ShapeBase\n }\n /**\n * Add to indexed buffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n const parentBufferIndex = {\n shape: this,\n frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n };\n for (let i = 0, len = childIndexedBuffer.length; i < len; i++) {\n const currentIndexed = { ...childIndexedBuffer[i] };\n const parent = currentIndexed.parent\n ? Shape.setIndexedParent(currentIndexed.parent, parentBufferIndex)\n : parentBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n }\n }\n }\n /**\n * Set parent of indexed\n *\n * @static\n * @param {(IBufferIndex )} current\n * @param {IBufferIndex} parent\n * @returns {(IBufferIndex )}\n */\n static setIndexedParent(current, parent) {\n const index = {\n ...current,\n };\n index.parent = current.parent ? Shape.setIndexedParent(current.parent, parent) : parent;\n return index;\n }\n /**\n * Set shape\n *\n * @param {(SceneChild | undefined)} [shape]\n */\n setShape(shape) {\n if (typeof shape === 'undefined') {\n this.shape = undefined;\n this.clearBuffer(true, true);\n }\n else {\n this.scene && Scene_1.Scene.propagateToChilden(shape, this.scene);\n this.shape = shape;\n this.shape.clearBuffer(true, true);\n }\n }\n}\nexports.Shape = Shape;\n//# sourceMappingURL=Shape.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapePrimitive = void 0;\nconst glme = require(\"../math/gl-matrix-extensions\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\nconst Modifier_1 = require(\"../modifiers/Modifier\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\n/**\n * @category Core.Abstract\n */\nclass ShapePrimitive extends ShapeBase_1.ShapeBase {\n /**\n * Creates an instance of ShapePrimitive.\n *\n * @param {IShapePrimitiveSettings} [settings={}]\n */\n constructor(settings = {}) {\n var _a;\n super(settings);\n /**\n * Contain the bounding of the last generated buffer\n *\n * @type {IShapeBounding}\n */\n this.currentGenerationPrimitiveBounding = Adapt_1.Bounding.empty();\n this.props.sideLength =\n typeof settings.sideLength === 'undefined'\n ? undefined\n : typeof settings.sideLength === 'function'\n ? settings.sideLength\n : glme.toVec2(settings.sideLength);\n this.drawer = settings.drawer || {};\n this.modifiers = settings.modifiers;\n this.bClosed = (_a = settings.bClosed) !== null && _a !== void 0 ? _a : true;\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n * @memberof ShapePrimitive\n */\n isStatic() {\n return typeof this.props.sideLength !== 'function' && super.isStatic();\n }\n /**\n * Return sideLength for current repetition\n *\n * @param propArguments\n * @returns\n */\n getRepetitionSideLength(propArguments) {\n if (this.bStatic) {\n // not set default value into constructor because it can be overridden by group\n if (typeof this.props.sideLength === 'undefined') {\n this.props.sideLength = [50, 50];\n }\n else if (typeof this.props.sideLength === 'number') {\n this.props.sideLength = [this.props.sideLength, this.props.sideLength];\n }\n return this.props.sideLength;\n }\n return glme.toVec2(this.getProp('sideLength', propArguments, [50, 50]));\n }\n /**\n * Apply modifiers on single repetition buffer\n *\n * @param buffer\n * @returns\n */\n applyModifiers(buffer, propArguments) {\n if (typeof this.modifiers === 'undefined')\n return buffer;\n let modified = buffer;\n const modifiers = Array.isArray(this.modifiers) ? this.modifiers : [this.modifiers];\n for (let i = 0, len = modifiers.length; i < len; i++) {\n const modifier = modifiers[i] instanceof Modifier_1.Modifier\n ? modifiers[i]\n : modifiers[i](propArguments);\n //@ts-ignore\n modified = modifier.apply(modified, this.bClosed, this);\n }\n return modified;\n }\n /**\n * Return a bounding of generated buffer if is direct scene child\n *\n * @returns {IShapeBounding}\n * @memberof ShapePrimitive\n */\n getShapeBounding() {\n return this.currentGenerationPrimitiveBounding;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n const index = {\n shape: this,\n frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n };\n this.indexedBuffer.push(index);\n }\n /**\n * Return bClosed\n *\n * @returns {boolean}\n * @memberof ShapePrimitive\n */\n isClosed() {\n return this.bClosed;\n }\n /**\n * Set bClosed\n *\n * @param {boolean} bClosed\n * @memberof ShapePrimitive\n */\n setClosed(bClosed) {\n this.bClosed = bClosed;\n }\n}\nexports.ShapePrimitive = ShapePrimitive;\n//# sourceMappingURL=ShapePrimitive.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeLoop = void 0;\nconst math_1 = require(\"../math\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst ShapePrimitive_1 = require(\"../shapes/ShapePrimitive\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\n/**\n * Shape Loop\n *\n * @category Core.Shapes\n * @public\n * @class ShapeLoop\n * @extends {ShapePrimitive}\n */\nclass ShapeLoop extends ShapePrimitive_1.ShapePrimitive {\n /**\n * Creates an instance of ShapeLoop.\n *\n * @param {IShapeLoopSettings} [settings={}]\n * @param {boolean} [bPreventGeneration=false]\n */\n constructor(settings = {}, bPreventGeneration = false) {\n settings.type = settings.type || 'ShapeLoop';\n super(settings);\n this.loopDependencies = (settings.loopDependencies || []).concat('sideLength');\n this.props.loop = settings.loop;\n if (!bPreventGeneration) {\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: math_1.PI2 / 10,\n vertex: () => [0, 0],\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n }\n /**\n * Check if currentOrSingleLoopBuffer is static\n *\n * @returns {boolean}\n */\n isStaticLoop() {\n if (this.loopDependencies.includes('propArguments'))\n return false;\n for (let i = 0, len = this.loopDependencies.length; i < len; i++)\n if (typeof this.props[this.loopDependencies[i]] === 'function')\n return false;\n return true;\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n */\n isStatic() {\n return this.bStaticLoop && super.isStatic();\n }\n /**\n * Check if shape has static indexed\n * The number of vertices is defined by number of loop iteration\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n // return this.bStaticLoop && super.isStaticIndexed()\n return (super.isStaticIndexed() &&\n (typeof this.props.loop !== 'undefined'\n ? typeof this.props.loop.start !== 'function' &&\n typeof this.props.loop.end !== 'function' &&\n typeof this.props.loop.inc !== 'function'\n : true));\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.bStaticLoop = this.isStaticLoop();\n if (bClearIndexed) {\n this.currentOrSingleLoopBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n * Set single or multiple props\n *\n * @param {(Props)} key\n * @param {*} [value]\n * @param {boolean} [bClearIndexed=false]\n */\n setProp(key, value) {\n let bClearIndexed = false;\n const keys = (typeof key === 'string' ? { [key]: value } : key);\n for (let i = this.loopDependencies.length - 1; i >= 0; i--) {\n if (this.loopDependencies[i] in keys) {\n // this.props.loop = undefined\n bClearIndexed = true;\n break;\n }\n }\n if ('loop' in keys) {\n keys.loop = { ...this.props.loop, ...keys.loop };\n bClearIndexed = true;\n }\n super.setProp(keys, value, bClearIndexed);\n }\n /**\n * Return length of buffer\n *\n * @param {PropArguments} [propArguments]\n * @returns {number}\n */\n getBufferLength(propArguments) {\n if (this.bStatic && typeof this.buffer !== 'undefined')\n return this.buffer.length;\n if (this.bStaticLoop && typeof this.currentOrSingleLoopBuffer !== 'undefined')\n return this.currentOrSingleLoopBuffer.length * this.getRepetitionCount();\n const { count } = this.getLoop(propArguments || ShapeBase_1.ShapeBase.getEmptyPropArguments(this));\n return this.getRepetitionCount() * count * 2;\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (!this.bStaticLoop)\n return this.generateLoopBuffer(propArguments);\n if (typeof this.props.sideLength === 'function' || typeof this.currentOrSingleLoopBuffer === 'undefined')\n this.currentOrSingleLoopBuffer = this.generateLoopBuffer(propArguments);\n return this.currentOrSingleLoopBuffer;\n }\n /**\n * Generate loop buffer\n *\n * @protected\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateLoopBuffer(propArguments) {\n const { start, inc, /*end,*/ count } = this.getLoop(propArguments);\n const sideLength = this.getRepetitionSideLength(propArguments);\n const getVertex = (this.props.loop && this.props.loop.vertex ? this.props.loop.vertex : this.loop.vertex);\n const shapeLoop = {\n index: 0,\n offset: 0,\n current: 0,\n count: count,\n };\n const vertexLength = shapeLoop.count;\n const bufferLength = vertexLength * 2;\n const currentOrSingleLoopBuffer = new Float32Array(bufferLength);\n for (let i = 0, j = 0; i < vertexLength; i++, j += 2) {\n const current = start + inc * i;\n const offset = shapeLoop.count > 1 ? i / (shapeLoop.count - 1) : 1;\n // const angle = (end - start) * offset + start\n shapeLoop.current = current;\n shapeLoop.index = i + 1;\n shapeLoop.offset = offset;\n const vertex = getVertex(shapeLoop, propArguments);\n currentOrSingleLoopBuffer[j] = vertex[0];\n currentOrSingleLoopBuffer[j + 1] = vertex[1];\n // currentOrSingleLoopBuffer[j] *= sideLength[0]\n // currentOrSingleLoopBuffer[j + 1] *= sideLength[1]\n // Bounding.add(tmpBounding, currentOrSingleLoopBuffer[j], currentOrSingleLoopBuffer[j + 1])\n }\n const tmpBounding = [undefined, undefined, undefined, undefined];\n const buffer = this.applyModifiers(currentOrSingleLoopBuffer, propArguments);\n for (let i = 0, len = buffer.length; i < len; i += 2) {\n buffer[i] = buffer[i] * sideLength[0];\n buffer[i + 1] = buffer[i + 1] * sideLength[1];\n Adapt_1.Bounding.add(tmpBounding, buffer[i], buffer[i + 1]);\n }\n Adapt_1.Bounding.bind(this.currentGenerationPrimitiveBounding, tmpBounding);\n return buffer;\n }\n /**\n * Return information about a client loop gnerator\n *\n * @public\n * @param {PropArguments} propArguments\n * @returns {ShapeLoopInformation}\n */\n getLoop(propArguments) {\n var _a, _b, _c, _d, _e, _f;\n let start = (_b = (_a = this.props.loop) === null || _a === void 0 ? void 0 : _a.start) !== null && _b !== void 0 ? _b : this.loop.start;\n let end = (_d = (_c = this.props.loop) === null || _c === void 0 ? void 0 : _c.end) !== null && _d !== void 0 ? _d : this.loop.end;\n let inc = (_f = (_e = this.props.loop) === null || _e === void 0 ? void 0 : _e.inc) !== null && _f !== void 0 ? _f : this.loop.inc;\n start = (typeof start === 'function' ? start(propArguments) : start);\n end = (typeof end === 'function' ? end(propArguments) : end);\n inc = (typeof inc === 'function' ? inc(propArguments) : inc);\n const count = Math.ceil((end - start) / inc);\n return { start, end, inc, count: count <= 0 ? 0 : count };\n }\n /**\n * Set shape from loop generator\n *\n * @param {(IShapeLoopGenerator)} [shape]\n */\n setShape(loop) {\n this.setProp('loop', loop);\n }\n /**\n * Get static buffer\n *\n * @param sideLength\n * @returns\n */\n static getBuffer(props) {\n const shape = new this({ ...props, sideLength: props.sideLength || 1 });\n shape.generate();\n return shape.getBuffer() || new Float32Array();\n }\n}\nexports.ShapeLoop = ShapeLoop;\nShapeLoop.PId2 = Math.PI / 2;\n//# sourceMappingURL=ShapeLoop.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeBuffer = void 0;\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst ShapePrimitive_1 = require(\"../shapes/ShapePrimitive\");\n/**\n * @category Core.Shapes\n */\nclass ShapeBuffer extends ShapePrimitive_1.ShapePrimitive {\n /**\n * Creates an instance of ShapeBuffer.\n *\n * @param {IShapeBufferSettings} [settings={}]\n */\n constructor(settings = {}) {\n var _a, _b;\n settings.type = settings.type || 'ShapeBuffer';\n settings.adaptMode = (_a = settings.adaptMode) !== null && _a !== void 0 ? _a : Adapt_1.EAdaptMode.Scale;\n super(settings);\n this.adaptMode = (_b = settings.adaptMode) !== null && _b !== void 0 ? _b : Adapt_1.EAdaptMode.Fill;\n if (typeof settings.shape === 'undefined') {\n console.warn('[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property');\n this.shape = ShapeBuffer.EMPTY_BUFFER;\n }\n else {\n this.shape = typeof settings.shape !== 'function' ? Adapt_1.Adapt.adapt(settings.shape, this.adaptMode) : settings.shape;\n }\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n /**\n * Check shape is static\n *\n * @returns boolean\n */\n isStatic() {\n return typeof this.shape !== 'function' && super.isStatic();\n }\n /**\n * Check shape is static indexed\n *\n * @returns boolean\n */\n isStaticIndexed() {\n return typeof this.shape !== 'function' && super.isStaticIndexed();\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n this.shapeBuffer = undefined;\n }\n /**\n * Apply sideLength on .shape buffer and calculate bounding\n *\n * @protected\n */\n bindBuffer(propArguments) {\n const sideLength = this.getRepetitionSideLength(propArguments);\n const shapeBuffer = this.applyModifiers(Float32Array.from(typeof this.shape === 'function' ? this.shape(propArguments) : this.shape), propArguments);\n const tmpBounding = [undefined, undefined, undefined, undefined];\n for (let i = 0, len = shapeBuffer.length; i < len; i += 2) {\n shapeBuffer[i] = shapeBuffer[i] * sideLength[0];\n shapeBuffer[i + 1] = shapeBuffer[i + 1] * sideLength[1];\n Adapt_1.Bounding.add(tmpBounding, shapeBuffer[i], shapeBuffer[i + 1]);\n }\n Adapt_1.Bounding.bind(this.currentGenerationPrimitiveBounding, tmpBounding);\n this.shapeBuffer = shapeBuffer;\n }\n /**\n * Return length of buffer\n *\n * @param {IPropArguments} propArguments\n * @returns {number}\n */\n getBufferLength( /*propArguments?: IPropArguments*/) {\n if (this.buffer && this.buffer.length > 0)\n return this.buffer.length;\n return this.shape.length * this.getRepetitionCount();\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (typeof this.shapeBuffer === 'undefined' ||\n typeof this.props.sideLength === 'function' ||\n typeof this.shape === 'function') {\n this.bindBuffer(propArguments);\n }\n return this.shapeBuffer;\n }\n /**\n * Set shape\n *\n * @param {(Float32Array)} [shape]\n */\n setShape(shape) {\n this.shape = Adapt_1.Adapt.adapt(shape, this.adaptMode);\n this.clearBuffer(true);\n }\n /**\n * Return adaptMode\n *\n * @returns {EAdaptMode}\n * @memberof ShapeBase\n */\n getAdaptMode() {\n return this.adaptMode;\n }\n /**\n * Get static buffer\n *\n * @param sideLength\n * @returns\n */\n static getBuffer(props = {}) {\n const shape = new this({ ...props, sideLength: props.sideLength || 1 });\n shape.generate();\n return shape.getBuffer() || new Float32Array();\n }\n}\nexports.ShapeBuffer = ShapeBuffer;\n//# sourceMappingURL=ShapeBuffer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeRecursive = void 0;\nconst Shape_1 = require(\"./Shape\");\n/**\n * @category Core.Shapes\n */\nclass ShapeRecursive extends Shape_1.Shape {\n /**\n * Creates an instance of ShapeRecursive.\n *\n * @param {IShapeRecursiveSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'ShapeRecursive';\n super(settings);\n this.props.recursions = settings.recursions || 1;\n this.props.recursionScale = settings.recursionScale || 2;\n this.props.recursionVertex = settings.recursionVertex || 0;\n // this.bInner = settings.bInner ?? false\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n this.shapeUseRecursion = !!settings.shapeUseRecursion;\n // this.currentGenerationRecursiveBounding = Bounding.empty()\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n if (bClearIndexed) {\n this.shapeRecursiveBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n * Set type of recursion\n *\n * @param {boolean} inner\n */\n // public setRecursionnInner(inner: boolean): void {\n // \tthis.bInner = inner\n // \tthis.clearBuffer(true)\n // }\n /**\n *\n * @returns {boolean}\n */\n isStatic() {\n return (typeof this.props.recursions !== 'function' &&\n typeof this.props.recursionScale !== 'function' &&\n typeof this.props.recursionVertex !== 'function' &&\n super.isStatic());\n }\n /**\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return (typeof this.props.recursions !== 'function' &&\n typeof this.props.recursionVertex !== 'function' &&\n super.isStaticIndexed());\n }\n /**\n * Return a buffer of children shape with recursion\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape) {\n if (typeof this.shapeRecursiveBuffer === 'undefined' ||\n this.shapeUseParent ||\n this.shape.generateId !== generateId) {\n this.bindBuffer(generateId, propArguments);\n }\n return this.shapeRecursiveBuffer;\n }\n return Shape_1.Shape.EMPTY_BUFFER;\n }\n /**\n * Generate Recoursive shape buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n */\n bindBuffer(generateId, propArguments) {\n const recursions = Math.floor(this.getProp('recursions', propArguments, 1));\n const recursionVertex = Math.floor(this.getProp('recursionVertex', propArguments, 0));\n const recursionScale = this.getProp('recursionScale', propArguments, 2);\n const childShape = this.shape;\n let currentRecursionRepetition = {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: 1 },\n };\n const recursionPropArguments = {\n ...propArguments,\n recursion: currentRecursionRepetition,\n };\n childShape.generate(generateId, false, recursionPropArguments);\n const firstGenerationChildBuffer = childShape.getBuffer();\n if (recursions <= 1) {\n // this.currentGenerationRecursiveBounding = this.shape.getBounding()\n this.shapeRecursiveBuffer = firstGenerationChildBuffer;\n return;\n }\n let shapeBuffer = firstGenerationChildBuffer;\n const storedRecursion = [currentRecursionRepetition];\n let paretRecursionIndex = 0, added = 1;\n // const tmpBounding = [undefined, undefined, undefined, undefined]\n const singleShapeBufferLength = shapeBuffer.length;\n const realVertexCount = singleShapeBufferLength / 2;\n const singleShapeVertexCount = recursionVertex <= 0 ? realVertexCount : Math.min(recursionVertex, realVertexCount);\n const recursionOffsetMultiplier = recursionVertex === 0 ? 1 : realVertexCount / Math.min(recursionVertex, realVertexCount);\n const recusiveShapeBuffer = new Float32Array(ShapeRecursive.summmation(recursions, singleShapeVertexCount) * singleShapeBufferLength);\n for (let i = 0; i < singleShapeBufferLength; i += 2) {\n recusiveShapeBuffer[i] = shapeBuffer[i];\n recusiveShapeBuffer[i + 1] = shapeBuffer[i + 1];\n // Bounding.add(tmpBounding, recusiveShapeBuffer[i], recusiveShapeBuffer[i + 1])\n }\n for (let currentRecursion = 1; currentRecursion < recursions; currentRecursion++) {\n const level_offset = recursions > 1 ? currentRecursion / (recursions - 1) : 1;\n const currentRecursionVertexCount = ShapeRecursive.summmation(currentRecursion, singleShapeVertexCount);\n const recursionBufferStartIndex = currentRecursionVertexCount * singleShapeBufferLength;\n const parentRecursion = currentRecursion - 1;\n const parentRecursionBufferStartIndex = parentRecursion === 0\n ? 0\n : ShapeRecursive.summmation(parentRecursion, singleShapeVertexCount) * singleShapeBufferLength;\n for (let currentShapeRecursionRepetition = 0, totalRecursionRepetitions = singleShapeVertexCount ** currentRecursion; currentShapeRecursionRepetition < totalRecursionRepetitions; currentShapeRecursionRepetition++, added++) {\n currentRecursionRepetition = {\n index: currentShapeRecursionRepetition + 1,\n offset: totalRecursionRepetitions > 1 ? currentShapeRecursionRepetition / (totalRecursionRepetitions - 1) : 1,\n count: totalRecursionRepetitions,\n level: { index: currentRecursion + 1, offset: level_offset, count: recursions },\n parent: storedRecursion[paretRecursionIndex],\n };\n storedRecursion.push(currentRecursionRepetition);\n if (this.shapeUseRecursion) {\n recursionPropArguments.recursion = currentRecursionRepetition;\n childShape.generate(generateId, false, recursionPropArguments);\n shapeBuffer = childShape.getBuffer();\n }\n const shapeVertexBufferIndex = recursionBufferStartIndex + currentShapeRecursionRepetition * singleShapeBufferLength;\n // const centerVertexIndex = parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2\n const centerVertexIndex = Math.floor(parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2 * recursionOffsetMultiplier);\n const centerX = recusiveShapeBuffer[centerVertexIndex];\n const centerY = recusiveShapeBuffer[centerVertexIndex + 1];\n const currentRecursionScale = recursionScale ** currentRecursion;\n for (let i = 0, len = singleShapeBufferLength; i < len; i += 2) {\n // if (this.bInner) {\n // \tconst parentCurrentVertex =\n // \t\tparentRecursionBufferStartIndex +\n // \t\tMath.floor(currentShapeRecursionRepetition / singleShapeVertexCount) *\n // \t\t\tsingleShapeVertexCount *\n // \t\t\trecursionOffsetMultiplier *\n // \t\t\t2\n // \tconst parentX = recusiveShapeBuffer[parentCurrentVertex + i]\n // \tconst parentY = recusiveShapeBuffer[parentCurrentVertex + i + 1]\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i] = (centerX - parentX) / recursionScale + parentX\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = (centerY - parentY) / recursionScale + parentY\n // const parentX = shapeBuffer[i] / recursionScale ** currentRecursion\n // const parentY = shapeBuffer[i + 1] / recursionScale ** currentRecursion\n // recusiveShapeBuffer[shapeVertexBufferIndex + i] = (centerX - parentX) / recursionScale + parentX\n // recusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = (centerY - parentY) / recursionScale + parentY\n // } else {\n const parentXScaled = shapeBuffer[i] / currentRecursionScale;\n const parentYScaled = shapeBuffer[i + 1] / currentRecursionScale;\n recusiveShapeBuffer[shapeVertexBufferIndex + i] = centerX + parentXScaled;\n recusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = centerY + parentYScaled;\n // }\n // Bounding.add(\n // \ttmpBounding,\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i],\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i + 1]\n // )\n }\n if (added % singleShapeVertexCount === 0) {\n paretRecursionIndex += 1;\n }\n }\n }\n // Bounding.bind(this.currentGenerationRecursiveBounding, tmpBounding)\n this.shapeRecursiveBuffer = recusiveShapeBuffer;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const propArguments = { repetition, shape: this };\n const recursions = Math.floor(this.getProp('recursions', propArguments, 1));\n const recursionVertex = Math.floor(this.getProp('recursionVertex', propArguments, 0));\n // const realFrameLength = ShapeRecursive.summmation(recursions, this.shape.getBufferLength() / 2)\n const bufferIndex = {\n shape: this,\n frameLength: frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n recursion: {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: recursions },\n },\n };\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentRecursionRepetition = {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: recursions },\n };\n const recursionBufferIndex = {\n ...bufferIndex,\n recursion: currentRecursionRepetition,\n };\n const parent = (currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, recursionBufferIndex)\n : recursionBufferIndex);\n this.indexedBuffer.push({\n ...currentIndexed,\n parent,\n });\n }\n if (recursions > 1) {\n const realVertexCount = this.shape.getBufferLength({ ...propArguments, parent: { ...bufferIndex } }) / 2;\n const vertexCount = recursionVertex <= 0 ? realVertexCount : Math.min(recursionVertex, realVertexCount);\n const storedRecursion = this.indexedBuffer.map(indexed => [indexed.parent.recursion]);\n let paretRecursionIndex = 0, added = 1;\n for (let i = 1; i < recursions; i++) {\n const level_offset = recursions > 1 ? i / (recursions - 1) : 1;\n for (let j = 0, len = vertexCount ** i; j < len; j++, added++) {\n const recursionOffset = len > 1 ? j / (len - 1) : 1;\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentRecursionRepetition = {\n index: j + 1,\n offset: recursionOffset,\n count: len,\n level: { index: i + 1, offset: level_offset, count: recursions },\n parent: storedRecursion[childIndexed][paretRecursionIndex],\n };\n const recursionBufferIndex = { ...bufferIndex, recursion: currentRecursionRepetition };\n const parent = currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, recursionBufferIndex)\n : recursionBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n storedRecursion[childIndexed].push(currentRecursionRepetition);\n if (added % vertexCount === 0) {\n paretRecursionIndex += 1;\n }\n }\n }\n }\n }\n }\n }\n /**\n * Retturn summation value\n *\n * @static\n * @param {number} recursion\n * @param {number} vertexCount\n * @returns {number}\n */\n static summmation(recursion, vertexCount) {\n if (recursion === 1)\n return 1;\n let result = 1;\n for (let i = 1; i < recursion; i++)\n result += vertexCount ** i;\n return result;\n }\n /**\n * Empty recursion repetition\n *\n * @static\n * @return {*} {IRecursionRepetition}\n */\n static getEmptyRecursion() {\n return {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: 1, count: 1 },\n };\n }\n}\nexports.ShapeRecursive = ShapeRecursive;\n//# sourceMappingURL=ShapeRecursive.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeFollow = void 0;\nconst Shape_1 = require(\"./Shape\");\n/**\n * @category Core.Shapes\n */\nclass ShapeFollow extends Shape_1.Shape {\n /**\n * Creates an instance of ShapeFollow.\n *\n * @param {IShapeFollowSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'ShapeFollow';\n super(settings);\n this.follow = settings.follow || settings.shape;\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n this.shapeUseFollow = !!settings.shapeUseFollow;\n // this.currentGenerationRecursiveBounding = Bounding.empty()\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n if (bClearIndexed) {\n this.shapeFollowBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n *\n * @returns {boolean}\n */\n isStatic() {\n return (this.follow ? this.follow.isStatic() : true) && super.isStatic();\n }\n /**\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return (this.follow ? this.follow.isStaticIndexed() : true) && super.isStaticIndexed();\n }\n /**\n * Return a buffer of children shape with recursion\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape && this.follow) {\n if (typeof this.shapeFollowBuffer === 'undefined' ||\n this.shapeUseParent ||\n this.shape.generateId !== generateId ||\n this.follow.generateId !== generateId) {\n this.bindBuffer(generateId, propArguments);\n }\n return this.shapeFollowBuffer;\n }\n return Shape_1.Shape.EMPTY_BUFFER;\n }\n /**\n * Generate Recoursive shape buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n */\n bindBuffer(generateId, propArguments) {\n const followShape = this.follow;\n followShape.generate(generateId, false, propArguments);\n const followBuffer = followShape.getBuffer();\n // const followIndexed = followShape.getIndexedBuffer() as Array\n const followPropArguments = {\n ...propArguments,\n follow: {\n index: 1,\n offset: 1,\n count: 1,\n },\n // follow_repetition: followIndexed[0].repetition,\n };\n const childShape = this.shape;\n childShape.generate(generateId, false, followPropArguments);\n let shapeBuffer = childShape.getBuffer();\n // const tmpBounding = [undefined, undefined, undefined, undefined]\n const singleShapeBufferLength = shapeBuffer.length;\n const followShapeBuffer = new Float32Array(singleShapeBufferLength * (followBuffer.length / 2));\n const totalFollowVertexCount = followBuffer.length / 2;\n for (let currentShapeFollowRepetition = 0; currentShapeFollowRepetition < totalFollowVertexCount; currentShapeFollowRepetition++) {\n const currentFollowRepetition = {\n index: currentShapeFollowRepetition + 1,\n offset: totalFollowVertexCount > 1 ? currentShapeFollowRepetition / (totalFollowVertexCount - 1) : 1,\n count: totalFollowVertexCount,\n };\n if (this.shapeUseFollow) {\n followPropArguments.follow = currentFollowRepetition;\n // followPropArguments.follow_repetition = followIndexed[currentShapeFollowRepetition].repetition\n childShape.generate(generateId, false, followPropArguments);\n shapeBuffer = childShape.getBuffer();\n }\n const shapeVertexBufferIndex = currentShapeFollowRepetition * singleShapeBufferLength;\n // const centerVertexIndex = parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2\n const centerVertexIndex = currentShapeFollowRepetition * 2;\n const centerX = followBuffer[centerVertexIndex];\n const centerY = followBuffer[centerVertexIndex + 1];\n for (let i = 0, len = shapeBuffer.length; i < len; i += 2) {\n followShapeBuffer[shapeVertexBufferIndex + i] = centerX + shapeBuffer[i];\n followShapeBuffer[shapeVertexBufferIndex + i + 1] = centerY + shapeBuffer[i + 1];\n // Bounding.add(\n // \ttmpBounding,\n // \tfollowShapeBuffer[shapeVertexBufferIndex + i],\n // \tfollowShapeBuffer[shapeVertexBufferIndex + i + 1]\n // )\n }\n }\n // Bounding.bind(this.currentGenerationRecursiveBounding, tmpBounding)\n this.shapeFollowBuffer = followShapeBuffer;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const propArguments = { repetition, shape: this };\n const bufferIndex = {\n shape: this,\n frameLength: frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n follow: {\n index: 1,\n offset: 1,\n count: 1,\n },\n };\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const vertexCount = this.follow.getBuffer().length / 2; // this.follow.getBufferLength({ ...propArguments, parent: { ...bufferIndex } }) / 2\n for (let j = 0, len = vertexCount; j < len; j++) {\n const followOffset = len > 1 ? j / (len - 1) : 1;\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentFollowRepetition = {\n index: j + 1,\n offset: followOffset,\n count: len,\n };\n const followBufferIndex = { ...bufferIndex, follow: currentFollowRepetition };\n const parent = currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, followBufferIndex)\n : followBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n }\n }\n }\n }\n }\n /**\n * Retturn summation value\n *\n * @static\n * @param {number} recursion\n * @param {number} vertexCount\n * @returns {number}\n */\n static summmation(recursion, vertexCount) {\n if (recursion === 1)\n return 1;\n let result = 1;\n for (let i = 1; i < recursion; i++)\n result += vertexCount ** i;\n return result;\n }\n /**\n * Empty recursion repetition\n *\n * @static\n * @return {*} {IRecursionRepetition}\n */\n static getEmptyRecursion() {\n return {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: 1, count: 1 },\n };\n }\n}\nexports.ShapeFollow = ShapeFollow;\n//# sourceMappingURL=ShapeFollow.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Line = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n *\n * @category Core.Primitives\n * @class Line\n * @extends {ShapeBuffer}\n */\nclass Line extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Two point, based on ShapeBuffer\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Line\n */\n constructor(settings = {}) {\n settings.type = 'Line';\n settings.shape = Line.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n settings.bClosed = false;\n super(settings);\n }\n /**\n * @link https://gist.github.com/pborissow/5c92b77a804688385c77749d1187ba07\n */\n static toPolygon(buffer, thickness) {\n const solidified = [];\n //Convert thickness into an array as needed\n if (!Array.isArray(thickness)) {\n const _thickness = thickness;\n const points = buffer.length / 2;\n thickness = new Array(points);\n for (let i = 0; i < points; i++) {\n thickness[i] = _thickness;\n }\n }\n function getOffsets(ax, ay, bx, by, thickness) {\n const dx = bx - ax, dy = by - ay, len = Math.sqrt(dx * dx + dy * dy), scale = thickness / (2 * len);\n return [-scale * dy, scale * dx];\n }\n function getIntersection(a1, b1, a2, b2) {\n // directional constants\n const k1 = (b1[1] - a1[1]) / (b1[0] - a1[0]), k2 = (b2[1] - a2[1]) / (b2[0] - a2[0]);\n // if the directional constants are equal, the lines are parallel\n if (Math.abs(k1 - k2) < 0.00001) {\n return;\n }\n // y offset constants for both lines\n const m1 = a1[1] - k1 * a1[0];\n const m2 = a2[1] - k2 * a2[0];\n // compute x\n const x = (m1 - m2) / (k2 - k1);\n // use y = k * x + m to get y coordinate\n const y = k1 * x + m1;\n return [x, y];\n }\n let bFirst, bLast, prevA = [\n [0, 0],\n [0, 0],\n ], prevB = [\n [0, 0],\n [0, 0],\n ];\n for (let i = 0, len = buffer.length - 2; i < len; i += 2) {\n bFirst = i === 0;\n bLast = i === len - 2;\n const off = getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], thickness[i]);\n const p0a = [buffer[i] + off[0], buffer[i + 1] + off[1]];\n const p1a = [buffer[i + 2] + off[0], buffer[i + 3] + off[1]];\n const p0b = [buffer[i] - off[0], buffer[i + 1] - off[1]];\n const p1b = [buffer[i + 2] - off[0], buffer[i + 3] - off[1]];\n if (!bFirst) {\n const interA = getIntersection(prevA[0], prevA[1], p0a, p1a);\n if (interA) {\n solidified.unshift(interA[1]);\n solidified.unshift(interA[0]);\n }\n const interB = getIntersection(prevB[0], prevB[1], p0b, p1b);\n if (interB) {\n solidified.push(interB[0]);\n solidified.push(interB[1]);\n }\n }\n if (bFirst) {\n solidified.unshift(p0a[1]);\n solidified.unshift(p0a[0]);\n solidified.push(p0b[0]);\n solidified.push(p0b[1]);\n }\n if (bLast) {\n solidified.unshift(p1a[1]);\n solidified.unshift(p1a[0]);\n solidified.push(p1b[0]);\n solidified.push(p1b[1]);\n }\n if (!bLast) {\n prevA = [p0a, p1a];\n prevB = [p0b, p1b];\n }\n }\n return Float32Array.from(solidified);\n }\n}\nexports.Line = Line;\nLine.buffer = [-1, 0, 1, 0];\n//# sourceMappingURL=Line.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Triangle = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n * Triangle ShapeBuffer\n *\n * @category Core.Primitives\n */\nclass Triangle extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Creates an instance of Triangleeee.\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Triangle\n */\n constructor(settings = {}) {\n settings.type = 'Triangle';\n settings.shape = Triangle.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n super(settings);\n }\n}\nexports.Triangle = Triangle;\nTriangle.buffer = [1, 0, -1, 1, -1, -1];\n//# sourceMappingURL=Triangle.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Rect = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n *\n * @category Core.Primitives\n * @class Rect\n * @extends {ShapeBuffer}\n */\nclass Rect extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Creates an instance of Rect.\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Rect\n */\n constructor(settings = {}) {\n settings.type = 'Rect';\n settings.shape = Rect.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n super(settings);\n }\n}\nexports.Rect = Rect;\nRect.buffer = [1, 1, -1, 1, -1, -1, 1, -1];\n//# sourceMappingURL=Rect.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Polygon = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Polygon shape\n *\n * @category Core.Primitives\n * @class Polygon\n * @extends {ShapeLoop}\n */\nclass Polygon extends ShapeLoop_1.ShapeLoop {\n /**\n * Is based on ShapeLoop and you can pass `sideNumber` property to define\n * a number of sides.\n *\n * @param settings\n */\n constructor(settings = {}) {\n settings.type = settings.type || 'Polygon';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['sideNumber']);\n super(settings, true);\n this.props.sideNumber = settings.sideNumber;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: (propArguments) => {\n return math_1.PI2 / this.getProp('sideNumber', propArguments, 5);\n },\n vertex: shapeLoopRepetition => {\n return [Math.cos(shapeLoopRepetition.current), Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n}\nexports.Polygon = Polygon;\n//# sourceMappingURL=Polygon.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Circle = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n *\n * @category Core.Primitives\n * @class Circle\n * @extends {ShapeLoop}\n */\nclass Circle extends ShapeLoop_1.ShapeLoop {\n /**\n * Based on ShapeLoop, the number of point (resolution) is based on sideLength.\n *\n * @param {ShapeLoopSettings} [settings={}]\n * @memberof Circle\n */\n constructor(settings = {}) {\n settings.type = 'Circle';\n super(settings, true);\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const sideLength = this.getRepetitionSideLength(propArguments);\n return (1 / Math.pow(sideLength[0] * sideLength[1], 0.25)) * ShapeLoop_1.ShapeLoop.PId2;\n },\n vertex: shapeLoopRepetition => [Math.cos(shapeLoopRepetition.current), Math.sin(shapeLoopRepetition.current)],\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n}\nexports.Circle = Circle;\n//# sourceMappingURL=Circle.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Star = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Polygon shape\n *\n * @category Core.Primitives\n * @class Polygon\n * @extends {ShapeLoop}\n */\nclass Star extends ShapeLoop_1.ShapeLoop {\n /**\n * Is based on ShapeLoop and you can pass `spikes` property to define\n * a number of spikes and `innerRadius`\n *\n * @param settings\n */\n constructor(settings = {}) {\n settings.type = settings.type || 'Polygon';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['spikes', 'innerRadius']);\n super(settings, true);\n this.props.spikes = settings.spikes;\n this.props.innerRadius = settings.innerRadius;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: (propArguments) => {\n // dyamic binding in `generateLoopBuffer`\n return this.inc;\n },\n vertex: shapeLoopRepetition => {\n const angle = (Math.PI / this.spikes) * shapeLoopRepetition.index;\n const radius = shapeLoopRepetition.index % 2 === 0 ? 1 : this.innerRadius;\n return [Math.cos(angle) * radius, Math.sin(angle) * radius];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.spikes = this.getProp('spikes', propArguments, 5);\n this.innerRadius = this.getProp('innerRadius', propArguments, 0.5);\n this.inc = Math.PI / this.spikes;\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.Star = Star;\n//# sourceMappingURL=Star.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Rose = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Rose shape\n *\n * @category Core.Primitives\n * @class Rose\n * @extends {ShapeLoop}\n */\nclass Rose extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Rose.\n *\n * @param {IRoseSettings} [settings={}]\n * @memberof Rose\n */\n constructor(settings = {}) {\n var _a, _b;\n settings.type = 'Rose';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['n', 'd']);\n super(settings, true);\n this.props.n = (_a = settings.n) !== null && _a !== void 0 ? _a : 1;\n this.props.d = (_b = settings.d) !== null && _b !== void 0 ? _b : 2;\n this.loop = {\n start: 0,\n end: (propArguments) => Rose.getFinalAngleFromK(this.getProp('n', propArguments), this.getProp('d', propArguments)),\n inc: (propArguments) => {\n const n = this.getProp('n', propArguments);\n const d = this.getProp('d', propArguments);\n const sideLength = this.getRepetitionSideLength(propArguments);\n const sides = Math.pow(sideLength[0] * sideLength[1], 0.45);\n const k = d < n ? n / d : 1.5;\n return math_1.PI2 / (sides * k);\n },\n vertex: (shapeLoopRepetition) => {\n const f = Math.cos(this.k * shapeLoopRepetition.current);\n return [f * Math.cos(shapeLoopRepetition.current), f * Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.k = this.getProp('n', propArguments) / this.getProp('d', propArguments);\n return super.generateLoopBuffer(propArguments);\n }\n /**\n * Return end angle of rose\n *\n * @static\n * @param {number} n\n * @param {number} d\n * @returns {number}\n * @memberof Rose\n */\n static getFinalAngleFromK(n, d) {\n if (n == d)\n return math_1.PI2;\n const k = n / d;\n const p = n * d;\n if (!Number.isInteger(k) && k % 0.5 == 0)\n return 4 * Math.PI;\n return Math.PI * d * (p % 2 == 0 ? 2 : 1);\n }\n}\nexports.Rose = Rose;\n//# sourceMappingURL=Rose.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Spiral = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n * Spiral shape\n *\n * @category Core.Primitives\n * @class Spiral\n * @extends {ShapeLoop}\n */\nclass Spiral extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Spiral.\n *\n * @param {SpiralSettings} [settings={}]\n * @memberof Spiral\n */\n constructor(settings = {}) {\n var _a, _b, _c;\n settings.type = 'Spiral';\n settings.bClosed = false;\n settings.loopDependencies = (settings.loopDependencies || []).concat(['twists', 'twistsStart', 'spiral']);\n super(settings, true);\n this.props.spiral = (_a = settings.spiral) !== null && _a !== void 0 ? _a : Spiral.types.ARCHIMEDE;\n this.props.twists = (_b = settings.twists) !== null && _b !== void 0 ? _b : 2;\n this.props.twistsStart = (_c = settings.twistsStart) !== null && _c !== void 0 ? _c : 0;\n this.loop = {\n start: (propArguments) => math_1.PI2 * this.getProp('twistsStart', propArguments),\n end: (propArguments) => math_1.PI2 *\n (this.getProp('twistsStart', propArguments) + this.getProp('twists', propArguments)),\n inc: (propArguments) => {\n const twists = this.getProp('twists', propArguments);\n const rep = math_1.PI2 * twists;\n const sideLength = this.getRepetitionSideLength(propArguments);\n const radius = 4 + Math.sqrt(sideLength[0] * sideLength[1]);\n return rep / (radius * twists);\n },\n vertex: (shapeLoopRepetition) => {\n const r = this.r(shapeLoopRepetition.current);\n return [r * Math.cos(shapeLoopRepetition.current), r * Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.spiral = this.getProp('spiral', propArguments);\n this.r = Spiral.getRFromTSpiralType(this.spiral);\n return super.generateLoopBuffer(propArguments);\n }\n /**\n * Point position and scale factor for spiral types\n *\n * @static\n * @param {TSpiralType} spiral\n * @returns {number}\n * @memberof Spiral\n */\n static getRFromTSpiralType(spiral) {\n switch (spiral) {\n case Spiral.types.ARCHIMEDE:\n return angle => angle / 10;\n case Spiral.types.HYPERBOLIC:\n return angle => (1 / angle) * 3;\n case Spiral.types.FERMAT:\n return angle => angle ** 0.5 / 3;\n case Spiral.types.LITUUS:\n return angle => angle ** -0.5;\n case Spiral.types.LOGARITHMIC:\n return angle => Math.E ** (angle * 0.2) / 10;\n }\n return angle => angle;\n }\n}\nexports.Spiral = Spiral;\n/**\n * Spural types\n *\n * @static\n * @type {{ [name in TSpiralType]: TSpiralType }}\n * @memberof Spiral\n */\nSpiral.types = {\n ARCHIMEDE: 'ARCHIMEDE',\n HYPERBOLIC: 'HYPERBOLIC',\n FERMAT: 'FERMAT',\n LITUUS: 'LITUUS',\n LOGARITHMIC: 'LOGARITHMIC',\n};\n//# sourceMappingURL=Spiral.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Lissajous = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Lissajous shape\n *\n * @category Core.Primitives\n * @class Lissajous\n * @extends {ShapeLoop}\n */\nclass Lissajous extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Lissajous.\n *\n * @param {ILissajousSettings} [settings={}]\n * @memberof Lissajous\n */\n constructor(settings = {}) {\n settings.type = 'Lissajous';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['wx', 'wy', 'wz']);\n super(settings, true);\n this.props.wx = settings.wx || 1;\n this.props.wy = settings.wy || 2;\n this.props.wz = settings.wz || 0;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const wx = this.getProp('wx', propArguments);\n const wy = this.getProp('wy', propArguments);\n const ratio = wx == wy ? ShapeLoop_1.ShapeLoop.PId2 : 0.5 - Math.min(49, wx + wy) * 0.01;\n const sideLength = this.getRepetitionSideLength(propArguments);\n return (1 / Math.pow(sideLength[0] * sideLength[1], 0.25)) * ratio;\n },\n vertex: (shapeLoopRepetition) => {\n return this.wx === this.wy\n ? [Math.cos(shapeLoopRepetition.current + this.wz), Math.sin(shapeLoopRepetition.current)]\n : [Math.cos(this.wx * shapeLoopRepetition.current + this.wz), Math.sin(this.wy * shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.wx = this.getProp('wx', propArguments, 1);\n this.wy = this.getProp('wy', propArguments, 2);\n this.wz = this.getProp('wz', propArguments, 2);\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.Lissajous = Lissajous;\n//# sourceMappingURL=Lissajous.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SuperShape = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n * ShperShape\n *\n * @category Core.Primitives\n * @class SuperShape\n * @extends {ShapeLoop}\n */\nclass SuperShape extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of SuperShape.\n *\n * @param {ISuperShapeSettings} [settings={}]\n * @memberof SuperShape\n */\n constructor(settings = {}) {\n var _a, _b, _c, _d, _e, _f;\n settings.type = 'SuperShape';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['a', 'b', 'm', 'n1', 'n2', 'n3']);\n super(settings, true);\n this.props.a = (_a = settings.a) !== null && _a !== void 0 ? _a : 1;\n this.props.b = (_b = settings.b) !== null && _b !== void 0 ? _b : 1;\n this.props.m = (_c = settings.m) !== null && _c !== void 0 ? _c : 6;\n this.props.n1 = (_d = settings.n1) !== null && _d !== void 0 ? _d : 1;\n this.props.n2 = (_e = settings.n2) !== null && _e !== void 0 ? _e : 1;\n this.props.n3 = (_f = settings.n3) !== null && _f !== void 0 ? _f : 1;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const sideLength = this.getRepetitionSideLength(propArguments);\n return Math.PI / Math.pow(sideLength[0] * sideLength[1], 0.5);\n },\n vertex: (shapeLoopRepetition) => {\n const angle = shapeLoopRepetition.current;\n const m = (this.m * angle) / 4;\n const a = Math.abs(Math.cos(m) / this.a) ** this.n2;\n const b = Math.abs(Math.sin(m) / this.b) ** this.n3;\n const raux = (a + b) ** (1 / this.n1);\n const r = raux === 0 ? 1 : 1 / raux;\n return [r * Math.cos(angle), r * Math.sin(angle)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.a = this.getProp('a', propArguments);\n this.b = this.getProp('b', propArguments);\n this.m = this.getProp('m', propArguments);\n this.n1 = this.getProp('n1', propArguments);\n this.n2 = this.getProp('n2', propArguments);\n this.n3 = this.getProp('n3', propArguments);\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.SuperShape = SuperShape;\n//# sourceMappingURL=SuperShape.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Modifiers = void 0;\nconst Adapt_1 = require(\"./Adapt\");\nconst Mirror_1 = require(\"./Mirror\");\nconst Smooth_1 = require(\"./Smooth\");\nconst Solidify_1 = require(\"./Solidify\");\nconst Subdivide_1 = require(\"./Subdivide\");\nconst Close_1 = require(\"./Close\");\nconst Offset_1 = require(\"./Offset\");\nconst Modifiers = {\n Adapt: Adapt_1.Adapt,\n Mirror: Mirror_1.Mirror,\n Smooth: Smooth_1.Smooth,\n Solidify: Solidify_1.Solidify,\n Subdivide: Subdivide_1.Subdivide,\n Close: Close_1.Close,\n Offset: Offset_1.Offset,\n};\nexports.Modifiers = Modifiers;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Mirror = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Mirror extends Modifier_1.Modifier {\n constructor(args = { x: true, y: true }) {\n super();\n this.x = args.x === true;\n this.y = args.y === true;\n }\n apply(buffer, bClosed) {\n const bufferLength = buffer.length;\n const mirror = new Float32Array(bufferLength * (this.x ? 2 : 1) * (this.y ? 2 : 1));\n const sideLengthX = 1;\n const sideLengthY = 1;\n if (this.x && this.y) {\n const bufferLengthX2 = bufferLength + bufferLength;\n const bufferLengthX3 = bufferLengthX2 + bufferLength;\n // |1|2|\n // |4|3|\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i] - sideLengthX;\n mirror[i + 1] = buffer[i + 1] - sideLengthY;\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i] * -1 + sideLengthX;\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1] - sideLengthY;\n mirror[bufferLengthX2 + i] = buffer[i] * -1 + sideLengthX;\n mirror[bufferLengthX2 + i + 1] = buffer[i + 1] * -1 + sideLengthY;\n mirror[bufferLengthX3 + i] = buffer[bufferLength - 2 - i] - sideLengthX;\n mirror[bufferLengthX3 + i + 1] = buffer[bufferLength - 2 - i + 1] * -1 + sideLengthY;\n }\n }\n else if (this.x) {\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i] - sideLengthX;\n mirror[i + 1] = buffer[i + 1];\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i] * -1 + sideLengthX;\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1];\n }\n }\n else if (this.y) {\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i];\n mirror[i + 1] = buffer[i + 1] - sideLengthY;\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i];\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1] * -1 + sideLengthY;\n }\n }\n else {\n return buffer;\n }\n return mirror;\n }\n}\nexports.Mirror = Mirror;\n//# sourceMappingURL=Mirror.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Smooth = void 0;\nconst Utilities_1 = require(\"../Utilities\");\nconst Close_1 = require(\"./Close\");\nconst Modifier_1 = require(\"./Modifier\");\nclass Smooth extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.level = args.level || 1;\n const tension = Array.isArray(args.tension) ? args.tension : [args.tension];\n this.tension = new Array(this.level).fill(0.5).map((v, i) => Utilities_1.clamp(0, 1, tension[i] || v));\n this.level = this.level < 1 ? 1 : this.level;\n this.closed = args.closed === true;\n }\n apply(buffer, bClosed) {\n if (bClosed && !Close_1.Close.isClosed(buffer)) {\n const bufferLen = buffer.length;\n const mofified = new Float32Array(bufferLen + 2);\n mofified.set(buffer, 0);\n mofified[bufferLen] = buffer[0];\n mofified[bufferLen + 1] = buffer[1];\n buffer = mofified;\n }\n let smoothed = buffer;\n for (let i = 0, len = this.level; i < len; i++)\n smoothed = Smooth.smooth(smoothed, this.tension[i], bClosed || this.closed);\n return smoothed;\n }\n /**\n * Chaikin smooth\n *\n * the tension factor defines a scale between corner cutting distance in segment half length,\n * i.e. between 0.05 and 0.45. The opposite corner will be cut by the inverse\n * (i.e. 1-cutting distance) to keep symmetry.\n * with a tension value of 0.5 this amounts to 0.25 = 1/4 and 0.75 = 3/4,\n * the original Chaikin values\n *\n * @link https://www.codeproject.com/Articles/1093960/D-Polyline-Vertex-Smoothing\n * @param buffer\n */\n static smooth(buffer, tension = 0.5, bClosed = false) {\n const bufferLength = buffer.length;\n const smoothed = new Float32Array((buffer.length - (bClosed ? 1 : 0)) * 2);\n if (!bClosed) {\n smoothed[0] = buffer[0];\n smoothed[1] = buffer[1];\n }\n const cutdist = 0.05 + tension * 0.4;\n const ncutdist = 1 - cutdist;\n let smoothedLength = bClosed ? 0 : 2;\n for (let i = 0, len = bufferLength - 2; i < len; i += 2, smoothedLength += 4) {\n // q\n smoothed[smoothedLength] = ncutdist * buffer[i] + cutdist * buffer[i + 2];\n smoothed[smoothedLength + 1] = ncutdist * buffer[i + 1] + cutdist * buffer[i + 3];\n // r\n smoothed[smoothedLength + 2] = cutdist * buffer[i] + ncutdist * buffer[i + 2];\n smoothed[smoothedLength + 3] = cutdist * buffer[i + 1] + ncutdist * buffer[i + 3];\n }\n if (!bClosed) {\n smoothed[smoothedLength] = buffer[bufferLength - 2];\n smoothed[smoothedLength + 1] = buffer[bufferLength - 1];\n }\n else {\n smoothed[smoothedLength] = smoothed[0];\n smoothed[smoothedLength + 1] = smoothed[1];\n }\n return smoothed;\n }\n}\nexports.Smooth = Smooth;\n//# sourceMappingURL=Smooth.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Close = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Close extends Modifier_1.Modifier {\n constructor() {\n super();\n }\n apply(buffer, bClosed, shape) {\n return Close.call(buffer);\n }\n static call(buffer) {\n const len = buffer.length;\n if (Close.isClosed(buffer))\n return buffer;\n const result = new Float32Array(len + 2);\n result.set(buffer, 0);\n result[len] = result[0];\n result[len + 1] = result[1];\n return result;\n }\n static isClosed(buffer) {\n const len = buffer.length;\n return buffer[0] === buffer[len - 2] && buffer[1] === buffer[len - 1];\n }\n}\nexports.Close = Close;\n//# sourceMappingURL=Close.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Solidify = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Solidify extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.closed = args.closed === true;\n this.thickness = args.thickness || 0.2;\n this.error = args.error;\n }\n apply(buffer, bClosed) {\n return Solidify.solidify(buffer, this.thickness, this.closed, this.error);\n }\n /**\n * @link https://gist.github.com/kekscom/4194148\n */\n static solidify(buffer, thickness, bClosed = false, error) {\n const solidified = [];\n thickness = typeof thickness === 'number' ? [thickness] : thickness;\n const thicknessLength = thickness.length;\n let bFirst, bLast, prevA = [\n [0, 0],\n [0, 0],\n ], prevB = [\n [0, 0],\n [0, 0],\n ];\n for (let i = 0, t = 0, len = buffer.length - 2; i < len; i += 2, t++) {\n bFirst = i === 0;\n bLast = i === len - 2;\n const currentThicknessRep = {\n index: i + 1,\n offset: i / len,\n count: len,\n };\n const nextThicknessRep = {\n index: i + 2,\n offset: (i + 1) / len,\n count: len,\n };\n const currentThickness = typeof thickness === 'function' ? thickness(currentThicknessRep) : thickness[t % thicknessLength];\n const nextThickness = typeof thickness === 'function' ? thickness(nextThicknessRep) : thickness[(t + 1) % thicknessLength];\n const off = Solidify.getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], currentThickness);\n const off2 = Solidify.getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], nextThickness);\n const p0a = [buffer[i] + off[0], buffer[i + 1] + off[1]];\n const p1a = [buffer[i + 2] + off2[0], buffer[i + 3] + off2[1]];\n const p0b = [buffer[i] - off[0], buffer[i + 1] - off[1]];\n const p1b = [buffer[i + 2] - off2[0], buffer[i + 3] - off2[1]];\n if (!bFirst) {\n const interA = Solidify.getIntersection(prevA[0], prevA[1], p0a, p1a, error);\n if (interA) {\n solidified.unshift(interA[1]);\n solidified.unshift(interA[0]);\n }\n const interB = Solidify.getIntersection(prevB[0], prevB[1], p0b, p1b, error);\n if (interB) {\n solidified.push(interB[0]);\n solidified.push(interB[1]);\n }\n }\n if (bFirst) {\n solidified.unshift(p0a[1]);\n solidified.unshift(p0a[0]);\n solidified.push(p0b[0]);\n solidified.push(p0b[1]);\n }\n if (bLast) {\n solidified.unshift(p1a[1]);\n solidified.unshift(p1a[0]);\n solidified.push(p1b[0]);\n solidified.push(p1b[1]);\n }\n if (!bLast) {\n prevA = [p0a, p1a];\n prevB = [p0b, p1b];\n }\n }\n if (bClosed) {\n const centerIndex = buffer.length - 2;\n const lastIndex = solidified.length - 2;\n const x = 0.5 * solidified[0] + solidified[centerIndex] * 0.5;\n const y = 0.5 * solidified[1] + solidified[centerIndex + 1] * 0.5;\n const x2 = 0.5 * solidified[centerIndex + 2] + solidified[lastIndex] * 0.5;\n const y2 = 0.5 * solidified[centerIndex + 3] + solidified[lastIndex + 1] * 0.5;\n solidified[0] = x;\n solidified[1] = y;\n solidified[centerIndex] = x;\n solidified[centerIndex + 1] = y;\n solidified[centerIndex + 2] = x2;\n solidified[centerIndex + 3] = y2;\n solidified[lastIndex] = x2;\n solidified[lastIndex + 1] = y2;\n }\n return Float32Array.from(solidified);\n }\n static getOffsets(ax, ay, bx, by, thickness) {\n const dx = bx - ax, dy = by - ay, len = Math.sqrt(dx * dx + dy * dy), scale = thickness / (2 * len);\n return [-scale * dy, scale * dx];\n }\n static getIntersection(a1, b1, a2, b2, error = 0.00001) {\n // directional constants\n const k1 = (b1[1] - a1[1]) / (b1[0] - a1[0]), k2 = (b2[1] - a2[1]) / (b2[0] - a2[0]);\n // if the directional constants are equal, the lines are parallel\n // if (Math.abs(k1 - k2) < 0.00001) {\n if (Math.abs(k1 - k2) < error) {\n return;\n }\n // y offset constants for both lines\n const m1 = a1[1] - k1 * a1[0];\n const m2 = a2[1] - k2 * a2[0];\n // compute x\n const x = (m1 - m2) / (k2 - k1);\n // use y = k * x + m to get y coordinate\n const y = k1 * x + m1;\n return [x, y];\n }\n}\nexports.Solidify = Solidify;\n//# sourceMappingURL=Solidify.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Subdivide = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Subdivide extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.level = args.level || 1;\n this.level = this.level < 1 ? 1 : this.level;\n }\n apply(buffer, bClosed) {\n const level = this.level;\n let subdivided = buffer;\n if (subdivided && subdivided.length > 0) {\n for (let i = 0; i < level; i++)\n subdivided = Subdivide.subdivide(subdivided, bClosed);\n }\n return subdivided;\n }\n /**\n * Subdivide buffer\n *\n * @static\n * @param {Float32Array} shape\n * @param {boolean} [bClosed=true]\n * @returns {(Float32Array)}\n */\n static subdivide(buffer, bClosed = false) {\n const bufferLength = buffer.length;\n const subdivided = new Float32Array(bufferLength * 2 - (bClosed ? 0 : 2));\n for (let i = 0; i < bufferLength; i += 2) {\n if (i === 0) {\n subdivided[0] = buffer[0];\n subdivided[1] = buffer[1];\n }\n else {\n const px = buffer[i - 2];\n const py = buffer[i - 1];\n const x = buffer[i];\n const y = buffer[i + 1];\n const nx = (x + px) / 2;\n const ny = (y + py) / 2;\n subdivided[(i - 1) * 2] = nx;\n subdivided[(i - 1) * 2 + 1] = ny;\n subdivided[i * 2] = x;\n subdivided[i * 2 + 1] = y;\n }\n }\n if (bClosed) {\n subdivided[(bufferLength - 1) * 2] = (buffer[0] + buffer[bufferLength - 2]) / 2;\n subdivided[(bufferLength - 1) * 2 + 1] = (buffer[1] + buffer[bufferLength - 1]) / 2;\n }\n return subdivided;\n }\n}\nexports.Subdivide = Subdivide;\n//# sourceMappingURL=Subdivide.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Offset = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Offset extends Modifier_1.Modifier {\n constructor(args = { from: 0, to: undefined }) {\n super();\n this.from = args.from;\n this.to = args.to;\n }\n apply(buffer, bClosed) {\n return buffer.subarray(this.from, this.to ? (this.to < 0 ? buffer.length + this.to : this.to) : undefined);\n }\n}\nexports.Offset = Offset;\n//# sourceMappingURL=Offset.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./utilities\"), exports);\n__exportStar(require(\"./createAnimation\"), exports);\n__exportStar(require(\"./createInterpolator\"), exports);\n__exportStar(require(\"./Easings\"), exports);\n__exportStar(require(\"./Animation\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.interpolateColorHSL = exports.interpolateColorRGB = exports.cosp = exports.sinp = exports.clockOffset = exports.clock = void 0;\n/**\n * Return time (from 0 to duration) in milliseconds\n *\n * @export\n * @param {number} time Current time\n * @param {number} duration Clock duration\n * @param {(number | boolean)} [loop=true]\n * @param {('normal' | 'reverse' | 'alternate')} [direction='alternate']\n * @param {number} [delay=0]\n * @param {number} [afterDelay=0]\n * @return {*} {number} Between 0 and duration\n */\nfunction clock(time, duration, loop = true, direction = 'alternate', delay = 0, afterDelay = 0) {\n const totalDuration = direction === 'normal'\n ? duration + delay\n : direction === 'reverse'\n ? duration + delay\n : duration * 2 + delay + afterDelay;\n if ((typeof loop === 'number' && time >= totalDuration * loop) || (loop === false && time >= totalDuration)) {\n return direction === 'normal' ? duration : 0;\n }\n time %= totalDuration;\n if ((time -= delay) <= 0) {\n return 0;\n }\n if (direction === 'alternate') {\n if (time <= duration) {\n // normal\n return time;\n }\n else {\n // reverse\n time -= duration;\n if ((time -= afterDelay) >= 0) {\n return duration - (time >= duration ? duration : time);\n }\n return duration;\n }\n }\n else {\n return time >= duration ? duration : time;\n }\n}\nexports.clock = clock;\n/**\n * Return offset between 0 and 1 from current time based on duration and other parameters\n *\n * @export\n * @param {number} time\n * @param {number} duration\n * @param {(number | boolean)} [loop=true]\n * @param {('normal' | 'reverse' | 'alternate')} [direction='alternate']\n * @param {number} [delay=0]\n * @param {number} [afterDelay=0]\n * @return {*} {number}\n */\nfunction clockOffset(time, duration, loop = true, direction = 'alternate', delay = 0, afterDelay = 0) {\n return clock(time, duration, loop, direction, delay, afterDelay) / duration;\n}\nexports.clockOffset = clockOffset;\nconst PI2 = Math.PI * 2;\n/**\n * Return sin of period 'durate' in time 'time'\n *\n * @export\n * @param {number} time\n * @param {number} durate\n * @param {number} phase\n * @param {boolean} [normalize=false]\n * @return {*} {number}\n */\nfunction sinp(time, durate, phase = 0, normalize = false) {\n const value = Math.sin((time * PI2) / durate + phase);\n return normalize ? 0.5 + value * 0.5 : value;\n}\nexports.sinp = sinp;\n/**\n * Return cos of period 'durate' in time 'time'\n *\n * @export\n * @param {number} time\n * @param {number} durate\n * @param {number} phase\n * @param {boolean} [normalize=false]\n * @return {*} {number}\n */\nfunction cosp(time, durate, phase = 0, normalize = false) {\n const value = Math.cos((time * PI2) / durate + phase);\n return normalize ? 0.5 + value * 0.5 : value;\n}\nexports.cosp = cosp;\nfunction interpolateColorRGB(start, end, offset) {\n const r = start.r + offset * (end.r - start.r);\n const g = start.g + offset * (end.g - start.g);\n const b = start.b + offset * (end.b - start.b);\n const alpha = start.alpha + offset * (end.alpha - start.alpha);\n return `rgba(${Math.floor(r)},${Math.floor(g)},${Math.floor(b)},${alpha})`;\n}\nexports.interpolateColorRGB = interpolateColorRGB;\nfunction interpolateColorHSL(start, end, offset) {\n const h = start.h + offset * (end.h - start.h);\n const s = start.s + offset * (end.s - start.s);\n const l = start.l + offset * (end.l - start.l);\n const alpha = start.alpha + offset * (end.alpha - start.alpha);\n return `hsla(${h},${s}%,${l}%,${alpha})`;\n}\nexports.interpolateColorHSL = interpolateColorHSL;\n//# sourceMappingURL=utilities.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createAnimation = void 0;\nconst createInterpolator_1 = require(\"./createInterpolator\");\n/**\n * Create TAnimation from object\n *\n * @param simpleAnimation\n * @returns\n */\nfunction createAnimation(simpleAnimation) {\n const interpolate = createInterpolator_1.createInterpolationCallback(simpleAnimation);\n if (typeof interpolate === 'undefined')\n return undefined;\n const delay = simpleAnimation.delay || 0;\n const afterDelay = simpleAnimation.afterDelay || 0;\n const direction = simpleAnimation.direction || 'normal';\n const duration = simpleAnimation.duration || 1000;\n const totalDuration = direction === 'normal'\n ? duration + delay\n : direction === 'reverse'\n ? duration + delay\n : duration * 2 + delay + afterDelay;\n const loop = typeof simpleAnimation.loop === 'number' ? simpleAnimation.loop : !!simpleAnimation.loop;\n const bindedValues = {\n delay,\n afterDelay,\n direction,\n duration,\n totalDuration,\n loop,\n };\n const animationFunction = createInterpolator_1.createInterpolator(simpleAnimation.interpolator);\n const animation = {\n loop: 0,\n offset: 0,\n loopDuration: totalDuration,\n direction: direction === 'alternate' ? 'normal' : direction,\n started: false,\n ended: false,\n value: undefined,\n };\n animation.update = createUpdate(animation, bindedValues, animationFunction, interpolate);\n return animation;\n}\nexports.createAnimation = createAnimation;\n/**\n *\n * @internal\n * @param animation\n * @param bindedValues\n * @param animationFunction\n * @param interpolate\n * @returns\n */\nfunction createUpdate(animation, bindedValues, animationFunction, interpolate) {\n const { loop, totalDuration, delay, afterDelay, direction, duration } = bindedValues;\n return (time) => {\n // Check animation is ended\n if ((typeof loop === 'number' && time >= totalDuration * loop) ||\n (loop === false && time >= bindedValues.totalDuration)) {\n animation.started = false;\n animation.ended = true;\n animation.offset = animationFunction(direction === 'normal' ? duration : 0, duration);\n animation.value = interpolate(animation.offset);\n return;\n }\n animation.loop = Math.ceil(time / totalDuration);\n time %= totalDuration;\n if ((time -= delay) <= 0) {\n animation.started = false;\n animation.offset = animationFunction(0, duration);\n animation.value = interpolate(animation.offset);\n return;\n }\n animation.started = true;\n if (direction === 'alternate') {\n if (time <= duration) {\n animation.direction = 'normal';\n animation.offset = animationFunction(time, duration);\n }\n else {\n animation.direction = 'reverse';\n time -= duration;\n // wait afterDelay\n if ((time -= afterDelay) >= 0) {\n animation.offset = 1 - animationFunction(time >= duration ? duration : time, duration);\n }\n else {\n animation.offset = 1;\n }\n }\n }\n else {\n const animationValue = animationFunction(time >= duration ? duration : time, duration);\n animation.offset = direction === 'normal' ? animationValue : 1 - animationValue;\n }\n animation.value = interpolate(animation.offset);\n };\n}\n//# sourceMappingURL=createAnimation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createInterpolator = exports.createInterpolationCallback = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst bezier_easing_1 = require(\"bezier-easing\");\nconst Easings_1 = require(\"./Easings\");\nconst utilities_1 = require(\"./utilities\");\n/**\n * Return a callback for value interpolation passing offset from 0 to 1\n *\n * @param simpleAnimation\n * @returns\n */\nfunction createInterpolationCallback(simpleAnimation) {\n const from = Array.isArray(simpleAnimation.from) ? simpleAnimation.from : [simpleAnimation.from];\n const to = Array.isArray(simpleAnimation.to) ? simpleAnimation.to : [simpleAnimation.to];\n const round = simpleAnimation.round;\n const colorInterpolation = simpleAnimation.colorTransitionMode === 'hue' ? utilities_1.interpolateColorHSL : utilities_1.interpolateColorRGB;\n if (from.length !== to.length)\n return undefined;\n const callbacks = [];\n for (let i = 0, len = from.length; i < len; i++) {\n if (typeof from[i] !== typeof to[i]) {\n console.warn('[@urpflanze/animation]: `from` and `to` values mismatch');\n return undefined;\n }\n else {\n if (typeof from[i] !== 'string') {\n const a = from[i], b = to[i];\n callbacks.push(typeof round !== 'undefined'\n ? (offset) => offset === 1 ? b : offset === 0 ? a : Math.round((a + offset * (b - a)) * round) / round\n : (offset) => (offset === 1 ? b : offset === 0 ? a : a + offset * (b - a)));\n }\n else {\n const a = from[i];\n const b = to[i];\n const parsed_a = color_1.parseColorAndConvert(a);\n const parsed_b = color_1.parseColorAndConvert(b);\n if (typeof parsed_a !== 'undefined' && typeof parsed_b !== 'undefined') {\n callbacks.push((offset) => offset === 1 ? b : offset === 0 ? a : colorInterpolation(parsed_a, parsed_b, offset));\n }\n }\n }\n }\n return (offset) => {\n const values = callbacks.map(c => c(offset));\n return values.length === 1 ? values[0] : values;\n };\n}\nexports.createInterpolationCallback = createInterpolationCallback;\n/**\n * Return a callback for calculate offset (0 to 1) from elapsed time and animation duration\n *\n * @param type\n * @returns\n */\nfunction createInterpolator(type) {\n var _a, _b;\n switch (typeof type) {\n case 'function':\n return (elapsed, duration) => type(elapsed / duration, elapsed);\n case 'string':\n switch (type) {\n case 'wave':\n return (elapsed, duration) => 0.5 + Math.sin((elapsed * Math.PI * 2) / duration + Math.PI * 1.5) * 0.5;\n default: {\n if (type in Easings_1.Easings) {\n const easing = Easings_1.Easings[type];\n return (elapsed, duration) => easing(elapsed, 0, 1, duration);\n }\n return (elapsed, duration) => Easings_1.Easings.linear(elapsed, 0, 1, duration);\n }\n }\n case 'object':\n switch (type.type) {\n case 'wave': {\n const phase = Math.PI * 1.5 + (((_a = type.params) === null || _a === void 0 ? void 0 : _a.phase) || 0);\n return (elapsed, duration) => {\n return 0.5 + Math.sin((elapsed * Math.PI * 2) / duration + phase) * 0.5;\n };\n }\n case 'elasticIn':\n case 'elasticOut':\n case 'elasticInOut': {\n const easing = Easings_1.Easings[type.type];\n const { amplitude, period } = type.params || {};\n return (elapsed, duration) => easing(elapsed, 0, 1, duration, amplitude, period);\n }\n case 'backIn':\n case 'backOut':\n case 'backInOut': {\n const easing = Easings_1.Easings[type.type];\n const overshoot = ((_b = type.params) === null || _b === void 0 ? void 0 : _b.overshoot) || undefined;\n return (elapsed, duration) => easing(elapsed, 0, 1, duration, overshoot);\n }\n case 'cubicBezier': {\n const easing = bezier_easing_1.default(type.params[0], type.params[1], type.params[2], type.params[3]);\n return (elapsed, duration) => easing(elapsed / duration);\n }\n }\n }\n return (elapsed, duration) => Easings_1.Easings.linear(elapsed, 0, 1, duration);\n}\nexports.createInterpolator = createInterpolator;\n//# sourceMappingURL=createInterpolator.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./conversions\"), exports);\n__exportStar(require(\"./parsing\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.rgbToHsl = exports.hslToRgb = exports.rgbToHex = void 0;\n/**\n * Convert rgb to hex\n *\n * @param r number between 0 - 255\n * @param g number between 0 - 255\n * @param b number between 0 - 255\n * @returns #ffffff\n */\nfunction rgbToHex(r, g, b) {\n return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;\n}\nexports.rgbToHex = rgbToHex;\n/**\n * Convert hsl (0-360, 0-100, 0-100) color to rgb(0-255, 0-255, 0-255)\n *\n * @param {number} h number between 0 - 360\n * @param {number} s number between 0 - 100\n * @param {number} l number between 0 - 100\n * @returns {[number, number, number]} [0-255, 0-255, 0-255]\n */\nfunction hslToRgb(h, s, l) {\n h /= 360;\n s /= 100;\n l /= 100;\n let r, g, b;\n if (s == 0) {\n r = g = b = l; // achromatic\n }\n else {\n const hue2rgb = (p, q, t) => {\n t += t < 0 ? 1 : t > 1 ? -1 : 0;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n };\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return [(0.5 + r * 255) << 0, (0.5 + g * 255) << 0, (0.5 + b * 255) << 0];\n}\nexports.hslToRgb = hslToRgb;\n/**\n * Convert rbg (0-255, 0-255, 0-255) to hsl (0-360, 0-100, 0-100)\n *\n * @param {number} r number between 0 - 255\n * @param {number} g number between 0 - 255\n * @param {number} b number between 0 - 255\n * @returns {[number, number, number]} (0-360, 0-100, 0-100)\n */\nfunction rgbToHsl(r, g, b) {\n r /= 255;\n g /= 255;\n b /= 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s;\n if (max === min) {\n h = s = 0;\n }\n else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h = h / 6;\n }\n return [(0.5 + h * 360) << 0, (0.5 + s * 100) << 0, (0.5 + l * 100) << 0];\n}\nexports.rgbToHsl = rgbToHsl;\n//# sourceMappingURL=conversions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseColor = exports.parseColorAndConvert = void 0;\nconst htmlcolors_1 = require(\"./htmlcolors\");\nconst conversions_1 = require(\"./conversions\");\n/**\n * Convert color to IConvertedColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IConvertedColor | undefined)}\n */\nfunction parseColorAndConvert(color) {\n const parsed = parseColor(color);\n if (parsed) {\n if (parsed.type === 'hsl') {\n const [r, g, b] = conversions_1.hslToRgb(parsed.a, parsed.b, parsed.c);\n return {\n r,\n g,\n b,\n h: parsed.a,\n s: parsed.b,\n l: parsed.c,\n alpha: parsed.alpha,\n };\n }\n else {\n const [h, s, l] = conversions_1.rgbToHsl(parsed.a, parsed.b, parsed.c);\n return {\n h,\n s,\n l,\n r: parsed.a,\n g: parsed.b,\n b: parsed.c,\n alpha: parsed.alpha,\n };\n }\n }\n}\nexports.parseColorAndConvert = parseColorAndConvert;\n/**\n * Convert color to IColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IColor | undefined)}\n */\nfunction parseColor(color) {\n if (typeof color === 'number') {\n if (color > 0xffffff) {\n return {\n type: 'rgb',\n a: (color >> 24) & 255,\n b: (color >> 16) & 255,\n c: (color >> 8) & 255,\n alpha: (color & 255) / 255,\n };\n }\n else {\n return { type: 'rgb', a: (color >> 16) & 255, b: (color >> 8) & 255, c: color & 255, alpha: 1 };\n }\n }\n color = color.replace(/\\s/g, '');\n if (htmlcolors_1.default[color])\n color = htmlcolors_1.default[color];\n let match = /^#([0-9a-f]{3,8})$/i.exec(color);\n if (match) {\n const hex = match[1];\n if (hex.length === 3) {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[0], 16),\n b: parseInt(hex[1] + hex[1], 16),\n c: parseInt(hex[2] + hex[2], 16),\n alpha: 1,\n };\n }\n else {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[1], 16),\n b: parseInt(hex[2] + hex[3], 16),\n c: parseInt(hex[4] + hex[5], 16),\n alpha: hex.length > 6 ? parseInt(hex.substring(6), 16) / 255 : 1,\n };\n }\n }\n match = /^((hsl|rgb)a?)\\((\\d+),(\\d+)%?,(\\d+)%?,?(.+)?\\)$/i.exec(color);\n if (match) {\n const [, , type, a, b, c, alpha] = match;\n return {\n type: type,\n a: +a,\n b: +b,\n c: +c,\n alpha: alpha ? +alpha : 1,\n };\n }\n}\nexports.parseColor = parseColor;\n//# sourceMappingURL=parsing.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst colors = {\n aliceblue: '#f0f8ff',\n antiquewhite: '#faebd7',\n aqua: '#00ffff',\n aquamarine: '#7fffd4',\n azure: '#f0ffff',\n beige: '#f5f5dc',\n bisque: '#ffe4c4',\n black: '#000000',\n blanchedalmond: '#ffebcd',\n blue: '#0000ff',\n blueviolet: '#8a2be2',\n brown: '#a52a2a',\n burlywood: '#deb887',\n cadetblue: '#5f9ea0',\n chartreuse: '#7fff00',\n chocolate: '#d2691e',\n coral: '#ff7f50',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyan: '#00ffff',\n darkblue: '#00008b',\n darkcyan: '#008b8b',\n darkgoldenrod: '#b8860b',\n darkgray: '#a9a9a9',\n darkgreen: '#006400',\n darkkhaki: '#bdb76b',\n darkmagenta: '#8b008b',\n darkolivegreen: '#556b2f',\n darkorange: '#ff8c00',\n darkorchid: '#9932cc',\n darkred: '#8b0000',\n darksalmon: '#e9967a',\n darkseagreen: '#8fbc8f',\n darkslateblue: '#483d8b',\n darkslategray: '#2f4f4f',\n darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n gold: '#ffd700',\n goldenrod: '#daa520',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n indianred: '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n lavender: '#e6e6fa',\n lavenderblush: '#fff0f5',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrodyellow: '#fafad2',\n lightgrey: '#d3d3d3',\n lightgreen: '#90ee90',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\n maroon: '#800000',\n mediumaquamarine: '#66cdaa',\n mediumblue: '#0000cd',\n mediumorchid: '#ba55d3',\n mediumpurple: '#9370d8',\n mediumseagreen: '#3cb371',\n mediumslateblue: '#7b68ee',\n mediumspringgreen: '#00fa9a',\n mediumturquoise: '#48d1cc',\n mediumvioletred: '#c71585',\n midnightblue: '#191970',\n mintcream: '#f5fffa',\n mistyrose: '#ffe4e1',\n moccasin: '#ffe4b5',\n navajowhite: '#ffdead',\n navy: '#000080',\n oldlace: '#fdf5e6',\n olive: '#808000',\n olivedrab: '#6b8e23',\n orange: '#ffa500',\n orangered: '#ff4500',\n orchid: '#da70d6',\n palegoldenrod: '#eee8aa',\n palegreen: '#98fb98',\n paleturquoise: '#afeeee',\n palevioletred: '#d87093',\n papayawhip: '#ffefd5',\n peachpuff: '#ffdab9',\n peru: '#cd853f',\n pink: '#ffc0cb',\n plum: '#dda0dd',\n powderblue: '#b0e0e6',\n purple: '#800080',\n rebeccapurple: '#663399',\n red: '#ff0000',\n rosybrown: '#bc8f8f',\n royalblue: '#4169e1',\n saddlebrown: '#8b4513',\n salmon: '#fa8072',\n sandybrown: '#f4a460',\n seagreen: '#2e8b57',\n seashell: '#fff5ee',\n sienna: '#a0522d',\n silver: '#c0c0c0',\n skyblue: '#87ceeb',\n slateblue: '#6a5acd',\n slategray: '#708090',\n snow: '#fffafa',\n springgreen: '#00ff7f',\n steelblue: '#4682b4',\n tan: '#d2b48c',\n teal: '#008080',\n thistle: '#d8bfd8',\n tomato: '#ff6347',\n turquoise: '#40e0d0',\n violet: '#ee82ee',\n wheat: '#f5deb3',\n white: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32',\n};\nexports.default = colors;\n//# sourceMappingURL=htmlcolors.js.map","/**\n * https://github.com/gre/bezier-easing\n * BezierEasing - use bezier curve for transition easing function\n * by Gaëtan Renaudeau 2014 - 2015 – MIT License\n */\n\n// These values are established by empiricism with tests (tradeoff: performance VS precision)\nvar NEWTON_ITERATIONS = 4;\nvar NEWTON_MIN_SLOPE = 0.001;\nvar SUBDIVISION_PRECISION = 0.0000001;\nvar SUBDIVISION_MAX_ITERATIONS = 10;\n\nvar kSplineTableSize = 11;\nvar kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\nvar float32ArraySupported = typeof Float32Array === 'function';\n\nfunction A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\nfunction B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\nfunction C (aA1) { return 3.0 * aA1; }\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nfunction calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }\n\n// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\nfunction getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); }\n\nfunction binarySubdivide (aX, aA, aB, mX1, mX2) {\n var currentX, currentT, i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n return currentT;\n}\n\nfunction newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {\n for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n if (currentSlope === 0.0) {\n return aGuessT;\n }\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n}\n\nfunction LinearEasing (x) {\n return x;\n}\n\nmodule.exports = function bezier (mX1, mY1, mX2, mY2) {\n if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {\n throw new Error('bezier x values must be in [0, 1] range');\n }\n\n if (mX1 === mY1 && mX2 === mY2) {\n return LinearEasing;\n }\n\n // Precompute samples table\n var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n for (var i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n\n function getTForX (aX) {\n var intervalStart = 0.0;\n var currentSample = 1;\n var lastSample = kSplineTableSize - 1;\n\n for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n --currentSample;\n\n // Interpolate to provide an initial guess for t\n var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n var guessForT = intervalStart + dist * kSampleStepSize;\n\n var initialSlope = getSlope(guessForT, mX1, mX2);\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if (initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n }\n\n return function BezierEasing (x) {\n // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n if (x === 0) {\n return 0;\n }\n if (x === 1) {\n return 1;\n }\n return calcBezier(getTForX(x), mY1, mY2);\n };\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Easings = void 0;\n/**\n * Easing functions\n *\n * @category Services.Animation\n */\nconst Easings = {\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n linear: (timeOrOffset, start, end, duration = 1) => (end * timeOrOffset) / duration + start,\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return -end * timeOrOffset * (timeOrOffset - 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset + start;\n timeOrOffset--;\n return (-end / 2) * (timeOrOffset * (timeOrOffset - 2) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * (timeOrOffset * timeOrOffset * timeOrOffset + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return -end * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (-end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset - 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalIn: (timeOrOffset, start, end, duration = 1) => {\n return -end * Math.cos((timeOrOffset / duration) * (Math.PI / 2)) + end + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalOut: (timeOrOffset, start, end, duration = 1) => {\n return end * Math.sin((timeOrOffset / duration) * (Math.PI / 2)) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalInOut: (timeOrOffset, start, end, duration = 1) => {\n return (-end / 2) * (Math.cos((Math.PI * timeOrOffset) / duration) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialIn: (timeOrOffset, start, end, duration = 1) => {\n return end * Math.pow(2, 10 * (timeOrOffset / duration - 1)) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialOut: (timeOrOffset, start, end, duration = 1) => {\n return end * (-Math.pow(2, (-10 * timeOrOffset) / duration) + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * Math.pow(2, 10 * (timeOrOffset - 1)) + start;\n timeOrOffset--;\n return (end / 2) * (-Math.pow(2, -10 * timeOrOffset) + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return -end * (Math.sqrt(1 - timeOrOffset * timeOrOffset) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * Math.sqrt(1 - timeOrOffset * timeOrOffset) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (-end / 2) * (Math.sqrt(1 - timeOrOffset * timeOrOffset) - 1) + start;\n timeOrOffset -= 2;\n return (end / 2) * (Math.sqrt(1 - timeOrOffset * timeOrOffset) + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticIn: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration) === 1) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n return (-(amplitude *\n Math.pow(2, 10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period)) + start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticOut: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration) === 1) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n return (amplitude * Math.pow(2, -10 * timeOrOffset) * Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period) +\n end +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticInOut: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration / 2) === 2) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n if (timeOrOffset < 1) {\n return (-0.5 *\n (amplitude *\n Math.pow(2, 10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period)) +\n start);\n }\n return (amplitude *\n Math.pow(2, -10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period) *\n 0.5 +\n end +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} overshoot (optional)\n * @return {number}\n */\n backIn: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n return end * (timeOrOffset /= duration) * timeOrOffset * ((overshoot + 1) * timeOrOffset - overshoot) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} s overshoot (optional)\n * @return {number}\n */\n backOut: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n return (end *\n ((timeOrOffset = timeOrOffset / duration - 1) * timeOrOffset * ((overshoot + 1) * timeOrOffset + overshoot) +\n 1) +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} overshoot (optional)\n * @return {number}\n */\n backInOut: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n if ((timeOrOffset /= duration / 2) < 1) {\n return (end / 2) * (timeOrOffset * timeOrOffset * (((overshoot *= 1.525) + 1) * timeOrOffset - overshoot)) + start;\n }\n return ((end / 2) * ((timeOrOffset -= 2) * timeOrOffset * (((overshoot *= 1.525) + 1) * timeOrOffset + overshoot) + 2) +\n start);\n },\n /**\n * @param {number} t current time\n * @param {number} b start value\n * @param {number} c end value\n * @param {number} d duration\n * @return {number}\n */\n bounceIn: (timeOrOffset, start, end, duration = 1) => {\n return end - Easings.bounceOut(duration - timeOrOffset, 0, end, duration) + start;\n },\n /**\n * @param {number} t current time\n * @param {number} b start value\n * @param {number} c end value\n * @param {number} d duration\n * @return {number}\n */\n bounceOut: (timeOrOffset, start, end, duration = 1) => {\n if ((timeOrOffset /= duration) < 1 / 2.75) {\n return end * (7.5625 * timeOrOffset * timeOrOffset) + start;\n }\n else if (timeOrOffset < 2 / 2.75) {\n return end * (7.5625 * (timeOrOffset -= 1.5 / 2.75) * timeOrOffset + 0.75) + start;\n }\n else if (timeOrOffset < 2.5 / 2.75) {\n return end * (7.5625 * (timeOrOffset -= 2.25 / 2.75) * timeOrOffset + 0.9375) + start;\n }\n return end * (7.5625 * (timeOrOffset -= 2.625 / 2.75) * timeOrOffset + 0.984375) + start;\n },\n /**\n *\n *\n * @param {number} time\n * @param {number} start\n * @param {number} end\n * @param {number} duration\n * @returns\n */\n bounceInOut: (timeOrOffset, start, end, duration = 1) => {\n if (timeOrOffset < duration / 2) {\n return Easings.bounceIn(timeOrOffset * 2, 0, end, duration) * 0.5 + start;\n }\n return Easings.bounceOut(timeOrOffset * 2 - duration, 0, end, duration) * 0.5 + end * 0.5 + start;\n },\n};\nexports.Easings = Easings;\n//# sourceMappingURL=Easings.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UncontrolledLoop = exports.Static = exports.Loop = exports.Compose = exports.Simple = exports.resolveSimpleAnimation = void 0;\nconst composeAnimations_1 = require(\"./composeAnimations\");\nconst createAnimation_1 = require(\"./createAnimation\");\nfunction resolveSimpleAnimation(simpleAnimation) {\n const animation = createAnimation_1.createAnimation(simpleAnimation);\n if (animation) {\n return (propArgumentsOrCurrentTime) => {\n var _a;\n const currentTime = typeof propArgumentsOrCurrentTime === 'number'\n ? propArgumentsOrCurrentTime\n : ((_a = propArgumentsOrCurrentTime.shape.scene) === null || _a === void 0 ? void 0 : _a.currentTime) || 0;\n animation.update(currentTime);\n return animation.value;\n };\n }\n}\nexports.resolveSimpleAnimation = resolveSimpleAnimation;\n// Alias\nexports.Simple = resolveSimpleAnimation;\n// Compose multiple animations\nconst Compose = (animations) => {\n const composed = composeAnimations_1.composeAnimations(animations);\n if (composed) {\n return (propArgumentsOrCurrentTime) => {\n var _a;\n const currentTime = typeof propArgumentsOrCurrentTime === 'number'\n ? propArgumentsOrCurrentTime\n : ((_a = propArgumentsOrCurrentTime.shape.scene) === null || _a === void 0 ? void 0 : _a.currentTime) || 0;\n return composed(currentTime);\n };\n }\n};\nexports.Compose = Compose;\nconst Loop = (loopAnimation) => {\n const simpleAnimation = loopAnimation;\n if (typeof simpleAnimation.interpolator === 'undefined') {\n simpleAnimation.interpolator = 'wave';\n }\n if (simpleAnimation.interpolator) {\n if (typeof simpleAnimation.interpolator === 'string') {\n if (simpleAnimation.interpolator !== 'wave') {\n simpleAnimation.direction = 'alternate';\n }\n }\n else if (typeof simpleAnimation.interpolator === 'object' && simpleAnimation.interpolator.type !== 'wave') {\n simpleAnimation.direction = 'alternate';\n }\n }\n simpleAnimation.loop = true;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.Loop = Loop;\nconst Static = (staticAnimation) => {\n const simpleAnimation = staticAnimation;\n simpleAnimation.direction = 'normal';\n simpleAnimation.loop = false;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.Static = Static;\nconst UncontrolledLoop = (uncontrolledLoopAnimation) => {\n const simpleAnimation = uncontrolledLoopAnimation;\n simpleAnimation.direction = 'normal';\n simpleAnimation.loop = true;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.UncontrolledLoop = UncontrolledLoop;\n//# sourceMappingURL=Animation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.composeAnimations = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst createAnimation_1 = require(\"./createAnimation\");\nconst utilities_1 = require(\"./utilities\");\n/**\n *\n *\n * @export\n * @param {Array} simpleAnimations\n * @return {*} {(((currentTime: number) => string | number | Array | undefined) | undefined)}\n */\nfunction composeAnimations(simpleAnimations) {\n const animations = simpleAnimations.map(createAnimation_1.createAnimation).filter(a => typeof a !== 'undefined');\n const animationsLength = animations.length;\n if (animationsLength > 0) {\n return (currentTime) => {\n let value = undefined;\n for (let i = 0; i < animationsLength; i++) {\n const animation = animations[i];\n animation.update(currentTime);\n value = typeof value === 'undefined' ? animation.value : interpolate(value, animation.value);\n }\n return value;\n };\n }\n}\nexports.composeAnimations = composeAnimations;\nfunction interpolate(a, b, offset = 0.5) {\n const from = Array.isArray(a) ? a : [a];\n const to = Array.isArray(b) ? b : [b];\n const results = [];\n for (let i = 0, len = from.length; i < len; i++) {\n if (typeof from[i] !== typeof to[i]) {\n console.error('[@urpflanze/animation]: cannot interpolate');\n return undefined;\n }\n else {\n if (typeof from[i] !== 'string') {\n const a = from[i], b = to[i];\n results.push(a + offset * (b - a));\n }\n else {\n const a = from[i];\n const b = to[i];\n const parsed_a = color_1.parseColorAndConvert(a);\n const parsed_b = color_1.parseColorAndConvert(b);\n if (typeof parsed_a !== 'undefined' && typeof parsed_b !== 'undefined') {\n results.push(utilities_1.interpolateColorRGB(parsed_a, parsed_b, offset));\n }\n }\n }\n }\n return results.length === 1 ? results[0] : results;\n}\n//# sourceMappingURL=composeAnimations.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BrowserDrawerCanvas = void 0;\nconst DrawerCanvas_1 = require(\"../DrawerCanvas\");\nconst utils_1 = require(\"../utils\");\n/**\n *\n * @category DrawerCanvas\n * @class BrowserDrawerCanvas\n * @extends {DrawerCanvas}\n */\nclass BrowserDrawerCanvas extends DrawerCanvas_1.DrawerCanvas {\n constructor(scene, canvasOrContainer, drawerOptions, duration = 60000, framerate = 60) {\n super(scene, canvasOrContainer, drawerOptions, duration, framerate);\n this.dpi = 1;\n this.dpi = (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.dpi) || 1;\n this.draw_id = null;\n this.redraw_id = null;\n this.animation_id = null;\n this.draw = this.draw.bind(this);\n this.animate = this.animate.bind(this);\n this.startAnimation = this.startAnimation.bind(this);\n this.resize(this.drawerOptions.width, this.drawerOptions.height);\n }\n resize(width, height, sceneFit, dpi = this.dpi) {\n this.drawerOptions.width = width * dpi;\n this.drawerOptions.height = height * dpi;\n if (this.canvas) {\n this.canvas.width = width * dpi;\n this.canvas.height = height * dpi;\n if (utils_1.bBrowser && this.canvas instanceof HTMLCanvasElement) {\n this.canvas.style.width = width + 'px';\n this.canvas.style.height = height + 'px';\n }\n }\n if (typeof sceneFit !== 'undefined') {\n this.drawerOptions.sceneFit = sceneFit;\n }\n this.dispatch('drawer-canvas:resize');\n }\n /**\n * Internal tick animation\n */\n animate(timestamp) {\n if (this.timeline.bSequenceStarted()) {\n this.animation_id = requestAnimationFrame(this.animate);\n if (this.timeline.tick(timestamp))\n this.draw();\n }\n }\n /**\n * Start animation drawing\n */\n startAnimation() {\n this.stopAnimation();\n this.timeline.start();\n this.animation_id = requestAnimationFrame(this.animate);\n }\n /**\n * Stop animation drawing\n */\n stopAnimation() {\n this.timeline.stop();\n if (this.animation_id)\n cancelAnimationFrame(this.animation_id);\n }\n /**\n * Pause animation drawing\n */\n pauseAnimation() {\n this.timeline.pause();\n if (this.animation_id)\n cancelAnimationFrame(this.animation_id);\n }\n /**\n * Play animation drawing\n */\n playAnimation() {\n this.timeline.start();\n requestAnimationFrame(this.animate);\n }\n redraw() {\n if (!this.timeline.bSequenceStarted()) {\n this.draw_id && cancelAnimationFrame(this.draw_id);\n if (typeof this.drawerOptions.ghosts === undefined || this.drawerOptions.ghosts === 0)\n this.timeline.stop();\n this.draw_id = requestAnimationFrame(this.draw);\n }\n else if (typeof this.drawerOptions.ghosts === undefined || this.drawerOptions.ghosts === 0) {\n this.stopAnimation();\n this.redraw_id && cancelAnimationFrame(this.redraw_id);\n this.redraw_id = requestAnimationFrame(this.startAnimation);\n }\n }\n}\nexports.BrowserDrawerCanvas = BrowserDrawerCanvas;\n//# sourceMappingURL=BrowserDrawerCanvas.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DrawerCanvas = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nconst math_1 = require(\"@urpflanze/core/dist/cjs/math\");\nconst Vec2_1 = require(\"@urpflanze/core/dist/cjs/math/Vec2\");\nconst canvas_1 = require(\"canvas\");\nconst Emitter_1 = require(\"./Emitter\");\nconst Timeline_1 = require(\"./Timeline\");\nconst utils_1 = require(\"./utils\");\n/**\n *\n * @category DrawerCanvas\n * @extends {Emitter}\n */\nclass DrawerCanvas extends Emitter_1.Emitter {\n constructor(scene, canvasOrContainer, drawerOptions, duration = 60000, framerate = 60) {\n var _a, _b, _c, _d, _e;\n super();\n this.drawerOptions = {\n width: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.width) || (scene === null || scene === void 0 ? void 0 : scene.width) || 400,\n height: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.height) || (scene === null || scene === void 0 ? void 0 : scene.height) || 400,\n clear: (_a = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.clear) !== null && _a !== void 0 ? _a : true,\n time: (_b = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.time) !== null && _b !== void 0 ? _b : 0,\n simmetricLines: (_c = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.simmetricLines) !== null && _c !== void 0 ? _c : 0,\n noBackground: (_d = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.noBackground) !== null && _d !== void 0 ? _d : false,\n ghosts: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghosts) || 0,\n ghostAlpha: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostAlpha) === false ? false : true,\n ghostSkipTime: (_e = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostSkipTime) !== null && _e !== void 0 ? _e : 30,\n ghostSkipFunction: drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostSkipFunction,\n sceneFit: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.sceneFit) || 'contain',\n backgroundImage: drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.backgroundImage,\n backgroundImageFit: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.backgroundImageFit) || 'cover',\n };\n this.timeline = new Timeline_1.Timeline(duration, framerate);\n this.timeline.setTime(this.drawerOptions.time);\n this.draw_id = null;\n this.redraw_id = null;\n this.animation_id = null;\n if (scene) {\n this.setScene(scene);\n }\n if (!utils_1.bWorker || (utils_1.bWorker && canvasOrContainer instanceof OffscreenCanvas))\n this.setCanvas(canvasOrContainer);\n }\n /**\n * Return option value or default\n *\n * @param {K keyof IDrawerCanvasOptions} name\n * @param {IDrawerCanvasOptions[K]} defaultValue\n */\n getOption(name, defaultValue) {\n var _a;\n return (_a = this.drawerOptions[name]) !== null && _a !== void 0 ? _a : defaultValue;\n }\n /**\n * Create instance of canvas (HTMLCanvasElement in browser o Canvas in Node)\n */\n setCanvas(canvasOrContainer) {\n if (utils_1.bWorker) {\n if (canvasOrContainer instanceof OffscreenCanvas) {\n this.canvas = canvasOrContainer;\n }\n else {\n console.error('Cannot set cavas');\n }\n }\n else {\n if (utils_1.bBrowser) {\n const canvas = canvas_1.createCanvas(this.drawerOptions.width, this.drawerOptions.height);\n if (canvasOrContainer instanceof HTMLElement &&\n !(canvasOrContainer instanceof HTMLCanvasElement || canvasOrContainer instanceof OffscreenCanvas)) {\n this.canvas = canvas;\n while (canvasOrContainer.lastChild)\n canvasOrContainer.removeChild(canvasOrContainer.lastChild);\n canvasOrContainer.appendChild(canvas);\n }\n else {\n this.canvas = typeof canvasOrContainer === 'undefined' ? canvas : canvasOrContainer;\n }\n }\n else {\n this.canvas = canvas_1.createCanvas(this.drawerOptions.width, this.drawerOptions.height);\n }\n }\n if (this.canvas) {\n this.canvas.width = this.drawerOptions.width;\n this.canvas.height = this.drawerOptions.height;\n this.context = this.canvas.getContext('2d', {\n alpha: true,\n // desynchronized: true,\n });\n }\n }\n /**\n * Return instance of canvas\n *\n * @returns canvas\n */\n getCanvas() {\n return this.canvas;\n }\n setScene(scene) {\n this.scene = scene;\n }\n draw() {\n if (this.context === null || typeof this.scene === 'undefined')\n return 0;\n const start_time = Utilities_1.now();\n const timeline = this.timeline;\n const drawAtTime = timeline.getTime();\n const drawerOptions = {\n ...this.drawerOptions,\n ghostIndex: undefined,\n clear: this.drawerOptions.clear || timeline.getCurrentFrame() <= 1,\n time: drawAtTime,\n };\n const currentFrame = timeline.getFrameAtTime(drawAtTime);\n this.dispatch('drawer-canvas:before_draw', {\n currentFrame: currentFrame,\n currentTime: drawAtTime,\n });\n if (drawerOptions.simmetricLines > 0) {\n if (drawerOptions.clear) {\n DrawerCanvas.clear(this.context, drawerOptions.width, drawerOptions.height, drawerOptions.noBackground ? false : this.scene.background, drawerOptions.backgroundImage, drawerOptions.backgroundImageFit);\n }\n DrawerCanvas.drawSimmetricLines(this.context, drawerOptions.simmetricLines, drawerOptions.width, drawerOptions.height, this.scene.color);\n drawerOptions.clear = false;\n }\n if (drawerOptions.ghosts) {\n const ghostDrawerOptions = {\n ...drawerOptions,\n };\n const drawAtTime = timeline.getTime();\n const sequenceDuration = timeline.getDuration();\n const ghostRepetition = {\n offset: 0,\n index: 0,\n count: drawerOptions.ghosts,\n };\n for (let i = 1; i <= drawerOptions.ghosts; i++) {\n ghostRepetition.index = i;\n ghostRepetition.offset = ghostRepetition.index / ghostRepetition.count;\n const ghostTime = drawAtTime -\n (drawerOptions.ghostSkipFunction\n ? drawerOptions.ghostSkipFunction(ghostRepetition, drawAtTime)\n : i * drawerOptions.ghostSkipTime);\n ghostDrawerOptions.ghostIndex = i;\n ghostDrawerOptions.time = math_1.mod(ghostTime, sequenceDuration);\n ghostDrawerOptions.clear = drawerOptions.clear && ghostDrawerOptions.ghostIndex === 1;\n this.realDraw(ghostDrawerOptions);\n }\n drawerOptions.clear = false;\n }\n this.realDraw(drawerOptions);\n return Utilities_1.now() - start_time;\n }\n realDraw(options) {\n var _a;\n const width = this.drawerOptions.width;\n const height = this.drawerOptions.height;\n const context = this.context;\n const scene = this.scene;\n const time = (_a = options.time) !== null && _a !== void 0 ? _a : 0;\n const bGhost = typeof options.ghosts !== 'undefined' &&\n options.ghosts > 0 &&\n typeof options.ghostIndex !== 'undefined' &&\n options.ghostIndex > 0;\n const ghostMultiplier = bGhost ? 1 - options.ghostIndex / (options.ghosts + 0.5) : 0;\n const ghostAlpha = options.ghostAlpha === true;\n const sceneFit = utils_1.fit(scene.width, scene.height, width, height, this.drawerOptions.sceneFit);\n const translateX = sceneFit.x;\n const translateY = sceneFit.y;\n options.clear &&\n DrawerCanvas.clear(context, width, height, options.noBackground ? false : scene.background, options.backgroundImage, options.backgroundImageFit);\n let logFillColorWarn = false;\n let logStrokeColorWarn = false;\n scene.currentTime = time;\n const sceneChilds = scene.getChildren();\n for (let i = 0, len = sceneChilds.length; i < len; i++) {\n const sceneChild = sceneChilds[i];\n if (!sceneChild.data ||\n (!(sceneChild.data.visible === false) && !(bGhost && sceneChild.data.disableGhost === true))) {\n sceneChilds[i].generate(time, true);\n const childIndexedBuffer = sceneChilds[i].getIndexedBuffer() || [];\n const childBuffer = sceneChilds[i].getBuffer() || [];\n let childVertexIndex = 0;\n for (let currentBufferIndex = 0, len = childIndexedBuffer.length; currentBufferIndex < len; currentBufferIndex++) {\n const currentIndexing = childIndexedBuffer[currentBufferIndex];\n const shape = currentIndexing.shape;\n const propArguments = {\n canvasContext: context,\n ...currentIndexing,\n };\n const composite = DrawerCanvas.getStreamDrawerProp(shape, 'composite', propArguments, 'source-over');\n context.globalCompositeOperation = composite;\n context.beginPath();\n context.moveTo(childBuffer[childVertexIndex] * sceneFit.scale + translateX, childBuffer[childVertexIndex + 1] * sceneFit.scale + translateY);\n childVertexIndex += 2;\n for (let currentFrameLength = childVertexIndex + currentIndexing.frameLength - 2; childVertexIndex < currentFrameLength; childVertexIndex += 2)\n context.lineTo(childBuffer[childVertexIndex] * sceneFit.scale + translateX, childBuffer[childVertexIndex + 1] * sceneFit.scale + translateY);\n if (shape.isClosed())\n context.closePath();\n const alpha = DrawerCanvas.getStreamDrawerProp(shape, 'opacity', propArguments, 1);\n context.globalAlpha = alpha;\n const shadowColor = DrawerCanvas.getStreamDrawerProp(shape, 'shadowColor', propArguments);\n const shadowBlur = DrawerCanvas.getStreamDrawerProp(shape, 'shadowBlur', propArguments);\n const shadowOffsetX = DrawerCanvas.getStreamDrawerProp(shape, 'shadowOffsetX', propArguments);\n const shadowOffsetY = DrawerCanvas.getStreamDrawerProp(shape, 'shadowOffsetY', propArguments);\n context.shadowColor = shadowColor;\n context.shadowBlur = shadowBlur;\n shadowOffsetX && (context.shadowOffsetX = shadowOffsetX);\n shadowOffsetY && (context.shadowOffsetY = shadowOffsetY);\n let fill = DrawerCanvas.getStreamDrawerProp(shape, 'fill', propArguments);\n if (typeof fill !== 'undefined') {\n if (bGhost && ghostAlpha) {\n const color = DrawerCanvas.ghostifyColor(fill, ghostMultiplier);\n if (color) {\n fill = color;\n }\n else if (!logFillColorWarn) {\n console.warn(`[Urpflanze:DrawerCanvas] Unable ghost fill color '${fill}',\n\t\t\t\t\t\t\t\tplease enter a rgba or hsla color`);\n logFillColorWarn = true;\n }\n }\n context.fillStyle = fill;\n context.fill();\n }\n let stroke = DrawerCanvas.getStreamDrawerProp(shape, 'stroke', propArguments, typeof fill === 'undefined' ? scene.color : undefined);\n let lineWidth = DrawerCanvas.getStreamDrawerProp(shape, 'lineWidth', propArguments, 1);\n if (stroke) {\n if (bGhost && ghostAlpha) {\n const color = DrawerCanvas.ghostifyColor(stroke, ghostMultiplier);\n if (color) {\n stroke = color;\n }\n else if (!logStrokeColorWarn) {\n console.warn(`[Urpflanze:DrawerCanvas] Unable ghost stroke color '${stroke}',\n\t\t\t\t\t\t\t\tplease enter a rgba or hsla color`);\n logStrokeColorWarn = true;\n }\n lineWidth *= ghostMultiplier;\n }\n const lineJoin = DrawerCanvas.getStreamDrawerProp(shape, 'lineJoin', propArguments);\n const lineCap = DrawerCanvas.getStreamDrawerProp(shape, 'lineCap', propArguments);\n const lineDash = DrawerCanvas.getStreamDrawerProp(shape, 'lineDash', propArguments);\n const lineDashOffset = DrawerCanvas.getStreamDrawerProp(shape, 'lineDashOffset', propArguments);\n const miterLimit = DrawerCanvas.getStreamDrawerProp(shape, 'miterLimit', propArguments);\n context.setLineDash.call(context, lineDash || []);\n context.lineJoin = lineJoin;\n context.lineCap = lineCap;\n context.lineDashOffset = lineDashOffset;\n context.miterLimit = miterLimit;\n context.lineWidth = lineWidth * sceneFit.scale;\n context.strokeStyle = stroke;\n context.stroke();\n }\n }\n context.restore();\n }\n }\n }\n /**\n * Return a drawer value\n *\n * @static\n * @template T\n * @param {ShapePrimitive} shape\n * @param {keyof T} key\n * @param {IDrawerPropArguments} propArguments\n * @param {*} [defaultValue]\n * @returns {*}\n */\n static getStreamDrawerProp(shape, key, propArguments, defaultValue) {\n let attribute = shape.drawer[key];\n if (typeof attribute === 'function') {\n attribute = attribute(propArguments);\n }\n return attribute !== null && attribute !== void 0 ? attribute : defaultValue;\n }\n /**\n * Create color based on ghostMultiplier\n *\n * @static\n * @param {any} color\n * @param {number} ghostMultiplier\n * @return {*} {(string | undefined)}\n */\n static ghostifyColor(color, ghostMultiplier) {\n if (typeof color === 'string' || typeof color === 'number') {\n const parsed = color_1.parseColor(color);\n if (parsed) {\n const ghostAlpha = parsed.alpha * ghostMultiplier;\n return parsed.type === 'rgb'\n ? `rgba(${parsed.a},${parsed.b},${parsed.c},${ghostAlpha})`\n : `hsla(${parsed.a},${parsed.b}%,${parsed.c}%,${ghostAlpha})`;\n }\n }\n return color;\n }\n /**\n * Clear canvas, draw background or image (and fit)\n *\n * @param context\n * @param width\n * @param height\n * @param background\n * @param backgroundImage\n * @param backgroundImageFit\n */\n static clear(context, width, height, background, backgroundImage, backgroundImageFit) {\n if (typeof background === 'boolean' && background === false) {\n context.clearRect(0, 0, width, height);\n }\n else {\n context.globalCompositeOperation = 'source-over';\n context.fillStyle = background; // or true\n context.fillRect(0, 0, width, height);\n if (backgroundImage) {\n const sourceWidth = backgroundImage instanceof SVGImageElement ? backgroundImage.width.baseVal.value : backgroundImage.width;\n const sourceHeight = backgroundImage instanceof SVGImageElement ? backgroundImage.height.baseVal.value : backgroundImage.height;\n const fitRect = utils_1.fit(sourceWidth, sourceHeight, width, height, backgroundImageFit);\n context.drawImage(backgroundImage, fitRect.x, fitRect.y, fitRect.width, fitRect.height);\n }\n }\n }\n /**\n * Draw utility lines\n *\n * @param context\n * @param simmetricLines\n * @param width\n * @param height\n * @param color\n */\n static drawSimmetricLines(context, simmetricLines, width, height, color) {\n const offset = Math.PI / simmetricLines;\n const size = Math.max(width, height);\n const sizeMin = Math.min(width, height);\n const k = width < height ? 1 : 0;\n const centerX = [size / 2, size / 2];\n const centerY = [sizeMin / 2, sizeMin / 2];\n for (let i = 0; i < simmetricLines; i++) {\n const a = [-size, -size];\n const b = [size * 2, size * 2];\n const rotate = i * offset + Math.PI / 4;\n Vec2_1.default.rotateZ(a, i % 2 === k ? centerX : centerY, rotate);\n Vec2_1.default.rotateZ(b, i % 2 === k ? centerX : centerY, rotate);\n context.beginPath();\n context.strokeStyle = color;\n context.lineWidth = 1;\n context.moveTo(a[0], a[1]);\n context.lineTo(b[0], b[1]);\n context.stroke();\n }\n }\n}\nexports.DrawerCanvas = DrawerCanvas;\n// const sourceRatio = sourceWidth / sourceHeight\n// let x = 0,\n// \ty = 0,\n// \tbgWidth = width,\n// \tbgHeight = height\n// if (sourceRatio !== ratio) {\n// \tif (options.backgroundImageFit === 'contain') {\n// \t\tbgWidth = ratio > sourceRatio ? (sourceWidth * height) / sourceHeight : width\n// \t\tbgHeight = ratio > sourceRatio ? height : (sourceHeight * width) / sourceWidth\n// \t} else {\n// \t\tbgWidth = ratio < sourceRatio ? (sourceWidth * height) / sourceHeight : width\n// \t\tbgHeight = ratio < sourceRatio ? height : (sourceHeight * width) / sourceWidth\n// \t}\n// \tx = (width - bgWidth) / 2\n// \ty = (height - bgHeight) / 2\n//# sourceMappingURL=DrawerCanvas.js.map","/* globals document, ImageData */\n\nconst parseFont = require('./lib/parse-font')\n\nexports.parseFont = parseFont\n\nexports.createCanvas = function (width, height) {\n return Object.assign(document.createElement('canvas'), { width: width, height: height })\n}\n\nexports.createImageData = function (array, width, height) {\n // Browser implementation of ImageData looks at the number of arguments passed\n switch (arguments.length) {\n case 0: return new ImageData()\n case 1: return new ImageData(array)\n case 2: return new ImageData(array, width)\n default: return new ImageData(array, width, height)\n }\n}\n\nexports.loadImage = function (src, options) {\n return new Promise(function (resolve, reject) {\n const image = Object.assign(document.createElement('img'), options)\n\n function cleanup () {\n image.onload = null\n image.onerror = null\n }\n\n image.onload = function () { cleanup(); resolve(image) }\n image.onerror = function () { cleanup(); reject(new Error('Failed to load the image \"' + src + '\"')) }\n\n image.src = src\n })\n}\n","'use strict'\n\n/**\n * Font RegExp helpers.\n */\n\nconst weights = 'bold|bolder|lighter|[1-9]00'\n , styles = 'italic|oblique'\n , variants = 'small-caps'\n , stretches = 'ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded'\n , units = 'px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q'\n , string = '\\'([^\\']+)\\'|\"([^\"]+)\"|[\\\\w\\\\s-]+'\n\n// [ [ <‘font-style’> || || <‘font-weight’> || <‘font-stretch’> ]?\n// <‘font-size’> [ / <‘line-height’> ]? <‘font-family’> ]\n// https://drafts.csswg.org/css-fonts-3/#font-prop\nconst weightRe = new RegExp('(' + weights + ') +', 'i')\nconst styleRe = new RegExp('(' + styles + ') +', 'i')\nconst variantRe = new RegExp('(' + variants + ') +', 'i')\nconst stretchRe = new RegExp('(' + stretches + ') +', 'i')\nconst sizeFamilyRe = new RegExp(\n '([\\\\d\\\\.]+)(' + units + ') *'\n + '((?:' + string + ')( *, *(?:' + string + '))*)')\n\n/**\n * Cache font parsing.\n */\n\nconst cache = {}\n\nconst defaultHeight = 16 // pt, common browser default\n\n/**\n * Parse font `str`.\n *\n * @param {String} str\n * @return {Object} Parsed font. `size` is in device units. `unit` is the unit\n * appearing in the input string.\n * @api private\n */\n\nmodule.exports = function (str) {\n // Cached\n if (cache[str]) return cache[str]\n\n // Try for required properties first.\n const sizeFamily = sizeFamilyRe.exec(str)\n if (!sizeFamily) return // invalid\n\n // Default values and required properties\n const font = {\n weight: 'normal',\n style: 'normal',\n stretch: 'normal',\n variant: 'normal',\n size: parseFloat(sizeFamily[1]),\n unit: sizeFamily[2],\n family: sizeFamily[3].replace(/[\"']/g, '').replace(/ *, */g, ',')\n }\n\n // Optional, unordered properties.\n let weight, style, variant, stretch\n // Stop search at `sizeFamily.index`\n let substr = str.substring(0, sizeFamily.index)\n if ((weight = weightRe.exec(substr))) font.weight = weight[1]\n if ((style = styleRe.exec(substr))) font.style = style[1]\n if ((variant = variantRe.exec(substr))) font.variant = variant[1]\n if ((stretch = stretchRe.exec(substr))) font.stretch = stretch[1]\n\n // Convert to device units. (`font.unit` is the original unit)\n // TODO: ch, ex\n switch (font.unit) {\n case 'pt':\n font.size /= 0.75\n break\n case 'pc':\n font.size *= 16\n break\n case 'in':\n font.size *= 96\n break\n case 'cm':\n font.size *= 96.0 / 2.54\n break\n case 'mm':\n font.size *= 96.0 / 25.4\n break\n case '%':\n // TODO disabled because existing unit tests assume 100\n // font.size *= defaultHeight / 100 / 0.75\n break\n case 'em':\n case 'rem':\n font.size *= defaultHeight / 0.75\n break\n case 'q':\n font.size *= 96 / 25.4 / 4\n break\n }\n\n return (cache[str] = font)\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Emitter = void 0;\n/**\n * Class used for emit and dispatch events\n *\n * @category Emitter\n * @abstract\n * @class Emitter\n * @template EventTypes\n */\nclass Emitter {\n constructor() {\n this.callbacks = {};\n }\n /**\n * Attach callback at event\n *\n * @param {keyof EventTypes} e\n * @param {(value: EventTypes[keyof EventTypes]) => any} callback\n * @memberof Emitter\n */\n attach(e, callback) {\n if (!(e in this.callbacks)) {\n this.callbacks[e] = [];\n }\n this.callbacks[e].push(callback);\n }\n /**\n * Remove callbach listener at event\n *\n * @param {keyof EventTypes} e\n * @param {(value: EventTypes[keyof EventTypes]) => void} callback\n * @memberof Emitter\n */\n detach(e, callback) {\n if (e in this.callbacks) {\n const index = this.callbacks[e].indexOf(callback);\n if (index >= 0) {\n this.callbacks[e].splice(index, 1);\n }\n }\n }\n /**\n * Dispatch event\n *\n * @param {keyof EventTypes} e\n * @param {EventTypes[keyof EventTypes]} [params]\n * @memberof Emitter\n */\n dispatch(e, params) {\n if (e in this.callbacks && this.callbacks[e].length > 0) {\n for (let i = 0, len = this.callbacks[e].length; i < len; i++)\n if (this.callbacks[e][i](params) === false)\n break;\n }\n }\n}\nexports.Emitter = Emitter;\n//# sourceMappingURL=Emitter.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Timeline = void 0;\nconst Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nconst math_1 = require(\"@urpflanze/core/dist/cjs/math\");\nconst Emitter_1 = require(\"./Emitter\");\n/**\n * Is used for sequence time management.\n * It is necessary to set the duration and the number of frames per second (frame rate).\n *\n * @category Timeline\n * @class Timeline\n * @extends {Emitter}\n */\nclass Timeline extends Emitter_1.Emitter {\n constructor(duration = 60000, framerate = 30) {\n super();\n this.fps_samples_size = 30;\n this.fps_samples = [];\n this.fps_samples_index = 0;\n this.paused_time = 0;\n this.sequence = {\n duration,\n framerate,\n frames: Math.round((duration / 1000) * framerate),\n };\n this.tick_time = 1000 / this.sequence.framerate;\n this.fps = this.sequence.framerate;\n this.b_sequence_started = false;\n this.currentFrame = 0;\n this.currentTime = 0;\n this.last_tick = 0;\n this.start_time = 0;\n }\n //#region sequence meta\n /**\n * Return the sequence\n *\n * @returns {Sequence}\n */\n getSequence() {\n return { ...this.sequence };\n }\n /**\n * Set Sequence\n *\n * @param {number} duration in ms\n * @param {number} framerate\n * @param {number} atTime\n */\n setSequence(duration, framerate, atTime) {\n this.sequence.duration = duration;\n this.sequence.framerate = framerate;\n this.tick_time = 1000 / this.sequence.framerate;\n this.sequence.frames = Math.round((this.sequence.duration / 1000) * this.sequence.framerate);\n if (typeof atTime !== 'undefined') {\n this.setTime(atTime);\n }\n else {\n this.dispatch('timeline:update_sequence', this.getSequence());\n }\n }\n /**\n * Set duration of timeline\n *\n * @param {number} framerate\n */\n setDuration(duration) {\n this.setSequence(duration, this.sequence.framerate);\n }\n /**\n * Get timeline duration\n *\n * @returns {number}\n */\n getDuration() {\n return this.sequence.duration;\n }\n /**\n * Return framerate\n *\n * @returns {number}\n */\n getFramerate() {\n return this.sequence.framerate;\n }\n /**\n * Set a framerate\n *\n * @param {number} framerate\n */\n setFramerate(framerate) {\n this.setSequence(this.sequence.duration, framerate);\n }\n /**\n * Get number of frames based on duration and framerate\n *\n * @returns {number}\n */\n getFramesCount() {\n return this.sequence.frames;\n }\n //#endregion meta\n //#region change status\n bSequenceStarted() {\n return this.b_sequence_started;\n }\n /**\n * Start the sequence\n *\n */\n start() {\n if (!this.b_sequence_started) {\n this.b_sequence_started = true;\n this.start_time = this.paused_time;\n this.dispatch('timeline:change_status', Timeline.START);\n }\n }\n /**\n * Pause the sequence\n *\n */\n pause() {\n if (this.b_sequence_started) {\n this.paused_time = Utilities_1.now();\n this.b_sequence_started = false;\n this.dispatch('timeline:change_status', Timeline.PAUSE);\n }\n }\n /**\n * Stop the sequence and reset\n *\n */\n stop() {\n if (this.b_sequence_started) {\n this.b_sequence_started = false;\n this.currentTime = 0;\n this.currentFrame = 0;\n this.start_time = 0;\n this.paused_time = 0;\n this.dispatch('timeline:change_status', Timeline.STOP);\n }\n }\n /**\n * Animation tick\n *\n * @param {number} timestamp current timestamp\n * @returns {boolean}\n */\n tick(timestamp) {\n if (this.b_sequence_started) {\n if (!this.start_time) {\n this.start_time = timestamp;\n this.last_tick = -this.tick_time;\n }\n const currentTime = timestamp - this.start_time;\n const elapsed = currentTime - this.last_tick;\n if (elapsed >= this.tick_time) {\n this.calculateFPS(1 / (elapsed / 1000));\n this.last_tick = currentTime;\n this.currentTime = (currentTime - (elapsed % this.tick_time)) % this.sequence.duration;\n this.currentFrame = this.getFrameAtTime(this.currentTime);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n return true;\n }\n }\n return false;\n }\n /**\n * Calculate fps\n *\n * @private\n * @param {number} currentFPS\n */\n calculateFPS(currentFPS) {\n const samples = this.fps_samples.length;\n if (samples > 0) {\n let average = 0;\n for (let i = 0; i < samples; i++)\n average += this.fps_samples[i];\n this.fps = Math.round(average / samples);\n }\n this.fps_samples[this.fps_samples_index] = Math.round(currentFPS);\n this.fps_samples_index = (this.fps_samples_index + 1) % this.fps_samples_size;\n }\n //#endregion\n //#region Frame and Time\n /**\n * Return current animation frame\n *\n * @returns {number}\n */\n getCurrentFrame() {\n return this.currentFrame;\n }\n /**\n * get the time at specific frame number\n *\n * @param {number} frame\n * @returns {number}\n */\n getFrameTime(frame) {\n frame = math_1.mod(frame, this.sequence.frames);\n return (frame * this.tick_time) % this.sequence.duration;\n }\n /**\n * Return frame number at time\n *\n * @param {number} time\n * @returns {number}\n */\n getFrameAtTime(time) {\n return Math.round((time % this.sequence.duration) / this.tick_time);\n }\n /**\n * set current frame\n *\n * @param {number} frame\n */\n setFrame(frame) {\n this.currentFrame = math_1.mod(frame, this.sequence.frames);\n this.currentTime = this.getFrameTime(this.currentFrame);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n }\n /**\n * Return tick time (based on framerate)\n *\n * @returns {number}\n */\n getTickTime() {\n return this.tick_time;\n }\n /**\n * Return the current time\n *\n * @returns {number}\n */\n getTime() {\n return this.currentTime;\n }\n /**\n * Set animation at time\n *\n * @param {number} time\n */\n setTime(time) {\n time = math_1.mod(time, this.sequence.duration);\n this.currentTime = time;\n this.currentFrame = this.getFrameAtTime(time);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n }\n}\nexports.Timeline = Timeline;\n/**\n * Animation status started\n * @internal\n */\nTimeline.START = 'start';\n/**\n * Animation status paused\n * @internal\n */\nTimeline.PAUSE = 'pause';\n/**\n * Animation status stop\n * @internal\n */\nTimeline.STOP = 'stop';\n//# sourceMappingURL=Timeline.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fit = exports.bWorker = exports.bBrowser = exports.bNode = void 0;\nexports.bNode = typeof process !== 'undefined' &&\n typeof process.versions !== 'undefined' &&\n typeof process.versions.node !== 'undefined';\nexports.bBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';\nexports.bWorker = typeof self === 'object' && ['ServiceWorkerGlobalScope', 'DedicatedWorkerGlobalScope'].includes(self.constructor.name);\n/**\n * Utiltites\n *\n * @category Utilities\n * @export\n * @param {number} sourceWidth\n * @param {number} sourceHeight\n * @param {number} destWidth\n * @param {number} destHeight\n * @param {('cover' | 'contain' | 'none')} [fit='none']\n * @return {*} {{ x: number; y: number; width: number; height: number; scale: number }}\n */\nfunction fit(sourceWidth, sourceHeight, destWidth, destHeight, fit = 'none') {\n let x = 0, y = 0, scale = 1, finalWidth = sourceWidth, finalHeight = sourceHeight;\n const ratio = destWidth / destHeight;\n const sourceRatio = sourceWidth / sourceHeight;\n if (fit === 'contain') {\n finalWidth = ratio > sourceRatio ? (sourceWidth * destHeight) / sourceHeight : destWidth;\n finalHeight = ratio > sourceRatio ? destHeight : (sourceHeight * destWidth) / sourceWidth;\n scale = Math.max(finalWidth, finalHeight) / Math.max(sourceWidth, sourceHeight);\n }\n else if (fit === 'cover') {\n finalWidth = ratio < sourceRatio ? (sourceWidth * destHeight) / sourceHeight : destWidth;\n finalHeight = ratio < sourceRatio ? destHeight : (sourceHeight * destWidth) / sourceWidth;\n // scale = Math.min(sourceWidth, sourceHeight) / Math.min(finalWidth, finalHeight)\n scale = Math.max(finalWidth, finalHeight) / Math.max(sourceWidth, sourceHeight);\n }\n else {\n // finalWidth = sourceWidth\n // finalHeight = sourceHeight\n }\n x = (destWidth - finalWidth) / 2;\n y = (destHeight - finalHeight) / 2;\n return {\n x,\n y,\n width: finalWidth,\n height: finalHeight,\n scale,\n };\n}\nexports.fit = fit;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./Timeline\"), exports);\n__exportStar(require(\"./DrawerCanvas\"), exports);\n__exportStar(require(\"./browser/BrowserDrawerCanvas\"), exports);\n__exportStar(require(\"./Renderer\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Renderer = void 0;\nconst ffmpeg_1 = require(\"@ffmpeg/ffmpeg\");\nconst Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nconst JSZip = require(\"jszip\");\nconst browser_1 = require(\"./browser\");\nconst Emitter_1 = require(\"./Emitter\");\nconst utils_1 = require(\"./utils\");\n/**\n * The Renderer is a class for exporting the scene\n *\n * @category Renderer\n * @class Renderer\n * @extends {Emitter}\n */\nclass Renderer extends Emitter_1.Emitter {\n constructor(drawer, ffmpegCorePath) {\n super();\n this.drawer = drawer;\n this.ffmpegCorePath =\n typeof ffmpegCorePath === 'undefined' && drawer instanceof browser_1.default\n ? 'https://unpkg.com/@ffmpeg/core@0.10.0/dist/ffmpeg-core.js'\n : ffmpegCorePath;\n }\n /**\n * Render any frame and create array of zip\n *\n * @param imagesType\n * @param quality\n * @param framesForChunk\n * @returns\n */\n async zip(imagesType = 'image/png', quality = 1, framesForChunk = 600) {\n const startTime = Utilities_1.now();\n const zip = new JSZip();\n const totalFrames = this.drawer.timeline.getFramesCount();\n const chunks = Math.ceil(totalFrames / framesForChunk);\n this.dispatch('renderer:zip_start', { chunks, totalFrames, framesForChunk });\n const extension = imagesType === 'image/jpeg' ? '.jpg' : '.png';\n const zipParts = [];\n let totalRenderTime = 0;\n for (let chunk = 0, rendered = 1; chunk < chunks; chunk++) {\n for (let frameIndex = 0; frameIndex < framesForChunk; frameIndex++, rendered++) {\n const frame = frameIndex + chunk * framesForChunk;\n if (frame < totalFrames) {\n const renderStartTime = Utilities_1.now();\n const frameName = frame.toString().padStart(5, '0') + extension;\n const blob = await this.frame(frame, imagesType, quality);\n const buffer = (await (utils_1.bNode ? blob : blob.arrayBuffer()));\n zip.file(frameName, new Uint8Array(buffer, 0, buffer.byteLength));\n const currentTime = Utilities_1.now();\n const renderTime = currentTime - renderStartTime;\n totalRenderTime += renderTime;\n this.dispatch('renderer:zip_progress', {\n chunk: chunk + 1,\n frame: frame + 1,\n totalFrames,\n framesForChunk,\n totalChunks: chunks,\n renderTime,\n remainingTime: (totalFrames - rendered) * (totalRenderTime / rendered),\n elapsedTime: currentTime - startTime,\n });\n }\n }\n this.dispatch('renderer:zip_preparing');\n zipParts.push(await zip.generateAsync({ type: 'uint8array' }));\n }\n return zipParts;\n }\n /**\n * Render animation\n *\n * @param type render type\n * @param quality\n * @param ffmpegLogger\n * @param ffmpegProgress\n * @returns\n */\n async render(type = 'video/mp4', quality = 1, ffmpegLogger, ffmpegProgress) {\n const startTime = Utilities_1.now();\n const totalFrames = this.drawer.timeline.getFramesCount();\n const framerate = this.drawer.timeline.getFramerate();\n const duration = this.drawer.timeline.getDuration();\n this.dispatch('renderer:video_init', { totalFrames, framerate, duration, type });\n if (!this.ffmpeg) {\n const ffmpegOptions = {\n log: false,\n };\n if (this.ffmpegCorePath)\n ffmpegOptions.corePath = this.ffmpegCorePath;\n if (ffmpegLogger)\n ffmpegOptions.logger = ffmpegLogger;\n if (ffmpegProgress)\n ffmpegOptions.progress = ffmpegProgress;\n this.ffmpeg = ffmpeg_1.createFFmpeg(ffmpegOptions);\n await this.ffmpeg.load();\n }\n let totalRenderTime = 0;\n this.dispatch('renderer:video_start', { totalFrames, framerate, duration, type });\n for (let frame = 0; frame < totalFrames; frame++) {\n const renderStartTime = Utilities_1.now();\n const blob = await this.frame(frame, 'image/jpeg', quality);\n const buffer = (await (utils_1.bNode ? blob : blob.arrayBuffer()));\n const frameName = frame.toString().padStart(5, '0') + '.jpg';\n this.ffmpeg.FS('writeFile', frameName, new Uint8Array(buffer, 0, buffer.byteLength));\n const currentTime = Utilities_1.now();\n const renderTime = currentTime - renderStartTime;\n totalRenderTime += renderTime;\n this.dispatch('renderer:video_progress', {\n totalFrames,\n frame: frame + 1,\n renderTime,\n duration,\n remainingTime: (totalFrames - frame) * (totalRenderTime / (frame + 1)),\n elapsedTime: currentTime - startTime,\n });\n }\n const args = ['-r', framerate.toString(), '-i', '%05d.jpg'];\n let outExt = 'mp4';\n switch (type) {\n case 'video/webm':\n args.push('-c:v', 'libvpx');\n args.push('-row-mt', '1');\n args.push('-pix_fmt', 'yuv420p');\n outExt = 'webm';\n break;\n case 'video/mp4':\n args.push('-c:v', 'libx264');\n args.push('-pix_fmt', 'yuv420p');\n outExt = 'mp4';\n break;\n case 'gif':\n args.push('-loop', '0');\n outExt = 'gif';\n break;\n }\n const outName = 'out.' + outExt;\n args.push(outName);\n this.dispatch('renderer:video_preparing');\n await this.ffmpeg.run(...args);\n const result = await this.ffmpeg.FS('readFile', outName);\n return result;\n }\n /**\n * Render frame `frameNumber` to Blob or Buffer\n *\n * @param frameNumber frame to render\n * @param mime image type\n * @param options quality or options\n * @returns Promise of Blob for browser or Buffer for Node\n */\n frame(frameNumber, mime = 'image/png', options = 1) {\n if (!this.drawer.getOption('clear', true)) {\n for (let i = 0; i <= frameNumber; i++) {\n this.drawer.timeline.setFrame(i);\n this.drawer.draw();\n }\n }\n else {\n this.drawer.timeline.setFrame(frameNumber);\n this.drawer.draw();\n }\n return this.blobOrBuffer(mime, options);\n }\n /**\n * Render frame at time to Blob or Buffer\n *\n * @param time animation time\n * @param mime image type\n * @param options quality or options\n * @returns Promise of Blob for browser or Buffer for Node\n */\n frameAtTime(time, mime = 'image/png', options = 1) {\n return this.frame(this.drawer.timeline.getFrameAtTime(time), mime, options);\n }\n /**\n * Render frame number to DataUrl\n *\n * @param frameNumber frame to render\n * @param mime image type\n * @param options quality or options\n * @returns string image\n */\n frameToDataUrl(frameNumber, mime = 'image/png', options = 1) {\n if (!this.drawer.getOption('clear', true)) {\n for (let i = 0; i <= frameNumber; i++) {\n this.drawer.timeline.setFrame(i);\n this.drawer.draw();\n }\n }\n else {\n this.drawer.timeline.setFrame(frameNumber);\n this.drawer.draw();\n }\n return this.toDataUrl(mime, options);\n }\n /**\n * Render a frame at `time` to DataUrl\n *\n * @param time of animation\n * @param mime image type\n * @param options quality or options\n * @returns string image\n */\n frameAtTimeToDataUrl(time, mime = 'image/png', options = 1) {\n return this.frameToDataUrl(this.drawer.timeline.getFrameAtTime(time), mime, options);\n }\n /**\n * Canvas to DataURL\n *\n * @param mime\n * @param optionsOrQuality\n * @returns\n */\n toDataUrl(mime, optionsOrQuality = 1) {\n const canvas = this.drawer.getCanvas();\n if (canvas) {\n if (utils_1.bBrowser && canvas instanceof OffscreenCanvas) {\n console.warn('Cannot convert toDataURL in OffscreenCanvas');\n }\n else {\n return canvas.toDataURL(mime, optionsOrQuality);\n }\n }\n return null;\n }\n /**\n * Canvas to BoB\n *\n * @param mime\n * @param optionsOrQuality\n * @returns\n */\n blobOrBuffer(mime, optionsOrQuality = 1) {\n const canvas = this.drawer.getCanvas();\n if (canvas === null)\n throw new Error('Canvas not setted into Drawer');\n if (utils_1.bNode) {\n // TODO default node quality for jpeg and png\n switch (mime) {\n case 'image/png': {\n const pngConf = typeof optionsOrQuality === 'number'\n ? {\n compressionLevel: (9 - Utilities_1.clamp(0, 1, optionsOrQuality) * 9),\n }\n : optionsOrQuality;\n return Promise.resolve(canvas.toBuffer(mime, pngConf));\n }\n case 'image/jpeg': {\n const jpegConf = typeof optionsOrQuality === 'number'\n ? {\n quality: optionsOrQuality,\n }\n : optionsOrQuality;\n return Promise.resolve(canvas.toBuffer(mime, jpegConf));\n }\n }\n }\n if (canvas instanceof OffscreenCanvas) {\n return canvas.convertToBlob({ type: mime, quality: typeof optionsOrQuality === 'number' ? optionsOrQuality : 1 });\n }\n return new Promise(resolve => {\n ;\n canvas.toBlob(blob => {\n if (blob)\n resolve(blob);\n else\n throw new Error('Blob error');\n }, mime, typeof optionsOrQuality === 'number' ? optionsOrQuality : 1);\n });\n }\n}\nexports.Renderer = Renderer;\n//# sourceMappingURL=Renderer.js.map","require('regenerator-runtime/runtime');\nconst createFFmpeg = require('./createFFmpeg');\nconst { fetchFile } = require('./node');\n\nmodule.exports = {\n /*\n * Create ffmpeg instance.\n * Each ffmpeg instance owns an isolated MEMFS and works\n * independently.\n *\n * For example:\n *\n * ```\n * const ffmpeg = createFFmpeg({\n * log: true,\n * logger: () => {},\n * progress: () => {},\n * corePath: '',\n * })\n * ```\n *\n * For the usage of these four arguments, check config.js\n *\n */\n createFFmpeg,\n /*\n * Helper function for fetching files from various resource.\n * Sometimes the video/audio file you want to process may located\n * in a remote URL and somewhere in your local file system.\n *\n * This helper function helps you to fetch to file and return an\n * Uint8Array variable for ffmpeg.wasm to consume.\n *\n */\n fetchFile,\n};\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","const { defaultArgs, baseOptions } = require('./config');\nconst { setLogging, setCustomLogger, log } = require('./utils/log');\nconst parseProgress = require('./utils/parseProgress');\nconst parseArgs = require('./utils/parseArgs');\nconst { defaultOptions, getCreateFFmpegCore } = require('./node');\nconst { version } = require('../package.json');\n\nconst NO_LOAD = Error('ffmpeg.wasm is not ready, make sure you have completed load().');\n\nmodule.exports = (_options = {}) => {\n const {\n log: logging,\n logger,\n progress: optProgress,\n ...options\n } = {\n ...baseOptions,\n ...defaultOptions,\n ..._options,\n };\n let Core = null;\n let ffmpeg = null;\n let runResolve = null;\n let running = false;\n let progress = optProgress;\n const detectCompletion = (message) => {\n if (message === 'FFMPEG_END' && runResolve !== null) {\n runResolve();\n runResolve = null;\n running = false;\n }\n };\n const parseMessage = ({ type, message }) => {\n log(type, message);\n parseProgress(message, progress);\n detectCompletion(message);\n };\n\n /*\n * Load ffmpeg.wasm-core script.\n * In browser environment, the ffmpeg.wasm-core script is fetch from\n * CDN and can be assign to a local path by assigning `corePath`.\n * In node environment, we use dynamic require and the default `corePath`\n * is `$ffmpeg/core`.\n *\n * Typically the load() func might take few seconds to minutes to complete,\n * better to do it as early as possible.\n *\n */\n const load = async () => {\n log('info', 'load ffmpeg-core');\n if (Core === null) {\n log('info', 'loading ffmpeg-core');\n /*\n * In node environment, all paths are undefined as there\n * is no need to set them.\n */\n const {\n createFFmpegCore,\n corePath,\n workerPath,\n wasmPath,\n } = await getCreateFFmpegCore(options);\n Core = await createFFmpegCore({\n /*\n * Assign mainScriptUrlOrBlob fixes chrome extension web worker issue\n * as there is no document.currentScript in the context of content_scripts\n */\n mainScriptUrlOrBlob: corePath,\n printErr: (message) => parseMessage({ type: 'fferr', message }),\n print: (message) => parseMessage({ type: 'ffout', message }),\n /*\n * locateFile overrides paths of files that is loaded by main script (ffmpeg-core.js).\n * It is critical for browser environment and we override both wasm and worker paths\n * as we are using blob URL instead of original URL to avoid cross origin issues.\n */\n locateFile: (path, prefix) => {\n if (typeof window !== 'undefined') {\n if (typeof wasmPath !== 'undefined'\n && path.endsWith('ffmpeg-core.wasm')) {\n return wasmPath;\n }\n if (typeof workerPath !== 'undefined'\n && path.endsWith('ffmpeg-core.worker.js')) {\n return workerPath;\n }\n }\n return prefix + path;\n },\n });\n ffmpeg = Core.cwrap('proxy_main', 'number', ['number', 'number']);\n log('info', 'ffmpeg-core loaded');\n } else {\n throw Error('ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.');\n }\n };\n\n /*\n * Determine whether the Core is loaded.\n */\n const isLoaded = () => Core !== null;\n\n /*\n * Run ffmpeg command.\n * This is the major function in ffmpeg.wasm, you can just imagine it\n * as ffmpeg native cli and what you need to pass is the same.\n *\n * For example, you can convert native command below:\n *\n * ```\n * $ ffmpeg -i video.avi -c:v libx264 video.mp4\n * ```\n *\n * To\n *\n * ```\n * await ffmpeg.run('-i', 'video.avi', '-c:v', 'libx264', 'video.mp4');\n * ```\n *\n */\n const run = (..._args) => {\n log('info', `run ffmpeg command: ${_args.join(' ')}`);\n if (Core === null) {\n throw NO_LOAD;\n } else if (running) {\n throw Error('ffmpeg.wasm can only run one command at a time');\n } else {\n running = true;\n return new Promise((resolve) => {\n const args = [...defaultArgs, ..._args].filter((s) => s.length !== 0);\n runResolve = resolve;\n ffmpeg(...parseArgs(Core, args));\n });\n }\n };\n\n /*\n * Run FS operations.\n * For input/output file of ffmpeg.wasm, it is required to save them to MEMFS\n * first so that ffmpeg.wasm is able to consume them. Here we rely on the FS\n * methods provided by Emscripten.\n *\n * Common methods to use are:\n * ffmpeg.FS('writeFile', 'video.avi', new Uint8Array(...)): writeFile writes\n * data to MEMFS. You need to use Uint8Array for binary data.\n * ffmpeg.FS('readFile', 'video.mp4'): readFile from MEMFS.\n * ffmpeg.FS('unlink', 'video.map'): delete file from MEMFS.\n *\n * For more info, check https://emscripten.org/docs/api_reference/Filesystem-API.html\n *\n */\n const FS = (method, ...args) => {\n log('info', `run FS.${method} ${args.map((arg) => (typeof arg === 'string' ? arg : `<${arg.length} bytes binary file>`)).join(' ')}`);\n if (Core === null) {\n throw NO_LOAD;\n } else {\n let ret = null;\n try {\n ret = Core.FS[method](...args);\n } catch (e) {\n if (method === 'readdir') {\n throw Error(`ffmpeg.FS('readdir', '${args[0]}') error. Check if the path exists, ex: ffmpeg.FS('readdir', '/')`);\n } else if (method === 'readFile') {\n throw Error(`ffmpeg.FS('readFile', '${args[0]}') error. Check if the path exists`);\n } else {\n throw Error('Oops, something went wrong in FS operation.');\n }\n }\n return ret;\n }\n };\n\n /**\n * forcibly terminate the ffmpeg program.\n */\n const exit = () => {\n if (Core === null) {\n throw NO_LOAD;\n } else {\n running = false;\n Core.exit(1);\n Core = null;\n ffmpeg = null;\n runResolve = null;\n }\n };\n\n const setProgress = (_progress) => {\n progress = _progress;\n };\n\n const setLogger = (_logger) => {\n setCustomLogger(_logger);\n };\n\n setLogging(logging);\n setCustomLogger(logger);\n\n log('info', `use ffmpeg.wasm v${version}`);\n\n return {\n setProgress,\n setLogger,\n setLogging,\n load,\n isLoaded,\n run,\n exit,\n FS,\n };\n};\n","module.exports = {\n defaultArgs: [\n /* args[0] is always the binary path */\n './ffmpeg',\n /* Disable interaction mode */\n '-nostdin',\n /* Force to override output file */\n '-y',\n ],\n baseOptions: {\n /* Flag to turn on/off log messages in console */\n log: false,\n /*\n * Custom logger to get ffmpeg.wasm output messages.\n * a sample logger looks like this:\n *\n * ```\n * logger = ({ type, message }) => {\n * console.log(type, message);\n * }\n * ```\n *\n * type can be one of following:\n *\n * info: internal workflow debug messages\n * fferr: ffmpeg native stderr output\n * ffout: ffmpeg native stdout output\n */\n logger: () => {},\n /*\n * Progress handler to get current progress of ffmpeg command.\n * a sample progress handler looks like this:\n *\n * ```\n * progress = ({ ratio }) => {\n * console.log(ratio);\n * }\n * ```\n *\n * ratio is a float number between 0 to 1.\n */\n progress: () => {},\n /*\n * Path to find/download ffmpeg.wasm-core,\n * this value should be overwriten by `defaultOptions` in\n * each environment.\n */\n corePath: '',\n },\n};\n","let logging = false;\nlet customLogger = () => {};\n\nconst setLogging = (_logging) => {\n logging = _logging;\n};\n\nconst setCustomLogger = (logger) => {\n customLogger = logger;\n};\n\nconst log = (type, message) => {\n customLogger({ type, message });\n if (logging) {\n console.log(`[${type}] ${message}`);\n }\n};\n\nmodule.exports = {\n logging,\n setLogging,\n setCustomLogger,\n log,\n};\n","let duration = 0;\nlet ratio = 0;\n\nconst ts2sec = (ts) => {\n const [h, m, s] = ts.split(':');\n return (parseFloat(h) * 60 * 60) + (parseFloat(m) * 60) + parseFloat(s);\n};\n\nmodule.exports = (message, progress) => {\n if (typeof message === 'string') {\n if (message.startsWith(' Duration')) {\n const ts = message.split(', ')[0].split(': ')[1];\n const d = ts2sec(ts);\n progress({ duration: d, ratio });\n if (duration === 0 || duration > d) {\n duration = d;\n }\n } else if (message.startsWith('frame') || message.startsWith('size')) {\n const ts = message.split('time=')[1].split(' ')[0];\n const t = ts2sec(ts);\n ratio = t / duration;\n progress({ ratio, time: t });\n } else if (message.startsWith('video:')) {\n progress({ ratio: 1 });\n duration = 0;\n }\n }\n};\n","module.exports = (Core, args) => {\n const argsPtr = Core._malloc(args.length * Uint32Array.BYTES_PER_ELEMENT);\n args.forEach((s, idx) => {\n const buf = Core._malloc(s.length + 1);\n Core.writeAsciiToMemory(s, buf);\n Core.setValue(argsPtr + (Uint32Array.BYTES_PER_ELEMENT * idx), buf, 'i32');\n });\n return [args.length, argsPtr];\n};\n","const defaultOptions = require('./defaultOptions');\nconst getCreateFFmpegCore = require('./getCreateFFmpegCore');\nconst fetchFile = require('./fetchFile');\n\nmodule.exports = {\n defaultOptions,\n getCreateFFmpegCore,\n fetchFile,\n};\n","const resolveURL = require('resolve-url');\nconst { devDependencies } = require('../../package.json');\n\n/*\n * Default options for browser environment\n */\nmodule.exports = {\n corePath: process.env.NODE_ENV === 'development'\n ? resolveURL('/node_modules/@ffmpeg/core/dist/ffmpeg-core.js')\n : `https://unpkg.com/@ffmpeg/core@${devDependencies['@ffmpeg/core'].substring(1)}/dist/ffmpeg-core.js`,\n};\n","// Copyright 2014 Simon Lydell\r\n// X11 (“MIT”) Licensed. (See LICENSE.)\r\n\r\nvoid (function(root, factory) {\r\n if (typeof define === \"function\" && define.amd) {\r\n define(factory)\r\n } else if (typeof exports === \"object\") {\r\n module.exports = factory()\r\n } else {\r\n root.resolveUrl = factory()\r\n }\r\n}(this, function() {\r\n\r\n function resolveUrl(/* ...urls */) {\r\n var numUrls = arguments.length\r\n\r\n if (numUrls === 0) {\r\n throw new Error(\"resolveUrl requires at least one argument; got none.\")\r\n }\r\n\r\n var base = document.createElement(\"base\")\r\n base.href = arguments[0]\r\n\r\n if (numUrls === 1) {\r\n return base.href\r\n }\r\n\r\n var head = document.getElementsByTagName(\"head\")[0]\r\n head.insertBefore(base, head.firstChild)\r\n\r\n var a = document.createElement(\"a\")\r\n var resolved\r\n\r\n for (var index = 1; index < numUrls; index++) {\r\n a.href = arguments[index]\r\n resolved = a.href\r\n base.href = resolved\r\n }\r\n\r\n head.removeChild(base)\r\n\r\n return resolved\r\n }\r\n\r\n return resolveUrl\r\n\r\n}));\r\n","/* eslint-disable no-undef */\nconst resolveURL = require('resolve-url');\nconst { log } = require('../utils/log');\n\n/*\n * Fetch data from remote URL and convert to blob URL\n * to avoid CORS issue\n */\nconst toBlobURL = async (url, mimeType) => {\n log('info', `fetch ${url}`);\n const buf = await (await fetch(url)).arrayBuffer();\n log('info', `${url} file size = ${buf.byteLength} bytes`);\n const blob = new Blob([buf], { type: mimeType });\n const blobURL = URL.createObjectURL(blob);\n log('info', `${url} blob URL = ${blobURL}`);\n return blobURL;\n};\n\nmodule.exports = async ({ corePath: _corePath }) => {\n if (typeof _corePath !== 'string') {\n throw Error('corePath should be a string!');\n }\n const coreRemotePath = resolveURL(_corePath);\n const corePath = await toBlobURL(\n coreRemotePath,\n 'application/javascript',\n );\n const wasmPath = await toBlobURL(\n coreRemotePath.replace('ffmpeg-core.js', 'ffmpeg-core.wasm'),\n 'application/wasm',\n );\n const workerPath = await toBlobURL(\n coreRemotePath.replace('ffmpeg-core.js', 'ffmpeg-core.worker.js'),\n 'application/javascript',\n );\n if (typeof createFFmpegCore === 'undefined') {\n return new Promise((resolve) => {\n const script = document.createElement('script');\n const eventHandler = () => {\n script.removeEventListener('load', eventHandler);\n log('info', 'ffmpeg-core.js script loaded');\n resolve({\n createFFmpegCore,\n corePath,\n wasmPath,\n workerPath,\n });\n };\n script.src = corePath;\n script.type = 'text/javascript';\n script.addEventListener('load', eventHandler);\n document.getElementsByTagName('head')[0].appendChild(script);\n });\n }\n log('info', 'ffmpeg-core.js script is loaded already');\n return Promise.resolve({\n createFFmpegCore,\n corePath,\n wasmPath,\n workerPath,\n });\n};\n","const resolveURL = require('resolve-url');\n\nconst readFromBlobOrFile = (blob) => (\n new Promise((resolve, reject) => {\n const fileReader = new FileReader();\n fileReader.onload = () => {\n resolve(fileReader.result);\n };\n fileReader.onerror = ({ target: { error: { code } } }) => {\n reject(Error(`File could not be read! Code=${code}`));\n };\n fileReader.readAsArrayBuffer(blob);\n })\n);\n\nmodule.exports = async (_data) => {\n let data = _data;\n if (typeof _data === 'undefined') {\n return new Uint8Array();\n }\n\n if (typeof _data === 'string') {\n /* From base64 format */\n if (/data:_data\\/([a-zA-Z]*);base64,([^\"]*)/.test(_data)) {\n data = atob(_data.split(',')[1])\n .split('')\n .map((c) => c.charCodeAt(0));\n /* From remote server/URL */\n } else {\n const res = await fetch(resolveURL(_data));\n data = await res.arrayBuffer();\n }\n /* From Blob or File */\n } else if (_data instanceof File || _data instanceof Blob) {\n data = await readFromBlobOrFile(_data);\n }\n\n return new Uint8Array(data);\n};\n","/*!\n\nJSZip v3.7.0 - A JavaScript class for generating and reading zip files\n\n\n(c) 2009-2016 Stuart Knightley \nDual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.\n\nJSZip uses the library pako released under the MIT license :\nhttps://github.com/nodeca/pako/blob/master/LICENSE\n*/\n\n!function(e){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=e();else if(\"function\"==typeof define&&define.amd)define([],e);else{(\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:this).JSZip=e()}}(function(){return function s(o,a,f){function u(r,e){if(!a[r]){if(!o[r]){var t=\"function\"==typeof require&&require;if(!e&&t)return t(r,!0);if(d)return d(r,!0);var n=new Error(\"Cannot find module '\"+r+\"'\");throw n.code=\"MODULE_NOT_FOUND\",n}var i=a[r]={exports:{}};o[r][0].call(i.exports,function(e){var t=o[r][1][e];return u(t||e)},i,i.exports,s,o,a,f)}return a[r].exports}for(var d=\"function\"==typeof require&&require,e=0;e>2,s=(3&t)<<4|r>>4,o=1>6:64,a=2>4,r=(15&i)<<4|(s=p.indexOf(e.charAt(a++)))>>2,n=(3&s)<<6|(o=p.indexOf(e.charAt(a++))),u[f++]=t,64!==s&&(u[f++]=r),64!==o&&(u[f++]=n);return u}},{\"./support\":30,\"./utils\":32}],2:[function(e,t,r){\"use strict\";var n=e(\"./external\"),i=e(\"./stream/DataWorker\"),s=e(\"./stream/Crc32Probe\"),o=e(\"./stream/DataLengthProbe\");function a(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}a.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o(\"data_length\")),t=this;return e.on(\"end\",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error(\"Bug : uncompressed data size mismatch\")}),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo(\"compressedSize\",this.compressedSize).withStreamInfo(\"uncompressedSize\",this.uncompressedSize).withStreamInfo(\"crc32\",this.crc32).withStreamInfo(\"compression\",this.compression)}},a.createWorkerFrom=function(e,t,r){return e.pipe(new s).pipe(new o(\"uncompressedSize\")).pipe(t.compressWorker(r)).pipe(new o(\"compressedSize\")).withStreamInfo(\"compression\",t)},t.exports=a},{\"./external\":6,\"./stream/Crc32Probe\":25,\"./stream/DataLengthProbe\":26,\"./stream/DataWorker\":27}],3:[function(e,t,r){\"use strict\";var n=e(\"./stream/GenericWorker\");r.STORE={magic:\"\\0\\0\",compressWorker:function(e){return new n(\"STORE compression\")},uncompressWorker:function(){return new n(\"STORE decompression\")}},r.DEFLATE=e(\"./flate\")},{\"./flate\":7,\"./stream/GenericWorker\":28}],4:[function(e,t,r){\"use strict\";var n=e(\"./utils\"),o=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?\"string\"!==n.getTypeOf(e)?function(e,t,r){var n=o,i=0+r;e^=-1;for(var s=0;s>>8^n[255&(e^t[s])];return-1^e}(0|t,e,e.length):function(e,t,r){var n=o,i=0+r;e^=-1;for(var s=0;s>>8^n[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length):0}},{\"./utils\":32}],5:[function(e,t,r){\"use strict\";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){\"use strict\";var n;n=\"undefined\"!=typeof Promise?Promise:e(\"lie\"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,r){\"use strict\";var n=\"undefined\"!=typeof Uint8Array&&\"undefined\"!=typeof Uint16Array&&\"undefined\"!=typeof Uint32Array,i=e(\"pako\"),s=e(\"./utils\"),o=e(\"./stream/GenericWorker\"),a=n?\"uint8array\":\"array\";function f(e,t){o.call(this,\"FlateWorker/\"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}r.magic=\"\\b\\0\",s.inherits(f,o),f.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,e.data),!1)},f.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},f.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},f.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(e){return new f(\"Deflate\",e)},r.uncompressWorker=function(){return new f(\"Inflate\",{})}},{\"./stream/GenericWorker\":28,\"./utils\":32,pako:38}],8:[function(e,t,r){\"use strict\";function O(e,t){var r,n=\"\";for(r=0;r>>=8;return n}function i(e,t,r,n,i,s){var o,a,f=e.file,u=e.compression,d=s!==D.utf8encode,h=I.transformTo(\"string\",s(f.name)),l=I.transformTo(\"string\",D.utf8encode(f.name)),c=f.comment,p=I.transformTo(\"string\",s(c)),m=I.transformTo(\"string\",D.utf8encode(c)),_=l.length!==f.name.length,w=m.length!==c.length,v=\"\",g=\"\",y=\"\",b=f.dir,k=f.date,x={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(x.crc32=e.crc32,x.compressedSize=e.compressedSize,x.uncompressedSize=e.uncompressedSize);var S=0;t&&(S|=8),d||!_&&!w||(S|=2048);var E,z=0,C=0;b&&(z|=16),\"UNIX\"===i?(C=798,z|=((E=f.unixPermissions)||(E=b?16893:33204),(65535&E)<<16)):(C=20,z|=63&(f.dosPermissions||0)),o=k.getUTCHours(),o<<=6,o|=k.getUTCMinutes(),o<<=5,o|=k.getUTCSeconds()/2,a=k.getUTCFullYear()-1980,a<<=4,a|=k.getUTCMonth()+1,a<<=5,a|=k.getUTCDate(),_&&(v+=\"up\"+O((g=O(1,1)+O(B(h),4)+l).length,2)+g),w&&(v+=\"uc\"+O((y=O(1,1)+O(B(p),4)+m).length,2)+y);var A=\"\";return A+=\"\\n\\0\",A+=O(S,2),A+=u.magic,A+=O(o,2),A+=O(a,2),A+=O(x.crc32,4),A+=O(x.compressedSize,4),A+=O(x.uncompressedSize,4),A+=O(h.length,2),A+=O(v.length,2),{fileRecord:T.LOCAL_FILE_HEADER+A+h+v,dirRecord:T.CENTRAL_FILE_HEADER+O(C,2)+A+O(p.length,2)+\"\\0\\0\\0\\0\"+O(z,4)+O(n,4)+h+v+p}}var I=e(\"../utils\"),s=e(\"../stream/GenericWorker\"),D=e(\"../utf8\"),B=e(\"../crc32\"),T=e(\"../signature\");function n(e,t,r,n){s.call(this,\"ZipFileWorker\"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}I.inherits(n,s),n.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,s.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},n.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},n.prototype.closedSource=function(e){this.accumulate=!1;var t,r=this.streamFiles&&!e.file.dir,n=i(e,r,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),r)this.push({data:(t=e,T.DATA_DESCRIPTOR+O(t.crc32,4)+O(t.compressedSize,4)+O(t.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},n.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo(\"string\",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{\"../utils\":32}],19:[function(e,t,r){\"use strict\";var n=e(\"./Uint8ArrayReader\");function i(e){n.call(this,e)}e(\"../utils\").inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{\"../utils\":32,\"./Uint8ArrayReader\":21}],20:[function(e,t,r){\"use strict\";var n=e(\"./DataReader\");function i(e){n.call(this,e)}e(\"../utils\").inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{\"../utils\":32,\"./DataReader\":18}],21:[function(e,t,r){\"use strict\";var n=e(\"./ArrayReader\");function i(e){n.call(this,e)}e(\"../utils\").inherits(i,n),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{\"../utils\":32,\"./ArrayReader\":17}],22:[function(e,t,r){\"use strict\";var n=e(\"../utils\"),i=e(\"../support\"),s=e(\"./ArrayReader\"),o=e(\"./StringReader\"),a=e(\"./NodeBufferReader\"),f=e(\"./Uint8ArrayReader\");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),\"string\"!==t||i.uint8array?\"nodebuffer\"===t?new a(e):i.uint8array?new f(n.transformTo(\"uint8array\",e)):new s(n.transformTo(\"array\",e)):new o(e)}},{\"../support\":30,\"../utils\":32,\"./ArrayReader\":17,\"./NodeBufferReader\":19,\"./StringReader\":20,\"./Uint8ArrayReader\":21}],23:[function(e,t,r){\"use strict\";r.LOCAL_FILE_HEADER=\"PK\u0003\u0004\",r.CENTRAL_FILE_HEADER=\"PK\u0001\u0002\",r.CENTRAL_DIRECTORY_END=\"PK\u0005\u0006\",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR=\"PK\u0006\u0007\",r.ZIP64_CENTRAL_DIRECTORY_END=\"PK\u0006\u0006\",r.DATA_DESCRIPTOR=\"PK\u0007\\b\"},{}],24:[function(e,t,r){\"use strict\";var n=e(\"./GenericWorker\"),i=e(\"../utils\");function s(e){n.call(this,\"ConvertWorker to \"+e),this.destType=e}i.inherits(s,n),s.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],25:[function(e,t,r){\"use strict\";var n=e(\"./GenericWorker\"),i=e(\"../crc32\");function s(){n.call(this,\"Crc32Probe\"),this.withStreamInfo(\"crc32\",0)}e(\"../utils\").inherits(s,n),s.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=s},{\"../crc32\":4,\"../utils\":32,\"./GenericWorker\":28}],26:[function(e,t,r){\"use strict\";var n=e(\"../utils\"),i=e(\"./GenericWorker\");function s(e){i.call(this,\"DataLengthProbe for \"+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(s,i),s.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],27:[function(e,t,r){\"use strict\";var n=e(\"../utils\"),i=e(\"./GenericWorker\");function s(e){i.call(this,\"DataWorker\");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=\"\",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}n.inherits(s,i),s.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case\"string\":e=this.data.substring(this.index,t);break;case\"uint8array\":e=this.data.subarray(this.index,t);break;case\"array\":case\"nodebuffer\":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],28:[function(e,t,r){\"use strict\";function n(e){this.name=e||\"default\",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit(\"data\",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit(\"end\"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit(\"error\",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit(\"error\",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r \"+e:e}},t.exports=n},{}],29:[function(e,t,r){\"use strict\";var u=e(\"../utils\"),i=e(\"./ConvertWorker\"),s=e(\"./GenericWorker\"),d=e(\"../base64\"),n=e(\"../support\"),o=e(\"../external\"),a=null;if(n.nodestream)try{a=e(\"../nodejs/NodejsStreamOutputAdapter\")}catch(e){}function f(e,t,r){var n=t;switch(t){case\"blob\":case\"arraybuffer\":n=\"uint8array\";break;case\"base64\":n=\"string\"}try{this._internalType=n,this._outputType=t,this._mimeType=r,u.checkSupport(n),this._worker=e.pipe(new i(n)),e.lock()}catch(e){this._worker=new s(\"error\"),this._worker.error(e)}}f.prototype={accumulate:function(e){return a=this,f=e,new o.Promise(function(t,r){var n=[],i=a._internalType,s=a._outputType,o=a._mimeType;a.on(\"data\",function(e,t){n.push(e),f&&f(t)}).on(\"error\",function(e){n=[],r(e)}).on(\"end\",function(){try{var e=function(e,t,r){switch(e){case\"blob\":return u.newBlob(u.transformTo(\"arraybuffer\",t),r);case\"base64\":return d.encode(t);default:return u.transformTo(e,t)}}(s,function(e,t){var r,n=0,i=null,s=0;for(r=0;r>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t}(e)},s.utf8decode=function(e){return f.nodebuffer?a.transformTo(\"nodebuffer\",e).toString(\"utf-8\"):function(e){var t,r,n,i,s=e.length,o=new Array(2*s);for(t=r=0;t>10&1023,o[r++]=56320|1023&n)}return o.length!==r&&(o.subarray?o=o.subarray(0,r):o.length=r),a.applyFromCharCode(o)}(e=a.transformTo(f.uint8array?\"uint8array\":\"array\",e))},a.inherits(o,n),o.prototype.processChunk=function(e){var t=a.transformTo(f.uint8array?\"uint8array\":\"array\",e.data);if(this.leftOver&&this.leftOver.length){if(f.uint8array){var r=t;(t=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),t.set(r,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var n=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+u[e[r]]>t?r:t}(t),i=t;n!==t.length&&(f.uint8array?(i=t.subarray(0,n),this.leftOver=t.subarray(n,t.length)):(i=t.slice(0,n),this.leftOver=t.slice(n,t.length))),this.push({data:s.utf8decode(i),meta:e.meta})},o.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=o,a.inherits(d,n),d.prototype.processChunk=function(e){this.push({data:s.utf8encode(e.data),meta:e.meta})},s.Utf8EncodeWorker=d},{\"./nodejsUtils\":14,\"./stream/GenericWorker\":28,\"./support\":30,\"./utils\":32}],32:[function(e,t,a){\"use strict\";var f=e(\"./support\"),u=e(\"./base64\"),r=e(\"./nodejsUtils\"),n=e(\"set-immediate-shim\"),d=e(\"./external\");function i(e){return e}function h(e,t){for(var r=0;r>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||\"/\"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=n(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t},r.buf2binstring=function(e){return d(e,e.length)},r.binstring2buf=function(e){for(var t=new f.Buf8(e.length),r=0,n=t.length;r>10&1023,a[n++]=56320|1023&i)}return d(a,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+u[e[r]]>t?r:t}},{\"./common\":41}],43:[function(e,t,r){\"use strict\";t.exports=function(e,t,r,n){for(var i=65535&e|0,s=e>>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,n){var i=a,s=n+r;e^=-1;for(var o=n;o>>8^i[255&(e^t[o])];return-1^e}},{}],46:[function(e,t,r){\"use strict\";var f,l=e(\"../utils/common\"),u=e(\"./trees\"),c=e(\"./adler32\"),p=e(\"./crc32\"),n=e(\"./messages\"),d=0,h=0,m=-2,i=2,_=8,s=286,o=30,a=19,w=2*s+1,v=15,g=3,y=258,b=y+g+1,k=42,x=113;function S(e,t){return e.msg=n[t],t}function E(e){return(e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(l.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function A(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,C(e.strm)}function O(e,t){e.pending_buf[e.pending++]=t}function I(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function D(e,t){var r,n,i=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match,f=e.strstart>e.w_size-b?e.strstart-(e.w_size-b):0,u=e.window,d=e.w_mask,h=e.prev,l=e.strstart+y,c=u[s+o-1],p=u[s+o];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(u[(r=t)+o]===p&&u[r+o-1]===c&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do{}while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&sf&&0!=--i);return o<=e.lookahead?o:e.lookahead}function B(e){var t,r,n,i,s,o,a,f,u,d,h=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=h+(h-b)){for(l.arraySet(e.window,e.window,h,h,0),e.match_start-=h,e.strstart-=h,e.block_start-=h,t=r=e.hash_size;n=e.head[--t],e.head[t]=h<=n?n-h:0,--r;);for(t=r=h;n=e.prev[--t],e.prev[t]=h<=n?n-h:0,--r;);i+=h}if(0===e.strm.avail_in)break;if(o=e.strm,a=e.window,f=e.strstart+e.lookahead,d=void 0,(u=i)<(d=o.avail_in)&&(d=u),r=0===d?0:(o.avail_in-=d,l.arraySet(a,o.input,o.next_in,d,f),1===o.state.wrap?o.adler=c(o.adler,a,d,f):2===o.state.wrap&&(o.adler=p(o.adler,a,d,f)),o.next_in+=d,o.total_in+=d,d),e.lookahead+=r,e.lookahead+e.insert>=g)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<=g&&(e.ins_h=(e.ins_h<=g)if(n=u._tr_tally(e,e.strstart-e.match_start,e.match_length-g),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=g){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=g&&(e.ins_h=(e.ins_h<=g&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-g,n=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-g),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(B(e),0===e.lookahead&&t===d)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,A(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-b&&(A(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(A(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(A(e,!1),e.strm.avail_out),1)}),new F(4,4,8,4,T),new F(4,5,16,8,T),new F(4,6,32,32,T),new F(4,4,16,16,R),new F(8,16,32,32,R),new F(8,16,128,128,R),new F(8,32,128,256,R),new F(32,128,258,1024,R),new F(32,258,258,4096,R)],r.deflateInit=function(e,t){return P(e,t,_,15,8,0)},r.deflateInit2=P,r.deflateReset=L,r.deflateResetKeep=U,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?m:(e.state.gzhead=t,h):m},r.deflate=function(e,t){var r,n,i,s;if(!e||!e.state||5>8&255),O(n,n.gzhead.time>>16&255),O(n,n.gzhead.time>>24&255),O(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),O(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(O(n,255&n.gzhead.extra.length),O(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=p(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(O(n,0),O(n,0),O(n,0),O(n,0),O(n,0),O(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),O(n,3),n.status=x);else{var o=_+(n.w_bits-8<<4)<<8;o|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(o|=32),o+=31-o%31,n.status=x,I(n,o),0!==n.strstart&&(I(n,e.adler>>>16),I(n,65535&e.adler)),e.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),C(e),i=n.pending,n.pending!==n.pending_buf_size));)O(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),C(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindexi&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),C(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindexi&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&C(e),n.pending+2<=n.pending_buf_size&&(O(n,255&e.adler),O(n,e.adler>>8&255),e.adler=0,n.status=x)):n.status=x),0!==n.pending){if(C(e),0===e.avail_out)return n.last_flush=-1,h}else if(0===e.avail_in&&E(t)<=E(r)&&4!==t)return S(e,-5);if(666===n.status&&0!==e.avail_in)return S(e,-5);if(0!==e.avail_in||0!==n.lookahead||t!==d&&666!==n.status){var a=2===n.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(B(e),0===e.lookahead)){if(t===d)return 1;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(A(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(A(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(A(e,!1),0===e.strm.avail_out)?1:2}(n,t):3===n.strategy?function(e,t){for(var r,n,i,s,o=e.window;;){if(e.lookahead<=y){if(B(e),e.lookahead<=y&&t===d)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=g&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=g?(r=u._tr_tally(e,1,e.match_length-g),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(A(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(A(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(A(e,!1),0===e.strm.avail_out)?1:2}(n,t):f[n.level].func(n,t);if(3!==a&&4!==a||(n.status=666),1===a||3===a)return 0===e.avail_out&&(n.last_flush=-1),h;if(2===a&&(1===t?u._tr_align(n):5!==t&&(u._tr_stored_block(n,0,0,!1),3===t&&(z(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),C(e),0===e.avail_out))return n.last_flush=-1,h}return 4!==t?h:n.wrap<=0?1:(2===n.wrap?(O(n,255&e.adler),O(n,e.adler>>8&255),O(n,e.adler>>16&255),O(n,e.adler>>24&255),O(n,255&e.total_in),O(n,e.total_in>>8&255),O(n,e.total_in>>16&255),O(n,e.total_in>>24&255)):(I(n,e.adler>>>16),I(n,65535&e.adler)),C(e),0=r.w_size&&(0===s&&(z(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new l.Buf8(r.w_size),l.arraySet(u,t,d-r.w_size,r.w_size,0),t=u,d=r.w_size),o=e.avail_in,a=e.next_in,f=e.input,e.avail_in=d,e.next_in=0,e.input=t,B(r);r.lookahead>=g;){for(n=r.strstart,i=r.lookahead-(g-1);r.ins_h=(r.ins_h<>>=y=g>>>24,p-=y,0==(y=g>>>16&255))z[s++]=65535&g;else{if(!(16&y)){if(0==(64&y)){g=m[(65535&g)+(c&(1<>>=y,p-=y),p<15&&(c+=E[n++]<>>=y=g>>>24,p-=y,!(16&(y=g>>>16&255))){if(0==(64&y)){g=_[(65535&g)+(c&(1<>>=y,p-=y,(y=s-o)>3,c&=(1<<(p-=b<<3))-1,e.next_in=n,e.next_out=s,e.avail_in=n>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function s(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new O.Buf16(320),this.work=new O.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=\"\",t.wrap&&(e.adler=1&t.wrap),t.mode=L,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new O.Buf32(n),t.distcode=t.distdyn=new O.Buf32(i),t.sane=1,t.back=-1,N):U}function a(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,o(e)):U}function f(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=s.wsize?(O.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(n<(i=s.wsize-s.wnext)&&(i=n),O.arraySet(s.window,t,r-n,i,s.wnext),(n-=i)?(O.arraySet(s.window,t,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=D(r.check,C,2,0),d=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg=\"incorrect header check\",r.mode=30;break}if(8!=(15&u)){e.msg=\"unknown compression method\",r.mode=30;break}if(d-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg=\"invalid window size\",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=D(r.check,C,2,0)),d=u=0,r.mode=3;case 3:for(;d<32;){if(0===a)break e;a--,u+=n[s++]<>>8&255,C[2]=u>>>16&255,C[3]=u>>>24&255,r.check=D(r.check,C,4,0)),d=u=0,r.mode=4;case 4:for(;d<16;){if(0===a)break e;a--,u+=n[s++]<>8),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=D(r.check,C,2,0)),d=u=0,r.mode=5;case 5:if(1024&r.flags){for(;d<16;){if(0===a)break e;a--,u+=n[s++]<>>8&255,r.check=D(r.check,C,2,0)),d=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(a<(c=r.length)&&(c=a),c&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),O.arraySet(r.head.extra,n,s,c,k)),512&r.flags&&(r.check=D(r.check,n,c,s)),a-=c,s+=c,r.length-=c),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===a)break e;for(c=0;k=n[s+c++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&c>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;d<32;){if(0===a)break e;a--,u+=n[s++]<>>=7&d,d-=7&d,r.mode=27;break}for(;d<3;){if(0===a)break e;a--,u+=n[s++]<>>=1)){case 0:r.mode=14;break;case 1:if(j(r),r.mode=20,6!==t)break;u>>>=2,d-=2;break e;case 2:r.mode=17;break;case 3:e.msg=\"invalid block type\",r.mode=30}u>>>=2,d-=2;break;case 14:for(u>>>=7&d,d-=7&d;d<32;){if(0===a)break e;a--,u+=n[s++]<>>16^65535)){e.msg=\"invalid stored block lengths\",r.mode=30;break}if(r.length=65535&u,d=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(c=r.length){if(a>>=5,d-=5,r.ndist=1+(31&u),u>>>=5,d-=5,r.ncode=4+(15&u),u>>>=4,d-=4,286>>=3,d-=3}for(;r.have<19;)r.lens[A[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=T(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg=\"invalid code lengths set\",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,v=65535&z,!((_=z>>>24)<=d);){if(0===a)break e;a--,u+=n[s++]<>>=_,d-=_,r.lens[r.have++]=v;else{if(16===v){for(E=_+2;d>>=_,d-=_,0===r.have){e.msg=\"invalid bit length repeat\",r.mode=30;break}k=r.lens[r.have-1],c=3+(3&u),u>>>=2,d-=2}else if(17===v){for(E=_+3;d>>=_)),u>>>=3,d-=3}else{for(E=_+7;d>>=_)),u>>>=7,d-=7}if(r.have+c>r.nlen+r.ndist){e.msg=\"invalid bit length repeat\",r.mode=30;break}for(;c--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg=\"invalid code -- missing end-of-block\",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=T(R,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg=\"invalid literal/lengths set\",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=T(F,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg=\"invalid distances set\",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=a&&258<=f){e.next_out=o,e.avail_out=f,e.next_in=s,e.avail_in=a,r.hold=u,r.bits=d,B(e,l),o=e.next_out,i=e.output,f=e.avail_out,s=e.next_in,n=e.input,a=e.avail_in,u=r.hold,d=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;w=(z=r.lencode[u&(1<>>16&255,v=65535&z,!((_=z>>>24)<=d);){if(0===a)break e;a--,u+=n[s++]<>g)])>>>16&255,v=65535&z,!(g+(_=z>>>24)<=d);){if(0===a)break e;a--,u+=n[s++]<>>=g,d-=g,r.back+=g}if(u>>>=_,d-=_,r.back+=_,r.length=v,0===w){r.mode=26;break}if(32&w){r.back=-1,r.mode=12;break}if(64&w){e.msg=\"invalid literal/length code\",r.mode=30;break}r.extra=15&w,r.mode=22;case 22:if(r.extra){for(E=r.extra;d>>=r.extra,d-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;w=(z=r.distcode[u&(1<>>16&255,v=65535&z,!((_=z>>>24)<=d);){if(0===a)break e;a--,u+=n[s++]<>g)])>>>16&255,v=65535&z,!(g+(_=z>>>24)<=d);){if(0===a)break e;a--,u+=n[s++]<>>=g,d-=g,r.back+=g}if(u>>>=_,d-=_,r.back+=_,64&w){e.msg=\"invalid distance code\",r.mode=30;break}r.offset=v,r.extra=15&w,r.mode=24;case 24:if(r.extra){for(E=r.extra;d>>=r.extra,d-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg=\"invalid distance too far back\",r.mode=30;break}r.mode=25;case 25:if(0===f)break e;if(c=l-f,r.offset>c){if((c=r.offset-c)>r.whave&&r.sane){e.msg=\"invalid distance too far back\",r.mode=30;break}p=c>r.wnext?(c-=r.wnext,r.wsize-c):r.wnext-c,c>r.length&&(c=r.length),m=r.window}else m=i,p=o-r.offset,c=r.length;for(fc?(m=B[T+o[g]],A[O+o[g]]):(m=96,0),f=1<>S)+(u-=f)]=p<<24|m<<16|_|0,0!==u;);for(f=1<>=1;if(0!==f?(C&=f-1,C+=f):C=0,g++,0==--I[v]){if(v===b)break;v=t[r+o[g]]}if(k>>7)]}function x(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function S(e,t,r){e.bi_valid>i-r?(e.bi_buf|=t<>i-e.bi_valid,e.bi_valid+=r-i):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function C(e,t,r){var n,i,s=new Array(_+1),o=0;for(n=1;n<=_;n++)s[n]=o=o+r[n-1]<<1;for(i=0;i<=t;i++){var a=e[2*i+1];0!==a&&(e[2*i]=z(s[a]++,a))}}function A(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function O(e){8>1;1<=r;r--)D(e,s,r);for(i=f;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],D(e,s,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,s[2*i]=s[2*r]+s[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,s[2*r+1]=s[2*n+1]=i,e.heap[1]=i++,D(e,s,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,s,o,a,f=t.dyn_tree,u=t.max_code,d=t.stat_desc.static_tree,h=t.stat_desc.has_stree,l=t.stat_desc.extra_bits,c=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(s=0;s<=_;s++)e.bl_count[s]=0;for(f[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)p<(s=f[2*f[2*(n=e.heap[r])+1]+1]+1)&&(s=p,m++),f[2*n+1]=s,u>=7;n<30;n++)for(y[n]=i<<7,e=0;e<1<>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),T(e,e.l_desc),T(e,e.d_desc),o=function(e){var t;for(R(e,e.dyn_ltree,e.l_desc.max_code),R(e,e.dyn_dtree,e.d_desc.max_code),T(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*d[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==t?U(e,t,r,n):4===e.strategy||s===i?(S(e,2+(n?1:0),3),B(e,h,l)):(S(e,4+(n?1:0),3),function(e,t,r,n){var i;for(S(e,t-257,5),S(e,r-1,5),S(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(p[r]+256+1)]++,e.dyn_dtree[2*k(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){var t;S(e,2,3),E(e,256,h),16===(t=e).bi_valid?(x(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{\"../utils/common\":41}],53:[function(e,t,r){\"use strict\";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,r){\"use strict\";t.exports=\"function\"==typeof setImmediate?setImmediate:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e)}},{}]},{},[10])(10)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)});","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"../Timeline\"), exports);\n__exportStar(require(\"../DrawerCanvas\"), exports);\n__exportStar(require(\"../Renderer\"), exports);\n__exportStar(require(\"./BrowserDrawerCanvas\"), exports);\nconst BrowserDrawerCanvas_1 = require(\"./BrowserDrawerCanvas\");\nexports.default = BrowserDrawerCanvas_1.BrowserDrawerCanvas;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GCODEExporter = void 0;\n__exportStar(require(\"./types\"), exports);\nconst GCODEExporter_1 = require(\"./GCODEExporter\");\nObject.defineProperty(exports, \"GCODEExporter\", { enumerable: true, get: function () { return GCODEExporter_1.GCODEExporter; } });\nif (typeof Urpflanze !== 'undefined') {\n Urpflanze.GCODEExporter = GCODEExporter_1.GCODEExporter;\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GCODEExporter = void 0;\nconst core_1 = require(\"@urpflanze/core\");\nconst simplify_js_1 = require(\"simplify-js\");\nconst utilities_1 = require(\"./utilities\");\nclass GCODEExporter {\n static parse(scene, settings) {\n const bindedSettings = {\n ...GCODEExporter.defaults,\n ...settings,\n };\n return GCODEExporter.generate(scene, bindedSettings).join('\\n');\n }\n /**\n * Set units to inches or millimeters.\n * When unit is set, all positions, offsets, rates, accelerations, etc., specified in G-code parameters are interpreted in that unit.\n *\n * @param unit 'millimeters' | 'inches'\n * @returns\n */\n static setUnit(unit) {\n return unit === 'inches' ? 'G20' : 'G21';\n }\n /**\n * In this mode all coordinates are interpreted as relative to the last position.\n *\n * @returns\n */\n static useRelativePosition() {\n return 'G91';\n }\n /**\n * All coordinates given in G-code are interpreted as positions in the logical coordinate space\n *\n * @returns\n */\n static useAbsolutePosition() {\n return 'G90';\n }\n /**\n * Up pen and go home\n *\n * @param penUpCommand\n * @returns\n */\n static goHome(penUpCommand) {\n return [penUpCommand, 'G28 X0 Y0'];\n }\n /**\n * Store the origin position that the machine goes to when the {G28} command is issued\n *\n * @param x\n * @param y\n * @param decimals\n * @returns\n */\n static setCurrentMachinePosition(x, y, decimals) {\n return `G28.1 X${utilities_1.round(x, decimals)} Y${utilities_1.round(y, decimals)}`;\n }\n /**\n * Set the current position to the values specified.\n *\n * @param x\n * @param y\n * @param decimals\n * @returns\n */\n static setCurrentWorkspacePosition(x, y, decimals) {\n return `G92 X${utilities_1.round(x, decimals)} Y${utilities_1.round(y, decimals)}`;\n }\n /**\n * Linear move.\n * G0 is a rapid moviment (max speed)\n * G1 moviment of setted velocity\n *\n * @param x\n * @param y\n * @param decimals\n * @param velocity\n * @returns\n */\n static goTo(x, y, decimals, velocity) {\n return typeof velocity !== 'undefined'\n ? `G1 X${utilities_1.round(x, decimals)} Y${utilities_1.round(y, decimals)} F${velocity}`\n : `G0 X${utilities_1.round(x, decimals)} Y${utilities_1.round(y, decimals)}`;\n }\n /**\n * Up the pen, move and down\n *\n * @param penUpCommand\n * @param penDownCommand\n * @param x\n * @param y\n * @param round\n * @returns\n */\n static moveTo(penUpCommand, penDownCommand, x, y, round) {\n return [penUpCommand, this.goTo(x, y, round), penDownCommand];\n }\n /**\n * goTo alias\n *\n * @param x\n * @param y\n * @param velocity\n * @param round\n * @returns\n */\n static lineTo(x, y, velocity, round) {\n return this.goTo(x, y, round, velocity);\n }\n /**\n * Generate gcode frm scene\n *\n * @param scene\n * @param settings\n * @returns\n */\n static generate(scene, settings) {\n // Calculate workspace area\n const workspaceWidth = settings.maxX - settings.minX;\n const workspaceHeight = settings.maxY - settings.minY;\n const workspaceRatio = workspaceWidth / workspaceHeight;\n // Calculate drawArea from scene\n const sceneRatio = scene.width / scene.height;\n const drawArea = [\n workspaceRatio > sceneRatio ? (scene.width * workspaceHeight) / scene.height : workspaceWidth,\n workspaceRatio > sceneRatio ? workspaceHeight : (scene.height * workspaceWidth) / scene.width,\n ];\n const drawAreaSceneOffset = [(workspaceWidth - drawArea[0]) / 2, (workspaceHeight - drawArea[1]) / 2];\n // Adapt drawArea to workspace\n const scale = workspaceRatio > sceneRatio ? scene.width / drawArea[0] : scene.height / drawArea[1];\n // const machineCenterPosition = [(settings.maxX + settings.minX) / 2, (settings.maxY + settings.minY) / 2]\n const gcode = [];\n utilities_1.concat(gcode, settings.penUpCommand);\n utilities_1.concat(gcode, this.setUnit(settings.unit));\n utilities_1.concat(gcode, this.useAbsolutePosition());\n utilities_1.concat(gcode, this.setCurrentMachinePosition(settings.minX, settings.minY, settings.decimals));\n utilities_1.concat(gcode, this.setCurrentWorkspacePosition(settings.minX, settings.minY, settings.decimals));\n const sceneChilds = scene.getChildren();\n for (let i = 0, len = sceneChilds.length; i < len; i++) {\n sceneChilds[i].generate(0, true);\n const childBuffer = sceneChilds[i].getBuffer() || [];\n const childIndexedBuffer = sceneChilds[i].getIndexedBuffer() || [];\n let childVertexIndex = 0;\n for (let currentBufferIndex = 0, len = childIndexedBuffer.length; currentBufferIndex < len; currentBufferIndex++) {\n const currentIndexing = childIndexedBuffer[currentBufferIndex];\n const initialPointX = core_1.clamp(settings.minX, settings.maxX, settings.minX + childBuffer[childVertexIndex] / scale + drawAreaSceneOffset[0]);\n const initialPointY = core_1.clamp(settings.minY, settings.maxY, settings.minY + childBuffer[childVertexIndex + 1] / scale + drawAreaSceneOffset[1]);\n utilities_1.concat(gcode, this.moveTo(settings.penUpCommand, settings.penDownCommand, initialPointX, initialPointY, settings.decimals));\n const simplifiedBuffer = GCODEExporter.pointsToBuffer(simplify_js_1.default(GCODEExporter.bufferToPoints(childBuffer.slice(childVertexIndex, childVertexIndex + currentIndexing.frameLength)), 1 / 10 ** settings.decimals, true));\n for (let i = 0, len = simplifiedBuffer.length; i < len; i += 2) {\n const currentX = core_1.clamp(settings.minX, settings.maxX, settings.minX + simplifiedBuffer[i] / scale + drawAreaSceneOffset[0]);\n const currentY = core_1.clamp(settings.minY, settings.maxY, settings.minY + simplifiedBuffer[i + 1] / scale + drawAreaSceneOffset[1]);\n utilities_1.concat(gcode, this.lineTo(currentX, currentY, settings.velocity, settings.decimals));\n }\n if (currentIndexing.shape.isClosed())\n utilities_1.concat(gcode, this.lineTo(initialPointX, initialPointY, settings.velocity, settings.decimals));\n childVertexIndex += currentIndexing.frameLength;\n }\n }\n /**\n *\n * @param penUpCommand\n * @returns\n */\n utilities_1.concat(gcode, this.goHome(settings.penUpCommand));\n return gcode;\n }\n static bufferToPoints(buffer) {\n const result = [];\n for (let i = 0, len = buffer.length; i < len; i += 2)\n result.push({ x: buffer[i], y: buffer[i + 1] });\n return result;\n }\n static pointsToBuffer(points) {\n const result = [];\n for (let i = 0, len = points.length; i < len; i++) {\n result.push(points[i].x);\n result.push(points[i].y);\n }\n return Float32Array.from(result);\n }\n}\nexports.GCODEExporter = GCODEExporter;\nGCODEExporter.defaults = {\n minX: 0,\n minY: 0,\n maxX: 297,\n maxY: 210,\n unit: 'millimeters',\n velocity: 1500,\n penUpCommand: 'M3 S30',\n penDownCommand: 'M3 S0',\n decimals: 2,\n};\n//# sourceMappingURL=GCODEExporter.js.map","/*! For license information please see urpflanze.min.js.LICENSE.txt */\n!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.Urpflanze=e():t.Urpflanze=e()}(window,(function(){return(()=>{var t={193:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Group=void 0;const n=r(107),i=r(15),o=r(485),a=r(658);class s extends i.SceneChild{constructor(t={}){t.type=\"Group\",super(t),this.children=[],[\"id\",\"name\",\"data\",\"order\",\"type\"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=a.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){\"object\"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=s},107:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Scene=void 0;const n=r(15),i=r(193),o=r(775),a=r(932);class s{constructor(t={}){this.width=400,this.height=400,this.background=\"hsla(0, 0%, 0%, 1)\",this.color=\"hsla(0, 0%, 100%, 1)\",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?[\"number\"==typeof t.anchor[0]?(.5+.5*a.clamp(-1,1,t.anchor[0]))*this.width:\"left\"===t.anchor[0]?0:\"right\"===t.anchor[0]?this.width:this.center[0],\"number\"==typeof t.anchor[1]?(.5+.5*a.clamp(-1,1,t.anchor[1]))*this.height:\"top\"===t.anchor[1]?0:\"bottom\"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e=\"number\"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,s.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{s.propagateToChilden(t,e)})):t instanceof o.Shape&&t.shape&&(t.shape.scene=e,s.propagateToChilden(t.shape,e))}}e.Scene=s},15:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||\"SceneChild\",this.name=t.name||this.type+\"_\"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){\"string\"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},932:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(21),i=r(345),o=r(271),a=\"undefined\"!=typeof performance?performance:Date;function s(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return a.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=s,e.relativeClamp=function(t,e,r,n,i){return s(n,i,(r-t)/(e-t)*(i-n)+n)};const u={random:new n(Math.random)};e.noise=function(t=\"random\",e=0,r=0,i=0){return void 0===u[t]&&(u[t]=new n(t)),u[t].noise3D(e,r,i)};const h={};function c(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),o=rn?[o,a]:[a,o]}function f(t,e){const r=t.length,n=r/2,i=2*(n+e),o=n-1;if(o>1){const n=r-2,a=Math.floor(e/o);let s=(i-(r+a*n))/2;const u=Math.round(o/s),h=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%u==0||e===n-2),p=a+(d?1:0),M=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);h[i]=(o=t(),a=t(),s=t(),u=t(),function(){let t=(o>>>=0)+(a>>>=0)|0;return o=a^a>>>9,a=(s>>>=0)+(s<<3)|0,t=t+(u=1+(u>>>=0)|0)|0,s=(s=s<<21|s>>>11)+t|0,(t>>>0)/4294967296})}var o,a,s,u;const c=e+h[i]()*(r-e);return void 0!==n?Math.round(c*10**n)/10**n:c},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return o.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=c,e.interpolate=function(t,e,r=.5){const[n,i]=c(t,e),o=Math.max(n.length,i.length),a=\"number\"==typeof r?[r]:r,s=o/2;if(a.length!==s){const t=a.length;for(let e=0;e{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return\"number\"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},348:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(887);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},888:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},658:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(700);var i;!function(t){t[t.None=0]=\"None\",t[t.Scale=2]=\"Scale\",t[t.Center=4]=\"Center\",t[t.Fill=8]=\"Fill\"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn(\"[Urplfanze:Bounding] cannot sum bounding\")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn(\"[Urplfanze:Bounding] cannot bind bounding\")}};class o extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return o.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=o.getBounding(t));const a=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,s=e>=i.Center?r.cx:0,u=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Close=void 0;const n=r(700);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},991:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Mirror=void 0;const n=r(700);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let o=0;o{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},62:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Offset=void 0;const n=r(700);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i},785:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Smooth=void 0;const n=r(932),i=r(364),o=r(700);class a extends o.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Solidify=void 0;const n=r(700);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const o=[],a=(e=\"number\"==typeof e?[e]:e).length;let s,u,h=[[0,0],[0,0]],c=[[0,0],[0,0]];for(let r=0,f=0,l=t.length-2;r{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Subdivide=void 0;const n=r(700);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Modifiers=void 0;const n=r(658),i=r(991),o=r(785),a=r(982),s=r(301),u=r(364),h=r(62),c={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:o.Smooth,Solidify:a.Solidify,Subdivide:s.Subdivide,Close:u.Close,Offset:h.Offset};e.Modifiers=c},775:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Shape=void 0;const n=r(107),i=r(15),o=r(485);class a extends o.ShapeBase{constructor(t){t.type=t.type||\"Shape\",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn(\"[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\\nYou passed:\",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):a.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeBase=void 0;const n=r(887),i=r(46),o=r(348),a=r(271),s=r(888),u=r(658),h=r(932),c=r(15),f=n.mat4.create(),l=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class M extends c.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?[\"number\"==typeof t.anchor[0]?-1*h.clamp(-1,1,t.anchor[0]):\"left\"===t.anchor[0]?1:\"right\"===t.anchor[0]?-1:0,\"number\"==typeof t.anchor[1]?-1*h.clamp(-1,1,t.anchor[1]):\"top\"===t.anchor[1]?1:\"bottom\"===t.anchor[1]?-1:0]:[0,0],this.boundingType=\"string\"==typeof t.boundingType?\"relative\"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return\"function\"!=typeof t.repetitions&&\"function\"!=typeof t.distance&&\"function\"!=typeof t.displace&&\"function\"!=typeof t.scale&&\"function\"!=typeof t.translate&&\"function\"!=typeof t.skewX&&\"function\"!=typeof t.skewY&&\"function\"!=typeof t.squeezeX&&\"function\"!=typeof t.squeezeY&&\"function\"!=typeof t.rotateX&&\"function\"!=typeof t.rotateY&&\"function\"!=typeof t.rotateZ&&\"function\"!=typeof t.transformOrigin&&\"function\"!=typeof t.perspective&&\"function\"!=typeof t.perspectiveOrigin}isStaticIndexed(){return\"function\"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return\"function\"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){\"string\"==typeof t?(r=r||\"repetitions\"==t,this.props[t]=e):(r=r||\"repetitions\"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var c,g;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const v=M.getEmptyPropArguments(this,r),m=v.repetition,b=this.getProp(\"repetitions\",v,1),y=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,x=Array.isArray(b)?b[0]*(null!==(c=b[1])&&void 0!==c?c:b[0]):b,S=Array.isArray(b)?b[0]:x,P=Array.isArray(b)?null!==(g=b[1])&&void 0!==g?g:b[0]:1,w=m.row;w.count=S;const B=m.col;B.count=P,m.count=x,m.col.count=P,m.row.count=S,m.type=y;let I=0;const R=[];let O=0;const A=n.vec2.fromValues((P-1)/2,(S-1)/2),L=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],E=[void 0,void 0,void 0,void 0],_=[void 0,void 0,void 0,void 0];for(let r=0;r1?O/(x-1):1,m.angle=y===i.ERepetitionType.Ring?s.PI2/x*O:0,B.index=c+1,B.offset=P>1?c/(P-1):1,w.index=r+1,w.offset=S>1?r/(S-1):1;const M=this.generateBuffer(t,v),g=M.length,b=this.getShapeBounding();R[O]=new Float32Array(g),I+=g;{const t=o.toVec2(this.getProp(\"distance\",v,o.VEC2_ZERO)),s=this.getProp(\"displace\",v,0),x=o.toVec3(this.getProp(\"scale\",v,o.VEC2_ONE),1),S=o.toVec3(this.getProp(\"translate\",v,o.VEC2_ZERO),0),P=this.getProp(\"skewX\",v,0),w=this.getProp(\"skewY\",v,0),B=this.getProp(\"squeezeX\",v,0),I=this.getProp(\"squeezeY\",v,0),F=this.getProp(\"rotateX\",v,0),C=this.getProp(\"rotateY\",v,0),j=this.getProp(\"rotateZ\",v,0),q=h.clamp(0,1,this.getProp(\"perspective\",v,0)),T=o.toVec3(this.getProp(\"perspectiveOrigin\",v,o.VEC2_ZERO),0),D=o.toVec3(this.getProp(\"transformOrigin\",v,o.VEC2_ZERO),0);let V;switch(y){case i.ERepetitionType.Ring:V=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(V,V,o.VEC3_ZERO,m.angle+s);break;case i.ERepetitionType.Matrix:V=n.vec3.fromValues(t[1]*(c-A[0]),t[0]*(r-A[1]),0)}const k=q>0?Math.max(b.width,b.height)/2:1,z=q>0?k+10*k*(1-q):0,U=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==q||0!==D[0]||0!==D[1],Y=0!==T[0]||0!==T[1];U&&(this.boundingType===i.EBoundingType.Relative?(D[0]=D[0]*(b.width/2)+b.cx,D[1]=D[1]*(b.height/2)+b.cy):(D[0]*=b.width/2,D[1]*=b.height/2),D[2]=z);{n.mat4.identity(l),U&&n.mat4.translate(l,l,D),0===S[0]&&0===S[1]||n.mat4.translate(l,l,S),0===P&&0===w||(o.fromSkew(f,[P,w]),n.mat4.multiply(l,l,f)),0!==F&&n.mat4.rotateX(l,l,F),0!==C&&n.mat4.rotateY(l,l,C),0!==j&&n.mat4.rotateZ(l,l,j),1===x[0]&&1===x[1]||n.mat4.scale(l,l,x),U&&n.mat4.translate(l,l,n.vec3.scale(D,D,-1)),z>0&&(Y&&(this.boundingType===i.EBoundingType.Relative?(T[0]=T[0]*(b.width/2)+b.cx,T[1]=T[1]*(b.height/2)+b.cy):(T[0]*=b.width/2,T[1]*=b.height/2),T[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,V),e&&n.mat4.translate(p,p,L);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),y===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,m.angle+s)}u.Bounding.clear(_);for(let t=0;t0&&(Y&&n.vec3.add(e,e,T),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,z),Y&&n.vec3.sub(e,e,T)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=g/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,v)}R[O][t]=e[0],R[O][t+1]=e[1],u.Bounding.add(_,e[0],e[1]),u.Bounding.add(E,e[0],e[1])}}const F={cx:0,cy:0,x:-1,y:-1,width:2,height:2};u.Bounding.bind(F,_),this.bStaticIndexed&&this.bIndexed||this.addIndex(g,m,F)}u.Bounding.bind(this.bounding,E),this.buffer=new Float32Array(I);for(let t=0,e=0,r=R.length;t({index:1,offset:1,count:1}),M.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...M.getEmptySimpleRepetition(),row:M.getEmptySimpleRepetition(),col:M.getEmptySimpleRepetition()})},425:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeBuffer=void 0;const n=r(658),i=r(436);class o extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||\"ShapeBuffer\",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn(\"[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property\"),this.shape=o.EMPTY_BUFFER):this.shape=\"function\"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return\"function\"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return\"function\"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from(\"function\"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,o=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&\"function\"!=typeof this.props.sideLength&&\"function\"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=o},549:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeFollow=void 0;const n=r(775);class i extends n.Shape{constructor(t){t.type=t.type||\"ShapeFollow\",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},o=this.shape;o.generate(t,!1,i);let a=o.getBuffer();const s=a.length,u=new Float32Array(s*(n.length/2)),h=n.length/2;for(let e=0;e1?e/(h-1):1,count:h};this.shapeUseFollow&&(i.follow=r,o.generate(t,!1,i),a=o.getBuffer());const c=e*s,f=2*e,l=n[f],d=n[f+1];for(let t=0,e=a.length;t1?t/(e-1):1;for(let a=0,s=o.length;a{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeLoop=void 0;const n=r(888),i=r(658),o=r(436),a=r(485);class s extends o.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||\"ShapeLoop\",super(t),this.loopDependencies=(t.loopDependencies||[]).concat(\"sideLength\"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes(\"propArguments\"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}\"loop\"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||a.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?(\"function\"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),o=this.getRepetitionSideLength(t),a=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,s={index:0,offset:0,current:0,count:n},u=s.count,h=new Float32Array(2*u);for(let n=0,i=0;n1?n/(s.count-1):1;s.current=o,s.index=n+1,s.offset=u;const c=a(s,t);h[i]=c[0],h[i+1]=c[1]}const c=[void 0,void 0,void 0,void 0],f=this.applyModifiers(h,t);for(let t=0,e=f.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapePrimitive=void 0;const n=r(348),i=r(485),o=r(700),a=r(658);class s extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=a.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:\"function\"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return\"function\"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:\"number\"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp(\"sideLength\",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeRecursive=void 0;const n=r(775);class i extends n.Shape{constructor(t){t.type=t.type||\"ShapeRecursive\",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return\"function\"!=typeof this.props.recursions&&\"function\"!=typeof this.props.recursionScale&&\"function\"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return\"function\"!=typeof this.props.recursions&&\"function\"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp(\"recursions\",e,1)),n=Math.floor(this.getProp(\"recursionVertex\",e,0)),o=this.getProp(\"recursionScale\",e,2),a=this.shape;let s={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const u={...e,recursion:s};a.generate(t,!1,u);const h=a.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=h);let c=h;const f=[s];let l=0,d=1;const p=c.length,M=p/2,g=n<=0?M:Math.min(n,M),v=0===n?1:M/Math.min(n,M),m=new Float32Array(i.summmation(r,g)*p);for(let t=0;t1?e/(r-1):1,h=i.summmation(e,g)*p,M=e-1,b=0===M?0:i.summmation(M,g)*p;for(let i=0,M=g**e;i1?i/(M-1):1,count:M,level:{index:e+1,offset:n,count:r},parent:f[l]},f.push(s),this.shapeUseRecursion&&(u.recursion=s,a.generate(t,!1,u),c=a.getBuffer());const y=h+i*p,x=Math.floor(b+2*i*v),S=m[x],P=m[x+1],w=o**e;for(let t=0,e=p;t1?0:1,count:o}}},u=this.shape.getIndexedBuffer()||[];for(let t=0,e=u.length;t1?0:1,count:o}},i={...s,recursion:r},a=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:a})}if(o>1){const t=this.shape.getBufferLength({...i,parent:{...s}})/2,e=a<=0?t:Math.min(a,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let h=0,c=1;for(let t=1;t1?t/(o-1):1;for(let a=0,f=e**t;a1?a/(f-1):1;for(let d=0,p=u.length;d{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Circle=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){t.type=\"Circle\",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=o},702:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Line=void 0;const n=r(658),i=r(425);class o extends i.ShapeBuffer{constructor(t={}){t.type=\"Line\",t.shape=o.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Lissajous=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){t.type=\"Lissajous\",t.loopDependencies=(t.loopDependencies||[]).concat([\"wx\",\"wy\",\"wz\"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp(\"wx\",t),r=this.getProp(\"wy\",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),o=this.getRepetitionSideLength(t);return 1/Math.pow(o[0]*o[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp(\"wx\",t,1),this.wy=this.getProp(\"wy\",t,2),this.wz=this.getProp(\"wz\",t,2),super.generateLoopBuffer(t)}}e.Lissajous=o},873:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Polygon=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){t.type=t.type||\"Polygon\",t.loopDependencies=(t.loopDependencies||[]).concat([\"sideNumber\"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp(\"sideNumber\",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=o},478:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Rect=void 0;const n=r(658),i=r(425);class o extends i.ShapeBuffer{constructor(t={}){t.type=\"Rect\",t.shape=o.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=o,o.buffer=[1,1,-1,1,-1,-1,1,-1]},710:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Rose=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){var e,r;t.type=\"Rose\",t.loopDependencies=(t.loopDependencies||[]).concat([\"n\",\"d\"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>o.getFinalAngleFromK(this.getProp(\"n\",t),this.getProp(\"d\",t)),inc:t=>{const e=this.getProp(\"n\",t),r=this.getProp(\"d\",t),i=this.getRepetitionSideLength(t),o=Math.pow(i[0]*i[1],.45),a=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp(\"n\",t)/this.getProp(\"d\",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=o},82:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Spiral=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type=\"Spiral\",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat([\"twists\",\"twistsStart\",\"spiral\"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:o.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp(\"twistsStart\",t),end:t=>n.PI2*(this.getProp(\"twistsStart\",t)+this.getProp(\"twists\",t)),inc:t=>{const e=this.getProp(\"twists\",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp(\"spiral\",t),this.r=o.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case o.types.ARCHIMEDE:return t=>t/10;case o.types.HYPERBOLIC:return t=>1/t*3;case o.types.FERMAT:return t=>t**.5/3;case o.types.LITUUS:return t=>t**-.5;case o.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=o,o.types={ARCHIMEDE:\"ARCHIMEDE\",HYPERBOLIC:\"HYPERBOLIC\",FERMAT:\"FERMAT\",LITUUS:\"LITUUS\",LOGARITHMIC:\"LOGARITHMIC\"}},490:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Star=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){t.type=t.type||\"Polygon\",t.loopDependencies=(t.loopDependencies||[]).concat([\"spikes\",\"innerRadius\"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp(\"spikes\",t,5),this.innerRadius=this.getProp(\"innerRadius\",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=o},845:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.SuperShape=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){var e,r,i,o,a,s;t.type=\"SuperShape\",t.loopDependencies=(t.loopDependencies||[]).concat([\"a\",\"b\",\"m\",\"n1\",\"n2\",\"n3\"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(o=t.n1)&&void 0!==o?o:1,this.props.n2=null!==(a=t.n2)&&void 0!==a?a:1,this.props.n3=null!==(s=t.n3)&&void 0!==s?s:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp(\"a\",t),this.b=this.getProp(\"b\",t),this.m=this.getProp(\"m\",t),this.n1=this.getProp(\"n1\",t),this.n2=this.getProp(\"n2\",t),this.n3=this.getProp(\"n3\",t),super.generateLoopBuffer(t)}}e.SuperShape=o},123:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Triangle=void 0;const n=r(658),i=r(425);class o extends i.ShapeBuffer{constructor(t={}){t.type=\"Triangle\",t.shape=o.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=o,o.buffer=[1,0,-1,1,-1,-1]},46:function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(574),e),i(r(636),e),i(r(345),e),i(r(920),e),i(r(676),e),i(r(300),e),i(r(273),e),i(r(511),e)},574:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},636:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},345:(t,e)=>{\"use strict\";var r;Object.defineProperty(e,\"__esModule\",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]=\"Ring\",r[r.Matrix=2]=\"Matrix\"},920:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},676:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},300:(t,e)=>{\"use strict\";var r;Object.defineProperty(e,\"__esModule\",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]=\"Relative\",r[r.Fixed=2]=\"Fixed\"},273:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},511:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},887:(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>o,mat3:()=>a,mat4:()=>s,quat:()=>c,quat2:()=>f,vec2:()=>l,vec3:()=>u,vec4:()=>h});var n={};r.r(n),r.d(n,{ARRAY_TYPE:()=>p,EPSILON:()=>d,RANDOM:()=>M,equals:()=>b,setMatrixArrayType:()=>g,toRadian:()=>m});var i={};r.r(i),r.d(i,{LDU:()=>T,add:()=>D,adjoint:()=>O,clone:()=>x,copy:()=>S,create:()=>y,determinant:()=>A,equals:()=>z,exactEquals:()=>k,frob:()=>q,fromRotation:()=>F,fromScaling:()=>C,fromValues:()=>w,identity:()=>P,invert:()=>R,mul:()=>N,multiply:()=>L,multiplyScalar:()=>U,multiplyScalarAndAdd:()=>Y,rotate:()=>E,scale:()=>_,set:()=>B,str:()=>j,sub:()=>Z,subtract:()=>V,transpose:()=>I});var o={};r.r(o),r.d(o,{add:()=>ht,clone:()=>H,copy:()=>G,create:()=>X,determinant:()=>J,equals:()=>pt,exactEquals:()=>dt,frob:()=>ut,fromRotation:()=>it,fromScaling:()=>ot,fromTranslation:()=>at,fromValues:()=>K,identity:()=>Q,invert:()=>$,mul:()=>Mt,multiply:()=>tt,multiplyScalar:()=>ft,multiplyScalarAndAdd:()=>lt,rotate:()=>et,scale:()=>rt,set:()=>W,str:()=>st,sub:()=>gt,subtract:()=>ct,translate:()=>nt});var a={};r.r(a),r.d(a,{add:()=>zt,adjoint:()=>It,clone:()=>bt,copy:()=>yt,create:()=>vt,determinant:()=>Rt,equals:()=>Xt,exactEquals:()=>Zt,frob:()=>kt,fromMat2d:()=>jt,fromMat4:()=>mt,fromQuat:()=>qt,fromRotation:()=>Ft,fromScaling:()=>Ct,fromTranslation:()=>_t,fromValues:()=>xt,identity:()=>Pt,invert:()=>Bt,mul:()=>Ht,multiply:()=>Ot,multiplyScalar:()=>Yt,multiplyScalarAndAdd:()=>Nt,normalFromMat4:()=>Tt,projection:()=>Dt,rotate:()=>Lt,scale:()=>Et,set:()=>St,str:()=>Vt,sub:()=>Gt,subtract:()=>Ut,translate:()=>At,transpose:()=>wt});var s={};r.r(s),r.d(s,{add:()=>Ce,adjoint:()=>ne,clone:()=>Kt,copy:()=>Wt,create:()=>Qt,determinant:()=>ie,equals:()=>Ve,exactEquals:()=>De,frob:()=>Fe,fromQuat:()=>Be,fromQuat2:()=>be,fromRotation:()=>pe,fromRotationTranslation:()=>me,fromRotationTranslationScale:()=>Pe,fromRotationTranslationScaleOrigin:()=>we,fromScaling:()=>de,fromTranslation:()=>le,fromValues:()=>$t,fromXRotation:()=>Me,fromYRotation:()=>ge,fromZRotation:()=>ve,frustum:()=>Ie,getRotation:()=>Se,getScaling:()=>xe,getTranslation:()=>ye,identity:()=>te,invert:()=>re,lookAt:()=>Le,mul:()=>ke,multiply:()=>oe,multiplyScalar:()=>qe,multiplyScalarAndAdd:()=>Te,ortho:()=>Ae,perspective:()=>Re,perspectiveFromFieldOfView:()=>Oe,rotate:()=>ue,rotateX:()=>he,rotateY:()=>ce,rotateZ:()=>fe,scale:()=>se,set:()=>Jt,str:()=>_e,sub:()=>ze,subtract:()=>je,targetTo:()=>Ee,translate:()=>ae,transpose:()=>ee});var u={};r.r(u),r.d(u,{add:()=>Ge,angle:()=>Pr,bezier:()=>Mr,ceil:()=>$e,clone:()=>Ye,copy:()=>Xe,create:()=>Ue,cross:()=>lr,dist:()=>_r,distance:()=>or,div:()=>Er,divide:()=>We,dot:()=>fr,equals:()=>Rr,exactEquals:()=>Ir,floor:()=>Je,forEach:()=>qr,fromValues:()=>Ze,hermite:()=>pr,inverse:()=>hr,len:()=>Cr,length:()=>Ne,lerp:()=>dr,max:()=>er,min:()=>tr,mul:()=>Lr,multiply:()=>Ke,negate:()=>ur,normalize:()=>cr,random:()=>gr,rotateX:()=>yr,rotateY:()=>xr,rotateZ:()=>Sr,round:()=>rr,scale:()=>nr,scaleAndAdd:()=>ir,set:()=>He,sqrDist:()=>Fr,sqrLen:()=>jr,squaredDistance:()=>ar,squaredLength:()=>sr,str:()=>Br,sub:()=>Ar,subtract:()=>Qe,transformMat3:()=>mr,transformMat4:()=>vr,transformQuat:()=>br,zero:()=>wr});var h={};r.r(h),r.d(h,{add:()=>Ur,ceil:()=>Xr,clone:()=>Dr,copy:()=>kr,create:()=>Tr,cross:()=>un,dist:()=>yn,distance:()=>Jr,div:()=>bn,divide:()=>Zr,dot:()=>sn,equals:()=>gn,exactEquals:()=>Mn,floor:()=>Hr,forEach:()=>wn,fromValues:()=>Vr,inverse:()=>on,len:()=>Sn,length:()=>en,lerp:()=>hn,max:()=>Qr,min:()=>Gr,mul:()=>mn,multiply:()=>Nr,negate:()=>nn,normalize:()=>an,random:()=>cn,round:()=>Kr,scale:()=>Wr,scaleAndAdd:()=>$r,set:()=>zr,sqrDist:()=>xn,sqrLen:()=>Pn,squaredDistance:()=>tn,squaredLength:()=>rn,str:()=>pn,sub:()=>vn,subtract:()=>Yr,transformMat4:()=>fn,transformQuat:()=>ln,zero:()=>dn});var c={};r.r(c),r.d(c,{add:()=>ei,calculateW:()=>Cn,clone:()=>Wn,conjugate:()=>zn,copy:()=>Jn,create:()=>Bn,dot:()=>ii,equals:()=>li,exactEquals:()=>fi,exp:()=>jn,fromEuler:()=>Yn,fromMat3:()=>Un,fromValues:()=>$n,getAngle:()=>An,getAxisAngle:()=>On,identity:()=>In,invert:()=>kn,len:()=>si,length:()=>ai,lerp:()=>oi,ln:()=>qn,mul:()=>ri,multiply:()=>Ln,normalize:()=>ci,pow:()=>Tn,random:()=>Vn,rotateX:()=>En,rotateY:()=>_n,rotateZ:()=>Fn,rotationTo:()=>di,scale:()=>ni,set:()=>ti,setAxes:()=>Mi,setAxisAngle:()=>Rn,slerp:()=>Dn,sqlerp:()=>pi,sqrLen:()=>hi,squaredLength:()=>ui,str:()=>Nn});var f={};r.r(f),r.d(f,{add:()=>Vi,clone:()=>vi,conjugate:()=>Xi,copy:()=>wi,create:()=>gi,dot:()=>Yi,equals:()=>to,exactEquals:()=>Ji,fromMat4:()=>Pi,fromRotation:()=>Si,fromRotationTranslation:()=>yi,fromRotationTranslationValues:()=>bi,fromTranslation:()=>xi,fromValues:()=>mi,getDual:()=>Oi,getReal:()=>Ri,getTranslation:()=>Ei,identity:()=>Bi,invert:()=>Zi,len:()=>Gi,length:()=>Hi,lerp:()=>Ni,mul:()=>zi,multiply:()=>ki,normalize:()=>Wi,rotateAroundAxis:()=>Di,rotateByQuatAppend:()=>qi,rotateByQuatPrepend:()=>Ti,rotateX:()=>Fi,rotateY:()=>Ci,rotateZ:()=>ji,scale:()=>Ui,set:()=>Ii,setDual:()=>Li,setReal:()=>Ai,sqrLen:()=>Ki,squaredLength:()=>Qi,str:()=>$i,translate:()=>_i});var l={};r.r(l),r.d(l,{add:()=>ao,angle:()=>Co,ceil:()=>co,clone:()=>ro,copy:()=>io,create:()=>eo,cross:()=>Io,dist:()=>Yo,distance:()=>mo,div:()=>Uo,divide:()=>ho,dot:()=>Bo,equals:()=>Do,exactEquals:()=>To,floor:()=>fo,forEach:()=>Xo,fromValues:()=>no,inverse:()=>Po,len:()=>Vo,length:()=>yo,lerp:()=>Ro,max:()=>po,min:()=>lo,mul:()=>zo,multiply:()=>uo,negate:()=>So,normalize:()=>wo,random:()=>Oo,rotate:()=>Fo,round:()=>Mo,scale:()=>go,scaleAndAdd:()=>vo,set:()=>oo,sqrDist:()=>No,sqrLen:()=>Zo,squaredDistance:()=>bo,squaredLength:()=>xo,str:()=>qo,sub:()=>ko,subtract:()=>so,transformMat2:()=>Ao,transformMat2d:()=>Lo,transformMat3:()=>Eo,transformMat4:()=>_o,zero:()=>jo});var d=1e-6,p=\"undefined\"!=typeof Float32Array?Float32Array:Array,M=Math.random;function g(t){p=t}var v=Math.PI/180;function m(t){return t*v}function b(t,e){return Math.abs(t-e)<=d*Math.max(1,Math.abs(t),Math.abs(e))}function y(){var t=new p(4);return p!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function x(t){var e=new p(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function S(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function P(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function w(t,e,r,n){var i=new p(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function B(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function I(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function R(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*o-i*n;return a?(a=1/a,t[0]=o*a,t[1]=-n*a,t[2]=-i*a,t[3]=r*a,t):null}function O(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function A(t){return t[0]*t[3]-t[2]*t[1]}function L(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*s+o*u,t[1]=i*s+a*u,t[2]=n*h+o*c,t[3]=i*h+a*c,t}function E(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+o*s,t[1]=i*u+a*s,t[2]=n*-s+o*u,t[3]=i*-s+a*u,t}function _(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1];return t[0]=n*s,t[1]=i*s,t[2]=o*u,t[3]=a*u,t}function F(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function C(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function j(t){return\"mat2(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}function q(t){return Math.hypot(t[0],t[1],t[2],t[3])}function T(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function D(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function V(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function k(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function z(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],h=e[3];return Math.abs(r-a)<=d*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-h)<=d*Math.max(1,Math.abs(o),Math.abs(h))}function U(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Y(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var N=L,Z=V;function X(){var t=new p(6);return p!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function H(t){var e=new p(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function G(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Q(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function K(t,e,r,n,i,o){var a=new p(6);return a[0]=t,a[1]=e,a[2]=r,a[3]=n,a[4]=i,a[5]=o,a}function W(t,e,r,n,i,o,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t}function $(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=r*o-n*i;return u?(u=1/u,t[0]=o*u,t[1]=-n*u,t[2]=-i*u,t[3]=r*u,t[4]=(i*s-o*a)*u,t[5]=(n*a-r*s)*u,t):null}function J(t){return t[0]*t[3]-t[1]*t[2]}function tt(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=r[0],c=r[1],f=r[2],l=r[3],d=r[4],p=r[5];return t[0]=n*h+o*c,t[1]=i*h+a*c,t[2]=n*f+o*l,t[3]=i*f+a*l,t[4]=n*d+o*p+s,t[5]=i*d+a*p+u,t}function et(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=Math.sin(r),c=Math.cos(r);return t[0]=n*c+o*h,t[1]=i*c+a*h,t[2]=n*-h+o*c,t[3]=i*-h+a*c,t[4]=s,t[5]=u,t}function rt(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=r[0],c=r[1];return t[0]=n*h,t[1]=i*h,t[2]=o*c,t[3]=a*c,t[4]=s,t[5]=u,t}function nt(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=n*h+o*c+s,t[5]=i*h+a*c+u,t}function it(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function ot(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function at(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function st(t){return\"mat2d(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\")\"}function ut(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function ht(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function ct(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function ft(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function lt(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function dt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function pt(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=e[0],h=e[1],c=e[2],f=e[3],l=e[4],p=e[5];return Math.abs(r-u)<=d*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-h)<=d*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-c)<=d*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(o-f)<=d*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-l)<=d*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(s-p)<=d*Math.max(1,Math.abs(s),Math.abs(p))}var Mt=tt,gt=ct;function vt(){var t=new p(9);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function mt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function bt(t){var e=new p(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function xt(t,e,r,n,i,o,a,s,u){var h=new p(9);return h[0]=t,h[1]=e,h[2]=r,h[3]=n,h[4]=i,h[5]=o,h[6]=a,h[7]=s,h[8]=u,h}function St(t,e,r,n,i,o,a,s,u,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=h,t}function Pt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function wt(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function Bt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8],f=c*a-s*h,l=-c*o+s*u,d=h*o-a*u,p=r*f+n*l+i*d;return p?(p=1/p,t[0]=f*p,t[1]=(-c*n+i*h)*p,t[2]=(s*n-i*a)*p,t[3]=l*p,t[4]=(c*r-i*u)*p,t[5]=(-s*r+i*o)*p,t[6]=d*p,t[7]=(-h*r+n*u)*p,t[8]=(a*r-n*o)*p,t):null}function It(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8];return t[0]=a*c-s*h,t[1]=i*h-n*c,t[2]=n*s-i*a,t[3]=s*u-o*c,t[4]=r*c-i*u,t[5]=i*o-r*s,t[6]=o*h-a*u,t[7]=n*u-r*h,t[8]=r*a-n*o,t}function Rt(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],h=t[8];return e*(h*o-a*u)+r*(-h*i+a*s)+n*(u*i-o*s)}function Ot(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=r[0],d=r[1],p=r[2],M=r[3],g=r[4],v=r[5],m=r[6],b=r[7],y=r[8];return t[0]=l*n+d*a+p*h,t[1]=l*i+d*s+p*c,t[2]=l*o+d*u+p*f,t[3]=M*n+g*a+v*h,t[4]=M*i+g*s+v*c,t[5]=M*o+g*u+v*f,t[6]=m*n+b*a+y*h,t[7]=m*i+b*s+y*c,t[8]=m*o+b*u+y*f,t}function At(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=l*n+d*a+h,t[7]=l*i+d*s+c,t[8]=l*o+d*u+f,t}function Lt(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=Math.sin(r),d=Math.cos(r);return t[0]=d*n+l*a,t[1]=d*i+l*s,t[2]=d*o+l*u,t[3]=d*a-l*n,t[4]=d*s-l*i,t[5]=d*u-l*o,t[6]=h,t[7]=c,t[8]=f,t}function Et(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function _t(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function Ft(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Ct(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function jt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function qt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,h=r*a,c=n*a,f=n*s,l=i*a,d=i*s,p=i*u,M=o*a,g=o*s,v=o*u;return t[0]=1-f-p,t[3]=c-v,t[6]=l+g,t[1]=c+v,t[4]=1-h-p,t[7]=d-M,t[2]=l-g,t[5]=d+M,t[8]=1-h-f,t}function Tt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8],f=e[9],l=e[10],d=e[11],p=e[12],M=e[13],g=e[14],v=e[15],m=r*s-n*a,b=r*u-i*a,y=r*h-o*a,x=n*u-i*s,S=n*h-o*s,P=i*h-o*u,w=c*M-f*p,B=c*g-l*p,I=c*v-d*p,R=f*g-l*M,O=f*v-d*M,A=l*v-d*g,L=m*A-b*O+y*R+x*I-S*B+P*w;return L?(L=1/L,t[0]=(s*A-u*O+h*R)*L,t[1]=(u*I-a*A-h*B)*L,t[2]=(a*O-s*I+h*w)*L,t[3]=(i*O-n*A-o*R)*L,t[4]=(r*A-i*I+o*B)*L,t[5]=(n*I-r*O-o*w)*L,t[6]=(M*P-g*S+v*x)*L,t[7]=(g*y-p*P-v*b)*L,t[8]=(p*S-M*y+v*m)*L,t):null}function Dt(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function Vt(t){return\"mat3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\")\"}function kt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function zt(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function Ut(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function Yt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function Nt(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function Zt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function Xt(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],h=t[7],c=t[8],f=e[0],l=e[1],p=e[2],M=e[3],g=e[4],v=e[5],m=e[6],b=e[7],y=e[8];return Math.abs(r-f)<=d*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(n-l)<=d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-p)<=d*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(o-M)<=d*Math.max(1,Math.abs(o),Math.abs(M))&&Math.abs(a-g)<=d*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(s-v)<=d*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(u-m)<=d*Math.max(1,Math.abs(u),Math.abs(m))&&Math.abs(h-b)<=d*Math.max(1,Math.abs(h),Math.abs(b))&&Math.abs(c-y)<=d*Math.max(1,Math.abs(c),Math.abs(y))}var Ht=Ot,Gt=Ut;function Qt(){var t=new p(16);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Kt(t){var e=new p(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Wt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function $t(t,e,r,n,i,o,a,s,u,h,c,f,l,d,M,g){var v=new p(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=n,v[4]=i,v[5]=o,v[6]=a,v[7]=s,v[8]=u,v[9]=h,v[10]=c,v[11]=f,v[12]=l,v[13]=d,v[14]=M,v[15]=g,v}function Jt(t,e,r,n,i,o,a,s,u,h,c,f,l,d,p,M,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=h,t[9]=c,t[10]=f,t[11]=l,t[12]=d,t[13]=p,t[14]=M,t[15]=g,t}function te(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ee(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function re(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8],f=e[9],l=e[10],d=e[11],p=e[12],M=e[13],g=e[14],v=e[15],m=r*s-n*a,b=r*u-i*a,y=r*h-o*a,x=n*u-i*s,S=n*h-o*s,P=i*h-o*u,w=c*M-f*p,B=c*g-l*p,I=c*v-d*p,R=f*g-l*M,O=f*v-d*M,A=l*v-d*g,L=m*A-b*O+y*R+x*I-S*B+P*w;return L?(L=1/L,t[0]=(s*A-u*O+h*R)*L,t[1]=(i*O-n*A-o*R)*L,t[2]=(M*P-g*S+v*x)*L,t[3]=(l*S-f*P-d*x)*L,t[4]=(u*I-a*A-h*B)*L,t[5]=(r*A-i*I+o*B)*L,t[6]=(g*y-p*P-v*b)*L,t[7]=(c*P-l*y+d*b)*L,t[8]=(a*O-s*I+h*w)*L,t[9]=(n*I-r*O-o*w)*L,t[10]=(p*S-M*y+v*m)*L,t[11]=(f*y-c*S-d*m)*L,t[12]=(s*B-a*R-u*w)*L,t[13]=(r*R-n*B+i*w)*L,t[14]=(M*b-p*x-g*m)*L,t[15]=(c*x-f*b+l*m)*L,t):null}function ne(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8],f=e[9],l=e[10],d=e[11],p=e[12],M=e[13],g=e[14],v=e[15];return t[0]=s*(l*v-d*g)-f*(u*v-h*g)+M*(u*d-h*l),t[1]=-(n*(l*v-d*g)-f*(i*v-o*g)+M*(i*d-o*l)),t[2]=n*(u*v-h*g)-s*(i*v-o*g)+M*(i*h-o*u),t[3]=-(n*(u*d-h*l)-s*(i*d-o*l)+f*(i*h-o*u)),t[4]=-(a*(l*v-d*g)-c*(u*v-h*g)+p*(u*d-h*l)),t[5]=r*(l*v-d*g)-c*(i*v-o*g)+p*(i*d-o*l),t[6]=-(r*(u*v-h*g)-a*(i*v-o*g)+p*(i*h-o*u)),t[7]=r*(u*d-h*l)-a*(i*d-o*l)+c*(i*h-o*u),t[8]=a*(f*v-d*M)-c*(s*v-h*M)+p*(s*d-h*f),t[9]=-(r*(f*v-d*M)-c*(n*v-o*M)+p*(n*d-o*f)),t[10]=r*(s*v-h*M)-a*(n*v-o*M)+p*(n*h-o*s),t[11]=-(r*(s*d-h*f)-a*(n*d-o*f)+c*(n*h-o*s)),t[12]=-(a*(f*g-l*M)-c*(s*g-u*M)+p*(s*l-u*f)),t[13]=r*(f*g-l*M)-c*(n*g-i*M)+p*(n*l-i*f),t[14]=-(r*(s*g-u*M)-a*(n*g-i*M)+p*(n*u-i*s)),t[15]=r*(s*l-u*f)-a*(n*l-i*f)+c*(n*u-i*s),t}function ie(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],h=t[8],c=t[9],f=t[10],l=t[11],d=t[12],p=t[13],M=t[14],g=t[15];return(e*a-r*o)*(f*g-l*M)-(e*s-n*o)*(c*g-l*p)+(e*u-i*o)*(c*M-f*p)+(r*s-n*a)*(h*g-l*d)-(r*u-i*a)*(h*M-f*d)+(n*u-i*s)*(h*p-c*d)}function oe(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=e[9],d=e[10],p=e[11],M=e[12],g=e[13],v=e[14],m=e[15],b=r[0],y=r[1],x=r[2],S=r[3];return t[0]=b*n+y*s+x*f+S*M,t[1]=b*i+y*u+x*l+S*g,t[2]=b*o+y*h+x*d+S*v,t[3]=b*a+y*c+x*p+S*m,b=r[4],y=r[5],x=r[6],S=r[7],t[4]=b*n+y*s+x*f+S*M,t[5]=b*i+y*u+x*l+S*g,t[6]=b*o+y*h+x*d+S*v,t[7]=b*a+y*c+x*p+S*m,b=r[8],y=r[9],x=r[10],S=r[11],t[8]=b*n+y*s+x*f+S*M,t[9]=b*i+y*u+x*l+S*g,t[10]=b*o+y*h+x*d+S*v,t[11]=b*a+y*c+x*p+S*m,b=r[12],y=r[13],x=r[14],S=r[15],t[12]=b*n+y*s+x*f+S*M,t[13]=b*i+y*u+x*l+S*g,t[14]=b*o+y*h+x*d+S*v,t[15]=b*a+y*c+x*p+S*m,t}function ae(t,e,r){var n,i,o,a,s,u,h,c,f,l,d,p,M=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*M+e[4]*g+e[8]*v+e[12],t[13]=e[1]*M+e[5]*g+e[9]*v+e[13],t[14]=e[2]*M+e[6]*g+e[10]*v+e[14],t[15]=e[3]*M+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=h,t[7]=c,t[8]=f,t[9]=l,t[10]=d,t[11]=p,t[12]=n*M+s*g+f*v+e[12],t[13]=i*M+u*g+l*v+e[13],t[14]=o*M+h*g+d*v+e[14],t[15]=a*M+c*g+p*v+e[15]),t}function se(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ue(t,e,r,n){var i,o,a,s,u,h,c,f,l,p,M,g,v,m,b,y,x,S,P,w,B,I,R,O,A=n[0],L=n[1],E=n[2],_=Math.hypot(A,L,E);return _0?(r[0]=2*(s*a+c*n+u*o-h*i)/f,r[1]=2*(u*a+c*i+h*n-s*o)/f,r[2]=2*(h*a+c*o+s*i-u*n)/f):(r[0]=2*(s*a+c*n+u*o-h*i),r[1]=2*(u*a+c*i+h*n-s*o),r[2]=2*(h*a+c*o+s*i-u*n)),me(t,e,r),t}function ye(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function xe(t,e){var r=e[0],n=e[1],i=e[2],o=e[4],a=e[5],s=e[6],u=e[8],h=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,h,c),t}function Se(t,e){var r=new p(3);xe(r,e);var n=1/r[0],i=1/r[1],o=1/r[2],a=e[0]*n,s=e[1]*i,u=e[2]*o,h=e[4]*n,c=e[5]*i,f=e[6]*o,l=e[8]*n,d=e[9]*i,M=e[10]*o,g=a+c+M,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(f-d)/v,t[1]=(l-u)/v,t[2]=(s-h)/v):a>c&&a>M?(v=2*Math.sqrt(1+a-c-M),t[3]=(f-d)/v,t[0]=.25*v,t[1]=(s+h)/v,t[2]=(l+u)/v):c>M?(v=2*Math.sqrt(1+c-a-M),t[3]=(l-u)/v,t[0]=(s+h)/v,t[1]=.25*v,t[2]=(f+d)/v):(v=2*Math.sqrt(1+M-a-c),t[3]=(s-h)/v,t[0]=(l+u)/v,t[1]=(f+d)/v,t[2]=.25*v),t}function Pe(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,h=o+o,c=a+a,f=i*u,l=i*h,d=i*c,p=o*h,M=o*c,g=a*c,v=s*u,m=s*h,b=s*c,y=n[0],x=n[1],S=n[2];return t[0]=(1-(p+g))*y,t[1]=(l+b)*y,t[2]=(d-m)*y,t[3]=0,t[4]=(l-b)*x,t[5]=(1-(f+g))*x,t[6]=(M+v)*x,t[7]=0,t[8]=(d+m)*S,t[9]=(M-v)*S,t[10]=(1-(f+p))*S,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function we(t,e,r,n,i){var o=e[0],a=e[1],s=e[2],u=e[3],h=o+o,c=a+a,f=s+s,l=o*h,d=o*c,p=o*f,M=a*c,g=a*f,v=s*f,m=u*h,b=u*c,y=u*f,x=n[0],S=n[1],P=n[2],w=i[0],B=i[1],I=i[2],R=(1-(M+v))*x,O=(d+y)*x,A=(p-b)*x,L=(d-y)*S,E=(1-(l+v))*S,_=(g+m)*S,F=(p+b)*P,C=(g-m)*P,j=(1-(l+M))*P;return t[0]=R,t[1]=O,t[2]=A,t[3]=0,t[4]=L,t[5]=E,t[6]=_,t[7]=0,t[8]=F,t[9]=C,t[10]=j,t[11]=0,t[12]=r[0]+w-(R*w+L*B+F*I),t[13]=r[1]+B-(O*w+E*B+C*I),t[14]=r[2]+I-(A*w+_*B+j*I),t[15]=1,t}function Be(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,h=r*a,c=n*a,f=n*s,l=i*a,d=i*s,p=i*u,M=o*a,g=o*s,v=o*u;return t[0]=1-f-p,t[1]=c+v,t[2]=l-g,t[3]=0,t[4]=c-v,t[5]=1-h-p,t[6]=d+M,t[7]=0,t[8]=l+g,t[9]=d-M,t[10]=1-h-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ie(t,e,r,n,i,o,a){var s=1/(r-e),u=1/(i-n),h=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*u,t[10]=(a+o)*h,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*h,t[15]=0,t}function Re(t,e,r,n,i){var o,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(n-i),t[10]=(i+n)*o,t[14]=2*i*n*o):(t[10]=-1,t[14]=-2*n),t}function Oe(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),h=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=h,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*h*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function Ae(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),h=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*h,t[15]=1,t}function Le(t,e,r,n){var i,o,a,s,u,h,c,f,l,p,M=e[0],g=e[1],v=e[2],m=n[0],b=n[1],y=n[2],x=r[0],S=r[1],P=r[2];return Math.abs(M-x)0&&(c*=d=1/Math.sqrt(d),f*=d,l*=d);var p=u*l-h*f,M=h*c-s*l,g=s*f-u*c;return(d=p*p+M*M+g*g)>0&&(p*=d=1/Math.sqrt(d),M*=d,g*=d),t[0]=p,t[1]=M,t[2]=g,t[3]=0,t[4]=f*g-l*M,t[5]=l*p-c*g,t[6]=c*M-f*p,t[7]=0,t[8]=c,t[9]=f,t[10]=l,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function _e(t){return\"mat4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\", \"+t[9]+\", \"+t[10]+\", \"+t[11]+\", \"+t[12]+\", \"+t[13]+\", \"+t[14]+\", \"+t[15]+\")\"}function Fe(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Ce(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function je(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function qe(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function Te(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function De(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function Ve(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],h=t[7],c=t[8],f=t[9],l=t[10],p=t[11],M=t[12],g=t[13],v=t[14],m=t[15],b=e[0],y=e[1],x=e[2],S=e[3],P=e[4],w=e[5],B=e[6],I=e[7],R=e[8],O=e[9],A=e[10],L=e[11],E=e[12],_=e[13],F=e[14],C=e[15];return Math.abs(r-b)<=d*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-y)<=d*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-x)<=d*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-S)<=d*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(a-P)<=d*Math.max(1,Math.abs(a),Math.abs(P))&&Math.abs(s-w)<=d*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(u-B)<=d*Math.max(1,Math.abs(u),Math.abs(B))&&Math.abs(h-I)<=d*Math.max(1,Math.abs(h),Math.abs(I))&&Math.abs(c-R)<=d*Math.max(1,Math.abs(c),Math.abs(R))&&Math.abs(f-O)<=d*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(l-A)<=d*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(p-L)<=d*Math.max(1,Math.abs(p),Math.abs(L))&&Math.abs(M-E)<=d*Math.max(1,Math.abs(M),Math.abs(E))&&Math.abs(g-_)<=d*Math.max(1,Math.abs(g),Math.abs(_))&&Math.abs(v-F)<=d*Math.max(1,Math.abs(v),Math.abs(F))&&Math.abs(m-C)<=d*Math.max(1,Math.abs(m),Math.abs(C))}var ke=oe,ze=je;function Ue(){var t=new p(3);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ye(t){var e=new p(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Ne(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function Ze(t,e,r){var n=new p(3);return n[0]=t,n[1]=e,n[2]=r,n}function Xe(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function He(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function Ge(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function Qe(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function Ke(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function We(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function $e(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Je(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function tr(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function er(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function rr(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function nr(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function ir(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function or(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function ar(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function sr(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function ur(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function hr(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function cr(t,e){var r=e[0],n=e[1],i=e[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function fr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function lr(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2];return t[0]=i*u-o*s,t[1]=o*a-n*u,t[2]=n*s-i*a,t}function dr(t,e,r,n){var i=e[0],o=e[1],a=e[2];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t}function pr(t,e,r,n,i,o){var a=o*o,s=a*(2*o-3)+1,u=a*(o-2)+o,h=a*(o-1),c=a*(3-2*o);return t[0]=e[0]*s+r[0]*u+n[0]*h+i[0]*c,t[1]=e[1]*s+r[1]*u+n[1]*h+i[1]*c,t[2]=e[2]*s+r[2]*u+n[2]*h+i[2]*c,t}function Mr(t,e,r,n,i,o){var a=1-o,s=a*a,u=o*o,h=s*a,c=3*o*s,f=3*u*a,l=u*o;return t[0]=e[0]*h+r[0]*c+n[0]*f+i[0]*l,t[1]=e[1]*h+r[1]*c+n[1]*f+i[1]*l,t[2]=e[2]*h+r[2]*c+n[2]*f+i[2]*l,t}function gr(t,e){e=e||1;var r=2*M()*Math.PI,n=2*M()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}function vr(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return a=a||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/a,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,t}function mr(t,e,r){var n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}function br(t,e,r){var n=r[0],i=r[1],o=r[2],a=r[3],s=e[0],u=e[1],h=e[2],c=i*h-o*u,f=o*s-n*h,l=n*u-i*s,d=i*l-o*f,p=o*c-n*l,M=n*f-i*c,g=2*a;return c*=g,f*=g,l*=g,d*=2,p*=2,M*=2,t[0]=s+c+d,t[1]=u+f+p,t[2]=h+l+M,t}function yr(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function xr(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function Sr(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function Pr(t,e){var r=t[0],n=t[1],i=t[2],o=e[0],a=e[1],s=e[2],u=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(o*o+a*a+s*s),h=u&&fr(t,e)/u;return Math.acos(Math.min(Math.max(h,-1),1))}function wr(t){return t[0]=0,t[1]=0,t[2]=0,t}function Br(t){return\"vec3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\")\"}function Ir(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Rr(t,e){var r=t[0],n=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-s)<=d*Math.max(1,Math.abs(i),Math.abs(s))}var Or,Ar=Qe,Lr=Ke,Er=We,_r=or,Fr=ar,Cr=Ne,jr=sr,qr=(Or=Ue(),function(t,e,r,n,i,o){var a,s;for(e||(e=3),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,a=r;a0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=o*a,t}function sn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function un(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],o=r[0]*n[2]-r[2]*n[0],a=r[0]*n[3]-r[3]*n[0],s=r[1]*n[2]-r[2]*n[1],u=r[1]*n[3]-r[3]*n[1],h=r[2]*n[3]-r[3]*n[2],c=e[0],f=e[1],l=e[2],d=e[3];return t[0]=f*h-l*u+d*s,t[1]=-c*h+l*a-d*o,t[2]=c*u-f*a+d*i,t[3]=-c*s+f*o-l*i,t}function hn(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t[3]=s+n*(r[3]-s),t}function cn(t,e){var r,n,i,o,a,s;e=e||1;do{a=(r=2*M()-1)*r+(n=2*M()-1)*n}while(a>=1);do{s=(i=2*M()-1)*i+(o=2*M()-1)*o}while(s>=1);var u=Math.sqrt((1-a)/s);return t[0]=e*r,t[1]=e*n,t[2]=e*i*u,t[3]=e*o*u,t}function fn(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}function ln(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2],h=r[3],c=h*n+s*o-u*i,f=h*i+u*n-a*o,l=h*o+a*i-s*n,d=-a*n-s*i-u*o;return t[0]=c*h+d*-a+f*-u-l*-s,t[1]=f*h+d*-s+l*-a-c*-u,t[2]=l*h+d*-u+c*-s-f*-a,t[3]=e[3],t}function dn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function pn(t){return\"vec4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}function Mn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function gn(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],h=e[3];return Math.abs(r-a)<=d*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-h)<=d*Math.max(1,Math.abs(o),Math.abs(h))}var vn=Yr,mn=Nr,bn=Zr,yn=Jr,xn=tn,Sn=en,Pn=rn,wn=function(){var t=Tr();return function(e,r,n,i,o,a){var s,u;for(r||(r=4),n||(n=0),u=i?Math.min(i*r+n,e.length):e.length,s=n;sd?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r}function An(t,e){var r=ii(t,e);return Math.acos(2*r*r-1)}function Ln(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*c+a*s+i*h-o*u,t[1]=i*c+a*u+o*s-n*h,t[2]=o*c+a*h+n*u-i*s,t[3]=a*c-n*s-i*u-o*h,t}function En(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+a*s,t[1]=i*u+o*s,t[2]=o*u-i*s,t[3]=a*u-n*s,t}function _n(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u-o*s,t[1]=i*u+a*s,t[2]=o*u+n*s,t[3]=a*u-i*s,t}function Fn(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+i*s,t[1]=i*u-n*s,t[2]=o*u+a*s,t[3]=a*u-o*s,t}function Cn(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function jn(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=Math.sqrt(r*r+n*n+i*i),s=Math.exp(o),u=a>0?s*Math.sin(a)/a:0;return t[0]=r*u,t[1]=n*u,t[2]=i*u,t[3]=s*Math.cos(a),t}function qn(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=Math.sqrt(r*r+n*n+i*i),s=a>0?Math.atan2(a,o)/a:0;return t[0]=r*s,t[1]=n*s,t[2]=i*s,t[3]=.5*Math.log(r*r+n*n+i*i+o*o),t}function Tn(t,e,r){return qn(t,e),ni(t,t,r),jn(t,t),t}function Dn(t,e,r,n){var i,o,a,s,u,h=e[0],c=e[1],f=e[2],l=e[3],p=r[0],M=r[1],g=r[2],v=r[3];return(o=h*p+c*M+f*g+l*v)<0&&(o=-o,p=-p,M=-M,g=-g,v=-v),1-o>d?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-n)*i)/a,u=Math.sin(n*i)/a):(s=1-n,u=n),t[0]=s*h+u*p,t[1]=s*c+u*M,t[2]=s*f+u*g,t[3]=s*l+u*v,t}function Vn(t){var e=M(),r=M(),n=M(),i=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*r),t[1]=i*Math.cos(2*Math.PI*r),t[2]=o*Math.sin(2*Math.PI*n),t[3]=o*Math.cos(2*Math.PI*n),t}function kn(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o,s=a?1/a:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=o*s,t}function zn(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Un(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*o+a]-e[3*a+o])*r,t[o]=(e[3*o+i]+e[3*i+o])*r,t[a]=(e[3*a+i]+e[3*i+a])*r}return t}function Yn(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(r),u=Math.cos(r),h=Math.sin(n),c=Math.cos(n);return t[0]=o*u*c-a*s*h,t[1]=a*s*c+o*u*h,t[2]=a*u*h-o*s*c,t[3]=a*u*c+o*s*h,t}function Nn(t){return\"quat(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}var Zn,Xn,Hn,Gn,Qn,Kn,Wn=Dr,$n=Vr,Jn=kr,ti=zr,ei=Ur,ri=Ln,ni=Wr,ii=sn,oi=hn,ai=en,si=ai,ui=rn,hi=ui,ci=an,fi=Mn,li=gn,di=(Zn=Ue(),Xn=Ze(1,0,0),Hn=Ze(0,1,0),function(t,e,r){var n=fr(e,r);return n<-.999999?(lr(Zn,Xn,e),Cr(Zn)<1e-6&&lr(Zn,Hn,e),cr(Zn,Zn),Rn(t,Zn,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(lr(Zn,e,r),t[0]=Zn[0],t[1]=Zn[1],t[2]=Zn[2],t[3]=1+n,ci(t,t))}),pi=(Gn=Bn(),Qn=Bn(),function(t,e,r,n,i,o){return Dn(Gn,e,i,o),Dn(Qn,r,n,o),Dn(t,Gn,Qn,2*o*(1-o)),t}),Mi=(Kn=vt(),function(t,e,r,n){return Kn[0]=r[0],Kn[3]=r[1],Kn[6]=r[2],Kn[1]=n[0],Kn[4]=n[1],Kn[7]=n[2],Kn[2]=-e[0],Kn[5]=-e[1],Kn[8]=-e[2],ci(t,Un(t,Kn))});function gi(){var t=new p(8);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function vi(t){var e=new p(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function mi(t,e,r,n,i,o,a,s){var u=new p(8);return u[0]=t,u[1]=e,u[2]=r,u[3]=n,u[4]=i,u[5]=o,u[6]=a,u[7]=s,u}function bi(t,e,r,n,i,o,a){var s=new p(8);s[0]=t,s[1]=e,s[2]=r,s[3]=n;var u=.5*i,h=.5*o,c=.5*a;return s[4]=u*n+h*r-c*e,s[5]=h*n+c*t-u*r,s[6]=c*n+u*e-h*t,s[7]=-u*t-h*e-c*r,s}function yi(t,e,r){var n=.5*r[0],i=.5*r[1],o=.5*r[2],a=e[0],s=e[1],u=e[2],h=e[3];return t[0]=a,t[1]=s,t[2]=u,t[3]=h,t[4]=n*h+i*u-o*s,t[5]=i*h+o*a-n*u,t[6]=o*h+n*s-i*a,t[7]=-n*a-i*s-o*u,t}function xi(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function Si(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Pi(t,e){var r=Bn();Se(r,e);var n=new p(3);return ye(n,e),yi(t,r,n),t}function wi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function Bi(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Ii(t,e,r,n,i,o,a,s,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t}var Ri=Jn;function Oi(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var Ai=Jn;function Li(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function Ei(t,e){var r=e[4],n=e[5],i=e[6],o=e[7],a=-e[0],s=-e[1],u=-e[2],h=e[3];return t[0]=2*(r*h+o*a+n*u-i*s),t[1]=2*(n*h+o*s+i*a-r*u),t[2]=2*(i*h+o*u+r*s-n*a),t}function _i(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=.5*r[0],u=.5*r[1],h=.5*r[2],c=e[4],f=e[5],l=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=a*s+i*h-o*u+c,t[5]=a*u+o*s-n*h+f,t[6]=a*h+n*u-i*s+l,t[7]=-n*s-i*u-o*h+d,t}function Fi(t,e,r){var n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=s*a+c*n+u*o-h*i,l=u*a+c*i+h*n-s*o,d=h*a+c*o+s*i-u*n,p=c*a-s*n-u*i-h*o;return En(t,e,r),n=t[0],i=t[1],o=t[2],a=t[3],t[4]=f*a+p*n+l*o-d*i,t[5]=l*a+p*i+d*n-f*o,t[6]=d*a+p*o+f*i-l*n,t[7]=p*a-f*n-l*i-d*o,t}function Ci(t,e,r){var n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=s*a+c*n+u*o-h*i,l=u*a+c*i+h*n-s*o,d=h*a+c*o+s*i-u*n,p=c*a-s*n-u*i-h*o;return _n(t,e,r),n=t[0],i=t[1],o=t[2],a=t[3],t[4]=f*a+p*n+l*o-d*i,t[5]=l*a+p*i+d*n-f*o,t[6]=d*a+p*o+f*i-l*n,t[7]=p*a-f*n-l*i-d*o,t}function ji(t,e,r){var n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=s*a+c*n+u*o-h*i,l=u*a+c*i+h*n-s*o,d=h*a+c*o+s*i-u*n,p=c*a-s*n-u*i-h*o;return Fn(t,e,r),n=t[0],i=t[1],o=t[2],a=t[3],t[4]=f*a+p*n+l*o-d*i,t[5]=l*a+p*i+d*n-f*o,t[6]=d*a+p*o+f*i-l*n,t[7]=p*a-f*n-l*i-d*o,t}function qi(t,e,r){var n=r[0],i=r[1],o=r[2],a=r[3],s=e[0],u=e[1],h=e[2],c=e[3];return t[0]=s*a+c*n+u*o-h*i,t[1]=u*a+c*i+h*n-s*o,t[2]=h*a+c*o+s*i-u*n,t[3]=c*a-s*n-u*i-h*o,s=e[4],u=e[5],h=e[6],c=e[7],t[4]=s*a+c*n+u*o-h*i,t[5]=u*a+c*i+h*n-s*o,t[6]=h*a+c*o+s*i-u*n,t[7]=c*a-s*n-u*i-h*o,t}function Ti(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*c+a*s+i*h-o*u,t[1]=i*c+a*u+o*s-n*h,t[2]=o*c+a*h+n*u-i*s,t[3]=a*c-n*s-i*u-o*h,s=r[4],u=r[5],h=r[6],c=r[7],t[4]=n*c+a*s+i*h-o*u,t[5]=i*c+a*u+o*s-n*h,t[6]=o*c+a*h+n*u-i*s,t[7]=a*c-n*s-i*u-o*h,t}function Di(t,e,r,n){if(Math.abs(n)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,o=e[2]/r,a=e[3]/r,s=e[4],u=e[5],h=e[6],c=e[7],f=n*s+i*u+o*h+a*c;t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=(s-n*f)/r,t[5]=(u-i*f)/r,t[6]=(h-o*f)/r,t[7]=(c-a*f)/r}return t}function $i(t){return\"quat2(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\")\"}function Ji(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function to(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],h=t[7],c=e[0],f=e[1],l=e[2],p=e[3],M=e[4],g=e[5],v=e[6],m=e[7];return Math.abs(r-c)<=d*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(n-f)<=d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-l)<=d*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(o-p)<=d*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-M)<=d*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(s-g)<=d*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(u-v)<=d*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(h-m)<=d*Math.max(1,Math.abs(h),Math.abs(m))}function eo(){var t=new p(2);return p!=Float32Array&&(t[0]=0,t[1]=0),t}function ro(t){var e=new p(2);return e[0]=t[0],e[1]=t[1],e}function no(t,e){var r=new p(2);return r[0]=t,r[1]=e,r}function io(t,e){return t[0]=e[0],t[1]=e[1],t}function oo(t,e,r){return t[0]=e,t[1]=r,t}function ao(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function so(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function uo(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function ho(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function co(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function fo(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function lo(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function po(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function Mo(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function go(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function vo(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function mo(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function bo(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function yo(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function xo(t){var e=t[0],r=t[1];return e*e+r*r}function So(t,e){return t[0]=-e[0],t[1]=-e[1],t}function Po(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function wo(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function Bo(t,e){return t[0]*e[0]+t[1]*e[1]}function Io(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function Ro(t,e,r,n){var i=e[0],o=e[1];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t}function Oo(t,e){e=e||1;var r=2*M()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function Ao(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function Lo(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function Eo(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function _o(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function Fo(t,e,r,n){var i=e[0]-r[0],o=e[1]-r[1],a=Math.sin(n),s=Math.cos(n);return t[0]=i*s-o*a+r[0],t[1]=i*a+o*s+r[1],t}function Co(t,e){var r=t[0],n=t[1],i=e[0],o=e[1],a=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+o*o),s=a&&(r*i+n*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function jo(t){return t[0]=0,t[1]=0,t}function qo(t){return\"vec2(\"+t[0]+\", \"+t[1]+\")\"}function To(t,e){return t[0]===e[0]&&t[1]===e[1]}function Do(t,e){var r=t[0],n=t[1],i=e[0],o=e[1];return Math.abs(r-i)<=d*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-o)<=d*Math.max(1,Math.abs(n),Math.abs(o))}var Vo=yo,ko=so,zo=uo,Uo=ho,Yo=mo,No=bo,Zo=xo,Xo=function(){var t=eo();return function(e,r,n,i,o,a){var s,u;for(r||(r=2),n||(n=0),u=i?Math.min(i*r+n,e.length):e.length,s=n;s{var n;!function(){\"use strict\";var i=.5*(Math.sqrt(3)-1),o=(3-Math.sqrt(3))/6,a=1/6,s=(Math.sqrt(5)-1)/4,u=(5-Math.sqrt(5))/20;function h(t){var e;e=\"function\"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=f();t=i(\" \"),e=i(\" \"),r=i(\" \");for(var o=0;o>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}h.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,a=this.permMod12,s=this.perm,u=this.grad3,h=0,c=0,f=0,l=(t+e)*i,d=Math.floor(t+l),p=Math.floor(e+l),M=(d+p)*o,g=t-(d-M),v=e-(p-M);g>v?(r=1,n=0):(r=0,n=1);var m=g-r+o,b=v-n+o,y=g-1+2*o,x=v-1+2*o,S=255&d,P=255&p,w=.5-g*g-v*v;if(w>=0){var B=3*a[S+s[P]];h=(w*=w)*w*(u[B]*g+u[B+1]*v)}var I=.5-m*m-b*b;if(I>=0){var R=3*a[S+r+s[P+n]];c=(I*=I)*I*(u[R]*m+u[R+1]*b)}var O=.5-y*y-x*x;if(O>=0){var A=3*a[S+1+s[P+1]];f=(O*=O)*O*(u[A]*y+u[A+1]*x)}return 70*(h+c+f)},noise3D:function(t,e,r){var n,i,o,s,u,h,c,f,l,d,p=this.permMod12,M=this.perm,g=this.grad3,v=.3333333333333333*(t+e+r),m=Math.floor(t+v),b=Math.floor(e+v),y=Math.floor(r+v),x=(m+b+y)*a,S=t-(m-x),P=e-(b-x),w=r-(y-x);S>=P?P>=w?(u=1,h=0,c=0,f=1,l=1,d=0):S>=w?(u=1,h=0,c=0,f=1,l=0,d=1):(u=0,h=0,c=1,f=1,l=0,d=1):P_?j++:q++,E>F?j++:T++,E>C?j++:D++,_>F?q++:T++,_>C?q++:D++,F>C?T++:D++;var V=E-(f=j>=3?1:0)+u,k=_-(l=q>=3?1:0)+u,z=F-(d=T>=3?1:0)+u,U=C-(p=D>=3?1:0)+u,Y=E-(M=j>=2?1:0)+2*u,N=_-(g=q>=2?1:0)+2*u,Z=F-(v=T>=2?1:0)+2*u,X=C-(m=D>=2?1:0)+2*u,H=E-(b=j>=1?1:0)+3*u,G=_-(y=q>=1?1:0)+3*u,Q=F-(x=T>=1?1:0)+3*u,K=C-(S=D>=1?1:0)+3*u,W=E-1+4*u,$=_-1+4*u,J=F-1+4*u,tt=C-1+4*u,et=255&I,rt=255&R,nt=255&O,it=255&A,ot=.6-E*E-_*_-F*F-C*C;if(ot<0)i=0;else{var at=P[et+P[rt+P[nt+P[it]]]]%32*4;i=(ot*=ot)*ot*(w[at]*E+w[at+1]*_+w[at+2]*F+w[at+3]*C)}var st=.6-V*V-k*k-z*z-U*U;if(st<0)o=0;else{var ut=P[et+f+P[rt+l+P[nt+d+P[it+p]]]]%32*4;o=(st*=st)*st*(w[ut]*V+w[ut+1]*k+w[ut+2]*z+w[ut+3]*U)}var ht=.6-Y*Y-N*N-Z*Z-X*X;if(ht<0)a=0;else{var ct=P[et+M+P[rt+g+P[nt+v+P[it+m]]]]%32*4;a=(ht*=ht)*ht*(w[ct]*Y+w[ct+1]*N+w[ct+2]*Z+w[ct+3]*X)}var ft=.6-H*H-G*G-Q*Q-K*K;if(ft<0)h=0;else{var lt=P[et+b+P[rt+y+P[nt+x+P[it+S]]]]%32*4;h=(ft*=ft)*ft*(w[lt]*H+w[lt+1]*G+w[lt+2]*Q+w[lt+3]*K)}var dt=.6-W*W-$*$-J*J-tt*tt;if(dt<0)c=0;else{var pt=P[et+1+P[rt+1+P[nt+1+P[it+1]]]]%32*4;c=(dt*=dt)*dt*(w[pt]*W+w[pt+1]*$+w[pt+2]*J+w[pt+3]*tt)}return 27*(i+o+a+h+c)}},h._buildPermutationTable=c,void 0===(n=function(){return h}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=h,t.exports=h}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r(915)})()}));","/*\n (c) 2017, Vladimir Agafonkin\n Simplify.js, a high-performance JS polyline simplification library\n mourner.github.io/simplify-js\n*/\n\n(function () { 'use strict';\n\n// to suit your point format, run search/replace for '.x' and '.y';\n// for 3D version, see 3d branch (configurability would draw significant performance overhead)\n\n// square distance between 2 points\nfunction getSqDist(p1, p2) {\n\n var dx = p1.x - p2.x,\n dy = p1.y - p2.y;\n\n return dx * dx + dy * dy;\n}\n\n// square distance from a point to a segment\nfunction getSqSegDist(p, p1, p2) {\n\n var x = p1.x,\n y = p1.y,\n dx = p2.x - x,\n dy = p2.y - y;\n\n if (dx !== 0 || dy !== 0) {\n\n var t = ((p.x - x) * dx + (p.y - y) * dy) / (dx * dx + dy * dy);\n\n if (t > 1) {\n x = p2.x;\n y = p2.y;\n\n } else if (t > 0) {\n x += dx * t;\n y += dy * t;\n }\n }\n\n dx = p.x - x;\n dy = p.y - y;\n\n return dx * dx + dy * dy;\n}\n// rest of the code doesn't care about point format\n\n// basic distance-based simplification\nfunction simplifyRadialDist(points, sqTolerance) {\n\n var prevPoint = points[0],\n newPoints = [prevPoint],\n point;\n\n for (var i = 1, len = points.length; i < len; i++) {\n point = points[i];\n\n if (getSqDist(point, prevPoint) > sqTolerance) {\n newPoints.push(point);\n prevPoint = point;\n }\n }\n\n if (prevPoint !== point) newPoints.push(point);\n\n return newPoints;\n}\n\nfunction simplifyDPStep(points, first, last, sqTolerance, simplified) {\n var maxSqDist = sqTolerance,\n index;\n\n for (var i = first + 1; i < last; i++) {\n var sqDist = getSqSegDist(points[i], points[first], points[last]);\n\n if (sqDist > maxSqDist) {\n index = i;\n maxSqDist = sqDist;\n }\n }\n\n if (maxSqDist > sqTolerance) {\n if (index - first > 1) simplifyDPStep(points, first, index, sqTolerance, simplified);\n simplified.push(points[index]);\n if (last - index > 1) simplifyDPStep(points, index, last, sqTolerance, simplified);\n }\n}\n\n// simplification using Ramer-Douglas-Peucker algorithm\nfunction simplifyDouglasPeucker(points, sqTolerance) {\n var last = points.length - 1;\n\n var simplified = [points[0]];\n simplifyDPStep(points, 0, last, sqTolerance, simplified);\n simplified.push(points[last]);\n\n return simplified;\n}\n\n// both algorithms combined for awesome performance\nfunction simplify(points, tolerance, highestQuality) {\n\n if (points.length <= 2) return points;\n\n var sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1;\n\n points = highestQuality ? points : simplifyRadialDist(points, sqTolerance);\n points = simplifyDouglasPeucker(points, sqTolerance);\n\n return points;\n}\n\n// export as AMD module / Node module / browser or worker variable\nif (typeof define === 'function' && define.amd) define(function() { return simplify; });\nelse if (typeof module !== 'undefined') {\n module.exports = simplify;\n module.exports.default = simplify;\n} else if (typeof self !== 'undefined') self.simplify = simplify;\nelse window.simplify = simplify;\n\n})();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.concat = exports.round = void 0;\nconst round = (value, decimals) => Math.round(value * 10 ** decimals) / 10 ** decimals;\nexports.round = round;\nconst concat = (result, data) => {\n if (typeof data === 'string')\n result.push(data);\n else\n data.forEach(line => result.push(line));\n};\nexports.concat = concat;\n//# sourceMappingURL=utilities.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./SVGExporter\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SVGExporter = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nclass SVGExporter {\n static parse(scene, settings = {}) {\n const bindedSettings = {\n ...SVGExporter.defaults,\n ...settings,\n };\n return SVGExporter.generate(scene, bindedSettings);\n }\n /**\n * Get drawer prop\n *\n * @param key name of the property (fill, stroke, lineWidth)\n * @param propArguments currentIndexing propArguments\n * @param defaultValue\n *\n * @returns string | number\n */\n static getSVGProp(key, propArguments, defaultValue) {\n let attribute = propArguments.shape.drawer[key];\n if (typeof attribute === 'function') {\n attribute = attribute(propArguments);\n }\n return attribute !== null && attribute !== void 0 ? attribute : defaultValue;\n }\n /**\n *\n * @param type fill | stroke\n * @param color string\n * @param attriburesPtr list of attributes to apply\n * @param stylePtr Array of string to put in style attr\n *\n * @returns\n */\n static bindColorAttribute(type, color, attriburesPtr, stylePtr) {\n if (typeof color === 'undefined')\n return;\n if (color === 'none') {\n attriburesPtr.push(`${type}=\"none\"`);\n }\n else {\n const parsed = color_1.parseColorAndConvert(color);\n if (parsed) {\n if (parsed.alpha !== 1) {\n stylePtr.push(`${type}-opacity: ${parsed.alpha}`);\n }\n attriburesPtr.push(`${type}=\"${color_1.rgbToHex(parsed.r, parsed.g, parsed.b)}\"`);\n }\n }\n }\n /**\n * Generate SVG from scene and settings\n *\n * @param scene\n * @param settings\n * @returns\n */\n static generate(scene, settings) {\n const paths = SVGExporter.generatePaths(scene, settings);\n let background;\n if (settings.background) {\n const attributes = [];\n const styles = [];\n SVGExporter.bindColorAttribute('fill', scene.background, attributes, styles);\n styles.length > 0 && attributes.push(`styles=\"${styles.join('; ')}\"`);\n background = ``;\n }\n return (`` +\n `\\n\\t` +\n (background ? `\\n\\t${background}` : '') +\n `\\n\\t${paths.join('\\n\\t')}` +\n `\\n`);\n }\n /**\n * Convert shapes to paths\n *\n * @param scene\n * @param settings\n * @returns\n */\n static generatePaths(scene, settings) {\n const paths = [];\n const sceneChilds = scene.getChildren();\n for (let i = 0, len = sceneChilds.length; i < len; i++) {\n sceneChilds[i].generate(0, true);\n const childBuffer = sceneChilds[i].getBuffer() || [];\n const childIndexedBuffer = sceneChilds[i].getIndexedBuffer() || [];\n let childVertexIndex = 0;\n for (let currentBufferIndex = 0, len = childIndexedBuffer.length; currentBufferIndex < len; currentBufferIndex++) {\n const currentIndexing = childIndexedBuffer[currentBufferIndex];\n // Store points\n const points = [];\n for (let len = childVertexIndex + currentIndexing.frameLength; childVertexIndex < len; childVertexIndex += 2) {\n points.push(childBuffer[childVertexIndex].toFixed(settings.decimals) +\n ' ' +\n childBuffer[childVertexIndex + 1].toFixed(settings.decimals));\n }\n // get styles and bind attributes\n const propArguments = {\n shape: currentIndexing.shape,\n repetition: currentIndexing.repetition,\n parent: currentIndexing.parent,\n };\n const attributes = [];\n const styles = [];\n const fill = SVGExporter.getSVGProp('fill', propArguments);\n SVGExporter.bindColorAttribute('fill', fill || 'none', attributes, styles);\n const stroke = SVGExporter.getSVGProp('stroke', propArguments, typeof fill === 'undefined' ? scene.color : undefined);\n SVGExporter.bindColorAttribute('stroke', stroke, attributes, styles);\n const lineWidth = SVGExporter.getSVGProp('lineWidth', propArguments, 1);\n if (stroke)\n attributes.push(`stroke-width=\"${lineWidth || 1}\"`);\n // move style to attributes\n styles.length > 0 && attributes.push(`style=\"${styles.join('; ')}\"`);\n // build path\n const d = `M${points.join(' L')} ${currentIndexing.shape.isClosed() ? 'Z' : ''}`;\n const path = ``;\n paths.push(path);\n }\n }\n return paths;\n }\n}\nexports.SVGExporter = SVGExporter;\nSVGExporter.defaults = {\n decimals: 3,\n background: true,\n};\n//# sourceMappingURL=SVGExporter.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./conversions\"), exports);\n__exportStar(require(\"./parsing\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.rgbToHsl = exports.hslToRgb = exports.rgbToHex = void 0;\n/**\n * Convert rgb to hex\n *\n * @param r number between 0 - 255\n * @param g number between 0 - 255\n * @param b number between 0 - 255\n * @returns #ffffff\n */\nfunction rgbToHex(r, g, b) {\n return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;\n}\nexports.rgbToHex = rgbToHex;\n/**\n * Convert hsl (0-360, 0-100, 0-100) color to rgb(0-255, 0-255, 0-255)\n *\n * @param {number} h number between 0 - 360\n * @param {number} s number between 0 - 100\n * @param {number} l number between 0 - 100\n * @returns {[number, number, number]} [0-255, 0-255, 0-255]\n */\nfunction hslToRgb(h, s, l) {\n h /= 360;\n s /= 100;\n l /= 100;\n let r, g, b;\n if (s == 0) {\n r = g = b = l; // achromatic\n }\n else {\n const hue2rgb = (p, q, t) => {\n t += t < 0 ? 1 : t > 1 ? -1 : 0;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n };\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return [(0.5 + r * 255) << 0, (0.5 + g * 255) << 0, (0.5 + b * 255) << 0];\n}\nexports.hslToRgb = hslToRgb;\n/**\n * Convert rbg (0-255, 0-255, 0-255) to hsl (0-360, 0-100, 0-100)\n *\n * @param {number} r number between 0 - 255\n * @param {number} g number between 0 - 255\n * @param {number} b number between 0 - 255\n * @returns {[number, number, number]} (0-360, 0-100, 0-100)\n */\nfunction rgbToHsl(r, g, b) {\n r /= 255;\n g /= 255;\n b /= 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s;\n if (max === min) {\n h = s = 0;\n }\n else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h = h / 6;\n }\n return [(0.5 + h * 360) << 0, (0.5 + s * 100) << 0, (0.5 + l * 100) << 0];\n}\nexports.rgbToHsl = rgbToHsl;\n//# sourceMappingURL=conversions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseColor = exports.parseColorAndConvert = void 0;\nconst conversions_1 = require(\"./conversions\");\n/**\n * Convert color to IConvertedColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IConvertedColor | undefined)}\n */\nfunction parseColorAndConvert(color) {\n const parsed = parseColor(color);\n if (parsed) {\n if (parsed.type === 'hsl') {\n const [r, g, b] = conversions_1.hslToRgb(parsed.a, parsed.b, parsed.c);\n return {\n r,\n g,\n b,\n h: parsed.a,\n s: parsed.b,\n l: parsed.c,\n alpha: parsed.alpha,\n };\n }\n else {\n const [h, s, l] = conversions_1.rgbToHsl(parsed.a, parsed.b, parsed.c);\n return {\n h,\n s,\n l,\n r: parsed.a,\n g: parsed.b,\n b: parsed.c,\n alpha: parsed.alpha,\n };\n }\n }\n}\nexports.parseColorAndConvert = parseColorAndConvert;\n/**\n * Convert color to IColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IColor | undefined)}\n */\nfunction parseColor(color) {\n if (typeof color === 'number') {\n if (color > 0xffffff) {\n return {\n type: 'rgb',\n a: (color >> 24) & 255,\n b: (color >> 16) & 255,\n c: (color >> 8) & 255,\n alpha: (color & 255) / 255,\n };\n }\n else {\n return { type: 'rgb', a: (color >> 16) & 255, b: (color >> 8) & 255, c: color & 255, alpha: 1 };\n }\n }\n color = color.replace(/\\s/g, '');\n let match = /^#([0-9a-f]{3,8})$/i.exec(color);\n if (match) {\n const hex = match[1];\n if (hex.length === 3) {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[0], 16),\n b: parseInt(hex[1] + hex[1], 16),\n c: parseInt(hex[2] + hex[2], 16),\n alpha: 1,\n };\n }\n else {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[1], 16),\n b: parseInt(hex[2] + hex[3], 16),\n c: parseInt(hex[4] + hex[5], 16),\n alpha: hex.length > 6 ? parseInt(hex.substring(6), 16) / 255 : 1,\n };\n }\n }\n match = /^((hsl|rgb)a?)\\((\\d+),(\\d+)%?,(\\d+)%?,?(.+)?\\)$/i.exec(color);\n if (match) {\n const [, , type, a, b, c, alpha] = match;\n return {\n type: type,\n a: +a,\n b: +b,\n c: +c,\n alpha: alpha ? +alpha : 1,\n };\n }\n}\nexports.parseColor = parseColor;\n//# sourceMappingURL=parsing.js.map","/*! For license information please see urpflanze-svg-importer.min.js.LICENSE.txt */\n!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.SVGImporter=e():t.SVGImporter=e()}(window,(function(){return(()=>{var t={877:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.SVGImporter=void 0;const n=r(500),i=r(688),s=r(926),o=r(926),a=r(479),h=r(721),u=r(197),c=r(825);class l{static isSVG(t){return l.SVG_REGEX.test(t.replace(l.COMMENT_REGEX,\"\"))}static getWindowInstance(){return l.windowInstance}static setWindowInstance(t){l.windowInstance=t}static stringToSVG(t){if(t=t.trim(),!l.isSVG(t))return console.warn(\"[Urpflanze:SVGImport] | Input is not valid SVG string\",t),null;const e=l.windowInstance.document.createElement(\"div\");return e.innerHTML=t,e.firstChild}static parse(t,e=.01,r){if(!1===l.isSVG(t))return console.warn(\"[Urpflanze:SVGImport] | Input is not valid svg\",t),null;const n=l.svgToBuffers(t,e);return n?l.parsedToShape(n,r):null}static parsedToShape(t,e){const r=[];if(t.buffers.forEach(((t,n)=>{const i=new s.ShapeBuffer({shape:t.buffer,bClosed:t.bClosed,sideLength:e,drawer:t.drawer});i&&r.push(i)})),1===r.length)return r[0];const n=new s.Group;return r.forEach((t=>n.add(t))),new s.Shape({shape:n})}static svgToBuffers(t,e=.01){const r=\"string\"==typeof t?l.stringToSVG(t):t;if(null===r)return console.error(\"[Urpflanze:SVGImport] | Cannot convert string to svg\",t),null;const n=l.getViewbox(r);r.querySelectorAll(\"g\").forEach(l.propagateGroupTransformAndStyleToChildren);const i=Array.from(r.querySelectorAll(\"rect, circle, ellipse, line, polyline, polygon, path\")),o=[].concat(...i.map((t=>l.elementToPath(t)))),a=Math.max(n[2]-n[0],n[3]-n[1]).toExponential(1).match(/e(\\+?[0-9]+)/),h=10/(1e3/Math.min(10**Math.max(a?+a[1]:0,0),1e3));let u=o.map((t=>l.pathToBuffer(t,h,n))).filter((t=>!!t&&t.length>=2));u=u.map((t=>l.simpliyBuffer(t,e))),u=u.map(((t,e)=>l.pathIsClosed(o[e])&&s.Vec2.distance([t[0],t[1]],[t[t.length-2],t[t.length-1]])<1?t.subarray(0,t.length-2):t));const f=Math.sqrt((n[2]-n[0])*(n[3]-n[1])),d=l.getStyleAttr(\"fill\",r),p=l.getStyleAttr(\"stroke\",r),m=l.getStyleAttr(\"stroke-width\",r,f/100),g=[];for(let t=0;t=0?c.fromPercentage(parseFloat(e),f):parseFloat(e));const n=l.getStyleAttr(\"fill\",o[t],d||void 0),i=l.getStyleAttr(\"stroke\",o[t],n?void 0:p||\"rgba(255,255,255)\"),s=r||(i?m:void 0);g.push({buffer:u[t],bClosed:l.pathIsClosed(o[t]),drawer:{fill:n,stroke:i,lineWidth:s?s/(f/100):void 0}})}return i.forEach((t=>t.remove())),{viewBox:n,buffers:g}}static getStyleAttr(t,e,r){const n=e.getAttribute(t);if(\"none\"===n)return;let s;if(null!=n)s=n;else{const r=\"stroke-width\"===t?\"strokeWidth\":t;void 0!==e.style[r]&&e.style[r].length>0&&(s=e.style[r])}if(void 0===s)return r;if(\"stroke-width\"===t)return parseFloat(s);let o=parseFloat(e.getAttribute(\"opacity\")||\"1\");const a=e.getAttribute(\"style\");if(a&&a.length){const e=new RegExp(`${t}-opacity: +?(\\\\d?.\\\\d|\\\\d)`,\"i\"),r=a.match(e);r&&(o=parseFloat(r[1]))}const h=i.parseColor(s);return h?(o=1!==h.alpha?h.alpha:o,\"rgb\"===h.type?`rgba(${h.a}, ${h.b}, ${h.c}, ${o})`:`hsla(${h.a}, ${h.b}%, ${h.c}%, ${o})`):r}static getViewbox(t){const e=t.getAttribute(\"viewBox\");if(e)return e.split(\" \").map((t=>parseFloat(t)));const r=t.getAttribute(\"width\"),n=t.getAttribute(\"height\");if(r&&n)return[0,0,parseFloat(r),parseFloat(n)];t=t.cloneNode(!0);const i=Array.from(t.querySelectorAll(\"rect, circle, ellipse, line, polyline, polygon, path\")),s=[].concat.apply([],i.map(l.elementToPath));let a=0,h=0;for(let t=0,e=s.length;ta&&(a=t.width),t.height>h&&(h=t.height)}}return[0,0,a,h]}static pathIsClosed(t){var e;return\"z\"===(null===(e=t.getAttribute(\"d\"))||void 0===e?void 0:e.trim().substr(-1).toLowerCase())}static simpliyBuffer(t,e=.01){const r=[];for(let e=0,n=t.length;e{i[2*e]=t.x,i[2*e+1]=t.y})),i}static sanitizePath(t,e){return h(t).abs().unarc().transform(e||\"\").toString()}static pathToBuffer(t,e=.01,r=[-1,-1,1,1]){const i=r[2]-r[0],s=r[3]-r[1],o=2/Math.max(i,s),a=t.getAttribute(\"d\"),h=t.getAttribute(\"transform\")||\"\",u=new n.Path({d:l.sanitizePath(a,h)}),c=Math.floor(u.length()),f=2*Math.floor(c/e),d=new Float32Array(f);let p=0;for(let t=0;t0){const r=u.compose(u.fromDefinition(u.fromTransformAttribute(e))),n=t.children;Array.from(n).forEach((t=>{let n=t.getAttribute(\"transform\");if(n&&n.length>0){const t=u.compose(u.fromDefinition(u.fromTransformAttribute(n))),e=u.compose(r,t);n=u.toSVG(e)}else n=e;t.setAttribute(\"transform\",n)}))}[\"fill\",\"stroke\",\"stroke-width\",\"style\"].forEach((e=>{const r=t.getAttribute(e);r&&Array.from(t.children).forEach((t=>{null===t.getAttribute(e)&&t.setAttribute(e,r)}))}))}static elementToPath(t){const e=l.windowInstance.document;let r=[];return\"path\"===t.nodeName?r=h(t.getAttribute(\"d\")||\"\").abs().unarc().toString().split(\"M\").filter((t=>t.length>0)).map((t=>\"M\"+t)):[\"rect\",\"ellipse\",\"circle\",\"line\",\"polyline\",\"polygon\"].includes(t.nodeName)?r=[c.conversion[t.nodeName](t)]:console.warn(`[Urpflanze:SVGImport] | Cannot convert ${t.nodeName} to path`),r.map((r=>{const n=e.createElementNS(\"http://www.w3.org/2000/svg\",\"path\");return n.setAttribute(\"d\",r),n.setAttribute(\"transform\",t.getAttribute(\"transform\")||\"\"),n.setAttribute(\"style\",t.getAttribute(\"style\")||\"\"),n.setAttribute(\"fill\",l.getStyleAttr(\"fill\",t,\"\")+\"\"),n.setAttribute(\"stroke\",l.getStyleAttr(\"stroke\",t,\"\")+\"\"),n.setAttribute(\"opacity\",t.getAttribute(\"opacity\")||\"1\"),n.setAttribute(\"stroke-width\",l.getStyleAttr(\"stroke-width\",t,\"\")+\"\"),n}))}}e.SVGImporter=l,l.HEX_REGEX=\"#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})\",l.SVG_REGEX=/^\\s*(?:<\\?xml[^>]*>\\s*)?(?:]*\\s*(?:\\[?(?:\\s*]*>\\s*)*\\]?)*[^>]*>\\s*)?(?:]*>[^]*<\\/svg>|]*\\/\\s*>)\\s*$/i,l.COMMENT_REGEX=//g},625:function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),e.SVGImporter=void 0;const s=r(877);Object.defineProperty(e,\"SVGImporter\",{enumerable:!0,get:function(){return s.SVGImporter}}),i(r(291),e),s.SVGImporter.setWindowInstance(window),e.default=s.SVGImporter},291:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},825:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.conversion=e.fromPercentage=void 0,e.fromPercentage=(t,e)=>/%$/.test(t+\"\")?100*parseFloat((t+\"\").replace(\"%\",\"\"))/e:+t;const r={rect:t=>{const r=parseFloat(t.getAttribute(\"width\")||\"0\"),n=parseFloat(t.getAttribute(\"height\")||\"0\"),i=parseFloat(t.getAttribute(\"x\")||\"0\"),s=parseFloat(t.getAttribute(\"y\")||\"0\");let o=t.getAttribute(\"rx\")||\"auto\",a=t.getAttribute(\"ry\")||\"auto\";\"auto\"===o&&\"auto\"===a?o=a=0:\"auto\"!==o&&\"auto\"===a?o=a=e.fromPercentage(o,r):\"auto\"!==a&&\"auto\"===o?a=o=e.fromPercentage(a,n):(o=e.fromPercentage(o,r),a=e.fromPercentage(a,n)),o>r/2&&(o=r/2),a>n/2&&(a=n/2);const h=o>0&&a>0;return[`M${i+o} ${s}`,\"H\"+(i+r-o),...h?[`A${o} ${a} 0 0 1 ${i+r} ${s+a}`]:[],\"V\"+(s+n-a),...h?[`A${o} ${a} 0 0 1 ${i+r-o} ${s+n}`]:[],`H${i+o}`,...h?[`A${o} ${a} 0 0 1 ${i} ${s+n-a}`]:[],`V${s+a}`,...h?[`A${o} ${a} 0 0 1 ${i+o} ${s}`]:[],\"Z\"].join(\" \")},ellipse:t=>{var e,r,n,i;const s=parseFloat(t.getAttribute(\"cx\")||\"0\"),o=parseFloat(t.getAttribute(\"cy\")||\"0\"),a=parseFloat(null!==(r=null!==(e=t.getAttribute(\"rx\"))&&void 0!==e?e:t.getAttribute(\"r\"))&&void 0!==r?r:\"0\"),h=parseFloat(null!==(i=null!==(n=t.getAttribute(\"ry\"))&&void 0!==n?n:t.getAttribute(\"r\"))&&void 0!==i?i:\"0\");return[`M${s+a} ${o}`,`A${a} ${h} 0 0 1 ${s} ${o+h}`,`A${a} ${h} 0 0 1 ${s-a} ${o}`,`A${a} ${h} 0 0 1 ${s+a} ${o}`,\"Z\"].join(\" \")},circle:t=>r.ellipse(t),line:t=>`M${t.getAttribute(\"x1\")||\"0\"} ${t.getAttribute(\"y1\")||\"0\"} L${t.getAttribute(\"x2\")||\"0\"} ${t.getAttribute(\"y2\")||\"0\"}`,polyline:t=>((t,e=2)=>{const r=[];for(;t.length>0;)r.push(t.splice(0,e));return r})((t.getAttribute(\"points\")||\"\").trim().replace(/ +/g,\" \").split(\" \").reduce(((t,e)=>[...t,...e.includes(\",\")?e.split(\",\"):[e]]),[]),2).map((([t,e],r)=>`${0===r?\"M\":\"L\"}${t} ${e}`)).join(\" \"),polygon:t=>r.polyline(t)+\" Z\",path:t=>t.getAttribute(\"d\")+\"\"};e.conversion=r},500:(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{A:()=>ur,Animator:()=>Ve,Array:()=>Lt,Box:()=>mt,Circle:()=>ir,ClipPath:()=>sr,Color:()=>ut,Container:()=>qt,Controller:()=>pe,Defs:()=>Yt,Dom:()=>Nt,Ease:()=>de,Element:()=>Ft,Ellipse:()=>Wt,EventTarget:()=>Ot,ForeignObject:()=>or,Fragment:()=>Jt,G:()=>hr,Gradient:()=>ne,Image:()=>se,Line:()=>he,List:()=>yt,Marker:()=>ue,Mask:()=>cr,Matrix:()=>ft,Morphable:()=>Ie,NonMorphable:()=>Re,Number:()=>kt,ObjectBag:()=>Le,PID:()=>ye,Path:()=>Fe,PathArray:()=>Ee,Pattern:()=>ie,Point:()=>ct,PointArray:()=>oe,Polygon:()=>qe,Polyline:()=>Ye,Queue:()=>ze,Rect:()=>De,Runner:()=>Ue,SVG:()=>mr,Shape:()=>Dt,Spring:()=>ge,Stop:()=>lr,Style:()=>fr,Svg:()=>Ke,Symbol:()=>tr,Text:()=>rr,TextPath:()=>dr,Timeline:()=>Xe,TransformBag:()=>Ce,Tspan:()=>nr,Use:()=>pr,adopt:()=>N,assignNewId:()=>V,clearEvents:()=>St,create:()=>L,defaults:()=>Tt,dispatch:()=>Et,easing:()=>le,eid:()=>z,extend:()=>$,find:()=>bt,getClass:()=>Y,getEventTarget:()=>_t,getEvents:()=>wt,getWindow:()=>I,makeInstance:()=>k,makeMorphable:()=>Ne,mockAdopt:()=>j,namespaces:()=>w,nodeOrNew:()=>B,off:()=>Pt,on:()=>At,parser:()=>dt,regex:()=>st,register:()=>q,registerMorphableType:()=>Be,registerWindow:()=>S,restoreWindow:()=>E,root:()=>T,saveWindow:()=>P,utils:()=>g,windowEvents:()=>Mt,withWindow:()=>O,wrapWithAttrCheck:()=>G});const n={},i=[];function s(t,e){if(Array.isArray(t))for(const r of t)s(r,e);else if(\"object\"!=typeof t)a(Object.getOwnPropertyNames(e)),n[t]=Object.assign(n[t]||{},e);else for(const e in t)s(e,t[e])}function o(t){return n[t]||{}}function a(t){i.push(...t)}function h(t,e){let r;const n=t.length,i=[];for(r=0;r=0;e--)V(t.children[e]);return t.id?(t.id=z(t.nodeName),t):t}function $(t,e){let r,n;for(n=(t=Array.isArray(t)?t:[t]).length-1;n>=0;n--)for(r in e)t[n].prototype[r]=e[r]}function G(t){return function(...e){const r=e[e.length-1];return!r||r.constructor!==Object||r instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(r)}}s(\"Dom\",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=k(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=k(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=k(t)).before(this),this},insertAfter:function(t){return(t=k(t)).after(this),this}});const X=/^([+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?)([a-z%]*)$/i,U=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i,H=/rgb\\((\\d+),(\\d+),(\\d+)\\)/,Z=/(#[a-z_][a-z0-9\\-_]*)/i,Q=/\\)\\s*,?\\s*/,W=/\\s/g,J=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,K=/^rgb\\(/,tt=/^(\\s+)?$/,et=/^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,rt=/\\.(jpg|jpeg|png|gif|svg)(\\?[^=]+.*)?/i,nt=/[\\s,]+/,it=/[MLHVCSQTAZ]/i;var st={__proto__:null,numberAndUnit:X,hex:U,rgb:H,reference:Z,transforms:Q,whitespace:W,isHex:J,isRgb:K,isBlank:tt,isNumber:et,isImage:rt,delimiter:nt,isPathLetter:it};function ot(t){const e=Math.round(t),r=Math.max(0,Math.min(255,e)).toString(16);return 1===r.length?\"0\"+r:r}function at(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function ht(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}s(\"Dom\",{classes:function(){const t=this.attr(\"class\");return null==t?[]:t.trim().split(nt)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr(\"class\",e.join(\" \"))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr(\"class\",this.classes().filter((function(e){return e!==t})).join(\" \")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),s(\"Dom\",{css:function(t,e){const r={};if(0===arguments.length)return this.node.style.cssText.split(/\\s*;\\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\\s*:\\s*/);r[e[0]]=e[1]})),r;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=l(e);r[t]=this.node.style[t]}return r}if(\"string\"==typeof t)return this.node.style[l(t)];if(\"object\"==typeof t)for(const e in t)this.node.style[l(e)]=null==t[e]||tt.test(t[e])?\"\":t[e]}return 2===arguments.length&&(this.node.style[l(t)]=null==e||tt.test(e)?\"\":e),this},show:function(){return this.css(\"display\",\"\")},hide:function(){return this.css(\"display\",\"none\")},visible:function(){return\"none\"!==this.css(\"display\")}}),s(\"Dom\",{data:function(t,e,r){if(null==t)return this.data(h(u(this.node.attributes,(t=>0===t.nodeName.indexOf(\"data-\"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const r of t)e[r]=this.data(r);return e}if(\"object\"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr(\"data-\"+t))}catch(e){return this.attr(\"data-\"+t)}else this.attr(\"data-\"+t,null===e?null:!0===r||\"string\"==typeof e||\"number\"==typeof e?e:JSON.stringify(e));return this}}),s(\"Dom\",{remember:function(t,e){if(\"object\"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class ut{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof ut||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&\"number\"==typeof t.r&&\"number\"==typeof t.g&&\"number\"==typeof t.b}static random(t=\"vibrant\",e,r){const{random:n,round:i,sin:s,PI:o}=Math;if(\"vibrant\"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new ut(t,e,r,\"lch\")}if(\"sine\"===t){const t=i(80*s(2*o*(e=null==e?n():e)/.5+.01)+150),r=i(50*s(2*o*e/.5+4.6)+200),a=i(100*s(2*o*e/.5+2.3)+150);return new ut(t,r,a)}if(\"pastel\"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new ut(t,e,r,\"lch\")}if(\"dark\"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new ut(t,e,r,\"lch\")}if(\"rgb\"===t){const t=255*n(),e=255*n(),r=255*n();return new ut(t,e,r)}if(\"lab\"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new ut(t,e,r,\"lab\")}if(\"grey\"===t){const t=255*n();return new ut(t,t,t)}throw new Error(\"Unsupported random color mode\")}static test(t){return\"string\"==typeof t&&(J.test(t)||K.test(t))}cmyk(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.min(1-n,1-i,1-s);return 1===o?new ut(0,0,0,1,\"cmyk\"):new ut((1-n-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,\"cmyk\")}hsl(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.max(n,i,s),a=Math.min(n,i,s),h=(o+a)/2,u=o===a,c=o-a;return new ut(360*(u?0:o===n?((i-s)/c+(i.5?c/(2-o-a):c/(o+a)),100*h,\"hsl\")}init(t=0,e=0,r=0,n=0,i=\"rgb\"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if(\"number\"==typeof t)i=\"string\"==typeof n?n:i,n=\"string\"==typeof n?0:n,Object.assign(this,{_a:t,_b:e,_c:r,_d:n,space:i});else if(t instanceof Array)this.space=e||(\"string\"==typeof t[3]?t[3]:t[4])||\"rgb\",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const r=function(t,e){const r=at(t,\"rgb\")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:\"rgb\"}:at(t,\"xyz\")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:\"xyz\"}:at(t,\"hsl\")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:\"hsl\"}:at(t,\"lab\")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:\"lab\"}:at(t,\"lch\")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:\"lch\"}:at(t,\"cmyk\")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:\"cmyk\"}:{_a:0,_b:0,_c:0,space:\"rgb\"};return r.space=e||r.space,r}(t,e);Object.assign(this,r)}else if(\"string\"==typeof t)if(K.test(t)){const e=t.replace(W,\"\"),[r,n,i]=H.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:\"rgb\"})}else{if(!J.test(t))throw Error(\"Unsupported string format, can't construct Color\");{const e=t=>parseInt(t,16),[,r,n,i]=U.exec(function(t){return 4===t.length?[\"#\",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(\"\"):t}(t)).map(e);Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:\"rgb\"})}}const{_a:s,_b:o,_c:a,_d:h}=this,u=\"rgb\"===this.space?{r:s,g:o,b:a}:\"xyz\"===this.space?{x:s,y:o,z:a}:\"hsl\"===this.space?{h:s,s:o,l:a}:\"lab\"===this.space?{l:s,a:o,b:a}:\"lch\"===this.space?{l:s,c:o,h:a}:\"cmyk\"===this.space?{c:s,m:o,y:a,k:h}:{};Object.assign(this,u)}lab(){const{x:t,y:e,z:r}=this.xyz();return new ut(116*e-16,500*(t-e),200*(e-r),\"lab\")}lch(){const{l:t,a:e,b:r}=this.lab(),n=Math.sqrt(e**2+r**2);let i=180*Math.atan2(r,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new ut(t,n,i,\"lch\")}rgb(){if(\"rgb\"===this.space)return this;if(\"lab\"===(t=this.space)||\"xyz\"===t||\"lch\"===t){let{x:t,y:e,z:r}=this;if(\"lab\"===this.space||\"lch\"===this.space){let{l:n,a:i,b:s}=this;if(\"lch\"===this.space){const{c:t,h:e}=this,r=Math.PI/180;i=t*Math.cos(r*e),s=t*Math.sin(r*e)}const o=(n+16)/116,a=i/500+o,h=o-s/200,u=16/116,c=.008856,l=7.787;t=.95047*(a**3>c?a**3:(a-u)/l),e=1*(o**3>c?o**3:(o-u)/l),r=1.08883*(h**3>c?h**3:(h-u)/l)}const n=3.2406*t+-1.5372*e+-.4986*r,i=-.9689*t+1.8758*e+.0415*r,s=.0557*t+-.204*e+1.057*r,o=Math.pow,a=.0031308,h=n>a?1.055*o(n,1/2.4)-.055:12.92*n,u=i>a?1.055*o(i,1/2.4)-.055:12.92*i,c=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new ut(255*h,255*u,255*c)}if(\"hsl\"===this.space){let{h:t,s:e,l:r}=this;if(t/=360,e/=100,r/=100,0===e)return r*=255,new ut(r,r,r);const n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,s=255*ht(i,n,t+1/3),o=255*ht(i,n,t),a=255*ht(i,n,t-1/3);return new ut(s,o,a)}if(\"cmyk\"===this.space){const{c:t,m:e,y:r,k:n}=this,i=255*(1-Math.min(1,t*(1-n)+n)),s=255*(1-Math.min(1,e*(1-n)+n)),o=255*(1-Math.min(1,r*(1-n)+n));return new ut(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:r,_d:n,space:i}=this;return[t,e,r,n,i]}toHex(){const[t,e,r]=this._clamped().map(ot);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,h=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,u=(.4124*o+.3576*a+.1805*h)/.95047,c=(.2126*o+.7152*a+.0722*h)/1,l=(.0193*o+.1192*a+.9505*h)/1.08883,f=u>.008856?Math.pow(u,1/3):7.787*u+16/116,d=c>.008856?Math.pow(c,1/3):7.787*c+16/116,p=l>.008856?Math.pow(l,1/3):7.787*l+16/116;return new ut(f,d,p,\"xyz\")}_clamped(){const{_a:t,_b:e,_c:r}=this.rgb(),{max:n,min:i,round:s}=Math;return[t,e,r].map((t=>n(0,i(s(t),255))))}}class ct{constructor(...t){this.init(...t)}clone(){return new ct(this)}init(t,e){const r=Array.isArray(t)?{x:t[0],y:t[1]}:\"object\"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==r.x?0:r.x,this.y=null==r.y?0:r.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){ft.isMatrixLike(t)||(t=new ft(t));const{x:e,y:r}=this;return this.x=t.a*e+t.c*r+t.e,this.y=t.b*e+t.d*r+t.f,this}}function lt(t,e,r){return Math.abs(e-t)<(r||1e-6)}class ft{constructor(...t){this.init(...t)}static formatTransforms(t){const e=\"both\"===t.flip||!0===t.flip,r=t.flip&&(e||\"x\"===t.flip)?-1:1,n=t.flip&&(e||\"y\"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleX)?t.scaleX*r:r,a=t.scale&&t.scale.length?t.scale[1]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleY)?t.scaleY*n:n,h=t.shear||0,u=t.rotate||t.theta||0,c=new ct(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=c.x,f=c.y,d=new ct(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.y,g=new ct(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,v=g.y,b=new ct(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:h,theta:u,rx:b.x,ry:b.y,tx:y,ty:v,ox:l,oy:f,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,r){const n=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,h=t.f+t.b*e.e+t.d*e.f;return r.a=n,r.b=i,r.c=s,r.d=o,r.e=a,r.f=h,r}around(t,e,r){return this.clone().aroundO(t,e,r)}aroundO(t,e,r){const n=t||0,i=e||0;return this.translateO(-n,-i).lmultiplyO(r).translateO(n,i)}clone(){return new ft(this)}decompose(t=0,e=0){const r=this.a,n=this.b,i=this.c,s=this.d,o=this.e,a=this.f,h=r*s-n*i,u=h>0?1:-1,c=u*Math.sqrt(r*r+n*n),l=Math.atan2(u*n,u*r),f=180/Math.PI*l,d=Math.cos(l),p=Math.sin(l),m=(r*i+n*s)/h,g=i*c/(m*r-n)||s*c/(m*n+r);return{scaleX:c,scaleY:g,shear:m,rotate:f,translateX:o-t+t*d*c+e*(m*d*c-p*g),translateY:a-e+t*p*c+e*(m*p*c+d*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new ft(t);return lt(this.a,e.a)&<(this.b,e.b)&<(this.c,e.c)&<(this.d,e.d)&<(this.e,e.e)&<(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return\"x\"===t?this.scaleO(-1,1,e,0):\"y\"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=ft.fromArray([1,0,0,1,0,0]);return t=t instanceof Ft?t.matrixify():\"string\"==typeof t?ft.fromArray(t.split(nt).map(parseFloat)):Array.isArray(t)?ft.fromArray(t):\"object\"==typeof t&&ft.isMatrixLike(t)?t:\"object\"==typeof t?(new ft).transform(t):6===arguments.length?ft.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,r=this.c,n=this.d,i=this.e,s=this.f,o=t*n-e*r;if(!o)throw new Error(\"Cannot invert \"+this);const a=n/o,h=-e/o,u=-r/o,c=t/o,l=-(a*i+u*s),f=-(h*i+c*s);return this.a=a,this.b=h,this.c=u,this.d=c,this.e=l,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof ft?t:new ft(t);return ft.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof ft?t:new ft(t);return ft.matrixMultiply(this,e,this)}rotate(t,e,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=c(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:h,e:u,f:l}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-h*i,this.d=h*n+a*i,this.e=u*n-l*i+r*i-e*n+e,this.f=l*n+u*i-e*i-r*n+r,this}scale(t,e,r,n){return this.clone().scaleO(...arguments)}scaleO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t);const{a:i,b:s,c:o,d:a,e:h,f:u}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=h*t-r*t+r,this.f=u*e-n*e+n,this}shear(t,e,r){return this.clone().shearO(t,e,r)}shearO(t,e=0,r=0){const{a:n,b:i,c:s,d:o,e:a,f:h}=this;return this.a=n+i*t,this.c=s+o*t,this.e=a+h*t-r*t,this}skew(t,e,r,n){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=c(t),e=c(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:h,d:u,e:l,f}=this;return this.a=o+a*i,this.b=a+o*s,this.c=h+u*i,this.d=u+h*s,this.e=l+f*i-n*i,this.f=f+l*s-r*s,this}skewX(t,e,r){return this.skew(t,0,e,r)}skewY(t,e,r){return this.skew(0,t,e,r)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return\"matrix(\"+this.a+\",\"+this.b+\",\"+this.c+\",\"+this.d+\",\"+this.e+\",\"+this.f+\")\"}transform(t){if(ft.isMatrixLike(t))return new ft(t).multiplyO(this);const e=ft.formatTransforms(t),{x:r,y:n}=new ct(e.ox,e.oy).transform(this),i=(new ft).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-r,-n).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(r,n);if(isFinite(e.px)||isFinite(e.py)){const t=new ct(r,n).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function dt(){if(!dt.nodes){const t=k().size(2,0);t.node.style.cssText=[\"opacity: 0\",\"position: absolute\",\"left: -100%\",\"top: -100%\",\"overflow: hidden\"].join(\";\"),t.attr(\"focusable\",\"false\"),t.attr(\"aria-hidden\",\"true\");const e=t.path().node;dt.nodes={svg:t,path:e}}if(!dt.nodes.svg.node.parentNode){const t=_.document.body||_.document.documentElement;dt.nodes.svg.addTo(t)}return dt.nodes}function pt(t){return!(t.width||t.height||t.x||t.y)}q(ft,\"Matrix\");class mt{constructor(...t){this.init(...t)}addOffset(){return this.x+=_.window.pageXOffset,this.y+=_.window.pageYOffset,new mt(this)}init(t){return t=\"string\"==typeof t?t.split(nt).map(parseFloat):Array.isArray(t)?t:\"object\"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return pt(this)}merge(t){const e=Math.min(this.x,t.x),r=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-r;return new mt(e,r,n,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+\" \"+this.y+\" \"+this.width+\" \"+this.height}transform(t){t instanceof ft||(t=new ft(t));let e=1/0,r=-1/0,n=1/0,i=-1/0;return[new ct(this.x,this.y),new ct(this.x2,this.y),new ct(this.x,this.y2),new ct(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),r=Math.max(r,s.x),n=Math.min(n,s.y),i=Math.max(i,s.y)})),new mt(e,n,r-e,i-n)}}function gt(t,e,r){let n;try{if(n=e(t.node),pt(n)&&(i=t.node)!==_.document&&!(_.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===_.document}).call(_.document.documentElement,i))throw new Error(\"Element not in the dom\")}catch(e){n=r(t)}var i;return n}s({viewbox:{viewbox(t,e,r,n){return null==t?new mt(this.attr(\"viewBox\")):this.attr(\"viewBox\",new mt(t,e,r,n))},zoom(t,e){let{width:r,height:n}=this.attr([\"width\",\"height\"]);if((r||n)&&\"string\"!=typeof r&&\"string\"!=typeof n||(r=this.node.clientWidth,n=this.node.clientHeight),!r||!n)throw new Error(\"Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element\");const i=this.viewbox(),s=r/i.width,o=n/i.height,a=Math.min(s,o);if(null==t)return a;let h=a/t;h===1/0&&(h=Number.MAX_SAFE_INTEGER/100),e=e||new ct(r/2/s+i.x,n/2/o+i.y);const u=new mt(i).transform(new ft({scale:h,origin:e}));return this.viewbox(u)}}}),q(mt,\"Box\");class yt extends Array{constructor(t=[],...e){if(super(t,...e),\"number\"==typeof t)return this;this.length=0,this.push(...t)}}$([yt],{each(t,...e){return\"function\"==typeof t?this.map(((e,r,n)=>t.call(e,e,r,n))):this.map((r=>r[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const vt=[\"toArray\",\"constructor\",\"each\"];function bt(t,e){return new yt(h((e||_.document).querySelectorAll(t),(function(t){return N(t)})))}yt.extend=function(t){t=t.reduce(((t,e)=>(vt.includes(e)||\"_\"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),$([yt],t)};let xt=0;const Mt={};function wt(t){let e=t.getEventHolder();return e===_.window&&(e=Mt),e.events||(e.events={}),e.events}function _t(t){return t.getEventTarget()}function St(t){let e=t.getEventHolder();e===_.window&&(e=Mt),e.events&&(e.events={})}function At(t,e,r,n,i){const s=r.bind(n||t),o=k(t),a=wt(o),h=_t(o);e=Array.isArray(e)?e:e.split(nt),r._svgjsListenerId||(r._svgjsListenerId=++xt),e.forEach((function(t){const e=t.split(\".\")[0],n=t.split(\".\")[1]||\"*\";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][r._svgjsListenerId]=s,h.addEventListener(e,s,i||!1)}))}function Pt(t,e,r,n){const i=k(t),s=wt(i),o=_t(i);(\"function\"!=typeof r||(r=r._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||\"\").split(nt)).forEach((function(t){const e=t&&t.split(\".\")[0],a=t&&t.split(\".\")[1];let h,u;if(r)s[e]&&s[e][a||\"*\"]&&(o.removeEventListener(e,s[e][a||\"*\"][r],n||!1),delete s[e][a||\"*\"][r]);else if(e&&a){if(s[e]&&s[e][a]){for(u in s[e][a])Pt(o,[e,a].join(\".\"),u);delete s[e][a]}}else if(a)for(t in s)for(h in s[t])a===h&&Pt(o,[t,a].join(\".\"));else if(e){if(s[e]){for(h in s[e])Pt(o,[e,h].join(\".\"));delete s[e]}}else{for(t in s)Pt(o,t);St(i)}}))}function Et(t,e,r,n){const i=_t(t);return e instanceof _.window.Event||(e=new _.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}class Ot extends R{addEventListener(){}dispatch(t,e,r){return Et(this,t,e,r)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const r=e[t.type];for(const e in r)for(const n in r[e])r[e][n](t);return!t.defaultPrevented}fire(t,e,r){return this.dispatch(t,e,r),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e){return Pt(this,t,e),this}on(t,e,r,n){return At(this,t,e,r,n),this}removeEventListener(){}}function It(){}q(Ot,\"EventTarget\");const Rt={duration:400,ease:\">\",delay:0},Ct={\"fill-opacity\":1,\"stroke-opacity\":1,\"stroke-width\":0,\"stroke-linejoin\":\"miter\",\"stroke-linecap\":\"butt\",fill:\"#000000\",stroke:\"#000000\",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,\"stop-opacity\":1,\"stop-color\":\"#000000\",\"text-anchor\":\"start\"};var Tt={__proto__:null,noop:It,timeline:Rt,attrs:Ct};class Lt extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return\"number\"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(nt).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(\" \")}valueOf(){const t=[];return t.push(...this),t}}class kt{constructor(...t){this.init(...t)}convert(t){return new kt(this.value,t)}divide(t){return t=new kt(t),new kt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||\"\",\"number\"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:\"string\"==typeof t?(e=t.match(X))&&(this.value=parseFloat(e[1]),\"%\"===e[5]?this.value/=100:\"s\"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof kt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new kt(t),new kt(this-t,this.unit||t.unit)}plus(t){return t=new kt(t),new kt(this+t,this.unit||t.unit)}times(t){return t=new kt(t),new kt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return(\"%\"===this.unit?~~(1e8*this.value)/1e6:\"s\"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const Bt=[];class Nt extends Ot{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=k(t)).removeNamespace&&this.node instanceof _.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return k(t).put(this,e)}children(){return new yt(h(this.node.children,(function(t){return N(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0){return this.writeDataToDom(),new this.constructor(V(this.node.cloneNode(t)))}each(t,e){const r=this.children();let n,i;for(n=0,i=r.length;n=0}html(t,e){return this.xml(t,e,v)}id(t){return void 0!==t||this.node.id||(this.node.id=z(this.type)),this.attr(\"id\",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return N(this.node.lastChild)}matches(t){const e=this.node,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return r&&r.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=N(e.node.parentNode),!t)return e;do{if(\"string\"==typeof t?e.matches(t):e instanceof t)return e}while(e=N(e.node.parentNode));return e}put(t,e){return t=k(t),this.add(t,e),t}putIn(t,e){return k(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=k(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const r=10**t,n=this.attr(e);for(const t in n)\"number\"==typeof n[t]&&(n[t]=Math.round(n[t]*r)/r);return this.attr(n),this}svg(t,e){return this.xml(t,e,y)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const r=e.index(this);return e.put(t,r).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,r){if(\"boolean\"==typeof t&&(r=e,e=t,t=null),null==t||\"function\"==typeof t){e=null==e||e,this.writeDataToDom();let r=this;if(null!=t){if(r=N(r.node.cloneNode(!0)),e){const e=t(r);if(r=e||r,!1===e)return\"\"}r.each((function(){const e=t(this),r=e||this;!1===e?this.remove():e&&this!==r&&this.replace(r)}),!0)}return e?r.node.outerHTML:r.node.innerHTML}e=null!=e&&e;const n=L(\"wrapper\",r),i=_.document.createDocumentFragment();n.innerHTML=t;for(let t=n.children.length;t--;)i.appendChild(n.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}$(Nt,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=et.test(r.nodeValue)?parseFloat(r.nodeValue):r.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if(\"object\"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?Ct[t]:et.test(e)?parseFloat(e):e;\"number\"==typeof(e=Bt.reduce(((e,r)=>r(t,e,this)),e))?e=new kt(e):ut.isColor(e)?e=new ut(e):e.constructor===Array&&(e=new Lt(e)),\"leading\"===t?this.leading&&this.leading(e):\"string\"==typeof r?this.node.setAttributeNS(r,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||\"font-size\"!==t&&\"x\"!==t||this.rebuild()}return this},find:function(t){return bt(t,this.node)},findOne:function(t){return N(this.node.querySelector(t))}}),q(Nt,\"Dom\");class Ft extends Nt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,t.hasAttribute(\"svgjs:data\")&&this.setData(JSON.parse(t.getAttribute(\"svgjs:data\"))||{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new kt(t).plus(this.x()))}dy(t=0){return this.y(new kt(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr(\"height\",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){t=k(t);const e=new yt;let r=this;for(;(r=r.parent())&&r.node!==_.document&&\"#document-fragment\"!==r.nodeName&&(e.push(r),r.node!==t.node););return e}reference(t){if(!(t=this.attr(t)))return null;const e=(t+\"\").match(Z);return e?k(e[1]):null}root(){const t=this.parent(Y(T));return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const r=p(this,t,e);return this.width(new kt(r.width)).height(new kt(r.height))}width(t){return this.attr(\"width\",t)}writeDataToDom(){return this.node.removeAttribute(\"svgjs:data\"),Object.keys(this.dom).length&&this.node.setAttribute(\"svgjs:data\",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr(\"x\",t)}y(t){return this.attr(\"y\",t)}}$(Ft,{bbox:function(){const t=gt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(dt().svg).show(),r=e.node.getBBox();return e.remove(),r}catch(e){throw new Error(`Getting bbox of element \"${t.node.nodeName}\" is not possible: ${e.toString()}`)}}));return new mt(t)},rbox:function(t){const e=gt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element \"${t.node.nodeName}\" is not possible`)})),r=new mt(e);return t?r.transform(t.screenCTM().inverseO()):r.addOffset()},inside:function(t,e){const r=this.bbox();return t>r.x&&e>r.y&&t=0;r--)null!=e[jt[t][r]]&&this.attr(jt.prefix(t,jt[t][r]),e[jt[t][r]]);return this},s([\"Element\",\"Runner\"],e)})),s([\"Element\",\"Runner\"],{matrix:function(t,e,r,n,i,s){return null==t?new ft(this):this.attr(\"transform\",new ft(t,e,r,n,i,s))},rotate:function(t,e,r){return this.transform({rotate:t,ox:e,oy:r},!0)},skew:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:r},!0):this.transform({skew:[t,e],ox:r,oy:n},!0)},shear:function(t,e,r){return this.transform({shear:t,ox:e,oy:r},!0)},scale:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:r},!0):this.transform({scale:[t,e],ox:r,oy:n},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t=\"both\",e=\"center\"){return-1===\"xybothtrue\".indexOf(t)&&(e=t,t=\"both\"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr(\"opacity\",t)}}),s(\"radius\",{radius:function(t,e=t){return\"radialGradient\"===(this._element||this).type?this.attr(\"r\",new kt(t)):this.rx(t).ry(e)}}),s(\"Path\",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new ct(this.node.getPointAtLength(t))}}),s([\"Element\",\"Runner\"],{font:function(t,e){if(\"object\"==typeof t){for(e in t)this.font(e,t[e]);return this}return\"leading\"===t?this.leading(e):\"anchor\"===t?this.attr(\"text-anchor\",e):\"size\"===t||\"family\"===t||\"weight\"===t||\"stretch\"===t||\"variant\"===t||\"style\"===t?this.attr(\"font-\"+t,e):this.attr(t,e)}}),s(\"Element\",[\"click\",\"dblclick\",\"mousedown\",\"mouseup\",\"mouseover\",\"mouseout\",\"mousemove\",\"mouseenter\",\"mouseleave\",\"touchstart\",\"touchmove\",\"touchleave\",\"touchend\",\"touchcancel\"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),s(\"Element\",{untransform:function(){return this.attr(\"transform\",null)},matrixify:function(){return(this.attr(\"transform\")||\"\").split(Q).slice(0,-1).map((function(t){const e=t.trim().split(\"(\");return[e[0],e[1].split(nt).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return\"matrix\"===e[0]?t.lmultiply(ft.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new ft)},toParent:function(t,e){if(this===t)return this;const r=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(n.multiply(r)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||\"string\"==typeof t){const e=new ft(this).decompose();return null==t?e:e[t]}ft.isMatrixLike(t)||(t={...t,origin:m(t,this)});const r=new ft(!0===e?this:e||!1).transform(t);return this.attr(\"transform\",r)}});class qt extends Ft{flatten(t=this,e){return this.each((function(){if(this instanceof qt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(r,n){return n[n.length-r-1].toParent(t,e)})),this.remove()}}q(qt,\"Container\");class Yt extends qt{constructor(t,e=t){super(B(\"defs\",t),e)}flatten(){return this}ungroup(){return this}}q(Yt,\"Defs\");class Dt extends Ft{}function zt(t){return this.attr(\"rx\",t)}function Vt(t){return this.attr(\"ry\",t)}function $t(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Gt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Xt(t){return this.attr(\"cx\",t)}function Ut(t){return this.attr(\"cy\",t)}function Ht(t){return null==t?2*this.rx():this.rx(new kt(t).divide(2))}function Zt(t){return null==t?2*this.ry():this.ry(new kt(t).divide(2))}q(Dt,\"Shape\");var Qt={__proto__:null,rx:zt,ry:Vt,x:$t,y:Gt,cx:Xt,cy:Ut,width:Ht,height:Zt};class Wt extends Dt{constructor(t,e=t){super(B(\"ellipse\",t),e)}size(t,e){const r=p(this,t,e);return this.rx(new kt(r.width).divide(2)).ry(new kt(r.height).divide(2))}}$(Wt,Qt),s(\"Container\",{ellipse:G((function(t=0,e=t){return this.put(new Wt).size(t,e).move(0,0)}))}),q(Wt,\"Ellipse\");class Jt extends Nt{constructor(t=_.document.createDocumentFragment()){super(t)}xml(t,e,r){if(\"boolean\"==typeof t&&(r=e,e=t,t=null),null==t||\"function\"==typeof t){const t=new Nt(L(\"wrapper\",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}}function Kt(t,e){return\"radialGradient\"===(this._element||this).type?this.attr({fx:new kt(t),fy:new kt(e)}):this.attr({x1:new kt(t),y1:new kt(e)})}function te(t,e){return\"radialGradient\"===(this._element||this).type?this.attr({cx:new kt(t),cy:new kt(e)}):this.attr({x2:new kt(t),y2:new kt(e)})}q(Jt,\"Fragment\");var ee,re={__proto__:null,from:Kt,to:te};class ne extends qt{constructor(t,e){super(B(t+\"Gradient\",\"string\"==typeof t?null:t),e)}attr(t,e,r){return\"transform\"===t&&(t=\"gradientTransform\"),super.attr(t,e,r)}bbox(){return new mt}targets(){return bt('svg [fill*=\"'+this.id()+'\"]')}toString(){return this.url()}update(t){return this.clear(),\"function\"==typeof t&&t.call(this,this),this}url(){return'url(\"#'+this.id()+'\")'}}$(ne,re),s({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:G((function(t,e){return this.put(new ne(t)).update(e)}))}}),q(ne,\"Gradient\");class ie extends qt{constructor(t,e=t){super(B(\"pattern\",t),e)}attr(t,e,r){return\"transform\"===t&&(t=\"patternTransform\"),super.attr(t,e,r)}bbox(){return new mt}targets(){return bt('svg [fill*=\"'+this.id()+'\"]')}toString(){return this.url()}update(t){return this.clear(),\"function\"==typeof t&&t.call(this,this),this}url(){return'url(\"#'+this.id()+'\")'}}s({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:G((function(t,e,r){return this.put(new ie).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:\"userSpaceOnUse\"})}))}}),q(ie,\"Pattern\");class se extends Dt{constructor(t,e=t){super(B(\"image\",t),e)}load(t,e){if(!t)return this;const r=new _.window.Image;return At(r,\"load\",(function(t){const n=this.parent(ie);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof ie&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),\"function\"==typeof e&&e.call(this,t)}),this),At(r,\"load error\",(function(){Pt(r)})),this.attr(\"href\",r.src=t,x)}}ee=function(t,e,r){return\"fill\"!==t&&\"stroke\"!==t||rt.test(e)&&(e=r.root().defs().image(e)),e instanceof se&&(e=r.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},Bt.push(ee),s({Container:{image:G((function(t,e){return this.put(new se).size(0,0).load(t,e)}))}}),q(se,\"Image\");class oe extends Lt{bbox(){let t=-1/0,e=-1/0,r=1/0,n=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),r=Math.min(i[0],r),n=Math.min(i[1],n)})),new mt(r,n,t-r,e-n)}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(nt).map(parseFloat)).length%2!=0&&t.pop();for(let r=0,n=t.length;r=0;r--)n.width&&(this[r][0]=(this[r][0]-n.x)*t/n.width+n.x),n.height&&(this[r][1]=(this[r][1]-n.y)*e/n.height+n.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,r=this.length;e\":function(t){return-Math.cos(t*Math.PI)/2+.5},\">\":function(t){return Math.sin(t*Math.PI/2)},\"<\":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,r,n){return function(i){return i<0?t>0?e/t*i:r>0?n/r*i:0:i>1?r<1?(1-n)/(1-r)*i+(n-r)/(1-r):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*n+i**3}},steps:function(t,e=\"end\"){e=e.split(\"-\").reverse()[0];let r=t;return\"none\"===e?--r:\"both\"===e&&++r,(n,i=!1)=>{let s=Math.floor(n*t);const o=n*s%1==0;return\"start\"!==e&&\"both\"!==e||++s,i&&o&&--s,n>=0&&s<0&&(s=0),n<=1&&s>r&&(s=r),s/r}}};class fe{done(){return!1}}class de extends fe{constructor(t=Rt.ease){super(),this.ease=le[t]||t}step(t,e,r){return\"number\"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}}class pe extends fe{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}}function me(){const t=(this._duration||500)/1e3,e=this._overshoot||0,r=Math.PI,n=Math.log(e/100+1e-10),i=-n/Math.sqrt(r*r+n*n),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}class ge extends pe{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,r,n){if(\"string\"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;r>100&&(r=16),r/=1e3;const i=n.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*r+s*r*r/2;return n.velocity=i+s*r,n.done=Math.abs(e-o)+Math.abs(i)<.002,n.done?e:o}}$(ge,{duration:ce(\"_duration\",me),overshoot:ce(\"_overshoot\",me)});class ye extends pe{constructor(t=.1,e=.01,r=0,n=1e3){super(),this.p(t).i(e).d(r).windup(n)}step(t,e,r,n){if(\"string\"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;const i=e-t;let s=(n.integral||0)+i*r;const o=(i-(n.error||0))/r,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),n.error=i,n.integral=s,n.done=Math.abs(i)<.001,n.done?e:t+(this.P*i+this.I*s+this.D*o)}}$(ye,{windup:ce(\"_windup\"),p:ce(\"P\"),i:ce(\"I\"),d:ce(\"D\")});const ve={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},be={M:function(t,e,r){return e.x=r.x=t[0],e.y=r.y=t[1],[\"M\",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],[\"L\",t[0],t[1]]},H:function(t,e){return e.x=t[0],[\"H\",t[0]]},V:function(t,e){return e.y=t[0],[\"V\",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],[\"C\",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],[\"S\",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],[\"Q\",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],[\"T\",t[0],t[1]]},Z:function(t,e,r){return e.x=r.x,e.y=r.y,[\"Z\"]},A:function(t,e){return e.x=t[5],e.y=t[6],[\"A\",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},xe=\"mlhvqtcsaz\".split(\"\");for(let t=0,e=xe.length;t=0;n--)r=this[n][0],\"M\"===r||\"L\"===r||\"T\"===r?(this[n][1]+=t,this[n][2]+=e):\"H\"===r?this[n][1]+=t:\"V\"===r?this[n][1]+=e:\"C\"===r||\"S\"===r||\"Q\"===r?(this[n][1]+=t,this[n][2]+=e,this[n][3]+=t,this[n][4]+=e,\"C\"===r&&(this[n][5]+=t,this[n][6]+=e)):\"A\"===r&&(this[n][6]+=t,this[n][7]+=e);return this}parse(t=\"M0 0\"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let r=0,n=\"\";const i={segment:[],inNumber:!1,number:\"\",lastToken:\"\",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new ct,p:new ct};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!we(i,n))if(\".\"!==n)if(isNaN(parseInt(n)))if(\" \"!==n&&\",\"!==n)if(\"-\"!==n)if(\"E\"!==n.toUpperCase()){if(it.test(n)){if(i.inNumber)_e(i,!1);else{if(!Me(i))throw new Error(\"parser Error\");Se(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!Pe(i)){_e(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else i.inNumber&&_e(i,!1);else{if(\"0\"===i.number||Ae(i)){i.inNumber=!0,i.number=n,_e(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){_e(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&_e(i,!1),i.inSegment&&Me(i)&&Se(i),i.segments}(t)}size(t,e){const r=this.bbox();let n,i;for(r.width=0===r.width?1:r.width,r.height=0===r.height?1:r.height,n=this.length-1;n>=0;n--)i=this[n][0],\"M\"===i||\"L\"===i||\"T\"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):\"H\"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:\"V\"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:\"C\"===i||\"S\"===i||\"Q\"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,\"C\"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):\"A\"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this}toString(){return function(t){let e=\"\";for(let r=0,n=t.length;r{const e=typeof t;return\"number\"===e?kt:\"string\"===e?ut.isColor(t)?ut:nt.test(t)?it.test(t)?Ee:Lt:X.test(t)?kt:Re:ke.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Lt:\"object\"===e?Le:Re};class Ie{constructor(t){this._stepper=t||new de(\"-\"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){const e=this;return this._morphObj.fromArray(this._from.map((function(r,n){return e._stepper.step(r,e._to[n],t,e._context[n],e._context)})))}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(Oe(t));let e=new this._type(t);return this._type===ut&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Le&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toArray(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class Re{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class Ce{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,Ce.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}Ce.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Te=(t,e)=>t[0]e[0]?1:0;class Le{constructor(...t){this.init(...t)}align(t){for(let e=0,r=this.values.length;et.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const r=e.shift(),n=e.shift(),i=e.shift(),s=e.splice(0,i);t[r]=new n(s).valueOf()}return t}}const ke=[Re,Ce,Le];function Be(t=[]){ke.push(...[].concat(t))}function Ne(){$(ke,{to(t){return(new Ie).type(this.constructor).from(this.valueOf()).to(t)},fromArray(t){return this.init(t),this}})}class Fe extends Dt{constructor(t,e=t){super(B(\"path\",t),e)}array(){return this._array||(this._array=new Ee(this.attr(\"d\")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr(\"d\",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr(\"d\",\"string\"==typeof t?t:this._array=new Ee(t))}size(t,e){const r=p(this,t,e);return this.attr(\"d\",this.array().size(r.width,r.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}Fe.prototype.MorphArray=Ee,s({Container:{path:G((function(t){return this.put(new Fe).plot(t||new Ee)}))}}),q(Fe,\"Path\");var je={__proto__:null,array:function(){return this._array||(this._array=new oe(this.attr(\"points\")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr(\"points\",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr(\"points\",\"string\"==typeof t?t:this._array=new oe(t))},size:function(t,e){const r=p(this,t,e);return this.attr(\"points\",this.array().size(r.width,r.height))}};class qe extends Dt{constructor(t,e=t){super(B(\"polygon\",t),e)}}s({Container:{polygon:G((function(t){return this.put(new qe).plot(t||new oe)}))}}),$(qe,ae),$(qe,je),q(qe,\"Polygon\");class Ye extends Dt{constructor(t,e=t){super(B(\"polyline\",t),e)}}s({Container:{polyline:G((function(t){return this.put(new Ye).plot(t||new oe)}))}}),$(Ye,ae),$(Ye,je),q(Ye,\"Polyline\");class De extends Dt{constructor(t,e=t){super(B(\"rect\",t),e)}}$(De,{rx:zt,ry:Vt}),s({Container:{rect:G((function(t,e){return this.put(new De).size(t,e)}))}}),q(De,\"Rect\");class ze{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Ve={nextDraw:null,frames:new ze,timeouts:new ze,immediates:new ze,timer:()=>_.window.performance||_.window.Date,transforms:[],frame(t){const e=Ve.frames.push({run:t});return null===Ve.nextDraw&&(Ve.nextDraw=_.window.requestAnimationFrame(Ve._draw)),e},timeout(t,e){e=e||0;const r=Ve.timer().now()+e,n=Ve.timeouts.push({run:t,time:r});return null===Ve.nextDraw&&(Ve.nextDraw=_.window.requestAnimationFrame(Ve._draw)),n},immediate(t){const e=Ve.immediates.push(t);return null===Ve.nextDraw&&(Ve.nextDraw=_.window.requestAnimationFrame(Ve._draw)),e},cancelFrame(t){null!=t&&Ve.frames.remove(t)},clearTimeout(t){null!=t&&Ve.timeouts.remove(t)},cancelImmediate(t){null!=t&&Ve.immediates.remove(t)},_draw(t){let e=null;const r=Ve.timeouts.last();for(;(e=Ve.timeouts.shift())&&(t>=e.time?e.run():Ve.timeouts.push(e),e!==r););let n=null;const i=Ve.frames.last();for(;n!==i&&(n=Ve.frames.shift());)n.run(t);let s=null;for(;s=Ve.immediates.shift();)s();Ve.nextDraw=Ve.timeouts.first()||Ve.frames.first()?_.window.requestAnimationFrame(Ve._draw):null}},$e=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},Ge=function(){const t=_.window;return(t.performance||t.Date).now()};class Xe extends Ot{constructor(t=Ge){super(),this._timeSource=t,this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const r=Math.abs(e);return this.speed(t?-r:r)}schedule(t,e,r){if(null==t)return this._runners.map($e);let n=0;const i=this.getEndTime();if(e=e||0,null==r||\"last\"===r||\"after\"===r)n=i;else if(\"absolute\"===r||\"start\"===r)n=e,e=0;else if(\"now\"===r)n=this._time;else if(\"relative\"===r){const r=this.getRunnerInfoById(t.id);r&&(n=r.start+e,e=0)}else{if(\"with-last\"!==r)throw new Error('Invalid value for the \"when\" parameter');{const t=this.getLastRunnerInfo();n=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:n+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Ve.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Ve.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let r=e-this._lastSourceTime;t&&(r=0);const n=this._speed*r+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=n,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire(\"time\",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],r=e.runner;this._time-e.start<=0&&r.reset()}let i=!1;for(let t=0,e=this._runners.length;t0?this._continue():(this.pause(),this.fire(\"finished\")),this}}s({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Xe,this._timeline):(this._timeline=t,this)}}});class Ue extends Ot{constructor(t){super(),this.id=Ue.id++,t=\"function\"==typeof(t=null==t?Rt.duration:t)?new pe(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration=\"number\"==typeof t&&t,this._isDeclarative=t instanceof pe,this._stepper=this._isDeclarative?t:new de,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new ft,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,r){let n=1,i=!1,s=0;return e=e||Rt.delay,r=r||\"last\",\"object\"!=typeof(t=t||Rt.duration)||t instanceof fe||(e=t.delay||e,r=t.when||r,i=t.swing||i,n=t.times||n,s=t.wait||s,t=t.duration||Rt.duration),{duration:t,delay:e,swing:i,times:n,wait:s,when:r}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t,e){return this.transforms.lmultiplyO(t),this}after(t){return this.on(\"finished\",t)}animate(t,e,r){const n=Ue.sanitise(t,e,r),i=new Ue(n.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(n).schedule(n.delay,n.when)}clearTransform(){return this.transforms=new ft,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new de(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,r){return\"object\"==typeof t&&(e=t.swing,r=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=r||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),r=(this._time-t*e)/this._duration;return Math.min(t+r,this._times)}const r=t%1,n=e*Math.floor(t)+this._duration*r;return this.time(n)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,r=this._duration,n=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(n+r))/(n+r)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(n+r))/r+i;return Math.max(Math.min(a,1),0)},h=i*(n+r)-n;return a=e<=0?Math.round(t(1e-5)):e=0;this._lastPosition=e;const n=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime=n;this._lastTime=this._time,i&&this.fire(\"start\",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=n,this._reseted=!1;let a=!1;return(r||o)&&(this._initialise(r),this.transforms=new ft,a=this._run(o?t:e),this.fire(\"step\",this)),this.done=this.done||a&&o,s&&this.fire(\"finished\",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,r=this._queue.length;et.lmultiplyO(e),Qe=t=>t.transforms;function We(){const t=this._transformationRunners.runners.map(Qe).reduce(Ze,new ft);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Je{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new He).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const r=this.ids.indexOf(t+1);return this.ids.splice(r,1,t+1),this.runners.splice(r,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;ee.id<=t.id)).map(Qe).reduce(Ze,new ft)},_addRunner(t){this._transformationRunners.add(t),Ve.cancelImmediate(this._frameId),this._frameId=Ve.immediate(We.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Je).add(new He(new ft(this))))}}}),$(Ue,{attr(t,e){return this.styleAttr(\"attr\",t,e)},css(t,e){return this.styleAttr(\"css\",t,e)},styleAttr(t,e,r){if(\"string\"==typeof e)return this.styleAttr(t,{[e]:r});let n=e;if(this._tryRetarget(t,n))return this;let i=new Ie(this._stepper).to(n),s=Object.keys(n);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const r=Object.keys(e),o=(a=s,r.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),r=new Le(i.from()).valueOf();Object.assign(r,e),i.from(r)}const h=new Le(i.to()).valueOf();Object.assign(h,e),i.to(h),s=r,n=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget(\"zoom\",t,e))return this;let r=new Ie(this._stepper).to(new kt(t));return this.queue((function(){r=r.from(this.element().zoom())}),(function(t){return this.element().zoom(r.at(t),e),r.done()}),(function(t,n){e=n,r.to(t)})),this._rememberMorpher(\"zoom\",r),this},transform(t,e,r){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget(\"transform\",t))return this;const n=ft.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new Ie(this._stepper).type(r?Ce:ft);let s,o,a,h,u;return this.queue((function(){o=o||this.element(),s=s||m(t,o),u=new ft(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:l,y:f}=new ct(s).transform(o._currentTransform(this));let d=new ft({...t,origin:[l,f]}),p=this._isDeclarative&&a?a:u;if(r){d=d.decompose(l,f),p=p.decompose(l,f);const t=d.rotate,e=p.rotate,r=[t-360,t,t+360],n=r.map((t=>Math.abs(t-e))),i=Math.min(...n),s=n.indexOf(i);d.rotate=r[s]}e&&(n||(d.rotate=t.rotate||0),this._isDeclarative&&h&&(p.rotate=h)),i.from(p),i.to(d);const m=i.at(c);return h=m.rotate,a=new ft(m),this.addTransform(a),o._addRunner(this),i.done()}),(function(e){(e.origin||\"center\").toString()!==(t.origin||\"center\").toString()&&(s=m(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher(\"transform\",i),this},x(t,e){return this._queueNumber(\"x\",t)},y(t){return this._queueNumber(\"y\",t)},dx(t=0){return this._queueNumberDelta(\"x\",t)},dy(t=0){return this._queueNumberDelta(\"y\",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new kt(e),this._tryRetarget(t,e))return this;const r=new Ie(this._stepper).to(e);let n=null;return this.queue((function(){n=this.element()[t](),r.from(n),r.to(n+e)}),(function(e){return this.element()[t](r.at(e)),r.done()}),(function(t){r.to(n+new kt(t))})),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new Ie(this._stepper).to(e);return this.queue((function(){r.from(this.element()[t]())}),(function(e){return this.element()[t](r.at(e)),r.done()})),this._rememberMorpher(t,r),this},_queueNumber(t,e){return this._queueObject(t,new kt(e))},cx(t){return this._queueNumber(\"cx\",t)},cy(t){return this._queueNumber(\"cy\",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let r;return t&&e||(r=this._element.bbox()),t||(t=r.width/r.height*e),e||(e=r.height/r.width*t),this.width(t).height(e)},width(t){return this._queueNumber(\"width\",t)},height(t){return this._queueNumber(\"height\",t)},plot(t,e,r,n){if(4===arguments.length)return this.plot([t,e,r,n]);if(this._tryRetarget(\"plot\",t))return this;const i=new Ie(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher(\"plot\",i),this},leading(t){return this._queueNumber(\"leading\",t)},viewbox(t,e,r,n){return this._queueObject(\"viewbox\",new mt(t,e,r,n))},update(t){return\"object\"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr(\"stop-opacity\",t.opacity),null!=t.color&&this.attr(\"stop-color\",t.color),null!=t.offset&&this.attr(\"offset\",t.offset),this)}}),$(Ue,{rx:zt,ry:Vt,from:Kt,to:te}),q(Ue,\"Runner\");class Ke extends qt{constructor(t,e=t){super(B(\"svg\",t),e),this.namespace()}defs(){return this.isRoot()?N(this.node.querySelector(\"defs\"))||this.put(new Yt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof _.window.SVGElement)&&\"#document-fragment\"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:y,version:\"1.1\"}).attr(\"xmlns:xlink\",x,b).attr(\"xmlns:svgjs\",M,b):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr(\"xmlns:xlink\",null,b).attr(\"xmlns:svgjs\",null,b)}root(){return this.isRoot()?this:super.root()}}s({Container:{nested:G((function(){return this.put(new Ke)}))}}),q(Ke,\"Svg\",!0);class tr extends qt{constructor(t,e=t){super(B(\"symbol\",t),e)}}s({Container:{symbol:G((function(){return this.put(new tr)}))}}),q(tr,\"Symbol\");var er={__proto__:null,plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(_.document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()},x:function(t,e=this.bbox()){return null==t?e.x:this.attr(\"x\",this.attr(\"x\")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr(\"y\",this.attr(\"y\")+t-e.y)},move:function(t,e,r=this.bbox()){return this.x(t,r).y(e,r)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr(\"x\",this.attr(\"x\")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr(\"y\",this.attr(\"y\")+t-e.cy)},center:function(t,e,r=this.bbox()){return this.cx(t,r).cy(e,r)},ax:function(t){return this.attr(\"x\",t)},ay:function(t){return this.attr(\"y\",t)},amove:function(t,e){return this.ax(t).ay(e)},build:function(t){return this._build=!!t,this}};class rr extends Dt{constructor(t,e=t){super(B(\"text\",t),e),this.dom.leading=new kt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new kt(t),this.rebuild())}rebuild(t){if(\"boolean\"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const r=this.dom.leading;this.each((function(n){const i=_.window.getComputedStyle(this.node).getPropertyValue(\"font-size\"),s=r*new kt(i);this.dom.newLined&&(this.attr(\"x\",t.attr(\"x\")),\"\\n\"===this.text()?e+=s:(this.attr(\"dy\",n?s+e:0),e=0))})),this.fire(\"rebuild\")}return this}setData(t){return this.dom=t,this.dom.leading=new kt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let r=0;t=\"\";for(let n=0,i=e.length;n{let i;try{i=r.bbox()}catch(t){return}const s=new ft(r),o=s.translate(t,e).transform(s.inverse()),a=new ct(i.x,i.y).transform(o);r.move(a.x,a.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)},size:function(t,e,r=this.bbox()){const n=p(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach(((t,e)=>{const n=new ct(r).transform(new ft(t).inverse());t.scale(i,s,n.x,n.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}};class hr extends qt{constructor(t,e=t){super(B(\"g\",t),e)}}$(hr,ar),s({Container:{group:G((function(){return this.put(new hr)}))}}),q(hr,\"G\");class ur extends qt{constructor(t,e=t){super(B(\"a\",t),e)}target(t){return this.attr(\"target\",t)}to(t){return this.attr(\"href\",t,x)}}$(ur,ar),s({Container:{link:G((function(t){return this.put(new ur).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const r=e.index(t);return e.add(this,r),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new ur,this.wrap(e)),\"function\"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&\"a\"===t.node.nodeName.toLowerCase()?t:null}}}),q(ur,\"A\");class cr extends qt{constructor(t,e=t){super(B(\"mask\",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return bt('svg [mask*=\"'+this.id()+'\"]')}}s({Container:{mask:G((function(){return this.defs().put(new cr)}))},Element:{masker(){return this.reference(\"mask\")},maskWith(t){const e=t instanceof cr?t:this.parent().mask().add(t);return this.attr(\"mask\",'url(\"#'+e.id()+'\")')},unmask(){return this.attr(\"mask\",null)}}}),q(cr,\"Mask\");class lr extends Ft{constructor(t,e=t){super(B(\"stop\",t),e)}update(t){return(\"number\"==typeof t||t instanceof kt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr(\"stop-opacity\",t.opacity),null!=t.color&&this.attr(\"stop-color\",t.color),null!=t.offset&&this.attr(\"offset\",new kt(t.offset)),this}}s({Gradient:{stop:function(t,e,r){return this.put(new lr).update(t,e,r)}}}),q(lr,\"Stop\");class fr extends Ft{constructor(t,e=t){super(B(\"style\",t),e)}addText(t=\"\"){return this.node.textContent+=t,this}font(t,e,r={}){return this.rule(\"@font-face\",{fontFamily:t,src:e,...r})}rule(t,e){return this.addText(function(t,e){if(!t)return\"\";if(!e)return t;let r=t+\"{\";for(const t in e)r+=f(t)+\":\"+e[t]+\";\";return r+=\"}\",r}(t,e))}}s(\"Dom\",{style(t,e){return this.put(new fr).rule(t,e)},fontface(t,e,r){return this.put(new fr).font(t,e,r)}}),q(fr,\"Style\");class dr extends rr{constructor(t,e=t){super(B(\"textPath\",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let r=null;return e&&(r=e.plot(t)),null==t?r:this}track(){return this.reference(\"href\")}}s({Container:{textPath:G((function(t,e){return t instanceof rr||(t=this.text(t)),t.path(e)}))},Text:{path:G((function(t,e=!0){const r=new dr;let n;if(t instanceof Fe||(t=this.defs().path(t)),r.attr(\"href\",\"#\"+t,x),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)})),textPath(){return this.findOne(\"textPath\")}},Path:{text:G((function(t){return t instanceof rr||(t=(new rr).addTo(this.parent()).text(t)),t.path(this)})),targets(){return bt(\"svg textPath\").filter((t=>(t.attr(\"href\")||\"\").includes(this.id())))}}}),dr.prototype.MorphArray=Ee,q(dr,\"TextPath\");class pr extends Dt{constructor(t,e=t){super(B(\"use\",t),e)}use(t,e){return this.attr(\"href\",(e||\"\")+\"#\"+t,x)}}s({Container:{use:G((function(t,e){return this.put(new pr).use(t,e)}))}}),q(pr,\"Use\");const mr=k;$([Ke,tr,se,ie,ue],o(\"viewbox\")),$([he,Ye,qe,Fe],o(\"marker\")),$(rr,o(\"Text\")),$(Fe,o(\"Path\")),$(Yt,o(\"Defs\")),$([rr,nr],o(\"Tspan\")),$([De,Wt,ne,Ue],o(\"radius\")),$(Ot,o(\"EventTarget\")),$(Nt,o(\"Dom\")),$(Ft,o(\"Element\")),$(Dt,o(\"Shape\")),$([qt,Jt],o(\"Container\")),$(ne,o(\"Gradient\")),$(Ue,o(\"Runner\")),yt.extend([...new Set(i)]),Be([kt,ut,mt,ft,Lt,oe,Ee]),Ne()},725:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.rgbToHsl=e.hslToRgb=e.rgbToHex=void 0,e.rgbToHex=function(t,e,r){return`#${((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}`},e.hslToRgb=function(t,e,r){let n,i,s;if(t/=360,r/=100,0==(e/=100))n=i=s=r;else{const o=(t,e,r)=>(r+=r<0?1:r>1?-1:0)<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,a=r<.5?r*(1+e):r+e-r*e,h=2*r-a;n=o(h,a,t+1/3),i=o(h,a,t),s=o(h,a,t-1/3)}return[.5+255*n<<0,.5+255*i<<0,.5+255*s<<0]},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;const n=Math.max(t,e,r),i=Math.min(t,e,r),s=(n+i)/2;let o,a;if(n===i)o=a=0;else{const h=n-i;switch(a=s>.5?h/(2-n-i):h/(n+i),n){case t:o=(e-r)/h+(e{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.default={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\",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\",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\",rebeccapurple:\"#663399\",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\",wheat:\"#f5deb3\",white:\"#ffffff\",whitesmoke:\"#f5f5f5\",yellow:\"#ffff00\",yellowgreen:\"#9acd32\"}},688:function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(785),e),i(r(725),e),i(r(951),e)},951:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseColor=e.parseColorAndConvert=void 0;const n=r(202),i=r(725);function s(t){if(\"number\"==typeof t)return t>16777215?{type:\"rgb\",a:t>>24&255,b:t>>16&255,c:t>>8&255,alpha:(255&t)/255}:{type:\"rgb\",a:t>>16&255,b:t>>8&255,c:255&t,alpha:1};t=t.replace(/\\s/g,\"\"),n.default[t]&&(t=n.default[t]);let e=/^#([0-9a-f]{3,8})$/i.exec(t);if(e){const t=e[1];return 3===t.length?{type:\"rgb\",a:parseInt(t[0]+t[0],16),b:parseInt(t[1]+t[1],16),c:parseInt(t[2]+t[2],16),alpha:1}:{type:\"rgb\",a:parseInt(t[0]+t[1],16),b:parseInt(t[2]+t[3],16),c:parseInt(t[4]+t[5],16),alpha:t.length>6?parseInt(t.substring(6),16)/255:1}}if(e=/^((hsl|rgb)a?)\\((\\d+),(\\d+)%?,(\\d+)%?,?(.+)?\\)$/i.exec(t),e){const[,,t,r,n,i,s]=e;return{type:t,a:+r,b:+n,c:+i,alpha:s?+s:1}}}e.parseColorAndConvert=function(t){const e=s(t);if(e){if(\"hsl\"===e.type){const[t,r,n]=i.hslToRgb(e.a,e.b,e.c);return{r:t,g:r,b:n,h:e.a,s:e.b,l:e.c,alpha:e.alpha}}{const[t,r,n]=i.rgbToHsl(e.a,e.b,e.c);return{h:t,s:r,l:n,r:e.a,g:e.b,b:e.c,alpha:e.alpha}}}},e.parseColor=s},785:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},926:t=>{var e;window,e=function(){return(()=>{var t=[function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),e.mod=e.log=e.PI2=e.PHI=e.Vec2=e.distributePointsInBuffer=e.prepareBufferForInterpolation=e.interpolate=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.now=e.toRadians=e.toDegrees=e.relativeClamp=e.clamp=e.lerp=void 0,i(r(1),e),r(10).glMatrix.setMatrixArrayType(Array),i(r(21),e),i(r(22),e),i(r(23),e),i(r(24),e),i(r(33),e),i(r(34),e),i(r(35),e),i(r(32),e),i(r(36),e),i(r(37),e),i(r(38),e),i(r(39),e),i(r(40),e),i(r(41),e),i(r(42),e),i(r(43),e),i(r(44),e),i(r(45),e),i(r(46),e),i(r(47),e),i(r(29),e),i(r(48),e);var s=r(30);Object.defineProperty(e,\"lerp\",{enumerable:!0,get:function(){return s.lerp}}),Object.defineProperty(e,\"clamp\",{enumerable:!0,get:function(){return s.clamp}}),Object.defineProperty(e,\"relativeClamp\",{enumerable:!0,get:function(){return s.relativeClamp}}),Object.defineProperty(e,\"toDegrees\",{enumerable:!0,get:function(){return s.toDegrees}}),Object.defineProperty(e,\"toRadians\",{enumerable:!0,get:function(){return s.toRadians}}),Object.defineProperty(e,\"now\",{enumerable:!0,get:function(){return s.now}}),Object.defineProperty(e,\"noise\",{enumerable:!0,get:function(){return s.noise}}),Object.defineProperty(e,\"random\",{enumerable:!0,get:function(){return s.random}}),Object.defineProperty(e,\"angleFromRepetition\",{enumerable:!0,get:function(){return s.angleFromRepetition}}),Object.defineProperty(e,\"angle2FromRepetition\",{enumerable:!0,get:function(){return s.angle2FromRepetition}}),Object.defineProperty(e,\"distanceFromRepetition\",{enumerable:!0,get:function(){return s.distanceFromRepetition}}),Object.defineProperty(e,\"interpolate\",{enumerable:!0,get:function(){return s.interpolate}}),Object.defineProperty(e,\"prepareBufferForInterpolation\",{enumerable:!0,get:function(){return s.prepareBufferForInterpolation}}),Object.defineProperty(e,\"distributePointsInBuffer\",{enumerable:!0,get:function(){return s.distributePointsInBuffer}});var o=r(26);Object.defineProperty(e,\"Vec2\",{enumerable:!0,get:function(){return o.default}});var a=r(27);Object.defineProperty(e,\"PHI\",{enumerable:!0,get:function(){return a.PHI}}),Object.defineProperty(e,\"PI2\",{enumerable:!0,get:function(){return a.PI2}}),Object.defineProperty(e,\"log\",{enumerable:!0,get:function(){return a.log}}),Object.defineProperty(e,\"mod\",{enumerable:!0,get:function(){return a.mod}})},function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(2),e),i(r(3),e),i(r(4),e),i(r(5),e),i(r(6),e),i(r(7),e),i(r(8),e),i(r(9),e)},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e)=>{\"use strict\";var r;Object.defineProperty(e,\"__esModule\",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]=\"Ring\",r[r.Matrix=2]=\"Matrix\"},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e)=>{\"use strict\";var r;Object.defineProperty(e,\"__esModule\",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]=\"Relative\",r[r.Fixed=2]=\"Fixed\"},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>s,mat3:()=>o,mat4:()=>a,quat:()=>h,quat2:()=>u,vec2:()=>c,vec3:()=>l,vec4:()=>f});var n=r(11),i=r(12),s=r(13),o=r(14),a=r(15),h=r(16),u=r(19),c=r(20),l=r(18),f=r(17)},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{EPSILON:()=>n,ARRAY_TYPE:()=>i,RANDOM:()=>s,setMatrixArrayType:()=>o,toRadian:()=>h,equals:()=>u});var n=1e-6,i=\"undefined\"!=typeof Float32Array?Float32Array:Array,s=Math.random;function o(t){i=t}var a=Math.PI/180;function h(t){return t*a}function u(t,e){return Math.abs(t-e)<=n*Math.max(1,Math.abs(t),Math.abs(e))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,identity:()=>a,fromValues:()=>h,set:()=>u,transpose:()=>c,invert:()=>l,adjoint:()=>f,determinant:()=>d,multiply:()=>p,rotate:()=>m,scale:()=>g,fromRotation:()=>y,fromScaling:()=>v,str:()=>b,frob:()=>x,LDU:()=>M,add:()=>w,subtract:()=>_,exactEquals:()=>S,equals:()=>A,multiplyScalar:()=>P,multiplyScalarAndAdd:()=>E,mul:()=>O,sub:()=>I});var n=r(11);function i(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function s(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function a(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function h(t,e,r,i){var s=new n.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=r,s[3]=i,s}function u(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function c(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function l(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*s-i*n;return o?(o=1/o,t[0]=s*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}function f(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function d(t){return t[0]*t[3]-t[2]*t[1]}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*a+s*h,t[1]=i*a+o*h,t[2]=n*u+s*c,t[3]=i*u+o*c,t}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+s*a,t[1]=i*h+o*a,t[2]=n*-a+s*h,t[3]=i*-a+o*h,t}function g(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1];return t[0]=n*a,t[1]=i*a,t[2]=s*h,t[3]=o*h,t}function y(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function v(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function b(t){return\"mat2(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}function x(t){return Math.hypot(t[0],t[1],t[2],t[3])}function M(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function w(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function _(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function S(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function A(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=e[0],h=e[1],u=e[2],c=e[3];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-h)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-u)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}function P(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function E(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}var O=p,I=_},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,identity:()=>a,fromValues:()=>h,set:()=>u,invert:()=>c,determinant:()=>l,multiply:()=>f,rotate:()=>d,scale:()=>p,translate:()=>m,fromRotation:()=>g,fromScaling:()=>y,fromTranslation:()=>v,str:()=>b,frob:()=>x,add:()=>M,subtract:()=>w,multiplyScalar:()=>_,multiplyScalarAndAdd:()=>S,exactEquals:()=>A,equals:()=>P,mul:()=>E,sub:()=>O});var n=r(11);function i(){var t=new n.ARRAY_TYPE(6);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function s(t){var e=new n.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function a(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function h(t,e,r,i,s,o){var a=new n.ARRAY_TYPE(6);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a[4]=s,a[5]=o,a}function u(t,e,r,n,i,s,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t}function c(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=r*s-n*i;return h?(h=1/h,t[0]=s*h,t[1]=-n*h,t[2]=-i*h,t[3]=r*h,t[4]=(i*a-s*o)*h,t[5]=(n*o-r*a)*h,t):null}function l(t){return t[0]*t[3]-t[1]*t[2]}function f(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1],l=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*u+s*c,t[1]=i*u+o*c,t[2]=n*l+s*f,t[3]=i*l+o*f,t[4]=n*d+s*p+a,t[5]=i*d+o*p+h,t}function d(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*u,t[1]=i*c+o*u,t[2]=n*-u+s*c,t[3]=i*-u+o*c,t[4]=a,t[5]=h,t}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1];return t[0]=n*u,t[1]=i*u,t[2]=s*c,t[3]=o*c,t[4]=a,t[5]=h,t}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=n*u+s*c+a,t[5]=i*u+o*c+h,t}function g(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function y(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function v(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function b(t){return\"mat2d(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\")\"}function x(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function M(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function w(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function _(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function S(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function A(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function P(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=e[0],c=e[1],l=e[2],f=e[3],d=e[4],p=e[5];return Math.abs(r-u)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-c)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(s-l)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(o-f)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-d)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(h-p)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(p))}var E=f,O=w},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,fromMat4:()=>s,clone:()=>o,copy:()=>a,fromValues:()=>h,set:()=>u,identity:()=>c,transpose:()=>l,invert:()=>f,adjoint:()=>d,determinant:()=>p,multiply:()=>m,translate:()=>g,rotate:()=>y,scale:()=>v,fromTranslation:()=>b,fromRotation:()=>x,fromScaling:()=>M,fromMat2d:()=>w,fromQuat:()=>_,normalFromMat4:()=>S,projection:()=>A,str:()=>P,frob:()=>E,add:()=>O,subtract:()=>I,multiplyScalar:()=>R,multiplyScalarAndAdd:()=>C,exactEquals:()=>T,equals:()=>L,mul:()=>k,sub:()=>B});var n=r(11);function i(){var t=new n.ARRAY_TYPE(9);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function o(t){var e=new n.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function h(t,e,r,i,s,o,a,h,u){var c=new n.ARRAY_TYPE(9);return c[0]=t,c[1]=e,c[2]=r,c[3]=i,c[4]=s,c[5]=o,c[6]=a,c[7]=h,c[8]=u,c}function u(t,e,r,n,i,s,o,a,h,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t}function c(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function l(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function f(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=c*o-a*u,f=-c*s+a*h,d=u*s-o*h,p=r*l+n*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-c*n+i*u)*p,t[2]=(a*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*h)*p,t[5]=(-a*r+i*s)*p,t[6]=d*p,t[7]=(-u*r+n*h)*p,t[8]=(o*r-n*s)*p,t):null}function d(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8];return t[0]=o*c-a*u,t[1]=i*u-n*c,t[2]=n*a-i*o,t[3]=a*h-s*c,t[4]=r*c-i*h,t[5]=i*s-r*a,t[6]=s*u-o*h,t[7]=n*h-r*u,t[8]=r*o-n*s,t}function p(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],h=t[7],u=t[8];return e*(u*s-o*h)+r*(-u*i+o*a)+n*(h*i-s*a)}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=r[0],d=r[1],p=r[2],m=r[3],g=r[4],y=r[5],v=r[6],b=r[7],x=r[8];return t[0]=f*n+d*o+p*u,t[1]=f*i+d*a+p*c,t[2]=f*s+d*h+p*l,t[3]=m*n+g*o+y*u,t[4]=m*i+g*a+y*c,t[5]=m*s+g*h+y*l,t[6]=v*n+b*o+x*u,t[7]=v*i+b*a+x*c,t[8]=v*s+b*h+x*l,t}function g(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=h,t[6]=f*n+d*o+u,t[7]=f*i+d*a+c,t[8]=f*s+d*h+l,t}function y(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*a,t[2]=d*s+f*h,t[3]=d*o-f*n,t[4]=d*a-f*i,t[5]=d*h-f*s,t[6]=u,t[7]=c,t[8]=l,t}function v(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function b(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function x(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function M(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function w(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function _(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,h=i+i,u=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*h,m=s*o,g=s*a,y=s*h;return t[0]=1-l-p,t[3]=c-y,t[6]=f+g,t[1]=c+y,t[4]=1-u-p,t[7]=d-m,t[2]=f-g,t[5]=d+m,t[8]=1-u-l,t}function S(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],y=e[15],v=r*a-n*o,b=r*h-i*o,x=r*u-s*o,M=n*h-i*a,w=n*u-s*a,_=i*u-s*h,S=c*m-l*p,A=c*g-f*p,P=c*y-d*p,E=l*g-f*m,O=l*y-d*m,I=f*y-d*g,R=v*I-b*O+x*E+M*P-w*A+_*S;return R?(R=1/R,t[0]=(a*I-h*O+u*E)*R,t[1]=(h*P-o*I-u*A)*R,t[2]=(o*O-a*P+u*S)*R,t[3]=(i*O-n*I-s*E)*R,t[4]=(r*I-i*P+s*A)*R,t[5]=(n*P-r*O-s*S)*R,t[6]=(m*_-g*w+y*M)*R,t[7]=(g*x-p*_-y*b)*R,t[8]=(p*w-m*x+y*v)*R,t):null}function A(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function P(t){return\"mat3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\")\"}function E(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function O(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function I(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function R(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function C(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function T(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function L(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=t[6],c=t[7],l=t[8],f=e[0],d=e[1],p=e[2],m=e[3],g=e[4],y=e[5],v=e[6],b=e[7],x=e[8];return Math.abs(r-f)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(i-d)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(s-p)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(o-m)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(a-g)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(h-y)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(y))&&Math.abs(u-v)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(c-b)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(l-x)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(x))}var k=m,B=I},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,fromValues:()=>a,set:()=>h,identity:()=>u,transpose:()=>c,invert:()=>l,adjoint:()=>f,determinant:()=>d,multiply:()=>p,translate:()=>m,scale:()=>g,rotate:()=>y,rotateX:()=>v,rotateY:()=>b,rotateZ:()=>x,fromTranslation:()=>M,fromScaling:()=>w,fromRotation:()=>_,fromXRotation:()=>S,fromYRotation:()=>A,fromZRotation:()=>P,fromRotationTranslation:()=>E,fromQuat2:()=>O,getTranslation:()=>I,getScaling:()=>R,getRotation:()=>C,fromRotationTranslationScale:()=>T,fromRotationTranslationScaleOrigin:()=>L,fromQuat:()=>k,frustum:()=>B,perspective:()=>N,perspectiveFromFieldOfView:()=>F,ortho:()=>j,lookAt:()=>q,targetTo:()=>Y,str:()=>D,frob:()=>z,add:()=>V,subtract:()=>$,multiplyScalar:()=>G,multiplyScalarAndAdd:()=>X,exactEquals:()=>U,equals:()=>H,mul:()=>Z,sub:()=>Q});var n=r(11);function i(){var t=new n.ARRAY_TYPE(16);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function s(t){var e=new n.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function a(t,e,r,i,s,o,a,h,u,c,l,f,d,p,m,g){var y=new n.ARRAY_TYPE(16);return y[0]=t,y[1]=e,y[2]=r,y[3]=i,y[4]=s,y[5]=o,y[6]=a,y[7]=h,y[8]=u,y[9]=c,y[10]=l,y[11]=f,y[12]=d,y[13]=p,y[14]=m,y[15]=g,y}function h(t,e,r,n,i,s,o,a,h,u,c,l,f,d,p,m,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t[9]=c,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=g,t}function u(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function c(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=i,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function l(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],y=e[15],v=r*a-n*o,b=r*h-i*o,x=r*u-s*o,M=n*h-i*a,w=n*u-s*a,_=i*u-s*h,S=c*m-l*p,A=c*g-f*p,P=c*y-d*p,E=l*g-f*m,O=l*y-d*m,I=f*y-d*g,R=v*I-b*O+x*E+M*P-w*A+_*S;return R?(R=1/R,t[0]=(a*I-h*O+u*E)*R,t[1]=(i*O-n*I-s*E)*R,t[2]=(m*_-g*w+y*M)*R,t[3]=(f*w-l*_-d*M)*R,t[4]=(h*P-o*I-u*A)*R,t[5]=(r*I-i*P+s*A)*R,t[6]=(g*x-p*_-y*b)*R,t[7]=(c*_-f*x+d*b)*R,t[8]=(o*O-a*P+u*S)*R,t[9]=(n*P-r*O-s*S)*R,t[10]=(p*w-m*x+y*v)*R,t[11]=(l*x-c*w-d*v)*R,t[12]=(a*A-o*E-h*S)*R,t[13]=(r*E-n*A+i*S)*R,t[14]=(m*b-p*M-g*v)*R,t[15]=(c*M-l*b+f*v)*R,t):null}function f(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],y=e[15];return t[0]=a*(f*y-d*g)-l*(h*y-u*g)+m*(h*d-u*f),t[1]=-(n*(f*y-d*g)-l*(i*y-s*g)+m*(i*d-s*f)),t[2]=n*(h*y-u*g)-a*(i*y-s*g)+m*(i*u-s*h),t[3]=-(n*(h*d-u*f)-a*(i*d-s*f)+l*(i*u-s*h)),t[4]=-(o*(f*y-d*g)-c*(h*y-u*g)+p*(h*d-u*f)),t[5]=r*(f*y-d*g)-c*(i*y-s*g)+p*(i*d-s*f),t[6]=-(r*(h*y-u*g)-o*(i*y-s*g)+p*(i*u-s*h)),t[7]=r*(h*d-u*f)-o*(i*d-s*f)+c*(i*u-s*h),t[8]=o*(l*y-d*m)-c*(a*y-u*m)+p*(a*d-u*l),t[9]=-(r*(l*y-d*m)-c*(n*y-s*m)+p*(n*d-s*l)),t[10]=r*(a*y-u*m)-o*(n*y-s*m)+p*(n*u-s*a),t[11]=-(r*(a*d-u*l)-o*(n*d-s*l)+c*(n*u-s*a)),t[12]=-(o*(l*g-f*m)-c*(a*g-h*m)+p*(a*f-h*l)),t[13]=r*(l*g-f*m)-c*(n*g-i*m)+p*(n*f-i*l),t[14]=-(r*(a*g-h*m)-o*(n*g-i*m)+p*(n*h-i*a)),t[15]=r*(a*f-h*l)-o*(n*f-i*l)+c*(n*h-i*a),t}function d(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],h=t[7],u=t[8],c=t[9],l=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*s)*(l*g-f*m)-(e*a-n*s)*(c*g-f*p)+(e*h-i*s)*(c*m-l*p)+(r*a-n*o)*(u*g-f*d)-(r*h-i*o)*(u*m-l*d)+(n*h-i*a)*(u*p-c*d)}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],y=e[14],v=e[15],b=r[0],x=r[1],M=r[2],w=r[3];return t[0]=b*n+x*a+M*l+w*m,t[1]=b*i+x*h+M*f+w*g,t[2]=b*s+x*u+M*d+w*y,t[3]=b*o+x*c+M*p+w*v,b=r[4],x=r[5],M=r[6],w=r[7],t[4]=b*n+x*a+M*l+w*m,t[5]=b*i+x*h+M*f+w*g,t[6]=b*s+x*u+M*d+w*y,t[7]=b*o+x*c+M*p+w*v,b=r[8],x=r[9],M=r[10],w=r[11],t[8]=b*n+x*a+M*l+w*m,t[9]=b*i+x*h+M*f+w*g,t[10]=b*s+x*u+M*d+w*y,t[11]=b*o+x*c+M*p+w*v,b=r[12],x=r[13],M=r[14],w=r[15],t[12]=b*n+x*a+M*l+w*m,t[13]=b*i+x*h+M*f+w*g,t[14]=b*s+x*u+M*d+w*y,t[15]=b*o+x*c+M*p+w*v,t}function m(t,e,r){var n,i,s,o,a,h,u,c,l,f,d,p,m=r[0],g=r[1],y=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=h,t[6]=u,t[7]=c,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+a*g+l*y+e[12],t[13]=i*m+h*g+f*y+e[13],t[14]=s*m+u*g+d*y+e[14],t[15]=o*m+c*g+p*y+e[15]),t}function g(t,e,r){var n=r[0],i=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function y(t,e,r,i){var s,o,a,h,u,c,l,f,d,p,m,g,y,v,b,x,M,w,_,S,A,P,E,O,I=i[0],R=i[1],C=i[2],T=Math.hypot(I,R,C);return T0?(r[0]=2*(h*a+l*i+u*o-c*s)/f,r[1]=2*(u*a+l*s+c*i-h*o)/f,r[2]=2*(c*a+l*o+h*s-u*i)/f):(r[0]=2*(h*a+l*i+u*o-c*s),r[1]=2*(u*a+l*s+c*i-h*o),r[2]=2*(c*a+l*o+h*s-u*i)),E(t,e,r),t}function I(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function R(t,e){var r=e[0],n=e[1],i=e[2],s=e[4],o=e[5],a=e[6],h=e[8],u=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(s,o,a),t[2]=Math.hypot(h,u,c),t}function C(t,e){var r=new n.ARRAY_TYPE(3);R(r,e);var i=1/r[0],s=1/r[1],o=1/r[2],a=e[0]*i,h=e[1]*s,u=e[2]*o,c=e[4]*i,l=e[5]*s,f=e[6]*o,d=e[8]*i,p=e[9]*s,m=e[10]*o,g=a+l+m,y=0;return g>0?(y=2*Math.sqrt(g+1),t[3]=.25*y,t[0]=(f-p)/y,t[1]=(d-u)/y,t[2]=(h-c)/y):a>l&&a>m?(y=2*Math.sqrt(1+a-l-m),t[3]=(f-p)/y,t[0]=.25*y,t[1]=(h+c)/y,t[2]=(d+u)/y):l>m?(y=2*Math.sqrt(1+l-a-m),t[3]=(d-u)/y,t[0]=(h+c)/y,t[1]=.25*y,t[2]=(f+p)/y):(y=2*Math.sqrt(1+m-a-l),t[3]=(h-c)/y,t[0]=(d+u)/y,t[1]=(f+p)/y,t[2]=.25*y),t}function T(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3],h=i+i,u=s+s,c=o+o,l=i*h,f=i*u,d=i*c,p=s*u,m=s*c,g=o*c,y=a*h,v=a*u,b=a*c,x=n[0],M=n[1],w=n[2];return t[0]=(1-(p+g))*x,t[1]=(f+b)*x,t[2]=(d-v)*x,t[3]=0,t[4]=(f-b)*M,t[5]=(1-(l+g))*M,t[6]=(m+y)*M,t[7]=0,t[8]=(d+v)*w,t[9]=(m-y)*w,t[10]=(1-(l+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function L(t,e,r,n,i){var s=e[0],o=e[1],a=e[2],h=e[3],u=s+s,c=o+o,l=a+a,f=s*u,d=s*c,p=s*l,m=o*c,g=o*l,y=a*l,v=h*u,b=h*c,x=h*l,M=n[0],w=n[1],_=n[2],S=i[0],A=i[1],P=i[2],E=(1-(m+y))*M,O=(d+x)*M,I=(p-b)*M,R=(d-x)*w,C=(1-(f+y))*w,T=(g+v)*w,L=(p+b)*_,k=(g-v)*_,B=(1-(f+m))*_;return t[0]=E,t[1]=O,t[2]=I,t[3]=0,t[4]=R,t[5]=C,t[6]=T,t[7]=0,t[8]=L,t[9]=k,t[10]=B,t[11]=0,t[12]=r[0]+S-(E*S+R*A+L*P),t[13]=r[1]+A-(O*S+C*A+k*P),t[14]=r[2]+P-(I*S+T*A+B*P),t[15]=1,t}function k(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,h=i+i,u=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*h,m=s*o,g=s*a,y=s*h;return t[0]=1-l-p,t[1]=c+y,t[2]=f-g,t[3]=0,t[4]=c-y,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-u-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function B(t,e,r,n,i,s,o){var a=1/(r-e),h=1/(i-n),u=1/(s-o);return t[0]=2*s*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*h,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*h,t[10]=(o+s)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*u,t[15]=0,t}function N(t,e,r,n,i){var s,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(s=1/(n-i),t[10]=(i+n)*s,t[14]=2*i*n*s):(t[10]=-1,t[14]=-2*n),t}function F(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),h=2/(o+a),u=2/(i+s);return t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-a)*h*.5,t[9]=(i-s)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function j(t,e,r,n,i,s,o){var a=1/(e-r),h=1/(n-i),u=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*h,t[14]=(o+s)*u,t[15]=1,t}function q(t,e,r,i){var s,o,a,h,c,l,f,d,p,m,g=e[0],y=e[1],v=e[2],b=i[0],x=i[1],M=i[2],w=r[0],_=r[1],S=r[2];return Math.abs(g-w)0&&(c*=d=1/Math.sqrt(d),l*=d,f*=d);var p=h*f-u*l,m=u*c-a*f,g=a*l-h*c;return(d=p*p+m*m+g*g)>0&&(p*=d=1/Math.sqrt(d),m*=d,g*=d),t[0]=p,t[1]=m,t[2]=g,t[3]=0,t[4]=l*g-f*m,t[5]=f*p-c*g,t[6]=c*m-l*p,t[7]=0,t[8]=c,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=s,t[14]=o,t[15]=1,t}function D(t){return\"mat4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\", \"+t[9]+\", \"+t[10]+\", \"+t[11]+\", \"+t[12]+\", \"+t[13]+\", \"+t[14]+\", \"+t[15]+\")\"}function z(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function V(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function $(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function G(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function X(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function U(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function H(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=t[6],c=t[7],l=t[8],f=t[9],d=t[10],p=t[11],m=t[12],g=t[13],y=t[14],v=t[15],b=e[0],x=e[1],M=e[2],w=e[3],_=e[4],S=e[5],A=e[6],P=e[7],E=e[8],O=e[9],I=e[10],R=e[11],C=e[12],T=e[13],L=e[14],k=e[15];return Math.abs(r-b)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(s-M)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(o-w)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-_)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(h-S)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(u-A)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(c-P)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(P))&&Math.abs(l-E)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(f-O)<=n.EPSILON*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(d-I)<=n.EPSILON*Math.max(1,Math.abs(d),Math.abs(I))&&Math.abs(p-R)<=n.EPSILON*Math.max(1,Math.abs(p),Math.abs(R))&&Math.abs(m-C)<=n.EPSILON*Math.max(1,Math.abs(m),Math.abs(C))&&Math.abs(g-T)<=n.EPSILON*Math.max(1,Math.abs(g),Math.abs(T))&&Math.abs(y-L)<=n.EPSILON*Math.max(1,Math.abs(y),Math.abs(L))&&Math.abs(v-k)<=n.EPSILON*Math.max(1,Math.abs(v),Math.abs(k))}var Z=p,Q=$},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>a,identity:()=>h,setAxisAngle:()=>u,getAxisAngle:()=>c,getAngle:()=>l,multiply:()=>f,rotateX:()=>d,rotateY:()=>p,rotateZ:()=>m,calculateW:()=>g,exp:()=>y,ln:()=>v,pow:()=>b,slerp:()=>x,random:()=>M,invert:()=>w,conjugate:()=>_,fromMat3:()=>S,fromEuler:()=>A,str:()=>P,clone:()=>L,fromValues:()=>k,copy:()=>B,set:()=>N,add:()=>F,mul:()=>j,scale:()=>q,dot:()=>Y,lerp:()=>D,length:()=>z,len:()=>V,squaredLength:()=>$,sqrLen:()=>G,normalize:()=>X,exactEquals:()=>U,equals:()=>H,rotationTo:()=>Z,sqlerp:()=>Q,setAxes:()=>W});var n=r(11),i=r(14),s=r(18),o=r(17);function a(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function h(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function u(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function c(t,e){var r=2*Math.acos(e[3]),i=Math.sin(r/2);return i>n.EPSILON?(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i):(t[0]=1,t[1]=0,t[2]=0),r}function l(t,e){var r=Y(t,e);return Math.acos(2*r*r-1)}function f(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*c+o*a+i*u-s*h,t[1]=i*c+o*h+s*a-n*u,t[2]=s*c+o*u+n*h-i*a,t[3]=o*c-n*a-i*h-s*u,t}function d(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+o*a,t[1]=i*h+s*a,t[2]=s*h-i*a,t[3]=o*h-n*a,t}function p(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h-s*a,t[1]=i*h+o*a,t[2]=s*h+n*a,t[3]=o*h-i*a,t}function m(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+i*a,t[1]=i*h-n*a,t[2]=s*h+o*a,t[3]=o*h-s*a,t}function g(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function y(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=Math.exp(s),h=o>0?a*Math.sin(o)/o:0;return t[0]=r*h,t[1]=n*h,t[2]=i*h,t[3]=a*Math.cos(o),t}function v(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=o>0?Math.atan2(o,s)/o:0;return t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=.5*Math.log(r*r+n*n+i*i+s*s),t}function b(t,e,r){return v(t,e),q(t,t,r),y(t,t),t}function x(t,e,r,i){var s,o,a,h,u,c=e[0],l=e[1],f=e[2],d=e[3],p=r[0],m=r[1],g=r[2],y=r[3];return(o=c*p+l*m+f*g+d*y)<0&&(o=-o,p=-p,m=-m,g=-g,y=-y),1-o>n.EPSILON?(s=Math.acos(o),a=Math.sin(s),h=Math.sin((1-i)*s)/a,u=Math.sin(i*s)/a):(h=1-i,u=i),t[0]=h*c+u*p,t[1]=h*l+u*m,t[2]=h*f+u*g,t[3]=h*d+u*y,t}function M(t){var e=n.RANDOM(),r=n.RANDOM(),i=n.RANDOM(),s=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=s*Math.sin(2*Math.PI*r),t[1]=s*Math.cos(2*Math.PI*r),t[2]=o*Math.sin(2*Math.PI*i),t[3]=o*Math.cos(2*Math.PI*i),t}function w(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s,a=o?1/o:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=s*a,t}function _(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function S(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var s=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*s+s]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*s+o]-e[3*o+s])*r,t[s]=(e[3*s+i]+e[3*i+s])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t}function A(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var s=Math.sin(e),o=Math.cos(e),a=Math.sin(r),h=Math.cos(r),u=Math.sin(n),c=Math.cos(n);return t[0]=s*h*c-o*a*u,t[1]=o*a*c+s*h*u,t[2]=o*h*u-s*a*c,t[3]=o*h*c+s*a*u,t}function P(t){return\"quat(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}var E,O,I,R,C,T,L=o.clone,k=o.fromValues,B=o.copy,N=o.set,F=o.add,j=f,q=o.scale,Y=o.dot,D=o.lerp,z=o.length,V=z,$=o.squaredLength,G=$,X=o.normalize,U=o.exactEquals,H=o.equals,Z=(E=s.create(),O=s.fromValues(1,0,0),I=s.fromValues(0,1,0),function(t,e,r){var n=s.dot(e,r);return n<-.999999?(s.cross(E,O,e),s.len(E)<1e-6&&s.cross(E,I,e),s.normalize(E,E),u(t,E,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(s.cross(E,e,r),t[0]=E[0],t[1]=E[1],t[2]=E[2],t[3]=1+n,X(t,t))}),Q=(R=a(),C=a(),function(t,e,r,n,i,s){return x(R,e,i,s),x(C,r,n,s),x(t,R,C,2*s*(1-s)),t}),W=(T=i.create(),function(t,e,r,n){return T[0]=r[0],T[3]=r[1],T[6]=r[2],T[1]=n[0],T[4]=n[1],T[7]=n[2],T[2]=-e[0],T[5]=-e[1],T[8]=-e[2],X(t,S(t,T))})},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,fromValues:()=>o,copy:()=>a,set:()=>h,add:()=>u,subtract:()=>c,multiply:()=>l,divide:()=>f,ceil:()=>d,floor:()=>p,min:()=>m,max:()=>g,round:()=>y,scale:()=>v,scaleAndAdd:()=>b,distance:()=>x,squaredDistance:()=>M,length:()=>w,squaredLength:()=>_,negate:()=>S,inverse:()=>A,normalize:()=>P,dot:()=>E,cross:()=>O,lerp:()=>I,random:()=>R,transformMat4:()=>C,transformQuat:()=>T,zero:()=>L,str:()=>k,exactEquals:()=>B,equals:()=>N,sub:()=>j,mul:()=>q,div:()=>Y,dist:()=>D,sqrDist:()=>z,len:()=>V,sqrLen:()=>$,forEach:()=>G});var n=r(11);function i(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function s(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(t,e,r,i){var s=new n.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=r,s[3]=i,s}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function h(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function u(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function l(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}function f(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function m(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}function g(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}function y(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function v(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function b(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}function x(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return Math.hypot(r,n,i,s)}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return r*r+n*n+i*i+s*s}function w(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}function _(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function A(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function P(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s;return o>0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=s*o,t}function E(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function O(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],s=r[0]*n[2]-r[2]*n[0],o=r[0]*n[3]-r[3]*n[0],a=r[1]*n[2]-r[2]*n[1],h=r[1]*n[3]-r[3]*n[1],u=r[2]*n[3]-r[3]*n[2],c=e[0],l=e[1],f=e[2],d=e[3];return t[0]=l*u-f*h+d*a,t[1]=-c*u+f*o-d*s,t[2]=c*h-l*o+d*i,t[3]=-c*a+l*s-f*i,t}function I(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t[3]=a+n*(r[3]-a),t}function R(t,e){var r,i,s,o,a,h;e=e||1;do{a=(r=2*n.RANDOM()-1)*r+(i=2*n.RANDOM()-1)*i}while(a>=1);do{h=(s=2*n.RANDOM()-1)*s+(o=2*n.RANDOM()-1)*o}while(h>=1);var u=Math.sqrt((1-a)/h);return t[0]=e*r,t[1]=e*i,t[2]=e*s*u,t[3]=e*o*u,t}function C(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*s+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*s+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*s+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*s+r[15]*o,t}function T(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],h=r[2],u=r[3],c=u*n+a*s-h*i,l=u*i+h*n-o*s,f=u*s+o*i-a*n,d=-o*n-a*i-h*s;return t[0]=c*u+d*-o+l*-h-f*-a,t[1]=l*u+d*-a+f*-o-c*-h,t[2]=f*u+d*-h+c*-a-l*-o,t[3]=e[3],t}function L(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function k(t){return\"vec4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}function B(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function N(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=e[0],h=e[1],u=e[2],c=e[3];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-h)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-u)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}var F,j=c,q=l,Y=f,D=x,z=M,V=w,$=_,G=(F=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=4),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,length:()=>o,fromValues:()=>a,copy:()=>h,set:()=>u,add:()=>c,subtract:()=>l,multiply:()=>f,divide:()=>d,ceil:()=>p,floor:()=>m,min:()=>g,max:()=>y,round:()=>v,scale:()=>b,scaleAndAdd:()=>x,distance:()=>M,squaredDistance:()=>w,squaredLength:()=>_,negate:()=>S,inverse:()=>A,normalize:()=>P,dot:()=>E,cross:()=>O,lerp:()=>I,hermite:()=>R,bezier:()=>C,random:()=>T,transformMat4:()=>L,transformMat3:()=>k,transformQuat:()=>B,rotateX:()=>N,rotateY:()=>F,rotateZ:()=>j,angle:()=>q,zero:()=>Y,str:()=>D,exactEquals:()=>z,equals:()=>V,sub:()=>G,mul:()=>X,div:()=>U,dist:()=>H,sqrDist:()=>Z,len:()=>Q,sqrLen:()=>W,forEach:()=>J});var n=r(11);function i(){var t=new n.ARRAY_TYPE(3);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function s(t){var e=new n.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function o(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function a(t,e,r){var i=new n.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=r,i}function h(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function u(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function c(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function l(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function f(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function d(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function p(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function m(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function g(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function y(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function v(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function b(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function x(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function w(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function _(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function A(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function P(t,e){var r=e[0],n=e[1],i=e[2],s=r*r+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function E(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function O(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],h=r[2];return t[0]=i*h-s*a,t[1]=s*o-n*h,t[2]=n*a-i*o,t}function I(t,e,r,n){var i=e[0],s=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t}function R(t,e,r,n,i,s){var o=s*s,a=o*(2*s-3)+1,h=o*(s-2)+s,u=o*(s-1),c=o*(3-2*s);return t[0]=e[0]*a+r[0]*h+n[0]*u+i[0]*c,t[1]=e[1]*a+r[1]*h+n[1]*u+i[1]*c,t[2]=e[2]*a+r[2]*h+n[2]*u+i[2]*c,t}function C(t,e,r,n,i,s){var o=1-s,a=o*o,h=s*s,u=a*o,c=3*s*a,l=3*h*o,f=h*s;return t[0]=e[0]*u+r[0]*c+n[0]*l+i[0]*f,t[1]=e[1]*u+r[1]*c+n[1]*l+i[1]*f,t[2]=e[2]*u+r[2]*c+n[2]*l+i[2]*f,t}function T(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,s=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*s,t[1]=Math.sin(r)*s,t[2]=i*e,t}function L(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[3]*n+r[7]*i+r[11]*s+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*s+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*s+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*s+r[14])/o,t}function k(t,e,r){var n=e[0],i=e[1],s=e[2];return t[0]=n*r[0]+i*r[3]+s*r[6],t[1]=n*r[1]+i*r[4]+s*r[7],t[2]=n*r[2]+i*r[5]+s*r[8],t}function B(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],h=e[1],u=e[2],c=i*u-s*h,l=s*a-n*u,f=n*h-i*a,d=i*f-s*l,p=s*c-n*f,m=n*l-i*c,g=2*o;return c*=g,l*=g,f*=g,d*=2,p*=2,m*=2,t[0]=a+c+d,t[1]=h+l+p,t[2]=u+f+m,t}function N(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0],s[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),s[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function F(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),s[1]=i[1],s[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function j(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),s[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),s[2]=i[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function q(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2],h=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(s*s+o*o+a*a),u=h&&E(t,e)/h;return Math.acos(Math.min(Math.max(u,-1),1))}function Y(t){return t[0]=0,t[1]=0,t[2]=0,t}function D(t){return\"vec3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\")\"}function z(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function V(t,e){var r=t[0],i=t[1],s=t[2],o=e[0],a=e[1],h=e[2];return Math.abs(r-o)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-a)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(s-h)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(h))}var $,G=l,X=f,U=d,H=M,Z=w,Q=o,W=_,J=($=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=3),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{\"use strict\";r.r(e),r.d(e,{create:()=>o,clone:()=>a,fromValues:()=>h,fromRotationTranslationValues:()=>u,fromRotationTranslation:()=>c,fromTranslation:()=>l,fromRotation:()=>f,fromMat4:()=>d,copy:()=>p,identity:()=>m,set:()=>g,getReal:()=>y,getDual:()=>v,setReal:()=>b,setDual:()=>x,getTranslation:()=>M,translate:()=>w,rotateX:()=>_,rotateY:()=>S,rotateZ:()=>A,rotateByQuatAppend:()=>P,rotateByQuatPrepend:()=>E,rotateAroundAxis:()=>O,add:()=>I,multiply:()=>R,mul:()=>C,scale:()=>T,dot:()=>L,lerp:()=>k,invert:()=>B,conjugate:()=>N,length:()=>F,len:()=>j,squaredLength:()=>q,sqrLen:()=>Y,normalize:()=>D,str:()=>z,exactEquals:()=>V,equals:()=>$});var n=r(11),i=r(16),s=r(15);function o(){var t=new n.ARRAY_TYPE(8);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function a(t){var e=new n.ARRAY_TYPE(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function h(t,e,r,i,s,o,a,h){var u=new n.ARRAY_TYPE(8);return u[0]=t,u[1]=e,u[2]=r,u[3]=i,u[4]=s,u[5]=o,u[6]=a,u[7]=h,u}function u(t,e,r,i,s,o,a){var h=new n.ARRAY_TYPE(8);h[0]=t,h[1]=e,h[2]=r,h[3]=i;var u=.5*s,c=.5*o,l=.5*a;return h[4]=u*i+c*r-l*e,h[5]=c*i+l*t-u*r,h[6]=l*i+u*e-c*t,h[7]=-u*t-c*e-l*r,h}function c(t,e,r){var n=.5*r[0],i=.5*r[1],s=.5*r[2],o=e[0],a=e[1],h=e[2],u=e[3];return t[0]=o,t[1]=a,t[2]=h,t[3]=u,t[4]=n*u+i*h-s*a,t[5]=i*u+s*o-n*h,t[6]=s*u+n*a-i*o,t[7]=-n*o-i*a-s*h,t}function l(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function d(t,e){var r=i.create();s.getRotation(r,e);var o=new n.ARRAY_TYPE(3);return s.getTranslation(o,e),c(t,r,o),t}function p(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function m(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function g(t,e,r,n,i,s,o,a,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t}var y=i.copy;function v(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var b=i.copy;function x(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function M(t,e){var r=e[4],n=e[5],i=e[6],s=e[7],o=-e[0],a=-e[1],h=-e[2],u=e[3];return t[0]=2*(r*u+s*o+n*h-i*a),t[1]=2*(n*u+s*a+i*o-r*h),t[2]=2*(i*u+s*h+r*a-n*o),t}function w(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=.5*r[0],h=.5*r[1],u=.5*r[2],c=e[4],l=e[5],f=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=o*a+i*u-s*h+c,t[5]=o*h+s*a-n*u+l,t[6]=o*u+n*h-i*a+f,t[7]=-n*a-i*h-s*u+d,t}function _(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],h=e[4],u=e[5],c=e[6],l=e[7],f=h*a+l*n+u*o-c*s,d=u*a+l*s+c*n-h*o,p=c*a+l*o+h*s-u*n,m=l*a-h*n-u*s-c*o;return i.rotateX(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function S(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],h=e[4],u=e[5],c=e[6],l=e[7],f=h*a+l*n+u*o-c*s,d=u*a+l*s+c*n-h*o,p=c*a+l*o+h*s-u*n,m=l*a-h*n-u*s-c*o;return i.rotateY(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function A(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],h=e[4],u=e[5],c=e[6],l=e[7],f=h*a+l*n+u*o-c*s,d=u*a+l*s+c*n-h*o,p=c*a+l*o+h*s-u*n,m=l*a-h*n-u*s-c*o;return i.rotateZ(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function P(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],h=e[1],u=e[2],c=e[3];return t[0]=a*o+c*n+h*s-u*i,t[1]=h*o+c*i+u*n-a*s,t[2]=u*o+c*s+a*i-h*n,t[3]=c*o-a*n-h*i-u*s,a=e[4],h=e[5],u=e[6],c=e[7],t[4]=a*o+c*n+h*s-u*i,t[5]=h*o+c*i+u*n-a*s,t[6]=u*o+c*s+a*i-h*n,t[7]=c*o-a*n-h*i-u*s,t}function E(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*c+o*a+i*u-s*h,t[1]=i*c+o*h+s*a-n*u,t[2]=s*c+o*u+n*h-i*a,t[3]=o*c-n*a-i*h-s*u,a=r[4],h=r[5],u=r[6],c=r[7],t[4]=n*c+o*a+i*u-s*h,t[5]=i*c+o*h+s*a-n*u,t[6]=s*c+o*u+n*h-i*a,t[7]=o*c-n*a-i*h-s*u,t}function O(t,e,r,i){if(Math.abs(i)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,s=e[2]/r,o=e[3]/r,a=e[4],h=e[5],u=e[6],c=e[7],l=n*a+i*h+s*u+o*c;t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=(a-n*l)/r,t[5]=(h-i*l)/r,t[6]=(u-s*l)/r,t[7]=(c-o*l)/r}return t}function z(t){return\"quat2(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\")\"}function V(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function $(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=t[6],c=t[7],l=e[0],f=e[1],d=e[2],p=e[3],m=e[4],g=e[5],y=e[6],v=e[7];return Math.abs(r-l)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(i-f)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(s-d)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(o-p)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-m)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(h-g)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(g))&&Math.abs(u-y)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-v)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(v))}},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,fromValues:()=>o,copy:()=>a,set:()=>h,add:()=>u,subtract:()=>c,multiply:()=>l,divide:()=>f,ceil:()=>d,floor:()=>p,min:()=>m,max:()=>g,round:()=>y,scale:()=>v,scaleAndAdd:()=>b,distance:()=>x,squaredDistance:()=>M,length:()=>w,squaredLength:()=>_,negate:()=>S,inverse:()=>A,normalize:()=>P,dot:()=>E,cross:()=>O,lerp:()=>I,random:()=>R,transformMat2:()=>C,transformMat2d:()=>T,transformMat3:()=>L,transformMat4:()=>k,rotate:()=>B,angle:()=>N,zero:()=>F,str:()=>j,exactEquals:()=>q,equals:()=>Y,len:()=>z,sub:()=>V,mul:()=>$,div:()=>G,dist:()=>X,sqrDist:()=>U,sqrLen:()=>H,forEach:()=>Z});var n=r(11);function i(){var t=new n.ARRAY_TYPE(2);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function s(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e}function o(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r}function a(t,e){return t[0]=e[0],t[1]=e[1],t}function h(t,e,r){return t[0]=e,t[1]=r,t}function u(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function l(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function f(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function m(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function g(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function y(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function v(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function b(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function x(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function w(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function _(t){var e=t[0],r=t[1];return e*e+r*r}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t}function A(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function P(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function E(t,e){return t[0]*e[0]+t[1]*e[1]}function O(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function I(t,e,r,n){var i=e[0],s=e[1];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t}function R(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function C(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function T(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function L(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function k(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function B(t,e,r,n){var i=e[0]-r[0],s=e[1]-r[1],o=Math.sin(n),a=Math.cos(n);return t[0]=i*a-s*o+r[0],t[1]=i*o+s*a+r[1],t}function N(t,e){var r=t[0],n=t[1],i=e[0],s=e[1],o=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+s*s),a=o&&(r*i+n*s)/o;return Math.acos(Math.min(Math.max(a,-1),1))}function F(t){return t[0]=0,t[1]=0,t}function j(t){return\"vec2(\"+t[0]+\", \"+t[1]+\")\"}function q(t,e){return t[0]===e[0]&&t[1]===e[1]}function Y(t,e){var r=t[0],i=t[1],s=e[0],o=e[1];return Math.abs(r-s)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-o)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))}var D,z=w,V=c,$=l,G=f,X=x,U=M,H=_,Z=(D=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=2),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Scene=void 0;const n=r(22),i=r(23),s=r(32),o=r(30);class a{constructor(t={}){this.width=400,this.height=400,this.background=\"hsla(0, 0%, 0%, 1)\",this.color=\"hsla(0, 0%, 100%, 1)\",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?[\"number\"==typeof t.anchor[0]?(.5+.5*o.clamp(-1,1,t.anchor[0]))*this.width:\"left\"===t.anchor[0]?0:\"right\"===t.anchor[0]?this.width:this.center[0],\"number\"==typeof t.anchor[1]?(.5+.5*o.clamp(-1,1,t.anchor[1]))*this.height:\"top\"===t.anchor[1]?0:\"bottom\"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e=\"number\"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,a.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{a.propagateToChilden(t,e)})):t instanceof s.Shape&&t.shape&&(t.shape.scene=e,a.propagateToChilden(t.shape,e))}}e.Scene=a},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||\"SceneChild\",this.name=t.name||this.type+\"_\"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){\"string\"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Group=void 0;const n=r(21),i=r(22),s=r(24),o=r(28);class a extends i.SceneChild{constructor(t={}){t.type=\"Group\",super(t),this.children=[],[\"id\",\"name\",\"data\",\"order\",\"type\"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=o.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){\"object\"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=a},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeBase=void 0;const n=r(10),i=r(1),s=r(25),o=r(26),a=r(27),h=r(28),u=r(30),c=r(22),l=n.mat4.create(),f=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class m extends c.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?[\"number\"==typeof t.anchor[0]?-1*u.clamp(-1,1,t.anchor[0]):\"left\"===t.anchor[0]?1:\"right\"===t.anchor[0]?-1:0,\"number\"==typeof t.anchor[1]?-1*u.clamp(-1,1,t.anchor[1]):\"top\"===t.anchor[1]?1:\"bottom\"===t.anchor[1]?-1:0]:[0,0],this.boundingType=\"string\"==typeof t.boundingType?\"relative\"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return\"function\"!=typeof t.repetitions&&\"function\"!=typeof t.distance&&\"function\"!=typeof t.displace&&\"function\"!=typeof t.scale&&\"function\"!=typeof t.translate&&\"function\"!=typeof t.skewX&&\"function\"!=typeof t.skewY&&\"function\"!=typeof t.squeezeX&&\"function\"!=typeof t.squeezeY&&\"function\"!=typeof t.rotateX&&\"function\"!=typeof t.rotateY&&\"function\"!=typeof t.rotateZ&&\"function\"!=typeof t.transformOrigin&&\"function\"!=typeof t.perspective&&\"function\"!=typeof t.perspectiveOrigin}isStaticIndexed(){return\"function\"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return\"function\"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){\"string\"==typeof t?(r=r||\"repetitions\"==t,this.props[t]=e):(r=r||\"repetitions\"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var c,g;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const y=m.getEmptyPropArguments(this,r),v=y.repetition,b=this.getProp(\"repetitions\",y,1),x=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,M=Array.isArray(b)?b[0]*(null!==(c=b[1])&&void 0!==c?c:b[0]):b,w=Array.isArray(b)?b[0]:M,_=Array.isArray(b)?null!==(g=b[1])&&void 0!==g?g:b[0]:1,S=v.row;S.count=w;const A=v.col;A.count=_,v.count=M,v.col.count=_,v.row.count=w,v.type=x;let P=0;const E=[];let O=0;const I=n.vec2.fromValues((_-1)/2,(w-1)/2),R=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],C=[void 0,void 0,void 0,void 0],T=[void 0,void 0,void 0,void 0];for(let r=0;r1?O/(M-1):1,v.angle=x===i.ERepetitionType.Ring?a.PI2/M*O:0,A.index=c+1,A.offset=_>1?c/(_-1):1,S.index=r+1,S.offset=w>1?r/(w-1):1;const m=this.generateBuffer(t,y),g=m.length,b=this.getShapeBounding();E[O]=new Float32Array(g),P+=g;{const t=s.toVec2(this.getProp(\"distance\",y,s.VEC2_ZERO)),a=this.getProp(\"displace\",y,0),M=s.toVec3(this.getProp(\"scale\",y,s.VEC2_ONE),1),w=s.toVec3(this.getProp(\"translate\",y,s.VEC2_ZERO),0),_=this.getProp(\"skewX\",y,0),S=this.getProp(\"skewY\",y,0),A=this.getProp(\"squeezeX\",y,0),P=this.getProp(\"squeezeY\",y,0),L=this.getProp(\"rotateX\",y,0),k=this.getProp(\"rotateY\",y,0),B=this.getProp(\"rotateZ\",y,0),N=u.clamp(0,1,this.getProp(\"perspective\",y,0)),F=s.toVec3(this.getProp(\"perspectiveOrigin\",y,s.VEC2_ZERO),0),j=s.toVec3(this.getProp(\"transformOrigin\",y,s.VEC2_ZERO),0);let q;switch(x){case i.ERepetitionType.Ring:q=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(q,q,s.VEC3_ZERO,v.angle+a);break;case i.ERepetitionType.Matrix:q=n.vec3.fromValues(t[1]*(c-I[0]),t[0]*(r-I[1]),0)}const Y=N>0?Math.max(b.width,b.height)/2:1,D=N>0?Y+10*Y*(1-N):0,z=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==N||0!==j[0]||0!==j[1],V=0!==F[0]||0!==F[1];z&&(this.boundingType===i.EBoundingType.Relative?(j[0]=j[0]*(b.width/2)+b.cx,j[1]=j[1]*(b.height/2)+b.cy):(j[0]*=b.width/2,j[1]*=b.height/2),j[2]=D);{n.mat4.identity(f),z&&n.mat4.translate(f,f,j),0===w[0]&&0===w[1]||n.mat4.translate(f,f,w),0===_&&0===S||(s.fromSkew(l,[_,S]),n.mat4.multiply(f,f,l)),0!==L&&n.mat4.rotateX(f,f,L),0!==k&&n.mat4.rotateY(f,f,k),0!==B&&n.mat4.rotateZ(f,f,B),1===M[0]&&1===M[1]||n.mat4.scale(f,f,M),z&&n.mat4.translate(f,f,n.vec3.scale(j,j,-1)),D>0&&(V&&(this.boundingType===i.EBoundingType.Relative?(F[0]=F[0]*(b.width/2)+b.cx,F[1]=F[1]*(b.height/2)+b.cy):(F[0]*=b.width/2,F[1]*=b.height/2),F[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,q),e&&n.mat4.translate(p,p,R);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),x===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,v.angle+a)}h.Bounding.clear(T);for(let t=0;t0&&(V&&n.vec3.add(e,e,F),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,D),V&&n.vec3.sub(e,e,F)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=g/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,y)}E[O][t]=e[0],E[O][t+1]=e[1],h.Bounding.add(T,e[0],e[1]),h.Bounding.add(C,e[0],e[1])}}const L={cx:0,cy:0,x:-1,y:-1,width:2,height:2};h.Bounding.bind(L,T),this.bStaticIndexed&&this.bIndexed||this.addIndex(g,v,L)}h.Bounding.bind(this.bounding,C),this.buffer=new Float32Array(P);for(let t=0,e=0,r=E.length;t({index:1,offset:1,count:1}),m.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...m.getEmptySimpleRepetition(),row:m.getEmptySimpleRepetition(),col:m.getEmptySimpleRepetition()})},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(10);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return\"number\"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(29);var i;!function(t){t[t.None=0]=\"None\",t[t.Scale=2]=\"Scale\",t[t.Center=4]=\"Center\",t[t.Fill=8]=\"Fill\"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn(\"[Urplfanze:Bounding] cannot sum bounding\")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn(\"[Urplfanze:Bounding] cannot bind bounding\")}};class s extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return s.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=s.getBounding(t));const o=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,a=e>=i.Center?r.cx:0,h=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(31),i=r(4),s=r(26),o=\"undefined\"!=typeof performance?performance:Date;function a(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return o.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=a,e.relativeClamp=function(t,e,r,n,i){return a(n,i,(r-t)/(e-t)*(i-n)+n)};const h={random:new n(Math.random)};e.noise=function(t=\"random\",e=0,r=0,i=0){return void 0===h[t]&&(h[t]=new n(t)),h[t].noise3D(e,r,i)};const u={};function c(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),s=rn?[s,o]:[o,s]}function l(t,e){const r=t.length,n=r/2,i=2*(n+e),s=n-1;if(s>1){const n=r-2,o=Math.floor(e/s);let a=(i-(r+o*n))/2;const h=Math.round(s/a),u=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%h==0||e===n-2),p=o+(d?1:0),m=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);u[i]=(s=t(),o=t(),a=t(),h=t(),function(){let t=(s>>>=0)+(o>>>=0)|0;return s=o^o>>>9,o=(a>>>=0)+(a<<3)|0,t=t+(h=1+(h>>>=0)|0)|0,a=(a=a<<21|a>>>11)+t|0,(t>>>0)/4294967296})}var s,o,a,h;const c=e+u[i]()*(r-e);return void 0!==n?Math.round(c*10**n)/10**n:c},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return s.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=c,e.interpolate=function(t,e,r=.5){const[n,i]=c(t,e),s=Math.max(n.length,i.length),o=\"number\"==typeof r?[r]:r,a=s/2;if(o.length!==a){const t=o.length;for(let e=0;e{var n;!function(){\"use strict\";var i=.5*(Math.sqrt(3)-1),s=(3-Math.sqrt(3))/6,o=1/6,a=(Math.sqrt(5)-1)/4,h=(5-Math.sqrt(5))/20;function u(t){var e;e=\"function\"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=l();t=i(\" \"),e=i(\" \"),r=i(\" \");for(var s=0;s>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}u.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,o=this.permMod12,a=this.perm,h=this.grad3,u=0,c=0,l=0,f=(t+e)*i,d=Math.floor(t+f),p=Math.floor(e+f),m=(d+p)*s,g=t-(d-m),y=e-(p-m);g>y?(r=1,n=0):(r=0,n=1);var v=g-r+s,b=y-n+s,x=g-1+2*s,M=y-1+2*s,w=255&d,_=255&p,S=.5-g*g-y*y;if(S>=0){var A=3*o[w+a[_]];u=(S*=S)*S*(h[A]*g+h[A+1]*y)}var P=.5-v*v-b*b;if(P>=0){var E=3*o[w+r+a[_+n]];c=(P*=P)*P*(h[E]*v+h[E+1]*b)}var O=.5-x*x-M*M;if(O>=0){var I=3*o[w+1+a[_+1]];l=(O*=O)*O*(h[I]*x+h[I+1]*M)}return 70*(u+c+l)},noise3D:function(t,e,r){var n,i,s,a,h,u,c,l,f,d,p=this.permMod12,m=this.perm,g=this.grad3,y=.3333333333333333*(t+e+r),v=Math.floor(t+y),b=Math.floor(e+y),x=Math.floor(r+y),M=(v+b+x)*o,w=t-(v-M),_=e-(b-M),S=r-(x-M);w>=_?_>=S?(h=1,u=0,c=0,l=1,f=1,d=0):w>=S?(h=1,u=0,c=0,l=1,f=0,d=1):(h=0,u=0,c=1,l=1,f=0,d=1):_T?B++:N++,C>L?B++:F++,C>k?B++:j++,T>L?N++:F++,T>k?N++:j++,L>k?F++:j++;var q=C-(l=B>=3?1:0)+h,Y=T-(f=N>=3?1:0)+h,D=L-(d=F>=3?1:0)+h,z=k-(p=j>=3?1:0)+h,V=C-(m=B>=2?1:0)+2*h,$=T-(g=N>=2?1:0)+2*h,G=L-(y=F>=2?1:0)+2*h,X=k-(v=j>=2?1:0)+2*h,U=C-(b=B>=1?1:0)+3*h,H=T-(x=N>=1?1:0)+3*h,Z=L-(M=F>=1?1:0)+3*h,Q=k-(w=j>=1?1:0)+3*h,W=C-1+4*h,J=T-1+4*h,K=L-1+4*h,tt=k-1+4*h,et=255&P,rt=255&E,nt=255&O,it=255&I,st=.6-C*C-T*T-L*L-k*k;if(st<0)i=0;else{var ot=_[et+_[rt+_[nt+_[it]]]]%32*4;i=(st*=st)*st*(S[ot]*C+S[ot+1]*T+S[ot+2]*L+S[ot+3]*k)}var at=.6-q*q-Y*Y-D*D-z*z;if(at<0)s=0;else{var ht=_[et+l+_[rt+f+_[nt+d+_[it+p]]]]%32*4;s=(at*=at)*at*(S[ht]*q+S[ht+1]*Y+S[ht+2]*D+S[ht+3]*z)}var ut=.6-V*V-$*$-G*G-X*X;if(ut<0)o=0;else{var ct=_[et+m+_[rt+g+_[nt+y+_[it+v]]]]%32*4;o=(ut*=ut)*ut*(S[ct]*V+S[ct+1]*$+S[ct+2]*G+S[ct+3]*X)}var lt=.6-U*U-H*H-Z*Z-Q*Q;if(lt<0)u=0;else{var ft=_[et+b+_[rt+x+_[nt+M+_[it+w]]]]%32*4;u=(lt*=lt)*lt*(S[ft]*U+S[ft+1]*H+S[ft+2]*Z+S[ft+3]*Q)}var dt=.6-W*W-J*J-K*K-tt*tt;if(dt<0)c=0;else{var pt=_[et+1+_[rt+1+_[nt+1+_[it+1]]]]%32*4;c=(dt*=dt)*dt*(S[pt]*W+S[pt+1]*J+S[pt+2]*K+S[pt+3]*tt)}return 27*(i+s+o+u+c)}},u._buildPermutationTable=c,void 0===(n=function(){return u}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=u,t.exports=u}()},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Shape=void 0;const n=r(21),i=r(22),s=r(24);class o extends s.ShapeBase{constructor(t){t.type=t.type||\"Shape\",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn(\"[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\\nYou passed:\",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):o.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapePrimitive=void 0;const n=r(25),i=r(24),s=r(29),o=r(28);class a extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=o.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:\"function\"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return\"function\"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:\"number\"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp(\"sideLength\",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeLoop=void 0;const n=r(27),i=r(28),s=r(33),o=r(24);class a extends s.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||\"ShapeLoop\",super(t),this.loopDependencies=(t.loopDependencies||[]).concat(\"sideLength\"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes(\"propArguments\"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}\"loop\"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||o.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?(\"function\"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),s=this.getRepetitionSideLength(t),o=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,a={index:0,offset:0,current:0,count:n},h=a.count,u=new Float32Array(2*h);for(let n=0,i=0;n1?n/(a.count-1):1;a.current=s,a.index=n+1,a.offset=h;const c=o(a,t);u[i]=c[0],u[i+1]=c[1]}const c=[void 0,void 0,void 0,void 0],l=this.applyModifiers(u,t);for(let t=0,e=l.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeBuffer=void 0;const n=r(28),i=r(33);class s extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||\"ShapeBuffer\",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn(\"[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property\"),this.shape=s.EMPTY_BUFFER):this.shape=\"function\"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return\"function\"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return\"function\"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from(\"function\"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,s=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&\"function\"!=typeof this.props.sideLength&&\"function\"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeRecursive=void 0;const n=r(32);class i extends n.Shape{constructor(t){t.type=t.type||\"ShapeRecursive\",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return\"function\"!=typeof this.props.recursions&&\"function\"!=typeof this.props.recursionScale&&\"function\"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return\"function\"!=typeof this.props.recursions&&\"function\"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp(\"recursions\",e,1)),n=Math.floor(this.getProp(\"recursionVertex\",e,0)),s=this.getProp(\"recursionScale\",e,2),o=this.shape;let a={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const h={...e,recursion:a};o.generate(t,!1,h);const u=o.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=u);let c=u;const l=[a];let f=0,d=1;const p=c.length,m=p/2,g=n<=0?m:Math.min(n,m),y=0===n?1:m/Math.min(n,m),v=new Float32Array(i.summmation(r,g)*p);for(let t=0;t1?e/(r-1):1,u=i.summmation(e,g)*p,m=e-1,b=0===m?0:i.summmation(m,g)*p;for(let i=0,m=g**e;i1?i/(m-1):1,count:m,level:{index:e+1,offset:n,count:r},parent:l[f]},l.push(a),this.shapeUseRecursion&&(h.recursion=a,o.generate(t,!1,h),c=o.getBuffer());const x=u+i*p,M=Math.floor(b+2*i*y),w=v[M],_=v[M+1],S=s**e;for(let t=0,e=p;t1?0:1,count:s}}},h=this.shape.getIndexedBuffer()||[];for(let t=0,e=h.length;t1?0:1,count:s}},i={...a,recursion:r},o=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:o})}if(s>1){const t=this.shape.getBufferLength({...i,parent:{...a}})/2,e=o<=0?t:Math.min(o,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let u=0,c=1;for(let t=1;t1?t/(s-1):1;for(let o=0,l=e**t;o1?o/(l-1):1;for(let d=0,p=h.length;d{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeFollow=void 0;const n=r(32);class i extends n.Shape{constructor(t){t.type=t.type||\"ShapeFollow\",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},s=this.shape;s.generate(t,!1,i);let o=s.getBuffer();const a=o.length,h=new Float32Array(a*(n.length/2)),u=n.length/2;for(let e=0;e1?e/(u-1):1,count:u};this.shapeUseFollow&&(i.follow=r,s.generate(t,!1,i),o=s.getBuffer());const c=e*a,l=2*e,f=n[l],d=n[l+1];for(let t=0,e=o.length;t1?t/(e-1):1;for(let o=0,a=s.length;o{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Line=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type=\"Line\",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Triangle=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type=\"Triangle\",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=s,s.buffer=[1,0,-1,1,-1,-1]},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Rect=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type=\"Rect\",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=s,s.buffer=[1,1,-1,1,-1,-1,1,-1]},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Polygon=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||\"Polygon\",t.loopDependencies=(t.loopDependencies||[]).concat([\"sideNumber\"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp(\"sideNumber\",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Circle=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=\"Circle\",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Star=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||\"Polygon\",t.loopDependencies=(t.loopDependencies||[]).concat([\"spikes\",\"innerRadius\"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp(\"spikes\",t,5),this.innerRadius=this.getProp(\"innerRadius\",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Rose=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r;t.type=\"Rose\",t.loopDependencies=(t.loopDependencies||[]).concat([\"n\",\"d\"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>s.getFinalAngleFromK(this.getProp(\"n\",t),this.getProp(\"d\",t)),inc:t=>{const e=this.getProp(\"n\",t),r=this.getProp(\"d\",t),i=this.getRepetitionSideLength(t),s=Math.pow(i[0]*i[1],.45),o=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp(\"n\",t)/this.getProp(\"d\",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Spiral=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type=\"Spiral\",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat([\"twists\",\"twistsStart\",\"spiral\"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:s.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp(\"twistsStart\",t),end:t=>n.PI2*(this.getProp(\"twistsStart\",t)+this.getProp(\"twists\",t)),inc:t=>{const e=this.getProp(\"twists\",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp(\"spiral\",t),this.r=s.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case s.types.ARCHIMEDE:return t=>t/10;case s.types.HYPERBOLIC:return t=>1/t*3;case s.types.FERMAT:return t=>t**.5/3;case s.types.LITUUS:return t=>t**-.5;case s.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=s,s.types={ARCHIMEDE:\"ARCHIMEDE\",HYPERBOLIC:\"HYPERBOLIC\",FERMAT:\"FERMAT\",LITUUS:\"LITUUS\",LOGARITHMIC:\"LOGARITHMIC\"}},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Lissajous=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=\"Lissajous\",t.loopDependencies=(t.loopDependencies||[]).concat([\"wx\",\"wy\",\"wz\"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp(\"wx\",t),r=this.getProp(\"wy\",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),s=this.getRepetitionSideLength(t);return 1/Math.pow(s[0]*s[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp(\"wx\",t,1),this.wy=this.getProp(\"wy\",t,2),this.wz=this.getProp(\"wz\",t,2),super.generateLoopBuffer(t)}}e.Lissajous=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.SuperShape=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r,i,s,o,a;t.type=\"SuperShape\",t.loopDependencies=(t.loopDependencies||[]).concat([\"a\",\"b\",\"m\",\"n1\",\"n2\",\"n3\"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(s=t.n1)&&void 0!==s?s:1,this.props.n2=null!==(o=t.n2)&&void 0!==o?o:1,this.props.n3=null!==(a=t.n3)&&void 0!==a?a:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp(\"a\",t),this.b=this.getProp(\"b\",t),this.m=this.getProp(\"m\",t),this.n1=this.getProp(\"n1\",t),this.n2=this.getProp(\"n2\",t),this.n3=this.getProp(\"n3\",t),super.generateLoopBuffer(t)}}e.SuperShape=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Modifiers=void 0;const n=r(28),i=r(49),s=r(50),o=r(52),a=r(53),h=r(51),u=r(54),c={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:s.Smooth,Solidify:o.Solidify,Subdivide:a.Subdivide,Close:h.Close,Offset:u.Offset};e.Modifiers=c},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Mirror=void 0;const n=r(29);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let s=0;s{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Smooth=void 0;const n=r(30),i=r(51),s=r(29);class o extends s.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Close=void 0;const n=r(29);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Solidify=void 0;const n=r(29);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const s=[],o=(e=\"number\"==typeof e?[e]:e).length;let a,h,u=[[0,0],[0,0]],c=[[0,0],[0,0]];for(let r=0,l=0,f=t.length-2;r{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Subdivide=void 0;const n=r(29);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Offset=void 0;const n=r(29);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i}],e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r(0)})()},t.exports=e()},479:(t,e,r)=>{var n;!function(){\"use strict\";function i(t,e,r){var n=e.x,i=e.y,s=r.x-n,o=r.y-i;if(0!==s||0!==o){var a=((t.x-n)*s+(t.y-i)*o)/(s*s+o*o);a>1?(n=r.x,i=r.y):a>0&&(n+=s*a,i+=o*a)}return(s=t.x-n)*s+(o=t.y-i)*o}function s(t,e,r,n,o){for(var a,h=n,u=e+1;uh&&(a=u,h=c)}h>n&&(a-e>1&&s(t,e,a,n,o),o.push(t[a]),r-a>1&&s(t,a,r,n,o))}function o(t,e){var r=t.length-1,n=[t[0]];return s(t,0,r,e,n),n.push(t[r]),n}function a(t,e,r){if(t.length<=2)return t;var n=void 0!==e?e*e:1;return o(t=r?t:function(t,e){for(var r,n,i,s,o,a=t[0],h=[a],u=1,c=t.length;ue&&(h.push(r),a=r);return a!==r&&h.push(r),h}(t,n),n)}void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()},721:(t,e,r)=>{\"use strict\";t.exports=r(192)},921:t=>{\"use strict\";var e=2*Math.PI;function r(t,e,r,n){var i=t*r+e*n;return i>1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)}function n(t,e){var r=4/3*Math.tan(e/4),n=Math.cos(t),i=Math.sin(t),s=Math.cos(t+e),o=Math.sin(t+e);return[n,i,n-i*r,i+n*r,s+o*r,o-s*r,s,o]}t.exports=function(t,i,s,o,a,h,u,c,l){var f=Math.sin(l*e/360),d=Math.cos(l*e/360),p=d*(t-s)/2+f*(i-o)/2,m=-f*(t-s)/2+d*(i-o)/2;if(0===p&&0===m)return[];if(0===u||0===c)return[];u=Math.abs(u),c=Math.abs(c);var g=p*p/(u*u)+m*m/(c*c);g>1&&(u*=Math.sqrt(g),c*=Math.sqrt(g));var y=function(t,n,i,s,o,a,h,u,c,l){var f=l*(t-i)/2+c*(n-s)/2,d=-c*(t-i)/2+l*(n-s)/2,p=h*h,m=u*u,g=f*f,y=d*d,v=p*m-p*y-m*g;v<0&&(v=0),v/=p*y+m*g;var b=(v=Math.sqrt(v)*(o===a?-1:1))*h/u*d,x=v*-u/h*f,M=l*b-c*x+(t+i)/2,w=c*b+l*x+(n+s)/2,_=(f-b)/h,S=(d-x)/u,A=(-f-b)/h,P=(-d-x)/u,E=r(1,0,_,S),O=r(_,S,A,P);return 0===a&&O>0&&(O-=e),1===a&&O<0&&(O+=e),[M,w,E,O]}(t,i,s,o,a,h,u,c,f,d),v=[],b=y[2],x=y[3],M=Math.max(Math.ceil(Math.abs(x)/(e/4)),1);x/=M;for(var w=0;w{\"use strict\";var e=1e-10,r=Math.PI/180;function n(t,e,r){if(!(this instanceof n))return new n(t,e,r);this.rx=t,this.ry=e,this.ax=r}n.prototype.transform=function(t){var n=Math.cos(this.ax*r),i=Math.sin(this.ax*r),s=[this.rx*(t[0]*n+t[2]*i),this.rx*(t[1]*n+t[3]*i),this.ry*(-t[0]*i+t[2]*n),this.ry*(-t[1]*i+t[3]*n)],o=s[0]*s[0]+s[2]*s[2],a=s[1]*s[1]+s[3]*s[3],h=((s[0]-s[3])*(s[0]-s[3])+(s[2]+s[1])*(s[2]+s[1]))*((s[0]+s[3])*(s[0]+s[3])+(s[2]-s[1])*(s[2]-s[1])),u=(o+a)/2;if(hMath.abs(l-a)?(l-o)/c:c/(l-a))/Math.PI,this.ax>=0?(this.rx=Math.sqrt(l),this.ry=Math.sqrt(f)):(this.ax+=90,this.rx=Math.sqrt(f),this.ry=Math.sqrt(l)),this},n.prototype.isDegenerate=function(){return this.rx{\"use strict\";function e(){if(!(this instanceof e))return new e;this.queue=[],this.cache=null}e.prototype.matrix=function(t){return 1===t[0]&&0===t[1]&&0===t[2]&&1===t[3]&&0===t[4]&&0===t[5]||(this.cache=null,this.queue.push(t)),this},e.prototype.translate=function(t,e){return 0===t&&0===e||(this.cache=null,this.queue.push([1,0,0,1,t,e])),this},e.prototype.scale=function(t,e){return 1===t&&1===e||(this.cache=null,this.queue.push([t,0,0,e,0,0])),this},e.prototype.rotate=function(t,e,r){var n,i,s;return 0!==t&&(this.translate(e,r),n=t*Math.PI/180,i=Math.cos(n),s=Math.sin(n),this.queue.push([i,s,-s,i,0,0]),this.cache=null,this.translate(-e,-r)),this},e.prototype.skewX=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},e.prototype.skewY=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},e.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],1===this.queue.length)return this.cache;for(var t=1;t{\"use strict\";var e={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},r=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function n(t){return t>=48&&t<=57}function i(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err=\"\",this.segmentStart=0,this.data=[]}function s(t){for(;t.index=5760&&r.indexOf(e)>=0);)t.index++;var e}function o(t){var e=t.path.charCodeAt(t.index);return 48===e?(t.param=0,void t.index++):49===e?(t.param=1,void t.index++):void(t.err=\"SvgPath: arc flag can be 0 or 1 only (at pos \"+t.index+\")\")}function a(t){var e,r=t.index,i=r,s=t.max,o=!1,a=!1,h=!1,u=!1;if(i>=s)t.err=\"SvgPath: missed param (at pos \"+i+\")\";else if(43!==(e=t.path.charCodeAt(i))&&45!==e||(e=++i2&&(t.result.push([r,i[0],i[1]]),i=i.slice(2),n=\"l\",r=\"m\"===r?\"l\":\"L\"),\"r\"===n)t.result.push([r].concat(i));else for(;i.length>=e[n]&&(t.result.push([r].concat(i.splice(0,e[n]))),e[n]););}function u(t){var r,n,i,u,c,l,f=t.max;if(t.segmentStart=t.index,n=97==(32|(r=t.path.charCodeAt(t.index))),function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}(r))if(u=e[t.path[t.index].toLowerCase()],t.index++,s(t),t.data=[],u){for(i=!1;;){for(c=u;c>0;c--){if(!n||3!==c&&4!==c?a(t):o(t),t.err.length)return;t.data.push(t.param),s(t),i=!1,t.index=t.max)break;if(!((l=t.path.charCodeAt(t.index))>=48&&l<=57||43===l||45===l||46===l))break}}h(t)}else h(t);else t.err=\"SvgPath: bad command \"+t.path[t.index]+\" (at pos \"+t.index+\")\"}t.exports=function(t){var e=new i(t),r=e.max;for(s(e);e.index{\"use strict\";var n=r(665),i=r(94),s=r(480),o=r(921),a=r(954);function h(t){if(!(this instanceof h))return new h(t);var e=n(t);this.segments=e.segments,this.err=e.err,this.__stack=[]}h.from=function(t){if(\"string\"==typeof t)return new h(t);if(t instanceof h){var e=new h(\"\");return e.err=t.err,e.segments=t.segments.map((function(t){return t.slice()})),e.__stack=t.__stack.map((function(t){return s().matrix(t.toArray())})),e}throw new Error(\"SvgPath.from: invalid param type \"+t)},h.prototype.__matrix=function(t){var e,r=this;t.queue.length&&this.iterate((function(n,i,s,o){var h,u,c,l;switch(n[0]){case\"v\":u=0===(h=t.calc(0,n[1],!0))[0]?[\"v\",h[1]]:[\"l\",h[0],h[1]];break;case\"V\":u=(h=t.calc(s,n[1],!1))[0]===t.calc(s,o,!1)[0]?[\"V\",h[1]]:[\"L\",h[0],h[1]];break;case\"h\":u=0===(h=t.calc(n[1],0,!0))[1]?[\"h\",h[0]]:[\"l\",h[0],h[1]];break;case\"H\":u=(h=t.calc(n[1],o,!1))[1]===t.calc(s,o,!1)[1]?[\"H\",h[0]]:[\"L\",h[0],h[1]];break;case\"a\":case\"A\":var f=t.toArray(),d=a(n[1],n[2],n[3]).transform(f);if(f[0]*f[3]-f[1]*f[2]<0&&(n[5]=n[5]?\"0\":\"1\"),h=t.calc(n[6],n[7],\"a\"===n[0]),\"A\"===n[0]&&n[6]===s&&n[7]===o||\"a\"===n[0]&&0===n[6]&&0===n[7]){u=[\"a\"===n[0]?\"l\":\"L\",h[0],h[1]];break}u=d.isDegenerate()?[\"a\"===n[0]?\"l\":\"L\",h[0],h[1]]:[n[0],d.rx,d.ry,d.ax,n[4],n[5],h[0],h[1]];break;case\"m\":l=i>0,u=[\"m\",(h=t.calc(n[1],n[2],l))[0],h[1]];break;default:for(u=[c=n[0]],l=c.toLowerCase()===c,e=1;e=0;)t.matrix(this.__stack[e].toArray());this.__matrix(t),this.__stack=[]}},h.prototype.toString=function(){var t,e,r=[];this.__evaluateStack();for(var n=0;n0&&\"m\"!==e&&\"M\"!==e&&e===this.segments[n-1][0],r=r.concat(t?this.segments[n].slice(1):this.segments[n]);return r.join(\" \").replace(/ ?([achlmqrstvz]) ?/gi,\"$1\").replace(/ \\-/g,\"-\").replace(/zm/g,\"z m\")},h.prototype.translate=function(t,e){return this.__stack.push(s().translate(t,e||0)),this},h.prototype.scale=function(t,e){return this.__stack.push(s().scale(t,e||0===e?e:t)),this},h.prototype.rotate=function(t,e,r){return this.__stack.push(s().rotate(t,e||0,r||0)),this},h.prototype.skewX=function(t){return this.__stack.push(s().skewX(t)),this},h.prototype.skewY=function(t){return this.__stack.push(s().skewY(t)),this},h.prototype.matrix=function(t){return this.__stack.push(s().matrix(t)),this},h.prototype.transform=function(t){return t.trim()?(this.__stack.push(i(t)),this):this},h.prototype.round=function(t){var e,r=0,n=0,i=0,s=0;return t=t||0,this.__evaluateStack(),this.segments.forEach((function(o){var a=o[0].toLowerCase()===o[0];switch(o[0]){case\"H\":case\"h\":return a&&(o[1]+=i),i=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case\"V\":case\"v\":return a&&(o[1]+=s),s=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case\"Z\":case\"z\":return i=r,void(s=n);case\"M\":case\"m\":return a&&(o[1]+=i,o[2]+=s),i=o[1]-o[1].toFixed(t),s=o[2]-o[2].toFixed(t),r=i,n=s,o[1]=+o[1].toFixed(t),void(o[2]=+o[2].toFixed(t));case\"A\":case\"a\":return a&&(o[6]+=i,o[7]+=s),i=o[6]-o[6].toFixed(t),s=o[7]-o[7].toFixed(t),o[1]=+o[1].toFixed(t),o[2]=+o[2].toFixed(t),o[3]=+o[3].toFixed(t+2),o[6]=+o[6].toFixed(t),void(o[7]=+o[7].toFixed(t));default:return e=o.length,a&&(o[e-2]+=i,o[e-1]+=s),i=o[e-2]-o[e-2].toFixed(t),s=o[e-1]-o[e-1].toFixed(t),void o.forEach((function(e,r){r&&(o[r]=+o[r].toFixed(t))}))}})),this},h.prototype.iterate=function(t,e){var r,n,i,s=this.segments,o={},a=!1,h=0,u=0,c=0,l=0;if(e||this.__evaluateStack(),s.forEach((function(e,r){var n=t(e,r,h,u);Array.isArray(n)&&(o[r]=n,a=!0);var i=e[0]===e[0].toLowerCase();switch(e[0]){case\"m\":case\"M\":return h=e[1]+(i?h:0),u=e[2]+(i?u:0),c=h,void(l=u);case\"h\":case\"H\":return void(h=e[1]+(i?h:0));case\"v\":case\"V\":return void(u=e[1]+(i?u:0));case\"z\":case\"Z\":return h=c,void(u=l);default:h=e[e.length-2]+(i?h:0),u=e[e.length-1]+(i?u:0)}})),!a)return this;for(i=[],r=0;r{\"use strict\";var n=r(480),i={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},s=/\\s*(matrix|translate|scale|rotate|skewX|skewY)\\s*\\(\\s*(.+?)\\s*\\)[\\s,]*/,o=/[\\s,]+/;t.exports=function(t){var e,r,a=new n;return t.split(s).forEach((function(t){if(t.length)if(void 0===i[t])switch(r=t.split(o).map((function(t){return+t||0})),e){case\"matrix\":return void(6===r.length&&a.matrix(r));case\"scale\":return void(1===r.length?a.scale(r[0],r[0]):2===r.length&&a.scale(r[0],r[1]));case\"rotate\":return void(1===r.length?a.rotate(r[0],0,0):3===r.length&&a.rotate(r[0],r[1],r[2]));case\"translate\":return void(1===r.length?a.translate(r[0],0):2===r.length&&a.translate(r[0],r[1]));case\"skewX\":return void(1===r.length&&a.skewX(r[0]));case\"skewY\":return void(1===r.length&&a.skewY(r[0]))}else e=t})),a}},197:(t,e,r)=>{\"use strict\";function n(t,e){return Array.isArray(e)?[t.a*e[0]+t.c*e[1]+t.e,t.b*e[0]+t.d*e[1]+t.f]:{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function i(t,e){return e.map((e=>n(t,e)))}function s(t){return{a:parseFloat(t.a),b:parseFloat(t.b),c:parseFloat(t.c),d:parseFloat(t.d),e:parseFloat(t.e),f:parseFloat(t.f)}}r.r(e),r.d(e,{applyToPoint:()=>n,applyToPoints:()=>i,compose:()=>m,fromDefinition:()=>C,fromObject:()=>s,fromString:()=>a,fromTransformAttribute:()=>k,fromTriangles:()=>R,identity:()=>h,inverse:()=>u,isAffineMatrix:()=>f,rotate:()=>b,rotateDEG:()=>x,scale:()=>M,shear:()=>w,skew:()=>S,skewDEG:()=>A,smoothMatrix:()=>I,toCSS:()=>P,toSVG:()=>E,toString:()=>O,transform:()=>p,translate:()=>d});const o=/^matrix\\(\\s*([0-9_+-.e]+)\\s*,\\s*([0-9_+-.e]+)\\s*,\\s*([0-9_+-.e]+)\\s*,\\s*([0-9_+-.e]+)\\s*,\\s*([0-9_+-.e]+)\\s*,\\s*([0-9_+-.e]+)\\s*\\)$/i;function a(t){const e=t.match(o);if(null===e||e.length<7)throw new Error(`'${t}' is not a matrix`);return{a:parseFloat(e[1]),b:parseFloat(e[2]),c:parseFloat(e[3]),d:parseFloat(e[4]),e:parseFloat(e[5]),f:parseFloat(e[6])}}function h(){return{a:1,c:0,e:0,b:0,d:1,f:0}}function u(t){const{a:e,b:r,c:n,d:i,e:s,f:o}=t,a=e*i-r*n;return{a:i/a,b:r/-a,c:n/-a,d:e/a,e:(i*s-n*o)/-a,f:(r*s-e*o)/a}}function c(t){return void 0===t}function l(t){return\"number\"==typeof t&&!Number.isNaN(t)&&Number.isFinite(t)}function f(t){return\"object\"==typeof(e=t)&&null!==e&&!Array.isArray(e)&&\"a\"in t&&l(t.a)&&\"b\"in t&&l(t.b)&&\"c\"in t&&l(t.c)&&\"d\"in t&&l(t.d)&&\"e\"in t&&l(t.e)&&\"f\"in t&&l(t.f);var e}function d(t,e=0){return{a:1,c:0,e:t,b:0,d:1,f:e}}function p(...t){const e=(t,e)=>({a:t.a*e.a+t.c*e.b,c:t.a*e.c+t.c*e.d,e:t.a*e.e+t.c*e.f+t.e,b:t.b*e.a+t.d*e.b,d:t.b*e.c+t.d*e.d,f:t.b*e.e+t.d*e.f+t.f});switch((t=Array.isArray(t[0])?t[0]:t).length){case 0:throw new Error(\"no matrices provided\");case 1:return t[0];case 2:return e(t[0],t[1]);default:{const[r,n,...i]=t;return p(e(r,n),...i)}}}function m(...t){return p(...t)}const{cos:g,sin:y,PI:v}=Math;function b(t,e,r){const n=g(t),i=y(t),s={a:n,c:-i,e:0,b:i,d:n,f:0};return c(e)||c(r)?s:p([d(e,r),s,d(-e,-r)])}function x(t,e,r){return b(t*v/180,e,r)}function M(t,e,r,n){c(e)&&(e=t);const i={a:t,c:0,e:0,b:0,d:e,f:0};return c(r)||c(n)?i:p([d(r,n),i,d(-r,-n)])}function w(t,e){return{a:1,c:t,e:0,b:e,d:1,f:0}}const{tan:_}=Math;function S(t,e){return{a:1,c:_(t),e:0,b:_(e),d:1,f:0}}function A(t,e){return S(t*Math.PI/180,e*Math.PI/180)}function P(t){return O(t)}function E(t){return O(t)}function O(t){return`matrix(${t.a},${t.b},${t.c},${t.d},${t.e},${t.f})`}function I(t,e=1e10){return{a:Math.round(t.a*e)/e,b:Math.round(t.b*e)/e,c:Math.round(t.c*e)/e,d:Math.round(t.d*e)/e,e:Math.round(t.e*e)/e,f:Math.round(t.f*e)/e}}function R(t,e){const r=null!=t[0].x?t[0].x:t[0][0],n=null!=t[0].y?t[0].y:t[0][1],i=null!=e[0].x?e[0].x:e[0][0],s=null!=e[0].y?e[0].y:e[0][1],o=null!=t[1].x?t[1].x:t[1][0],a=null!=t[1].y?t[1].y:t[1][1],h=null!=e[1].x?e[1].x:e[1][0],c=null!=e[1].y?e[1].y:e[1][1],l=null!=t[2].x?t[2].x:t[2][0],f=null!=t[2].y?t[2].y:t[2][1],d=null!=e[2].x?e[2].x:e[2][0],m=null!=e[2].y?e[2].y:e[2][1];return I(p([{a:i-d,b:s-m,c:h-d,d:c-m,e:d,f:m},u({a:r-l,b:n-f,c:o-l,d:a-f,e:l,f})]))}function C(t){return Array.isArray(t)?t.map(e):e(t);function e(t){switch(t.type){case\"matrix\":if(\"a\"in t&&\"b\"in t&&\"c\"in t&&\"d\"in t&&\"e\"in t&&\"f\"in t)return s(t);throw new Error(\"MISSING_MANDATORY_PARAM\");case\"translate\":if(!(\"tx\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return\"ty\"in t?d(t.tx,t.ty):d(t.tx);case\"scale\":if(!(\"sx\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return\"sy\"in t?M(t.sx,t.sy):M(t.sx);case\"rotate\":if(!(\"angle\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return\"cx\"in t&&\"cy\"in t?x(t.angle,t.cx,t.cy):x(t.angle);case\"skewX\":if(!(\"angle\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return A(t.angle,0);case\"skewY\":if(!(\"angle\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return A(0,t.angle);case\"shear\":if(!(\"shx\"in t)||!(\"shy\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return w(t.shx,t.shy);default:throw new Error(\"UNSUPPORTED_DESCRIPTOR\")}}}function T(t,e,r,n){this.message=t,this.expected=e,this.found=r,this.location=n,this.name=\"SyntaxError\",\"function\"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,T)}function L(t,e){e=void 0!==e?e:{};var r,n={},i={transformList:G},s=G,o=\"matrix\",a=\"(\",h=\")\",u=\"translate\",c=\"scale\",l=\"rotate\",f=\"skewX\",d=\"skewY\",p=/^[eE]/,m=/^[+\\-]/,g=/^[0-9]/,y=/^[ \\t\\r\\n]/,v=F(\"matrix\",!1),b=F(\"(\",!1),x=F(\")\",!1),M=F(\"translate\",!1),w=F(\"scale\",!1),_=F(\"rotate\",!1),S=F(\"skewX\",!1),A=F(\"skewY\",!1),P=F(\",\",!1),E={type:\"other\",description:\"fractionalConstant\"},O=j([\"e\",\"E\"],!1,!1),I=j([\"+\",\"-\"],!1,!1),R=j([[\"0\",\"9\"]],!1,!1),C=j([\" \",\"\\t\",\"\\r\",\"\\n\"],!1,!1),L=0,k=[{line:1,column:1}],B=[],N=0;if(\"startRule\"in e){if(!(e.startRule in i))throw new Error(\"Can't start parsing from rule \\\"\"+e.startRule+'\".');s=i[e.startRule]}function F(t,e){return{type:\"literal\",text:t,ignoreCase:e}}function j(t,e,r){return{type:\"class\",parts:t,inverted:e,ignoreCase:r}}function q(e){var r,n=k[e];if(n)return n;for(r=e-1;!k[r];)r--;for(n={line:(n=k[r]).line,column:n.column};r0;function V(t,r){var n={};z&&(n.filename=e.filename);var i=q(t);n.start={offset:t,line:i.line,column:i.column};var s=q(r);return n.end={offset:r,line:s.line,column:s.column},n}function $(t){var e=B[B.length-1];Le.pos&&(e.pos=L,e.variants=[]),e.variants.push(t))}function G(){var t,e,r,i;for(L,t=[],e=rt();e!==n;)t.push(e),e=rt();for((e=X())===n&&(e=null),r=[],i=rt();i!==n;)r.push(i),i=rt();return e}function X(){var t,e,r,i,s;if(t=L,(e=U())!==n){if(r=[],(i=Q())!==n)for(;i!==n;)r.push(i),i=Q();else r=n;r!==n&&(i=X())!==n?(s=i,t=e.concat(s)):(L=t,t=n)}else L=t,t=n;return t===n&&(t=U()),t}function U(){var e;return(e=function(){var e,r,i,s,u,c,l,f,d,p,m,g,y,M=function(t){0===N&&$(t)};if(e=L,M(v),t.substr(L,6)===o?(r=o,L+=6):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(M(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(u=[],c=rt();c!==n;)u.push(c),c=rt();if((c=H())!==n)if(Q()!==n)if((l=H())!==n)if(Q()!==n)if((f=H())!==n)if(Q()!==n)if((d=H())!==n)if(Q()!==n)if((p=H())!==n)if(Q()!==n)if((m=H())!==n){for(g=[],y=rt();y!==n;)g.push(y),y=rt();M(x),41===t.charCodeAt(L)?(y=h,L++):y=n,y!==n?e=[{type:\"matrix\",a:c,b:l,c:f,d,e:p,f:m}]:(L=e,e=n)}else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,c,l,f,d,p,m,g=function(t){0===N&&$(t)};if(e=L,g(M),t.substr(L,9)===u?(r=u,L+=9):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(o=[],c=rt();c!==n;)o.push(c),c=rt();if((c=H())!==n){for((l=Z())===n&&(l=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(x),41===t.charCodeAt(L)?(d=h,L++):d=n,d!==n?(m={type:\"translate\",tx:c},(p=l)&&(m.ty=p),e=[m]):(L=e,e=n)}else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,l,f,d,p,m,g=function(t){0===N&&$(t)};if(e=L,g(w),t.substr(L,5)===c?(r=c,L+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=H())!==n){for((l=Z())===n&&(l=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(x),41===t.charCodeAt(L)?(d=h,L++):d=n,d!==n?(m={type:\"scale\",sx:u},(p=l)&&(m.sy=p),e=[m]):(L=e,e=n)}else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,c,f,d,p,m,g=function(t){0===N&&$(t)};if(e=L,g(_),t.substr(L,6)===l?(r=l,L+=6):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=H())!==n){for((c=function(){var t,e,r;return t=L,Q()!==n&&(e=H())!==n&&Q()!==n&&(r=H())!==n?t=[e,r]:(L=t,t=n),t}())===n&&(c=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(x),41===t.charCodeAt(L)?(d=h,L++):d=n,d!==n?(m={type:\"rotate\",angle:u},(p=c)&&(m.cx=p[0],m.cy=p[1]),e=[m]):(L=e,e=n)}else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,c,l,d=function(t){0===N&&$(t)};if(e=L,d(S),t.substr(L,5)===f?(r=f,L+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(d(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=H())!==n){for(c=[],l=rt();l!==n;)c.push(l),l=rt();d(x),41===t.charCodeAt(L)?(l=h,L++):l=n,l!==n?e=[{type:\"skewX\",angle:u}]:(L=e,e=n)}else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,c,l,f=function(t){0===N&&$(t)};if(e=L,f(A),t.substr(L,5)===d?(r=d,L+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(f(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=H())!==n){for(c=[],l=rt();l!==n;)c.push(l),l=rt();f(x),41===t.charCodeAt(L)?(l=h,L++):l=n,l!==n?e=[{type:\"skewY\",angle:u}]:(L=e,e=n)}else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}()),e}function H(){var e,r,i,s;return e=L,r=L,(i=K())===n&&(i=null),(s=function(){var e,r,i;return e=L,(r=function(){var e,r,i,s,o,a,h;return o=E,0===N&&$(o),N++,e=L,(r=tt())===n&&(r=null),46===t.charCodeAt(L)?(i=\".\",L++):i=n,i!==n&&(s=tt())!==n?(h=s,e=[(a=r)?a.join(\"\"):null,\".\",h.join(\"\")].join(\"\")):(L=e,e=n),e===n&&(e=L,(r=tt())!==n?(46===t.charCodeAt(L)?(i=\".\",L++):i=n,i!==n?e=r.join(\"\"):(L=e,e=n)):(L=e,e=n)),N--,e}())!==n?((i=J())===n&&(i=null),e=[r,i||null].join(\"\")):(L=e,e=n),e===n&&(e=L,(r=tt())!==n&&(i=J())!==n?e=[r,i].join(\"\"):(L=e,e=n)),e}())!==n?r=i=[i,s]:(L=r,r=n),r!==n&&(r=parseFloat(r.join(\"\"))),(e=r)===n&&(e=L,r=L,(i=K())===n&&(i=null),(s=function(){var t;return L,(t=tt())!==n&&(t=t.join(\"\")),t}())!==n?r=i=[i,s]:(L=r,r=n),r!==n&&(r=parseInt(r.join(\"\"))),e=r),e}function Z(){var t,e;return t=L,Q()!==n&&(e=H())!==n?t=e:(L=t,t=n),t}function Q(){var t,e,r,i,s;if(t=L,e=[],(r=rt())!==n)for(;r!==n;)e.push(r),r=rt();else e=n;if(e!==n){for((r=W())===n&&(r=null),i=[],s=rt();s!==n;)i.push(s),s=rt();t=e=[e,r,i]}else L=t,t=n;if(t===n)if(t=L,(e=W())!==n){for(r=[],i=rt();i!==n;)r.push(i),i=rt();t=e=[e,r]}else L=t,t=n;return t}function W(){var e,r;return r=P,0===N&&$(r),44===t.charCodeAt(L)?(e=\",\",L++):e=n,e}function J(){var e,r,i,s,o;return e=L,o=O,0===N&&$(o),p.test(t.charAt(L))?(r=t.charAt(L),L++):r=n,r!==n?((i=K())===n&&(i=null),(s=tt())!==n?e=[\"e\",i,s.join(\"\")].join(\"\"):(L=e,e=n)):(L=e,e=n),e}function K(){var e,r;return r=I,0===N&&$(r),m.test(t.charAt(L))?(e=t.charAt(L),L++):e=n,e}function tt(){var t,e;if(t=[],(e=et())!==n)for(;e!==n;)t.push(e),e=et();else t=n;return t}function et(){var e,r;return r=R,0===N&&$(r),g.test(t.charAt(L))?(e=t.charAt(L),L++):e=n,e}function rt(){var e,r;return r=C,0===N&&$(r),y.test(t.charAt(L))?(e=t.charAt(L),L++):e=n,e}if(B.push({pos:L,variants:[]}),(r=s())!==n&&L===t.length)return r;throw r!==n&&L0){for(e=1,r=1;e{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r(625)})()}));","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import * as Urpflanze from './modules';\nexport { Urpflanze };\nexport default Urpflanze;\n//# sourceMappingURL=index.js.map"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@urpflanze/js/./dist/esm/modules.js","webpack://@urpflanze/js/./dist/esm/modules-light.js","webpack://@urpflanze/js/./dist/esm/core.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/Scene.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/SceneChild.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/Group.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeBase.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/index.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/common.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/mat2.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/mat2d.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/mat3.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/mat4.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/quat.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/vec4.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/vec3.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/quat2.js","webpack://@urpflanze/js/./node_modules/gl-matrix/esm/vec2.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/indexedBuffer.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/propArguments.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/repetitions.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/scene-child.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/scene.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/shape-base.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/shape-primitives.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/types/shapes.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/math/gl-matrix-extensions.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/math/Vec2.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/math/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Adapt.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Modifier.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/Utilities.js","webpack://@urpflanze/js/./node_modules/simplex-noise/simplex-noise.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/Shape.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapePrimitive.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeLoop.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeBuffer.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeRecursive.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeFollow.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Line.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Triangle.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Rect.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Polygon.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Circle.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Star.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Rose.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Spiral.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Lissajous.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/SuperShape.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Mirror.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Smooth.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Close.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Solidify.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Subdivide.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/dist/cjs/modifiers/Offset.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/types.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/utilities.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/createAnimation.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/createInterpolator.js","webpack://@urpflanze/js/./node_modules/@urpflanze/color/dist/cjs/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/color/dist/cjs/types.js","webpack://@urpflanze/js/./node_modules/@urpflanze/color/dist/cjs/conversions.js","webpack://@urpflanze/js/./node_modules/@urpflanze/color/dist/cjs/parsing.js","webpack://@urpflanze/js/./node_modules/@urpflanze/color/dist/cjs/htmlcolors.js","webpack://@urpflanze/js/./node_modules/bezier-easing/src/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/Easings.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/Animation.js","webpack://@urpflanze/js/./node_modules/@urpflanze/animation/dist/cjs/composeAnimations.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/browser/BrowserDrawerCanvas.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/DrawerCanvas.js","webpack://@urpflanze/js/./node_modules/canvas/browser.js","webpack://@urpflanze/js/./node_modules/canvas/lib/parse-font.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/Emitter.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/Timeline.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/utils.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/Renderer.js","webpack://@urpflanze/js/./node_modules/@ffmpeg/ffmpeg/src/index.js","webpack://@urpflanze/js/./node_modules/regenerator-runtime/runtime.js","webpack://@urpflanze/js/./node_modules/@ffmpeg/ffmpeg/src/createFFmpeg.js","webpack://@urpflanze/js/./node_modules/@ffmpeg/ffmpeg/src/config.js","webpack://@urpflanze/js/./node_modules/@ffmpeg/ffmpeg/src/utils/log.js","webpack://@urpflanze/js/./node_modules/@ffmpeg/ffmpeg/src/utils/parseProgress.js","webpack://@urpflanze/js/./node_modules/@ffmpeg/ffmpeg/src/utils/parseArgs.js","webpack://@urpflanze/js/./node_modules/@ffmpeg/ffmpeg/src/browser/index.js","webpack://@urpflanze/js/./node_modules/@ffmpeg/ffmpeg/src/browser/defaultOptions.js","webpack://@urpflanze/js/./node_modules/resolve-url/resolve-url.js","webpack://@urpflanze/js/./node_modules/@ffmpeg/ffmpeg/src/browser/getCreateFFmpegCore.js","webpack://@urpflanze/js/./node_modules/@ffmpeg/ffmpeg/src/browser/fetchFile.js","webpack://@urpflanze/js/./node_modules/jszip/dist/jszip.min.js","webpack://@urpflanze/js/./node_modules/@urpflanze/drawer-canvas/dist/cjs/browser/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/gcode-exporter/dist/cjs/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/gcode-exporter/dist/cjs/types.js","webpack://@urpflanze/js/./node_modules/@urpflanze/gcode-exporter/dist/cjs/GCODEExporter.js","webpack://@urpflanze/js/./node_modules/@urpflanze/core/build/umd/urpflanze.min.js","webpack://@urpflanze/js/./node_modules/simplify-js/simplify.js","webpack://@urpflanze/js/./node_modules/@urpflanze/gcode-exporter/dist/cjs/utilities.js","webpack://@urpflanze/js/./node_modules/@urpflanze/svg-exporter/dist/cjs/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/svg-exporter/dist/cjs/types.js","webpack://@urpflanze/js/./node_modules/@urpflanze/svg-exporter/dist/cjs/SVGExporter.js","webpack://@urpflanze/js/./node_modules/@urpflanze/svg-exporter/node_modules/@urpflanze/color/dist/index.js","webpack://@urpflanze/js/./node_modules/@urpflanze/svg-exporter/node_modules/@urpflanze/color/dist/types.js","webpack://@urpflanze/js/./node_modules/@urpflanze/svg-exporter/node_modules/@urpflanze/color/dist/conversions.js","webpack://@urpflanze/js/./node_modules/@urpflanze/svg-exporter/node_modules/@urpflanze/color/dist/parsing.js","webpack://@urpflanze/js/./node_modules/@urpflanze/svg-importer/build/umd/urpflanze-svg-importer.min.js","webpack://@urpflanze/js/webpack/bootstrap","webpack://@urpflanze/js/webpack/runtime/compat get default export","webpack://@urpflanze/js/webpack/runtime/define property getters","webpack://@urpflanze/js/webpack/runtime/global","webpack://@urpflanze/js/webpack/runtime/hasOwnProperty shorthand","webpack://@urpflanze/js/webpack/runtime/make namespace object","webpack://@urpflanze/js/./dist/esm/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAgC;AACmB;AACoB;AACJ;AACJ;AACT;AACtD,mC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACNuB;AACoC;AACyD;AACpH,yC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACH+C;AACK;AACL;AACW;AACK;AACL;AACE;AACN;AACS;AACH;AACI;AACI;AACJ;AACG;AACD;AACF;AACA;AACE;AACG;AACC;AACV;AACT;AACiN;AAC/L;AACF;AACnE,gC;;;;;;;ACzBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,qBAAqB,mBAAO,CAAC,CAAc;AAC3C,gBAAgB,mBAAO,CAAC,CAAS;AACjC,gBAAgB,mBAAO,CAAC,EAAgB;AACxC,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB;AACpC,eAAe,WAAW;AAC1B,eAAe,4BAA4B;AAC3C,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,qBAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACxVa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,eAAe,cAAc;AAC7B,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0EAA0E;AACzF,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sC;;;;;;;AClGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,gBAAgB,mBAAO,CAAC,CAAS;AACjC,qBAAqB,mBAAO,CAAC,CAAc;AAC3C,oBAAoB,mBAAO,CAAC,CAAoB;AAChD,gBAAgB,mBAAO,CAAC,EAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,SAAS;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACxTa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,oBAAoB,mBAAO,CAAC,CAAW;AACvC,gBAAgB,mBAAO,CAAC,EAAU;AAClC,aAAa,mBAAO,CAAC,EAA8B;AACnD,eAAe,mBAAO,CAAC,EAAc;AACrC,eAAe,mBAAO,CAAC,EAAS;AAChC,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,oBAAoB,mBAAO,CAAC,EAAc;AAC1C,qBAAqB,mBAAO,CAAC,CAAe;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,cAAc;AAC7B,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0EAA0E;AACzF,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,2CAA2C;AACrF,8CAA8C,2CAA2C;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,4BAA4B;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,SAAS;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;AACA,mEAAmE,SAAS;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,gCAAgC;AAClD,kBAAkB,gCAAgC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzgBwC;AACN;AACE;AACF;AACA;AACA;AACE;AACF;AACA;AACA;;;;;;;;;;;;;;;;;ACTlC;AACA;AACA;AACA;AACA;AACO;AACA;AACA;AACP;AACA;AACA;AACA,WAAW,2CAA2C;AACtD;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjDwC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA,gBAAgB;;AAEhB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AAC7S;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC/aiC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACvd;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACreiC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACttB;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzwBiC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY,+CAAgB;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA,YAAY,+CAAgB;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP,wBAAwB,kDAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;;AAExD;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,YAAY,KAAK;AACjB;;AAEO;AACP,oBAAoB,kDAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,+CAAgB,+BAA+B,+CAAgB,+BAA+B,+CAAgB;AAC/I;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,uEAAuE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB;AAC/zC;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrxDiC;AACN;AACA;AACA;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,OAAO;AACnB;;AAEO;AACP;AACA;;AAEA,UAAU,+CAAgB;AAC1B;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,aAAa;AACzB,YAAY,aAAa;AACzB,YAAY,OAAO;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;;AAE1C,gDAAgD;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH,oBAAoB,+CAAgB;AACpC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA,WAAW,8CAAe;AAC1B,WAAW,8CAAe;AAC1B,WAAW,8CAAe;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,mCAAmC;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAoC;;AAEpC;AACA,wBAAwB;;AAExB;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,EAAE;AACb,WAAW,EAAE;AACb,WAAW,EAAE;AACb,aAAa,KAAK;AAClB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,YAAY,2CAAU;AAC7B;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,iBAAiB,gDAAe;AACvC;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,WAAW,0CAAS;AAC3B;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,YAAY,2CAAU;AAC7B;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,WAAW,0CAAS;AAC3B;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO,aAAa,4CAAW;AAC/B;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;AACA;;AAEO,oBAAoB,mDAAkB;AAC7C;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,gBAAgB,+CAAc;AACrC;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO,kBAAkB,iDAAgB;AACzC;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO,aAAa,4CAAW;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,4CAAW;AAC3B,kBAAkB,gDAAe;AACjC,kBAAkB,gDAAe;AACjC;AACA,cAAc,yCAAQ;;AAEtB;AACA,MAAM,2CAAU;AAChB,UAAU,yCAAQ,sBAAsB,2CAAU;AAClD,MAAM,+CAAc;AACpB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,MAAM,2CAAU;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,aAAa,4CAAW;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrsBuC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,uBAAuB;AACvB;AACA;;AAEA;AACA;;AAEA;AACA,SAAS,8CAAe;AACxB,SAAS,8CAAe;AACxB;AACA,GAAG;;AAEH;AACA,SAAS,8CAAe;AACxB,SAAS,8CAAe;AACxB;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;;AAEhB;AACA;AACA;AACA,qCAAqC;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AAC7S;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtpBuC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,UAAU,8CAAe;AACzB,UAAU,8CAAe;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;;AAEA;AACA;AACA,4BAA4B;;AAE5B;AACA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA,YAAY;;AAEZ;AACA;AACA,YAAY;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACxN;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClxBuC;AACN;AACA;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;;AAEO;AACP,eAAe,kDAAmB;;AAElC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA,cAAc,4CAAW;AACzB,EAAE,iDAAgB;AAClB,cAAc,kDAAmB;AACjC,EAAE,oDAAmB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO,cAAc,0CAAS;AAC9B;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO,cAAc,0CAAS;AAC9B;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA,sBAAsB,+CAAgB;AACtC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,aAAa,4CAAW;AAC/B;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,oBAAoB,mDAAkB;AAC7C;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACjoB,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACl0BwC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,UAAU,8CAAe;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA,2BAA2B;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;;AAE5C;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB;AACnI;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;AC/mBY;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAiB;AACtC,aAAa,mBAAO,CAAC,EAAiB;AACtC,aAAa,mBAAO,CAAC,EAAe;AACpC,aAAa,mBAAO,CAAC,EAAe;AACpC,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAc;AACnC,aAAa,mBAAO,CAAC,EAAoB;AACzC,aAAa,mBAAO,CAAC,EAAU;AAC/B,iC;;;;;;;ACpBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD,uBAAuB,KAAK;AAC7E,uC;;;;;;;ACxBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C,qBAAqB,KAAK;AACvE,sC;;;;;;;AChBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA,4C;;;;;;;ACHa;AACb;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kC;;;;;;;ACHa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc,GAAG,cAAc,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,iBAAiB;AAChI,oBAAoB,mBAAO,CAAC,CAAW;AACvC,iBAAiB;AACjB,gBAAgB;AAChB,iBAAiB;AACjB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,gD;;;;;;;AC5Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,gBAAgB;AAChB;AACA,6BAA6B,OAAO,OAAO,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,gC;;;;;;;ACpNa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,iC;;;;;;;AClCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,GAAG,gBAAgB,GAAG,kBAAkB;AACrD,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC,kBAAkB,KAAK;AAC9D;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6BAA6B;AAC5C,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,iC;;;;;;;ACrKa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB;AACA;AACA,gBAAgB;AAChB,oC;;;;;;;ACNa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gCAAgC,GAAG,mBAAmB,GAAG,qCAAqC,GAAG,8BAA8B,GAAG,4BAA4B,GAAG,2BAA2B,GAAG,cAAc,GAAG,aAAa,GAAG,qBAAqB,GAAG,aAAa,GAAG,YAAY,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,WAAW;AAC1U,qBAAqB,mBAAO,CAAC,EAAe;AAC5C,sBAAsB,mBAAO,CAAC,EAAqB;AACnD,eAAe,mBAAO,CAAC,EAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,mBAAmB,iBAAiB;AACpC,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,gBAAgB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA,4BAA4B,qBAAqB;AACjD;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,eAAe;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yBAAyB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC,qC;;;;;;ACxWA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA,qBAAqB;AACrB;AACA,wBAAwB;AACxB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,4BAA4B;AAC5B;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,kCAAkC;AAClC;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA,6BAA6B;AAC7B;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA,mCAAmC;AACnC,qBAAqB;AACrB;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,yBAAyB;AACzB,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,iBAAiB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,gDAAgD;AAChD;AACA;;AAEA;AACA,MAAM,IAA2C,EAAE,mCAAO,YAAY,qBAAqB;AAAA,kGAAC;AAC5F;AACA,MAAM,IAA8B,EAAE,oBAAoB;AAC1D;AACA,OAAO,EAAsE;AAC7E;AACA,MAAM,IAA6B;AACnC;AACA;;AAEA,CAAC;;;;;;;;ACxdY;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,gBAAgB,mBAAO,CAAC,CAAU;AAClC,qBAAqB,mBAAO,CAAC,CAAe;AAC5C,oBAAoB,mBAAO,CAAC,CAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc,aAAa;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA,4DAA4D,SAAS;AACrE,wCAAwC;AACxC;AACA;AACA;AACA,yCAAyC,4BAA4B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,aAAa;AAC5B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACnLa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,sBAAsB;AACtB,aAAa,mBAAO,CAAC,EAA8B;AACnD,oBAAoB,mBAAO,CAAC,CAAa;AACzC,mBAAmB,mBAAO,CAAC,EAAuB;AAClD,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB,aAAa;AACpD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,0C;;;;;;;ACjJa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,eAAe,mBAAO,CAAC,EAAS;AAChC,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,yBAAyB,mBAAO,CAAC,EAA0B;AAC3D,oBAAoB,mBAAO,CAAC,CAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB,aAAa;AAC/C,eAAe,QAAQ;AACvB;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB;AACA;AACA;AACA,iDAAiD,eAAe;AAChE,sDAAsD,QAAQ;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA,eAAe,6BAA6B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,kBAAkB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,eAAe,sBAAsB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,8CAA8C;AAC9E;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,qC;;;;;;;AChOa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB;AACnB,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,yBAAyB,mBAAO,CAAC,EAA0B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB,aAAa;AACjD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,gCAAgC,8CAA8C;AAC9E;AACA;AACA;AACA;AACA,mBAAmB;AACnB,uC;;;;;;;ACnIa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,sBAAsB;AACtB,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB,aAAa;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,qDAAqD;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,6BAA6B;AACpD;AACA;AACA;AACA;AACA,sCAAsC,+BAA+B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iIAAiI,6DAA6D;AAC9L;AACA;AACA;AACA;AACA,4BAA4B,uEAAuE;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,SAAS;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,4BAA4B,8DAA8D;AAC1F,iBAAiB;AACjB;AACA;AACA,mFAAmF,gCAAgC;AACnH,wCAAwC;AACxC;AACA;AACA;AACA;AACA,4BAA4B,8DAA8D;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,oEAAoE,4BAA4B,iBAAiB,EAAE;AACnH;AACA;AACA;AACA,+BAA+B,gBAAgB;AAC/C;AACA,2DAA2D,SAAS;AACpE;AACA,+FAA+F,gCAAgC;AAC/H,oDAAoD;AACpD;AACA;AACA;AACA;AACA,wCAAwC,wDAAwD;AAChG;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;AACA,qDAAqD,4BAA4B;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA,sBAAsB;AACtB,0C;;;;;;;AChUa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB;AACnB,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB,aAAa;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,uDAAuD;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,SAAS;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,mFAAmF,gCAAgC;AACnH,uEAAuE,iCAAiC,4BAA4B,iBAAiB,EAAE;AACvJ,kDAAkD,SAAS;AAC3D;AACA,2FAA2F,gCAAgC;AAC3H,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA,iDAAiD,4BAA4B;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA,mBAAmB;AACnB,uC;;;;;;;AC3Na;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,YAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,SAAS;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,gC;;;;;;;AC5Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA,oC;;;;;;;AC1Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,gC;;;;;;;AC3Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,mC;;;;;;;ACxCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACpCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ,gC;;;;;;;AClDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc,aAAa;AAC1C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ,gC;;;;;;;ACtEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe,aAAa;AAC3C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kC;;;;;;;AC5Fa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB,aAAa;AAC/C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,qC;;;;;;;ACtDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB;AAClB,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sC;;;;;;;AC9Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,gBAAgB,mBAAO,CAAC,EAAS;AACjC,iBAAiB,mBAAO,CAAC,EAAU;AACnC,iBAAiB,mBAAO,CAAC,EAAU;AACnC,mBAAmB,mBAAO,CAAC,EAAY;AACvC,oBAAoB,mBAAO,CAAC,EAAa;AACzC,gBAAgB,mBAAO,CAAC,EAAS;AACjC,iBAAiB,mBAAO,CAAC,EAAU;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,iC;;;;;;;ACpBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACtDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,oBAAoB,mBAAO,CAAC,EAAc;AAC1C,gBAAgB,mBAAO,CAAC,EAAS;AACjC,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,SAAS;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACvEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;AC3Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,oC;;;;;;;ACvHa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,WAAW;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,qC;;;;;;;ACxDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,wBAAwB,yBAAyB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACfa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAa;AAClC,aAAa,mBAAO,CAAC,EAAmB;AACxC,aAAa,mBAAO,CAAC,EAAsB;AAC3C,aAAa,mBAAO,CAAC,EAAW;AAChC,aAAa,mBAAO,CAAC,EAAa;AAClC,iC;;;;;;;AClBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,2BAA2B,GAAG,2BAA2B,GAAG,YAAY,GAAG,YAAY,GAAG,mBAAmB,GAAG,aAAa;AAC7H;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,mBAAmB;AAC9B,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,EAAE,GAAG,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,mBAAmB;AAC9B,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,mBAAmB,cAAc,GAAG,cAAc,GAAG,cAAc,GAAG,MAAM;AAC5E;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA,mBAAmB,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,MAAM;AAC1C;AACA,2BAA2B;AAC3B,qC;;;;;;;AC9Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uBAAuB;AACvB,6BAA6B,mBAAO,CAAC,EAAsB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8DAA8D;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2C;;;;;;;ACpGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,0BAA0B,GAAG,mCAAmC;AAChE,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,wBAAwB,mBAAO,CAAC,EAAe;AAC/C,kBAAkB,mBAAO,CAAC,EAAW;AACrC,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,8C;;;;;;;ACxGa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAe;AACpC,aAAa,mBAAO,CAAC,EAAW;AAChC,iC;;;;;;;ACfa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6DAA6D;AAC5E;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,uC;;;;;;;ACzFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB,GAAG,4BAA4B;AACjD,qBAAqB,mBAAO,CAAC,EAAc;AAC3C,sBAAsB,mBAAO,CAAC,EAAe;AAC7C;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,6BAA6B,IAAI;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,mC;;;;;;;AC1Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,sC;;;;;;AClJA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,uBAAuB,oCAAoC;AAC3D,uBAAuB,8BAA8B;AACrD,uBAAuB,kBAAkB;;AAEzC;AACA,oCAAoC,8DAA8D;;AAElG;AACA,kCAAkC,sEAAsE;;AAExG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;;AAEA;AACA;AACA;AACA;;AAEA,UAAU,mEAAmE;AAC7E;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe;AACf,mC;;;;;;;AChca;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,wBAAwB,GAAG,cAAc,GAAG,YAAY,GAAG,eAAe,GAAG,cAAc,GAAG,8BAA8B;AAC5H,4BAA4B,mBAAO,CAAC,EAAqB;AACzD,0BAA0B,mBAAO,CAAC,EAAmB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB,qC;;;;;;;ACpEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yBAAyB;AACzB,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,0BAA0B,mBAAO,CAAC,EAAmB;AACrD,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA,WAAW,wBAAwB;AACnC,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6C;;;;;;;ACxDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,2BAA2B;AAC3B,uBAAuB,mBAAO,CAAC,EAAiB;AAChD,gBAAgB,mBAAO,CAAC,EAAU;AAClC;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,+C;;;;;;;AChGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,oBAAoB;AACpB,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,oBAAoB,mBAAO,CAAC,EAAoC;AAChE,eAAe,mBAAO,CAAC,EAA+B;AACtD,eAAe,mBAAO,CAAC,EAAoC;AAC3D,iBAAiB,mBAAO,CAAC,EAAQ;AACjC,kBAAkB,mBAAO,CAAC,EAAW;AACrC,mBAAmB,mBAAO,CAAC,EAAY;AACvC,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6BAA6B;AAC5C,eAAe,wBAAwB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,2BAA2B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,0BAA0B;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qGAAqG,uCAAuC;AAC5I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,KAAK;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oGAAoG,OAAO;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,eAAe,QAAQ;AACvB,eAAe,qBAAqB;AACpC,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB,eAAe,OAAO;AACtB,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW;AAC7E,8BAA8B,SAAS,GAAG,SAAS,IAAI,SAAS,IAAI,WAAW;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,wC;;;;;;ACvXA;;AAEA,kBAAkB,mBAAO,CAAC,EAAkB;;AAE5C,iBAAiB;;AAEjB,oBAAoB;AACpB,0DAA0D,+BAA+B;AACzF;;AAEA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA;AACA;;AAEA,gCAAgC,WAAW;AAC3C,iCAAiC,WAAW;;AAE5C;AACA,GAAG;AACH;;;;;;;;AClCY;;AAEZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACrGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,6CAA6C;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,8CAA8C;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,6BAA6B;AAC5C;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,mC;;;;;;;AC3Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,oBAAoB,mBAAO,CAAC,EAAoC;AAChE,eAAe,mBAAO,CAAC,EAA+B;AACtD,kBAAkB,mBAAO,CAAC,EAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,2BAA2B,aAAa;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oC;;;;;;;ACxRa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,eAAe,GAAG,gBAAgB,GAAG,aAAa;AAChE,aAAa;AACb;AACA;AACA,gBAAgB;AAChB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,+BAA+B;AAC1C,YAAY,EAAE,IAAI,WAAW,WAAW,eAAe,gBAAgB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,iC;;;;;;;AClDa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAY;AACjC,aAAa,mBAAO,CAAC,EAAgB;AACrC,aAAa,mBAAO,CAAC,EAA+B;AACpD,aAAa,mBAAO,CAAC,EAAY;AACjC,iC;;;;;;;AChBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,iBAAiB,mBAAO,CAAC,EAAgB;AACzC,oBAAoB,mBAAO,CAAC,EAAoC;AAChE,cAAc,mBAAO,CAAC,EAAO;AAC7B,kBAAkB,mBAAO,CAAC,EAAW;AACrC,kBAAkB,mBAAO,CAAC,EAAW;AACrC,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,sCAAsC;AACnF;AACA;AACA;AACA,yCAAyC,gBAAgB;AACzD,oCAAoC,6BAA6B;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,mDAAmD,qBAAqB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,yCAAyC;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,yCAAyC;AACxF,2BAA2B,qBAAqB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,mFAAmF;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,gBAAgB;AAChB,oC;;;;;;ACnRA,mBAAO,CAAC,EAA6B;AACrC,qBAAqB,mBAAO,CAAC,EAAgB;AAC7C,OAAO,YAAY,GAAG,mBAAO,CAAC,EAAQ;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,wBAAwB;AACxB;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,KAAK;AACL,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;;AAEA;AACA;AACA,wCAAwC,WAAW;AACnD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA,2BAA2B;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,SAAS;AACT;AACA;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC,cAAc;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,kBAAkB;AACnD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA,iBAAiB;;AAEjB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,8CAA8C,QAAQ;AACtD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA,WAAW;AACX;AACA;AACA;;AAEA,WAAW;AACX;AACA;AACA;;AAEA,WAAW;AACX;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,8CAA8C,QAAQ;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA,KAAK;;AAEL;AACA,8CAA8C,QAAQ;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,8CAA8C,QAAQ;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,CAAC;AACD;AACA;AACA;AACA;AACA,EAAE,KAA0B,oBAAoB,CAAE;AAClD;;AAEA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;;;;;;ACjvBA,OAAO,2BAA2B,GAAG,mBAAO,CAAC,EAAU;AACvD,OAAO,mCAAmC,GAAG,mBAAO,CAAC,EAAa;AAClE,sBAAsB,mBAAO,CAAC,EAAuB;AACrD,kBAAkB,mBAAO,CAAC,EAAmB;AAC7C,OAAO,sCAAsC,GAAG,mBAAO,CAAC,EAAQ;AAChE,OAAO,UAAU,GAAG,mBAAO,CAAC,EAAiB;;AAE7C;;AAEA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,gBAAgB;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,yBAAyB;AACtE,0CAA0C,yBAAyB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,gBAAgB;AACvD;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,OAAO,GAAG,uDAAuD,WAAW,iCAAiC;AACvI;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA,+CAA+C,QAAQ;AACvD,SAAS;AACT,gDAAgD,QAAQ;AACxD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,kCAAkC,QAAQ;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AClNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,gBAAgB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;ACjDA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,gBAAgB,gBAAgB;AAChC;AACA,oBAAoB,KAAK,IAAI,QAAQ;AACrC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACvBA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB,qBAAqB;AACrC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,gBAAgB,iBAAiB;AACjC,KAAK;AACL,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;;;;;ACRA,uBAAuB,mBAAO,CAAC,EAAkB;AACjD,4BAA4B,mBAAO,CAAC,EAAuB;AAC3D,kBAAkB,mBAAO,CAAC,EAAa;;AAEvC;AACA;AACA;AACA;AACA;;;;;;;ACRA,mBAAmB,mBAAO,CAAC,EAAa;AACxC,OAAO,kBAAkB,GAAG,mBAAO,CAAC,EAAoB;;AAExD;AACA;AACA;AACA;AACA,YAAY,KAAsC;AAClD;AACA,MAAM,CAAoG;AAC1G;;;;;;;ACVA;AACA;;AAEA;AACA,MAAM,IAA0C;AAChD,IAAI,oCAAO,OAAO;AAAA;AAAA;AAAA;AAAA,kGAAC;AACnB,GAAG,MAAM,EAIN;AACH,CAAC;;AAED;AACA;;AAEA;AACA,iEAAiE;AACjE;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,CAAC;;;;;;;;;;;;;;AC9CD;AACA,mBAAmB,mBAAO,CAAC,EAAa;AACxC,OAAO,MAAM,GAAG,mBAAO,CAAC,EAAc;;AAEtC;AACA;AACA;AACA;AACA;AACA,uBAAuB,IAAI;AAC3B;AACA,iBAAiB,IAAI,eAAe,eAAe;AACnD,gCAAgC,iBAAiB;AACjD;AACA,iBAAiB,IAAI,cAAc,QAAQ;AAC3C;AACA;;AAEA,yBAAyB,sBAAsB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;AC7DA,mBAAmB,mBAAO,CAAC,EAAa;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,UAAU,SAAS,OAAO,EAAE,EAAE;AACzD,mDAAmD,KAAK;AACxD;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;;;;;;ACtCA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,aAAa,GAAG,IAAoD,oBAAoB,KAAK,EAA8K,CAAC,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,MAAM,SAAmC,CAAC,gBAAgB,OAAC,OAAO,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,iBAAiB,eAAe,sBAAsB,oBAAoB,UAAU,SAAmC,KAAK,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,0GAA0G,qBAAqB,0EAA0E,WAAW,+OAA+O,kBAAkB,sBAAsB,wBAAwB,2GAA2G,2DAA2D,yJAAyJ,sDAAsD,WAAW,kMAAkM,UAAU,EAAE,4BAA4B,qBAAqB,aAAa,4GAA4G,sBAAsB,uGAAuG,aAAa,4BAA4B,mIAAmI,6BAA6B,6GAA6G,IAAI,gCAAgC,yPAAyP,oCAAoC,6IAA6I,aAAa,EAAE,+FAA+F,qBAAqB,aAAa,kCAAkC,SAAS,wCAAwC,kCAAkC,6BAA6B,qCAAqC,wBAAwB,EAAE,wCAAwC,qBAAqB,aAAa,gCAAgC,mBAAmB,MAAM,KAAK,IAAI,YAAY,IAAI,iCAAiC,OAAO,SAAS,GAAG,wBAAwB,sEAAsE,cAAc,MAAM,YAAY,IAAI,4BAA4B,WAAW,iCAAiC,cAAc,MAAM,YAAY,IAAI,uCAAuC,WAAW,oBAAoB,EAAE,aAAa,qBAAqB,aAAa,yKAAyK,GAAG,qBAAqB,aAAa,MAAM,0DAA0D,WAAW,EAAE,OAAO,qBAAqB,aAAa,yLAAyL,gBAAgB,kGAAkG,oEAAoE,mGAAmG,8BAA8B,0FAA0F,gCAAgC,+CAA+C,oCAAoC,oCAAoC,yCAAyC,EAAE,WAAW,8BAA8B,QAAQ,mBAAmB,GAAG,8BAA8B,0BAA0B,+BAA+B,yBAAyB,GAAG,EAAE,iDAAiD,qBAAqB,aAAa,gBAAgB,WAAW,QAAQ,IAAI,yCAAyC,SAAS,wBAAwB,gTAAgT,6CAA6C,iGAAiG,QAAQ,+BAA+B,cAAc,wXAAwX,SAAS,iKAAiK,4HAA4H,sGAAsG,oBAAoB,iRAAiR,6CAA6C,mEAAmE,yGAAyG,kBAAkB,8DAA8D,GAAG,sCAAsC,wEAAwE,oCAAoC,MAAM,8EAA8E,WAAW,wBAAwB,WAAW,EAAE,wBAAwB,sCAAsC,mBAAmB,gHAAgH,kDAAkD,8FAA8F,aAAa,EAAE,oBAAoB,wBAAwB,WAAW,EAAE,0BAA0B,uCAAuC,sBAAsB,8BAA8B,gCAAgC,yBAAyB,eAAe,8BAA8B,aAAa,EAAE,iOAAiO,WAAW,aAAa,aAAa,EAAE,0CAA0C,2IAA2I,0CAA0C,sBAAsB,WAAW,+BAA+B,kBAAkB,wBAAwB,sFAAsF,2BAA2B,WAAW,OAAO,+BAA+B,4LAA4L,+BAA+B,oBAAoB,4CAA4C,YAAY,WAAW,QAAQ,cAAc,UAAU,SAAS,6BAA6B,4BAA4B,4BAA4B,WAAW,gBAAgB,aAAa,EAAE,uFAAuF,qBAAqB,aAAa,kDAAkD,iCAAiC,6DAA6D,IAAI,wBAAwB,IAAI,oBAAoB,kBAAkB,gEAAgE,SAAS,8FAA8F,kBAAkB,8CAA8C,4GAA4G,UAAU,mBAAmB,SAAS,WAAW,UAAU,EAAE,wCAAwC,sBAAsB,aAAa,aAAa,qCAAqC,sIAAsI,aAAa,sDAAsD,YAAY,6DAA6D,UAAU,kJAAkJ,6BAA6B,wCAAwC,EAAE,uEAAuE,sBAAsB,aAAa,uHAAuH,cAAc,mCAAmC,oDAAoD,yBAAyB,KAAK,sBAAsB,6FAA6F,WAAW,EAAE,wBAAwB,WAAW,uBAAuB,EAAE,8FAA8F,6MAA6M,eAAe,mBAAmB,mBAAmB,uCAAuC,4BAA4B,WAAW,oBAAoB,wBAAwB,mBAAmB,kCAAkC,WAAW,KAAK,WAAW,qCAAqC,+MAA+M,EAAE,uDAAuD,GAAG,EAAE,sGAAsG,sBAAsB,aAAa,mDAAmD,gBAAgB,6FAA6F,oDAAoD,WAAW,iDAAiD,QAAQ,aAAa,WAAW,EAAE,yBAAyB,4CAA4C,sBAAsB,uCAAuC,EAAE,8BAA8B,gEAAgE,+BAA+B,iGAAiG,aAAa,EAAE,2CAA2C,sBAAsB,aAAa,oCAAoC,kBAAkB,8BAA8B,WAAW,0BAA0B,qCAAqC,yBAAyB,kBAAkB,sBAAsB,aAAa,EAAE,yDAAyD,sBAAsB,aAAa,EAAE,mCAAmC,sBAAsB,aAAa,WAAW,8DAA8D,sEAAsE,kFAAkF,uBAAuB,yBAAyB,uCAAuC,oBAAoB,mBAAmB,sBAAsB,0BAA0B,sBAAsB,6FAA6F,GAAG,sBAAsB,aAAa,kBAAkB,uCAAuC,IAAI,yUAAyU,iDAAiD,yBAAyB,+BAA+B,wBAAwB,mDAAmD,6SAA6S,mBAAmB,gBAAgB,cAAc,oCAAoC,2PAA2P,gFAAgF,uBAAuB,iBAAiB,cAAc,4DAA4D,OAAO,gBAAgB,8FAA8F,qBAAqB,UAAU,4JAA4J,oBAAoB,SAAS,kCAAkC,kBAAkB,IAAI,sBAAsB,qEAAqE,SAAS,QAAQ,iCAAiC,wBAAwB,EAAE,8BAA8B,wBAAwB,oBAAoB,kBAAkB,yCAAyC,wBAAwB,EAAE,kDAAkD,uBAAuB,oBAAoB,cAAc,oBAAoB,mFAAmF,yCAAyC,oCAAoC,MAAM,WAAW,iCAAiC,YAAY,sBAAsB,8FAA8F,oCAAoC,WAAW,IAAI,oBAAoB,EAAE,sJAAsJ,uKAAuK,+KAA+K,kCAAkC,6BAA6B,SAAS,4BAA4B,4CAA4C,6BAA6B,oDAAoD,kCAAkC,cAAc,iFAAiF,YAAY,EAAE,gNAAgN,sBAAsB,sBAAsB,EAAE,cAAc,sBAAsB,aAAa,wBAAwB,cAAc,eAAe,YAAY,mBAAmB,kBAAkB,2DAA2D,8BAA8B,8CAA8C,gGAAgG,KAAK,uGAAuG,SAAS,+CAA+C,+FAA+F,8CAA8C,kCAAkC,sCAAsC,mEAAmE,uBAAuB,aAAa,EAAE,gCAAgC,sBAAsB,aAAa,oBAAoB,cAAc,0DAA0D,aAAa,wBAAwB,8BAA8B,wBAAwB,6IAA6I,sBAAsB,gCAAgC,kBAAkB,4BAA4B,qBAAqB,qBAAqB,UAAU,yCAAyC,cAAc,4BAA4B,uBAAuB,wBAAwB,gDAAgD,uBAAuB,mCAAmC,oCAAoC,qBAAqB,sBAAsB,8FAA8F,aAAa,EAAE,cAAc,sBAAsB,aAAa,8BAA8B,cAAc,eAAe,6DAA6D,oBAAoB,mEAAmE,uBAAuB,aAAa,EAAE,sCAAsC,sBAAsB,aAAa,wBAAwB,cAAc,eAAe,2DAA2D,yCAAyC,8CAA8C,0CAA0C,+CAA+C,4BAA4B,kCAAkC,oBAAoB,mEAAmE,uBAAuB,aAAa,EAAE,gCAAgC,sBAAsB,aAAa,yBAAyB,cAAc,eAAe,6DAA6D,sDAAsD,sEAAsE,uBAAuB,aAAa,EAAE,iCAAiC,sBAAsB,aAAa,qIAAqI,sBAAsB,qBAAqB,0KAA0K,EAAE,qHAAqH,sBAAsB,aAAa,+LAA+L,GAAG,sBAAsB,aAAa,2CAA2C,cAAc,mDAAmD,qDAAqD,WAAW,qDAAqD,EAAE,aAAa,EAAE,mCAAmC,sBAAsB,aAAa,2CAA2C,aAAa,yDAAyD,iEAAiE,sEAAsE,aAAa,EAAE,gDAAgD,sBAAsB,aAAa,2CAA2C,cAAc,+EAA+E,qDAAqD,MAAM,wCAAwC,+CAA+C,sCAAsC,aAAa,EAAE,mCAAmC,sBAAsB,aAAa,2CAA2C,cAAc,0BAA0B,WAAW,kHAAkH,oGAAoG,aAAa,WAAW,EAAE,+CAA+C,8CAA8C,+BAA+B,kJAAkJ,uCAAuC,qJAAqJ,8BAA8B,2CAA2C,iDAAiD,0CAA0C,kBAAkB,iDAAiD,MAAM,oDAAoD,MAAM,6DAA6D,+BAA+B,aAAa,4CAA4C,EAAE,aAAa,EAAE,mCAAmC,sBAAsB,aAAa,cAAc,yCAAyC,iDAAiD,uEAAuE,wBAAwB,oBAAoB,aAAa,iBAAiB,oBAAoB,gBAAgB,4BAA4B,aAAa,IAAI,mDAAmD,SAAS,qBAAqB,SAAS,mBAAmB,gKAAgK,kBAAkB,uCAAuC,oBAAoB,iFAAiF,oBAAoB,kCAAkC,4BAA4B,uCAAuC,kBAAkB,gCAAgC,8BAA8B,iFAAiF,oEAAoE,WAAW,+BAA+B,kBAAkB,wBAAwB,QAAQ,2BAA2B,WAAW,OAAO,kBAAkB,mGAAmG,mBAAmB,4CAA4C,uBAAuB,4GAA4G,mBAAmB,0BAA0B,aAAa,8BAA8B,6DAA6D,4BAA4B,uHAAuH,iBAAiB,iFAAiF,qDAAqD,qBAAqB,0BAA0B,+CAA+C,aAAa,GAAG,sBAAsB,aAAa,+HAA+H,oBAAoB,2CAA2C,UAAU,kBAAkB,QAAQ,UAAU,4CAA4C,MAAM,wBAAwB,IAAI,kHAAkH,SAAS,mDAAmD,aAAa,uBAAuB,8CAA8C,yDAAyD,0BAA0B,kBAAkB,yBAAyB,UAAU,sBAAsB,IAAI,sBAAsB,UAAU,8DAA8D,gCAAgC,mCAAmC,iBAAiB,qBAAqB,QAAQ,WAAW,mBAAmB,UAAU,+BAA+B,sDAAsD,6CAA6C,WAAW,iCAAiC,SAAS,yCAAyC,8DAA8D,SAAS,KAAK,SAAS,KAAK,KAAK,WAAW,EAAE,QAAQ,kBAAkB,WAAW,+CAA+C,wBAAwB,+BAA+B,uBAAuB,OAAO,mBAAmB,yDAAyD,kBAAkB,iCAAiC,4BAA4B,qIAAqI,mBAAmB,2CAA2C,KAAK,aAAa,EAAE,+IAA+I,sBAAsB,aAAa,kPAAkP,KAAK,yBAAyB,IAAI,yBAAyB,uBAAuB,OAAO,SAAS,IAAI,6FAA6F,yDAAyD,SAAS,YAAY,IAAI,6CAA6C,SAAS,iBAAiB,EAAE,qBAAqB,sBAAsB,aAAa,gHAAgH,MAAM,wDAAwD,aAAa,+CAA+C,aAAa,4BAA4B,yCAAyC,2DAA2D,6BAA6B,QAAQ,IAAI,2JAA2J,wDAAwD,IAAI,6QAA6Q,SAAS,IAAI,0BAA0B,gFAAgF,wCAAwC,UAAU,IAAI,4BAA4B,uCAAuC,KAAK,2BAA2B,SAAS,sBAAsB,yFAAyF,sFAAsF,uDAAuD,sDAAsD,8DAA8D,wCAAwC,iBAAiB,QAAQ,qGAAqG,+BAA+B,mBAAmB,oBAAoB,MAAM,iDAAiD,sBAAsB,KAAK,qCAAqC,QAAQ,oJAAoJ,iCAAiC,EAAE,8BAA8B,iDAAiD,yCAAyC,sBAAsB,2EAA2E,WAAW,sCAAsC,EAAE,sBAAsB,EAAE,2EAA2E,sBAAsB,aAAa,sGAAsG,cAAc,SAAS,gBAAgB,YAAY,WAAW,6BAA6B,SAAS,wBAAwB,uBAAuB,IAAI,qBAAqB,OAAO,EAAE,SAAS,IAAI,6FAA6F,gCAAgC,SAAS,sDAAsD,OAAO,iCAAiC,wBAAwB,iDAAiD,KAAK,IAAI,6KAA6K,kBAAkB,6BAA6B,iBAAiB,WAAW,iCAAiC,SAAS,iBAAiB,sBAAsB,IAAI,kFAAkF,SAAS,UAAU,yBAAyB,IAAI,iFAAiF,SAAS,UAAU,KAAK,cAAc,kCAAkC,2GAA2G,IAAI,KAAK,iCAAiC,SAAS,kBAAkB,4BAA4B,gBAAgB,YAAY,WAAW,cAAc,SAAS,sBAAsB,SAAS,UAAU,2BAA2B,gCAAgC,yBAAyB,qCAAqC,wBAAwB,qCAAqC,wBAAwB,qCAAqC,UAAU,yCAAyC,gCAAgC,wBAAwB,yBAAyB,wBAAwB,2BAA2B,gBAAgB,mBAAmB,4BAA4B,mBAAmB,oDAAoD,sCAAsC,yBAAyB,wBAAwB,2CAA2C,eAAe,2BAA2B,gCAAgC,yBAAyB,gBAAgB,qCAAqC,2BAA2B,eAAe,2BAA2B,gCAAgC,yBAAyB,yCAAyC,wBAAwB,qCAAqC,cAAc,6BAA6B,uBAAuB,kBAAkB,qBAAqB,kBAAkB,yBAAyB,wPAAwP,4BAA4B,+EAA+E,qEAAqE,aAAa,QAAQ,iBAAiB,0EAA0E,SAAS,yBAAyB,aAAa,uBAAuB,EAAE,0BAA0B,cAAc,0CAA0C,qBAAqB,aAAa,QAAQ,mBAAmB,gGAAgG,SAAS,sCAAsC,6CAA6C,kLAAkL,qBAAqB,qBAAqB,mBAAmB,uBAAuB,kBAAkB,wBAAwB,IAAI,mBAAmB,uBAAuB,sTAAsT,GAAG,EAAE,sFAAsF,sBAAsB,aAAa,iHAAiH,cAAc,iCAAiC,aAAa,2BAA2B,0CAA0C,qBAAqB,gCAAgC,2GAA2G,2BAA2B,wBAAwB,wBAAwB,oCAAoC,iCAAiC,kCAAkC,sUAAsU,2GAA2G,mDAAmD,uCAAuC,2XAA2X,8CAA8C,IAAI,0GAA0G,uBAAuB,8CAA8C,2OAA2O,2BAA2B,QAAQ,QAAQ,oBAAoB,yKAAyK,2BAA2B,MAAM,gDAAgD,yDAAyD,WAAW,iBAAiB,oEAAoE,6NAA6N,6BAA6B,gEAAgE,0QAA0Q,wBAAwB,QAAQ,gWAAgW,mLAAmL,ybAAyb,mJAAmJ,gDAAgD,qDAAqD,UAAU,uEAAuE,6EAA6E,2BAA2B,iBAAiB,kBAAkB,2FAA2F,aAAa,EAAE,iGAAiG,sBAAsB,aAAa,2IAA2I,gBAAgB,kCAAkC,aAAa,uBAAuB,2BAA2B,oBAAoB,iCAAiC,2BAA2B,QAAQ,iUAAiU,yBAAyB,kEAAkE,YAAY,+KAA+K,gHAAgH,6BAA6B,8NAA8N,mBAAmB,ySAAyS,mHAAmH,8BAA8B,mDAAmD,4BAA4B,oOAAoO,kCAAkC,wBAAwB,mCAAmC,iUAAiU,6BAA6B,2CAA2C,0CAA0C,EAAE,YAAY,oEAAoE,uBAAuB,cAAc,uBAAuB,wCAAwC,kHAAkH,KAAK,uCAAuC,+BAA+B,KAAK,qCAAqC,oDAAoD,0CAA0C,kCAAkC,KAAK,wCAAwC,yDAAyD,sCAAsC,8BAA8B,MAAM,iBAAiB,uGAAuG,YAAY,yCAAyC,8BAA8B,MAAM,iBAAiB,0GAA0G,aAAa,aAAa,EAAE,sHAAsH,sBAAsB,aAAa,kBAAkB,oMAAoM,mEAAmE,kIAAkI,aAAa,2BAA2B,sBAAsB,IAAI,mDAAmD,iDAAiD,wEAAwE,wBAAwB,oFAAoF,SAAS,4BAA4B,qBAAqB,qBAAqB,4CAA4C,0BAA0B,8DAA8D,+BAA+B,2GAA2G,+BAA+B,sFAAsF,8BAA8B,oHAAoH,2FAA2F,8FAA8F,KAAK,WAAW,wBAAwB,YAAY,EAAE,mHAAmH,sBAAsB,aAAa,aAAa,uDAAuD,MAAM,mDAAmD,aAAa,iBAAiB,eAAe,gBAAgB,yIAAyI,yCAAyC,gCAAgC,iEAAiE,2CAA2C,YAAY,iBAAiB,KAAK,2BAA2B,iCAAiC,wBAAwB,SAAS,aAAa,QAAQ,KAAK,mBAAmB,EAAE,EAAE,kBAAkB,MAAM,QAAQ,WAAW,KAAK,sBAAsB,uBAAuB,2FAA2F,EAAE,GAAG,sBAAsB,aAAa,qBAAqB,cAAc,QAAQ,8CAA8C,cAAc,2EAA2E,gEAAgE,kBAAkB,wLAAwL,kBAAkB,aAAa,MAAM,IAAI,OAAO,SAAS,qBAAqB,qFAAqF,EAAE,cAAc,gBAAgB,yFAAyF,sBAAsB,gBAAgB,SAAS,cAAc,wBAAwB,cAAc,yBAAyB,mBAAmB,OAAO,EAAE,+BAA+B,gBAAgB,SAAS,IAAI,gCAAgC,SAAS,2BAA2B,SAAS,4CAA4C,oCAAoC,uBAAuB,6BAA6B,sCAAsC,SAAS,EAAE,aAAa,sCAAsC,QAAQ,EAAE,EAAE,+BAA+B,yBAAyB,gCAAgC,0FAA0F,8BAA8B,2FAA2F,uCAAuC,0BAA0B,4CAA4C,mCAAmC,sCAAsC,yBAAyB,2CAA2C,kCAAkC,yBAAyB,aAAa,iDAAiD,cAAc,YAAY,KAAK,sBAAsB,8BAA8B,MAAM,6BAA6B,SAAS,wBAAwB,sBAAsB,8BAA8B,MAAM,4BAA4B,SAAS,uBAAuB,oDAAoD,sBAAsB,kBAAkB,qBAAqB,mBAAmB,WAAW,8GAA8G,oBAAoB,8BAA8B,8CAA8C,MAAM,WAAW,SAAS,gBAAgB,8BAA8B,yCAAyC,aAAa,wBAAwB,GAAG,oBAAoB,8GAA8G,oBAAoB,8BAA8B,6BAA6B,MAAM,yCAAyC,yBAAyB,aAAa,wBAAwB,EAAE,UAAU,EAAE,aAAa,sBAAsB,aAAa,SAAS,kHAAkH,EAAE,wFAAwF,sBAAsB,aAAa,iKAAiK,cAAc,wCAAwC,uBAAuB,2EAA2E,MAAM,EAAE,mBAAmB,uMAAuM,oFAAoF,+BAA+B,kEAAkE,MAAM,wNAAwN,mBAAmB,gBAAgB,eAAe,4CAA4C,gBAAgB,+BAA+B,6CAA6C,uBAAuB,+KAA+K,GAAG,4IAA4I,2LAA2L,8CAA8C,mHAAmH,gCAAgC,oBAAoB,+BAA+B,+JAA+J,oDAAoD,cAAc,gBAAgB,sBAAsB,cAAc,kBAAkB,EAAE,sGAAsG,sBAAsB,aAAa,+LAA+L,cAAc,wCAAwC,uBAAuB,mCAAmC,MAAM,EAAE,mBAAmB,yVAAyV,6CAA6C,oCAAoC,4DAA4D,gBAAgB,eAAe,4CAA4C,gBAAgB,+BAA+B,oFAAoF,uBAAuB,sMAAsM,GAAG,8WAA8W,+XAA+X,2DAA2D,sLAAsL,gCAAgC,oBAAoB,+BAA+B,oKAAoK,oDAAoD,cAAc,gBAAgB,YAAY,EAAE,iJAAiJ,sBAAsB,aAAa,sGAAsG,qBAAqB,kDAAkD,SAAS,EAAE,gBAAgB,MAAM,kEAAkE,iDAAiD,SAAS,2BAA2B,iEAAiE,OAAO,6BAA6B,qDAAqD,iBAAiB,IAAI,kBAAkB,2BAA2B,gBAAgB,qBAAqB,IAAI,mBAAmB,yCAAyC,IAAI,kCAAkC,UAAU,IAAI,6BAA6B,YAAY,IAAI,kBAAkB,2BAA2B,8BAA8B,uBAAuB,oIAAoI,eAAe,GAAG,sBAAsB,aAAa,8BAA8B,IAAI,oCAAoC,SAAS,KAAK,IAAI,kDAAkD,SAAS,KAAK,8BAA8B,MAAM,wDAAwD,gBAAgB,oGAAoG,iBAAiB,IAAI,iCAAiC,SAAS,yCAAyC,6BAA6B,QAAQ,IAAI,2JAA2J,0BAA0B,IAAI,6QAA6Q,SAAS,6BAA6B,qBAAqB,6BAA6B,8CAA8C,IAAI,yBAAyB,SAAS,4BAA4B,2CAA2C,UAAU,IAAI,4BAA4B,uCAAuC,KAAK,2BAA2B,SAAS,sBAAsB,yFAAyF,cAAc,4BAA4B,MAAM,iDAAiD,sBAAsB,KAAK,sCAAsC,EAAE,cAAc,sBAAsB,aAAa,4BAA4B,yCAAyC,MAAM,EAAE,qBAAqB,yBAAyB,EAAE,kBAAkB,kBAAkB,GAAG,sBAAsB,aAAa,WAAW,+XAA+X,GAAG,sBAAsB,aAAa,iBAAiB,mBAAmB,MAAM,KAAK,IAAI,YAAY,IAAI,iCAAiC,OAAO,SAAS,GAAG,4BAA4B,cAAc,MAAM,YAAY,IAAI,4BAA4B,YAAY,GAAG,sBAAsB,aAAa,6KAA6K,gBAAgB,oBAAoB,cAAc,uBAAuB,cAAc,mBAAmB,OAAO,QAAQ,cAAc,0BAA0B,iNAAiN,gBAAgB,qHAAqH,gBAAgB,6BAA6B,gBAAgB,sEAAsE,gBAAgB,6LAA6L,oEAAoE,GAAG,+DAA+D,SAAS,IAAI,mJAAmJ,wBAAwB,kCAAkC,sBAAsB,4BAA4B,oCAAoC,cAAc,mCAAmC,GAAG,+DAA+D,wGAAwG,uCAAuC,EAAE,UAAU,uCAAuC,EAAE,KAAK,6BAA6B,sZAAsZ,sKAAsK,GAAG,0CAA0C,gBAAgB,aAAa,EAAE,kBAAkB,sCAAsC,yBAAyB,8XAA8X,qBAAqB,+KAA+K,EAAE,aAAa,iJAAiJ,wEAAwE,8CAA8C,sIAAsI,gBAAgB,eAAe,EAAE,kBAAkB,sCAAsC,yBAAyB,yeAAye,wIAAwI,oLAAoL,EAAE,kGAAkG,2BAA2B,iHAAiH,oDAAoD,yNAAyN,sBAAsB,mFAAmF,aAAa,8nCAA8nC,cAAc,MAAM,6MAA6M,cAAc,aAAa,yUAAyU,wBAAwB,eAAe,QAAQ,+GAA+G,aAAa,YAAY,ueAAue,+BAA+B,YAAY,sDAAsD,EAAE,mBAAmB,wCAAwC,yBAAyB,sCAAsC,sBAAsB,kHAAkH,iFAAiF,oHAAoH,0NAA0N,uBAAuB,yFAAyF,4DAA4D,yBAAyB,YAAY,4CAA4C,yGAAyG,mrBAAmrB,KAAK,2BAA2B,qLAAqL,oCAAoC,gBAAgB,0MAA0M,gDAAgD,0IAA0I,iBAAiB,mCAAmC,YAAY,GAAG,mKAAmK,IAAI,MAAM,oFAAoF,aAAa,8GAA8G,iBAAiB,sCAAsC,YAAY,GAAG,mKAAmK,IAAI,MAAM,0FAA0F,aAAa,mGAAmG,kBAAkB,iMAAiM,iDAAiD,yDAAyD,iDAAiD,2DAA2D,mCAAmC,WAAW,EAAE,4CAA4C,kBAAkB,MAAM,kIAAkI,0GAA0G,mCAAmC,4BAA4B,EAAE,mBAAmB,uCAAuC,yBAAyB,0GAA0G,eAAe,IAAI,2GAA2G,gFAAgF,mPAAmP,0GAA0G,2BAA2B,yFAAyF,mMAAmM,6SAA6S,0BAA0B,MAAM,kIAAkI,sCAAsC,+BAA+B,yBAAyB,uEAAuE,gRAAgR,eAAe,EAAE,qCAAqC,yHAAyH,EAAE,kCAAkC,8LAA8L,oDAAoD,EAAE,8EAA8E,sBAAsB,aAAa,qBAAqB,wIAAwI,GAAG,sBAAsB,aAAa,wBAAwB,sDAAsD,yPAAyP,KAAK,qDAAqD,QAAQ,EAAE,uDAAuD,KAAK,YAAY,cAAc,4BAA4B,WAAW,SAAS,UAAU,QAAQ,8CAA8C,QAAQ,6HAA6H,QAAQ,EAAE,4CAA4C,cAAc,4BAA4B,WAAW,wCAAwC,QAAQ,wFAAwF,gDAAgD,QAAQ,0BAA0B,sBAAsB,gDAAgD,QAAQ,kBAAkB,eAAe,SAAS,kBAAkB,EAAE,WAAW,aAAa,sBAAsB,SAAS,kBAAkB,EAAE,YAAY,WAAW,kBAAkB,EAAE,YAAY,oBAAoB,SAAS,kBAAkB,EAAE,UAAU,KAAK,IAAI,gDAAgD,wCAAwC,KAAK,UAAU,mDAAmD,EAAE,wCAAwC,OAAO,OAAO,gBAAgB,yIAAyI,GAAG,sBAAsB,aAAa,+HAA+H,cAAc,8DAA8D,aAAa,+fAA+f,cAAc,MAAM,0QAA0Q,cAAc,MAAM,mEAAmE,gBAAgB,QAAQ,mKAAmK,gBAAgB,QAAQ,8EAA8E,aAAa,cAAc,MAAM,MAAM,6CAA6C,MAAM,eAAe,KAAK,MAAM,eAAe,KAAK,MAAM,eAAe,KAAK,MAAM,eAAe,iCAAiC,OAAO,MAAM,KAAK,eAAe,4BAA4B,OAAO,OAAO,kDAAkD,oBAAoB,gBAAgB,kYAAkY,kFAAkF,eAAe,0CAA0C,2HAA2H,8DAA8D,0IAA0I,QAAQ,gBAAgB,sBAAsB,UAAU,MAAM,KAAK,KAAK,EAAE,iBAAiB,sBAAsB,wBAAwB,0EAA0E,MAAM,6EAA6E,yCAAyC,MAAM,cAAc,6CAA6C,MAAM,gDAAgD,mBAAmB,sCAAsC,MAAM,uDAAuD,MAAM,YAAY,KAAK,EAAE,iBAAiB,sBAAsB,+BAA+B,6CAA6C,MAAM,kBAAkB,2CAA2C,MAAM,8GAA8G,YAAY,KAAK,EAAE,iBAAiB,sBAAsB,yIAAyI,YAAY,KAAK,EAAE,iBAAiB,sBAAsB,8HAA8H,wBAAwB,KAAK,KAAK,EAAE,iBAAiB,sBAAsB,gHAAgH,iCAAiC,SAAS,oQAAoQ,oBAAoB,wBAAwB,iBAAiB,QAAQ,mFAAmF,EAAE,+DAA+D,gCAAgC,oBAAoB,wBAAwB,iBAAiB,QAAQ,sFAAsF,EAAE,+DAA+D,mCAAmC,SAAS,uBAAuB,KAAK,KAAK,EAAE,iBAAiB,sBAAsB,wBAAwB,sCAAsC,MAAM,MAAM,8EAA8E,MAAM,aAAa,KAAK,EAAE,iBAAiB,sBAAsB,qCAAqC,yGAAyG,4BAA4B,gCAAgC,mBAAmB,0BAA0B,MAAM,KAAK,IAAI,EAAE,iBAAiB,sBAAsB,mCAAmC,iBAAiB,MAAM,qCAAqC,YAAY,QAAQ,iBAAiB,MAAM,4CAA4C,YAAY,MAAM,4BAA4B,KAAK,EAAE,iBAAiB,sBAAsB,8BAA8B,+CAA+C,MAAM,kDAAkD,kBAAkB,uBAAuB,uCAAuC,sDAAsD,MAAM,UAAU,MAAM,aAAa,KAAK,EAAE,iBAAiB,sBAAsB,mHAAmH,sDAAsD,MAAM,mBAAmB,aAAa,eAAe,EAAE,KAAK,IAAI,EAAE,iBAAiB,sBAAsB,oCAAoC,KAAK,UAAU,uBAAuB,qCAAqC,eAAe,6DAA6D,2CAA2C,MAAM,mBAAmB,aAAa,sBAAsB,EAAE,KAAK,wEAAwE,EAAE,iBAAiB,sBAAsB,uCAAuC,KAAK,WAAW,UAAU,IAAI,EAAE,iBAAiB,sBAAsB,2BAA2B,4CAA4C,MAAM,yCAAyC,gBAAgB,UAAU,IAAI,EAAE,iBAAiB,sBAAsB,sCAAsC,KAAK,UAAU,IAAI,EAAE,iBAAiB,sBAAsB,yCAAyC,4BAA4B,4CAA4C,MAAM,KAAK,IAAI,qBAAqB,qBAAqB,oBAAoB,uDAAuD,MAAM,kBAAkB,eAAe,iEAAiE,8CAA8C,MAAM,wCAAwC,gBAAgB,yEAAyE,wCAAwC,MAAM,2BAA2B,kBAAkB,yBAAyB,iMAAiM,MAAM,aAAa,wEAAwE,EAAE,iBAAiB,sBAAsB,kBAAkB,gBAAgB,6EAA6E,EAAE,iBAAiB,sBAAsB,sBAAsB,2CAA2C,UAAU,MAAM,SAAS,oBAAoB,MAAM,SAAS,8CAA8C,MAAM,uBAAuB,oBAAoB,cAAc,IAAI,EAAE,iBAAiB,sBAAsB,mEAAmE,yBAAyB,aAAa,0EAA0E,EAAE,iBAAiB,sBAAsB,eAAe,gBAAgB,8EAA8E,EAAE,iBAAiB,sBAAsB,sBAAsB,+BAA+B,wCAAwC,MAAM,kCAAkC,oBAAoB,cAAc,IAAI,EAAE,iBAAiB,sBAAsB,mEAAmE,oBAAoB,gDAAgD,MAAM,UAAU,yBAAyB,qBAAqB,mCAAmC,gDAAgD,MAAM,iFAAiF,iCAAiC,gCAAgC,kBAAkB,EAAE,0BAA0B,MAAM,yBAAyB,8BAA8B,MAAM,mBAAmB,KAAK,KAAK,EAAE,iBAAiB,sBAAsB,qIAAqI,uCAAuC,MAAM,MAAM,UAAU,4BAA4B,KAAK,KAAK,EAAE,iBAAiB,sBAAsB,6BAA6B,yCAAyC,MAAM,MAAM,UAAU,YAAY,QAAQ,aAAa,QAAQ,iBAAiB,yBAAyB,8dAA8d,0BAA0B,yBAAyB,cAAc,gDAAgD,kCAAkC,MAAM,qEAAqE,sCAAsC,iBAAiB,wIAAwI,oDAAoD,EAAE,gFAAgF,sBAAsB,aAAa,sbAAsb,oCAAoC,iIAAiI,QAAQ,MAAM,WAAW,QAAQ,IAAI,gBAAgB,aAAa,eAAe,KAAK,sEAAsE,QAAQ,cAAc,KAAK,qBAAqB,MAAM,kCAAkC,gCAAgC,eAAe,KAAK,qBAAqB,QAAQ,IAAI,mCAAmC,+IAA+I,MAAM,EAAE,wFAAwF,yCAAyC,EAAE,aAAa,IAAI,OAAO,0CAA0C,eAAe,YAAY,mBAAmB,mCAAmC,yBAAyB,WAAW,+CAA+C,4BAA4B,oDAAoD,EAAE,qBAAqB,sBAAsB,aAAa,WAAW,4KAA4K,GAAG,sBAAsB,aAAa,2BAA2B,cAAc,mBAAmB,OAAO,QAAQ,kQAAkQ,KAAK,oBAAoB,KAAK,qBAAqB,KAAK,qBAAqB,KAAK,oBAAoB,KAAK,0BAA0B,sBAAsB,iHAAiH,gBAAgB,iDAAiD,cAAc,iCAAiC,gBAAgB,sEAAsE,kBAAkB,oJAAoJ,kBAAkB,qBAAqB,gBAAgB,YAAY,0BAA0B,EAAE,aAAa,kBAAkB,6BAA6B,QAAQ,KAAK,uBAAuB,QAAQ,KAAK,KAAK,eAAe,6BAA6B,cAAc,MAAM,QAAQ,MAAM,uBAAuB,QAAQ,KAAK,uBAAuB,QAAQ,KAAK,qBAAqB,mEAAmE,cAAc,uGAAuG,oBAAoB,gBAAgB,0CAA0C,kBAAkB,2BAA2B,iGAAiG,+BAA+B,YAAY,kBAAkB,gBAAgB,uBAAuB,0NAA0N,EAAE,WAAW,gBAAgB,kGAAkG,oCAAoC,IAAI,kEAAkE,KAAK,aAAa,gGAAgG,iCAAiC,KAAK,aAAa,QAAQ,wPAAwP,EAAE,6CAA6C,2KAA2K,QAAQ,KAAK,oBAAoB,+CAA+C,MAAM,wKAAwK,UAAU,GAAG,UAAU,kBAAkB,KAAK,wDAAwD,WAAW,QAAQ,MAAM,wBAAwB,MAAM,qFAAqF,wBAAwB,kBAAkB,gCAAgC,8CAA8C,KAAK,mMAAmM,kBAAkB,gCAAgC,2BAA2B,KAAK,2CAA2C,YAAY,wBAAwB,EAAE,6IAA6I,iDAAiD,KAAK,SAAS,oBAAoB,UAAU,6GAA6G,uBAAuB,eAAe,+BAA+B,UAAU,KAAK,mBAAmB,UAAU,aAAa,mBAAmB,KAAK,mBAAmB,UAAU,aAAa,UAAU,KAAK,sBAAsB,YAAY,iBAAiB,QAAQ,KAAK,WAAW,QAAQ,OAAO,uBAAuB,KAAK,OAAO,uBAAuB,KAAK,OAAO,uBAAuB,KAAK,OAAO,uBAAuB,mBAAmB,KAAK,6BAA6B,0EAA0E,+HAA+H,0DAA0D,YAAY,+DAA+D,mBAAmB,QAAQ,MAAM,iDAAiD,0EAA0E,SAAS,MAAM,qCAAqC,SAAS,+CAA+C,MAAM,8FAA8F,8BAA8B,KAAK,kCAAkC,oLAAoL,MAAM,2CAA2C,IAAI,+BAA+B,0CAA0C,2FAA2F,6BAA6B,kRAAkR,yBAAyB,MAAM,qKAAqK,EAAE,qBAAqB,sBAAsB,aAAa,qBAAqB,6LAA6L,GAAG,sBAAsB,aAAa,kEAAkE,gCAAgC,0CAA0C,GAAG,EAAE,GAAG,WAAW,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,gCAAgC,qBAAM,CAAC,qBAAM,mEAAmE,EAAE,GAAG,EAAE,GAAG,SAAS,E;;;;;;;ACZt1xG;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAa;AAClC,aAAa,mBAAO,CAAC,EAAiB;AACtC,aAAa,mBAAO,CAAC,EAAa;AAClC,aAAa,mBAAO,CAAC,EAAuB;AAC5C,8BAA8B,mBAAO,CAAC,EAAuB;AAC7D,eAAe;AACf,iC;;;;;;;AClBa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,qBAAqB;AACrB,aAAa,mBAAO,CAAC,EAAS;AAC9B,wBAAwB,mBAAO,CAAC,EAAiB;AACjD,iDAAgD,CAAC,qCAAqC,sCAAsC,EAAE,EAAE,EAAC;AACjI;AACA;AACA;AACA,iC;;;;;;;ACnBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,qBAAqB;AACrB,eAAe,mBAAO,CAAC,EAAiB;AACxC,sBAAsB,mBAAO,CAAC,GAAa;AAC3C,oBAAoB,mBAAO,CAAC,GAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,IAAI;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,+BAA+B,IAAI,+BAA+B;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,+BAA+B,IAAI,+BAA+B;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,+BAA+B,IAAI,+BAA+B,IAAI,SAAS;AACpG,qBAAqB,+BAA+B,IAAI,+BAA+B;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA,6EAA6E,0BAA0B;AACvG;AACA;AACA;AACA;AACA;AACA,8DAA8D,SAAS;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD,yBAAyB,iCAAiC;AAC1D;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yC;;;;;;ACrMA;AACA,eAAe,KAAiD,oBAAoB,CAAiH,CAAC,oBAAoB,YAAY,OAAO,cAAc,aAAa,sCAAsC,SAAS,iBAAiB,yCAAyC,6BAA6B,gBAAgB,EAAE,0FAA0F,oBAAoB,gBAAgB,WAAW,sBAAsB,uBAAuB,IAAI,iCAAiC,SAAS,kBAAkB,sBAAsB,uBAAuB,IAAI,wCAAwC,SAAS,UAAU,uBAAuB,IAAI,KAAK,4BAA4B,qCAAqC,0CAA0C,kMAAkM,oBAAoB,eAAe,0HAA0H,cAAc,qBAAqB,QAAQ,0CAA0C,2BAA2B,uBAAuB,IAAI,KAAK,qBAAqB,qBAAqB,YAAY,OAAO,0DAA0D,UAAU,iCAAiC,kCAAkC,8BAA8B,SAAS,gBAAgB,mCAAmC,IAAI,oFAAoF,mBAAmB,gEAAgE,cAAc,gCAAgC,2BAA2B,oDAAoD,mCAAmC,IAAI,yJAAyJ,uCAAuC,SAAS,uBAAuB,kEAAkE,gDAAgD,4CAA4C,aAAa,8HAA8H,mBAAmB,0EAA0E,mBAAmB,2EAA2E,YAAY,wGAAwG,QAAQ,4BAA4B,cAAc,2BAA2B,IAAI,mCAAmC,SAAS,gCAAgC,mBAAmB,6EAA6E,4BAA4B,UAAU,yCAAyC,UAAU,eAAe,aAAa,sCAAsC,SAAS,iBAAiB,yCAAyC,QAAQ,gBAAgB,EAAE,qtBAAqtB,gBAAgB,wBAAwB,iBAAiB,yBAAyB,cAAc,oEAAoE,+DAA+D,gGAAgG,YAAY,mBAAmB,mCAAmC,IAAI,mDAAmD,UAAU,wCAAwC,cAAc,qBAAqB,UAAU,wFAAwF,YAAY,IAAI,KAAK,aAAa,4NAA4N,oBAAoB,eAAe,qGAAqG,QAAQ,2BAA2B,uBAAuB,IAAI,KAAK,qBAAqB,qBAAqB,YAAY,OAAO,0DAA0D,UAAU,wDAAwD,iBAAiB,iBAAiB,gBAAgB,mCAAmC,IAAI,gGAAgG,qBAAqB,mCAAmC,IAAI,2CAA2C,uCAAuC,4CAA4C,0BAA0B,yCAAyC,8BAA8B,wCAAwC,MAAM,8BAA8B,uBAAuB,kCAAkC,kBAAkB,+DAA+D,yCAAyC,wBAAwB,UAAU,uBAAuB,IAAI,KAAK,aAAa,8CAA8C,QAAQ,YAAY,iBAAiB,8BAA8B,sBAAsB,kEAAkE,yCAAyC,wBAAwB,uBAAuB,IAAI,KAAK,aAAa,+BAA+B,+BAA+B,4DAA4D,0BAA0B,qFAAqF,UAAU,YAAY,aAAa,sCAAsC,SAAS,sBAAsB,QAAQ,mBAAmB,eAAe,MAAM,wJAAwJ,eAAe,QAAQ,4CAA4C,WAAW,kBAAkB,eAAe,MAAM,gDAAgD,WAAW,8BAA8B,mBAAmB,qFAAqF,eAAe,aAAa,sCAAsC,SAAS,sOAAsO,mFAAmF,kBAAkB,uBAAuB,iBAAiB,eAAe,yBAAyB,qBAAqB,yBAAyB,qBAAqB,wBAAwB,kBAAkB,+CAA+C,mCAAmC,SAAS,2BAA2B,yCAAyC,2DAA2D,WAAW,gBAAgB,4BAA4B,qBAAqB,6DAA6D,uBAAuB,gBAAgB,uCAAuC,QAAQ,8BAA8B,oBAAoB,8CAA8C,oBAAoB,IAAI,eAAe,wCAAwC,gBAAgB,qDAAqD,YAAY,IAAI,UAAU,gBAAgB,sCAAsC,OAAO,qCAAqC,4BAA4B,YAAY,IAAI,mCAAmC,SAAS,+BAA+B,aAAa,kBAAkB,oBAAoB,8BAA8B,KAAK,WAAW,6DAA6D,kBAAkB,0FAA0F,IAAI,yCAAyC,0BAA0B,sGAAsG,EAAE,YAAY,uBAAuB,8CAA8C,2CAA2C,sCAAsC,8CAA8C,gCAAgC,gDAAgD,8BAA8B,0BAA0B,4CAA4C,sCAAsC,8CAA8C,gCAAgC,gDAAgD,+BAA+B,uBAAuB,8CAA8C,sCAAsC,gBAAgB,gCAAgC,oCAAoC,+BAA+B,SAAS,oEAAoE,iFAAiF,iBAAiB,iBAAiB,YAAY,IAAI,gBAAgB,4BAA4B,gBAAgB,IAAI,yEAAyE,SAAS,8BAA8B,qBAAqB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,gkBAAgkB,aAAa,gCAAgC,6BAA6B,eAAe,mCAAmC,6BAA6B,gBAAgB,2CAA2C,6BAA6B,wBAAwB,uCAAuC,6BAA6B,oBAAoB,uCAAuC,6BAA6B,oBAAoB,iCAAiC,6BAA6B,cAAc,mCAAmC,6BAA6B,gBAAgB,oCAAoC,6BAA6B,iBAAiB,iDAAiD,6BAA6B,8BAA8B,kDAAkD,6BAA6B,+BAA+B,oDAAoD,6BAA6B,iCAAiC,yCAAyC,6BAA6B,sBAAsB,2DAA2D,6BAA6B,wCAAwC,sDAAsD,6BAA6B,mCAAmC,EAAE,aAAa,gCAAgC,6BAA6B,kBAAkB,EAAE,aAAa,+BAA+B,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,EAAE,aAAa,aAAa,sCAAsC,SAAS,EAAE,wBAAwB,eAAe,qBAAqB,2EAA2E,eAAe,oBAAoB,mCAAmC,qMAAqM,uBAAuB,eAAe,uBAAuB,kBAAkB,qBAAqB,kBAAkB,oBAAoB,kBAAkB,8BAA8B,gDAAgD,mBAAmB,sDAAsD,mBAAmB,sDAAsD,mBAAmB,qFAAqF,mBAAmB,sBAAsB,eAAe,sBAAsB,gBAAgB,sBAAsB,mBAAmB,KAAK,OAAO,KAAK,gDAAgD,YAAY,eAAe,aAAa,sCAAsC,SAAS,oFAAoF,eAAe,wIAAwI,yJAAyJ,sBAAsB,0CAA0C,0BAA0B,+CAA+C,aAAa,aAAa,sCAAsC,SAAS,6HAA6H,YAAY,kBAAkB,eAAe,aAAa,sCAAsC,SAAS,yCAAyC,eAAe,MAAM,aAAa,kFAAkF,iCAAiC,eAAe,YAAY,qCAAqC,YAAY,gDAAgD,eAAe,wIAAwI,aAAa,uTAAuT,cAAc,uNAAuN,2BAA2B,eAAe,kDAAkD,WAAW,sCAAsC,oBAAoB,0CAA0C,mCAAmC,wBAAwB,6IAA6I,uBAAuB,IAAI,yCAAyC,SAAS,wBAAwB,mCAAmC,sCAAsC,uBAAuB,IAAI,mCAAmC,+BAA+B,oBAAoB,eAAe,aAAa,sCAAsC,SAAS,iBAAiB,eAAe,2BAA2B,cAAc,QAAQ,aAAa,iBAAiB,eAAe,iBAAiB,0BAA0B,8BAA8B,0CAA0C,mBAAmB,iBAAiB,qCAAqC,UAAU,eAAe,aAAa,sCAAsC,SAAS,kBAAkB,eAAe,2BAA2B,eAAe,UAAU,EAAE,wCAAwC,WAAW,iEAAiE,mBAAmB,kBAAkB,YAAY,IAAI,6JAA6J,2BAA2B,IAAI,wEAAwE,KAAK,oBAAoB,YAAY,IAAI,wEAAwE,UAAU,WAAW,aAAa,aAAa,sCAAsC,SAAS,uCAAuC,cAAc,aAAa,sCAAsC,SAAS,kBAAkB,eAAe,2BAA2B,eAAe,iBAAiB,EAAE,sCAAsC,WAAW,gFAAgF,WAAW,eAAe,aAAa,sCAAsC,SAAS,kBAAkB,iCAAiC,2BAA2B,gBAAgB,EAAE,8BAA8B,uDAAuD,8IAA8I,WAAW,4BAA4B,yCAAyC,qCAAqC,QAAQ,yBAAyB,IAAI,iDAAiD,SAAS,2BAA2B,0DAA0D,yBAAyB,uBAAuB,YAAY,kBAAkB,IAAI,wGAAwG,gEAAgE,WAAW,eAAe,aAAa,sCAAsC,SAAS,oBAAoB,eAAe,2BAA2B,gBAAgB,EAAE,oFAAoF,WAAW,2DAA2D,4BAA4B,iDAAiD,wCAAwC,6BAA6B,IAAI,UAAU,kBAAkB,SAAS,6BAA6B,IAAI,iCAAiC,+QAA+Q,OAAO,2CAA2C,qCAAqC,2CAA2C,+BAA+B,mJAAmJ,MAAM,gHAAgH,gEAAgE,4BAA4B,6BAA6B,6CAA6C,iBAAiB,uCAAuC,0DAA0D,0BAA0B,8CAA8C,iBAAiB,aAAa,eAAe,aAAa,sCAAsC,SAAS,qBAAqB,eAAe,2BAA2B,gBAAgB,EAAE,mEAAmE,WAAW,mBAAmB,QAAQ,6BAA6B,IAAI,uBAAuB,SAAS,yBAAyB,iDAAiD,YAAY,IAAI,kCAAkC,KAAK,4DAA4D,gDAAgD,uEAAuE,cAAc,eAAe,aAAa,sCAAsC,SAAS,qBAAqB,uEAAuE,uHAAuH,cAAc,eAAe,aAAa,sCAAsC,SAAS,iBAAiB,gCAAgC,4BAA4B,eAAe,qTAAqT,WAAW,8DAA8D,kBAAkB,4EAA4E,QAAQ,0EAA0E,mBAAmB,iJAAiJ,oBAAoB,6LAA6L,mBAAmB,yDAAyD,gBAAgB,eAAe,6CAA6C,gEAAgE,2EAA2E,wDAAwD,MAAM,2DAA2D,uBAAuB,IAAI,KAAK,SAAS,QAAQ,6CAA6C,yBAAyB,cAAc,IAAI,6BAA6B,SAAS,MAAM,4DAA4D,YAAY,0JAA0J,UAAU,eAAe,aAAa,sCAAsC,SAAS,qBAAqB,oJAAoJ,6BAA6B,gBAAgB,EAAE,+DAA+D,qCAAqC,aAAa,kUAAkU,udAAud,WAAW,mBAAmB,ieAAie,kBAAkB,gDAAgD,eAAe,oBAAoB,qEAAqE,kBAAkB,2JAA2J,uBAAuB,8LAA8L,gDAAgD,4CAA4C,qBAAqB,QAAQ,oCAAoC,8EAA8E,qTAAqT,UAAU,cAAc,yDAAyD,QAAQ,WAAW,QAAQ,8KAA8K,YAAY,IAAI,gBAAgB,IAAI,SAAS,wJAAwJ,sEAAsE,+BAA+B,wjBAAwjB,MAAM,UAAU,oGAAoG,MAAM,iFAAiF,mLAAmL,sJAAsJ,6kBAA6kB,mEAAmE,kFAAkF,oBAAoB,YAAY,IAAI,MAAM,wBAAwB,wPAAwP,qBAAqB,wCAAwC,2BAA2B,qFAAqF,SAAS,sCAAsC,8EAA8E,iEAAiE,2BAA2B,IAAI,2CAA2C,iBAAiB,cAAc,qBAAqB,qBAAqB,MAAM,6CAA6C,oEAAoE,YAAY,mBAAmB,mBAAmB,0BAA0B,8BAA8B,8BAA8B,mBAAmB,KAAK,kBAAkB,gBAAgB,SAAS,UAAU,+EAA+E,IAAI,KAAK,8BAA8B,GAAG,oHAAoH,oBAAoB,kCAAkC,OAAO,YAAY,kEAAkE,yBAAyB,MAAM,0BAA0B,oBAAoB,kFAAkF,yBAAyB,6BAA6B,sIAAsI,EAAE,eAAe,aAAa,sCAAsC,SAAS,uBAAuB,wBAAwB,iCAAiC,gBAAgB,EAAE,QAAQ,2dAA2d,WAAW,sDAAsD,kBAAkB,6DAA6D,uBAAuB,+CAA+C,cAAc,2KAA2K,uBAAuB,IAAI,qEAAqE,8EAA8E,kBAAkB,wGAAwG,oBAAoB,+IAA+I,YAAY,gEAAgE,eAAe,sBAAsB,qBAAqB,EAAE,kBAAkB,gCAAgC,EAAE,qDAAqD,gBAAgB,eAAe,aAAa,sCAAsC,SAAS,uBAAuB,eAAe,wBAAwB,eAAe,mLAAmL,uBAAuB,0DAA0D,WAAW,+DAA+D,kBAAkB,6EAA6E,oBAAoB,iNAAiN,gBAAgB,oBAAoB,mBAAmB,yBAAyB,aAAa,0BAA0B,cAAc,mBAAmB,oBAAoB,iEAAiE,YAAY,IAAI,KAAK,SAAS,wCAAwC,qEAAqE,kCAAkC,uBAAuB,IAAI,qCAAqC,yBAAyB,gBAAgB,eAAe,SAAS,gEAAgE,2EAA2E,wDAAwD,MAAM,yDAAyD,SAAS,0BAA0B,qCAAqC,uBAAuB,IAAI,mDAAmD,IAAI,KAAK,sBAAsB,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,aAAa,4BAA4B,mDAAmD,yBAAyB,cAAc,KAAK,uBAAuB,kBAAkB,QAAQ,YAAY,IAAI,YAAY,SAAS,2BAA2B,OAAO,gCAAgC,4BAA4B,gBAAgB,eAAe,aAAa,sCAAsC,SAAS,qBAAqB,0CAA0C,iCAAiC,gBAAgB,OAAO,8IAA8I,gDAAgD,+GAA+G,eAAe,4DAA4D,2CAA2C,IAAI,wEAAwE,SAAS,WAAW,0CAA0C,kBAAkB,qLAAqL,uBAAuB,uGAAuG,aAAa,SAAS,4BAA4B,MAAM,GAAG,yCAAyC,KAAK,qCAAqC,KAAK,MAAM,qBAAqB,6BAA6B,4BAA4B,mBAAmB,gEAAgE,oIAAoI,MAAM,QAAQ,0DAA0D,qCAAqC,oBAAoB,mOAAmO,sBAAsB,MAAM,sBAAsB,wIAAwI,mCAAmC,mCAAmC,gBAAgB,IAAI,UAAU,0CAA0C,mCAAmC,eAAe,sBAAsB,iEAAiE,uBAAuB,IAAI,qEAAqE,oEAAoE,WAAW,gBAAgB,+RAA+R,0FAA0F,2BAA2B,OAAO,oCAAoC,YAAY,uBAAuB,oBAAoB,kBAAkB,gCAAgC,EAAE,qDAAqD,+BAA+B,eAAe,aAAa,sCAAsC,SAAS,0BAA0B,0CAA0C,4BAA4B,gBAAgB,EAAE,MAAM,mNAAmN,6EAA6E,WAAW,iEAAiE,2BAA2B,sQAAsQ,oBAAoB,oCAAoC,QAAQ,sEAAsE,uBAAuB,IAAI,0EAA0E,SAAS,mBAAmB,+CAA+C,gBAAgB,SAAS,gEAAgE,2EAA2E,wDAAwD,MAAM,2DAA2D,2BAA2B,WAAW,oBAAoB,aAAa,gBAAgB,mBAAmB,eAAe,aAAa,sCAAsC,SAAS,0BAA0B,eAAe,wBAAwB,eAAe,kSAAkS,uBAAuB,6DAA6D,WAAW,8JAA8J,kBAAkB,uHAAuH,oBAAoB,8KAA8K,gBAAgB,uJAAuJ,OAAO,gCAAgC,iCAAiC,SAAS,kBAAkB,mBAAmB,sBAAsB,iDAAiD,QAAQ,YAAY,YAAY,gHAAgH,YAAY,IAAI,6BAA6B,YAAY,IAAI,KAAK,gFAAgF,mBAAmB,IAAI,SAAS,GAAG,8CAA8C,2BAA2B,aAAa,sFAAsF,2DAA2D,gBAAgB,IAAI,MAAM,0BAA0B,wBAAwB,gBAAgB,4BAA4B,gBAAgB,eAAe,SAAS,wBAAwB,mGAAmG,gEAAgE,2EAA2E,wDAAwD,MAAM,yDAAyD,YAAY,gCAAgC,iCAAiC,qCAAqC,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,gCAAgC,gCAAgC,IAAI,iBAAiB,mDAAmD,yBAAyB,cAAc,EAAE,QAAQ,oCAAoC,aAAa,MAAM,+EAA+E,YAAY,YAAY,IAAI,KAAK,sBAAsB,mBAAmB,IAAI,SAAS,sBAAsB,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,kCAAkC,2BAA2B,gBAAgB,IAAI,iBAAiB,mDAAmD,yBAAyB,cAAc,mCAAmC,uBAAuB,kBAAkB,QAAQ,YAAY,IAAI,YAAY,SAAS,2BAA2B,OAAO,gCAAgC,4BAA4B,mBAAmB,eAAe,aAAa,sCAAsC,SAAS,kBAAkB,wBAAwB,4BAA4B,gBAAgB,EAAE,uCAAuC,0BAA0B,wCAAwC,kDAAkD,qDAAqD,+GAA+G,WAAW,eAAe,aAAa,sCAAsC,SAAS,gBAAgB,wBAAwB,8BAA8B,gBAAgB,EAAE,mFAAmF,sBAAsB,WAAW,sBAAsB,uBAAuB,eAAe,YAAY,IAAI,WAAW,sBAAsB,6CAA6C,iBAAiB,oBAAoB,0DAA0D,6BAA6B,8CAA8C,gBAAgB,wCAAwC,yBAAyB,IAAI,MAAM,kBAAkB,sJAAsJ,OAAO,yBAAyB,qCAAqC,yBAAyB,+BAA+B,mJAAmJ,6BAA6B,6BAA6B,eAAe,aAAa,sCAAsC,SAAS,qBAAqB,wBAAwB,4BAA4B,gBAAgB,EAAE,iLAAiL,0BAA0B,sIAAsI,mCAAmC,iJAAiJ,8GAA8G,sBAAsB,iIAAiI,cAAc,eAAe,aAAa,sCAAsC,SAAS,mBAAmB,wBAAwB,4BAA4B,gBAAgB,EAAE,sJAAsJ,kHAAkH,+GAA+G,YAAY,eAAe,aAAa,sCAAsC,SAAS,gBAAgB,wBAAwB,8BAA8B,gBAAgB,EAAE,uEAAuE,wCAAwC,eAAe,aAAa,sCAAsC,SAAS,gBAAgB,wBAAwB,4BAA4B,gBAAgB,EAAE,QAAQ,2LAA2L,qFAAqF,4HAA4H,mBAAmB,YAAY,mCAAmC,qDAAqD,8GAA8G,sBAAsB,kFAAkF,+BAA+B,qBAAqB,kBAAkB,sEAAsE,SAAS,cAAc,aAAa,sCAAsC,SAAS,kBAAkB,wBAAwB,4BAA4B,gBAAgB,EAAE,UAAU,sUAAsU,2HAA2H,6EAA6E,sCAAsC,YAAY,0BAA0B,qDAAqD,8GAA8G,sBAAsB,kHAAkH,8BAA8B,UAAU,sCAAsC,wCAAwC,sCAAsC,qCAAqC,qDAAqD,aAAa,oBAAoB,yGAAyG,eAAe,aAAa,sCAAsC,SAAS,gBAAgB,wBAAwB,4BAA4B,gBAAgB,EAAE,6LAA6L,6CAA6C,sEAAsE,qCAAqC,8GAA8G,sBAAsB,0JAA0J,SAAS,eAAe,aAAa,sCAAsC,SAAS,sBAAsB,wBAAwB,4BAA4B,gBAAgB,EAAE,gBAAgB,0YAA0Y,0BAA0B,wCAAwC,sCAAsC,YAAY,0IAA0I,qCAAqC,8GAA8G,sBAAsB,4MAA4M,eAAe,eAAe,aAAa,sCAAsC,SAAS,oBAAoB,wBAAwB,8BAA8B,gBAAgB,EAAE,2EAA2E,uCAAuC,oBAAoB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,kGAAkG,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,MAAM,sCAAsC,SAAS,sEAAsE,2CAA2C,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,MAAM,sCAAsC,SAAS,gEAAgE,iDAAiD,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,sCAAsC,SAAS,EAAE,eAAe,aAAa,cAAc,oHAAoH,EAAE,SAAS,cAAc,iGAAiG,EAAE,SAAS,cAAc,mXAAmX,EAAE,SAAS,cAAc,kYAAkY,EAAE,SAAS,cAAc,mgBAAmgB,EAAE,SAAS,cAAc,80BAA80B,EAAE,SAAS,cAAc,qrBAAqrB,EAAE,SAAS,cAAc,ykBAAykB,EAAE,SAAS,cAAc,wjBAAwjB,EAAE,SAAS,cAAc,kpBAAkpB,EAAE,SAAS,cAAc,+oBAA+oB,EAAE,+EAA+E,cAAc,IAAI,kBAAkB,cAAc,WAAW,gBAAgB,4DAA4D,aAAa,eAAe,wDAAwD,cAAc,eAAe,iDAAiD,gBAAgB,iDAAiD,cAAc,qCAAqC,oBAAoB,eAAe,qCAAqC,sBAAsB,qCAAqC,gBAAgB,UAAU,WAAW,iBAAiB,6CAA6C,SAAS,gBAAgB,0CAA0C,8DAA8D,gBAAgB,WAAW,gDAAgD,cAAc,2BAA2B,kBAAkB,4DAA4D,6DAA6D,kBAAkB,4DAA4D,+DAA+D,kBAAkB,8CAA8C,6CAA6C,gBAAgB,gCAAgC,sCAAsC,gBAAgB,2CAA2C,cAAc,qDAAqD,cAAc,uCAAuC,oBAAoB,sEAAsE,kBAAkB,qEAAqE,kBAAkB,qEAAqE,gBAAgB,0DAA0D,gBAAgB,4DAA4D,8NAA8N,kBAAkB,yDAAyD,oBAAoB,6EAA6E,mCAAmC,+BAA+B,IAAI,8BAA8B,oBAAoB,EAAE,YAAY,aAAa,eAAe,sEAAsE,cAAc,eAAe,qEAAqE,gBAAgB,qEAAqE,cAAc,mDAAmD,wBAAwB,eAAe,mDAAmD,0BAA0B,mDAAmD,gBAAgB,wDAAwD,gGAAgG,cAAc,2BAA2B,mBAAmB,wFAAwF,2FAA2F,mBAAmB,0EAA0E,6EAA6E,mBAAmB,4DAA4D,2DAA2D,mBAAmB,4DAA4D,mEAAmE,iBAAiB,gCAAgC,oDAAoD,iBAAiB,yDAAyD,iBAAiB,yDAAyD,eAAe,0EAA0E,eAAe,mDAAmD,mBAAmB,mGAAmG,mBAAmB,mGAAmG,mBAAmB,iFAAiF,qBAAqB,+GAA+G,iBAAiB,oFAAoF,iBAAiB,wFAAwF,0UAA0U,gBAAgB,cAAc,eAAe,2FAA2F,iBAAiB,oGAAoG,eAAe,eAAe,mGAAmG,iBAAiB,mGAAmG,+BAA+B,eAAe,wEAAwE,iCAAiC,wEAAwE,eAAe,wEAAwE,iBAAiB,UAAU,yBAAyB,mDAAmD,+FAA+F,SAAS,iBAAiB,gHAAgH,4JAA4J,iBAAiB,mEAAmE,8HAA8H,eAAe,mEAAmE,4CAA4C,mBAAmB,kIAAkI,kKAAkK,mBAAmB,iFAAiF,gGAAgG,mBAAmB,+FAA+F,4GAA4G,mBAAmB,kBAAkB,+GAA+G,iBAAiB,8EAA8E,iBAAiB,gCAAgC,yEAAyE,iBAAiB,8EAA8E,iBAAiB,0FAA0F,iBAAiB,wGAAwG,gGAAgG,iBAAiB,4QAA4Q,qNAAqN,mBAAmB,8EAA8E,eAAe,uGAAuG,eAAe,gEAAgE,mBAAmB,gJAAgJ,mBAAmB,gJAAgJ,mBAAmB,qHAAqH,qBAAqB,kKAAkK,iBAAiB,2HAA2H,iBAAiB,kIAAkI,4eAA4e,gBAAgB,cAAc,gBAAgB,kJAAkJ,eAAe,gBAAgB,qLAAqL,iBAAiB,qLAAqL,6CAA6C,gBAAgB,+HAA+H,+CAA+C,+HAA+H,eAAe,+HAA+H,iBAAiB,UAAU,+CAA+C,6GAA6G,iLAAiL,SAAS,iBAAiB,4QAA4Q,8WAA8W,iBAAiB,0HAA0H,urBAAurB,eAAe,0HAA0H,8HAA8H,mBAAmB,sJAAsJ,ybAAyb,mBAAmB,iDAAiD,qaAAqa,mBAAmB,yBAAyB,6MAA6M,qBAAqB,6FAA6F,4gBAA4gB,mBAAmB,0FAA0F,oNAAoN,mBAAmB,0FAA0F,oNAAoN,mBAAmB,wFAAwF,sNAAsN,iBAAiB,wIAAwI,iBAAiB,wIAAwI,mBAAmB,mDAAmD,iQAAiQ,iBAAiB,gCAAgC,gIAAgI,iBAAiB,gCAAgC,gIAAgI,iBAAiB,gCAAgC,gIAAgI,mBAAmB,wGAAwG,sKAAsK,iBAAiB,4FAA4F,uLAAuL,iBAAiB,0CAA0C,iBAAiB,oEAAoE,8EAA8E,iBAAiB,eAAe,QAAQ,6HAA6H,kUAAkU,qBAAqB,6HAA6H,0MAA0M,uBAAuB,wPAAwP,wLAAwL,iBAAiB,wGAAwG,uJAAuJ,2BAA2B,kCAAkC,gKAAgK,uBAAuB,wBAAwB,iMAAiM,qBAAqB,+KAA+K,iKAAiK,2BAA2B,kCAAkC,yJAAyJ,qBAAqB,uFAAuF,mcAAmc,qBAAqB,uFAAuF,qCAAqC,kCAAkC,mMAAmM,eAAe,mLAAmL,eAAe,yGAAyG,mBAAmB,2QAA2Q,mBAAmB,2QAA2Q,mBAAmB,qNAAqN,qBAAqB,2SAA2S,iBAAiB,kOAAkO,iBAAiB,gPAAgP,s2BAAs2B,gBAAgB,cAAc,eAAe,iDAAiD,eAAe,eAAe,uCAAuC,eAAe,yBAAyB,yBAAyB,mBAAmB,eAAe,8BAA8B,iBAAiB,uCAAuC,qBAAqB,8BAA8B,mBAAmB,sDAAsD,mBAAmB,sDAAsD,mBAAmB,sDAAsD,mBAAmB,sDAAsD,iBAAiB,wEAAwE,iBAAiB,2EAA2E,mBAAmB,oFAAoF,mBAAmB,oFAAoF,iBAAiB,2EAA2E,mBAAmB,6CAA6C,qBAAqB,4DAA4D,iBAAiB,wCAAwC,yBAAyB,iBAAiB,wCAAwC,mBAAmB,eAAe,yBAAyB,mBAAmB,iBAAiB,0CAA0C,iBAAiB,6CAA6C,iBAAiB,uCAAuC,qEAAqE,iBAAiB,qCAAqC,mBAAmB,8CAA8C,gDAAgD,qBAAqB,yBAAyB,+DAA+D,yBAAyB,0DAA0D,4GAA4G,yBAAyB,kDAAkD,4GAA4G,iBAAiB,OAAO,mDAAmD,wDAAwD,mBAAmB,uDAAuD,6HAA6H,mBAAmB,yBAAyB,uFAAuF,mBAAmB,uHAAuH,wEAAwE,qBAAqB,cAAc,2LAA2L,qBAAqB,cAAc,2LAA2L,qBAAqB,cAAc,2LAA2L,iBAAiB,6GAA6G,6CAA6C,eAAe,8BAA8B,eAAe,2CAA2C,iBAAiB,6CAA6C,iBAAiB,8CAA8C,wKAAwK,mFAAmF,QAAQ,gEAAgE,IAAI,0FAA0F,SAAS,EAAE,cAAc,eAAe,wDAAwD,eAAe,eAAe,iDAAiD,qBAAqB,eAAe,qCAAqC,iBAAiB,iDAAiD,uBAAuB,qCAAqC,mBAAmB,qEAAqE,mBAAmB,qEAAqE,mBAAmB,qEAAqE,mBAAmB,qEAAqE,iBAAiB,6FAA6F,iBAAiB,iGAAiG,mBAAmB,6GAA6G,mBAAmB,6GAA6G,iBAAiB,iGAAiG,mBAAmB,yDAAyD,qBAAqB,6EAA6E,iBAAiB,oDAAoD,2BAA2B,iBAAiB,oDAAoD,uBAAuB,eAAe,gCAAgC,2BAA2B,eAAe,gCAAgC,uBAAuB,iBAAiB,qDAAqD,iBAAiB,yDAAyD,iBAAiB,kDAAkD,qEAAqE,iBAAiB,+CAA+C,qBAAqB,oKAAoK,+EAA+E,qBAAqB,gCAAgC,iFAAiF,iBAAiB,gBAAgB,OAAO,GAAG,8BAA8B,YAAY,GAAG,8BAA8B,YAAY,yBAAyB,iDAAiD,mBAAmB,gCAAgC,mJAAmJ,mBAAmB,8GAA8G,2FAA2F,eAAe,qCAAqC,eAAe,qDAAqD,iBAAiB,0DAA0D,iBAAiB,4DAA4D,8NAA8N,4DAA4D,WAAW,6BAA6B,QAAQ,gEAAgE,IAAI,0GAA0G,UAAU,GAAG,cAAc,eAAe,wDAAwD,eAAe,qCAAqC,mBAAmB,MAAM,kBAAkB,8DAA8D,iBAAiB,wCAAwC,0EAA0E,iBAAiB,cAAc,0BAA0B,mBAAmB,4DAA4D,6FAA6F,mBAAmB,MAAM,4DAA4D,6DAA6D,mBAAmB,MAAM,4DAA4D,6DAA6D,mBAAmB,MAAM,4DAA4D,6DAA6D,iBAAiB,yBAAyB,sEAAsE,iBAAiB,+FAA+F,uDAAuD,iBAAiB,mFAAmF,sEAAsE,mBAAmB,mCAAmC,qBAAqB,sEAAsE,uMAAuM,eAAe,sDAAsD,6HAA6H,iBAAiB,4DAA4D,gDAAgD,iBAAiB,oDAAoD,iBAAiB,uBAAuB,kGAAkG,KAAK,QAAQ,sCAAsC,wBAAwB,4IAA4I,SAAS,qBAAqB,qBAAqB,eAAe,wFAAwF,6EAA6E,eAAe,qDAAqD,4KAA4K,cAAc,+LAA+L,4CAA4C,yDAAyD,gCAAgC,4HAA4H,EAAE,cAAc,eAAe,oFAAoF,eAAe,eAAe,yFAAyF,6BAA6B,eAAe,iEAAiE,2BAA2B,eAAe,4BAA4B,yBAAyB,8EAA8E,mBAAmB,8DAA8D,0GAA0G,iBAAiB,mFAAmF,iBAAiB,6EAA6E,iBAAiB,WAAW,QAAQ,eAAe,2BAA2B,iBAAiB,yFAAyF,eAAe,iEAAiE,+BAA+B,iEAAiE,UAAU,iBAAiB,iDAAiD,UAAU,iBAAiB,iDAAiD,iBAAiB,+DAA+D,oFAAoF,mBAAmB,0FAA0F,kHAAkH,mBAAmB,uIAAuI,mIAAmI,mBAAmB,uIAAuI,mIAAmI,mBAAmB,uIAAuI,mIAAmI,mBAAmB,4DAA4D,6MAA6M,mBAAmB,4DAA4D,6MAA6M,qBAAqB,gCAAgC,iCAAiC,MAAM,6FAA6F,oFAAoF,gCAAgC,6FAA6F,mBAAmB,iIAAiI,mBAAmB,oHAAoH,iPAAiP,UAAU,mBAAmB,yGAAyG,UAAU,qBAAqB,UAAU,mLAAmL,iBAAiB,YAAY,+GAA+G,iBAAiB,+FAA+F,4BAA4B,iBAAiB,YAAY,QAAQ,eAAe,sFAAsF,wFAAwF,SAAS,eAAe,8FAA8F,iBAAiB,8GAA8G,iBAAiB,oHAAoH,sbAAsb,cAAc,eAAe,0CAA0C,eAAe,eAAe,6BAA6B,iBAAiB,eAAe,uBAAuB,iBAAiB,6BAA6B,mBAAmB,uBAAuB,mBAAmB,uCAAuC,mBAAmB,uCAAuC,mBAAmB,uCAAuC,mBAAmB,uCAAuC,iBAAiB,mDAAmD,iBAAiB,qDAAqD,mBAAmB,2DAA2D,mBAAmB,2DAA2D,iBAAiB,qDAAqD,mBAAmB,iCAAiC,qBAAqB,2CAA2C,iBAAiB,4BAA4B,uBAAuB,iBAAiB,4BAA4B,eAAe,eAAe,kBAAkB,uBAAuB,eAAe,kBAAkB,eAAe,iBAAiB,+BAA+B,iBAAiB,iCAAiC,iBAAiB,4BAA4B,yDAAyD,iBAAiB,2BAA2B,mBAAmB,0BAA0B,4BAA4B,qBAAqB,kBAAkB,6CAA6C,iBAAiB,OAAO,oBAAoB,+CAA+C,mBAAmB,kBAAkB,+CAA+C,mBAAmB,kBAAkB,yDAAyD,mBAAmB,kBAAkB,yDAAyD,mBAAmB,kBAAkB,2DAA2D,qBAAqB,wDAAwD,6CAA6C,iBAAiB,yFAAyF,6CAA6C,eAAe,uBAAuB,eAAe,iCAAiC,iBAAiB,gCAAgC,iBAAiB,gCAAgC,kHAAkH,4DAA4D,WAAW,6BAA6B,QAAQ,gEAAgE,IAAI,0DAA0D,UAAU,GAAG,cAAc,MAAM,YAAY,aAAa,gGAAgG,cAAc,MAAM,sCAAsC,0BAA0B,2BAA2B,YAAY,mBAAmB,iGAAiG,yBAAyB,yCAAyC,4BAA4B,6FAA6F,YAAY,MAAM,iEAAiE,cAAc,4BAA4B,QAAQ,MAAM,WAAW,QAAQ,MAAM,KAAK,+BAA+B,iBAAiB,SAAS,aAAa,iBAAiB,mBAAmB,eAAe,YAAY,WAAW,KAAK,8CAA8C,6CAA6C,uCAAuC,aAAa,8cAA8c,0IAA0I,wBAAwB,qEAAqE,SAAS,kBAAkB,6BAA6B,iBAAiB,SAAS,sBAAsB,6BAA6B,iBAAiB,SAAS,sBAAsB,6BAA6B,kBAAkB,yBAAyB,8LAA8L,mLAAmL,8HAA8H,WAAW,KAAK,uBAAuB,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,oBAAoB,2BAA2B,2NAA2N,wEAAwE,2VAA2V,YAAY,KAAK,oCAAoC,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,4BAA4B,YAAY,KAAK,4CAA4C,uDAAuD,uBAAuB,mDAAmD,SAAS,4DAA4D,IAAI,MAAM,cAAc,WAAW,+BAA+B,YAAY,YAAY,oDAAoD,mBAAmB,+DAA+D,uBAAuB,EAAE,8DAA8D,4FAA4F,eAAe,wCAAwC,SAAS,EAAE,QAAQ,IAAI,G;;;;;;ACDr91G;AACA;AACA;AACA;AACA;;AAEA,cAAc;;AAEd;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,wCAAwC,SAAS;AACjD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,2BAA2B,UAAU;AACrC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,IAAI,IAA0C,EAAE,mCAAO,YAAY,iBAAiB,EAAE;AAAA,kGAAC;AACvF,KAAK,EAI2B;;AAEhC,CAAC;;;;;;;;AC1HY;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc,GAAG,aAAa;AAC9B;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,qC;;;;;;;ACZa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,GAAS;AAC9B,aAAa,mBAAO,CAAC,GAAe;AACpC,iC;;;;;;;ACda;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB;AACnB,gBAAgB,mBAAO,CAAC,GAAkB;AAC1C;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,KAAK;AACvC;AACA;AACA;AACA;AACA;AACA,qCAAqC,KAAK,YAAY,aAAa;AACnE;AACA,sCAAsC,KAAK,IAAI,+CAA+C;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,cAAc,IAAI;AAC9E,yCAAyC,YAAY,YAAY,aAAa,IAAI,oDAAoD;AACtI;AACA,qCAAqC,YAAY,GAAG,aAAa;AACjE;AACA,iCAAiC,WAAW;AAC5C,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA,6EAA6E,0BAA0B;AACvG;AACA;AACA;AACA,8EAA8E,wBAAwB;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,eAAe;AACpE;AACA,+DAA+D,cAAc,IAAI;AACjF;AACA,8BAA8B,kBAAkB,GAAG,4CAA4C;AAC/F,yCAAyC,EAAE,IAAI,oDAAoD;AACnG;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA,uC;;;;;;;ACnIa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,GAAS;AAC9B,aAAa,mBAAO,CAAC,GAAe;AACpC,aAAa,mBAAO,CAAC,GAAW;AAChC,iC;;;;;;;ACfa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6DAA6D;AAC5E;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,uC;;;;;;;ACzFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB,GAAG,4BAA4B;AACjD,sBAAsB,mBAAO,CAAC,GAAe;AAC7C;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,6BAA6B,IAAI;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,mC;;;;;;ACvGA;AACA,eAAe,KAAiD,oBAAoB,CAAqH,CAAC,oBAAoB,YAAY,OAAO,cAAc,aAAa,sCAAsC,SAAS,uBAAuB,8EAA8E,QAAQ,gBAAgB,uDAAuD,2BAA2B,wBAAwB,4BAA4B,mBAAmB,sBAAsB,8GAA8G,uDAAuD,kCAAkC,wBAAwB,gGAAgG,4BAA4B,mCAAmC,0BAA0B,WAAW,8BAA8B,2BAA2B,8DAA8D,EAAE,aAAa,4BAA4B,oBAAoB,6CAA6C,QAAQ,EAAE,6BAA6B,8CAA8C,gGAAgG,wBAAwB,6EAA6E,wQAAwQ,sEAAsE,mKAAmK,iJAAiJ,YAAY,WAAW,KAAK,0CAA0C,MAAM,yEAAyE,gIAAgI,QAAQ,iDAAiD,8CAA8C,EAAE,mCAAmC,qBAAqB,2BAA2B,0BAA0B,qBAAqB,MAAM,eAAe,KAAK,2CAA2C,yDAAyD,uBAAuB,2CAA2C,iDAAiD,gCAAgC,gBAAgB,sBAAsB,EAAE,8CAA8C,wBAAwB,wBAAwB,yDAAyD,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE,WAAW,IAAI,IAAI,IAAI,KAAK,IAAI,KAAK,EAAE,MAAM,qBAAqB,kCAAkC,iDAAiD,2DAA2D,gDAAgD,kBAAkB,4IAA4I,YAAY,uBAAuB,IAAI,KAAK,+BAA+B,MAAM,yCAAyC,4EAA4E,gBAAgB,uBAAuB,MAAM,kGAAkG,8BAA8B,WAAW,uBAAuB,IAAI,aAAa,gBAAgB,EAAE,yDAAyD,0BAA0B,wBAAwB,KAAK,yBAAyB,sDAAsD,2CAA2C,sHAAsH,sBAAsB,qEAAqE,QAAQ,YAAY,IAAI,MAAM,MAAM,QAAQ,cAAc,qCAAqC,uBAAuB,oDAAoD,oCAAoC,kBAAkB,8EAA8E,2BAA2B,kCAAkC,kBAAkB,kFAAkF,aAAa,SAAS,8BAA8B,GAAG,sDAAsD,0BAA0B,uCAAuC,8CAA8C,GAAG,GAAG,wBAAwB,kCAAkC,SAAS,uSAAuS,WAAW,sBAAsB,+DAA+D,8XAA8X,IAAI,2CAA2C,EAAE,aAAa,EAAE,+LAA+L,qBAAqB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,uBAAuB,eAAe,uCAAuC,6BAA6B,sBAAsB,8EAA8E,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,sCAAsC,SAAS,2HAA2H,SAAS,SAAS,2KAA2K,kEAAkE,+MAA+M,iBAAiB,WAAW,IAAI,GAAG,EAAE,wBAAwB,EAAE,GAAG,EAAE,SAAS,IAAI,GAAG,IAAI,4BAA4B,EAAE,GAAG,EAAE,SAAS,MAAM,GAAG,IAAI,UAAU,IAAI,YAAY,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,MAAM,UAAU,IAAI,YAAY,EAAE,GAAG,EAAE,SAAS,IAAI,GAAG,EAAE,qBAAqB,aAAa,YAAY,gTAAgT,WAAW,IAAI,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,IAAI,MAAM,EAAE,GAAG,EAAE,SAAS,IAAI,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,IAAI,GAAG,EAAE,iBAAiB,oCAAoC,0BAA0B,GAAG,0BAA0B,IAAI,0BAA0B,GAAG,0BAA0B,yBAAyB,WAAW,KAAK,WAAW,uBAAuB,SAAS,4JAA4J,cAAc,EAAE,EAAE,GAAG,EAAE,4EAA4E,eAAe,eAAe,aAAa,cAAc,swCAAswC,EAAE,UAAU,MAAM,gBAAgB,4CAA4C,uFAAuF,IAAI,gCAAgC,cAAc,gBAAgB,cAAc,aAAa,gBAAgB,MAAM,sBAAsB,QAAQ,IAAI,oBAAoB,SAAS,gBAAgB,MAAM,sBAAsB,QAAQ,IAAI,0BAA0B,SAAS,cAAc,yBAAyB,cAAc,sDAAsD,uBAAuB,GAAG,cAAc,2CAA2C,0BAA0B,GAAG,cAAc,4CAA4C,oBAAoB,uGAAuG,kBAAkB,gBAAgB,iBAAiB,8GAA8G,uEAAuE,gDAAgD,SAAS,MAAM,yBAAyB,UAAU,oHAAoH,YAAY,OAAO,4DAA4D,yBAAyB,wEAAwE,oKAAoK,OAAO,qDAAqD,SAAS,mGAAmG,0BAA0B,wBAAwB,WAAW,aAAa,wCAAwC,aAAa,wCAAwC,gBAAgB,wCAAwC,aAAa,gBAAgB,SAAS,UAAU,yBAAyB,kBAAkB,uCAAuC,mBAAmB,2BAA2B,kCAAkC,2BAA2B,+EAA+E,mDAAmD,qEAAqE,gBAAgB,yCAAyC,cAAc,kBAAkB,6CAA6C,8DAA8D,2BAA2B,0FAA0F,QAAQ,gBAAgB,IAAI,4BAA4B,uEAAuE,cAAc,YAAY,UAAU,cAAc,uBAAuB,cAAc,8BAA8B,KAAK,qBAAqB,qCAAqC,gBAAgB,QAAQ,0CAA0C,KAAK,sCAAsC,cAAc,sBAAsB,sBAAsB,0GAA0G,SAAS,oBAAoB,gCAAgC,qBAAqB,iCAAiC,iBAAiB,0CAA0C,iBAAiB,0CAA0C,oBAAoB,wBAAwB,iDAAiD,qBAAqB,wBAAwB,qDAAqD,kBAAkB,6CAA6C,iBAAiB,+CAA+C,oBAAoB,kBAAkB,wBAAwB,mCAAmC,mBAAmB,kBAAkB,wBAAwB,qCAAqC,0BAA0B,iCAAiC,yBAAyB,iCAAiC,EAAE,4EAA4E,EAAE,UAAU,EAAE,UAAU,EAAE,kGAAkG,EAAE,aAAa,EAAE,oJAAoJ,QAAQ,iKAAiK,eAAe,iEAAiE,4BAA4B,iBAAiB,mBAAmB,IAAI,2BAA2B,SAAS,mBAAmB,kFAAkF,SAAS,mBAAmB,2BAA2B,qCAAqC,sBAAsB,qCAAqC,sBAAsB,sBAAsB,uBAAuB,yCAAyC,YAAY,yBAAyB,8EAA8E,aAAa,mBAAmB,yBAAyB,8DAA8D,WAAW,kBAAkB,WAAW,kEAAkE,0BAA0B,iBAAiB,wBAAwB,2BAA2B,aAAa,KAAK,uBAAuB,qBAAqB,kBAAkB,aAAa,wBAAwB,SAAS,mDAAmD,+FAA+F,mFAAmF,iBAAiB,8BAA8B,iBAAiB,kCAAkC,oBAAoB,oCAAoC,WAAW,qBAAqB,sHAAsH,uBAAuB,WAAW,mCAAmC,SAAS,mDAAmD,+BAA+B,wCAAwC,SAAS,4BAA4B,2GAA2G,aAAa,WAAW,uBAAuB,wEAAwE,KAAK,gDAAgD,mBAAmB,YAAY,mBAAmB,wCAAwC,kCAAkC,KAAK,uCAAuC,YAAY,mBAAmB,sCAAsC,EAAE,SAAS,kBAAkB,gBAAgB,kBAAkB,yDAAyD,gBAAgB,2EAA2E,+BAA+B,MAAM,4BAA4B,MAAM,kBAAkB,wCAAwC,2BAA2B,eAAe,2GAA2G,qBAAqB,iBAAiB,sCAAsC,2BAA2B,eAAe,wCAAwC,2BAA2B,cAAc,oCAAoC,qBAAqB,cAAc,4CAA4C,2BAA2B,eAAe,gBAAgB,qBAAqB,iDAAiD,eAAe,iDAAiD,OAAO,MAAM,eAAe,oEAAoE,+FAA+F,MAAM,MAAM,eAAe,wGAAwG,4IAA4I,8BAA8B,0EAA0E,4FAA4F,4BAA4B,EAAE,sGAAsG,mCAAmC,EAAE,6BAA6B,sBAAsB,qBAAqB,sCAAsC,cAAc,sCAAsC,cAAc,sCAAsC,cAAc,sCAAsC,cAAc,sCAAsC,eAAe,yCAAyC,EAAE,4BAA4B,4BAA4B,MAAM,sBAAsB,yCAAyC,2EAA2E,oBAAoB,gCAAgC,EAAE,KAAK,+EAA+E,sDAAsD,2IAA2I,YAAY,oBAAoB,gCAAgC,GAAG,MAAM,oBAAoB,4BAA4B,YAAY,qBAAqB,YAAY,qBAAqB,YAAY,qBAAqB,YAAY,qBAAqB,YAAY,sBAAsB,gBAAgB,IAAI,sBAAsB,MAAM,MAAM,YAAY,YAAY,kDAAkD,MAAM,MAAM,YAAY,mCAAmC,kCAAkC,gDAAgD,MAAM,kCAAkC,iDAAiD,IAAI,YAAY,MAAM,2CAA2C,IAAI,YAAY,MAAM,uBAAuB,MAAM,QAAQ,oBAAoB,oCAAoC,kEAAkE,yFAAyF,4NAA4N,iCAAiC,uBAAuB,IAAI,YAAY,MAAM,0DAA0D,6FAA6F,qBAAqB,wBAAwB,MAAM,gBAAgB,sGAAsG,qBAAqB,YAAY,MAAM,UAAU,MAAM,4BAA4B,MAAM,kBAAkB,QAAQ,qCAAqC,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,QAAQ,6BAA6B,aAAa,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,WAAW,oBAAoB,MAAM,MAAM,eAAe,kaAAka,2BAA2B,WAAW,MAAM,eAAe,aAAa,oBAAoB,MAAM,0CAA0C,SAAS,kBAAkB,gBAAgB,QAAQ,oBAAoB,UAAU,0BAA0B,cAAc,qBAAqB,YAAY,EAAE,SAAS,0DAA0D,UAAU,sBAAsB,aAAa,kCAAkC,cAAc,kCAAkC,MAAM,QAAQ,MAAM,2DAA2D,mBAAmB,+BAA+B,SAAS,kBAAkB,gBAAgB,2BAA2B,0xBAA0xB,OAAO,+FAA+F,oBAAoB,OAAO,2CAA2C,uBAAuB,wEAAwE,6BAA6B,0HAA0H,6CAA6C,cAAc,mCAAmC,eAAe,oBAAoB,4DAA4D,QAAQ,oBAAoB,mBAAmB,mNAAmN,OAAO,oLAAoL,UAAU,qBAAqB,kBAAkB,sGAAsG,UAAU,+BAA+B,WAAW,4FAA4F,QAAQ,oCAAoC,gbAAgb,UAAU,+BAA+B,WAAW,sEAAsE,6CAA6C,0DAA0D,kEAAkE,aAAa,kCAAkC,cAAc,oCAAoC,sCAAsC,YAAY,iCAAiC,aAAa,oCAAoC,sCAAsC,cAAc,mCAAmC,mBAAmB,OAAO,mCAAmC,wBAAwB,MAAM,0HAA0H,eAAe,yCAAyC,sBAAsB,oCAAoC,MAAM,wBAAwB,MAAM,0FAA0F,aAAa,kCAAkC,kBAAkB,MAAM,wBAAwB,MAAM,uDAAuD,cAAc,wCAAwC,qBAAqB,kDAAkD,mCAAmC,sBAAsB,MAAM,kGAAkG,aAAa,0BAA0B,aAAa,0BAA0B,UAAU,kDAAkD,WAAW,kFAAkF,aAAa,uDAAuD,gCAAgC,QAAQ,yMAAyM,mCAAmC,yFAAyF,kBAAkB,iCAAiC,eAAe,oCAAoC,gBAAgB,sCAAsC,UAAU,OAAO,wDAAwD,cAAc,cAAc,sBAAsB,8GAA8G,4DAA4D,sBAAsB,UAAU,cAAc,kCAAkC,oDAAoD,sBAAsB,gBAAgB,eAAe,qCAAqC,eAAe,SAAS,kBAAkB,gBAAgB,YAAY,8EAA8E,QAAQ,2YAA2Y,WAAW,gBAAgB,SAAS,8IAA8I,uBAAuB,UAAU,6CAA6C,WAAW,wDAAwD,aAAa,+BAA+B,8BAA8B,yHAAyH,yFAAyF,wBAAwB,mBAAmB,MAAM,IAAI,kGAAkG,KAAK,aAAa,gBAAgB,sBAAsB,+EAA+E,SAAS,OAAO,MAAM,SAAS,GAAG,SAAS,iBAAiB,iFAAiF,WAAW,IAAI,iBAAiB,+BAA+B,0PAA0P,gEAAgE,oBAAoB,UAAU,0EAA0E,oCAAoC,iBAAiB,GAAG,yBAAyB,cAAc,uBAAuB,uBAAuB,gDAAgD,+BAA+B,QAAQ,aAAa,0FAA0F,WAAW,8CAA8C,EAAE,0CAA0C,iBAAiB,iEAAiE,YAAY,IAAI,sBAAsB,qEAAqE,yBAAyB,QAAQ,aAAa,SAAS,YAAY,eAAe,yBAAyB,kDAAkD,WAAW,eAAe,0BAA0B,eAAe,yBAAyB,2CAA2C,EAAE,uBAAuB,4CAA4C,sGAAsG,+CAA+C,aAAa,oBAAoB,6DAA6D,GAAG,qBAAqB,6BAA6B,8GAA8G,gDAAgD,QAAQ,iGAAiG,cAAc,kBAAkB,yCAAyC,gBAAgB,gEAAgE,WAAW,SAAS,oCAAoC,aAAa,KAAK,mBAAmB,OAAO,GAAG,qBAAqB,cAAc,mEAAmE,4BAA4B,wBAAwB,mBAAmB,oBAAoB,gBAAgB,sBAAsB,iBAAiB,qCAAqC,eAAe,kBAAkB,gDAAgD,0BAA0B,YAAY,iCAAiC,iBAAiB,YAAY,iBAAiB,YAAY,SAAS,yBAAyB,YAAY,6BAA6B,wBAAwB,eAAe,oBAAoB,UAAU,8BAA8B,KAAK,0QAA0Q,QAAQ,6CAA6C,uBAAuB,kBAAkB,4BAA4B,QAAQ,kCAAkC,QAAQ,2EAA2E,YAAY,+DAA+D,UAAU,6CAA6C,QAAQ,qBAAqB,WAAW,sBAAsB,UAAU,WAAW,0BAA0B,SAAS,kBAAkB,gBAAgB,WAAW,4BAA4B,UAAU,oDAAoD,UAAU,yWAAyW,SAAS,oDAAoD,QAAQ,oDAAoD,SAAS,oDAAoD,UAAU,6BAA6B,SAAS,uBAAuB,WAAW,mGAAmG,UAAU,mBAAmB,YAAY,oBAAoB,iBAAiB,gEAAgE,SAAS,kOAAkO,WAAW,wBAAwB,WAAW,gDAAgD,YAAY,IAAI,QAAQ,KAAK,0BAA0B,4CAA4C,YAAY,YAAY,6EAA6E,UAAU,wBAAwB,QAAQ,mBAAmB,IAAI,0CAA0C,YAAY,aAAa,gCAAgC,QAAQ,+BAA+B,OAAO,kCAAkC,iBAAiB,iBAAiB,iBAAiB,iBAAiB,OAAO,wBAAwB,UAAU,uBAAuB,MAAM,+EAA+E,SAAS,0DAA0D,OAAO,8BAA8B,WAAW,+IAA+I,sBAAsB,UAAU,WAAW,kCAAkC,sCAAsC,GAAG,2DAA2D,8BAA8B,SAAS,SAAS,8BAA8B,WAAW,wBAAwB,SAAS,6DAA6D,iBAAiB,0CAA0C,WAAW,0FAA0F,kBAAkB,6BAA6B,oEAAoE,yBAAyB,SAAS,uBAAuB,WAAW,iBAAiB,SAAS,oCAAoC,QAAQ,sBAAsB,2BAA2B,sBAAsB,4BAA4B,iBAAiB,6BAA6B,sBAAsB,QAAQ,WAAW,wEAAwE,mCAAmC,WAAW,YAAY,gCAAgC,aAAa,0BAA0B,mBAAmB,0BAA0B,kDAAkD,MAAM,2CAA2C,aAAa,6DAA6D,cAAc,4BAA4B,IAAI,oCAAoC,sBAAsB,yCAAyC,MAAM,qBAAqB,YAAY,IAAI,wBAAwB,wFAAwF,SAAS,uEAAuE,EAAE,2EAA2E,8CAA8C,KAAK,uFAAuF,0UAA0U,YAAY,kBAAkB,uBAAuB,qBAAqB,sCAAsC,cAAc,oBAAoB,iBAAiB,sBAAsB,gHAAgH,EAAE,YAAY,wBAAwB,MAAM,gEAAgE,MAAM,kEAAkE,OAAO,oBAAoB,mBAAmB,WAAW,wBAAwB,QAAQ,wCAAwC,QAAQ,wCAAwC,iBAAiB,YAAY,UAAU,6BAA6B,UAAU,sBAAsB,uBAAuB,OAAO,eAAe,WAAW,KAAK,oGAAoG,EAAE,SAAS,aAAa,iCAAiC,wBAAwB,sBAAsB,OAAO,0BAA0B,mBAAmB,WAAW,uBAAuB,UAAU,oBAAoB,4DAA4D,SAAS,4BAA4B,iBAAiB,kKAAkK,KAAK,wBAAwB,KAAK,yBAAyB,MAAM,gBAAgB,sCAAsC,IAAI,4DAA4D,oBAAoB,SAAS,4CAA4C,gBAAgB,qBAAqB,aAAa,IAAI,GAAG,iBAAiB,kBAAkB,oDAAoD,4CAA4C,gBAAgB,oBAAoB,eAAe,6DAA6D,sBAAsB,oBAAoB,mDAAmD,qBAAqB,yDAAyD,gBAAgB,kCAAkC,sBAAsB,mDAAmD,+CAA+C,4BAA4B,yCAAyC,kBAAkB,UAAU,mJAAmJ,8BAA8B,uCAAuC,WAAW,MAAM,iBAAiB,kCAAkC,oFAAoF,0BAA0B,KAAK,oEAAoE,YAAY,2BAA2B,2BAA2B,6BAA6B,uEAAuE,wBAAwB,uBAAuB,mBAAmB,KAAK,wBAAwB,kEAAkE,iBAAiB,qBAAqB,qBAAqB,KAAK,uBAAuB,uBAAuB,kBAAkB,KAAK,yBAAyB,kEAAkE,kBAAkB,qBAAqB,sBAAsB,KAAK,yBAAyB,uBAAuB,gBAAgB,KAAK,wBAAwB,uBAAuB,eAAe,KAAK,oCAAoC,mEAAmE,gBAAgB,KAAK,qBAAqB,+BAA+B,cAAc,uBAAuB,+FAA+F,YAAY,kBAAkB,kCAAkC,qBAAqB,8CAA8C,0BAA0B,mBAAmB,uBAAuB,6BAA6B,YAAY,qMAAqM,2MAA2M,wBAAwB,8CAA8C,GAAG,IAAI,gBAAgB,uBAAuB,mCAAmC,sBAAsB,yEAAyE,4BAA4B,4CAA4C,qBAAqB,IAAI,mCAAmC,4EAA4E,UAAU,wBAAwB,wBAAwB,mDAAmD,mEAAmE,oBAAoB,oCAAoC,yBAAyB,gCAAgC,iCAAiC,sBAAsB,wBAAwB,sBAAsB,EAAE,+CAA+C,iCAAiC,EAAE,oBAAoB,kBAAkB,6BAA6B,sDAAsD,QAAQ,yCAAyC,+DAA+D,qCAAqC,kBAAkB,kBAAkB,oBAAoB,mBAAmB,qBAAqB,UAAU,YAAY,UAAU,aAAa,aAAa,qBAAqB,eAAe,yBAAyB,eAAe,yBAAyB,eAAe,wDAAwD,eAAe,wDAAwD,eAAe,yBAAyB,eAAe,yBAAyB,eAAe,wDAAwD,eAAe,wDAAwD,cAAc,QAAQ,qEAAqE,oBAAoB,mBAAmB,wBAAwB,UAAU,oBAAoB,0EAA0E,wBAAwB,6BAA6B,4CAA4C,GAAG,kBAAkB,oBAAoB,mDAAmD,SAAS,WAAW,wEAAwE,+BAA+B,kDAAkD,0BAA0B,iBAAiB,+DAA+D,0BAA0B,aAAa,0BAA0B,EAAE,iBAAiB,+DAA+D,0BAA0B,aAAa,0BAA0B,EAAE,iBAAiB,WAAW,8BAA8B,oBAAoB,iBAAiB,mDAAmD,YAAY,iEAAiE,OAAO,cAAc,UAAU,yCAAyC,WAAW,kBAAkB,UAAU,iEAAiE,MAAM,+BAA+B,YAAY,WAAW,eAAe,mCAAmC,OAAO,0BAA0B,qCAAqC,IAAI,mBAAmB,oBAAoB,mBAAmB,wBAAwB,YAAY,gEAAgE,OAAO,cAAc,UAAU,yCAAyC,WAAW,kBAAkB,UAAU,iEAAiE,MAAM,+BAA+B,GAAG,WAAW,cAAc,kCAAkC,OAAO,2BAA2B,wCAAwC,uDAAuD,EAAE,IAAI,kBAAkB,oBAAoB,mBAAmB,sBAAsB,UAAU,kBAAkB,2BAA2B,gCAAgC,wBAAwB,yLAAyL,sCAAsC,MAAM,gCAAgC,mBAAmB,8HAA8H,SAAS,MAAM,gBAAgB,WAAW,uBAAuB,4CAA4C,IAAI,gBAAgB,oBAAoB,OAAO,8BAA8B,iCAAiC,4EAA4E,uBAAuB,UAAU,oBAAoB,8DAA8D,KAAK,wCAAwC,YAAY,eAAe,WAAW,kHAAkH,uBAAuB,IAAI,2BAA2B,SAAS,UAAU,MAAM,oBAAoB,oBAAoB,KAAK,gHAAgH,YAAY,SAAS,OAAO,yDAAyD,WAAW,WAAW,0BAA0B,IAAI,8BAA8B,mBAAmB,aAAa,kCAAkC,cAAc,kCAAkC,sBAAsB,IAAI,EAAE,mBAAmB,sDAAsD,aAAa,QAAQ,2CAA2C,wDAAwD,eAAe,wDAAwD,mBAAmB,oBAAoB,6CAA6C,oBAAoB,oBAAoB,+CAA+C,oBAAoB,mBAAmB,qBAAqB,QAAQ,qFAAqF,UAAU,kDAAkD,cAAc,2CAA2C,oBAAoB,kCAAkC,UAAU,oBAAoB,gEAAgE,YAAY,WAAW,uBAAuB,wEAAwE,IAAI,eAAe,oBAAoB,mBAAmB,uBAAuB,UAAU,mCAAmC,UAAU,6BAA6B,SAAS,0CAA0C,WAAW,4BAA4B,UAAU,iEAAiE,SAAS,mCAAmC,iBAAiB,mBAAmB,yDAAyD,GAAG,WAAW,aAAa,iCAAiC,OAAO,0BAA0B,gGAAgG,GAAG,SAAS,gBAAgB,iBAAiB,6HAA6H,iBAAiB,UAAU,gBAAgB,SAAS,kBAAkB,gCAAgC,iBAAiB,6BAA6B,iBAAiB,+BAA+B,0BAA0B,mBAAmB,uIAAuI,2BAA2B,4BAA4B,QAAQ,gDAAgD,sBAAsB,iBAAiB,sFAAsF,SAAS,OAAO,UAAU,oBAAoB,uBAAuB,2BAA2B,YAAY,uDAAuD,oBAAoB,eAAe,uBAAuB,QAAQ,cAAc,cAAc,8BAA8B,cAAc,6HAA6H,wBAAwB,oBAAoB,uBAAuB,sCAAsC,cAAc,+BAA+B,mCAAmC,kBAAkB,qBAAqB,+DAA+D,0EAA0E,MAAM,0DAA0D,EAAE,oBAAoB,kCAAkC,sCAAsC,cAAc,+BAA+B,mCAAmC,kBAAkB,YAAY,0BAA0B,0CAA0C,qIAAqI,MAAM,mDAAmD,EAAE,UAAU,wCAAwC,KAAK,kBAAkB,+CAA+C,iBAAiB,yCAAyC,iBAAiB,2BAA2B,iBAAiB,2BAA2B,iBAAiB,6DAA6D,iBAAiB,mDAAmD,iBAAiB,mDAAmD,iBAAiB,yCAAyC,mBAAmB,6BAA6B,iBAAiB,mEAAmE,2BAA2B,wBAAwB,IAAI,0BAA0B,uBAAuB,yBAAyB,8BAA8B,4CAA4C,4BAA4B,IAAI,4BAA4B,qBAAqB,sBAAsB,eAAe,6EAA6E,iBAAiB,qBAAqB,mBAAmB,mBAAmB,KAAK,gDAAgD,gCAAgC,mDAAmD,iBAAiB,+CAA+C,qHAAqH,eAAe,kDAAkD,qBAAqB,0CAA0C,gCAAgC,eAAe,8BAA8B,4DAA4D,yBAAyB,eAAe,sCAAsC,oBAAoB,OAAO,mFAAmF,UAAU,oBAAoB,gEAAgE,KAAK,uRAAuR,YAAY,gBAAgB,4FAA4F,aAAa,SAAS,kIAAkI,KAAK,8BAA8B,oHAAoH,eAAe,uBAAuB,KAAK,0CAA0C,MAAM,KAAK,kCAAkC,KAAK,uBAAuB,aAAa,SAAS,0BAA0B,0BAA0B,KAAK,0BAA0B,kCAAkC,SAAS,0BAA0B,KAAK,+BAA+B,aAAa,SAAS,yCAAyC,iEAAiE,IAAI,UAAU,oBAAoB,QAAQ,mFAAmF,KAAK,8qBAA8qB,YAAY,WAAW,mBAAmB,SAAS,uBAAuB,IAAI,2NAA2N,aAAa,QAAQ,aAAa,iBAAiB,mLAAmL,SAAS,eAAe,kHAAkH,MAAM,aAAa,8DAA8D,8DAA8D,IAAI,OAAO,mEAAmE,YAAY,MAAM,QAAQ,yDAAyD,WAAW,oDAAoD,MAAM,qDAAqD,QAAQ,8CAA8C,QAAQ,6BAA6B,wBAAwB,+TAA+T,mBAAmB,MAAM,SAAS,kBAAkB,gBAAgB,QAAQ,mDAAmD,UAAU,mBAAmB,UAAU,mBAAmB,SAAS,kBAAkB,gBAAgB,QAAQ,6BAA6B,yGAAyG,yCAAyC,UAAU,aAAa,0FAA0F,aAAa,kFAAkF,2CAA2C,SAAS,kBAAkB,gBAAgB,SAAS,iCAAiC,IAAI,4BAA4B,kEAAkE,+BAA+B,YAAY,QAAQ,sEAAsE,QAAQ,WAAW,kBAAkB,yCAAyC,4BAA4B,qEAAqE,UAAU,mBAAmB,UAAU,UAAU,eAAe,KAAK,SAAS,EAAE,0DAA0D,wBAAwB,UAAU,oBAAoB,kBAAkB,yBAAyB,cAAc,MAAM,MAAM,iEAAiE,cAAc,0BAA0B,EAAE,oBAAoB,mBAAmB,qBAAqB,QAAQ,yDAAyD,QAAQ,+BAA+B,UAAU,iEAAiE,UAAU,6CAA6C,QAAQ,8FAA8F,UAAU,oBAAoB,0DAA0D,SAAS,iEAAiE,KAAK,wDAAwD,KAAK,yDAAyD,8BAA8B,WAAW,oBAAoB,wCAAwC,IAAI,eAAe,QAAQ,gCAAgC,8DAA8D,kBAAkB,+BAA+B,oBAAoB,kDAAkD,kBAAkB,mGAAmG,oBAAoB,oBAAoB,iEAAiE,oBAAoB,mBAAmB,yBAAyB,GAAG,WAAW,uBAAuB,wCAAwC,IAAI,oCAAoC,oBAAoB,mBAAmB,0BAA0B,GAAG,WAAW,wBAAwB,wCAAwC,IAAI,qCAAqC,oBAAoB,mBAAmB,sBAAsB,MAAM,YAAY,KAAK,WAAW,sBAAsB,kCAAkC,IAAI,eAAe,SAAS,cAAc,iCAAiC,QAAQ,sCAAsC,OAAO,oCAAoC,QAAQ,2BAA2B,6BAA6B,oGAAoG,UAAU,4JAA4J,QAAQ,oBAAoB,wHAAwH,UAAU,mIAAmI,wBAAwB,MAAM,EAAE,oFAAoF,cAAc,OAAO,+CAA+C,aAAa,EAAE,oFAAoF,cAAc,8BAA8B,oFAAoF,gBAAgB,6BAA6B,iBAAiB,+BAA+B,oBAAoB,iCAAiC,UAAU,WAAW,2BAA2B,KAAK,uEAAuE,EAAE,WAAW,yBAAyB,KAAK,6BAA6B,UAAU,WAAW,KAAK,wBAAwB,KAAK,kGAAkG,gBAAgB,sCAAsC,OAAO,4CAA4C,eAAe,iBAAiB,qCAAqC,oBAAoB,kBAAkB,wTAAwT,SAAS,wBAAwB,SAAS,6DAA6D,aAAa,2DAA2D,+BAA+B,uBAAuB,4DAA4D,wBAAwB,oBAAoB,kDAAkD,qBAAqB,uDAAuD,QAAQ,wCAAwC,WAAW,oDAAoD,OAAO,qDAAqD,WAAW,qBAAqB,iCAAiC,oBAAoB,0BAA0B,gBAAgB,wCAAwC,QAAQ,0BAA0B,+CAA+C,4CAA4C,+BAA+B,wBAAwB,qCAAqC,qBAAqB,KAAK,8EAA8E,iCAAiC,wBAAwB,gCAAgC,uBAAuB,qDAAqD,yLAAyL,QAAQ,+BAA+B,UAAU,0DAA0D,SAAS,gDAAgD,OAAO,iCAAiC,QAAQ,4DAA4D,cAAc,sCAAsC,0FAA0F,aAAa,qEAAqE,gBAAgB,gJAAgJ,cAAc,2BAA2B,6BAA6B,SAAS,sDAAsD,0IAA0I,+BAA+B,IAAI,EAAE,oCAAoC,iCAAiC,SAAS,mCAAmC,IAAI,KAAK,oCAAoC,QAAQ,2BAA2B,yJAAyJ,4JAA4J,GAAG,SAAS,qBAAqB,gGAAgG,EAAE,oBAAoB,eAAe,yRAAyR,0QAA0Q,uBAAuB,iBAAiB,kLAAkL,kDAAkD,UAAU,kDAAkD,kBAAkB,0CAA0C,SAAS,6BAA6B,eAAe,gDAAgD,6HAA6H,iBAAiB,mCAAmC,2BAA2B,8HAA8H,SAAS,yBAAyB,WAAW,0DAA0D,UAAU,0BAA0B,QAAQ,oCAAoC,WAAW,uEAAuE,SAAS,sBAAsB,YAAY,uJAAuJ,SAAS,kCAAkC,YAAY,mEAAmE,iCAAiC,+CAA+C,oBAAoB,WAAW,oDAAoD,YAAY,6FAA6F,MAAM,YAAY,oBAAoB,sFAAsF,iCAAiC,aAAa,mEAAmE,6CAA6C,6CAA6C,YAAY,mFAAmF,eAAe,yBAAyB,mFAAmF,oDAAoD,QAAQ,2DAA2D,WAAW,mDAAmD,gBAAgB,8GAA8G,iCAAiC,QAAQ,6BAA6B,6BAA6B,gEAAgE,qBAAqB,4FAA4F,qDAAqD,4BAA4B,iDAAiD,SAAS,kKAAkK,QAAQ,6BAA6B,qBAAqB,yBAAyB,YAAY,yDAAyD,aAAa,wBAAwB,kCAAkC,eAAe,2DAA2D,IAAI,KAAK,gEAAgE,iEAAiE,sBAAsB,qBAAqB,mDAAmD,sBAAsB,wBAAwB,aAAa,QAAQ,SAAS,iCAAiC,IAAI,KAAK,+CAA+C,8CAA8C,SAAS,oBAAoB,qBAAqB,yCAAyC,qDAAqD,kCAAkC,oJAAoJ,wBAAwB,sBAAsB,UAAU,QAAQ,SAAS,gCAAgC,wCAAwC,6BAA6B,WAAW,aAAa,6DAA6D,EAAE,mDAAmD,cAAc,sEAAsE,qHAAqH,SAAS,cAAc,4BAA4B,OAAO,mCAAmC,eAAe,kDAAkD,eAAe,iCAAiC,8GAA8G,UAAU,8BAA8B,gEAAgE,WAAW,2CAA2C,SAAS,uBAAuB,QAAQ,WAAW,YAAY,sBAAsB,KAAK,wBAAwB,oIAAoI,KAAK,kBAAkB,uBAAuB,2BAA2B,YAAY,UAAU,8BAA8B,2DAA2D,GAAG,SAAS,eAAe,6CAA6C,4FAA4F,YAAY,2BAA2B,iCAAiC,8CAA8C,sBAAsB,6FAA6F,eAAe,+GAA+G,kBAAkB,wFAAwF,QAAQ,UAAU,kCAAkC,UAAU,iCAAiC,kBAAkB,+CAA+C,MAAM,EAAE,QAAQ,sCAAsC,mDAAmD,8BAA8B,+BAA+B,eAAe,qDAAqD,eAAe,6DAA6D,MAAM,aAAa,0DAA0D,6BAA6B,iCAAiC,mCAAmC,mCAAmC,WAAW,6CAA6C,0CAA0C,8BAA8B,gCAAgC,eAAe,+CAA+C,iBAAiB,YAAY,wCAAwC,kBAAkB,yFAAyF,2BAA2B,uCAAuC,4CAA4C,cAAc,8BAA8B,gHAAgH,eAAe,yBAAyB,MAAM,QAAQ,gDAAgD,cAAc,kBAAkB,+BAA+B,MAAM,sCAAsC,0GAA0G,cAAc,sFAAsF,gBAAgB,+EAA+E,eAAe,iFAAiF,eAAe,qEAAqE,QAAQ,gCAAgC,MAAM,gCAAgC,SAAS,qCAAqC,SAAS,qCAAqC,YAAY,wBAAwB,wBAAwB,kDAAkD,oCAAoC,WAAW,8BAA8B,0CAA0C,eAAe,2CAA2C,eAAe,kBAAkB,mCAAmC,mBAAmB,sCAAsC,oCAAoC,8BAA8B,4BAA4B,eAAe,2CAA2C,mCAAmC,mBAAmB,sCAAsC,OAAO,iCAAiC,OAAO,iCAAiC,WAAW,sBAAsB,aAAa,wBAAwB,WAAW,MAAM,kHAAkH,UAAU,oCAAoC,WAAW,qCAAqC,eAAe,oDAAoD,2CAA2C,mEAAmE,8BAA8B,8BAA8B,eAAe,4CAA4C,wCAAwC,YAAY,sCAAsC,kBAAkB,oDAAoD,WAAW,sCAAsC,4DAA4D,2JAA2J,QAAQ,0BAA0B,iBAAiB,oBAAoB,mBAAmB,qCAAqC,OAAO,6FAA6F,SAAS,0IAA0I,YAAY,gCAAgC,sBAAsB,0EAA0E,kBAAkB,kBAAkB,wBAAwB,wDAAwD,OAAO,wCAAwC,GAAG,WAAW,qBAAqB,wBAAwB,IAAI,iBAAiB,oBAAoB,mBAAmB,wBAAwB,GAAG,WAAW,qBAAqB,wBAAwB,IAAI,iBAAiB,QAAQ,iCAAiC,8FAA8F,mBAAmB,yCAAyC,6BAA6B,uDAAuD,6BAA6B,uDAAuD,kCAAkC,0BAA0B,8BAA8B,yDAAyD,8BAA8B,yDAAyD,oCAAoC,4BAA4B,gBAAgB,wBAAwB,gBAAgB,wBAAwB,qBAAqB,wBAAwB,mBAAmB,8BAA8B,oBAAoB,mBAAmB,kFAAkF,WAAW,4EAA4E,WAAW,yDAAyD,aAAa,QAAQ,yBAAyB,uBAAuB,yFAAyF,sGAAsG,wBAAwB,YAAY,WAAW,+DAA+D,QAAQ,eAAe,6BAA6B,QAAQ,KAAK,uBAAuB,IAAI,iIAAiI,SAAS,iEAAiE,iDAAiD,IAAI,uBAAuB,iCAAiC,YAAY,WAAW,uBAAuB,gCAAgC,2BAA2B,iCAAiC,IAAI,eAAe,oBAAoB,mBAAmB,qCAAqC,MAAM,yBAAyB,MAAM,yBAAyB,UAAU,qBAAqB,sBAAsB,kCAAkC,qHAAqH,sCAAsC,QAAQ,sKAAsK,YAAY,OAAO,wBAAwB,eAAe,qDAAqD,GAAG,OAAO,uBAAuB,iCAAiC,gBAAgB,oBAAoB,mBAAmB,uBAAuB,UAAU,wBAAwB,MAAM,wBAAwB,MAAM,kBAAkB,QAAQ,yCAAyC,MAAM,yCAAyC,KAAK,WAAW,wBAAwB,0CAA0C,IAAI,iBAAiB,oBAAoB,mBAAmB,yBAAyB,SAAS,2CAA2C,WAAW,kBAAkB,UAAU,+CAA+C,GAAG,WAAW,mBAAmB,+BAA+B,GAAG,UAAU,UAAU,mCAAmC,aAAa,sDAAsD,mDAAmD,UAAU,qCAAqC,mBAAmB,oBAAoB,mBAAmB,+BAA+B,GAAG,WAAW,+BAA+B,kCAAkC,IAAI,wBAAwB,QAAQ,mCAAmC,wCAAwC,MAAM,IAAI,WAAW,SAAS,OAAO,2FAA2F,gBAAgB,QAAQ,gBAAgB,uBAAuB,gBAAgB,uBAAuB,kCAAkC,+CAA+C,sCAAsC,sBAAsB,uBAAuB,kCAAkC,4DAA4D,wCAAwC,iDAAiD,qBAAqB,QAAQ,iCAAiC,+CAA+C,6BAA6B,sCAAsC,6BAA6B,wCAAwC,oBAAoB,mBAAmB,mBAAmB,YAAY,WAAW,oBAAoB,wBAAwB,IAAI,YAAY,oBAAoB,mBAAmB,kBAAkB,UAAU,6BAA6B,MAAM,8BAA8B,YAAY,WAAW,oBAAoB,8BAA8B,GAAG,UAAU,SAAS,sBAAsB,kBAAkB,mBAAmB,2BAA2B,mBAAmB,qCAAqC,WAAW,oBAAoB,gFAAgF,UAAU,sBAAsB,uDAAuD,YAAY,oBAAoB,mBAAmB,qBAAqB,SAAS,2CAA2C,WAAW,kBAAkB,UAAU,0CAA0C,GAAG,WAAW,mBAAmB,+BAA+B,GAAG,UAAU,SAAS,8BAA8B,aAAa,sDAAsD,8CAA8C,UAAU,gCAAgC,eAAe,oBAAoB,mBAAmB,qBAAqB,UAAU,iDAAiD,4DAA4D,iKAAiK,GAAG,UAAU,qBAAqB,wCAAwC,eAAe,oBAAoB,mBAAmB,sBAAsB,cAAc,qCAAqC,aAAa,EAAE,+BAA+B,wBAAwB,EAAE,UAAU,kCAAkC,eAAe,eAAe,UAAU,EAAE,oCAAoC,EAAE,YAAY,IAAI,QAAQ,SAAS,WAAW,kCAAkC,iBAAiB,qCAAqC,gBAAgB,oBAAoB,mBAAmB,yBAAyB,QAAQ,qBAAqB,wBAAwB,QAAQ,qBAAqB,WAAW,uCAAuC,QAAQ,+BAA+B,GAAG,WAAW,0BAA0B,mDAAmD,GAAG,OAAO,yBAAyB,eAAe,MAAM,0EAA0E,uBAAuB,uBAAuB,mBAAmB,cAAc,iCAAiC,OAAO,oBAAoB,+EAA+E,aAAa,kFAAkF,8CAA8C,oBAAoB,mBAAmB,oBAAoB,SAAS,0CAA0C,GAAG,WAAW,qBAAqB,iCAAiC,IAAI,cAAc,WAAW,sWAAsW,aAAa,aAAa,sCAAsC,SAAS,qEAAqE,UAAU,iDAAiD,EAAE,4BAA4B,UAAU,qCAAqC,KAAK,qHAAqH,yCAAyC,4CAA4C,4BAA4B,qBAAqB,oDAAoD,QAAQ,eAAe,KAAK,YAAY,mCAAmC,2BAA2B,MAAM,mBAAmB,MAAM,mBAAmB,KAAK,6CAA6C,aAAa,aAAa,sCAAsC,SAAS,aAAa,0vFAA0vF,qBAAqB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,sCAAsC,eAAe,aAAa,sCAAsC,SAAS,6CAA6C,wBAAwB,cAAc,yCAAyC,gEAAgE,EAAE,mDAAmD,qDAAqD,mBAAmB,IAAI,aAAa,MAAM,aAAa,qBAAqB,8FAA8F,EAAE,0IAA0I,mEAAmE,qBAAqB,OAAO,qCAAqC,mCAAmC,aAAa,MAAM,mBAAmB,qCAAqC,OAAO,8CAA8C,qCAAqC,OAAO,+CAA+C,gBAAgB,aAAa,aAAa,sCAAsC,SAAS,EAAE,SAAS,MAAM,oBAAoB,YAAY,uBAAuB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,0iBAA0iB,YAAY,gCAAgC,6BAA6B,eAAe,mCAAmC,6BAA6B,gBAAgB,2CAA2C,6BAA6B,wBAAwB,uCAAuC,6BAA6B,oBAAoB,uCAAuC,6BAA6B,oBAAoB,iCAAiC,6BAA6B,cAAc,mCAAmC,6BAA6B,gBAAgB,oCAAoC,6BAA6B,iBAAiB,iDAAiD,6BAA6B,8BAA8B,kDAAkD,6BAA6B,+BAA+B,oDAAoD,6BAA6B,iCAAiC,yCAAyC,6BAA6B,sBAAsB,2DAA2D,6BAA6B,wCAAwC,sDAAsD,6BAA6B,mCAAmC,EAAE,YAAY,gCAAgC,6BAA6B,kBAAkB,EAAE,YAAY,+BAA+B,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,EAAE,iBAAiB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,kFAAkF,SAAS,aAAa,sCAAsC,SAAS,EAAE,SAAS,aAAa,sCAAsC,SAAS,EAAE,SAAS,aAAa,MAAM,sCAAsC,SAAS,sEAAsE,2CAA2C,SAAS,aAAa,sCAAsC,SAAS,EAAE,SAAS,aAAa,sCAAsC,SAAS,EAAE,SAAS,aAAa,MAAM,sCAAsC,SAAS,gEAAgE,iDAAiD,SAAS,aAAa,sCAAsC,SAAS,EAAE,SAAS,aAAa,sCAAsC,SAAS,EAAE,WAAW,aAAa,cAAc,oHAAoH,EAAE,oFAAoF,WAAW,aAAa,cAAc,iGAAiG,EAAE,+EAA+E,cAAc,IAAI,kBAAkB,cAAc,WAAW,gBAAgB,4DAA4D,mCAAmC,+BAA+B,IAAI,8BAA8B,oBAAoB,EAAE,WAAW,aAAa,cAAc,mXAAmX,EAAE,YAAY,aAAa,0BAA0B,mEAAmE,cAAc,0BAA0B,iDAAiD,gBAAgB,iDAAiD,cAAc,qCAAqC,oBAAoB,0BAA0B,qCAAqC,sBAAsB,qCAAqC,gBAAgB,UAAU,WAAW,iBAAiB,6CAA6C,SAAS,gBAAgB,0CAA0C,8DAA8D,gBAAgB,WAAW,gDAAgD,cAAc,2BAA2B,kBAAkB,4DAA4D,6DAA6D,kBAAkB,4DAA4D,+DAA+D,kBAAkB,8CAA8C,6CAA6C,gBAAgB,gCAAgC,sCAAsC,gBAAgB,2CAA2C,cAAc,qDAAqD,cAAc,uCAAuC,oBAAoB,sEAAsE,kBAAkB,qEAAqE,kBAAkB,qEAAqE,gBAAgB,0DAA0D,gBAAgB,4DAA4D,8PAA8P,kBAAkB,yDAAyD,oBAAoB,6EAA6E,YAAY,WAAW,aAAa,cAAc,iXAAiX,EAAE,YAAY,aAAa,0BAA0B,iFAAiF,cAAc,0BAA0B,qEAAqE,gBAAgB,qEAAqE,cAAc,mDAAmD,wBAAwB,0BAA0B,mDAAmD,0BAA0B,mDAAmD,gBAAgB,wDAAwD,gGAAgG,cAAc,2BAA2B,kBAAkB,wFAAwF,2FAA2F,kBAAkB,0EAA0E,6EAA6E,kBAAkB,4DAA4D,2DAA2D,kBAAkB,4DAA4D,mEAAmE,gBAAgB,gCAAgC,oDAAoD,gBAAgB,yDAAyD,gBAAgB,yDAAyD,cAAc,0EAA0E,cAAc,mDAAmD,kBAAkB,mGAAmG,kBAAkB,mGAAmG,kBAAkB,iFAAiF,oBAAoB,+GAA+G,gBAAgB,oFAAoF,gBAAgB,wFAAwF,0XAA0X,YAAY,WAAW,aAAa,cAAc,meAAme,EAAE,YAAY,aAAa,0BAA0B,sGAAsG,gBAAgB,oGAAoG,cAAc,0BAA0B,mGAAmG,gBAAgB,mGAAmG,8BAA8B,0BAA0B,wEAAwE,gCAAgC,wEAAwE,cAAc,wEAAwE,gBAAgB,UAAU,yBAAyB,mDAAmD,+FAA+F,SAAS,gBAAgB,gHAAgH,4JAA4J,gBAAgB,mEAAmE,8HAA8H,cAAc,mEAAmE,4CAA4C,kBAAkB,kIAAkI,kKAAkK,kBAAkB,iFAAiF,gGAAgG,kBAAkB,+FAA+F,4GAA4G,kBAAkB,kBAAkB,+GAA+G,gBAAgB,8EAA8E,gBAAgB,gCAAgC,yEAAyE,gBAAgB,8EAA8E,gBAAgB,0FAA0F,gBAAgB,wGAAwG,gGAAgG,gBAAgB,4QAA4Q,qNAAqN,kBAAkB,8EAA8E,cAAc,uGAAuG,cAAc,gEAAgE,kBAAkB,gJAAgJ,kBAAkB,gJAAgJ,kBAAkB,qHAAqH,oBAAoB,kKAAkK,gBAAgB,2HAA2H,gBAAgB,kIAAkI,ojBAAojB,YAAY,WAAW,aAAa,cAAc,+xBAA+xB,EAAE,YAAY,aAAa,2BAA2B,6JAA6J,cAAc,2BAA2B,qLAAqL,gBAAgB,qLAAqL,4CAA4C,2BAA2B,+HAA+H,8CAA8C,+HAA+H,cAAc,+HAA+H,gBAAgB,UAAU,+CAA+C,6GAA6G,iLAAiL,SAAS,gBAAgB,4QAA4Q,8WAA8W,gBAAgB,0HAA0H,urBAAurB,cAAc,0HAA0H,8HAA8H,kBAAkB,sJAAsJ,ybAAyb,kBAAkB,iDAAiD,qaAAqa,kBAAkB,yBAAyB,6MAA6M,oBAAoB,6FAA6F,ohBAAohB,kBAAkB,0FAA0F,oNAAoN,kBAAkB,0FAA0F,oNAAoN,kBAAkB,wFAAwF,sNAAsN,gBAAgB,wIAAwI,gBAAgB,wIAAwI,kBAAkB,mDAAmD,yQAAyQ,gBAAgB,gCAAgC,gIAAgI,gBAAgB,gCAAgC,gIAAgI,gBAAgB,gCAAgC,gIAAgI,kBAAkB,wGAAwG,sKAAsK,gBAAgB,uGAAuG,sLAAsL,gBAAgB,0CAA0C,gBAAgB,oEAAoE,8EAA8E,gBAAgB,0BAA0B,OAAO,6HAA6H,kUAAkU,oBAAoB,6HAA6H,0MAA0M,sBAAsB,wPAAwP,wLAAwL,gBAAgB,wGAAwG,uJAAuJ,0BAA0B,kCAAkC,gKAAgK,sBAAsB,wBAAwB,iMAAiM,oBAAoB,+KAA+K,iKAAiK,0BAA0B,kCAAkC,yJAAyJ,oBAAoB,uFAAuF,0dAA0d,oBAAoB,uFAAuF,qCAAqC,kCAAkC,mMAAmM,cAAc,mLAAmL,cAAc,yGAAyG,kBAAkB,2QAA2Q,kBAAkB,2QAA2Q,kBAAkB,qNAAqN,oBAAoB,2SAA2S,gBAAgB,kOAAkO,gBAAgB,gPAAgP,s+BAAs+B,YAAY,WAAW,aAAa,cAAc,ihBAAihB,EAAE,oCAAoC,aAAa,0BAA0B,mEAAmE,cAAc,qCAAqC,kBAAkB,MAAM,kBAAkB,8DAA8D,gBAAgB,wCAAwC,kFAAkF,gBAAgB,aAAa,0BAA0B,kBAAkB,4DAA4D,6FAA6F,kBAAkB,MAAM,4DAA4D,6DAA6D,kBAAkB,MAAM,4DAA4D,6DAA6D,kBAAkB,MAAM,4DAA4D,6DAA6D,gBAAgB,yBAAyB,sEAAsE,gBAAgB,+FAA+F,uDAAuD,gBAAgB,mFAAmF,sEAAsE,kBAAkB,gCAAgC,oBAAoB,sEAAsE,+MAA+M,cAAc,2EAA2E,6HAA6H,gBAAgB,4DAA4D,gDAAgD,gBAAgB,oDAAoD,gBAAgB,uBAAuB,kGAAkG,KAAK,QAAQ,sCAAsC,wBAAwB,4IAA4I,SAAS,oBAAoB,qBAAqB,eAAe,wFAAwF,6EAA6E,cAAc,qDAAqD,2PAA2P,iBAAiB,4MAA4M,uCAAuC,kDAAkD,oCAAoC,gHAAgH,EAAE,WAAW,aAAa,cAAc,giBAAgiB,EAAE,YAAY,aAAa,0BAA0B,mEAAmE,cAAc,0BAA0B,iDAAiD,oBAAoB,0BAA0B,qCAAqC,gBAAgB,iDAAiD,sBAAsB,qCAAqC,kBAAkB,qEAAqE,kBAAkB,qEAAqE,kBAAkB,qEAAqE,kBAAkB,qEAAqE,gBAAgB,6FAA6F,gBAAgB,iGAAiG,kBAAkB,6GAA6G,kBAAkB,6GAA6G,gBAAgB,iGAAiG,kBAAkB,yDAAyD,oBAAoB,6EAA6E,gBAAgB,oDAAoD,2BAA2B,gBAAgB,oDAAoD,uBAAuB,cAAc,gCAAgC,2BAA2B,cAAc,gCAAgC,uBAAuB,gBAAgB,qDAAqD,gBAAgB,yDAAyD,gBAAgB,kDAAkD,qEAAqE,gBAAgB,+CAA+C,oBAAoB,oKAAoK,+EAA+E,oBAAoB,gCAAgC,iFAAiF,gBAAgB,gBAAgB,OAAO,GAAG,4CAA4C,YAAY,GAAG,4CAA4C,YAAY,yBAAyB,iDAAiD,kBAAkB,gCAAgC,mJAAmJ,kBAAkB,8GAA8G,2FAA2F,cAAc,qCAAqC,cAAc,qDAAqD,gBAAgB,0DAA0D,gBAAgB,4DAA4D,8PAA8P,iEAAiE,QAAQ,gEAAgE,IAAI,0GAA0G,SAAS,EAAE,WAAW,aAAa,cAAc,qoBAAqoB,EAAE,YAAY,aAAa,0BAA0B,4DAA4D,cAAc,0BAA0B,uCAAuC,cAAc,yBAAyB,yBAAyB,kBAAkB,0BAA0B,8BAA8B,gBAAgB,uCAAuC,oBAAoB,8BAA8B,kBAAkB,sDAAsD,kBAAkB,sDAAsD,kBAAkB,sDAAsD,kBAAkB,sDAAsD,gBAAgB,wEAAwE,gBAAgB,2EAA2E,kBAAkB,oFAAoF,kBAAkB,oFAAoF,gBAAgB,2EAA2E,kBAAkB,6CAA6C,oBAAoB,4DAA4D,gBAAgB,wCAAwC,yBAAyB,gBAAgB,wCAAwC,mBAAmB,cAAc,yBAAyB,mBAAmB,gBAAgB,0CAA0C,gBAAgB,6CAA6C,gBAAgB,uCAAuC,qEAAqE,gBAAgB,qCAAqC,kBAAkB,8CAA8C,gDAAgD,oBAAoB,yBAAyB,+DAA+D,wBAAwB,0DAA0D,4GAA4G,wBAAwB,kDAAkD,4GAA4G,gBAAgB,OAAO,iEAAiE,wDAAwD,kBAAkB,uDAAuD,6HAA6H,kBAAkB,yBAAyB,uFAAuF,kBAAkB,uHAAuH,wEAAwE,oBAAoB,cAAc,2LAA2L,oBAAoB,cAAc,2LAA2L,oBAAoB,cAAc,2LAA2L,gBAAgB,4GAA4G,6CAA6C,cAAc,8BAA8B,cAAc,2CAA2C,gBAAgB,6CAA6C,gBAAgB,8CAA8C,gMAAgM,iEAAiE,QAAQ,gEAAgE,IAAI,kFAAkF,SAAS,EAAE,WAAW,aAAa,cAAc,2mBAA2mB,EAAE,4BAA4B,aAAa,0BAA0B,+FAA+F,cAAc,0BAA0B,yFAAyF,4BAA4B,0BAA0B,iEAAiE,0BAA0B,0BAA0B,4BAA4B,yBAAyB,8EAA8E,kBAAkB,8DAA8D,0GAA0G,gBAAgB,mFAAmF,gBAAgB,6EAA6E,gBAAgB,iBAAiB,mBAAmB,0BAA0B,wCAAwC,gBAAgB,yFAAyF,cAAc,iEAAiE,8BAA8B,iEAAiE,aAAa,gBAAgB,iDAAiD,aAAa,gBAAgB,iDAAiD,gBAAgB,+DAA+D,oFAAoF,kBAAkB,0FAA0F,kHAAkH,kBAAkB,uIAAuI,0IAA0I,kBAAkB,uIAAuI,0IAA0I,kBAAkB,uIAAuI,0IAA0I,kBAAkB,4DAA4D,6MAA6M,kBAAkB,4DAA4D,6MAA6M,oBAAoB,uCAAuC,iCAAiC,MAAM,6FAA6F,oFAAoF,gCAAgC,6FAA6F,kBAAkB,iIAAiI,kBAAkB,oHAAoH,iPAAiP,QAAQ,kBAAkB,yGAAyG,YAAY,oBAAoB,UAAU,kLAAkL,gBAAgB,WAAW,+GAA+G,gBAAgB,+FAA+F,yCAAyC,gBAAgB,WAAW,QAAQ,eAAe,sFAAsF,wFAAwF,SAAS,cAAc,8FAA8F,gBAAgB,8GAA8G,gBAAgB,oHAAoH,ufAAuf,WAAW,aAAa,cAAc,kmBAAkmB,EAAE,YAAY,aAAa,0BAA0B,qDAAqD,cAAc,0BAA0B,6BAA6B,gBAAgB,0BAA0B,uBAAuB,gBAAgB,6BAA6B,kBAAkB,uBAAuB,kBAAkB,uCAAuC,kBAAkB,uCAAuC,kBAAkB,uCAAuC,kBAAkB,uCAAuC,gBAAgB,mDAAmD,gBAAgB,qDAAqD,kBAAkB,2DAA2D,kBAAkB,2DAA2D,gBAAgB,qDAAqD,kBAAkB,iCAAiC,oBAAoB,2CAA2C,gBAAgB,4BAA4B,uBAAuB,gBAAgB,4BAA4B,eAAe,cAAc,kBAAkB,uBAAuB,cAAc,kBAAkB,eAAe,gBAAgB,+BAA+B,gBAAgB,iCAAiC,gBAAgB,4BAA4B,yDAAyD,gBAAgB,2BAA2B,kBAAkB,0BAA0B,4BAA4B,oBAAoB,kBAAkB,6CAA6C,gBAAgB,OAAO,2BAA2B,+CAA+C,kBAAkB,kBAAkB,+CAA+C,kBAAkB,kBAAkB,yDAAyD,kBAAkB,kBAAkB,yDAAyD,kBAAkB,kBAAkB,2DAA2D,oBAAoB,wDAAwD,6CAA6C,gBAAgB,yFAAyF,6CAA6C,cAAc,uBAAuB,cAAc,iCAAiC,gBAAgB,gCAAgC,gBAAgB,gCAAgC,kIAAkI,iEAAiE,QAAQ,gEAAgE,IAAI,0DAA0D,SAAS,EAAE,WAAW,aAAa,sCAAsC,SAAS,iBAAiB,sCAAsC,QAAQ,gBAAgB,EAAE,qtBAAqtB,gBAAgB,wBAAwB,iBAAiB,yBAAyB,cAAc,oEAAoE,+DAA+D,gGAAgG,YAAY,mBAAmB,mCAAmC,IAAI,mDAAmD,UAAU,wCAAwC,cAAc,qBAAqB,UAAU,wFAAwF,YAAY,IAAI,KAAK,aAAa,4NAA4N,oBAAoB,eAAe,qGAAqG,QAAQ,2BAA2B,uBAAuB,IAAI,KAAK,qBAAqB,qBAAqB,YAAY,OAAO,0DAA0D,UAAU,wDAAwD,iBAAiB,iBAAiB,gBAAgB,mCAAmC,IAAI,gGAAgG,qBAAqB,mCAAmC,IAAI,2CAA2C,uCAAuC,4CAA4C,0BAA0B,yCAAyC,8BAA8B,wCAAwC,MAAM,8BAA8B,uBAAuB,kCAAkC,kBAAkB,+DAA+D,yCAAyC,wBAAwB,UAAU,uBAAuB,IAAI,KAAK,aAAa,8CAA8C,QAAQ,YAAY,iBAAiB,8BAA8B,sBAAsB,kEAAkE,yCAAyC,wBAAwB,uBAAuB,IAAI,KAAK,aAAa,+BAA+B,+BAA+B,4DAA4D,0BAA0B,qFAAqF,UAAU,SAAS,aAAa,sCAAsC,SAAS,sBAAsB,QAAQ,mBAAmB,eAAe,MAAM,wJAAwJ,eAAe,QAAQ,4CAA4C,WAAW,kBAAkB,eAAe,MAAM,gDAAgD,WAAW,8BAA8B,mBAAmB,qFAAqF,WAAW,aAAa,sCAAsC,SAAS,iBAAiB,sCAAsC,6BAA6B,gBAAgB,EAAE,0FAA0F,oBAAoB,gBAAgB,WAAW,sBAAsB,uBAAuB,IAAI,iCAAiC,SAAS,kBAAkB,sBAAsB,uBAAuB,IAAI,wCAAwC,SAAS,UAAU,uBAAuB,IAAI,KAAK,4BAA4B,qCAAqC,0CAA0C,kMAAkM,oBAAoB,eAAe,0HAA0H,cAAc,qBAAqB,QAAQ,0CAA0C,2BAA2B,uBAAuB,IAAI,KAAK,qBAAqB,qBAAqB,YAAY,OAAO,0DAA0D,UAAU,iCAAiC,kCAAkC,8BAA8B,SAAS,gBAAgB,mCAAmC,IAAI,oFAAoF,mBAAmB,gEAAgE,cAAc,gCAAgC,2BAA2B,oDAAoD,mCAAmC,IAAI,yJAAyJ,uCAAuC,SAAS,uBAAuB,kEAAkE,gDAAgD,4CAA4C,aAAa,8HAA8H,mBAAmB,0EAA0E,mBAAmB,2EAA2E,YAAY,wGAAwG,QAAQ,4BAA4B,cAAc,2BAA2B,IAAI,mCAAmC,SAAS,gCAAgC,mBAAmB,6EAA6E,4BAA4B,UAAU,yCAAyC,UAAU,WAAW,aAAa,sCAAsC,SAAS,qBAAqB,6IAA6I,6BAA6B,gBAAgB,EAAE,+DAA+D,qCAAqC,aAAa,kUAAkU,udAAud,WAAW,mBAAmB,ieAAie,kBAAkB,gDAAgD,eAAe,oBAAoB,qEAAqE,kBAAkB,2JAA2J,uBAAuB,8LAA8L,gDAAgD,4CAA4C,qBAAqB,QAAQ,oCAAoC,8EAA8E,qTAAqT,UAAU,cAAc,yDAAyD,QAAQ,WAAW,QAAQ,8KAA8K,YAAY,IAAI,gBAAgB,IAAI,SAAS,wJAAwJ,sEAAsE,+BAA+B,wjBAAwjB,MAAM,UAAU,oGAAoG,MAAM,iFAAiF,mLAAmL,sJAAsJ,6kBAA6kB,mEAAmE,kFAAkF,oBAAoB,YAAY,IAAI,MAAM,wBAAwB,wPAAwP,qBAAqB,wCAAwC,2BAA2B,qFAAqF,SAAS,sCAAsC,8EAA8E,iEAAiE,2BAA2B,IAAI,2CAA2C,iBAAiB,cAAc,qBAAqB,qBAAqB,MAAM,6CAA6C,oEAAoE,YAAY,mBAAmB,mBAAmB,0BAA0B,8BAA8B,8BAA8B,mBAAmB,KAAK,kBAAkB,gBAAgB,SAAS,UAAU,+EAA+E,IAAI,KAAK,8BAA8B,GAAG,oHAAoH,oBAAoB,kCAAkC,OAAO,YAAY,kEAAkE,yBAAyB,MAAM,0BAA0B,oBAAoB,kFAAkF,yBAAyB,6BAA6B,sIAAsI,EAAE,WAAW,aAAa,sCAAsC,SAAS,oFAAoF,cAAc,wIAAwI,yJAAyJ,sBAAsB,0CAA0C,0BAA0B,+CAA+C,SAAS,aAAa,sCAAsC,SAAS,EAAE,wBAAwB,eAAe,qBAAqB,2EAA2E,eAAe,oBAAoB,mCAAmC,qMAAqM,uBAAuB,eAAe,uBAAuB,kBAAkB,qBAAqB,kBAAkB,oBAAoB,kBAAkB,8BAA8B,gDAAgD,mBAAmB,sDAAsD,mBAAmB,sDAAsD,mBAAmB,qFAAqF,mBAAmB,sBAAsB,eAAe,sBAAsB,gBAAgB,sBAAsB,mBAAmB,KAAK,OAAO,KAAK,gDAAgD,YAAY,SAAS,aAAa,sCAAsC,SAAS,6HAA6H,YAAY,kBAAkB,WAAW,aAAa,sCAAsC,SAAS,yCAAyC,cAAc,MAAM,aAAa,kFAAkF,iCAAiC,eAAe,YAAY,qCAAqC,YAAY,gDAAgD,eAAe,wIAAwI,aAAa,uTAAuT,cAAc,uNAAuN,2BAA2B,eAAe,kDAAkD,WAAW,sCAAsC,oBAAoB,0CAA0C,mCAAmC,wBAAwB,6IAA6I,uBAAuB,IAAI,yCAAyC,SAAS,wBAAwB,mCAAmC,sCAAsC,uBAAuB,IAAI,mCAAmC,+BAA+B,oBAAoB,SAAS,aAAa,sCAAsC,SAAS,uCAAuC,WAAW,aAAa,sCAAsC,SAAS,sOAAsO,gFAAgF,kBAAkB,uBAAuB,iBAAiB,eAAe,yBAAyB,qBAAqB,yBAAyB,qBAAqB,wBAAwB,kBAAkB,+CAA+C,mCAAmC,SAAS,2BAA2B,yCAAyC,2DAA2D,WAAW,gBAAgB,4BAA4B,qBAAqB,6DAA6D,uBAAuB,gBAAgB,uCAAuC,QAAQ,8BAA8B,oBAAoB,8CAA8C,oBAAoB,IAAI,eAAe,wCAAwC,gBAAgB,qDAAqD,YAAY,IAAI,UAAU,gBAAgB,sCAAsC,OAAO,qCAAqC,4BAA4B,YAAY,IAAI,mCAAmC,SAAS,+BAA+B,aAAa,kBAAkB,oBAAoB,8BAA8B,KAAK,WAAW,6DAA6D,kBAAkB,0FAA0F,IAAI,yCAAyC,0BAA0B,sGAAsG,EAAE,YAAY,uBAAuB,8CAA8C,2CAA2C,sCAAsC,8CAA8C,gCAAgC,gDAAgD,8BAA8B,0BAA0B,4CAA4C,sCAAsC,8CAA8C,gCAAgC,gDAAgD,+BAA+B,uBAAuB,8CAA8C,sCAAsC,gBAAgB,gCAAgC,oCAAoC,+BAA+B,SAAS,oEAAoE,iFAAiF,iBAAiB,iBAAiB,YAAY,IAAI,gBAAgB,4BAA4B,gBAAgB,IAAI,yEAAyE,SAAS,8BAA8B,WAAW,MAAM,YAAY,aAAa,gGAAgG,cAAc,MAAM,sCAAsC,0BAA0B,2BAA2B,YAAY,mBAAmB,iGAAiG,yBAAyB,yCAAyC,4BAA4B,6FAA6F,YAAY,MAAM,iEAAiE,cAAc,4BAA4B,QAAQ,MAAM,WAAW,QAAQ,MAAM,KAAK,+BAA+B,iBAAiB,SAAS,aAAa,iBAAiB,mBAAmB,eAAe,YAAY,WAAW,KAAK,8CAA8C,6CAA6C,uCAAuC,aAAa,8cAA8c,0IAA0I,wBAAwB,qEAAqE,SAAS,kBAAkB,6BAA6B,iBAAiB,SAAS,sBAAsB,6BAA6B,iBAAiB,SAAS,sBAAsB,6BAA6B,kBAAkB,yBAAyB,8LAA8L,mLAAmL,8HAA8H,WAAW,KAAK,uBAAuB,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,oBAAoB,2BAA2B,2NAA2N,wEAAwE,2VAA2V,YAAY,KAAK,oCAAoC,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,4BAA4B,YAAY,KAAK,4CAA4C,uDAAuD,uBAAuB,mDAAmD,SAAS,4DAA4D,GAAG,WAAW,aAAa,sCAAsC,SAAS,iBAAiB,8BAA8B,4BAA4B,eAAe,qTAAqT,WAAW,8DAA8D,kBAAkB,4EAA4E,QAAQ,0EAA0E,mBAAmB,iJAAiJ,oBAAoB,6LAA6L,mBAAmB,yDAAyD,gBAAgB,eAAe,6CAA6C,gEAAgE,2EAA2E,wDAAwD,MAAM,2DAA2D,uBAAuB,IAAI,KAAK,SAAS,QAAQ,6CAA6C,yBAAyB,cAAc,IAAI,6BAA6B,SAAS,MAAM,4DAA4D,YAAY,0JAA0J,UAAU,WAAW,aAAa,sCAAsC,SAAS,0BAA0B,sCAAsC,4BAA4B,gBAAgB,EAAE,MAAM,mNAAmN,6EAA6E,WAAW,iEAAiE,2BAA2B,sQAAsQ,oBAAoB,oCAAoC,QAAQ,sEAAsE,uBAAuB,IAAI,0EAA0E,SAAS,mBAAmB,+CAA+C,gBAAgB,SAAS,gEAAgE,2EAA2E,wDAAwD,MAAM,2DAA2D,2BAA2B,WAAW,oBAAoB,aAAa,gBAAgB,mBAAmB,WAAW,aAAa,sCAAsC,SAAS,qBAAqB,sCAAsC,iCAAiC,gBAAgB,OAAO,8IAA8I,gDAAgD,+GAA+G,eAAe,4DAA4D,2CAA2C,IAAI,wEAAwE,SAAS,WAAW,0CAA0C,kBAAkB,qLAAqL,uBAAuB,uGAAuG,aAAa,SAAS,4BAA4B,MAAM,GAAG,yCAAyC,KAAK,qCAAqC,KAAK,MAAM,qBAAqB,6BAA6B,4BAA4B,mBAAmB,gEAAgE,oIAAoI,MAAM,QAAQ,0DAA0D,qCAAqC,oBAAoB,mOAAmO,sBAAsB,MAAM,sBAAsB,wIAAwI,mCAAmC,mCAAmC,gBAAgB,IAAI,UAAU,0CAA0C,mCAAmC,eAAe,sBAAsB,iEAAiE,uBAAuB,IAAI,qEAAqE,oEAAoE,WAAW,gBAAgB,+RAA+R,0FAA0F,2BAA2B,OAAO,oCAAoC,YAAY,uBAAuB,oBAAoB,kBAAkB,gCAAgC,EAAE,qDAAqD,+BAA+B,WAAW,aAAa,sCAAsC,SAAS,uBAAuB,sBAAsB,iCAAiC,gBAAgB,EAAE,QAAQ,2dAA2d,WAAW,sDAAsD,kBAAkB,6DAA6D,uBAAuB,+CAA+C,cAAc,2KAA2K,uBAAuB,IAAI,qEAAqE,8EAA8E,kBAAkB,wGAAwG,oBAAoB,+IAA+I,YAAY,gEAAgE,eAAe,sBAAsB,qBAAqB,EAAE,kBAAkB,gCAAgC,EAAE,qDAAqD,gBAAgB,WAAW,aAAa,sCAAsC,SAAS,0BAA0B,cAAc,wBAAwB,eAAe,kSAAkS,uBAAuB,6DAA6D,WAAW,8JAA8J,kBAAkB,uHAAuH,oBAAoB,8KAA8K,gBAAgB,uJAAuJ,OAAO,gCAAgC,iCAAiC,SAAS,kBAAkB,mBAAmB,sBAAsB,iDAAiD,QAAQ,YAAY,YAAY,gHAAgH,YAAY,IAAI,6BAA6B,YAAY,IAAI,KAAK,gFAAgF,mBAAmB,IAAI,SAAS,GAAG,8CAA8C,2BAA2B,aAAa,sFAAsF,2DAA2D,gBAAgB,IAAI,MAAM,0BAA0B,wBAAwB,gBAAgB,4BAA4B,gBAAgB,eAAe,SAAS,wBAAwB,mGAAmG,gEAAgE,2EAA2E,wDAAwD,MAAM,yDAAyD,YAAY,gCAAgC,iCAAiC,qCAAqC,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,gCAAgC,gCAAgC,IAAI,iBAAiB,mDAAmD,yBAAyB,cAAc,EAAE,QAAQ,oCAAoC,aAAa,MAAM,+EAA+E,YAAY,YAAY,IAAI,KAAK,sBAAsB,mBAAmB,IAAI,SAAS,sBAAsB,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,kCAAkC,2BAA2B,gBAAgB,IAAI,iBAAiB,mDAAmD,yBAAyB,cAAc,mCAAmC,uBAAuB,kBAAkB,QAAQ,YAAY,IAAI,YAAY,SAAS,2BAA2B,OAAO,gCAAgC,4BAA4B,mBAAmB,WAAW,aAAa,sCAAsC,SAAS,uBAAuB,cAAc,wBAAwB,eAAe,mLAAmL,uBAAuB,0DAA0D,WAAW,+DAA+D,kBAAkB,6EAA6E,oBAAoB,iNAAiN,gBAAgB,oBAAoB,mBAAmB,yBAAyB,aAAa,0BAA0B,cAAc,mBAAmB,oBAAoB,iEAAiE,YAAY,IAAI,KAAK,SAAS,wCAAwC,qEAAqE,kCAAkC,uBAAuB,IAAI,qCAAqC,yBAAyB,gBAAgB,eAAe,SAAS,gEAAgE,2EAA2E,wDAAwD,MAAM,yDAAyD,SAAS,0BAA0B,qCAAqC,uBAAuB,IAAI,mDAAmD,IAAI,KAAK,sBAAsB,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,aAAa,4BAA4B,mDAAmD,yBAAyB,cAAc,KAAK,uBAAuB,kBAAkB,QAAQ,YAAY,IAAI,YAAY,SAAS,2BAA2B,OAAO,gCAAgC,4BAA4B,gBAAgB,WAAW,aAAa,sCAAsC,SAAS,gBAAgB,sBAAsB,8BAA8B,gBAAgB,EAAE,mFAAmF,sBAAsB,WAAW,sBAAsB,uBAAuB,eAAe,YAAY,IAAI,WAAW,sBAAsB,6CAA6C,iBAAiB,oBAAoB,0DAA0D,6BAA6B,8CAA8C,gBAAgB,wCAAwC,yBAAyB,IAAI,MAAM,kBAAkB,sJAAsJ,OAAO,yBAAyB,qCAAqC,yBAAyB,+BAA+B,mJAAmJ,6BAA6B,6BAA6B,WAAW,aAAa,sCAAsC,SAAS,oBAAoB,sBAAsB,8BAA8B,gBAAgB,EAAE,2EAA2E,uCAAuC,WAAW,aAAa,sCAAsC,SAAS,gBAAgB,sBAAsB,8BAA8B,gBAAgB,EAAE,uEAAuE,wCAAwC,WAAW,aAAa,sCAAsC,SAAS,mBAAmB,sBAAsB,4BAA4B,gBAAgB,EAAE,sJAAsJ,kHAAkH,+GAA+G,YAAY,WAAW,aAAa,sCAAsC,SAAS,kBAAkB,sBAAsB,4BAA4B,gBAAgB,EAAE,uCAAuC,0BAA0B,wCAAwC,kDAAkD,qDAAqD,+GAA+G,WAAW,WAAW,aAAa,sCAAsC,SAAS,gBAAgB,sBAAsB,4BAA4B,gBAAgB,EAAE,6LAA6L,6CAA6C,sEAAsE,qCAAqC,8GAA8G,sBAAsB,0JAA0J,SAAS,WAAW,aAAa,sCAAsC,SAAS,gBAAgB,sBAAsB,4BAA4B,gBAAgB,EAAE,QAAQ,2LAA2L,qFAAqF,4HAA4H,mBAAmB,YAAY,mCAAmC,qDAAqD,8GAA8G,sBAAsB,kFAAkF,+BAA+B,qBAAqB,kBAAkB,sEAAsE,SAAS,WAAW,aAAa,sCAAsC,SAAS,kBAAkB,sBAAsB,4BAA4B,gBAAgB,EAAE,UAAU,sUAAsU,2HAA2H,6EAA6E,sCAAsC,YAAY,0BAA0B,qDAAqD,8GAA8G,sBAAsB,kHAAkH,8BAA8B,UAAU,sCAAsC,wCAAwC,sCAAsC,qCAAqC,qDAAqD,aAAa,oBAAoB,yGAAyG,WAAW,aAAa,sCAAsC,SAAS,qBAAqB,sBAAsB,4BAA4B,gBAAgB,EAAE,iLAAiL,0BAA0B,sIAAsI,mCAAmC,iJAAiJ,8GAA8G,sBAAsB,iIAAiI,cAAc,WAAW,aAAa,sCAAsC,SAAS,sBAAsB,sBAAsB,4BAA4B,gBAAgB,EAAE,gBAAgB,0YAA0Y,0BAA0B,wCAAwC,sCAAsC,YAAY,0IAA0I,qCAAqC,8GAA8G,sBAAsB,4MAA4M,eAAe,WAAW,aAAa,sCAAsC,SAAS,qBAAqB,iEAAiE,uHAAuH,cAAc,WAAW,aAAa,sCAAsC,SAAS,kBAAkB,cAAc,2BAA2B,eAAe,UAAU,EAAE,wCAAwC,WAAW,iEAAiE,mBAAmB,kBAAkB,YAAY,IAAI,6JAA6J,2BAA2B,IAAI,wEAAwE,KAAK,oBAAoB,YAAY,IAAI,wEAAwE,UAAU,WAAW,WAAW,aAAa,sCAAsC,SAAS,kBAAkB,8BAA8B,2BAA2B,gBAAgB,EAAE,8BAA8B,uDAAuD,8IAA8I,WAAW,4BAA4B,yCAAyC,qCAAqC,QAAQ,yBAAyB,IAAI,iDAAiD,SAAS,2BAA2B,0DAA0D,yBAAyB,uBAAuB,YAAY,kBAAkB,IAAI,wGAAwG,gEAAgE,WAAW,WAAW,aAAa,sCAAsC,SAAS,iBAAiB,cAAc,2BAA2B,cAAc,QAAQ,aAAa,iBAAiB,eAAe,iBAAiB,0BAA0B,8BAA8B,0CAA0C,mBAAmB,iBAAiB,qCAAqC,UAAU,WAAW,aAAa,sCAAsC,SAAS,oBAAoB,cAAc,2BAA2B,gBAAgB,EAAE,oFAAoF,WAAW,2DAA2D,4BAA4B,iDAAiD,wCAAwC,6BAA6B,IAAI,UAAU,kBAAkB,SAAS,6BAA6B,IAAI,iCAAiC,+QAA+Q,OAAO,2CAA2C,qCAAqC,2CAA2C,+BAA+B,mJAAmJ,MAAM,gHAAgH,gEAAgE,4BAA4B,6BAA6B,6CAA6C,iBAAiB,uCAAuC,0DAA0D,0BAA0B,8CAA8C,iBAAiB,aAAa,WAAW,aAAa,sCAAsC,SAAS,qBAAqB,cAAc,2BAA2B,gBAAgB,EAAE,mEAAmE,WAAW,mBAAmB,QAAQ,6BAA6B,IAAI,uBAAuB,SAAS,yBAAyB,iDAAiD,YAAY,IAAI,kCAAkC,KAAK,4DAA4D,gDAAgD,uEAAuE,cAAc,WAAW,aAAa,sCAAsC,SAAS,kBAAkB,cAAc,2BAA2B,eAAe,iBAAiB,EAAE,sCAAsC,WAAW,gFAAgF,WAAW,OAAO,cAAc,WAAW,+BAA+B,YAAY,YAAY,oDAAoD,mBAAmB,+DAA+D,uBAAuB,EAAE,8DAA8D,4FAA4F,eAAe,wCAAwC,SAAS,EAAE,MAAM,IAAI,eAAe,eAAe,MAAM,YAAY,aAAa,kBAAkB,gCAAgC,iBAAiB,sCAAsC,uCAAuC,8BAA8B,sBAAsB,oBAAoB,IAAI,KAAK,wBAAwB,eAAe,4DAA4D,gBAAgB,0BAA0B,mCAAmC,kBAAkB,wBAAwB,uBAAuB,6BAA6B,8CAA8C,IAAI,8EAA8E,0BAA0B,SAAS,uBAAuB,SAAS,+BAA+B,GAAG,eAAe,aAAa,iBAAiB,SAAS,aAAa,gBAAgB,oBAAoB,cAAc,6DAA6D,gBAAgB,oFAAoF,wCAAwC,sCAAsC,yFAAyF,yBAAyB,yBAAyB,4BAA4B,0BAA0B,uCAAuC,oCAAoC,uFAAuF,sBAAsB,6JAA6J,uDAAuD,oFAAoF,KAAK,YAAY,IAAI,wBAAwB,0BAA0B,YAAY,WAAW,MAAM,oDAAoD,4BAA4B,SAAS,IAAI,SAAS,aAAa,0BAA0B,kBAAkB,4CAA4C,8BAA8B,kCAAkC,kTAAkT,4DAA4D,yDAAyD,sOAAsO,qCAAqC,4CAA4C,aAAa,SAAS,aAAa,aAAa,qCAAqC,8BAA8B,+BAA+B,6GAA6G,qCAAqC,2EAA2E,iCAAiC,2EAA2E,oCAAoC,UAAU,2JAA2J,+BAA+B,0FAA0F,+BAA+B,0FAA0F,gCAAgC,gCAAgC,iEAAiE,oEAAoE,YAAY,oBAAoB,kLAAkL,QAAQ,kBAAkB,kCAAkC,MAAM,0IAA0I,aAAa,SAAS,aAAa,OAAO,4CAA4C,4FAA4F,cAAc,oBAAoB,cAAc,oHAAoH,cAAc,KAAK,mJAAmJ,WAAW,MAAM,cAAc,iCAAiC,mJAAmJ,cAAc,gDAAgD,qDAAqD,8FAA8F,WAAW,0JAA0J,KAAK,6BAA6B,UAAU,6BAA6B,WAAW,aAAa,wBAAwB,UAAU,6BAA6B,oBAAoB,iFAAiF,0JAA0J,KAAK,6BAA6B,KAAK,kDAAkD,yEAAyE,cAAc,QAAQ,2CAA2C,aAAa,iIAAiI,UAAU,mEAAmE,GAAG,cAAc,wBAAwB,gFAAgF,aAAa,0GAA0G,SAAS,sEAAsE,UAAU,EAAE,QAAQ,IAAI,KAAK,kDAAkD,iGAAiG,OAAO,wBAAwB,+EAA+E,KAAK,UAAU,2EAA2E,sBAAsB,uBAAuB,SAAS,yBAAyB,MAAM,yKAAyK,8BAA8B,eAAe,aAAa,gDAAgD,cAAc,wCAAwC,WAAW,wDAAwD,mBAAmB,sCAAsC,mBAAmB,gBAAgB,0DAA0D,iBAAiB,wCAAwC,+BAA+B,KAAK,uDAAuD,kCAAkC,aAAa,gDAAgD,YAAY,aAAa,kEAAkE,MAAM,kFAAkF,MAAM,kEAAkE,MAAM,kFAAkF,MAAM,mEAAmE,6IAA6I,iCAAiC,MAAM,4FAA4F,MAAM,sDAAsD,MAAM,iDAAiD,WAAW,+CAA+C,gBAAgB,MAAM,wCAAwC,QAAQ,wBAAwB,uFAAuF,gCAAgC,OAAO,qCAAqC,kCAAkC,iCAAiC,aAAa,uBAAuB,YAAY,uBAAuB,sIAAsI,kGAAkG,qCAAqC,qDAAqD,iCAAiC,yDAAyD,oCAAoC,uDAAuD,+BAA+B,4CAA4C,+BAA+B,4CAA4C,gCAAgC,6CAA6C,mCAAmC,oDAAoD,+BAA+B,sBAAsB,wEAAwE,gCAAgC,aAAa,uFAAuF,uFAAuF,qCAAqC,oJAAoJ,gNAAgN,uIAAuI,2BAA2B,IAAI,QAAQ,mCAAmC,8BAA8B,sBAAsB,sDAAsD,iBAAiB,gCAAgC,gCAAgC,aAAa,mEAAmE,4CAA4C,4CAA4C,qCAAqC,yDAAyD,kBAAkB,aAAa,WAAW,6BAA6B,cAAc,oBAAoB,kBAAkB,4BAA4B,4BAA4B,uCAAuC,+BAA+B,0BAA0B,6BAA6B,qCAAqC,gBAAgB,WAAW,mBAAmB,WAAW,4BAA4B,uCAAuC,+BAA+B,4CAA4C,6BAA6B,qCAAqC,gBAAgB,WAAW,mBAAmB,WAAW,8BAA8B,uCAAuC,sBAAsB,qLAAqL,4CAA4C,OAAO,QAAQ,gCAAgC,8BAA8B,uCAAuC,+BAA+B,sVAAsV,QAAQ,aAAa,cAAc,aAAa,gBAAgB,4DAA4D,uFAAuF,sBAAsB,gBAAgB,uCAAuC,kEAAkE,YAAY,MAAM,oDAAoD,0FAA0F,iGAAiG,mGAAmG,qDAAqD,qDAAqD,SAAS,MAAM,eAAe,aAAa,gBAAgB,uEAAuE,6CAA6C,gBAAgB,0BAA0B,cAAc,OAAO,6GAA6G,cAAc,uXAAuX,EAAE,+IAA+I,cAAc,mBAAmB,4CAA4C,EAAE,oBAAoB,OAAO,mHAAmH,aAAa,OAAO,yBAAyB,cAAc,MAAM,wBAAwB,aAAa,OAAO,wDAAwD,cAAc,kBAAkB,cAAc,+DAA+D,cAAc,+JAA+J,MAAM,kBAAkB,OAAO,yBAAyB,iBAAiB,iBAAiB,oHAAoH,EAAE,8CAA8C,+CAA+C,mBAAmB,2BAA2B,SAAS,kBAAkB,wBAAwB,iBAAiB,eAAe,MAAM,iBAAiB,MAAM,kBAAkB,uBAAuB,0BAA0B,2CAA2C,kBAAkB,sBAAsB,oBAAoB,YAAY,SAAS,yBAAyB,2CAA2C,gBAAgB,OAAO,yBAAyB,MAAM,MAAM,MAAM,gBAAgB,OAAO,+BAA+B,gBAAgB,sCAAsC,cAAc,YAAY,cAAc,YAAY,cAAc,gBAAgB,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,qBAAqB,OAAO,qIAAqI,gBAAgB,8WAA8W,aAAa,gCAAgC,IAAI,8BAA8B,KAAK,cAAc,sCAAsC,cAAc,eAAe,iFAAiF,2CAA2C,0EAA0E,oCAAoC,sEAAsE,oCAAoC,0EAA0E,yDAAyD,yEAAyE,oBAAoB,yEAAyE,oBAAoB,qFAAqF,sBAAsB,oDAAoD,oBAAoB,gKAAgK,gBAAgB,kBAAkB,UAAU,IAAI,gBAAgB,+QAA+Q,8CAA8C,0GAA0G,gBAAgB,WAAW,oBAAoB,4FAA4F,iBAAiB,gBAAgB,OAAO,oCAAoC,kBAAkB,OAAO,8CAA8C,cAAc,aAAa,cAAc,UAAU,MAAM,KAAK,OAAO,oCAAoC,IAAI,2DAA2D,gBAAgB,2DAA2D,gBAAgB,SAAS,2BAA2B,WAAW,SAAS,sCAAsC,WAAW,cAAc,qCAAqC,GAAG,cAAc,oBAAoB,+DAA+D,aAAa,YAAY,kBAAkB,MAAM,kBAAkB,sCAAsC,MAAM,kBAAkB,SAAS,aAAa,cAAc,oBAAoB,yBAAyB,MAAM,iBAAiB,SAAS,iDAAiD,aAAa,wBAAwB,aAAa,MAAM,oBAAoB,4CAA4C,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,kJAAkJ,gBAAgB,MAAM,kBAAkB,kDAAkD,oCAAoC,YAAY,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,SAAS,uBAAuB,wCAAwC,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,gBAAgB,sCAAsC,MAAM,kBAAkB,kDAAkD,sBAAsB,kCAAkC,aAAa,aAAa,aAAa,SAAS,uBAAuB,wCAAwC,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,gBAAgB,sCAAsC,MAAM,kBAAkB,kDAAkD,kBAAkB,kCAAkC,aAAa,aAAa,aAAa,SAAS,uBAAuB,wCAAwC,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,gBAAgB,kBAAkB,UAAU,0EAA0E,8BAA8B,MAAM,kBAAkB,kDAAkD,sBAAsB,+CAA+C,aAAa,aAAa,aAAa,SAAS,uBAAuB,kCAAkC,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,gBAAgB,gBAAgB,MAAM,kBAAkB,kDAAkD,qBAAqB,YAAY,aAAa,aAAa,aAAa,SAAS,uBAAuB,kCAAkC,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,gBAAgB,gBAAgB,MAAM,kBAAkB,kDAAkD,qBAAqB,YAAY,aAAa,aAAa,aAAa,SAAS,MAAM,aAAa,YAAY,mDAAmD,UAAU,yBAAyB,kBAAkB,+RAA+R,qIAAqI,sHAAsH,MAAM,wCAAwC,mEAAmE,aAAa,QAAQ,gDAAgD,aAAa,cAAc,8BAA8B,MAAM,kBAAkB,SAAS,UAAU,sCAAsC,MAAM,kBAAkB,YAAY,aAAa,6BAA6B,gBAAgB,MAAM,kBAAkB,UAAU,aAAa,SAAS,aAAa,QAAQ,8DAA8D,aAAa,cAAc,sKAAsK,aAAa,QAAQ,qEAAqE,cAAc,QAAQ,0BAA0B,MAAM,kBAAkB,SAAS,SAAS,cAAc,QAAQ,qEAAqE,cAAc,QAAQ,qEAAqE,WAAW,kBAAkB,qCAAqC,4BAA4B,WAAW,iCAAiC,0CAA0C,oEAAoE,cAAc,YAAY,eAAe,aAAa,mBAAmB,0CAA0C,yCAAyC,OAAO,oBAAoB,wBAAwB,mBAAmB,+BAA+B,iDAAiD,GAAG,oCAAoC,gBAAgB,sBAAsB,gBAAgB,qBAAqB,mBAAmB,qBAAqB,iBAAiB,6BAA6B,cAAc,kDAAkD,cAAc,2KAA2K,kBAAkB,gDAAgD,iBAAiB,GAAG,cAAc,qNAAqN,kBAAkB,gDAAgD,iBAAiB,GAAG,cAAc,oBAAoB,8BAA8B,mBAAmB,wBAAwB,YAAY,WAAW,mCAAmC,WAAW,iBAAiB,mBAAmB,+BAA+B,+DAA+D,wBAAwB,qCAAqC,gBAAgB,MAAM,cAAc,WAAW,+BAA+B,YAAY,YAAY,oDAAoD,mBAAmB,+DAA+D,uBAAuB,EAAE,8DAA8D,4FAA4F,eAAe,wCAAwC,SAAS,EAAE,QAAQ,IAAI,G;;;;;SCDz49N;SACA;;SAEA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;;SAEA;SACA;;SAEA;SACA;SACA;;;;;UCtBA;UACA;UACA;UACA;UACA;UACA,gCAAgC,YAAY;UAC5C;UACA,E;;;;;UCPA;UACA;UACA;UACA;UACA,wCAAwC,yCAAyC;UACjF;UACA;UACA,E;;;;;UCPA;UACA;UACA;UACA;UACA,EAAE;UACF;UACA;UACA,CAAC,I;;;;;UCPD,wF;;;;;UCAA;UACA;UACA;UACA,sDAAsD,kBAAkB;UACxE;UACA,+CAA+C,cAAc;UAC7D,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACN0B;AAC1B,iC","file":"urpflanze.js","sourcesContent":["export * from './modules-light';\nexport * as Color from '@urpflanze/color/dist/cjs';\nexport { Renderer, Timeline } from '@urpflanze/drawer-canvas/dist/cjs';\nexport { GCODEExporter } from '@urpflanze/gcode-exporter/dist/cjs';\nexport { SVGExporter } from '@urpflanze/svg-exporter/dist/cjs';\nexport { SVGImporter } from '@urpflanze/svg-importer';\n//# sourceMappingURL=modules.js.map","export * from './core';\nexport * as Animation from '@urpflanze/animation/dist/cjs';\nexport { BrowserDrawerCanvas as DrawerCanvas } from '@urpflanze/drawer-canvas/dist/cjs/browser/BrowserDrawerCanvas';\n//# sourceMappingURL=modules-light.js.map","export * from '@urpflanze/core/dist/cjs/Scene';\nexport * from '@urpflanze/core/dist/cjs/SceneChild';\nexport * from '@urpflanze/core/dist/cjs/Group';\nexport * from '@urpflanze/core/dist/cjs/shapes/ShapeBase';\nexport * from '@urpflanze/core/dist/cjs/shapes/ShapePrimitive';\nexport * from '@urpflanze/core/dist/cjs/shapes/ShapeLoop';\nexport * from '@urpflanze/core/dist/cjs/shapes/ShapeBuffer';\nexport * from '@urpflanze/core/dist/cjs/shapes/Shape';\nexport * from '@urpflanze/core/dist/cjs/shapes/ShapeRecursive';\nexport * from '@urpflanze/core/dist/cjs/shapes/ShapeFollow';\nexport * from '@urpflanze/core/dist/cjs/shapes/primitives/Line';\nexport * from '@urpflanze/core/dist/cjs/shapes/primitives/Triangle';\nexport * from '@urpflanze/core/dist/cjs/shapes/primitives/Rect';\nexport * from '@urpflanze/core/dist/cjs/shapes/primitives/Polygon';\nexport * from '@urpflanze/core/dist/cjs/shapes/primitives/Circle';\nexport * from '@urpflanze/core/dist/cjs/shapes/primitives/Star';\nexport * from '@urpflanze/core/dist/cjs/shapes/primitives/Rose';\nexport * from '@urpflanze/core/dist/cjs/shapes/primitives/Spiral';\nexport * from '@urpflanze/core/dist/cjs/shapes/primitives/Lissajous';\nexport * from '@urpflanze/core/dist/cjs/shapes/primitives/SuperShape';\nexport * from '@urpflanze/core/dist/cjs/modifiers/Modifier';\nexport * from '@urpflanze/core/dist/cjs/modifiers';\nexport { lerp, clamp, relativeClamp, toDegrees, toRadians, now, noise, random, angleFromRepetition, angle2FromRepetition, distanceFromRepetition, interpolate, prepareBufferForInterpolation, distributePointsInBuffer, } from '@urpflanze/core/dist/cjs/Utilities';\nexport { default as Vec2 } from '@urpflanze/core/dist/cjs/math/Vec2';\nexport { PHI, PI2, log, mod } from '@urpflanze/core/dist/cjs/math';\n//# sourceMappingURL=core.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Scene = void 0;\nconst SceneChild_1 = require(\"./SceneChild\");\nconst Group_1 = require(\"./Group\");\nconst Shape_1 = require(\"./shapes/Shape\");\nconst Utilities_1 = require(\"./Utilities\");\n/**\n * Container for all SceneChild.\n * The main purpose is to manage the drawing order and update the child buffers\n *\n * @order 1\n * @category Core.Scene\n * @class Scene\n */\nclass Scene {\n /**\n * Creates an instance of Scene.\n * You can see the default values in the property definitions\n */\n constructor(settings = {}) {\n /**\n * Logical number, the drawer will take care of defining the unit of measure\n */\n this.width = 400;\n /**\n * Logical number, the drawer will take care of defining the unit of measure\n */\n this.height = 400;\n /**\n * Default background color (black)\n */\n this.background = 'hsla(0, 0%, 0%, 1)';\n /**\n * Default ScenePrimitive stroke color (white)\n */\n this.color = 'hsla(0, 0%, 100%, 1)';\n /**\n * Current time\n */\n this.currentTime = 0;\n if (typeof settings.width !== 'undefined')\n this.width = settings.width;\n if (typeof settings.height !== 'undefined')\n this.height = settings.height;\n if (typeof settings.background !== 'undefined')\n this.background = settings.background;\n if (typeof settings.color !== 'undefined')\n this.color = settings.color;\n this.children = [];\n this.center = [this.width / 2, this.height / 2];\n this.anchor =\n settings.anchor && Array.isArray(settings.anchor)\n ? [\n typeof settings.anchor[0] === 'number'\n ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[0]) * 0.5) * this.width\n : settings.anchor[0] === 'left'\n ? 0\n : settings.anchor[0] === 'right'\n ? this.width\n : this.center[0],\n typeof settings.anchor[1] === 'number'\n ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[1]) * 0.5) * this.height\n : settings.anchor[1] === 'top'\n ? 0\n : settings.anchor[1] === 'bottom'\n ? this.height\n : this.center[1],\n ]\n : [this.center[0], this.center[1]];\n }\n /**\n * Return width percentage\n *\n * @param {number} [percentage=100]\n * @returns {number}\n */\n getWidth(percentage = 100) {\n return (this.width * percentage) / 100;\n }\n /**\n * Return height percentage\n *\n * @param {number} [percentage=100]\n * @returns {number}\n */\n getHeight(percentage = 100) {\n return (this.height * percentage) / 100;\n }\n /**\n * Resize the scene size\n *\n * @param {number} width\n * @param {number} [height=width]\n * @memberof Scene\n */\n resize(width, height = width) {\n this.width = width;\n this.height = height;\n this.center = [this.width / 2, this.height / 2];\n const anchor = [this.width / this.anchor[0], this.height / this.anchor[1]];\n this.anchor = [this.width / anchor[0], this.height / anchor[1]];\n this.children.forEach(sceneChild => sceneChild.clearBuffer(true, false));\n }\n /**\n * Update all children, generate a streamable buffer for drawing\n *\n * @param {number} [atTime] time in ms\n * @memberof Scene\n */\n update(atTime = 0) {\n this.currentTime = atTime;\n for (let i = 0, len = this.children.length; i < len; i++) {\n this.children[i].generate(this.currentTime, true);\n }\n }\n /**\n * Traverse the child buffer and use it with callback\n *\n * @param {(streamArguments: IStreamArguments) => void} callback\n * @memberof Scene\n */\n stream(callback) {\n this.children.forEach(sceneChild => sceneChild.stream(callback));\n }\n /*\n |--------------------------------------------------------------------------\n | SceneChild\n |--------------------------------------------------------------------------\n */\n /**\n * Return a list of children\n *\n * @returns {Array}\n * @memberof Scene\n */\n getChildren() {\n return this.children;\n }\n /**\n * Add SceneChild to Scene, pass `order` as last parameter for drawing priorities\n *\n * @param {Array} items\n * @param {number} [order]\n * @memberof Scene\n */\n add(...items /**, order: number */) {\n const order = typeof items[items.length - 1] === 'number' ? items[items.length - 1] : undefined;\n const len = items.length - (typeof order === 'undefined' ? 0 : 1);\n for (let i = 0; i < len; i++) {\n const item = items[i];\n item.order =\n typeof order !== 'undefined'\n ? order + i\n : typeof item.order !== 'undefined'\n ? item.order\n : this.children.length > 0\n ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1\n : 0;\n Scene.propagateToChilden(item, this);\n this.children.push(item);\n item.clearBuffer(true, false);\n item.generate(0, true);\n }\n this.sortChildren();\n }\n /**\n * Sort children by order\n *\n * @memberof Scene\n */\n sortChildren() {\n this.children.sort((a, b) => a.order - b.order);\n this.children = this.children.map((child, index) => {\n child.order = index;\n return child;\n });\n }\n /**\n * Find sceneChild from id or name in the whole scene\n *\n * @param {string | number} idOrName\n * @returns {(SceneChild | null)}\n * @memberof Scene\n */\n find(idOrName) {\n const children = this.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const result = children[i].find(idOrName);\n if (result !== null)\n return result;\n }\n return null;\n }\n /**\n * Get shape by index\n *\n * @param {number} index\n * @returns {(SceneChild | null)}\n * @memberof Scene\n */\n get(index) {\n return index >= 0 && index < this.children.length ? this.children[index] : null;\n }\n /**\n * Remove a shape by index\n *\n * @param {number} index\n * @memberof Scene\n */\n remove(index) {\n index >= 0 && index < this.children.length && this.children.splice(index, 1);\n }\n /**\n * Removes all children\n *\n * @memberof Scene\n */\n removeChildren() {\n this.children = [];\n }\n /**\n * Remove sceneChild by id or name\n *\n * @param {number | number} idOrName\n * @memberof Scene\n */\n removeFromId(idOrName) {\n for (let i = 0, len = this.children.length; i < len; i++)\n if (this.children[i].id === idOrName || this.children[i].name === idOrName) {\n this.children.splice(i, 1);\n return;\n }\n }\n /**\n * Return true if sceneChild is direct children\n *\n * @param {SceneChild} sceneChild\n * @returns {boolean}\n * @memberof Scene\n */\n isFirstLevelChild(sceneChild) {\n for (let i = 0, len = this.children.length; i < len; i++)\n if (this.children[i].id === sceneChild.id)\n return true;\n const parents = this.getParentsOfSceneChild(sceneChild);\n return parents.length === 1 && parents[0] instanceof Group_1.Group;\n }\n /**\n * Returns the list of sceneChild hierarchy starting from the scene\n *\n * @param {SceneChild} sceneChild\n * @returns {Array}\n * @memberof Scene\n */\n getParentsOfSceneChild(sceneChild) {\n const result = Scene.getParentsOfSceneChild(this, sceneChild);\n if (result) {\n result.splice(0, 1);\n return result;\n }\n return [];\n }\n /**\n * Returns the list of sceneChild hierarchy starting from the scene\n *\n * @static\n * @param {(Scene | SceneChild)} current\n * @param {SceneChild} sceneChild\n * @param {(Array)} [parents=[]]\n * @returns {(Array | null)}\n * @memberof Scene\n */\n static getParentsOfSceneChild(current, sceneChild, parents = []) {\n let result;\n if (current instanceof SceneChild_1.SceneChild) {\n if (current.id == sceneChild.id)\n return parents;\n if (current instanceof Shape_1.Shape && current.shape) {\n const tmpParents = parents.slice();\n tmpParents.push(current);\n if ((result = Scene.getParentsOfSceneChild(current.shape, sceneChild, tmpParents)))\n return result;\n }\n }\n if (current instanceof Scene || current instanceof Group_1.Group) {\n const children = current.getChildren();\n parents.push(current);\n for (let i = 0, len = children.length; i < len; i++) {\n const child = children[i];\n if ((result = Scene.getParentsOfSceneChild(child, sceneChild, parents)))\n return result;\n }\n parents.pop();\n }\n return null;\n }\n /**\n * Walk through the scene\n *\n * @static\n * @param {SceneChild} callbackk\n * @param {(Scene | SceneChild)} current\n * @memberof Scene\n */\n static walk(callback, current) {\n if (current instanceof SceneChild_1.SceneChild) {\n if (callback(current) === false)\n return false;\n if (current instanceof Shape_1.Shape && current.shape)\n if (Scene.walk(callback, current.shape) === false)\n return false;\n }\n if (current instanceof Scene || current instanceof Group_1.Group) {\n const children = current.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const child = children[i];\n if (Scene.walk(callback, child) === false)\n return false;\n }\n }\n }\n /**\n * Propagate scene to sceneChild (and children)\n *\n * @static\n * @param {SceneChild} sceneChild\n * @param {Scene} scene\n * @memberof Scene\n */\n static propagateToChilden(sceneChild, scene) {\n sceneChild.scene = scene;\n if (sceneChild instanceof Group_1.Group) {\n sceneChild.getChildren().forEach((item) => {\n Scene.propagateToChilden(item, scene);\n });\n }\n else if (sceneChild instanceof Shape_1.Shape && sceneChild.shape) {\n sceneChild.shape.scene = scene;\n Scene.propagateToChilden(sceneChild.shape, scene);\n }\n }\n}\nexports.Scene = Scene;\n//# sourceMappingURL=Scene.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SceneChild = void 0;\n/**\n * Autoincrement sceneChild default id\n *\n * @internal\n * @ignore\n */\nlet __id = 0;\n/**\n * The element to be added into a scene.\n * Preserve props, drawing order, generate and return buffers.\n * The only implementations of this class are Group and ShapeBase\n *\n * @abstract\n * @category Core.Abstract\n * @order 2\n * @class SceneChild\n */\nclass SceneChild {\n /**\n * Creates an instance of SceneChild.\n * Base values will be assigned in case they are not passed\n *\n * @param {ISceneChildSettings} settings\n */\n constructor(settings) {\n var _a;\n /**\n * Shape generation id\n * used for prevent buffer calculation\n *\n * @internal\n * @ignore\n */\n this.generateId = -1;\n this.id = (_a = settings.id) !== null && _a !== void 0 ? _a : ++__id;\n this.type = settings.type || 'SceneChild';\n this.name = settings.name || this.type + '_' + this.id;\n this.data = settings.data || {};\n this.props = {};\n }\n /**\n * Find this or form or children.\n * Overridden by classes that extend it\n *\n * @param {string | number} idOrName\n * @returns {(SceneChild | null)}\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n return null;\n }\n /**\n * Return the sceneChild properties\n *\n * @returns {Props}\n */\n getProps() {\n return this.props;\n }\n /**\n * Return a sceneChild prop or default value\n *\n * @param {keyof Props} key\n * @param {PropArguments} [propArguments]\n * @param {*} [defaultValue]\n * @returns {*}\n */\n getProp(key, propArguments, defaultValue) {\n var _a;\n return ((_a = this.props[key]) !== null && _a !== void 0 ? _a : defaultValue);\n }\n /**\n * Check SceneChild has prop\n *\n * @param {keyof Props} key\n * @returns\n */\n hasProp(key) {\n return typeof this.props[key] !== 'undefined';\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n */\n setPropUnsafe(key, value) {\n if (typeof key == 'string')\n this.props[key] = value;\n else\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n }\n}\nexports.SceneChild = SceneChild;\n//# sourceMappingURL=SceneChild.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Group = void 0;\nconst Scene_1 = require(\"./Scene\");\nconst SceneChild_1 = require(\"./SceneChild\");\nconst ShapeBase_1 = require(\"./shapes/ShapeBase\");\nconst Adapt_1 = require(\"./modifiers/Adapt\");\n/**\n * A SceneChild container, propagates properties to children\n *\n * @order 3\n * @category Core.Scene\n * @extends {SceneChild}\n * @example\n * ```javascript\n * // Group example\n *\n * const rect = new Urpflanze.Rect({\n * \tdistance: 100 // <- if a property is set the group will not overwrite it\n * })\n * const group = new Urpflanze.Group({\n * \trepetitions: 3,\n * \tdistance: 200\n * })\n *\n * group.add(rect)\n * group.add(new Urpflanze.Triangle())\n * ```\n * @class Group\n */\nclass Group extends SceneChild_1.SceneChild {\n /**\n * Creates an instance of Group\n *\n * @param {ISceneChildSettings} [settings={}]\n * @memberof Group\n */\n constructor(settings = {}) {\n settings.type = 'Group';\n super(settings);\n this.children = [];\n ['id', 'name', 'data', 'order', 'type'].forEach((prop) => {\n if (prop in settings)\n delete settings[prop];\n });\n this.props = settings;\n }\n /**\n * Check group has static children\n *\n * @returns {boolean}\n * @memberof Group\n */\n isStatic() {\n const children = this.children;\n for (let i = 0, len = children.length; i < len; i++)\n if (!children[i].isStatic())\n return false;\n return true;\n }\n /**\n * Check group has static children indexed\n *\n * @returns {boolean}\n * @memberof Group\n */\n isStaticIndexed() {\n const children = this.children;\n for (let i = 0, len = children.length; i < len; i++)\n if (!children[i].isStaticIndexed())\n return false;\n return true;\n }\n /**\n * Add item to Group\n *\n * @param {Array} items\n * @memberof Group\n */\n add(...items) {\n for (let i = 0, len = items.length; i < len; i++) {\n const item = items[i];\n const rawItemProps = item.getProps();\n Object.keys(this.props).forEach((propKey) => {\n if (typeof rawItemProps[propKey] === 'undefined')\n item.setProp(propKey, this.props[propKey]);\n });\n item.order =\n typeof item.order !== 'undefined'\n ? item.order\n : this.children.length > 0\n ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1\n : 0;\n this.scene && Scene_1.Scene.propagateToChilden(item, this.scene);\n this.children.push(item);\n }\n this.sortChildren();\n }\n /**\n * Sort children\n *\n * @memberof Group\n */\n sortChildren() {\n this.children.sort((a, b) => a.order - b.order);\n this.children = this.children.map((child, index) => {\n child.order = index;\n return child;\n });\n this.clearBuffer(true);\n }\n /**\n * Return shape children\n *\n * @returns {Array}\n * @memberof Group\n */\n getChildren() {\n return this.children;\n }\n /**\n * Find scene child from id or name\n *\n * @param {number | string} idOrName\n * @returns {(SceneChild | null)}\n * @memberof Group\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n const children = this.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const result = children[i].find(idOrName);\n if (result !== null)\n return result;\n }\n return null;\n }\n /**\n * Get item from group\n *\n * @param {number} index\n * @returns {(SceneChild | null)}\n * @memberof Group\n */\n get(index) {\n return index >= 0 && index < this.children.length ? this.children[index] : null;\n }\n /**\n * Remove item from group\n *\n * @param {number} index\n * @returns {(false | Array)}\n * @memberof Group\n */\n remove(index) {\n if (index >= 0 && index < this.children.length) {\n const removed = this.children.splice(index, 1);\n this.clearBuffer(true);\n return removed;\n }\n return false;\n }\n /**\n * Remove from id\n *\n * @param {number} id\n * @memberof Scene\n */\n removeFromId(id) {\n for (let i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i].id == id) {\n this.children.splice(i, 1);\n return this.clearBuffer(true);\n }\n }\n }\n /**\n * Generate children buffers\n *\n * @param {number} generateId\n * @param {boolean} [bDirectSceneChild=false]\n * @param {IPropArguments} [parentPropArguments]\n * @memberof Group\n */\n generate(generateId, bDirectSceneChild = false, parentPropArguments) {\n this.generateId = generateId;\n this.children.forEach(item => item.generate(generateId, bDirectSceneChild, parentPropArguments));\n }\n /**\n * Sum the children bounding\n *\n * @return {IShapeBounding}\n */\n getBounding() {\n const boundings = [];\n const bounding = Adapt_1.Bounding.empty();\n if (this.children.length > 0) {\n this.children.forEach(item => boundings.push(item.getBounding()));\n for (let i = 0, len = this.children.length; i < len; i++) {\n bounding.x = bounding.x > boundings[i].x ? boundings[i].x : bounding.x;\n bounding.y = bounding.y > boundings[i].y ? boundings[i].y : bounding.y;\n bounding.width = bounding.width < boundings[i].width ? boundings[i].width : bounding.width;\n bounding.height = bounding.height < boundings[i].height ? boundings[i].height : bounding.height;\n }\n bounding.cx = bounding.x + bounding.width / 2;\n bounding.cy = bounding.y + bounding.height / 2;\n }\n return bounding;\n }\n /**\n * Chear children buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @memberof Group\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.children.forEach(item => item.clearBuffer(bClearIndexed, false));\n if (this.scene && bPropagateToParents) {\n const parents = this.scene.getParentsOfSceneChild(this);\n parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */);\n }\n // if (bPropagateToParents && this.scene)\n // {\n // const parents = this.scene.getParentsOfSceneChild(this)\n // parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, true, false)\n // }\n // if (bPropagateToChildren)\n // {\n // this.children.forEach(sceneChild => sceneChild.clearBuffer(bClearIndexed, false, true))\n // }\n }\n /**\n * Set a single or multiple props\n *\n * @abstract\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @memberof SceneChild\n */\n setProp(key, value) {\n if (typeof key === 'object')\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n else\n this.props[key] = value;\n this.children.forEach(item => item.setProp(key, value));\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @memberof ShapeBase\n */\n setPropUnsafe(key, value) {\n super.setPropUnsafe(key, value);\n this.children.forEach(item => item.setPropUnsafe(key, value));\n }\n /**\n * Return length of buffer\n *\n * @param {IPropArguments} propArguments\n * @returns {number}\n * @memberof Group\n */\n getBufferLength(propArguments) {\n return this.children.map(sceneChild => sceneChild.getBufferLength(propArguments)).reduce((p, c) => p + c, 0);\n }\n /**\n * return a single buffer binded from children\n *\n * @returns {Float32Array}\n * @memberof Group\n */\n getBuffer() {\n const buffers = this.children\n .map(item => item.getBuffer())\n .filter(b => b !== undefined);\n const size = buffers.reduce((currLength, buffer) => currLength + buffer.length, 0);\n if (size > 0) {\n const result = new Float32Array(size);\n result.set(buffers[0], 0);\n for (let i = 1, offset = 0, len = buffers.length; i < len; i++) {\n offset += buffers[i - 1].length;\n result.set(buffers[i], offset);\n }\n return result;\n }\n return ShapeBase_1.ShapeBase.EMPTY_BUFFER;\n }\n /**\n * return a single buffer binded from children\n *\n * @returns {(Array | undefined)}\n * @memberof Group\n */\n getIndexedBuffer() {\n const indexed = this.children.map(item => item.getIndexedBuffer()).filter(b => b !== undefined);\n return [].concat.apply([], indexed);\n }\n /**\n * Call strem on children\n *\n * @param {(streamArguments: IStreamArguments) => void} callback\n * @memberof Group\n */\n stream(callback) {\n this.children.forEach(item => item.stream(callback));\n }\n}\nexports.Group = Group;\n//# sourceMappingURL=Group.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeBase = void 0;\nconst gl_matrix_1 = require(\"gl-matrix\");\nconst types_1 = require(\"../types\");\nconst glme = require(\"../math/gl-matrix-extensions\");\nconst Vec2_1 = require(\"../math/Vec2\");\nconst math_1 = require(\"../math\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst Utilities_1 = require(\"../Utilities\");\nconst SceneChild_1 = require(\"../SceneChild\");\nconst tmpMatrix = gl_matrix_1.mat4.create();\nconst transformMatrix = gl_matrix_1.mat4.create();\nconst perspectiveMatrix = gl_matrix_1.mat4.create();\nconst repetitionMatrix = gl_matrix_1.mat4.create();\n/**\n * Main class for shape generation\n *\n * @category Core.Abstract\n * @abstract\n * @class ShapeBase\n * @order 4\n * @extends {SceneChild}\n */\nclass ShapeBase extends SceneChild_1.SceneChild {\n /**\n * Creates an instance of ShapeBase\n *\n * @param {ISceneChildSettings} [settings={}]\n */\n constructor(settings = {}) {\n super(settings);\n /**\n * Flag used to determine if indexedBuffer has been generated\n *\n * @internal\n * @ignore\n */\n this.bIndexed = false;\n /**\n * Array used for index a vertex buffer\n * only for first level scene children\n *\n * @internal\n * @ignore\n */\n this.indexedBuffer = [];\n /**\n * The bounding inside the scene\n *\n * @type {IShapeBounding}\n */\n this.bounding = {\n cx: 0,\n cy: 0,\n x: -1,\n y: -1,\n width: 2,\n height: 2,\n };\n this.props = {\n distance: settings.distance,\n repetitions: settings.repetitions,\n rotateX: settings.rotateX,\n rotateY: settings.rotateY,\n rotateZ: settings.rotateZ,\n skewX: settings.skewX,\n skewY: settings.skewY,\n squeezeX: settings.squeezeX,\n squeezeY: settings.squeezeY,\n displace: settings.displace,\n translate: settings.translate,\n scale: settings.scale,\n transformOrigin: settings.transformOrigin,\n perspective: settings.perspective,\n perspectiveOrigin: settings.perspectiveOrigin,\n };\n this.anchor =\n settings.anchor && Array.isArray(settings.anchor)\n ? [\n typeof settings.anchor[0] === 'number'\n ? Utilities_1.clamp(-1, 1, settings.anchor[0]) * -1\n : settings.anchor[0] === 'left'\n ? 1\n : settings.anchor[0] === 'right'\n ? -1\n : 0,\n typeof settings.anchor[1] === 'number'\n ? Utilities_1.clamp(-1, 1, settings.anchor[1]) * -1\n : settings.anchor[1] === 'top'\n ? 1\n : settings.anchor[1] === 'bottom'\n ? -1\n : 0,\n ]\n : [0, 0];\n this.boundingType =\n typeof settings.boundingType === 'string'\n ? settings.boundingType === 'relative'\n ? types_1.EBoundingType.Relative\n : types_1.EBoundingType.Fixed\n : settings.boundingType || types_1.EBoundingType.Fixed;\n this.vertexCallback = settings.vertexCallback;\n }\n /**\n * Check if the shape should be generated every time\n *\n * @returns {boolean}\n */\n isStatic() {\n const props = this.props;\n return (typeof props.repetitions !== 'function' &&\n typeof props.distance !== 'function' &&\n typeof props.displace !== 'function' &&\n typeof props.scale !== 'function' &&\n typeof props.translate !== 'function' &&\n typeof props.skewX !== 'function' &&\n typeof props.skewY !== 'function' &&\n typeof props.squeezeX !== 'function' &&\n typeof props.squeezeY !== 'function' &&\n typeof props.rotateX !== 'function' &&\n typeof props.rotateY !== 'function' &&\n typeof props.rotateZ !== 'function' &&\n typeof props.transformOrigin !== 'function' &&\n typeof props.perspective !== 'function' &&\n typeof props.perspectiveOrigin !== 'function');\n }\n /**\n * Check if the indexedBuffer array needs to be recreated every time,\n * this can happen when a shape generates an array of vertices different in length at each repetition\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return typeof this.props.repetitions !== 'function';\n }\n /**\n * Return a prop value\n *\n * @param {keyof ISceneChildProps} key\n * @param {PropArguments} [propArguments]\n * @param {*} [defaultValue]\n * @returns {*}\n */\n getProp(key, propArguments, defaultValue) {\n let attribute = this.props[key];\n if (typeof attribute === 'function') {\n attribute = attribute(propArguments);\n }\n return typeof attribute === 'undefined' || Number.isNaN(attribute) ? defaultValue : attribute;\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @param {boolean} [bClearIndexed=false]\n */\n setProp(key, value, bClearIndexed = false) {\n if (typeof key === 'string') {\n bClearIndexed = bClearIndexed || key == 'repetitions';\n this.props[key] = value;\n }\n else {\n bClearIndexed = bClearIndexed || 'repetitions' in key;\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n }\n this.clearBuffer(bClearIndexed, true);\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.buffer = undefined;\n if (bClearIndexed) {\n this.bIndexed = false;\n this.indexedBuffer = [];\n }\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n if (bPropagateToParents && this.scene && !this.scene.isFirstLevelChild(this)) {\n const parents = this.scene.getParentsOfSceneChild(this);\n parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */);\n }\n }\n /**\n * Update the vertex array if the shape is not static and update the indexedBuffer if it is also not static\n *\n * @param {number} generateId generation id\n * @param {boolean} [bDirectSceneChild=false] adjust shape of center of scene\n * @param {PropArguments} [parentPropArguments]\n */\n generate(generateId = 0, bDirectSceneChild = false, parentPropArguments) {\n var _a, _b;\n if (this.buffer && this.bStatic) {\n return;\n }\n this.generateId = generateId;\n if (!this.bStaticIndexed || !this.bIndexed)\n this.indexedBuffer = [];\n const propArguments = ShapeBase.getEmptyPropArguments(this, parentPropArguments);\n const repetition = propArguments.repetition;\n const repetitions = this.getProp('repetitions', propArguments, 1);\n const repetitionType = Array.isArray(repetitions) ? types_1.ERepetitionType.Matrix : types_1.ERepetitionType.Ring;\n const repetitionCount = Array.isArray(repetitions)\n ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0])\n : repetitions;\n const repetitionRowCount = Array.isArray(repetitions) ? repetitions[0] : repetitionCount;\n const repetitionColCount = Array.isArray(repetitions) ? (_b = repetitions[1]) !== null && _b !== void 0 ? _b : repetitions[0] : 1;\n const rowRepetition = repetition.row;\n rowRepetition.count = repetitionRowCount;\n const colRepetition = repetition.col;\n colRepetition.count = repetitionColCount;\n repetition.count = repetitionCount;\n repetition.col.count = repetitionColCount;\n repetition.row.count = repetitionRowCount;\n repetition.type = repetitionType;\n let totalBufferLength = 0;\n const buffers = [];\n let currentIndex = 0;\n const centerMatrix = gl_matrix_1.vec2.fromValues((repetitionColCount - 1) / 2, (repetitionRowCount - 1) / 2);\n const sceneAnchor = this.scene ? [this.scene.anchor[0], this.scene.anchor[1], 0] : [0, 0, 0];\n const tmpTotalShapeBounding = [undefined, undefined, undefined, undefined];\n const tmpSingleRepetitionBounding = [undefined, undefined, undefined, undefined];\n for (let currentRowRepetition = 0; currentRowRepetition < repetitionRowCount; currentRowRepetition++) {\n for (let currentColRepetition = 0; currentColRepetition < repetitionColCount; currentColRepetition++, currentIndex++) {\n repetition.index = currentIndex + 1;\n repetition.offset = repetitionCount > 1 ? currentIndex / (repetitionCount - 1) : 1;\n repetition.angle = repetitionType === types_1.ERepetitionType.Ring ? (math_1.PI2 / repetitionCount) * currentIndex : 0;\n colRepetition.index = currentColRepetition + 1;\n colRepetition.offset = repetitionColCount > 1 ? currentColRepetition / (repetitionColCount - 1) : 1;\n rowRepetition.index = currentRowRepetition + 1;\n rowRepetition.offset = repetitionRowCount > 1 ? currentRowRepetition / (repetitionRowCount - 1) : 1;\n // Generate primitives buffer recursively\n const buffer = this.generateBuffer(generateId, propArguments);\n const bufferLength = buffer.length;\n const bounding = this.getShapeBounding();\n buffers[currentIndex] = new Float32Array(bufferLength);\n totalBufferLength += bufferLength;\n {\n const distance = glme.toVec2(this.getProp('distance', propArguments, glme.VEC2_ZERO));\n const displace = this.getProp('displace', propArguments, 0);\n const scale = glme.toVec3(this.getProp('scale', propArguments, glme.VEC2_ONE), 1);\n const translate = glme.toVec3(this.getProp('translate', propArguments, glme.VEC2_ZERO), 0);\n const skewX = this.getProp('skewX', propArguments, 0);\n const skewY = this.getProp('skewY', propArguments, 0);\n const squeezeX = this.getProp('squeezeX', propArguments, 0);\n const squeezeY = this.getProp('squeezeY', propArguments, 0);\n const rotateX = this.getProp('rotateX', propArguments, 0);\n const rotateY = this.getProp('rotateY', propArguments, 0);\n const rotateZ = this.getProp('rotateZ', propArguments, 0);\n const perspective = Utilities_1.clamp(0, 1, this.getProp('perspective', propArguments, 0));\n const perspectiveOrigin = glme.toVec3(this.getProp('perspectiveOrigin', propArguments, glme.VEC2_ZERO), 0);\n const transformOrigin = glme.toVec3(this.getProp('transformOrigin', propArguments, glme.VEC2_ZERO), 0);\n let offset;\n switch (repetitionType) {\n case types_1.ERepetitionType.Ring:\n offset = gl_matrix_1.vec3.fromValues(distance[0], 0, 0);\n gl_matrix_1.vec3.rotateZ(offset, offset, glme.VEC3_ZERO, repetition.angle + displace);\n break;\n case types_1.ERepetitionType.Matrix:\n offset = gl_matrix_1.vec3.fromValues(distance[1] * (currentColRepetition - centerMatrix[0]), distance[0] * (currentRowRepetition - centerMatrix[1]), 0);\n break;\n }\n const perspectiveSize = perspective > 0 ? Math.max(bounding.width, bounding.height) / 2 : 1;\n const perspectiveValue = perspective > 0 ? perspectiveSize + (1 - perspective) * (perspectiveSize * 10) : 0;\n const bTransformOrigin = (this.boundingType === types_1.EBoundingType.Relative ? bounding.cx !== 0 || bounding.cy !== 0 : true) ||\n perspective !== 0 ||\n transformOrigin[0] !== 0 ||\n transformOrigin[1] !== 0;\n const bPerspectiveOrigin = perspectiveOrigin[0] !== 0 || perspectiveOrigin[1] !== 0;\n if (bTransformOrigin) {\n if (this.boundingType === types_1.EBoundingType.Relative) {\n transformOrigin[0] = transformOrigin[0] * (bounding.width / 2) + bounding.cx;\n transformOrigin[1] = transformOrigin[1] * (bounding.height / 2) + bounding.cy;\n }\n else {\n transformOrigin[0] *= bounding.width / 2;\n transformOrigin[1] *= bounding.height / 2;\n }\n transformOrigin[2] = perspectiveValue;\n }\n /**\n * Create Matrices\n */\n {\n /**\n * Create Transformation matrix\n */\n gl_matrix_1.mat4.identity(transformMatrix);\n bTransformOrigin && gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, transformOrigin);\n if (translate[0] !== 0 || translate[1] !== 0)\n gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, translate);\n if (skewX !== 0 || skewY !== 0) {\n glme.fromSkew(tmpMatrix, [skewX, skewY]);\n gl_matrix_1.mat4.multiply(transformMatrix, transformMatrix, tmpMatrix);\n }\n rotateX !== 0 && gl_matrix_1.mat4.rotateX(transformMatrix, transformMatrix, rotateX);\n rotateY !== 0 && gl_matrix_1.mat4.rotateY(transformMatrix, transformMatrix, rotateY);\n rotateZ !== 0 && gl_matrix_1.mat4.rotateZ(transformMatrix, transformMatrix, rotateZ);\n if (scale[0] !== 1 || scale[1] !== 1)\n gl_matrix_1.mat4.scale(transformMatrix, transformMatrix, scale);\n bTransformOrigin &&\n gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, gl_matrix_1.vec3.scale(transformOrigin, transformOrigin, -1));\n /**\n * Create Perspective matrix\n */\n if (perspectiveValue > 0) {\n if (bPerspectiveOrigin) {\n if (this.boundingType === types_1.EBoundingType.Relative) {\n perspectiveOrigin[0] = perspectiveOrigin[0] * (bounding.width / 2) + bounding.cx;\n perspectiveOrigin[1] = perspectiveOrigin[1] * (bounding.height / 2) + bounding.cy;\n }\n else {\n perspectiveOrigin[0] *= bounding.width / 2;\n perspectiveOrigin[1] *= bounding.height / 2;\n }\n perspectiveOrigin[2] = 0;\n }\n gl_matrix_1.mat4.perspective(perspectiveMatrix, -Math.PI / 2, 1, 0, Infinity);\n }\n /**\n * Create Repetition matrix\n */\n gl_matrix_1.mat4.identity(repetitionMatrix);\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, offset);\n if (bDirectSceneChild) {\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, sceneAnchor);\n }\n /**\n * Apply anchor\n */\n const shapeAnchor = [this.anchor[0] * (bounding.width / 2), this.anchor[1] * (bounding.height / 2), 0];\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, shapeAnchor);\n if (repetitionType === types_1.ERepetitionType.Ring)\n gl_matrix_1.mat4.rotateZ(repetitionMatrix, repetitionMatrix, repetition.angle + displace);\n }\n Adapt_1.Bounding.clear(tmpSingleRepetitionBounding);\n // Apply matrices on vertex\n for (let bufferIndex = 0; bufferIndex < bufferLength; bufferIndex += 2) {\n const vertex = [buffer[bufferIndex], buffer[bufferIndex + 1], perspectiveValue];\n {\n // Apply squeeze, can be insert into transformMatrix?\n squeezeX !== 0 && Vec2_1.default.squeezeX(vertex, squeezeX);\n squeezeY !== 0 && Vec2_1.default.squeezeY(vertex, squeezeY);\n // Apply transforms\n gl_matrix_1.vec3.transformMat4(vertex, vertex, transformMatrix);\n // Apply perspective\n if (perspectiveValue > 0) {\n bPerspectiveOrigin && gl_matrix_1.vec3.add(vertex, vertex, perspectiveOrigin);\n gl_matrix_1.vec3.transformMat4(vertex, vertex, perspectiveMatrix);\n gl_matrix_1.vec3.scale(vertex, vertex, perspectiveValue);\n bPerspectiveOrigin && gl_matrix_1.vec3.sub(vertex, vertex, perspectiveOrigin);\n }\n // apply repetition matrix\n gl_matrix_1.vec3.transformMat4(vertex, vertex, repetitionMatrix);\n // custom vertex manipulation\n if (typeof this.vertexCallback !== 'undefined') {\n const index = bufferIndex / 2;\n const count = bufferLength / 2;\n const vertexRepetition = {\n index: index + 1,\n count,\n offset: count > 1 ? index / (count - 1) : 1,\n };\n this.vertexCallback(vertex, vertexRepetition, propArguments);\n }\n }\n buffers[currentIndex][bufferIndex] = vertex[0];\n buffers[currentIndex][bufferIndex + 1] = vertex[1];\n Adapt_1.Bounding.add(tmpSingleRepetitionBounding, vertex[0], vertex[1]);\n Adapt_1.Bounding.add(tmpTotalShapeBounding, vertex[0], vertex[1]);\n }\n }\n // Bounding.sum(tmpTotalShapeBounding, tmpSingleRepetitionBounding)\n // After buffer creation, add a frame into indexedBuffer if not static or update bounding\n const singleRepetitionBounding = { cx: 0, cy: 0, x: -1, y: -1, width: 2, height: 2 };\n Adapt_1.Bounding.bind(singleRepetitionBounding, tmpSingleRepetitionBounding);\n if (!this.bStaticIndexed || !this.bIndexed) {\n this.addIndex(bufferLength, repetition, singleRepetitionBounding);\n }\n }\n }\n Adapt_1.Bounding.bind(this.bounding, tmpTotalShapeBounding);\n this.buffer = new Float32Array(totalBufferLength);\n for (let i = 0, offset = 0, len = buffers.length; i < len; offset += buffers[i].length, i++)\n this.buffer.set(buffers[i], offset);\n this.bIndexed = true;\n }\n /**\n * Return current shape (whit repetions) bounding\n *\n * @return {*} {IShapeBounding}\n */\n getBounding() {\n return this.bounding;\n }\n /**\n * Get number of repetitions\n *\n * @returns {number}\n */\n getRepetitionCount() {\n var _a;\n const repetitions = this.getProp('repetitions', undefined, 1);\n return Array.isArray(repetitions) ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) : repetitions;\n }\n /**\n * Return buffer\n *\n * @returns {(Float32Array | undefined)}\n */\n getBuffer() {\n return this.buffer;\n }\n /**\n * Return indexed buffer\n *\n * @returns {(Array> | undefined)}\n */\n getIndexedBuffer() {\n return this.indexedBuffer;\n }\n /**\n * Return number of encapsulation\n *\n * @param {IBufferIndex} index\n * @returns {number}\n */\n static getIndexParentLevel(index) {\n if (typeof index.parent === 'undefined')\n return 0;\n let currentParent = index.parent;\n let currentParentLevel = 1;\n while (typeof currentParent.parent !== 'undefined') {\n currentParentLevel++;\n currentParent = currentParent.parent;\n }\n return currentParentLevel;\n }\n /**\n * Stream buffer\n *\n * @param {(TStreamCallback} callback\n */\n stream(callback) {\n if (this.buffer && this.indexedBuffer) {\n for (let i = 0, j = 0, len = this.indexedBuffer.length; i < len; i++) {\n const currentIndexing = this.indexedBuffer[i];\n callback({\n buffer: this.buffer,\n frameLength: currentIndexing.frameLength,\n frameBufferIndex: j,\n currentIndexing: currentIndexing,\n currentShapeIndex: i,\n totalShapes: len,\n });\n j += currentIndexing.frameLength;\n }\n }\n }\n /**\n * Return empty propArguments\n *\n * @static\n * @param {ShapeBase} shape\n * @return {*} {PropArguments}\n */\n static getEmptyPropArguments(shape, parentPropArguments) {\n const repetition = {\n type: types_1.ERepetitionType.Ring,\n angle: 0,\n index: 1,\n offset: 1,\n count: 1,\n row: { index: 1, offset: 1, count: 1 },\n col: { index: 1, offset: 1, count: 1 },\n };\n return {\n repetition,\n shape,\n parent: parentPropArguments,\n };\n }\n}\nexports.ShapeBase = ShapeBase;\n/**\n * Empty buffer\n *\n * @internal\n * @ignore\n */\nShapeBase.EMPTY_BUFFER = new Float32Array(0);\n/**\n * Empty BaseRepetition\n *\n * @internal\n * @ignore\n */\nShapeBase.getEmptySimpleRepetition = () => ({\n index: 1,\n offset: 1,\n count: 1,\n});\n/**\n * Empty Repetition\n *\n * @internal\n * @ignore\n */\nShapeBase.getEmptyRepetition = () => ({\n type: types_1.ERepetitionType.Ring,\n angle: 0,\n ...ShapeBase.getEmptySimpleRepetition(),\n row: ShapeBase.getEmptySimpleRepetition(),\n col: ShapeBase.getEmptySimpleRepetition(),\n});\n//# sourceMappingURL=ShapeBase.js.map","import * as glMatrix from \"./common.js\";\nimport * as mat2 from \"./mat2.js\";\nimport * as mat2d from \"./mat2d.js\";\nimport * as mat3 from \"./mat3.js\";\nimport * as mat4 from \"./mat4.js\";\nimport * as quat from \"./quat.js\";\nimport * as quat2 from \"./quat2.js\";\nimport * as vec2 from \"./vec2.js\";\nimport * as vec3 from \"./vec3.js\";\nimport * as vec4 from \"./vec4.js\";\nexport { glMatrix, mat2, mat2d, mat3, mat4, quat, quat2, vec2, vec3, vec4 };","/**\r\n * Common utilities\r\n * @module glMatrix\r\n */\n// Configuration Constants\nexport var EPSILON = 0.000001;\nexport var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexport var RANDOM = Math.random;\n/**\r\n * Sets the type of array used when creating new vectors and matrices\r\n *\r\n * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array\r\n */\n\nexport function setMatrixArrayType(type) {\n ARRAY_TYPE = type;\n}\nvar degree = Math.PI / 180;\n/**\r\n * Convert Degree To Radian\r\n *\r\n * @param {Number} a Angle in Degrees\r\n */\n\nexport function toRadian(a) {\n return a * degree;\n}\n/**\r\n * Tests whether or not the arguments have approximately the same value, within an absolute\r\n * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less\r\n * than or equal to 1.0, and a relative tolerance is used for larger values)\r\n *\r\n * @param {Number} a The first number to test.\r\n * @param {Number} b The second number to test.\r\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n}\nif (!Math.hypot) Math.hypot = function () {\n var y = 0,\n i = arguments.length;\n\n while (i--) {\n y += arguments[i] * arguments[i];\n }\n\n return Math.sqrt(y);\n};","import * as glMatrix from \"./common.js\";\n/**\r\n * 2x2 Matrix\r\n * @module mat2\r\n */\n\n/**\r\n * Creates a new identity mat2\r\n *\r\n * @returns {mat2} a new 2x2 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\r\n * Creates a new mat2 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat2} a matrix to clone\r\n * @returns {mat2} a new 2x2 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Copy the values from one mat2 to another\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set a mat2 to the identity matrix\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @returns {mat2} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\r\n * Create a new mat2 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\r\n * @returns {mat2} out A new 2x2 matrix\r\n */\n\nexport function fromValues(m00, m01, m10, m11) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\r\n * Set the components of a mat2 to the given values\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\r\n * @returns {mat2} out\r\n */\n\nexport function set(out, m00, m01, m10, m11) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\r\n * Transpose the values of a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache\n // some values\n if (out === a) {\n var a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3]; // Calculate the determinant\n\n var det = a0 * a3 - a2 * a1;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function adjoint(out, a) {\n // Caching this value is nessecary if out == a\n var a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat2\r\n *\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n}\n/**\r\n * Multiplies two mat2's\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n}\n/**\r\n * Rotates a mat2 by the given angle\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n}\n/**\r\n * Scales the mat2 by the dimensions in the given vec2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to rotate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat2} out\r\n **/\n\nexport function scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n *\r\n * @param {mat2} out mat2 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n *\r\n * @param {mat2} out mat2 receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat2} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n}\n/**\r\n * Returns a string representation of a mat2\r\n *\r\n * @param {ReadonlyMat2} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat2\r\n *\r\n * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3]);\n}\n/**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @param {ReadonlyMat2} L the lower triangular matrix\r\n * @param {ReadonlyMat2} D the diagonal matrix\r\n * @param {ReadonlyMat2} U the upper triangular matrix\r\n * @param {ReadonlyMat2} a the input matrix to factorize\r\n */\n\nexport function LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n}\n/**\r\n * Adds two mat2's\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat2} a The first matrix.\r\n * @param {ReadonlyMat2} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat2} a The first matrix.\r\n * @param {ReadonlyMat2} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat2} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\r\n * Adds two mat2's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat2} out the receiving vector\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat2} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\r\n * Alias for {@link mat2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat2.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 2x3 Matrix\r\n * @module mat2d\r\n * @description\r\n * A mat2d contains six elements defined as:\r\n *
\r\n * [a, b,\r\n *  c, d,\r\n *  tx, ty]\r\n * 
\r\n * This is a short form for the 3x3 matrix:\r\n *
\r\n * [a, b, 0,\r\n *  c, d, 0,\r\n *  tx, ty, 1]\r\n * 
\r\n * The last column is ignored so the array is shorter and operations are faster.\r\n */\n\n/**\r\n * Creates a new identity mat2d\r\n *\r\n * @returns {mat2d} a new 2x3 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(6);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[4] = 0;\n out[5] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\r\n * Creates a new mat2d initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat2d} a matrix to clone\r\n * @returns {mat2d} a new 2x3 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\r\n * Copy the values from one mat2d to another\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\r\n * Set a mat2d to the identity matrix\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Create a new mat2d with the given values\r\n *\r\n * @param {Number} a Component A (index 0)\r\n * @param {Number} b Component B (index 1)\r\n * @param {Number} c Component C (index 2)\r\n * @param {Number} d Component D (index 3)\r\n * @param {Number} tx Component TX (index 4)\r\n * @param {Number} ty Component TY (index 5)\r\n * @returns {mat2d} A new mat2d\r\n */\n\nexport function fromValues(a, b, c, d, tx, ty) {\n var out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\r\n * Set the components of a mat2d to the given values\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {Number} a Component A (index 0)\r\n * @param {Number} b Component B (index 1)\r\n * @param {Number} c Component C (index 2)\r\n * @param {Number} d Component D (index 3)\r\n * @param {Number} tx Component TX (index 4)\r\n * @param {Number} ty Component TY (index 5)\r\n * @returns {mat2d} out\r\n */\n\nexport function set(out, a, b, c, d, tx, ty) {\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\r\n * Inverts a mat2d\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function invert(out, a) {\n var aa = a[0],\n ab = a[1],\n ac = a[2],\n ad = a[3];\n var atx = a[4],\n aty = a[5];\n var det = aa * ad - ab * ac;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n}\n/**\r\n * Multiplies two mat2d's\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n}\n/**\r\n * Rotates a mat2d by the given angle\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2d} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\r\n * Scales the mat2d by the dimensions in the given vec2\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to translate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat2d} out\r\n **/\n\nexport function scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\r\n * Translates the mat2d by the dimensions in the given vec2\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to translate\r\n * @param {ReadonlyVec2} v the vec2 to translate the matrix by\r\n * @returns {mat2d} out\r\n **/\n\nexport function translate(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.rotate(dest, dest, rad);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2d} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.scale(dest, dest, vec);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat2d} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.translate(dest, dest, vec);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {ReadonlyVec2} v Translation vector\r\n * @returns {mat2d} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n}\n/**\r\n * Returns a string representation of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat2d(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1);\n}\n/**\r\n * Adds two mat2d's\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat2d} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n}\n/**\r\n * Adds two mat2d's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat2d} out the receiving vector\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat2d} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat2d} a The first matrix.\r\n * @param {ReadonlyMat2d} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat2d} a The first matrix.\r\n * @param {ReadonlyMat2d} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5));\n}\n/**\r\n * Alias for {@link mat2d.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat2d.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 3x3 Matrix\r\n * @module mat3\r\n */\n\n/**\r\n * Creates a new identity mat3\r\n *\r\n * @returns {mat3} a new 3x3 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(9);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n }\n\n out[0] = 1;\n out[4] = 1;\n out[8] = 1;\n return out;\n}\n/**\r\n * Copies the upper-left 3x3 values into the given mat3.\r\n *\r\n * @param {mat3} out the receiving 3x3 matrix\r\n * @param {ReadonlyMat4} a the source 4x4 matrix\r\n * @returns {mat3} out\r\n */\n\nexport function fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n}\n/**\r\n * Creates a new mat3 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat3} a matrix to clone\r\n * @returns {mat3} a new 3x3 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Copy the values from one mat3 to another\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Create a new mat3 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\r\n * @returns {mat3} A new mat3\r\n */\n\nexport function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\r\n * Set the components of a mat3 to the given values\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\r\n * @returns {mat3} out\r\n */\n\nexport function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\r\n * Set a mat3 to the identity matrix\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @returns {mat3} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Transpose the values of a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b01 = a22 * a11 - a12 * a21;\n var b11 = -a22 * a10 + a12 * a20;\n var b21 = a21 * a10 - a11 * a20; // Calculate the determinant\n\n var det = a00 * b01 + a01 * b11 + a02 * b21;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat3\r\n *\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n}\n/**\r\n * Multiplies two mat3's\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b00 = b[0],\n b01 = b[1],\n b02 = b[2];\n var b10 = b[3],\n b11 = b[4],\n b12 = b[5];\n var b20 = b[6],\n b21 = b[7],\n b22 = b[8];\n out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n return out;\n}\n/**\r\n * Translate a mat3 by the given vector\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to translate\r\n * @param {ReadonlyVec2} v vector to translate by\r\n * @returns {mat3} out\r\n */\n\nexport function translate(out, a, v) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n x = v[0],\n y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n}\n/**\r\n * Rotates a mat3 by the given angle\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat3} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n}\n/**\r\n * Scales the mat3 by the dimensions in the given vec2\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to rotate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat3} out\r\n **/\n\nexport function scale(out, a, v) {\n var x = v[0],\n y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyVec2} v Translation vector\r\n * @returns {mat3} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat3} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat3} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Copies the values from a mat2d into a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to copy\r\n * @returns {mat3} out\r\n **/\n\nexport function fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n}\n/**\r\n * Calculates a 3x3 matrix from the given quaternion\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyQuat} q Quaternion to create matrix from\r\n *\r\n * @returns {mat3} out\r\n */\n\nexport function fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n}\n/**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n *\r\n * @returns {mat3} out\r\n */\n\nexport function normalFromMat4(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n}\n/**\r\n * Generates a 2D projection matrix with the given bounds\r\n *\r\n * @param {mat3} out mat3 frustum matrix will be written into\r\n * @param {number} width Width of your gl context\r\n * @param {number} height Height of gl context\r\n * @returns {mat3} out\r\n */\n\nexport function projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n}\n/**\r\n * Returns a string representation of a mat3\r\n *\r\n * @param {ReadonlyMat3} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat3\r\n *\r\n * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);\n}\n/**\r\n * Adds two mat3's\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat3} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n}\n/**\r\n * Adds two mat3's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat3} out the receiving vector\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat3} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat3} a The first matrix.\r\n * @param {ReadonlyMat3} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat3} a The first matrix.\r\n * @param {ReadonlyMat3} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7],\n a8 = a[8];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7],\n b8 = b[8];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8));\n}\n/**\r\n * Alias for {@link mat3.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat3.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied.\r\n * @module mat4\r\n */\n\n/**\r\n * Creates a new identity mat4\r\n *\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(16);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n }\n\n out[0] = 1;\n out[5] = 1;\n out[10] = 1;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a new mat4 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat4} a matrix to clone\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Copy the values from one mat4 to another\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Create a new mat4 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} A new mat4\r\n */\n\nexport function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\r\n * Set the components of a mat4 to the given values\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} out\r\n */\n\nexport function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\r\n * Set a mat4 to the identity matrix\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @returns {mat4} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Transpose the values of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a12 = a[6],\n a13 = a[7];\n var a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22);\n out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\n out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12);\n out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\n out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\n out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22);\n out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\n out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12);\n out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21);\n out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\n out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11);\n out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\n out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\n out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21);\n out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\n out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11);\n return out;\n}\n/**\r\n * Calculates the determinant of a mat4\r\n *\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n}\n/**\r\n * Multiplies two mat4s\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15]; // Cache only the current line of the second matrix\n\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n/**\r\n * Translate a mat4 by the given vector\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to translate\r\n * @param {ReadonlyVec3} v vector to translate by\r\n * @returns {mat4} out\r\n */\n\nexport function translate(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n\n return out;\n}\n/**\r\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to scale\r\n * @param {ReadonlyVec3} v the vec3 to scale the matrix by\r\n * @returns {mat4} out\r\n **/\n\nexport function scale(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Rotates a mat4 by the given angle around the given axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nexport function rotate(out, a, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n var b00, b01, b02;\n var b10, b11, b12;\n var b20, b21, b22;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11]; // Construct the elements of the rotation matrix\n\n b00 = x * x * t + c;\n b01 = y * x * t + z * s;\n b02 = z * x * t - y * s;\n b10 = x * y * t - z * s;\n b11 = y * y * t + c;\n b12 = z * y * t + x * s;\n b20 = x * z * t + y * s;\n b21 = y * z * t - x * s;\n b22 = z * z * t + c; // Perform rotation-specific matrix multiplication\n\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the X axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateX(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Y axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateY(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Z axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyVec3} v Scaling vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotation(out, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c; // Perform rotation-specific matrix multiplication\n\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromXRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromYRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromZRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslation(out, q, v) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a new mat4 from a dual quat.\r\n *\r\n * @param {mat4} out Matrix\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @returns {mat4} mat4 receiving operation result\r\n */\n\nexport function fromQuat2(out, a) {\n var translation = new glMatrix.ARRAY_TYPE(3);\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense\n\n if (magnitude > 0) {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n\n fromRotationTranslation(out, a, translation);\n return out;\n}\n/**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nexport function getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n}\n/**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion paramter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nexport function getScaling(out, mat) {\n var m11 = mat[0];\n var m12 = mat[1];\n var m13 = mat[2];\n var m21 = mat[4];\n var m22 = mat[5];\n var m23 = mat[6];\n var m31 = mat[8];\n var m32 = mat[9];\n var m33 = mat[10];\n out[0] = Math.hypot(m11, m12, m13);\n out[1] = Math.hypot(m21, m22, m23);\n out[2] = Math.hypot(m31, m32, m33);\n return out;\n}\n/**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @param {quat} out Quaternion to receive the rotation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {quat} out\r\n */\n\nexport function getRotation(out, mat) {\n var scaling = new glMatrix.ARRAY_TYPE(3);\n getScaling(scaling, mat);\n var is1 = 1 / scaling[0];\n var is2 = 1 / scaling[1];\n var is3 = 1 / scaling[2];\n var sm11 = mat[0] * is1;\n var sm12 = mat[1] * is2;\n var sm13 = mat[2] * is3;\n var sm21 = mat[4] * is1;\n var sm22 = mat[5] * is2;\n var sm23 = mat[6] * is3;\n var sm31 = mat[8] * is1;\n var sm32 = mat[9] * is2;\n var sm33 = mat[10] * is3;\n var trace = sm11 + sm22 + sm33;\n var S = 0;\n\n if (trace > 0) {\n S = Math.sqrt(trace + 1.0) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @param {ReadonlyVec3} s Scaling vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslationScale(out, q, v, s) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @param {ReadonlyVec3} s Scaling vector\r\n * @param {ReadonlyVec3} o The origin vector around which to scale and rotate\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n var ox = o[0];\n var oy = o[1];\n var oz = o[2];\n var out0 = (1 - (yy + zz)) * sx;\n var out1 = (xy + wz) * sx;\n var out2 = (xz - wy) * sx;\n var out4 = (xy - wz) * sy;\n var out5 = (1 - (xx + zz)) * sy;\n var out6 = (yz + wx) * sy;\n var out8 = (xz + wy) * sz;\n var out9 = (yz - wx) * sz;\n var out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n}\n/**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyQuat} q Quaternion to create matrix from\r\n *\r\n * @returns {mat4} out\r\n */\n\nexport function fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a frustum matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Number} left Left bound of the frustum\r\n * @param {Number} right Right bound of the frustum\r\n * @param {Number} bottom Bottom bound of the frustum\r\n * @param {Number} top Top bound of the frustum\r\n * @param {Number} near Near bound of the frustum\r\n * @param {Number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function frustum(out, left, right, bottom, top, near, far) {\n var rl = 1 / (right - left);\n var tb = 1 / (top - bottom);\n var nf = 1 / (near - far);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near * 2 * nf;\n out[15] = 0;\n return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} fovy Vertical field of view in radians\r\n * @param {number} aspect Aspect ratio. typically viewport width/height\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum, can be null or Infinity\r\n * @returns {mat4} out\r\n */\n\nexport function perspective(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n\n return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function perspectiveFromFieldOfView(out, fov, near, far) {\n var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);\n var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);\n var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);\n var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);\n var xScale = 2.0 / (leftTan + rightTan);\n var yScale = 2.0 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n out[4] = 0.0;\n out[5] = yScale;\n out[6] = 0.0;\n out[7] = 0.0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1.0;\n out[12] = 0.0;\n out[13] = 0.0;\n out[14] = far * near / (near - far);\n out[15] = 0.0;\n return out;\n}\n/**\r\n * Generates a orthogonal projection matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} left Left bound of the frustum\r\n * @param {number} right Right bound of the frustum\r\n * @param {number} bottom Bottom bound of the frustum\r\n * @param {number} top Top bound of the frustum\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function ortho(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {ReadonlyVec3} eye Position of the viewer\r\n * @param {ReadonlyVec3} center Point the viewer is looking at\r\n * @param {ReadonlyVec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nexport function lookAt(out, eye, center, up) {\n var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;\n var eyex = eye[0];\n var eyey = eye[1];\n var eyez = eye[2];\n var upx = up[0];\n var upy = up[1];\n var upz = up[2];\n var centerx = center[0];\n var centery = center[1];\n var centerz = center[2];\n\n if (Math.abs(eyex - centerx) < glMatrix.EPSILON && Math.abs(eyey - centery) < glMatrix.EPSILON && Math.abs(eyez - centerz) < glMatrix.EPSILON) {\n return identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n len = 1 / Math.hypot(z0, z1, z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.hypot(x0, x1, x2);\n\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n len = Math.hypot(y0, y1, y2);\n\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a matrix that makes something look at something else.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {ReadonlyVec3} eye Position of the viewer\r\n * @param {ReadonlyVec3} center Point the viewer is looking at\r\n * @param {ReadonlyVec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nexport function targetTo(out, eye, target, up) {\n var eyex = eye[0],\n eyey = eye[1],\n eyez = eye[2],\n upx = up[0],\n upy = up[1],\n upz = up[2];\n var z0 = eyex - target[0],\n z1 = eyey - target[1],\n z2 = eyez - target[2];\n var len = z0 * z0 + z1 * z1 + z2 * z2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n\n var x0 = upy * z2 - upz * z1,\n x1 = upz * z0 - upx * z2,\n x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n}\n/**\r\n * Returns a string representation of a mat4\r\n *\r\n * @param {ReadonlyMat4} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \", \" + a[9] + \", \" + a[10] + \", \" + a[11] + \", \" + a[12] + \", \" + a[13] + \", \" + a[14] + \", \" + a[15] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat4\r\n *\r\n * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);\n}\n/**\r\n * Adds two mat4's\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat4} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n}\n/**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat4} out the receiving vector\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat4} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat4} a The first matrix.\r\n * @param {ReadonlyMat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat4} a The first matrix.\r\n * @param {ReadonlyMat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var a8 = a[8],\n a9 = a[9],\n a10 = a[10],\n a11 = a[11];\n var a12 = a[12],\n a13 = a[13],\n a14 = a[14],\n a15 = a[15];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n var b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n var b8 = b[8],\n b9 = b[9],\n b10 = b[10],\n b11 = b[11];\n var b12 = b[12],\n b13 = b[13],\n b14 = b[14],\n b15 = b[15];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15));\n}\n/**\r\n * Alias for {@link mat4.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat4.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\nimport * as mat3 from \"./mat3.js\";\nimport * as vec3 from \"./vec3.js\";\nimport * as vec4 from \"./vec4.js\";\n/**\r\n * Quaternion\r\n * @module quat\r\n */\n\n/**\r\n * Creates a new identity quat\r\n *\r\n * @returns {quat} a new quaternion\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n out[3] = 1;\n return out;\n}\n/**\r\n * Set a quat to the identity quaternion\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @returns {quat} out\r\n */\n\nexport function identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyVec3} axis the axis around which to rotate\r\n * @param {Number} rad the angle in radians\r\n * @returns {quat} out\r\n **/\n\nexport function setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n var s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n}\n/**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @param {vec3} out_axis Vector receiving the axis of rotation\r\n * @param {ReadonlyQuat} q Quaternion to be decomposed\r\n * @return {Number} Angle, in radians, of the rotation\r\n */\n\nexport function getAxisAngle(out_axis, q) {\n var rad = Math.acos(q[3]) * 2.0;\n var s = Math.sin(rad / 2.0);\n\n if (s > glMatrix.EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n // If s is zero, return any axis (no rotation - axis does not matter)\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n\n return rad;\n}\n/**\r\n * Gets the angular distance between two unit quaternions\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\n\nexport function getAngle(a, b) {\n var dotproduct = dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n}\n/**\r\n * Multiplies two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {quat} out\r\n */\n\nexport function multiply(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the X axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateX(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateY(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var by = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bz = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n}\n/**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate W component of\r\n * @returns {quat} out\r\n */\n\nexport function calculateW(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\n return out;\n}\n/**\r\n * Calculate the exponential of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @returns {quat} out\r\n */\n\nexport function exp(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var et = Math.exp(w);\n var s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n}\n/**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @returns {quat} out\r\n */\n\nexport function ln(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n}\n/**\r\n * Calculate the scalar power of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @param {Number} b amount to scale the quaternion by\r\n * @returns {quat} out\r\n */\n\nexport function pow(out, a, b) {\n ln(out, a);\n scale(out, out, b);\n exp(out, out);\n return out;\n}\n/**\r\n * Performs a spherical linear interpolation between two quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n */\n\nexport function slerp(out, a, b, t) {\n // benchmarks:\n // http://jsperf.com/quaternion-slerp-implementations\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n var omega, cosom, sinom, scale0, scale1; // calc cosine\n\n cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary)\n\n if (cosom < 0.0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n } // calculate coefficients\n\n\n if (1.0 - cosom > glMatrix.EPSILON) {\n // standard case (slerp)\n omega = Math.acos(cosom);\n sinom = Math.sin(omega);\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n // \"from\" and \"to\" quaternions are very close\n // ... so we can do a linear interpolation\n scale0 = 1.0 - t;\n scale1 = t;\n } // calculate final values\n\n\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n}\n/**\r\n * Generates a random unit quaternion\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @returns {quat} out\r\n */\n\nexport function random(out) {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n var u1 = glMatrix.RANDOM();\n var u2 = glMatrix.RANDOM();\n var u3 = glMatrix.RANDOM();\n var sqrt1MinusU1 = Math.sqrt(1 - u1);\n var sqrtU1 = Math.sqrt(u1);\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n}\n/**\r\n * Calculates the inverse of a quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate inverse of\r\n * @returns {quat} out\r\n */\n\nexport function invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\n\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n}\n/**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate conjugate of\r\n * @returns {quat} out\r\n */\n\nexport function conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyMat3} m rotation matrix\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport function fromMat3(out, m) {\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n var fTrace = m[0] + m[4] + m[8];\n var fRoot;\n\n if (fTrace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\n\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot; // 1/(4w)\n\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n // |w| <= 1/2\n var i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n var j = (i + 1) % 3;\n var k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n\n return out;\n}\n/**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {x} Angle to rotate around X axis in degrees.\r\n * @param {y} Angle to rotate around Y axis in degrees.\r\n * @param {z} Angle to rotate around Z axis in degrees.\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport function fromEuler(out, x, y, z) {\n var halfToRad = 0.5 * Math.PI / 180.0;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n var sx = Math.sin(x);\n var cx = Math.cos(x);\n var sy = Math.sin(y);\n var cy = Math.cos(y);\n var sz = Math.sin(z);\n var cz = Math.cos(z);\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n return out;\n}\n/**\r\n * Returns a string representation of a quatenion\r\n *\r\n * @param {ReadonlyQuat} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"quat(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n *\r\n * @param {ReadonlyQuat} a quaternion to clone\r\n * @returns {quat} a new quaternion\r\n * @function\r\n */\n\nexport var clone = vec4.clone;\n/**\r\n * Creates a new quat initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {quat} a new quaternion\r\n * @function\r\n */\n\nexport var fromValues = vec4.fromValues;\n/**\r\n * Copy the values from one quat to another\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the source quaternion\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var copy = vec4.copy;\n/**\r\n * Set the components of a quat to the given values\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var set = vec4.set;\n/**\r\n * Adds two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var add = vec4.add;\n/**\r\n * Alias for {@link quat.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Scales a quat by a scalar number\r\n *\r\n * @param {quat} out the receiving vector\r\n * @param {ReadonlyQuat} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var scale = vec4.scale;\n/**\r\n * Calculates the dot product of two quat's\r\n *\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {Number} dot product of a and b\r\n * @function\r\n */\n\nexport var dot = vec4.dot;\n/**\r\n * Performs a linear interpolation between two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var lerp = vec4.lerp;\n/**\r\n * Calculates the length of a quat\r\n *\r\n * @param {ReadonlyQuat} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport var length = vec4.length;\n/**\r\n * Alias for {@link quat.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Calculates the squared length of a quat\r\n *\r\n * @param {ReadonlyQuat} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n * @function\r\n */\n\nexport var squaredLength = vec4.squaredLength;\n/**\r\n * Alias for {@link quat.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Normalize a quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quaternion to normalize\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var normalize = vec4.normalize;\n/**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyQuat} a The first quaternion.\r\n * @param {ReadonlyQuat} b The second quaternion.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport var exactEquals = vec4.exactEquals;\n/**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyQuat} a The first vector.\r\n * @param {ReadonlyQuat} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport var equals = vec4.equals;\n/**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n *\r\n * @param {quat} out the receiving quaternion.\r\n * @param {ReadonlyVec3} a the initial vector\r\n * @param {ReadonlyVec3} b the destination vector\r\n * @returns {quat} out\r\n */\n\nexport var rotationTo = function () {\n var tmpvec3 = vec3.create();\n var xUnitVec3 = vec3.fromValues(1, 0, 0);\n var yUnitVec3 = vec3.fromValues(0, 1, 0);\n return function (out, a, b) {\n var dot = vec3.dot(a, b);\n\n if (dot < -0.999999) {\n vec3.cross(tmpvec3, xUnitVec3, a);\n if (vec3.len(tmpvec3) < 0.000001) vec3.cross(tmpvec3, yUnitVec3, a);\n vec3.normalize(tmpvec3, tmpvec3);\n setAxisAngle(out, tmpvec3, Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n vec3.cross(tmpvec3, a, b);\n out[0] = tmpvec3[0];\n out[1] = tmpvec3[1];\n out[2] = tmpvec3[2];\n out[3] = 1 + dot;\n return normalize(out, out);\n }\n };\n}();\n/**\r\n * Performs a spherical linear interpolation with two control points\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {ReadonlyQuat} c the third operand\r\n * @param {ReadonlyQuat} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n */\n\nexport var sqlerp = function () {\n var temp1 = create();\n var temp2 = create();\n return function (out, a, b, c, d, t) {\n slerp(temp1, a, d, t);\n slerp(temp2, b, c, t);\n slerp(out, temp1, temp2, 2 * t * (1 - t));\n return out;\n };\n}();\n/**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n *\r\n * @param {ReadonlyVec3} view the vector representing the viewing direction\r\n * @param {ReadonlyVec3} right the vector representing the local \"right\" direction\r\n * @param {ReadonlyVec3} up the vector representing the local \"up\" direction\r\n * @returns {quat} out\r\n */\n\nexport var setAxes = function () {\n var matr = mat3.create();\n return function (out, view, right, up) {\n matr[0] = right[0];\n matr[3] = right[1];\n matr[6] = right[2];\n matr[1] = up[0];\n matr[4] = up[1];\n matr[7] = up[2];\n matr[2] = -view[0];\n matr[5] = -view[1];\n matr[8] = -view[2];\n return normalize(out, fromMat3(out, matr));\n };\n}();","import * as glMatrix from \"./common.js\";\n/**\r\n * 4 Dimensional Vector\r\n * @module vec4\r\n */\n\n/**\r\n * Creates a new, empty vec4\r\n *\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec4 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec4} a vector to clone\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Creates a new vec4 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function fromValues(x, y, z, w) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\r\n * Copy the values from one vec4 to another\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the source vector\r\n * @returns {vec4} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set the components of a vec4 to the given values\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} out\r\n */\n\nexport function set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\r\n * Adds two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\r\n * Multiplies two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n}\n/**\r\n * Divides two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to ceil\r\n * @returns {vec4} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to floor\r\n * @returns {vec4} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n}\n/**\r\n * Math.round the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to round\r\n * @returns {vec4} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n}\n/**\r\n * Scales a vec4 by a scalar number\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec4} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\r\n * Adds two vec4's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec4} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Calculates the length of a vec4\r\n *\r\n * @param {ReadonlyVec4} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\r\n * Calculates the squared length of a vec4\r\n *\r\n * @param {ReadonlyVec4} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Negates the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to negate\r\n * @returns {vec4} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to invert\r\n * @returns {vec4} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n out[3] = 1.0 / a[3];\n return out;\n}\n/**\r\n * Normalize a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to normalize\r\n * @returns {vec4} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n var len = x * x + y * y + z * z + w * w;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n}\n/**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n *\r\n * @param {ReadonlyVec4} result the receiving vector\r\n * @param {ReadonlyVec4} U the first vector\r\n * @param {ReadonlyVec4} V the second vector\r\n * @param {ReadonlyVec4} W the third vector\r\n * @returns {vec4} result\r\n */\n\nexport function cross(out, u, v, w) {\n var A = v[0] * w[1] - v[1] * w[0],\n B = v[0] * w[2] - v[2] * w[0],\n C = v[0] * w[3] - v[3] * w[0],\n D = v[1] * w[2] - v[2] * w[1],\n E = v[1] * w[3] - v[3] * w[1],\n F = v[2] * w[3] - v[3] * w[2];\n var G = u[0];\n var H = u[1];\n var I = u[2];\n var J = u[3];\n out[0] = H * F - I * E + J * D;\n out[1] = -(G * F) + I * C - J * B;\n out[2] = G * E - H * C + J * A;\n out[3] = -(G * D) + H * B - I * A;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec4} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n var aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec4} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n\n var v1, v2, v3, v4;\n var s1, s2;\n\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n\n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n}\n/**\r\n * Transforms the vec4 with a mat4.\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec4} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n}\n/**\r\n * Transforms the vec4 with a quat\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to transform\r\n * @param {ReadonlyQuat} q quaternion to transform with\r\n * @returns {vec4} out\r\n */\n\nexport function transformQuat(out, a, q) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3]; // calculate quat * vec\n\n var ix = qw * x + qy * z - qz * y;\n var iy = qw * y + qz * x - qx * z;\n var iz = qw * z + qx * y - qy * x;\n var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set the components of a vec4 to zero\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @returns {vec4} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec4} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec4} a The first vector.\r\n * @param {ReadonlyVec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec4} a The first vector.\r\n * @param {ReadonlyVec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\r\n * Alias for {@link vec4.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec4.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec4.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec4.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec4.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec4.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec4.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec4s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 4;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n vec[3] = a[i + 3];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n a[i + 3] = vec[3];\n }\n\n return a;\n };\n}();","import * as glMatrix from \"./common.js\";\n/**\r\n * 3 Dimensional Vector\r\n * @module vec3\r\n */\n\n/**\r\n * Creates a new, empty vec3\r\n *\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(3);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec3} a vector to clone\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\r\n * Calculates the length of a vec3\r\n *\r\n * @param {ReadonlyVec3} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return Math.hypot(x, y, z);\n}\n/**\r\n * Creates a new vec3 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function fromValues(x, y, z) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\r\n * Copy the values from one vec3 to another\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the source vector\r\n * @returns {vec3} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\r\n * Set the components of a vec3 to the given values\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} out\r\n */\n\nexport function set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\r\n * Adds two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n}\n/**\r\n * Multiplies two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n}\n/**\r\n * Divides two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to ceil\r\n * @returns {vec3} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to floor\r\n * @returns {vec3} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n}\n/**\r\n * Math.round the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to round\r\n * @returns {vec3} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n return out;\n}\n/**\r\n * Scales a vec3 by a scalar number\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec3} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n return out;\n}\n/**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec3} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return Math.hypot(x, y, z);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return x * x + y * y + z * z;\n}\n/**\r\n * Calculates the squared length of a vec3\r\n *\r\n * @param {ReadonlyVec3} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return x * x + y * y + z * z;\n}\n/**\r\n * Negates the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to negate\r\n * @returns {vec3} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to invert\r\n * @returns {vec3} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n return out;\n}\n/**\r\n * Normalize a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to normalize\r\n * @returns {vec3} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var len = x * x + y * y + z * z;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n/**\r\n * Computes the cross product of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function cross(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2];\n var bx = b[0],\n by = b[1],\n bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n}\n/**\r\n * Performs a hermite interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {ReadonlyVec3} c the third operand\r\n * @param {ReadonlyVec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function hermite(out, a, b, c, d, t) {\n var factorTimes2 = t * t;\n var factor1 = factorTimes2 * (2 * t - 3) + 1;\n var factor2 = factorTimes2 * (t - 2) + t;\n var factor3 = factorTimes2 * (t - 1);\n var factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\r\n * Performs a bezier interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {ReadonlyVec3} c the third operand\r\n * @param {ReadonlyVec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function bezier(out, a, b, c, d, t) {\n var inverseFactor = 1 - t;\n var inverseFactorTimesTwo = inverseFactor * inverseFactor;\n var factorTimes2 = t * t;\n var factor1 = inverseFactorTimesTwo * inverseFactor;\n var factor2 = 3 * t * inverseFactorTimesTwo;\n var factor3 = 3 * factorTimes2 * inverseFactor;\n var factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec3} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n var z = glMatrix.RANDOM() * 2.0 - 1.0;\n var zScale = Math.sqrt(1.0 - z * z) * scale;\n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n}\n/**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n/**\r\n * Transforms the vec3 with a mat3.\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyMat3} m the 3x3 matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformMat3(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n}\n/**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyQuat} q quaternion to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformQuat(out, a, q) {\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3];\n var x = a[0],\n y = a[1],\n z = a[2]; // var qvec = [qx, qy, qz];\n // var uv = vec3.cross([], qvec, a);\n\n var uvx = qy * z - qz * y,\n uvy = qz * x - qx * z,\n uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv);\n\n var uuvx = qy * uvz - qz * uvy,\n uuvy = qz * uvx - qx * uvz,\n uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w);\n\n var w2 = qw * 2;\n uvx *= w2;\n uvy *= w2;\n uvz *= w2; // vec3.scale(uuv, uuv, 2);\n\n uuvx *= 2;\n uuvy *= 2;\n uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv));\n\n out[0] = x + uvx + uuvx;\n out[1] = y + uvy + uuvy;\n out[2] = z + uvz + uuvz;\n return out;\n}\n/**\r\n * Rotate a 3D vector around the x-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateX(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Rotate a 3D vector around the y-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateY(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Rotate a 3D vector around the z-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateZ(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2]; //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Get the angle between two 3D vectors\r\n * @param {ReadonlyVec3} a The first operand\r\n * @param {ReadonlyVec3} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nexport function angle(a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n bx = b[0],\n by = b[1],\n bz = b[2],\n mag1 = Math.sqrt(ax * ax + ay * ay + az * az),\n mag2 = Math.sqrt(bx * bx + by * by + bz * bz),\n mag = mag1 * mag2,\n cosine = mag && dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\r\n * Set the components of a vec3 to zero\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @returns {vec3} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec3} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \")\";\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec3} a The first vector.\r\n * @param {ReadonlyVec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec3} a The first vector.\r\n * @param {ReadonlyVec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2));\n}\n/**\r\n * Alias for {@link vec3.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec3.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec3.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec3.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec3.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec3.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec3.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec3s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 3;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n }\n\n return a;\n };\n}();","import * as glMatrix from \"./common.js\";\nimport * as quat from \"./quat.js\";\nimport * as mat4 from \"./mat4.js\";\n/**\r\n * Dual Quaternion
\r\n * Format: [real, dual]
\r\n * Quaternion format: XYZW
\r\n * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
\r\n * @module quat2\r\n */\n\n/**\r\n * Creates a new identity dual quat\r\n *\r\n * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation]\r\n */\n\nexport function create() {\n var dq = new glMatrix.ARRAY_TYPE(8);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n dq[0] = 0;\n dq[1] = 0;\n dq[2] = 0;\n dq[4] = 0;\n dq[5] = 0;\n dq[6] = 0;\n dq[7] = 0;\n }\n\n dq[3] = 1;\n return dq;\n}\n/**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n *\r\n * @param {ReadonlyQuat2} a dual quaternion to clone\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function clone(a) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = a[0];\n dq[1] = a[1];\n dq[2] = a[2];\n dq[3] = a[3];\n dq[4] = a[4];\n dq[5] = a[5];\n dq[6] = a[6];\n dq[7] = a[7];\n return dq;\n}\n/**\r\n * Creates a new dual quat initialized with the given values\r\n *\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component\r\n * @param {Number} y2 Y component\r\n * @param {Number} z2 Z component\r\n * @param {Number} w2 W component\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n dq[4] = x2;\n dq[5] = y2;\n dq[6] = z2;\n dq[7] = w2;\n return dq;\n}\n/**\r\n * Creates a new dual quat from the given values (quat and translation)\r\n *\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component (translation)\r\n * @param {Number} y2 Y component (translation)\r\n * @param {Number} z2 Z component (translation)\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n var ax = x2 * 0.5,\n ay = y2 * 0.5,\n az = z2 * 0.5;\n dq[4] = ax * w1 + ay * z1 - az * y1;\n dq[5] = ay * w1 + az * x1 - ax * z1;\n dq[6] = az * w1 + ax * y1 - ay * x1;\n dq[7] = -ax * x1 - ay * y1 - az * z1;\n return dq;\n}\n/**\r\n * Creates a dual quat from a quaternion and a translation\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyQuat} q a normalized quaternion\r\n * @param {ReadonlyVec3} t tranlation vector\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromRotationTranslation(out, q, t) {\n var ax = t[0] * 0.5,\n ay = t[1] * 0.5,\n az = t[2] * 0.5,\n bx = q[0],\n by = q[1],\n bz = q[2],\n bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Creates a dual quat from a translation\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyVec3} t translation vector\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n}\n/**\r\n * Creates a dual quat from a quaternion\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyQuat} q the quaternion\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\r\n * Creates a new dual quat from a matrix (4x4)\r\n *\r\n * @param {quat2} out the dual quaternion\r\n * @param {ReadonlyMat4} a the matrix\r\n * @returns {quat2} dual quat receiving operation result\r\n * @function\r\n */\n\nexport function fromMat4(out, a) {\n //TODO Optimize this\n var outer = quat.create();\n mat4.getRotation(outer, a);\n var t = new glMatrix.ARRAY_TYPE(3);\n mat4.getTranslation(t, a);\n fromRotationTranslation(out, outer, t);\n return out;\n}\n/**\r\n * Copy the values from one dual quat to another\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the source dual quaternion\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n}\n/**\r\n * Set a dual quat to the identity dual quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @returns {quat2} out\r\n */\n\nexport function identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\r\n * Set the components of a dual quat to the given values\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component\r\n * @param {Number} y2 Y component\r\n * @param {Number} z2 Z component\r\n * @param {Number} w2 W component\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n}\n/**\r\n * Gets the real part of a dual quat\r\n * @param {quat} out real part\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @return {quat} real part\r\n */\n\nexport var getReal = quat.copy;\n/**\r\n * Gets the dual part of a dual quat\r\n * @param {quat} out dual part\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @return {quat} dual part\r\n */\n\nexport function getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n}\n/**\r\n * Set the real component of a dual quat to the given quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat} q a quaternion representing the real part\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport var setReal = quat.copy;\n/**\r\n * Set the dual component of a dual quat to the given quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat} q a quaternion representing the dual part\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function setDual(out, q) {\n out[4] = q[0];\n out[5] = q[1];\n out[6] = q[2];\n out[7] = q[3];\n return out;\n}\n/**\r\n * Gets the translation of a normalized dual quat\r\n * @param {vec3} out translation\r\n * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed\r\n * @return {vec3} translation\r\n */\n\nexport function getTranslation(out, a) {\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n}\n/**\r\n * Translates a dual quat by the given vector\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to translate\r\n * @param {ReadonlyVec3} v vector to translate by\r\n * @returns {quat2} out\r\n */\n\nexport function translate(out, a, v) {\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3],\n bx1 = v[0] * 0.5,\n by1 = v[1] * 0.5,\n bz1 = v[2] * 0.5,\n ax2 = a[4],\n ay2 = a[5],\n az2 = a[6],\n aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n}\n/**\r\n * Rotates a dual quat around the X axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateX(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around the Y axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateY(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around the Z axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat by a given quaternion (a * q)\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {ReadonlyQuat} q quaternion to rotate by\r\n * @returns {quat2} out\r\n */\n\nexport function rotateByQuatAppend(out, a, q) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n}\n/**\r\n * Rotates a dual quat by a given quaternion (q * a)\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat} q quaternion to rotate by\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @returns {quat2} out\r\n */\n\nexport function rotateByQuatPrepend(out, q, a) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n bx = a[0],\n by = a[1],\n bz = a[2],\n bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around a given axis. Does the normalisation automatically\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @param {Number} rad how far the rotation should be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateAroundAxis(out, a, axis, rad) {\n //Special case for rad = 0\n if (Math.abs(rad) < glMatrix.EPSILON) {\n return copy(out, a);\n }\n\n var axisLength = Math.hypot(axis[0], axis[1], axis[2]);\n rad = rad * 0.5;\n var s = Math.sin(rad);\n var bx = s * axis[0] / axisLength;\n var by = s * axis[1] / axisLength;\n var bz = s * axis[2] / axisLength;\n var bw = Math.cos(rad);\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Adds two dual quat's\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n}\n/**\r\n * Multiplies two dual quat's\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {quat2} out\r\n */\n\nexport function multiply(out, a, b) {\n var ax0 = a[0],\n ay0 = a[1],\n az0 = a[2],\n aw0 = a[3],\n bx1 = b[4],\n by1 = b[5],\n bz1 = b[6],\n bw1 = b[7],\n ax1 = a[4],\n ay1 = a[5],\n az1 = a[6],\n aw1 = a[7],\n bx0 = b[0],\n by0 = b[1],\n bz0 = b[2],\n bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n}\n/**\r\n * Alias for {@link quat2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Scales a dual quat by a scalar number\r\n *\r\n * @param {quat2} out the receiving dual quat\r\n * @param {ReadonlyQuat2} a the dual quat to scale\r\n * @param {Number} b amount to scale the dual quat by\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n}\n/**\r\n * Calculates the dot product of two dual quat's (The dot product of the real parts)\r\n *\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {Number} dot product of a and b\r\n * @function\r\n */\n\nexport var dot = quat.dot;\n/**\r\n * Performs a linear interpolation between two dual quats's\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5)\r\n *\r\n * @param {quat2} out the receiving dual quat\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat2} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var mt = 1 - t;\n if (dot(a, b) < 0) t = -t;\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n}\n/**\r\n * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a dual quat to calculate inverse of\r\n * @returns {quat2} out\r\n */\n\nexport function invert(out, a) {\n var sqlen = squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n}\n/**\r\n * Calculates the conjugate of a dual quat\r\n * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result.\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat2} a quat to calculate conjugate of\r\n * @returns {quat2} out\r\n */\n\nexport function conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n}\n/**\r\n * Calculates the length of a dual quat\r\n *\r\n * @param {ReadonlyQuat2} a dual quat to calculate length of\r\n * @returns {Number} length of a\r\n * @function\r\n */\n\nexport var length = quat.length;\n/**\r\n * Alias for {@link quat2.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Calculates the squared length of a dual quat\r\n *\r\n * @param {ReadonlyQuat2} a dual quat to calculate squared length of\r\n * @returns {Number} squared length of a\r\n * @function\r\n */\n\nexport var squaredLength = quat.squaredLength;\n/**\r\n * Alias for {@link quat2.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Normalize a dual quat\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a dual quaternion to normalize\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function normalize(out, a) {\n var magnitude = squaredLength(a);\n\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n var a0 = a[0] / magnitude;\n var a1 = a[1] / magnitude;\n var a2 = a[2] / magnitude;\n var a3 = a[3] / magnitude;\n var b0 = a[4];\n var b1 = a[5];\n var b2 = a[6];\n var b3 = a[7];\n var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n\n return out;\n}\n/**\r\n * Returns a string representation of a dual quatenion\r\n *\r\n * @param {ReadonlyQuat2} a dual quaternion to represent as a string\r\n * @returns {String} string representation of the dual quat\r\n */\n\nexport function str(a) {\n return \"quat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \")\";\n}\n/**\r\n * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyQuat2} a the first dual quaternion.\r\n * @param {ReadonlyQuat2} b the second dual quaternion.\r\n * @returns {Boolean} true if the dual quaternions are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7];\n}\n/**\r\n * Returns whether or not the dual quaternions have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyQuat2} a the first dual quat.\r\n * @param {ReadonlyQuat2} b the second dual quat.\r\n * @returns {Boolean} true if the dual quats are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7));\n}","import * as glMatrix from \"./common.js\";\n/**\r\n * 2 Dimensional Vector\r\n * @module vec2\r\n */\n\n/**\r\n * Creates a new, empty vec2\r\n *\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(2);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec2 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec2} a vector to clone\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\r\n * Creates a new vec2 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function fromValues(x, y) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\r\n * Copy the values from one vec2 to another\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the source vector\r\n * @returns {vec2} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\r\n * Set the components of a vec2 to the given values\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} out\r\n */\n\nexport function set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\r\n * Adds two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n}\n/**\r\n * Multiplies two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n}\n/**\r\n * Divides two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to ceil\r\n * @returns {vec2} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to floor\r\n * @returns {vec2} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n}\n/**\r\n * Math.round the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to round\r\n * @returns {vec2} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n}\n/**\r\n * Scales a vec2 by a scalar number\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec2} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n}\n/**\r\n * Adds two vec2's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec2} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return Math.hypot(x, y);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return x * x + y * y;\n}\n/**\r\n * Calculates the length of a vec2\r\n *\r\n * @param {ReadonlyVec2} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0],\n y = a[1];\n return Math.hypot(x, y);\n}\n/**\r\n * Calculates the squared length of a vec2\r\n *\r\n * @param {ReadonlyVec2} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0],\n y = a[1];\n return x * x + y * y;\n}\n/**\r\n * Negates the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to negate\r\n * @returns {vec2} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to invert\r\n * @returns {vec2} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n return out;\n}\n/**\r\n * Normalize a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to normalize\r\n * @returns {vec2} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0],\n y = a[1];\n var len = x * x + y * y;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n}\n/**\r\n * Computes the cross product of two vec2's\r\n * Note that the cross product must by definition produce a 3D vector\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function cross(out, a, b) {\n var z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec2} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0],\n ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec2} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n out[0] = Math.cos(r) * scale;\n out[1] = Math.sin(r) * scale;\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat2} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat2(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat2d\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat2d} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat2d(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat3\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat3} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat3(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat4\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0];\n var y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n}\n/**\r\n * Rotate a 2D vector\r\n * @param {vec2} out The receiving vec2\r\n * @param {ReadonlyVec2} a The vec2 point to rotate\r\n * @param {ReadonlyVec2} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec2} out\r\n */\n\nexport function rotate(out, a, b, rad) {\n //Translate point to the origin\n var p0 = a[0] - b[0],\n p1 = a[1] - b[1],\n sinC = Math.sin(rad),\n cosC = Math.cos(rad); //perform rotation and translate to correct position\n\n out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n}\n/**\r\n * Get the angle between two 2D vectors\r\n * @param {ReadonlyVec2} a The first operand\r\n * @param {ReadonlyVec2} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nexport function angle(a, b) {\n var x1 = a[0],\n y1 = a[1],\n x2 = b[0],\n y2 = b[1],\n // mag is the product of the magnitudes of a and b\n mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2),\n // mag &&.. short circuits if mag == 0\n cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\n\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\r\n * Set the components of a vec2 to zero\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @returns {vec2} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec2} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec2(\" + a[0] + \", \" + a[1] + \")\";\n}\n/**\r\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec2} a The first vector.\r\n * @param {ReadonlyVec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec2} a The first vector.\r\n * @param {ReadonlyVec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1];\n var b0 = b[0],\n b1 = b[1];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1));\n}\n/**\r\n * Alias for {@link vec2.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec2.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec2.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec2.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec2.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec2.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec2s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 2;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n }\n\n return a;\n };\n}();","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./indexedBuffer\"), exports);\n__exportStar(require(\"./propArguments\"), exports);\n__exportStar(require(\"./repetitions\"), exports);\n__exportStar(require(\"./scene-child\"), exports);\n__exportStar(require(\"./scene\"), exports);\n__exportStar(require(\"./shape-base\"), exports);\n__exportStar(require(\"./shape-primitives\"), exports);\n__exportStar(require(\"./shapes\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=indexedBuffer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=propArguments.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ERepetitionType = void 0;\n/**\n * Repetition type enumerator.\n *\n * @category Core.Repetition\n * @internal\n */\nvar ERepetitionType;\n(function (ERepetitionType) {\n /**\n * Defines the type of repetition of the shape,\n * in a circular way starting from the center of the scene\n * @order 1\n */\n ERepetitionType[ERepetitionType[\"Ring\"] = 1] = \"Ring\";\n /**\n * Defines the type of repetition of the shape,\n * on a nxm grid starting from the center of the scene\n * @order 2\n */\n ERepetitionType[ERepetitionType[\"Matrix\"] = 2] = \"Matrix\";\n})(ERepetitionType = exports.ERepetitionType || (exports.ERepetitionType = {}));\n//# sourceMappingURL=repetitions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=scene-child.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=scene.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EBoundingType = void 0;\nvar EBoundingType;\n(function (EBoundingType) {\n /**\n * Relative to the real bounding of the shape\n * @order 2\n */\n EBoundingType[EBoundingType[\"Relative\"] = 1] = \"Relative\";\n /**\n * Fixed to te width and height of the shape\n * @order 3\n */\n EBoundingType[EBoundingType[\"Fixed\"] = 2] = \"Fixed\";\n})(EBoundingType = exports.EBoundingType || (exports.EBoundingType = {}));\n//# sourceMappingURL=shape-base.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//////\n//# sourceMappingURL=shape-primitives.js.map","\"use strict\";\n// Shape\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=shapes.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toVec3 = exports.toVec2 = exports.fromSkew = exports.VEC2_ONE = exports.VEC2_ZERO = exports.VEC3_ONE = exports.VEC3_ZERO = void 0;\nconst gl_matrix_1 = require(\"gl-matrix\");\nexports.VEC3_ZERO = [0, 0, 0];\nexports.VEC3_ONE = [1, 1, 1];\nexports.VEC2_ZERO = [0, 0];\nexports.VEC2_ONE = [1, 1];\ngl_matrix_1.glMatrix.setMatrixArrayType(Array);\n/**\n * Skew matrix\n *\n * @internal\n * @ignore\n */\nfunction fromSkew(out, skew) {\n out[0] = 1;\n out[1] = Math.tan(skew[1]);\n out[2] = 0;\n out[3] = 0;\n out[4] = Math.tan(skew[0]);\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\nexports.fromSkew = fromSkew;\n/**\n * number to vec 2\n *\n * @internal\n * @ignore\n */\nfunction toVec2(x) {\n if (Array.isArray(x))\n return [x[0], x[1]];\n return [x, x];\n}\nexports.toVec2 = toVec2;\n/**\n * number to vec 3\n *\n * @internal\n * @ignore\n */\nfunction toVec3(x, defaultZValue = 0) {\n if (Array.isArray(x)) {\n return [x[0], x[1], defaultZValue];\n }\n return [x, x, defaultZValue];\n}\nexports.toVec3 = toVec3;\n//# sourceMappingURL=gl-matrix-extensions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Temporany matrix\n *\n * @internal\n * @ignore\n */\nconst MATRIX = new Array(4);\n/**\n * Vec2 operation\n *\n * @category Core.Utilities\n */\nconst Vec2 = {\n /**\n * from new vertex\n *\n * @param {Array | number} [x=0]\n * @param {number} [y]\n * @returns {Array}\n */\n from: (x = 0, y) => {\n const out = new Array(2);\n if (typeof x === 'number') {\n out[0] = x;\n out[1] = y !== null && y !== void 0 ? y : x;\n }\n else {\n out[0] = x[0];\n out[1] = x[1];\n }\n return out;\n },\n normalize: (v) => {\n const len = Vec2.length(v);\n return len !== 0 ? [v[0] / len, v[1] / len] : [0, 0];\n },\n /**\n * Distance between two points\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n distance: (a, b) => Math.hypot(a[0] - b[0], a[1] - b[1]),\n /**\n * dot product\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n dot: (a, b) => a[0] * b[0] + a[1] * b[1],\n /**\n * length of point\n *\n * @param {Array} vec\n * @returns {number}\n */\n length: (vec) => Math.hypot(vec[0], vec[1]),\n /**\n * angle between two point\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n angle: (a, b) => {\n a = Vec2.normalize(a);\n b = Vec2.normalize(b);\n return Math.acos(Vec2.dot(a, b));\n },\n /**\n * skewX point\n *\n * @param {Array} vec\n * @param {number} m\n */\n skewX: (vec, m) => {\n vec[0] += Math.tan(m) * vec[1];\n },\n /**\n * skewY point\n *\n * @param {Array} vec\n * @param {number} m\n */\n skewY: (vec, m) => {\n vec[1] += Math.tan(m) * vec[0];\n },\n /**\n * squeezeX point\n *\n * @param {Array} vec\n * @param {number} m\n */\n squeezeX: (vec, m) => {\n vec[1] += vec[1] * (vec[0] * -m);\n },\n /**\n * squeezeY point\n *\n * @param {Array} vec\n * @param {number} m\n */\n squeezeY: (vec, m) => {\n vec[0] += vec[0] * (vec[1] * m);\n },\n /**\n * Rotate point\n *\n * @param {Array} vec\n * @param {Array} MATRIX\n * @param {Array} fromPoint\n * @internal\n */\n rotate: (vec, MATRIX, fromPoint) => {\n const p0 = vec[0] - fromPoint[0];\n const p1 = vec[1] - fromPoint[1];\n vec[0] = p0 * MATRIX[0] + p1 * MATRIX[1] + fromPoint[0];\n vec[1] = p0 * MATRIX[2] + p1 * MATRIX[3] + fromPoint[1];\n },\n /**\n * RotateX point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateX: (vec, fromPoint, rad) => {\n MATRIX[0] = 1;\n MATRIX[1] = 0;\n MATRIX[2] = 0;\n MATRIX[3] = Math.cos(rad);\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * RotateY point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateY: (vec, fromPoint, rad) => {\n MATRIX[0] = Math.cos(rad);\n MATRIX[1] = 0;\n MATRIX[2] = 0;\n MATRIX[3] = 1;\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * RotateZ point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateZ: (vec, fromPoint, rad) => {\n MATRIX[0] = Math.cos(rad);\n MATRIX[1] = -Math.sin(rad);\n MATRIX[2] = Math.sin(rad);\n MATRIX[3] = Math.cos(rad);\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * Translate vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n translate: (vec, to) => {\n vec[0] += to[0];\n vec[1] += to[1];\n },\n /**\n * Scale vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n scale: (vec, to) => {\n vec[0] *= to[0];\n vec[1] *= to[1];\n },\n /**\n * Scale vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n divide: (vec, to) => {\n vec[0] /= to[0];\n vec[1] /= to[1];\n },\n /**\n * Vec to string\n *\n * @param {Array} vec\n * @return {string}\n */\n toString: (vec) => `x: ${vec[0]}, y: ${vec[1]}`,\n /**\n * Vertex [0, 0]\n */\n ZERO: Array.from([0, 0]),\n /**\n * Vertex [1, 1]\n */\n ONE: Array.from([1, 1]),\n};\nexports.default = Vec2;\n//# sourceMappingURL=Vec2.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mod = exports.PHI = exports.PI2 = exports.log = void 0;\n/**\n * Return logarith value and base\n *\n * @category Core.Utilities\n *\n * @param n number\n * @param base number\n */\nconst log = (n, base) => Math.log(n) / Math.log(base);\nexports.log = log;\n/**\n * @category Core.Utilities\n */\nexports.PI2 = Math.PI * 2;\n/**\n * @category Core.Utilities\n */\nexports.PHI = (1 + Math.sqrt(5)) / 2;\n/**\n * Return a positive module of positive or negative value\n *\n * @category Core.Utilities\n *\n * @param value number\n * @param base number\n */\nconst mod = (value, base) => {\n const result = value % base;\n return result < 0 ? result + base : result;\n};\nexports.mod = mod;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Adapt = exports.Bounding = exports.EAdaptMode = void 0;\nconst Modifier_1 = require(\"./Modifier\");\n/**\n *\n *\n * @category Core.Enums\n */\nvar EAdaptMode;\n(function (EAdaptMode) {\n /**\n * The buffer is not changed\n * @order 1\n */\n EAdaptMode[EAdaptMode[\"None\"] = 0] = \"None\";\n /**\n * The buffer is scaled in a range between [-1, -1] and [1,1]\n * @order 2\n */\n EAdaptMode[EAdaptMode[\"Scale\"] = 2] = \"Scale\";\n /**\n * The buffer is scaled in a range between [-1, -1] and [1,1] and is centered\n * @order 3\n */\n EAdaptMode[EAdaptMode[\"Center\"] = 4] = \"Center\";\n /**\n * The buffer is adapted centrally and expanded in a range between [-1, -1] and [1,1]\n * @order 4\n */\n EAdaptMode[EAdaptMode[\"Fill\"] = 8] = \"Fill\";\n})(EAdaptMode = exports.EAdaptMode || (exports.EAdaptMode = {}));\n/**\n * @internal\n * @ignore\n */\nexports.Bounding = {\n empty: () => ({\n cx: 0,\n cy: 0,\n x: -1,\n y: -1,\n width: 2,\n height: 2,\n }),\n clear: (tmpBounding) => {\n tmpBounding[0] = undefined;\n tmpBounding[1] = undefined;\n tmpBounding[2] = undefined;\n tmpBounding[3] = undefined;\n },\n add: (tmpBounding, x, y) => {\n if (typeof tmpBounding[0] === 'undefined' || x < tmpBounding[0])\n tmpBounding[0] = x;\n if (typeof tmpBounding[2] === 'undefined' || x > tmpBounding[2])\n tmpBounding[2] = x;\n if (typeof tmpBounding[1] === 'undefined' || y < tmpBounding[1])\n tmpBounding[1] = y;\n if (typeof tmpBounding[3] === 'undefined' || y > tmpBounding[3])\n tmpBounding[3] = y;\n },\n sum: (dest, bounding) => {\n if (typeof bounding[0] !== 'undefined' &&\n typeof bounding[1] !== 'undefined' &&\n typeof bounding[2] !== 'undefined' &&\n typeof bounding[3] !== 'undefined') {\n if (typeof dest[0] === 'undefined' ||\n typeof dest[1] === 'undefined' ||\n typeof dest[2] === 'undefined' ||\n typeof dest[3] === 'undefined') {\n dest[0] = bounding[0];\n dest[1] = bounding[1];\n dest[2] = bounding[2];\n dest[3] = bounding[3];\n }\n else {\n if (dest[0] < bounding[0])\n dest[0] = bounding[0];\n if (dest[2] > bounding[2])\n dest[2] = bounding[2];\n if (dest[1] < bounding[1])\n dest[1] = bounding[1];\n if (dest[3] > bounding[3])\n dest[3] = bounding[3];\n }\n }\n else {\n console.warn('[Urplfanze:Bounding] cannot sum bounding');\n }\n },\n bind: (bounding, tmpBounding) => {\n if (typeof tmpBounding[0] !== 'undefined' &&\n typeof tmpBounding[1] !== 'undefined' &&\n typeof tmpBounding[2] !== 'undefined' &&\n typeof tmpBounding[3] !== 'undefined') {\n bounding.x = tmpBounding[0];\n bounding.y = tmpBounding[1];\n bounding.width = tmpBounding[2] - tmpBounding[0];\n bounding.height = tmpBounding[3] - tmpBounding[1];\n bounding.cx = bounding.x + bounding.width / 2;\n bounding.cy = bounding.y + bounding.height / 2;\n }\n else {\n console.warn('[Urplfanze:Bounding] cannot bind bounding');\n }\n },\n};\nclass Adapt extends Modifier_1.Modifier {\n constructor(args) {\n super();\n this.mode = args.mode || EAdaptMode.Fill;\n this.rect = args.rect;\n }\n apply(buffer, bClosed) {\n return Adapt.adapt(buffer, this.mode, this.rect);\n }\n /**\n * Return adapted buffer between [-1,-1] and [1,1]\n *\n * @public\n * @static\n * @param {Float32Array} input\n * @param {EAdaptMode} mode\n * @returns {Float32Array}\n * @memberof ShapeBuffer\n */\n static adapt(input, mode, rect) {\n if (mode === EAdaptMode.None)\n return Float32Array.from(input);\n const output = new Float32Array(input.length);\n if (!rect) {\n rect = Adapt.getBounding(input);\n }\n const scale = rect.width >= 2 || rect.height >= 2 || (mode >= EAdaptMode.Fill && (rect.width < 2 || rect.height < 2))\n ? 2 / Math.max(rect.width, rect.height)\n : 1;\n const translateX = mode >= EAdaptMode.Center ? rect.cx : 0;\n const translateY = mode >= EAdaptMode.Center ? rect.cy : 0;\n for (let i = 0, len = input.length; i < len; i += 2) {\n output[i] = (input[i] - translateX) * scale;\n output[i + 1] = (input[i + 1] - translateY) * scale;\n }\n return output;\n }\n /**\n * Get buffer bounding\n *\n * @static\n * @param {Float32Array | Array} buffer\n * @returns {IShapeBounding}\n * @memberof ShapePrimitive\n */\n static getBounding(buffer, bounding) {\n if (typeof bounding === 'undefined')\n bounding = exports.Bounding.empty();\n const tmp_bounding = [undefined, undefined, undefined, undefined];\n for (let i = 0, len = buffer.length; i < len; i += 2) {\n exports.Bounding.add(tmp_bounding, buffer[i], buffer[i + 1]);\n }\n exports.Bounding.bind(bounding, tmp_bounding);\n return bounding;\n }\n}\nexports.Adapt = Adapt;\nAdapt.MODES = EAdaptMode;\n//# sourceMappingURL=Adapt.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Modifier = void 0;\nclass Modifier {\n}\nexports.Modifier = Modifier;\n//# sourceMappingURL=Modifier.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.distributePointsInBuffer = exports.interpolate = exports.prepareBufferForInterpolation = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.relativeClamp = exports.clamp = exports.lerp = exports.toRadians = exports.toDegrees = exports.now = void 0;\nconst SimplexNoise = require(\"simplex-noise\");\nconst repetitions_1 = require(\"./types/repetitions\");\nconst Vec2_1 = require(\"./math/Vec2\");\n// isDef: (object: any): boolean => typeof object !== 'undefined' && object !== null,\nconst measurement = typeof performance !== 'undefined' ? performance : Date;\n/**\n * Get current timestamp in milliseconds\n *\n * @category Utilities\n * @returns {number}\n */\nfunction now() {\n return measurement.now();\n}\nexports.now = now;\n// aOr: (...args: Array): any => {\n// \tfor (let i = 0; i < args.length; i++) if (Utilities.isDef(args[i])) return args[i]\n// },\n/**\n * Convert number from radians to degrees\n *\n * @category Utilities\n *\n * @example\n * ```javascript\n * Urpflanze.toDegrees(Math.PI) // 180\n * ```\n *\n * @param {number} radians\n * @returns {number}\n */\nfunction toDegrees(radians) {\n return (radians * 180) / Math.PI;\n}\nexports.toDegrees = toDegrees;\n/**\n * Convert angle from degrees to radians\n * @example\n * ```javascript\n * Urpflanze.toRadians(180) // 3.141592653589793\n * ```\n *\n * @category Utilities\n * @param {number} degrees\n * @returns {number}\n */\nfunction toRadians(degrees) {\n return (degrees * Math.PI) / 180;\n}\nexports.toRadians = toRadians;\n// perf: (name: string, callback: any, log: boolean = false): number => {\n// \tconst t1 = now()\n// \tcallback()\n// \tconst t2 = now()\n// \tlog && console.log('perf ' + name + ': ' + (t2 - t1))\n// \treturn t2 - t1\n// }\n/**\n * Linear interpolation from `a` when `i` as 0 an `b` when `i' as 1\n *\n * @category Utilities\n * @param {number} a\n * @param {number} b\n * @param {number} i\n * @returns {number}\n */\nfunction lerp(a, b, i) {\n return (1 - i) * a + i * b;\n}\nexports.lerp = lerp;\n/**\n * Return number between min and max\n *\n * @category Utilities\n * @example\n * ```javascript\n * Urpflanze.clamp(0, 1, 1.2) // 1\n * Urpflanze.clamp(0, 1, -2) // 0\n * ```\n * @param {number} min\n * @param {number} max\n * @param {number} value\n * @returns {number}\n */\nfunction clamp(min, max, value) {\n return value <= min ? min : value >= max ? max : value;\n}\nexports.clamp = clamp;\n/**\n * Map number between refMin e refMax from min and max\n *\n * @category Utilities\n *\n * @example\n * ```javascript\n * Urpflanze.relativeClamp(0, 1, 0.5, 100, 200) // 150\n * ```\n *\n * @param {number} refMin\n * @param {number} refMax\n * @param {number} value\n * @param {number} toMin\n * @param {number} toMax\n * @returns {number}\n */\nfunction relativeClamp(refMin, refMax, value, toMin, toMax) {\n return clamp(toMin, toMax, ((value - refMin) / (refMax - refMin)) * (toMax - toMin) + toMin);\n}\nexports.relativeClamp = relativeClamp;\n/**\n * @internal\n * @ignore\n */\nconst noises = {\n random: new SimplexNoise(Math.random),\n};\n/**\n * SimplexNoise\n * Use 'random' as seed property for random seed.\n * Return value between -1 and 1\n *\n * @category Utilities\n *\n * @param {string} [seed='random']\n * @param {number} [x=0]\n * @param {number} [y=0]\n * @param {number} [z=0]\n * @returns {number} between -1 and 1\n */\nfunction noise(seed = 'random', x = 0, y = 0, z = 0) {\n if (typeof noises[seed] === 'undefined') {\n noises[seed] = new SimplexNoise(seed);\n }\n return noises[seed].noise3D(x, y, z);\n}\nexports.noise = noise;\n/**\n * Random number generator\n */\nconst randoms = {};\n/**\n * random number generator\n * @param seed\n * @returns\n */\nfunction random(seed, min = 0, max = 1, decimals) {\n const key = seed + '';\n if (typeof randoms[key] === 'undefined') {\n const seed = xmur3(key);\n randoms[key] = sfc32(seed(), seed(), seed(), seed());\n }\n const value = min + randoms[key]() * (max - min);\n return typeof decimals !== 'undefined' ? Math.round(value * 10 ** decimals) / 10 ** decimals : value;\n}\nexports.random = random;\n/**\n *\n * @internal\n * @param str\n * @returns\n */\nfunction xmur3(str) {\n let i = 0, h = 1779033703 ^ str.length;\n for (; i < str.length; i++)\n (h = Math.imul(h ^ str.charCodeAt(i), 3432918353)), (h = (h << 13) | (h >>> 19));\n return function () {\n h = Math.imul(h ^ (h >>> 16), 2246822507);\n h = Math.imul(h ^ (h >>> 13), 3266489909);\n return (h ^= h >>> 16) >>> 0;\n };\n}\n/**\n * @internal\n * @param a\n * @param b\n * @param c\n * @param d\n * @returns\n */\nfunction sfc32(a, b, c, d) {\n return function () {\n a >>>= 0;\n b >>>= 0;\n c >>>= 0;\n d >>>= 0;\n let t = (a + b) | 0;\n a = b ^ (b >>> 9);\n b = (c + (c << 3)) | 0;\n c = (c << 21) | (c >>> 11);\n d = (d + 1) | 0;\n t = (t + d) | 0;\n c = (c + t) | 0;\n return (t >>> 0) / 4294967296;\n };\n}\n/**\n * Return angle (atan) from offset (or center) for matrix repetition.\n * Offset is array between [-1, -1] and [1, 1].\n * The return value is between -Math.PI / 2 and Math.PI / 2\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter\n * @returns {number} between -Math.PI / 2 and Math.PI / 2\n */\nfunction angleFromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [(repetition.col.count - 1) / 2, (repetition.row.count - 1) / 2];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const x = repetition.col.index - 1 - centerMatrix[0];\n const y = repetition.row.index - 1 - centerMatrix[1];\n return x === 0 ? 0 : Math.atan(y / x);\n }\n return (repetition.angle - Math.PI) / 2;\n}\nexports.angleFromRepetition = angleFromRepetition;\n/**\n * Return angle (atan2, 4 quadrants) from offset (or center) for matrix repetition.\n * Offset is array between [-1, -1] and [1, 1].\n * The return value is between -Math.PI an Math.PI\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter\n * @returns {number} between -Math.PI an Math.PI\n */\nfunction angle2FromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [(repetition.col.count - 1) / 2, (repetition.row.count - 1) / 2];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const x = repetition.col.index - 1 - centerMatrix[0];\n const y = repetition.row.index - 1 - centerMatrix[1];\n return x === 0 ? 0 : Math.atan2(y, x);\n }\n return repetition.angle - Math.PI;\n}\nexports.angle2FromRepetition = angle2FromRepetition;\n/**\n * Return distance from offset (or center) for matrix repetition.\n * The return value is between 0 and 1\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter offset relative to distance prop\n * @returns {number} between 0 and 1\n */\nfunction distanceFromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [0.5, 0.5];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const current = [repetition.col.offset, repetition.row.offset];\n return Vec2_1.default.distance(current, centerMatrix);\n }\n return 1;\n}\nexports.distanceFromRepetition = distanceFromRepetition;\n/// Interpolation\n/**\n *\n * @param from\n * @param to\n * @returns\n */\nfunction prepareBufferForInterpolation(from, to) {\n const fromBufferLength = from.length;\n const toBufferLength = to.length;\n if (fromBufferLength === toBufferLength) {\n return [from, to];\n }\n const maxBufferLength = fromBufferLength > toBufferLength ? fromBufferLength : toBufferLength;\n const difference = Math.abs(fromBufferLength - toBufferLength);\n const minBufferLength = maxBufferLength - difference;\n /////\n const b = fromBufferLength < toBufferLength ? to : from;\n const t = fromBufferLength < toBufferLength ? from : to;\n const a = distributePointsInBuffer(t, Math.floor(difference / 2));\n // a[maxBufferLength - 2] = t[minBufferLength - 2]\n // a[maxBufferLength - 1] = t[minBufferLength - 1]\n return fromBufferLength > toBufferLength ? [b, a] : [a, b];\n}\nexports.prepareBufferForInterpolation = prepareBufferForInterpolation;\n/**\n *\n * @param from\n * @param to\n * @param offset\n * @returns\n */\nfunction interpolate(from, to, initialOffset = 0.5) {\n const [a, b] = prepareBufferForInterpolation(from, to);\n const maxBufferLength = Math.max(a.length, b.length);\n const offset = typeof initialOffset === 'number' ? [initialOffset] : initialOffset;\n const maxPoints = maxBufferLength / 2;\n if (offset.length !== maxPoints) {\n const tl = offset.length;\n for (let i = 0; i < maxPoints; i++) {\n offset[i] = offset[i % tl];\n }\n }\n ////\n const result = new Float32Array(maxBufferLength);\n for (let i = 0, off = 0; i < maxBufferLength; i += 2, off++) {\n result[i] = (1 - offset[off]) * a[i] + offset[off] * b[i];\n result[i + 1] = (1 - offset[off]) * a[i + 1] + offset[off] * b[i + 1];\n }\n return result;\n}\nexports.interpolate = interpolate;\nfunction distributePointsInBuffer(buffer, count) {\n const bufferLen = buffer.length;\n const pointsLen = bufferLen / 2;\n const finalBufferLength = (pointsLen + count) * 2;\n const edges = pointsLen - 1;\n if (edges > 1) {\n const lastPoint = bufferLen - 2;\n const newPointsOnEdge = Math.floor(count / edges);\n const bufferWithPointsEveryEdge = bufferLen + newPointsOnEdge * lastPoint;\n let remainingPoints = (finalBufferLength - bufferWithPointsEveryEdge) / 2;\n const edgeRemainingIndex = Math.round(edges / remainingPoints);\n const result = new Float32Array(finalBufferLength);\n for (let i = 0, edgeIndex = 0, r = 0; i < lastPoint; i += 2, edgeIndex++, r += 2) {\n const ax = buffer[i];\n const ay = buffer[i + 1];\n const bx = buffer[i + 2];\n const by = buffer[i + 3];\n result[r] = ax;\n result[r + 1] = ay;\n const addReminingPoints = remainingPoints > 0 && (edgeIndex % edgeRemainingIndex === 0 || i === lastPoint - 2);\n const currentPointsOnEdge = newPointsOnEdge + (addReminingPoints ? 1 : 0);\n const newPointOffset = 1 / (currentPointsOnEdge + 1);\n for (let h = 0; h < currentPointsOnEdge; h++, r += 2) {\n const o = newPointOffset * (h + 1);\n result[r + 2] = (1 - o) * ax + o * bx;\n result[r + 3] = (1 - o) * ay + o * by;\n }\n if (addReminingPoints) {\n remainingPoints--;\n }\n }\n result[finalBufferLength - 2] = buffer[bufferLen - 2];\n result[finalBufferLength - 1] = buffer[bufferLen - 1];\n return result;\n }\n const result = new Float32Array(finalBufferLength);\n for (let i = 0; i < finalBufferLength; i += 2) {\n result[i] = buffer[i % bufferLen];\n result[i + 1] = buffer[(i + 1) % bufferLen];\n }\n return result;\n}\nexports.distributePointsInBuffer = distributePointsInBuffer;\n//# sourceMappingURL=Utilities.js.map","/*\n * A fast javascript implementation of simplex noise by Jonas Wagner\n\nBased on a speed-improved simplex noise algorithm for 2D, 3D and 4D in Java.\nWhich is based on example code by Stefan Gustavson (stegu@itn.liu.se).\nWith Optimisations by Peter Eastman (peastman@drizzle.stanford.edu).\nBetter rank ordering method by Stefan Gustavson in 2012.\n\n\n Copyright (c) 2018 Jonas Wagner\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n(function() {\n 'use strict';\n\n var F2 = 0.5 * (Math.sqrt(3.0) - 1.0);\n var G2 = (3.0 - Math.sqrt(3.0)) / 6.0;\n var F3 = 1.0 / 3.0;\n var G3 = 1.0 / 6.0;\n var F4 = (Math.sqrt(5.0) - 1.0) / 4.0;\n var G4 = (5.0 - Math.sqrt(5.0)) / 20.0;\n\n function SimplexNoise(randomOrSeed) {\n var random;\n if (typeof randomOrSeed == 'function') {\n random = randomOrSeed;\n }\n else if (randomOrSeed) {\n random = alea(randomOrSeed);\n } else {\n random = Math.random;\n }\n this.p = buildPermutationTable(random);\n this.perm = new Uint8Array(512);\n this.permMod12 = new Uint8Array(512);\n for (var i = 0; i < 512; i++) {\n this.perm[i] = this.p[i & 255];\n this.permMod12[i] = this.perm[i] % 12;\n }\n\n }\n SimplexNoise.prototype = {\n grad3: new Float32Array([1, 1, 0,\n -1, 1, 0,\n 1, -1, 0,\n\n -1, -1, 0,\n 1, 0, 1,\n -1, 0, 1,\n\n 1, 0, -1,\n -1, 0, -1,\n 0, 1, 1,\n\n 0, -1, 1,\n 0, 1, -1,\n 0, -1, -1]),\n grad4: new Float32Array([0, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1,\n 0, -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1,\n 1, 0, 1, 1, 1, 0, 1, -1, 1, 0, -1, 1, 1, 0, -1, -1,\n -1, 0, 1, 1, -1, 0, 1, -1, -1, 0, -1, 1, -1, 0, -1, -1,\n 1, 1, 0, 1, 1, 1, 0, -1, 1, -1, 0, 1, 1, -1, 0, -1,\n -1, 1, 0, 1, -1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, -1,\n 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0,\n -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1, 0]),\n noise2D: function(xin, yin) {\n var permMod12 = this.permMod12;\n var perm = this.perm;\n var grad3 = this.grad3;\n var n0 = 0; // Noise contributions from the three corners\n var n1 = 0;\n var n2 = 0;\n // Skew the input space to determine which simplex cell we're in\n var s = (xin + yin) * F2; // Hairy factor for 2D\n var i = Math.floor(xin + s);\n var j = Math.floor(yin + s);\n var t = (i + j) * G2;\n var X0 = i - t; // Unskew the cell origin back to (x,y) space\n var Y0 = j - t;\n var x0 = xin - X0; // The x,y distances from the cell origin\n var y0 = yin - Y0;\n // For the 2D case, the simplex shape is an equilateral triangle.\n // Determine which simplex we are in.\n var i1, j1; // Offsets for second (middle) corner of simplex in (i,j) coords\n if (x0 > y0) {\n i1 = 1;\n j1 = 0;\n } // lower triangle, XY order: (0,0)->(1,0)->(1,1)\n else {\n i1 = 0;\n j1 = 1;\n } // upper triangle, YX order: (0,0)->(0,1)->(1,1)\n // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and\n // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where\n // c = (3-sqrt(3))/6\n var x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords\n var y1 = y0 - j1 + G2;\n var x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords\n var y2 = y0 - 1.0 + 2.0 * G2;\n // Work out the hashed gradient indices of the three simplex corners\n var ii = i & 255;\n var jj = j & 255;\n // Calculate the contribution from the three corners\n var t0 = 0.5 - x0 * x0 - y0 * y0;\n if (t0 >= 0) {\n var gi0 = permMod12[ii + perm[jj]] * 3;\n t0 *= t0;\n n0 = t0 * t0 * (grad3[gi0] * x0 + grad3[gi0 + 1] * y0); // (x,y) of grad3 used for 2D gradient\n }\n var t1 = 0.5 - x1 * x1 - y1 * y1;\n if (t1 >= 0) {\n var gi1 = permMod12[ii + i1 + perm[jj + j1]] * 3;\n t1 *= t1;\n n1 = t1 * t1 * (grad3[gi1] * x1 + grad3[gi1 + 1] * y1);\n }\n var t2 = 0.5 - x2 * x2 - y2 * y2;\n if (t2 >= 0) {\n var gi2 = permMod12[ii + 1 + perm[jj + 1]] * 3;\n t2 *= t2;\n n2 = t2 * t2 * (grad3[gi2] * x2 + grad3[gi2 + 1] * y2);\n }\n // Add contributions from each corner to get the final noise value.\n // The result is scaled to return values in the interval [-1,1].\n return 70.0 * (n0 + n1 + n2);\n },\n // 3D simplex noise\n noise3D: function(xin, yin, zin) {\n var permMod12 = this.permMod12;\n var perm = this.perm;\n var grad3 = this.grad3;\n var n0, n1, n2, n3; // Noise contributions from the four corners\n // Skew the input space to determine which simplex cell we're in\n var s = (xin + yin + zin) * F3; // Very nice and simple skew factor for 3D\n var i = Math.floor(xin + s);\n var j = Math.floor(yin + s);\n var k = Math.floor(zin + s);\n var t = (i + j + k) * G3;\n var X0 = i - t; // Unskew the cell origin back to (x,y,z) space\n var Y0 = j - t;\n var Z0 = k - t;\n var x0 = xin - X0; // The x,y,z distances from the cell origin\n var y0 = yin - Y0;\n var z0 = zin - Z0;\n // For the 3D case, the simplex shape is a slightly irregular tetrahedron.\n // Determine which simplex we are in.\n var i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords\n var i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords\n if (x0 >= y0) {\n if (y0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 1;\n k2 = 0;\n } // X Y Z order\n else if (x0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n } // X Z Y order\n else {\n i1 = 0;\n j1 = 0;\n k1 = 1;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n } // Z X Y order\n }\n else { // x0 y0) rankx++;\n else ranky++;\n if (x0 > z0) rankx++;\n else rankz++;\n if (x0 > w0) rankx++;\n else rankw++;\n if (y0 > z0) ranky++;\n else rankz++;\n if (y0 > w0) ranky++;\n else rankw++;\n if (z0 > w0) rankz++;\n else rankw++;\n var i1, j1, k1, l1; // The integer offsets for the second simplex corner\n var i2, j2, k2, l2; // The integer offsets for the third simplex corner\n var i3, j3, k3, l3; // The integer offsets for the fourth simplex corner\n // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order.\n // Many values of c will never occur, since e.g. x>y>z>w makes x= 3 ? 1 : 0;\n j1 = ranky >= 3 ? 1 : 0;\n k1 = rankz >= 3 ? 1 : 0;\n l1 = rankw >= 3 ? 1 : 0;\n // Rank 2 denotes the second largest coordinate.\n i2 = rankx >= 2 ? 1 : 0;\n j2 = ranky >= 2 ? 1 : 0;\n k2 = rankz >= 2 ? 1 : 0;\n l2 = rankw >= 2 ? 1 : 0;\n // Rank 1 denotes the second smallest coordinate.\n i3 = rankx >= 1 ? 1 : 0;\n j3 = ranky >= 1 ? 1 : 0;\n k3 = rankz >= 1 ? 1 : 0;\n l3 = rankw >= 1 ? 1 : 0;\n // The fifth corner has all coordinate offsets = 1, so no need to compute that.\n var x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords\n var y1 = y0 - j1 + G4;\n var z1 = z0 - k1 + G4;\n var w1 = w0 - l1 + G4;\n var x2 = x0 - i2 + 2.0 * G4; // Offsets for third corner in (x,y,z,w) coords\n var y2 = y0 - j2 + 2.0 * G4;\n var z2 = z0 - k2 + 2.0 * G4;\n var w2 = w0 - l2 + 2.0 * G4;\n var x3 = x0 - i3 + 3.0 * G4; // Offsets for fourth corner in (x,y,z,w) coords\n var y3 = y0 - j3 + 3.0 * G4;\n var z3 = z0 - k3 + 3.0 * G4;\n var w3 = w0 - l3 + 3.0 * G4;\n var x4 = x0 - 1.0 + 4.0 * G4; // Offsets for last corner in (x,y,z,w) coords\n var y4 = y0 - 1.0 + 4.0 * G4;\n var z4 = z0 - 1.0 + 4.0 * G4;\n var w4 = w0 - 1.0 + 4.0 * G4;\n // Work out the hashed gradient indices of the five simplex corners\n var ii = i & 255;\n var jj = j & 255;\n var kk = k & 255;\n var ll = l & 255;\n // Calculate the contribution from the five corners\n var t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0;\n if (t0 < 0) n0 = 0.0;\n else {\n var gi0 = (perm[ii + perm[jj + perm[kk + perm[ll]]]] % 32) * 4;\n t0 *= t0;\n n0 = t0 * t0 * (grad4[gi0] * x0 + grad4[gi0 + 1] * y0 + grad4[gi0 + 2] * z0 + grad4[gi0 + 3] * w0);\n }\n var t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1;\n if (t1 < 0) n1 = 0.0;\n else {\n var gi1 = (perm[ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]]] % 32) * 4;\n t1 *= t1;\n n1 = t1 * t1 * (grad4[gi1] * x1 + grad4[gi1 + 1] * y1 + grad4[gi1 + 2] * z1 + grad4[gi1 + 3] * w1);\n }\n var t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2;\n if (t2 < 0) n2 = 0.0;\n else {\n var gi2 = (perm[ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]]] % 32) * 4;\n t2 *= t2;\n n2 = t2 * t2 * (grad4[gi2] * x2 + grad4[gi2 + 1] * y2 + grad4[gi2 + 2] * z2 + grad4[gi2 + 3] * w2);\n }\n var t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3;\n if (t3 < 0) n3 = 0.0;\n else {\n var gi3 = (perm[ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]]] % 32) * 4;\n t3 *= t3;\n n3 = t3 * t3 * (grad4[gi3] * x3 + grad4[gi3 + 1] * y3 + grad4[gi3 + 2] * z3 + grad4[gi3 + 3] * w3);\n }\n var t4 = 0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4;\n if (t4 < 0) n4 = 0.0;\n else {\n var gi4 = (perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32) * 4;\n t4 *= t4;\n n4 = t4 * t4 * (grad4[gi4] * x4 + grad4[gi4 + 1] * y4 + grad4[gi4 + 2] * z4 + grad4[gi4 + 3] * w4);\n }\n // Sum up and scale the result to cover the range [-1,1]\n return 27.0 * (n0 + n1 + n2 + n3 + n4);\n }\n };\n\n function buildPermutationTable(random) {\n var i;\n var p = new Uint8Array(256);\n for (i = 0; i < 256; i++) {\n p[i] = i;\n }\n for (i = 0; i < 255; i++) {\n var r = i + ~~(random() * (256 - i));\n var aux = p[i];\n p[i] = p[r];\n p[r] = aux;\n }\n return p;\n }\n SimplexNoise._buildPermutationTable = buildPermutationTable;\n\n function alea() {\n // Johannes Baagøe , 2010\n var s0 = 0;\n var s1 = 0;\n var s2 = 0;\n var c = 1;\n\n var mash = masher();\n s0 = mash(' ');\n s1 = mash(' ');\n s2 = mash(' ');\n\n for (var i = 0; i < arguments.length; i++) {\n s0 -= mash(arguments[i]);\n if (s0 < 0) {\n s0 += 1;\n }\n s1 -= mash(arguments[i]);\n if (s1 < 0) {\n s1 += 1;\n }\n s2 -= mash(arguments[i]);\n if (s2 < 0) {\n s2 += 1;\n }\n }\n mash = null;\n return function() {\n var t = 2091639 * s0 + c * 2.3283064365386963e-10; // 2^-32\n s0 = s1;\n s1 = s2;\n return s2 = t - (c = t | 0);\n };\n }\n function masher() {\n var n = 0xefc8249d;\n return function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n }\n\n // amd\n if (typeof define !== 'undefined' && define.amd) define(function() {return SimplexNoise;});\n // common js\n if (typeof exports !== 'undefined') exports.SimplexNoise = SimplexNoise;\n // browser\n else if (typeof window !== 'undefined') window.SimplexNoise = SimplexNoise;\n // nodejs\n if (typeof module !== 'undefined') {\n module.exports = SimplexNoise;\n }\n\n})();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Shape = void 0;\nconst Scene_1 = require(\"../Scene\");\nconst SceneChild_1 = require(\"../SceneChild\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\n/**\n * Container of ShapeBase or Group, it applies transformations on each repetition\n *\n * @category Core.Shapes\n */\nclass Shape extends ShapeBase_1.ShapeBase {\n /**\n * Creates an instance of Shape.\n *\n * @param {ShapeSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'Shape';\n super(settings);\n if (settings.shape instanceof SceneChild_1.SceneChild) {\n this.shape = settings.shape;\n }\n else {\n console.warn(\"[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\\nYou passed:\", settings.shape);\n }\n this.shapeUseParent = !!settings.shapeUseParent;\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n */\n isStatic() {\n // return super.isStatic() && !this.shapeUseParent\n return super.isStatic() && (this.shape ? this.shape.isStatic() : true);\n }\n /**\n * Check if shape has static index\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return super.isStaticIndexed() && (this.shape ? this.shape.isStaticIndexed() : true);\n }\n /**\n * Find shape by id or name\n *\n * @param {number | string} idOrName\n * @returns {(SceneChild | null)}\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n if (this.shape)\n return this.shape.find(idOrName);\n return null;\n }\n /**\n * Return length of buffer\n *\n * @param {PropArguments} propArguments\n * @returns {number}\n */\n getBufferLength(propArguments) {\n if (this.bStatic && this.buffer && this.buffer.length > 0)\n return this.buffer.length;\n const childBufferLength = this.shape ? this.shape.getBufferLength(propArguments) : 0;\n return childBufferLength * this.getRepetitionCount();\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape) {\n if (this.shapeUseParent || this.shape.generateId !== generateId) {\n if (this.shapeUseParent) {\n this.shape.clearBuffer(true, false);\n }\n this.shape.generate(generateId, false, propArguments);\n }\n return this.shape.getBuffer();\n }\n return Shape.EMPTY_BUFFER;\n }\n /**\n * Return bounding\n *\n * @param {boolean} bDirectSceneChild\n * @returns {IShapeBounding}\n */\n getShapeBounding() {\n if (this.shape) {\n return this.shape.getBounding();\n }\n return this.bounding; // empty bounding defined in ShapeBase\n }\n /**\n * Add to indexed buffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n const parentBufferIndex = {\n shape: this,\n frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n };\n for (let i = 0, len = childIndexedBuffer.length; i < len; i++) {\n const currentIndexed = { ...childIndexedBuffer[i] };\n const parent = currentIndexed.parent\n ? Shape.setIndexedParent(currentIndexed.parent, parentBufferIndex)\n : parentBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n }\n }\n }\n /**\n * Set parent of indexed\n *\n * @static\n * @param {(IBufferIndex )} current\n * @param {IBufferIndex} parent\n * @returns {(IBufferIndex )}\n */\n static setIndexedParent(current, parent) {\n const index = {\n ...current,\n };\n index.parent = current.parent ? Shape.setIndexedParent(current.parent, parent) : parent;\n return index;\n }\n /**\n * Set shape\n *\n * @param {(SceneChild | undefined)} [shape]\n */\n setShape(shape) {\n if (typeof shape === 'undefined') {\n this.shape = undefined;\n this.clearBuffer(true, true);\n }\n else {\n this.scene && Scene_1.Scene.propagateToChilden(shape, this.scene);\n this.shape = shape;\n this.shape.clearBuffer(true, true);\n }\n }\n}\nexports.Shape = Shape;\n//# sourceMappingURL=Shape.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapePrimitive = void 0;\nconst glme = require(\"../math/gl-matrix-extensions\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\nconst Modifier_1 = require(\"../modifiers/Modifier\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\n/**\n * @category Core.Abstract\n */\nclass ShapePrimitive extends ShapeBase_1.ShapeBase {\n /**\n * Creates an instance of ShapePrimitive.\n *\n * @param {IShapePrimitiveSettings} [settings={}]\n */\n constructor(settings = {}) {\n var _a;\n super(settings);\n /**\n * Contain the bounding of the last generated buffer\n *\n * @type {IShapeBounding}\n */\n this.currentGenerationPrimitiveBounding = Adapt_1.Bounding.empty();\n this.props.sideLength =\n typeof settings.sideLength === 'undefined'\n ? undefined\n : typeof settings.sideLength === 'function'\n ? settings.sideLength\n : glme.toVec2(settings.sideLength);\n this.drawer = settings.drawer || {};\n this.modifiers = settings.modifiers;\n this.bClosed = (_a = settings.bClosed) !== null && _a !== void 0 ? _a : true;\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n * @memberof ShapePrimitive\n */\n isStatic() {\n return typeof this.props.sideLength !== 'function' && super.isStatic();\n }\n /**\n * Return sideLength for current repetition\n *\n * @param propArguments\n * @returns\n */\n getRepetitionSideLength(propArguments) {\n if (this.bStatic) {\n // not set default value into constructor because it can be overridden by group\n if (typeof this.props.sideLength === 'undefined') {\n this.props.sideLength = [50, 50];\n }\n else if (typeof this.props.sideLength === 'number') {\n this.props.sideLength = [this.props.sideLength, this.props.sideLength];\n }\n return this.props.sideLength;\n }\n return glme.toVec2(this.getProp('sideLength', propArguments, [50, 50]));\n }\n /**\n * Apply modifiers on single repetition buffer\n *\n * @param buffer\n * @returns\n */\n applyModifiers(buffer, propArguments) {\n if (typeof this.modifiers === 'undefined')\n return buffer;\n let modified = buffer;\n const modifiers = Array.isArray(this.modifiers) ? this.modifiers : [this.modifiers];\n for (let i = 0, len = modifiers.length; i < len; i++) {\n const modifier = modifiers[i] instanceof Modifier_1.Modifier\n ? modifiers[i]\n : modifiers[i](propArguments);\n //@ts-ignore\n modified = modifier.apply(modified, this.bClosed, this);\n }\n return modified;\n }\n /**\n * Return a bounding of generated buffer if is direct scene child\n *\n * @returns {IShapeBounding}\n * @memberof ShapePrimitive\n */\n getShapeBounding() {\n return this.currentGenerationPrimitiveBounding;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n const index = {\n shape: this,\n frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n };\n this.indexedBuffer.push(index);\n }\n /**\n * Return bClosed\n *\n * @returns {boolean}\n * @memberof ShapePrimitive\n */\n isClosed() {\n return this.bClosed;\n }\n /**\n * Set bClosed\n *\n * @param {boolean} bClosed\n * @memberof ShapePrimitive\n */\n setClosed(bClosed) {\n this.bClosed = bClosed;\n }\n}\nexports.ShapePrimitive = ShapePrimitive;\n//# sourceMappingURL=ShapePrimitive.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeLoop = void 0;\nconst math_1 = require(\"../math\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst ShapePrimitive_1 = require(\"../shapes/ShapePrimitive\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\n/**\n * Shape Loop\n *\n * @category Core.Shapes\n * @public\n * @class ShapeLoop\n * @extends {ShapePrimitive}\n */\nclass ShapeLoop extends ShapePrimitive_1.ShapePrimitive {\n /**\n * Creates an instance of ShapeLoop.\n *\n * @param {IShapeLoopSettings} [settings={}]\n * @param {boolean} [bPreventGeneration=false]\n */\n constructor(settings = {}, bPreventGeneration = false) {\n settings.type = settings.type || 'ShapeLoop';\n super(settings);\n this.loopDependencies = (settings.loopDependencies || []).concat('sideLength');\n this.props.loop = settings.loop;\n if (!bPreventGeneration) {\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: math_1.PI2 / 10,\n vertex: () => [0, 0],\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n }\n /**\n * Check if currentOrSingleLoopBuffer is static\n *\n * @returns {boolean}\n */\n isStaticLoop() {\n if (this.loopDependencies.includes('propArguments'))\n return false;\n for (let i = 0, len = this.loopDependencies.length; i < len; i++)\n if (typeof this.props[this.loopDependencies[i]] === 'function')\n return false;\n return true;\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n */\n isStatic() {\n return this.bStaticLoop && super.isStatic();\n }\n /**\n * Check if shape has static indexed\n * The number of vertices is defined by number of loop iteration\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n // return this.bStaticLoop && super.isStaticIndexed()\n return (super.isStaticIndexed() &&\n (typeof this.props.loop !== 'undefined'\n ? typeof this.props.loop.start !== 'function' &&\n typeof this.props.loop.end !== 'function' &&\n typeof this.props.loop.inc !== 'function'\n : true));\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.bStaticLoop = this.isStaticLoop();\n if (bClearIndexed) {\n this.currentOrSingleLoopBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n * Set single or multiple props\n *\n * @param {(Props)} key\n * @param {*} [value]\n * @param {boolean} [bClearIndexed=false]\n */\n setProp(key, value) {\n let bClearIndexed = false;\n const keys = (typeof key === 'string' ? { [key]: value } : key);\n for (let i = this.loopDependencies.length - 1; i >= 0; i--) {\n if (this.loopDependencies[i] in keys) {\n // this.props.loop = undefined\n bClearIndexed = true;\n break;\n }\n }\n if ('loop' in keys) {\n keys.loop = { ...this.props.loop, ...keys.loop };\n bClearIndexed = true;\n }\n super.setProp(keys, value, bClearIndexed);\n }\n /**\n * Return length of buffer\n *\n * @param {PropArguments} [propArguments]\n * @returns {number}\n */\n getBufferLength(propArguments) {\n if (this.bStatic && typeof this.buffer !== 'undefined')\n return this.buffer.length;\n if (this.bStaticLoop && typeof this.currentOrSingleLoopBuffer !== 'undefined')\n return this.currentOrSingleLoopBuffer.length * this.getRepetitionCount();\n const { count } = this.getLoop(propArguments || ShapeBase_1.ShapeBase.getEmptyPropArguments(this));\n return this.getRepetitionCount() * count * 2;\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (!this.bStaticLoop)\n return this.generateLoopBuffer(propArguments);\n if (typeof this.props.sideLength === 'function' || typeof this.currentOrSingleLoopBuffer === 'undefined')\n this.currentOrSingleLoopBuffer = this.generateLoopBuffer(propArguments);\n return this.currentOrSingleLoopBuffer;\n }\n /**\n * Generate loop buffer\n *\n * @protected\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateLoopBuffer(propArguments) {\n const { start, inc, /*end,*/ count } = this.getLoop(propArguments);\n const sideLength = this.getRepetitionSideLength(propArguments);\n const getVertex = (this.props.loop && this.props.loop.vertex ? this.props.loop.vertex : this.loop.vertex);\n const shapeLoop = {\n index: 0,\n offset: 0,\n current: 0,\n count: count,\n };\n const vertexLength = shapeLoop.count;\n const bufferLength = vertexLength * 2;\n const currentOrSingleLoopBuffer = new Float32Array(bufferLength);\n for (let i = 0, j = 0; i < vertexLength; i++, j += 2) {\n const current = start + inc * i;\n const offset = shapeLoop.count > 1 ? i / (shapeLoop.count - 1) : 1;\n // const angle = (end - start) * offset + start\n shapeLoop.current = current;\n shapeLoop.index = i + 1;\n shapeLoop.offset = offset;\n const vertex = getVertex(shapeLoop, propArguments);\n currentOrSingleLoopBuffer[j] = vertex[0];\n currentOrSingleLoopBuffer[j + 1] = vertex[1];\n // currentOrSingleLoopBuffer[j] *= sideLength[0]\n // currentOrSingleLoopBuffer[j + 1] *= sideLength[1]\n // Bounding.add(tmpBounding, currentOrSingleLoopBuffer[j], currentOrSingleLoopBuffer[j + 1])\n }\n const tmpBounding = [undefined, undefined, undefined, undefined];\n const buffer = this.applyModifiers(currentOrSingleLoopBuffer, propArguments);\n for (let i = 0, len = buffer.length; i < len; i += 2) {\n buffer[i] = buffer[i] * sideLength[0];\n buffer[i + 1] = buffer[i + 1] * sideLength[1];\n Adapt_1.Bounding.add(tmpBounding, buffer[i], buffer[i + 1]);\n }\n Adapt_1.Bounding.bind(this.currentGenerationPrimitiveBounding, tmpBounding);\n return buffer;\n }\n /**\n * Return information about a client loop gnerator\n *\n * @public\n * @param {PropArguments} propArguments\n * @returns {ShapeLoopInformation}\n */\n getLoop(propArguments) {\n var _a, _b, _c, _d, _e, _f;\n let start = (_b = (_a = this.props.loop) === null || _a === void 0 ? void 0 : _a.start) !== null && _b !== void 0 ? _b : this.loop.start;\n let end = (_d = (_c = this.props.loop) === null || _c === void 0 ? void 0 : _c.end) !== null && _d !== void 0 ? _d : this.loop.end;\n let inc = (_f = (_e = this.props.loop) === null || _e === void 0 ? void 0 : _e.inc) !== null && _f !== void 0 ? _f : this.loop.inc;\n start = (typeof start === 'function' ? start(propArguments) : start);\n end = (typeof end === 'function' ? end(propArguments) : end);\n inc = (typeof inc === 'function' ? inc(propArguments) : inc);\n const count = Math.ceil((end - start) / inc);\n return { start, end, inc, count: count <= 0 ? 0 : count };\n }\n /**\n * Set shape from loop generator\n *\n * @param {(IShapeLoopGenerator)} [shape]\n */\n setShape(loop) {\n this.setProp('loop', loop);\n }\n /**\n * Get static buffer\n *\n * @param sideLength\n * @returns\n */\n static getBuffer(props) {\n const shape = new this({ ...props, sideLength: props.sideLength || 1 });\n shape.generate();\n return shape.getBuffer() || new Float32Array();\n }\n}\nexports.ShapeLoop = ShapeLoop;\nShapeLoop.PId2 = Math.PI / 2;\n//# sourceMappingURL=ShapeLoop.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeBuffer = void 0;\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst ShapePrimitive_1 = require(\"../shapes/ShapePrimitive\");\n/**\n * @category Core.Shapes\n */\nclass ShapeBuffer extends ShapePrimitive_1.ShapePrimitive {\n /**\n * Creates an instance of ShapeBuffer.\n *\n * @param {IShapeBufferSettings} [settings={}]\n */\n constructor(settings = {}) {\n var _a, _b;\n settings.type = settings.type || 'ShapeBuffer';\n settings.adaptMode = (_a = settings.adaptMode) !== null && _a !== void 0 ? _a : Adapt_1.EAdaptMode.Scale;\n super(settings);\n this.adaptMode = (_b = settings.adaptMode) !== null && _b !== void 0 ? _b : Adapt_1.EAdaptMode.Fill;\n if (typeof settings.shape === 'undefined') {\n console.warn('[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property');\n this.shape = ShapeBuffer.EMPTY_BUFFER;\n }\n else {\n this.shape = typeof settings.shape !== 'function' ? Adapt_1.Adapt.adapt(settings.shape, this.adaptMode) : settings.shape;\n }\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n /**\n * Check shape is static\n *\n * @returns boolean\n */\n isStatic() {\n return typeof this.shape !== 'function' && super.isStatic();\n }\n /**\n * Check shape is static indexed\n *\n * @returns boolean\n */\n isStaticIndexed() {\n return typeof this.shape !== 'function' && super.isStaticIndexed();\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n this.shapeBuffer = undefined;\n }\n /**\n * Apply sideLength on .shape buffer and calculate bounding\n *\n * @protected\n */\n bindBuffer(propArguments) {\n const sideLength = this.getRepetitionSideLength(propArguments);\n const shapeBuffer = this.applyModifiers(Float32Array.from(typeof this.shape === 'function' ? this.shape(propArguments) : this.shape), propArguments);\n const tmpBounding = [undefined, undefined, undefined, undefined];\n for (let i = 0, len = shapeBuffer.length; i < len; i += 2) {\n shapeBuffer[i] = shapeBuffer[i] * sideLength[0];\n shapeBuffer[i + 1] = shapeBuffer[i + 1] * sideLength[1];\n Adapt_1.Bounding.add(tmpBounding, shapeBuffer[i], shapeBuffer[i + 1]);\n }\n Adapt_1.Bounding.bind(this.currentGenerationPrimitiveBounding, tmpBounding);\n this.shapeBuffer = shapeBuffer;\n }\n /**\n * Return length of buffer\n *\n * @param {IPropArguments} propArguments\n * @returns {number}\n */\n getBufferLength( /*propArguments?: IPropArguments*/) {\n if (this.buffer && this.buffer.length > 0)\n return this.buffer.length;\n return this.shape.length * this.getRepetitionCount();\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (typeof this.shapeBuffer === 'undefined' ||\n typeof this.props.sideLength === 'function' ||\n typeof this.shape === 'function') {\n this.bindBuffer(propArguments);\n }\n return this.shapeBuffer;\n }\n /**\n * Set shape\n *\n * @param {(Float32Array)} [shape]\n */\n setShape(shape) {\n this.shape = Adapt_1.Adapt.adapt(shape, this.adaptMode);\n this.clearBuffer(true);\n }\n /**\n * Return adaptMode\n *\n * @returns {EAdaptMode}\n * @memberof ShapeBase\n */\n getAdaptMode() {\n return this.adaptMode;\n }\n /**\n * Get static buffer\n *\n * @param sideLength\n * @returns\n */\n static getBuffer(props = {}) {\n const shape = new this({ ...props, sideLength: props.sideLength || 1 });\n shape.generate();\n return shape.getBuffer() || new Float32Array();\n }\n}\nexports.ShapeBuffer = ShapeBuffer;\n//# sourceMappingURL=ShapeBuffer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeRecursive = void 0;\nconst Shape_1 = require(\"./Shape\");\n/**\n * @category Core.Shapes\n */\nclass ShapeRecursive extends Shape_1.Shape {\n /**\n * Creates an instance of ShapeRecursive.\n *\n * @param {IShapeRecursiveSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'ShapeRecursive';\n super(settings);\n this.props.recursions = settings.recursions || 1;\n this.props.recursionScale = settings.recursionScale || 2;\n this.props.recursionVertex = settings.recursionVertex || 0;\n // this.bInner = settings.bInner ?? false\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n this.shapeUseRecursion = !!settings.shapeUseRecursion;\n // this.currentGenerationRecursiveBounding = Bounding.empty()\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n if (bClearIndexed) {\n this.shapeRecursiveBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n * Set type of recursion\n *\n * @param {boolean} inner\n */\n // public setRecursionnInner(inner: boolean): void {\n // \tthis.bInner = inner\n // \tthis.clearBuffer(true)\n // }\n /**\n *\n * @returns {boolean}\n */\n isStatic() {\n return (typeof this.props.recursions !== 'function' &&\n typeof this.props.recursionScale !== 'function' &&\n typeof this.props.recursionVertex !== 'function' &&\n super.isStatic());\n }\n /**\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return (typeof this.props.recursions !== 'function' &&\n typeof this.props.recursionVertex !== 'function' &&\n super.isStaticIndexed());\n }\n /**\n * Return a buffer of children shape with recursion\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape) {\n if (typeof this.shapeRecursiveBuffer === 'undefined' ||\n this.shapeUseParent ||\n this.shape.generateId !== generateId) {\n this.bindBuffer(generateId, propArguments);\n }\n return this.shapeRecursiveBuffer;\n }\n return Shape_1.Shape.EMPTY_BUFFER;\n }\n /**\n * Generate Recoursive shape buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n */\n bindBuffer(generateId, propArguments) {\n const recursions = Math.floor(this.getProp('recursions', propArguments, 1));\n const recursionVertex = Math.floor(this.getProp('recursionVertex', propArguments, 0));\n const recursionScale = this.getProp('recursionScale', propArguments, 2);\n const childShape = this.shape;\n let currentRecursionRepetition = {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: 1 },\n };\n const recursionPropArguments = {\n ...propArguments,\n recursion: currentRecursionRepetition,\n };\n childShape.generate(generateId, false, recursionPropArguments);\n const firstGenerationChildBuffer = childShape.getBuffer();\n if (recursions <= 1) {\n // this.currentGenerationRecursiveBounding = this.shape.getBounding()\n this.shapeRecursiveBuffer = firstGenerationChildBuffer;\n return;\n }\n let shapeBuffer = firstGenerationChildBuffer;\n const storedRecursion = [currentRecursionRepetition];\n let paretRecursionIndex = 0, added = 1;\n // const tmpBounding = [undefined, undefined, undefined, undefined]\n const singleShapeBufferLength = shapeBuffer.length;\n const realVertexCount = singleShapeBufferLength / 2;\n const singleShapeVertexCount = recursionVertex <= 0 ? realVertexCount : Math.min(recursionVertex, realVertexCount);\n const recursionOffsetMultiplier = recursionVertex === 0 ? 1 : realVertexCount / Math.min(recursionVertex, realVertexCount);\n const recusiveShapeBuffer = new Float32Array(ShapeRecursive.summmation(recursions, singleShapeVertexCount) * singleShapeBufferLength);\n for (let i = 0; i < singleShapeBufferLength; i += 2) {\n recusiveShapeBuffer[i] = shapeBuffer[i];\n recusiveShapeBuffer[i + 1] = shapeBuffer[i + 1];\n // Bounding.add(tmpBounding, recusiveShapeBuffer[i], recusiveShapeBuffer[i + 1])\n }\n for (let currentRecursion = 1; currentRecursion < recursions; currentRecursion++) {\n const level_offset = recursions > 1 ? currentRecursion / (recursions - 1) : 1;\n const currentRecursionVertexCount = ShapeRecursive.summmation(currentRecursion, singleShapeVertexCount);\n const recursionBufferStartIndex = currentRecursionVertexCount * singleShapeBufferLength;\n const parentRecursion = currentRecursion - 1;\n const parentRecursionBufferStartIndex = parentRecursion === 0\n ? 0\n : ShapeRecursive.summmation(parentRecursion, singleShapeVertexCount) * singleShapeBufferLength;\n for (let currentShapeRecursionRepetition = 0, totalRecursionRepetitions = singleShapeVertexCount ** currentRecursion; currentShapeRecursionRepetition < totalRecursionRepetitions; currentShapeRecursionRepetition++, added++) {\n currentRecursionRepetition = {\n index: currentShapeRecursionRepetition + 1,\n offset: totalRecursionRepetitions > 1 ? currentShapeRecursionRepetition / (totalRecursionRepetitions - 1) : 1,\n count: totalRecursionRepetitions,\n level: { index: currentRecursion + 1, offset: level_offset, count: recursions },\n parent: storedRecursion[paretRecursionIndex],\n };\n storedRecursion.push(currentRecursionRepetition);\n if (this.shapeUseRecursion) {\n recursionPropArguments.recursion = currentRecursionRepetition;\n childShape.generate(generateId, false, recursionPropArguments);\n shapeBuffer = childShape.getBuffer();\n }\n const shapeVertexBufferIndex = recursionBufferStartIndex + currentShapeRecursionRepetition * singleShapeBufferLength;\n // const centerVertexIndex = parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2\n const centerVertexIndex = Math.floor(parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2 * recursionOffsetMultiplier);\n const centerX = recusiveShapeBuffer[centerVertexIndex];\n const centerY = recusiveShapeBuffer[centerVertexIndex + 1];\n const currentRecursionScale = recursionScale ** currentRecursion;\n for (let i = 0, len = singleShapeBufferLength; i < len; i += 2) {\n // if (this.bInner) {\n // \tconst parentCurrentVertex =\n // \t\tparentRecursionBufferStartIndex +\n // \t\tMath.floor(currentShapeRecursionRepetition / singleShapeVertexCount) *\n // \t\t\tsingleShapeVertexCount *\n // \t\t\trecursionOffsetMultiplier *\n // \t\t\t2\n // \tconst parentX = recusiveShapeBuffer[parentCurrentVertex + i]\n // \tconst parentY = recusiveShapeBuffer[parentCurrentVertex + i + 1]\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i] = (centerX - parentX) / recursionScale + parentX\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = (centerY - parentY) / recursionScale + parentY\n // const parentX = shapeBuffer[i] / recursionScale ** currentRecursion\n // const parentY = shapeBuffer[i + 1] / recursionScale ** currentRecursion\n // recusiveShapeBuffer[shapeVertexBufferIndex + i] = (centerX - parentX) / recursionScale + parentX\n // recusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = (centerY - parentY) / recursionScale + parentY\n // } else {\n const parentXScaled = shapeBuffer[i] / currentRecursionScale;\n const parentYScaled = shapeBuffer[i + 1] / currentRecursionScale;\n recusiveShapeBuffer[shapeVertexBufferIndex + i] = centerX + parentXScaled;\n recusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = centerY + parentYScaled;\n // }\n // Bounding.add(\n // \ttmpBounding,\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i],\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i + 1]\n // )\n }\n if (added % singleShapeVertexCount === 0) {\n paretRecursionIndex += 1;\n }\n }\n }\n // Bounding.bind(this.currentGenerationRecursiveBounding, tmpBounding)\n this.shapeRecursiveBuffer = recusiveShapeBuffer;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const propArguments = { repetition, shape: this };\n const recursions = Math.floor(this.getProp('recursions', propArguments, 1));\n const recursionVertex = Math.floor(this.getProp('recursionVertex', propArguments, 0));\n // const realFrameLength = ShapeRecursive.summmation(recursions, this.shape.getBufferLength() / 2)\n const bufferIndex = {\n shape: this,\n frameLength: frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n recursion: {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: recursions },\n },\n };\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentRecursionRepetition = {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: recursions },\n };\n const recursionBufferIndex = {\n ...bufferIndex,\n recursion: currentRecursionRepetition,\n };\n const parent = (currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, recursionBufferIndex)\n : recursionBufferIndex);\n this.indexedBuffer.push({\n ...currentIndexed,\n parent,\n });\n }\n if (recursions > 1) {\n const realVertexCount = this.shape.getBufferLength({ ...propArguments, parent: { ...bufferIndex } }) / 2;\n const vertexCount = recursionVertex <= 0 ? realVertexCount : Math.min(recursionVertex, realVertexCount);\n const storedRecursion = this.indexedBuffer.map(indexed => [indexed.parent.recursion]);\n let paretRecursionIndex = 0, added = 1;\n for (let i = 1; i < recursions; i++) {\n const level_offset = recursions > 1 ? i / (recursions - 1) : 1;\n for (let j = 0, len = vertexCount ** i; j < len; j++, added++) {\n const recursionOffset = len > 1 ? j / (len - 1) : 1;\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentRecursionRepetition = {\n index: j + 1,\n offset: recursionOffset,\n count: len,\n level: { index: i + 1, offset: level_offset, count: recursions },\n parent: storedRecursion[childIndexed][paretRecursionIndex],\n };\n const recursionBufferIndex = { ...bufferIndex, recursion: currentRecursionRepetition };\n const parent = currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, recursionBufferIndex)\n : recursionBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n storedRecursion[childIndexed].push(currentRecursionRepetition);\n if (added % vertexCount === 0) {\n paretRecursionIndex += 1;\n }\n }\n }\n }\n }\n }\n }\n /**\n * Retturn summation value\n *\n * @static\n * @param {number} recursion\n * @param {number} vertexCount\n * @returns {number}\n */\n static summmation(recursion, vertexCount) {\n if (recursion === 1)\n return 1;\n let result = 1;\n for (let i = 1; i < recursion; i++)\n result += vertexCount ** i;\n return result;\n }\n /**\n * Empty recursion repetition\n *\n * @static\n * @return {*} {IRecursionRepetition}\n */\n static getEmptyRecursion() {\n return {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: 1, count: 1 },\n };\n }\n}\nexports.ShapeRecursive = ShapeRecursive;\n//# sourceMappingURL=ShapeRecursive.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeFollow = void 0;\nconst Shape_1 = require(\"./Shape\");\n/**\n * @category Core.Shapes\n */\nclass ShapeFollow extends Shape_1.Shape {\n /**\n * Creates an instance of ShapeFollow.\n *\n * @param {IShapeFollowSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'ShapeFollow';\n super(settings);\n this.follow = settings.follow || settings.shape;\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n this.shapeUseFollow = !!settings.shapeUseFollow;\n // this.currentGenerationRecursiveBounding = Bounding.empty()\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n if (bClearIndexed) {\n this.shapeFollowBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n *\n * @returns {boolean}\n */\n isStatic() {\n return (this.follow ? this.follow.isStatic() : true) && super.isStatic();\n }\n /**\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return (this.follow ? this.follow.isStaticIndexed() : true) && super.isStaticIndexed();\n }\n /**\n * Return a buffer of children shape with recursion\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape && this.follow) {\n if (typeof this.shapeFollowBuffer === 'undefined' ||\n this.shapeUseParent ||\n this.shape.generateId !== generateId ||\n this.follow.generateId !== generateId) {\n this.bindBuffer(generateId, propArguments);\n }\n return this.shapeFollowBuffer;\n }\n return Shape_1.Shape.EMPTY_BUFFER;\n }\n /**\n * Generate Recoursive shape buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n */\n bindBuffer(generateId, propArguments) {\n const followShape = this.follow;\n followShape.generate(generateId, false, propArguments);\n const followBuffer = followShape.getBuffer();\n // const followIndexed = followShape.getIndexedBuffer() as Array\n const followPropArguments = {\n ...propArguments,\n follow: {\n index: 1,\n offset: 1,\n count: 1,\n },\n // follow_repetition: followIndexed[0].repetition,\n };\n const childShape = this.shape;\n childShape.generate(generateId, false, followPropArguments);\n let shapeBuffer = childShape.getBuffer();\n // const tmpBounding = [undefined, undefined, undefined, undefined]\n const singleShapeBufferLength = shapeBuffer.length;\n const followShapeBuffer = new Float32Array(singleShapeBufferLength * (followBuffer.length / 2));\n const totalFollowVertexCount = followBuffer.length / 2;\n for (let currentShapeFollowRepetition = 0; currentShapeFollowRepetition < totalFollowVertexCount; currentShapeFollowRepetition++) {\n const currentFollowRepetition = {\n index: currentShapeFollowRepetition + 1,\n offset: totalFollowVertexCount > 1 ? currentShapeFollowRepetition / (totalFollowVertexCount - 1) : 1,\n count: totalFollowVertexCount,\n };\n if (this.shapeUseFollow) {\n followPropArguments.follow = currentFollowRepetition;\n // followPropArguments.follow_repetition = followIndexed[currentShapeFollowRepetition].repetition\n childShape.generate(generateId, false, followPropArguments);\n shapeBuffer = childShape.getBuffer();\n }\n const shapeVertexBufferIndex = currentShapeFollowRepetition * singleShapeBufferLength;\n // const centerVertexIndex = parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2\n const centerVertexIndex = currentShapeFollowRepetition * 2;\n const centerX = followBuffer[centerVertexIndex];\n const centerY = followBuffer[centerVertexIndex + 1];\n for (let i = 0, len = shapeBuffer.length; i < len; i += 2) {\n followShapeBuffer[shapeVertexBufferIndex + i] = centerX + shapeBuffer[i];\n followShapeBuffer[shapeVertexBufferIndex + i + 1] = centerY + shapeBuffer[i + 1];\n // Bounding.add(\n // \ttmpBounding,\n // \tfollowShapeBuffer[shapeVertexBufferIndex + i],\n // \tfollowShapeBuffer[shapeVertexBufferIndex + i + 1]\n // )\n }\n }\n // Bounding.bind(this.currentGenerationRecursiveBounding, tmpBounding)\n this.shapeFollowBuffer = followShapeBuffer;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const propArguments = { repetition, shape: this };\n const bufferIndex = {\n shape: this,\n frameLength: frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n follow: {\n index: 1,\n offset: 1,\n count: 1,\n },\n };\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const vertexCount = this.follow.getBuffer().length / 2; // this.follow.getBufferLength({ ...propArguments, parent: { ...bufferIndex } }) / 2\n for (let j = 0, len = vertexCount; j < len; j++) {\n const followOffset = len > 1 ? j / (len - 1) : 1;\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentFollowRepetition = {\n index: j + 1,\n offset: followOffset,\n count: len,\n };\n const followBufferIndex = { ...bufferIndex, follow: currentFollowRepetition };\n const parent = currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, followBufferIndex)\n : followBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n }\n }\n }\n }\n }\n /**\n * Retturn summation value\n *\n * @static\n * @param {number} recursion\n * @param {number} vertexCount\n * @returns {number}\n */\n static summmation(recursion, vertexCount) {\n if (recursion === 1)\n return 1;\n let result = 1;\n for (let i = 1; i < recursion; i++)\n result += vertexCount ** i;\n return result;\n }\n /**\n * Empty recursion repetition\n *\n * @static\n * @return {*} {IRecursionRepetition}\n */\n static getEmptyRecursion() {\n return {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: 1, count: 1 },\n };\n }\n}\nexports.ShapeFollow = ShapeFollow;\n//# sourceMappingURL=ShapeFollow.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Line = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n *\n * @category Core.Primitives\n * @class Line\n * @extends {ShapeBuffer}\n */\nclass Line extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Two point, based on ShapeBuffer\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Line\n */\n constructor(settings = {}) {\n settings.type = 'Line';\n settings.shape = Line.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n settings.bClosed = false;\n super(settings);\n }\n /**\n * @link https://gist.github.com/pborissow/5c92b77a804688385c77749d1187ba07\n */\n static toPolygon(buffer, thickness) {\n const solidified = [];\n //Convert thickness into an array as needed\n if (!Array.isArray(thickness)) {\n const _thickness = thickness;\n const points = buffer.length / 2;\n thickness = new Array(points);\n for (let i = 0; i < points; i++) {\n thickness[i] = _thickness;\n }\n }\n function getOffsets(ax, ay, bx, by, thickness) {\n const dx = bx - ax, dy = by - ay, len = Math.sqrt(dx * dx + dy * dy), scale = thickness / (2 * len);\n return [-scale * dy, scale * dx];\n }\n function getIntersection(a1, b1, a2, b2) {\n // directional constants\n const k1 = (b1[1] - a1[1]) / (b1[0] - a1[0]), k2 = (b2[1] - a2[1]) / (b2[0] - a2[0]);\n // if the directional constants are equal, the lines are parallel\n if (Math.abs(k1 - k2) < 0.00001) {\n return;\n }\n // y offset constants for both lines\n const m1 = a1[1] - k1 * a1[0];\n const m2 = a2[1] - k2 * a2[0];\n // compute x\n const x = (m1 - m2) / (k2 - k1);\n // use y = k * x + m to get y coordinate\n const y = k1 * x + m1;\n return [x, y];\n }\n let bFirst, bLast, prevA = [\n [0, 0],\n [0, 0],\n ], prevB = [\n [0, 0],\n [0, 0],\n ];\n for (let i = 0, len = buffer.length - 2; i < len; i += 2) {\n bFirst = i === 0;\n bLast = i === len - 2;\n const off = getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], thickness[i]);\n const p0a = [buffer[i] + off[0], buffer[i + 1] + off[1]];\n const p1a = [buffer[i + 2] + off[0], buffer[i + 3] + off[1]];\n const p0b = [buffer[i] - off[0], buffer[i + 1] - off[1]];\n const p1b = [buffer[i + 2] - off[0], buffer[i + 3] - off[1]];\n if (!bFirst) {\n const interA = getIntersection(prevA[0], prevA[1], p0a, p1a);\n if (interA) {\n solidified.unshift(interA[1]);\n solidified.unshift(interA[0]);\n }\n const interB = getIntersection(prevB[0], prevB[1], p0b, p1b);\n if (interB) {\n solidified.push(interB[0]);\n solidified.push(interB[1]);\n }\n }\n if (bFirst) {\n solidified.unshift(p0a[1]);\n solidified.unshift(p0a[0]);\n solidified.push(p0b[0]);\n solidified.push(p0b[1]);\n }\n if (bLast) {\n solidified.unshift(p1a[1]);\n solidified.unshift(p1a[0]);\n solidified.push(p1b[0]);\n solidified.push(p1b[1]);\n }\n if (!bLast) {\n prevA = [p0a, p1a];\n prevB = [p0b, p1b];\n }\n }\n return Float32Array.from(solidified);\n }\n}\nexports.Line = Line;\nLine.buffer = [-1, 0, 1, 0];\n//# sourceMappingURL=Line.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Triangle = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n * Triangle ShapeBuffer\n *\n * @category Core.Primitives\n */\nclass Triangle extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Creates an instance of Triangleeee.\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Triangle\n */\n constructor(settings = {}) {\n settings.type = 'Triangle';\n settings.shape = Triangle.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n super(settings);\n }\n}\nexports.Triangle = Triangle;\nTriangle.buffer = [1, 0, -1, 1, -1, -1];\n//# sourceMappingURL=Triangle.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Rect = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n *\n * @category Core.Primitives\n * @class Rect\n * @extends {ShapeBuffer}\n */\nclass Rect extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Creates an instance of Rect.\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Rect\n */\n constructor(settings = {}) {\n settings.type = 'Rect';\n settings.shape = Rect.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n super(settings);\n }\n}\nexports.Rect = Rect;\nRect.buffer = [1, 1, -1, 1, -1, -1, 1, -1];\n//# sourceMappingURL=Rect.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Polygon = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Polygon shape\n *\n * @category Core.Primitives\n * @class Polygon\n * @extends {ShapeLoop}\n */\nclass Polygon extends ShapeLoop_1.ShapeLoop {\n /**\n * Is based on ShapeLoop and you can pass `sideNumber` property to define\n * a number of sides.\n *\n * @param settings\n */\n constructor(settings = {}) {\n settings.type = settings.type || 'Polygon';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['sideNumber']);\n super(settings, true);\n this.props.sideNumber = settings.sideNumber;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: (propArguments) => {\n return math_1.PI2 / this.getProp('sideNumber', propArguments, 5);\n },\n vertex: shapeLoopRepetition => {\n return [Math.cos(shapeLoopRepetition.current), Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n}\nexports.Polygon = Polygon;\n//# sourceMappingURL=Polygon.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Circle = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n *\n * @category Core.Primitives\n * @class Circle\n * @extends {ShapeLoop}\n */\nclass Circle extends ShapeLoop_1.ShapeLoop {\n /**\n * Based on ShapeLoop, the number of point (resolution) is based on sideLength.\n *\n * @param {ShapeLoopSettings} [settings={}]\n * @memberof Circle\n */\n constructor(settings = {}) {\n settings.type = 'Circle';\n super(settings, true);\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const sideLength = this.getRepetitionSideLength(propArguments);\n return (1 / Math.pow(sideLength[0] * sideLength[1], 0.25)) * ShapeLoop_1.ShapeLoop.PId2;\n },\n vertex: shapeLoopRepetition => [Math.cos(shapeLoopRepetition.current), Math.sin(shapeLoopRepetition.current)],\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n}\nexports.Circle = Circle;\n//# sourceMappingURL=Circle.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Star = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Polygon shape\n *\n * @category Core.Primitives\n * @class Polygon\n * @extends {ShapeLoop}\n */\nclass Star extends ShapeLoop_1.ShapeLoop {\n /**\n * Is based on ShapeLoop and you can pass `spikes` property to define\n * a number of spikes and `innerRadius`\n *\n * @param settings\n */\n constructor(settings = {}) {\n settings.type = settings.type || 'Polygon';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['spikes', 'innerRadius']);\n super(settings, true);\n this.props.spikes = settings.spikes;\n this.props.innerRadius = settings.innerRadius;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: (propArguments) => {\n // dyamic binding in `generateLoopBuffer`\n return this.inc;\n },\n vertex: shapeLoopRepetition => {\n const angle = (Math.PI / this.spikes) * shapeLoopRepetition.index;\n const radius = shapeLoopRepetition.index % 2 === 0 ? 1 : this.innerRadius;\n return [Math.cos(angle) * radius, Math.sin(angle) * radius];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.spikes = this.getProp('spikes', propArguments, 5);\n this.innerRadius = this.getProp('innerRadius', propArguments, 0.5);\n this.inc = Math.PI / this.spikes;\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.Star = Star;\n//# sourceMappingURL=Star.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Rose = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Rose shape\n *\n * @category Core.Primitives\n * @class Rose\n * @extends {ShapeLoop}\n */\nclass Rose extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Rose.\n *\n * @param {IRoseSettings} [settings={}]\n * @memberof Rose\n */\n constructor(settings = {}) {\n var _a, _b;\n settings.type = 'Rose';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['n', 'd']);\n super(settings, true);\n this.props.n = (_a = settings.n) !== null && _a !== void 0 ? _a : 1;\n this.props.d = (_b = settings.d) !== null && _b !== void 0 ? _b : 2;\n this.loop = {\n start: 0,\n end: (propArguments) => Rose.getFinalAngleFromK(this.getProp('n', propArguments), this.getProp('d', propArguments)),\n inc: (propArguments) => {\n const n = this.getProp('n', propArguments);\n const d = this.getProp('d', propArguments);\n const sideLength = this.getRepetitionSideLength(propArguments);\n const sides = Math.pow(sideLength[0] * sideLength[1], 0.45);\n const k = d < n ? n / d : 1.5;\n return math_1.PI2 / (sides * k);\n },\n vertex: (shapeLoopRepetition) => {\n const f = Math.cos(this.k * shapeLoopRepetition.current);\n return [f * Math.cos(shapeLoopRepetition.current), f * Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.k = this.getProp('n', propArguments) / this.getProp('d', propArguments);\n return super.generateLoopBuffer(propArguments);\n }\n /**\n * Return end angle of rose\n *\n * @static\n * @param {number} n\n * @param {number} d\n * @returns {number}\n * @memberof Rose\n */\n static getFinalAngleFromK(n, d) {\n if (n == d)\n return math_1.PI2;\n const k = n / d;\n const p = n * d;\n if (!Number.isInteger(k) && k % 0.5 == 0)\n return 4 * Math.PI;\n return Math.PI * d * (p % 2 == 0 ? 2 : 1);\n }\n}\nexports.Rose = Rose;\n//# sourceMappingURL=Rose.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Spiral = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n * Spiral shape\n *\n * @category Core.Primitives\n * @class Spiral\n * @extends {ShapeLoop}\n */\nclass Spiral extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Spiral.\n *\n * @param {SpiralSettings} [settings={}]\n * @memberof Spiral\n */\n constructor(settings = {}) {\n var _a, _b, _c;\n settings.type = 'Spiral';\n settings.bClosed = false;\n settings.loopDependencies = (settings.loopDependencies || []).concat(['twists', 'twistsStart', 'spiral']);\n super(settings, true);\n this.props.spiral = (_a = settings.spiral) !== null && _a !== void 0 ? _a : Spiral.types.ARCHIMEDE;\n this.props.twists = (_b = settings.twists) !== null && _b !== void 0 ? _b : 2;\n this.props.twistsStart = (_c = settings.twistsStart) !== null && _c !== void 0 ? _c : 0;\n this.loop = {\n start: (propArguments) => math_1.PI2 * this.getProp('twistsStart', propArguments),\n end: (propArguments) => math_1.PI2 *\n (this.getProp('twistsStart', propArguments) + this.getProp('twists', propArguments)),\n inc: (propArguments) => {\n const twists = this.getProp('twists', propArguments);\n const rep = math_1.PI2 * twists;\n const sideLength = this.getRepetitionSideLength(propArguments);\n const radius = 4 + Math.sqrt(sideLength[0] * sideLength[1]);\n return rep / (radius * twists);\n },\n vertex: (shapeLoopRepetition) => {\n const r = this.r(shapeLoopRepetition.current);\n return [r * Math.cos(shapeLoopRepetition.current), r * Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.spiral = this.getProp('spiral', propArguments);\n this.r = Spiral.getRFromTSpiralType(this.spiral);\n return super.generateLoopBuffer(propArguments);\n }\n /**\n * Point position and scale factor for spiral types\n *\n * @static\n * @param {TSpiralType} spiral\n * @returns {number}\n * @memberof Spiral\n */\n static getRFromTSpiralType(spiral) {\n switch (spiral) {\n case Spiral.types.ARCHIMEDE:\n return angle => angle / 10;\n case Spiral.types.HYPERBOLIC:\n return angle => (1 / angle) * 3;\n case Spiral.types.FERMAT:\n return angle => angle ** 0.5 / 3;\n case Spiral.types.LITUUS:\n return angle => angle ** -0.5;\n case Spiral.types.LOGARITHMIC:\n return angle => Math.E ** (angle * 0.2) / 10;\n }\n return angle => angle;\n }\n}\nexports.Spiral = Spiral;\n/**\n * Spural types\n *\n * @static\n * @type {{ [name in TSpiralType]: TSpiralType }}\n * @memberof Spiral\n */\nSpiral.types = {\n ARCHIMEDE: 'ARCHIMEDE',\n HYPERBOLIC: 'HYPERBOLIC',\n FERMAT: 'FERMAT',\n LITUUS: 'LITUUS',\n LOGARITHMIC: 'LOGARITHMIC',\n};\n//# sourceMappingURL=Spiral.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Lissajous = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Lissajous shape\n *\n * @category Core.Primitives\n * @class Lissajous\n * @extends {ShapeLoop}\n */\nclass Lissajous extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Lissajous.\n *\n * @param {ILissajousSettings} [settings={}]\n * @memberof Lissajous\n */\n constructor(settings = {}) {\n settings.type = 'Lissajous';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['wx', 'wy', 'wz']);\n super(settings, true);\n this.props.wx = settings.wx || 1;\n this.props.wy = settings.wy || 2;\n this.props.wz = settings.wz || 0;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const wx = this.getProp('wx', propArguments);\n const wy = this.getProp('wy', propArguments);\n const ratio = wx == wy ? ShapeLoop_1.ShapeLoop.PId2 : 0.5 - Math.min(49, wx + wy) * 0.01;\n const sideLength = this.getRepetitionSideLength(propArguments);\n return (1 / Math.pow(sideLength[0] * sideLength[1], 0.25)) * ratio;\n },\n vertex: (shapeLoopRepetition) => {\n return this.wx === this.wy\n ? [Math.cos(shapeLoopRepetition.current + this.wz), Math.sin(shapeLoopRepetition.current)]\n : [Math.cos(this.wx * shapeLoopRepetition.current + this.wz), Math.sin(this.wy * shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.wx = this.getProp('wx', propArguments, 1);\n this.wy = this.getProp('wy', propArguments, 2);\n this.wz = this.getProp('wz', propArguments, 2);\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.Lissajous = Lissajous;\n//# sourceMappingURL=Lissajous.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SuperShape = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n * ShperShape\n *\n * @category Core.Primitives\n * @class SuperShape\n * @extends {ShapeLoop}\n */\nclass SuperShape extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of SuperShape.\n *\n * @param {ISuperShapeSettings} [settings={}]\n * @memberof SuperShape\n */\n constructor(settings = {}) {\n var _a, _b, _c, _d, _e, _f;\n settings.type = 'SuperShape';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['a', 'b', 'm', 'n1', 'n2', 'n3']);\n super(settings, true);\n this.props.a = (_a = settings.a) !== null && _a !== void 0 ? _a : 1;\n this.props.b = (_b = settings.b) !== null && _b !== void 0 ? _b : 1;\n this.props.m = (_c = settings.m) !== null && _c !== void 0 ? _c : 6;\n this.props.n1 = (_d = settings.n1) !== null && _d !== void 0 ? _d : 1;\n this.props.n2 = (_e = settings.n2) !== null && _e !== void 0 ? _e : 1;\n this.props.n3 = (_f = settings.n3) !== null && _f !== void 0 ? _f : 1;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const sideLength = this.getRepetitionSideLength(propArguments);\n return Math.PI / Math.pow(sideLength[0] * sideLength[1], 0.5);\n },\n vertex: (shapeLoopRepetition) => {\n const angle = shapeLoopRepetition.current;\n const m = (this.m * angle) / 4;\n const a = Math.abs(Math.cos(m) / this.a) ** this.n2;\n const b = Math.abs(Math.sin(m) / this.b) ** this.n3;\n const raux = (a + b) ** (1 / this.n1);\n const r = raux === 0 ? 1 : 1 / raux;\n return [r * Math.cos(angle), r * Math.sin(angle)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.a = this.getProp('a', propArguments);\n this.b = this.getProp('b', propArguments);\n this.m = this.getProp('m', propArguments);\n this.n1 = this.getProp('n1', propArguments);\n this.n2 = this.getProp('n2', propArguments);\n this.n3 = this.getProp('n3', propArguments);\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.SuperShape = SuperShape;\n//# sourceMappingURL=SuperShape.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Modifiers = void 0;\nconst Adapt_1 = require(\"./Adapt\");\nconst Mirror_1 = require(\"./Mirror\");\nconst Smooth_1 = require(\"./Smooth\");\nconst Solidify_1 = require(\"./Solidify\");\nconst Subdivide_1 = require(\"./Subdivide\");\nconst Close_1 = require(\"./Close\");\nconst Offset_1 = require(\"./Offset\");\nconst Modifiers = {\n Adapt: Adapt_1.Adapt,\n Mirror: Mirror_1.Mirror,\n Smooth: Smooth_1.Smooth,\n Solidify: Solidify_1.Solidify,\n Subdivide: Subdivide_1.Subdivide,\n Close: Close_1.Close,\n Offset: Offset_1.Offset,\n};\nexports.Modifiers = Modifiers;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Mirror = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Mirror extends Modifier_1.Modifier {\n constructor(args = { x: true, y: true }) {\n super();\n this.x = args.x === true;\n this.y = args.y === true;\n }\n apply(buffer, bClosed) {\n const bufferLength = buffer.length;\n const mirror = new Float32Array(bufferLength * (this.x ? 2 : 1) * (this.y ? 2 : 1));\n const sideLengthX = 1;\n const sideLengthY = 1;\n if (this.x && this.y) {\n const bufferLengthX2 = bufferLength + bufferLength;\n const bufferLengthX3 = bufferLengthX2 + bufferLength;\n // |1|2|\n // |4|3|\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i] - sideLengthX;\n mirror[i + 1] = buffer[i + 1] - sideLengthY;\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i] * -1 + sideLengthX;\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1] - sideLengthY;\n mirror[bufferLengthX2 + i] = buffer[i] * -1 + sideLengthX;\n mirror[bufferLengthX2 + i + 1] = buffer[i + 1] * -1 + sideLengthY;\n mirror[bufferLengthX3 + i] = buffer[bufferLength - 2 - i] - sideLengthX;\n mirror[bufferLengthX3 + i + 1] = buffer[bufferLength - 2 - i + 1] * -1 + sideLengthY;\n }\n }\n else if (this.x) {\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i] - sideLengthX;\n mirror[i + 1] = buffer[i + 1];\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i] * -1 + sideLengthX;\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1];\n }\n }\n else if (this.y) {\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i];\n mirror[i + 1] = buffer[i + 1] - sideLengthY;\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i];\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1] * -1 + sideLengthY;\n }\n }\n else {\n return buffer;\n }\n return mirror;\n }\n}\nexports.Mirror = Mirror;\n//# sourceMappingURL=Mirror.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Smooth = void 0;\nconst Utilities_1 = require(\"../Utilities\");\nconst Close_1 = require(\"./Close\");\nconst Modifier_1 = require(\"./Modifier\");\nclass Smooth extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.level = args.level || 1;\n const tension = Array.isArray(args.tension) ? args.tension : [args.tension];\n this.tension = new Array(this.level).fill(0.5).map((v, i) => Utilities_1.clamp(0, 1, tension[i] || v));\n this.level = this.level < 1 ? 1 : this.level;\n this.closed = args.closed === true;\n }\n apply(buffer, bClosed) {\n if (bClosed && !Close_1.Close.isClosed(buffer)) {\n const bufferLen = buffer.length;\n const mofified = new Float32Array(bufferLen + 2);\n mofified.set(buffer, 0);\n mofified[bufferLen] = buffer[0];\n mofified[bufferLen + 1] = buffer[1];\n buffer = mofified;\n }\n let smoothed = buffer;\n for (let i = 0, len = this.level; i < len; i++)\n smoothed = Smooth.smooth(smoothed, this.tension[i], bClosed || this.closed);\n return smoothed;\n }\n /**\n * Chaikin smooth\n *\n * the tension factor defines a scale between corner cutting distance in segment half length,\n * i.e. between 0.05 and 0.45. The opposite corner will be cut by the inverse\n * (i.e. 1-cutting distance) to keep symmetry.\n * with a tension value of 0.5 this amounts to 0.25 = 1/4 and 0.75 = 3/4,\n * the original Chaikin values\n *\n * @link https://www.codeproject.com/Articles/1093960/D-Polyline-Vertex-Smoothing\n * @param buffer\n */\n static smooth(buffer, tension = 0.5, bClosed = false) {\n const bufferLength = buffer.length;\n const smoothed = new Float32Array((buffer.length - (bClosed ? 1 : 0)) * 2);\n if (!bClosed) {\n smoothed[0] = buffer[0];\n smoothed[1] = buffer[1];\n }\n const cutdist = 0.05 + tension * 0.4;\n const ncutdist = 1 - cutdist;\n let smoothedLength = bClosed ? 0 : 2;\n for (let i = 0, len = bufferLength - 2; i < len; i += 2, smoothedLength += 4) {\n // q\n smoothed[smoothedLength] = ncutdist * buffer[i] + cutdist * buffer[i + 2];\n smoothed[smoothedLength + 1] = ncutdist * buffer[i + 1] + cutdist * buffer[i + 3];\n // r\n smoothed[smoothedLength + 2] = cutdist * buffer[i] + ncutdist * buffer[i + 2];\n smoothed[smoothedLength + 3] = cutdist * buffer[i + 1] + ncutdist * buffer[i + 3];\n }\n if (!bClosed) {\n smoothed[smoothedLength] = buffer[bufferLength - 2];\n smoothed[smoothedLength + 1] = buffer[bufferLength - 1];\n }\n else {\n smoothed[smoothedLength] = smoothed[0];\n smoothed[smoothedLength + 1] = smoothed[1];\n }\n return smoothed;\n }\n}\nexports.Smooth = Smooth;\n//# sourceMappingURL=Smooth.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Close = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Close extends Modifier_1.Modifier {\n constructor() {\n super();\n }\n apply(buffer, bClosed, shape) {\n return Close.call(buffer);\n }\n static call(buffer) {\n const len = buffer.length;\n if (Close.isClosed(buffer))\n return buffer;\n const result = new Float32Array(len + 2);\n result.set(buffer, 0);\n result[len] = result[0];\n result[len + 1] = result[1];\n return result;\n }\n static isClosed(buffer) {\n const len = buffer.length;\n return buffer[0] === buffer[len - 2] && buffer[1] === buffer[len - 1];\n }\n}\nexports.Close = Close;\n//# sourceMappingURL=Close.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Solidify = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Solidify extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.closed = args.closed === true;\n this.thickness = args.thickness || 0.2;\n this.error = args.error;\n }\n apply(buffer, bClosed) {\n return Solidify.solidify(buffer, this.thickness, this.closed, this.error);\n }\n /**\n * @link https://gist.github.com/kekscom/4194148\n */\n static solidify(buffer, thickness, bClosed = false, error) {\n const solidified = [];\n thickness = typeof thickness === 'number' ? [thickness] : thickness;\n const thicknessLength = thickness.length;\n let bFirst, bLast, prevA = [\n [0, 0],\n [0, 0],\n ], prevB = [\n [0, 0],\n [0, 0],\n ];\n for (let i = 0, t = 0, len = buffer.length - 2; i < len; i += 2, t++) {\n bFirst = i === 0;\n bLast = i === len - 2;\n const currentThicknessRep = {\n index: i + 1,\n offset: i / len,\n count: len,\n };\n const nextThicknessRep = {\n index: i + 2,\n offset: (i + 1) / len,\n count: len,\n };\n const currentThickness = typeof thickness === 'function' ? thickness(currentThicknessRep) : thickness[t % thicknessLength];\n const nextThickness = typeof thickness === 'function' ? thickness(nextThicknessRep) : thickness[(t + 1) % thicknessLength];\n const off = Solidify.getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], currentThickness);\n const off2 = Solidify.getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], nextThickness);\n const p0a = [buffer[i] + off[0], buffer[i + 1] + off[1]];\n const p1a = [buffer[i + 2] + off2[0], buffer[i + 3] + off2[1]];\n const p0b = [buffer[i] - off[0], buffer[i + 1] - off[1]];\n const p1b = [buffer[i + 2] - off2[0], buffer[i + 3] - off2[1]];\n if (!bFirst) {\n const interA = Solidify.getIntersection(prevA[0], prevA[1], p0a, p1a, error);\n if (interA) {\n solidified.unshift(interA[1]);\n solidified.unshift(interA[0]);\n }\n const interB = Solidify.getIntersection(prevB[0], prevB[1], p0b, p1b, error);\n if (interB) {\n solidified.push(interB[0]);\n solidified.push(interB[1]);\n }\n }\n if (bFirst) {\n solidified.unshift(p0a[1]);\n solidified.unshift(p0a[0]);\n solidified.push(p0b[0]);\n solidified.push(p0b[1]);\n }\n if (bLast) {\n solidified.unshift(p1a[1]);\n solidified.unshift(p1a[0]);\n solidified.push(p1b[0]);\n solidified.push(p1b[1]);\n }\n if (!bLast) {\n prevA = [p0a, p1a];\n prevB = [p0b, p1b];\n }\n }\n if (bClosed) {\n const centerIndex = buffer.length - 2;\n const lastIndex = solidified.length - 2;\n const x = 0.5 * solidified[0] + solidified[centerIndex] * 0.5;\n const y = 0.5 * solidified[1] + solidified[centerIndex + 1] * 0.5;\n const x2 = 0.5 * solidified[centerIndex + 2] + solidified[lastIndex] * 0.5;\n const y2 = 0.5 * solidified[centerIndex + 3] + solidified[lastIndex + 1] * 0.5;\n solidified[0] = x;\n solidified[1] = y;\n solidified[centerIndex] = x;\n solidified[centerIndex + 1] = y;\n solidified[centerIndex + 2] = x2;\n solidified[centerIndex + 3] = y2;\n solidified[lastIndex] = x2;\n solidified[lastIndex + 1] = y2;\n }\n return Float32Array.from(solidified);\n }\n static getOffsets(ax, ay, bx, by, thickness) {\n const dx = bx - ax, dy = by - ay, len = Math.sqrt(dx * dx + dy * dy), scale = thickness / (2 * len);\n return [-scale * dy, scale * dx];\n }\n static getIntersection(a1, b1, a2, b2, error = 0.00001) {\n // directional constants\n const k1 = (b1[1] - a1[1]) / (b1[0] - a1[0]), k2 = (b2[1] - a2[1]) / (b2[0] - a2[0]);\n // if the directional constants are equal, the lines are parallel\n // if (Math.abs(k1 - k2) < 0.00001) {\n if (Math.abs(k1 - k2) < error) {\n return;\n }\n // y offset constants for both lines\n const m1 = a1[1] - k1 * a1[0];\n const m2 = a2[1] - k2 * a2[0];\n // compute x\n const x = (m1 - m2) / (k2 - k1);\n // use y = k * x + m to get y coordinate\n const y = k1 * x + m1;\n return [x, y];\n }\n}\nexports.Solidify = Solidify;\n//# sourceMappingURL=Solidify.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Subdivide = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Subdivide extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.level = args.level || 1;\n this.level = this.level < 1 ? 1 : this.level;\n }\n apply(buffer, bClosed) {\n const level = this.level;\n let subdivided = buffer;\n if (subdivided && subdivided.length > 0) {\n for (let i = 0; i < level; i++)\n subdivided = Subdivide.subdivide(subdivided, bClosed);\n }\n return subdivided;\n }\n /**\n * Subdivide buffer\n *\n * @static\n * @param {Float32Array} shape\n * @param {boolean} [bClosed=true]\n * @returns {(Float32Array)}\n */\n static subdivide(buffer, bClosed = false) {\n const bufferLength = buffer.length;\n const subdivided = new Float32Array(bufferLength * 2 - (bClosed ? 0 : 2));\n for (let i = 0; i < bufferLength; i += 2) {\n if (i === 0) {\n subdivided[0] = buffer[0];\n subdivided[1] = buffer[1];\n }\n else {\n const px = buffer[i - 2];\n const py = buffer[i - 1];\n const x = buffer[i];\n const y = buffer[i + 1];\n const nx = (x + px) / 2;\n const ny = (y + py) / 2;\n subdivided[(i - 1) * 2] = nx;\n subdivided[(i - 1) * 2 + 1] = ny;\n subdivided[i * 2] = x;\n subdivided[i * 2 + 1] = y;\n }\n }\n if (bClosed) {\n subdivided[(bufferLength - 1) * 2] = (buffer[0] + buffer[bufferLength - 2]) / 2;\n subdivided[(bufferLength - 1) * 2 + 1] = (buffer[1] + buffer[bufferLength - 1]) / 2;\n }\n return subdivided;\n }\n}\nexports.Subdivide = Subdivide;\n//# sourceMappingURL=Subdivide.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Offset = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Offset extends Modifier_1.Modifier {\n constructor(args = { from: 0, to: undefined }) {\n super();\n this.from = args.from;\n this.to = args.to;\n }\n apply(buffer, bClosed) {\n return buffer.subarray(this.from, this.to ? (this.to < 0 ? buffer.length + this.to : this.to) : undefined);\n }\n}\nexports.Offset = Offset;\n//# sourceMappingURL=Offset.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./utilities\"), exports);\n__exportStar(require(\"./createAnimation\"), exports);\n__exportStar(require(\"./createInterpolator\"), exports);\n__exportStar(require(\"./Easings\"), exports);\n__exportStar(require(\"./Animation\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.interpolateColorHSL = exports.interpolateColorRGB = exports.cosp = exports.sinp = exports.clockOffset = exports.clock = void 0;\n/**\n * Return time (from 0 to duration) in milliseconds\n *\n * @export\n * @param {number} time Current time\n * @param {number} duration Clock duration\n * @param {(number | boolean)} [loop=true]\n * @param {('normal' | 'reverse' | 'alternate')} [direction='alternate']\n * @param {number} [delay=0]\n * @param {number} [afterDelay=0]\n * @return {*} {number} Between 0 and duration\n */\nfunction clock(time, duration, loop = true, direction = 'alternate', delay = 0, afterDelay = 0) {\n const totalDuration = direction === 'normal'\n ? duration + delay\n : direction === 'reverse'\n ? duration + delay\n : duration * 2 + delay + afterDelay;\n if ((typeof loop === 'number' && time >= totalDuration * loop) || (loop === false && time >= totalDuration)) {\n return direction === 'normal' ? duration : 0;\n }\n time %= totalDuration;\n if ((time -= delay) <= 0) {\n return 0;\n }\n if (direction === 'alternate') {\n if (time <= duration) {\n // normal\n return time;\n }\n else {\n // reverse\n time -= duration;\n if ((time -= afterDelay) >= 0) {\n return duration - (time >= duration ? duration : time);\n }\n return duration;\n }\n }\n else {\n return time >= duration ? duration : time;\n }\n}\nexports.clock = clock;\n/**\n * Return offset between 0 and 1 from current time based on duration and other parameters\n *\n * @export\n * @param {number} time\n * @param {number} duration\n * @param {(number | boolean)} [loop=true]\n * @param {('normal' | 'reverse' | 'alternate')} [direction='alternate']\n * @param {number} [delay=0]\n * @param {number} [afterDelay=0]\n * @return {*} {number}\n */\nfunction clockOffset(time, duration, loop = true, direction = 'alternate', delay = 0, afterDelay = 0) {\n return clock(time, duration, loop, direction, delay, afterDelay) / duration;\n}\nexports.clockOffset = clockOffset;\nconst PI2 = Math.PI * 2;\n/**\n * Return sin of period 'durate' in time 'time'\n *\n * @export\n * @param {number} time\n * @param {number} durate\n * @param {number} phase\n * @param {boolean} [normalize=false]\n * @return {*} {number}\n */\nfunction sinp(time, durate, phase = 0, normalize = false) {\n const value = Math.sin((time * PI2) / durate + phase);\n return normalize ? 0.5 + value * 0.5 : value;\n}\nexports.sinp = sinp;\n/**\n * Return cos of period 'durate' in time 'time'\n *\n * @export\n * @param {number} time\n * @param {number} durate\n * @param {number} phase\n * @param {boolean} [normalize=false]\n * @return {*} {number}\n */\nfunction cosp(time, durate, phase = 0, normalize = false) {\n const value = Math.cos((time * PI2) / durate + phase);\n return normalize ? 0.5 + value * 0.5 : value;\n}\nexports.cosp = cosp;\nfunction interpolateColorRGB(start, end, offset) {\n const r = start.r + offset * (end.r - start.r);\n const g = start.g + offset * (end.g - start.g);\n const b = start.b + offset * (end.b - start.b);\n const alpha = start.alpha + offset * (end.alpha - start.alpha);\n return `rgba(${Math.floor(r)},${Math.floor(g)},${Math.floor(b)},${alpha})`;\n}\nexports.interpolateColorRGB = interpolateColorRGB;\nfunction interpolateColorHSL(start, end, offset) {\n const h = start.h + offset * (end.h - start.h);\n const s = start.s + offset * (end.s - start.s);\n const l = start.l + offset * (end.l - start.l);\n const alpha = start.alpha + offset * (end.alpha - start.alpha);\n return `hsla(${h},${s}%,${l}%,${alpha})`;\n}\nexports.interpolateColorHSL = interpolateColorHSL;\n//# sourceMappingURL=utilities.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createAnimation = void 0;\nconst createInterpolator_1 = require(\"./createInterpolator\");\n/**\n * Create TAnimation from object\n *\n * @param simpleAnimation\n * @returns\n */\nfunction createAnimation(simpleAnimation) {\n const interpolate = createInterpolator_1.createInterpolationCallback(simpleAnimation);\n if (typeof interpolate === 'undefined')\n return undefined;\n const delay = simpleAnimation.delay || 0;\n const afterDelay = simpleAnimation.afterDelay || 0;\n const direction = simpleAnimation.direction || 'normal';\n const duration = simpleAnimation.duration || 1000;\n const totalDuration = direction === 'normal'\n ? duration + delay\n : direction === 'reverse'\n ? duration + delay\n : duration * 2 + delay + afterDelay;\n const loop = typeof simpleAnimation.loop === 'number' ? simpleAnimation.loop : !!simpleAnimation.loop;\n const bindedValues = {\n delay,\n afterDelay,\n direction,\n duration,\n totalDuration,\n loop,\n };\n const animationFunction = createInterpolator_1.createInterpolator(simpleAnimation.interpolator);\n const animation = {\n loop: 0,\n offset: 0,\n loopDuration: totalDuration,\n direction: direction === 'alternate' ? 'normal' : direction,\n started: false,\n ended: false,\n value: undefined,\n };\n animation.update = createUpdate(animation, bindedValues, animationFunction, interpolate);\n return animation;\n}\nexports.createAnimation = createAnimation;\n/**\n *\n * @internal\n * @param animation\n * @param bindedValues\n * @param animationFunction\n * @param interpolate\n * @returns\n */\nfunction createUpdate(animation, bindedValues, animationFunction, interpolate) {\n const { loop, totalDuration, delay, afterDelay, direction, duration } = bindedValues;\n return (time) => {\n // Check animation is ended\n if ((typeof loop === 'number' && time >= totalDuration * loop) ||\n (loop === false && time >= bindedValues.totalDuration)) {\n animation.started = false;\n animation.ended = true;\n animation.offset = animationFunction(direction === 'normal' ? duration : 0, duration);\n animation.value = interpolate(animation.offset);\n return;\n }\n animation.loop = Math.ceil(time / totalDuration);\n time %= totalDuration;\n if ((time -= delay) <= 0) {\n animation.started = false;\n animation.offset = animationFunction(0, duration);\n animation.value = interpolate(animation.offset);\n return;\n }\n animation.started = true;\n if (direction === 'alternate') {\n if (time <= duration) {\n animation.direction = 'normal';\n animation.offset = animationFunction(time, duration);\n }\n else {\n animation.direction = 'reverse';\n time -= duration;\n // wait afterDelay\n if ((time -= afterDelay) >= 0) {\n animation.offset = 1 - animationFunction(time >= duration ? duration : time, duration);\n }\n else {\n animation.offset = 1;\n }\n }\n }\n else {\n const animationValue = animationFunction(time >= duration ? duration : time, duration);\n animation.offset = direction === 'normal' ? animationValue : 1 - animationValue;\n }\n animation.value = interpolate(animation.offset);\n };\n}\n//# sourceMappingURL=createAnimation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createInterpolator = exports.createInterpolationCallback = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst bezier_easing_1 = require(\"bezier-easing\");\nconst Easings_1 = require(\"./Easings\");\nconst utilities_1 = require(\"./utilities\");\n/**\n * Return a callback for value interpolation passing offset from 0 to 1\n *\n * @param simpleAnimation\n * @returns\n */\nfunction createInterpolationCallback(simpleAnimation) {\n const from = Array.isArray(simpleAnimation.from) ? simpleAnimation.from : [simpleAnimation.from];\n const to = Array.isArray(simpleAnimation.to) ? simpleAnimation.to : [simpleAnimation.to];\n const round = simpleAnimation.round;\n const colorInterpolation = simpleAnimation.colorTransitionMode === 'hue' ? utilities_1.interpolateColorHSL : utilities_1.interpolateColorRGB;\n if (from.length !== to.length)\n return undefined;\n const callbacks = [];\n for (let i = 0, len = from.length; i < len; i++) {\n if (typeof from[i] !== typeof to[i]) {\n console.warn('[@urpflanze/animation]: `from` and `to` values mismatch');\n return undefined;\n }\n else {\n if (typeof from[i] !== 'string') {\n const a = from[i], b = to[i];\n callbacks.push(typeof round !== 'undefined'\n ? (offset) => offset === 1 ? b : offset === 0 ? a : Math.round((a + offset * (b - a)) * round) / round\n : (offset) => (offset === 1 ? b : offset === 0 ? a : a + offset * (b - a)));\n }\n else {\n const a = from[i];\n const b = to[i];\n const parsed_a = color_1.parseColorAndConvert(a);\n const parsed_b = color_1.parseColorAndConvert(b);\n if (typeof parsed_a !== 'undefined' && typeof parsed_b !== 'undefined') {\n callbacks.push((offset) => offset === 1 ? b : offset === 0 ? a : colorInterpolation(parsed_a, parsed_b, offset));\n }\n }\n }\n }\n return (offset) => {\n const values = callbacks.map(c => c(offset));\n return values.length === 1 ? values[0] : values;\n };\n}\nexports.createInterpolationCallback = createInterpolationCallback;\n/**\n * Return a callback for calculate offset (0 to 1) from elapsed time and animation duration\n *\n * @param type\n * @returns\n */\nfunction createInterpolator(type) {\n var _a, _b;\n switch (typeof type) {\n case 'function':\n return (elapsed, duration) => type(elapsed / duration, elapsed);\n case 'string':\n switch (type) {\n case 'wave':\n return (elapsed, duration) => 0.5 + Math.sin((elapsed * Math.PI * 2) / duration + Math.PI * 1.5) * 0.5;\n default: {\n if (type in Easings_1.Easings) {\n const easing = Easings_1.Easings[type];\n return (elapsed, duration) => easing(elapsed, 0, 1, duration);\n }\n return (elapsed, duration) => Easings_1.Easings.linear(elapsed, 0, 1, duration);\n }\n }\n case 'object':\n switch (type.type) {\n case 'wave': {\n const phase = Math.PI * 1.5 + (((_a = type.params) === null || _a === void 0 ? void 0 : _a.phase) || 0);\n return (elapsed, duration) => {\n return 0.5 + Math.sin((elapsed * Math.PI * 2) / duration + phase) * 0.5;\n };\n }\n case 'elasticIn':\n case 'elasticOut':\n case 'elasticInOut': {\n const easing = Easings_1.Easings[type.type];\n const { amplitude, period } = type.params || {};\n return (elapsed, duration) => easing(elapsed, 0, 1, duration, amplitude, period);\n }\n case 'backIn':\n case 'backOut':\n case 'backInOut': {\n const easing = Easings_1.Easings[type.type];\n const overshoot = ((_b = type.params) === null || _b === void 0 ? void 0 : _b.overshoot) || undefined;\n return (elapsed, duration) => easing(elapsed, 0, 1, duration, overshoot);\n }\n case 'cubicBezier': {\n const easing = bezier_easing_1.default(type.params[0], type.params[1], type.params[2], type.params[3]);\n return (elapsed, duration) => easing(elapsed / duration);\n }\n }\n }\n return (elapsed, duration) => Easings_1.Easings.linear(elapsed, 0, 1, duration);\n}\nexports.createInterpolator = createInterpolator;\n//# sourceMappingURL=createInterpolator.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./conversions\"), exports);\n__exportStar(require(\"./parsing\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.rgbToHsl = exports.hslToRgb = exports.rgbToHex = void 0;\n/**\n * Convert rgb to hex\n *\n * @param r number between 0 - 255\n * @param g number between 0 - 255\n * @param b number between 0 - 255\n * @returns #ffffff\n */\nfunction rgbToHex(r, g, b) {\n return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;\n}\nexports.rgbToHex = rgbToHex;\n/**\n * Convert hsl (0-360, 0-100, 0-100) color to rgb(0-255, 0-255, 0-255)\n *\n * @param {number} h number between 0 - 360\n * @param {number} s number between 0 - 100\n * @param {number} l number between 0 - 100\n * @returns {[number, number, number]} [0-255, 0-255, 0-255]\n */\nfunction hslToRgb(h, s, l) {\n h /= 360;\n s /= 100;\n l /= 100;\n let r, g, b;\n if (s == 0) {\n r = g = b = l; // achromatic\n }\n else {\n const hue2rgb = (p, q, t) => {\n t += t < 0 ? 1 : t > 1 ? -1 : 0;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n };\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return [(0.5 + r * 255) << 0, (0.5 + g * 255) << 0, (0.5 + b * 255) << 0];\n}\nexports.hslToRgb = hslToRgb;\n/**\n * Convert rbg (0-255, 0-255, 0-255) to hsl (0-360, 0-100, 0-100)\n *\n * @param {number} r number between 0 - 255\n * @param {number} g number between 0 - 255\n * @param {number} b number between 0 - 255\n * @returns {[number, number, number]} (0-360, 0-100, 0-100)\n */\nfunction rgbToHsl(r, g, b) {\n r /= 255;\n g /= 255;\n b /= 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s;\n if (max === min) {\n h = s = 0;\n }\n else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h = h / 6;\n }\n return [(0.5 + h * 360) << 0, (0.5 + s * 100) << 0, (0.5 + l * 100) << 0];\n}\nexports.rgbToHsl = rgbToHsl;\n//# sourceMappingURL=conversions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseColor = exports.parseColorAndConvert = void 0;\nconst htmlcolors_1 = require(\"./htmlcolors\");\nconst conversions_1 = require(\"./conversions\");\n/**\n * Convert color to IConvertedColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IConvertedColor | undefined)}\n */\nfunction parseColorAndConvert(color) {\n const parsed = parseColor(color);\n if (parsed) {\n if (parsed.type === 'hsl') {\n const [r, g, b] = conversions_1.hslToRgb(parsed.a, parsed.b, parsed.c);\n return {\n r,\n g,\n b,\n h: parsed.a,\n s: parsed.b,\n l: parsed.c,\n alpha: parsed.alpha,\n };\n }\n else {\n const [h, s, l] = conversions_1.rgbToHsl(parsed.a, parsed.b, parsed.c);\n return {\n h,\n s,\n l,\n r: parsed.a,\n g: parsed.b,\n b: parsed.c,\n alpha: parsed.alpha,\n };\n }\n }\n}\nexports.parseColorAndConvert = parseColorAndConvert;\n/**\n * Convert color to IColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IColor | undefined)}\n */\nfunction parseColor(color) {\n if (typeof color === 'number') {\n if (color > 0xffffff) {\n return {\n type: 'rgb',\n a: (color >> 24) & 255,\n b: (color >> 16) & 255,\n c: (color >> 8) & 255,\n alpha: (color & 255) / 255,\n };\n }\n else {\n return { type: 'rgb', a: (color >> 16) & 255, b: (color >> 8) & 255, c: color & 255, alpha: 1 };\n }\n }\n color = color.replace(/\\s/g, '');\n if (htmlcolors_1.default[color])\n color = htmlcolors_1.default[color];\n let match = /^#([0-9a-f]{3,8})$/i.exec(color);\n if (match) {\n const hex = match[1];\n if (hex.length === 3) {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[0], 16),\n b: parseInt(hex[1] + hex[1], 16),\n c: parseInt(hex[2] + hex[2], 16),\n alpha: 1,\n };\n }\n else {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[1], 16),\n b: parseInt(hex[2] + hex[3], 16),\n c: parseInt(hex[4] + hex[5], 16),\n alpha: hex.length > 6 ? parseInt(hex.substring(6), 16) / 255 : 1,\n };\n }\n }\n match = /^((hsl|rgb)a?)\\((\\d+),(\\d+)%?,(\\d+)%?,?(.+)?\\)$/i.exec(color);\n if (match) {\n const [, , type, a, b, c, alpha] = match;\n return {\n type: type,\n a: +a,\n b: +b,\n c: +c,\n alpha: alpha ? +alpha : 1,\n };\n }\n}\nexports.parseColor = parseColor;\n//# sourceMappingURL=parsing.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst colors = {\n aliceblue: '#f0f8ff',\n antiquewhite: '#faebd7',\n aqua: '#00ffff',\n aquamarine: '#7fffd4',\n azure: '#f0ffff',\n beige: '#f5f5dc',\n bisque: '#ffe4c4',\n black: '#000000',\n blanchedalmond: '#ffebcd',\n blue: '#0000ff',\n blueviolet: '#8a2be2',\n brown: '#a52a2a',\n burlywood: '#deb887',\n cadetblue: '#5f9ea0',\n chartreuse: '#7fff00',\n chocolate: '#d2691e',\n coral: '#ff7f50',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyan: '#00ffff',\n darkblue: '#00008b',\n darkcyan: '#008b8b',\n darkgoldenrod: '#b8860b',\n darkgray: '#a9a9a9',\n darkgreen: '#006400',\n darkkhaki: '#bdb76b',\n darkmagenta: '#8b008b',\n darkolivegreen: '#556b2f',\n darkorange: '#ff8c00',\n darkorchid: '#9932cc',\n darkred: '#8b0000',\n darksalmon: '#e9967a',\n darkseagreen: '#8fbc8f',\n darkslateblue: '#483d8b',\n darkslategray: '#2f4f4f',\n darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n gold: '#ffd700',\n goldenrod: '#daa520',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n indianred: '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n lavender: '#e6e6fa',\n lavenderblush: '#fff0f5',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrodyellow: '#fafad2',\n lightgrey: '#d3d3d3',\n lightgreen: '#90ee90',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\n maroon: '#800000',\n mediumaquamarine: '#66cdaa',\n mediumblue: '#0000cd',\n mediumorchid: '#ba55d3',\n mediumpurple: '#9370d8',\n mediumseagreen: '#3cb371',\n mediumslateblue: '#7b68ee',\n mediumspringgreen: '#00fa9a',\n mediumturquoise: '#48d1cc',\n mediumvioletred: '#c71585',\n midnightblue: '#191970',\n mintcream: '#f5fffa',\n mistyrose: '#ffe4e1',\n moccasin: '#ffe4b5',\n navajowhite: '#ffdead',\n navy: '#000080',\n oldlace: '#fdf5e6',\n olive: '#808000',\n olivedrab: '#6b8e23',\n orange: '#ffa500',\n orangered: '#ff4500',\n orchid: '#da70d6',\n palegoldenrod: '#eee8aa',\n palegreen: '#98fb98',\n paleturquoise: '#afeeee',\n palevioletred: '#d87093',\n papayawhip: '#ffefd5',\n peachpuff: '#ffdab9',\n peru: '#cd853f',\n pink: '#ffc0cb',\n plum: '#dda0dd',\n powderblue: '#b0e0e6',\n purple: '#800080',\n rebeccapurple: '#663399',\n red: '#ff0000',\n rosybrown: '#bc8f8f',\n royalblue: '#4169e1',\n saddlebrown: '#8b4513',\n salmon: '#fa8072',\n sandybrown: '#f4a460',\n seagreen: '#2e8b57',\n seashell: '#fff5ee',\n sienna: '#a0522d',\n silver: '#c0c0c0',\n skyblue: '#87ceeb',\n slateblue: '#6a5acd',\n slategray: '#708090',\n snow: '#fffafa',\n springgreen: '#00ff7f',\n steelblue: '#4682b4',\n tan: '#d2b48c',\n teal: '#008080',\n thistle: '#d8bfd8',\n tomato: '#ff6347',\n turquoise: '#40e0d0',\n violet: '#ee82ee',\n wheat: '#f5deb3',\n white: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32',\n};\nexports.default = colors;\n//# sourceMappingURL=htmlcolors.js.map","/**\n * https://github.com/gre/bezier-easing\n * BezierEasing - use bezier curve for transition easing function\n * by Gaëtan Renaudeau 2014 - 2015 – MIT License\n */\n\n// These values are established by empiricism with tests (tradeoff: performance VS precision)\nvar NEWTON_ITERATIONS = 4;\nvar NEWTON_MIN_SLOPE = 0.001;\nvar SUBDIVISION_PRECISION = 0.0000001;\nvar SUBDIVISION_MAX_ITERATIONS = 10;\n\nvar kSplineTableSize = 11;\nvar kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\nvar float32ArraySupported = typeof Float32Array === 'function';\n\nfunction A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\nfunction B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\nfunction C (aA1) { return 3.0 * aA1; }\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nfunction calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }\n\n// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\nfunction getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); }\n\nfunction binarySubdivide (aX, aA, aB, mX1, mX2) {\n var currentX, currentT, i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n return currentT;\n}\n\nfunction newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {\n for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n if (currentSlope === 0.0) {\n return aGuessT;\n }\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n}\n\nfunction LinearEasing (x) {\n return x;\n}\n\nmodule.exports = function bezier (mX1, mY1, mX2, mY2) {\n if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {\n throw new Error('bezier x values must be in [0, 1] range');\n }\n\n if (mX1 === mY1 && mX2 === mY2) {\n return LinearEasing;\n }\n\n // Precompute samples table\n var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n for (var i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n\n function getTForX (aX) {\n var intervalStart = 0.0;\n var currentSample = 1;\n var lastSample = kSplineTableSize - 1;\n\n for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n --currentSample;\n\n // Interpolate to provide an initial guess for t\n var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n var guessForT = intervalStart + dist * kSampleStepSize;\n\n var initialSlope = getSlope(guessForT, mX1, mX2);\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if (initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n }\n\n return function BezierEasing (x) {\n // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n if (x === 0) {\n return 0;\n }\n if (x === 1) {\n return 1;\n }\n return calcBezier(getTForX(x), mY1, mY2);\n };\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Easings = void 0;\n/**\n * Easing functions\n *\n * @category Services.Animation\n */\nconst Easings = {\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n linear: (timeOrOffset, start, end, duration = 1) => (end * timeOrOffset) / duration + start,\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return -end * timeOrOffset * (timeOrOffset - 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset + start;\n timeOrOffset--;\n return (-end / 2) * (timeOrOffset * (timeOrOffset - 2) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * (timeOrOffset * timeOrOffset * timeOrOffset + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return -end * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (-end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset - 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalIn: (timeOrOffset, start, end, duration = 1) => {\n return -end * Math.cos((timeOrOffset / duration) * (Math.PI / 2)) + end + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalOut: (timeOrOffset, start, end, duration = 1) => {\n return end * Math.sin((timeOrOffset / duration) * (Math.PI / 2)) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalInOut: (timeOrOffset, start, end, duration = 1) => {\n return (-end / 2) * (Math.cos((Math.PI * timeOrOffset) / duration) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialIn: (timeOrOffset, start, end, duration = 1) => {\n return end * Math.pow(2, 10 * (timeOrOffset / duration - 1)) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialOut: (timeOrOffset, start, end, duration = 1) => {\n return end * (-Math.pow(2, (-10 * timeOrOffset) / duration) + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * Math.pow(2, 10 * (timeOrOffset - 1)) + start;\n timeOrOffset--;\n return (end / 2) * (-Math.pow(2, -10 * timeOrOffset) + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return -end * (Math.sqrt(1 - timeOrOffset * timeOrOffset) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * Math.sqrt(1 - timeOrOffset * timeOrOffset) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (-end / 2) * (Math.sqrt(1 - timeOrOffset * timeOrOffset) - 1) + start;\n timeOrOffset -= 2;\n return (end / 2) * (Math.sqrt(1 - timeOrOffset * timeOrOffset) + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticIn: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration) === 1) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n return (-(amplitude *\n Math.pow(2, 10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period)) + start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticOut: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration) === 1) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n return (amplitude * Math.pow(2, -10 * timeOrOffset) * Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period) +\n end +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticInOut: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration / 2) === 2) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n if (timeOrOffset < 1) {\n return (-0.5 *\n (amplitude *\n Math.pow(2, 10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period)) +\n start);\n }\n return (amplitude *\n Math.pow(2, -10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period) *\n 0.5 +\n end +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} overshoot (optional)\n * @return {number}\n */\n backIn: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n return end * (timeOrOffset /= duration) * timeOrOffset * ((overshoot + 1) * timeOrOffset - overshoot) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} s overshoot (optional)\n * @return {number}\n */\n backOut: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n return (end *\n ((timeOrOffset = timeOrOffset / duration - 1) * timeOrOffset * ((overshoot + 1) * timeOrOffset + overshoot) +\n 1) +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} overshoot (optional)\n * @return {number}\n */\n backInOut: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n if ((timeOrOffset /= duration / 2) < 1) {\n return (end / 2) * (timeOrOffset * timeOrOffset * (((overshoot *= 1.525) + 1) * timeOrOffset - overshoot)) + start;\n }\n return ((end / 2) * ((timeOrOffset -= 2) * timeOrOffset * (((overshoot *= 1.525) + 1) * timeOrOffset + overshoot) + 2) +\n start);\n },\n /**\n * @param {number} t current time\n * @param {number} b start value\n * @param {number} c end value\n * @param {number} d duration\n * @return {number}\n */\n bounceIn: (timeOrOffset, start, end, duration = 1) => {\n return end - Easings.bounceOut(duration - timeOrOffset, 0, end, duration) + start;\n },\n /**\n * @param {number} t current time\n * @param {number} b start value\n * @param {number} c end value\n * @param {number} d duration\n * @return {number}\n */\n bounceOut: (timeOrOffset, start, end, duration = 1) => {\n if ((timeOrOffset /= duration) < 1 / 2.75) {\n return end * (7.5625 * timeOrOffset * timeOrOffset) + start;\n }\n else if (timeOrOffset < 2 / 2.75) {\n return end * (7.5625 * (timeOrOffset -= 1.5 / 2.75) * timeOrOffset + 0.75) + start;\n }\n else if (timeOrOffset < 2.5 / 2.75) {\n return end * (7.5625 * (timeOrOffset -= 2.25 / 2.75) * timeOrOffset + 0.9375) + start;\n }\n return end * (7.5625 * (timeOrOffset -= 2.625 / 2.75) * timeOrOffset + 0.984375) + start;\n },\n /**\n *\n *\n * @param {number} time\n * @param {number} start\n * @param {number} end\n * @param {number} duration\n * @returns\n */\n bounceInOut: (timeOrOffset, start, end, duration = 1) => {\n if (timeOrOffset < duration / 2) {\n return Easings.bounceIn(timeOrOffset * 2, 0, end, duration) * 0.5 + start;\n }\n return Easings.bounceOut(timeOrOffset * 2 - duration, 0, end, duration) * 0.5 + end * 0.5 + start;\n },\n};\nexports.Easings = Easings;\n//# sourceMappingURL=Easings.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UncontrolledLoop = exports.Static = exports.Loop = exports.Compose = exports.Simple = exports.resolveSimpleAnimation = void 0;\nconst composeAnimations_1 = require(\"./composeAnimations\");\nconst createAnimation_1 = require(\"./createAnimation\");\nfunction resolveSimpleAnimation(simpleAnimation) {\n const animation = createAnimation_1.createAnimation(simpleAnimation);\n if (animation) {\n return (propArgumentsOrCurrentTime) => {\n var _a;\n const currentTime = typeof propArgumentsOrCurrentTime === 'number'\n ? propArgumentsOrCurrentTime\n : ((_a = propArgumentsOrCurrentTime.shape.scene) === null || _a === void 0 ? void 0 : _a.currentTime) || 0;\n animation.update(currentTime);\n return animation.value;\n };\n }\n}\nexports.resolveSimpleAnimation = resolveSimpleAnimation;\n// Alias\nexports.Simple = resolveSimpleAnimation;\n// Compose multiple animations\nconst Compose = (animations) => {\n const composed = composeAnimations_1.composeAnimations(animations);\n if (composed) {\n return (propArgumentsOrCurrentTime) => {\n var _a;\n const currentTime = typeof propArgumentsOrCurrentTime === 'number'\n ? propArgumentsOrCurrentTime\n : ((_a = propArgumentsOrCurrentTime.shape.scene) === null || _a === void 0 ? void 0 : _a.currentTime) || 0;\n return composed(currentTime);\n };\n }\n};\nexports.Compose = Compose;\nconst Loop = (loopAnimation) => {\n const simpleAnimation = loopAnimation;\n if (typeof simpleAnimation.interpolator === 'undefined') {\n simpleAnimation.interpolator = 'wave';\n }\n if (simpleAnimation.interpolator) {\n if (typeof simpleAnimation.interpolator === 'string') {\n if (simpleAnimation.interpolator !== 'wave') {\n simpleAnimation.direction = 'alternate';\n }\n }\n else if (typeof simpleAnimation.interpolator === 'object' && simpleAnimation.interpolator.type !== 'wave') {\n simpleAnimation.direction = 'alternate';\n }\n }\n simpleAnimation.loop = true;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.Loop = Loop;\nconst Static = (staticAnimation) => {\n const simpleAnimation = staticAnimation;\n simpleAnimation.direction = 'normal';\n simpleAnimation.loop = false;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.Static = Static;\nconst UncontrolledLoop = (uncontrolledLoopAnimation) => {\n const simpleAnimation = uncontrolledLoopAnimation;\n simpleAnimation.direction = 'normal';\n simpleAnimation.loop = true;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.UncontrolledLoop = UncontrolledLoop;\n//# sourceMappingURL=Animation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.composeAnimations = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst createAnimation_1 = require(\"./createAnimation\");\nconst utilities_1 = require(\"./utilities\");\n/**\n *\n *\n * @export\n * @param {Array} simpleAnimations\n * @return {*} {(((currentTime: number) => string | number | Array | undefined) | undefined)}\n */\nfunction composeAnimations(simpleAnimations) {\n const animations = simpleAnimations.map(createAnimation_1.createAnimation).filter(a => typeof a !== 'undefined');\n const animationsLength = animations.length;\n if (animationsLength > 0) {\n return (currentTime) => {\n let value = undefined;\n for (let i = 0; i < animationsLength; i++) {\n const animation = animations[i];\n animation.update(currentTime);\n value = typeof value === 'undefined' ? animation.value : interpolate(value, animation.value);\n }\n return value;\n };\n }\n}\nexports.composeAnimations = composeAnimations;\nfunction interpolate(a, b, offset = 0.5) {\n const from = Array.isArray(a) ? a : [a];\n const to = Array.isArray(b) ? b : [b];\n const results = [];\n for (let i = 0, len = from.length; i < len; i++) {\n if (typeof from[i] !== typeof to[i]) {\n console.error('[@urpflanze/animation]: cannot interpolate');\n return undefined;\n }\n else {\n if (typeof from[i] !== 'string') {\n const a = from[i], b = to[i];\n results.push(a + offset * (b - a));\n }\n else {\n const a = from[i];\n const b = to[i];\n const parsed_a = color_1.parseColorAndConvert(a);\n const parsed_b = color_1.parseColorAndConvert(b);\n if (typeof parsed_a !== 'undefined' && typeof parsed_b !== 'undefined') {\n results.push(utilities_1.interpolateColorRGB(parsed_a, parsed_b, offset));\n }\n }\n }\n }\n return results.length === 1 ? results[0] : results;\n}\n//# sourceMappingURL=composeAnimations.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BrowserDrawerCanvas = void 0;\nconst DrawerCanvas_1 = require(\"../DrawerCanvas\");\nconst utils_1 = require(\"../utils\");\n/**\n *\n * @category DrawerCanvas\n * @class BrowserDrawerCanvas\n * @extends {DrawerCanvas}\n */\nclass BrowserDrawerCanvas extends DrawerCanvas_1.DrawerCanvas {\n constructor(scene, canvasOrContainer, drawerOptions, duration = 60000, framerate = 60) {\n super(scene, canvasOrContainer, drawerOptions, duration, framerate);\n this.dpi = 1;\n this.dpi = (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.dpi) || 1;\n this.draw_id = null;\n this.redraw_id = null;\n this.animation_id = null;\n this.draw = this.draw.bind(this);\n this.animate = this.animate.bind(this);\n this.startAnimation = this.startAnimation.bind(this);\n this.resize(this.drawerOptions.width, this.drawerOptions.height);\n }\n resize(width, height, sceneFit, dpi = this.dpi) {\n this.drawerOptions.width = width * dpi;\n this.drawerOptions.height = height * dpi;\n if (this.canvas) {\n this.canvas.width = width * dpi;\n this.canvas.height = height * dpi;\n if (utils_1.bBrowser && this.canvas instanceof HTMLCanvasElement) {\n this.canvas.style.width = width + 'px';\n this.canvas.style.height = height + 'px';\n }\n }\n if (typeof sceneFit !== 'undefined') {\n this.drawerOptions.sceneFit = sceneFit;\n }\n this.dispatch('drawer-canvas:resize');\n }\n /**\n * Internal tick animation\n */\n animate(timestamp) {\n if (this.timeline.bSequenceStarted()) {\n this.animation_id = requestAnimationFrame(this.animate);\n if (this.timeline.tick(timestamp))\n this.draw();\n }\n }\n /**\n * Start animation drawing\n */\n startAnimation() {\n this.stopAnimation();\n this.timeline.start();\n this.animation_id = requestAnimationFrame(this.animate);\n }\n /**\n * Stop animation drawing\n */\n stopAnimation() {\n this.timeline.stop();\n if (this.animation_id)\n cancelAnimationFrame(this.animation_id);\n }\n /**\n * Pause animation drawing\n */\n pauseAnimation() {\n this.timeline.pause();\n if (this.animation_id)\n cancelAnimationFrame(this.animation_id);\n }\n /**\n * Play animation drawing\n */\n playAnimation() {\n this.timeline.start();\n requestAnimationFrame(this.animate);\n }\n redraw() {\n if (!this.timeline.bSequenceStarted()) {\n this.draw_id && cancelAnimationFrame(this.draw_id);\n if (typeof this.drawerOptions.ghosts === undefined || this.drawerOptions.ghosts === 0)\n this.timeline.stop();\n this.draw_id = requestAnimationFrame(this.draw);\n }\n else if (typeof this.drawerOptions.ghosts === undefined || this.drawerOptions.ghosts === 0) {\n this.stopAnimation();\n this.redraw_id && cancelAnimationFrame(this.redraw_id);\n this.redraw_id = requestAnimationFrame(this.startAnimation);\n }\n }\n}\nexports.BrowserDrawerCanvas = BrowserDrawerCanvas;\n//# sourceMappingURL=BrowserDrawerCanvas.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DrawerCanvas = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nconst math_1 = require(\"@urpflanze/core/dist/cjs/math\");\nconst Vec2_1 = require(\"@urpflanze/core/dist/cjs/math/Vec2\");\nconst canvas_1 = require(\"canvas\");\nconst Emitter_1 = require(\"./Emitter\");\nconst Timeline_1 = require(\"./Timeline\");\nconst utils_1 = require(\"./utils\");\n/**\n *\n * @category DrawerCanvas\n * @extends {Emitter}\n */\nclass DrawerCanvas extends Emitter_1.Emitter {\n constructor(scene, canvasOrContainer, drawerOptions, duration = 60000, framerate = 60) {\n var _a, _b, _c, _d, _e;\n super();\n this.drawerOptions = {\n width: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.width) || (scene === null || scene === void 0 ? void 0 : scene.width) || 400,\n height: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.height) || (scene === null || scene === void 0 ? void 0 : scene.height) || 400,\n clear: (_a = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.clear) !== null && _a !== void 0 ? _a : true,\n time: (_b = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.time) !== null && _b !== void 0 ? _b : 0,\n simmetricLines: (_c = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.simmetricLines) !== null && _c !== void 0 ? _c : 0,\n noBackground: (_d = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.noBackground) !== null && _d !== void 0 ? _d : false,\n ghosts: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghosts) || 0,\n ghostAlpha: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostAlpha) === false ? false : true,\n ghostSkipTime: (_e = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostSkipTime) !== null && _e !== void 0 ? _e : 30,\n ghostSkipFunction: drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostSkipFunction,\n sceneFit: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.sceneFit) || 'contain',\n backgroundImage: drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.backgroundImage,\n backgroundImageFit: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.backgroundImageFit) || 'cover',\n };\n this.timeline = new Timeline_1.Timeline(duration, framerate);\n this.timeline.setTime(this.drawerOptions.time);\n this.draw_id = null;\n this.redraw_id = null;\n this.animation_id = null;\n if (scene) {\n this.setScene(scene);\n }\n if (!utils_1.bWorker || (utils_1.bWorker && canvasOrContainer instanceof OffscreenCanvas))\n this.setCanvas(canvasOrContainer);\n }\n /**\n * Return option value or default\n *\n * @param {K keyof IDrawerCanvasOptions} name\n * @param {IDrawerCanvasOptions[K]} defaultValue\n */\n getOption(name, defaultValue) {\n var _a;\n return (_a = this.drawerOptions[name]) !== null && _a !== void 0 ? _a : defaultValue;\n }\n /**\n * Create instance of canvas (HTMLCanvasElement in browser o Canvas in Node)\n */\n setCanvas(canvasOrContainer) {\n if (utils_1.bWorker) {\n if (canvasOrContainer instanceof OffscreenCanvas) {\n this.canvas = canvasOrContainer;\n }\n else {\n console.error('Cannot set cavas');\n }\n }\n else {\n if (utils_1.bBrowser) {\n const canvas = canvas_1.createCanvas(this.drawerOptions.width, this.drawerOptions.height);\n if (canvasOrContainer instanceof HTMLElement &&\n !(canvasOrContainer instanceof HTMLCanvasElement || canvasOrContainer instanceof OffscreenCanvas)) {\n this.canvas = canvas;\n while (canvasOrContainer.lastChild)\n canvasOrContainer.removeChild(canvasOrContainer.lastChild);\n canvasOrContainer.appendChild(canvas);\n }\n else {\n this.canvas = typeof canvasOrContainer === 'undefined' ? canvas : canvasOrContainer;\n }\n }\n else {\n this.canvas = canvas_1.createCanvas(this.drawerOptions.width, this.drawerOptions.height);\n }\n }\n if (this.canvas) {\n this.canvas.width = this.drawerOptions.width;\n this.canvas.height = this.drawerOptions.height;\n this.context = this.canvas.getContext('2d', {\n alpha: true,\n // desynchronized: true,\n });\n }\n }\n /**\n * Return instance of canvas\n *\n * @returns canvas\n */\n getCanvas() {\n return this.canvas;\n }\n setScene(scene) {\n this.scene = scene;\n }\n draw() {\n if (this.context === null || typeof this.scene === 'undefined')\n return 0;\n const start_time = Utilities_1.now();\n const timeline = this.timeline;\n const drawAtTime = timeline.getTime();\n const drawerOptions = {\n ...this.drawerOptions,\n ghostIndex: undefined,\n clear: this.drawerOptions.clear || timeline.getCurrentFrame() <= 1,\n time: drawAtTime,\n };\n const currentFrame = timeline.getFrameAtTime(drawAtTime);\n this.dispatch('drawer-canvas:before_draw', {\n currentFrame: currentFrame,\n currentTime: drawAtTime,\n });\n if (drawerOptions.simmetricLines > 0) {\n if (drawerOptions.clear) {\n DrawerCanvas.clear(this.context, drawerOptions.width, drawerOptions.height, drawerOptions.noBackground ? false : this.scene.background, drawerOptions.backgroundImage, drawerOptions.backgroundImageFit);\n }\n DrawerCanvas.drawSimmetricLines(this.context, drawerOptions.simmetricLines, drawerOptions.width, drawerOptions.height, this.scene.color);\n drawerOptions.clear = false;\n }\n if (drawerOptions.ghosts) {\n const ghostDrawerOptions = {\n ...drawerOptions,\n };\n const drawAtTime = timeline.getTime();\n const sequenceDuration = timeline.getDuration();\n const ghostRepetition = {\n offset: 0,\n index: 0,\n count: drawerOptions.ghosts,\n };\n for (let i = 1; i <= drawerOptions.ghosts; i++) {\n ghostRepetition.index = i;\n ghostRepetition.offset = ghostRepetition.index / ghostRepetition.count;\n const ghostTime = drawAtTime -\n (drawerOptions.ghostSkipFunction\n ? drawerOptions.ghostSkipFunction(ghostRepetition, drawAtTime)\n : i * drawerOptions.ghostSkipTime);\n ghostDrawerOptions.ghostIndex = i;\n ghostDrawerOptions.time = math_1.mod(ghostTime, sequenceDuration);\n ghostDrawerOptions.clear = drawerOptions.clear && ghostDrawerOptions.ghostIndex === 1;\n this.realDraw(ghostDrawerOptions);\n }\n drawerOptions.clear = false;\n }\n this.realDraw(drawerOptions);\n return Utilities_1.now() - start_time;\n }\n realDraw(options) {\n var _a;\n const width = this.drawerOptions.width;\n const height = this.drawerOptions.height;\n const context = this.context;\n const scene = this.scene;\n const time = (_a = options.time) !== null && _a !== void 0 ? _a : 0;\n const bGhost = typeof options.ghosts !== 'undefined' &&\n options.ghosts > 0 &&\n typeof options.ghostIndex !== 'undefined' &&\n options.ghostIndex > 0;\n const ghostMultiplier = bGhost ? 1 - options.ghostIndex / (options.ghosts + 0.5) : 0;\n const ghostAlpha = options.ghostAlpha === true;\n const sceneFit = utils_1.fit(scene.width, scene.height, width, height, this.drawerOptions.sceneFit);\n const translateX = sceneFit.x;\n const translateY = sceneFit.y;\n options.clear &&\n DrawerCanvas.clear(context, width, height, options.noBackground ? false : scene.background, options.backgroundImage, options.backgroundImageFit);\n let logFillColorWarn = false;\n let logStrokeColorWarn = false;\n scene.currentTime = time;\n const sceneChilds = scene.getChildren();\n for (let i = 0, len = sceneChilds.length; i < len; i++) {\n const sceneChild = sceneChilds[i];\n if (!sceneChild.data ||\n (!(sceneChild.data.visible === false) && !(bGhost && sceneChild.data.disableGhost === true))) {\n sceneChilds[i].generate(time, true);\n const childIndexedBuffer = sceneChilds[i].getIndexedBuffer() || [];\n const childBuffer = sceneChilds[i].getBuffer() || [];\n let childVertexIndex = 0;\n for (let currentBufferIndex = 0, len = childIndexedBuffer.length; currentBufferIndex < len; currentBufferIndex++) {\n const currentIndexing = childIndexedBuffer[currentBufferIndex];\n const shape = currentIndexing.shape;\n const propArguments = {\n canvasContext: context,\n ...currentIndexing,\n };\n const composite = DrawerCanvas.getStreamDrawerProp(shape, 'composite', propArguments, 'source-over');\n context.globalCompositeOperation = composite;\n context.beginPath();\n context.moveTo(childBuffer[childVertexIndex] * sceneFit.scale + translateX, childBuffer[childVertexIndex + 1] * sceneFit.scale + translateY);\n childVertexIndex += 2;\n for (let currentFrameLength = childVertexIndex + currentIndexing.frameLength - 2; childVertexIndex < currentFrameLength; childVertexIndex += 2)\n context.lineTo(childBuffer[childVertexIndex] * sceneFit.scale + translateX, childBuffer[childVertexIndex + 1] * sceneFit.scale + translateY);\n if (shape.isClosed())\n context.closePath();\n const alpha = DrawerCanvas.getStreamDrawerProp(shape, 'opacity', propArguments, 1);\n context.globalAlpha = alpha;\n const shadowColor = DrawerCanvas.getStreamDrawerProp(shape, 'shadowColor', propArguments);\n const shadowBlur = DrawerCanvas.getStreamDrawerProp(shape, 'shadowBlur', propArguments);\n const shadowOffsetX = DrawerCanvas.getStreamDrawerProp(shape, 'shadowOffsetX', propArguments);\n const shadowOffsetY = DrawerCanvas.getStreamDrawerProp(shape, 'shadowOffsetY', propArguments);\n context.shadowColor = shadowColor;\n context.shadowBlur = shadowBlur;\n shadowOffsetX && (context.shadowOffsetX = shadowOffsetX);\n shadowOffsetY && (context.shadowOffsetY = shadowOffsetY);\n let fill = DrawerCanvas.getStreamDrawerProp(shape, 'fill', propArguments);\n if (typeof fill !== 'undefined') {\n if (bGhost && ghostAlpha) {\n const color = DrawerCanvas.ghostifyColor(fill, ghostMultiplier);\n if (color) {\n fill = color;\n }\n else if (!logFillColorWarn) {\n console.warn(`[Urpflanze:DrawerCanvas] Unable ghost fill color '${fill}',\n\t\t\t\t\t\t\t\tplease enter a rgba or hsla color`);\n logFillColorWarn = true;\n }\n }\n context.fillStyle = fill;\n context.fill();\n }\n let stroke = DrawerCanvas.getStreamDrawerProp(shape, 'stroke', propArguments, typeof fill === 'undefined' ? scene.color : undefined);\n let lineWidth = DrawerCanvas.getStreamDrawerProp(shape, 'lineWidth', propArguments, 1);\n if (stroke) {\n if (bGhost && ghostAlpha) {\n const color = DrawerCanvas.ghostifyColor(stroke, ghostMultiplier);\n if (color) {\n stroke = color;\n }\n else if (!logStrokeColorWarn) {\n console.warn(`[Urpflanze:DrawerCanvas] Unable ghost stroke color '${stroke}',\n\t\t\t\t\t\t\t\tplease enter a rgba or hsla color`);\n logStrokeColorWarn = true;\n }\n lineWidth *= ghostMultiplier;\n }\n const lineJoin = DrawerCanvas.getStreamDrawerProp(shape, 'lineJoin', propArguments);\n const lineCap = DrawerCanvas.getStreamDrawerProp(shape, 'lineCap', propArguments);\n const lineDash = DrawerCanvas.getStreamDrawerProp(shape, 'lineDash', propArguments);\n const lineDashOffset = DrawerCanvas.getStreamDrawerProp(shape, 'lineDashOffset', propArguments);\n const miterLimit = DrawerCanvas.getStreamDrawerProp(shape, 'miterLimit', propArguments);\n context.setLineDash.call(context, lineDash || []);\n context.lineJoin = lineJoin;\n context.lineCap = lineCap;\n context.lineDashOffset = lineDashOffset;\n context.miterLimit = miterLimit;\n context.lineWidth = lineWidth * sceneFit.scale;\n context.strokeStyle = stroke;\n context.stroke();\n }\n }\n context.restore();\n }\n }\n }\n /**\n * Return a drawer value\n *\n * @static\n * @template T\n * @param {ShapePrimitive} shape\n * @param {keyof T} key\n * @param {IDrawerPropArguments} propArguments\n * @param {*} [defaultValue]\n * @returns {*}\n */\n static getStreamDrawerProp(shape, key, propArguments, defaultValue) {\n let attribute = shape.drawer[key];\n if (typeof attribute === 'function') {\n attribute = attribute(propArguments);\n }\n return attribute !== null && attribute !== void 0 ? attribute : defaultValue;\n }\n /**\n * Create color based on ghostMultiplier\n *\n * @static\n * @param {any} color\n * @param {number} ghostMultiplier\n * @return {*} {(string | undefined)}\n */\n static ghostifyColor(color, ghostMultiplier) {\n if (typeof color === 'string' || typeof color === 'number') {\n const parsed = color_1.parseColor(color);\n if (parsed) {\n const ghostAlpha = parsed.alpha * ghostMultiplier;\n return parsed.type === 'rgb'\n ? `rgba(${parsed.a},${parsed.b},${parsed.c},${ghostAlpha})`\n : `hsla(${parsed.a},${parsed.b}%,${parsed.c}%,${ghostAlpha})`;\n }\n }\n return color;\n }\n /**\n * Clear canvas, draw background or image (and fit)\n *\n * @param context\n * @param width\n * @param height\n * @param background\n * @param backgroundImage\n * @param backgroundImageFit\n */\n static clear(context, width, height, background, backgroundImage, backgroundImageFit) {\n if (typeof background === 'boolean' && background === false) {\n context.clearRect(0, 0, width, height);\n }\n else {\n context.globalCompositeOperation = 'source-over';\n context.fillStyle = background; // or true\n context.fillRect(0, 0, width, height);\n if (backgroundImage) {\n const sourceWidth = backgroundImage instanceof SVGImageElement ? backgroundImage.width.baseVal.value : backgroundImage.width;\n const sourceHeight = backgroundImage instanceof SVGImageElement ? backgroundImage.height.baseVal.value : backgroundImage.height;\n const fitRect = utils_1.fit(sourceWidth, sourceHeight, width, height, backgroundImageFit);\n context.drawImage(backgroundImage, fitRect.x, fitRect.y, fitRect.width, fitRect.height);\n }\n }\n }\n /**\n * Draw utility lines\n *\n * @param context\n * @param simmetricLines\n * @param width\n * @param height\n * @param color\n */\n static drawSimmetricLines(context, simmetricLines, width, height, color) {\n const offset = Math.PI / simmetricLines;\n const size = Math.max(width, height);\n const sizeMin = Math.min(width, height);\n const k = width < height ? 1 : 0;\n const centerX = [size / 2, size / 2];\n const centerY = [sizeMin / 2, sizeMin / 2];\n for (let i = 0; i < simmetricLines; i++) {\n const a = [-size, -size];\n const b = [size * 2, size * 2];\n const rotate = i * offset + Math.PI / 4;\n Vec2_1.default.rotateZ(a, i % 2 === k ? centerX : centerY, rotate);\n Vec2_1.default.rotateZ(b, i % 2 === k ? centerX : centerY, rotate);\n context.beginPath();\n context.strokeStyle = color;\n context.lineWidth = 1;\n context.moveTo(a[0], a[1]);\n context.lineTo(b[0], b[1]);\n context.stroke();\n }\n }\n}\nexports.DrawerCanvas = DrawerCanvas;\n// const sourceRatio = sourceWidth / sourceHeight\n// let x = 0,\n// \ty = 0,\n// \tbgWidth = width,\n// \tbgHeight = height\n// if (sourceRatio !== ratio) {\n// \tif (options.backgroundImageFit === 'contain') {\n// \t\tbgWidth = ratio > sourceRatio ? (sourceWidth * height) / sourceHeight : width\n// \t\tbgHeight = ratio > sourceRatio ? height : (sourceHeight * width) / sourceWidth\n// \t} else {\n// \t\tbgWidth = ratio < sourceRatio ? (sourceWidth * height) / sourceHeight : width\n// \t\tbgHeight = ratio < sourceRatio ? height : (sourceHeight * width) / sourceWidth\n// \t}\n// \tx = (width - bgWidth) / 2\n// \ty = (height - bgHeight) / 2\n//# sourceMappingURL=DrawerCanvas.js.map","/* globals document, ImageData */\n\nconst parseFont = require('./lib/parse-font')\n\nexports.parseFont = parseFont\n\nexports.createCanvas = function (width, height) {\n return Object.assign(document.createElement('canvas'), { width: width, height: height })\n}\n\nexports.createImageData = function (array, width, height) {\n // Browser implementation of ImageData looks at the number of arguments passed\n switch (arguments.length) {\n case 0: return new ImageData()\n case 1: return new ImageData(array)\n case 2: return new ImageData(array, width)\n default: return new ImageData(array, width, height)\n }\n}\n\nexports.loadImage = function (src, options) {\n return new Promise(function (resolve, reject) {\n const image = Object.assign(document.createElement('img'), options)\n\n function cleanup () {\n image.onload = null\n image.onerror = null\n }\n\n image.onload = function () { cleanup(); resolve(image) }\n image.onerror = function () { cleanup(); reject(new Error('Failed to load the image \"' + src + '\"')) }\n\n image.src = src\n })\n}\n","'use strict'\n\n/**\n * Font RegExp helpers.\n */\n\nconst weights = 'bold|bolder|lighter|[1-9]00'\n , styles = 'italic|oblique'\n , variants = 'small-caps'\n , stretches = 'ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded'\n , units = 'px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q'\n , string = '\\'([^\\']+)\\'|\"([^\"]+)\"|[\\\\w\\\\s-]+'\n\n// [ [ <‘font-style’> || || <‘font-weight’> || <‘font-stretch’> ]?\n// <‘font-size’> [ / <‘line-height’> ]? <‘font-family’> ]\n// https://drafts.csswg.org/css-fonts-3/#font-prop\nconst weightRe = new RegExp('(' + weights + ') +', 'i')\nconst styleRe = new RegExp('(' + styles + ') +', 'i')\nconst variantRe = new RegExp('(' + variants + ') +', 'i')\nconst stretchRe = new RegExp('(' + stretches + ') +', 'i')\nconst sizeFamilyRe = new RegExp(\n '([\\\\d\\\\.]+)(' + units + ') *'\n + '((?:' + string + ')( *, *(?:' + string + '))*)')\n\n/**\n * Cache font parsing.\n */\n\nconst cache = {}\n\nconst defaultHeight = 16 // pt, common browser default\n\n/**\n * Parse font `str`.\n *\n * @param {String} str\n * @return {Object} Parsed font. `size` is in device units. `unit` is the unit\n * appearing in the input string.\n * @api private\n */\n\nmodule.exports = function (str) {\n // Cached\n if (cache[str]) return cache[str]\n\n // Try for required properties first.\n const sizeFamily = sizeFamilyRe.exec(str)\n if (!sizeFamily) return // invalid\n\n // Default values and required properties\n const font = {\n weight: 'normal',\n style: 'normal',\n stretch: 'normal',\n variant: 'normal',\n size: parseFloat(sizeFamily[1]),\n unit: sizeFamily[2],\n family: sizeFamily[3].replace(/[\"']/g, '').replace(/ *, */g, ',')\n }\n\n // Optional, unordered properties.\n let weight, style, variant, stretch\n // Stop search at `sizeFamily.index`\n let substr = str.substring(0, sizeFamily.index)\n if ((weight = weightRe.exec(substr))) font.weight = weight[1]\n if ((style = styleRe.exec(substr))) font.style = style[1]\n if ((variant = variantRe.exec(substr))) font.variant = variant[1]\n if ((stretch = stretchRe.exec(substr))) font.stretch = stretch[1]\n\n // Convert to device units. (`font.unit` is the original unit)\n // TODO: ch, ex\n switch (font.unit) {\n case 'pt':\n font.size /= 0.75\n break\n case 'pc':\n font.size *= 16\n break\n case 'in':\n font.size *= 96\n break\n case 'cm':\n font.size *= 96.0 / 2.54\n break\n case 'mm':\n font.size *= 96.0 / 25.4\n break\n case '%':\n // TODO disabled because existing unit tests assume 100\n // font.size *= defaultHeight / 100 / 0.75\n break\n case 'em':\n case 'rem':\n font.size *= defaultHeight / 0.75\n break\n case 'q':\n font.size *= 96 / 25.4 / 4\n break\n }\n\n return (cache[str] = font)\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Emitter = void 0;\n/**\n * Class used for emit and dispatch events\n *\n * @category Emitter\n * @abstract\n * @class Emitter\n * @template EventTypes\n */\nclass Emitter {\n constructor() {\n this.callbacks = {};\n }\n /**\n * Attach callback at event\n *\n * @param {keyof EventTypes} e\n * @param {(value: EventTypes[keyof EventTypes]) => any} callback\n * @memberof Emitter\n */\n attach(e, callback) {\n if (!(e in this.callbacks)) {\n this.callbacks[e] = [];\n }\n this.callbacks[e].push(callback);\n }\n /**\n * Remove callbach listener at event\n *\n * @param {keyof EventTypes} e\n * @param {(value: EventTypes[keyof EventTypes]) => void} callback\n * @memberof Emitter\n */\n detach(e, callback) {\n if (e in this.callbacks) {\n const index = this.callbacks[e].indexOf(callback);\n if (index >= 0) {\n this.callbacks[e].splice(index, 1);\n }\n }\n }\n /**\n * Dispatch event\n *\n * @param {keyof EventTypes} e\n * @param {EventTypes[keyof EventTypes]} [params]\n * @memberof Emitter\n */\n dispatch(e, params) {\n if (e in this.callbacks && this.callbacks[e].length > 0) {\n for (let i = 0, len = this.callbacks[e].length; i < len; i++)\n if (this.callbacks[e][i](params) === false)\n break;\n }\n }\n}\nexports.Emitter = Emitter;\n//# sourceMappingURL=Emitter.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Timeline = void 0;\nconst Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nconst math_1 = require(\"@urpflanze/core/dist/cjs/math\");\nconst Emitter_1 = require(\"./Emitter\");\n/**\n * Is used for sequence time management.\n * It is necessary to set the duration and the number of frames per second (frame rate).\n *\n * @category Timeline\n * @class Timeline\n * @extends {Emitter}\n */\nclass Timeline extends Emitter_1.Emitter {\n constructor(duration = 60000, framerate = 30) {\n super();\n this.fps_samples_size = 30;\n this.fps_samples = [];\n this.fps_samples_index = 0;\n this.paused_time = 0;\n this.sequence = {\n duration,\n framerate,\n frames: Math.round((duration / 1000) * framerate),\n };\n this.tick_time = 1000 / this.sequence.framerate;\n this.fps = this.sequence.framerate;\n this.b_sequence_started = false;\n this.currentFrame = 0;\n this.currentTime = 0;\n this.last_tick = 0;\n this.start_time = 0;\n }\n //#region sequence meta\n /**\n * Return the sequence\n *\n * @returns {Sequence}\n */\n getSequence() {\n return { ...this.sequence };\n }\n /**\n * Set Sequence\n *\n * @param {number} duration in ms\n * @param {number} framerate\n * @param {number} atTime\n */\n setSequence(duration, framerate, atTime) {\n this.sequence.duration = duration;\n this.sequence.framerate = framerate;\n this.tick_time = 1000 / this.sequence.framerate;\n this.sequence.frames = Math.round((this.sequence.duration / 1000) * this.sequence.framerate);\n if (typeof atTime !== 'undefined') {\n this.setTime(atTime);\n }\n else {\n this.dispatch('timeline:update_sequence', this.getSequence());\n }\n }\n /**\n * Set duration of timeline\n *\n * @param {number} framerate\n */\n setDuration(duration) {\n this.setSequence(duration, this.sequence.framerate);\n }\n /**\n * Get timeline duration\n *\n * @returns {number}\n */\n getDuration() {\n return this.sequence.duration;\n }\n /**\n * Return framerate\n *\n * @returns {number}\n */\n getFramerate() {\n return this.sequence.framerate;\n }\n /**\n * Set a framerate\n *\n * @param {number} framerate\n */\n setFramerate(framerate) {\n this.setSequence(this.sequence.duration, framerate);\n }\n /**\n * Get number of frames based on duration and framerate\n *\n * @returns {number}\n */\n getFramesCount() {\n return this.sequence.frames;\n }\n //#endregion meta\n //#region change status\n bSequenceStarted() {\n return this.b_sequence_started;\n }\n /**\n * Start the sequence\n *\n */\n start() {\n if (!this.b_sequence_started) {\n this.b_sequence_started = true;\n this.start_time = this.paused_time;\n this.dispatch('timeline:change_status', Timeline.START);\n }\n }\n /**\n * Pause the sequence\n *\n */\n pause() {\n if (this.b_sequence_started) {\n this.paused_time = Utilities_1.now();\n this.b_sequence_started = false;\n this.dispatch('timeline:change_status', Timeline.PAUSE);\n }\n }\n /**\n * Stop the sequence and reset\n *\n */\n stop() {\n if (this.b_sequence_started) {\n this.b_sequence_started = false;\n this.currentTime = 0;\n this.currentFrame = 0;\n this.start_time = 0;\n this.paused_time = 0;\n this.dispatch('timeline:change_status', Timeline.STOP);\n }\n }\n /**\n * Animation tick\n *\n * @param {number} timestamp current timestamp\n * @returns {boolean}\n */\n tick(timestamp) {\n if (this.b_sequence_started) {\n if (!this.start_time) {\n this.start_time = timestamp;\n this.last_tick = -this.tick_time;\n }\n const currentTime = timestamp - this.start_time;\n const elapsed = currentTime - this.last_tick;\n if (elapsed >= this.tick_time) {\n this.calculateFPS(1 / (elapsed / 1000));\n this.last_tick = currentTime;\n this.currentTime = (currentTime - (elapsed % this.tick_time)) % this.sequence.duration;\n this.currentFrame = this.getFrameAtTime(this.currentTime);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n return true;\n }\n }\n return false;\n }\n /**\n * Calculate fps\n *\n * @private\n * @param {number} currentFPS\n */\n calculateFPS(currentFPS) {\n const samples = this.fps_samples.length;\n if (samples > 0) {\n let average = 0;\n for (let i = 0; i < samples; i++)\n average += this.fps_samples[i];\n this.fps = Math.round(average / samples);\n }\n this.fps_samples[this.fps_samples_index] = Math.round(currentFPS);\n this.fps_samples_index = (this.fps_samples_index + 1) % this.fps_samples_size;\n }\n //#endregion\n //#region Frame and Time\n /**\n * Return current animation frame\n *\n * @returns {number}\n */\n getCurrentFrame() {\n return this.currentFrame;\n }\n /**\n * get the time at specific frame number\n *\n * @param {number} frame\n * @returns {number}\n */\n getFrameTime(frame) {\n frame = math_1.mod(frame, this.sequence.frames);\n return (frame * this.tick_time) % this.sequence.duration;\n }\n /**\n * Return frame number at time\n *\n * @param {number} time\n * @returns {number}\n */\n getFrameAtTime(time) {\n return Math.round((time % this.sequence.duration) / this.tick_time);\n }\n /**\n * set current frame\n *\n * @param {number} frame\n */\n setFrame(frame) {\n this.currentFrame = math_1.mod(frame, this.sequence.frames);\n this.currentTime = this.getFrameTime(this.currentFrame);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n }\n /**\n * Return tick time (based on framerate)\n *\n * @returns {number}\n */\n getTickTime() {\n return this.tick_time;\n }\n /**\n * Return the current time\n *\n * @returns {number}\n */\n getTime() {\n return this.currentTime;\n }\n /**\n * Set animation at time\n *\n * @param {number} time\n */\n setTime(time) {\n time = math_1.mod(time, this.sequence.duration);\n this.currentTime = time;\n this.currentFrame = this.getFrameAtTime(time);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n }\n}\nexports.Timeline = Timeline;\n/**\n * Animation status started\n * @internal\n */\nTimeline.START = 'start';\n/**\n * Animation status paused\n * @internal\n */\nTimeline.PAUSE = 'pause';\n/**\n * Animation status stop\n * @internal\n */\nTimeline.STOP = 'stop';\n//# sourceMappingURL=Timeline.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fit = exports.bWorker = exports.bBrowser = exports.bNode = void 0;\nexports.bNode = typeof process !== 'undefined' &&\n typeof process.versions !== 'undefined' &&\n typeof process.versions.node !== 'undefined';\nexports.bBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';\nexports.bWorker = typeof self === 'object' && ['ServiceWorkerGlobalScope', 'DedicatedWorkerGlobalScope'].includes(self.constructor.name);\n/**\n * Utiltites\n *\n * @category Utilities\n * @export\n * @param {number} sourceWidth\n * @param {number} sourceHeight\n * @param {number} destWidth\n * @param {number} destHeight\n * @param {('cover' | 'contain' | 'none')} [fit='none']\n * @return {*} {{ x: number; y: number; width: number; height: number; scale: number }}\n */\nfunction fit(sourceWidth, sourceHeight, destWidth, destHeight, fit = 'none') {\n let x = 0, y = 0, scale = 1, finalWidth = sourceWidth, finalHeight = sourceHeight;\n const ratio = destWidth / destHeight;\n const sourceRatio = sourceWidth / sourceHeight;\n if (fit === 'contain') {\n finalWidth = ratio > sourceRatio ? (sourceWidth * destHeight) / sourceHeight : destWidth;\n finalHeight = ratio > sourceRatio ? destHeight : (sourceHeight * destWidth) / sourceWidth;\n scale = Math.max(finalWidth, finalHeight) / Math.max(sourceWidth, sourceHeight);\n }\n else if (fit === 'cover') {\n finalWidth = ratio < sourceRatio ? (sourceWidth * destHeight) / sourceHeight : destWidth;\n finalHeight = ratio < sourceRatio ? destHeight : (sourceHeight * destWidth) / sourceWidth;\n // scale = Math.min(sourceWidth, sourceHeight) / Math.min(finalWidth, finalHeight)\n scale = Math.max(finalWidth, finalHeight) / Math.max(sourceWidth, sourceHeight);\n }\n else {\n // finalWidth = sourceWidth\n // finalHeight = sourceHeight\n }\n x = (destWidth - finalWidth) / 2;\n y = (destHeight - finalHeight) / 2;\n return {\n x,\n y,\n width: finalWidth,\n height: finalHeight,\n scale,\n };\n}\nexports.fit = fit;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./Timeline\"), exports);\n__exportStar(require(\"./DrawerCanvas\"), exports);\n__exportStar(require(\"./browser/BrowserDrawerCanvas\"), exports);\n__exportStar(require(\"./Renderer\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Renderer = void 0;\nconst ffmpeg_1 = require(\"@ffmpeg/ffmpeg\");\nconst Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nconst JSZip = require(\"jszip\");\nconst browser_1 = require(\"./browser\");\nconst Emitter_1 = require(\"./Emitter\");\nconst utils_1 = require(\"./utils\");\n/**\n * The Renderer is a class for exporting the scene\n *\n * @category Renderer\n * @class Renderer\n * @extends {Emitter}\n */\nclass Renderer extends Emitter_1.Emitter {\n constructor(drawer, ffmpegCorePath) {\n super();\n this.drawer = drawer;\n this.ffmpegCorePath =\n typeof ffmpegCorePath === 'undefined' && drawer instanceof browser_1.default\n ? 'https://unpkg.com/@ffmpeg/core@0.10.0/dist/ffmpeg-core.js'\n : ffmpegCorePath;\n }\n /**\n * Render any frame and create array of zip\n *\n * @param imagesType\n * @param quality\n * @param framesForChunk\n * @returns\n */\n async zip(imagesType = 'image/png', quality = 1, framesForChunk = 600) {\n const startTime = Utilities_1.now();\n const zip = new JSZip();\n const totalFrames = this.drawer.timeline.getFramesCount();\n const chunks = Math.ceil(totalFrames / framesForChunk);\n this.dispatch('renderer:zip_start', { chunks, totalFrames, framesForChunk });\n const extension = imagesType === 'image/jpeg' ? '.jpg' : '.png';\n const zipParts = [];\n let totalRenderTime = 0;\n for (let chunk = 0, rendered = 1; chunk < chunks; chunk++) {\n for (let frameIndex = 0; frameIndex < framesForChunk; frameIndex++, rendered++) {\n const frame = frameIndex + chunk * framesForChunk;\n if (frame < totalFrames) {\n const renderStartTime = Utilities_1.now();\n const frameName = frame.toString().padStart(5, '0') + extension;\n const blob = await this.frame(frame, imagesType, quality);\n const buffer = (await (utils_1.bNode ? blob : blob.arrayBuffer()));\n zip.file(frameName, new Uint8Array(buffer, 0, buffer.byteLength));\n const currentTime = Utilities_1.now();\n const renderTime = currentTime - renderStartTime;\n totalRenderTime += renderTime;\n this.dispatch('renderer:zip_progress', {\n chunk: chunk + 1,\n frame: frame + 1,\n totalFrames,\n framesForChunk,\n totalChunks: chunks,\n renderTime,\n remainingTime: (totalFrames - rendered) * (totalRenderTime / rendered),\n elapsedTime: currentTime - startTime,\n });\n }\n }\n this.dispatch('renderer:zip_preparing');\n zipParts.push(await zip.generateAsync({ type: 'uint8array' }));\n }\n return zipParts;\n }\n /**\n * Render animation\n *\n * @param type render type\n * @param quality\n * @param ffmpegLogger\n * @param ffmpegProgress\n * @returns\n */\n async render(type = 'video/mp4', quality = 1, ffmpegLogger, ffmpegProgress) {\n const startTime = Utilities_1.now();\n const totalFrames = this.drawer.timeline.getFramesCount();\n const framerate = this.drawer.timeline.getFramerate();\n const duration = this.drawer.timeline.getDuration();\n this.dispatch('renderer:video_init', { totalFrames, framerate, duration, type });\n if (!this.ffmpeg) {\n const ffmpegOptions = {\n log: false,\n };\n if (this.ffmpegCorePath)\n ffmpegOptions.corePath = this.ffmpegCorePath;\n if (ffmpegLogger)\n ffmpegOptions.logger = ffmpegLogger;\n if (ffmpegProgress)\n ffmpegOptions.progress = ffmpegProgress;\n this.ffmpeg = ffmpeg_1.createFFmpeg(ffmpegOptions);\n await this.ffmpeg.load();\n }\n let totalRenderTime = 0;\n this.dispatch('renderer:video_start', { totalFrames, framerate, duration, type });\n for (let frame = 0; frame < totalFrames; frame++) {\n const renderStartTime = Utilities_1.now();\n const blob = await this.frame(frame, 'image/jpeg', quality);\n const buffer = (await (utils_1.bNode ? blob : blob.arrayBuffer()));\n const frameName = frame.toString().padStart(5, '0') + '.jpg';\n this.ffmpeg.FS('writeFile', frameName, new Uint8Array(buffer, 0, buffer.byteLength));\n const currentTime = Utilities_1.now();\n const renderTime = currentTime - renderStartTime;\n totalRenderTime += renderTime;\n this.dispatch('renderer:video_progress', {\n totalFrames,\n frame: frame + 1,\n renderTime,\n duration,\n remainingTime: (totalFrames - frame) * (totalRenderTime / (frame + 1)),\n elapsedTime: currentTime - startTime,\n });\n }\n const args = ['-r', framerate.toString(), '-i', '%05d.jpg'];\n let outExt = 'mp4';\n switch (type) {\n case 'video/webm':\n args.push('-c:v', 'libvpx');\n args.push('-row-mt', '1');\n args.push('-pix_fmt', 'yuv420p');\n outExt = 'webm';\n break;\n case 'video/mp4':\n args.push('-c:v', 'libx264');\n args.push('-pix_fmt', 'yuv420p');\n outExt = 'mp4';\n break;\n case 'gif':\n args.push('-loop', '0');\n outExt = 'gif';\n break;\n }\n const outName = 'out.' + outExt;\n args.push(outName);\n this.dispatch('renderer:video_preparing');\n await this.ffmpeg.run(...args);\n const result = await this.ffmpeg.FS('readFile', outName);\n return result;\n }\n /**\n * Render frame `frameNumber` to Blob or Buffer\n *\n * @param frameNumber frame to render\n * @param mime image type\n * @param options quality or options\n * @returns Promise of Blob for browser or Buffer for Node\n */\n frame(frameNumber, mime = 'image/png', options = 1) {\n if (!this.drawer.getOption('clear', true)) {\n for (let i = 0; i <= frameNumber; i++) {\n this.drawer.timeline.setFrame(i);\n this.drawer.draw();\n }\n }\n else {\n this.drawer.timeline.setFrame(frameNumber);\n this.drawer.draw();\n }\n return this.blobOrBuffer(mime, options);\n }\n /**\n * Render frame at time to Blob or Buffer\n *\n * @param time animation time\n * @param mime image type\n * @param options quality or options\n * @returns Promise of Blob for browser or Buffer for Node\n */\n frameAtTime(time, mime = 'image/png', options = 1) {\n return this.frame(this.drawer.timeline.getFrameAtTime(time), mime, options);\n }\n /**\n * Render frame number to DataUrl\n *\n * @param frameNumber frame to render\n * @param mime image type\n * @param options quality or options\n * @returns string image\n */\n frameToDataUrl(frameNumber, mime = 'image/png', options = 1) {\n if (!this.drawer.getOption('clear', true)) {\n for (let i = 0; i <= frameNumber; i++) {\n this.drawer.timeline.setFrame(i);\n this.drawer.draw();\n }\n }\n else {\n this.drawer.timeline.setFrame(frameNumber);\n this.drawer.draw();\n }\n return this.toDataUrl(mime, options);\n }\n /**\n * Render a frame at `time` to DataUrl\n *\n * @param time of animation\n * @param mime image type\n * @param options quality or options\n * @returns string image\n */\n frameAtTimeToDataUrl(time, mime = 'image/png', options = 1) {\n return this.frameToDataUrl(this.drawer.timeline.getFrameAtTime(time), mime, options);\n }\n /**\n * Canvas to DataURL\n *\n * @param mime\n * @param optionsOrQuality\n * @returns\n */\n toDataUrl(mime, optionsOrQuality = 1) {\n const canvas = this.drawer.getCanvas();\n if (canvas) {\n if (utils_1.bBrowser && canvas instanceof OffscreenCanvas) {\n console.warn('Cannot convert toDataURL in OffscreenCanvas');\n }\n else {\n return canvas.toDataURL(mime, optionsOrQuality);\n }\n }\n return null;\n }\n /**\n * Canvas to BoB\n *\n * @param mime\n * @param optionsOrQuality\n * @returns\n */\n blobOrBuffer(mime, optionsOrQuality = 1) {\n const canvas = this.drawer.getCanvas();\n if (canvas === null)\n throw new Error('Canvas not setted into Drawer');\n if (utils_1.bNode) {\n // TODO default node quality for jpeg and png\n switch (mime) {\n case 'image/png': {\n const pngConf = typeof optionsOrQuality === 'number'\n ? {\n compressionLevel: (9 - Utilities_1.clamp(0, 1, optionsOrQuality) * 9),\n }\n : optionsOrQuality;\n return Promise.resolve(canvas.toBuffer(mime, pngConf));\n }\n case 'image/jpeg': {\n const jpegConf = typeof optionsOrQuality === 'number'\n ? {\n quality: optionsOrQuality,\n }\n : optionsOrQuality;\n return Promise.resolve(canvas.toBuffer(mime, jpegConf));\n }\n }\n }\n if (canvas instanceof OffscreenCanvas) {\n return canvas.convertToBlob({ type: mime, quality: typeof optionsOrQuality === 'number' ? optionsOrQuality : 1 });\n }\n return new Promise(resolve => {\n ;\n canvas.toBlob(blob => {\n if (blob)\n resolve(blob);\n else\n throw new Error('Blob error');\n }, mime, typeof optionsOrQuality === 'number' ? optionsOrQuality : 1);\n });\n }\n}\nexports.Renderer = Renderer;\n//# sourceMappingURL=Renderer.js.map","require('regenerator-runtime/runtime');\nconst createFFmpeg = require('./createFFmpeg');\nconst { fetchFile } = require('./node');\n\nmodule.exports = {\n /*\n * Create ffmpeg instance.\n * Each ffmpeg instance owns an isolated MEMFS and works\n * independently.\n *\n * For example:\n *\n * ```\n * const ffmpeg = createFFmpeg({\n * log: true,\n * logger: () => {},\n * progress: () => {},\n * corePath: '',\n * })\n * ```\n *\n * For the usage of these four arguments, check config.js\n *\n */\n createFFmpeg,\n /*\n * Helper function for fetching files from various resource.\n * Sometimes the video/audio file you want to process may located\n * in a remote URL and somewhere in your local file system.\n *\n * This helper function helps you to fetch to file and return an\n * Uint8Array variable for ffmpeg.wasm to consume.\n *\n */\n fetchFile,\n};\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","const { defaultArgs, baseOptions } = require('./config');\nconst { setLogging, setCustomLogger, log } = require('./utils/log');\nconst parseProgress = require('./utils/parseProgress');\nconst parseArgs = require('./utils/parseArgs');\nconst { defaultOptions, getCreateFFmpegCore } = require('./node');\nconst { version } = require('../package.json');\n\nconst NO_LOAD = Error('ffmpeg.wasm is not ready, make sure you have completed load().');\n\nmodule.exports = (_options = {}) => {\n const {\n log: logging,\n logger,\n progress: optProgress,\n ...options\n } = {\n ...baseOptions,\n ...defaultOptions,\n ..._options,\n };\n let Core = null;\n let ffmpeg = null;\n let runResolve = null;\n let running = false;\n let progress = optProgress;\n const detectCompletion = (message) => {\n if (message === 'FFMPEG_END' && runResolve !== null) {\n runResolve();\n runResolve = null;\n running = false;\n }\n };\n const parseMessage = ({ type, message }) => {\n log(type, message);\n parseProgress(message, progress);\n detectCompletion(message);\n };\n\n /*\n * Load ffmpeg.wasm-core script.\n * In browser environment, the ffmpeg.wasm-core script is fetch from\n * CDN and can be assign to a local path by assigning `corePath`.\n * In node environment, we use dynamic require and the default `corePath`\n * is `$ffmpeg/core`.\n *\n * Typically the load() func might take few seconds to minutes to complete,\n * better to do it as early as possible.\n *\n */\n const load = async () => {\n log('info', 'load ffmpeg-core');\n if (Core === null) {\n log('info', 'loading ffmpeg-core');\n /*\n * In node environment, all paths are undefined as there\n * is no need to set them.\n */\n const {\n createFFmpegCore,\n corePath,\n workerPath,\n wasmPath,\n } = await getCreateFFmpegCore(options);\n Core = await createFFmpegCore({\n /*\n * Assign mainScriptUrlOrBlob fixes chrome extension web worker issue\n * as there is no document.currentScript in the context of content_scripts\n */\n mainScriptUrlOrBlob: corePath,\n printErr: (message) => parseMessage({ type: 'fferr', message }),\n print: (message) => parseMessage({ type: 'ffout', message }),\n /*\n * locateFile overrides paths of files that is loaded by main script (ffmpeg-core.js).\n * It is critical for browser environment and we override both wasm and worker paths\n * as we are using blob URL instead of original URL to avoid cross origin issues.\n */\n locateFile: (path, prefix) => {\n if (typeof window !== 'undefined') {\n if (typeof wasmPath !== 'undefined'\n && path.endsWith('ffmpeg-core.wasm')) {\n return wasmPath;\n }\n if (typeof workerPath !== 'undefined'\n && path.endsWith('ffmpeg-core.worker.js')) {\n return workerPath;\n }\n }\n return prefix + path;\n },\n });\n ffmpeg = Core.cwrap('proxy_main', 'number', ['number', 'number']);\n log('info', 'ffmpeg-core loaded');\n } else {\n throw Error('ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.');\n }\n };\n\n /*\n * Determine whether the Core is loaded.\n */\n const isLoaded = () => Core !== null;\n\n /*\n * Run ffmpeg command.\n * This is the major function in ffmpeg.wasm, you can just imagine it\n * as ffmpeg native cli and what you need to pass is the same.\n *\n * For example, you can convert native command below:\n *\n * ```\n * $ ffmpeg -i video.avi -c:v libx264 video.mp4\n * ```\n *\n * To\n *\n * ```\n * await ffmpeg.run('-i', 'video.avi', '-c:v', 'libx264', 'video.mp4');\n * ```\n *\n */\n const run = (..._args) => {\n log('info', `run ffmpeg command: ${_args.join(' ')}`);\n if (Core === null) {\n throw NO_LOAD;\n } else if (running) {\n throw Error('ffmpeg.wasm can only run one command at a time');\n } else {\n running = true;\n return new Promise((resolve) => {\n const args = [...defaultArgs, ..._args].filter((s) => s.length !== 0);\n runResolve = resolve;\n ffmpeg(...parseArgs(Core, args));\n });\n }\n };\n\n /*\n * Run FS operations.\n * For input/output file of ffmpeg.wasm, it is required to save them to MEMFS\n * first so that ffmpeg.wasm is able to consume them. Here we rely on the FS\n * methods provided by Emscripten.\n *\n * Common methods to use are:\n * ffmpeg.FS('writeFile', 'video.avi', new Uint8Array(...)): writeFile writes\n * data to MEMFS. You need to use Uint8Array for binary data.\n * ffmpeg.FS('readFile', 'video.mp4'): readFile from MEMFS.\n * ffmpeg.FS('unlink', 'video.map'): delete file from MEMFS.\n *\n * For more info, check https://emscripten.org/docs/api_reference/Filesystem-API.html\n *\n */\n const FS = (method, ...args) => {\n log('info', `run FS.${method} ${args.map((arg) => (typeof arg === 'string' ? arg : `<${arg.length} bytes binary file>`)).join(' ')}`);\n if (Core === null) {\n throw NO_LOAD;\n } else {\n let ret = null;\n try {\n ret = Core.FS[method](...args);\n } catch (e) {\n if (method === 'readdir') {\n throw Error(`ffmpeg.FS('readdir', '${args[0]}') error. Check if the path exists, ex: ffmpeg.FS('readdir', '/')`);\n } else if (method === 'readFile') {\n throw Error(`ffmpeg.FS('readFile', '${args[0]}') error. Check if the path exists`);\n } else {\n throw Error('Oops, something went wrong in FS operation.');\n }\n }\n return ret;\n }\n };\n\n /**\n * forcibly terminate the ffmpeg program.\n */\n const exit = () => {\n if (Core === null) {\n throw NO_LOAD;\n } else {\n running = false;\n Core.exit(1);\n Core = null;\n ffmpeg = null;\n runResolve = null;\n }\n };\n\n const setProgress = (_progress) => {\n progress = _progress;\n };\n\n const setLogger = (_logger) => {\n setCustomLogger(_logger);\n };\n\n setLogging(logging);\n setCustomLogger(logger);\n\n log('info', `use ffmpeg.wasm v${version}`);\n\n return {\n setProgress,\n setLogger,\n setLogging,\n load,\n isLoaded,\n run,\n exit,\n FS,\n };\n};\n","module.exports = {\n defaultArgs: [\n /* args[0] is always the binary path */\n './ffmpeg',\n /* Disable interaction mode */\n '-nostdin',\n /* Force to override output file */\n '-y',\n ],\n baseOptions: {\n /* Flag to turn on/off log messages in console */\n log: false,\n /*\n * Custom logger to get ffmpeg.wasm output messages.\n * a sample logger looks like this:\n *\n * ```\n * logger = ({ type, message }) => {\n * console.log(type, message);\n * }\n * ```\n *\n * type can be one of following:\n *\n * info: internal workflow debug messages\n * fferr: ffmpeg native stderr output\n * ffout: ffmpeg native stdout output\n */\n logger: () => {},\n /*\n * Progress handler to get current progress of ffmpeg command.\n * a sample progress handler looks like this:\n *\n * ```\n * progress = ({ ratio }) => {\n * console.log(ratio);\n * }\n * ```\n *\n * ratio is a float number between 0 to 1.\n */\n progress: () => {},\n /*\n * Path to find/download ffmpeg.wasm-core,\n * this value should be overwriten by `defaultOptions` in\n * each environment.\n */\n corePath: '',\n },\n};\n","let logging = false;\nlet customLogger = () => {};\n\nconst setLogging = (_logging) => {\n logging = _logging;\n};\n\nconst setCustomLogger = (logger) => {\n customLogger = logger;\n};\n\nconst log = (type, message) => {\n customLogger({ type, message });\n if (logging) {\n console.log(`[${type}] ${message}`);\n }\n};\n\nmodule.exports = {\n logging,\n setLogging,\n setCustomLogger,\n log,\n};\n","let duration = 0;\nlet ratio = 0;\n\nconst ts2sec = (ts) => {\n const [h, m, s] = ts.split(':');\n return (parseFloat(h) * 60 * 60) + (parseFloat(m) * 60) + parseFloat(s);\n};\n\nmodule.exports = (message, progress) => {\n if (typeof message === 'string') {\n if (message.startsWith(' Duration')) {\n const ts = message.split(', ')[0].split(': ')[1];\n const d = ts2sec(ts);\n progress({ duration: d, ratio });\n if (duration === 0 || duration > d) {\n duration = d;\n }\n } else if (message.startsWith('frame') || message.startsWith('size')) {\n const ts = message.split('time=')[1].split(' ')[0];\n const t = ts2sec(ts);\n ratio = t / duration;\n progress({ ratio, time: t });\n } else if (message.startsWith('video:')) {\n progress({ ratio: 1 });\n duration = 0;\n }\n }\n};\n","module.exports = (Core, args) => {\n const argsPtr = Core._malloc(args.length * Uint32Array.BYTES_PER_ELEMENT);\n args.forEach((s, idx) => {\n const buf = Core._malloc(s.length + 1);\n Core.writeAsciiToMemory(s, buf);\n Core.setValue(argsPtr + (Uint32Array.BYTES_PER_ELEMENT * idx), buf, 'i32');\n });\n return [args.length, argsPtr];\n};\n","const defaultOptions = require('./defaultOptions');\nconst getCreateFFmpegCore = require('./getCreateFFmpegCore');\nconst fetchFile = require('./fetchFile');\n\nmodule.exports = {\n defaultOptions,\n getCreateFFmpegCore,\n fetchFile,\n};\n","const resolveURL = require('resolve-url');\nconst { devDependencies } = require('../../package.json');\n\n/*\n * Default options for browser environment\n */\nmodule.exports = {\n corePath: process.env.NODE_ENV === 'development'\n ? resolveURL('/node_modules/@ffmpeg/core/dist/ffmpeg-core.js')\n : `https://unpkg.com/@ffmpeg/core@${devDependencies['@ffmpeg/core'].substring(1)}/dist/ffmpeg-core.js`,\n};\n","// Copyright 2014 Simon Lydell\r\n// X11 (“MIT”) Licensed. (See LICENSE.)\r\n\r\nvoid (function(root, factory) {\r\n if (typeof define === \"function\" && define.amd) {\r\n define(factory)\r\n } else if (typeof exports === \"object\") {\r\n module.exports = factory()\r\n } else {\r\n root.resolveUrl = factory()\r\n }\r\n}(this, function() {\r\n\r\n function resolveUrl(/* ...urls */) {\r\n var numUrls = arguments.length\r\n\r\n if (numUrls === 0) {\r\n throw new Error(\"resolveUrl requires at least one argument; got none.\")\r\n }\r\n\r\n var base = document.createElement(\"base\")\r\n base.href = arguments[0]\r\n\r\n if (numUrls === 1) {\r\n return base.href\r\n }\r\n\r\n var head = document.getElementsByTagName(\"head\")[0]\r\n head.insertBefore(base, head.firstChild)\r\n\r\n var a = document.createElement(\"a\")\r\n var resolved\r\n\r\n for (var index = 1; index < numUrls; index++) {\r\n a.href = arguments[index]\r\n resolved = a.href\r\n base.href = resolved\r\n }\r\n\r\n head.removeChild(base)\r\n\r\n return resolved\r\n }\r\n\r\n return resolveUrl\r\n\r\n}));\r\n","/* eslint-disable no-undef */\nconst resolveURL = require('resolve-url');\nconst { log } = require('../utils/log');\n\n/*\n * Fetch data from remote URL and convert to blob URL\n * to avoid CORS issue\n */\nconst toBlobURL = async (url, mimeType) => {\n log('info', `fetch ${url}`);\n const buf = await (await fetch(url)).arrayBuffer();\n log('info', `${url} file size = ${buf.byteLength} bytes`);\n const blob = new Blob([buf], { type: mimeType });\n const blobURL = URL.createObjectURL(blob);\n log('info', `${url} blob URL = ${blobURL}`);\n return blobURL;\n};\n\nmodule.exports = async ({ corePath: _corePath }) => {\n if (typeof _corePath !== 'string') {\n throw Error('corePath should be a string!');\n }\n const coreRemotePath = resolveURL(_corePath);\n const corePath = await toBlobURL(\n coreRemotePath,\n 'application/javascript',\n );\n const wasmPath = await toBlobURL(\n coreRemotePath.replace('ffmpeg-core.js', 'ffmpeg-core.wasm'),\n 'application/wasm',\n );\n const workerPath = await toBlobURL(\n coreRemotePath.replace('ffmpeg-core.js', 'ffmpeg-core.worker.js'),\n 'application/javascript',\n );\n if (typeof createFFmpegCore === 'undefined') {\n return new Promise((resolve) => {\n const script = document.createElement('script');\n const eventHandler = () => {\n script.removeEventListener('load', eventHandler);\n log('info', 'ffmpeg-core.js script loaded');\n resolve({\n createFFmpegCore,\n corePath,\n wasmPath,\n workerPath,\n });\n };\n script.src = corePath;\n script.type = 'text/javascript';\n script.addEventListener('load', eventHandler);\n document.getElementsByTagName('head')[0].appendChild(script);\n });\n }\n log('info', 'ffmpeg-core.js script is loaded already');\n return Promise.resolve({\n createFFmpegCore,\n corePath,\n wasmPath,\n workerPath,\n });\n};\n","const resolveURL = require('resolve-url');\n\nconst readFromBlobOrFile = (blob) => (\n new Promise((resolve, reject) => {\n const fileReader = new FileReader();\n fileReader.onload = () => {\n resolve(fileReader.result);\n };\n fileReader.onerror = ({ target: { error: { code } } }) => {\n reject(Error(`File could not be read! Code=${code}`));\n };\n fileReader.readAsArrayBuffer(blob);\n })\n);\n\nmodule.exports = async (_data) => {\n let data = _data;\n if (typeof _data === 'undefined') {\n return new Uint8Array();\n }\n\n if (typeof _data === 'string') {\n /* From base64 format */\n if (/data:_data\\/([a-zA-Z]*);base64,([^\"]*)/.test(_data)) {\n data = atob(_data.split(',')[1])\n .split('')\n .map((c) => c.charCodeAt(0));\n /* From remote server/URL */\n } else {\n const res = await fetch(resolveURL(_data));\n data = await res.arrayBuffer();\n }\n /* From Blob or File */\n } else if (_data instanceof File || _data instanceof Blob) {\n data = await readFromBlobOrFile(_data);\n }\n\n return new Uint8Array(data);\n};\n","/*!\n\nJSZip v3.7.0 - A JavaScript class for generating and reading zip files\n\n\n(c) 2009-2016 Stuart Knightley \nDual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.\n\nJSZip uses the library pako released under the MIT license :\nhttps://github.com/nodeca/pako/blob/master/LICENSE\n*/\n\n!function(e){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=e();else if(\"function\"==typeof define&&define.amd)define([],e);else{(\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:this).JSZip=e()}}(function(){return function s(o,a,f){function u(r,e){if(!a[r]){if(!o[r]){var t=\"function\"==typeof require&&require;if(!e&&t)return t(r,!0);if(d)return d(r,!0);var n=new Error(\"Cannot find module '\"+r+\"'\");throw n.code=\"MODULE_NOT_FOUND\",n}var i=a[r]={exports:{}};o[r][0].call(i.exports,function(e){var t=o[r][1][e];return u(t||e)},i,i.exports,s,o,a,f)}return a[r].exports}for(var d=\"function\"==typeof require&&require,e=0;e>2,s=(3&t)<<4|r>>4,o=1>6:64,a=2>4,r=(15&i)<<4|(s=p.indexOf(e.charAt(a++)))>>2,n=(3&s)<<6|(o=p.indexOf(e.charAt(a++))),u[f++]=t,64!==s&&(u[f++]=r),64!==o&&(u[f++]=n);return u}},{\"./support\":30,\"./utils\":32}],2:[function(e,t,r){\"use strict\";var n=e(\"./external\"),i=e(\"./stream/DataWorker\"),s=e(\"./stream/Crc32Probe\"),o=e(\"./stream/DataLengthProbe\");function a(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}a.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o(\"data_length\")),t=this;return e.on(\"end\",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error(\"Bug : uncompressed data size mismatch\")}),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo(\"compressedSize\",this.compressedSize).withStreamInfo(\"uncompressedSize\",this.uncompressedSize).withStreamInfo(\"crc32\",this.crc32).withStreamInfo(\"compression\",this.compression)}},a.createWorkerFrom=function(e,t,r){return e.pipe(new s).pipe(new o(\"uncompressedSize\")).pipe(t.compressWorker(r)).pipe(new o(\"compressedSize\")).withStreamInfo(\"compression\",t)},t.exports=a},{\"./external\":6,\"./stream/Crc32Probe\":25,\"./stream/DataLengthProbe\":26,\"./stream/DataWorker\":27}],3:[function(e,t,r){\"use strict\";var n=e(\"./stream/GenericWorker\");r.STORE={magic:\"\\0\\0\",compressWorker:function(e){return new n(\"STORE compression\")},uncompressWorker:function(){return new n(\"STORE decompression\")}},r.DEFLATE=e(\"./flate\")},{\"./flate\":7,\"./stream/GenericWorker\":28}],4:[function(e,t,r){\"use strict\";var n=e(\"./utils\"),o=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?\"string\"!==n.getTypeOf(e)?function(e,t,r){var n=o,i=0+r;e^=-1;for(var s=0;s>>8^n[255&(e^t[s])];return-1^e}(0|t,e,e.length):function(e,t,r){var n=o,i=0+r;e^=-1;for(var s=0;s>>8^n[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length):0}},{\"./utils\":32}],5:[function(e,t,r){\"use strict\";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){\"use strict\";var n;n=\"undefined\"!=typeof Promise?Promise:e(\"lie\"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,r){\"use strict\";var n=\"undefined\"!=typeof Uint8Array&&\"undefined\"!=typeof Uint16Array&&\"undefined\"!=typeof Uint32Array,i=e(\"pako\"),s=e(\"./utils\"),o=e(\"./stream/GenericWorker\"),a=n?\"uint8array\":\"array\";function f(e,t){o.call(this,\"FlateWorker/\"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}r.magic=\"\\b\\0\",s.inherits(f,o),f.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,e.data),!1)},f.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},f.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},f.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(e){return new f(\"Deflate\",e)},r.uncompressWorker=function(){return new f(\"Inflate\",{})}},{\"./stream/GenericWorker\":28,\"./utils\":32,pako:38}],8:[function(e,t,r){\"use strict\";function O(e,t){var r,n=\"\";for(r=0;r>>=8;return n}function i(e,t,r,n,i,s){var o,a,f=e.file,u=e.compression,d=s!==D.utf8encode,h=I.transformTo(\"string\",s(f.name)),l=I.transformTo(\"string\",D.utf8encode(f.name)),c=f.comment,p=I.transformTo(\"string\",s(c)),m=I.transformTo(\"string\",D.utf8encode(c)),_=l.length!==f.name.length,w=m.length!==c.length,v=\"\",g=\"\",y=\"\",b=f.dir,k=f.date,x={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(x.crc32=e.crc32,x.compressedSize=e.compressedSize,x.uncompressedSize=e.uncompressedSize);var S=0;t&&(S|=8),d||!_&&!w||(S|=2048);var E,z=0,C=0;b&&(z|=16),\"UNIX\"===i?(C=798,z|=((E=f.unixPermissions)||(E=b?16893:33204),(65535&E)<<16)):(C=20,z|=63&(f.dosPermissions||0)),o=k.getUTCHours(),o<<=6,o|=k.getUTCMinutes(),o<<=5,o|=k.getUTCSeconds()/2,a=k.getUTCFullYear()-1980,a<<=4,a|=k.getUTCMonth()+1,a<<=5,a|=k.getUTCDate(),_&&(v+=\"up\"+O((g=O(1,1)+O(B(h),4)+l).length,2)+g),w&&(v+=\"uc\"+O((y=O(1,1)+O(B(p),4)+m).length,2)+y);var A=\"\";return A+=\"\\n\\0\",A+=O(S,2),A+=u.magic,A+=O(o,2),A+=O(a,2),A+=O(x.crc32,4),A+=O(x.compressedSize,4),A+=O(x.uncompressedSize,4),A+=O(h.length,2),A+=O(v.length,2),{fileRecord:T.LOCAL_FILE_HEADER+A+h+v,dirRecord:T.CENTRAL_FILE_HEADER+O(C,2)+A+O(p.length,2)+\"\\0\\0\\0\\0\"+O(z,4)+O(n,4)+h+v+p}}var I=e(\"../utils\"),s=e(\"../stream/GenericWorker\"),D=e(\"../utf8\"),B=e(\"../crc32\"),T=e(\"../signature\");function n(e,t,r,n){s.call(this,\"ZipFileWorker\"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}I.inherits(n,s),n.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,s.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},n.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},n.prototype.closedSource=function(e){this.accumulate=!1;var t,r=this.streamFiles&&!e.file.dir,n=i(e,r,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),r)this.push({data:(t=e,T.DATA_DESCRIPTOR+O(t.crc32,4)+O(t.compressedSize,4)+O(t.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},n.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo(\"string\",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{\"../utils\":32}],19:[function(e,t,r){\"use strict\";var n=e(\"./Uint8ArrayReader\");function i(e){n.call(this,e)}e(\"../utils\").inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{\"../utils\":32,\"./Uint8ArrayReader\":21}],20:[function(e,t,r){\"use strict\";var n=e(\"./DataReader\");function i(e){n.call(this,e)}e(\"../utils\").inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{\"../utils\":32,\"./DataReader\":18}],21:[function(e,t,r){\"use strict\";var n=e(\"./ArrayReader\");function i(e){n.call(this,e)}e(\"../utils\").inherits(i,n),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{\"../utils\":32,\"./ArrayReader\":17}],22:[function(e,t,r){\"use strict\";var n=e(\"../utils\"),i=e(\"../support\"),s=e(\"./ArrayReader\"),o=e(\"./StringReader\"),a=e(\"./NodeBufferReader\"),f=e(\"./Uint8ArrayReader\");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),\"string\"!==t||i.uint8array?\"nodebuffer\"===t?new a(e):i.uint8array?new f(n.transformTo(\"uint8array\",e)):new s(n.transformTo(\"array\",e)):new o(e)}},{\"../support\":30,\"../utils\":32,\"./ArrayReader\":17,\"./NodeBufferReader\":19,\"./StringReader\":20,\"./Uint8ArrayReader\":21}],23:[function(e,t,r){\"use strict\";r.LOCAL_FILE_HEADER=\"PK\u0003\u0004\",r.CENTRAL_FILE_HEADER=\"PK\u0001\u0002\",r.CENTRAL_DIRECTORY_END=\"PK\u0005\u0006\",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR=\"PK\u0006\u0007\",r.ZIP64_CENTRAL_DIRECTORY_END=\"PK\u0006\u0006\",r.DATA_DESCRIPTOR=\"PK\u0007\\b\"},{}],24:[function(e,t,r){\"use strict\";var n=e(\"./GenericWorker\"),i=e(\"../utils\");function s(e){n.call(this,\"ConvertWorker to \"+e),this.destType=e}i.inherits(s,n),s.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],25:[function(e,t,r){\"use strict\";var n=e(\"./GenericWorker\"),i=e(\"../crc32\");function s(){n.call(this,\"Crc32Probe\"),this.withStreamInfo(\"crc32\",0)}e(\"../utils\").inherits(s,n),s.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=s},{\"../crc32\":4,\"../utils\":32,\"./GenericWorker\":28}],26:[function(e,t,r){\"use strict\";var n=e(\"../utils\"),i=e(\"./GenericWorker\");function s(e){i.call(this,\"DataLengthProbe for \"+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(s,i),s.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],27:[function(e,t,r){\"use strict\";var n=e(\"../utils\"),i=e(\"./GenericWorker\");function s(e){i.call(this,\"DataWorker\");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=\"\",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}n.inherits(s,i),s.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case\"string\":e=this.data.substring(this.index,t);break;case\"uint8array\":e=this.data.subarray(this.index,t);break;case\"array\":case\"nodebuffer\":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],28:[function(e,t,r){\"use strict\";function n(e){this.name=e||\"default\",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit(\"data\",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit(\"end\"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit(\"error\",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit(\"error\",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r \"+e:e}},t.exports=n},{}],29:[function(e,t,r){\"use strict\";var u=e(\"../utils\"),i=e(\"./ConvertWorker\"),s=e(\"./GenericWorker\"),d=e(\"../base64\"),n=e(\"../support\"),o=e(\"../external\"),a=null;if(n.nodestream)try{a=e(\"../nodejs/NodejsStreamOutputAdapter\")}catch(e){}function f(e,t,r){var n=t;switch(t){case\"blob\":case\"arraybuffer\":n=\"uint8array\";break;case\"base64\":n=\"string\"}try{this._internalType=n,this._outputType=t,this._mimeType=r,u.checkSupport(n),this._worker=e.pipe(new i(n)),e.lock()}catch(e){this._worker=new s(\"error\"),this._worker.error(e)}}f.prototype={accumulate:function(e){return a=this,f=e,new o.Promise(function(t,r){var n=[],i=a._internalType,s=a._outputType,o=a._mimeType;a.on(\"data\",function(e,t){n.push(e),f&&f(t)}).on(\"error\",function(e){n=[],r(e)}).on(\"end\",function(){try{var e=function(e,t,r){switch(e){case\"blob\":return u.newBlob(u.transformTo(\"arraybuffer\",t),r);case\"base64\":return d.encode(t);default:return u.transformTo(e,t)}}(s,function(e,t){var r,n=0,i=null,s=0;for(r=0;r>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t}(e)},s.utf8decode=function(e){return f.nodebuffer?a.transformTo(\"nodebuffer\",e).toString(\"utf-8\"):function(e){var t,r,n,i,s=e.length,o=new Array(2*s);for(t=r=0;t>10&1023,o[r++]=56320|1023&n)}return o.length!==r&&(o.subarray?o=o.subarray(0,r):o.length=r),a.applyFromCharCode(o)}(e=a.transformTo(f.uint8array?\"uint8array\":\"array\",e))},a.inherits(o,n),o.prototype.processChunk=function(e){var t=a.transformTo(f.uint8array?\"uint8array\":\"array\",e.data);if(this.leftOver&&this.leftOver.length){if(f.uint8array){var r=t;(t=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),t.set(r,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var n=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+u[e[r]]>t?r:t}(t),i=t;n!==t.length&&(f.uint8array?(i=t.subarray(0,n),this.leftOver=t.subarray(n,t.length)):(i=t.slice(0,n),this.leftOver=t.slice(n,t.length))),this.push({data:s.utf8decode(i),meta:e.meta})},o.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=o,a.inherits(d,n),d.prototype.processChunk=function(e){this.push({data:s.utf8encode(e.data),meta:e.meta})},s.Utf8EncodeWorker=d},{\"./nodejsUtils\":14,\"./stream/GenericWorker\":28,\"./support\":30,\"./utils\":32}],32:[function(e,t,a){\"use strict\";var f=e(\"./support\"),u=e(\"./base64\"),r=e(\"./nodejsUtils\"),n=e(\"set-immediate-shim\"),d=e(\"./external\");function i(e){return e}function h(e,t){for(var r=0;r>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||\"/\"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=n(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t},r.buf2binstring=function(e){return d(e,e.length)},r.binstring2buf=function(e){for(var t=new f.Buf8(e.length),r=0,n=t.length;r>10&1023,a[n++]=56320|1023&i)}return d(a,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+u[e[r]]>t?r:t}},{\"./common\":41}],43:[function(e,t,r){\"use strict\";t.exports=function(e,t,r,n){for(var i=65535&e|0,s=e>>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,n){var i=a,s=n+r;e^=-1;for(var o=n;o>>8^i[255&(e^t[o])];return-1^e}},{}],46:[function(e,t,r){\"use strict\";var f,l=e(\"../utils/common\"),u=e(\"./trees\"),c=e(\"./adler32\"),p=e(\"./crc32\"),n=e(\"./messages\"),d=0,h=0,m=-2,i=2,_=8,s=286,o=30,a=19,w=2*s+1,v=15,g=3,y=258,b=y+g+1,k=42,x=113;function S(e,t){return e.msg=n[t],t}function E(e){return(e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(l.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function A(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,C(e.strm)}function O(e,t){e.pending_buf[e.pending++]=t}function I(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function D(e,t){var r,n,i=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match,f=e.strstart>e.w_size-b?e.strstart-(e.w_size-b):0,u=e.window,d=e.w_mask,h=e.prev,l=e.strstart+y,c=u[s+o-1],p=u[s+o];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(u[(r=t)+o]===p&&u[r+o-1]===c&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do{}while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&sf&&0!=--i);return o<=e.lookahead?o:e.lookahead}function B(e){var t,r,n,i,s,o,a,f,u,d,h=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=h+(h-b)){for(l.arraySet(e.window,e.window,h,h,0),e.match_start-=h,e.strstart-=h,e.block_start-=h,t=r=e.hash_size;n=e.head[--t],e.head[t]=h<=n?n-h:0,--r;);for(t=r=h;n=e.prev[--t],e.prev[t]=h<=n?n-h:0,--r;);i+=h}if(0===e.strm.avail_in)break;if(o=e.strm,a=e.window,f=e.strstart+e.lookahead,d=void 0,(u=i)<(d=o.avail_in)&&(d=u),r=0===d?0:(o.avail_in-=d,l.arraySet(a,o.input,o.next_in,d,f),1===o.state.wrap?o.adler=c(o.adler,a,d,f):2===o.state.wrap&&(o.adler=p(o.adler,a,d,f)),o.next_in+=d,o.total_in+=d,d),e.lookahead+=r,e.lookahead+e.insert>=g)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<=g&&(e.ins_h=(e.ins_h<=g)if(n=u._tr_tally(e,e.strstart-e.match_start,e.match_length-g),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=g){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=g&&(e.ins_h=(e.ins_h<=g&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-g,n=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-g),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(B(e),0===e.lookahead&&t===d)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,A(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-b&&(A(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(A(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(A(e,!1),e.strm.avail_out),1)}),new F(4,4,8,4,T),new F(4,5,16,8,T),new F(4,6,32,32,T),new F(4,4,16,16,R),new F(8,16,32,32,R),new F(8,16,128,128,R),new F(8,32,128,256,R),new F(32,128,258,1024,R),new F(32,258,258,4096,R)],r.deflateInit=function(e,t){return P(e,t,_,15,8,0)},r.deflateInit2=P,r.deflateReset=L,r.deflateResetKeep=U,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?m:(e.state.gzhead=t,h):m},r.deflate=function(e,t){var r,n,i,s;if(!e||!e.state||5>8&255),O(n,n.gzhead.time>>16&255),O(n,n.gzhead.time>>24&255),O(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),O(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(O(n,255&n.gzhead.extra.length),O(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=p(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(O(n,0),O(n,0),O(n,0),O(n,0),O(n,0),O(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),O(n,3),n.status=x);else{var o=_+(n.w_bits-8<<4)<<8;o|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(o|=32),o+=31-o%31,n.status=x,I(n,o),0!==n.strstart&&(I(n,e.adler>>>16),I(n,65535&e.adler)),e.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),C(e),i=n.pending,n.pending!==n.pending_buf_size));)O(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),C(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindexi&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),C(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindexi&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&C(e),n.pending+2<=n.pending_buf_size&&(O(n,255&e.adler),O(n,e.adler>>8&255),e.adler=0,n.status=x)):n.status=x),0!==n.pending){if(C(e),0===e.avail_out)return n.last_flush=-1,h}else if(0===e.avail_in&&E(t)<=E(r)&&4!==t)return S(e,-5);if(666===n.status&&0!==e.avail_in)return S(e,-5);if(0!==e.avail_in||0!==n.lookahead||t!==d&&666!==n.status){var a=2===n.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(B(e),0===e.lookahead)){if(t===d)return 1;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(A(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(A(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(A(e,!1),0===e.strm.avail_out)?1:2}(n,t):3===n.strategy?function(e,t){for(var r,n,i,s,o=e.window;;){if(e.lookahead<=y){if(B(e),e.lookahead<=y&&t===d)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=g&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=g?(r=u._tr_tally(e,1,e.match_length-g),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(A(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(A(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(A(e,!1),0===e.strm.avail_out)?1:2}(n,t):f[n.level].func(n,t);if(3!==a&&4!==a||(n.status=666),1===a||3===a)return 0===e.avail_out&&(n.last_flush=-1),h;if(2===a&&(1===t?u._tr_align(n):5!==t&&(u._tr_stored_block(n,0,0,!1),3===t&&(z(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),C(e),0===e.avail_out))return n.last_flush=-1,h}return 4!==t?h:n.wrap<=0?1:(2===n.wrap?(O(n,255&e.adler),O(n,e.adler>>8&255),O(n,e.adler>>16&255),O(n,e.adler>>24&255),O(n,255&e.total_in),O(n,e.total_in>>8&255),O(n,e.total_in>>16&255),O(n,e.total_in>>24&255)):(I(n,e.adler>>>16),I(n,65535&e.adler)),C(e),0=r.w_size&&(0===s&&(z(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new l.Buf8(r.w_size),l.arraySet(u,t,d-r.w_size,r.w_size,0),t=u,d=r.w_size),o=e.avail_in,a=e.next_in,f=e.input,e.avail_in=d,e.next_in=0,e.input=t,B(r);r.lookahead>=g;){for(n=r.strstart,i=r.lookahead-(g-1);r.ins_h=(r.ins_h<>>=y=g>>>24,p-=y,0==(y=g>>>16&255))z[s++]=65535&g;else{if(!(16&y)){if(0==(64&y)){g=m[(65535&g)+(c&(1<>>=y,p-=y),p<15&&(c+=E[n++]<>>=y=g>>>24,p-=y,!(16&(y=g>>>16&255))){if(0==(64&y)){g=_[(65535&g)+(c&(1<>>=y,p-=y,(y=s-o)>3,c&=(1<<(p-=b<<3))-1,e.next_in=n,e.next_out=s,e.avail_in=n>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function s(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new O.Buf16(320),this.work=new O.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=\"\",t.wrap&&(e.adler=1&t.wrap),t.mode=L,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new O.Buf32(n),t.distcode=t.distdyn=new O.Buf32(i),t.sane=1,t.back=-1,N):U}function a(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,o(e)):U}function f(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=s.wsize?(O.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(n<(i=s.wsize-s.wnext)&&(i=n),O.arraySet(s.window,t,r-n,i,s.wnext),(n-=i)?(O.arraySet(s.window,t,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=D(r.check,C,2,0),d=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg=\"incorrect header check\",r.mode=30;break}if(8!=(15&u)){e.msg=\"unknown compression method\",r.mode=30;break}if(d-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg=\"invalid window size\",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=D(r.check,C,2,0)),d=u=0,r.mode=3;case 3:for(;d<32;){if(0===a)break e;a--,u+=n[s++]<>>8&255,C[2]=u>>>16&255,C[3]=u>>>24&255,r.check=D(r.check,C,4,0)),d=u=0,r.mode=4;case 4:for(;d<16;){if(0===a)break e;a--,u+=n[s++]<>8),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=D(r.check,C,2,0)),d=u=0,r.mode=5;case 5:if(1024&r.flags){for(;d<16;){if(0===a)break e;a--,u+=n[s++]<>>8&255,r.check=D(r.check,C,2,0)),d=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(a<(c=r.length)&&(c=a),c&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),O.arraySet(r.head.extra,n,s,c,k)),512&r.flags&&(r.check=D(r.check,n,c,s)),a-=c,s+=c,r.length-=c),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===a)break e;for(c=0;k=n[s+c++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&c>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;d<32;){if(0===a)break e;a--,u+=n[s++]<>>=7&d,d-=7&d,r.mode=27;break}for(;d<3;){if(0===a)break e;a--,u+=n[s++]<>>=1)){case 0:r.mode=14;break;case 1:if(j(r),r.mode=20,6!==t)break;u>>>=2,d-=2;break e;case 2:r.mode=17;break;case 3:e.msg=\"invalid block type\",r.mode=30}u>>>=2,d-=2;break;case 14:for(u>>>=7&d,d-=7&d;d<32;){if(0===a)break e;a--,u+=n[s++]<>>16^65535)){e.msg=\"invalid stored block lengths\",r.mode=30;break}if(r.length=65535&u,d=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(c=r.length){if(a>>=5,d-=5,r.ndist=1+(31&u),u>>>=5,d-=5,r.ncode=4+(15&u),u>>>=4,d-=4,286>>=3,d-=3}for(;r.have<19;)r.lens[A[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=T(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg=\"invalid code lengths set\",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,v=65535&z,!((_=z>>>24)<=d);){if(0===a)break e;a--,u+=n[s++]<>>=_,d-=_,r.lens[r.have++]=v;else{if(16===v){for(E=_+2;d>>=_,d-=_,0===r.have){e.msg=\"invalid bit length repeat\",r.mode=30;break}k=r.lens[r.have-1],c=3+(3&u),u>>>=2,d-=2}else if(17===v){for(E=_+3;d>>=_)),u>>>=3,d-=3}else{for(E=_+7;d>>=_)),u>>>=7,d-=7}if(r.have+c>r.nlen+r.ndist){e.msg=\"invalid bit length repeat\",r.mode=30;break}for(;c--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg=\"invalid code -- missing end-of-block\",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=T(R,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg=\"invalid literal/lengths set\",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=T(F,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg=\"invalid distances set\",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=a&&258<=f){e.next_out=o,e.avail_out=f,e.next_in=s,e.avail_in=a,r.hold=u,r.bits=d,B(e,l),o=e.next_out,i=e.output,f=e.avail_out,s=e.next_in,n=e.input,a=e.avail_in,u=r.hold,d=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;w=(z=r.lencode[u&(1<>>16&255,v=65535&z,!((_=z>>>24)<=d);){if(0===a)break e;a--,u+=n[s++]<>g)])>>>16&255,v=65535&z,!(g+(_=z>>>24)<=d);){if(0===a)break e;a--,u+=n[s++]<>>=g,d-=g,r.back+=g}if(u>>>=_,d-=_,r.back+=_,r.length=v,0===w){r.mode=26;break}if(32&w){r.back=-1,r.mode=12;break}if(64&w){e.msg=\"invalid literal/length code\",r.mode=30;break}r.extra=15&w,r.mode=22;case 22:if(r.extra){for(E=r.extra;d>>=r.extra,d-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;w=(z=r.distcode[u&(1<>>16&255,v=65535&z,!((_=z>>>24)<=d);){if(0===a)break e;a--,u+=n[s++]<>g)])>>>16&255,v=65535&z,!(g+(_=z>>>24)<=d);){if(0===a)break e;a--,u+=n[s++]<>>=g,d-=g,r.back+=g}if(u>>>=_,d-=_,r.back+=_,64&w){e.msg=\"invalid distance code\",r.mode=30;break}r.offset=v,r.extra=15&w,r.mode=24;case 24:if(r.extra){for(E=r.extra;d>>=r.extra,d-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg=\"invalid distance too far back\",r.mode=30;break}r.mode=25;case 25:if(0===f)break e;if(c=l-f,r.offset>c){if((c=r.offset-c)>r.whave&&r.sane){e.msg=\"invalid distance too far back\",r.mode=30;break}p=c>r.wnext?(c-=r.wnext,r.wsize-c):r.wnext-c,c>r.length&&(c=r.length),m=r.window}else m=i,p=o-r.offset,c=r.length;for(fc?(m=B[T+o[g]],A[O+o[g]]):(m=96,0),f=1<>S)+(u-=f)]=p<<24|m<<16|_|0,0!==u;);for(f=1<>=1;if(0!==f?(C&=f-1,C+=f):C=0,g++,0==--I[v]){if(v===b)break;v=t[r+o[g]]}if(k>>7)]}function x(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function S(e,t,r){e.bi_valid>i-r?(e.bi_buf|=t<>i-e.bi_valid,e.bi_valid+=r-i):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function C(e,t,r){var n,i,s=new Array(_+1),o=0;for(n=1;n<=_;n++)s[n]=o=o+r[n-1]<<1;for(i=0;i<=t;i++){var a=e[2*i+1];0!==a&&(e[2*i]=z(s[a]++,a))}}function A(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function O(e){8>1;1<=r;r--)D(e,s,r);for(i=f;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],D(e,s,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,s[2*i]=s[2*r]+s[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,s[2*r+1]=s[2*n+1]=i,e.heap[1]=i++,D(e,s,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,s,o,a,f=t.dyn_tree,u=t.max_code,d=t.stat_desc.static_tree,h=t.stat_desc.has_stree,l=t.stat_desc.extra_bits,c=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(s=0;s<=_;s++)e.bl_count[s]=0;for(f[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)p<(s=f[2*f[2*(n=e.heap[r])+1]+1]+1)&&(s=p,m++),f[2*n+1]=s,u>=7;n<30;n++)for(y[n]=i<<7,e=0;e<1<>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),T(e,e.l_desc),T(e,e.d_desc),o=function(e){var t;for(R(e,e.dyn_ltree,e.l_desc.max_code),R(e,e.dyn_dtree,e.d_desc.max_code),T(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*d[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==t?U(e,t,r,n):4===e.strategy||s===i?(S(e,2+(n?1:0),3),B(e,h,l)):(S(e,4+(n?1:0),3),function(e,t,r,n){var i;for(S(e,t-257,5),S(e,r-1,5),S(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(p[r]+256+1)]++,e.dyn_dtree[2*k(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){var t;S(e,2,3),E(e,256,h),16===(t=e).bi_valid?(x(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{\"../utils/common\":41}],53:[function(e,t,r){\"use strict\";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,r){\"use strict\";t.exports=\"function\"==typeof setImmediate?setImmediate:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e)}},{}]},{},[10])(10)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)});","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"../Timeline\"), exports);\n__exportStar(require(\"../DrawerCanvas\"), exports);\n__exportStar(require(\"../Renderer\"), exports);\n__exportStar(require(\"./BrowserDrawerCanvas\"), exports);\nconst BrowserDrawerCanvas_1 = require(\"./BrowserDrawerCanvas\");\nexports.default = BrowserDrawerCanvas_1.BrowserDrawerCanvas;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GCODEExporter = void 0;\n__exportStar(require(\"./types\"), exports);\nconst GCODEExporter_1 = require(\"./GCODEExporter\");\nObject.defineProperty(exports, \"GCODEExporter\", { enumerable: true, get: function () { return GCODEExporter_1.GCODEExporter; } });\nif (typeof Urpflanze !== 'undefined') {\n Urpflanze.GCODEExporter = GCODEExporter_1.GCODEExporter;\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GCODEExporter = void 0;\nconst core_1 = require(\"@urpflanze/core\");\nconst simplify_js_1 = require(\"simplify-js\");\nconst utilities_1 = require(\"./utilities\");\nclass GCODEExporter {\n static parse(scene, settings) {\n const bindedSettings = {\n ...GCODEExporter.defaults,\n ...settings,\n };\n return GCODEExporter.generate(scene, bindedSettings).join('\\n');\n }\n /**\n * Set units to inches or millimeters.\n * When unit is set, all positions, offsets, rates, accelerations, etc., specified in G-code parameters are interpreted in that unit.\n *\n * @param unit 'millimeters' | 'inches'\n * @returns\n */\n static setUnit(unit) {\n return unit === 'inches' ? 'G20' : 'G21';\n }\n /**\n * In this mode all coordinates are interpreted as relative to the last position.\n *\n * @returns\n */\n static useRelativePosition() {\n return 'G91';\n }\n /**\n * All coordinates given in G-code are interpreted as positions in the logical coordinate space\n *\n * @returns\n */\n static useAbsolutePosition() {\n return 'G90';\n }\n /**\n * Up pen and go home\n *\n * @param penUpCommand\n * @returns\n */\n static goHome(penUpCommand) {\n return [penUpCommand, 'G28 X0 Y0'];\n }\n /**\n * Store the origin position that the machine goes to when the {G28} command is issued\n *\n * @param x\n * @param y\n * @param decimals\n * @returns\n */\n static setCurrentMachinePosition(x, y, decimals) {\n return `G28.1 X${utilities_1.round(x, decimals)} Y${utilities_1.round(y, decimals)}`;\n }\n /**\n * Set the current position to the values specified.\n *\n * @param x\n * @param y\n * @param decimals\n * @returns\n */\n static setCurrentWorkspacePosition(x, y, decimals) {\n return `G92 X${utilities_1.round(x, decimals)} Y${utilities_1.round(y, decimals)}`;\n }\n /**\n * Linear move.\n * G0 is a rapid moviment (max speed)\n * G1 moviment of setted velocity\n *\n * @param x\n * @param y\n * @param decimals\n * @param velocity\n * @returns\n */\n static goTo(x, y, decimals, velocity) {\n return typeof velocity !== 'undefined'\n ? `G1 X${utilities_1.round(x, decimals)} Y${utilities_1.round(y, decimals)} F${velocity}`\n : `G0 X${utilities_1.round(x, decimals)} Y${utilities_1.round(y, decimals)}`;\n }\n /**\n * Up the pen, move and down\n *\n * @param penUpCommand\n * @param penDownCommand\n * @param x\n * @param y\n * @param round\n * @returns\n */\n static moveTo(penUpCommand, penDownCommand, x, y, round) {\n return [penUpCommand, this.goTo(x, y, round), penDownCommand];\n }\n /**\n * goTo alias\n *\n * @param x\n * @param y\n * @param velocity\n * @param round\n * @returns\n */\n static lineTo(x, y, velocity, round) {\n return this.goTo(x, y, round, velocity);\n }\n /**\n * Generate gcode frm scene\n *\n * @param scene\n * @param settings\n * @returns\n */\n static generate(scene, settings) {\n // Calculate workspace area\n const workspaceWidth = settings.maxX - settings.minX;\n const workspaceHeight = settings.maxY - settings.minY;\n const workspaceRatio = workspaceWidth / workspaceHeight;\n // Calculate drawArea from scene\n const sceneRatio = scene.width / scene.height;\n const drawArea = [\n workspaceRatio > sceneRatio ? (scene.width * workspaceHeight) / scene.height : workspaceWidth,\n workspaceRatio > sceneRatio ? workspaceHeight : (scene.height * workspaceWidth) / scene.width,\n ];\n const drawAreaSceneOffset = [(workspaceWidth - drawArea[0]) / 2, (workspaceHeight - drawArea[1]) / 2];\n // Adapt drawArea to workspace\n const scale = workspaceRatio > sceneRatio ? scene.width / drawArea[0] : scene.height / drawArea[1];\n // const machineCenterPosition = [(settings.maxX + settings.minX) / 2, (settings.maxY + settings.minY) / 2]\n const gcode = [];\n utilities_1.concat(gcode, settings.penUpCommand);\n utilities_1.concat(gcode, this.setUnit(settings.unit));\n utilities_1.concat(gcode, this.useAbsolutePosition());\n utilities_1.concat(gcode, this.setCurrentMachinePosition(settings.minX, settings.minY, settings.decimals));\n utilities_1.concat(gcode, this.setCurrentWorkspacePosition(settings.minX, settings.minY, settings.decimals));\n const sceneChilds = scene.getChildren();\n for (let i = 0, len = sceneChilds.length; i < len; i++) {\n sceneChilds[i].generate(0, true);\n const childBuffer = sceneChilds[i].getBuffer() || [];\n const childIndexedBuffer = sceneChilds[i].getIndexedBuffer() || [];\n let childVertexIndex = 0;\n for (let currentBufferIndex = 0, len = childIndexedBuffer.length; currentBufferIndex < len; currentBufferIndex++) {\n const currentIndexing = childIndexedBuffer[currentBufferIndex];\n const initialPointX = core_1.clamp(settings.minX, settings.maxX, settings.minX + childBuffer[childVertexIndex] / scale + drawAreaSceneOffset[0]);\n const initialPointY = core_1.clamp(settings.minY, settings.maxY, settings.minY + childBuffer[childVertexIndex + 1] / scale + drawAreaSceneOffset[1]);\n utilities_1.concat(gcode, this.moveTo(settings.penUpCommand, settings.penDownCommand, initialPointX, initialPointY, settings.decimals));\n const simplifiedBuffer = GCODEExporter.pointsToBuffer(simplify_js_1.default(GCODEExporter.bufferToPoints(childBuffer.slice(childVertexIndex, childVertexIndex + currentIndexing.frameLength)), 1 / 10 ** settings.decimals, true));\n for (let i = 0, len = simplifiedBuffer.length; i < len; i += 2) {\n const currentX = core_1.clamp(settings.minX, settings.maxX, settings.minX + simplifiedBuffer[i] / scale + drawAreaSceneOffset[0]);\n const currentY = core_1.clamp(settings.minY, settings.maxY, settings.minY + simplifiedBuffer[i + 1] / scale + drawAreaSceneOffset[1]);\n utilities_1.concat(gcode, this.lineTo(currentX, currentY, settings.velocity, settings.decimals));\n }\n if (currentIndexing.shape.isClosed())\n utilities_1.concat(gcode, this.lineTo(initialPointX, initialPointY, settings.velocity, settings.decimals));\n childVertexIndex += currentIndexing.frameLength;\n }\n }\n /**\n *\n * @param penUpCommand\n * @returns\n */\n utilities_1.concat(gcode, this.goHome(settings.penUpCommand));\n return gcode;\n }\n static bufferToPoints(buffer) {\n const result = [];\n for (let i = 0, len = buffer.length; i < len; i += 2)\n result.push({ x: buffer[i], y: buffer[i + 1] });\n return result;\n }\n static pointsToBuffer(points) {\n const result = [];\n for (let i = 0, len = points.length; i < len; i++) {\n result.push(points[i].x);\n result.push(points[i].y);\n }\n return Float32Array.from(result);\n }\n}\nexports.GCODEExporter = GCODEExporter;\nGCODEExporter.defaults = {\n minX: 0,\n minY: 0,\n maxX: 297,\n maxY: 210,\n unit: 'millimeters',\n velocity: 1500,\n penUpCommand: 'M3 S30',\n penDownCommand: 'M3 S0',\n decimals: 2,\n};\n//# sourceMappingURL=GCODEExporter.js.map","/*! For license information please see urpflanze.min.js.LICENSE.txt */\n!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.Urpflanze=e():t.Urpflanze=e()}(window,(function(){return(()=>{var t={193:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Group=void 0;const n=r(107),i=r(15),o=r(485),a=r(658);class s extends i.SceneChild{constructor(t={}){t.type=\"Group\",super(t),this.children=[],[\"id\",\"name\",\"data\",\"order\",\"type\"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=a.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){\"object\"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=s},107:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Scene=void 0;const n=r(15),i=r(193),o=r(775),a=r(932);class s{constructor(t={}){this.width=400,this.height=400,this.background=\"hsla(0, 0%, 0%, 1)\",this.color=\"hsla(0, 0%, 100%, 1)\",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?[\"number\"==typeof t.anchor[0]?(.5+.5*a.clamp(-1,1,t.anchor[0]))*this.width:\"left\"===t.anchor[0]?0:\"right\"===t.anchor[0]?this.width:this.center[0],\"number\"==typeof t.anchor[1]?(.5+.5*a.clamp(-1,1,t.anchor[1]))*this.height:\"top\"===t.anchor[1]?0:\"bottom\"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e=\"number\"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,s.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{s.propagateToChilden(t,e)})):t instanceof o.Shape&&t.shape&&(t.shape.scene=e,s.propagateToChilden(t.shape,e))}}e.Scene=s},15:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||\"SceneChild\",this.name=t.name||this.type+\"_\"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){\"string\"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},932:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(21),i=r(345),o=r(271),a=\"undefined\"!=typeof performance?performance:Date;function s(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return a.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=s,e.relativeClamp=function(t,e,r,n,i){return s(n,i,(r-t)/(e-t)*(i-n)+n)};const u={random:new n(Math.random)};e.noise=function(t=\"random\",e=0,r=0,i=0){return void 0===u[t]&&(u[t]=new n(t)),u[t].noise3D(e,r,i)};const h={};function c(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),o=rn?[o,a]:[a,o]}function f(t,e){const r=t.length,n=r/2,i=2*(n+e),o=n-1;if(o>1){const n=r-2,a=Math.floor(e/o);let s=(i-(r+a*n))/2;const u=Math.round(o/s),h=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%u==0||e===n-2),p=a+(d?1:0),M=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);h[i]=(o=t(),a=t(),s=t(),u=t(),function(){let t=(o>>>=0)+(a>>>=0)|0;return o=a^a>>>9,a=(s>>>=0)+(s<<3)|0,t=t+(u=1+(u>>>=0)|0)|0,s=(s=s<<21|s>>>11)+t|0,(t>>>0)/4294967296})}var o,a,s,u;const c=e+h[i]()*(r-e);return void 0!==n?Math.round(c*10**n)/10**n:c},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return o.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=c,e.interpolate=function(t,e,r=.5){const[n,i]=c(t,e),o=Math.max(n.length,i.length),a=\"number\"==typeof r?[r]:r,s=o/2;if(a.length!==s){const t=a.length;for(let e=0;e{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return\"number\"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},348:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(887);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},888:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},658:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(700);var i;!function(t){t[t.None=0]=\"None\",t[t.Scale=2]=\"Scale\",t[t.Center=4]=\"Center\",t[t.Fill=8]=\"Fill\"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn(\"[Urplfanze:Bounding] cannot sum bounding\")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn(\"[Urplfanze:Bounding] cannot bind bounding\")}};class o extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return o.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=o.getBounding(t));const a=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,s=e>=i.Center?r.cx:0,u=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Close=void 0;const n=r(700);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},991:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Mirror=void 0;const n=r(700);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let o=0;o{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},62:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Offset=void 0;const n=r(700);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i},785:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Smooth=void 0;const n=r(932),i=r(364),o=r(700);class a extends o.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Solidify=void 0;const n=r(700);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const o=[],a=(e=\"number\"==typeof e?[e]:e).length;let s,u,h=[[0,0],[0,0]],c=[[0,0],[0,0]];for(let r=0,f=0,l=t.length-2;r{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Subdivide=void 0;const n=r(700);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Modifiers=void 0;const n=r(658),i=r(991),o=r(785),a=r(982),s=r(301),u=r(364),h=r(62),c={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:o.Smooth,Solidify:a.Solidify,Subdivide:s.Subdivide,Close:u.Close,Offset:h.Offset};e.Modifiers=c},775:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Shape=void 0;const n=r(107),i=r(15),o=r(485);class a extends o.ShapeBase{constructor(t){t.type=t.type||\"Shape\",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn(\"[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\\nYou passed:\",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):a.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeBase=void 0;const n=r(887),i=r(46),o=r(348),a=r(271),s=r(888),u=r(658),h=r(932),c=r(15),f=n.mat4.create(),l=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class M extends c.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?[\"number\"==typeof t.anchor[0]?-1*h.clamp(-1,1,t.anchor[0]):\"left\"===t.anchor[0]?1:\"right\"===t.anchor[0]?-1:0,\"number\"==typeof t.anchor[1]?-1*h.clamp(-1,1,t.anchor[1]):\"top\"===t.anchor[1]?1:\"bottom\"===t.anchor[1]?-1:0]:[0,0],this.boundingType=\"string\"==typeof t.boundingType?\"relative\"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return\"function\"!=typeof t.repetitions&&\"function\"!=typeof t.distance&&\"function\"!=typeof t.displace&&\"function\"!=typeof t.scale&&\"function\"!=typeof t.translate&&\"function\"!=typeof t.skewX&&\"function\"!=typeof t.skewY&&\"function\"!=typeof t.squeezeX&&\"function\"!=typeof t.squeezeY&&\"function\"!=typeof t.rotateX&&\"function\"!=typeof t.rotateY&&\"function\"!=typeof t.rotateZ&&\"function\"!=typeof t.transformOrigin&&\"function\"!=typeof t.perspective&&\"function\"!=typeof t.perspectiveOrigin}isStaticIndexed(){return\"function\"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return\"function\"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){\"string\"==typeof t?(r=r||\"repetitions\"==t,this.props[t]=e):(r=r||\"repetitions\"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var c,g;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const v=M.getEmptyPropArguments(this,r),m=v.repetition,b=this.getProp(\"repetitions\",v,1),y=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,x=Array.isArray(b)?b[0]*(null!==(c=b[1])&&void 0!==c?c:b[0]):b,S=Array.isArray(b)?b[0]:x,P=Array.isArray(b)?null!==(g=b[1])&&void 0!==g?g:b[0]:1,w=m.row;w.count=S;const B=m.col;B.count=P,m.count=x,m.col.count=P,m.row.count=S,m.type=y;let I=0;const R=[];let O=0;const A=n.vec2.fromValues((P-1)/2,(S-1)/2),L=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],E=[void 0,void 0,void 0,void 0],_=[void 0,void 0,void 0,void 0];for(let r=0;r1?O/(x-1):1,m.angle=y===i.ERepetitionType.Ring?s.PI2/x*O:0,B.index=c+1,B.offset=P>1?c/(P-1):1,w.index=r+1,w.offset=S>1?r/(S-1):1;const M=this.generateBuffer(t,v),g=M.length,b=this.getShapeBounding();R[O]=new Float32Array(g),I+=g;{const t=o.toVec2(this.getProp(\"distance\",v,o.VEC2_ZERO)),s=this.getProp(\"displace\",v,0),x=o.toVec3(this.getProp(\"scale\",v,o.VEC2_ONE),1),S=o.toVec3(this.getProp(\"translate\",v,o.VEC2_ZERO),0),P=this.getProp(\"skewX\",v,0),w=this.getProp(\"skewY\",v,0),B=this.getProp(\"squeezeX\",v,0),I=this.getProp(\"squeezeY\",v,0),F=this.getProp(\"rotateX\",v,0),C=this.getProp(\"rotateY\",v,0),j=this.getProp(\"rotateZ\",v,0),q=h.clamp(0,1,this.getProp(\"perspective\",v,0)),T=o.toVec3(this.getProp(\"perspectiveOrigin\",v,o.VEC2_ZERO),0),D=o.toVec3(this.getProp(\"transformOrigin\",v,o.VEC2_ZERO),0);let V;switch(y){case i.ERepetitionType.Ring:V=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(V,V,o.VEC3_ZERO,m.angle+s);break;case i.ERepetitionType.Matrix:V=n.vec3.fromValues(t[1]*(c-A[0]),t[0]*(r-A[1]),0)}const k=q>0?Math.max(b.width,b.height)/2:1,z=q>0?k+10*k*(1-q):0,U=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==q||0!==D[0]||0!==D[1],Y=0!==T[0]||0!==T[1];U&&(this.boundingType===i.EBoundingType.Relative?(D[0]=D[0]*(b.width/2)+b.cx,D[1]=D[1]*(b.height/2)+b.cy):(D[0]*=b.width/2,D[1]*=b.height/2),D[2]=z);{n.mat4.identity(l),U&&n.mat4.translate(l,l,D),0===S[0]&&0===S[1]||n.mat4.translate(l,l,S),0===P&&0===w||(o.fromSkew(f,[P,w]),n.mat4.multiply(l,l,f)),0!==F&&n.mat4.rotateX(l,l,F),0!==C&&n.mat4.rotateY(l,l,C),0!==j&&n.mat4.rotateZ(l,l,j),1===x[0]&&1===x[1]||n.mat4.scale(l,l,x),U&&n.mat4.translate(l,l,n.vec3.scale(D,D,-1)),z>0&&(Y&&(this.boundingType===i.EBoundingType.Relative?(T[0]=T[0]*(b.width/2)+b.cx,T[1]=T[1]*(b.height/2)+b.cy):(T[0]*=b.width/2,T[1]*=b.height/2),T[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,V),e&&n.mat4.translate(p,p,L);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),y===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,m.angle+s)}u.Bounding.clear(_);for(let t=0;t0&&(Y&&n.vec3.add(e,e,T),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,z),Y&&n.vec3.sub(e,e,T)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=g/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,v)}R[O][t]=e[0],R[O][t+1]=e[1],u.Bounding.add(_,e[0],e[1]),u.Bounding.add(E,e[0],e[1])}}const F={cx:0,cy:0,x:-1,y:-1,width:2,height:2};u.Bounding.bind(F,_),this.bStaticIndexed&&this.bIndexed||this.addIndex(g,m,F)}u.Bounding.bind(this.bounding,E),this.buffer=new Float32Array(I);for(let t=0,e=0,r=R.length;t({index:1,offset:1,count:1}),M.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...M.getEmptySimpleRepetition(),row:M.getEmptySimpleRepetition(),col:M.getEmptySimpleRepetition()})},425:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeBuffer=void 0;const n=r(658),i=r(436);class o extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||\"ShapeBuffer\",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn(\"[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property\"),this.shape=o.EMPTY_BUFFER):this.shape=\"function\"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return\"function\"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return\"function\"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from(\"function\"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,o=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&\"function\"!=typeof this.props.sideLength&&\"function\"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=o},549:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeFollow=void 0;const n=r(775);class i extends n.Shape{constructor(t){t.type=t.type||\"ShapeFollow\",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},o=this.shape;o.generate(t,!1,i);let a=o.getBuffer();const s=a.length,u=new Float32Array(s*(n.length/2)),h=n.length/2;for(let e=0;e1?e/(h-1):1,count:h};this.shapeUseFollow&&(i.follow=r,o.generate(t,!1,i),a=o.getBuffer());const c=e*s,f=2*e,l=n[f],d=n[f+1];for(let t=0,e=a.length;t1?t/(e-1):1;for(let a=0,s=o.length;a{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeLoop=void 0;const n=r(888),i=r(658),o=r(436),a=r(485);class s extends o.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||\"ShapeLoop\",super(t),this.loopDependencies=(t.loopDependencies||[]).concat(\"sideLength\"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes(\"propArguments\"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}\"loop\"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||a.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?(\"function\"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),o=this.getRepetitionSideLength(t),a=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,s={index:0,offset:0,current:0,count:n},u=s.count,h=new Float32Array(2*u);for(let n=0,i=0;n1?n/(s.count-1):1;s.current=o,s.index=n+1,s.offset=u;const c=a(s,t);h[i]=c[0],h[i+1]=c[1]}const c=[void 0,void 0,void 0,void 0],f=this.applyModifiers(h,t);for(let t=0,e=f.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapePrimitive=void 0;const n=r(348),i=r(485),o=r(700),a=r(658);class s extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=a.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:\"function\"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return\"function\"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:\"number\"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp(\"sideLength\",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeRecursive=void 0;const n=r(775);class i extends n.Shape{constructor(t){t.type=t.type||\"ShapeRecursive\",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return\"function\"!=typeof this.props.recursions&&\"function\"!=typeof this.props.recursionScale&&\"function\"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return\"function\"!=typeof this.props.recursions&&\"function\"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp(\"recursions\",e,1)),n=Math.floor(this.getProp(\"recursionVertex\",e,0)),o=this.getProp(\"recursionScale\",e,2),a=this.shape;let s={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const u={...e,recursion:s};a.generate(t,!1,u);const h=a.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=h);let c=h;const f=[s];let l=0,d=1;const p=c.length,M=p/2,g=n<=0?M:Math.min(n,M),v=0===n?1:M/Math.min(n,M),m=new Float32Array(i.summmation(r,g)*p);for(let t=0;t1?e/(r-1):1,h=i.summmation(e,g)*p,M=e-1,b=0===M?0:i.summmation(M,g)*p;for(let i=0,M=g**e;i1?i/(M-1):1,count:M,level:{index:e+1,offset:n,count:r},parent:f[l]},f.push(s),this.shapeUseRecursion&&(u.recursion=s,a.generate(t,!1,u),c=a.getBuffer());const y=h+i*p,x=Math.floor(b+2*i*v),S=m[x],P=m[x+1],w=o**e;for(let t=0,e=p;t1?0:1,count:o}}},u=this.shape.getIndexedBuffer()||[];for(let t=0,e=u.length;t1?0:1,count:o}},i={...s,recursion:r},a=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:a})}if(o>1){const t=this.shape.getBufferLength({...i,parent:{...s}})/2,e=a<=0?t:Math.min(a,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let h=0,c=1;for(let t=1;t1?t/(o-1):1;for(let a=0,f=e**t;a1?a/(f-1):1;for(let d=0,p=u.length;d{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Circle=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){t.type=\"Circle\",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=o},702:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Line=void 0;const n=r(658),i=r(425);class o extends i.ShapeBuffer{constructor(t={}){t.type=\"Line\",t.shape=o.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Lissajous=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){t.type=\"Lissajous\",t.loopDependencies=(t.loopDependencies||[]).concat([\"wx\",\"wy\",\"wz\"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp(\"wx\",t),r=this.getProp(\"wy\",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),o=this.getRepetitionSideLength(t);return 1/Math.pow(o[0]*o[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp(\"wx\",t,1),this.wy=this.getProp(\"wy\",t,2),this.wz=this.getProp(\"wz\",t,2),super.generateLoopBuffer(t)}}e.Lissajous=o},873:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Polygon=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){t.type=t.type||\"Polygon\",t.loopDependencies=(t.loopDependencies||[]).concat([\"sideNumber\"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp(\"sideNumber\",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=o},478:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Rect=void 0;const n=r(658),i=r(425);class o extends i.ShapeBuffer{constructor(t={}){t.type=\"Rect\",t.shape=o.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=o,o.buffer=[1,1,-1,1,-1,-1,1,-1]},710:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Rose=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){var e,r;t.type=\"Rose\",t.loopDependencies=(t.loopDependencies||[]).concat([\"n\",\"d\"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>o.getFinalAngleFromK(this.getProp(\"n\",t),this.getProp(\"d\",t)),inc:t=>{const e=this.getProp(\"n\",t),r=this.getProp(\"d\",t),i=this.getRepetitionSideLength(t),o=Math.pow(i[0]*i[1],.45),a=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp(\"n\",t)/this.getProp(\"d\",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=o},82:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Spiral=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type=\"Spiral\",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat([\"twists\",\"twistsStart\",\"spiral\"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:o.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp(\"twistsStart\",t),end:t=>n.PI2*(this.getProp(\"twistsStart\",t)+this.getProp(\"twists\",t)),inc:t=>{const e=this.getProp(\"twists\",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp(\"spiral\",t),this.r=o.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case o.types.ARCHIMEDE:return t=>t/10;case o.types.HYPERBOLIC:return t=>1/t*3;case o.types.FERMAT:return t=>t**.5/3;case o.types.LITUUS:return t=>t**-.5;case o.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=o,o.types={ARCHIMEDE:\"ARCHIMEDE\",HYPERBOLIC:\"HYPERBOLIC\",FERMAT:\"FERMAT\",LITUUS:\"LITUUS\",LOGARITHMIC:\"LOGARITHMIC\"}},490:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Star=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){t.type=t.type||\"Polygon\",t.loopDependencies=(t.loopDependencies||[]).concat([\"spikes\",\"innerRadius\"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp(\"spikes\",t,5),this.innerRadius=this.getProp(\"innerRadius\",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=o},845:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.SuperShape=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){var e,r,i,o,a,s;t.type=\"SuperShape\",t.loopDependencies=(t.loopDependencies||[]).concat([\"a\",\"b\",\"m\",\"n1\",\"n2\",\"n3\"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(o=t.n1)&&void 0!==o?o:1,this.props.n2=null!==(a=t.n2)&&void 0!==a?a:1,this.props.n3=null!==(s=t.n3)&&void 0!==s?s:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp(\"a\",t),this.b=this.getProp(\"b\",t),this.m=this.getProp(\"m\",t),this.n1=this.getProp(\"n1\",t),this.n2=this.getProp(\"n2\",t),this.n3=this.getProp(\"n3\",t),super.generateLoopBuffer(t)}}e.SuperShape=o},123:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Triangle=void 0;const n=r(658),i=r(425);class o extends i.ShapeBuffer{constructor(t={}){t.type=\"Triangle\",t.shape=o.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=o,o.buffer=[1,0,-1,1,-1,-1]},46:function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(574),e),i(r(636),e),i(r(345),e),i(r(920),e),i(r(676),e),i(r(300),e),i(r(273),e),i(r(511),e)},574:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},636:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},345:(t,e)=>{\"use strict\";var r;Object.defineProperty(e,\"__esModule\",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]=\"Ring\",r[r.Matrix=2]=\"Matrix\"},920:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},676:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},300:(t,e)=>{\"use strict\";var r;Object.defineProperty(e,\"__esModule\",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]=\"Relative\",r[r.Fixed=2]=\"Fixed\"},273:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},511:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},887:(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>o,mat3:()=>a,mat4:()=>s,quat:()=>c,quat2:()=>f,vec2:()=>l,vec3:()=>u,vec4:()=>h});var n={};r.r(n),r.d(n,{ARRAY_TYPE:()=>p,EPSILON:()=>d,RANDOM:()=>M,equals:()=>b,setMatrixArrayType:()=>g,toRadian:()=>m});var i={};r.r(i),r.d(i,{LDU:()=>T,add:()=>D,adjoint:()=>O,clone:()=>x,copy:()=>S,create:()=>y,determinant:()=>A,equals:()=>z,exactEquals:()=>k,frob:()=>q,fromRotation:()=>F,fromScaling:()=>C,fromValues:()=>w,identity:()=>P,invert:()=>R,mul:()=>N,multiply:()=>L,multiplyScalar:()=>U,multiplyScalarAndAdd:()=>Y,rotate:()=>E,scale:()=>_,set:()=>B,str:()=>j,sub:()=>Z,subtract:()=>V,transpose:()=>I});var o={};r.r(o),r.d(o,{add:()=>ht,clone:()=>H,copy:()=>G,create:()=>X,determinant:()=>J,equals:()=>pt,exactEquals:()=>dt,frob:()=>ut,fromRotation:()=>it,fromScaling:()=>ot,fromTranslation:()=>at,fromValues:()=>K,identity:()=>Q,invert:()=>$,mul:()=>Mt,multiply:()=>tt,multiplyScalar:()=>ft,multiplyScalarAndAdd:()=>lt,rotate:()=>et,scale:()=>rt,set:()=>W,str:()=>st,sub:()=>gt,subtract:()=>ct,translate:()=>nt});var a={};r.r(a),r.d(a,{add:()=>zt,adjoint:()=>It,clone:()=>bt,copy:()=>yt,create:()=>vt,determinant:()=>Rt,equals:()=>Xt,exactEquals:()=>Zt,frob:()=>kt,fromMat2d:()=>jt,fromMat4:()=>mt,fromQuat:()=>qt,fromRotation:()=>Ft,fromScaling:()=>Ct,fromTranslation:()=>_t,fromValues:()=>xt,identity:()=>Pt,invert:()=>Bt,mul:()=>Ht,multiply:()=>Ot,multiplyScalar:()=>Yt,multiplyScalarAndAdd:()=>Nt,normalFromMat4:()=>Tt,projection:()=>Dt,rotate:()=>Lt,scale:()=>Et,set:()=>St,str:()=>Vt,sub:()=>Gt,subtract:()=>Ut,translate:()=>At,transpose:()=>wt});var s={};r.r(s),r.d(s,{add:()=>Ce,adjoint:()=>ne,clone:()=>Kt,copy:()=>Wt,create:()=>Qt,determinant:()=>ie,equals:()=>Ve,exactEquals:()=>De,frob:()=>Fe,fromQuat:()=>Be,fromQuat2:()=>be,fromRotation:()=>pe,fromRotationTranslation:()=>me,fromRotationTranslationScale:()=>Pe,fromRotationTranslationScaleOrigin:()=>we,fromScaling:()=>de,fromTranslation:()=>le,fromValues:()=>$t,fromXRotation:()=>Me,fromYRotation:()=>ge,fromZRotation:()=>ve,frustum:()=>Ie,getRotation:()=>Se,getScaling:()=>xe,getTranslation:()=>ye,identity:()=>te,invert:()=>re,lookAt:()=>Le,mul:()=>ke,multiply:()=>oe,multiplyScalar:()=>qe,multiplyScalarAndAdd:()=>Te,ortho:()=>Ae,perspective:()=>Re,perspectiveFromFieldOfView:()=>Oe,rotate:()=>ue,rotateX:()=>he,rotateY:()=>ce,rotateZ:()=>fe,scale:()=>se,set:()=>Jt,str:()=>_e,sub:()=>ze,subtract:()=>je,targetTo:()=>Ee,translate:()=>ae,transpose:()=>ee});var u={};r.r(u),r.d(u,{add:()=>Ge,angle:()=>Pr,bezier:()=>Mr,ceil:()=>$e,clone:()=>Ye,copy:()=>Xe,create:()=>Ue,cross:()=>lr,dist:()=>_r,distance:()=>or,div:()=>Er,divide:()=>We,dot:()=>fr,equals:()=>Rr,exactEquals:()=>Ir,floor:()=>Je,forEach:()=>qr,fromValues:()=>Ze,hermite:()=>pr,inverse:()=>hr,len:()=>Cr,length:()=>Ne,lerp:()=>dr,max:()=>er,min:()=>tr,mul:()=>Lr,multiply:()=>Ke,negate:()=>ur,normalize:()=>cr,random:()=>gr,rotateX:()=>yr,rotateY:()=>xr,rotateZ:()=>Sr,round:()=>rr,scale:()=>nr,scaleAndAdd:()=>ir,set:()=>He,sqrDist:()=>Fr,sqrLen:()=>jr,squaredDistance:()=>ar,squaredLength:()=>sr,str:()=>Br,sub:()=>Ar,subtract:()=>Qe,transformMat3:()=>mr,transformMat4:()=>vr,transformQuat:()=>br,zero:()=>wr});var h={};r.r(h),r.d(h,{add:()=>Ur,ceil:()=>Xr,clone:()=>Dr,copy:()=>kr,create:()=>Tr,cross:()=>un,dist:()=>yn,distance:()=>Jr,div:()=>bn,divide:()=>Zr,dot:()=>sn,equals:()=>gn,exactEquals:()=>Mn,floor:()=>Hr,forEach:()=>wn,fromValues:()=>Vr,inverse:()=>on,len:()=>Sn,length:()=>en,lerp:()=>hn,max:()=>Qr,min:()=>Gr,mul:()=>mn,multiply:()=>Nr,negate:()=>nn,normalize:()=>an,random:()=>cn,round:()=>Kr,scale:()=>Wr,scaleAndAdd:()=>$r,set:()=>zr,sqrDist:()=>xn,sqrLen:()=>Pn,squaredDistance:()=>tn,squaredLength:()=>rn,str:()=>pn,sub:()=>vn,subtract:()=>Yr,transformMat4:()=>fn,transformQuat:()=>ln,zero:()=>dn});var c={};r.r(c),r.d(c,{add:()=>ei,calculateW:()=>Cn,clone:()=>Wn,conjugate:()=>zn,copy:()=>Jn,create:()=>Bn,dot:()=>ii,equals:()=>li,exactEquals:()=>fi,exp:()=>jn,fromEuler:()=>Yn,fromMat3:()=>Un,fromValues:()=>$n,getAngle:()=>An,getAxisAngle:()=>On,identity:()=>In,invert:()=>kn,len:()=>si,length:()=>ai,lerp:()=>oi,ln:()=>qn,mul:()=>ri,multiply:()=>Ln,normalize:()=>ci,pow:()=>Tn,random:()=>Vn,rotateX:()=>En,rotateY:()=>_n,rotateZ:()=>Fn,rotationTo:()=>di,scale:()=>ni,set:()=>ti,setAxes:()=>Mi,setAxisAngle:()=>Rn,slerp:()=>Dn,sqlerp:()=>pi,sqrLen:()=>hi,squaredLength:()=>ui,str:()=>Nn});var f={};r.r(f),r.d(f,{add:()=>Vi,clone:()=>vi,conjugate:()=>Xi,copy:()=>wi,create:()=>gi,dot:()=>Yi,equals:()=>to,exactEquals:()=>Ji,fromMat4:()=>Pi,fromRotation:()=>Si,fromRotationTranslation:()=>yi,fromRotationTranslationValues:()=>bi,fromTranslation:()=>xi,fromValues:()=>mi,getDual:()=>Oi,getReal:()=>Ri,getTranslation:()=>Ei,identity:()=>Bi,invert:()=>Zi,len:()=>Gi,length:()=>Hi,lerp:()=>Ni,mul:()=>zi,multiply:()=>ki,normalize:()=>Wi,rotateAroundAxis:()=>Di,rotateByQuatAppend:()=>qi,rotateByQuatPrepend:()=>Ti,rotateX:()=>Fi,rotateY:()=>Ci,rotateZ:()=>ji,scale:()=>Ui,set:()=>Ii,setDual:()=>Li,setReal:()=>Ai,sqrLen:()=>Ki,squaredLength:()=>Qi,str:()=>$i,translate:()=>_i});var l={};r.r(l),r.d(l,{add:()=>ao,angle:()=>Co,ceil:()=>co,clone:()=>ro,copy:()=>io,create:()=>eo,cross:()=>Io,dist:()=>Yo,distance:()=>mo,div:()=>Uo,divide:()=>ho,dot:()=>Bo,equals:()=>Do,exactEquals:()=>To,floor:()=>fo,forEach:()=>Xo,fromValues:()=>no,inverse:()=>Po,len:()=>Vo,length:()=>yo,lerp:()=>Ro,max:()=>po,min:()=>lo,mul:()=>zo,multiply:()=>uo,negate:()=>So,normalize:()=>wo,random:()=>Oo,rotate:()=>Fo,round:()=>Mo,scale:()=>go,scaleAndAdd:()=>vo,set:()=>oo,sqrDist:()=>No,sqrLen:()=>Zo,squaredDistance:()=>bo,squaredLength:()=>xo,str:()=>qo,sub:()=>ko,subtract:()=>so,transformMat2:()=>Ao,transformMat2d:()=>Lo,transformMat3:()=>Eo,transformMat4:()=>_o,zero:()=>jo});var d=1e-6,p=\"undefined\"!=typeof Float32Array?Float32Array:Array,M=Math.random;function g(t){p=t}var v=Math.PI/180;function m(t){return t*v}function b(t,e){return Math.abs(t-e)<=d*Math.max(1,Math.abs(t),Math.abs(e))}function y(){var t=new p(4);return p!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function x(t){var e=new p(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function S(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function P(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function w(t,e,r,n){var i=new p(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function B(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function I(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function R(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*o-i*n;return a?(a=1/a,t[0]=o*a,t[1]=-n*a,t[2]=-i*a,t[3]=r*a,t):null}function O(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function A(t){return t[0]*t[3]-t[2]*t[1]}function L(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*s+o*u,t[1]=i*s+a*u,t[2]=n*h+o*c,t[3]=i*h+a*c,t}function E(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+o*s,t[1]=i*u+a*s,t[2]=n*-s+o*u,t[3]=i*-s+a*u,t}function _(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1];return t[0]=n*s,t[1]=i*s,t[2]=o*u,t[3]=a*u,t}function F(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function C(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function j(t){return\"mat2(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}function q(t){return Math.hypot(t[0],t[1],t[2],t[3])}function T(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function D(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function V(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function k(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function z(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],h=e[3];return Math.abs(r-a)<=d*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-h)<=d*Math.max(1,Math.abs(o),Math.abs(h))}function U(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Y(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var N=L,Z=V;function X(){var t=new p(6);return p!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function H(t){var e=new p(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function G(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Q(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function K(t,e,r,n,i,o){var a=new p(6);return a[0]=t,a[1]=e,a[2]=r,a[3]=n,a[4]=i,a[5]=o,a}function W(t,e,r,n,i,o,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t}function $(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=r*o-n*i;return u?(u=1/u,t[0]=o*u,t[1]=-n*u,t[2]=-i*u,t[3]=r*u,t[4]=(i*s-o*a)*u,t[5]=(n*a-r*s)*u,t):null}function J(t){return t[0]*t[3]-t[1]*t[2]}function tt(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=r[0],c=r[1],f=r[2],l=r[3],d=r[4],p=r[5];return t[0]=n*h+o*c,t[1]=i*h+a*c,t[2]=n*f+o*l,t[3]=i*f+a*l,t[4]=n*d+o*p+s,t[5]=i*d+a*p+u,t}function et(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=Math.sin(r),c=Math.cos(r);return t[0]=n*c+o*h,t[1]=i*c+a*h,t[2]=n*-h+o*c,t[3]=i*-h+a*c,t[4]=s,t[5]=u,t}function rt(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=r[0],c=r[1];return t[0]=n*h,t[1]=i*h,t[2]=o*c,t[3]=a*c,t[4]=s,t[5]=u,t}function nt(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=n*h+o*c+s,t[5]=i*h+a*c+u,t}function it(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function ot(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function at(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function st(t){return\"mat2d(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\")\"}function ut(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function ht(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function ct(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function ft(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function lt(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function dt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function pt(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=e[0],h=e[1],c=e[2],f=e[3],l=e[4],p=e[5];return Math.abs(r-u)<=d*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-h)<=d*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-c)<=d*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(o-f)<=d*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-l)<=d*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(s-p)<=d*Math.max(1,Math.abs(s),Math.abs(p))}var Mt=tt,gt=ct;function vt(){var t=new p(9);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function mt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function bt(t){var e=new p(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function xt(t,e,r,n,i,o,a,s,u){var h=new p(9);return h[0]=t,h[1]=e,h[2]=r,h[3]=n,h[4]=i,h[5]=o,h[6]=a,h[7]=s,h[8]=u,h}function St(t,e,r,n,i,o,a,s,u,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=h,t}function Pt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function wt(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function Bt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8],f=c*a-s*h,l=-c*o+s*u,d=h*o-a*u,p=r*f+n*l+i*d;return p?(p=1/p,t[0]=f*p,t[1]=(-c*n+i*h)*p,t[2]=(s*n-i*a)*p,t[3]=l*p,t[4]=(c*r-i*u)*p,t[5]=(-s*r+i*o)*p,t[6]=d*p,t[7]=(-h*r+n*u)*p,t[8]=(a*r-n*o)*p,t):null}function It(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8];return t[0]=a*c-s*h,t[1]=i*h-n*c,t[2]=n*s-i*a,t[3]=s*u-o*c,t[4]=r*c-i*u,t[5]=i*o-r*s,t[6]=o*h-a*u,t[7]=n*u-r*h,t[8]=r*a-n*o,t}function Rt(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],h=t[8];return e*(h*o-a*u)+r*(-h*i+a*s)+n*(u*i-o*s)}function Ot(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=r[0],d=r[1],p=r[2],M=r[3],g=r[4],v=r[5],m=r[6],b=r[7],y=r[8];return t[0]=l*n+d*a+p*h,t[1]=l*i+d*s+p*c,t[2]=l*o+d*u+p*f,t[3]=M*n+g*a+v*h,t[4]=M*i+g*s+v*c,t[5]=M*o+g*u+v*f,t[6]=m*n+b*a+y*h,t[7]=m*i+b*s+y*c,t[8]=m*o+b*u+y*f,t}function At(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=l*n+d*a+h,t[7]=l*i+d*s+c,t[8]=l*o+d*u+f,t}function Lt(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=Math.sin(r),d=Math.cos(r);return t[0]=d*n+l*a,t[1]=d*i+l*s,t[2]=d*o+l*u,t[3]=d*a-l*n,t[4]=d*s-l*i,t[5]=d*u-l*o,t[6]=h,t[7]=c,t[8]=f,t}function Et(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function _t(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function Ft(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Ct(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function jt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function qt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,h=r*a,c=n*a,f=n*s,l=i*a,d=i*s,p=i*u,M=o*a,g=o*s,v=o*u;return t[0]=1-f-p,t[3]=c-v,t[6]=l+g,t[1]=c+v,t[4]=1-h-p,t[7]=d-M,t[2]=l-g,t[5]=d+M,t[8]=1-h-f,t}function Tt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8],f=e[9],l=e[10],d=e[11],p=e[12],M=e[13],g=e[14],v=e[15],m=r*s-n*a,b=r*u-i*a,y=r*h-o*a,x=n*u-i*s,S=n*h-o*s,P=i*h-o*u,w=c*M-f*p,B=c*g-l*p,I=c*v-d*p,R=f*g-l*M,O=f*v-d*M,A=l*v-d*g,L=m*A-b*O+y*R+x*I-S*B+P*w;return L?(L=1/L,t[0]=(s*A-u*O+h*R)*L,t[1]=(u*I-a*A-h*B)*L,t[2]=(a*O-s*I+h*w)*L,t[3]=(i*O-n*A-o*R)*L,t[4]=(r*A-i*I+o*B)*L,t[5]=(n*I-r*O-o*w)*L,t[6]=(M*P-g*S+v*x)*L,t[7]=(g*y-p*P-v*b)*L,t[8]=(p*S-M*y+v*m)*L,t):null}function Dt(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function Vt(t){return\"mat3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\")\"}function kt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function zt(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function Ut(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function Yt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function Nt(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function Zt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function Xt(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],h=t[7],c=t[8],f=e[0],l=e[1],p=e[2],M=e[3],g=e[4],v=e[5],m=e[6],b=e[7],y=e[8];return Math.abs(r-f)<=d*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(n-l)<=d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-p)<=d*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(o-M)<=d*Math.max(1,Math.abs(o),Math.abs(M))&&Math.abs(a-g)<=d*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(s-v)<=d*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(u-m)<=d*Math.max(1,Math.abs(u),Math.abs(m))&&Math.abs(h-b)<=d*Math.max(1,Math.abs(h),Math.abs(b))&&Math.abs(c-y)<=d*Math.max(1,Math.abs(c),Math.abs(y))}var Ht=Ot,Gt=Ut;function Qt(){var t=new p(16);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Kt(t){var e=new p(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Wt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function $t(t,e,r,n,i,o,a,s,u,h,c,f,l,d,M,g){var v=new p(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=n,v[4]=i,v[5]=o,v[6]=a,v[7]=s,v[8]=u,v[9]=h,v[10]=c,v[11]=f,v[12]=l,v[13]=d,v[14]=M,v[15]=g,v}function Jt(t,e,r,n,i,o,a,s,u,h,c,f,l,d,p,M,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=h,t[9]=c,t[10]=f,t[11]=l,t[12]=d,t[13]=p,t[14]=M,t[15]=g,t}function te(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ee(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function re(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8],f=e[9],l=e[10],d=e[11],p=e[12],M=e[13],g=e[14],v=e[15],m=r*s-n*a,b=r*u-i*a,y=r*h-o*a,x=n*u-i*s,S=n*h-o*s,P=i*h-o*u,w=c*M-f*p,B=c*g-l*p,I=c*v-d*p,R=f*g-l*M,O=f*v-d*M,A=l*v-d*g,L=m*A-b*O+y*R+x*I-S*B+P*w;return L?(L=1/L,t[0]=(s*A-u*O+h*R)*L,t[1]=(i*O-n*A-o*R)*L,t[2]=(M*P-g*S+v*x)*L,t[3]=(l*S-f*P-d*x)*L,t[4]=(u*I-a*A-h*B)*L,t[5]=(r*A-i*I+o*B)*L,t[6]=(g*y-p*P-v*b)*L,t[7]=(c*P-l*y+d*b)*L,t[8]=(a*O-s*I+h*w)*L,t[9]=(n*I-r*O-o*w)*L,t[10]=(p*S-M*y+v*m)*L,t[11]=(f*y-c*S-d*m)*L,t[12]=(s*B-a*R-u*w)*L,t[13]=(r*R-n*B+i*w)*L,t[14]=(M*b-p*x-g*m)*L,t[15]=(c*x-f*b+l*m)*L,t):null}function ne(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8],f=e[9],l=e[10],d=e[11],p=e[12],M=e[13],g=e[14],v=e[15];return t[0]=s*(l*v-d*g)-f*(u*v-h*g)+M*(u*d-h*l),t[1]=-(n*(l*v-d*g)-f*(i*v-o*g)+M*(i*d-o*l)),t[2]=n*(u*v-h*g)-s*(i*v-o*g)+M*(i*h-o*u),t[3]=-(n*(u*d-h*l)-s*(i*d-o*l)+f*(i*h-o*u)),t[4]=-(a*(l*v-d*g)-c*(u*v-h*g)+p*(u*d-h*l)),t[5]=r*(l*v-d*g)-c*(i*v-o*g)+p*(i*d-o*l),t[6]=-(r*(u*v-h*g)-a*(i*v-o*g)+p*(i*h-o*u)),t[7]=r*(u*d-h*l)-a*(i*d-o*l)+c*(i*h-o*u),t[8]=a*(f*v-d*M)-c*(s*v-h*M)+p*(s*d-h*f),t[9]=-(r*(f*v-d*M)-c*(n*v-o*M)+p*(n*d-o*f)),t[10]=r*(s*v-h*M)-a*(n*v-o*M)+p*(n*h-o*s),t[11]=-(r*(s*d-h*f)-a*(n*d-o*f)+c*(n*h-o*s)),t[12]=-(a*(f*g-l*M)-c*(s*g-u*M)+p*(s*l-u*f)),t[13]=r*(f*g-l*M)-c*(n*g-i*M)+p*(n*l-i*f),t[14]=-(r*(s*g-u*M)-a*(n*g-i*M)+p*(n*u-i*s)),t[15]=r*(s*l-u*f)-a*(n*l-i*f)+c*(n*u-i*s),t}function ie(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],h=t[8],c=t[9],f=t[10],l=t[11],d=t[12],p=t[13],M=t[14],g=t[15];return(e*a-r*o)*(f*g-l*M)-(e*s-n*o)*(c*g-l*p)+(e*u-i*o)*(c*M-f*p)+(r*s-n*a)*(h*g-l*d)-(r*u-i*a)*(h*M-f*d)+(n*u-i*s)*(h*p-c*d)}function oe(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=e[9],d=e[10],p=e[11],M=e[12],g=e[13],v=e[14],m=e[15],b=r[0],y=r[1],x=r[2],S=r[3];return t[0]=b*n+y*s+x*f+S*M,t[1]=b*i+y*u+x*l+S*g,t[2]=b*o+y*h+x*d+S*v,t[3]=b*a+y*c+x*p+S*m,b=r[4],y=r[5],x=r[6],S=r[7],t[4]=b*n+y*s+x*f+S*M,t[5]=b*i+y*u+x*l+S*g,t[6]=b*o+y*h+x*d+S*v,t[7]=b*a+y*c+x*p+S*m,b=r[8],y=r[9],x=r[10],S=r[11],t[8]=b*n+y*s+x*f+S*M,t[9]=b*i+y*u+x*l+S*g,t[10]=b*o+y*h+x*d+S*v,t[11]=b*a+y*c+x*p+S*m,b=r[12],y=r[13],x=r[14],S=r[15],t[12]=b*n+y*s+x*f+S*M,t[13]=b*i+y*u+x*l+S*g,t[14]=b*o+y*h+x*d+S*v,t[15]=b*a+y*c+x*p+S*m,t}function ae(t,e,r){var n,i,o,a,s,u,h,c,f,l,d,p,M=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*M+e[4]*g+e[8]*v+e[12],t[13]=e[1]*M+e[5]*g+e[9]*v+e[13],t[14]=e[2]*M+e[6]*g+e[10]*v+e[14],t[15]=e[3]*M+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=h,t[7]=c,t[8]=f,t[9]=l,t[10]=d,t[11]=p,t[12]=n*M+s*g+f*v+e[12],t[13]=i*M+u*g+l*v+e[13],t[14]=o*M+h*g+d*v+e[14],t[15]=a*M+c*g+p*v+e[15]),t}function se(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ue(t,e,r,n){var i,o,a,s,u,h,c,f,l,p,M,g,v,m,b,y,x,S,P,w,B,I,R,O,A=n[0],L=n[1],E=n[2],_=Math.hypot(A,L,E);return _0?(r[0]=2*(s*a+c*n+u*o-h*i)/f,r[1]=2*(u*a+c*i+h*n-s*o)/f,r[2]=2*(h*a+c*o+s*i-u*n)/f):(r[0]=2*(s*a+c*n+u*o-h*i),r[1]=2*(u*a+c*i+h*n-s*o),r[2]=2*(h*a+c*o+s*i-u*n)),me(t,e,r),t}function ye(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function xe(t,e){var r=e[0],n=e[1],i=e[2],o=e[4],a=e[5],s=e[6],u=e[8],h=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,h,c),t}function Se(t,e){var r=new p(3);xe(r,e);var n=1/r[0],i=1/r[1],o=1/r[2],a=e[0]*n,s=e[1]*i,u=e[2]*o,h=e[4]*n,c=e[5]*i,f=e[6]*o,l=e[8]*n,d=e[9]*i,M=e[10]*o,g=a+c+M,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(f-d)/v,t[1]=(l-u)/v,t[2]=(s-h)/v):a>c&&a>M?(v=2*Math.sqrt(1+a-c-M),t[3]=(f-d)/v,t[0]=.25*v,t[1]=(s+h)/v,t[2]=(l+u)/v):c>M?(v=2*Math.sqrt(1+c-a-M),t[3]=(l-u)/v,t[0]=(s+h)/v,t[1]=.25*v,t[2]=(f+d)/v):(v=2*Math.sqrt(1+M-a-c),t[3]=(s-h)/v,t[0]=(l+u)/v,t[1]=(f+d)/v,t[2]=.25*v),t}function Pe(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,h=o+o,c=a+a,f=i*u,l=i*h,d=i*c,p=o*h,M=o*c,g=a*c,v=s*u,m=s*h,b=s*c,y=n[0],x=n[1],S=n[2];return t[0]=(1-(p+g))*y,t[1]=(l+b)*y,t[2]=(d-m)*y,t[3]=0,t[4]=(l-b)*x,t[5]=(1-(f+g))*x,t[6]=(M+v)*x,t[7]=0,t[8]=(d+m)*S,t[9]=(M-v)*S,t[10]=(1-(f+p))*S,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function we(t,e,r,n,i){var o=e[0],a=e[1],s=e[2],u=e[3],h=o+o,c=a+a,f=s+s,l=o*h,d=o*c,p=o*f,M=a*c,g=a*f,v=s*f,m=u*h,b=u*c,y=u*f,x=n[0],S=n[1],P=n[2],w=i[0],B=i[1],I=i[2],R=(1-(M+v))*x,O=(d+y)*x,A=(p-b)*x,L=(d-y)*S,E=(1-(l+v))*S,_=(g+m)*S,F=(p+b)*P,C=(g-m)*P,j=(1-(l+M))*P;return t[0]=R,t[1]=O,t[2]=A,t[3]=0,t[4]=L,t[5]=E,t[6]=_,t[7]=0,t[8]=F,t[9]=C,t[10]=j,t[11]=0,t[12]=r[0]+w-(R*w+L*B+F*I),t[13]=r[1]+B-(O*w+E*B+C*I),t[14]=r[2]+I-(A*w+_*B+j*I),t[15]=1,t}function Be(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,h=r*a,c=n*a,f=n*s,l=i*a,d=i*s,p=i*u,M=o*a,g=o*s,v=o*u;return t[0]=1-f-p,t[1]=c+v,t[2]=l-g,t[3]=0,t[4]=c-v,t[5]=1-h-p,t[6]=d+M,t[7]=0,t[8]=l+g,t[9]=d-M,t[10]=1-h-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ie(t,e,r,n,i,o,a){var s=1/(r-e),u=1/(i-n),h=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*u,t[10]=(a+o)*h,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*h,t[15]=0,t}function Re(t,e,r,n,i){var o,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(n-i),t[10]=(i+n)*o,t[14]=2*i*n*o):(t[10]=-1,t[14]=-2*n),t}function Oe(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),h=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=h,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*h*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function Ae(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),h=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*h,t[15]=1,t}function Le(t,e,r,n){var i,o,a,s,u,h,c,f,l,p,M=e[0],g=e[1],v=e[2],m=n[0],b=n[1],y=n[2],x=r[0],S=r[1],P=r[2];return Math.abs(M-x)0&&(c*=d=1/Math.sqrt(d),f*=d,l*=d);var p=u*l-h*f,M=h*c-s*l,g=s*f-u*c;return(d=p*p+M*M+g*g)>0&&(p*=d=1/Math.sqrt(d),M*=d,g*=d),t[0]=p,t[1]=M,t[2]=g,t[3]=0,t[4]=f*g-l*M,t[5]=l*p-c*g,t[6]=c*M-f*p,t[7]=0,t[8]=c,t[9]=f,t[10]=l,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function _e(t){return\"mat4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\", \"+t[9]+\", \"+t[10]+\", \"+t[11]+\", \"+t[12]+\", \"+t[13]+\", \"+t[14]+\", \"+t[15]+\")\"}function Fe(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Ce(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function je(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function qe(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function Te(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function De(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function Ve(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],h=t[7],c=t[8],f=t[9],l=t[10],p=t[11],M=t[12],g=t[13],v=t[14],m=t[15],b=e[0],y=e[1],x=e[2],S=e[3],P=e[4],w=e[5],B=e[6],I=e[7],R=e[8],O=e[9],A=e[10],L=e[11],E=e[12],_=e[13],F=e[14],C=e[15];return Math.abs(r-b)<=d*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-y)<=d*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-x)<=d*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-S)<=d*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(a-P)<=d*Math.max(1,Math.abs(a),Math.abs(P))&&Math.abs(s-w)<=d*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(u-B)<=d*Math.max(1,Math.abs(u),Math.abs(B))&&Math.abs(h-I)<=d*Math.max(1,Math.abs(h),Math.abs(I))&&Math.abs(c-R)<=d*Math.max(1,Math.abs(c),Math.abs(R))&&Math.abs(f-O)<=d*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(l-A)<=d*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(p-L)<=d*Math.max(1,Math.abs(p),Math.abs(L))&&Math.abs(M-E)<=d*Math.max(1,Math.abs(M),Math.abs(E))&&Math.abs(g-_)<=d*Math.max(1,Math.abs(g),Math.abs(_))&&Math.abs(v-F)<=d*Math.max(1,Math.abs(v),Math.abs(F))&&Math.abs(m-C)<=d*Math.max(1,Math.abs(m),Math.abs(C))}var ke=oe,ze=je;function Ue(){var t=new p(3);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ye(t){var e=new p(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Ne(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function Ze(t,e,r){var n=new p(3);return n[0]=t,n[1]=e,n[2]=r,n}function Xe(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function He(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function Ge(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function Qe(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function Ke(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function We(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function $e(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Je(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function tr(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function er(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function rr(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function nr(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function ir(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function or(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function ar(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function sr(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function ur(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function hr(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function cr(t,e){var r=e[0],n=e[1],i=e[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function fr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function lr(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2];return t[0]=i*u-o*s,t[1]=o*a-n*u,t[2]=n*s-i*a,t}function dr(t,e,r,n){var i=e[0],o=e[1],a=e[2];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t}function pr(t,e,r,n,i,o){var a=o*o,s=a*(2*o-3)+1,u=a*(o-2)+o,h=a*(o-1),c=a*(3-2*o);return t[0]=e[0]*s+r[0]*u+n[0]*h+i[0]*c,t[1]=e[1]*s+r[1]*u+n[1]*h+i[1]*c,t[2]=e[2]*s+r[2]*u+n[2]*h+i[2]*c,t}function Mr(t,e,r,n,i,o){var a=1-o,s=a*a,u=o*o,h=s*a,c=3*o*s,f=3*u*a,l=u*o;return t[0]=e[0]*h+r[0]*c+n[0]*f+i[0]*l,t[1]=e[1]*h+r[1]*c+n[1]*f+i[1]*l,t[2]=e[2]*h+r[2]*c+n[2]*f+i[2]*l,t}function gr(t,e){e=e||1;var r=2*M()*Math.PI,n=2*M()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}function vr(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return a=a||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/a,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,t}function mr(t,e,r){var n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}function br(t,e,r){var n=r[0],i=r[1],o=r[2],a=r[3],s=e[0],u=e[1],h=e[2],c=i*h-o*u,f=o*s-n*h,l=n*u-i*s,d=i*l-o*f,p=o*c-n*l,M=n*f-i*c,g=2*a;return c*=g,f*=g,l*=g,d*=2,p*=2,M*=2,t[0]=s+c+d,t[1]=u+f+p,t[2]=h+l+M,t}function yr(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function xr(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function Sr(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function Pr(t,e){var r=t[0],n=t[1],i=t[2],o=e[0],a=e[1],s=e[2],u=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(o*o+a*a+s*s),h=u&&fr(t,e)/u;return Math.acos(Math.min(Math.max(h,-1),1))}function wr(t){return t[0]=0,t[1]=0,t[2]=0,t}function Br(t){return\"vec3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\")\"}function Ir(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Rr(t,e){var r=t[0],n=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-s)<=d*Math.max(1,Math.abs(i),Math.abs(s))}var Or,Ar=Qe,Lr=Ke,Er=We,_r=or,Fr=ar,Cr=Ne,jr=sr,qr=(Or=Ue(),function(t,e,r,n,i,o){var a,s;for(e||(e=3),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,a=r;a0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=o*a,t}function sn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function un(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],o=r[0]*n[2]-r[2]*n[0],a=r[0]*n[3]-r[3]*n[0],s=r[1]*n[2]-r[2]*n[1],u=r[1]*n[3]-r[3]*n[1],h=r[2]*n[3]-r[3]*n[2],c=e[0],f=e[1],l=e[2],d=e[3];return t[0]=f*h-l*u+d*s,t[1]=-c*h+l*a-d*o,t[2]=c*u-f*a+d*i,t[3]=-c*s+f*o-l*i,t}function hn(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t[3]=s+n*(r[3]-s),t}function cn(t,e){var r,n,i,o,a,s;e=e||1;do{a=(r=2*M()-1)*r+(n=2*M()-1)*n}while(a>=1);do{s=(i=2*M()-1)*i+(o=2*M()-1)*o}while(s>=1);var u=Math.sqrt((1-a)/s);return t[0]=e*r,t[1]=e*n,t[2]=e*i*u,t[3]=e*o*u,t}function fn(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}function ln(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2],h=r[3],c=h*n+s*o-u*i,f=h*i+u*n-a*o,l=h*o+a*i-s*n,d=-a*n-s*i-u*o;return t[0]=c*h+d*-a+f*-u-l*-s,t[1]=f*h+d*-s+l*-a-c*-u,t[2]=l*h+d*-u+c*-s-f*-a,t[3]=e[3],t}function dn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function pn(t){return\"vec4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}function Mn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function gn(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],h=e[3];return Math.abs(r-a)<=d*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-h)<=d*Math.max(1,Math.abs(o),Math.abs(h))}var vn=Yr,mn=Nr,bn=Zr,yn=Jr,xn=tn,Sn=en,Pn=rn,wn=function(){var t=Tr();return function(e,r,n,i,o,a){var s,u;for(r||(r=4),n||(n=0),u=i?Math.min(i*r+n,e.length):e.length,s=n;sd?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r}function An(t,e){var r=ii(t,e);return Math.acos(2*r*r-1)}function Ln(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*c+a*s+i*h-o*u,t[1]=i*c+a*u+o*s-n*h,t[2]=o*c+a*h+n*u-i*s,t[3]=a*c-n*s-i*u-o*h,t}function En(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+a*s,t[1]=i*u+o*s,t[2]=o*u-i*s,t[3]=a*u-n*s,t}function _n(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u-o*s,t[1]=i*u+a*s,t[2]=o*u+n*s,t[3]=a*u-i*s,t}function Fn(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+i*s,t[1]=i*u-n*s,t[2]=o*u+a*s,t[3]=a*u-o*s,t}function Cn(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function jn(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=Math.sqrt(r*r+n*n+i*i),s=Math.exp(o),u=a>0?s*Math.sin(a)/a:0;return t[0]=r*u,t[1]=n*u,t[2]=i*u,t[3]=s*Math.cos(a),t}function qn(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=Math.sqrt(r*r+n*n+i*i),s=a>0?Math.atan2(a,o)/a:0;return t[0]=r*s,t[1]=n*s,t[2]=i*s,t[3]=.5*Math.log(r*r+n*n+i*i+o*o),t}function Tn(t,e,r){return qn(t,e),ni(t,t,r),jn(t,t),t}function Dn(t,e,r,n){var i,o,a,s,u,h=e[0],c=e[1],f=e[2],l=e[3],p=r[0],M=r[1],g=r[2],v=r[3];return(o=h*p+c*M+f*g+l*v)<0&&(o=-o,p=-p,M=-M,g=-g,v=-v),1-o>d?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-n)*i)/a,u=Math.sin(n*i)/a):(s=1-n,u=n),t[0]=s*h+u*p,t[1]=s*c+u*M,t[2]=s*f+u*g,t[3]=s*l+u*v,t}function Vn(t){var e=M(),r=M(),n=M(),i=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*r),t[1]=i*Math.cos(2*Math.PI*r),t[2]=o*Math.sin(2*Math.PI*n),t[3]=o*Math.cos(2*Math.PI*n),t}function kn(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o,s=a?1/a:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=o*s,t}function zn(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Un(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*o+a]-e[3*a+o])*r,t[o]=(e[3*o+i]+e[3*i+o])*r,t[a]=(e[3*a+i]+e[3*i+a])*r}return t}function Yn(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(r),u=Math.cos(r),h=Math.sin(n),c=Math.cos(n);return t[0]=o*u*c-a*s*h,t[1]=a*s*c+o*u*h,t[2]=a*u*h-o*s*c,t[3]=a*u*c+o*s*h,t}function Nn(t){return\"quat(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}var Zn,Xn,Hn,Gn,Qn,Kn,Wn=Dr,$n=Vr,Jn=kr,ti=zr,ei=Ur,ri=Ln,ni=Wr,ii=sn,oi=hn,ai=en,si=ai,ui=rn,hi=ui,ci=an,fi=Mn,li=gn,di=(Zn=Ue(),Xn=Ze(1,0,0),Hn=Ze(0,1,0),function(t,e,r){var n=fr(e,r);return n<-.999999?(lr(Zn,Xn,e),Cr(Zn)<1e-6&&lr(Zn,Hn,e),cr(Zn,Zn),Rn(t,Zn,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(lr(Zn,e,r),t[0]=Zn[0],t[1]=Zn[1],t[2]=Zn[2],t[3]=1+n,ci(t,t))}),pi=(Gn=Bn(),Qn=Bn(),function(t,e,r,n,i,o){return Dn(Gn,e,i,o),Dn(Qn,r,n,o),Dn(t,Gn,Qn,2*o*(1-o)),t}),Mi=(Kn=vt(),function(t,e,r,n){return Kn[0]=r[0],Kn[3]=r[1],Kn[6]=r[2],Kn[1]=n[0],Kn[4]=n[1],Kn[7]=n[2],Kn[2]=-e[0],Kn[5]=-e[1],Kn[8]=-e[2],ci(t,Un(t,Kn))});function gi(){var t=new p(8);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function vi(t){var e=new p(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function mi(t,e,r,n,i,o,a,s){var u=new p(8);return u[0]=t,u[1]=e,u[2]=r,u[3]=n,u[4]=i,u[5]=o,u[6]=a,u[7]=s,u}function bi(t,e,r,n,i,o,a){var s=new p(8);s[0]=t,s[1]=e,s[2]=r,s[3]=n;var u=.5*i,h=.5*o,c=.5*a;return s[4]=u*n+h*r-c*e,s[5]=h*n+c*t-u*r,s[6]=c*n+u*e-h*t,s[7]=-u*t-h*e-c*r,s}function yi(t,e,r){var n=.5*r[0],i=.5*r[1],o=.5*r[2],a=e[0],s=e[1],u=e[2],h=e[3];return t[0]=a,t[1]=s,t[2]=u,t[3]=h,t[4]=n*h+i*u-o*s,t[5]=i*h+o*a-n*u,t[6]=o*h+n*s-i*a,t[7]=-n*a-i*s-o*u,t}function xi(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function Si(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Pi(t,e){var r=Bn();Se(r,e);var n=new p(3);return ye(n,e),yi(t,r,n),t}function wi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function Bi(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Ii(t,e,r,n,i,o,a,s,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t}var Ri=Jn;function Oi(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var Ai=Jn;function Li(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function Ei(t,e){var r=e[4],n=e[5],i=e[6],o=e[7],a=-e[0],s=-e[1],u=-e[2],h=e[3];return t[0]=2*(r*h+o*a+n*u-i*s),t[1]=2*(n*h+o*s+i*a-r*u),t[2]=2*(i*h+o*u+r*s-n*a),t}function _i(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=.5*r[0],u=.5*r[1],h=.5*r[2],c=e[4],f=e[5],l=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=a*s+i*h-o*u+c,t[5]=a*u+o*s-n*h+f,t[6]=a*h+n*u-i*s+l,t[7]=-n*s-i*u-o*h+d,t}function Fi(t,e,r){var n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=s*a+c*n+u*o-h*i,l=u*a+c*i+h*n-s*o,d=h*a+c*o+s*i-u*n,p=c*a-s*n-u*i-h*o;return En(t,e,r),n=t[0],i=t[1],o=t[2],a=t[3],t[4]=f*a+p*n+l*o-d*i,t[5]=l*a+p*i+d*n-f*o,t[6]=d*a+p*o+f*i-l*n,t[7]=p*a-f*n-l*i-d*o,t}function Ci(t,e,r){var n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=s*a+c*n+u*o-h*i,l=u*a+c*i+h*n-s*o,d=h*a+c*o+s*i-u*n,p=c*a-s*n-u*i-h*o;return _n(t,e,r),n=t[0],i=t[1],o=t[2],a=t[3],t[4]=f*a+p*n+l*o-d*i,t[5]=l*a+p*i+d*n-f*o,t[6]=d*a+p*o+f*i-l*n,t[7]=p*a-f*n-l*i-d*o,t}function ji(t,e,r){var n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=s*a+c*n+u*o-h*i,l=u*a+c*i+h*n-s*o,d=h*a+c*o+s*i-u*n,p=c*a-s*n-u*i-h*o;return Fn(t,e,r),n=t[0],i=t[1],o=t[2],a=t[3],t[4]=f*a+p*n+l*o-d*i,t[5]=l*a+p*i+d*n-f*o,t[6]=d*a+p*o+f*i-l*n,t[7]=p*a-f*n-l*i-d*o,t}function qi(t,e,r){var n=r[0],i=r[1],o=r[2],a=r[3],s=e[0],u=e[1],h=e[2],c=e[3];return t[0]=s*a+c*n+u*o-h*i,t[1]=u*a+c*i+h*n-s*o,t[2]=h*a+c*o+s*i-u*n,t[3]=c*a-s*n-u*i-h*o,s=e[4],u=e[5],h=e[6],c=e[7],t[4]=s*a+c*n+u*o-h*i,t[5]=u*a+c*i+h*n-s*o,t[6]=h*a+c*o+s*i-u*n,t[7]=c*a-s*n-u*i-h*o,t}function Ti(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*c+a*s+i*h-o*u,t[1]=i*c+a*u+o*s-n*h,t[2]=o*c+a*h+n*u-i*s,t[3]=a*c-n*s-i*u-o*h,s=r[4],u=r[5],h=r[6],c=r[7],t[4]=n*c+a*s+i*h-o*u,t[5]=i*c+a*u+o*s-n*h,t[6]=o*c+a*h+n*u-i*s,t[7]=a*c-n*s-i*u-o*h,t}function Di(t,e,r,n){if(Math.abs(n)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,o=e[2]/r,a=e[3]/r,s=e[4],u=e[5],h=e[6],c=e[7],f=n*s+i*u+o*h+a*c;t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=(s-n*f)/r,t[5]=(u-i*f)/r,t[6]=(h-o*f)/r,t[7]=(c-a*f)/r}return t}function $i(t){return\"quat2(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\")\"}function Ji(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function to(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],h=t[7],c=e[0],f=e[1],l=e[2],p=e[3],M=e[4],g=e[5],v=e[6],m=e[7];return Math.abs(r-c)<=d*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(n-f)<=d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-l)<=d*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(o-p)<=d*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-M)<=d*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(s-g)<=d*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(u-v)<=d*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(h-m)<=d*Math.max(1,Math.abs(h),Math.abs(m))}function eo(){var t=new p(2);return p!=Float32Array&&(t[0]=0,t[1]=0),t}function ro(t){var e=new p(2);return e[0]=t[0],e[1]=t[1],e}function no(t,e){var r=new p(2);return r[0]=t,r[1]=e,r}function io(t,e){return t[0]=e[0],t[1]=e[1],t}function oo(t,e,r){return t[0]=e,t[1]=r,t}function ao(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function so(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function uo(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function ho(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function co(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function fo(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function lo(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function po(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function Mo(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function go(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function vo(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function mo(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function bo(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function yo(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function xo(t){var e=t[0],r=t[1];return e*e+r*r}function So(t,e){return t[0]=-e[0],t[1]=-e[1],t}function Po(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function wo(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function Bo(t,e){return t[0]*e[0]+t[1]*e[1]}function Io(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function Ro(t,e,r,n){var i=e[0],o=e[1];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t}function Oo(t,e){e=e||1;var r=2*M()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function Ao(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function Lo(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function Eo(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function _o(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function Fo(t,e,r,n){var i=e[0]-r[0],o=e[1]-r[1],a=Math.sin(n),s=Math.cos(n);return t[0]=i*s-o*a+r[0],t[1]=i*a+o*s+r[1],t}function Co(t,e){var r=t[0],n=t[1],i=e[0],o=e[1],a=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+o*o),s=a&&(r*i+n*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function jo(t){return t[0]=0,t[1]=0,t}function qo(t){return\"vec2(\"+t[0]+\", \"+t[1]+\")\"}function To(t,e){return t[0]===e[0]&&t[1]===e[1]}function Do(t,e){var r=t[0],n=t[1],i=e[0],o=e[1];return Math.abs(r-i)<=d*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-o)<=d*Math.max(1,Math.abs(n),Math.abs(o))}var Vo=yo,ko=so,zo=uo,Uo=ho,Yo=mo,No=bo,Zo=xo,Xo=function(){var t=eo();return function(e,r,n,i,o,a){var s,u;for(r||(r=2),n||(n=0),u=i?Math.min(i*r+n,e.length):e.length,s=n;s{var n;!function(){\"use strict\";var i=.5*(Math.sqrt(3)-1),o=(3-Math.sqrt(3))/6,a=1/6,s=(Math.sqrt(5)-1)/4,u=(5-Math.sqrt(5))/20;function h(t){var e;e=\"function\"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=f();t=i(\" \"),e=i(\" \"),r=i(\" \");for(var o=0;o>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}h.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,a=this.permMod12,s=this.perm,u=this.grad3,h=0,c=0,f=0,l=(t+e)*i,d=Math.floor(t+l),p=Math.floor(e+l),M=(d+p)*o,g=t-(d-M),v=e-(p-M);g>v?(r=1,n=0):(r=0,n=1);var m=g-r+o,b=v-n+o,y=g-1+2*o,x=v-1+2*o,S=255&d,P=255&p,w=.5-g*g-v*v;if(w>=0){var B=3*a[S+s[P]];h=(w*=w)*w*(u[B]*g+u[B+1]*v)}var I=.5-m*m-b*b;if(I>=0){var R=3*a[S+r+s[P+n]];c=(I*=I)*I*(u[R]*m+u[R+1]*b)}var O=.5-y*y-x*x;if(O>=0){var A=3*a[S+1+s[P+1]];f=(O*=O)*O*(u[A]*y+u[A+1]*x)}return 70*(h+c+f)},noise3D:function(t,e,r){var n,i,o,s,u,h,c,f,l,d,p=this.permMod12,M=this.perm,g=this.grad3,v=.3333333333333333*(t+e+r),m=Math.floor(t+v),b=Math.floor(e+v),y=Math.floor(r+v),x=(m+b+y)*a,S=t-(m-x),P=e-(b-x),w=r-(y-x);S>=P?P>=w?(u=1,h=0,c=0,f=1,l=1,d=0):S>=w?(u=1,h=0,c=0,f=1,l=0,d=1):(u=0,h=0,c=1,f=1,l=0,d=1):P_?j++:q++,E>F?j++:T++,E>C?j++:D++,_>F?q++:T++,_>C?q++:D++,F>C?T++:D++;var V=E-(f=j>=3?1:0)+u,k=_-(l=q>=3?1:0)+u,z=F-(d=T>=3?1:0)+u,U=C-(p=D>=3?1:0)+u,Y=E-(M=j>=2?1:0)+2*u,N=_-(g=q>=2?1:0)+2*u,Z=F-(v=T>=2?1:0)+2*u,X=C-(m=D>=2?1:0)+2*u,H=E-(b=j>=1?1:0)+3*u,G=_-(y=q>=1?1:0)+3*u,Q=F-(x=T>=1?1:0)+3*u,K=C-(S=D>=1?1:0)+3*u,W=E-1+4*u,$=_-1+4*u,J=F-1+4*u,tt=C-1+4*u,et=255&I,rt=255&R,nt=255&O,it=255&A,ot=.6-E*E-_*_-F*F-C*C;if(ot<0)i=0;else{var at=P[et+P[rt+P[nt+P[it]]]]%32*4;i=(ot*=ot)*ot*(w[at]*E+w[at+1]*_+w[at+2]*F+w[at+3]*C)}var st=.6-V*V-k*k-z*z-U*U;if(st<0)o=0;else{var ut=P[et+f+P[rt+l+P[nt+d+P[it+p]]]]%32*4;o=(st*=st)*st*(w[ut]*V+w[ut+1]*k+w[ut+2]*z+w[ut+3]*U)}var ht=.6-Y*Y-N*N-Z*Z-X*X;if(ht<0)a=0;else{var ct=P[et+M+P[rt+g+P[nt+v+P[it+m]]]]%32*4;a=(ht*=ht)*ht*(w[ct]*Y+w[ct+1]*N+w[ct+2]*Z+w[ct+3]*X)}var ft=.6-H*H-G*G-Q*Q-K*K;if(ft<0)h=0;else{var lt=P[et+b+P[rt+y+P[nt+x+P[it+S]]]]%32*4;h=(ft*=ft)*ft*(w[lt]*H+w[lt+1]*G+w[lt+2]*Q+w[lt+3]*K)}var dt=.6-W*W-$*$-J*J-tt*tt;if(dt<0)c=0;else{var pt=P[et+1+P[rt+1+P[nt+1+P[it+1]]]]%32*4;c=(dt*=dt)*dt*(w[pt]*W+w[pt+1]*$+w[pt+2]*J+w[pt+3]*tt)}return 27*(i+o+a+h+c)}},h._buildPermutationTable=c,void 0===(n=function(){return h}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=h,t.exports=h}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r(915)})()}));","/*\n (c) 2017, Vladimir Agafonkin\n Simplify.js, a high-performance JS polyline simplification library\n mourner.github.io/simplify-js\n*/\n\n(function () { 'use strict';\n\n// to suit your point format, run search/replace for '.x' and '.y';\n// for 3D version, see 3d branch (configurability would draw significant performance overhead)\n\n// square distance between 2 points\nfunction getSqDist(p1, p2) {\n\n var dx = p1.x - p2.x,\n dy = p1.y - p2.y;\n\n return dx * dx + dy * dy;\n}\n\n// square distance from a point to a segment\nfunction getSqSegDist(p, p1, p2) {\n\n var x = p1.x,\n y = p1.y,\n dx = p2.x - x,\n dy = p2.y - y;\n\n if (dx !== 0 || dy !== 0) {\n\n var t = ((p.x - x) * dx + (p.y - y) * dy) / (dx * dx + dy * dy);\n\n if (t > 1) {\n x = p2.x;\n y = p2.y;\n\n } else if (t > 0) {\n x += dx * t;\n y += dy * t;\n }\n }\n\n dx = p.x - x;\n dy = p.y - y;\n\n return dx * dx + dy * dy;\n}\n// rest of the code doesn't care about point format\n\n// basic distance-based simplification\nfunction simplifyRadialDist(points, sqTolerance) {\n\n var prevPoint = points[0],\n newPoints = [prevPoint],\n point;\n\n for (var i = 1, len = points.length; i < len; i++) {\n point = points[i];\n\n if (getSqDist(point, prevPoint) > sqTolerance) {\n newPoints.push(point);\n prevPoint = point;\n }\n }\n\n if (prevPoint !== point) newPoints.push(point);\n\n return newPoints;\n}\n\nfunction simplifyDPStep(points, first, last, sqTolerance, simplified) {\n var maxSqDist = sqTolerance,\n index;\n\n for (var i = first + 1; i < last; i++) {\n var sqDist = getSqSegDist(points[i], points[first], points[last]);\n\n if (sqDist > maxSqDist) {\n index = i;\n maxSqDist = sqDist;\n }\n }\n\n if (maxSqDist > sqTolerance) {\n if (index - first > 1) simplifyDPStep(points, first, index, sqTolerance, simplified);\n simplified.push(points[index]);\n if (last - index > 1) simplifyDPStep(points, index, last, sqTolerance, simplified);\n }\n}\n\n// simplification using Ramer-Douglas-Peucker algorithm\nfunction simplifyDouglasPeucker(points, sqTolerance) {\n var last = points.length - 1;\n\n var simplified = [points[0]];\n simplifyDPStep(points, 0, last, sqTolerance, simplified);\n simplified.push(points[last]);\n\n return simplified;\n}\n\n// both algorithms combined for awesome performance\nfunction simplify(points, tolerance, highestQuality) {\n\n if (points.length <= 2) return points;\n\n var sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1;\n\n points = highestQuality ? points : simplifyRadialDist(points, sqTolerance);\n points = simplifyDouglasPeucker(points, sqTolerance);\n\n return points;\n}\n\n// export as AMD module / Node module / browser or worker variable\nif (typeof define === 'function' && define.amd) define(function() { return simplify; });\nelse if (typeof module !== 'undefined') {\n module.exports = simplify;\n module.exports.default = simplify;\n} else if (typeof self !== 'undefined') self.simplify = simplify;\nelse window.simplify = simplify;\n\n})();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.concat = exports.round = void 0;\nconst round = (value, decimals) => Math.round(value * 10 ** decimals) / 10 ** decimals;\nexports.round = round;\nconst concat = (result, data) => {\n if (typeof data === 'string')\n result.push(data);\n else\n data.forEach(line => result.push(line));\n};\nexports.concat = concat;\n//# sourceMappingURL=utilities.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./SVGExporter\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SVGExporter = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nclass SVGExporter {\n static parse(scene, settings = {}) {\n const bindedSettings = {\n ...SVGExporter.defaults,\n ...settings,\n };\n return SVGExporter.generate(scene, bindedSettings);\n }\n /**\n * Get drawer prop\n *\n * @param key name of the property (fill, stroke, lineWidth)\n * @param propArguments currentIndexing propArguments\n * @param defaultValue\n *\n * @returns string | number\n */\n static getSVGProp(key, propArguments, defaultValue) {\n let attribute = propArguments.shape.drawer[key];\n if (typeof attribute === 'function') {\n attribute = attribute(propArguments);\n }\n return attribute !== null && attribute !== void 0 ? attribute : defaultValue;\n }\n /**\n *\n * @param type fill | stroke\n * @param color string\n * @param attriburesPtr list of attributes to apply\n * @param stylePtr Array of string to put in style attr\n *\n * @returns\n */\n static bindColorAttribute(type, color, attriburesPtr, stylePtr) {\n if (typeof color === 'undefined')\n return;\n if (color === 'none') {\n attriburesPtr.push(`${type}=\"none\"`);\n }\n else {\n const parsed = color_1.parseColorAndConvert(color);\n if (parsed) {\n if (parsed.alpha !== 1) {\n stylePtr.push(`${type}-opacity: ${parsed.alpha}`);\n }\n attriburesPtr.push(`${type}=\"${color_1.rgbToHex(parsed.r, parsed.g, parsed.b)}\"`);\n }\n }\n }\n /**\n * Generate SVG from scene and settings\n *\n * @param scene\n * @param settings\n * @returns\n */\n static generate(scene, settings) {\n const paths = SVGExporter.generatePaths(scene, settings);\n let background;\n if (settings.background) {\n const attributes = [];\n const styles = [];\n SVGExporter.bindColorAttribute('fill', scene.background, attributes, styles);\n styles.length > 0 && attributes.push(`styles=\"${styles.join('; ')}\"`);\n background = ``;\n }\n return (`` +\n `\\n\\t` +\n (background ? `\\n\\t${background}` : '') +\n `\\n\\t${paths.join('\\n\\t')}` +\n `\\n`);\n }\n /**\n * Convert shapes to paths\n *\n * @param scene\n * @param settings\n * @returns\n */\n static generatePaths(scene, settings) {\n const paths = [];\n const sceneChilds = scene.getChildren();\n for (let i = 0, len = sceneChilds.length; i < len; i++) {\n sceneChilds[i].generate(0, true);\n const childBuffer = sceneChilds[i].getBuffer() || [];\n const childIndexedBuffer = sceneChilds[i].getIndexedBuffer() || [];\n let childVertexIndex = 0;\n for (let currentBufferIndex = 0, len = childIndexedBuffer.length; currentBufferIndex < len; currentBufferIndex++) {\n const currentIndexing = childIndexedBuffer[currentBufferIndex];\n // Store points\n const points = [];\n for (let len = childVertexIndex + currentIndexing.frameLength; childVertexIndex < len; childVertexIndex += 2) {\n points.push(childBuffer[childVertexIndex].toFixed(settings.decimals) +\n ' ' +\n childBuffer[childVertexIndex + 1].toFixed(settings.decimals));\n }\n // get styles and bind attributes\n const propArguments = {\n shape: currentIndexing.shape,\n repetition: currentIndexing.repetition,\n parent: currentIndexing.parent,\n };\n const attributes = [];\n const styles = [];\n const fill = SVGExporter.getSVGProp('fill', propArguments);\n SVGExporter.bindColorAttribute('fill', fill || 'none', attributes, styles);\n const stroke = SVGExporter.getSVGProp('stroke', propArguments, typeof fill === 'undefined' ? scene.color : undefined);\n SVGExporter.bindColorAttribute('stroke', stroke, attributes, styles);\n const lineWidth = SVGExporter.getSVGProp('lineWidth', propArguments, 1);\n if (stroke)\n attributes.push(`stroke-width=\"${lineWidth || 1}\"`);\n // move style to attributes\n styles.length > 0 && attributes.push(`style=\"${styles.join('; ')}\"`);\n // build path\n const d = `M${points.join(' L')} ${currentIndexing.shape.isClosed() ? 'Z' : ''}`;\n const path = ``;\n paths.push(path);\n }\n }\n return paths;\n }\n}\nexports.SVGExporter = SVGExporter;\nSVGExporter.defaults = {\n decimals: 3,\n background: true,\n};\n//# sourceMappingURL=SVGExporter.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./conversions\"), exports);\n__exportStar(require(\"./parsing\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.rgbToHsl = exports.hslToRgb = exports.rgbToHex = void 0;\n/**\n * Convert rgb to hex\n *\n * @param r number between 0 - 255\n * @param g number between 0 - 255\n * @param b number between 0 - 255\n * @returns #ffffff\n */\nfunction rgbToHex(r, g, b) {\n return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;\n}\nexports.rgbToHex = rgbToHex;\n/**\n * Convert hsl (0-360, 0-100, 0-100) color to rgb(0-255, 0-255, 0-255)\n *\n * @param {number} h number between 0 - 360\n * @param {number} s number between 0 - 100\n * @param {number} l number between 0 - 100\n * @returns {[number, number, number]} [0-255, 0-255, 0-255]\n */\nfunction hslToRgb(h, s, l) {\n h /= 360;\n s /= 100;\n l /= 100;\n let r, g, b;\n if (s == 0) {\n r = g = b = l; // achromatic\n }\n else {\n const hue2rgb = (p, q, t) => {\n t += t < 0 ? 1 : t > 1 ? -1 : 0;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n };\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return [(0.5 + r * 255) << 0, (0.5 + g * 255) << 0, (0.5 + b * 255) << 0];\n}\nexports.hslToRgb = hslToRgb;\n/**\n * Convert rbg (0-255, 0-255, 0-255) to hsl (0-360, 0-100, 0-100)\n *\n * @param {number} r number between 0 - 255\n * @param {number} g number between 0 - 255\n * @param {number} b number between 0 - 255\n * @returns {[number, number, number]} (0-360, 0-100, 0-100)\n */\nfunction rgbToHsl(r, g, b) {\n r /= 255;\n g /= 255;\n b /= 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s;\n if (max === min) {\n h = s = 0;\n }\n else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h = h / 6;\n }\n return [(0.5 + h * 360) << 0, (0.5 + s * 100) << 0, (0.5 + l * 100) << 0];\n}\nexports.rgbToHsl = rgbToHsl;\n//# sourceMappingURL=conversions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseColor = exports.parseColorAndConvert = void 0;\nconst conversions_1 = require(\"./conversions\");\n/**\n * Convert color to IConvertedColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IConvertedColor | undefined)}\n */\nfunction parseColorAndConvert(color) {\n const parsed = parseColor(color);\n if (parsed) {\n if (parsed.type === 'hsl') {\n const [r, g, b] = conversions_1.hslToRgb(parsed.a, parsed.b, parsed.c);\n return {\n r,\n g,\n b,\n h: parsed.a,\n s: parsed.b,\n l: parsed.c,\n alpha: parsed.alpha,\n };\n }\n else {\n const [h, s, l] = conversions_1.rgbToHsl(parsed.a, parsed.b, parsed.c);\n return {\n h,\n s,\n l,\n r: parsed.a,\n g: parsed.b,\n b: parsed.c,\n alpha: parsed.alpha,\n };\n }\n }\n}\nexports.parseColorAndConvert = parseColorAndConvert;\n/**\n * Convert color to IColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IColor | undefined)}\n */\nfunction parseColor(color) {\n if (typeof color === 'number') {\n if (color > 0xffffff) {\n return {\n type: 'rgb',\n a: (color >> 24) & 255,\n b: (color >> 16) & 255,\n c: (color >> 8) & 255,\n alpha: (color & 255) / 255,\n };\n }\n else {\n return { type: 'rgb', a: (color >> 16) & 255, b: (color >> 8) & 255, c: color & 255, alpha: 1 };\n }\n }\n color = color.replace(/\\s/g, '');\n let match = /^#([0-9a-f]{3,8})$/i.exec(color);\n if (match) {\n const hex = match[1];\n if (hex.length === 3) {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[0], 16),\n b: parseInt(hex[1] + hex[1], 16),\n c: parseInt(hex[2] + hex[2], 16),\n alpha: 1,\n };\n }\n else {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[1], 16),\n b: parseInt(hex[2] + hex[3], 16),\n c: parseInt(hex[4] + hex[5], 16),\n alpha: hex.length > 6 ? parseInt(hex.substring(6), 16) / 255 : 1,\n };\n }\n }\n match = /^((hsl|rgb)a?)\\((\\d+),(\\d+)%?,(\\d+)%?,?(.+)?\\)$/i.exec(color);\n if (match) {\n const [, , type, a, b, c, alpha] = match;\n return {\n type: type,\n a: +a,\n b: +b,\n c: +c,\n alpha: alpha ? +alpha : 1,\n };\n }\n}\nexports.parseColor = parseColor;\n//# sourceMappingURL=parsing.js.map","/*! For license information please see urpflanze-svg-importer.min.js.LICENSE.txt */\n!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.SVGImporter=e():t.SVGImporter=e()}(window,(function(){return(()=>{var t={877:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.SVGImporter=void 0;const n=r(500),i=r(688),s=r(926),o=r(926),a=r(479),h=r(721),u=r(197),c=r(825);class l{static isSVG(t){return l.SVG_REGEX.test(t.replace(l.COMMENT_REGEX,\"\"))}static getWindowInstance(){return l.windowInstance}static setWindowInstance(t){l.windowInstance=t}static stringToSVG(t){if(t=t.trim(),!l.isSVG(t))return console.warn(\"[Urpflanze:SVGImport] | Input is not valid SVG string\",t),null;const e=l.windowInstance.document.createElement(\"div\");return e.innerHTML=t,e.firstChild}static parse(t,e=.01,r){if(!1===l.isSVG(t))return console.warn(\"[Urpflanze:SVGImport] | Input is not valid svg\",t),null;const n=l.svgToBuffers(t,e);return n?l.parsedToShape(n,r):null}static parsedToShape(t,e){const r=[];if(t.buffers.forEach(((t,n)=>{const i=new s.ShapeBuffer({shape:t.buffer,bClosed:t.bClosed,sideLength:e,drawer:t.drawer});i&&r.push(i)})),1===r.length)return r[0];const n=new s.Group;return r.forEach((t=>n.add(t))),new s.Shape({shape:n})}static svgToBuffers(t,e=.01){const r=\"string\"==typeof t?l.stringToSVG(t):t;if(null===r)return console.error(\"[Urpflanze:SVGImport] | Cannot convert string to svg\",t),null;const n=l.getViewbox(r);r.querySelectorAll(\"g\").forEach(l.propagateGroupTransformAndStyleToChildren);const i=Array.from(r.querySelectorAll(\"rect, circle, ellipse, line, polyline, polygon, path\")),o=[].concat(...i.map((t=>l.elementToPath(t)))),a=Math.max(n[2]-n[0],n[3]-n[1]).toExponential(1).match(/e(\\+?[0-9]+)/),h=10/(1e3/Math.min(10**Math.max(a?+a[1]:0,0),1e3));let u=o.map((t=>l.pathToBuffer(t,h,n))).filter((t=>!!t&&t.length>=2));u=u.map((t=>l.simpliyBuffer(t,e))),u=u.map(((t,e)=>l.pathIsClosed(o[e])&&s.Vec2.distance([t[0],t[1]],[t[t.length-2],t[t.length-1]])<1?t.subarray(0,t.length-2):t));const f=Math.sqrt((n[2]-n[0])*(n[3]-n[1])),d=l.getStyleAttr(\"fill\",r),p=l.getStyleAttr(\"stroke\",r),m=l.getStyleAttr(\"stroke-width\",r,f/100),g=[];for(let t=0;t=0?c.fromPercentage(parseFloat(e),f):parseFloat(e));const n=l.getStyleAttr(\"fill\",o[t],d||void 0),i=l.getStyleAttr(\"stroke\",o[t],n?void 0:p||\"rgba(255,255,255)\"),s=r||(i?m:void 0);g.push({buffer:u[t],bClosed:l.pathIsClosed(o[t]),drawer:{fill:n,stroke:i,lineWidth:s?s/(f/100):void 0}})}return i.forEach((t=>t.remove())),{viewBox:n,buffers:g}}static getStyleAttr(t,e,r){const n=e.getAttribute(t);if(\"none\"===n)return;let s;if(null!=n)s=n;else{const r=\"stroke-width\"===t?\"strokeWidth\":t;void 0!==e.style[r]&&e.style[r].length>0&&(s=e.style[r])}if(void 0===s)return r;if(\"stroke-width\"===t)return parseFloat(s);let o=parseFloat(e.getAttribute(\"opacity\")||\"1\");const a=e.getAttribute(\"style\");if(a&&a.length){const e=new RegExp(`${t}-opacity: +?(\\\\d?.\\\\d|\\\\d)`,\"i\"),r=a.match(e);r&&(o=parseFloat(r[1]))}const h=i.parseColor(s);return h?(o=1!==h.alpha?h.alpha:o,\"rgb\"===h.type?`rgba(${h.a}, ${h.b}, ${h.c}, ${o})`:`hsla(${h.a}, ${h.b}%, ${h.c}%, ${o})`):r}static getViewbox(t){const e=t.getAttribute(\"viewBox\");if(e)return e.split(\" \").map((t=>parseFloat(t)));const r=t.getAttribute(\"width\"),n=t.getAttribute(\"height\");if(r&&n)return[0,0,parseFloat(r),parseFloat(n)];t=t.cloneNode(!0);const i=Array.from(t.querySelectorAll(\"rect, circle, ellipse, line, polyline, polygon, path\")),s=[].concat.apply([],i.map(l.elementToPath));let a=0,h=0;for(let t=0,e=s.length;ta&&(a=t.width),t.height>h&&(h=t.height)}}return[0,0,a,h]}static pathIsClosed(t){var e;return\"z\"===(null===(e=t.getAttribute(\"d\"))||void 0===e?void 0:e.trim().substr(-1).toLowerCase())}static simpliyBuffer(t,e=.01){const r=[];for(let e=0,n=t.length;e{i[2*e]=t.x,i[2*e+1]=t.y})),i}static sanitizePath(t,e){return h(t).abs().unarc().transform(e||\"\").toString()}static pathToBuffer(t,e=.01,r=[-1,-1,1,1]){const i=r[2]-r[0],s=r[3]-r[1],o=2/Math.max(i,s),a=t.getAttribute(\"d\"),h=t.getAttribute(\"transform\")||\"\",u=new n.Path({d:l.sanitizePath(a,h)}),c=Math.floor(u.length()),f=2*Math.floor(c/e),d=new Float32Array(f);let p=0;for(let t=0;t0){const r=u.compose(u.fromDefinition(u.fromTransformAttribute(e))),n=t.children;Array.from(n).forEach((t=>{let n=t.getAttribute(\"transform\");if(n&&n.length>0){const t=u.compose(u.fromDefinition(u.fromTransformAttribute(n))),e=u.compose(r,t);n=u.toSVG(e)}else n=e;t.setAttribute(\"transform\",n)}))}[\"fill\",\"stroke\",\"stroke-width\",\"style\"].forEach((e=>{const r=t.getAttribute(e);r&&Array.from(t.children).forEach((t=>{null===t.getAttribute(e)&&t.setAttribute(e,r)}))}))}static elementToPath(t){const e=l.windowInstance.document;let r=[];return\"path\"===t.nodeName?r=h(t.getAttribute(\"d\")||\"\").abs().unarc().toString().split(\"M\").filter((t=>t.length>0)).map((t=>\"M\"+t)):[\"rect\",\"ellipse\",\"circle\",\"line\",\"polyline\",\"polygon\"].includes(t.nodeName)?r=[c.conversion[t.nodeName](t)]:console.warn(`[Urpflanze:SVGImport] | Cannot convert ${t.nodeName} to path`),r.map((r=>{const n=e.createElementNS(\"http://www.w3.org/2000/svg\",\"path\");return n.setAttribute(\"d\",r),n.setAttribute(\"transform\",t.getAttribute(\"transform\")||\"\"),n.setAttribute(\"style\",t.getAttribute(\"style\")||\"\"),n.setAttribute(\"fill\",l.getStyleAttr(\"fill\",t,\"\")+\"\"),n.setAttribute(\"stroke\",l.getStyleAttr(\"stroke\",t,\"\")+\"\"),n.setAttribute(\"opacity\",t.getAttribute(\"opacity\")||\"1\"),n.setAttribute(\"stroke-width\",l.getStyleAttr(\"stroke-width\",t,\"\")+\"\"),n}))}}e.SVGImporter=l,l.HEX_REGEX=\"#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})\",l.SVG_REGEX=/^\\s*(?:<\\?xml[^>]*>\\s*)?(?:]*\\s*(?:\\[?(?:\\s*]*>\\s*)*\\]?)*[^>]*>\\s*)?(?:]*>[^]*<\\/svg>|]*\\/\\s*>)\\s*$/i,l.COMMENT_REGEX=//g},625:function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),e.SVGImporter=void 0;const s=r(877);Object.defineProperty(e,\"SVGImporter\",{enumerable:!0,get:function(){return s.SVGImporter}}),i(r(291),e),s.SVGImporter.setWindowInstance(window),e.default=s.SVGImporter},291:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},825:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.conversion=e.fromPercentage=void 0,e.fromPercentage=(t,e)=>/%$/.test(t+\"\")?100*parseFloat((t+\"\").replace(\"%\",\"\"))/e:+t;const r={rect:t=>{const r=parseFloat(t.getAttribute(\"width\")||\"0\"),n=parseFloat(t.getAttribute(\"height\")||\"0\"),i=parseFloat(t.getAttribute(\"x\")||\"0\"),s=parseFloat(t.getAttribute(\"y\")||\"0\");let o=t.getAttribute(\"rx\")||\"auto\",a=t.getAttribute(\"ry\")||\"auto\";\"auto\"===o&&\"auto\"===a?o=a=0:\"auto\"!==o&&\"auto\"===a?o=a=e.fromPercentage(o,r):\"auto\"!==a&&\"auto\"===o?a=o=e.fromPercentage(a,n):(o=e.fromPercentage(o,r),a=e.fromPercentage(a,n)),o>r/2&&(o=r/2),a>n/2&&(a=n/2);const h=o>0&&a>0;return[`M${i+o} ${s}`,\"H\"+(i+r-o),...h?[`A${o} ${a} 0 0 1 ${i+r} ${s+a}`]:[],\"V\"+(s+n-a),...h?[`A${o} ${a} 0 0 1 ${i+r-o} ${s+n}`]:[],`H${i+o}`,...h?[`A${o} ${a} 0 0 1 ${i} ${s+n-a}`]:[],`V${s+a}`,...h?[`A${o} ${a} 0 0 1 ${i+o} ${s}`]:[],\"Z\"].join(\" \")},ellipse:t=>{var e,r,n,i;const s=parseFloat(t.getAttribute(\"cx\")||\"0\"),o=parseFloat(t.getAttribute(\"cy\")||\"0\"),a=parseFloat(null!==(r=null!==(e=t.getAttribute(\"rx\"))&&void 0!==e?e:t.getAttribute(\"r\"))&&void 0!==r?r:\"0\"),h=parseFloat(null!==(i=null!==(n=t.getAttribute(\"ry\"))&&void 0!==n?n:t.getAttribute(\"r\"))&&void 0!==i?i:\"0\");return[`M${s+a} ${o}`,`A${a} ${h} 0 0 1 ${s} ${o+h}`,`A${a} ${h} 0 0 1 ${s-a} ${o}`,`A${a} ${h} 0 0 1 ${s+a} ${o}`,\"Z\"].join(\" \")},circle:t=>r.ellipse(t),line:t=>`M${t.getAttribute(\"x1\")||\"0\"} ${t.getAttribute(\"y1\")||\"0\"} L${t.getAttribute(\"x2\")||\"0\"} ${t.getAttribute(\"y2\")||\"0\"}`,polyline:t=>((t,e=2)=>{const r=[];for(;t.length>0;)r.push(t.splice(0,e));return r})((t.getAttribute(\"points\")||\"\").trim().replace(/ +/g,\" \").split(\" \").reduce(((t,e)=>[...t,...e.includes(\",\")?e.split(\",\"):[e]]),[]),2).map((([t,e],r)=>`${0===r?\"M\":\"L\"}${t} ${e}`)).join(\" \"),polygon:t=>r.polyline(t)+\" Z\",path:t=>t.getAttribute(\"d\")+\"\"};e.conversion=r},500:(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{A:()=>ur,Animator:()=>Ve,Array:()=>Lt,Box:()=>mt,Circle:()=>ir,ClipPath:()=>sr,Color:()=>ut,Container:()=>qt,Controller:()=>pe,Defs:()=>Yt,Dom:()=>Nt,Ease:()=>de,Element:()=>Ft,Ellipse:()=>Wt,EventTarget:()=>Ot,ForeignObject:()=>or,Fragment:()=>Jt,G:()=>hr,Gradient:()=>ne,Image:()=>se,Line:()=>he,List:()=>yt,Marker:()=>ue,Mask:()=>cr,Matrix:()=>ft,Morphable:()=>Ie,NonMorphable:()=>Re,Number:()=>kt,ObjectBag:()=>Le,PID:()=>ye,Path:()=>Fe,PathArray:()=>Ee,Pattern:()=>ie,Point:()=>ct,PointArray:()=>oe,Polygon:()=>qe,Polyline:()=>Ye,Queue:()=>ze,Rect:()=>De,Runner:()=>Ue,SVG:()=>mr,Shape:()=>Dt,Spring:()=>ge,Stop:()=>lr,Style:()=>fr,Svg:()=>Ke,Symbol:()=>tr,Text:()=>rr,TextPath:()=>dr,Timeline:()=>Xe,TransformBag:()=>Ce,Tspan:()=>nr,Use:()=>pr,adopt:()=>N,assignNewId:()=>V,clearEvents:()=>St,create:()=>L,defaults:()=>Tt,dispatch:()=>Et,easing:()=>le,eid:()=>z,extend:()=>$,find:()=>bt,getClass:()=>Y,getEventTarget:()=>_t,getEvents:()=>wt,getWindow:()=>I,makeInstance:()=>k,makeMorphable:()=>Ne,mockAdopt:()=>j,namespaces:()=>w,nodeOrNew:()=>B,off:()=>Pt,on:()=>At,parser:()=>dt,regex:()=>st,register:()=>q,registerMorphableType:()=>Be,registerWindow:()=>S,restoreWindow:()=>E,root:()=>T,saveWindow:()=>P,utils:()=>g,windowEvents:()=>Mt,withWindow:()=>O,wrapWithAttrCheck:()=>G});const n={},i=[];function s(t,e){if(Array.isArray(t))for(const r of t)s(r,e);else if(\"object\"!=typeof t)a(Object.getOwnPropertyNames(e)),n[t]=Object.assign(n[t]||{},e);else for(const e in t)s(e,t[e])}function o(t){return n[t]||{}}function a(t){i.push(...t)}function h(t,e){let r;const n=t.length,i=[];for(r=0;r=0;e--)V(t.children[e]);return t.id?(t.id=z(t.nodeName),t):t}function $(t,e){let r,n;for(n=(t=Array.isArray(t)?t:[t]).length-1;n>=0;n--)for(r in e)t[n].prototype[r]=e[r]}function G(t){return function(...e){const r=e[e.length-1];return!r||r.constructor!==Object||r instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(r)}}s(\"Dom\",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=k(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=k(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=k(t)).before(this),this},insertAfter:function(t){return(t=k(t)).after(this),this}});const X=/^([+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?)([a-z%]*)$/i,U=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i,H=/rgb\\((\\d+),(\\d+),(\\d+)\\)/,Z=/(#[a-z_][a-z0-9\\-_]*)/i,Q=/\\)\\s*,?\\s*/,W=/\\s/g,J=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,K=/^rgb\\(/,tt=/^(\\s+)?$/,et=/^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,rt=/\\.(jpg|jpeg|png|gif|svg)(\\?[^=]+.*)?/i,nt=/[\\s,]+/,it=/[MLHVCSQTAZ]/i;var st={__proto__:null,numberAndUnit:X,hex:U,rgb:H,reference:Z,transforms:Q,whitespace:W,isHex:J,isRgb:K,isBlank:tt,isNumber:et,isImage:rt,delimiter:nt,isPathLetter:it};function ot(t){const e=Math.round(t),r=Math.max(0,Math.min(255,e)).toString(16);return 1===r.length?\"0\"+r:r}function at(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function ht(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}s(\"Dom\",{classes:function(){const t=this.attr(\"class\");return null==t?[]:t.trim().split(nt)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr(\"class\",e.join(\" \"))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr(\"class\",this.classes().filter((function(e){return e!==t})).join(\" \")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),s(\"Dom\",{css:function(t,e){const r={};if(0===arguments.length)return this.node.style.cssText.split(/\\s*;\\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\\s*:\\s*/);r[e[0]]=e[1]})),r;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=l(e);r[t]=this.node.style[t]}return r}if(\"string\"==typeof t)return this.node.style[l(t)];if(\"object\"==typeof t)for(const e in t)this.node.style[l(e)]=null==t[e]||tt.test(t[e])?\"\":t[e]}return 2===arguments.length&&(this.node.style[l(t)]=null==e||tt.test(e)?\"\":e),this},show:function(){return this.css(\"display\",\"\")},hide:function(){return this.css(\"display\",\"none\")},visible:function(){return\"none\"!==this.css(\"display\")}}),s(\"Dom\",{data:function(t,e,r){if(null==t)return this.data(h(u(this.node.attributes,(t=>0===t.nodeName.indexOf(\"data-\"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const r of t)e[r]=this.data(r);return e}if(\"object\"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr(\"data-\"+t))}catch(e){return this.attr(\"data-\"+t)}else this.attr(\"data-\"+t,null===e?null:!0===r||\"string\"==typeof e||\"number\"==typeof e?e:JSON.stringify(e));return this}}),s(\"Dom\",{remember:function(t,e){if(\"object\"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class ut{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof ut||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&\"number\"==typeof t.r&&\"number\"==typeof t.g&&\"number\"==typeof t.b}static random(t=\"vibrant\",e,r){const{random:n,round:i,sin:s,PI:o}=Math;if(\"vibrant\"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new ut(t,e,r,\"lch\")}if(\"sine\"===t){const t=i(80*s(2*o*(e=null==e?n():e)/.5+.01)+150),r=i(50*s(2*o*e/.5+4.6)+200),a=i(100*s(2*o*e/.5+2.3)+150);return new ut(t,r,a)}if(\"pastel\"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new ut(t,e,r,\"lch\")}if(\"dark\"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new ut(t,e,r,\"lch\")}if(\"rgb\"===t){const t=255*n(),e=255*n(),r=255*n();return new ut(t,e,r)}if(\"lab\"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new ut(t,e,r,\"lab\")}if(\"grey\"===t){const t=255*n();return new ut(t,t,t)}throw new Error(\"Unsupported random color mode\")}static test(t){return\"string\"==typeof t&&(J.test(t)||K.test(t))}cmyk(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.min(1-n,1-i,1-s);return 1===o?new ut(0,0,0,1,\"cmyk\"):new ut((1-n-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,\"cmyk\")}hsl(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.max(n,i,s),a=Math.min(n,i,s),h=(o+a)/2,u=o===a,c=o-a;return new ut(360*(u?0:o===n?((i-s)/c+(i.5?c/(2-o-a):c/(o+a)),100*h,\"hsl\")}init(t=0,e=0,r=0,n=0,i=\"rgb\"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if(\"number\"==typeof t)i=\"string\"==typeof n?n:i,n=\"string\"==typeof n?0:n,Object.assign(this,{_a:t,_b:e,_c:r,_d:n,space:i});else if(t instanceof Array)this.space=e||(\"string\"==typeof t[3]?t[3]:t[4])||\"rgb\",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const r=function(t,e){const r=at(t,\"rgb\")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:\"rgb\"}:at(t,\"xyz\")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:\"xyz\"}:at(t,\"hsl\")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:\"hsl\"}:at(t,\"lab\")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:\"lab\"}:at(t,\"lch\")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:\"lch\"}:at(t,\"cmyk\")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:\"cmyk\"}:{_a:0,_b:0,_c:0,space:\"rgb\"};return r.space=e||r.space,r}(t,e);Object.assign(this,r)}else if(\"string\"==typeof t)if(K.test(t)){const e=t.replace(W,\"\"),[r,n,i]=H.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:\"rgb\"})}else{if(!J.test(t))throw Error(\"Unsupported string format, can't construct Color\");{const e=t=>parseInt(t,16),[,r,n,i]=U.exec(function(t){return 4===t.length?[\"#\",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(\"\"):t}(t)).map(e);Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:\"rgb\"})}}const{_a:s,_b:o,_c:a,_d:h}=this,u=\"rgb\"===this.space?{r:s,g:o,b:a}:\"xyz\"===this.space?{x:s,y:o,z:a}:\"hsl\"===this.space?{h:s,s:o,l:a}:\"lab\"===this.space?{l:s,a:o,b:a}:\"lch\"===this.space?{l:s,c:o,h:a}:\"cmyk\"===this.space?{c:s,m:o,y:a,k:h}:{};Object.assign(this,u)}lab(){const{x:t,y:e,z:r}=this.xyz();return new ut(116*e-16,500*(t-e),200*(e-r),\"lab\")}lch(){const{l:t,a:e,b:r}=this.lab(),n=Math.sqrt(e**2+r**2);let i=180*Math.atan2(r,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new ut(t,n,i,\"lch\")}rgb(){if(\"rgb\"===this.space)return this;if(\"lab\"===(t=this.space)||\"xyz\"===t||\"lch\"===t){let{x:t,y:e,z:r}=this;if(\"lab\"===this.space||\"lch\"===this.space){let{l:n,a:i,b:s}=this;if(\"lch\"===this.space){const{c:t,h:e}=this,r=Math.PI/180;i=t*Math.cos(r*e),s=t*Math.sin(r*e)}const o=(n+16)/116,a=i/500+o,h=o-s/200,u=16/116,c=.008856,l=7.787;t=.95047*(a**3>c?a**3:(a-u)/l),e=1*(o**3>c?o**3:(o-u)/l),r=1.08883*(h**3>c?h**3:(h-u)/l)}const n=3.2406*t+-1.5372*e+-.4986*r,i=-.9689*t+1.8758*e+.0415*r,s=.0557*t+-.204*e+1.057*r,o=Math.pow,a=.0031308,h=n>a?1.055*o(n,1/2.4)-.055:12.92*n,u=i>a?1.055*o(i,1/2.4)-.055:12.92*i,c=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new ut(255*h,255*u,255*c)}if(\"hsl\"===this.space){let{h:t,s:e,l:r}=this;if(t/=360,e/=100,r/=100,0===e)return r*=255,new ut(r,r,r);const n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,s=255*ht(i,n,t+1/3),o=255*ht(i,n,t),a=255*ht(i,n,t-1/3);return new ut(s,o,a)}if(\"cmyk\"===this.space){const{c:t,m:e,y:r,k:n}=this,i=255*(1-Math.min(1,t*(1-n)+n)),s=255*(1-Math.min(1,e*(1-n)+n)),o=255*(1-Math.min(1,r*(1-n)+n));return new ut(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:r,_d:n,space:i}=this;return[t,e,r,n,i]}toHex(){const[t,e,r]=this._clamped().map(ot);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,h=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,u=(.4124*o+.3576*a+.1805*h)/.95047,c=(.2126*o+.7152*a+.0722*h)/1,l=(.0193*o+.1192*a+.9505*h)/1.08883,f=u>.008856?Math.pow(u,1/3):7.787*u+16/116,d=c>.008856?Math.pow(c,1/3):7.787*c+16/116,p=l>.008856?Math.pow(l,1/3):7.787*l+16/116;return new ut(f,d,p,\"xyz\")}_clamped(){const{_a:t,_b:e,_c:r}=this.rgb(),{max:n,min:i,round:s}=Math;return[t,e,r].map((t=>n(0,i(s(t),255))))}}class ct{constructor(...t){this.init(...t)}clone(){return new ct(this)}init(t,e){const r=Array.isArray(t)?{x:t[0],y:t[1]}:\"object\"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==r.x?0:r.x,this.y=null==r.y?0:r.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){ft.isMatrixLike(t)||(t=new ft(t));const{x:e,y:r}=this;return this.x=t.a*e+t.c*r+t.e,this.y=t.b*e+t.d*r+t.f,this}}function lt(t,e,r){return Math.abs(e-t)<(r||1e-6)}class ft{constructor(...t){this.init(...t)}static formatTransforms(t){const e=\"both\"===t.flip||!0===t.flip,r=t.flip&&(e||\"x\"===t.flip)?-1:1,n=t.flip&&(e||\"y\"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleX)?t.scaleX*r:r,a=t.scale&&t.scale.length?t.scale[1]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleY)?t.scaleY*n:n,h=t.shear||0,u=t.rotate||t.theta||0,c=new ct(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=c.x,f=c.y,d=new ct(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.y,g=new ct(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,v=g.y,b=new ct(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:h,theta:u,rx:b.x,ry:b.y,tx:y,ty:v,ox:l,oy:f,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,r){const n=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,h=t.f+t.b*e.e+t.d*e.f;return r.a=n,r.b=i,r.c=s,r.d=o,r.e=a,r.f=h,r}around(t,e,r){return this.clone().aroundO(t,e,r)}aroundO(t,e,r){const n=t||0,i=e||0;return this.translateO(-n,-i).lmultiplyO(r).translateO(n,i)}clone(){return new ft(this)}decompose(t=0,e=0){const r=this.a,n=this.b,i=this.c,s=this.d,o=this.e,a=this.f,h=r*s-n*i,u=h>0?1:-1,c=u*Math.sqrt(r*r+n*n),l=Math.atan2(u*n,u*r),f=180/Math.PI*l,d=Math.cos(l),p=Math.sin(l),m=(r*i+n*s)/h,g=i*c/(m*r-n)||s*c/(m*n+r);return{scaleX:c,scaleY:g,shear:m,rotate:f,translateX:o-t+t*d*c+e*(m*d*c-p*g),translateY:a-e+t*p*c+e*(m*p*c+d*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new ft(t);return lt(this.a,e.a)&<(this.b,e.b)&<(this.c,e.c)&<(this.d,e.d)&<(this.e,e.e)&<(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return\"x\"===t?this.scaleO(-1,1,e,0):\"y\"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=ft.fromArray([1,0,0,1,0,0]);return t=t instanceof Ft?t.matrixify():\"string\"==typeof t?ft.fromArray(t.split(nt).map(parseFloat)):Array.isArray(t)?ft.fromArray(t):\"object\"==typeof t&&ft.isMatrixLike(t)?t:\"object\"==typeof t?(new ft).transform(t):6===arguments.length?ft.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,r=this.c,n=this.d,i=this.e,s=this.f,o=t*n-e*r;if(!o)throw new Error(\"Cannot invert \"+this);const a=n/o,h=-e/o,u=-r/o,c=t/o,l=-(a*i+u*s),f=-(h*i+c*s);return this.a=a,this.b=h,this.c=u,this.d=c,this.e=l,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof ft?t:new ft(t);return ft.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof ft?t:new ft(t);return ft.matrixMultiply(this,e,this)}rotate(t,e,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=c(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:h,e:u,f:l}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-h*i,this.d=h*n+a*i,this.e=u*n-l*i+r*i-e*n+e,this.f=l*n+u*i-e*i-r*n+r,this}scale(t,e,r,n){return this.clone().scaleO(...arguments)}scaleO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t);const{a:i,b:s,c:o,d:a,e:h,f:u}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=h*t-r*t+r,this.f=u*e-n*e+n,this}shear(t,e,r){return this.clone().shearO(t,e,r)}shearO(t,e=0,r=0){const{a:n,b:i,c:s,d:o,e:a,f:h}=this;return this.a=n+i*t,this.c=s+o*t,this.e=a+h*t-r*t,this}skew(t,e,r,n){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=c(t),e=c(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:h,d:u,e:l,f}=this;return this.a=o+a*i,this.b=a+o*s,this.c=h+u*i,this.d=u+h*s,this.e=l+f*i-n*i,this.f=f+l*s-r*s,this}skewX(t,e,r){return this.skew(t,0,e,r)}skewY(t,e,r){return this.skew(0,t,e,r)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return\"matrix(\"+this.a+\",\"+this.b+\",\"+this.c+\",\"+this.d+\",\"+this.e+\",\"+this.f+\")\"}transform(t){if(ft.isMatrixLike(t))return new ft(t).multiplyO(this);const e=ft.formatTransforms(t),{x:r,y:n}=new ct(e.ox,e.oy).transform(this),i=(new ft).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-r,-n).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(r,n);if(isFinite(e.px)||isFinite(e.py)){const t=new ct(r,n).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function dt(){if(!dt.nodes){const t=k().size(2,0);t.node.style.cssText=[\"opacity: 0\",\"position: absolute\",\"left: -100%\",\"top: -100%\",\"overflow: hidden\"].join(\";\"),t.attr(\"focusable\",\"false\"),t.attr(\"aria-hidden\",\"true\");const e=t.path().node;dt.nodes={svg:t,path:e}}if(!dt.nodes.svg.node.parentNode){const t=_.document.body||_.document.documentElement;dt.nodes.svg.addTo(t)}return dt.nodes}function pt(t){return!(t.width||t.height||t.x||t.y)}q(ft,\"Matrix\");class mt{constructor(...t){this.init(...t)}addOffset(){return this.x+=_.window.pageXOffset,this.y+=_.window.pageYOffset,new mt(this)}init(t){return t=\"string\"==typeof t?t.split(nt).map(parseFloat):Array.isArray(t)?t:\"object\"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return pt(this)}merge(t){const e=Math.min(this.x,t.x),r=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-r;return new mt(e,r,n,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+\" \"+this.y+\" \"+this.width+\" \"+this.height}transform(t){t instanceof ft||(t=new ft(t));let e=1/0,r=-1/0,n=1/0,i=-1/0;return[new ct(this.x,this.y),new ct(this.x2,this.y),new ct(this.x,this.y2),new ct(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),r=Math.max(r,s.x),n=Math.min(n,s.y),i=Math.max(i,s.y)})),new mt(e,n,r-e,i-n)}}function gt(t,e,r){let n;try{if(n=e(t.node),pt(n)&&(i=t.node)!==_.document&&!(_.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===_.document}).call(_.document.documentElement,i))throw new Error(\"Element not in the dom\")}catch(e){n=r(t)}var i;return n}s({viewbox:{viewbox(t,e,r,n){return null==t?new mt(this.attr(\"viewBox\")):this.attr(\"viewBox\",new mt(t,e,r,n))},zoom(t,e){let{width:r,height:n}=this.attr([\"width\",\"height\"]);if((r||n)&&\"string\"!=typeof r&&\"string\"!=typeof n||(r=this.node.clientWidth,n=this.node.clientHeight),!r||!n)throw new Error(\"Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element\");const i=this.viewbox(),s=r/i.width,o=n/i.height,a=Math.min(s,o);if(null==t)return a;let h=a/t;h===1/0&&(h=Number.MAX_SAFE_INTEGER/100),e=e||new ct(r/2/s+i.x,n/2/o+i.y);const u=new mt(i).transform(new ft({scale:h,origin:e}));return this.viewbox(u)}}}),q(mt,\"Box\");class yt extends Array{constructor(t=[],...e){if(super(t,...e),\"number\"==typeof t)return this;this.length=0,this.push(...t)}}$([yt],{each(t,...e){return\"function\"==typeof t?this.map(((e,r,n)=>t.call(e,e,r,n))):this.map((r=>r[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const vt=[\"toArray\",\"constructor\",\"each\"];function bt(t,e){return new yt(h((e||_.document).querySelectorAll(t),(function(t){return N(t)})))}yt.extend=function(t){t=t.reduce(((t,e)=>(vt.includes(e)||\"_\"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),$([yt],t)};let xt=0;const Mt={};function wt(t){let e=t.getEventHolder();return e===_.window&&(e=Mt),e.events||(e.events={}),e.events}function _t(t){return t.getEventTarget()}function St(t){let e=t.getEventHolder();e===_.window&&(e=Mt),e.events&&(e.events={})}function At(t,e,r,n,i){const s=r.bind(n||t),o=k(t),a=wt(o),h=_t(o);e=Array.isArray(e)?e:e.split(nt),r._svgjsListenerId||(r._svgjsListenerId=++xt),e.forEach((function(t){const e=t.split(\".\")[0],n=t.split(\".\")[1]||\"*\";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][r._svgjsListenerId]=s,h.addEventListener(e,s,i||!1)}))}function Pt(t,e,r,n){const i=k(t),s=wt(i),o=_t(i);(\"function\"!=typeof r||(r=r._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||\"\").split(nt)).forEach((function(t){const e=t&&t.split(\".\")[0],a=t&&t.split(\".\")[1];let h,u;if(r)s[e]&&s[e][a||\"*\"]&&(o.removeEventListener(e,s[e][a||\"*\"][r],n||!1),delete s[e][a||\"*\"][r]);else if(e&&a){if(s[e]&&s[e][a]){for(u in s[e][a])Pt(o,[e,a].join(\".\"),u);delete s[e][a]}}else if(a)for(t in s)for(h in s[t])a===h&&Pt(o,[t,a].join(\".\"));else if(e){if(s[e]){for(h in s[e])Pt(o,[e,h].join(\".\"));delete s[e]}}else{for(t in s)Pt(o,t);St(i)}}))}function Et(t,e,r,n){const i=_t(t);return e instanceof _.window.Event||(e=new _.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}class Ot extends R{addEventListener(){}dispatch(t,e,r){return Et(this,t,e,r)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const r=e[t.type];for(const e in r)for(const n in r[e])r[e][n](t);return!t.defaultPrevented}fire(t,e,r){return this.dispatch(t,e,r),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e){return Pt(this,t,e),this}on(t,e,r,n){return At(this,t,e,r,n),this}removeEventListener(){}}function It(){}q(Ot,\"EventTarget\");const Rt={duration:400,ease:\">\",delay:0},Ct={\"fill-opacity\":1,\"stroke-opacity\":1,\"stroke-width\":0,\"stroke-linejoin\":\"miter\",\"stroke-linecap\":\"butt\",fill:\"#000000\",stroke:\"#000000\",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,\"stop-opacity\":1,\"stop-color\":\"#000000\",\"text-anchor\":\"start\"};var Tt={__proto__:null,noop:It,timeline:Rt,attrs:Ct};class Lt extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return\"number\"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(nt).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(\" \")}valueOf(){const t=[];return t.push(...this),t}}class kt{constructor(...t){this.init(...t)}convert(t){return new kt(this.value,t)}divide(t){return t=new kt(t),new kt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||\"\",\"number\"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:\"string\"==typeof t?(e=t.match(X))&&(this.value=parseFloat(e[1]),\"%\"===e[5]?this.value/=100:\"s\"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof kt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new kt(t),new kt(this-t,this.unit||t.unit)}plus(t){return t=new kt(t),new kt(this+t,this.unit||t.unit)}times(t){return t=new kt(t),new kt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return(\"%\"===this.unit?~~(1e8*this.value)/1e6:\"s\"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const Bt=[];class Nt extends Ot{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=k(t)).removeNamespace&&this.node instanceof _.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return k(t).put(this,e)}children(){return new yt(h(this.node.children,(function(t){return N(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0){return this.writeDataToDom(),new this.constructor(V(this.node.cloneNode(t)))}each(t,e){const r=this.children();let n,i;for(n=0,i=r.length;n=0}html(t,e){return this.xml(t,e,v)}id(t){return void 0!==t||this.node.id||(this.node.id=z(this.type)),this.attr(\"id\",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return N(this.node.lastChild)}matches(t){const e=this.node,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return r&&r.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=N(e.node.parentNode),!t)return e;do{if(\"string\"==typeof t?e.matches(t):e instanceof t)return e}while(e=N(e.node.parentNode));return e}put(t,e){return t=k(t),this.add(t,e),t}putIn(t,e){return k(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=k(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const r=10**t,n=this.attr(e);for(const t in n)\"number\"==typeof n[t]&&(n[t]=Math.round(n[t]*r)/r);return this.attr(n),this}svg(t,e){return this.xml(t,e,y)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const r=e.index(this);return e.put(t,r).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,r){if(\"boolean\"==typeof t&&(r=e,e=t,t=null),null==t||\"function\"==typeof t){e=null==e||e,this.writeDataToDom();let r=this;if(null!=t){if(r=N(r.node.cloneNode(!0)),e){const e=t(r);if(r=e||r,!1===e)return\"\"}r.each((function(){const e=t(this),r=e||this;!1===e?this.remove():e&&this!==r&&this.replace(r)}),!0)}return e?r.node.outerHTML:r.node.innerHTML}e=null!=e&&e;const n=L(\"wrapper\",r),i=_.document.createDocumentFragment();n.innerHTML=t;for(let t=n.children.length;t--;)i.appendChild(n.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}$(Nt,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=et.test(r.nodeValue)?parseFloat(r.nodeValue):r.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if(\"object\"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?Ct[t]:et.test(e)?parseFloat(e):e;\"number\"==typeof(e=Bt.reduce(((e,r)=>r(t,e,this)),e))?e=new kt(e):ut.isColor(e)?e=new ut(e):e.constructor===Array&&(e=new Lt(e)),\"leading\"===t?this.leading&&this.leading(e):\"string\"==typeof r?this.node.setAttributeNS(r,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||\"font-size\"!==t&&\"x\"!==t||this.rebuild()}return this},find:function(t){return bt(t,this.node)},findOne:function(t){return N(this.node.querySelector(t))}}),q(Nt,\"Dom\");class Ft extends Nt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,t.hasAttribute(\"svgjs:data\")&&this.setData(JSON.parse(t.getAttribute(\"svgjs:data\"))||{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new kt(t).plus(this.x()))}dy(t=0){return this.y(new kt(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr(\"height\",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){t=k(t);const e=new yt;let r=this;for(;(r=r.parent())&&r.node!==_.document&&\"#document-fragment\"!==r.nodeName&&(e.push(r),r.node!==t.node););return e}reference(t){if(!(t=this.attr(t)))return null;const e=(t+\"\").match(Z);return e?k(e[1]):null}root(){const t=this.parent(Y(T));return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const r=p(this,t,e);return this.width(new kt(r.width)).height(new kt(r.height))}width(t){return this.attr(\"width\",t)}writeDataToDom(){return this.node.removeAttribute(\"svgjs:data\"),Object.keys(this.dom).length&&this.node.setAttribute(\"svgjs:data\",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr(\"x\",t)}y(t){return this.attr(\"y\",t)}}$(Ft,{bbox:function(){const t=gt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(dt().svg).show(),r=e.node.getBBox();return e.remove(),r}catch(e){throw new Error(`Getting bbox of element \"${t.node.nodeName}\" is not possible: ${e.toString()}`)}}));return new mt(t)},rbox:function(t){const e=gt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element \"${t.node.nodeName}\" is not possible`)})),r=new mt(e);return t?r.transform(t.screenCTM().inverseO()):r.addOffset()},inside:function(t,e){const r=this.bbox();return t>r.x&&e>r.y&&t=0;r--)null!=e[jt[t][r]]&&this.attr(jt.prefix(t,jt[t][r]),e[jt[t][r]]);return this},s([\"Element\",\"Runner\"],e)})),s([\"Element\",\"Runner\"],{matrix:function(t,e,r,n,i,s){return null==t?new ft(this):this.attr(\"transform\",new ft(t,e,r,n,i,s))},rotate:function(t,e,r){return this.transform({rotate:t,ox:e,oy:r},!0)},skew:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:r},!0):this.transform({skew:[t,e],ox:r,oy:n},!0)},shear:function(t,e,r){return this.transform({shear:t,ox:e,oy:r},!0)},scale:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:r},!0):this.transform({scale:[t,e],ox:r,oy:n},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t=\"both\",e=\"center\"){return-1===\"xybothtrue\".indexOf(t)&&(e=t,t=\"both\"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr(\"opacity\",t)}}),s(\"radius\",{radius:function(t,e=t){return\"radialGradient\"===(this._element||this).type?this.attr(\"r\",new kt(t)):this.rx(t).ry(e)}}),s(\"Path\",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new ct(this.node.getPointAtLength(t))}}),s([\"Element\",\"Runner\"],{font:function(t,e){if(\"object\"==typeof t){for(e in t)this.font(e,t[e]);return this}return\"leading\"===t?this.leading(e):\"anchor\"===t?this.attr(\"text-anchor\",e):\"size\"===t||\"family\"===t||\"weight\"===t||\"stretch\"===t||\"variant\"===t||\"style\"===t?this.attr(\"font-\"+t,e):this.attr(t,e)}}),s(\"Element\",[\"click\",\"dblclick\",\"mousedown\",\"mouseup\",\"mouseover\",\"mouseout\",\"mousemove\",\"mouseenter\",\"mouseleave\",\"touchstart\",\"touchmove\",\"touchleave\",\"touchend\",\"touchcancel\"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),s(\"Element\",{untransform:function(){return this.attr(\"transform\",null)},matrixify:function(){return(this.attr(\"transform\")||\"\").split(Q).slice(0,-1).map((function(t){const e=t.trim().split(\"(\");return[e[0],e[1].split(nt).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return\"matrix\"===e[0]?t.lmultiply(ft.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new ft)},toParent:function(t,e){if(this===t)return this;const r=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(n.multiply(r)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||\"string\"==typeof t){const e=new ft(this).decompose();return null==t?e:e[t]}ft.isMatrixLike(t)||(t={...t,origin:m(t,this)});const r=new ft(!0===e?this:e||!1).transform(t);return this.attr(\"transform\",r)}});class qt extends Ft{flatten(t=this,e){return this.each((function(){if(this instanceof qt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(r,n){return n[n.length-r-1].toParent(t,e)})),this.remove()}}q(qt,\"Container\");class Yt extends qt{constructor(t,e=t){super(B(\"defs\",t),e)}flatten(){return this}ungroup(){return this}}q(Yt,\"Defs\");class Dt extends Ft{}function zt(t){return this.attr(\"rx\",t)}function Vt(t){return this.attr(\"ry\",t)}function $t(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Gt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Xt(t){return this.attr(\"cx\",t)}function Ut(t){return this.attr(\"cy\",t)}function Ht(t){return null==t?2*this.rx():this.rx(new kt(t).divide(2))}function Zt(t){return null==t?2*this.ry():this.ry(new kt(t).divide(2))}q(Dt,\"Shape\");var Qt={__proto__:null,rx:zt,ry:Vt,x:$t,y:Gt,cx:Xt,cy:Ut,width:Ht,height:Zt};class Wt extends Dt{constructor(t,e=t){super(B(\"ellipse\",t),e)}size(t,e){const r=p(this,t,e);return this.rx(new kt(r.width).divide(2)).ry(new kt(r.height).divide(2))}}$(Wt,Qt),s(\"Container\",{ellipse:G((function(t=0,e=t){return this.put(new Wt).size(t,e).move(0,0)}))}),q(Wt,\"Ellipse\");class Jt extends Nt{constructor(t=_.document.createDocumentFragment()){super(t)}xml(t,e,r){if(\"boolean\"==typeof t&&(r=e,e=t,t=null),null==t||\"function\"==typeof t){const t=new Nt(L(\"wrapper\",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}}function Kt(t,e){return\"radialGradient\"===(this._element||this).type?this.attr({fx:new kt(t),fy:new kt(e)}):this.attr({x1:new kt(t),y1:new kt(e)})}function te(t,e){return\"radialGradient\"===(this._element||this).type?this.attr({cx:new kt(t),cy:new kt(e)}):this.attr({x2:new kt(t),y2:new kt(e)})}q(Jt,\"Fragment\");var ee,re={__proto__:null,from:Kt,to:te};class ne extends qt{constructor(t,e){super(B(t+\"Gradient\",\"string\"==typeof t?null:t),e)}attr(t,e,r){return\"transform\"===t&&(t=\"gradientTransform\"),super.attr(t,e,r)}bbox(){return new mt}targets(){return bt('svg [fill*=\"'+this.id()+'\"]')}toString(){return this.url()}update(t){return this.clear(),\"function\"==typeof t&&t.call(this,this),this}url(){return'url(\"#'+this.id()+'\")'}}$(ne,re),s({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:G((function(t,e){return this.put(new ne(t)).update(e)}))}}),q(ne,\"Gradient\");class ie extends qt{constructor(t,e=t){super(B(\"pattern\",t),e)}attr(t,e,r){return\"transform\"===t&&(t=\"patternTransform\"),super.attr(t,e,r)}bbox(){return new mt}targets(){return bt('svg [fill*=\"'+this.id()+'\"]')}toString(){return this.url()}update(t){return this.clear(),\"function\"==typeof t&&t.call(this,this),this}url(){return'url(\"#'+this.id()+'\")'}}s({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:G((function(t,e,r){return this.put(new ie).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:\"userSpaceOnUse\"})}))}}),q(ie,\"Pattern\");class se extends Dt{constructor(t,e=t){super(B(\"image\",t),e)}load(t,e){if(!t)return this;const r=new _.window.Image;return At(r,\"load\",(function(t){const n=this.parent(ie);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof ie&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),\"function\"==typeof e&&e.call(this,t)}),this),At(r,\"load error\",(function(){Pt(r)})),this.attr(\"href\",r.src=t,x)}}ee=function(t,e,r){return\"fill\"!==t&&\"stroke\"!==t||rt.test(e)&&(e=r.root().defs().image(e)),e instanceof se&&(e=r.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},Bt.push(ee),s({Container:{image:G((function(t,e){return this.put(new se).size(0,0).load(t,e)}))}}),q(se,\"Image\");class oe extends Lt{bbox(){let t=-1/0,e=-1/0,r=1/0,n=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),r=Math.min(i[0],r),n=Math.min(i[1],n)})),new mt(r,n,t-r,e-n)}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(nt).map(parseFloat)).length%2!=0&&t.pop();for(let r=0,n=t.length;r=0;r--)n.width&&(this[r][0]=(this[r][0]-n.x)*t/n.width+n.x),n.height&&(this[r][1]=(this[r][1]-n.y)*e/n.height+n.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,r=this.length;e\":function(t){return-Math.cos(t*Math.PI)/2+.5},\">\":function(t){return Math.sin(t*Math.PI/2)},\"<\":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,r,n){return function(i){return i<0?t>0?e/t*i:r>0?n/r*i:0:i>1?r<1?(1-n)/(1-r)*i+(n-r)/(1-r):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*n+i**3}},steps:function(t,e=\"end\"){e=e.split(\"-\").reverse()[0];let r=t;return\"none\"===e?--r:\"both\"===e&&++r,(n,i=!1)=>{let s=Math.floor(n*t);const o=n*s%1==0;return\"start\"!==e&&\"both\"!==e||++s,i&&o&&--s,n>=0&&s<0&&(s=0),n<=1&&s>r&&(s=r),s/r}}};class fe{done(){return!1}}class de extends fe{constructor(t=Rt.ease){super(),this.ease=le[t]||t}step(t,e,r){return\"number\"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}}class pe extends fe{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}}function me(){const t=(this._duration||500)/1e3,e=this._overshoot||0,r=Math.PI,n=Math.log(e/100+1e-10),i=-n/Math.sqrt(r*r+n*n),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}class ge extends pe{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,r,n){if(\"string\"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;r>100&&(r=16),r/=1e3;const i=n.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*r+s*r*r/2;return n.velocity=i+s*r,n.done=Math.abs(e-o)+Math.abs(i)<.002,n.done?e:o}}$(ge,{duration:ce(\"_duration\",me),overshoot:ce(\"_overshoot\",me)});class ye extends pe{constructor(t=.1,e=.01,r=0,n=1e3){super(),this.p(t).i(e).d(r).windup(n)}step(t,e,r,n){if(\"string\"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;const i=e-t;let s=(n.integral||0)+i*r;const o=(i-(n.error||0))/r,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),n.error=i,n.integral=s,n.done=Math.abs(i)<.001,n.done?e:t+(this.P*i+this.I*s+this.D*o)}}$(ye,{windup:ce(\"_windup\"),p:ce(\"P\"),i:ce(\"I\"),d:ce(\"D\")});const ve={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},be={M:function(t,e,r){return e.x=r.x=t[0],e.y=r.y=t[1],[\"M\",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],[\"L\",t[0],t[1]]},H:function(t,e){return e.x=t[0],[\"H\",t[0]]},V:function(t,e){return e.y=t[0],[\"V\",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],[\"C\",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],[\"S\",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],[\"Q\",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],[\"T\",t[0],t[1]]},Z:function(t,e,r){return e.x=r.x,e.y=r.y,[\"Z\"]},A:function(t,e){return e.x=t[5],e.y=t[6],[\"A\",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},xe=\"mlhvqtcsaz\".split(\"\");for(let t=0,e=xe.length;t=0;n--)r=this[n][0],\"M\"===r||\"L\"===r||\"T\"===r?(this[n][1]+=t,this[n][2]+=e):\"H\"===r?this[n][1]+=t:\"V\"===r?this[n][1]+=e:\"C\"===r||\"S\"===r||\"Q\"===r?(this[n][1]+=t,this[n][2]+=e,this[n][3]+=t,this[n][4]+=e,\"C\"===r&&(this[n][5]+=t,this[n][6]+=e)):\"A\"===r&&(this[n][6]+=t,this[n][7]+=e);return this}parse(t=\"M0 0\"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let r=0,n=\"\";const i={segment:[],inNumber:!1,number:\"\",lastToken:\"\",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new ct,p:new ct};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!we(i,n))if(\".\"!==n)if(isNaN(parseInt(n)))if(\" \"!==n&&\",\"!==n)if(\"-\"!==n)if(\"E\"!==n.toUpperCase()){if(it.test(n)){if(i.inNumber)_e(i,!1);else{if(!Me(i))throw new Error(\"parser Error\");Se(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!Pe(i)){_e(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else i.inNumber&&_e(i,!1);else{if(\"0\"===i.number||Ae(i)){i.inNumber=!0,i.number=n,_e(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){_e(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&_e(i,!1),i.inSegment&&Me(i)&&Se(i),i.segments}(t)}size(t,e){const r=this.bbox();let n,i;for(r.width=0===r.width?1:r.width,r.height=0===r.height?1:r.height,n=this.length-1;n>=0;n--)i=this[n][0],\"M\"===i||\"L\"===i||\"T\"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):\"H\"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:\"V\"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:\"C\"===i||\"S\"===i||\"Q\"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,\"C\"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):\"A\"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this}toString(){return function(t){let e=\"\";for(let r=0,n=t.length;r{const e=typeof t;return\"number\"===e?kt:\"string\"===e?ut.isColor(t)?ut:nt.test(t)?it.test(t)?Ee:Lt:X.test(t)?kt:Re:ke.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Lt:\"object\"===e?Le:Re};class Ie{constructor(t){this._stepper=t||new de(\"-\"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){const e=this;return this._morphObj.fromArray(this._from.map((function(r,n){return e._stepper.step(r,e._to[n],t,e._context[n],e._context)})))}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(Oe(t));let e=new this._type(t);return this._type===ut&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Le&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toArray(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class Re{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class Ce{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,Ce.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}Ce.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Te=(t,e)=>t[0]e[0]?1:0;class Le{constructor(...t){this.init(...t)}align(t){for(let e=0,r=this.values.length;et.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const r=e.shift(),n=e.shift(),i=e.shift(),s=e.splice(0,i);t[r]=new n(s).valueOf()}return t}}const ke=[Re,Ce,Le];function Be(t=[]){ke.push(...[].concat(t))}function Ne(){$(ke,{to(t){return(new Ie).type(this.constructor).from(this.valueOf()).to(t)},fromArray(t){return this.init(t),this}})}class Fe extends Dt{constructor(t,e=t){super(B(\"path\",t),e)}array(){return this._array||(this._array=new Ee(this.attr(\"d\")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr(\"d\",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr(\"d\",\"string\"==typeof t?t:this._array=new Ee(t))}size(t,e){const r=p(this,t,e);return this.attr(\"d\",this.array().size(r.width,r.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}Fe.prototype.MorphArray=Ee,s({Container:{path:G((function(t){return this.put(new Fe).plot(t||new Ee)}))}}),q(Fe,\"Path\");var je={__proto__:null,array:function(){return this._array||(this._array=new oe(this.attr(\"points\")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr(\"points\",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr(\"points\",\"string\"==typeof t?t:this._array=new oe(t))},size:function(t,e){const r=p(this,t,e);return this.attr(\"points\",this.array().size(r.width,r.height))}};class qe extends Dt{constructor(t,e=t){super(B(\"polygon\",t),e)}}s({Container:{polygon:G((function(t){return this.put(new qe).plot(t||new oe)}))}}),$(qe,ae),$(qe,je),q(qe,\"Polygon\");class Ye extends Dt{constructor(t,e=t){super(B(\"polyline\",t),e)}}s({Container:{polyline:G((function(t){return this.put(new Ye).plot(t||new oe)}))}}),$(Ye,ae),$(Ye,je),q(Ye,\"Polyline\");class De extends Dt{constructor(t,e=t){super(B(\"rect\",t),e)}}$(De,{rx:zt,ry:Vt}),s({Container:{rect:G((function(t,e){return this.put(new De).size(t,e)}))}}),q(De,\"Rect\");class ze{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Ve={nextDraw:null,frames:new ze,timeouts:new ze,immediates:new ze,timer:()=>_.window.performance||_.window.Date,transforms:[],frame(t){const e=Ve.frames.push({run:t});return null===Ve.nextDraw&&(Ve.nextDraw=_.window.requestAnimationFrame(Ve._draw)),e},timeout(t,e){e=e||0;const r=Ve.timer().now()+e,n=Ve.timeouts.push({run:t,time:r});return null===Ve.nextDraw&&(Ve.nextDraw=_.window.requestAnimationFrame(Ve._draw)),n},immediate(t){const e=Ve.immediates.push(t);return null===Ve.nextDraw&&(Ve.nextDraw=_.window.requestAnimationFrame(Ve._draw)),e},cancelFrame(t){null!=t&&Ve.frames.remove(t)},clearTimeout(t){null!=t&&Ve.timeouts.remove(t)},cancelImmediate(t){null!=t&&Ve.immediates.remove(t)},_draw(t){let e=null;const r=Ve.timeouts.last();for(;(e=Ve.timeouts.shift())&&(t>=e.time?e.run():Ve.timeouts.push(e),e!==r););let n=null;const i=Ve.frames.last();for(;n!==i&&(n=Ve.frames.shift());)n.run(t);let s=null;for(;s=Ve.immediates.shift();)s();Ve.nextDraw=Ve.timeouts.first()||Ve.frames.first()?_.window.requestAnimationFrame(Ve._draw):null}},$e=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},Ge=function(){const t=_.window;return(t.performance||t.Date).now()};class Xe extends Ot{constructor(t=Ge){super(),this._timeSource=t,this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const r=Math.abs(e);return this.speed(t?-r:r)}schedule(t,e,r){if(null==t)return this._runners.map($e);let n=0;const i=this.getEndTime();if(e=e||0,null==r||\"last\"===r||\"after\"===r)n=i;else if(\"absolute\"===r||\"start\"===r)n=e,e=0;else if(\"now\"===r)n=this._time;else if(\"relative\"===r){const r=this.getRunnerInfoById(t.id);r&&(n=r.start+e,e=0)}else{if(\"with-last\"!==r)throw new Error('Invalid value for the \"when\" parameter');{const t=this.getLastRunnerInfo();n=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:n+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Ve.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Ve.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let r=e-this._lastSourceTime;t&&(r=0);const n=this._speed*r+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=n,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire(\"time\",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],r=e.runner;this._time-e.start<=0&&r.reset()}let i=!1;for(let t=0,e=this._runners.length;t0?this._continue():(this.pause(),this.fire(\"finished\")),this}}s({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Xe,this._timeline):(this._timeline=t,this)}}});class Ue extends Ot{constructor(t){super(),this.id=Ue.id++,t=\"function\"==typeof(t=null==t?Rt.duration:t)?new pe(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration=\"number\"==typeof t&&t,this._isDeclarative=t instanceof pe,this._stepper=this._isDeclarative?t:new de,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new ft,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,r){let n=1,i=!1,s=0;return e=e||Rt.delay,r=r||\"last\",\"object\"!=typeof(t=t||Rt.duration)||t instanceof fe||(e=t.delay||e,r=t.when||r,i=t.swing||i,n=t.times||n,s=t.wait||s,t=t.duration||Rt.duration),{duration:t,delay:e,swing:i,times:n,wait:s,when:r}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t,e){return this.transforms.lmultiplyO(t),this}after(t){return this.on(\"finished\",t)}animate(t,e,r){const n=Ue.sanitise(t,e,r),i=new Ue(n.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(n).schedule(n.delay,n.when)}clearTransform(){return this.transforms=new ft,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new de(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,r){return\"object\"==typeof t&&(e=t.swing,r=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=r||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),r=(this._time-t*e)/this._duration;return Math.min(t+r,this._times)}const r=t%1,n=e*Math.floor(t)+this._duration*r;return this.time(n)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,r=this._duration,n=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(n+r))/(n+r)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(n+r))/r+i;return Math.max(Math.min(a,1),0)},h=i*(n+r)-n;return a=e<=0?Math.round(t(1e-5)):e=0;this._lastPosition=e;const n=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime=n;this._lastTime=this._time,i&&this.fire(\"start\",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=n,this._reseted=!1;let a=!1;return(r||o)&&(this._initialise(r),this.transforms=new ft,a=this._run(o?t:e),this.fire(\"step\",this)),this.done=this.done||a&&o,s&&this.fire(\"finished\",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,r=this._queue.length;et.lmultiplyO(e),Qe=t=>t.transforms;function We(){const t=this._transformationRunners.runners.map(Qe).reduce(Ze,new ft);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Je{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new He).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const r=this.ids.indexOf(t+1);return this.ids.splice(r,1,t+1),this.runners.splice(r,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;ee.id<=t.id)).map(Qe).reduce(Ze,new ft)},_addRunner(t){this._transformationRunners.add(t),Ve.cancelImmediate(this._frameId),this._frameId=Ve.immediate(We.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Je).add(new He(new ft(this))))}}}),$(Ue,{attr(t,e){return this.styleAttr(\"attr\",t,e)},css(t,e){return this.styleAttr(\"css\",t,e)},styleAttr(t,e,r){if(\"string\"==typeof e)return this.styleAttr(t,{[e]:r});let n=e;if(this._tryRetarget(t,n))return this;let i=new Ie(this._stepper).to(n),s=Object.keys(n);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const r=Object.keys(e),o=(a=s,r.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),r=new Le(i.from()).valueOf();Object.assign(r,e),i.from(r)}const h=new Le(i.to()).valueOf();Object.assign(h,e),i.to(h),s=r,n=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget(\"zoom\",t,e))return this;let r=new Ie(this._stepper).to(new kt(t));return this.queue((function(){r=r.from(this.element().zoom())}),(function(t){return this.element().zoom(r.at(t),e),r.done()}),(function(t,n){e=n,r.to(t)})),this._rememberMorpher(\"zoom\",r),this},transform(t,e,r){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget(\"transform\",t))return this;const n=ft.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new Ie(this._stepper).type(r?Ce:ft);let s,o,a,h,u;return this.queue((function(){o=o||this.element(),s=s||m(t,o),u=new ft(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:l,y:f}=new ct(s).transform(o._currentTransform(this));let d=new ft({...t,origin:[l,f]}),p=this._isDeclarative&&a?a:u;if(r){d=d.decompose(l,f),p=p.decompose(l,f);const t=d.rotate,e=p.rotate,r=[t-360,t,t+360],n=r.map((t=>Math.abs(t-e))),i=Math.min(...n),s=n.indexOf(i);d.rotate=r[s]}e&&(n||(d.rotate=t.rotate||0),this._isDeclarative&&h&&(p.rotate=h)),i.from(p),i.to(d);const m=i.at(c);return h=m.rotate,a=new ft(m),this.addTransform(a),o._addRunner(this),i.done()}),(function(e){(e.origin||\"center\").toString()!==(t.origin||\"center\").toString()&&(s=m(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher(\"transform\",i),this},x(t,e){return this._queueNumber(\"x\",t)},y(t){return this._queueNumber(\"y\",t)},dx(t=0){return this._queueNumberDelta(\"x\",t)},dy(t=0){return this._queueNumberDelta(\"y\",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new kt(e),this._tryRetarget(t,e))return this;const r=new Ie(this._stepper).to(e);let n=null;return this.queue((function(){n=this.element()[t](),r.from(n),r.to(n+e)}),(function(e){return this.element()[t](r.at(e)),r.done()}),(function(t){r.to(n+new kt(t))})),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new Ie(this._stepper).to(e);return this.queue((function(){r.from(this.element()[t]())}),(function(e){return this.element()[t](r.at(e)),r.done()})),this._rememberMorpher(t,r),this},_queueNumber(t,e){return this._queueObject(t,new kt(e))},cx(t){return this._queueNumber(\"cx\",t)},cy(t){return this._queueNumber(\"cy\",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let r;return t&&e||(r=this._element.bbox()),t||(t=r.width/r.height*e),e||(e=r.height/r.width*t),this.width(t).height(e)},width(t){return this._queueNumber(\"width\",t)},height(t){return this._queueNumber(\"height\",t)},plot(t,e,r,n){if(4===arguments.length)return this.plot([t,e,r,n]);if(this._tryRetarget(\"plot\",t))return this;const i=new Ie(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher(\"plot\",i),this},leading(t){return this._queueNumber(\"leading\",t)},viewbox(t,e,r,n){return this._queueObject(\"viewbox\",new mt(t,e,r,n))},update(t){return\"object\"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr(\"stop-opacity\",t.opacity),null!=t.color&&this.attr(\"stop-color\",t.color),null!=t.offset&&this.attr(\"offset\",t.offset),this)}}),$(Ue,{rx:zt,ry:Vt,from:Kt,to:te}),q(Ue,\"Runner\");class Ke extends qt{constructor(t,e=t){super(B(\"svg\",t),e),this.namespace()}defs(){return this.isRoot()?N(this.node.querySelector(\"defs\"))||this.put(new Yt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof _.window.SVGElement)&&\"#document-fragment\"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:y,version:\"1.1\"}).attr(\"xmlns:xlink\",x,b).attr(\"xmlns:svgjs\",M,b):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr(\"xmlns:xlink\",null,b).attr(\"xmlns:svgjs\",null,b)}root(){return this.isRoot()?this:super.root()}}s({Container:{nested:G((function(){return this.put(new Ke)}))}}),q(Ke,\"Svg\",!0);class tr extends qt{constructor(t,e=t){super(B(\"symbol\",t),e)}}s({Container:{symbol:G((function(){return this.put(new tr)}))}}),q(tr,\"Symbol\");var er={__proto__:null,plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(_.document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()},x:function(t,e=this.bbox()){return null==t?e.x:this.attr(\"x\",this.attr(\"x\")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr(\"y\",this.attr(\"y\")+t-e.y)},move:function(t,e,r=this.bbox()){return this.x(t,r).y(e,r)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr(\"x\",this.attr(\"x\")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr(\"y\",this.attr(\"y\")+t-e.cy)},center:function(t,e,r=this.bbox()){return this.cx(t,r).cy(e,r)},ax:function(t){return this.attr(\"x\",t)},ay:function(t){return this.attr(\"y\",t)},amove:function(t,e){return this.ax(t).ay(e)},build:function(t){return this._build=!!t,this}};class rr extends Dt{constructor(t,e=t){super(B(\"text\",t),e),this.dom.leading=new kt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new kt(t),this.rebuild())}rebuild(t){if(\"boolean\"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const r=this.dom.leading;this.each((function(n){const i=_.window.getComputedStyle(this.node).getPropertyValue(\"font-size\"),s=r*new kt(i);this.dom.newLined&&(this.attr(\"x\",t.attr(\"x\")),\"\\n\"===this.text()?e+=s:(this.attr(\"dy\",n?s+e:0),e=0))})),this.fire(\"rebuild\")}return this}setData(t){return this.dom=t,this.dom.leading=new kt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let r=0;t=\"\";for(let n=0,i=e.length;n{let i;try{i=r.bbox()}catch(t){return}const s=new ft(r),o=s.translate(t,e).transform(s.inverse()),a=new ct(i.x,i.y).transform(o);r.move(a.x,a.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)},size:function(t,e,r=this.bbox()){const n=p(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach(((t,e)=>{const n=new ct(r).transform(new ft(t).inverse());t.scale(i,s,n.x,n.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}};class hr extends qt{constructor(t,e=t){super(B(\"g\",t),e)}}$(hr,ar),s({Container:{group:G((function(){return this.put(new hr)}))}}),q(hr,\"G\");class ur extends qt{constructor(t,e=t){super(B(\"a\",t),e)}target(t){return this.attr(\"target\",t)}to(t){return this.attr(\"href\",t,x)}}$(ur,ar),s({Container:{link:G((function(t){return this.put(new ur).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const r=e.index(t);return e.add(this,r),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new ur,this.wrap(e)),\"function\"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&\"a\"===t.node.nodeName.toLowerCase()?t:null}}}),q(ur,\"A\");class cr extends qt{constructor(t,e=t){super(B(\"mask\",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return bt('svg [mask*=\"'+this.id()+'\"]')}}s({Container:{mask:G((function(){return this.defs().put(new cr)}))},Element:{masker(){return this.reference(\"mask\")},maskWith(t){const e=t instanceof cr?t:this.parent().mask().add(t);return this.attr(\"mask\",'url(\"#'+e.id()+'\")')},unmask(){return this.attr(\"mask\",null)}}}),q(cr,\"Mask\");class lr extends Ft{constructor(t,e=t){super(B(\"stop\",t),e)}update(t){return(\"number\"==typeof t||t instanceof kt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr(\"stop-opacity\",t.opacity),null!=t.color&&this.attr(\"stop-color\",t.color),null!=t.offset&&this.attr(\"offset\",new kt(t.offset)),this}}s({Gradient:{stop:function(t,e,r){return this.put(new lr).update(t,e,r)}}}),q(lr,\"Stop\");class fr extends Ft{constructor(t,e=t){super(B(\"style\",t),e)}addText(t=\"\"){return this.node.textContent+=t,this}font(t,e,r={}){return this.rule(\"@font-face\",{fontFamily:t,src:e,...r})}rule(t,e){return this.addText(function(t,e){if(!t)return\"\";if(!e)return t;let r=t+\"{\";for(const t in e)r+=f(t)+\":\"+e[t]+\";\";return r+=\"}\",r}(t,e))}}s(\"Dom\",{style(t,e){return this.put(new fr).rule(t,e)},fontface(t,e,r){return this.put(new fr).font(t,e,r)}}),q(fr,\"Style\");class dr extends rr{constructor(t,e=t){super(B(\"textPath\",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let r=null;return e&&(r=e.plot(t)),null==t?r:this}track(){return this.reference(\"href\")}}s({Container:{textPath:G((function(t,e){return t instanceof rr||(t=this.text(t)),t.path(e)}))},Text:{path:G((function(t,e=!0){const r=new dr;let n;if(t instanceof Fe||(t=this.defs().path(t)),r.attr(\"href\",\"#\"+t,x),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)})),textPath(){return this.findOne(\"textPath\")}},Path:{text:G((function(t){return t instanceof rr||(t=(new rr).addTo(this.parent()).text(t)),t.path(this)})),targets(){return bt(\"svg textPath\").filter((t=>(t.attr(\"href\")||\"\").includes(this.id())))}}}),dr.prototype.MorphArray=Ee,q(dr,\"TextPath\");class pr extends Dt{constructor(t,e=t){super(B(\"use\",t),e)}use(t,e){return this.attr(\"href\",(e||\"\")+\"#\"+t,x)}}s({Container:{use:G((function(t,e){return this.put(new pr).use(t,e)}))}}),q(pr,\"Use\");const mr=k;$([Ke,tr,se,ie,ue],o(\"viewbox\")),$([he,Ye,qe,Fe],o(\"marker\")),$(rr,o(\"Text\")),$(Fe,o(\"Path\")),$(Yt,o(\"Defs\")),$([rr,nr],o(\"Tspan\")),$([De,Wt,ne,Ue],o(\"radius\")),$(Ot,o(\"EventTarget\")),$(Nt,o(\"Dom\")),$(Ft,o(\"Element\")),$(Dt,o(\"Shape\")),$([qt,Jt],o(\"Container\")),$(ne,o(\"Gradient\")),$(Ue,o(\"Runner\")),yt.extend([...new Set(i)]),Be([kt,ut,mt,ft,Lt,oe,Ee]),Ne()},725:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.rgbToHsl=e.hslToRgb=e.rgbToHex=void 0,e.rgbToHex=function(t,e,r){return`#${((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}`},e.hslToRgb=function(t,e,r){let n,i,s;if(t/=360,r/=100,0==(e/=100))n=i=s=r;else{const o=(t,e,r)=>(r+=r<0?1:r>1?-1:0)<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,a=r<.5?r*(1+e):r+e-r*e,h=2*r-a;n=o(h,a,t+1/3),i=o(h,a,t),s=o(h,a,t-1/3)}return[.5+255*n<<0,.5+255*i<<0,.5+255*s<<0]},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;const n=Math.max(t,e,r),i=Math.min(t,e,r),s=(n+i)/2;let o,a;if(n===i)o=a=0;else{const h=n-i;switch(a=s>.5?h/(2-n-i):h/(n+i),n){case t:o=(e-r)/h+(e{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.default={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\",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\",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\",rebeccapurple:\"#663399\",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\",wheat:\"#f5deb3\",white:\"#ffffff\",whitesmoke:\"#f5f5f5\",yellow:\"#ffff00\",yellowgreen:\"#9acd32\"}},688:function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(785),e),i(r(725),e),i(r(951),e)},951:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseColor=e.parseColorAndConvert=void 0;const n=r(202),i=r(725);function s(t){if(\"number\"==typeof t)return t>16777215?{type:\"rgb\",a:t>>24&255,b:t>>16&255,c:t>>8&255,alpha:(255&t)/255}:{type:\"rgb\",a:t>>16&255,b:t>>8&255,c:255&t,alpha:1};t=t.replace(/\\s/g,\"\"),n.default[t]&&(t=n.default[t]);let e=/^#([0-9a-f]{3,8})$/i.exec(t);if(e){const t=e[1];return 3===t.length?{type:\"rgb\",a:parseInt(t[0]+t[0],16),b:parseInt(t[1]+t[1],16),c:parseInt(t[2]+t[2],16),alpha:1}:{type:\"rgb\",a:parseInt(t[0]+t[1],16),b:parseInt(t[2]+t[3],16),c:parseInt(t[4]+t[5],16),alpha:t.length>6?parseInt(t.substring(6),16)/255:1}}if(e=/^((hsl|rgb)a?)\\((\\d+),(\\d+)%?,(\\d+)%?,?(.+)?\\)$/i.exec(t),e){const[,,t,r,n,i,s]=e;return{type:t,a:+r,b:+n,c:+i,alpha:s?+s:1}}}e.parseColorAndConvert=function(t){const e=s(t);if(e){if(\"hsl\"===e.type){const[t,r,n]=i.hslToRgb(e.a,e.b,e.c);return{r:t,g:r,b:n,h:e.a,s:e.b,l:e.c,alpha:e.alpha}}{const[t,r,n]=i.rgbToHsl(e.a,e.b,e.c);return{h:t,s:r,l:n,r:e.a,g:e.b,b:e.c,alpha:e.alpha}}}},e.parseColor=s},785:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},926:t=>{var e;window,e=function(){return(()=>{var t=[function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),e.mod=e.log=e.PI2=e.PHI=e.Vec2=e.distributePointsInBuffer=e.prepareBufferForInterpolation=e.interpolate=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.now=e.toRadians=e.toDegrees=e.relativeClamp=e.clamp=e.lerp=void 0,i(r(1),e),r(10).glMatrix.setMatrixArrayType(Array),i(r(21),e),i(r(22),e),i(r(23),e),i(r(24),e),i(r(33),e),i(r(34),e),i(r(35),e),i(r(32),e),i(r(36),e),i(r(37),e),i(r(38),e),i(r(39),e),i(r(40),e),i(r(41),e),i(r(42),e),i(r(43),e),i(r(44),e),i(r(45),e),i(r(46),e),i(r(47),e),i(r(29),e),i(r(48),e);var s=r(30);Object.defineProperty(e,\"lerp\",{enumerable:!0,get:function(){return s.lerp}}),Object.defineProperty(e,\"clamp\",{enumerable:!0,get:function(){return s.clamp}}),Object.defineProperty(e,\"relativeClamp\",{enumerable:!0,get:function(){return s.relativeClamp}}),Object.defineProperty(e,\"toDegrees\",{enumerable:!0,get:function(){return s.toDegrees}}),Object.defineProperty(e,\"toRadians\",{enumerable:!0,get:function(){return s.toRadians}}),Object.defineProperty(e,\"now\",{enumerable:!0,get:function(){return s.now}}),Object.defineProperty(e,\"noise\",{enumerable:!0,get:function(){return s.noise}}),Object.defineProperty(e,\"random\",{enumerable:!0,get:function(){return s.random}}),Object.defineProperty(e,\"angleFromRepetition\",{enumerable:!0,get:function(){return s.angleFromRepetition}}),Object.defineProperty(e,\"angle2FromRepetition\",{enumerable:!0,get:function(){return s.angle2FromRepetition}}),Object.defineProperty(e,\"distanceFromRepetition\",{enumerable:!0,get:function(){return s.distanceFromRepetition}}),Object.defineProperty(e,\"interpolate\",{enumerable:!0,get:function(){return s.interpolate}}),Object.defineProperty(e,\"prepareBufferForInterpolation\",{enumerable:!0,get:function(){return s.prepareBufferForInterpolation}}),Object.defineProperty(e,\"distributePointsInBuffer\",{enumerable:!0,get:function(){return s.distributePointsInBuffer}});var o=r(26);Object.defineProperty(e,\"Vec2\",{enumerable:!0,get:function(){return o.default}});var a=r(27);Object.defineProperty(e,\"PHI\",{enumerable:!0,get:function(){return a.PHI}}),Object.defineProperty(e,\"PI2\",{enumerable:!0,get:function(){return a.PI2}}),Object.defineProperty(e,\"log\",{enumerable:!0,get:function(){return a.log}}),Object.defineProperty(e,\"mod\",{enumerable:!0,get:function(){return a.mod}})},function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(2),e),i(r(3),e),i(r(4),e),i(r(5),e),i(r(6),e),i(r(7),e),i(r(8),e),i(r(9),e)},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e)=>{\"use strict\";var r;Object.defineProperty(e,\"__esModule\",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]=\"Ring\",r[r.Matrix=2]=\"Matrix\"},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e)=>{\"use strict\";var r;Object.defineProperty(e,\"__esModule\",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]=\"Relative\",r[r.Fixed=2]=\"Fixed\"},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>s,mat3:()=>o,mat4:()=>a,quat:()=>h,quat2:()=>u,vec2:()=>c,vec3:()=>l,vec4:()=>f});var n=r(11),i=r(12),s=r(13),o=r(14),a=r(15),h=r(16),u=r(19),c=r(20),l=r(18),f=r(17)},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{EPSILON:()=>n,ARRAY_TYPE:()=>i,RANDOM:()=>s,setMatrixArrayType:()=>o,toRadian:()=>h,equals:()=>u});var n=1e-6,i=\"undefined\"!=typeof Float32Array?Float32Array:Array,s=Math.random;function o(t){i=t}var a=Math.PI/180;function h(t){return t*a}function u(t,e){return Math.abs(t-e)<=n*Math.max(1,Math.abs(t),Math.abs(e))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,identity:()=>a,fromValues:()=>h,set:()=>u,transpose:()=>c,invert:()=>l,adjoint:()=>f,determinant:()=>d,multiply:()=>p,rotate:()=>m,scale:()=>g,fromRotation:()=>y,fromScaling:()=>v,str:()=>b,frob:()=>x,LDU:()=>M,add:()=>w,subtract:()=>_,exactEquals:()=>S,equals:()=>A,multiplyScalar:()=>P,multiplyScalarAndAdd:()=>E,mul:()=>O,sub:()=>I});var n=r(11);function i(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function s(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function a(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function h(t,e,r,i){var s=new n.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=r,s[3]=i,s}function u(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function c(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function l(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*s-i*n;return o?(o=1/o,t[0]=s*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}function f(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function d(t){return t[0]*t[3]-t[2]*t[1]}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*a+s*h,t[1]=i*a+o*h,t[2]=n*u+s*c,t[3]=i*u+o*c,t}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+s*a,t[1]=i*h+o*a,t[2]=n*-a+s*h,t[3]=i*-a+o*h,t}function g(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1];return t[0]=n*a,t[1]=i*a,t[2]=s*h,t[3]=o*h,t}function y(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function v(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function b(t){return\"mat2(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}function x(t){return Math.hypot(t[0],t[1],t[2],t[3])}function M(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function w(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function _(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function S(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function A(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=e[0],h=e[1],u=e[2],c=e[3];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-h)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-u)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}function P(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function E(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}var O=p,I=_},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,identity:()=>a,fromValues:()=>h,set:()=>u,invert:()=>c,determinant:()=>l,multiply:()=>f,rotate:()=>d,scale:()=>p,translate:()=>m,fromRotation:()=>g,fromScaling:()=>y,fromTranslation:()=>v,str:()=>b,frob:()=>x,add:()=>M,subtract:()=>w,multiplyScalar:()=>_,multiplyScalarAndAdd:()=>S,exactEquals:()=>A,equals:()=>P,mul:()=>E,sub:()=>O});var n=r(11);function i(){var t=new n.ARRAY_TYPE(6);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function s(t){var e=new n.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function a(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function h(t,e,r,i,s,o){var a=new n.ARRAY_TYPE(6);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a[4]=s,a[5]=o,a}function u(t,e,r,n,i,s,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t}function c(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=r*s-n*i;return h?(h=1/h,t[0]=s*h,t[1]=-n*h,t[2]=-i*h,t[3]=r*h,t[4]=(i*a-s*o)*h,t[5]=(n*o-r*a)*h,t):null}function l(t){return t[0]*t[3]-t[1]*t[2]}function f(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1],l=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*u+s*c,t[1]=i*u+o*c,t[2]=n*l+s*f,t[3]=i*l+o*f,t[4]=n*d+s*p+a,t[5]=i*d+o*p+h,t}function d(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*u,t[1]=i*c+o*u,t[2]=n*-u+s*c,t[3]=i*-u+o*c,t[4]=a,t[5]=h,t}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1];return t[0]=n*u,t[1]=i*u,t[2]=s*c,t[3]=o*c,t[4]=a,t[5]=h,t}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=n*u+s*c+a,t[5]=i*u+o*c+h,t}function g(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function y(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function v(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function b(t){return\"mat2d(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\")\"}function x(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function M(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function w(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function _(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function S(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function A(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function P(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=e[0],c=e[1],l=e[2],f=e[3],d=e[4],p=e[5];return Math.abs(r-u)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-c)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(s-l)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(o-f)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-d)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(h-p)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(p))}var E=f,O=w},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,fromMat4:()=>s,clone:()=>o,copy:()=>a,fromValues:()=>h,set:()=>u,identity:()=>c,transpose:()=>l,invert:()=>f,adjoint:()=>d,determinant:()=>p,multiply:()=>m,translate:()=>g,rotate:()=>y,scale:()=>v,fromTranslation:()=>b,fromRotation:()=>x,fromScaling:()=>M,fromMat2d:()=>w,fromQuat:()=>_,normalFromMat4:()=>S,projection:()=>A,str:()=>P,frob:()=>E,add:()=>O,subtract:()=>I,multiplyScalar:()=>R,multiplyScalarAndAdd:()=>C,exactEquals:()=>T,equals:()=>L,mul:()=>k,sub:()=>B});var n=r(11);function i(){var t=new n.ARRAY_TYPE(9);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function o(t){var e=new n.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function h(t,e,r,i,s,o,a,h,u){var c=new n.ARRAY_TYPE(9);return c[0]=t,c[1]=e,c[2]=r,c[3]=i,c[4]=s,c[5]=o,c[6]=a,c[7]=h,c[8]=u,c}function u(t,e,r,n,i,s,o,a,h,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t}function c(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function l(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function f(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=c*o-a*u,f=-c*s+a*h,d=u*s-o*h,p=r*l+n*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-c*n+i*u)*p,t[2]=(a*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*h)*p,t[5]=(-a*r+i*s)*p,t[6]=d*p,t[7]=(-u*r+n*h)*p,t[8]=(o*r-n*s)*p,t):null}function d(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8];return t[0]=o*c-a*u,t[1]=i*u-n*c,t[2]=n*a-i*o,t[3]=a*h-s*c,t[4]=r*c-i*h,t[5]=i*s-r*a,t[6]=s*u-o*h,t[7]=n*h-r*u,t[8]=r*o-n*s,t}function p(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],h=t[7],u=t[8];return e*(u*s-o*h)+r*(-u*i+o*a)+n*(h*i-s*a)}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=r[0],d=r[1],p=r[2],m=r[3],g=r[4],y=r[5],v=r[6],b=r[7],x=r[8];return t[0]=f*n+d*o+p*u,t[1]=f*i+d*a+p*c,t[2]=f*s+d*h+p*l,t[3]=m*n+g*o+y*u,t[4]=m*i+g*a+y*c,t[5]=m*s+g*h+y*l,t[6]=v*n+b*o+x*u,t[7]=v*i+b*a+x*c,t[8]=v*s+b*h+x*l,t}function g(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=h,t[6]=f*n+d*o+u,t[7]=f*i+d*a+c,t[8]=f*s+d*h+l,t}function y(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*a,t[2]=d*s+f*h,t[3]=d*o-f*n,t[4]=d*a-f*i,t[5]=d*h-f*s,t[6]=u,t[7]=c,t[8]=l,t}function v(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function b(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function x(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function M(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function w(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function _(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,h=i+i,u=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*h,m=s*o,g=s*a,y=s*h;return t[0]=1-l-p,t[3]=c-y,t[6]=f+g,t[1]=c+y,t[4]=1-u-p,t[7]=d-m,t[2]=f-g,t[5]=d+m,t[8]=1-u-l,t}function S(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],y=e[15],v=r*a-n*o,b=r*h-i*o,x=r*u-s*o,M=n*h-i*a,w=n*u-s*a,_=i*u-s*h,S=c*m-l*p,A=c*g-f*p,P=c*y-d*p,E=l*g-f*m,O=l*y-d*m,I=f*y-d*g,R=v*I-b*O+x*E+M*P-w*A+_*S;return R?(R=1/R,t[0]=(a*I-h*O+u*E)*R,t[1]=(h*P-o*I-u*A)*R,t[2]=(o*O-a*P+u*S)*R,t[3]=(i*O-n*I-s*E)*R,t[4]=(r*I-i*P+s*A)*R,t[5]=(n*P-r*O-s*S)*R,t[6]=(m*_-g*w+y*M)*R,t[7]=(g*x-p*_-y*b)*R,t[8]=(p*w-m*x+y*v)*R,t):null}function A(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function P(t){return\"mat3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\")\"}function E(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function O(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function I(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function R(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function C(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function T(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function L(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=t[6],c=t[7],l=t[8],f=e[0],d=e[1],p=e[2],m=e[3],g=e[4],y=e[5],v=e[6],b=e[7],x=e[8];return Math.abs(r-f)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(i-d)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(s-p)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(o-m)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(a-g)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(h-y)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(y))&&Math.abs(u-v)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(c-b)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(l-x)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(x))}var k=m,B=I},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,fromValues:()=>a,set:()=>h,identity:()=>u,transpose:()=>c,invert:()=>l,adjoint:()=>f,determinant:()=>d,multiply:()=>p,translate:()=>m,scale:()=>g,rotate:()=>y,rotateX:()=>v,rotateY:()=>b,rotateZ:()=>x,fromTranslation:()=>M,fromScaling:()=>w,fromRotation:()=>_,fromXRotation:()=>S,fromYRotation:()=>A,fromZRotation:()=>P,fromRotationTranslation:()=>E,fromQuat2:()=>O,getTranslation:()=>I,getScaling:()=>R,getRotation:()=>C,fromRotationTranslationScale:()=>T,fromRotationTranslationScaleOrigin:()=>L,fromQuat:()=>k,frustum:()=>B,perspective:()=>N,perspectiveFromFieldOfView:()=>F,ortho:()=>j,lookAt:()=>q,targetTo:()=>Y,str:()=>D,frob:()=>z,add:()=>V,subtract:()=>$,multiplyScalar:()=>G,multiplyScalarAndAdd:()=>X,exactEquals:()=>U,equals:()=>H,mul:()=>Z,sub:()=>Q});var n=r(11);function i(){var t=new n.ARRAY_TYPE(16);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function s(t){var e=new n.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function a(t,e,r,i,s,o,a,h,u,c,l,f,d,p,m,g){var y=new n.ARRAY_TYPE(16);return y[0]=t,y[1]=e,y[2]=r,y[3]=i,y[4]=s,y[5]=o,y[6]=a,y[7]=h,y[8]=u,y[9]=c,y[10]=l,y[11]=f,y[12]=d,y[13]=p,y[14]=m,y[15]=g,y}function h(t,e,r,n,i,s,o,a,h,u,c,l,f,d,p,m,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t[9]=c,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=g,t}function u(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function c(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=i,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function l(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],y=e[15],v=r*a-n*o,b=r*h-i*o,x=r*u-s*o,M=n*h-i*a,w=n*u-s*a,_=i*u-s*h,S=c*m-l*p,A=c*g-f*p,P=c*y-d*p,E=l*g-f*m,O=l*y-d*m,I=f*y-d*g,R=v*I-b*O+x*E+M*P-w*A+_*S;return R?(R=1/R,t[0]=(a*I-h*O+u*E)*R,t[1]=(i*O-n*I-s*E)*R,t[2]=(m*_-g*w+y*M)*R,t[3]=(f*w-l*_-d*M)*R,t[4]=(h*P-o*I-u*A)*R,t[5]=(r*I-i*P+s*A)*R,t[6]=(g*x-p*_-y*b)*R,t[7]=(c*_-f*x+d*b)*R,t[8]=(o*O-a*P+u*S)*R,t[9]=(n*P-r*O-s*S)*R,t[10]=(p*w-m*x+y*v)*R,t[11]=(l*x-c*w-d*v)*R,t[12]=(a*A-o*E-h*S)*R,t[13]=(r*E-n*A+i*S)*R,t[14]=(m*b-p*M-g*v)*R,t[15]=(c*M-l*b+f*v)*R,t):null}function f(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],y=e[15];return t[0]=a*(f*y-d*g)-l*(h*y-u*g)+m*(h*d-u*f),t[1]=-(n*(f*y-d*g)-l*(i*y-s*g)+m*(i*d-s*f)),t[2]=n*(h*y-u*g)-a*(i*y-s*g)+m*(i*u-s*h),t[3]=-(n*(h*d-u*f)-a*(i*d-s*f)+l*(i*u-s*h)),t[4]=-(o*(f*y-d*g)-c*(h*y-u*g)+p*(h*d-u*f)),t[5]=r*(f*y-d*g)-c*(i*y-s*g)+p*(i*d-s*f),t[6]=-(r*(h*y-u*g)-o*(i*y-s*g)+p*(i*u-s*h)),t[7]=r*(h*d-u*f)-o*(i*d-s*f)+c*(i*u-s*h),t[8]=o*(l*y-d*m)-c*(a*y-u*m)+p*(a*d-u*l),t[9]=-(r*(l*y-d*m)-c*(n*y-s*m)+p*(n*d-s*l)),t[10]=r*(a*y-u*m)-o*(n*y-s*m)+p*(n*u-s*a),t[11]=-(r*(a*d-u*l)-o*(n*d-s*l)+c*(n*u-s*a)),t[12]=-(o*(l*g-f*m)-c*(a*g-h*m)+p*(a*f-h*l)),t[13]=r*(l*g-f*m)-c*(n*g-i*m)+p*(n*f-i*l),t[14]=-(r*(a*g-h*m)-o*(n*g-i*m)+p*(n*h-i*a)),t[15]=r*(a*f-h*l)-o*(n*f-i*l)+c*(n*h-i*a),t}function d(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],h=t[7],u=t[8],c=t[9],l=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*s)*(l*g-f*m)-(e*a-n*s)*(c*g-f*p)+(e*h-i*s)*(c*m-l*p)+(r*a-n*o)*(u*g-f*d)-(r*h-i*o)*(u*m-l*d)+(n*h-i*a)*(u*p-c*d)}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],y=e[14],v=e[15],b=r[0],x=r[1],M=r[2],w=r[3];return t[0]=b*n+x*a+M*l+w*m,t[1]=b*i+x*h+M*f+w*g,t[2]=b*s+x*u+M*d+w*y,t[3]=b*o+x*c+M*p+w*v,b=r[4],x=r[5],M=r[6],w=r[7],t[4]=b*n+x*a+M*l+w*m,t[5]=b*i+x*h+M*f+w*g,t[6]=b*s+x*u+M*d+w*y,t[7]=b*o+x*c+M*p+w*v,b=r[8],x=r[9],M=r[10],w=r[11],t[8]=b*n+x*a+M*l+w*m,t[9]=b*i+x*h+M*f+w*g,t[10]=b*s+x*u+M*d+w*y,t[11]=b*o+x*c+M*p+w*v,b=r[12],x=r[13],M=r[14],w=r[15],t[12]=b*n+x*a+M*l+w*m,t[13]=b*i+x*h+M*f+w*g,t[14]=b*s+x*u+M*d+w*y,t[15]=b*o+x*c+M*p+w*v,t}function m(t,e,r){var n,i,s,o,a,h,u,c,l,f,d,p,m=r[0],g=r[1],y=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=h,t[6]=u,t[7]=c,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+a*g+l*y+e[12],t[13]=i*m+h*g+f*y+e[13],t[14]=s*m+u*g+d*y+e[14],t[15]=o*m+c*g+p*y+e[15]),t}function g(t,e,r){var n=r[0],i=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function y(t,e,r,i){var s,o,a,h,u,c,l,f,d,p,m,g,y,v,b,x,M,w,_,S,A,P,E,O,I=i[0],R=i[1],C=i[2],T=Math.hypot(I,R,C);return T0?(r[0]=2*(h*a+l*i+u*o-c*s)/f,r[1]=2*(u*a+l*s+c*i-h*o)/f,r[2]=2*(c*a+l*o+h*s-u*i)/f):(r[0]=2*(h*a+l*i+u*o-c*s),r[1]=2*(u*a+l*s+c*i-h*o),r[2]=2*(c*a+l*o+h*s-u*i)),E(t,e,r),t}function I(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function R(t,e){var r=e[0],n=e[1],i=e[2],s=e[4],o=e[5],a=e[6],h=e[8],u=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(s,o,a),t[2]=Math.hypot(h,u,c),t}function C(t,e){var r=new n.ARRAY_TYPE(3);R(r,e);var i=1/r[0],s=1/r[1],o=1/r[2],a=e[0]*i,h=e[1]*s,u=e[2]*o,c=e[4]*i,l=e[5]*s,f=e[6]*o,d=e[8]*i,p=e[9]*s,m=e[10]*o,g=a+l+m,y=0;return g>0?(y=2*Math.sqrt(g+1),t[3]=.25*y,t[0]=(f-p)/y,t[1]=(d-u)/y,t[2]=(h-c)/y):a>l&&a>m?(y=2*Math.sqrt(1+a-l-m),t[3]=(f-p)/y,t[0]=.25*y,t[1]=(h+c)/y,t[2]=(d+u)/y):l>m?(y=2*Math.sqrt(1+l-a-m),t[3]=(d-u)/y,t[0]=(h+c)/y,t[1]=.25*y,t[2]=(f+p)/y):(y=2*Math.sqrt(1+m-a-l),t[3]=(h-c)/y,t[0]=(d+u)/y,t[1]=(f+p)/y,t[2]=.25*y),t}function T(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3],h=i+i,u=s+s,c=o+o,l=i*h,f=i*u,d=i*c,p=s*u,m=s*c,g=o*c,y=a*h,v=a*u,b=a*c,x=n[0],M=n[1],w=n[2];return t[0]=(1-(p+g))*x,t[1]=(f+b)*x,t[2]=(d-v)*x,t[3]=0,t[4]=(f-b)*M,t[5]=(1-(l+g))*M,t[6]=(m+y)*M,t[7]=0,t[8]=(d+v)*w,t[9]=(m-y)*w,t[10]=(1-(l+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function L(t,e,r,n,i){var s=e[0],o=e[1],a=e[2],h=e[3],u=s+s,c=o+o,l=a+a,f=s*u,d=s*c,p=s*l,m=o*c,g=o*l,y=a*l,v=h*u,b=h*c,x=h*l,M=n[0],w=n[1],_=n[2],S=i[0],A=i[1],P=i[2],E=(1-(m+y))*M,O=(d+x)*M,I=(p-b)*M,R=(d-x)*w,C=(1-(f+y))*w,T=(g+v)*w,L=(p+b)*_,k=(g-v)*_,B=(1-(f+m))*_;return t[0]=E,t[1]=O,t[2]=I,t[3]=0,t[4]=R,t[5]=C,t[6]=T,t[7]=0,t[8]=L,t[9]=k,t[10]=B,t[11]=0,t[12]=r[0]+S-(E*S+R*A+L*P),t[13]=r[1]+A-(O*S+C*A+k*P),t[14]=r[2]+P-(I*S+T*A+B*P),t[15]=1,t}function k(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,h=i+i,u=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*h,m=s*o,g=s*a,y=s*h;return t[0]=1-l-p,t[1]=c+y,t[2]=f-g,t[3]=0,t[4]=c-y,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-u-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function B(t,e,r,n,i,s,o){var a=1/(r-e),h=1/(i-n),u=1/(s-o);return t[0]=2*s*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*h,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*h,t[10]=(o+s)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*u,t[15]=0,t}function N(t,e,r,n,i){var s,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(s=1/(n-i),t[10]=(i+n)*s,t[14]=2*i*n*s):(t[10]=-1,t[14]=-2*n),t}function F(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),h=2/(o+a),u=2/(i+s);return t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-a)*h*.5,t[9]=(i-s)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function j(t,e,r,n,i,s,o){var a=1/(e-r),h=1/(n-i),u=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*h,t[14]=(o+s)*u,t[15]=1,t}function q(t,e,r,i){var s,o,a,h,c,l,f,d,p,m,g=e[0],y=e[1],v=e[2],b=i[0],x=i[1],M=i[2],w=r[0],_=r[1],S=r[2];return Math.abs(g-w)0&&(c*=d=1/Math.sqrt(d),l*=d,f*=d);var p=h*f-u*l,m=u*c-a*f,g=a*l-h*c;return(d=p*p+m*m+g*g)>0&&(p*=d=1/Math.sqrt(d),m*=d,g*=d),t[0]=p,t[1]=m,t[2]=g,t[3]=0,t[4]=l*g-f*m,t[5]=f*p-c*g,t[6]=c*m-l*p,t[7]=0,t[8]=c,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=s,t[14]=o,t[15]=1,t}function D(t){return\"mat4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\", \"+t[9]+\", \"+t[10]+\", \"+t[11]+\", \"+t[12]+\", \"+t[13]+\", \"+t[14]+\", \"+t[15]+\")\"}function z(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function V(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function $(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function G(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function X(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function U(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function H(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=t[6],c=t[7],l=t[8],f=t[9],d=t[10],p=t[11],m=t[12],g=t[13],y=t[14],v=t[15],b=e[0],x=e[1],M=e[2],w=e[3],_=e[4],S=e[5],A=e[6],P=e[7],E=e[8],O=e[9],I=e[10],R=e[11],C=e[12],T=e[13],L=e[14],k=e[15];return Math.abs(r-b)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(s-M)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(o-w)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-_)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(h-S)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(u-A)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(c-P)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(P))&&Math.abs(l-E)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(f-O)<=n.EPSILON*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(d-I)<=n.EPSILON*Math.max(1,Math.abs(d),Math.abs(I))&&Math.abs(p-R)<=n.EPSILON*Math.max(1,Math.abs(p),Math.abs(R))&&Math.abs(m-C)<=n.EPSILON*Math.max(1,Math.abs(m),Math.abs(C))&&Math.abs(g-T)<=n.EPSILON*Math.max(1,Math.abs(g),Math.abs(T))&&Math.abs(y-L)<=n.EPSILON*Math.max(1,Math.abs(y),Math.abs(L))&&Math.abs(v-k)<=n.EPSILON*Math.max(1,Math.abs(v),Math.abs(k))}var Z=p,Q=$},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>a,identity:()=>h,setAxisAngle:()=>u,getAxisAngle:()=>c,getAngle:()=>l,multiply:()=>f,rotateX:()=>d,rotateY:()=>p,rotateZ:()=>m,calculateW:()=>g,exp:()=>y,ln:()=>v,pow:()=>b,slerp:()=>x,random:()=>M,invert:()=>w,conjugate:()=>_,fromMat3:()=>S,fromEuler:()=>A,str:()=>P,clone:()=>L,fromValues:()=>k,copy:()=>B,set:()=>N,add:()=>F,mul:()=>j,scale:()=>q,dot:()=>Y,lerp:()=>D,length:()=>z,len:()=>V,squaredLength:()=>$,sqrLen:()=>G,normalize:()=>X,exactEquals:()=>U,equals:()=>H,rotationTo:()=>Z,sqlerp:()=>Q,setAxes:()=>W});var n=r(11),i=r(14),s=r(18),o=r(17);function a(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function h(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function u(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function c(t,e){var r=2*Math.acos(e[3]),i=Math.sin(r/2);return i>n.EPSILON?(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i):(t[0]=1,t[1]=0,t[2]=0),r}function l(t,e){var r=Y(t,e);return Math.acos(2*r*r-1)}function f(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*c+o*a+i*u-s*h,t[1]=i*c+o*h+s*a-n*u,t[2]=s*c+o*u+n*h-i*a,t[3]=o*c-n*a-i*h-s*u,t}function d(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+o*a,t[1]=i*h+s*a,t[2]=s*h-i*a,t[3]=o*h-n*a,t}function p(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h-s*a,t[1]=i*h+o*a,t[2]=s*h+n*a,t[3]=o*h-i*a,t}function m(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+i*a,t[1]=i*h-n*a,t[2]=s*h+o*a,t[3]=o*h-s*a,t}function g(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function y(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=Math.exp(s),h=o>0?a*Math.sin(o)/o:0;return t[0]=r*h,t[1]=n*h,t[2]=i*h,t[3]=a*Math.cos(o),t}function v(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=o>0?Math.atan2(o,s)/o:0;return t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=.5*Math.log(r*r+n*n+i*i+s*s),t}function b(t,e,r){return v(t,e),q(t,t,r),y(t,t),t}function x(t,e,r,i){var s,o,a,h,u,c=e[0],l=e[1],f=e[2],d=e[3],p=r[0],m=r[1],g=r[2],y=r[3];return(o=c*p+l*m+f*g+d*y)<0&&(o=-o,p=-p,m=-m,g=-g,y=-y),1-o>n.EPSILON?(s=Math.acos(o),a=Math.sin(s),h=Math.sin((1-i)*s)/a,u=Math.sin(i*s)/a):(h=1-i,u=i),t[0]=h*c+u*p,t[1]=h*l+u*m,t[2]=h*f+u*g,t[3]=h*d+u*y,t}function M(t){var e=n.RANDOM(),r=n.RANDOM(),i=n.RANDOM(),s=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=s*Math.sin(2*Math.PI*r),t[1]=s*Math.cos(2*Math.PI*r),t[2]=o*Math.sin(2*Math.PI*i),t[3]=o*Math.cos(2*Math.PI*i),t}function w(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s,a=o?1/o:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=s*a,t}function _(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function S(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var s=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*s+s]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*s+o]-e[3*o+s])*r,t[s]=(e[3*s+i]+e[3*i+s])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t}function A(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var s=Math.sin(e),o=Math.cos(e),a=Math.sin(r),h=Math.cos(r),u=Math.sin(n),c=Math.cos(n);return t[0]=s*h*c-o*a*u,t[1]=o*a*c+s*h*u,t[2]=o*h*u-s*a*c,t[3]=o*h*c+s*a*u,t}function P(t){return\"quat(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}var E,O,I,R,C,T,L=o.clone,k=o.fromValues,B=o.copy,N=o.set,F=o.add,j=f,q=o.scale,Y=o.dot,D=o.lerp,z=o.length,V=z,$=o.squaredLength,G=$,X=o.normalize,U=o.exactEquals,H=o.equals,Z=(E=s.create(),O=s.fromValues(1,0,0),I=s.fromValues(0,1,0),function(t,e,r){var n=s.dot(e,r);return n<-.999999?(s.cross(E,O,e),s.len(E)<1e-6&&s.cross(E,I,e),s.normalize(E,E),u(t,E,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(s.cross(E,e,r),t[0]=E[0],t[1]=E[1],t[2]=E[2],t[3]=1+n,X(t,t))}),Q=(R=a(),C=a(),function(t,e,r,n,i,s){return x(R,e,i,s),x(C,r,n,s),x(t,R,C,2*s*(1-s)),t}),W=(T=i.create(),function(t,e,r,n){return T[0]=r[0],T[3]=r[1],T[6]=r[2],T[1]=n[0],T[4]=n[1],T[7]=n[2],T[2]=-e[0],T[5]=-e[1],T[8]=-e[2],X(t,S(t,T))})},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,fromValues:()=>o,copy:()=>a,set:()=>h,add:()=>u,subtract:()=>c,multiply:()=>l,divide:()=>f,ceil:()=>d,floor:()=>p,min:()=>m,max:()=>g,round:()=>y,scale:()=>v,scaleAndAdd:()=>b,distance:()=>x,squaredDistance:()=>M,length:()=>w,squaredLength:()=>_,negate:()=>S,inverse:()=>A,normalize:()=>P,dot:()=>E,cross:()=>O,lerp:()=>I,random:()=>R,transformMat4:()=>C,transformQuat:()=>T,zero:()=>L,str:()=>k,exactEquals:()=>B,equals:()=>N,sub:()=>j,mul:()=>q,div:()=>Y,dist:()=>D,sqrDist:()=>z,len:()=>V,sqrLen:()=>$,forEach:()=>G});var n=r(11);function i(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function s(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(t,e,r,i){var s=new n.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=r,s[3]=i,s}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function h(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function u(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function l(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}function f(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function m(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}function g(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}function y(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function v(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function b(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}function x(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return Math.hypot(r,n,i,s)}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return r*r+n*n+i*i+s*s}function w(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}function _(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function A(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function P(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s;return o>0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=s*o,t}function E(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function O(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],s=r[0]*n[2]-r[2]*n[0],o=r[0]*n[3]-r[3]*n[0],a=r[1]*n[2]-r[2]*n[1],h=r[1]*n[3]-r[3]*n[1],u=r[2]*n[3]-r[3]*n[2],c=e[0],l=e[1],f=e[2],d=e[3];return t[0]=l*u-f*h+d*a,t[1]=-c*u+f*o-d*s,t[2]=c*h-l*o+d*i,t[3]=-c*a+l*s-f*i,t}function I(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t[3]=a+n*(r[3]-a),t}function R(t,e){var r,i,s,o,a,h;e=e||1;do{a=(r=2*n.RANDOM()-1)*r+(i=2*n.RANDOM()-1)*i}while(a>=1);do{h=(s=2*n.RANDOM()-1)*s+(o=2*n.RANDOM()-1)*o}while(h>=1);var u=Math.sqrt((1-a)/h);return t[0]=e*r,t[1]=e*i,t[2]=e*s*u,t[3]=e*o*u,t}function C(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*s+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*s+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*s+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*s+r[15]*o,t}function T(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],h=r[2],u=r[3],c=u*n+a*s-h*i,l=u*i+h*n-o*s,f=u*s+o*i-a*n,d=-o*n-a*i-h*s;return t[0]=c*u+d*-o+l*-h-f*-a,t[1]=l*u+d*-a+f*-o-c*-h,t[2]=f*u+d*-h+c*-a-l*-o,t[3]=e[3],t}function L(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function k(t){return\"vec4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}function B(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function N(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=e[0],h=e[1],u=e[2],c=e[3];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-h)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-u)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}var F,j=c,q=l,Y=f,D=x,z=M,V=w,$=_,G=(F=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=4),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,length:()=>o,fromValues:()=>a,copy:()=>h,set:()=>u,add:()=>c,subtract:()=>l,multiply:()=>f,divide:()=>d,ceil:()=>p,floor:()=>m,min:()=>g,max:()=>y,round:()=>v,scale:()=>b,scaleAndAdd:()=>x,distance:()=>M,squaredDistance:()=>w,squaredLength:()=>_,negate:()=>S,inverse:()=>A,normalize:()=>P,dot:()=>E,cross:()=>O,lerp:()=>I,hermite:()=>R,bezier:()=>C,random:()=>T,transformMat4:()=>L,transformMat3:()=>k,transformQuat:()=>B,rotateX:()=>N,rotateY:()=>F,rotateZ:()=>j,angle:()=>q,zero:()=>Y,str:()=>D,exactEquals:()=>z,equals:()=>V,sub:()=>G,mul:()=>X,div:()=>U,dist:()=>H,sqrDist:()=>Z,len:()=>Q,sqrLen:()=>W,forEach:()=>J});var n=r(11);function i(){var t=new n.ARRAY_TYPE(3);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function s(t){var e=new n.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function o(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function a(t,e,r){var i=new n.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=r,i}function h(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function u(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function c(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function l(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function f(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function d(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function p(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function m(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function g(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function y(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function v(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function b(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function x(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function w(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function _(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function A(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function P(t,e){var r=e[0],n=e[1],i=e[2],s=r*r+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function E(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function O(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],h=r[2];return t[0]=i*h-s*a,t[1]=s*o-n*h,t[2]=n*a-i*o,t}function I(t,e,r,n){var i=e[0],s=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t}function R(t,e,r,n,i,s){var o=s*s,a=o*(2*s-3)+1,h=o*(s-2)+s,u=o*(s-1),c=o*(3-2*s);return t[0]=e[0]*a+r[0]*h+n[0]*u+i[0]*c,t[1]=e[1]*a+r[1]*h+n[1]*u+i[1]*c,t[2]=e[2]*a+r[2]*h+n[2]*u+i[2]*c,t}function C(t,e,r,n,i,s){var o=1-s,a=o*o,h=s*s,u=a*o,c=3*s*a,l=3*h*o,f=h*s;return t[0]=e[0]*u+r[0]*c+n[0]*l+i[0]*f,t[1]=e[1]*u+r[1]*c+n[1]*l+i[1]*f,t[2]=e[2]*u+r[2]*c+n[2]*l+i[2]*f,t}function T(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,s=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*s,t[1]=Math.sin(r)*s,t[2]=i*e,t}function L(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[3]*n+r[7]*i+r[11]*s+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*s+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*s+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*s+r[14])/o,t}function k(t,e,r){var n=e[0],i=e[1],s=e[2];return t[0]=n*r[0]+i*r[3]+s*r[6],t[1]=n*r[1]+i*r[4]+s*r[7],t[2]=n*r[2]+i*r[5]+s*r[8],t}function B(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],h=e[1],u=e[2],c=i*u-s*h,l=s*a-n*u,f=n*h-i*a,d=i*f-s*l,p=s*c-n*f,m=n*l-i*c,g=2*o;return c*=g,l*=g,f*=g,d*=2,p*=2,m*=2,t[0]=a+c+d,t[1]=h+l+p,t[2]=u+f+m,t}function N(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0],s[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),s[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function F(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),s[1]=i[1],s[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function j(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),s[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),s[2]=i[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function q(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2],h=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(s*s+o*o+a*a),u=h&&E(t,e)/h;return Math.acos(Math.min(Math.max(u,-1),1))}function Y(t){return t[0]=0,t[1]=0,t[2]=0,t}function D(t){return\"vec3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\")\"}function z(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function V(t,e){var r=t[0],i=t[1],s=t[2],o=e[0],a=e[1],h=e[2];return Math.abs(r-o)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-a)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(s-h)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(h))}var $,G=l,X=f,U=d,H=M,Z=w,Q=o,W=_,J=($=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=3),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{\"use strict\";r.r(e),r.d(e,{create:()=>o,clone:()=>a,fromValues:()=>h,fromRotationTranslationValues:()=>u,fromRotationTranslation:()=>c,fromTranslation:()=>l,fromRotation:()=>f,fromMat4:()=>d,copy:()=>p,identity:()=>m,set:()=>g,getReal:()=>y,getDual:()=>v,setReal:()=>b,setDual:()=>x,getTranslation:()=>M,translate:()=>w,rotateX:()=>_,rotateY:()=>S,rotateZ:()=>A,rotateByQuatAppend:()=>P,rotateByQuatPrepend:()=>E,rotateAroundAxis:()=>O,add:()=>I,multiply:()=>R,mul:()=>C,scale:()=>T,dot:()=>L,lerp:()=>k,invert:()=>B,conjugate:()=>N,length:()=>F,len:()=>j,squaredLength:()=>q,sqrLen:()=>Y,normalize:()=>D,str:()=>z,exactEquals:()=>V,equals:()=>$});var n=r(11),i=r(16),s=r(15);function o(){var t=new n.ARRAY_TYPE(8);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function a(t){var e=new n.ARRAY_TYPE(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function h(t,e,r,i,s,o,a,h){var u=new n.ARRAY_TYPE(8);return u[0]=t,u[1]=e,u[2]=r,u[3]=i,u[4]=s,u[5]=o,u[6]=a,u[7]=h,u}function u(t,e,r,i,s,o,a){var h=new n.ARRAY_TYPE(8);h[0]=t,h[1]=e,h[2]=r,h[3]=i;var u=.5*s,c=.5*o,l=.5*a;return h[4]=u*i+c*r-l*e,h[5]=c*i+l*t-u*r,h[6]=l*i+u*e-c*t,h[7]=-u*t-c*e-l*r,h}function c(t,e,r){var n=.5*r[0],i=.5*r[1],s=.5*r[2],o=e[0],a=e[1],h=e[2],u=e[3];return t[0]=o,t[1]=a,t[2]=h,t[3]=u,t[4]=n*u+i*h-s*a,t[5]=i*u+s*o-n*h,t[6]=s*u+n*a-i*o,t[7]=-n*o-i*a-s*h,t}function l(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function d(t,e){var r=i.create();s.getRotation(r,e);var o=new n.ARRAY_TYPE(3);return s.getTranslation(o,e),c(t,r,o),t}function p(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function m(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function g(t,e,r,n,i,s,o,a,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t}var y=i.copy;function v(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var b=i.copy;function x(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function M(t,e){var r=e[4],n=e[5],i=e[6],s=e[7],o=-e[0],a=-e[1],h=-e[2],u=e[3];return t[0]=2*(r*u+s*o+n*h-i*a),t[1]=2*(n*u+s*a+i*o-r*h),t[2]=2*(i*u+s*h+r*a-n*o),t}function w(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=.5*r[0],h=.5*r[1],u=.5*r[2],c=e[4],l=e[5],f=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=o*a+i*u-s*h+c,t[5]=o*h+s*a-n*u+l,t[6]=o*u+n*h-i*a+f,t[7]=-n*a-i*h-s*u+d,t}function _(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],h=e[4],u=e[5],c=e[6],l=e[7],f=h*a+l*n+u*o-c*s,d=u*a+l*s+c*n-h*o,p=c*a+l*o+h*s-u*n,m=l*a-h*n-u*s-c*o;return i.rotateX(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function S(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],h=e[4],u=e[5],c=e[6],l=e[7],f=h*a+l*n+u*o-c*s,d=u*a+l*s+c*n-h*o,p=c*a+l*o+h*s-u*n,m=l*a-h*n-u*s-c*o;return i.rotateY(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function A(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],h=e[4],u=e[5],c=e[6],l=e[7],f=h*a+l*n+u*o-c*s,d=u*a+l*s+c*n-h*o,p=c*a+l*o+h*s-u*n,m=l*a-h*n-u*s-c*o;return i.rotateZ(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function P(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],h=e[1],u=e[2],c=e[3];return t[0]=a*o+c*n+h*s-u*i,t[1]=h*o+c*i+u*n-a*s,t[2]=u*o+c*s+a*i-h*n,t[3]=c*o-a*n-h*i-u*s,a=e[4],h=e[5],u=e[6],c=e[7],t[4]=a*o+c*n+h*s-u*i,t[5]=h*o+c*i+u*n-a*s,t[6]=u*o+c*s+a*i-h*n,t[7]=c*o-a*n-h*i-u*s,t}function E(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*c+o*a+i*u-s*h,t[1]=i*c+o*h+s*a-n*u,t[2]=s*c+o*u+n*h-i*a,t[3]=o*c-n*a-i*h-s*u,a=r[4],h=r[5],u=r[6],c=r[7],t[4]=n*c+o*a+i*u-s*h,t[5]=i*c+o*h+s*a-n*u,t[6]=s*c+o*u+n*h-i*a,t[7]=o*c-n*a-i*h-s*u,t}function O(t,e,r,i){if(Math.abs(i)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,s=e[2]/r,o=e[3]/r,a=e[4],h=e[5],u=e[6],c=e[7],l=n*a+i*h+s*u+o*c;t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=(a-n*l)/r,t[5]=(h-i*l)/r,t[6]=(u-s*l)/r,t[7]=(c-o*l)/r}return t}function z(t){return\"quat2(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\")\"}function V(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function $(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=t[6],c=t[7],l=e[0],f=e[1],d=e[2],p=e[3],m=e[4],g=e[5],y=e[6],v=e[7];return Math.abs(r-l)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(i-f)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(s-d)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(o-p)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-m)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(h-g)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(g))&&Math.abs(u-y)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-v)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(v))}},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,fromValues:()=>o,copy:()=>a,set:()=>h,add:()=>u,subtract:()=>c,multiply:()=>l,divide:()=>f,ceil:()=>d,floor:()=>p,min:()=>m,max:()=>g,round:()=>y,scale:()=>v,scaleAndAdd:()=>b,distance:()=>x,squaredDistance:()=>M,length:()=>w,squaredLength:()=>_,negate:()=>S,inverse:()=>A,normalize:()=>P,dot:()=>E,cross:()=>O,lerp:()=>I,random:()=>R,transformMat2:()=>C,transformMat2d:()=>T,transformMat3:()=>L,transformMat4:()=>k,rotate:()=>B,angle:()=>N,zero:()=>F,str:()=>j,exactEquals:()=>q,equals:()=>Y,len:()=>z,sub:()=>V,mul:()=>$,div:()=>G,dist:()=>X,sqrDist:()=>U,sqrLen:()=>H,forEach:()=>Z});var n=r(11);function i(){var t=new n.ARRAY_TYPE(2);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function s(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e}function o(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r}function a(t,e){return t[0]=e[0],t[1]=e[1],t}function h(t,e,r){return t[0]=e,t[1]=r,t}function u(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function l(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function f(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function m(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function g(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function y(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function v(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function b(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function x(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function w(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function _(t){var e=t[0],r=t[1];return e*e+r*r}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t}function A(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function P(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function E(t,e){return t[0]*e[0]+t[1]*e[1]}function O(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function I(t,e,r,n){var i=e[0],s=e[1];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t}function R(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function C(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function T(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function L(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function k(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function B(t,e,r,n){var i=e[0]-r[0],s=e[1]-r[1],o=Math.sin(n),a=Math.cos(n);return t[0]=i*a-s*o+r[0],t[1]=i*o+s*a+r[1],t}function N(t,e){var r=t[0],n=t[1],i=e[0],s=e[1],o=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+s*s),a=o&&(r*i+n*s)/o;return Math.acos(Math.min(Math.max(a,-1),1))}function F(t){return t[0]=0,t[1]=0,t}function j(t){return\"vec2(\"+t[0]+\", \"+t[1]+\")\"}function q(t,e){return t[0]===e[0]&&t[1]===e[1]}function Y(t,e){var r=t[0],i=t[1],s=e[0],o=e[1];return Math.abs(r-s)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-o)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))}var D,z=w,V=c,$=l,G=f,X=x,U=M,H=_,Z=(D=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=2),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Scene=void 0;const n=r(22),i=r(23),s=r(32),o=r(30);class a{constructor(t={}){this.width=400,this.height=400,this.background=\"hsla(0, 0%, 0%, 1)\",this.color=\"hsla(0, 0%, 100%, 1)\",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?[\"number\"==typeof t.anchor[0]?(.5+.5*o.clamp(-1,1,t.anchor[0]))*this.width:\"left\"===t.anchor[0]?0:\"right\"===t.anchor[0]?this.width:this.center[0],\"number\"==typeof t.anchor[1]?(.5+.5*o.clamp(-1,1,t.anchor[1]))*this.height:\"top\"===t.anchor[1]?0:\"bottom\"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e=\"number\"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,a.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{a.propagateToChilden(t,e)})):t instanceof s.Shape&&t.shape&&(t.shape.scene=e,a.propagateToChilden(t.shape,e))}}e.Scene=a},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||\"SceneChild\",this.name=t.name||this.type+\"_\"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){\"string\"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Group=void 0;const n=r(21),i=r(22),s=r(24),o=r(28);class a extends i.SceneChild{constructor(t={}){t.type=\"Group\",super(t),this.children=[],[\"id\",\"name\",\"data\",\"order\",\"type\"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=o.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){\"object\"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=a},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeBase=void 0;const n=r(10),i=r(1),s=r(25),o=r(26),a=r(27),h=r(28),u=r(30),c=r(22),l=n.mat4.create(),f=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class m extends c.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?[\"number\"==typeof t.anchor[0]?-1*u.clamp(-1,1,t.anchor[0]):\"left\"===t.anchor[0]?1:\"right\"===t.anchor[0]?-1:0,\"number\"==typeof t.anchor[1]?-1*u.clamp(-1,1,t.anchor[1]):\"top\"===t.anchor[1]?1:\"bottom\"===t.anchor[1]?-1:0]:[0,0],this.boundingType=\"string\"==typeof t.boundingType?\"relative\"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return\"function\"!=typeof t.repetitions&&\"function\"!=typeof t.distance&&\"function\"!=typeof t.displace&&\"function\"!=typeof t.scale&&\"function\"!=typeof t.translate&&\"function\"!=typeof t.skewX&&\"function\"!=typeof t.skewY&&\"function\"!=typeof t.squeezeX&&\"function\"!=typeof t.squeezeY&&\"function\"!=typeof t.rotateX&&\"function\"!=typeof t.rotateY&&\"function\"!=typeof t.rotateZ&&\"function\"!=typeof t.transformOrigin&&\"function\"!=typeof t.perspective&&\"function\"!=typeof t.perspectiveOrigin}isStaticIndexed(){return\"function\"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return\"function\"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){\"string\"==typeof t?(r=r||\"repetitions\"==t,this.props[t]=e):(r=r||\"repetitions\"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var c,g;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const y=m.getEmptyPropArguments(this,r),v=y.repetition,b=this.getProp(\"repetitions\",y,1),x=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,M=Array.isArray(b)?b[0]*(null!==(c=b[1])&&void 0!==c?c:b[0]):b,w=Array.isArray(b)?b[0]:M,_=Array.isArray(b)?null!==(g=b[1])&&void 0!==g?g:b[0]:1,S=v.row;S.count=w;const A=v.col;A.count=_,v.count=M,v.col.count=_,v.row.count=w,v.type=x;let P=0;const E=[];let O=0;const I=n.vec2.fromValues((_-1)/2,(w-1)/2),R=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],C=[void 0,void 0,void 0,void 0],T=[void 0,void 0,void 0,void 0];for(let r=0;r1?O/(M-1):1,v.angle=x===i.ERepetitionType.Ring?a.PI2/M*O:0,A.index=c+1,A.offset=_>1?c/(_-1):1,S.index=r+1,S.offset=w>1?r/(w-1):1;const m=this.generateBuffer(t,y),g=m.length,b=this.getShapeBounding();E[O]=new Float32Array(g),P+=g;{const t=s.toVec2(this.getProp(\"distance\",y,s.VEC2_ZERO)),a=this.getProp(\"displace\",y,0),M=s.toVec3(this.getProp(\"scale\",y,s.VEC2_ONE),1),w=s.toVec3(this.getProp(\"translate\",y,s.VEC2_ZERO),0),_=this.getProp(\"skewX\",y,0),S=this.getProp(\"skewY\",y,0),A=this.getProp(\"squeezeX\",y,0),P=this.getProp(\"squeezeY\",y,0),L=this.getProp(\"rotateX\",y,0),k=this.getProp(\"rotateY\",y,0),B=this.getProp(\"rotateZ\",y,0),N=u.clamp(0,1,this.getProp(\"perspective\",y,0)),F=s.toVec3(this.getProp(\"perspectiveOrigin\",y,s.VEC2_ZERO),0),j=s.toVec3(this.getProp(\"transformOrigin\",y,s.VEC2_ZERO),0);let q;switch(x){case i.ERepetitionType.Ring:q=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(q,q,s.VEC3_ZERO,v.angle+a);break;case i.ERepetitionType.Matrix:q=n.vec3.fromValues(t[1]*(c-I[0]),t[0]*(r-I[1]),0)}const Y=N>0?Math.max(b.width,b.height)/2:1,D=N>0?Y+10*Y*(1-N):0,z=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==N||0!==j[0]||0!==j[1],V=0!==F[0]||0!==F[1];z&&(this.boundingType===i.EBoundingType.Relative?(j[0]=j[0]*(b.width/2)+b.cx,j[1]=j[1]*(b.height/2)+b.cy):(j[0]*=b.width/2,j[1]*=b.height/2),j[2]=D);{n.mat4.identity(f),z&&n.mat4.translate(f,f,j),0===w[0]&&0===w[1]||n.mat4.translate(f,f,w),0===_&&0===S||(s.fromSkew(l,[_,S]),n.mat4.multiply(f,f,l)),0!==L&&n.mat4.rotateX(f,f,L),0!==k&&n.mat4.rotateY(f,f,k),0!==B&&n.mat4.rotateZ(f,f,B),1===M[0]&&1===M[1]||n.mat4.scale(f,f,M),z&&n.mat4.translate(f,f,n.vec3.scale(j,j,-1)),D>0&&(V&&(this.boundingType===i.EBoundingType.Relative?(F[0]=F[0]*(b.width/2)+b.cx,F[1]=F[1]*(b.height/2)+b.cy):(F[0]*=b.width/2,F[1]*=b.height/2),F[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,q),e&&n.mat4.translate(p,p,R);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),x===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,v.angle+a)}h.Bounding.clear(T);for(let t=0;t0&&(V&&n.vec3.add(e,e,F),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,D),V&&n.vec3.sub(e,e,F)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=g/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,y)}E[O][t]=e[0],E[O][t+1]=e[1],h.Bounding.add(T,e[0],e[1]),h.Bounding.add(C,e[0],e[1])}}const L={cx:0,cy:0,x:-1,y:-1,width:2,height:2};h.Bounding.bind(L,T),this.bStaticIndexed&&this.bIndexed||this.addIndex(g,v,L)}h.Bounding.bind(this.bounding,C),this.buffer=new Float32Array(P);for(let t=0,e=0,r=E.length;t({index:1,offset:1,count:1}),m.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...m.getEmptySimpleRepetition(),row:m.getEmptySimpleRepetition(),col:m.getEmptySimpleRepetition()})},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(10);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return\"number\"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(29);var i;!function(t){t[t.None=0]=\"None\",t[t.Scale=2]=\"Scale\",t[t.Center=4]=\"Center\",t[t.Fill=8]=\"Fill\"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn(\"[Urplfanze:Bounding] cannot sum bounding\")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn(\"[Urplfanze:Bounding] cannot bind bounding\")}};class s extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return s.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=s.getBounding(t));const o=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,a=e>=i.Center?r.cx:0,h=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(31),i=r(4),s=r(26),o=\"undefined\"!=typeof performance?performance:Date;function a(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return o.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=a,e.relativeClamp=function(t,e,r,n,i){return a(n,i,(r-t)/(e-t)*(i-n)+n)};const h={random:new n(Math.random)};e.noise=function(t=\"random\",e=0,r=0,i=0){return void 0===h[t]&&(h[t]=new n(t)),h[t].noise3D(e,r,i)};const u={};function c(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),s=rn?[s,o]:[o,s]}function l(t,e){const r=t.length,n=r/2,i=2*(n+e),s=n-1;if(s>1){const n=r-2,o=Math.floor(e/s);let a=(i-(r+o*n))/2;const h=Math.round(s/a),u=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%h==0||e===n-2),p=o+(d?1:0),m=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);u[i]=(s=t(),o=t(),a=t(),h=t(),function(){let t=(s>>>=0)+(o>>>=0)|0;return s=o^o>>>9,o=(a>>>=0)+(a<<3)|0,t=t+(h=1+(h>>>=0)|0)|0,a=(a=a<<21|a>>>11)+t|0,(t>>>0)/4294967296})}var s,o,a,h;const c=e+u[i]()*(r-e);return void 0!==n?Math.round(c*10**n)/10**n:c},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return s.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=c,e.interpolate=function(t,e,r=.5){const[n,i]=c(t,e),s=Math.max(n.length,i.length),o=\"number\"==typeof r?[r]:r,a=s/2;if(o.length!==a){const t=o.length;for(let e=0;e{var n;!function(){\"use strict\";var i=.5*(Math.sqrt(3)-1),s=(3-Math.sqrt(3))/6,o=1/6,a=(Math.sqrt(5)-1)/4,h=(5-Math.sqrt(5))/20;function u(t){var e;e=\"function\"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=l();t=i(\" \"),e=i(\" \"),r=i(\" \");for(var s=0;s>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}u.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,o=this.permMod12,a=this.perm,h=this.grad3,u=0,c=0,l=0,f=(t+e)*i,d=Math.floor(t+f),p=Math.floor(e+f),m=(d+p)*s,g=t-(d-m),y=e-(p-m);g>y?(r=1,n=0):(r=0,n=1);var v=g-r+s,b=y-n+s,x=g-1+2*s,M=y-1+2*s,w=255&d,_=255&p,S=.5-g*g-y*y;if(S>=0){var A=3*o[w+a[_]];u=(S*=S)*S*(h[A]*g+h[A+1]*y)}var P=.5-v*v-b*b;if(P>=0){var E=3*o[w+r+a[_+n]];c=(P*=P)*P*(h[E]*v+h[E+1]*b)}var O=.5-x*x-M*M;if(O>=0){var I=3*o[w+1+a[_+1]];l=(O*=O)*O*(h[I]*x+h[I+1]*M)}return 70*(u+c+l)},noise3D:function(t,e,r){var n,i,s,a,h,u,c,l,f,d,p=this.permMod12,m=this.perm,g=this.grad3,y=.3333333333333333*(t+e+r),v=Math.floor(t+y),b=Math.floor(e+y),x=Math.floor(r+y),M=(v+b+x)*o,w=t-(v-M),_=e-(b-M),S=r-(x-M);w>=_?_>=S?(h=1,u=0,c=0,l=1,f=1,d=0):w>=S?(h=1,u=0,c=0,l=1,f=0,d=1):(h=0,u=0,c=1,l=1,f=0,d=1):_T?B++:N++,C>L?B++:F++,C>k?B++:j++,T>L?N++:F++,T>k?N++:j++,L>k?F++:j++;var q=C-(l=B>=3?1:0)+h,Y=T-(f=N>=3?1:0)+h,D=L-(d=F>=3?1:0)+h,z=k-(p=j>=3?1:0)+h,V=C-(m=B>=2?1:0)+2*h,$=T-(g=N>=2?1:0)+2*h,G=L-(y=F>=2?1:0)+2*h,X=k-(v=j>=2?1:0)+2*h,U=C-(b=B>=1?1:0)+3*h,H=T-(x=N>=1?1:0)+3*h,Z=L-(M=F>=1?1:0)+3*h,Q=k-(w=j>=1?1:0)+3*h,W=C-1+4*h,J=T-1+4*h,K=L-1+4*h,tt=k-1+4*h,et=255&P,rt=255&E,nt=255&O,it=255&I,st=.6-C*C-T*T-L*L-k*k;if(st<0)i=0;else{var ot=_[et+_[rt+_[nt+_[it]]]]%32*4;i=(st*=st)*st*(S[ot]*C+S[ot+1]*T+S[ot+2]*L+S[ot+3]*k)}var at=.6-q*q-Y*Y-D*D-z*z;if(at<0)s=0;else{var ht=_[et+l+_[rt+f+_[nt+d+_[it+p]]]]%32*4;s=(at*=at)*at*(S[ht]*q+S[ht+1]*Y+S[ht+2]*D+S[ht+3]*z)}var ut=.6-V*V-$*$-G*G-X*X;if(ut<0)o=0;else{var ct=_[et+m+_[rt+g+_[nt+y+_[it+v]]]]%32*4;o=(ut*=ut)*ut*(S[ct]*V+S[ct+1]*$+S[ct+2]*G+S[ct+3]*X)}var lt=.6-U*U-H*H-Z*Z-Q*Q;if(lt<0)u=0;else{var ft=_[et+b+_[rt+x+_[nt+M+_[it+w]]]]%32*4;u=(lt*=lt)*lt*(S[ft]*U+S[ft+1]*H+S[ft+2]*Z+S[ft+3]*Q)}var dt=.6-W*W-J*J-K*K-tt*tt;if(dt<0)c=0;else{var pt=_[et+1+_[rt+1+_[nt+1+_[it+1]]]]%32*4;c=(dt*=dt)*dt*(S[pt]*W+S[pt+1]*J+S[pt+2]*K+S[pt+3]*tt)}return 27*(i+s+o+u+c)}},u._buildPermutationTable=c,void 0===(n=function(){return u}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=u,t.exports=u}()},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Shape=void 0;const n=r(21),i=r(22),s=r(24);class o extends s.ShapeBase{constructor(t){t.type=t.type||\"Shape\",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn(\"[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\\nYou passed:\",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):o.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapePrimitive=void 0;const n=r(25),i=r(24),s=r(29),o=r(28);class a extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=o.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:\"function\"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return\"function\"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:\"number\"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp(\"sideLength\",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeLoop=void 0;const n=r(27),i=r(28),s=r(33),o=r(24);class a extends s.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||\"ShapeLoop\",super(t),this.loopDependencies=(t.loopDependencies||[]).concat(\"sideLength\"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes(\"propArguments\"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}\"loop\"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||o.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?(\"function\"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),s=this.getRepetitionSideLength(t),o=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,a={index:0,offset:0,current:0,count:n},h=a.count,u=new Float32Array(2*h);for(let n=0,i=0;n1?n/(a.count-1):1;a.current=s,a.index=n+1,a.offset=h;const c=o(a,t);u[i]=c[0],u[i+1]=c[1]}const c=[void 0,void 0,void 0,void 0],l=this.applyModifiers(u,t);for(let t=0,e=l.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeBuffer=void 0;const n=r(28),i=r(33);class s extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||\"ShapeBuffer\",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn(\"[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property\"),this.shape=s.EMPTY_BUFFER):this.shape=\"function\"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return\"function\"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return\"function\"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from(\"function\"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,s=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&\"function\"!=typeof this.props.sideLength&&\"function\"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeRecursive=void 0;const n=r(32);class i extends n.Shape{constructor(t){t.type=t.type||\"ShapeRecursive\",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return\"function\"!=typeof this.props.recursions&&\"function\"!=typeof this.props.recursionScale&&\"function\"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return\"function\"!=typeof this.props.recursions&&\"function\"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp(\"recursions\",e,1)),n=Math.floor(this.getProp(\"recursionVertex\",e,0)),s=this.getProp(\"recursionScale\",e,2),o=this.shape;let a={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const h={...e,recursion:a};o.generate(t,!1,h);const u=o.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=u);let c=u;const l=[a];let f=0,d=1;const p=c.length,m=p/2,g=n<=0?m:Math.min(n,m),y=0===n?1:m/Math.min(n,m),v=new Float32Array(i.summmation(r,g)*p);for(let t=0;t1?e/(r-1):1,u=i.summmation(e,g)*p,m=e-1,b=0===m?0:i.summmation(m,g)*p;for(let i=0,m=g**e;i1?i/(m-1):1,count:m,level:{index:e+1,offset:n,count:r},parent:l[f]},l.push(a),this.shapeUseRecursion&&(h.recursion=a,o.generate(t,!1,h),c=o.getBuffer());const x=u+i*p,M=Math.floor(b+2*i*y),w=v[M],_=v[M+1],S=s**e;for(let t=0,e=p;t1?0:1,count:s}}},h=this.shape.getIndexedBuffer()||[];for(let t=0,e=h.length;t1?0:1,count:s}},i={...a,recursion:r},o=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:o})}if(s>1){const t=this.shape.getBufferLength({...i,parent:{...a}})/2,e=o<=0?t:Math.min(o,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let u=0,c=1;for(let t=1;t1?t/(s-1):1;for(let o=0,l=e**t;o1?o/(l-1):1;for(let d=0,p=h.length;d{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeFollow=void 0;const n=r(32);class i extends n.Shape{constructor(t){t.type=t.type||\"ShapeFollow\",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},s=this.shape;s.generate(t,!1,i);let o=s.getBuffer();const a=o.length,h=new Float32Array(a*(n.length/2)),u=n.length/2;for(let e=0;e1?e/(u-1):1,count:u};this.shapeUseFollow&&(i.follow=r,s.generate(t,!1,i),o=s.getBuffer());const c=e*a,l=2*e,f=n[l],d=n[l+1];for(let t=0,e=o.length;t1?t/(e-1):1;for(let o=0,a=s.length;o{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Line=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type=\"Line\",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Triangle=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type=\"Triangle\",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=s,s.buffer=[1,0,-1,1,-1,-1]},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Rect=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type=\"Rect\",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=s,s.buffer=[1,1,-1,1,-1,-1,1,-1]},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Polygon=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||\"Polygon\",t.loopDependencies=(t.loopDependencies||[]).concat([\"sideNumber\"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp(\"sideNumber\",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Circle=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=\"Circle\",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Star=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||\"Polygon\",t.loopDependencies=(t.loopDependencies||[]).concat([\"spikes\",\"innerRadius\"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp(\"spikes\",t,5),this.innerRadius=this.getProp(\"innerRadius\",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Rose=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r;t.type=\"Rose\",t.loopDependencies=(t.loopDependencies||[]).concat([\"n\",\"d\"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>s.getFinalAngleFromK(this.getProp(\"n\",t),this.getProp(\"d\",t)),inc:t=>{const e=this.getProp(\"n\",t),r=this.getProp(\"d\",t),i=this.getRepetitionSideLength(t),s=Math.pow(i[0]*i[1],.45),o=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp(\"n\",t)/this.getProp(\"d\",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Spiral=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type=\"Spiral\",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat([\"twists\",\"twistsStart\",\"spiral\"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:s.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp(\"twistsStart\",t),end:t=>n.PI2*(this.getProp(\"twistsStart\",t)+this.getProp(\"twists\",t)),inc:t=>{const e=this.getProp(\"twists\",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp(\"spiral\",t),this.r=s.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case s.types.ARCHIMEDE:return t=>t/10;case s.types.HYPERBOLIC:return t=>1/t*3;case s.types.FERMAT:return t=>t**.5/3;case s.types.LITUUS:return t=>t**-.5;case s.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=s,s.types={ARCHIMEDE:\"ARCHIMEDE\",HYPERBOLIC:\"HYPERBOLIC\",FERMAT:\"FERMAT\",LITUUS:\"LITUUS\",LOGARITHMIC:\"LOGARITHMIC\"}},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Lissajous=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=\"Lissajous\",t.loopDependencies=(t.loopDependencies||[]).concat([\"wx\",\"wy\",\"wz\"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp(\"wx\",t),r=this.getProp(\"wy\",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),s=this.getRepetitionSideLength(t);return 1/Math.pow(s[0]*s[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp(\"wx\",t,1),this.wy=this.getProp(\"wy\",t,2),this.wz=this.getProp(\"wz\",t,2),super.generateLoopBuffer(t)}}e.Lissajous=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.SuperShape=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r,i,s,o,a;t.type=\"SuperShape\",t.loopDependencies=(t.loopDependencies||[]).concat([\"a\",\"b\",\"m\",\"n1\",\"n2\",\"n3\"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(s=t.n1)&&void 0!==s?s:1,this.props.n2=null!==(o=t.n2)&&void 0!==o?o:1,this.props.n3=null!==(a=t.n3)&&void 0!==a?a:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp(\"a\",t),this.b=this.getProp(\"b\",t),this.m=this.getProp(\"m\",t),this.n1=this.getProp(\"n1\",t),this.n2=this.getProp(\"n2\",t),this.n3=this.getProp(\"n3\",t),super.generateLoopBuffer(t)}}e.SuperShape=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Modifiers=void 0;const n=r(28),i=r(49),s=r(50),o=r(52),a=r(53),h=r(51),u=r(54),c={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:s.Smooth,Solidify:o.Solidify,Subdivide:a.Subdivide,Close:h.Close,Offset:u.Offset};e.Modifiers=c},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Mirror=void 0;const n=r(29);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let s=0;s{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Smooth=void 0;const n=r(30),i=r(51),s=r(29);class o extends s.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Close=void 0;const n=r(29);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Solidify=void 0;const n=r(29);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const s=[],o=(e=\"number\"==typeof e?[e]:e).length;let a,h,u=[[0,0],[0,0]],c=[[0,0],[0,0]];for(let r=0,l=0,f=t.length-2;r{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Subdivide=void 0;const n=r(29);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Offset=void 0;const n=r(29);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i}],e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r(0)})()},t.exports=e()},479:(t,e,r)=>{var n;!function(){\"use strict\";function i(t,e,r){var n=e.x,i=e.y,s=r.x-n,o=r.y-i;if(0!==s||0!==o){var a=((t.x-n)*s+(t.y-i)*o)/(s*s+o*o);a>1?(n=r.x,i=r.y):a>0&&(n+=s*a,i+=o*a)}return(s=t.x-n)*s+(o=t.y-i)*o}function s(t,e,r,n,o){for(var a,h=n,u=e+1;uh&&(a=u,h=c)}h>n&&(a-e>1&&s(t,e,a,n,o),o.push(t[a]),r-a>1&&s(t,a,r,n,o))}function o(t,e){var r=t.length-1,n=[t[0]];return s(t,0,r,e,n),n.push(t[r]),n}function a(t,e,r){if(t.length<=2)return t;var n=void 0!==e?e*e:1;return o(t=r?t:function(t,e){for(var r,n,i,s,o,a=t[0],h=[a],u=1,c=t.length;ue&&(h.push(r),a=r);return a!==r&&h.push(r),h}(t,n),n)}void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()},721:(t,e,r)=>{\"use strict\";t.exports=r(192)},921:t=>{\"use strict\";var e=2*Math.PI;function r(t,e,r,n){var i=t*r+e*n;return i>1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)}function n(t,e){var r=4/3*Math.tan(e/4),n=Math.cos(t),i=Math.sin(t),s=Math.cos(t+e),o=Math.sin(t+e);return[n,i,n-i*r,i+n*r,s+o*r,o-s*r,s,o]}t.exports=function(t,i,s,o,a,h,u,c,l){var f=Math.sin(l*e/360),d=Math.cos(l*e/360),p=d*(t-s)/2+f*(i-o)/2,m=-f*(t-s)/2+d*(i-o)/2;if(0===p&&0===m)return[];if(0===u||0===c)return[];u=Math.abs(u),c=Math.abs(c);var g=p*p/(u*u)+m*m/(c*c);g>1&&(u*=Math.sqrt(g),c*=Math.sqrt(g));var y=function(t,n,i,s,o,a,h,u,c,l){var f=l*(t-i)/2+c*(n-s)/2,d=-c*(t-i)/2+l*(n-s)/2,p=h*h,m=u*u,g=f*f,y=d*d,v=p*m-p*y-m*g;v<0&&(v=0),v/=p*y+m*g;var b=(v=Math.sqrt(v)*(o===a?-1:1))*h/u*d,x=v*-u/h*f,M=l*b-c*x+(t+i)/2,w=c*b+l*x+(n+s)/2,_=(f-b)/h,S=(d-x)/u,A=(-f-b)/h,P=(-d-x)/u,E=r(1,0,_,S),O=r(_,S,A,P);return 0===a&&O>0&&(O-=e),1===a&&O<0&&(O+=e),[M,w,E,O]}(t,i,s,o,a,h,u,c,f,d),v=[],b=y[2],x=y[3],M=Math.max(Math.ceil(Math.abs(x)/(e/4)),1);x/=M;for(var w=0;w{\"use strict\";var e=1e-10,r=Math.PI/180;function n(t,e,r){if(!(this instanceof n))return new n(t,e,r);this.rx=t,this.ry=e,this.ax=r}n.prototype.transform=function(t){var n=Math.cos(this.ax*r),i=Math.sin(this.ax*r),s=[this.rx*(t[0]*n+t[2]*i),this.rx*(t[1]*n+t[3]*i),this.ry*(-t[0]*i+t[2]*n),this.ry*(-t[1]*i+t[3]*n)],o=s[0]*s[0]+s[2]*s[2],a=s[1]*s[1]+s[3]*s[3],h=((s[0]-s[3])*(s[0]-s[3])+(s[2]+s[1])*(s[2]+s[1]))*((s[0]+s[3])*(s[0]+s[3])+(s[2]-s[1])*(s[2]-s[1])),u=(o+a)/2;if(hMath.abs(l-a)?(l-o)/c:c/(l-a))/Math.PI,this.ax>=0?(this.rx=Math.sqrt(l),this.ry=Math.sqrt(f)):(this.ax+=90,this.rx=Math.sqrt(f),this.ry=Math.sqrt(l)),this},n.prototype.isDegenerate=function(){return this.rx{\"use strict\";function e(){if(!(this instanceof e))return new e;this.queue=[],this.cache=null}e.prototype.matrix=function(t){return 1===t[0]&&0===t[1]&&0===t[2]&&1===t[3]&&0===t[4]&&0===t[5]||(this.cache=null,this.queue.push(t)),this},e.prototype.translate=function(t,e){return 0===t&&0===e||(this.cache=null,this.queue.push([1,0,0,1,t,e])),this},e.prototype.scale=function(t,e){return 1===t&&1===e||(this.cache=null,this.queue.push([t,0,0,e,0,0])),this},e.prototype.rotate=function(t,e,r){var n,i,s;return 0!==t&&(this.translate(e,r),n=t*Math.PI/180,i=Math.cos(n),s=Math.sin(n),this.queue.push([i,s,-s,i,0,0]),this.cache=null,this.translate(-e,-r)),this},e.prototype.skewX=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},e.prototype.skewY=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},e.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],1===this.queue.length)return this.cache;for(var t=1;t{\"use strict\";var e={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},r=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function n(t){return t>=48&&t<=57}function i(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err=\"\",this.segmentStart=0,this.data=[]}function s(t){for(;t.index=5760&&r.indexOf(e)>=0);)t.index++;var e}function o(t){var e=t.path.charCodeAt(t.index);return 48===e?(t.param=0,void t.index++):49===e?(t.param=1,void t.index++):void(t.err=\"SvgPath: arc flag can be 0 or 1 only (at pos \"+t.index+\")\")}function a(t){var e,r=t.index,i=r,s=t.max,o=!1,a=!1,h=!1,u=!1;if(i>=s)t.err=\"SvgPath: missed param (at pos \"+i+\")\";else if(43!==(e=t.path.charCodeAt(i))&&45!==e||(e=++i2&&(t.result.push([r,i[0],i[1]]),i=i.slice(2),n=\"l\",r=\"m\"===r?\"l\":\"L\"),\"r\"===n)t.result.push([r].concat(i));else for(;i.length>=e[n]&&(t.result.push([r].concat(i.splice(0,e[n]))),e[n]););}function u(t){var r,n,i,u,c,l,f=t.max;if(t.segmentStart=t.index,n=97==(32|(r=t.path.charCodeAt(t.index))),function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}(r))if(u=e[t.path[t.index].toLowerCase()],t.index++,s(t),t.data=[],u){for(i=!1;;){for(c=u;c>0;c--){if(!n||3!==c&&4!==c?a(t):o(t),t.err.length)return;t.data.push(t.param),s(t),i=!1,t.index=t.max)break;if(!((l=t.path.charCodeAt(t.index))>=48&&l<=57||43===l||45===l||46===l))break}}h(t)}else h(t);else t.err=\"SvgPath: bad command \"+t.path[t.index]+\" (at pos \"+t.index+\")\"}t.exports=function(t){var e=new i(t),r=e.max;for(s(e);e.index{\"use strict\";var n=r(665),i=r(94),s=r(480),o=r(921),a=r(954);function h(t){if(!(this instanceof h))return new h(t);var e=n(t);this.segments=e.segments,this.err=e.err,this.__stack=[]}h.from=function(t){if(\"string\"==typeof t)return new h(t);if(t instanceof h){var e=new h(\"\");return e.err=t.err,e.segments=t.segments.map((function(t){return t.slice()})),e.__stack=t.__stack.map((function(t){return s().matrix(t.toArray())})),e}throw new Error(\"SvgPath.from: invalid param type \"+t)},h.prototype.__matrix=function(t){var e,r=this;t.queue.length&&this.iterate((function(n,i,s,o){var h,u,c,l;switch(n[0]){case\"v\":u=0===(h=t.calc(0,n[1],!0))[0]?[\"v\",h[1]]:[\"l\",h[0],h[1]];break;case\"V\":u=(h=t.calc(s,n[1],!1))[0]===t.calc(s,o,!1)[0]?[\"V\",h[1]]:[\"L\",h[0],h[1]];break;case\"h\":u=0===(h=t.calc(n[1],0,!0))[1]?[\"h\",h[0]]:[\"l\",h[0],h[1]];break;case\"H\":u=(h=t.calc(n[1],o,!1))[1]===t.calc(s,o,!1)[1]?[\"H\",h[0]]:[\"L\",h[0],h[1]];break;case\"a\":case\"A\":var f=t.toArray(),d=a(n[1],n[2],n[3]).transform(f);if(f[0]*f[3]-f[1]*f[2]<0&&(n[5]=n[5]?\"0\":\"1\"),h=t.calc(n[6],n[7],\"a\"===n[0]),\"A\"===n[0]&&n[6]===s&&n[7]===o||\"a\"===n[0]&&0===n[6]&&0===n[7]){u=[\"a\"===n[0]?\"l\":\"L\",h[0],h[1]];break}u=d.isDegenerate()?[\"a\"===n[0]?\"l\":\"L\",h[0],h[1]]:[n[0],d.rx,d.ry,d.ax,n[4],n[5],h[0],h[1]];break;case\"m\":l=i>0,u=[\"m\",(h=t.calc(n[1],n[2],l))[0],h[1]];break;default:for(u=[c=n[0]],l=c.toLowerCase()===c,e=1;e=0;)t.matrix(this.__stack[e].toArray());this.__matrix(t),this.__stack=[]}},h.prototype.toString=function(){var t,e,r=[];this.__evaluateStack();for(var n=0;n0&&\"m\"!==e&&\"M\"!==e&&e===this.segments[n-1][0],r=r.concat(t?this.segments[n].slice(1):this.segments[n]);return r.join(\" \").replace(/ ?([achlmqrstvz]) ?/gi,\"$1\").replace(/ \\-/g,\"-\").replace(/zm/g,\"z m\")},h.prototype.translate=function(t,e){return this.__stack.push(s().translate(t,e||0)),this},h.prototype.scale=function(t,e){return this.__stack.push(s().scale(t,e||0===e?e:t)),this},h.prototype.rotate=function(t,e,r){return this.__stack.push(s().rotate(t,e||0,r||0)),this},h.prototype.skewX=function(t){return this.__stack.push(s().skewX(t)),this},h.prototype.skewY=function(t){return this.__stack.push(s().skewY(t)),this},h.prototype.matrix=function(t){return this.__stack.push(s().matrix(t)),this},h.prototype.transform=function(t){return t.trim()?(this.__stack.push(i(t)),this):this},h.prototype.round=function(t){var e,r=0,n=0,i=0,s=0;return t=t||0,this.__evaluateStack(),this.segments.forEach((function(o){var a=o[0].toLowerCase()===o[0];switch(o[0]){case\"H\":case\"h\":return a&&(o[1]+=i),i=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case\"V\":case\"v\":return a&&(o[1]+=s),s=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case\"Z\":case\"z\":return i=r,void(s=n);case\"M\":case\"m\":return a&&(o[1]+=i,o[2]+=s),i=o[1]-o[1].toFixed(t),s=o[2]-o[2].toFixed(t),r=i,n=s,o[1]=+o[1].toFixed(t),void(o[2]=+o[2].toFixed(t));case\"A\":case\"a\":return a&&(o[6]+=i,o[7]+=s),i=o[6]-o[6].toFixed(t),s=o[7]-o[7].toFixed(t),o[1]=+o[1].toFixed(t),o[2]=+o[2].toFixed(t),o[3]=+o[3].toFixed(t+2),o[6]=+o[6].toFixed(t),void(o[7]=+o[7].toFixed(t));default:return e=o.length,a&&(o[e-2]+=i,o[e-1]+=s),i=o[e-2]-o[e-2].toFixed(t),s=o[e-1]-o[e-1].toFixed(t),void o.forEach((function(e,r){r&&(o[r]=+o[r].toFixed(t))}))}})),this},h.prototype.iterate=function(t,e){var r,n,i,s=this.segments,o={},a=!1,h=0,u=0,c=0,l=0;if(e||this.__evaluateStack(),s.forEach((function(e,r){var n=t(e,r,h,u);Array.isArray(n)&&(o[r]=n,a=!0);var i=e[0]===e[0].toLowerCase();switch(e[0]){case\"m\":case\"M\":return h=e[1]+(i?h:0),u=e[2]+(i?u:0),c=h,void(l=u);case\"h\":case\"H\":return void(h=e[1]+(i?h:0));case\"v\":case\"V\":return void(u=e[1]+(i?u:0));case\"z\":case\"Z\":return h=c,void(u=l);default:h=e[e.length-2]+(i?h:0),u=e[e.length-1]+(i?u:0)}})),!a)return this;for(i=[],r=0;r{\"use strict\";var n=r(480),i={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},s=/\\s*(matrix|translate|scale|rotate|skewX|skewY)\\s*\\(\\s*(.+?)\\s*\\)[\\s,]*/,o=/[\\s,]+/;t.exports=function(t){var e,r,a=new n;return t.split(s).forEach((function(t){if(t.length)if(void 0===i[t])switch(r=t.split(o).map((function(t){return+t||0})),e){case\"matrix\":return void(6===r.length&&a.matrix(r));case\"scale\":return void(1===r.length?a.scale(r[0],r[0]):2===r.length&&a.scale(r[0],r[1]));case\"rotate\":return void(1===r.length?a.rotate(r[0],0,0):3===r.length&&a.rotate(r[0],r[1],r[2]));case\"translate\":return void(1===r.length?a.translate(r[0],0):2===r.length&&a.translate(r[0],r[1]));case\"skewX\":return void(1===r.length&&a.skewX(r[0]));case\"skewY\":return void(1===r.length&&a.skewY(r[0]))}else e=t})),a}},197:(t,e,r)=>{\"use strict\";function n(t,e){return Array.isArray(e)?[t.a*e[0]+t.c*e[1]+t.e,t.b*e[0]+t.d*e[1]+t.f]:{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function i(t,e){return e.map((e=>n(t,e)))}function s(t){return{a:parseFloat(t.a),b:parseFloat(t.b),c:parseFloat(t.c),d:parseFloat(t.d),e:parseFloat(t.e),f:parseFloat(t.f)}}r.r(e),r.d(e,{applyToPoint:()=>n,applyToPoints:()=>i,compose:()=>m,fromDefinition:()=>C,fromObject:()=>s,fromString:()=>a,fromTransformAttribute:()=>k,fromTriangles:()=>R,identity:()=>h,inverse:()=>u,isAffineMatrix:()=>f,rotate:()=>b,rotateDEG:()=>x,scale:()=>M,shear:()=>w,skew:()=>S,skewDEG:()=>A,smoothMatrix:()=>I,toCSS:()=>P,toSVG:()=>E,toString:()=>O,transform:()=>p,translate:()=>d});const o=/^matrix\\(\\s*([0-9_+-.e]+)\\s*,\\s*([0-9_+-.e]+)\\s*,\\s*([0-9_+-.e]+)\\s*,\\s*([0-9_+-.e]+)\\s*,\\s*([0-9_+-.e]+)\\s*,\\s*([0-9_+-.e]+)\\s*\\)$/i;function a(t){const e=t.match(o);if(null===e||e.length<7)throw new Error(`'${t}' is not a matrix`);return{a:parseFloat(e[1]),b:parseFloat(e[2]),c:parseFloat(e[3]),d:parseFloat(e[4]),e:parseFloat(e[5]),f:parseFloat(e[6])}}function h(){return{a:1,c:0,e:0,b:0,d:1,f:0}}function u(t){const{a:e,b:r,c:n,d:i,e:s,f:o}=t,a=e*i-r*n;return{a:i/a,b:r/-a,c:n/-a,d:e/a,e:(i*s-n*o)/-a,f:(r*s-e*o)/a}}function c(t){return void 0===t}function l(t){return\"number\"==typeof t&&!Number.isNaN(t)&&Number.isFinite(t)}function f(t){return\"object\"==typeof(e=t)&&null!==e&&!Array.isArray(e)&&\"a\"in t&&l(t.a)&&\"b\"in t&&l(t.b)&&\"c\"in t&&l(t.c)&&\"d\"in t&&l(t.d)&&\"e\"in t&&l(t.e)&&\"f\"in t&&l(t.f);var e}function d(t,e=0){return{a:1,c:0,e:t,b:0,d:1,f:e}}function p(...t){const e=(t,e)=>({a:t.a*e.a+t.c*e.b,c:t.a*e.c+t.c*e.d,e:t.a*e.e+t.c*e.f+t.e,b:t.b*e.a+t.d*e.b,d:t.b*e.c+t.d*e.d,f:t.b*e.e+t.d*e.f+t.f});switch((t=Array.isArray(t[0])?t[0]:t).length){case 0:throw new Error(\"no matrices provided\");case 1:return t[0];case 2:return e(t[0],t[1]);default:{const[r,n,...i]=t;return p(e(r,n),...i)}}}function m(...t){return p(...t)}const{cos:g,sin:y,PI:v}=Math;function b(t,e,r){const n=g(t),i=y(t),s={a:n,c:-i,e:0,b:i,d:n,f:0};return c(e)||c(r)?s:p([d(e,r),s,d(-e,-r)])}function x(t,e,r){return b(t*v/180,e,r)}function M(t,e,r,n){c(e)&&(e=t);const i={a:t,c:0,e:0,b:0,d:e,f:0};return c(r)||c(n)?i:p([d(r,n),i,d(-r,-n)])}function w(t,e){return{a:1,c:t,e:0,b:e,d:1,f:0}}const{tan:_}=Math;function S(t,e){return{a:1,c:_(t),e:0,b:_(e),d:1,f:0}}function A(t,e){return S(t*Math.PI/180,e*Math.PI/180)}function P(t){return O(t)}function E(t){return O(t)}function O(t){return`matrix(${t.a},${t.b},${t.c},${t.d},${t.e},${t.f})`}function I(t,e=1e10){return{a:Math.round(t.a*e)/e,b:Math.round(t.b*e)/e,c:Math.round(t.c*e)/e,d:Math.round(t.d*e)/e,e:Math.round(t.e*e)/e,f:Math.round(t.f*e)/e}}function R(t,e){const r=null!=t[0].x?t[0].x:t[0][0],n=null!=t[0].y?t[0].y:t[0][1],i=null!=e[0].x?e[0].x:e[0][0],s=null!=e[0].y?e[0].y:e[0][1],o=null!=t[1].x?t[1].x:t[1][0],a=null!=t[1].y?t[1].y:t[1][1],h=null!=e[1].x?e[1].x:e[1][0],c=null!=e[1].y?e[1].y:e[1][1],l=null!=t[2].x?t[2].x:t[2][0],f=null!=t[2].y?t[2].y:t[2][1],d=null!=e[2].x?e[2].x:e[2][0],m=null!=e[2].y?e[2].y:e[2][1];return I(p([{a:i-d,b:s-m,c:h-d,d:c-m,e:d,f:m},u({a:r-l,b:n-f,c:o-l,d:a-f,e:l,f})]))}function C(t){return Array.isArray(t)?t.map(e):e(t);function e(t){switch(t.type){case\"matrix\":if(\"a\"in t&&\"b\"in t&&\"c\"in t&&\"d\"in t&&\"e\"in t&&\"f\"in t)return s(t);throw new Error(\"MISSING_MANDATORY_PARAM\");case\"translate\":if(!(\"tx\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return\"ty\"in t?d(t.tx,t.ty):d(t.tx);case\"scale\":if(!(\"sx\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return\"sy\"in t?M(t.sx,t.sy):M(t.sx);case\"rotate\":if(!(\"angle\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return\"cx\"in t&&\"cy\"in t?x(t.angle,t.cx,t.cy):x(t.angle);case\"skewX\":if(!(\"angle\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return A(t.angle,0);case\"skewY\":if(!(\"angle\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return A(0,t.angle);case\"shear\":if(!(\"shx\"in t)||!(\"shy\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return w(t.shx,t.shy);default:throw new Error(\"UNSUPPORTED_DESCRIPTOR\")}}}function T(t,e,r,n){this.message=t,this.expected=e,this.found=r,this.location=n,this.name=\"SyntaxError\",\"function\"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,T)}function L(t,e){e=void 0!==e?e:{};var r,n={},i={transformList:G},s=G,o=\"matrix\",a=\"(\",h=\")\",u=\"translate\",c=\"scale\",l=\"rotate\",f=\"skewX\",d=\"skewY\",p=/^[eE]/,m=/^[+\\-]/,g=/^[0-9]/,y=/^[ \\t\\r\\n]/,v=F(\"matrix\",!1),b=F(\"(\",!1),x=F(\")\",!1),M=F(\"translate\",!1),w=F(\"scale\",!1),_=F(\"rotate\",!1),S=F(\"skewX\",!1),A=F(\"skewY\",!1),P=F(\",\",!1),E={type:\"other\",description:\"fractionalConstant\"},O=j([\"e\",\"E\"],!1,!1),I=j([\"+\",\"-\"],!1,!1),R=j([[\"0\",\"9\"]],!1,!1),C=j([\" \",\"\\t\",\"\\r\",\"\\n\"],!1,!1),L=0,k=[{line:1,column:1}],B=[],N=0;if(\"startRule\"in e){if(!(e.startRule in i))throw new Error(\"Can't start parsing from rule \\\"\"+e.startRule+'\".');s=i[e.startRule]}function F(t,e){return{type:\"literal\",text:t,ignoreCase:e}}function j(t,e,r){return{type:\"class\",parts:t,inverted:e,ignoreCase:r}}function q(e){var r,n=k[e];if(n)return n;for(r=e-1;!k[r];)r--;for(n={line:(n=k[r]).line,column:n.column};r0;function V(t,r){var n={};z&&(n.filename=e.filename);var i=q(t);n.start={offset:t,line:i.line,column:i.column};var s=q(r);return n.end={offset:r,line:s.line,column:s.column},n}function $(t){var e=B[B.length-1];Le.pos&&(e.pos=L,e.variants=[]),e.variants.push(t))}function G(){var t,e,r,i;for(L,t=[],e=rt();e!==n;)t.push(e),e=rt();for((e=X())===n&&(e=null),r=[],i=rt();i!==n;)r.push(i),i=rt();return e}function X(){var t,e,r,i,s;if(t=L,(e=U())!==n){if(r=[],(i=Q())!==n)for(;i!==n;)r.push(i),i=Q();else r=n;r!==n&&(i=X())!==n?(s=i,t=e.concat(s)):(L=t,t=n)}else L=t,t=n;return t===n&&(t=U()),t}function U(){var e;return(e=function(){var e,r,i,s,u,c,l,f,d,p,m,g,y,M=function(t){0===N&&$(t)};if(e=L,M(v),t.substr(L,6)===o?(r=o,L+=6):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(M(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(u=[],c=rt();c!==n;)u.push(c),c=rt();if((c=H())!==n)if(Q()!==n)if((l=H())!==n)if(Q()!==n)if((f=H())!==n)if(Q()!==n)if((d=H())!==n)if(Q()!==n)if((p=H())!==n)if(Q()!==n)if((m=H())!==n){for(g=[],y=rt();y!==n;)g.push(y),y=rt();M(x),41===t.charCodeAt(L)?(y=h,L++):y=n,y!==n?e=[{type:\"matrix\",a:c,b:l,c:f,d,e:p,f:m}]:(L=e,e=n)}else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,c,l,f,d,p,m,g=function(t){0===N&&$(t)};if(e=L,g(M),t.substr(L,9)===u?(r=u,L+=9):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(o=[],c=rt();c!==n;)o.push(c),c=rt();if((c=H())!==n){for((l=Z())===n&&(l=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(x),41===t.charCodeAt(L)?(d=h,L++):d=n,d!==n?(m={type:\"translate\",tx:c},(p=l)&&(m.ty=p),e=[m]):(L=e,e=n)}else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,l,f,d,p,m,g=function(t){0===N&&$(t)};if(e=L,g(w),t.substr(L,5)===c?(r=c,L+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=H())!==n){for((l=Z())===n&&(l=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(x),41===t.charCodeAt(L)?(d=h,L++):d=n,d!==n?(m={type:\"scale\",sx:u},(p=l)&&(m.sy=p),e=[m]):(L=e,e=n)}else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,c,f,d,p,m,g=function(t){0===N&&$(t)};if(e=L,g(_),t.substr(L,6)===l?(r=l,L+=6):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=H())!==n){for((c=function(){var t,e,r;return t=L,Q()!==n&&(e=H())!==n&&Q()!==n&&(r=H())!==n?t=[e,r]:(L=t,t=n),t}())===n&&(c=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(x),41===t.charCodeAt(L)?(d=h,L++):d=n,d!==n?(m={type:\"rotate\",angle:u},(p=c)&&(m.cx=p[0],m.cy=p[1]),e=[m]):(L=e,e=n)}else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,c,l,d=function(t){0===N&&$(t)};if(e=L,d(S),t.substr(L,5)===f?(r=f,L+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(d(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=H())!==n){for(c=[],l=rt();l!==n;)c.push(l),l=rt();d(x),41===t.charCodeAt(L)?(l=h,L++):l=n,l!==n?e=[{type:\"skewX\",angle:u}]:(L=e,e=n)}else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,c,l,f=function(t){0===N&&$(t)};if(e=L,f(A),t.substr(L,5)===d?(r=d,L+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(f(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=H())!==n){for(c=[],l=rt();l!==n;)c.push(l),l=rt();f(x),41===t.charCodeAt(L)?(l=h,L++):l=n,l!==n?e=[{type:\"skewY\",angle:u}]:(L=e,e=n)}else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}()),e}function H(){var e,r,i,s;return e=L,r=L,(i=K())===n&&(i=null),(s=function(){var e,r,i;return e=L,(r=function(){var e,r,i,s,o,a,h;return o=E,0===N&&$(o),N++,e=L,(r=tt())===n&&(r=null),46===t.charCodeAt(L)?(i=\".\",L++):i=n,i!==n&&(s=tt())!==n?(h=s,e=[(a=r)?a.join(\"\"):null,\".\",h.join(\"\")].join(\"\")):(L=e,e=n),e===n&&(e=L,(r=tt())!==n?(46===t.charCodeAt(L)?(i=\".\",L++):i=n,i!==n?e=r.join(\"\"):(L=e,e=n)):(L=e,e=n)),N--,e}())!==n?((i=J())===n&&(i=null),e=[r,i||null].join(\"\")):(L=e,e=n),e===n&&(e=L,(r=tt())!==n&&(i=J())!==n?e=[r,i].join(\"\"):(L=e,e=n)),e}())!==n?r=i=[i,s]:(L=r,r=n),r!==n&&(r=parseFloat(r.join(\"\"))),(e=r)===n&&(e=L,r=L,(i=K())===n&&(i=null),(s=function(){var t;return L,(t=tt())!==n&&(t=t.join(\"\")),t}())!==n?r=i=[i,s]:(L=r,r=n),r!==n&&(r=parseInt(r.join(\"\"))),e=r),e}function Z(){var t,e;return t=L,Q()!==n&&(e=H())!==n?t=e:(L=t,t=n),t}function Q(){var t,e,r,i,s;if(t=L,e=[],(r=rt())!==n)for(;r!==n;)e.push(r),r=rt();else e=n;if(e!==n){for((r=W())===n&&(r=null),i=[],s=rt();s!==n;)i.push(s),s=rt();t=e=[e,r,i]}else L=t,t=n;if(t===n)if(t=L,(e=W())!==n){for(r=[],i=rt();i!==n;)r.push(i),i=rt();t=e=[e,r]}else L=t,t=n;return t}function W(){var e,r;return r=P,0===N&&$(r),44===t.charCodeAt(L)?(e=\",\",L++):e=n,e}function J(){var e,r,i,s,o;return e=L,o=O,0===N&&$(o),p.test(t.charAt(L))?(r=t.charAt(L),L++):r=n,r!==n?((i=K())===n&&(i=null),(s=tt())!==n?e=[\"e\",i,s.join(\"\")].join(\"\"):(L=e,e=n)):(L=e,e=n),e}function K(){var e,r;return r=I,0===N&&$(r),m.test(t.charAt(L))?(e=t.charAt(L),L++):e=n,e}function tt(){var t,e;if(t=[],(e=et())!==n)for(;e!==n;)t.push(e),e=et();else t=n;return t}function et(){var e,r;return r=R,0===N&&$(r),g.test(t.charAt(L))?(e=t.charAt(L),L++):e=n,e}function rt(){var e,r;return r=C,0===N&&$(r),y.test(t.charAt(L))?(e=t.charAt(L),L++):e=n,e}if(B.push({pos:L,variants:[]}),(r=s())!==n&&L===t.length)return r;throw r!==n&&L0){for(e=1,r=1;e{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r(625)})()}));","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export * from './modules';\n//# sourceMappingURL=index.js.map"],"sourceRoot":""} \ No newline at end of file diff --git a/build/esm/urpflanze.min.js b/build/esm/urpflanze.min.js index 35fbf7b..1981378 100644 --- a/build/esm/urpflanze.min.js +++ b/build/esm/urpflanze.min.js @@ -1,2 +1,2 @@ /*! For license information please see urpflanze.min.js.LICENSE.txt */ -var t={50:t=>{t.exports=JSON.parse('{"name":"@ffmpeg/ffmpeg","version":"0.10.1","description":"FFmpeg WebAssembly version","main":"src/index.js","types":"src/index.d.ts","directories":{"example":"examples"},"scripts":{"start":"node scripts/server.js","build":"rimraf dist && webpack --config scripts/webpack.config.prod.js","prepublishOnly":"npm run build","lint":"eslint src","wait":"rimraf dist && wait-on http://localhost:3000/dist/ffmpeg.dev.js","test":"npm-run-all -p -r start test:all","test:all":"npm-run-all wait test:browser:ffmpeg test:node:all","test:node":"node --experimental-wasm-threads --experimental-wasm-bulk-memory node_modules/.bin/_mocha --exit --bail --require ./scripts/test-helper.js","test:node:all":"npm run test:node -- ./tests/*.test.js","test:browser":"mocha-headless-chrome -a allow-file-access-from-files -a incognito -a no-sandbox -a disable-setuid-sandbox -a disable-logging -t 300000","test:browser:ffmpeg":"npm run test:browser -- -f ./tests/ffmpeg.test.html"},"browser":{"./src/node/index.js":"./src/browser/index.js"},"repository":{"type":"git","url":"git+https://github.com/ffmpegwasm/ffmpeg.wasm.git"},"keywords":["ffmpeg","WebAssembly","video"],"author":"Jerome Wu ","license":"MIT","bugs":{"url":"https://github.com/ffmpegwasm/ffmpeg.wasm/issues"},"engines":{"node":">=12.16.1"},"homepage":"https://github.com/ffmpegwasm/ffmpeg.wasm#readme","dependencies":{"is-url":"^1.2.4","node-fetch":"^2.6.1","regenerator-runtime":"^0.13.7","resolve-url":"^0.2.1"},"devDependencies":{"@babel/core":"^7.12.3","@babel/preset-env":"^7.12.1","@ffmpeg/core":"^0.10.0","@types/emscripten":"^1.39.4","babel-loader":"^8.1.0","chai":"^4.2.0","cors":"^2.8.5","eslint":"^7.12.1","eslint-config-airbnb-base":"^14.1.0","eslint-plugin-import":"^2.22.1","express":"^4.17.1","mocha":"^8.2.1","mocha-headless-chrome":"^2.0.3","npm-run-all":"^4.1.5","wait-on":"^5.3.0","webpack":"^5.3.2","webpack-cli":"^4.1.0","webpack-dev-middleware":"^4.0.0"}}')},4076:(t,e,r)=>{r(5072);const{devDependencies:n}=r(50);t.exports={corePath:`https://unpkg.com/@ffmpeg/core@${n["@ffmpeg/core"].substring(1)}/dist/ffmpeg-core.js`}},2339:(t,e,r)=>{const n=r(5072);t.exports=async t=>{let e=t;if(void 0===t)return new Uint8Array;if("string"==typeof t)if(/data:_data\/([a-zA-Z]*);base64,([^"]*)/.test(t))e=atob(t.split(",")[1]).split("").map((t=>t.charCodeAt(0)));else{const r=await fetch(n(t));e=await r.arrayBuffer()}else(t instanceof File||t instanceof Blob)&&(e=await(r=t,new Promise(((t,e)=>{const n=new FileReader;n.onload=()=>{t(n.result)},n.onerror=({target:{error:{code:t}}})=>{e(Error(`File could not be read! Code=${t}`))},n.readAsArrayBuffer(r)}))));var r;return new Uint8Array(e)}},1440:(t,e,r)=>{const n=r(5072),{log:i}=r(888),s=async(t,e)=>{i("info",`fetch ${t}`);const r=await(await fetch(t)).arrayBuffer();i("info",`${t} file size = ${r.byteLength} bytes`);const n=new Blob([r],{type:e}),s=URL.createObjectURL(n);return i("info",`${t} blob URL = ${s}`),s};t.exports=async({corePath:t})=>{if("string"!=typeof t)throw Error("corePath should be a string!");const e=n(t),r=await s(e,"application/javascript"),o=await s(e.replace("ffmpeg-core.js","ffmpeg-core.wasm"),"application/wasm"),a=await s(e.replace("ffmpeg-core.js","ffmpeg-core.worker.js"),"application/javascript");return"undefined"==typeof createFFmpegCore?new Promise((t=>{const e=document.createElement("script"),n=()=>{e.removeEventListener("load",n),i("info","ffmpeg-core.js script loaded"),t({createFFmpegCore,corePath:r,wasmPath:o,workerPath:a})};e.src=r,e.type="text/javascript",e.addEventListener("load",n),document.getElementsByTagName("head")[0].appendChild(e)})):(i("info","ffmpeg-core.js script is loaded already"),Promise.resolve({createFFmpegCore,corePath:r,wasmPath:o,workerPath:a}))}},3451:(t,e,r)=>{const n=r(4076),i=r(1440),s=r(2339);t.exports={defaultOptions:n,getCreateFFmpegCore:i,fetchFile:s}},1617:t=>{t.exports={defaultArgs:["./ffmpeg","-nostdin","-y"],baseOptions:{log:!1,logger:()=>{},progress:()=>{},corePath:""}}},9289:(t,e,r)=>{const{defaultArgs:n,baseOptions:i}=r(1617),{setLogging:s,setCustomLogger:o,log:a}=r(888),h=r(6405),u=r(7010),{defaultOptions:c,getCreateFFmpegCore:l}=r(3451),{version:f}=r(50),d=Error("ffmpeg.wasm is not ready, make sure you have completed load().");t.exports=(t={})=>{const{log:e,logger:r,progress:p,...m}={...i,...c,...t};let g=null,v=null,y=null,b=!1,w=p;const M=({type:t,message:e})=>{a(t,e),h(e,w),(t=>{"FFMPEG_END"===t&&null!==y&&(y(),y=null,b=!1)})(e)};return s(e),o(r),a("info",`use ffmpeg.wasm v${f}`),{setProgress:t=>{w=t},setLogger:t=>{o(t)},setLogging:s,load:async()=>{if(a("info","load ffmpeg-core"),null!==g)throw Error("ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.");{a("info","loading ffmpeg-core");const{createFFmpegCore:t,corePath:e,workerPath:r,wasmPath:n}=await l(m);g=await t({mainScriptUrlOrBlob:e,printErr:t=>M({type:"fferr",message:t}),print:t=>M({type:"ffout",message:t}),locateFile:(t,e)=>{if("undefined"!=typeof window){if(void 0!==n&&t.endsWith("ffmpeg-core.wasm"))return n;if(void 0!==r&&t.endsWith("ffmpeg-core.worker.js"))return r}return e+t}}),v=g.cwrap("proxy_main","number",["number","number"]),a("info","ffmpeg-core loaded")}},isLoaded:()=>null!==g,run:(...t)=>{if(a("info",`run ffmpeg command: ${t.join(" ")}`),null===g)throw d;if(b)throw Error("ffmpeg.wasm can only run one command at a time");return b=!0,new Promise((e=>{const r=[...n,...t].filter((t=>0!==t.length));y=e,v(...u(g,r))}))},exit:()=>{if(null===g)throw d;b=!1,g.exit(1),g=null,v=null,y=null},FS:(t,...e)=>{if(a("info",`run FS.${t} ${e.map((t=>"string"==typeof t?t:`<${t.length} bytes binary file>`)).join(" ")}`),null===g)throw d;{let r=null;try{r=g.FS[t](...e)}catch(r){throw"readdir"===t?Error(`ffmpeg.FS('readdir', '${e[0]}') error. Check if the path exists, ex: ffmpeg.FS('readdir', '/')`):"readFile"===t?Error(`ffmpeg.FS('readFile', '${e[0]}') error. Check if the path exists`):Error("Oops, something went wrong in FS operation.")}return r}}}}},5045:(t,e,r)=>{r(5666);const n=r(9289),{fetchFile:i}=r(3451);t.exports={createFFmpeg:n,fetchFile:i}},888:t=>{let e=!1,r=()=>{};t.exports={logging:e,setLogging:t=>{e=t},setCustomLogger:t=>{r=t},log:(t,n)=>{r({type:t,message:n}),e&&console.log(`[${t}] ${n}`)}}},7010:t=>{t.exports=(t,e)=>{const r=t._malloc(e.length*Uint32Array.BYTES_PER_ELEMENT);return e.forEach(((e,n)=>{const i=t._malloc(e.length+1);t.writeAsciiToMemory(e,i),t.setValue(r+Uint32Array.BYTES_PER_ELEMENT*n,i,"i32")})),[e.length,r]}},6405:t=>{let e=0,r=0;const n=t=>{const[e,r,n]=t.split(":");return 60*parseFloat(e)*60+60*parseFloat(r)+parseFloat(n)};t.exports=(t,i)=>{if("string"==typeof t)if(t.startsWith(" Duration")){const s=t.split(", ")[0].split(": ")[1],o=n(s);i({duration:o,ratio:r}),(0===e||e>o)&&(e=o)}else if(t.startsWith("frame")||t.startsWith("size")){const s=t.split("time=")[1].split(" ")[0],o=n(s);r=o/e,i({ratio:r,time:o})}else t.startsWith("video:")&&(i({ratio:1}),e=0)}},2894:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.UncontrolledLoop=e.Static=e.Loop=e.Compose=e.Simple=e.resolveSimpleAnimation=void 0;const n=r(4825),i=r(2765);function s(t){const e=i.createAnimation(t);if(e)return t=>{var r;const n="number"==typeof t?t:(null===(r=t.shape.scene)||void 0===r?void 0:r.currentTime)||0;return e.update(n),e.value}}e.resolveSimpleAnimation=s,e.Simple=s,e.Compose=t=>{const e=n.composeAnimations(t);if(e)return t=>{var r;const n="number"==typeof t?t:(null===(r=t.shape.scene)||void 0===r?void 0:r.currentTime)||0;return e(n)}},e.Loop=t=>{const e=t;return void 0===e.interpolator&&(e.interpolator="wave"),e.interpolator&&("string"==typeof e.interpolator?"wave"!==e.interpolator&&(e.direction="alternate"):"object"==typeof e.interpolator&&"wave"!==e.interpolator.type&&(e.direction="alternate")),e.loop=!0,s(e)},e.Static=t=>{const e=t;return e.direction="normal",e.loop=!1,s(e)},e.UncontrolledLoop=t=>{const e=t;return e.direction="normal",e.loop=!0,s(e)}},9727:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=void 0;const r={linear:(t,e,r,n=1)=>r*t/n+e,quadraticIn:(t,e,r,n=1)=>r*(t/=n)*t+e,quadraticOut:(t,e,r,n=1)=>-r*(t/=n)*(t-2)+e,quadraticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t+e:-r/2*(--t*(t-2)-1)+e,cubicIn:(t,e,r,n=1)=>r*(t/=n)*t*t+e,cubicOut:(t,e,r,n=1)=>(t/=n,r*(--t*t*t+1)+e),cubicInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t+e:r/2*((t-=2)*t*t+2)+e,quarticIn:(t,e,r,n=1)=>r*(t/=n)*t*t*t+e,quarticOut:(t,e,r,n=1)=>(t/=n,-r*(--t*t*t*t-1)+e),quarticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t*t+e:-r/2*((t-=2)*t*t*t-2)+e,quinticIn:(t,e,r,n=1)=>r*(t/=n)*t*t*t*t+e,quinticOut:(t,e,r,n=1)=>(t/=n,r*(--t*t*t*t*t+1)+e),quinticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t*t*t+e:r/2*((t-=2)*t*t*t*t+2)+e,sinusoidalIn:(t,e,r,n=1)=>-r*Math.cos(t/n*(Math.PI/2))+r+e,sinusoidalOut:(t,e,r,n=1)=>r*Math.sin(t/n*(Math.PI/2))+e,sinusoidalInOut:(t,e,r,n=1)=>-r/2*(Math.cos(Math.PI*t/n)-1)+e,exponentialIn:(t,e,r,n=1)=>r*Math.pow(2,10*(t/n-1))+e,exponentialOut:(t,e,r,n=1)=>r*(1-Math.pow(2,-10*t/n))+e,exponentialInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*Math.pow(2,10*(t-1))+e:(t--,r/2*(2-Math.pow(2,-10*t))+e),circularIn:(t,e,r,n=1)=>(t/=n,-r*(Math.sqrt(1-t*t)-1)+e),circularOut:(t,e,r,n=1)=>(t/=n,t--,r*Math.sqrt(1-t*t)+e),circularInOut:(t,e,r,n=1)=>(t/=n/2)<1?-r/2*(Math.sqrt(1-t*t)-1)+e:(t-=2,r/2*(Math.sqrt(1-t*t)+1)+e),elasticIn:(t,e,r,n=1,i=1,s=.5)=>{if(0===t)return e;if(1==(t/=n))return e+r;s*=n;let o=0;return i{if(0===t)return e;if(1==(t/=n))return e+r;s*=n;let o=0;return i{if(0===t)return e;if(2==(t/=n/2))return e+r;s*=n;let o=0;return ir*(t/=n)*t*((i+1)*t-i)+e,backOut:(t,e,r,n=1,i=1.70158)=>r*((t=t/n-1)*t*((i+1)*t+i)+1)+e,backInOut:(t,e,r,n=1,i=1.70158)=>(t/=n/2)<1?r/2*(t*t*((1+(i*=1.525))*t-i))+e:r/2*((t-=2)*t*((1+(i*=1.525))*t+i)+2)+e,bounceIn:(t,e,n,i=1)=>n-r.bounceOut(i-t,0,n,i)+e,bounceOut:(t,e,r,n=1)=>(t/=n)<1/2.75?r*(7.5625*t*t)+e:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+e:r*(7.5625*(t-=2.625/2.75)*t+.984375)+e,bounceInOut:(t,e,n,i=1)=>t{Object.defineProperty(e,"__esModule",{value:!0}),e.composeAnimations=void 0;const n=r(7358),i=r(2765),s=r(8782);function o(t,e,r=.5){const i=Array.isArray(t)?t:[t],o=Array.isArray(e)?e:[e],a=[];for(let t=0,e=i.length;tvoid 0!==t)),r=e.length;if(r>0)return t=>{let n;for(let i=0;i{Object.defineProperty(e,"__esModule",{value:!0}),e.createAnimation=void 0;const n=r(9298);e.createAnimation=function(t){const e=n.createInterpolationCallback(t);if(void 0===e)return;const r=t.delay||0,i=t.afterDelay||0,s=t.direction||"normal",o=t.duration||1e3,a="normal"===s||"reverse"===s?o+r:2*o+r+i,h={delay:r,afterDelay:i,direction:s,duration:o,totalDuration:a,loop:"number"==typeof t.loop?t.loop:!!t.loop},u=n.createInterpolator(t.interpolator),c={loop:0,offset:0,loopDuration:a,direction:"alternate"===s?"normal":s,started:!1,ended:!1,value:void 0};return c.update=function(t,e,r,n){const{loop:i,totalDuration:s,delay:o,afterDelay:a,direction:h,duration:u}=e;return c=>{if("number"==typeof i&&c>=s*i||!1===i&&c>=e.totalDuration)return t.started=!1,t.ended=!0,t.offset=r("normal"===h?u:0,u),void(t.value=n(t.offset));if(t.loop=Math.ceil(c/s),c%=s,(c-=o)<=0)return t.started=!1,t.offset=r(0,u),void(t.value=n(t.offset));if(t.started=!0,"alternate"===h)c<=u?(t.direction="normal",t.offset=r(c,u)):(t.direction="reverse",c-=u,(c-=a)>=0?t.offset=1-r(c>=u?u:c,u):t.offset=1);else{const e=r(c>=u?u:c,u);t.offset="normal"===h?e:1-e}t.value=n(t.offset)}}(c,h,u,e),c}},9298:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createInterpolator=e.createInterpolationCallback=void 0;const n=r(7358),i=r(3431),s=r(9727),o=r(8782);e.createInterpolationCallback=function(t){const e=Array.isArray(t.from)?t.from:[t.from],r=Array.isArray(t.to)?t.to:[t.to],i=t.round,s="hue"===t.colorTransitionMode?o.interpolateColorHSL:o.interpolateColorRGB;if(e.length!==r.length)return;const a=[];for(let t=0,o=e.length;t1===t?s:0===t?n:Math.round((n+t*(s-n))*i)/i:t=>1===t?s:0===t?n:n+t*(s-n))}else{const i=e[t],o=r[t],h=n.parseColorAndConvert(i),u=n.parseColorAndConvert(o);void 0!==h&&void 0!==u&&a.push((t=>1===t?o:0===t?i:s(h,u,t)))}}return t=>{const e=a.map((e=>e(t)));return 1===e.length?e[0]:e}},e.createInterpolator=function(t){var e,r;switch(typeof t){case"function":return(e,r)=>t(e/r,e);case"string":switch(t){case"wave":return(t,e)=>.5+.5*Math.sin(t*Math.PI*2/e+1.5*Math.PI);default:if(t in s.Easings){const e=s.Easings[t];return(t,r)=>e(t,0,1,r)}return(t,e)=>s.Easings.linear(t,0,1,e)}case"object":switch(t.type){case"wave":{const r=1.5*Math.PI+((null===(e=t.params)||void 0===e?void 0:e.phase)||0);return(t,e)=>.5+.5*Math.sin(t*Math.PI*2/e+r)}case"elasticIn":case"elasticOut":case"elasticInOut":{const e=s.Easings[t.type],{amplitude:r,period:n}=t.params||{};return(t,i)=>e(t,0,1,i,r,n)}case"backIn":case"backOut":case"backInOut":{const e=s.Easings[t.type],n=(null===(r=t.params)||void 0===r?void 0:r.overshoot)||void 0;return(t,r)=>e(t,0,1,r,n)}case"cubicBezier":{const e=i.default(t.params[0],t.params[1],t.params[2],t.params[3]);return(t,r)=>e(t/r)}}}return(t,e)=>s.Easings.linear(t,0,1,e)}},7518:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(5240),e),i(r(8782),e),i(r(2765),e),i(r(9298),e),i(r(9727),e),i(r(2894),e)},5240:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},8782:(t,e)=>{function r(t,e,r=!0,n="alternate",i=0,s=0){const o="normal"===n||"reverse"===n?e+i:2*e+i+s;return"number"==typeof r&&t>=o*r||!1===r&&t>=o?"normal"===n?e:0:(t%=o,(t-=i)<=0?0:"alternate"===n?t<=e?t:(t-=e,(t-=s)>=0?e-(t>=e?e:t):e):t>=e?e:t)}Object.defineProperty(e,"__esModule",{value:!0}),e.interpolateColorHSL=e.interpolateColorRGB=e.cosp=e.sinp=e.clockOffset=e.clock=void 0,e.clock=r,e.clockOffset=function(t,e,n=!0,i="alternate",s=0,o=0){return r(t,e,n,i,s,o)/e};const n=2*Math.PI;e.sinp=function(t,e,r=0,i=!1){const s=Math.sin(t*n/e+r);return i?.5+.5*s:s},e.cosp=function(t,e,r=0,i=!1){const s=Math.cos(t*n/e+r);return i?.5+.5*s:s},e.interpolateColorRGB=function(t,e,r){const n=t.r+r*(e.r-t.r),i=t.g+r*(e.g-t.g),s=t.b+r*(e.b-t.b),o=t.alpha+r*(e.alpha-t.alpha);return`rgba(${Math.floor(n)},${Math.floor(i)},${Math.floor(s)},${o})`},e.interpolateColorHSL=function(t,e,r){return`hsla(${t.h+r*(e.h-t.h)},${t.s+r*(e.s-t.s)}%,${t.l+r*(e.l-t.l)}%,${t.alpha+r*(e.alpha-t.alpha)})`}},814:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.rgbToHsl=e.hslToRgb=e.rgbToHex=void 0,e.rgbToHex=function(t,e,r){return`#${((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}`},e.hslToRgb=function(t,e,r){let n,i,s;if(t/=360,r/=100,0==(e/=100))n=i=s=r;else{const o=(t,e,r)=>(r+=r<0?1:r>1?-1:0)<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,a=r<.5?r*(1+e):r+e-r*e,h=2*r-a;n=o(h,a,t+1/3),i=o(h,a,t),s=o(h,a,t-1/3)}return[.5+255*n<<0,.5+255*i<<0,.5+255*s<<0]},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;const n=Math.max(t,e,r),i=Math.min(t,e,r),s=(n+i)/2;let o,a;if(n===i)o=a=0;else{const h=n-i;switch(a=s>.5?h/(2-n-i):h/(n+i),n){case t:o=(e-r)/h+(e{Object.defineProperty(e,"__esModule",{value:!0}),e.default={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",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",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",rebeccapurple:"#663399",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",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},7358:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(6097),e),i(r(814),e),i(r(5576),e)},5576:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.parseColorAndConvert=void 0;const n=r(4947),i=r(814);function s(t){if("number"==typeof t)return t>16777215?{type:"rgb",a:t>>24&255,b:t>>16&255,c:t>>8&255,alpha:(255&t)/255}:{type:"rgb",a:t>>16&255,b:t>>8&255,c:255&t,alpha:1};t=t.replace(/\s/g,""),n.default[t]&&(t=n.default[t]);let e=/^#([0-9a-f]{3,8})$/i.exec(t);if(e){const t=e[1];return 3===t.length?{type:"rgb",a:parseInt(t[0]+t[0],16),b:parseInt(t[1]+t[1],16),c:parseInt(t[2]+t[2],16),alpha:1}:{type:"rgb",a:parseInt(t[0]+t[1],16),b:parseInt(t[2]+t[3],16),c:parseInt(t[4]+t[5],16),alpha:t.length>6?parseInt(t.substring(6),16)/255:1}}if(e=/^((hsl|rgb)a?)\((\d+),(\d+)%?,(\d+)%?,?(.+)?\)$/i.exec(t),e){const[,,t,r,n,i,s]=e;return{type:t,a:+r,b:+n,c:+i,alpha:s?+s:1}}}e.parseColorAndConvert=function(t){const e=s(t);if(e){if("hsl"===e.type){const[t,r,n]=i.hslToRgb(e.a,e.b,e.c);return{r:t,g:r,b:n,h:e.a,s:e.b,l:e.c,alpha:e.alpha}}{const[t,r,n]=i.rgbToHsl(e.a,e.b,e.c);return{h:t,s:r,l:n,r:e.a,g:e.b,b:e.c,alpha:e.alpha}}}},e.parseColor=s},6097:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},1172:t=>{window,t.exports=(()=>{var t={193:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Group=void 0;const n=r(107),i=r(15),s=r(485),o=r(658);class a extends i.SceneChild{constructor(t={}){t.type="Group",super(t),this.children=[],["id","name","data","order","type"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=o.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){"object"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=a},107:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Scene=void 0;const n=r(15),i=r(193),s=r(775),o=r(932);class a{constructor(t={}){this.width=400,this.height=400,this.background="hsla(0, 0%, 0%, 1)",this.color="hsla(0, 0%, 100%, 1)",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?(.5+.5*o.clamp(-1,1,t.anchor[0]))*this.width:"left"===t.anchor[0]?0:"right"===t.anchor[0]?this.width:this.center[0],"number"==typeof t.anchor[1]?(.5+.5*o.clamp(-1,1,t.anchor[1]))*this.height:"top"===t.anchor[1]?0:"bottom"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e="number"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,a.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{a.propagateToChilden(t,e)})):t instanceof s.Shape&&t.shape&&(t.shape.scene=e,a.propagateToChilden(t.shape,e))}}e.Scene=a},15:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||"SceneChild",this.name=t.name||this.type+"_"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){"string"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},932:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(21),i=r(345),s=r(271),o="undefined"!=typeof performance?performance:Date;function a(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return o.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=a,e.relativeClamp=function(t,e,r,n,i){return a(n,i,(r-t)/(e-t)*(i-n)+n)};const h={random:new n(Math.random)};e.noise=function(t="random",e=0,r=0,i=0){return void 0===h[t]&&(h[t]=new n(t)),h[t].noise3D(e,r,i)};const u={};function c(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),s=rn?[s,o]:[o,s]}function l(t,e){const r=t.length,n=r/2,i=2*(n+e),s=n-1;if(s>1){const n=r-2,o=Math.floor(e/s);let a=(i-(r+o*n))/2;const h=Math.round(s/a),u=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%h==0||e===n-2),p=o+(d?1:0),m=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);u[i]=(s=t(),o=t(),a=t(),h=t(),function(){let t=(s>>>=0)+(o>>>=0)|0;return s=o^o>>>9,o=(a>>>=0)+(a<<3)|0,t=t+(h=1+(h>>>=0)|0)|0,a=(a=a<<21|a>>>11)+t|0,(t>>>0)/4294967296})}var s,o,a,h;const c=e+u[i]()*(r-e);return void 0!==n?Math.round(c*10**n)/10**n:c},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return s.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=c,e.interpolate=function(t,e,r=.5){const[n,i]=c(t,e),s=Math.max(n.length,i.length),o="number"==typeof r?[r]:r,a=s/2;if(o.length!==a){const t=o.length;for(let e=0;e{Object.defineProperty(e,"__esModule",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return"number"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},348:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(887);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},888:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},658:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(700);var i;!function(t){t[t.None=0]="None",t[t.Scale=2]="Scale",t[t.Center=4]="Center",t[t.Fill=8]="Fill"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn("[Urplfanze:Bounding] cannot sum bounding")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn("[Urplfanze:Bounding] cannot bind bounding")}};class s extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return s.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=s.getBounding(t));const o=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,a=e>=i.Center?r.cx:0,h=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{Object.defineProperty(e,"__esModule",{value:!0}),e.Close=void 0;const n=r(700);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},991:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Mirror=void 0;const n=r(700);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let s=0;s{Object.defineProperty(e,"__esModule",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},62:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Offset=void 0;const n=r(700);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i},785:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Smooth=void 0;const n=r(932),i=r(364),s=r(700);class o extends s.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Solidify=void 0;const n=r(700);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const s=[],o=(e="number"==typeof e?[e]:e).length;let a,h,u=[[0,0],[0,0]],c=[[0,0],[0,0]];for(let r=0,l=0,f=t.length-2;r{Object.defineProperty(e,"__esModule",{value:!0}),e.Subdivide=void 0;const n=r(700);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Modifiers=void 0;const n=r(658),i=r(991),s=r(785),o=r(982),a=r(301),h=r(364),u=r(62),c={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:s.Smooth,Solidify:o.Solidify,Subdivide:a.Subdivide,Close:h.Close,Offset:u.Offset};e.Modifiers=c},775:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=void 0;const n=r(107),i=r(15),s=r(485);class o extends s.ShapeBase{constructor(t){t.type=t.type||"Shape",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn("[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\nYou passed:",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):o.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBase=void 0;const n=r(887),i=r(46),s=r(348),o=r(271),a=r(888),h=r(658),u=r(932),c=r(15),l=n.mat4.create(),f=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class m extends c.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?-1*u.clamp(-1,1,t.anchor[0]):"left"===t.anchor[0]?1:"right"===t.anchor[0]?-1:0,"number"==typeof t.anchor[1]?-1*u.clamp(-1,1,t.anchor[1]):"top"===t.anchor[1]?1:"bottom"===t.anchor[1]?-1:0]:[0,0],this.boundingType="string"==typeof t.boundingType?"relative"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return"function"!=typeof t.repetitions&&"function"!=typeof t.distance&&"function"!=typeof t.displace&&"function"!=typeof t.scale&&"function"!=typeof t.translate&&"function"!=typeof t.skewX&&"function"!=typeof t.skewY&&"function"!=typeof t.squeezeX&&"function"!=typeof t.squeezeY&&"function"!=typeof t.rotateX&&"function"!=typeof t.rotateY&&"function"!=typeof t.rotateZ&&"function"!=typeof t.transformOrigin&&"function"!=typeof t.perspective&&"function"!=typeof t.perspectiveOrigin}isStaticIndexed(){return"function"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return"function"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){"string"==typeof t?(r=r||"repetitions"==t,this.props[t]=e):(r=r||"repetitions"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var c,g;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const v=m.getEmptyPropArguments(this,r),y=v.repetition,b=this.getProp("repetitions",v,1),w=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,M=Array.isArray(b)?b[0]*(null!==(c=b[1])&&void 0!==c?c:b[0]):b,x=Array.isArray(b)?b[0]:M,_=Array.isArray(b)?null!==(g=b[1])&&void 0!==g?g:b[0]:1,S=y.row;S.count=x;const P=y.col;P.count=_,y.count=M,y.col.count=_,y.row.count=x,y.type=w;let A=0;const O=[];let E=0;const k=n.vec2.fromValues((_-1)/2,(x-1)/2),I=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],C=[void 0,void 0,void 0,void 0],B=[void 0,void 0,void 0,void 0];for(let r=0;r1?E/(M-1):1,y.angle=w===i.ERepetitionType.Ring?a.PI2/M*E:0,P.index=c+1,P.offset=_>1?c/(_-1):1,S.index=r+1,S.offset=x>1?r/(x-1):1;const m=this.generateBuffer(t,v),g=m.length,b=this.getShapeBounding();O[E]=new Float32Array(g),A+=g;{const t=s.toVec2(this.getProp("distance",v,s.VEC2_ZERO)),a=this.getProp("displace",v,0),M=s.toVec3(this.getProp("scale",v,s.VEC2_ONE),1),x=s.toVec3(this.getProp("translate",v,s.VEC2_ZERO),0),_=this.getProp("skewX",v,0),S=this.getProp("skewY",v,0),P=this.getProp("squeezeX",v,0),A=this.getProp("squeezeY",v,0),R=this.getProp("rotateX",v,0),T=this.getProp("rotateY",v,0),L=this.getProp("rotateZ",v,0),F=u.clamp(0,1,this.getProp("perspective",v,0)),j=s.toVec3(this.getProp("perspectiveOrigin",v,s.VEC2_ZERO),0),D=s.toVec3(this.getProp("transformOrigin",v,s.VEC2_ZERO),0);let z;switch(w){case i.ERepetitionType.Ring:z=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(z,z,s.VEC3_ZERO,y.angle+a);break;case i.ERepetitionType.Matrix:z=n.vec3.fromValues(t[1]*(c-k[0]),t[0]*(r-k[1]),0)}const q=F>0?Math.max(b.width,b.height)/2:1,N=F>0?q+10*q*(1-F):0,U=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==F||0!==D[0]||0!==D[1],Y=0!==j[0]||0!==j[1];U&&(this.boundingType===i.EBoundingType.Relative?(D[0]=D[0]*(b.width/2)+b.cx,D[1]=D[1]*(b.height/2)+b.cy):(D[0]*=b.width/2,D[1]*=b.height/2),D[2]=N);{n.mat4.identity(f),U&&n.mat4.translate(f,f,D),0===x[0]&&0===x[1]||n.mat4.translate(f,f,x),0===_&&0===S||(s.fromSkew(l,[_,S]),n.mat4.multiply(f,f,l)),0!==R&&n.mat4.rotateX(f,f,R),0!==T&&n.mat4.rotateY(f,f,T),0!==L&&n.mat4.rotateZ(f,f,L),1===M[0]&&1===M[1]||n.mat4.scale(f,f,M),U&&n.mat4.translate(f,f,n.vec3.scale(D,D,-1)),N>0&&(Y&&(this.boundingType===i.EBoundingType.Relative?(j[0]=j[0]*(b.width/2)+b.cx,j[1]=j[1]*(b.height/2)+b.cy):(j[0]*=b.width/2,j[1]*=b.height/2),j[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,z),e&&n.mat4.translate(p,p,I);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),w===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,y.angle+a)}h.Bounding.clear(B);for(let t=0;t0&&(Y&&n.vec3.add(e,e,j),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,N),Y&&n.vec3.sub(e,e,j)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=g/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,v)}O[E][t]=e[0],O[E][t+1]=e[1],h.Bounding.add(B,e[0],e[1]),h.Bounding.add(C,e[0],e[1])}}const R={cx:0,cy:0,x:-1,y:-1,width:2,height:2};h.Bounding.bind(R,B),this.bStaticIndexed&&this.bIndexed||this.addIndex(g,y,R)}h.Bounding.bind(this.bounding,C),this.buffer=new Float32Array(A);for(let t=0,e=0,r=O.length;t({index:1,offset:1,count:1}),m.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...m.getEmptySimpleRepetition(),row:m.getEmptySimpleRepetition(),col:m.getEmptySimpleRepetition()})},425:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBuffer=void 0;const n=r(658),i=r(436);class s extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||"ShapeBuffer",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn("[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property"),this.shape=s.EMPTY_BUFFER):this.shape="function"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return"function"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from("function"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,s=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&"function"!=typeof this.props.sideLength&&"function"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=s},549:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeFollow=void 0;const n=r(775);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeFollow",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},s=this.shape;s.generate(t,!1,i);let o=s.getBuffer();const a=o.length,h=new Float32Array(a*(n.length/2)),u=n.length/2;for(let e=0;e1?e/(u-1):1,count:u};this.shapeUseFollow&&(i.follow=r,s.generate(t,!1,i),o=s.getBuffer());const c=e*a,l=2*e,f=n[l],d=n[l+1];for(let t=0,e=o.length;t1?t/(e-1):1;for(let o=0,a=s.length;o{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeLoop=void 0;const n=r(888),i=r(658),s=r(436),o=r(485);class a extends s.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||"ShapeLoop",super(t),this.loopDependencies=(t.loopDependencies||[]).concat("sideLength"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes("propArguments"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}"loop"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||o.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?("function"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),s=this.getRepetitionSideLength(t),o=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,a={index:0,offset:0,current:0,count:n},h=a.count,u=new Float32Array(2*h);for(let n=0,i=0;n1?n/(a.count-1):1;a.current=s,a.index=n+1,a.offset=h;const c=o(a,t);u[i]=c[0],u[i+1]=c[1]}const c=[void 0,void 0,void 0,void 0],l=this.applyModifiers(u,t);for(let t=0,e=l.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapePrimitive=void 0;const n=r(348),i=r(485),s=r(700),o=r(658);class a extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=o.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:"function"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return"function"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:"number"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp("sideLength",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeRecursive=void 0;const n=r(775);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeRecursive",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionScale&&"function"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp("recursions",e,1)),n=Math.floor(this.getProp("recursionVertex",e,0)),s=this.getProp("recursionScale",e,2),o=this.shape;let a={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const h={...e,recursion:a};o.generate(t,!1,h);const u=o.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=u);let c=u;const l=[a];let f=0,d=1;const p=c.length,m=p/2,g=n<=0?m:Math.min(n,m),v=0===n?1:m/Math.min(n,m),y=new Float32Array(i.summmation(r,g)*p);for(let t=0;t1?e/(r-1):1,u=i.summmation(e,g)*p,m=e-1,b=0===m?0:i.summmation(m,g)*p;for(let i=0,m=g**e;i1?i/(m-1):1,count:m,level:{index:e+1,offset:n,count:r},parent:l[f]},l.push(a),this.shapeUseRecursion&&(h.recursion=a,o.generate(t,!1,h),c=o.getBuffer());const w=u+i*p,M=Math.floor(b+2*i*v),x=y[M],_=y[M+1],S=s**e;for(let t=0,e=p;t1?0:1,count:s}}},h=this.shape.getIndexedBuffer()||[];for(let t=0,e=h.length;t1?0:1,count:s}},i={...a,recursion:r},o=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:o})}if(s>1){const t=this.shape.getBufferLength({...i,parent:{...a}})/2,e=o<=0?t:Math.min(o,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let u=0,c=1;for(let t=1;t1?t/(s-1):1;for(let o=0,l=e**t;o1?o/(l-1):1;for(let d=0,p=h.length;d{Object.defineProperty(e,"__esModule",{value:!0}),e.Circle=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){t.type="Circle",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=s},702:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Line=void 0;const n=r(658),i=r(425);class s extends i.ShapeBuffer{constructor(t={}){t.type="Line",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Lissajous=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){t.type="Lissajous",t.loopDependencies=(t.loopDependencies||[]).concat(["wx","wy","wz"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp("wx",t),r=this.getProp("wy",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),s=this.getRepetitionSideLength(t);return 1/Math.pow(s[0]*s[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp("wx",t,1),this.wy=this.getProp("wy",t,2),this.wz=this.getProp("wz",t,2),super.generateLoopBuffer(t)}}e.Lissajous=s},873:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Polygon=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["sideNumber"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp("sideNumber",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=s},478:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Rect=void 0;const n=r(658),i=r(425);class s extends i.ShapeBuffer{constructor(t={}){t.type="Rect",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=s,s.buffer=[1,1,-1,1,-1,-1,1,-1]},710:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Rose=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){var e,r;t.type="Rose",t.loopDependencies=(t.loopDependencies||[]).concat(["n","d"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>s.getFinalAngleFromK(this.getProp("n",t),this.getProp("d",t)),inc:t=>{const e=this.getProp("n",t),r=this.getProp("d",t),i=this.getRepetitionSideLength(t),s=Math.pow(i[0]*i[1],.45),o=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp("n",t)/this.getProp("d",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=s},82:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Spiral=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type="Spiral",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat(["twists","twistsStart","spiral"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:s.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp("twistsStart",t),end:t=>n.PI2*(this.getProp("twistsStart",t)+this.getProp("twists",t)),inc:t=>{const e=this.getProp("twists",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp("spiral",t),this.r=s.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case s.types.ARCHIMEDE:return t=>t/10;case s.types.HYPERBOLIC:return t=>1/t*3;case s.types.FERMAT:return t=>t**.5/3;case s.types.LITUUS:return t=>t**-.5;case s.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=s,s.types={ARCHIMEDE:"ARCHIMEDE",HYPERBOLIC:"HYPERBOLIC",FERMAT:"FERMAT",LITUUS:"LITUUS",LOGARITHMIC:"LOGARITHMIC"}},490:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Star=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["spikes","innerRadius"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp("spikes",t,5),this.innerRadius=this.getProp("innerRadius",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=s},845:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SuperShape=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){var e,r,i,s,o,a;t.type="SuperShape",t.loopDependencies=(t.loopDependencies||[]).concat(["a","b","m","n1","n2","n3"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(s=t.n1)&&void 0!==s?s:1,this.props.n2=null!==(o=t.n2)&&void 0!==o?o:1,this.props.n3=null!==(a=t.n3)&&void 0!==a?a:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp("a",t),this.b=this.getProp("b",t),this.m=this.getProp("m",t),this.n1=this.getProp("n1",t),this.n2=this.getProp("n2",t),this.n3=this.getProp("n3",t),super.generateLoopBuffer(t)}}e.SuperShape=s},123:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Triangle=void 0;const n=r(658),i=r(425);class s extends i.ShapeBuffer{constructor(t={}){t.type="Triangle",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=s,s.buffer=[1,0,-1,1,-1,-1]},46:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(574),e),i(r(636),e),i(r(345),e),i(r(920),e),i(r(676),e),i(r(300),e),i(r(273),e),i(r(511),e)},574:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},636:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},345:(t,e)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]="Ring",r[r.Matrix=2]="Matrix"},920:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},676:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},300:(t,e)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]="Relative",r[r.Fixed=2]="Fixed"},273:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},511:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},887:(t,e,r)=>{r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>s,mat3:()=>o,mat4:()=>a,quat:()=>c,quat2:()=>l,vec2:()=>f,vec3:()=>h,vec4:()=>u});var n={};r.r(n),r.d(n,{ARRAY_TYPE:()=>p,EPSILON:()=>d,RANDOM:()=>m,equals:()=>b,setMatrixArrayType:()=>g,toRadian:()=>y});var i={};r.r(i),r.d(i,{LDU:()=>j,add:()=>D,adjoint:()=>E,clone:()=>M,copy:()=>x,create:()=>w,determinant:()=>k,equals:()=>N,exactEquals:()=>q,frob:()=>F,fromRotation:()=>R,fromScaling:()=>T,fromValues:()=>S,identity:()=>_,invert:()=>O,mul:()=>V,multiply:()=>I,multiplyScalar:()=>U,multiplyScalarAndAdd:()=>Y,rotate:()=>C,scale:()=>B,set:()=>P,str:()=>L,sub:()=>Z,subtract:()=>z,transpose:()=>A});var s={};r.r(s),r.d(s,{add:()=>ut,clone:()=>$,copy:()=>X,create:()=>G,determinant:()=>K,equals:()=>pt,exactEquals:()=>dt,frob:()=>ht,fromRotation:()=>it,fromScaling:()=>st,fromTranslation:()=>ot,fromValues:()=>W,identity:()=>H,invert:()=>Q,mul:()=>mt,multiply:()=>tt,multiplyScalar:()=>lt,multiplyScalarAndAdd:()=>ft,rotate:()=>et,scale:()=>rt,set:()=>J,str:()=>at,sub:()=>gt,subtract:()=>ct,translate:()=>nt});var o={};r.r(o),r.d(o,{add:()=>Nt,adjoint:()=>At,clone:()=>bt,copy:()=>wt,create:()=>vt,determinant:()=>Ot,equals:()=>Gt,exactEquals:()=>Zt,frob:()=>qt,fromMat2d:()=>Lt,fromMat4:()=>yt,fromQuat:()=>Ft,fromRotation:()=>Rt,fromScaling:()=>Tt,fromTranslation:()=>Bt,fromValues:()=>Mt,identity:()=>_t,invert:()=>Pt,mul:()=>$t,multiply:()=>Et,multiplyScalar:()=>Yt,multiplyScalarAndAdd:()=>Vt,normalFromMat4:()=>jt,projection:()=>Dt,rotate:()=>It,scale:()=>Ct,set:()=>xt,str:()=>zt,sub:()=>Xt,subtract:()=>Ut,translate:()=>kt,transpose:()=>St});var a={};r.r(a),r.d(a,{add:()=>Te,adjoint:()=>ne,clone:()=>Wt,copy:()=>Jt,create:()=>Ht,determinant:()=>ie,equals:()=>ze,exactEquals:()=>De,frob:()=>Re,fromQuat:()=>Pe,fromQuat2:()=>be,fromRotation:()=>pe,fromRotationTranslation:()=>ye,fromRotationTranslationScale:()=>_e,fromRotationTranslationScaleOrigin:()=>Se,fromScaling:()=>de,fromTranslation:()=>fe,fromValues:()=>Qt,fromXRotation:()=>me,fromYRotation:()=>ge,fromZRotation:()=>ve,frustum:()=>Ae,getRotation:()=>xe,getScaling:()=>Me,getTranslation:()=>we,identity:()=>te,invert:()=>re,lookAt:()=>Ie,mul:()=>qe,multiply:()=>se,multiplyScalar:()=>Fe,multiplyScalarAndAdd:()=>je,ortho:()=>ke,perspective:()=>Oe,perspectiveFromFieldOfView:()=>Ee,rotate:()=>he,rotateX:()=>ue,rotateY:()=>ce,rotateZ:()=>le,scale:()=>ae,set:()=>Kt,str:()=>Be,sub:()=>Ne,subtract:()=>Le,targetTo:()=>Ce,translate:()=>oe,transpose:()=>ee});var h={};r.r(h),r.d(h,{add:()=>Xe,angle:()=>_r,bezier:()=>mr,ceil:()=>Qe,clone:()=>Ye,copy:()=>Ge,create:()=>Ue,cross:()=>fr,dist:()=>Br,distance:()=>sr,div:()=>Cr,divide:()=>Je,dot:()=>lr,equals:()=>Or,exactEquals:()=>Ar,floor:()=>Ke,forEach:()=>Fr,fromValues:()=>Ze,hermite:()=>pr,inverse:()=>ur,len:()=>Tr,length:()=>Ve,lerp:()=>dr,max:()=>er,min:()=>tr,mul:()=>Ir,multiply:()=>We,negate:()=>hr,normalize:()=>cr,random:()=>gr,rotateX:()=>wr,rotateY:()=>Mr,rotateZ:()=>xr,round:()=>rr,scale:()=>nr,scaleAndAdd:()=>ir,set:()=>$e,sqrDist:()=>Rr,sqrLen:()=>Lr,squaredDistance:()=>or,squaredLength:()=>ar,str:()=>Pr,sub:()=>kr,subtract:()=>He,transformMat3:()=>yr,transformMat4:()=>vr,transformQuat:()=>br,zero:()=>Sr});var u={};r.r(u),r.d(u,{add:()=>Ur,ceil:()=>Gr,clone:()=>Dr,copy:()=>qr,create:()=>jr,cross:()=>hn,dist:()=>wn,distance:()=>Kr,div:()=>bn,divide:()=>Zr,dot:()=>an,equals:()=>gn,exactEquals:()=>mn,floor:()=>$r,forEach:()=>Sn,fromValues:()=>zr,inverse:()=>sn,len:()=>xn,length:()=>en,lerp:()=>un,max:()=>Hr,min:()=>Xr,mul:()=>yn,multiply:()=>Vr,negate:()=>nn,normalize:()=>on,random:()=>cn,round:()=>Wr,scale:()=>Jr,scaleAndAdd:()=>Qr,set:()=>Nr,sqrDist:()=>Mn,sqrLen:()=>_n,squaredDistance:()=>tn,squaredLength:()=>rn,str:()=>pn,sub:()=>vn,subtract:()=>Yr,transformMat4:()=>ln,transformQuat:()=>fn,zero:()=>dn});var c={};r.r(c),r.d(c,{add:()=>ei,calculateW:()=>Tn,clone:()=>Jn,conjugate:()=>Nn,copy:()=>Kn,create:()=>Pn,dot:()=>ii,equals:()=>fi,exactEquals:()=>li,exp:()=>Ln,fromEuler:()=>Yn,fromMat3:()=>Un,fromValues:()=>Qn,getAngle:()=>kn,getAxisAngle:()=>En,identity:()=>An,invert:()=>qn,len:()=>ai,length:()=>oi,lerp:()=>si,ln:()=>Fn,mul:()=>ri,multiply:()=>In,normalize:()=>ci,pow:()=>jn,random:()=>zn,rotateX:()=>Cn,rotateY:()=>Bn,rotateZ:()=>Rn,rotationTo:()=>di,scale:()=>ni,set:()=>ti,setAxes:()=>mi,setAxisAngle:()=>On,slerp:()=>Dn,sqlerp:()=>pi,sqrLen:()=>ui,squaredLength:()=>hi,str:()=>Vn});var l={};r.r(l),r.d(l,{add:()=>zi,clone:()=>vi,conjugate:()=>Gi,copy:()=>Si,create:()=>gi,dot:()=>Yi,equals:()=>ts,exactEquals:()=>Ki,fromMat4:()=>_i,fromRotation:()=>xi,fromRotationTranslation:()=>wi,fromRotationTranslationValues:()=>bi,fromTranslation:()=>Mi,fromValues:()=>yi,getDual:()=>Ei,getReal:()=>Oi,getTranslation:()=>Ci,identity:()=>Pi,invert:()=>Zi,len:()=>Xi,length:()=>$i,lerp:()=>Vi,mul:()=>Ni,multiply:()=>qi,normalize:()=>Ji,rotateAroundAxis:()=>Di,rotateByQuatAppend:()=>Fi,rotateByQuatPrepend:()=>ji,rotateX:()=>Ri,rotateY:()=>Ti,rotateZ:()=>Li,scale:()=>Ui,set:()=>Ai,setDual:()=>Ii,setReal:()=>ki,sqrLen:()=>Wi,squaredLength:()=>Hi,str:()=>Qi,translate:()=>Bi});var f={};r.r(f),r.d(f,{add:()=>os,angle:()=>Rs,ceil:()=>cs,clone:()=>rs,copy:()=>is,create:()=>es,cross:()=>Ps,dist:()=>Us,distance:()=>vs,div:()=>Ns,divide:()=>us,dot:()=>Ss,equals:()=>js,exactEquals:()=>Fs,floor:()=>ls,forEach:()=>Zs,fromValues:()=>ns,inverse:()=>xs,len:()=>Ds,length:()=>bs,lerp:()=>As,max:()=>ds,min:()=>fs,mul:()=>qs,multiply:()=>hs,negate:()=>Ms,normalize:()=>_s,random:()=>Os,rotate:()=>Bs,round:()=>ps,scale:()=>ms,scaleAndAdd:()=>gs,set:()=>ss,sqrDist:()=>Ys,sqrLen:()=>Vs,squaredDistance:()=>ys,squaredLength:()=>ws,str:()=>Ls,sub:()=>zs,subtract:()=>as,transformMat2:()=>Es,transformMat2d:()=>ks,transformMat3:()=>Is,transformMat4:()=>Cs,zero:()=>Ts});var d=1e-6,p="undefined"!=typeof Float32Array?Float32Array:Array,m=Math.random;function g(t){p=t}var v=Math.PI/180;function y(t){return t*v}function b(t,e){return Math.abs(t-e)<=d*Math.max(1,Math.abs(t),Math.abs(e))}function w(){var t=new p(4);return p!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function M(t){var e=new p(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function x(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function _(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function S(t,e,r,n){var i=new p(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function P(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function A(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function O(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*s-i*n;return o?(o=1/o,t[0]=s*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}function E(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function k(t){return t[0]*t[3]-t[2]*t[1]}function I(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*a+s*h,t[1]=i*a+o*h,t[2]=n*u+s*c,t[3]=i*u+o*c,t}function C(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+s*a,t[1]=i*h+o*a,t[2]=n*-a+s*h,t[3]=i*-a+o*h,t}function B(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1];return t[0]=n*a,t[1]=i*a,t[2]=s*h,t[3]=o*h,t}function R(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function T(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function L(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function F(t){return Math.hypot(t[0],t[1],t[2],t[3])}function j(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function D(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function z(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function q(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function N(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=e[0],a=e[1],h=e[2],u=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-h)<=d*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-u)<=d*Math.max(1,Math.abs(s),Math.abs(u))}function U(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Y(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var V=I,Z=z;function G(){var t=new p(6);return p!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function $(t){var e=new p(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function X(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function H(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function W(t,e,r,n,i,s){var o=new p(6);return o[0]=t,o[1]=e,o[2]=r,o[3]=n,o[4]=i,o[5]=s,o}function J(t,e,r,n,i,s,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t}function Q(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=r*s-n*i;return h?(h=1/h,t[0]=s*h,t[1]=-n*h,t[2]=-i*h,t[3]=r*h,t[4]=(i*a-s*o)*h,t[5]=(n*o-r*a)*h,t):null}function K(t){return t[0]*t[3]-t[1]*t[2]}function tt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1],l=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*u+s*c,t[1]=i*u+o*c,t[2]=n*l+s*f,t[3]=i*l+o*f,t[4]=n*d+s*p+a,t[5]=i*d+o*p+h,t}function et(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*u,t[1]=i*c+o*u,t[2]=n*-u+s*c,t[3]=i*-u+o*c,t[4]=a,t[5]=h,t}function rt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1];return t[0]=n*u,t[1]=i*u,t[2]=s*c,t[3]=o*c,t[4]=a,t[5]=h,t}function nt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=n*u+s*c+a,t[5]=i*u+o*c+h,t}function it(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function st(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function ot(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function at(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function ht(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function ut(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function ct(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function lt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function ft(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function dt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function pt(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],h=e[0],u=e[1],c=e[2],l=e[3],f=e[4],p=e[5];return Math.abs(r-h)<=d*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(n-u)<=d*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(i-c)<=d*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(s-l)<=d*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(o-f)<=d*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-p)<=d*Math.max(1,Math.abs(a),Math.abs(p))}var mt=tt,gt=ct;function vt(){var t=new p(9);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function bt(t){var e=new p(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function wt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Mt(t,e,r,n,i,s,o,a,h){var u=new p(9);return u[0]=t,u[1]=e,u[2]=r,u[3]=n,u[4]=i,u[5]=s,u[6]=o,u[7]=a,u[8]=h,u}function xt(t,e,r,n,i,s,o,a,h,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t}function _t(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function St(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function Pt(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=c*o-a*u,f=-c*s+a*h,d=u*s-o*h,p=r*l+n*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-c*n+i*u)*p,t[2]=(a*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*h)*p,t[5]=(-a*r+i*s)*p,t[6]=d*p,t[7]=(-u*r+n*h)*p,t[8]=(o*r-n*s)*p,t):null}function At(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8];return t[0]=o*c-a*u,t[1]=i*u-n*c,t[2]=n*a-i*o,t[3]=a*h-s*c,t[4]=r*c-i*h,t[5]=i*s-r*a,t[6]=s*u-o*h,t[7]=n*h-r*u,t[8]=r*o-n*s,t}function Ot(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],h=t[7],u=t[8];return e*(u*s-o*h)+r*(-u*i+o*a)+n*(h*i-s*a)}function Et(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=r[0],d=r[1],p=r[2],m=r[3],g=r[4],v=r[5],y=r[6],b=r[7],w=r[8];return t[0]=f*n+d*o+p*u,t[1]=f*i+d*a+p*c,t[2]=f*s+d*h+p*l,t[3]=m*n+g*o+v*u,t[4]=m*i+g*a+v*c,t[5]=m*s+g*h+v*l,t[6]=y*n+b*o+w*u,t[7]=y*i+b*a+w*c,t[8]=y*s+b*h+w*l,t}function kt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=h,t[6]=f*n+d*o+u,t[7]=f*i+d*a+c,t[8]=f*s+d*h+l,t}function It(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*a,t[2]=d*s+f*h,t[3]=d*o-f*n,t[4]=d*a-f*i,t[5]=d*h-f*s,t[6]=u,t[7]=c,t[8]=l,t}function Ct(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Bt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function Rt(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Tt(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Lt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function Ft(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,h=i+i,u=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*h,m=s*o,g=s*a,v=s*h;return t[0]=1-l-p,t[3]=c-v,t[6]=f+g,t[1]=c+v,t[4]=1-u-p,t[7]=d-m,t[2]=f-g,t[5]=d+m,t[8]=1-u-l,t}function jt(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*h-i*o,w=r*u-s*o,M=n*h-i*a,x=n*u-s*a,_=i*u-s*h,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,O=l*g-f*m,E=l*v-d*m,k=f*v-d*g,I=y*k-b*E+w*O+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-h*E+u*O)*I,t[1]=(h*A-o*k-u*P)*I,t[2]=(o*E-a*A+u*S)*I,t[3]=(i*E-n*k-s*O)*I,t[4]=(r*k-i*A+s*P)*I,t[5]=(n*A-r*E-s*S)*I,t[6]=(m*_-g*x+v*M)*I,t[7]=(g*w-p*_-v*b)*I,t[8]=(p*x-m*w+v*y)*I,t):null}function Dt(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function zt(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function qt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Nt(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function Ut(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function Yt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function Vt(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function Zt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function Gt(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],h=t[6],u=t[7],c=t[8],l=e[0],f=e[1],p=e[2],m=e[3],g=e[4],v=e[5],y=e[6],b=e[7],w=e[8];return Math.abs(r-l)<=d*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(n-f)<=d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-p)<=d*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(s-m)<=d*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(o-g)<=d*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(a-v)<=d*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(h-y)<=d*Math.max(1,Math.abs(h),Math.abs(y))&&Math.abs(u-b)<=d*Math.max(1,Math.abs(u),Math.abs(b))&&Math.abs(c-w)<=d*Math.max(1,Math.abs(c),Math.abs(w))}var $t=Et,Xt=Ut;function Ht(){var t=new p(16);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Wt(t){var e=new p(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Jt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Qt(t,e,r,n,i,s,o,a,h,u,c,l,f,d,m,g){var v=new p(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=n,v[4]=i,v[5]=s,v[6]=o,v[7]=a,v[8]=h,v[9]=u,v[10]=c,v[11]=l,v[12]=f,v[13]=d,v[14]=m,v[15]=g,v}function Kt(t,e,r,n,i,s,o,a,h,u,c,l,f,d,p,m,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t[9]=c,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=g,t}function te(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ee(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=i,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function re(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*h-i*o,w=r*u-s*o,M=n*h-i*a,x=n*u-s*a,_=i*u-s*h,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,O=l*g-f*m,E=l*v-d*m,k=f*v-d*g,I=y*k-b*E+w*O+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-h*E+u*O)*I,t[1]=(i*E-n*k-s*O)*I,t[2]=(m*_-g*x+v*M)*I,t[3]=(f*x-l*_-d*M)*I,t[4]=(h*A-o*k-u*P)*I,t[5]=(r*k-i*A+s*P)*I,t[6]=(g*w-p*_-v*b)*I,t[7]=(c*_-f*w+d*b)*I,t[8]=(o*E-a*A+u*S)*I,t[9]=(n*A-r*E-s*S)*I,t[10]=(p*x-m*w+v*y)*I,t[11]=(l*w-c*x-d*y)*I,t[12]=(a*P-o*O-h*S)*I,t[13]=(r*O-n*P+i*S)*I,t[14]=(m*b-p*M-g*y)*I,t[15]=(c*M-l*b+f*y)*I,t):null}function ne(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15];return t[0]=a*(f*v-d*g)-l*(h*v-u*g)+m*(h*d-u*f),t[1]=-(n*(f*v-d*g)-l*(i*v-s*g)+m*(i*d-s*f)),t[2]=n*(h*v-u*g)-a*(i*v-s*g)+m*(i*u-s*h),t[3]=-(n*(h*d-u*f)-a*(i*d-s*f)+l*(i*u-s*h)),t[4]=-(o*(f*v-d*g)-c*(h*v-u*g)+p*(h*d-u*f)),t[5]=r*(f*v-d*g)-c*(i*v-s*g)+p*(i*d-s*f),t[6]=-(r*(h*v-u*g)-o*(i*v-s*g)+p*(i*u-s*h)),t[7]=r*(h*d-u*f)-o*(i*d-s*f)+c*(i*u-s*h),t[8]=o*(l*v-d*m)-c*(a*v-u*m)+p*(a*d-u*l),t[9]=-(r*(l*v-d*m)-c*(n*v-s*m)+p*(n*d-s*l)),t[10]=r*(a*v-u*m)-o*(n*v-s*m)+p*(n*u-s*a),t[11]=-(r*(a*d-u*l)-o*(n*d-s*l)+c*(n*u-s*a)),t[12]=-(o*(l*g-f*m)-c*(a*g-h*m)+p*(a*f-h*l)),t[13]=r*(l*g-f*m)-c*(n*g-i*m)+p*(n*f-i*l),t[14]=-(r*(a*g-h*m)-o*(n*g-i*m)+p*(n*h-i*a)),t[15]=r*(a*f-h*l)-o*(n*f-i*l)+c*(n*h-i*a),t}function ie(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],h=t[7],u=t[8],c=t[9],l=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*s)*(l*g-f*m)-(e*a-n*s)*(c*g-f*p)+(e*h-i*s)*(c*m-l*p)+(r*a-n*o)*(u*g-f*d)-(r*h-i*o)*(u*m-l*d)+(n*h-i*a)*(u*p-c*d)}function se(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],v=e[14],y=e[15],b=r[0],w=r[1],M=r[2],x=r[3];return t[0]=b*n+w*a+M*l+x*m,t[1]=b*i+w*h+M*f+x*g,t[2]=b*s+w*u+M*d+x*v,t[3]=b*o+w*c+M*p+x*y,b=r[4],w=r[5],M=r[6],x=r[7],t[4]=b*n+w*a+M*l+x*m,t[5]=b*i+w*h+M*f+x*g,t[6]=b*s+w*u+M*d+x*v,t[7]=b*o+w*c+M*p+x*y,b=r[8],w=r[9],M=r[10],x=r[11],t[8]=b*n+w*a+M*l+x*m,t[9]=b*i+w*h+M*f+x*g,t[10]=b*s+w*u+M*d+x*v,t[11]=b*o+w*c+M*p+x*y,b=r[12],w=r[13],M=r[14],x=r[15],t[12]=b*n+w*a+M*l+x*m,t[13]=b*i+w*h+M*f+x*g,t[14]=b*s+w*u+M*d+x*v,t[15]=b*o+w*c+M*p+x*y,t}function oe(t,e,r){var n,i,s,o,a,h,u,c,l,f,d,p,m=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=h,t[6]=u,t[7]=c,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+a*g+l*v+e[12],t[13]=i*m+h*g+f*v+e[13],t[14]=s*m+u*g+d*v+e[14],t[15]=o*m+c*g+p*v+e[15]),t}function ae(t,e,r){var n=r[0],i=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function he(t,e,r,n){var i,s,o,a,h,u,c,l,f,p,m,g,v,y,b,w,M,x,_,S,P,A,O,E,k=n[0],I=n[1],C=n[2],B=Math.hypot(k,I,C);return B0?(r[0]=2*(a*o+c*n+h*s-u*i)/l,r[1]=2*(h*o+c*i+u*n-a*s)/l,r[2]=2*(u*o+c*s+a*i-h*n)/l):(r[0]=2*(a*o+c*n+h*s-u*i),r[1]=2*(h*o+c*i+u*n-a*s),r[2]=2*(u*o+c*s+a*i-h*n)),ye(t,e,r),t}function we(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Me(t,e){var r=e[0],n=e[1],i=e[2],s=e[4],o=e[5],a=e[6],h=e[8],u=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(s,o,a),t[2]=Math.hypot(h,u,c),t}function xe(t,e){var r=new p(3);Me(r,e);var n=1/r[0],i=1/r[1],s=1/r[2],o=e[0]*n,a=e[1]*i,h=e[2]*s,u=e[4]*n,c=e[5]*i,l=e[6]*s,f=e[8]*n,d=e[9]*i,m=e[10]*s,g=o+c+m,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(l-d)/v,t[1]=(f-h)/v,t[2]=(a-u)/v):o>c&&o>m?(v=2*Math.sqrt(1+o-c-m),t[3]=(l-d)/v,t[0]=.25*v,t[1]=(a+u)/v,t[2]=(f+h)/v):c>m?(v=2*Math.sqrt(1+c-o-m),t[3]=(f-h)/v,t[0]=(a+u)/v,t[1]=.25*v,t[2]=(l+d)/v):(v=2*Math.sqrt(1+m-o-c),t[3]=(a-u)/v,t[0]=(f+h)/v,t[1]=(l+d)/v,t[2]=.25*v),t}function _e(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3],h=i+i,u=s+s,c=o+o,l=i*h,f=i*u,d=i*c,p=s*u,m=s*c,g=o*c,v=a*h,y=a*u,b=a*c,w=n[0],M=n[1],x=n[2];return t[0]=(1-(p+g))*w,t[1]=(f+b)*w,t[2]=(d-y)*w,t[3]=0,t[4]=(f-b)*M,t[5]=(1-(l+g))*M,t[6]=(m+v)*M,t[7]=0,t[8]=(d+y)*x,t[9]=(m-v)*x,t[10]=(1-(l+p))*x,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function Se(t,e,r,n,i){var s=e[0],o=e[1],a=e[2],h=e[3],u=s+s,c=o+o,l=a+a,f=s*u,d=s*c,p=s*l,m=o*c,g=o*l,v=a*l,y=h*u,b=h*c,w=h*l,M=n[0],x=n[1],_=n[2],S=i[0],P=i[1],A=i[2],O=(1-(m+v))*M,E=(d+w)*M,k=(p-b)*M,I=(d-w)*x,C=(1-(f+v))*x,B=(g+y)*x,R=(p+b)*_,T=(g-y)*_,L=(1-(f+m))*_;return t[0]=O,t[1]=E,t[2]=k,t[3]=0,t[4]=I,t[5]=C,t[6]=B,t[7]=0,t[8]=R,t[9]=T,t[10]=L,t[11]=0,t[12]=r[0]+S-(O*S+I*P+R*A),t[13]=r[1]+P-(E*S+C*P+T*A),t[14]=r[2]+A-(k*S+B*P+L*A),t[15]=1,t}function Pe(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,h=i+i,u=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*h,m=s*o,g=s*a,v=s*h;return t[0]=1-l-p,t[1]=c+v,t[2]=f-g,t[3]=0,t[4]=c-v,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-u-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ae(t,e,r,n,i,s,o){var a=1/(r-e),h=1/(i-n),u=1/(s-o);return t[0]=2*s*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*h,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*h,t[10]=(o+s)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*u,t[15]=0,t}function Oe(t,e,r,n,i){var s,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(s=1/(n-i),t[10]=(i+n)*s,t[14]=2*i*n*s):(t[10]=-1,t[14]=-2*n),t}function Ee(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),h=2/(o+a),u=2/(i+s);return t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-a)*h*.5,t[9]=(i-s)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function ke(t,e,r,n,i,s,o){var a=1/(e-r),h=1/(n-i),u=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*h,t[14]=(o+s)*u,t[15]=1,t}function Ie(t,e,r,n){var i,s,o,a,h,u,c,l,f,p,m=e[0],g=e[1],v=e[2],y=n[0],b=n[1],w=n[2],M=r[0],x=r[1],_=r[2];return Math.abs(m-M)0&&(c*=d=1/Math.sqrt(d),l*=d,f*=d);var p=h*f-u*l,m=u*c-a*f,g=a*l-h*c;return(d=p*p+m*m+g*g)>0&&(p*=d=1/Math.sqrt(d),m*=d,g*=d),t[0]=p,t[1]=m,t[2]=g,t[3]=0,t[4]=l*g-f*m,t[5]=f*p-c*g,t[6]=c*m-l*p,t[7]=0,t[8]=c,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=s,t[14]=o,t[15]=1,t}function Be(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Re(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Te(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Le(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function Fe(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function je(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function De(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function ze(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],h=t[6],u=t[7],c=t[8],l=t[9],f=t[10],p=t[11],m=t[12],g=t[13],v=t[14],y=t[15],b=e[0],w=e[1],M=e[2],x=e[3],_=e[4],S=e[5],P=e[6],A=e[7],O=e[8],E=e[9],k=e[10],I=e[11],C=e[12],B=e[13],R=e[14],T=e[15];return Math.abs(r-b)<=d*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-w)<=d*Math.max(1,Math.abs(n),Math.abs(w))&&Math.abs(i-M)<=d*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(s-x)<=d*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(o-_)<=d*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(a-S)<=d*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(h-P)<=d*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(u-A)<=d*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(c-O)<=d*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(l-E)<=d*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(f-k)<=d*Math.max(1,Math.abs(f),Math.abs(k))&&Math.abs(p-I)<=d*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(m-C)<=d*Math.max(1,Math.abs(m),Math.abs(C))&&Math.abs(g-B)<=d*Math.max(1,Math.abs(g),Math.abs(B))&&Math.abs(v-R)<=d*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(y-T)<=d*Math.max(1,Math.abs(y),Math.abs(T))}var qe=se,Ne=Le;function Ue(){var t=new p(3);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ye(t){var e=new p(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Ve(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function Ze(t,e,r){var n=new p(3);return n[0]=t,n[1]=e,n[2]=r,n}function Ge(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function $e(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function Xe(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function He(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function We(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function Je(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function Qe(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Ke(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function tr(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function er(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function rr(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function nr(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function ir(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function sr(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function or(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function ar(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function hr(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function ur(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function cr(t,e){var r=e[0],n=e[1],i=e[2],s=r*r+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function lr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function fr(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],h=r[2];return t[0]=i*h-s*a,t[1]=s*o-n*h,t[2]=n*a-i*o,t}function dr(t,e,r,n){var i=e[0],s=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t}function pr(t,e,r,n,i,s){var o=s*s,a=o*(2*s-3)+1,h=o*(s-2)+s,u=o*(s-1),c=o*(3-2*s);return t[0]=e[0]*a+r[0]*h+n[0]*u+i[0]*c,t[1]=e[1]*a+r[1]*h+n[1]*u+i[1]*c,t[2]=e[2]*a+r[2]*h+n[2]*u+i[2]*c,t}function mr(t,e,r,n,i,s){var o=1-s,a=o*o,h=s*s,u=a*o,c=3*s*a,l=3*h*o,f=h*s;return t[0]=e[0]*u+r[0]*c+n[0]*l+i[0]*f,t[1]=e[1]*u+r[1]*c+n[1]*l+i[1]*f,t[2]=e[2]*u+r[2]*c+n[2]*l+i[2]*f,t}function gr(t,e){e=e||1;var r=2*m()*Math.PI,n=2*m()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}function vr(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[3]*n+r[7]*i+r[11]*s+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*s+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*s+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*s+r[14])/o,t}function yr(t,e,r){var n=e[0],i=e[1],s=e[2];return t[0]=n*r[0]+i*r[3]+s*r[6],t[1]=n*r[1]+i*r[4]+s*r[7],t[2]=n*r[2]+i*r[5]+s*r[8],t}function br(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],h=e[1],u=e[2],c=i*u-s*h,l=s*a-n*u,f=n*h-i*a,d=i*f-s*l,p=s*c-n*f,m=n*l-i*c,g=2*o;return c*=g,l*=g,f*=g,d*=2,p*=2,m*=2,t[0]=a+c+d,t[1]=h+l+p,t[2]=u+f+m,t}function wr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0],s[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),s[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function Mr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),s[1]=i[1],s[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function xr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),s[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),s[2]=i[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function _r(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2],h=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(s*s+o*o+a*a),u=h&&lr(t,e)/h;return Math.acos(Math.min(Math.max(u,-1),1))}function Sr(t){return t[0]=0,t[1]=0,t[2]=0,t}function Pr(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function Ar(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Or(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2];return Math.abs(r-s)<=d*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-o)<=d*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=d*Math.max(1,Math.abs(i),Math.abs(a))}var Er,kr=He,Ir=We,Cr=Je,Br=sr,Rr=or,Tr=Ve,Lr=ar,Fr=(Er=Ue(),function(t,e,r,n,i,s){var o,a;for(e||(e=3),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=s*o,t}function an(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function hn(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],s=r[0]*n[2]-r[2]*n[0],o=r[0]*n[3]-r[3]*n[0],a=r[1]*n[2]-r[2]*n[1],h=r[1]*n[3]-r[3]*n[1],u=r[2]*n[3]-r[3]*n[2],c=e[0],l=e[1],f=e[2],d=e[3];return t[0]=l*u-f*h+d*a,t[1]=-c*u+f*o-d*s,t[2]=c*h-l*o+d*i,t[3]=-c*a+l*s-f*i,t}function un(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t[3]=a+n*(r[3]-a),t}function cn(t,e){var r,n,i,s,o,a;e=e||1;do{o=(r=2*m()-1)*r+(n=2*m()-1)*n}while(o>=1);do{a=(i=2*m()-1)*i+(s=2*m()-1)*s}while(a>=1);var h=Math.sqrt((1-o)/a);return t[0]=e*r,t[1]=e*n,t[2]=e*i*h,t[3]=e*s*h,t}function ln(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*s+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*s+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*s+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*s+r[15]*o,t}function fn(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],h=r[2],u=r[3],c=u*n+a*s-h*i,l=u*i+h*n-o*s,f=u*s+o*i-a*n,d=-o*n-a*i-h*s;return t[0]=c*u+d*-o+l*-h-f*-a,t[1]=l*u+d*-a+f*-o-c*-h,t[2]=f*u+d*-h+c*-a-l*-o,t[3]=e[3],t}function dn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function pn(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function mn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function gn(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=e[0],a=e[1],h=e[2],u=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-h)<=d*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-u)<=d*Math.max(1,Math.abs(s),Math.abs(u))}var vn=Yr,yn=Vr,bn=Zr,wn=Kr,Mn=tn,xn=en,_n=rn,Sn=function(){var t=jr();return function(e,r,n,i,s,o){var a,h;for(r||(r=4),n||(n=0),h=i?Math.min(i*r+n,e.length):e.length,a=n;ad?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r}function kn(t,e){var r=ii(t,e);return Math.acos(2*r*r-1)}function In(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*c+o*a+i*u-s*h,t[1]=i*c+o*h+s*a-n*u,t[2]=s*c+o*u+n*h-i*a,t[3]=o*c-n*a-i*h-s*u,t}function Cn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+o*a,t[1]=i*h+s*a,t[2]=s*h-i*a,t[3]=o*h-n*a,t}function Bn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h-s*a,t[1]=i*h+o*a,t[2]=s*h+n*a,t[3]=o*h-i*a,t}function Rn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+i*a,t[1]=i*h-n*a,t[2]=s*h+o*a,t[3]=o*h-s*a,t}function Tn(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function Ln(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=Math.exp(s),h=o>0?a*Math.sin(o)/o:0;return t[0]=r*h,t[1]=n*h,t[2]=i*h,t[3]=a*Math.cos(o),t}function Fn(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=o>0?Math.atan2(o,s)/o:0;return t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=.5*Math.log(r*r+n*n+i*i+s*s),t}function jn(t,e,r){return Fn(t,e),ni(t,t,r),Ln(t,t),t}function Dn(t,e,r,n){var i,s,o,a,h,u=e[0],c=e[1],l=e[2],f=e[3],p=r[0],m=r[1],g=r[2],v=r[3];return(s=u*p+c*m+l*g+f*v)<0&&(s=-s,p=-p,m=-m,g=-g,v=-v),1-s>d?(i=Math.acos(s),o=Math.sin(i),a=Math.sin((1-n)*i)/o,h=Math.sin(n*i)/o):(a=1-n,h=n),t[0]=a*u+h*p,t[1]=a*c+h*m,t[2]=a*l+h*g,t[3]=a*f+h*v,t}function zn(t){var e=m(),r=m(),n=m(),i=Math.sqrt(1-e),s=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*r),t[1]=i*Math.cos(2*Math.PI*r),t[2]=s*Math.sin(2*Math.PI*n),t[3]=s*Math.cos(2*Math.PI*n),t}function qn(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s,a=o?1/o:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=s*a,t}function Nn(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Un(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var s=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*s+s]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*s+o]-e[3*o+s])*r,t[s]=(e[3*s+i]+e[3*i+s])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t}function Yn(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var s=Math.sin(e),o=Math.cos(e),a=Math.sin(r),h=Math.cos(r),u=Math.sin(n),c=Math.cos(n);return t[0]=s*h*c-o*a*u,t[1]=o*a*c+s*h*u,t[2]=o*h*u-s*a*c,t[3]=o*h*c+s*a*u,t}function Vn(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var Zn,Gn,$n,Xn,Hn,Wn,Jn=Dr,Qn=zr,Kn=qr,ti=Nr,ei=Ur,ri=In,ni=Jr,ii=an,si=un,oi=en,ai=oi,hi=rn,ui=hi,ci=on,li=mn,fi=gn,di=(Zn=Ue(),Gn=Ze(1,0,0),$n=Ze(0,1,0),function(t,e,r){var n=lr(e,r);return n<-.999999?(fr(Zn,Gn,e),Tr(Zn)<1e-6&&fr(Zn,$n,e),cr(Zn,Zn),On(t,Zn,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(fr(Zn,e,r),t[0]=Zn[0],t[1]=Zn[1],t[2]=Zn[2],t[3]=1+n,ci(t,t))}),pi=(Xn=Pn(),Hn=Pn(),function(t,e,r,n,i,s){return Dn(Xn,e,i,s),Dn(Hn,r,n,s),Dn(t,Xn,Hn,2*s*(1-s)),t}),mi=(Wn=vt(),function(t,e,r,n){return Wn[0]=r[0],Wn[3]=r[1],Wn[6]=r[2],Wn[1]=n[0],Wn[4]=n[1],Wn[7]=n[2],Wn[2]=-e[0],Wn[5]=-e[1],Wn[8]=-e[2],ci(t,Un(t,Wn))});function gi(){var t=new p(8);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function vi(t){var e=new p(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function yi(t,e,r,n,i,s,o,a){var h=new p(8);return h[0]=t,h[1]=e,h[2]=r,h[3]=n,h[4]=i,h[5]=s,h[6]=o,h[7]=a,h}function bi(t,e,r,n,i,s,o){var a=new p(8);a[0]=t,a[1]=e,a[2]=r,a[3]=n;var h=.5*i,u=.5*s,c=.5*o;return a[4]=h*n+u*r-c*e,a[5]=u*n+c*t-h*r,a[6]=c*n+h*e-u*t,a[7]=-h*t-u*e-c*r,a}function wi(t,e,r){var n=.5*r[0],i=.5*r[1],s=.5*r[2],o=e[0],a=e[1],h=e[2],u=e[3];return t[0]=o,t[1]=a,t[2]=h,t[3]=u,t[4]=n*u+i*h-s*a,t[5]=i*u+s*o-n*h,t[6]=s*u+n*a-i*o,t[7]=-n*o-i*a-s*h,t}function Mi(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function xi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function _i(t,e){var r=Pn();xe(r,e);var n=new p(3);return we(n,e),wi(t,r,n),t}function Si(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function Pi(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Ai(t,e,r,n,i,s,o,a,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t}var Oi=Kn;function Ei(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var ki=Kn;function Ii(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function Ci(t,e){var r=e[4],n=e[5],i=e[6],s=e[7],o=-e[0],a=-e[1],h=-e[2],u=e[3];return t[0]=2*(r*u+s*o+n*h-i*a),t[1]=2*(n*u+s*a+i*o-r*h),t[2]=2*(i*u+s*h+r*a-n*o),t}function Bi(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=.5*r[0],h=.5*r[1],u=.5*r[2],c=e[4],l=e[5],f=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=o*a+i*u-s*h+c,t[5]=o*h+s*a-n*u+l,t[6]=o*u+n*h-i*a+f,t[7]=-n*a-i*h-s*u+d,t}function Ri(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=a*o+c*n+h*s-u*i,f=h*o+c*i+u*n-a*s,d=u*o+c*s+a*i-h*n,p=c*o-a*n-h*i-u*s;return Cn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Ti(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=a*o+c*n+h*s-u*i,f=h*o+c*i+u*n-a*s,d=u*o+c*s+a*i-h*n,p=c*o-a*n-h*i-u*s;return Bn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Li(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=a*o+c*n+h*s-u*i,f=h*o+c*i+u*n-a*s,d=u*o+c*s+a*i-h*n,p=c*o-a*n-h*i-u*s;return Rn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Fi(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],h=e[1],u=e[2],c=e[3];return t[0]=a*o+c*n+h*s-u*i,t[1]=h*o+c*i+u*n-a*s,t[2]=u*o+c*s+a*i-h*n,t[3]=c*o-a*n-h*i-u*s,a=e[4],h=e[5],u=e[6],c=e[7],t[4]=a*o+c*n+h*s-u*i,t[5]=h*o+c*i+u*n-a*s,t[6]=u*o+c*s+a*i-h*n,t[7]=c*o-a*n-h*i-u*s,t}function ji(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*c+o*a+i*u-s*h,t[1]=i*c+o*h+s*a-n*u,t[2]=s*c+o*u+n*h-i*a,t[3]=o*c-n*a-i*h-s*u,a=r[4],h=r[5],u=r[6],c=r[7],t[4]=n*c+o*a+i*u-s*h,t[5]=i*c+o*h+s*a-n*u,t[6]=s*c+o*u+n*h-i*a,t[7]=o*c-n*a-i*h-s*u,t}function Di(t,e,r,n){if(Math.abs(n)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,s=e[2]/r,o=e[3]/r,a=e[4],h=e[5],u=e[6],c=e[7],l=n*a+i*h+s*u+o*c;t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=(a-n*l)/r,t[5]=(h-i*l)/r,t[6]=(u-s*l)/r,t[7]=(c-o*l)/r}return t}function Qi(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function Ki(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function ts(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],h=t[6],u=t[7],c=e[0],l=e[1],f=e[2],p=e[3],m=e[4],g=e[5],v=e[6],y=e[7];return Math.abs(r-c)<=d*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(n-l)<=d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-f)<=d*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(s-p)<=d*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(o-m)<=d*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(a-g)<=d*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(h-v)<=d*Math.max(1,Math.abs(h),Math.abs(v))&&Math.abs(u-y)<=d*Math.max(1,Math.abs(u),Math.abs(y))}function es(){var t=new p(2);return p!=Float32Array&&(t[0]=0,t[1]=0),t}function rs(t){var e=new p(2);return e[0]=t[0],e[1]=t[1],e}function ns(t,e){var r=new p(2);return r[0]=t,r[1]=e,r}function is(t,e){return t[0]=e[0],t[1]=e[1],t}function ss(t,e,r){return t[0]=e,t[1]=r,t}function os(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function as(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function hs(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function us(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function cs(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function ls(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function fs(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function ds(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function ps(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function ms(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function gs(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function vs(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function ys(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function bs(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function ws(t){var e=t[0],r=t[1];return e*e+r*r}function Ms(t,e){return t[0]=-e[0],t[1]=-e[1],t}function xs(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function _s(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function Ss(t,e){return t[0]*e[0]+t[1]*e[1]}function Ps(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function As(t,e,r,n){var i=e[0],s=e[1];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t}function Os(t,e){e=e||1;var r=2*m()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function Es(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function ks(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function Is(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function Cs(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function Bs(t,e,r,n){var i=e[0]-r[0],s=e[1]-r[1],o=Math.sin(n),a=Math.cos(n);return t[0]=i*a-s*o+r[0],t[1]=i*o+s*a+r[1],t}function Rs(t,e){var r=t[0],n=t[1],i=e[0],s=e[1],o=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+s*s),a=o&&(r*i+n*s)/o;return Math.acos(Math.min(Math.max(a,-1),1))}function Ts(t){return t[0]=0,t[1]=0,t}function Ls(t){return"vec2("+t[0]+", "+t[1]+")"}function Fs(t,e){return t[0]===e[0]&&t[1]===e[1]}function js(t,e){var r=t[0],n=t[1],i=e[0],s=e[1];return Math.abs(r-i)<=d*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))}var Ds=bs,zs=as,qs=hs,Ns=us,Us=vs,Ys=ys,Vs=ws,Zs=function(){var t=es();return function(e,r,n,i,s,o){var a,h;for(r||(r=2),n||(n=0),h=i?Math.min(i*r+n,e.length):e.length,a=n;a{var n;!function(){var i=.5*(Math.sqrt(3)-1),s=(3-Math.sqrt(3))/6,o=1/6,a=(Math.sqrt(5)-1)/4,h=(5-Math.sqrt(5))/20;function u(t){var e;e="function"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=l();t=i(" "),e=i(" "),r=i(" ");for(var s=0;s>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}u.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,o=this.permMod12,a=this.perm,h=this.grad3,u=0,c=0,l=0,f=(t+e)*i,d=Math.floor(t+f),p=Math.floor(e+f),m=(d+p)*s,g=t-(d-m),v=e-(p-m);g>v?(r=1,n=0):(r=0,n=1);var y=g-r+s,b=v-n+s,w=g-1+2*s,M=v-1+2*s,x=255&d,_=255&p,S=.5-g*g-v*v;if(S>=0){var P=3*o[x+a[_]];u=(S*=S)*S*(h[P]*g+h[P+1]*v)}var A=.5-y*y-b*b;if(A>=0){var O=3*o[x+r+a[_+n]];c=(A*=A)*A*(h[O]*y+h[O+1]*b)}var E=.5-w*w-M*M;if(E>=0){var k=3*o[x+1+a[_+1]];l=(E*=E)*E*(h[k]*w+h[k+1]*M)}return 70*(u+c+l)},noise3D:function(t,e,r){var n,i,s,a,h,u,c,l,f,d,p=this.permMod12,m=this.perm,g=this.grad3,v=.3333333333333333*(t+e+r),y=Math.floor(t+v),b=Math.floor(e+v),w=Math.floor(r+v),M=(y+b+w)*o,x=t-(y-M),_=e-(b-M),S=r-(w-M);x>=_?_>=S?(h=1,u=0,c=0,l=1,f=1,d=0):x>=S?(h=1,u=0,c=0,l=1,f=0,d=1):(h=0,u=0,c=1,l=1,f=0,d=1):_B?L++:F++,C>R?L++:j++,C>T?L++:D++,B>R?F++:j++,B>T?F++:D++,R>T?j++:D++;var z=C-(l=L>=3?1:0)+h,q=B-(f=F>=3?1:0)+h,N=R-(d=j>=3?1:0)+h,U=T-(p=D>=3?1:0)+h,Y=C-(m=L>=2?1:0)+2*h,V=B-(g=F>=2?1:0)+2*h,Z=R-(v=j>=2?1:0)+2*h,G=T-(y=D>=2?1:0)+2*h,$=C-(b=L>=1?1:0)+3*h,X=B-(w=F>=1?1:0)+3*h,H=R-(M=j>=1?1:0)+3*h,W=T-(x=D>=1?1:0)+3*h,J=C-1+4*h,Q=B-1+4*h,K=R-1+4*h,tt=T-1+4*h,et=255&A,rt=255&O,nt=255&E,it=255&k,st=.6-C*C-B*B-R*R-T*T;if(st<0)i=0;else{var ot=_[et+_[rt+_[nt+_[it]]]]%32*4;i=(st*=st)*st*(S[ot]*C+S[ot+1]*B+S[ot+2]*R+S[ot+3]*T)}var at=.6-z*z-q*q-N*N-U*U;if(at<0)s=0;else{var ht=_[et+l+_[rt+f+_[nt+d+_[it+p]]]]%32*4;s=(at*=at)*at*(S[ht]*z+S[ht+1]*q+S[ht+2]*N+S[ht+3]*U)}var ut=.6-Y*Y-V*V-Z*Z-G*G;if(ut<0)o=0;else{var ct=_[et+m+_[rt+g+_[nt+v+_[it+y]]]]%32*4;o=(ut*=ut)*ut*(S[ct]*Y+S[ct+1]*V+S[ct+2]*Z+S[ct+3]*G)}var lt=.6-$*$-X*X-H*H-W*W;if(lt<0)u=0;else{var ft=_[et+b+_[rt+w+_[nt+M+_[it+x]]]]%32*4;u=(lt*=lt)*lt*(S[ft]*$+S[ft+1]*X+S[ft+2]*H+S[ft+3]*W)}var dt=.6-J*J-Q*Q-K*K-tt*tt;if(dt<0)c=0;else{var pt=_[et+1+_[rt+1+_[nt+1+_[it+1]]]]%32*4;c=(dt*=dt)*dt*(S[pt]*J+S[pt+1]*Q+S[pt+2]*K+S[pt+3]*tt)}return 27*(i+s+o+u+c)}},u._buildPermutationTable=c,void 0===(n=function(){return u}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=u,t.exports=u}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(915)})()},2513:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Group=void 0;const n=r(1378),i=r(541),s=r(2648),o=r(5511);class a extends i.SceneChild{constructor(t={}){t.type="Group",super(t),this.children=[],["id","name","data","order","type"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=o.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){"object"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=a},1378:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Scene=void 0;const n=r(541),i=r(2513),s=r(6448),o=r(313);class a{constructor(t={}){this.width=400,this.height=400,this.background="hsla(0, 0%, 0%, 1)",this.color="hsla(0, 0%, 100%, 1)",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?(.5+.5*o.clamp(-1,1,t.anchor[0]))*this.width:"left"===t.anchor[0]?0:"right"===t.anchor[0]?this.width:this.center[0],"number"==typeof t.anchor[1]?(.5+.5*o.clamp(-1,1,t.anchor[1]))*this.height:"top"===t.anchor[1]?0:"bottom"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e="number"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,a.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{a.propagateToChilden(t,e)})):t instanceof s.Shape&&t.shape&&(t.shape.scene=e,a.propagateToChilden(t.shape,e))}}e.Scene=a},541:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||"SceneChild",this.name=t.name||this.type+"_"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){"string"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},313:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(21),i=r(2769),s=r(795),o="undefined"!=typeof performance?performance:Date;function a(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return o.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=a,e.relativeClamp=function(t,e,r,n,i){return a(n,i,(r-t)/(e-t)*(i-n)+n)};const h={random:new n(Math.random)};e.noise=function(t="random",e=0,r=0,i=0){return void 0===h[t]&&(h[t]=new n(t)),h[t].noise3D(e,r,i)};const u={};function c(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),s=rn?[s,o]:[o,s]}function l(t,e){const r=t.length,n=r/2,i=2*(n+e),s=n-1;if(s>1){const n=r-2,o=Math.floor(e/s);let a=(i-(r+o*n))/2;const h=Math.round(s/a),u=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%h==0||e===n-2),p=o+(d?1:0),m=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);u[i]=(s=t(),o=t(),a=t(),h=t(),function(){let t=(s>>>=0)+(o>>>=0)|0;return s=o^o>>>9,o=(a>>>=0)+(a<<3)|0,t=t+(h=1+(h>>>=0)|0)|0,a=(a=a<<21|a>>>11)+t|0,(t>>>0)/4294967296})}var s,o,a,h;const c=e+u[i]()*(r-e);return void 0!==n?Math.round(c*10**n)/10**n:c},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return s.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=c,e.interpolate=function(t,e,r=.5){const[n,i]=c(t,e),s=Math.max(n.length,i.length),o="number"==typeof r?[r]:r,a=s/2;if(o.length!==a){const t=o.length;for(let e=0;e{Object.defineProperty(e,"__esModule",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return"number"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},8721:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(887);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},3792:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},5511:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(9958);var i;!function(t){t[t.None=0]="None",t[t.Scale=2]="Scale",t[t.Center=4]="Center",t[t.Fill=8]="Fill"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn("[Urplfanze:Bounding] cannot sum bounding")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn("[Urplfanze:Bounding] cannot bind bounding")}};class s extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return s.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=s.getBounding(t));const o=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,a=e>=i.Center?r.cx:0,h=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{Object.defineProperty(e,"__esModule",{value:!0}),e.Close=void 0;const n=r(9958);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},1740:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Mirror=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let s=0;s{Object.defineProperty(e,"__esModule",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},3315:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Offset=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i},4660:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Smooth=void 0;const n=r(313),i=r(8301),s=r(9958);class o extends s.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Solidify=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const s=[],o=(e="number"==typeof e?[e]:e).length;let a,h,u=[[0,0],[0,0]],c=[[0,0],[0,0]];for(let r=0,l=0,f=t.length-2;r{Object.defineProperty(e,"__esModule",{value:!0}),e.Subdivide=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Modifiers=void 0;const n=r(5511),i=r(1740),s=r(4660),o=r(5838),a=r(5588),h=r(8301),u=r(3315),c={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:s.Smooth,Solidify:o.Solidify,Subdivide:a.Subdivide,Close:h.Close,Offset:u.Offset};e.Modifiers=c},6448:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=void 0;const n=r(1378),i=r(541),s=r(2648);class o extends s.ShapeBase{constructor(t){t.type=t.type||"Shape",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn("[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\nYou passed:",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):o.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBase=void 0;const n=r(887),i=r(3757),s=r(8721),o=r(795),a=r(3792),h=r(5511),u=r(313),c=r(541),l=n.mat4.create(),f=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class m extends c.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?-1*u.clamp(-1,1,t.anchor[0]):"left"===t.anchor[0]?1:"right"===t.anchor[0]?-1:0,"number"==typeof t.anchor[1]?-1*u.clamp(-1,1,t.anchor[1]):"top"===t.anchor[1]?1:"bottom"===t.anchor[1]?-1:0]:[0,0],this.boundingType="string"==typeof t.boundingType?"relative"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return"function"!=typeof t.repetitions&&"function"!=typeof t.distance&&"function"!=typeof t.displace&&"function"!=typeof t.scale&&"function"!=typeof t.translate&&"function"!=typeof t.skewX&&"function"!=typeof t.skewY&&"function"!=typeof t.squeezeX&&"function"!=typeof t.squeezeY&&"function"!=typeof t.rotateX&&"function"!=typeof t.rotateY&&"function"!=typeof t.rotateZ&&"function"!=typeof t.transformOrigin&&"function"!=typeof t.perspective&&"function"!=typeof t.perspectiveOrigin}isStaticIndexed(){return"function"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return"function"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){"string"==typeof t?(r=r||"repetitions"==t,this.props[t]=e):(r=r||"repetitions"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var c,g;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const v=m.getEmptyPropArguments(this,r),y=v.repetition,b=this.getProp("repetitions",v,1),w=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,M=Array.isArray(b)?b[0]*(null!==(c=b[1])&&void 0!==c?c:b[0]):b,x=Array.isArray(b)?b[0]:M,_=Array.isArray(b)?null!==(g=b[1])&&void 0!==g?g:b[0]:1,S=y.row;S.count=x;const P=y.col;P.count=_,y.count=M,y.col.count=_,y.row.count=x,y.type=w;let A=0;const O=[];let E=0;const k=n.vec2.fromValues((_-1)/2,(x-1)/2),I=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],C=[void 0,void 0,void 0,void 0],B=[void 0,void 0,void 0,void 0];for(let r=0;r1?E/(M-1):1,y.angle=w===i.ERepetitionType.Ring?a.PI2/M*E:0,P.index=c+1,P.offset=_>1?c/(_-1):1,S.index=r+1,S.offset=x>1?r/(x-1):1;const m=this.generateBuffer(t,v),g=m.length,b=this.getShapeBounding();O[E]=new Float32Array(g),A+=g;{const t=s.toVec2(this.getProp("distance",v,s.VEC2_ZERO)),a=this.getProp("displace",v,0),M=s.toVec3(this.getProp("scale",v,s.VEC2_ONE),1),x=s.toVec3(this.getProp("translate",v,s.VEC2_ZERO),0),_=this.getProp("skewX",v,0),S=this.getProp("skewY",v,0),P=this.getProp("squeezeX",v,0),A=this.getProp("squeezeY",v,0),R=this.getProp("rotateX",v,0),T=this.getProp("rotateY",v,0),L=this.getProp("rotateZ",v,0),F=u.clamp(0,1,this.getProp("perspective",v,0)),j=s.toVec3(this.getProp("perspectiveOrigin",v,s.VEC2_ZERO),0),D=s.toVec3(this.getProp("transformOrigin",v,s.VEC2_ZERO),0);let z;switch(w){case i.ERepetitionType.Ring:z=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(z,z,s.VEC3_ZERO,y.angle+a);break;case i.ERepetitionType.Matrix:z=n.vec3.fromValues(t[1]*(c-k[0]),t[0]*(r-k[1]),0)}const q=F>0?Math.max(b.width,b.height)/2:1,N=F>0?q+10*q*(1-F):0,U=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==F||0!==D[0]||0!==D[1],Y=0!==j[0]||0!==j[1];U&&(this.boundingType===i.EBoundingType.Relative?(D[0]=D[0]*(b.width/2)+b.cx,D[1]=D[1]*(b.height/2)+b.cy):(D[0]*=b.width/2,D[1]*=b.height/2),D[2]=N);{n.mat4.identity(f),U&&n.mat4.translate(f,f,D),0===x[0]&&0===x[1]||n.mat4.translate(f,f,x),0===_&&0===S||(s.fromSkew(l,[_,S]),n.mat4.multiply(f,f,l)),0!==R&&n.mat4.rotateX(f,f,R),0!==T&&n.mat4.rotateY(f,f,T),0!==L&&n.mat4.rotateZ(f,f,L),1===M[0]&&1===M[1]||n.mat4.scale(f,f,M),U&&n.mat4.translate(f,f,n.vec3.scale(D,D,-1)),N>0&&(Y&&(this.boundingType===i.EBoundingType.Relative?(j[0]=j[0]*(b.width/2)+b.cx,j[1]=j[1]*(b.height/2)+b.cy):(j[0]*=b.width/2,j[1]*=b.height/2),j[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,z),e&&n.mat4.translate(p,p,I);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),w===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,y.angle+a)}h.Bounding.clear(B);for(let t=0;t0&&(Y&&n.vec3.add(e,e,j),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,N),Y&&n.vec3.sub(e,e,j)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=g/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,v)}O[E][t]=e[0],O[E][t+1]=e[1],h.Bounding.add(B,e[0],e[1]),h.Bounding.add(C,e[0],e[1])}}const R={cx:0,cy:0,x:-1,y:-1,width:2,height:2};h.Bounding.bind(R,B),this.bStaticIndexed&&this.bIndexed||this.addIndex(g,y,R)}h.Bounding.bind(this.bounding,C),this.buffer=new Float32Array(A);for(let t=0,e=0,r=O.length;t({index:1,offset:1,count:1}),m.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...m.getEmptySimpleRepetition(),row:m.getEmptySimpleRepetition(),col:m.getEmptySimpleRepetition()})},7439:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBuffer=void 0;const n=r(5511),i=r(3674);class s extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||"ShapeBuffer",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn("[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property"),this.shape=s.EMPTY_BUFFER):this.shape="function"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return"function"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from("function"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,s=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&"function"!=typeof this.props.sideLength&&"function"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=s},5382:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeFollow=void 0;const n=r(6448);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeFollow",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},s=this.shape;s.generate(t,!1,i);let o=s.getBuffer();const a=o.length,h=new Float32Array(a*(n.length/2)),u=n.length/2;for(let e=0;e1?e/(u-1):1,count:u};this.shapeUseFollow&&(i.follow=r,s.generate(t,!1,i),o=s.getBuffer());const c=e*a,l=2*e,f=n[l],d=n[l+1];for(let t=0,e=o.length;t1?t/(e-1):1;for(let o=0,a=s.length;o{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeLoop=void 0;const n=r(3792),i=r(5511),s=r(3674),o=r(2648);class a extends s.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||"ShapeLoop",super(t),this.loopDependencies=(t.loopDependencies||[]).concat("sideLength"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes("propArguments"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}"loop"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||o.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?("function"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),s=this.getRepetitionSideLength(t),o=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,a={index:0,offset:0,current:0,count:n},h=a.count,u=new Float32Array(2*h);for(let n=0,i=0;n1?n/(a.count-1):1;a.current=s,a.index=n+1,a.offset=h;const c=o(a,t);u[i]=c[0],u[i+1]=c[1]}const c=[void 0,void 0,void 0,void 0],l=this.applyModifiers(u,t);for(let t=0,e=l.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapePrimitive=void 0;const n=r(8721),i=r(2648),s=r(9958),o=r(5511);class a extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=o.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:"function"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return"function"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:"number"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp("sideLength",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeRecursive=void 0;const n=r(6448);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeRecursive",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionScale&&"function"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp("recursions",e,1)),n=Math.floor(this.getProp("recursionVertex",e,0)),s=this.getProp("recursionScale",e,2),o=this.shape;let a={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const h={...e,recursion:a};o.generate(t,!1,h);const u=o.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=u);let c=u;const l=[a];let f=0,d=1;const p=c.length,m=p/2,g=n<=0?m:Math.min(n,m),v=0===n?1:m/Math.min(n,m),y=new Float32Array(i.summmation(r,g)*p);for(let t=0;t1?e/(r-1):1,u=i.summmation(e,g)*p,m=e-1,b=0===m?0:i.summmation(m,g)*p;for(let i=0,m=g**e;i1?i/(m-1):1,count:m,level:{index:e+1,offset:n,count:r},parent:l[f]},l.push(a),this.shapeUseRecursion&&(h.recursion=a,o.generate(t,!1,h),c=o.getBuffer());const w=u+i*p,M=Math.floor(b+2*i*v),x=y[M],_=y[M+1],S=s**e;for(let t=0,e=p;t1?0:1,count:s}}},h=this.shape.getIndexedBuffer()||[];for(let t=0,e=h.length;t1?0:1,count:s}},i={...a,recursion:r},o=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:o})}if(s>1){const t=this.shape.getBufferLength({...i,parent:{...a}})/2,e=o<=0?t:Math.min(o,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let u=0,c=1;for(let t=1;t1?t/(s-1):1;for(let o=0,l=e**t;o1?o/(l-1):1;for(let d=0,p=h.length;d{Object.defineProperty(e,"__esModule",{value:!0}),e.Circle=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){t.type="Circle",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=s},6329:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Line=void 0;const n=r(5511),i=r(7439);class s extends i.ShapeBuffer{constructor(t={}){t.type="Line",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Lissajous=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){t.type="Lissajous",t.loopDependencies=(t.loopDependencies||[]).concat(["wx","wy","wz"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp("wx",t),r=this.getProp("wy",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),s=this.getRepetitionSideLength(t);return 1/Math.pow(s[0]*s[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp("wx",t,1),this.wy=this.getProp("wy",t,2),this.wz=this.getProp("wz",t,2),super.generateLoopBuffer(t)}}e.Lissajous=s},2982:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Polygon=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["sideNumber"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp("sideNumber",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=s},5510:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Rect=void 0;const n=r(5511),i=r(7439);class s extends i.ShapeBuffer{constructor(t={}){t.type="Rect",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=s,s.buffer=[1,1,-1,1,-1,-1,1,-1]},894:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Rose=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){var e,r;t.type="Rose",t.loopDependencies=(t.loopDependencies||[]).concat(["n","d"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>s.getFinalAngleFromK(this.getProp("n",t),this.getProp("d",t)),inc:t=>{const e=this.getProp("n",t),r=this.getProp("d",t),i=this.getRepetitionSideLength(t),s=Math.pow(i[0]*i[1],.45),o=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp("n",t)/this.getProp("d",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=s},5719:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Spiral=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type="Spiral",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat(["twists","twistsStart","spiral"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:s.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp("twistsStart",t),end:t=>n.PI2*(this.getProp("twistsStart",t)+this.getProp("twists",t)),inc:t=>{const e=this.getProp("twists",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp("spiral",t),this.r=s.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case s.types.ARCHIMEDE:return t=>t/10;case s.types.HYPERBOLIC:return t=>1/t*3;case s.types.FERMAT:return t=>t**.5/3;case s.types.LITUUS:return t=>t**-.5;case s.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=s,s.types={ARCHIMEDE:"ARCHIMEDE",HYPERBOLIC:"HYPERBOLIC",FERMAT:"FERMAT",LITUUS:"LITUUS",LOGARITHMIC:"LOGARITHMIC"}},9667:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Star=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["spikes","innerRadius"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp("spikes",t,5),this.innerRadius=this.getProp("innerRadius",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=s},3977:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SuperShape=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){var e,r,i,s,o,a;t.type="SuperShape",t.loopDependencies=(t.loopDependencies||[]).concat(["a","b","m","n1","n2","n3"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(s=t.n1)&&void 0!==s?s:1,this.props.n2=null!==(o=t.n2)&&void 0!==o?o:1,this.props.n3=null!==(a=t.n3)&&void 0!==a?a:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp("a",t),this.b=this.getProp("b",t),this.m=this.getProp("m",t),this.n1=this.getProp("n1",t),this.n2=this.getProp("n2",t),this.n3=this.getProp("n3",t),super.generateLoopBuffer(t)}}e.SuperShape=s},4233:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Triangle=void 0;const n=r(5511),i=r(7439);class s extends i.ShapeBuffer{constructor(t={}){t.type="Triangle",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=s,s.buffer=[1,0,-1,1,-1,-1]},3757:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(7678),e),i(r(7066),e),i(r(2769),e),i(r(7266),e),i(r(3647),e),i(r(4526),e),i(r(1618),e),i(r(6787),e)},7678:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},7066:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2769:(t,e)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]="Ring",r[r.Matrix=2]="Matrix"},7266:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},3647:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4526:(t,e)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]="Relative",r[r.Fixed=2]="Fixed"},1618:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6787:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},9962:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DrawerCanvas=void 0;const n=r(7358),i=r(313),s=r(3792),o=r(795),a=r(292),h=r(1189),u=r(8909),c=r(9724);class l extends h.Emitter{constructor(t,e,r,n=6e4,i=60){var s,o,a,h,l;super(),this.drawerOptions={width:(null==r?void 0:r.width)||(null==t?void 0:t.width)||400,height:(null==r?void 0:r.height)||(null==t?void 0:t.height)||400,clear:null===(s=null==r?void 0:r.clear)||void 0===s||s,time:null!==(o=null==r?void 0:r.time)&&void 0!==o?o:0,simmetricLines:null!==(a=null==r?void 0:r.simmetricLines)&&void 0!==a?a:0,noBackground:null!==(h=null==r?void 0:r.noBackground)&&void 0!==h&&h,ghosts:(null==r?void 0:r.ghosts)||0,ghostAlpha:!1!==(null==r?void 0:r.ghostAlpha),ghostSkipTime:null!==(l=null==r?void 0:r.ghostSkipTime)&&void 0!==l?l:30,ghostSkipFunction:null==r?void 0:r.ghostSkipFunction,sceneFit:(null==r?void 0:r.sceneFit)||"contain",backgroundImage:null==r?void 0:r.backgroundImage,backgroundImageFit:(null==r?void 0:r.backgroundImageFit)||"cover"},this.timeline=new u.Timeline(n,i),this.timeline.setTime(this.drawerOptions.time),this.draw_id=null,this.redraw_id=null,this.animation_id=null,t&&this.setScene(t),(!c.bWorker||c.bWorker&&e instanceof OffscreenCanvas)&&this.setCanvas(e)}getOption(t,e){var r;return null!==(r=this.drawerOptions[t])&&void 0!==r?r:e}setCanvas(t){if(c.bWorker)t instanceof OffscreenCanvas?this.canvas=t:console.error("Cannot set cavas");else if(c.bBrowser){const e=a.createCanvas(this.drawerOptions.width,this.drawerOptions.height);if(t instanceof HTMLElement&&!(t instanceof HTMLCanvasElement||t instanceof OffscreenCanvas)){for(this.canvas=e;t.lastChild;)t.removeChild(t.lastChild);t.appendChild(e)}else this.canvas=void 0===t?e:t}else this.canvas=a.createCanvas(this.drawerOptions.width,this.drawerOptions.height);this.canvas&&(this.canvas.width=this.drawerOptions.width,this.canvas.height=this.drawerOptions.height,this.context=this.canvas.getContext("2d",{alpha:!0}))}getCanvas(){return this.canvas}setScene(t){this.scene=t}draw(){if(null===this.context||void 0===this.scene)return 0;const t=i.now(),e=this.timeline,r=e.getTime(),n={...this.drawerOptions,ghostIndex:void 0,clear:this.drawerOptions.clear||e.getCurrentFrame()<=1,time:r},o=e.getFrameAtTime(r);if(this.dispatch("drawer-canvas:before_draw",{currentFrame:o,currentTime:r}),n.simmetricLines>0&&(n.clear&&l.clear(this.context,n.width,n.height,!n.noBackground&&this.scene.background,n.backgroundImage,n.backgroundImageFit),l.drawSimmetricLines(this.context,n.simmetricLines,n.width,n.height,this.scene.color),n.clear=!1),n.ghosts){const t={...n},r=e.getTime(),i=e.getDuration(),o={offset:0,index:0,count:n.ghosts};for(let e=1;e<=n.ghosts;e++){o.index=e,o.offset=o.index/o.count;const a=r-(n.ghostSkipFunction?n.ghostSkipFunction(o,r):e*n.ghostSkipTime);t.ghostIndex=e,t.time=s.mod(a,i),t.clear=n.clear&&1===t.ghostIndex,this.realDraw(t)}n.clear=!1}return this.realDraw(n),i.now()-t}realDraw(t){var e;const r=this.drawerOptions.width,n=this.drawerOptions.height,i=this.context,s=this.scene,o=null!==(e=t.time)&&void 0!==e?e:0,a=void 0!==t.ghosts&&t.ghosts>0&&void 0!==t.ghostIndex&&t.ghostIndex>0,h=a?1-t.ghostIndex/(t.ghosts+.5):0,u=!0===t.ghostAlpha,f=c.fit(s.width,s.height,r,n,this.drawerOptions.sceneFit),d=f.x,p=f.y;t.clear&&l.clear(i,r,n,!t.noBackground&&s.background,t.backgroundImage,t.backgroundImageFit);let m=!1,g=!1;s.currentTime=o;const v=s.getChildren();for(let t=0,e=v.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=void 0,e.Emitter=class{constructor(){this.callbacks={}}attach(t,e){t in this.callbacks||(this.callbacks[t]=[]),this.callbacks[t].push(e)}detach(t,e){if(t in this.callbacks){const r=this.callbacks[t].indexOf(e);r>=0&&this.callbacks[t].splice(r,1)}}dispatch(t,e){if(t in this.callbacks&&this.callbacks[t].length>0)for(let r=0,n=this.callbacks[t].length;r{Object.defineProperty(e,"__esModule",{value:!0}),e.Renderer=void 0;const n=r(5045),i=r(313),s=r(5733),o=r(6151),a=r(1189),h=r(9724);class u extends a.Emitter{constructor(t,e){super(),this.drawer=t,this.ffmpegCorePath=void 0===e&&t instanceof o.default?"https://unpkg.com/@ffmpeg/core@0.10.0/dist/ffmpeg-core.js":e}async zip(t="image/png",e=1,r=600){const n=i.now(),o=new s,a=this.drawer.timeline.getFramesCount(),u=Math.ceil(a/r);this.dispatch("renderer:zip_start",{chunks:u,totalFrames:a,framesForChunk:r});const c="image/jpeg"===t?".jpg":".png",l=[];let f=0;for(let s=0,d=1;s{r.toBlob((t=>{if(!t)throw new Error("Blob error");n(t)}),t,"number"==typeof e?e:1)}))}}e.Renderer=u},8909:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=void 0;const n=r(313),i=r(3792),s=r(1189);class o extends s.Emitter{constructor(t=6e4,e=30){super(),this.fps_samples_size=30,this.fps_samples=[],this.fps_samples_index=0,this.paused_time=0,this.sequence={duration:t,framerate:e,frames:Math.round(t/1e3*e)},this.tick_time=1e3/this.sequence.framerate,this.fps=this.sequence.framerate,this.b_sequence_started=!1,this.currentFrame=0,this.currentTime=0,this.last_tick=0,this.start_time=0}getSequence(){return{...this.sequence}}setSequence(t,e,r){this.sequence.duration=t,this.sequence.framerate=e,this.tick_time=1e3/this.sequence.framerate,this.sequence.frames=Math.round(this.sequence.duration/1e3*this.sequence.framerate),void 0!==r?this.setTime(r):this.dispatch("timeline:update_sequence",this.getSequence())}setDuration(t){this.setSequence(t,this.sequence.framerate)}getDuration(){return this.sequence.duration}getFramerate(){return this.sequence.framerate}setFramerate(t){this.setSequence(this.sequence.duration,t)}getFramesCount(){return this.sequence.frames}bSequenceStarted(){return this.b_sequence_started}start(){this.b_sequence_started||(this.b_sequence_started=!0,this.start_time=this.paused_time,this.dispatch("timeline:change_status",o.START))}pause(){this.b_sequence_started&&(this.paused_time=n.now(),this.b_sequence_started=!1,this.dispatch("timeline:change_status",o.PAUSE))}stop(){this.b_sequence_started&&(this.b_sequence_started=!1,this.currentTime=0,this.currentFrame=0,this.start_time=0,this.paused_time=0,this.dispatch("timeline:change_status",o.STOP))}tick(t){if(this.b_sequence_started){this.start_time||(this.start_time=t,this.last_tick=-this.tick_time);const e=t-this.start_time,r=e-this.last_tick;if(r>=this.tick_time)return this.calculateFPS(1/(r/1e3)),this.last_tick=e,this.currentTime=(e-r%this.tick_time)%this.sequence.duration,this.currentFrame=this.getFrameAtTime(this.currentTime),this.dispatch("timeline:progress",{currentFrame:this.currentFrame,currentTime:this.currentTime,fps:this.fps}),!0}return!1}calculateFPS(t){const e=this.fps_samples.length;if(e>0){let t=0;for(let r=0;r{Object.defineProperty(e,"__esModule",{value:!0}),e.BrowserDrawerCanvas=void 0;const n=r(9962),i=r(9724);class s extends n.DrawerCanvas{constructor(t,e,r,n=6e4,i=60){super(t,e,r,n,i),this.dpi=1,this.dpi=(null==r?void 0:r.dpi)||1,this.draw_id=null,this.redraw_id=null,this.animation_id=null,this.draw=this.draw.bind(this),this.animate=this.animate.bind(this),this.startAnimation=this.startAnimation.bind(this),this.resize(this.drawerOptions.width,this.drawerOptions.height)}resize(t,e,r,n=this.dpi){this.drawerOptions.width=t*n,this.drawerOptions.height=e*n,this.canvas&&(this.canvas.width=t*n,this.canvas.height=e*n,i.bBrowser&&this.canvas instanceof HTMLCanvasElement&&(this.canvas.style.width=t+"px",this.canvas.style.height=e+"px")),void 0!==r&&(this.drawerOptions.sceneFit=r),this.dispatch("drawer-canvas:resize")}animate(t){this.timeline.bSequenceStarted()&&(this.animation_id=requestAnimationFrame(this.animate),this.timeline.tick(t)&&this.draw())}startAnimation(){this.stopAnimation(),this.timeline.start(),this.animation_id=requestAnimationFrame(this.animate)}stopAnimation(){this.timeline.stop(),this.animation_id&&cancelAnimationFrame(this.animation_id)}pauseAnimation(){this.timeline.pause(),this.animation_id&&cancelAnimationFrame(this.animation_id)}playAnimation(){this.timeline.start(),requestAnimationFrame(this.animate)}redraw(){this.timeline.bSequenceStarted()?void 0!==typeof this.drawerOptions.ghosts&&0!==this.drawerOptions.ghosts||(this.stopAnimation(),this.redraw_id&&cancelAnimationFrame(this.redraw_id),this.redraw_id=requestAnimationFrame(this.startAnimation)):(this.draw_id&&cancelAnimationFrame(this.draw_id),void 0!==typeof this.drawerOptions.ghosts&&0!==this.drawerOptions.ghosts||this.timeline.stop(),this.draw_id=requestAnimationFrame(this.draw))}}e.BrowserDrawerCanvas=s},6151:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(8909),e),i(r(9962),e),i(r(4425),e),i(r(2251),e);const s=r(2251);e.default=s.BrowserDrawerCanvas},1532:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(8909),e),i(r(9962),e),i(r(2251),e),i(r(4425),e)},9724:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fit=e.bWorker=e.bBrowser=e.bNode=void 0,e.bNode="undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node,e.bBrowser="undefined"!=typeof window&&void 0!==window.document,e.bWorker="object"==typeof self&&["ServiceWorkerGlobalScope","DedicatedWorkerGlobalScope"].includes(self.constructor.name),e.fit=function(t,e,r,n,i="none"){let s=0,o=0,a=1,h=t,u=e;const c=r/n,l=t/e;return"contain"===i?(h=c>l?t*n/e:r,u=c>l?n:e*r/t,a=Math.max(h,u)/Math.max(t,e)):"cover"===i&&(h=c{Object.defineProperty(e,"__esModule",{value:!0}),e.GCODEExporter=void 0;const n=r(1172),i=r(6479),s=r(310);class o{static parse(t,e){const r={...o.defaults,...e};return o.generate(t,r).join("\n")}static setUnit(t){return"inches"===t?"G20":"G21"}static useRelativePosition(){return"G91"}static useAbsolutePosition(){return"G90"}static goHome(t){return[t,"G28 X0 Y0"]}static setCurrentMachinePosition(t,e,r){return`G28.1 X${s.round(t,r)} Y${s.round(e,r)}`}static setCurrentWorkspacePosition(t,e,r){return`G92 X${s.round(t,r)} Y${s.round(e,r)}`}static goTo(t,e,r,n){return void 0!==n?`G1 X${s.round(t,r)} Y${s.round(e,r)} F${n}`:`G0 X${s.round(t,r)} Y${s.round(e,r)}`}static moveTo(t,e,r,n,i){return[t,this.goTo(r,n,i),e]}static lineTo(t,e,r,n){return this.goTo(t,e,n,r)}static generate(t,e){const r=e.maxX-e.minX,a=e.maxY-e.minY,h=r/a,u=t.width/t.height,c=[h>u?t.width*a/t.height:r,h>u?a:t.height*r/t.width],l=[(r-c[0])/2,(a-c[1])/2],f=h>u?t.width/c[0]:t.height/c[1],d=[];s.concat(d,e.penUpCommand),s.concat(d,this.setUnit(e.unit)),s.concat(d,this.useAbsolutePosition()),s.concat(d,this.setCurrentMachinePosition(e.minX,e.minY,e.decimals)),s.concat(d,this.setCurrentWorkspacePosition(e.minX,e.minY,e.decimals));const p=t.getChildren();for(let t=0,r=p.length;t{Object.defineProperty(e,"__esModule",{value:!0})},310:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.concat=e.round=void 0,e.round=(t,e)=>Math.round(t*10**e)/10**e,e.concat=(t,e)=>{"string"==typeof e?t.push(e):e.forEach((e=>t.push(e)))}},2674:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SVGExporter=void 0;const n=r(9887);class i{static parse(t,e={}){const r={...i.defaults,...e};return i.generate(t,r)}static getSVGProp(t,e,r){let n=e.shape.drawer[t];return"function"==typeof n&&(n=n(e)),null!=n?n:r}static bindColorAttribute(t,e,r,i){if(void 0!==e)if("none"===e)r.push(`${t}="none"`);else{const s=n.parseColorAndConvert(e);s&&(1!==s.alpha&&i.push(`${t}-opacity: ${s.alpha}`),r.push(`${t}="${n.rgbToHex(s.r,s.g,s.b)}"`))}}static generate(t,e){const r=i.generatePaths(t,e);let n;if(e.background){const e=[],r=[];i.bindColorAttribute("fill",t.background,e,r),r.length>0&&e.push(`styles="${r.join("; ")}"`),n=``}return`\n\t\x3c!-- Create with Urpflanze --\x3e`+(n?`\n\t${n}`:"")+`\n\t${r.join("\n\t")}\n`}static generatePaths(t,e){const r=[],n=t.getChildren();for(let s=0,o=n.length;s0&&l.push(`style="${f.join("; ")}"`);const g=``;r.push(g)}}return r}}e.SVGExporter=i,i.defaults={decimals:3,background:!0}},7773:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(4105),e),i(r(2674),e)},4105:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5917:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.rgbToHsl=e.hslToRgb=e.rgbToHex=void 0,e.rgbToHex=function(t,e,r){return`#${((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}`},e.hslToRgb=function(t,e,r){let n,i,s;if(t/=360,r/=100,0==(e/=100))n=i=s=r;else{const o=(t,e,r)=>(r+=r<0?1:r>1?-1:0)<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,a=r<.5?r*(1+e):r+e-r*e,h=2*r-a;n=o(h,a,t+1/3),i=o(h,a,t),s=o(h,a,t-1/3)}return[.5+255*n<<0,.5+255*i<<0,.5+255*s<<0]},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;const n=Math.max(t,e,r),i=Math.min(t,e,r),s=(n+i)/2;let o,a;if(n===i)o=a=0;else{const h=n-i;switch(a=s>.5?h/(2-n-i):h/(n+i),n){case t:o=(e-r)/h+(e{Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.parseColorAndConvert=void 0;const n=r(5917);function i(t){if("number"==typeof t)return t>16777215?{type:"rgb",a:t>>24&255,b:t>>16&255,c:t>>8&255,alpha:(255&t)/255}:{type:"rgb",a:t>>16&255,b:t>>8&255,c:255&t,alpha:1};t=t.replace(/\s/g,"");let e=/^#([0-9a-f]{3,8})$/i.exec(t);if(e){const t=e[1];return 3===t.length?{type:"rgb",a:parseInt(t[0]+t[0],16),b:parseInt(t[1]+t[1],16),c:parseInt(t[2]+t[2],16),alpha:1}:{type:"rgb",a:parseInt(t[0]+t[1],16),b:parseInt(t[2]+t[3],16),c:parseInt(t[4]+t[5],16),alpha:t.length>6?parseInt(t.substring(6),16)/255:1}}if(e=/^((hsl|rgb)a?)\((\d+),(\d+)%?,(\d+)%?,?(.+)?\)$/i.exec(t),e){const[,,t,r,n,i,s]=e;return{type:t,a:+r,b:+n,c:+i,alpha:s?+s:1}}}e.parseColorAndConvert=function(t){const e=i(t);if(e){if("hsl"===e.type){const[t,r,i]=n.hslToRgb(e.a,e.b,e.c);return{r:t,g:r,b:i,h:e.a,s:e.b,l:e.c,alpha:e.alpha}}{const[t,r,i]=n.rgbToHsl(e.a,e.b,e.c);return{h:t,s:r,l:i,r:e.a,g:e.b,b:e.c,alpha:e.alpha}}}},e.parseColor=i},6073:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5052:t=>{window,t.exports=(()=>{var t={877:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SVGImporter=void 0;const n=r(500),i=r(688),s=r(926),o=r(926),a=r(479),h=r(721),u=r(197),c=r(825);class l{static isSVG(t){return l.SVG_REGEX.test(t.replace(l.COMMENT_REGEX,""))}static getWindowInstance(){return l.windowInstance}static setWindowInstance(t){l.windowInstance=t}static stringToSVG(t){if(t=t.trim(),!l.isSVG(t))return console.warn("[Urpflanze:SVGImport] | Input is not valid SVG string",t),null;const e=l.windowInstance.document.createElement("div");return e.innerHTML=t,e.firstChild}static parse(t,e=.01,r){if(!1===l.isSVG(t))return console.warn("[Urpflanze:SVGImport] | Input is not valid svg",t),null;const n=l.svgToBuffers(t,e);return n?l.parsedToShape(n,r):null}static parsedToShape(t,e){const r=[];if(t.buffers.forEach(((t,n)=>{const i=new s.ShapeBuffer({shape:t.buffer,bClosed:t.bClosed,sideLength:e,drawer:t.drawer});i&&r.push(i)})),1===r.length)return r[0];const n=new s.Group;return r.forEach((t=>n.add(t))),new s.Shape({shape:n})}static svgToBuffers(t,e=.01){const r="string"==typeof t?l.stringToSVG(t):t;if(null===r)return console.error("[Urpflanze:SVGImport] | Cannot convert string to svg",t),null;const n=l.getViewbox(r);r.querySelectorAll("g").forEach(l.propagateGroupTransformAndStyleToChildren);const i=Array.from(r.querySelectorAll("rect, circle, ellipse, line, polyline, polygon, path")),o=[].concat(...i.map((t=>l.elementToPath(t)))),a=Math.max(n[2]-n[0],n[3]-n[1]).toExponential(1).match(/e(\+?[0-9]+)/),h=10/(1e3/Math.min(10**Math.max(a?+a[1]:0,0),1e3));let u=o.map((t=>l.pathToBuffer(t,h,n))).filter((t=>!!t&&t.length>=2));u=u.map((t=>l.simpliyBuffer(t,e))),u=u.map(((t,e)=>l.pathIsClosed(o[e])&&s.Vec2.distance([t[0],t[1]],[t[t.length-2],t[t.length-1]])<1?t.subarray(0,t.length-2):t));const f=Math.sqrt((n[2]-n[0])*(n[3]-n[1])),d=l.getStyleAttr("fill",r),p=l.getStyleAttr("stroke",r),m=l.getStyleAttr("stroke-width",r,f/100),g=[];for(let t=0;t=0?c.fromPercentage(parseFloat(e),f):parseFloat(e));const n=l.getStyleAttr("fill",o[t],d||void 0),i=l.getStyleAttr("stroke",o[t],n?void 0:p||"rgba(255,255,255)"),s=r||(i?m:void 0);g.push({buffer:u[t],bClosed:l.pathIsClosed(o[t]),drawer:{fill:n,stroke:i,lineWidth:s?s/(f/100):void 0}})}return i.forEach((t=>t.remove())),{viewBox:n,buffers:g}}static getStyleAttr(t,e,r){const n=e.getAttribute(t);if("none"===n)return;let s;if(null!=n)s=n;else{const r="stroke-width"===t?"strokeWidth":t;void 0!==e.style[r]&&e.style[r].length>0&&(s=e.style[r])}if(void 0===s)return r;if("stroke-width"===t)return parseFloat(s);let o=parseFloat(e.getAttribute("opacity")||"1");const a=e.getAttribute("style");if(a&&a.length){const e=new RegExp(`${t}-opacity: +?(\\d?.\\d|\\d)`,"i"),r=a.match(e);r&&(o=parseFloat(r[1]))}const h=i.parseColor(s);return h?(o=1!==h.alpha?h.alpha:o,"rgb"===h.type?`rgba(${h.a}, ${h.b}, ${h.c}, ${o})`:`hsla(${h.a}, ${h.b}%, ${h.c}%, ${o})`):r}static getViewbox(t){const e=t.getAttribute("viewBox");if(e)return e.split(" ").map((t=>parseFloat(t)));const r=t.getAttribute("width"),n=t.getAttribute("height");if(r&&n)return[0,0,parseFloat(r),parseFloat(n)];t=t.cloneNode(!0);const i=Array.from(t.querySelectorAll("rect, circle, ellipse, line, polyline, polygon, path")),s=[].concat.apply([],i.map(l.elementToPath));let a=0,h=0;for(let t=0,e=s.length;ta&&(a=t.width),t.height>h&&(h=t.height)}}return[0,0,a,h]}static pathIsClosed(t){var e;return"z"===(null===(e=t.getAttribute("d"))||void 0===e?void 0:e.trim().substr(-1).toLowerCase())}static simpliyBuffer(t,e=.01){const r=[];for(let e=0,n=t.length;e{i[2*e]=t.x,i[2*e+1]=t.y})),i}static sanitizePath(t,e){return h(t).abs().unarc().transform(e||"").toString()}static pathToBuffer(t,e=.01,r=[-1,-1,1,1]){const i=r[2]-r[0],s=r[3]-r[1],o=2/Math.max(i,s),a=t.getAttribute("d"),h=t.getAttribute("transform")||"",u=new n.Path({d:l.sanitizePath(a,h)}),c=Math.floor(u.length()),f=2*Math.floor(c/e),d=new Float32Array(f);let p=0;for(let t=0;t0){const r=u.compose(u.fromDefinition(u.fromTransformAttribute(e))),n=t.children;Array.from(n).forEach((t=>{let n=t.getAttribute("transform");if(n&&n.length>0){const t=u.compose(u.fromDefinition(u.fromTransformAttribute(n))),e=u.compose(r,t);n=u.toSVG(e)}else n=e;t.setAttribute("transform",n)}))}["fill","stroke","stroke-width","style"].forEach((e=>{const r=t.getAttribute(e);r&&Array.from(t.children).forEach((t=>{null===t.getAttribute(e)&&t.setAttribute(e,r)}))}))}static elementToPath(t){const e=l.windowInstance.document;let r=[];return"path"===t.nodeName?r=h(t.getAttribute("d")||"").abs().unarc().toString().split("M").filter((t=>t.length>0)).map((t=>"M"+t)):["rect","ellipse","circle","line","polyline","polygon"].includes(t.nodeName)?r=[c.conversion[t.nodeName](t)]:console.warn(`[Urpflanze:SVGImport] | Cannot convert ${t.nodeName} to path`),r.map((r=>{const n=e.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d",r),n.setAttribute("transform",t.getAttribute("transform")||""),n.setAttribute("style",t.getAttribute("style")||""),n.setAttribute("fill",l.getStyleAttr("fill",t,"")+""),n.setAttribute("stroke",l.getStyleAttr("stroke",t,"")+""),n.setAttribute("opacity",t.getAttribute("opacity")||"1"),n.setAttribute("stroke-width",l.getStyleAttr("stroke-width",t,"")+""),n}))}}e.SVGImporter=l,l.HEX_REGEX="#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})",l.SVG_REGEX=/^\s*(?:<\?xml[^>]*>\s*)?(?:]*\s*(?:\[?(?:\s*]*>\s*)*\]?)*[^>]*>\s*)?(?:]*>[^]*<\/svg>|]*\/\s*>)\s*$/i,l.COMMENT_REGEX=//g},625:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.SVGImporter=void 0;const s=r(877);Object.defineProperty(e,"SVGImporter",{enumerable:!0,get:function(){return s.SVGImporter}}),i(r(291),e),s.SVGImporter.setWindowInstance(window),e.default=s.SVGImporter},291:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},825:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.conversion=e.fromPercentage=void 0,e.fromPercentage=(t,e)=>/%$/.test(t+"")?100*parseFloat((t+"").replace("%",""))/e:+t;const r={rect:t=>{const r=parseFloat(t.getAttribute("width")||"0"),n=parseFloat(t.getAttribute("height")||"0"),i=parseFloat(t.getAttribute("x")||"0"),s=parseFloat(t.getAttribute("y")||"0");let o=t.getAttribute("rx")||"auto",a=t.getAttribute("ry")||"auto";"auto"===o&&"auto"===a?o=a=0:"auto"!==o&&"auto"===a?o=a=e.fromPercentage(o,r):"auto"!==a&&"auto"===o?a=o=e.fromPercentage(a,n):(o=e.fromPercentage(o,r),a=e.fromPercentage(a,n)),o>r/2&&(o=r/2),a>n/2&&(a=n/2);const h=o>0&&a>0;return[`M${i+o} ${s}`,"H"+(i+r-o),...h?[`A${o} ${a} 0 0 1 ${i+r} ${s+a}`]:[],"V"+(s+n-a),...h?[`A${o} ${a} 0 0 1 ${i+r-o} ${s+n}`]:[],`H${i+o}`,...h?[`A${o} ${a} 0 0 1 ${i} ${s+n-a}`]:[],`V${s+a}`,...h?[`A${o} ${a} 0 0 1 ${i+o} ${s}`]:[],"Z"].join(" ")},ellipse:t=>{var e,r,n,i;const s=parseFloat(t.getAttribute("cx")||"0"),o=parseFloat(t.getAttribute("cy")||"0"),a=parseFloat(null!==(r=null!==(e=t.getAttribute("rx"))&&void 0!==e?e:t.getAttribute("r"))&&void 0!==r?r:"0"),h=parseFloat(null!==(i=null!==(n=t.getAttribute("ry"))&&void 0!==n?n:t.getAttribute("r"))&&void 0!==i?i:"0");return[`M${s+a} ${o}`,`A${a} ${h} 0 0 1 ${s} ${o+h}`,`A${a} ${h} 0 0 1 ${s-a} ${o}`,`A${a} ${h} 0 0 1 ${s+a} ${o}`,"Z"].join(" ")},circle:t=>r.ellipse(t),line:t=>`M${t.getAttribute("x1")||"0"} ${t.getAttribute("y1")||"0"} L${t.getAttribute("x2")||"0"} ${t.getAttribute("y2")||"0"}`,polyline:t=>((t,e=2)=>{const r=[];for(;t.length>0;)r.push(t.splice(0,e));return r})((t.getAttribute("points")||"").trim().replace(/ +/g," ").split(" ").reduce(((t,e)=>[...t,...e.includes(",")?e.split(","):[e]]),[]),2).map((([t,e],r)=>`${0===r?"M":"L"}${t} ${e}`)).join(" "),polygon:t=>r.polyline(t)+" Z",path:t=>t.getAttribute("d")+""};e.conversion=r},500:(t,e,r)=>{r.r(e),r.d(e,{A:()=>ur,Animator:()=>Ye,Array:()=>Rt,Box:()=>mt,Circle:()=>ir,ClipPath:()=>sr,Color:()=>ut,Container:()=>zt,Controller:()=>pe,Defs:()=>qt,Dom:()=>Ft,Ease:()=>de,Element:()=>jt,Ellipse:()=>Jt,EventTarget:()=>Et,ForeignObject:()=>or,Fragment:()=>Qt,G:()=>hr,Gradient:()=>ne,Image:()=>se,Line:()=>he,List:()=>vt,Marker:()=>ue,Mask:()=>cr,Matrix:()=>ft,Morphable:()=>ke,NonMorphable:()=>Ie,Number:()=>Tt,ObjectBag:()=>Re,PID:()=>ve,Path:()=>je,PathArray:()=>Oe,Pattern:()=>ie,Point:()=>ct,PointArray:()=>oe,Polygon:()=>ze,Polyline:()=>qe,Queue:()=>Ue,Rect:()=>Ne,Runner:()=>$e,SVG:()=>mr,Shape:()=>Nt,Spring:()=>ge,Stop:()=>lr,Style:()=>fr,Svg:()=>Ke,Symbol:()=>tr,Text:()=>rr,TextPath:()=>dr,Timeline:()=>Ge,TransformBag:()=>Ce,Tspan:()=>nr,Use:()=>pr,adopt:()=>F,assignNewId:()=>Y,clearEvents:()=>St,create:()=>R,defaults:()=>Bt,dispatch:()=>Ot,easing:()=>le,eid:()=>U,extend:()=>V,find:()=>bt,getClass:()=>q,getEventTarget:()=>_t,getEvents:()=>xt,getWindow:()=>k,makeInstance:()=>T,makeMorphable:()=>Fe,mockAdopt:()=>D,namespaces:()=>x,nodeOrNew:()=>L,off:()=>At,on:()=>Pt,parser:()=>dt,regex:()=>st,register:()=>z,registerMorphableType:()=>Le,registerWindow:()=>S,restoreWindow:()=>O,root:()=>B,saveWindow:()=>A,utils:()=>g,windowEvents:()=>Mt,withWindow:()=>E,wrapWithAttrCheck:()=>Z});const n={},i=[];function s(t,e){if(Array.isArray(t))for(const r of t)s(r,e);else if("object"!=typeof t)a(Object.getOwnPropertyNames(e)),n[t]=Object.assign(n[t]||{},e);else for(const e in t)s(e,t[e])}function o(t){return n[t]||{}}function a(t){i.push(...t)}function h(t,e){let r;const n=t.length,i=[];for(r=0;r=0;e--)Y(t.children[e]);return t.id?(t.id=U(t.nodeName),t):t}function V(t,e){let r,n;for(n=(t=Array.isArray(t)?t:[t]).length-1;n>=0;n--)for(r in e)t[n].prototype[r]=e[r]}function Z(t){return function(...e){const r=e[e.length-1];return!r||r.constructor!==Object||r instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(r)}}s("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=T(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=T(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=T(t)).before(this),this},insertAfter:function(t){return(t=T(t)).after(this),this}});const G=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,$=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,X=/rgb\((\d+),(\d+),(\d+)\)/,H=/(#[a-z_][a-z0-9\-_]*)/i,W=/\)\s*,?\s*/,J=/\s/g,Q=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,K=/^rgb\(/,tt=/^(\s+)?$/,et=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,rt=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,nt=/[\s,]+/,it=/[MLHVCSQTAZ]/i;var st={__proto__:null,numberAndUnit:G,hex:$,rgb:X,reference:H,transforms:W,whitespace:J,isHex:Q,isRgb:K,isBlank:tt,isNumber:et,isImage:rt,delimiter:nt,isPathLetter:it};function ot(t){const e=Math.round(t),r=Math.max(0,Math.min(255,e)).toString(16);return 1===r.length?"0"+r:r}function at(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function ht(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}s("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(nt)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),s("Dom",{css:function(t,e){const r={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);r[e[0]]=e[1]})),r;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=l(e);r[t]=this.node.style[t]}return r}if("string"==typeof t)return this.node.style[l(t)];if("object"==typeof t)for(const e in t)this.node.style[l(e)]=null==t[e]||tt.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[l(t)]=null==e||tt.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),s("Dom",{data:function(t,e,r){if(null==t)return this.data(h(u(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const r of t)e[r]=this.data(r);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===r||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),s("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class ut{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof ut||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e,r){const{random:n,round:i,sin:s,PI:o}=Math;if("vibrant"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new ut(t,e,r,"lch")}if("sine"===t){const t=i(80*s(2*o*(e=null==e?n():e)/.5+.01)+150),r=i(50*s(2*o*e/.5+4.6)+200),a=i(100*s(2*o*e/.5+2.3)+150);return new ut(t,r,a)}if("pastel"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new ut(t,e,r,"lch")}if("dark"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new ut(t,e,r,"lch")}if("rgb"===t){const t=255*n(),e=255*n(),r=255*n();return new ut(t,e,r)}if("lab"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new ut(t,e,r,"lab")}if("grey"===t){const t=255*n();return new ut(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(Q.test(t)||K.test(t))}cmyk(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.min(1-n,1-i,1-s);return 1===o?new ut(0,0,0,1,"cmyk"):new ut((1-n-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.max(n,i,s),a=Math.min(n,i,s),h=(o+a)/2,u=o===a,c=o-a;return new ut(360*(u?0:o===n?((i-s)/c+(i.5?c/(2-o-a):c/(o+a)),100*h,"hsl")}init(t=0,e=0,r=0,n=0,i="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)i="string"==typeof n?n:i,n="string"==typeof n?0:n,Object.assign(this,{_a:t,_b:e,_c:r,_d:n,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const r=function(t,e){const r=at(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:at(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:at(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:at(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:at(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:at(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return r.space=e||r.space,r}(t,e);Object.assign(this,r)}else if("string"==typeof t)if(K.test(t)){const e=t.replace(J,""),[r,n,i]=X.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}else{if(!Q.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,r,n,i]=$.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:h}=this,u="rgb"===this.space?{r:s,g:o,b:a}:"xyz"===this.space?{x:s,y:o,z:a}:"hsl"===this.space?{h:s,s:o,l:a}:"lab"===this.space?{l:s,a:o,b:a}:"lch"===this.space?{l:s,c:o,h:a}:"cmyk"===this.space?{c:s,m:o,y:a,k:h}:{};Object.assign(this,u)}lab(){const{x:t,y:e,z:r}=this.xyz();return new ut(116*e-16,500*(t-e),200*(e-r),"lab")}lch(){const{l:t,a:e,b:r}=this.lab(),n=Math.sqrt(e**2+r**2);let i=180*Math.atan2(r,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new ut(t,n,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:n,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,r=Math.PI/180;i=t*Math.cos(r*e),s=t*Math.sin(r*e)}const o=(n+16)/116,a=i/500+o,h=o-s/200,u=16/116,c=.008856,l=7.787;t=.95047*(a**3>c?a**3:(a-u)/l),e=1*(o**3>c?o**3:(o-u)/l),r=1.08883*(h**3>c?h**3:(h-u)/l)}const n=3.2406*t+-1.5372*e+-.4986*r,i=-.9689*t+1.8758*e+.0415*r,s=.0557*t+-.204*e+1.057*r,o=Math.pow,a=.0031308,h=n>a?1.055*o(n,1/2.4)-.055:12.92*n,u=i>a?1.055*o(i,1/2.4)-.055:12.92*i,c=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new ut(255*h,255*u,255*c)}if("hsl"===this.space){let{h:t,s:e,l:r}=this;if(t/=360,e/=100,r/=100,0===e)return r*=255,new ut(r,r,r);const n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,s=255*ht(i,n,t+1/3),o=255*ht(i,n,t),a=255*ht(i,n,t-1/3);return new ut(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:r,k:n}=this,i=255*(1-Math.min(1,t*(1-n)+n)),s=255*(1-Math.min(1,e*(1-n)+n)),o=255*(1-Math.min(1,r*(1-n)+n));return new ut(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:r,_d:n,space:i}=this;return[t,e,r,n,i]}toHex(){const[t,e,r]=this._clamped().map(ot);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,h=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,u=(.4124*o+.3576*a+.1805*h)/.95047,c=(.2126*o+.7152*a+.0722*h)/1,l=(.0193*o+.1192*a+.9505*h)/1.08883,f=u>.008856?Math.pow(u,1/3):7.787*u+16/116,d=c>.008856?Math.pow(c,1/3):7.787*c+16/116,p=l>.008856?Math.pow(l,1/3):7.787*l+16/116;return new ut(f,d,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:r}=this.rgb(),{max:n,min:i,round:s}=Math;return[t,e,r].map((t=>n(0,i(s(t),255))))}}class ct{constructor(...t){this.init(...t)}clone(){return new ct(this)}init(t,e){const r=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==r.x?0:r.x,this.y=null==r.y?0:r.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){ft.isMatrixLike(t)||(t=new ft(t));const{x:e,y:r}=this;return this.x=t.a*e+t.c*r+t.e,this.y=t.b*e+t.d*r+t.f,this}}function lt(t,e,r){return Math.abs(e-t)<(r||1e-6)}class ft{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,r=t.flip&&(e||"x"===t.flip)?-1:1,n=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleX)?t.scaleX*r:r,a=t.scale&&t.scale.length?t.scale[1]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleY)?t.scaleY*n:n,h=t.shear||0,u=t.rotate||t.theta||0,c=new ct(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=c.x,f=c.y,d=new ct(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.y,g=new ct(t.translate||t.tx||t.translateX,t.ty||t.translateY),v=g.x,y=g.y,b=new ct(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:h,theta:u,rx:b.x,ry:b.y,tx:v,ty:y,ox:l,oy:f,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,r){const n=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,h=t.f+t.b*e.e+t.d*e.f;return r.a=n,r.b=i,r.c=s,r.d=o,r.e=a,r.f=h,r}around(t,e,r){return this.clone().aroundO(t,e,r)}aroundO(t,e,r){const n=t||0,i=e||0;return this.translateO(-n,-i).lmultiplyO(r).translateO(n,i)}clone(){return new ft(this)}decompose(t=0,e=0){const r=this.a,n=this.b,i=this.c,s=this.d,o=this.e,a=this.f,h=r*s-n*i,u=h>0?1:-1,c=u*Math.sqrt(r*r+n*n),l=Math.atan2(u*n,u*r),f=180/Math.PI*l,d=Math.cos(l),p=Math.sin(l),m=(r*i+n*s)/h,g=i*c/(m*r-n)||s*c/(m*n+r);return{scaleX:c,scaleY:g,shear:m,rotate:f,translateX:o-t+t*d*c+e*(m*d*c-p*g),translateY:a-e+t*p*c+e*(m*p*c+d*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new ft(t);return lt(this.a,e.a)&<(this.b,e.b)&<(this.c,e.c)&<(this.d,e.d)&<(this.e,e.e)&<(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=ft.fromArray([1,0,0,1,0,0]);return t=t instanceof jt?t.matrixify():"string"==typeof t?ft.fromArray(t.split(nt).map(parseFloat)):Array.isArray(t)?ft.fromArray(t):"object"==typeof t&&ft.isMatrixLike(t)?t:"object"==typeof t?(new ft).transform(t):6===arguments.length?ft.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,r=this.c,n=this.d,i=this.e,s=this.f,o=t*n-e*r;if(!o)throw new Error("Cannot invert "+this);const a=n/o,h=-e/o,u=-r/o,c=t/o,l=-(a*i+u*s),f=-(h*i+c*s);return this.a=a,this.b=h,this.c=u,this.d=c,this.e=l,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof ft?t:new ft(t);return ft.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof ft?t:new ft(t);return ft.matrixMultiply(this,e,this)}rotate(t,e,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=c(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:h,e:u,f:l}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-h*i,this.d=h*n+a*i,this.e=u*n-l*i+r*i-e*n+e,this.f=l*n+u*i-e*i-r*n+r,this}scale(t,e,r,n){return this.clone().scaleO(...arguments)}scaleO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t);const{a:i,b:s,c:o,d:a,e:h,f:u}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=h*t-r*t+r,this.f=u*e-n*e+n,this}shear(t,e,r){return this.clone().shearO(t,e,r)}shearO(t,e=0,r=0){const{a:n,b:i,c:s,d:o,e:a,f:h}=this;return this.a=n+i*t,this.c=s+o*t,this.e=a+h*t-r*t,this}skew(t,e,r,n){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=c(t),e=c(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:h,d:u,e:l,f}=this;return this.a=o+a*i,this.b=a+o*s,this.c=h+u*i,this.d=u+h*s,this.e=l+f*i-n*i,this.f=f+l*s-r*s,this}skewX(t,e,r){return this.skew(t,0,e,r)}skewY(t,e,r){return this.skew(0,t,e,r)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(ft.isMatrixLike(t))return new ft(t).multiplyO(this);const e=ft.formatTransforms(t),{x:r,y:n}=new ct(e.ox,e.oy).transform(this),i=(new ft).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-r,-n).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(r,n);if(isFinite(e.px)||isFinite(e.py)){const t=new ct(r,n).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function dt(){if(!dt.nodes){const t=T().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;dt.nodes={svg:t,path:e}}if(!dt.nodes.svg.node.parentNode){const t=_.document.body||_.document.documentElement;dt.nodes.svg.addTo(t)}return dt.nodes}function pt(t){return!(t.width||t.height||t.x||t.y)}z(ft,"Matrix");class mt{constructor(...t){this.init(...t)}addOffset(){return this.x+=_.window.pageXOffset,this.y+=_.window.pageYOffset,new mt(this)}init(t){return t="string"==typeof t?t.split(nt).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return pt(this)}merge(t){const e=Math.min(this.x,t.x),r=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-r;return new mt(e,r,n,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof ft||(t=new ft(t));let e=1/0,r=-1/0,n=1/0,i=-1/0;return[new ct(this.x,this.y),new ct(this.x2,this.y),new ct(this.x,this.y2),new ct(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),r=Math.max(r,s.x),n=Math.min(n,s.y),i=Math.max(i,s.y)})),new mt(e,n,r-e,i-n)}}function gt(t,e,r){let n;try{if(n=e(t.node),pt(n)&&(i=t.node)!==_.document&&!(_.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===_.document}).call(_.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){n=r(t)}var i;return n}s({viewbox:{viewbox(t,e,r,n){return null==t?new mt(this.attr("viewBox")):this.attr("viewBox",new mt(t,e,r,n))},zoom(t,e){let{width:r,height:n}=this.attr(["width","height"]);if((r||n)&&"string"!=typeof r&&"string"!=typeof n||(r=this.node.clientWidth,n=this.node.clientHeight),!r||!n)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=r/i.width,o=n/i.height,a=Math.min(s,o);if(null==t)return a;let h=a/t;h===1/0&&(h=Number.MAX_SAFE_INTEGER/100),e=e||new ct(r/2/s+i.x,n/2/o+i.y);const u=new mt(i).transform(new ft({scale:h,origin:e}));return this.viewbox(u)}}}),z(mt,"Box");class vt extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}V([vt],{each(t,...e){return"function"==typeof t?this.map(((e,r,n)=>t.call(e,e,r,n))):this.map((r=>r[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const yt=["toArray","constructor","each"];function bt(t,e){return new vt(h((e||_.document).querySelectorAll(t),(function(t){return F(t)})))}vt.extend=function(t){t=t.reduce(((t,e)=>(yt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),V([vt],t)};let wt=0;const Mt={};function xt(t){let e=t.getEventHolder();return e===_.window&&(e=Mt),e.events||(e.events={}),e.events}function _t(t){return t.getEventTarget()}function St(t){let e=t.getEventHolder();e===_.window&&(e=Mt),e.events&&(e.events={})}function Pt(t,e,r,n,i){const s=r.bind(n||t),o=T(t),a=xt(o),h=_t(o);e=Array.isArray(e)?e:e.split(nt),r._svgjsListenerId||(r._svgjsListenerId=++wt),e.forEach((function(t){const e=t.split(".")[0],n=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][r._svgjsListenerId]=s,h.addEventListener(e,s,i||!1)}))}function At(t,e,r,n){const i=T(t),s=xt(i),o=_t(i);("function"!=typeof r||(r=r._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(nt)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let h,u;if(r)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][r],n||!1),delete s[e][a||"*"][r]);else if(e&&a){if(s[e]&&s[e][a]){for(u in s[e][a])At(o,[e,a].join("."),u);delete s[e][a]}}else if(a)for(t in s)for(h in s[t])a===h&&At(o,[t,a].join("."));else if(e){if(s[e]){for(h in s[e])At(o,[e,h].join("."));delete s[e]}}else{for(t in s)At(o,t);St(i)}}))}function Ot(t,e,r,n){const i=_t(t);return e instanceof _.window.Event||(e=new _.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}class Et extends I{addEventListener(){}dispatch(t,e,r){return Ot(this,t,e,r)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const r=e[t.type];for(const e in r)for(const n in r[e])r[e][n](t);return!t.defaultPrevented}fire(t,e,r){return this.dispatch(t,e,r),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e){return At(this,t,e),this}on(t,e,r,n){return Pt(this,t,e,r,n),this}removeEventListener(){}}function kt(){}z(Et,"EventTarget");const It={duration:400,ease:">",delay:0},Ct={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};var Bt={__proto__:null,noop:kt,timeline:It,attrs:Ct};class Rt extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(nt).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class Tt{constructor(...t){this.init(...t)}convert(t){return new Tt(this.value,t)}divide(t){return t=new Tt(t),new Tt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(G))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof Tt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new Tt(t),new Tt(this-t,this.unit||t.unit)}plus(t){return t=new Tt(t),new Tt(this+t,this.unit||t.unit)}times(t){return t=new Tt(t),new Tt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const Lt=[];class Ft extends Et{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=T(t)).removeNamespace&&this.node instanceof _.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return T(t).put(this,e)}children(){return new vt(h(this.node.children,(function(t){return F(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0){return this.writeDataToDom(),new this.constructor(Y(this.node.cloneNode(t)))}each(t,e){const r=this.children();let n,i;for(n=0,i=r.length;n=0}html(t,e){return this.xml(t,e,y)}id(t){return void 0!==t||this.node.id||(this.node.id=U(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return F(this.node.lastChild)}matches(t){const e=this.node,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return r&&r.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=F(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=F(e.node.parentNode));return e}put(t,e){return t=T(t),this.add(t,e),t}putIn(t,e){return T(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=T(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const r=10**t,n=this.attr(e);for(const t in n)"number"==typeof n[t]&&(n[t]=Math.round(n[t]*r)/r);return this.attr(n),this}svg(t,e){return this.xml(t,e,v)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const r=e.index(this);return e.put(t,r).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let r=this;if(null!=t){if(r=F(r.node.cloneNode(!0)),e){const e=t(r);if(r=e||r,!1===e)return""}r.each((function(){const e=t(this),r=e||this;!1===e?this.remove():e&&this!==r&&this.replace(r)}),!0)}return e?r.node.outerHTML:r.node.innerHTML}e=null!=e&&e;const n=R("wrapper",r),i=_.document.createDocumentFragment();n.innerHTML=t;for(let t=n.children.length;t--;)i.appendChild(n.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}V(Ft,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=et.test(r.nodeValue)?parseFloat(r.nodeValue):r.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?Ct[t]:et.test(e)?parseFloat(e):e;"number"==typeof(e=Lt.reduce(((e,r)=>r(t,e,this)),e))?e=new Tt(e):ut.isColor(e)?e=new ut(e):e.constructor===Array&&(e=new Rt(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof r?this.node.setAttributeNS(r,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return bt(t,this.node)},findOne:function(t){return F(this.node.querySelector(t))}}),z(Ft,"Dom");class jt extends Ft{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,t.hasAttribute("svgjs:data")&&this.setData(JSON.parse(t.getAttribute("svgjs:data"))||{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new Tt(t).plus(this.x()))}dy(t=0){return this.y(new Tt(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){t=T(t);const e=new vt;let r=this;for(;(r=r.parent())&&r.node!==_.document&&"#document-fragment"!==r.nodeName&&(e.push(r),r.node!==t.node););return e}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(H);return e?T(e[1]):null}root(){const t=this.parent(q(B));return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const r=p(this,t,e);return this.width(new Tt(r.width)).height(new Tt(r.height))}width(t){return this.attr("width",t)}writeDataToDom(){return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}V(jt,{bbox:function(){const t=gt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(dt().svg).show(),r=e.node.getBBox();return e.remove(),r}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new mt(t)},rbox:function(t){const e=gt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),r=new mt(e);return t?r.transform(t.screenCTM().inverseO()):r.addOffset()},inside:function(t,e){const r=this.bbox();return t>r.x&&e>r.y&&t=0;r--)null!=e[Dt[t][r]]&&this.attr(Dt.prefix(t,Dt[t][r]),e[Dt[t][r]]);return this},s(["Element","Runner"],e)})),s(["Element","Runner"],{matrix:function(t,e,r,n,i,s){return null==t?new ft(this):this.attr("transform",new ft(t,e,r,n,i,s))},rotate:function(t,e,r){return this.transform({rotate:t,ox:e,oy:r},!0)},skew:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:r},!0):this.transform({skew:[t,e],ox:r,oy:n},!0)},shear:function(t,e,r){return this.transform({shear:t,ox:e,oy:r},!0)},scale:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:r},!0):this.transform({scale:[t,e],ox:r,oy:n},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),s("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new Tt(t)):this.rx(t).ry(e)}}),s("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new ct(this.node.getPointAtLength(t))}}),s(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),s("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),s("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(W).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(nt).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(ft.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new ft)},toParent:function(t,e){if(this===t)return this;const r=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(n.multiply(r)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new ft(this).decompose();return null==t?e:e[t]}ft.isMatrixLike(t)||(t={...t,origin:m(t,this)});const r=new ft(!0===e?this:e||!1).transform(t);return this.attr("transform",r)}});class zt extends jt{flatten(t=this,e){return this.each((function(){if(this instanceof zt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(r,n){return n[n.length-r-1].toParent(t,e)})),this.remove()}}z(zt,"Container");class qt extends zt{constructor(t,e=t){super(L("defs",t),e)}flatten(){return this}ungroup(){return this}}z(qt,"Defs");class Nt extends jt{}function Ut(t){return this.attr("rx",t)}function Yt(t){return this.attr("ry",t)}function Vt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Zt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Gt(t){return this.attr("cx",t)}function $t(t){return this.attr("cy",t)}function Xt(t){return null==t?2*this.rx():this.rx(new Tt(t).divide(2))}function Ht(t){return null==t?2*this.ry():this.ry(new Tt(t).divide(2))}z(Nt,"Shape");var Wt={__proto__:null,rx:Ut,ry:Yt,x:Vt,y:Zt,cx:Gt,cy:$t,width:Xt,height:Ht};class Jt extends Nt{constructor(t,e=t){super(L("ellipse",t),e)}size(t,e){const r=p(this,t,e);return this.rx(new Tt(r.width).divide(2)).ry(new Tt(r.height).divide(2))}}V(Jt,Wt),s("Container",{ellipse:Z((function(t=0,e=t){return this.put(new Jt).size(t,e).move(0,0)}))}),z(Jt,"Ellipse");class Qt extends Ft{constructor(t=_.document.createDocumentFragment()){super(t)}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){const t=new Ft(R("wrapper",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}}function Kt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new Tt(t),fy:new Tt(e)}):this.attr({x1:new Tt(t),y1:new Tt(e)})}function te(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new Tt(t),cy:new Tt(e)}):this.attr({x2:new Tt(t),y2:new Tt(e)})}z(Qt,"Fragment");var ee,re={__proto__:null,from:Kt,to:te};class ne extends zt{constructor(t,e){super(L(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,r){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,r)}bbox(){return new mt}targets(){return bt('svg [fill*="'+this.id()+'"]')}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return'url("#'+this.id()+'")'}}V(ne,re),s({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:Z((function(t,e){return this.put(new ne(t)).update(e)}))}}),z(ne,"Gradient");class ie extends zt{constructor(t,e=t){super(L("pattern",t),e)}attr(t,e,r){return"transform"===t&&(t="patternTransform"),super.attr(t,e,r)}bbox(){return new mt}targets(){return bt('svg [fill*="'+this.id()+'"]')}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return'url("#'+this.id()+'")'}}s({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:Z((function(t,e,r){return this.put(new ie).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),z(ie,"Pattern");class se extends Nt{constructor(t,e=t){super(L("image",t),e)}load(t,e){if(!t)return this;const r=new _.window.Image;return Pt(r,"load",(function(t){const n=this.parent(ie);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof ie&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),Pt(r,"load error",(function(){At(r)})),this.attr("href",r.src=t,w)}}ee=function(t,e,r){return"fill"!==t&&"stroke"!==t||rt.test(e)&&(e=r.root().defs().image(e)),e instanceof se&&(e=r.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},Lt.push(ee),s({Container:{image:Z((function(t,e){return this.put(new se).size(0,0).load(t,e)}))}}),z(se,"Image");class oe extends Rt{bbox(){let t=-1/0,e=-1/0,r=1/0,n=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),r=Math.min(i[0],r),n=Math.min(i[1],n)})),new mt(r,n,t-r,e-n)}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(nt).map(parseFloat)).length%2!=0&&t.pop();for(let r=0,n=t.length;r=0;r--)n.width&&(this[r][0]=(this[r][0]-n.x)*t/n.width+n.x),n.height&&(this[r][1]=(this[r][1]-n.y)*e/n.height+n.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,r=this.length;e":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,r,n){return function(i){return i<0?t>0?e/t*i:r>0?n/r*i:0:i>1?r<1?(1-n)/(1-r)*i+(n-r)/(1-r):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*n+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let r=t;return"none"===e?--r:"both"===e&&++r,(n,i=!1)=>{let s=Math.floor(n*t);const o=n*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,n>=0&&s<0&&(s=0),n<=1&&s>r&&(s=r),s/r}}};class fe{done(){return!1}}class de extends fe{constructor(t=It.ease){super(),this.ease=le[t]||t}step(t,e,r){return"number"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}}class pe extends fe{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}}function me(){const t=(this._duration||500)/1e3,e=this._overshoot||0,r=Math.PI,n=Math.log(e/100+1e-10),i=-n/Math.sqrt(r*r+n*n),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}class ge extends pe{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;r>100&&(r=16),r/=1e3;const i=n.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*r+s*r*r/2;return n.velocity=i+s*r,n.done=Math.abs(e-o)+Math.abs(i)<.002,n.done?e:o}}V(ge,{duration:ce("_duration",me),overshoot:ce("_overshoot",me)});class ve extends pe{constructor(t=.1,e=.01,r=0,n=1e3){super(),this.p(t).i(e).d(r).windup(n)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;const i=e-t;let s=(n.integral||0)+i*r;const o=(i-(n.error||0))/r,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),n.error=i,n.integral=s,n.done=Math.abs(i)<.001,n.done?e:t+(this.P*i+this.I*s+this.D*o)}}V(ve,{windup:ce("_windup"),p:ce("P"),i:ce("I"),d:ce("D")});const ye={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},be={M:function(t,e,r){return e.x=r.x=t[0],e.y=r.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,r){return e.x=r.x,e.y=r.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},we="mlhvqtcsaz".split("");for(let t=0,e=we.length;t=0;n--)r=this[n][0],"M"===r||"L"===r||"T"===r?(this[n][1]+=t,this[n][2]+=e):"H"===r?this[n][1]+=t:"V"===r?this[n][1]+=e:"C"===r||"S"===r||"Q"===r?(this[n][1]+=t,this[n][2]+=e,this[n][3]+=t,this[n][4]+=e,"C"===r&&(this[n][5]+=t,this[n][6]+=e)):"A"===r&&(this[n][6]+=t,this[n][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let r=0,n="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new ct,p:new ct};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!xe(i,n))if("."!==n)if(isNaN(parseInt(n)))if(" "!==n&&","!==n)if("-"!==n)if("E"!==n.toUpperCase()){if(it.test(n)){if(i.inNumber)_e(i,!1);else{if(!Me(i))throw new Error("parser Error");Se(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!Ae(i)){_e(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else i.inNumber&&_e(i,!1);else{if("0"===i.number||Pe(i)){i.inNumber=!0,i.number=n,_e(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){_e(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&_e(i,!1),i.inSegment&&Me(i)&&Se(i),i.segments}(t)}size(t,e){const r=this.bbox();let n,i;for(r.width=0===r.width?1:r.width,r.height=0===r.height?1:r.height,n=this.length-1;n>=0;n--)i=this[n][0],"M"===i||"L"===i||"T"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):"H"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:"V"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:"C"===i||"S"===i||"Q"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,"C"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):"A"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this}toString(){return function(t){let e="";for(let r=0,n=t.length;r{const e=typeof t;return"number"===e?Tt:"string"===e?ut.isColor(t)?ut:nt.test(t)?it.test(t)?Oe:Rt:G.test(t)?Tt:Ie:Te.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Rt:"object"===e?Re:Ie};class ke{constructor(t){this._stepper=t||new de("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){const e=this;return this._morphObj.fromArray(this._from.map((function(r,n){return e._stepper.step(r,e._to[n],t,e._context[n],e._context)})))}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(Ee(t));let e=new this._type(t);return this._type===ut&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Re&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toArray(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class Ie{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class Ce{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,Ce.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}Ce.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Be=(t,e)=>t[0]e[0]?1:0;class Re{constructor(...t){this.init(...t)}align(t){for(let e=0,r=this.values.length;et.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const r=e.shift(),n=e.shift(),i=e.shift(),s=e.splice(0,i);t[r]=new n(s).valueOf()}return t}}const Te=[Ie,Ce,Re];function Le(t=[]){Te.push(...[].concat(t))}function Fe(){V(Te,{to(t){return(new ke).type(this.constructor).from(this.valueOf()).to(t)},fromArray(t){return this.init(t),this}})}class je extends Nt{constructor(t,e=t){super(L("path",t),e)}array(){return this._array||(this._array=new Oe(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new Oe(t))}size(t,e){const r=p(this,t,e);return this.attr("d",this.array().size(r.width,r.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}je.prototype.MorphArray=Oe,s({Container:{path:Z((function(t){return this.put(new je).plot(t||new Oe)}))}}),z(je,"Path");var De={__proto__:null,array:function(){return this._array||(this._array=new oe(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new oe(t))},size:function(t,e){const r=p(this,t,e);return this.attr("points",this.array().size(r.width,r.height))}};class ze extends Nt{constructor(t,e=t){super(L("polygon",t),e)}}s({Container:{polygon:Z((function(t){return this.put(new ze).plot(t||new oe)}))}}),V(ze,ae),V(ze,De),z(ze,"Polygon");class qe extends Nt{constructor(t,e=t){super(L("polyline",t),e)}}s({Container:{polyline:Z((function(t){return this.put(new qe).plot(t||new oe)}))}}),V(qe,ae),V(qe,De),z(qe,"Polyline");class Ne extends Nt{constructor(t,e=t){super(L("rect",t),e)}}V(Ne,{rx:Ut,ry:Yt}),s({Container:{rect:Z((function(t,e){return this.put(new Ne).size(t,e)}))}}),z(Ne,"Rect");class Ue{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Ye={nextDraw:null,frames:new Ue,timeouts:new Ue,immediates:new Ue,timer:()=>_.window.performance||_.window.Date,transforms:[],frame(t){const e=Ye.frames.push({run:t});return null===Ye.nextDraw&&(Ye.nextDraw=_.window.requestAnimationFrame(Ye._draw)),e},timeout(t,e){e=e||0;const r=Ye.timer().now()+e,n=Ye.timeouts.push({run:t,time:r});return null===Ye.nextDraw&&(Ye.nextDraw=_.window.requestAnimationFrame(Ye._draw)),n},immediate(t){const e=Ye.immediates.push(t);return null===Ye.nextDraw&&(Ye.nextDraw=_.window.requestAnimationFrame(Ye._draw)),e},cancelFrame(t){null!=t&&Ye.frames.remove(t)},clearTimeout(t){null!=t&&Ye.timeouts.remove(t)},cancelImmediate(t){null!=t&&Ye.immediates.remove(t)},_draw(t){let e=null;const r=Ye.timeouts.last();for(;(e=Ye.timeouts.shift())&&(t>=e.time?e.run():Ye.timeouts.push(e),e!==r););let n=null;const i=Ye.frames.last();for(;n!==i&&(n=Ye.frames.shift());)n.run(t);let s=null;for(;s=Ye.immediates.shift();)s();Ye.nextDraw=Ye.timeouts.first()||Ye.frames.first()?_.window.requestAnimationFrame(Ye._draw):null}},Ve=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},Ze=function(){const t=_.window;return(t.performance||t.Date).now()};class Ge extends Et{constructor(t=Ze){super(),this._timeSource=t,this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const r=Math.abs(e);return this.speed(t?-r:r)}schedule(t,e,r){if(null==t)return this._runners.map(Ve);let n=0;const i=this.getEndTime();if(e=e||0,null==r||"last"===r||"after"===r)n=i;else if("absolute"===r||"start"===r)n=e,e=0;else if("now"===r)n=this._time;else if("relative"===r){const r=this.getRunnerInfoById(t.id);r&&(n=r.start+e,e=0)}else{if("with-last"!==r)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();n=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:n+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Ye.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Ye.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let r=e-this._lastSourceTime;t&&(r=0);const n=this._speed*r+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=n,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],r=e.runner;this._time-e.start<=0&&r.reset()}let i=!1;for(let t=0,e=this._runners.length;t0?this._continue():(this.pause(),this.fire("finished")),this}}s({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Ge,this._timeline):(this._timeline=t,this)}}});class $e extends Et{constructor(t){super(),this.id=$e.id++,t="function"==typeof(t=null==t?It.duration:t)?new pe(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof pe,this._stepper=this._isDeclarative?t:new de,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new ft,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,r){let n=1,i=!1,s=0;return e=e||It.delay,r=r||"last","object"!=typeof(t=t||It.duration)||t instanceof fe||(e=t.delay||e,r=t.when||r,i=t.swing||i,n=t.times||n,s=t.wait||s,t=t.duration||It.duration),{duration:t,delay:e,swing:i,times:n,wait:s,when:r}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t,e){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,r){const n=$e.sanitise(t,e,r),i=new $e(n.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(n).schedule(n.delay,n.when)}clearTransform(){return this.transforms=new ft,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new de(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,r){return"object"==typeof t&&(e=t.swing,r=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=r||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),r=(this._time-t*e)/this._duration;return Math.min(t+r,this._times)}const r=t%1,n=e*Math.floor(t)+this._duration*r;return this.time(n)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,r=this._duration,n=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(n+r))/(n+r)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(n+r))/r+i;return Math.max(Math.min(a,1),0)},h=i*(n+r)-n;return a=e<=0?Math.round(t(1e-5)):e=0;this._lastPosition=e;const n=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime=n;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=n,this._reseted=!1;let a=!1;return(r||o)&&(this._initialise(r),this.transforms=new ft,a=this._run(o?t:e),this.fire("step",this)),this.done=this.done||a&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,r=this._queue.length;et.lmultiplyO(e),We=t=>t.transforms;function Je(){const t=this._transformationRunners.runners.map(We).reduce(He,new ft);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Qe{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Xe).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const r=this.ids.indexOf(t+1);return this.ids.splice(r,1,t+1),this.runners.splice(r,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;ee.id<=t.id)).map(We).reduce(He,new ft)},_addRunner(t){this._transformationRunners.add(t),Ye.cancelImmediate(this._frameId),this._frameId=Ye.immediate(Je.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Qe).add(new Xe(new ft(this))))}}}),V($e,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,r){if("string"==typeof e)return this.styleAttr(t,{[e]:r});let n=e;if(this._tryRetarget(t,n))return this;let i=new ke(this._stepper).to(n),s=Object.keys(n);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const r=Object.keys(e),o=(a=s,r.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),r=new Re(i.from()).valueOf();Object.assign(r,e),i.from(r)}const h=new Re(i.to()).valueOf();Object.assign(h,e),i.to(h),s=r,n=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let r=new ke(this._stepper).to(new Tt(t));return this.queue((function(){r=r.from(this.element().zoom())}),(function(t){return this.element().zoom(r.at(t),e),r.done()}),(function(t,n){e=n,r.to(t)})),this._rememberMorpher("zoom",r),this},transform(t,e,r){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const n=ft.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new ke(this._stepper).type(r?Ce:ft);let s,o,a,h,u;return this.queue((function(){o=o||this.element(),s=s||m(t,o),u=new ft(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:l,y:f}=new ct(s).transform(o._currentTransform(this));let d=new ft({...t,origin:[l,f]}),p=this._isDeclarative&&a?a:u;if(r){d=d.decompose(l,f),p=p.decompose(l,f);const t=d.rotate,e=p.rotate,r=[t-360,t,t+360],n=r.map((t=>Math.abs(t-e))),i=Math.min(...n),s=n.indexOf(i);d.rotate=r[s]}e&&(n||(d.rotate=t.rotate||0),this._isDeclarative&&h&&(p.rotate=h)),i.from(p),i.to(d);const m=i.at(c);return h=m.rotate,a=new ft(m),this.addTransform(a),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=m(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t,e){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new Tt(e),this._tryRetarget(t,e))return this;const r=new ke(this._stepper).to(e);let n=null;return this.queue((function(){n=this.element()[t](),r.from(n),r.to(n+e)}),(function(e){return this.element()[t](r.at(e)),r.done()}),(function(t){r.to(n+new Tt(t))})),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new ke(this._stepper).to(e);return this.queue((function(){r.from(this.element()[t]())}),(function(e){return this.element()[t](r.at(e)),r.done()})),this._rememberMorpher(t,r),this},_queueNumber(t,e){return this._queueObject(t,new Tt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let r;return t&&e||(r=this._element.bbox()),t||(t=r.width/r.height*e),e||(e=r.height/r.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,r,n){if(4===arguments.length)return this.plot([t,e,r,n]);if(this._tryRetarget("plot",t))return this;const i=new ke(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,r,n){return this._queueObject("viewbox",new mt(t,e,r,n))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),V($e,{rx:Ut,ry:Yt,from:Kt,to:te}),z($e,"Runner");class Ke extends zt{constructor(t,e=t){super(L("svg",t),e),this.namespace()}defs(){return this.isRoot()?F(this.node.querySelector("defs"))||this.put(new qt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof _.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:v,version:"1.1"}).attr("xmlns:xlink",w,b).attr("xmlns:svgjs",M,b):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,b).attr("xmlns:svgjs",null,b)}root(){return this.isRoot()?this:super.root()}}s({Container:{nested:Z((function(){return this.put(new Ke)}))}}),z(Ke,"Svg",!0);class tr extends zt{constructor(t,e=t){super(L("symbol",t),e)}}s({Container:{symbol:Z((function(){return this.put(new tr)}))}}),z(tr,"Symbol");var er={__proto__:null,plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(_.document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)},move:function(t,e,r=this.bbox()){return this.x(t,r).y(e,r)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},center:function(t,e,r=this.bbox()){return this.cx(t,r).cy(e,r)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},amove:function(t,e){return this.ax(t).ay(e)},build:function(t){return this._build=!!t,this}};class rr extends Nt{constructor(t,e=t){super(L("text",t),e),this.dom.leading=new Tt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new Tt(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const r=this.dom.leading;this.each((function(n){const i=_.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=r*new Tt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",n?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new Tt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let r=0;t="";for(let n=0,i=e.length;n{let i;try{i=r.bbox()}catch(t){return}const s=new ft(r),o=s.translate(t,e).transform(s.inverse()),a=new ct(i.x,i.y).transform(o);r.move(a.x,a.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)},size:function(t,e,r=this.bbox()){const n=p(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach(((t,e)=>{const n=new ct(r).transform(new ft(t).inverse());t.scale(i,s,n.x,n.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}};class hr extends zt{constructor(t,e=t){super(L("g",t),e)}}V(hr,ar),s({Container:{group:Z((function(){return this.put(new hr)}))}}),z(hr,"G");class ur extends zt{constructor(t,e=t){super(L("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,w)}}V(ur,ar),s({Container:{link:Z((function(t){return this.put(new ur).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const r=e.index(t);return e.add(this,r),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new ur,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),z(ur,"A");class cr extends zt{constructor(t,e=t){super(L("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return bt('svg [mask*="'+this.id()+'"]')}}s({Container:{mask:Z((function(){return this.defs().put(new cr)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof cr?t:this.parent().mask().add(t);return this.attr("mask",'url("#'+e.id()+'")')},unmask(){return this.attr("mask",null)}}}),z(cr,"Mask");class lr extends jt{constructor(t,e=t){super(L("stop",t),e)}update(t){return("number"==typeof t||t instanceof Tt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new Tt(t.offset)),this}}s({Gradient:{stop:function(t,e,r){return this.put(new lr).update(t,e,r)}}}),z(lr,"Stop");class fr extends jt{constructor(t,e=t){super(L("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,r={}){return this.rule("@font-face",{fontFamily:t,src:e,...r})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let r=t+"{";for(const t in e)r+=f(t)+":"+e[t]+";";return r+="}",r}(t,e))}}s("Dom",{style(t,e){return this.put(new fr).rule(t,e)},fontface(t,e,r){return this.put(new fr).font(t,e,r)}}),z(fr,"Style");class dr extends rr{constructor(t,e=t){super(L("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let r=null;return e&&(r=e.plot(t)),null==t?r:this}track(){return this.reference("href")}}s({Container:{textPath:Z((function(t,e){return t instanceof rr||(t=this.text(t)),t.path(e)}))},Text:{path:Z((function(t,e=!0){const r=new dr;let n;if(t instanceof je||(t=this.defs().path(t)),r.attr("href","#"+t,w),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)})),textPath(){return this.findOne("textPath")}},Path:{text:Z((function(t){return t instanceof rr||(t=(new rr).addTo(this.parent()).text(t)),t.path(this)})),targets(){return bt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),dr.prototype.MorphArray=Oe,z(dr,"TextPath");class pr extends Nt{constructor(t,e=t){super(L("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,w)}}s({Container:{use:Z((function(t,e){return this.put(new pr).use(t,e)}))}}),z(pr,"Use");const mr=T;V([Ke,tr,se,ie,ue],o("viewbox")),V([he,qe,ze,je],o("marker")),V(rr,o("Text")),V(je,o("Path")),V(qt,o("Defs")),V([rr,nr],o("Tspan")),V([Ne,Jt,ne,$e],o("radius")),V(Et,o("EventTarget")),V(Ft,o("Dom")),V(jt,o("Element")),V(Nt,o("Shape")),V([zt,Qt],o("Container")),V(ne,o("Gradient")),V($e,o("Runner")),vt.extend([...new Set(i)]),Le([Tt,ut,mt,ft,Rt,oe,Oe]),Fe()},725:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.rgbToHsl=e.hslToRgb=e.rgbToHex=void 0,e.rgbToHex=function(t,e,r){return`#${((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}`},e.hslToRgb=function(t,e,r){let n,i,s;if(t/=360,r/=100,0==(e/=100))n=i=s=r;else{const o=(t,e,r)=>(r+=r<0?1:r>1?-1:0)<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,a=r<.5?r*(1+e):r+e-r*e,h=2*r-a;n=o(h,a,t+1/3),i=o(h,a,t),s=o(h,a,t-1/3)}return[.5+255*n<<0,.5+255*i<<0,.5+255*s<<0]},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;const n=Math.max(t,e,r),i=Math.min(t,e,r),s=(n+i)/2;let o,a;if(n===i)o=a=0;else{const h=n-i;switch(a=s>.5?h/(2-n-i):h/(n+i),n){case t:o=(e-r)/h+(e{Object.defineProperty(e,"__esModule",{value:!0}),e.default={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",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",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",rebeccapurple:"#663399",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",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},688:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(785),e),i(r(725),e),i(r(951),e)},951:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.parseColorAndConvert=void 0;const n=r(202),i=r(725);function s(t){if("number"==typeof t)return t>16777215?{type:"rgb",a:t>>24&255,b:t>>16&255,c:t>>8&255,alpha:(255&t)/255}:{type:"rgb",a:t>>16&255,b:t>>8&255,c:255&t,alpha:1};t=t.replace(/\s/g,""),n.default[t]&&(t=n.default[t]);let e=/^#([0-9a-f]{3,8})$/i.exec(t);if(e){const t=e[1];return 3===t.length?{type:"rgb",a:parseInt(t[0]+t[0],16),b:parseInt(t[1]+t[1],16),c:parseInt(t[2]+t[2],16),alpha:1}:{type:"rgb",a:parseInt(t[0]+t[1],16),b:parseInt(t[2]+t[3],16),c:parseInt(t[4]+t[5],16),alpha:t.length>6?parseInt(t.substring(6),16)/255:1}}if(e=/^((hsl|rgb)a?)\((\d+),(\d+)%?,(\d+)%?,?(.+)?\)$/i.exec(t),e){const[,,t,r,n,i,s]=e;return{type:t,a:+r,b:+n,c:+i,alpha:s?+s:1}}}e.parseColorAndConvert=function(t){const e=s(t);if(e){if("hsl"===e.type){const[t,r,n]=i.hslToRgb(e.a,e.b,e.c);return{r:t,g:r,b:n,h:e.a,s:e.b,l:e.c,alpha:e.alpha}}{const[t,r,n]=i.rgbToHsl(e.a,e.b,e.c);return{h:t,s:r,l:n,r:e.a,g:e.b,b:e.c,alpha:e.alpha}}}},e.parseColor=s},785:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},926:t=>{var e;window,e=function(){return(()=>{var t=[function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.log=e.PI2=e.PHI=e.Vec2=e.distributePointsInBuffer=e.prepareBufferForInterpolation=e.interpolate=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.now=e.toRadians=e.toDegrees=e.relativeClamp=e.clamp=e.lerp=void 0,i(r(1),e),r(10).glMatrix.setMatrixArrayType(Array),i(r(21),e),i(r(22),e),i(r(23),e),i(r(24),e),i(r(33),e),i(r(34),e),i(r(35),e),i(r(32),e),i(r(36),e),i(r(37),e),i(r(38),e),i(r(39),e),i(r(40),e),i(r(41),e),i(r(42),e),i(r(43),e),i(r(44),e),i(r(45),e),i(r(46),e),i(r(47),e),i(r(29),e),i(r(48),e);var s=r(30);Object.defineProperty(e,"lerp",{enumerable:!0,get:function(){return s.lerp}}),Object.defineProperty(e,"clamp",{enumerable:!0,get:function(){return s.clamp}}),Object.defineProperty(e,"relativeClamp",{enumerable:!0,get:function(){return s.relativeClamp}}),Object.defineProperty(e,"toDegrees",{enumerable:!0,get:function(){return s.toDegrees}}),Object.defineProperty(e,"toRadians",{enumerable:!0,get:function(){return s.toRadians}}),Object.defineProperty(e,"now",{enumerable:!0,get:function(){return s.now}}),Object.defineProperty(e,"noise",{enumerable:!0,get:function(){return s.noise}}),Object.defineProperty(e,"random",{enumerable:!0,get:function(){return s.random}}),Object.defineProperty(e,"angleFromRepetition",{enumerable:!0,get:function(){return s.angleFromRepetition}}),Object.defineProperty(e,"angle2FromRepetition",{enumerable:!0,get:function(){return s.angle2FromRepetition}}),Object.defineProperty(e,"distanceFromRepetition",{enumerable:!0,get:function(){return s.distanceFromRepetition}}),Object.defineProperty(e,"interpolate",{enumerable:!0,get:function(){return s.interpolate}}),Object.defineProperty(e,"prepareBufferForInterpolation",{enumerable:!0,get:function(){return s.prepareBufferForInterpolation}}),Object.defineProperty(e,"distributePointsInBuffer",{enumerable:!0,get:function(){return s.distributePointsInBuffer}});var o=r(26);Object.defineProperty(e,"Vec2",{enumerable:!0,get:function(){return o.default}});var a=r(27);Object.defineProperty(e,"PHI",{enumerable:!0,get:function(){return a.PHI}}),Object.defineProperty(e,"PI2",{enumerable:!0,get:function(){return a.PI2}}),Object.defineProperty(e,"log",{enumerable:!0,get:function(){return a.log}}),Object.defineProperty(e,"mod",{enumerable:!0,get:function(){return a.mod}})},function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(2),e),i(r(3),e),i(r(4),e),i(r(5),e),i(r(6),e),i(r(7),e),i(r(8),e),i(r(9),e)},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},(t,e)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]="Ring",r[r.Matrix=2]="Matrix"},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},(t,e)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]="Relative",r[r.Fixed=2]="Fixed"},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},(t,e,r)=>{r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>s,mat3:()=>o,mat4:()=>a,quat:()=>h,quat2:()=>u,vec2:()=>c,vec3:()=>l,vec4:()=>f});var n=r(11),i=r(12),s=r(13),o=r(14),a=r(15),h=r(16),u=r(19),c=r(20),l=r(18),f=r(17)},(t,e,r)=>{r.r(e),r.d(e,{EPSILON:()=>n,ARRAY_TYPE:()=>i,RANDOM:()=>s,setMatrixArrayType:()=>o,toRadian:()=>h,equals:()=>u});var n=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array,s=Math.random;function o(t){i=t}var a=Math.PI/180;function h(t){return t*a}function u(t,e){return Math.abs(t-e)<=n*Math.max(1,Math.abs(t),Math.abs(e))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},(t,e,r)=>{r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,identity:()=>a,fromValues:()=>h,set:()=>u,transpose:()=>c,invert:()=>l,adjoint:()=>f,determinant:()=>d,multiply:()=>p,rotate:()=>m,scale:()=>g,fromRotation:()=>v,fromScaling:()=>y,str:()=>b,frob:()=>w,LDU:()=>M,add:()=>x,subtract:()=>_,exactEquals:()=>S,equals:()=>P,multiplyScalar:()=>A,multiplyScalarAndAdd:()=>O,mul:()=>E,sub:()=>k});var n=r(11);function i(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function s(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function a(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function h(t,e,r,i){var s=new n.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=r,s[3]=i,s}function u(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function c(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function l(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*s-i*n;return o?(o=1/o,t[0]=s*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}function f(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function d(t){return t[0]*t[3]-t[2]*t[1]}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*a+s*h,t[1]=i*a+o*h,t[2]=n*u+s*c,t[3]=i*u+o*c,t}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+s*a,t[1]=i*h+o*a,t[2]=n*-a+s*h,t[3]=i*-a+o*h,t}function g(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1];return t[0]=n*a,t[1]=i*a,t[2]=s*h,t[3]=o*h,t}function v(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function y(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function b(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function w(t){return Math.hypot(t[0],t[1],t[2],t[3])}function M(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function x(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function _(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function S(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function P(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=e[0],h=e[1],u=e[2],c=e[3];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-h)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-u)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}function A(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function O(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}var E=p,k=_},(t,e,r)=>{r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,identity:()=>a,fromValues:()=>h,set:()=>u,invert:()=>c,determinant:()=>l,multiply:()=>f,rotate:()=>d,scale:()=>p,translate:()=>m,fromRotation:()=>g,fromScaling:()=>v,fromTranslation:()=>y,str:()=>b,frob:()=>w,add:()=>M,subtract:()=>x,multiplyScalar:()=>_,multiplyScalarAndAdd:()=>S,exactEquals:()=>P,equals:()=>A,mul:()=>O,sub:()=>E});var n=r(11);function i(){var t=new n.ARRAY_TYPE(6);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function s(t){var e=new n.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function a(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function h(t,e,r,i,s,o){var a=new n.ARRAY_TYPE(6);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a[4]=s,a[5]=o,a}function u(t,e,r,n,i,s,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t}function c(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=r*s-n*i;return h?(h=1/h,t[0]=s*h,t[1]=-n*h,t[2]=-i*h,t[3]=r*h,t[4]=(i*a-s*o)*h,t[5]=(n*o-r*a)*h,t):null}function l(t){return t[0]*t[3]-t[1]*t[2]}function f(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1],l=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*u+s*c,t[1]=i*u+o*c,t[2]=n*l+s*f,t[3]=i*l+o*f,t[4]=n*d+s*p+a,t[5]=i*d+o*p+h,t}function d(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*u,t[1]=i*c+o*u,t[2]=n*-u+s*c,t[3]=i*-u+o*c,t[4]=a,t[5]=h,t}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1];return t[0]=n*u,t[1]=i*u,t[2]=s*c,t[3]=o*c,t[4]=a,t[5]=h,t}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=n*u+s*c+a,t[5]=i*u+o*c+h,t}function g(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function v(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function y(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function b(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function w(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function M(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function x(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function _(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function S(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function P(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function A(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=e[0],c=e[1],l=e[2],f=e[3],d=e[4],p=e[5];return Math.abs(r-u)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-c)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(s-l)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(o-f)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-d)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(h-p)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(p))}var O=f,E=x},(t,e,r)=>{r.r(e),r.d(e,{create:()=>i,fromMat4:()=>s,clone:()=>o,copy:()=>a,fromValues:()=>h,set:()=>u,identity:()=>c,transpose:()=>l,invert:()=>f,adjoint:()=>d,determinant:()=>p,multiply:()=>m,translate:()=>g,rotate:()=>v,scale:()=>y,fromTranslation:()=>b,fromRotation:()=>w,fromScaling:()=>M,fromMat2d:()=>x,fromQuat:()=>_,normalFromMat4:()=>S,projection:()=>P,str:()=>A,frob:()=>O,add:()=>E,subtract:()=>k,multiplyScalar:()=>I,multiplyScalarAndAdd:()=>C,exactEquals:()=>B,equals:()=>R,mul:()=>T,sub:()=>L});var n=r(11);function i(){var t=new n.ARRAY_TYPE(9);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function o(t){var e=new n.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function h(t,e,r,i,s,o,a,h,u){var c=new n.ARRAY_TYPE(9);return c[0]=t,c[1]=e,c[2]=r,c[3]=i,c[4]=s,c[5]=o,c[6]=a,c[7]=h,c[8]=u,c}function u(t,e,r,n,i,s,o,a,h,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t}function c(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function l(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function f(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=c*o-a*u,f=-c*s+a*h,d=u*s-o*h,p=r*l+n*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-c*n+i*u)*p,t[2]=(a*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*h)*p,t[5]=(-a*r+i*s)*p,t[6]=d*p,t[7]=(-u*r+n*h)*p,t[8]=(o*r-n*s)*p,t):null}function d(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8];return t[0]=o*c-a*u,t[1]=i*u-n*c,t[2]=n*a-i*o,t[3]=a*h-s*c,t[4]=r*c-i*h,t[5]=i*s-r*a,t[6]=s*u-o*h,t[7]=n*h-r*u,t[8]=r*o-n*s,t}function p(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],h=t[7],u=t[8];return e*(u*s-o*h)+r*(-u*i+o*a)+n*(h*i-s*a)}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=r[0],d=r[1],p=r[2],m=r[3],g=r[4],v=r[5],y=r[6],b=r[7],w=r[8];return t[0]=f*n+d*o+p*u,t[1]=f*i+d*a+p*c,t[2]=f*s+d*h+p*l,t[3]=m*n+g*o+v*u,t[4]=m*i+g*a+v*c,t[5]=m*s+g*h+v*l,t[6]=y*n+b*o+w*u,t[7]=y*i+b*a+w*c,t[8]=y*s+b*h+w*l,t}function g(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=h,t[6]=f*n+d*o+u,t[7]=f*i+d*a+c,t[8]=f*s+d*h+l,t}function v(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*a,t[2]=d*s+f*h,t[3]=d*o-f*n,t[4]=d*a-f*i,t[5]=d*h-f*s,t[6]=u,t[7]=c,t[8]=l,t}function y(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function b(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function w(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function M(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function x(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function _(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,h=i+i,u=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*h,m=s*o,g=s*a,v=s*h;return t[0]=1-l-p,t[3]=c-v,t[6]=f+g,t[1]=c+v,t[4]=1-u-p,t[7]=d-m,t[2]=f-g,t[5]=d+m,t[8]=1-u-l,t}function S(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*h-i*o,w=r*u-s*o,M=n*h-i*a,x=n*u-s*a,_=i*u-s*h,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,O=l*g-f*m,E=l*v-d*m,k=f*v-d*g,I=y*k-b*E+w*O+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-h*E+u*O)*I,t[1]=(h*A-o*k-u*P)*I,t[2]=(o*E-a*A+u*S)*I,t[3]=(i*E-n*k-s*O)*I,t[4]=(r*k-i*A+s*P)*I,t[5]=(n*A-r*E-s*S)*I,t[6]=(m*_-g*x+v*M)*I,t[7]=(g*w-p*_-v*b)*I,t[8]=(p*x-m*w+v*y)*I,t):null}function P(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function A(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function O(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function E(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function k(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function I(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function C(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function B(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function R(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=t[6],c=t[7],l=t[8],f=e[0],d=e[1],p=e[2],m=e[3],g=e[4],v=e[5],y=e[6],b=e[7],w=e[8];return Math.abs(r-f)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(i-d)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(s-p)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(o-m)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(a-g)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(h-v)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(v))&&Math.abs(u-y)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-b)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(l-w)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(w))}var T=m,L=k},(t,e,r)=>{r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,fromValues:()=>a,set:()=>h,identity:()=>u,transpose:()=>c,invert:()=>l,adjoint:()=>f,determinant:()=>d,multiply:()=>p,translate:()=>m,scale:()=>g,rotate:()=>v,rotateX:()=>y,rotateY:()=>b,rotateZ:()=>w,fromTranslation:()=>M,fromScaling:()=>x,fromRotation:()=>_,fromXRotation:()=>S,fromYRotation:()=>P,fromZRotation:()=>A,fromRotationTranslation:()=>O,fromQuat2:()=>E,getTranslation:()=>k,getScaling:()=>I,getRotation:()=>C,fromRotationTranslationScale:()=>B,fromRotationTranslationScaleOrigin:()=>R,fromQuat:()=>T,frustum:()=>L,perspective:()=>F,perspectiveFromFieldOfView:()=>j,ortho:()=>D,lookAt:()=>z,targetTo:()=>q,str:()=>N,frob:()=>U,add:()=>Y,subtract:()=>V,multiplyScalar:()=>Z,multiplyScalarAndAdd:()=>G,exactEquals:()=>$,equals:()=>X,mul:()=>H,sub:()=>W});var n=r(11);function i(){var t=new n.ARRAY_TYPE(16);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function s(t){var e=new n.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function a(t,e,r,i,s,o,a,h,u,c,l,f,d,p,m,g){var v=new n.ARRAY_TYPE(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=i,v[4]=s,v[5]=o,v[6]=a,v[7]=h,v[8]=u,v[9]=c,v[10]=l,v[11]=f,v[12]=d,v[13]=p,v[14]=m,v[15]=g,v}function h(t,e,r,n,i,s,o,a,h,u,c,l,f,d,p,m,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t[9]=c,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=g,t}function u(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function c(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=i,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function l(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*h-i*o,w=r*u-s*o,M=n*h-i*a,x=n*u-s*a,_=i*u-s*h,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,O=l*g-f*m,E=l*v-d*m,k=f*v-d*g,I=y*k-b*E+w*O+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-h*E+u*O)*I,t[1]=(i*E-n*k-s*O)*I,t[2]=(m*_-g*x+v*M)*I,t[3]=(f*x-l*_-d*M)*I,t[4]=(h*A-o*k-u*P)*I,t[5]=(r*k-i*A+s*P)*I,t[6]=(g*w-p*_-v*b)*I,t[7]=(c*_-f*w+d*b)*I,t[8]=(o*E-a*A+u*S)*I,t[9]=(n*A-r*E-s*S)*I,t[10]=(p*x-m*w+v*y)*I,t[11]=(l*w-c*x-d*y)*I,t[12]=(a*P-o*O-h*S)*I,t[13]=(r*O-n*P+i*S)*I,t[14]=(m*b-p*M-g*y)*I,t[15]=(c*M-l*b+f*y)*I,t):null}function f(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15];return t[0]=a*(f*v-d*g)-l*(h*v-u*g)+m*(h*d-u*f),t[1]=-(n*(f*v-d*g)-l*(i*v-s*g)+m*(i*d-s*f)),t[2]=n*(h*v-u*g)-a*(i*v-s*g)+m*(i*u-s*h),t[3]=-(n*(h*d-u*f)-a*(i*d-s*f)+l*(i*u-s*h)),t[4]=-(o*(f*v-d*g)-c*(h*v-u*g)+p*(h*d-u*f)),t[5]=r*(f*v-d*g)-c*(i*v-s*g)+p*(i*d-s*f),t[6]=-(r*(h*v-u*g)-o*(i*v-s*g)+p*(i*u-s*h)),t[7]=r*(h*d-u*f)-o*(i*d-s*f)+c*(i*u-s*h),t[8]=o*(l*v-d*m)-c*(a*v-u*m)+p*(a*d-u*l),t[9]=-(r*(l*v-d*m)-c*(n*v-s*m)+p*(n*d-s*l)),t[10]=r*(a*v-u*m)-o*(n*v-s*m)+p*(n*u-s*a),t[11]=-(r*(a*d-u*l)-o*(n*d-s*l)+c*(n*u-s*a)),t[12]=-(o*(l*g-f*m)-c*(a*g-h*m)+p*(a*f-h*l)),t[13]=r*(l*g-f*m)-c*(n*g-i*m)+p*(n*f-i*l),t[14]=-(r*(a*g-h*m)-o*(n*g-i*m)+p*(n*h-i*a)),t[15]=r*(a*f-h*l)-o*(n*f-i*l)+c*(n*h-i*a),t}function d(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],h=t[7],u=t[8],c=t[9],l=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*s)*(l*g-f*m)-(e*a-n*s)*(c*g-f*p)+(e*h-i*s)*(c*m-l*p)+(r*a-n*o)*(u*g-f*d)-(r*h-i*o)*(u*m-l*d)+(n*h-i*a)*(u*p-c*d)}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],v=e[14],y=e[15],b=r[0],w=r[1],M=r[2],x=r[3];return t[0]=b*n+w*a+M*l+x*m,t[1]=b*i+w*h+M*f+x*g,t[2]=b*s+w*u+M*d+x*v,t[3]=b*o+w*c+M*p+x*y,b=r[4],w=r[5],M=r[6],x=r[7],t[4]=b*n+w*a+M*l+x*m,t[5]=b*i+w*h+M*f+x*g,t[6]=b*s+w*u+M*d+x*v,t[7]=b*o+w*c+M*p+x*y,b=r[8],w=r[9],M=r[10],x=r[11],t[8]=b*n+w*a+M*l+x*m,t[9]=b*i+w*h+M*f+x*g,t[10]=b*s+w*u+M*d+x*v,t[11]=b*o+w*c+M*p+x*y,b=r[12],w=r[13],M=r[14],x=r[15],t[12]=b*n+w*a+M*l+x*m,t[13]=b*i+w*h+M*f+x*g,t[14]=b*s+w*u+M*d+x*v,t[15]=b*o+w*c+M*p+x*y,t}function m(t,e,r){var n,i,s,o,a,h,u,c,l,f,d,p,m=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=h,t[6]=u,t[7]=c,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+a*g+l*v+e[12],t[13]=i*m+h*g+f*v+e[13],t[14]=s*m+u*g+d*v+e[14],t[15]=o*m+c*g+p*v+e[15]),t}function g(t,e,r){var n=r[0],i=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function v(t,e,r,i){var s,o,a,h,u,c,l,f,d,p,m,g,v,y,b,w,M,x,_,S,P,A,O,E,k=i[0],I=i[1],C=i[2],B=Math.hypot(k,I,C);return B0?(r[0]=2*(h*a+l*i+u*o-c*s)/f,r[1]=2*(u*a+l*s+c*i-h*o)/f,r[2]=2*(c*a+l*o+h*s-u*i)/f):(r[0]=2*(h*a+l*i+u*o-c*s),r[1]=2*(u*a+l*s+c*i-h*o),r[2]=2*(c*a+l*o+h*s-u*i)),O(t,e,r),t}function k(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function I(t,e){var r=e[0],n=e[1],i=e[2],s=e[4],o=e[5],a=e[6],h=e[8],u=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(s,o,a),t[2]=Math.hypot(h,u,c),t}function C(t,e){var r=new n.ARRAY_TYPE(3);I(r,e);var i=1/r[0],s=1/r[1],o=1/r[2],a=e[0]*i,h=e[1]*s,u=e[2]*o,c=e[4]*i,l=e[5]*s,f=e[6]*o,d=e[8]*i,p=e[9]*s,m=e[10]*o,g=a+l+m,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(f-p)/v,t[1]=(d-u)/v,t[2]=(h-c)/v):a>l&&a>m?(v=2*Math.sqrt(1+a-l-m),t[3]=(f-p)/v,t[0]=.25*v,t[1]=(h+c)/v,t[2]=(d+u)/v):l>m?(v=2*Math.sqrt(1+l-a-m),t[3]=(d-u)/v,t[0]=(h+c)/v,t[1]=.25*v,t[2]=(f+p)/v):(v=2*Math.sqrt(1+m-a-l),t[3]=(h-c)/v,t[0]=(d+u)/v,t[1]=(f+p)/v,t[2]=.25*v),t}function B(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3],h=i+i,u=s+s,c=o+o,l=i*h,f=i*u,d=i*c,p=s*u,m=s*c,g=o*c,v=a*h,y=a*u,b=a*c,w=n[0],M=n[1],x=n[2];return t[0]=(1-(p+g))*w,t[1]=(f+b)*w,t[2]=(d-y)*w,t[3]=0,t[4]=(f-b)*M,t[5]=(1-(l+g))*M,t[6]=(m+v)*M,t[7]=0,t[8]=(d+y)*x,t[9]=(m-v)*x,t[10]=(1-(l+p))*x,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function R(t,e,r,n,i){var s=e[0],o=e[1],a=e[2],h=e[3],u=s+s,c=o+o,l=a+a,f=s*u,d=s*c,p=s*l,m=o*c,g=o*l,v=a*l,y=h*u,b=h*c,w=h*l,M=n[0],x=n[1],_=n[2],S=i[0],P=i[1],A=i[2],O=(1-(m+v))*M,E=(d+w)*M,k=(p-b)*M,I=(d-w)*x,C=(1-(f+v))*x,B=(g+y)*x,R=(p+b)*_,T=(g-y)*_,L=(1-(f+m))*_;return t[0]=O,t[1]=E,t[2]=k,t[3]=0,t[4]=I,t[5]=C,t[6]=B,t[7]=0,t[8]=R,t[9]=T,t[10]=L,t[11]=0,t[12]=r[0]+S-(O*S+I*P+R*A),t[13]=r[1]+P-(E*S+C*P+T*A),t[14]=r[2]+A-(k*S+B*P+L*A),t[15]=1,t}function T(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,h=i+i,u=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*h,m=s*o,g=s*a,v=s*h;return t[0]=1-l-p,t[1]=c+v,t[2]=f-g,t[3]=0,t[4]=c-v,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-u-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function L(t,e,r,n,i,s,o){var a=1/(r-e),h=1/(i-n),u=1/(s-o);return t[0]=2*s*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*h,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*h,t[10]=(o+s)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*u,t[15]=0,t}function F(t,e,r,n,i){var s,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(s=1/(n-i),t[10]=(i+n)*s,t[14]=2*i*n*s):(t[10]=-1,t[14]=-2*n),t}function j(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),h=2/(o+a),u=2/(i+s);return t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-a)*h*.5,t[9]=(i-s)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function D(t,e,r,n,i,s,o){var a=1/(e-r),h=1/(n-i),u=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*h,t[14]=(o+s)*u,t[15]=1,t}function z(t,e,r,i){var s,o,a,h,c,l,f,d,p,m,g=e[0],v=e[1],y=e[2],b=i[0],w=i[1],M=i[2],x=r[0],_=r[1],S=r[2];return Math.abs(g-x)0&&(c*=d=1/Math.sqrt(d),l*=d,f*=d);var p=h*f-u*l,m=u*c-a*f,g=a*l-h*c;return(d=p*p+m*m+g*g)>0&&(p*=d=1/Math.sqrt(d),m*=d,g*=d),t[0]=p,t[1]=m,t[2]=g,t[3]=0,t[4]=l*g-f*m,t[5]=f*p-c*g,t[6]=c*m-l*p,t[7]=0,t[8]=c,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=s,t[14]=o,t[15]=1,t}function N(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function U(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Y(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function V(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function Z(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function G(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function $(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function X(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=t[6],c=t[7],l=t[8],f=t[9],d=t[10],p=t[11],m=t[12],g=t[13],v=t[14],y=t[15],b=e[0],w=e[1],M=e[2],x=e[3],_=e[4],S=e[5],P=e[6],A=e[7],O=e[8],E=e[9],k=e[10],I=e[11],C=e[12],B=e[13],R=e[14],T=e[15];return Math.abs(r-b)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-w)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(w))&&Math.abs(s-M)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(o-x)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(a-_)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(h-S)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(u-P)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(P))&&Math.abs(c-A)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(l-O)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(f-E)<=n.EPSILON*Math.max(1,Math.abs(f),Math.abs(E))&&Math.abs(d-k)<=n.EPSILON*Math.max(1,Math.abs(d),Math.abs(k))&&Math.abs(p-I)<=n.EPSILON*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(m-C)<=n.EPSILON*Math.max(1,Math.abs(m),Math.abs(C))&&Math.abs(g-B)<=n.EPSILON*Math.max(1,Math.abs(g),Math.abs(B))&&Math.abs(v-R)<=n.EPSILON*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(y-T)<=n.EPSILON*Math.max(1,Math.abs(y),Math.abs(T))}var H=p,W=V},(t,e,r)=>{r.r(e),r.d(e,{create:()=>a,identity:()=>h,setAxisAngle:()=>u,getAxisAngle:()=>c,getAngle:()=>l,multiply:()=>f,rotateX:()=>d,rotateY:()=>p,rotateZ:()=>m,calculateW:()=>g,exp:()=>v,ln:()=>y,pow:()=>b,slerp:()=>w,random:()=>M,invert:()=>x,conjugate:()=>_,fromMat3:()=>S,fromEuler:()=>P,str:()=>A,clone:()=>R,fromValues:()=>T,copy:()=>L,set:()=>F,add:()=>j,mul:()=>D,scale:()=>z,dot:()=>q,lerp:()=>N,length:()=>U,len:()=>Y,squaredLength:()=>V,sqrLen:()=>Z,normalize:()=>G,exactEquals:()=>$,equals:()=>X,rotationTo:()=>H,sqlerp:()=>W,setAxes:()=>J});var n=r(11),i=r(14),s=r(18),o=r(17);function a(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function h(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function u(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function c(t,e){var r=2*Math.acos(e[3]),i=Math.sin(r/2);return i>n.EPSILON?(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i):(t[0]=1,t[1]=0,t[2]=0),r}function l(t,e){var r=q(t,e);return Math.acos(2*r*r-1)}function f(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*c+o*a+i*u-s*h,t[1]=i*c+o*h+s*a-n*u,t[2]=s*c+o*u+n*h-i*a,t[3]=o*c-n*a-i*h-s*u,t}function d(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+o*a,t[1]=i*h+s*a,t[2]=s*h-i*a,t[3]=o*h-n*a,t}function p(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h-s*a,t[1]=i*h+o*a,t[2]=s*h+n*a,t[3]=o*h-i*a,t}function m(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+i*a,t[1]=i*h-n*a,t[2]=s*h+o*a,t[3]=o*h-s*a,t}function g(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function v(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=Math.exp(s),h=o>0?a*Math.sin(o)/o:0;return t[0]=r*h,t[1]=n*h,t[2]=i*h,t[3]=a*Math.cos(o),t}function y(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=o>0?Math.atan2(o,s)/o:0;return t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=.5*Math.log(r*r+n*n+i*i+s*s),t}function b(t,e,r){return y(t,e),z(t,t,r),v(t,t),t}function w(t,e,r,i){var s,o,a,h,u,c=e[0],l=e[1],f=e[2],d=e[3],p=r[0],m=r[1],g=r[2],v=r[3];return(o=c*p+l*m+f*g+d*v)<0&&(o=-o,p=-p,m=-m,g=-g,v=-v),1-o>n.EPSILON?(s=Math.acos(o),a=Math.sin(s),h=Math.sin((1-i)*s)/a,u=Math.sin(i*s)/a):(h=1-i,u=i),t[0]=h*c+u*p,t[1]=h*l+u*m,t[2]=h*f+u*g,t[3]=h*d+u*v,t}function M(t){var e=n.RANDOM(),r=n.RANDOM(),i=n.RANDOM(),s=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=s*Math.sin(2*Math.PI*r),t[1]=s*Math.cos(2*Math.PI*r),t[2]=o*Math.sin(2*Math.PI*i),t[3]=o*Math.cos(2*Math.PI*i),t}function x(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s,a=o?1/o:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=s*a,t}function _(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function S(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var s=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*s+s]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*s+o]-e[3*o+s])*r,t[s]=(e[3*s+i]+e[3*i+s])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t}function P(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var s=Math.sin(e),o=Math.cos(e),a=Math.sin(r),h=Math.cos(r),u=Math.sin(n),c=Math.cos(n);return t[0]=s*h*c-o*a*u,t[1]=o*a*c+s*h*u,t[2]=o*h*u-s*a*c,t[3]=o*h*c+s*a*u,t}function A(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var O,E,k,I,C,B,R=o.clone,T=o.fromValues,L=o.copy,F=o.set,j=o.add,D=f,z=o.scale,q=o.dot,N=o.lerp,U=o.length,Y=U,V=o.squaredLength,Z=V,G=o.normalize,$=o.exactEquals,X=o.equals,H=(O=s.create(),E=s.fromValues(1,0,0),k=s.fromValues(0,1,0),function(t,e,r){var n=s.dot(e,r);return n<-.999999?(s.cross(O,E,e),s.len(O)<1e-6&&s.cross(O,k,e),s.normalize(O,O),u(t,O,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(s.cross(O,e,r),t[0]=O[0],t[1]=O[1],t[2]=O[2],t[3]=1+n,G(t,t))}),W=(I=a(),C=a(),function(t,e,r,n,i,s){return w(I,e,i,s),w(C,r,n,s),w(t,I,C,2*s*(1-s)),t}),J=(B=i.create(),function(t,e,r,n){return B[0]=r[0],B[3]=r[1],B[6]=r[2],B[1]=n[0],B[4]=n[1],B[7]=n[2],B[2]=-e[0],B[5]=-e[1],B[8]=-e[2],G(t,S(t,B))})},(t,e,r)=>{r.r(e),r.d(e,{create:()=>i,clone:()=>s,fromValues:()=>o,copy:()=>a,set:()=>h,add:()=>u,subtract:()=>c,multiply:()=>l,divide:()=>f,ceil:()=>d,floor:()=>p,min:()=>m,max:()=>g,round:()=>v,scale:()=>y,scaleAndAdd:()=>b,distance:()=>w,squaredDistance:()=>M,length:()=>x,squaredLength:()=>_,negate:()=>S,inverse:()=>P,normalize:()=>A,dot:()=>O,cross:()=>E,lerp:()=>k,random:()=>I,transformMat4:()=>C,transformQuat:()=>B,zero:()=>R,str:()=>T,exactEquals:()=>L,equals:()=>F,sub:()=>D,mul:()=>z,div:()=>q,dist:()=>N,sqrDist:()=>U,len:()=>Y,sqrLen:()=>V,forEach:()=>Z});var n=r(11);function i(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function s(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(t,e,r,i){var s=new n.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=r,s[3]=i,s}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function h(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function u(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function l(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}function f(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function m(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}function g(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}function v(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function y(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function b(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}function w(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return Math.hypot(r,n,i,s)}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return r*r+n*n+i*i+s*s}function x(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}function _(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function P(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function A(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s;return o>0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=s*o,t}function O(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function E(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],s=r[0]*n[2]-r[2]*n[0],o=r[0]*n[3]-r[3]*n[0],a=r[1]*n[2]-r[2]*n[1],h=r[1]*n[3]-r[3]*n[1],u=r[2]*n[3]-r[3]*n[2],c=e[0],l=e[1],f=e[2],d=e[3];return t[0]=l*u-f*h+d*a,t[1]=-c*u+f*o-d*s,t[2]=c*h-l*o+d*i,t[3]=-c*a+l*s-f*i,t}function k(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t[3]=a+n*(r[3]-a),t}function I(t,e){var r,i,s,o,a,h;e=e||1;do{a=(r=2*n.RANDOM()-1)*r+(i=2*n.RANDOM()-1)*i}while(a>=1);do{h=(s=2*n.RANDOM()-1)*s+(o=2*n.RANDOM()-1)*o}while(h>=1);var u=Math.sqrt((1-a)/h);return t[0]=e*r,t[1]=e*i,t[2]=e*s*u,t[3]=e*o*u,t}function C(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*s+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*s+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*s+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*s+r[15]*o,t}function B(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],h=r[2],u=r[3],c=u*n+a*s-h*i,l=u*i+h*n-o*s,f=u*s+o*i-a*n,d=-o*n-a*i-h*s;return t[0]=c*u+d*-o+l*-h-f*-a,t[1]=l*u+d*-a+f*-o-c*-h,t[2]=f*u+d*-h+c*-a-l*-o,t[3]=e[3],t}function R(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function T(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function L(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function F(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=e[0],h=e[1],u=e[2],c=e[3];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-h)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-u)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}var j,D=c,z=l,q=f,N=w,U=M,Y=x,V=_,Z=(j=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=4),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{r.r(e),r.d(e,{create:()=>i,clone:()=>s,length:()=>o,fromValues:()=>a,copy:()=>h,set:()=>u,add:()=>c,subtract:()=>l,multiply:()=>f,divide:()=>d,ceil:()=>p,floor:()=>m,min:()=>g,max:()=>v,round:()=>y,scale:()=>b,scaleAndAdd:()=>w,distance:()=>M,squaredDistance:()=>x,squaredLength:()=>_,negate:()=>S,inverse:()=>P,normalize:()=>A,dot:()=>O,cross:()=>E,lerp:()=>k,hermite:()=>I,bezier:()=>C,random:()=>B,transformMat4:()=>R,transformMat3:()=>T,transformQuat:()=>L,rotateX:()=>F,rotateY:()=>j,rotateZ:()=>D,angle:()=>z,zero:()=>q,str:()=>N,exactEquals:()=>U,equals:()=>Y,sub:()=>Z,mul:()=>G,div:()=>$,dist:()=>X,sqrDist:()=>H,len:()=>W,sqrLen:()=>J,forEach:()=>Q});var n=r(11);function i(){var t=new n.ARRAY_TYPE(3);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function s(t){var e=new n.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function o(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function a(t,e,r){var i=new n.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=r,i}function h(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function u(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function c(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function l(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function f(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function d(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function p(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function m(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function g(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function v(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function y(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function b(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function w(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function x(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function _(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function P(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function A(t,e){var r=e[0],n=e[1],i=e[2],s=r*r+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function O(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function E(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],h=r[2];return t[0]=i*h-s*a,t[1]=s*o-n*h,t[2]=n*a-i*o,t}function k(t,e,r,n){var i=e[0],s=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t}function I(t,e,r,n,i,s){var o=s*s,a=o*(2*s-3)+1,h=o*(s-2)+s,u=o*(s-1),c=o*(3-2*s);return t[0]=e[0]*a+r[0]*h+n[0]*u+i[0]*c,t[1]=e[1]*a+r[1]*h+n[1]*u+i[1]*c,t[2]=e[2]*a+r[2]*h+n[2]*u+i[2]*c,t}function C(t,e,r,n,i,s){var o=1-s,a=o*o,h=s*s,u=a*o,c=3*s*a,l=3*h*o,f=h*s;return t[0]=e[0]*u+r[0]*c+n[0]*l+i[0]*f,t[1]=e[1]*u+r[1]*c+n[1]*l+i[1]*f,t[2]=e[2]*u+r[2]*c+n[2]*l+i[2]*f,t}function B(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,s=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*s,t[1]=Math.sin(r)*s,t[2]=i*e,t}function R(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[3]*n+r[7]*i+r[11]*s+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*s+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*s+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*s+r[14])/o,t}function T(t,e,r){var n=e[0],i=e[1],s=e[2];return t[0]=n*r[0]+i*r[3]+s*r[6],t[1]=n*r[1]+i*r[4]+s*r[7],t[2]=n*r[2]+i*r[5]+s*r[8],t}function L(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],h=e[1],u=e[2],c=i*u-s*h,l=s*a-n*u,f=n*h-i*a,d=i*f-s*l,p=s*c-n*f,m=n*l-i*c,g=2*o;return c*=g,l*=g,f*=g,d*=2,p*=2,m*=2,t[0]=a+c+d,t[1]=h+l+p,t[2]=u+f+m,t}function F(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0],s[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),s[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function j(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),s[1]=i[1],s[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function D(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),s[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),s[2]=i[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function z(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2],h=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(s*s+o*o+a*a),u=h&&O(t,e)/h;return Math.acos(Math.min(Math.max(u,-1),1))}function q(t){return t[0]=0,t[1]=0,t[2]=0,t}function N(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function U(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Y(t,e){var r=t[0],i=t[1],s=t[2],o=e[0],a=e[1],h=e[2];return Math.abs(r-o)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-a)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(s-h)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(h))}var V,Z=l,G=f,$=d,X=M,H=x,W=o,J=_,Q=(V=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=3),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{r.r(e),r.d(e,{create:()=>o,clone:()=>a,fromValues:()=>h,fromRotationTranslationValues:()=>u,fromRotationTranslation:()=>c,fromTranslation:()=>l,fromRotation:()=>f,fromMat4:()=>d,copy:()=>p,identity:()=>m,set:()=>g,getReal:()=>v,getDual:()=>y,setReal:()=>b,setDual:()=>w,getTranslation:()=>M,translate:()=>x,rotateX:()=>_,rotateY:()=>S,rotateZ:()=>P,rotateByQuatAppend:()=>A,rotateByQuatPrepend:()=>O,rotateAroundAxis:()=>E,add:()=>k,multiply:()=>I,mul:()=>C,scale:()=>B,dot:()=>R,lerp:()=>T,invert:()=>L,conjugate:()=>F,length:()=>j,len:()=>D,squaredLength:()=>z,sqrLen:()=>q,normalize:()=>N,str:()=>U,exactEquals:()=>Y,equals:()=>V});var n=r(11),i=r(16),s=r(15);function o(){var t=new n.ARRAY_TYPE(8);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function a(t){var e=new n.ARRAY_TYPE(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function h(t,e,r,i,s,o,a,h){var u=new n.ARRAY_TYPE(8);return u[0]=t,u[1]=e,u[2]=r,u[3]=i,u[4]=s,u[5]=o,u[6]=a,u[7]=h,u}function u(t,e,r,i,s,o,a){var h=new n.ARRAY_TYPE(8);h[0]=t,h[1]=e,h[2]=r,h[3]=i;var u=.5*s,c=.5*o,l=.5*a;return h[4]=u*i+c*r-l*e,h[5]=c*i+l*t-u*r,h[6]=l*i+u*e-c*t,h[7]=-u*t-c*e-l*r,h}function c(t,e,r){var n=.5*r[0],i=.5*r[1],s=.5*r[2],o=e[0],a=e[1],h=e[2],u=e[3];return t[0]=o,t[1]=a,t[2]=h,t[3]=u,t[4]=n*u+i*h-s*a,t[5]=i*u+s*o-n*h,t[6]=s*u+n*a-i*o,t[7]=-n*o-i*a-s*h,t}function l(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function d(t,e){var r=i.create();s.getRotation(r,e);var o=new n.ARRAY_TYPE(3);return s.getTranslation(o,e),c(t,r,o),t}function p(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function m(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function g(t,e,r,n,i,s,o,a,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t}var v=i.copy;function y(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var b=i.copy;function w(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function M(t,e){var r=e[4],n=e[5],i=e[6],s=e[7],o=-e[0],a=-e[1],h=-e[2],u=e[3];return t[0]=2*(r*u+s*o+n*h-i*a),t[1]=2*(n*u+s*a+i*o-r*h),t[2]=2*(i*u+s*h+r*a-n*o),t}function x(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=.5*r[0],h=.5*r[1],u=.5*r[2],c=e[4],l=e[5],f=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=o*a+i*u-s*h+c,t[5]=o*h+s*a-n*u+l,t[6]=o*u+n*h-i*a+f,t[7]=-n*a-i*h-s*u+d,t}function _(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],h=e[4],u=e[5],c=e[6],l=e[7],f=h*a+l*n+u*o-c*s,d=u*a+l*s+c*n-h*o,p=c*a+l*o+h*s-u*n,m=l*a-h*n-u*s-c*o;return i.rotateX(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function S(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],h=e[4],u=e[5],c=e[6],l=e[7],f=h*a+l*n+u*o-c*s,d=u*a+l*s+c*n-h*o,p=c*a+l*o+h*s-u*n,m=l*a-h*n-u*s-c*o;return i.rotateY(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function P(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],h=e[4],u=e[5],c=e[6],l=e[7],f=h*a+l*n+u*o-c*s,d=u*a+l*s+c*n-h*o,p=c*a+l*o+h*s-u*n,m=l*a-h*n-u*s-c*o;return i.rotateZ(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function A(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],h=e[1],u=e[2],c=e[3];return t[0]=a*o+c*n+h*s-u*i,t[1]=h*o+c*i+u*n-a*s,t[2]=u*o+c*s+a*i-h*n,t[3]=c*o-a*n-h*i-u*s,a=e[4],h=e[5],u=e[6],c=e[7],t[4]=a*o+c*n+h*s-u*i,t[5]=h*o+c*i+u*n-a*s,t[6]=u*o+c*s+a*i-h*n,t[7]=c*o-a*n-h*i-u*s,t}function O(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*c+o*a+i*u-s*h,t[1]=i*c+o*h+s*a-n*u,t[2]=s*c+o*u+n*h-i*a,t[3]=o*c-n*a-i*h-s*u,a=r[4],h=r[5],u=r[6],c=r[7],t[4]=n*c+o*a+i*u-s*h,t[5]=i*c+o*h+s*a-n*u,t[6]=s*c+o*u+n*h-i*a,t[7]=o*c-n*a-i*h-s*u,t}function E(t,e,r,i){if(Math.abs(i)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,s=e[2]/r,o=e[3]/r,a=e[4],h=e[5],u=e[6],c=e[7],l=n*a+i*h+s*u+o*c;t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=(a-n*l)/r,t[5]=(h-i*l)/r,t[6]=(u-s*l)/r,t[7]=(c-o*l)/r}return t}function U(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function Y(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function V(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=t[6],c=t[7],l=e[0],f=e[1],d=e[2],p=e[3],m=e[4],g=e[5],v=e[6],y=e[7];return Math.abs(r-l)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(i-f)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(s-d)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(o-p)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-m)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(h-g)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(g))&&Math.abs(u-v)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(c-y)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(y))}},(t,e,r)=>{r.r(e),r.d(e,{create:()=>i,clone:()=>s,fromValues:()=>o,copy:()=>a,set:()=>h,add:()=>u,subtract:()=>c,multiply:()=>l,divide:()=>f,ceil:()=>d,floor:()=>p,min:()=>m,max:()=>g,round:()=>v,scale:()=>y,scaleAndAdd:()=>b,distance:()=>w,squaredDistance:()=>M,length:()=>x,squaredLength:()=>_,negate:()=>S,inverse:()=>P,normalize:()=>A,dot:()=>O,cross:()=>E,lerp:()=>k,random:()=>I,transformMat2:()=>C,transformMat2d:()=>B,transformMat3:()=>R,transformMat4:()=>T,rotate:()=>L,angle:()=>F,zero:()=>j,str:()=>D,exactEquals:()=>z,equals:()=>q,len:()=>U,sub:()=>Y,mul:()=>V,div:()=>Z,dist:()=>G,sqrDist:()=>$,sqrLen:()=>X,forEach:()=>H});var n=r(11);function i(){var t=new n.ARRAY_TYPE(2);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function s(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e}function o(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r}function a(t,e){return t[0]=e[0],t[1]=e[1],t}function h(t,e,r){return t[0]=e,t[1]=r,t}function u(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function l(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function f(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function m(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function g(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function v(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function y(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function b(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function w(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function x(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function _(t){var e=t[0],r=t[1];return e*e+r*r}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t}function P(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function A(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function O(t,e){return t[0]*e[0]+t[1]*e[1]}function E(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function k(t,e,r,n){var i=e[0],s=e[1];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t}function I(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function C(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function B(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function R(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function T(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function L(t,e,r,n){var i=e[0]-r[0],s=e[1]-r[1],o=Math.sin(n),a=Math.cos(n);return t[0]=i*a-s*o+r[0],t[1]=i*o+s*a+r[1],t}function F(t,e){var r=t[0],n=t[1],i=e[0],s=e[1],o=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+s*s),a=o&&(r*i+n*s)/o;return Math.acos(Math.min(Math.max(a,-1),1))}function j(t){return t[0]=0,t[1]=0,t}function D(t){return"vec2("+t[0]+", "+t[1]+")"}function z(t,e){return t[0]===e[0]&&t[1]===e[1]}function q(t,e){var r=t[0],i=t[1],s=e[0],o=e[1];return Math.abs(r-s)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-o)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))}var N,U=x,Y=c,V=l,Z=f,G=w,$=M,X=_,H=(N=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=2),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{Object.defineProperty(e,"__esModule",{value:!0}),e.Scene=void 0;const n=r(22),i=r(23),s=r(32),o=r(30);class a{constructor(t={}){this.width=400,this.height=400,this.background="hsla(0, 0%, 0%, 1)",this.color="hsla(0, 0%, 100%, 1)",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?(.5+.5*o.clamp(-1,1,t.anchor[0]))*this.width:"left"===t.anchor[0]?0:"right"===t.anchor[0]?this.width:this.center[0],"number"==typeof t.anchor[1]?(.5+.5*o.clamp(-1,1,t.anchor[1]))*this.height:"top"===t.anchor[1]?0:"bottom"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e="number"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,a.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{a.propagateToChilden(t,e)})):t instanceof s.Shape&&t.shape&&(t.shape.scene=e,a.propagateToChilden(t.shape,e))}}e.Scene=a},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||"SceneChild",this.name=t.name||this.type+"_"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){"string"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Group=void 0;const n=r(21),i=r(22),s=r(24),o=r(28);class a extends i.SceneChild{constructor(t={}){t.type="Group",super(t),this.children=[],["id","name","data","order","type"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=o.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){"object"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=a},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBase=void 0;const n=r(10),i=r(1),s=r(25),o=r(26),a=r(27),h=r(28),u=r(30),c=r(22),l=n.mat4.create(),f=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class m extends c.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?-1*u.clamp(-1,1,t.anchor[0]):"left"===t.anchor[0]?1:"right"===t.anchor[0]?-1:0,"number"==typeof t.anchor[1]?-1*u.clamp(-1,1,t.anchor[1]):"top"===t.anchor[1]?1:"bottom"===t.anchor[1]?-1:0]:[0,0],this.boundingType="string"==typeof t.boundingType?"relative"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return"function"!=typeof t.repetitions&&"function"!=typeof t.distance&&"function"!=typeof t.displace&&"function"!=typeof t.scale&&"function"!=typeof t.translate&&"function"!=typeof t.skewX&&"function"!=typeof t.skewY&&"function"!=typeof t.squeezeX&&"function"!=typeof t.squeezeY&&"function"!=typeof t.rotateX&&"function"!=typeof t.rotateY&&"function"!=typeof t.rotateZ&&"function"!=typeof t.transformOrigin&&"function"!=typeof t.perspective&&"function"!=typeof t.perspectiveOrigin}isStaticIndexed(){return"function"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return"function"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){"string"==typeof t?(r=r||"repetitions"==t,this.props[t]=e):(r=r||"repetitions"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var c,g;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const v=m.getEmptyPropArguments(this,r),y=v.repetition,b=this.getProp("repetitions",v,1),w=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,M=Array.isArray(b)?b[0]*(null!==(c=b[1])&&void 0!==c?c:b[0]):b,x=Array.isArray(b)?b[0]:M,_=Array.isArray(b)?null!==(g=b[1])&&void 0!==g?g:b[0]:1,S=y.row;S.count=x;const P=y.col;P.count=_,y.count=M,y.col.count=_,y.row.count=x,y.type=w;let A=0;const O=[];let E=0;const k=n.vec2.fromValues((_-1)/2,(x-1)/2),I=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],C=[void 0,void 0,void 0,void 0],B=[void 0,void 0,void 0,void 0];for(let r=0;r1?E/(M-1):1,y.angle=w===i.ERepetitionType.Ring?a.PI2/M*E:0,P.index=c+1,P.offset=_>1?c/(_-1):1,S.index=r+1,S.offset=x>1?r/(x-1):1;const m=this.generateBuffer(t,v),g=m.length,b=this.getShapeBounding();O[E]=new Float32Array(g),A+=g;{const t=s.toVec2(this.getProp("distance",v,s.VEC2_ZERO)),a=this.getProp("displace",v,0),M=s.toVec3(this.getProp("scale",v,s.VEC2_ONE),1),x=s.toVec3(this.getProp("translate",v,s.VEC2_ZERO),0),_=this.getProp("skewX",v,0),S=this.getProp("skewY",v,0),P=this.getProp("squeezeX",v,0),A=this.getProp("squeezeY",v,0),R=this.getProp("rotateX",v,0),T=this.getProp("rotateY",v,0),L=this.getProp("rotateZ",v,0),F=u.clamp(0,1,this.getProp("perspective",v,0)),j=s.toVec3(this.getProp("perspectiveOrigin",v,s.VEC2_ZERO),0),D=s.toVec3(this.getProp("transformOrigin",v,s.VEC2_ZERO),0);let z;switch(w){case i.ERepetitionType.Ring:z=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(z,z,s.VEC3_ZERO,y.angle+a);break;case i.ERepetitionType.Matrix:z=n.vec3.fromValues(t[1]*(c-k[0]),t[0]*(r-k[1]),0)}const q=F>0?Math.max(b.width,b.height)/2:1,N=F>0?q+10*q*(1-F):0,U=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==F||0!==D[0]||0!==D[1],Y=0!==j[0]||0!==j[1];U&&(this.boundingType===i.EBoundingType.Relative?(D[0]=D[0]*(b.width/2)+b.cx,D[1]=D[1]*(b.height/2)+b.cy):(D[0]*=b.width/2,D[1]*=b.height/2),D[2]=N);{n.mat4.identity(f),U&&n.mat4.translate(f,f,D),0===x[0]&&0===x[1]||n.mat4.translate(f,f,x),0===_&&0===S||(s.fromSkew(l,[_,S]),n.mat4.multiply(f,f,l)),0!==R&&n.mat4.rotateX(f,f,R),0!==T&&n.mat4.rotateY(f,f,T),0!==L&&n.mat4.rotateZ(f,f,L),1===M[0]&&1===M[1]||n.mat4.scale(f,f,M),U&&n.mat4.translate(f,f,n.vec3.scale(D,D,-1)),N>0&&(Y&&(this.boundingType===i.EBoundingType.Relative?(j[0]=j[0]*(b.width/2)+b.cx,j[1]=j[1]*(b.height/2)+b.cy):(j[0]*=b.width/2,j[1]*=b.height/2),j[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,z),e&&n.mat4.translate(p,p,I);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),w===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,y.angle+a)}h.Bounding.clear(B);for(let t=0;t0&&(Y&&n.vec3.add(e,e,j),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,N),Y&&n.vec3.sub(e,e,j)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=g/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,v)}O[E][t]=e[0],O[E][t+1]=e[1],h.Bounding.add(B,e[0],e[1]),h.Bounding.add(C,e[0],e[1])}}const R={cx:0,cy:0,x:-1,y:-1,width:2,height:2};h.Bounding.bind(R,B),this.bStaticIndexed&&this.bIndexed||this.addIndex(g,y,R)}h.Bounding.bind(this.bounding,C),this.buffer=new Float32Array(A);for(let t=0,e=0,r=O.length;t({index:1,offset:1,count:1}),m.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...m.getEmptySimpleRepetition(),row:m.getEmptySimpleRepetition(),col:m.getEmptySimpleRepetition()})},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(10);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return"number"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(29);var i;!function(t){t[t.None=0]="None",t[t.Scale=2]="Scale",t[t.Center=4]="Center",t[t.Fill=8]="Fill"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn("[Urplfanze:Bounding] cannot sum bounding")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn("[Urplfanze:Bounding] cannot bind bounding")}};class s extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return s.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=s.getBounding(t));const o=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,a=e>=i.Center?r.cx:0,h=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{Object.defineProperty(e,"__esModule",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(31),i=r(4),s=r(26),o="undefined"!=typeof performance?performance:Date;function a(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return o.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=a,e.relativeClamp=function(t,e,r,n,i){return a(n,i,(r-t)/(e-t)*(i-n)+n)};const h={random:new n(Math.random)};e.noise=function(t="random",e=0,r=0,i=0){return void 0===h[t]&&(h[t]=new n(t)),h[t].noise3D(e,r,i)};const u={};function c(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),s=rn?[s,o]:[o,s]}function l(t,e){const r=t.length,n=r/2,i=2*(n+e),s=n-1;if(s>1){const n=r-2,o=Math.floor(e/s);let a=(i-(r+o*n))/2;const h=Math.round(s/a),u=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%h==0||e===n-2),p=o+(d?1:0),m=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);u[i]=(s=t(),o=t(),a=t(),h=t(),function(){let t=(s>>>=0)+(o>>>=0)|0;return s=o^o>>>9,o=(a>>>=0)+(a<<3)|0,t=t+(h=1+(h>>>=0)|0)|0,a=(a=a<<21|a>>>11)+t|0,(t>>>0)/4294967296})}var s,o,a,h;const c=e+u[i]()*(r-e);return void 0!==n?Math.round(c*10**n)/10**n:c},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return s.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=c,e.interpolate=function(t,e,r=.5){const[n,i]=c(t,e),s=Math.max(n.length,i.length),o="number"==typeof r?[r]:r,a=s/2;if(o.length!==a){const t=o.length;for(let e=0;e{var n;!function(){var i=.5*(Math.sqrt(3)-1),s=(3-Math.sqrt(3))/6,o=1/6,a=(Math.sqrt(5)-1)/4,h=(5-Math.sqrt(5))/20;function u(t){var e;e="function"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=l();t=i(" "),e=i(" "),r=i(" ");for(var s=0;s>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}u.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,o=this.permMod12,a=this.perm,h=this.grad3,u=0,c=0,l=0,f=(t+e)*i,d=Math.floor(t+f),p=Math.floor(e+f),m=(d+p)*s,g=t-(d-m),v=e-(p-m);g>v?(r=1,n=0):(r=0,n=1);var y=g-r+s,b=v-n+s,w=g-1+2*s,M=v-1+2*s,x=255&d,_=255&p,S=.5-g*g-v*v;if(S>=0){var P=3*o[x+a[_]];u=(S*=S)*S*(h[P]*g+h[P+1]*v)}var A=.5-y*y-b*b;if(A>=0){var O=3*o[x+r+a[_+n]];c=(A*=A)*A*(h[O]*y+h[O+1]*b)}var E=.5-w*w-M*M;if(E>=0){var k=3*o[x+1+a[_+1]];l=(E*=E)*E*(h[k]*w+h[k+1]*M)}return 70*(u+c+l)},noise3D:function(t,e,r){var n,i,s,a,h,u,c,l,f,d,p=this.permMod12,m=this.perm,g=this.grad3,v=.3333333333333333*(t+e+r),y=Math.floor(t+v),b=Math.floor(e+v),w=Math.floor(r+v),M=(y+b+w)*o,x=t-(y-M),_=e-(b-M),S=r-(w-M);x>=_?_>=S?(h=1,u=0,c=0,l=1,f=1,d=0):x>=S?(h=1,u=0,c=0,l=1,f=0,d=1):(h=0,u=0,c=1,l=1,f=0,d=1):_B?L++:F++,C>R?L++:j++,C>T?L++:D++,B>R?F++:j++,B>T?F++:D++,R>T?j++:D++;var z=C-(l=L>=3?1:0)+h,q=B-(f=F>=3?1:0)+h,N=R-(d=j>=3?1:0)+h,U=T-(p=D>=3?1:0)+h,Y=C-(m=L>=2?1:0)+2*h,V=B-(g=F>=2?1:0)+2*h,Z=R-(v=j>=2?1:0)+2*h,G=T-(y=D>=2?1:0)+2*h,$=C-(b=L>=1?1:0)+3*h,X=B-(w=F>=1?1:0)+3*h,H=R-(M=j>=1?1:0)+3*h,W=T-(x=D>=1?1:0)+3*h,J=C-1+4*h,Q=B-1+4*h,K=R-1+4*h,tt=T-1+4*h,et=255&A,rt=255&O,nt=255&E,it=255&k,st=.6-C*C-B*B-R*R-T*T;if(st<0)i=0;else{var ot=_[et+_[rt+_[nt+_[it]]]]%32*4;i=(st*=st)*st*(S[ot]*C+S[ot+1]*B+S[ot+2]*R+S[ot+3]*T)}var at=.6-z*z-q*q-N*N-U*U;if(at<0)s=0;else{var ht=_[et+l+_[rt+f+_[nt+d+_[it+p]]]]%32*4;s=(at*=at)*at*(S[ht]*z+S[ht+1]*q+S[ht+2]*N+S[ht+3]*U)}var ut=.6-Y*Y-V*V-Z*Z-G*G;if(ut<0)o=0;else{var ct=_[et+m+_[rt+g+_[nt+v+_[it+y]]]]%32*4;o=(ut*=ut)*ut*(S[ct]*Y+S[ct+1]*V+S[ct+2]*Z+S[ct+3]*G)}var lt=.6-$*$-X*X-H*H-W*W;if(lt<0)u=0;else{var ft=_[et+b+_[rt+w+_[nt+M+_[it+x]]]]%32*4;u=(lt*=lt)*lt*(S[ft]*$+S[ft+1]*X+S[ft+2]*H+S[ft+3]*W)}var dt=.6-J*J-Q*Q-K*K-tt*tt;if(dt<0)c=0;else{var pt=_[et+1+_[rt+1+_[nt+1+_[it+1]]]]%32*4;c=(dt*=dt)*dt*(S[pt]*J+S[pt+1]*Q+S[pt+2]*K+S[pt+3]*tt)}return 27*(i+s+o+u+c)}},u._buildPermutationTable=c,void 0===(n=function(){return u}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=u,t.exports=u}()},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=void 0;const n=r(21),i=r(22),s=r(24);class o extends s.ShapeBase{constructor(t){t.type=t.type||"Shape",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn("[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\nYou passed:",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):o.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapePrimitive=void 0;const n=r(25),i=r(24),s=r(29),o=r(28);class a extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=o.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:"function"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return"function"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:"number"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp("sideLength",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeLoop=void 0;const n=r(27),i=r(28),s=r(33),o=r(24);class a extends s.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||"ShapeLoop",super(t),this.loopDependencies=(t.loopDependencies||[]).concat("sideLength"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes("propArguments"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}"loop"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||o.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?("function"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),s=this.getRepetitionSideLength(t),o=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,a={index:0,offset:0,current:0,count:n},h=a.count,u=new Float32Array(2*h);for(let n=0,i=0;n1?n/(a.count-1):1;a.current=s,a.index=n+1,a.offset=h;const c=o(a,t);u[i]=c[0],u[i+1]=c[1]}const c=[void 0,void 0,void 0,void 0],l=this.applyModifiers(u,t);for(let t=0,e=l.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBuffer=void 0;const n=r(28),i=r(33);class s extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||"ShapeBuffer",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn("[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property"),this.shape=s.EMPTY_BUFFER):this.shape="function"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return"function"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from("function"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,s=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&"function"!=typeof this.props.sideLength&&"function"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=s},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeRecursive=void 0;const n=r(32);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeRecursive",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionScale&&"function"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp("recursions",e,1)),n=Math.floor(this.getProp("recursionVertex",e,0)),s=this.getProp("recursionScale",e,2),o=this.shape;let a={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const h={...e,recursion:a};o.generate(t,!1,h);const u=o.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=u);let c=u;const l=[a];let f=0,d=1;const p=c.length,m=p/2,g=n<=0?m:Math.min(n,m),v=0===n?1:m/Math.min(n,m),y=new Float32Array(i.summmation(r,g)*p);for(let t=0;t1?e/(r-1):1,u=i.summmation(e,g)*p,m=e-1,b=0===m?0:i.summmation(m,g)*p;for(let i=0,m=g**e;i1?i/(m-1):1,count:m,level:{index:e+1,offset:n,count:r},parent:l[f]},l.push(a),this.shapeUseRecursion&&(h.recursion=a,o.generate(t,!1,h),c=o.getBuffer());const w=u+i*p,M=Math.floor(b+2*i*v),x=y[M],_=y[M+1],S=s**e;for(let t=0,e=p;t1?0:1,count:s}}},h=this.shape.getIndexedBuffer()||[];for(let t=0,e=h.length;t1?0:1,count:s}},i={...a,recursion:r},o=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:o})}if(s>1){const t=this.shape.getBufferLength({...i,parent:{...a}})/2,e=o<=0?t:Math.min(o,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let u=0,c=1;for(let t=1;t1?t/(s-1):1;for(let o=0,l=e**t;o1?o/(l-1):1;for(let d=0,p=h.length;d{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeFollow=void 0;const n=r(32);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeFollow",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},s=this.shape;s.generate(t,!1,i);let o=s.getBuffer();const a=o.length,h=new Float32Array(a*(n.length/2)),u=n.length/2;for(let e=0;e1?e/(u-1):1,count:u};this.shapeUseFollow&&(i.follow=r,s.generate(t,!1,i),o=s.getBuffer());const c=e*a,l=2*e,f=n[l],d=n[l+1];for(let t=0,e=o.length;t1?t/(e-1):1;for(let o=0,a=s.length;o{Object.defineProperty(e,"__esModule",{value:!0}),e.Line=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type="Line",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Triangle=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type="Triangle",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=s,s.buffer=[1,0,-1,1,-1,-1]},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Rect=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type="Rect",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=s,s.buffer=[1,1,-1,1,-1,-1,1,-1]},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Polygon=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["sideNumber"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp("sideNumber",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=s},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Circle=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type="Circle",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=s},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Star=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["spikes","innerRadius"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp("spikes",t,5),this.innerRadius=this.getProp("innerRadius",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=s},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Rose=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r;t.type="Rose",t.loopDependencies=(t.loopDependencies||[]).concat(["n","d"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>s.getFinalAngleFromK(this.getProp("n",t),this.getProp("d",t)),inc:t=>{const e=this.getProp("n",t),r=this.getProp("d",t),i=this.getRepetitionSideLength(t),s=Math.pow(i[0]*i[1],.45),o=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp("n",t)/this.getProp("d",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=s},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Spiral=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type="Spiral",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat(["twists","twistsStart","spiral"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:s.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp("twistsStart",t),end:t=>n.PI2*(this.getProp("twistsStart",t)+this.getProp("twists",t)),inc:t=>{const e=this.getProp("twists",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp("spiral",t),this.r=s.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case s.types.ARCHIMEDE:return t=>t/10;case s.types.HYPERBOLIC:return t=>1/t*3;case s.types.FERMAT:return t=>t**.5/3;case s.types.LITUUS:return t=>t**-.5;case s.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=s,s.types={ARCHIMEDE:"ARCHIMEDE",HYPERBOLIC:"HYPERBOLIC",FERMAT:"FERMAT",LITUUS:"LITUUS",LOGARITHMIC:"LOGARITHMIC"}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Lissajous=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type="Lissajous",t.loopDependencies=(t.loopDependencies||[]).concat(["wx","wy","wz"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp("wx",t),r=this.getProp("wy",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),s=this.getRepetitionSideLength(t);return 1/Math.pow(s[0]*s[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp("wx",t,1),this.wy=this.getProp("wy",t,2),this.wz=this.getProp("wz",t,2),super.generateLoopBuffer(t)}}e.Lissajous=s},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SuperShape=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r,i,s,o,a;t.type="SuperShape",t.loopDependencies=(t.loopDependencies||[]).concat(["a","b","m","n1","n2","n3"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(s=t.n1)&&void 0!==s?s:1,this.props.n2=null!==(o=t.n2)&&void 0!==o?o:1,this.props.n3=null!==(a=t.n3)&&void 0!==a?a:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp("a",t),this.b=this.getProp("b",t),this.m=this.getProp("m",t),this.n1=this.getProp("n1",t),this.n2=this.getProp("n2",t),this.n3=this.getProp("n3",t),super.generateLoopBuffer(t)}}e.SuperShape=s},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Modifiers=void 0;const n=r(28),i=r(49),s=r(50),o=r(52),a=r(53),h=r(51),u=r(54),c={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:s.Smooth,Solidify:o.Solidify,Subdivide:a.Subdivide,Close:h.Close,Offset:u.Offset};e.Modifiers=c},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Mirror=void 0;const n=r(29);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let s=0;s{Object.defineProperty(e,"__esModule",{value:!0}),e.Smooth=void 0;const n=r(30),i=r(51),s=r(29);class o extends s.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Close=void 0;const n=r(29);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Solidify=void 0;const n=r(29);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const s=[],o=(e="number"==typeof e?[e]:e).length;let a,h,u=[[0,0],[0,0]],c=[[0,0],[0,0]];for(let r=0,l=0,f=t.length-2;r{Object.defineProperty(e,"__esModule",{value:!0}),e.Subdivide=void 0;const n=r(29);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Offset=void 0;const n=r(29);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i}],e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(0)})()},t.exports=e()},479:(t,e,r)=>{var n;!function(){function i(t,e,r){var n=e.x,i=e.y,s=r.x-n,o=r.y-i;if(0!==s||0!==o){var a=((t.x-n)*s+(t.y-i)*o)/(s*s+o*o);a>1?(n=r.x,i=r.y):a>0&&(n+=s*a,i+=o*a)}return(s=t.x-n)*s+(o=t.y-i)*o}function s(t,e,r,n,o){for(var a,h=n,u=e+1;uh&&(a=u,h=c)}h>n&&(a-e>1&&s(t,e,a,n,o),o.push(t[a]),r-a>1&&s(t,a,r,n,o))}function o(t,e){var r=t.length-1,n=[t[0]];return s(t,0,r,e,n),n.push(t[r]),n}function a(t,e,r){if(t.length<=2)return t;var n=void 0!==e?e*e:1;return o(t=r?t:function(t,e){for(var r,n,i,s,o,a=t[0],h=[a],u=1,c=t.length;ue&&(h.push(r),a=r);return a!==r&&h.push(r),h}(t,n),n)}void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()},721:(t,e,r)=>{t.exports=r(192)},921:t=>{var e=2*Math.PI;function r(t,e,r,n){var i=t*r+e*n;return i>1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)}function n(t,e){var r=4/3*Math.tan(e/4),n=Math.cos(t),i=Math.sin(t),s=Math.cos(t+e),o=Math.sin(t+e);return[n,i,n-i*r,i+n*r,s+o*r,o-s*r,s,o]}t.exports=function(t,i,s,o,a,h,u,c,l){var f=Math.sin(l*e/360),d=Math.cos(l*e/360),p=d*(t-s)/2+f*(i-o)/2,m=-f*(t-s)/2+d*(i-o)/2;if(0===p&&0===m)return[];if(0===u||0===c)return[];u=Math.abs(u),c=Math.abs(c);var g=p*p/(u*u)+m*m/(c*c);g>1&&(u*=Math.sqrt(g),c*=Math.sqrt(g));var v=function(t,n,i,s,o,a,h,u,c,l){var f=l*(t-i)/2+c*(n-s)/2,d=-c*(t-i)/2+l*(n-s)/2,p=h*h,m=u*u,g=f*f,v=d*d,y=p*m-p*v-m*g;y<0&&(y=0),y/=p*v+m*g;var b=(y=Math.sqrt(y)*(o===a?-1:1))*h/u*d,w=y*-u/h*f,M=l*b-c*w+(t+i)/2,x=c*b+l*w+(n+s)/2,_=(f-b)/h,S=(d-w)/u,P=(-f-b)/h,A=(-d-w)/u,O=r(1,0,_,S),E=r(_,S,P,A);return 0===a&&E>0&&(E-=e),1===a&&E<0&&(E+=e),[M,x,O,E]}(t,i,s,o,a,h,u,c,f,d),y=[],b=v[2],w=v[3],M=Math.max(Math.ceil(Math.abs(w)/(e/4)),1);w/=M;for(var x=0;x{var e=1e-10,r=Math.PI/180;function n(t,e,r){if(!(this instanceof n))return new n(t,e,r);this.rx=t,this.ry=e,this.ax=r}n.prototype.transform=function(t){var n=Math.cos(this.ax*r),i=Math.sin(this.ax*r),s=[this.rx*(t[0]*n+t[2]*i),this.rx*(t[1]*n+t[3]*i),this.ry*(-t[0]*i+t[2]*n),this.ry*(-t[1]*i+t[3]*n)],o=s[0]*s[0]+s[2]*s[2],a=s[1]*s[1]+s[3]*s[3],h=((s[0]-s[3])*(s[0]-s[3])+(s[2]+s[1])*(s[2]+s[1]))*((s[0]+s[3])*(s[0]+s[3])+(s[2]-s[1])*(s[2]-s[1])),u=(o+a)/2;if(hMath.abs(l-a)?(l-o)/c:c/(l-a))/Math.PI,this.ax>=0?(this.rx=Math.sqrt(l),this.ry=Math.sqrt(f)):(this.ax+=90,this.rx=Math.sqrt(f),this.ry=Math.sqrt(l)),this},n.prototype.isDegenerate=function(){return this.rx{function e(){if(!(this instanceof e))return new e;this.queue=[],this.cache=null}e.prototype.matrix=function(t){return 1===t[0]&&0===t[1]&&0===t[2]&&1===t[3]&&0===t[4]&&0===t[5]||(this.cache=null,this.queue.push(t)),this},e.prototype.translate=function(t,e){return 0===t&&0===e||(this.cache=null,this.queue.push([1,0,0,1,t,e])),this},e.prototype.scale=function(t,e){return 1===t&&1===e||(this.cache=null,this.queue.push([t,0,0,e,0,0])),this},e.prototype.rotate=function(t,e,r){var n,i,s;return 0!==t&&(this.translate(e,r),n=t*Math.PI/180,i=Math.cos(n),s=Math.sin(n),this.queue.push([i,s,-s,i,0,0]),this.cache=null,this.translate(-e,-r)),this},e.prototype.skewX=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},e.prototype.skewY=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},e.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],1===this.queue.length)return this.cache;for(var t=1;t{var e={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},r=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function n(t){return t>=48&&t<=57}function i(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function s(t){for(;t.index=5760&&r.indexOf(e)>=0);)t.index++;var e}function o(t){var e=t.path.charCodeAt(t.index);return 48===e?(t.param=0,void t.index++):49===e?(t.param=1,void t.index++):void(t.err="SvgPath: arc flag can be 0 or 1 only (at pos "+t.index+")")}function a(t){var e,r=t.index,i=r,s=t.max,o=!1,a=!1,h=!1,u=!1;if(i>=s)t.err="SvgPath: missed param (at pos "+i+")";else if(43!==(e=t.path.charCodeAt(i))&&45!==e||(e=++i2&&(t.result.push([r,i[0],i[1]]),i=i.slice(2),n="l",r="m"===r?"l":"L"),"r"===n)t.result.push([r].concat(i));else for(;i.length>=e[n]&&(t.result.push([r].concat(i.splice(0,e[n]))),e[n]););}function u(t){var r,n,i,u,c,l,f=t.max;if(t.segmentStart=t.index,n=97==(32|(r=t.path.charCodeAt(t.index))),function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}(r))if(u=e[t.path[t.index].toLowerCase()],t.index++,s(t),t.data=[],u){for(i=!1;;){for(c=u;c>0;c--){if(!n||3!==c&&4!==c?a(t):o(t),t.err.length)return;t.data.push(t.param),s(t),i=!1,t.index=t.max)break;if(!((l=t.path.charCodeAt(t.index))>=48&&l<=57||43===l||45===l||46===l))break}}h(t)}else h(t);else t.err="SvgPath: bad command "+t.path[t.index]+" (at pos "+t.index+")"}t.exports=function(t){var e=new i(t),r=e.max;for(s(e);e.index{var n=r(665),i=r(94),s=r(480),o=r(921),a=r(954);function h(t){if(!(this instanceof h))return new h(t);var e=n(t);this.segments=e.segments,this.err=e.err,this.__stack=[]}h.from=function(t){if("string"==typeof t)return new h(t);if(t instanceof h){var e=new h("");return e.err=t.err,e.segments=t.segments.map((function(t){return t.slice()})),e.__stack=t.__stack.map((function(t){return s().matrix(t.toArray())})),e}throw new Error("SvgPath.from: invalid param type "+t)},h.prototype.__matrix=function(t){var e,r=this;t.queue.length&&this.iterate((function(n,i,s,o){var h,u,c,l;switch(n[0]){case"v":u=0===(h=t.calc(0,n[1],!0))[0]?["v",h[1]]:["l",h[0],h[1]];break;case"V":u=(h=t.calc(s,n[1],!1))[0]===t.calc(s,o,!1)[0]?["V",h[1]]:["L",h[0],h[1]];break;case"h":u=0===(h=t.calc(n[1],0,!0))[1]?["h",h[0]]:["l",h[0],h[1]];break;case"H":u=(h=t.calc(n[1],o,!1))[1]===t.calc(s,o,!1)[1]?["H",h[0]]:["L",h[0],h[1]];break;case"a":case"A":var f=t.toArray(),d=a(n[1],n[2],n[3]).transform(f);if(f[0]*f[3]-f[1]*f[2]<0&&(n[5]=n[5]?"0":"1"),h=t.calc(n[6],n[7],"a"===n[0]),"A"===n[0]&&n[6]===s&&n[7]===o||"a"===n[0]&&0===n[6]&&0===n[7]){u=["a"===n[0]?"l":"L",h[0],h[1]];break}u=d.isDegenerate()?["a"===n[0]?"l":"L",h[0],h[1]]:[n[0],d.rx,d.ry,d.ax,n[4],n[5],h[0],h[1]];break;case"m":l=i>0,u=["m",(h=t.calc(n[1],n[2],l))[0],h[1]];break;default:for(u=[c=n[0]],l=c.toLowerCase()===c,e=1;e=0;)t.matrix(this.__stack[e].toArray());this.__matrix(t),this.__stack=[]}},h.prototype.toString=function(){var t,e,r=[];this.__evaluateStack();for(var n=0;n0&&"m"!==e&&"M"!==e&&e===this.segments[n-1][0],r=r.concat(t?this.segments[n].slice(1):this.segments[n]);return r.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")},h.prototype.translate=function(t,e){return this.__stack.push(s().translate(t,e||0)),this},h.prototype.scale=function(t,e){return this.__stack.push(s().scale(t,e||0===e?e:t)),this},h.prototype.rotate=function(t,e,r){return this.__stack.push(s().rotate(t,e||0,r||0)),this},h.prototype.skewX=function(t){return this.__stack.push(s().skewX(t)),this},h.prototype.skewY=function(t){return this.__stack.push(s().skewY(t)),this},h.prototype.matrix=function(t){return this.__stack.push(s().matrix(t)),this},h.prototype.transform=function(t){return t.trim()?(this.__stack.push(i(t)),this):this},h.prototype.round=function(t){var e,r=0,n=0,i=0,s=0;return t=t||0,this.__evaluateStack(),this.segments.forEach((function(o){var a=o[0].toLowerCase()===o[0];switch(o[0]){case"H":case"h":return a&&(o[1]+=i),i=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case"V":case"v":return a&&(o[1]+=s),s=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case"Z":case"z":return i=r,void(s=n);case"M":case"m":return a&&(o[1]+=i,o[2]+=s),i=o[1]-o[1].toFixed(t),s=o[2]-o[2].toFixed(t),r=i,n=s,o[1]=+o[1].toFixed(t),void(o[2]=+o[2].toFixed(t));case"A":case"a":return a&&(o[6]+=i,o[7]+=s),i=o[6]-o[6].toFixed(t),s=o[7]-o[7].toFixed(t),o[1]=+o[1].toFixed(t),o[2]=+o[2].toFixed(t),o[3]=+o[3].toFixed(t+2),o[6]=+o[6].toFixed(t),void(o[7]=+o[7].toFixed(t));default:return e=o.length,a&&(o[e-2]+=i,o[e-1]+=s),i=o[e-2]-o[e-2].toFixed(t),s=o[e-1]-o[e-1].toFixed(t),void o.forEach((function(e,r){r&&(o[r]=+o[r].toFixed(t))}))}})),this},h.prototype.iterate=function(t,e){var r,n,i,s=this.segments,o={},a=!1,h=0,u=0,c=0,l=0;if(e||this.__evaluateStack(),s.forEach((function(e,r){var n=t(e,r,h,u);Array.isArray(n)&&(o[r]=n,a=!0);var i=e[0]===e[0].toLowerCase();switch(e[0]){case"m":case"M":return h=e[1]+(i?h:0),u=e[2]+(i?u:0),c=h,void(l=u);case"h":case"H":return void(h=e[1]+(i?h:0));case"v":case"V":return void(u=e[1]+(i?u:0));case"z":case"Z":return h=c,void(u=l);default:h=e[e.length-2]+(i?h:0),u=e[e.length-1]+(i?u:0)}})),!a)return this;for(i=[],r=0;r{var n=r(480),i={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},s=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,o=/[\s,]+/;t.exports=function(t){var e,r,a=new n;return t.split(s).forEach((function(t){if(t.length)if(void 0===i[t])switch(r=t.split(o).map((function(t){return+t||0})),e){case"matrix":return void(6===r.length&&a.matrix(r));case"scale":return void(1===r.length?a.scale(r[0],r[0]):2===r.length&&a.scale(r[0],r[1]));case"rotate":return void(1===r.length?a.rotate(r[0],0,0):3===r.length&&a.rotate(r[0],r[1],r[2]));case"translate":return void(1===r.length?a.translate(r[0],0):2===r.length&&a.translate(r[0],r[1]));case"skewX":return void(1===r.length&&a.skewX(r[0]));case"skewY":return void(1===r.length&&a.skewY(r[0]))}else e=t})),a}},197:(t,e,r)=>{function n(t,e){return Array.isArray(e)?[t.a*e[0]+t.c*e[1]+t.e,t.b*e[0]+t.d*e[1]+t.f]:{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function i(t,e){return e.map((e=>n(t,e)))}function s(t){return{a:parseFloat(t.a),b:parseFloat(t.b),c:parseFloat(t.c),d:parseFloat(t.d),e:parseFloat(t.e),f:parseFloat(t.f)}}r.r(e),r.d(e,{applyToPoint:()=>n,applyToPoints:()=>i,compose:()=>m,fromDefinition:()=>C,fromObject:()=>s,fromString:()=>a,fromTransformAttribute:()=>T,fromTriangles:()=>I,identity:()=>h,inverse:()=>u,isAffineMatrix:()=>f,rotate:()=>b,rotateDEG:()=>w,scale:()=>M,shear:()=>x,skew:()=>S,skewDEG:()=>P,smoothMatrix:()=>k,toCSS:()=>A,toSVG:()=>O,toString:()=>E,transform:()=>p,translate:()=>d});const o=/^matrix\(\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*\)$/i;function a(t){const e=t.match(o);if(null===e||e.length<7)throw new Error(`'${t}' is not a matrix`);return{a:parseFloat(e[1]),b:parseFloat(e[2]),c:parseFloat(e[3]),d:parseFloat(e[4]),e:parseFloat(e[5]),f:parseFloat(e[6])}}function h(){return{a:1,c:0,e:0,b:0,d:1,f:0}}function u(t){const{a:e,b:r,c:n,d:i,e:s,f:o}=t,a=e*i-r*n;return{a:i/a,b:r/-a,c:n/-a,d:e/a,e:(i*s-n*o)/-a,f:(r*s-e*o)/a}}function c(t){return void 0===t}function l(t){return"number"==typeof t&&!Number.isNaN(t)&&Number.isFinite(t)}function f(t){return"object"==typeof(e=t)&&null!==e&&!Array.isArray(e)&&"a"in t&&l(t.a)&&"b"in t&&l(t.b)&&"c"in t&&l(t.c)&&"d"in t&&l(t.d)&&"e"in t&&l(t.e)&&"f"in t&&l(t.f);var e}function d(t,e=0){return{a:1,c:0,e:t,b:0,d:1,f:e}}function p(...t){const e=(t,e)=>({a:t.a*e.a+t.c*e.b,c:t.a*e.c+t.c*e.d,e:t.a*e.e+t.c*e.f+t.e,b:t.b*e.a+t.d*e.b,d:t.b*e.c+t.d*e.d,f:t.b*e.e+t.d*e.f+t.f});switch((t=Array.isArray(t[0])?t[0]:t).length){case 0:throw new Error("no matrices provided");case 1:return t[0];case 2:return e(t[0],t[1]);default:{const[r,n,...i]=t;return p(e(r,n),...i)}}}function m(...t){return p(...t)}const{cos:g,sin:v,PI:y}=Math;function b(t,e,r){const n=g(t),i=v(t),s={a:n,c:-i,e:0,b:i,d:n,f:0};return c(e)||c(r)?s:p([d(e,r),s,d(-e,-r)])}function w(t,e,r){return b(t*y/180,e,r)}function M(t,e,r,n){c(e)&&(e=t);const i={a:t,c:0,e:0,b:0,d:e,f:0};return c(r)||c(n)?i:p([d(r,n),i,d(-r,-n)])}function x(t,e){return{a:1,c:t,e:0,b:e,d:1,f:0}}const{tan:_}=Math;function S(t,e){return{a:1,c:_(t),e:0,b:_(e),d:1,f:0}}function P(t,e){return S(t*Math.PI/180,e*Math.PI/180)}function A(t){return E(t)}function O(t){return E(t)}function E(t){return`matrix(${t.a},${t.b},${t.c},${t.d},${t.e},${t.f})`}function k(t,e=1e10){return{a:Math.round(t.a*e)/e,b:Math.round(t.b*e)/e,c:Math.round(t.c*e)/e,d:Math.round(t.d*e)/e,e:Math.round(t.e*e)/e,f:Math.round(t.f*e)/e}}function I(t,e){const r=null!=t[0].x?t[0].x:t[0][0],n=null!=t[0].y?t[0].y:t[0][1],i=null!=e[0].x?e[0].x:e[0][0],s=null!=e[0].y?e[0].y:e[0][1],o=null!=t[1].x?t[1].x:t[1][0],a=null!=t[1].y?t[1].y:t[1][1],h=null!=e[1].x?e[1].x:e[1][0],c=null!=e[1].y?e[1].y:e[1][1],l=null!=t[2].x?t[2].x:t[2][0],f=null!=t[2].y?t[2].y:t[2][1],d=null!=e[2].x?e[2].x:e[2][0],m=null!=e[2].y?e[2].y:e[2][1];return k(p([{a:i-d,b:s-m,c:h-d,d:c-m,e:d,f:m},u({a:r-l,b:n-f,c:o-l,d:a-f,e:l,f})]))}function C(t){return Array.isArray(t)?t.map(e):e(t);function e(t){switch(t.type){case"matrix":if("a"in t&&"b"in t&&"c"in t&&"d"in t&&"e"in t&&"f"in t)return s(t);throw new Error("MISSING_MANDATORY_PARAM");case"translate":if(!("tx"in t))throw new Error("MISSING_MANDATORY_PARAM");return"ty"in t?d(t.tx,t.ty):d(t.tx);case"scale":if(!("sx"in t))throw new Error("MISSING_MANDATORY_PARAM");return"sy"in t?M(t.sx,t.sy):M(t.sx);case"rotate":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return"cx"in t&&"cy"in t?w(t.angle,t.cx,t.cy):w(t.angle);case"skewX":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return P(t.angle,0);case"skewY":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return P(0,t.angle);case"shear":if(!("shx"in t)||!("shy"in t))throw new Error("MISSING_MANDATORY_PARAM");return x(t.shx,t.shy);default:throw new Error("UNSUPPORTED_DESCRIPTOR")}}}function B(t,e,r,n){this.message=t,this.expected=e,this.found=r,this.location=n,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,B)}function R(t,e){e=void 0!==e?e:{};var r,n={},i={transformList:Z},s=Z,o="matrix",a="(",h=")",u="translate",c="scale",l="rotate",f="skewX",d="skewY",p=/^[eE]/,m=/^[+\-]/,g=/^[0-9]/,v=/^[ \t\r\n]/,y=j("matrix",!1),b=j("(",!1),w=j(")",!1),M=j("translate",!1),x=j("scale",!1),_=j("rotate",!1),S=j("skewX",!1),P=j("skewY",!1),A=j(",",!1),O={type:"other",description:"fractionalConstant"},E=D(["e","E"],!1,!1),k=D(["+","-"],!1,!1),I=D([["0","9"]],!1,!1),C=D([" ","\t","\r","\n"],!1,!1),R=0,T=[{line:1,column:1}],L=[],F=0;if("startRule"in e){if(!(e.startRule in i))throw new Error("Can't start parsing from rule \""+e.startRule+'".');s=i[e.startRule]}function j(t,e){return{type:"literal",text:t,ignoreCase:e}}function D(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function z(e){var r,n=T[e];if(n)return n;for(r=e-1;!T[r];)r--;for(n={line:(n=T[r]).line,column:n.column};r0;function Y(t,r){var n={};U&&(n.filename=e.filename);var i=z(t);n.start={offset:t,line:i.line,column:i.column};var s=z(r);return n.end={offset:r,line:s.line,column:s.column},n}function V(t){var e=L[L.length-1];Re.pos&&(e.pos=R,e.variants=[]),e.variants.push(t))}function Z(){var t,e,r,i;for(t=[],e=rt();e!==n;)t.push(e),e=rt();for((e=G())===n&&(e=null),r=[],i=rt();i!==n;)r.push(i),i=rt();return e}function G(){var t,e,r,i,s;if(t=R,(e=$())!==n){if(r=[],(i=W())!==n)for(;i!==n;)r.push(i),i=W();else r=n;r!==n&&(i=G())!==n?(s=i,t=e.concat(s)):(R=t,t=n)}else R=t,t=n;return t===n&&(t=$()),t}function $(){var e;return(e=function(){var e,r,i,s,u,c,l,f,d,p,m,g,v,M=function(t){0===F&&V(t)};if(e=R,M(y),t.substr(R,6)===o?(r=o,R+=6):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(M(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(u=[],c=rt();c!==n;)u.push(c),c=rt();if((c=X())!==n)if(W()!==n)if((l=X())!==n)if(W()!==n)if((f=X())!==n)if(W()!==n)if((d=X())!==n)if(W()!==n)if((p=X())!==n)if(W()!==n)if((m=X())!==n){for(g=[],v=rt();v!==n;)g.push(v),v=rt();M(w),41===t.charCodeAt(R)?(v=h,R++):v=n,v!==n?e=[{type:"matrix",a:c,b:l,c:f,d,e:p,f:m}]:(R=e,e=n)}else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,c,l,f,d,p,m,g=function(t){0===F&&V(t)};if(e=R,g(M),t.substr(R,9)===u?(r=u,R+=9):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(o=[],c=rt();c!==n;)o.push(c),c=rt();if((c=X())!==n){for((l=H())===n&&(l=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(w),41===t.charCodeAt(R)?(d=h,R++):d=n,d!==n?(m={type:"translate",tx:c},(p=l)&&(m.ty=p),e=[m]):(R=e,e=n)}else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,l,f,d,p,m,g=function(t){0===F&&V(t)};if(e=R,g(x),t.substr(R,5)===c?(r=c,R+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=X())!==n){for((l=H())===n&&(l=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(w),41===t.charCodeAt(R)?(d=h,R++):d=n,d!==n?(m={type:"scale",sx:u},(p=l)&&(m.sy=p),e=[m]):(R=e,e=n)}else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,c,f,d,p,m,g=function(t){0===F&&V(t)};if(e=R,g(_),t.substr(R,6)===l?(r=l,R+=6):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=X())!==n){for((c=function(){var t,e,r;return t=R,W()!==n&&(e=X())!==n&&W()!==n&&(r=X())!==n?t=[e,r]:(R=t,t=n),t}())===n&&(c=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(w),41===t.charCodeAt(R)?(d=h,R++):d=n,d!==n?(m={type:"rotate",angle:u},(p=c)&&(m.cx=p[0],m.cy=p[1]),e=[m]):(R=e,e=n)}else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,c,l,d=function(t){0===F&&V(t)};if(e=R,d(S),t.substr(R,5)===f?(r=f,R+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(d(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=X())!==n){for(c=[],l=rt();l!==n;)c.push(l),l=rt();d(w),41===t.charCodeAt(R)?(l=h,R++):l=n,l!==n?e=[{type:"skewX",angle:u}]:(R=e,e=n)}else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,c,l,f=function(t){0===F&&V(t)};if(e=R,f(P),t.substr(R,5)===d?(r=d,R+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(f(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=X())!==n){for(c=[],l=rt();l!==n;)c.push(l),l=rt();f(w),41===t.charCodeAt(R)?(l=h,R++):l=n,l!==n?e=[{type:"skewY",angle:u}]:(R=e,e=n)}else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}()),e}function X(){var e,r,i,s;return e=R,r=R,(i=K())===n&&(i=null),(s=function(){var e,r,i;return e=R,(r=function(){var e,r,i,s,o,a;return 0===F&&V(O),F++,e=R,(r=tt())===n&&(r=null),46===t.charCodeAt(R)?(i=".",R++):i=n,i!==n&&(s=tt())!==n?(a=s,e=[(o=r)?o.join(""):null,".",a.join("")].join("")):(R=e,e=n),e===n&&(e=R,(r=tt())!==n?(46===t.charCodeAt(R)?(i=".",R++):i=n,i!==n?e=r.join(""):(R=e,e=n)):(R=e,e=n)),F--,e}())!==n?((i=Q())===n&&(i=null),e=[r,i||null].join("")):(R=e,e=n),e===n&&(e=R,(r=tt())!==n&&(i=Q())!==n?e=[r,i].join(""):(R=e,e=n)),e}())!==n?r=i=[i,s]:(R=r,r=n),r!==n&&(r=parseFloat(r.join(""))),(e=r)===n&&(e=R,r=R,(i=K())===n&&(i=null),(s=function(){var t;return(t=tt())!==n&&(t=t.join("")),t}())!==n?r=i=[i,s]:(R=r,r=n),r!==n&&(r=parseInt(r.join(""))),e=r),e}function H(){var t,e;return t=R,W()!==n&&(e=X())!==n?t=e:(R=t,t=n),t}function W(){var t,e,r,i,s;if(t=R,e=[],(r=rt())!==n)for(;r!==n;)e.push(r),r=rt();else e=n;if(e!==n){for((r=J())===n&&(r=null),i=[],s=rt();s!==n;)i.push(s),s=rt();t=e=[e,r,i]}else R=t,t=n;if(t===n)if(t=R,(e=J())!==n){for(r=[],i=rt();i!==n;)r.push(i),i=rt();t=e=[e,r]}else R=t,t=n;return t}function J(){var e;return 0===F&&V(A),44===t.charCodeAt(R)?(e=",",R++):e=n,e}function Q(){var e,r,i,s;return e=R,0===F&&V(E),p.test(t.charAt(R))?(r=t.charAt(R),R++):r=n,r!==n?((i=K())===n&&(i=null),(s=tt())!==n?e=["e",i,s.join("")].join(""):(R=e,e=n)):(R=e,e=n),e}function K(){var e;return 0===F&&V(k),m.test(t.charAt(R))?(e=t.charAt(R),R++):e=n,e}function tt(){var t,e;if(t=[],(e=et())!==n)for(;e!==n;)t.push(e),e=et();else t=n;return t}function et(){var e;return 0===F&&V(I),g.test(t.charAt(R))?(e=t.charAt(R),R++):e=n,e}function rt(){var e;return 0===F&&V(C),v.test(t.charAt(R))?(e=t.charAt(R),R++):e=n,e}if(L.push({pos:R,variants:[]}),(r=s())!==n&&R===t.length)return r;throw r!==n&&R0){for(e=1,r=1;e{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(625)})()},3431:t=>{var e=.1,r="function"==typeof Float32Array;function n(t,e){return 1-3*e+3*t}function i(t,e){return 3*e-6*t}function s(t){return 3*t}function o(t,e,r){return((n(e,r)*t+i(e,r))*t+s(e))*t}function a(t,e,r){return 3*n(e,r)*t*t+2*i(e,r)*t+s(e)}function h(t){return t}t.exports=function(t,n,i,s){if(!(0<=t&&t<=1&&0<=i&&i<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===n&&i===s)return h;for(var u=r?new Float32Array(11):new Array(11),c=0;c<11;++c)u[c]=o(c*e,t,i);return function(r){return 0===r?0:1===r?1:o(function(r){for(var n=0,s=1;10!==s&&u[s]<=r;++s)n+=e;--s;var h=n+(r-u[s])/(u[s+1]-u[s])*e,c=a(h,t,i);return c>=.001?function(t,e,r,n){for(var i=0;i<4;++i){var s=a(e,r,n);if(0===s)return e;e-=(o(e,r,n)-t)/s}return e}(r,h,t,i):0===c?h:function(t,e,r,n,i){var s,a,h=0;do{(s=o(a=e+(r-e)/2,n,i)-t)>0?r=a:e=a}while(Math.abs(s)>1e-7&&++h<10);return a}(r,n,n+e,t,i)}(r),n,s)}}},292:(t,e,r)=>{const n=r(9850);e.parseFont=n,e.createCanvas=function(t,e){return Object.assign(document.createElement("canvas"),{width:t,height:e})},e.createImageData=function(t,e,r){switch(arguments.length){case 0:return new ImageData;case 1:return new ImageData(t);case 2:return new ImageData(t,e);default:return new ImageData(t,e,r)}},e.loadImage=function(t,e){return new Promise((function(r,n){const i=Object.assign(document.createElement("img"),e);function s(){i.onload=null,i.onerror=null}i.onload=function(){s(),r(i)},i.onerror=function(){s(),n(new Error('Failed to load the image "'+t+'"'))},i.src=t}))}},9850:t=>{const e="'([^']+)'|\"([^\"]+)\"|[\\w\\s-]+",r=new RegExp("(bold|bolder|lighter|[1-9]00) +","i"),n=new RegExp("(italic|oblique) +","i"),i=new RegExp("(small-caps) +","i"),s=new RegExp("(ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded) +","i"),o=new RegExp("([\\d\\.]+)(px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q) *((?:"+e+")( *, *(?:"+e+"))*)"),a={};t.exports=function(t){if(a[t])return a[t];const e=o.exec(t);if(!e)return;const h={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(e[1]),unit:e[2],family:e[3].replace(/["']/g,"").replace(/ *, */g,",")};let u,c,l,f,d=t.substring(0,e.index);switch((u=r.exec(d))&&(h.weight=u[1]),(c=n.exec(d))&&(h.style=c[1]),(l=i.exec(d))&&(h.variant=l[1]),(f=s.exec(d))&&(h.stretch=f[1]),h.unit){case"pt":h.size/=.75;break;case"pc":h.size*=16;break;case"in":h.size*=96;break;case"cm":h.size*=96/2.54;break;case"mm":h.size*=96/25.4;break;case"%":break;case"em":case"rem":h.size*=16/.75;break;case"q":h.size*=96/25.4/4}return a[t]=h}},887:(t,e,r)=>{r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>s,mat3:()=>o,mat4:()=>a,quat:()=>c,quat2:()=>l,vec2:()=>f,vec3:()=>h,vec4:()=>u});var n={};r.r(n),r.d(n,{ARRAY_TYPE:()=>p,EPSILON:()=>d,RANDOM:()=>m,equals:()=>b,setMatrixArrayType:()=>g,toRadian:()=>y});var i={};r.r(i),r.d(i,{LDU:()=>j,add:()=>D,adjoint:()=>E,clone:()=>M,copy:()=>x,create:()=>w,determinant:()=>k,equals:()=>N,exactEquals:()=>q,frob:()=>F,fromRotation:()=>R,fromScaling:()=>T,fromValues:()=>S,identity:()=>_,invert:()=>O,mul:()=>V,multiply:()=>I,multiplyScalar:()=>U,multiplyScalarAndAdd:()=>Y,rotate:()=>C,scale:()=>B,set:()=>P,str:()=>L,sub:()=>Z,subtract:()=>z,transpose:()=>A});var s={};r.r(s),r.d(s,{add:()=>ut,clone:()=>$,copy:()=>X,create:()=>G,determinant:()=>K,equals:()=>pt,exactEquals:()=>dt,frob:()=>ht,fromRotation:()=>it,fromScaling:()=>st,fromTranslation:()=>ot,fromValues:()=>W,identity:()=>H,invert:()=>Q,mul:()=>mt,multiply:()=>tt,multiplyScalar:()=>lt,multiplyScalarAndAdd:()=>ft,rotate:()=>et,scale:()=>rt,set:()=>J,str:()=>at,sub:()=>gt,subtract:()=>ct,translate:()=>nt});var o={};r.r(o),r.d(o,{add:()=>Nt,adjoint:()=>At,clone:()=>bt,copy:()=>wt,create:()=>vt,determinant:()=>Ot,equals:()=>Gt,exactEquals:()=>Zt,frob:()=>qt,fromMat2d:()=>Lt,fromMat4:()=>yt,fromQuat:()=>Ft,fromRotation:()=>Rt,fromScaling:()=>Tt,fromTranslation:()=>Bt,fromValues:()=>Mt,identity:()=>_t,invert:()=>Pt,mul:()=>$t,multiply:()=>Et,multiplyScalar:()=>Yt,multiplyScalarAndAdd:()=>Vt,normalFromMat4:()=>jt,projection:()=>Dt,rotate:()=>It,scale:()=>Ct,set:()=>xt,str:()=>zt,sub:()=>Xt,subtract:()=>Ut,translate:()=>kt,transpose:()=>St});var a={};r.r(a),r.d(a,{add:()=>Te,adjoint:()=>ne,clone:()=>Wt,copy:()=>Jt,create:()=>Ht,determinant:()=>ie,equals:()=>ze,exactEquals:()=>De,frob:()=>Re,fromQuat:()=>Pe,fromQuat2:()=>be,fromRotation:()=>pe,fromRotationTranslation:()=>ye,fromRotationTranslationScale:()=>_e,fromRotationTranslationScaleOrigin:()=>Se,fromScaling:()=>de,fromTranslation:()=>fe,fromValues:()=>Qt,fromXRotation:()=>me,fromYRotation:()=>ge,fromZRotation:()=>ve,frustum:()=>Ae,getRotation:()=>xe,getScaling:()=>Me,getTranslation:()=>we,identity:()=>te,invert:()=>re,lookAt:()=>Ie,mul:()=>qe,multiply:()=>se,multiplyScalar:()=>Fe,multiplyScalarAndAdd:()=>je,ortho:()=>ke,perspective:()=>Oe,perspectiveFromFieldOfView:()=>Ee,rotate:()=>he,rotateX:()=>ue,rotateY:()=>ce,rotateZ:()=>le,scale:()=>ae,set:()=>Kt,str:()=>Be,sub:()=>Ne,subtract:()=>Le,targetTo:()=>Ce,translate:()=>oe,transpose:()=>ee});var h={};r.r(h),r.d(h,{add:()=>Xe,angle:()=>_r,bezier:()=>mr,ceil:()=>Qe,clone:()=>Ye,copy:()=>Ge,create:()=>Ue,cross:()=>fr,dist:()=>Br,distance:()=>sr,div:()=>Cr,divide:()=>Je,dot:()=>lr,equals:()=>Or,exactEquals:()=>Ar,floor:()=>Ke,forEach:()=>Fr,fromValues:()=>Ze,hermite:()=>pr,inverse:()=>ur,len:()=>Tr,length:()=>Ve,lerp:()=>dr,max:()=>er,min:()=>tr,mul:()=>Ir,multiply:()=>We,negate:()=>hr,normalize:()=>cr,random:()=>gr,rotateX:()=>wr,rotateY:()=>Mr,rotateZ:()=>xr,round:()=>rr,scale:()=>nr,scaleAndAdd:()=>ir,set:()=>$e,sqrDist:()=>Rr,sqrLen:()=>Lr,squaredDistance:()=>or,squaredLength:()=>ar,str:()=>Pr,sub:()=>kr,subtract:()=>He,transformMat3:()=>yr,transformMat4:()=>vr,transformQuat:()=>br,zero:()=>Sr});var u={};r.r(u),r.d(u,{add:()=>Ur,ceil:()=>Gr,clone:()=>Dr,copy:()=>qr,create:()=>jr,cross:()=>hn,dist:()=>wn,distance:()=>Kr,div:()=>bn,divide:()=>Zr,dot:()=>an,equals:()=>gn,exactEquals:()=>mn,floor:()=>$r,forEach:()=>Sn,fromValues:()=>zr,inverse:()=>sn,len:()=>xn,length:()=>en,lerp:()=>un,max:()=>Hr,min:()=>Xr,mul:()=>yn,multiply:()=>Vr,negate:()=>nn,normalize:()=>on,random:()=>cn,round:()=>Wr,scale:()=>Jr,scaleAndAdd:()=>Qr,set:()=>Nr,sqrDist:()=>Mn,sqrLen:()=>_n,squaredDistance:()=>tn,squaredLength:()=>rn,str:()=>pn,sub:()=>vn,subtract:()=>Yr,transformMat4:()=>ln,transformQuat:()=>fn,zero:()=>dn});var c={};r.r(c),r.d(c,{add:()=>ei,calculateW:()=>Tn,clone:()=>Jn,conjugate:()=>Nn,copy:()=>Kn,create:()=>Pn,dot:()=>ii,equals:()=>fi,exactEquals:()=>li,exp:()=>Ln,fromEuler:()=>Yn,fromMat3:()=>Un,fromValues:()=>Qn,getAngle:()=>kn,getAxisAngle:()=>En,identity:()=>An,invert:()=>qn,len:()=>ai,length:()=>oi,lerp:()=>si,ln:()=>Fn,mul:()=>ri,multiply:()=>In,normalize:()=>ci,pow:()=>jn,random:()=>zn,rotateX:()=>Cn,rotateY:()=>Bn,rotateZ:()=>Rn,rotationTo:()=>di,scale:()=>ni,set:()=>ti,setAxes:()=>mi,setAxisAngle:()=>On,slerp:()=>Dn,sqlerp:()=>pi,sqrLen:()=>ui,squaredLength:()=>hi,str:()=>Vn});var l={};r.r(l),r.d(l,{add:()=>zi,clone:()=>vi,conjugate:()=>Gi,copy:()=>Si,create:()=>gi,dot:()=>Yi,equals:()=>ts,exactEquals:()=>Ki,fromMat4:()=>_i,fromRotation:()=>xi,fromRotationTranslation:()=>wi,fromRotationTranslationValues:()=>bi,fromTranslation:()=>Mi,fromValues:()=>yi,getDual:()=>Ei,getReal:()=>Oi,getTranslation:()=>Ci,identity:()=>Pi,invert:()=>Zi,len:()=>Xi,length:()=>$i,lerp:()=>Vi,mul:()=>Ni,multiply:()=>qi,normalize:()=>Ji,rotateAroundAxis:()=>Di,rotateByQuatAppend:()=>Fi,rotateByQuatPrepend:()=>ji,rotateX:()=>Ri,rotateY:()=>Ti,rotateZ:()=>Li,scale:()=>Ui,set:()=>Ai,setDual:()=>Ii,setReal:()=>ki,sqrLen:()=>Wi,squaredLength:()=>Hi,str:()=>Qi,translate:()=>Bi});var f={};r.r(f),r.d(f,{add:()=>os,angle:()=>Rs,ceil:()=>cs,clone:()=>rs,copy:()=>is,create:()=>es,cross:()=>Ps,dist:()=>Us,distance:()=>vs,div:()=>Ns,divide:()=>us,dot:()=>Ss,equals:()=>js,exactEquals:()=>Fs,floor:()=>ls,forEach:()=>Zs,fromValues:()=>ns,inverse:()=>xs,len:()=>Ds,length:()=>bs,lerp:()=>As,max:()=>ds,min:()=>fs,mul:()=>qs,multiply:()=>hs,negate:()=>Ms,normalize:()=>_s,random:()=>Os,rotate:()=>Bs,round:()=>ps,scale:()=>ms,scaleAndAdd:()=>gs,set:()=>ss,sqrDist:()=>Ys,sqrLen:()=>Vs,squaredDistance:()=>ys,squaredLength:()=>ws,str:()=>Ls,sub:()=>zs,subtract:()=>as,transformMat2:()=>Es,transformMat2d:()=>ks,transformMat3:()=>Is,transformMat4:()=>Cs,zero:()=>Ts});var d=1e-6,p="undefined"!=typeof Float32Array?Float32Array:Array,m=Math.random;function g(t){p=t}var v=Math.PI/180;function y(t){return t*v}function b(t,e){return Math.abs(t-e)<=d*Math.max(1,Math.abs(t),Math.abs(e))}function w(){var t=new p(4);return p!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function M(t){var e=new p(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function x(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function _(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function S(t,e,r,n){var i=new p(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function P(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function A(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function O(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*s-i*n;return o?(o=1/o,t[0]=s*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}function E(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function k(t){return t[0]*t[3]-t[2]*t[1]}function I(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*a+s*h,t[1]=i*a+o*h,t[2]=n*u+s*c,t[3]=i*u+o*c,t}function C(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+s*a,t[1]=i*h+o*a,t[2]=n*-a+s*h,t[3]=i*-a+o*h,t}function B(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1];return t[0]=n*a,t[1]=i*a,t[2]=s*h,t[3]=o*h,t}function R(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function T(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function L(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function F(t){return Math.hypot(t[0],t[1],t[2],t[3])}function j(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function D(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function z(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function q(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function N(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=e[0],a=e[1],h=e[2],u=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-h)<=d*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-u)<=d*Math.max(1,Math.abs(s),Math.abs(u))}function U(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Y(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var V=I,Z=z;function G(){var t=new p(6);return p!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function $(t){var e=new p(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function X(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function H(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function W(t,e,r,n,i,s){var o=new p(6);return o[0]=t,o[1]=e,o[2]=r,o[3]=n,o[4]=i,o[5]=s,o}function J(t,e,r,n,i,s,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t}function Q(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=r*s-n*i;return h?(h=1/h,t[0]=s*h,t[1]=-n*h,t[2]=-i*h,t[3]=r*h,t[4]=(i*a-s*o)*h,t[5]=(n*o-r*a)*h,t):null}function K(t){return t[0]*t[3]-t[1]*t[2]}function tt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1],l=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*u+s*c,t[1]=i*u+o*c,t[2]=n*l+s*f,t[3]=i*l+o*f,t[4]=n*d+s*p+a,t[5]=i*d+o*p+h,t}function et(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*u,t[1]=i*c+o*u,t[2]=n*-u+s*c,t[3]=i*-u+o*c,t[4]=a,t[5]=h,t}function rt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1];return t[0]=n*u,t[1]=i*u,t[2]=s*c,t[3]=o*c,t[4]=a,t[5]=h,t}function nt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=n*u+s*c+a,t[5]=i*u+o*c+h,t}function it(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function st(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function ot(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function at(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function ht(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function ut(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function ct(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function lt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function ft(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function dt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function pt(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],h=e[0],u=e[1],c=e[2],l=e[3],f=e[4],p=e[5];return Math.abs(r-h)<=d*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(n-u)<=d*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(i-c)<=d*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(s-l)<=d*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(o-f)<=d*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-p)<=d*Math.max(1,Math.abs(a),Math.abs(p))}var mt=tt,gt=ct;function vt(){var t=new p(9);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function bt(t){var e=new p(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function wt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Mt(t,e,r,n,i,s,o,a,h){var u=new p(9);return u[0]=t,u[1]=e,u[2]=r,u[3]=n,u[4]=i,u[5]=s,u[6]=o,u[7]=a,u[8]=h,u}function xt(t,e,r,n,i,s,o,a,h,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t}function _t(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function St(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function Pt(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=c*o-a*u,f=-c*s+a*h,d=u*s-o*h,p=r*l+n*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-c*n+i*u)*p,t[2]=(a*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*h)*p,t[5]=(-a*r+i*s)*p,t[6]=d*p,t[7]=(-u*r+n*h)*p,t[8]=(o*r-n*s)*p,t):null}function At(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8];return t[0]=o*c-a*u,t[1]=i*u-n*c,t[2]=n*a-i*o,t[3]=a*h-s*c,t[4]=r*c-i*h,t[5]=i*s-r*a,t[6]=s*u-o*h,t[7]=n*h-r*u,t[8]=r*o-n*s,t}function Ot(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],h=t[7],u=t[8];return e*(u*s-o*h)+r*(-u*i+o*a)+n*(h*i-s*a)}function Et(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=r[0],d=r[1],p=r[2],m=r[3],g=r[4],v=r[5],y=r[6],b=r[7],w=r[8];return t[0]=f*n+d*o+p*u,t[1]=f*i+d*a+p*c,t[2]=f*s+d*h+p*l,t[3]=m*n+g*o+v*u,t[4]=m*i+g*a+v*c,t[5]=m*s+g*h+v*l,t[6]=y*n+b*o+w*u,t[7]=y*i+b*a+w*c,t[8]=y*s+b*h+w*l,t}function kt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=h,t[6]=f*n+d*o+u,t[7]=f*i+d*a+c,t[8]=f*s+d*h+l,t}function It(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*a,t[2]=d*s+f*h,t[3]=d*o-f*n,t[4]=d*a-f*i,t[5]=d*h-f*s,t[6]=u,t[7]=c,t[8]=l,t}function Ct(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Bt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function Rt(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Tt(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Lt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function Ft(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,h=i+i,u=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*h,m=s*o,g=s*a,v=s*h;return t[0]=1-l-p,t[3]=c-v,t[6]=f+g,t[1]=c+v,t[4]=1-u-p,t[7]=d-m,t[2]=f-g,t[5]=d+m,t[8]=1-u-l,t}function jt(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*h-i*o,w=r*u-s*o,M=n*h-i*a,x=n*u-s*a,_=i*u-s*h,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,O=l*g-f*m,E=l*v-d*m,k=f*v-d*g,I=y*k-b*E+w*O+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-h*E+u*O)*I,t[1]=(h*A-o*k-u*P)*I,t[2]=(o*E-a*A+u*S)*I,t[3]=(i*E-n*k-s*O)*I,t[4]=(r*k-i*A+s*P)*I,t[5]=(n*A-r*E-s*S)*I,t[6]=(m*_-g*x+v*M)*I,t[7]=(g*w-p*_-v*b)*I,t[8]=(p*x-m*w+v*y)*I,t):null}function Dt(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function zt(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function qt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Nt(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function Ut(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function Yt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function Vt(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function Zt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function Gt(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],h=t[6],u=t[7],c=t[8],l=e[0],f=e[1],p=e[2],m=e[3],g=e[4],v=e[5],y=e[6],b=e[7],w=e[8];return Math.abs(r-l)<=d*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(n-f)<=d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-p)<=d*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(s-m)<=d*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(o-g)<=d*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(a-v)<=d*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(h-y)<=d*Math.max(1,Math.abs(h),Math.abs(y))&&Math.abs(u-b)<=d*Math.max(1,Math.abs(u),Math.abs(b))&&Math.abs(c-w)<=d*Math.max(1,Math.abs(c),Math.abs(w))}var $t=Et,Xt=Ut;function Ht(){var t=new p(16);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Wt(t){var e=new p(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Jt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Qt(t,e,r,n,i,s,o,a,h,u,c,l,f,d,m,g){var v=new p(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=n,v[4]=i,v[5]=s,v[6]=o,v[7]=a,v[8]=h,v[9]=u,v[10]=c,v[11]=l,v[12]=f,v[13]=d,v[14]=m,v[15]=g,v}function Kt(t,e,r,n,i,s,o,a,h,u,c,l,f,d,p,m,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t[9]=c,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=g,t}function te(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ee(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=i,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function re(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*h-i*o,w=r*u-s*o,M=n*h-i*a,x=n*u-s*a,_=i*u-s*h,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,O=l*g-f*m,E=l*v-d*m,k=f*v-d*g,I=y*k-b*E+w*O+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-h*E+u*O)*I,t[1]=(i*E-n*k-s*O)*I,t[2]=(m*_-g*x+v*M)*I,t[3]=(f*x-l*_-d*M)*I,t[4]=(h*A-o*k-u*P)*I,t[5]=(r*k-i*A+s*P)*I,t[6]=(g*w-p*_-v*b)*I,t[7]=(c*_-f*w+d*b)*I,t[8]=(o*E-a*A+u*S)*I,t[9]=(n*A-r*E-s*S)*I,t[10]=(p*x-m*w+v*y)*I,t[11]=(l*w-c*x-d*y)*I,t[12]=(a*P-o*O-h*S)*I,t[13]=(r*O-n*P+i*S)*I,t[14]=(m*b-p*M-g*y)*I,t[15]=(c*M-l*b+f*y)*I,t):null}function ne(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15];return t[0]=a*(f*v-d*g)-l*(h*v-u*g)+m*(h*d-u*f),t[1]=-(n*(f*v-d*g)-l*(i*v-s*g)+m*(i*d-s*f)),t[2]=n*(h*v-u*g)-a*(i*v-s*g)+m*(i*u-s*h),t[3]=-(n*(h*d-u*f)-a*(i*d-s*f)+l*(i*u-s*h)),t[4]=-(o*(f*v-d*g)-c*(h*v-u*g)+p*(h*d-u*f)),t[5]=r*(f*v-d*g)-c*(i*v-s*g)+p*(i*d-s*f),t[6]=-(r*(h*v-u*g)-o*(i*v-s*g)+p*(i*u-s*h)),t[7]=r*(h*d-u*f)-o*(i*d-s*f)+c*(i*u-s*h),t[8]=o*(l*v-d*m)-c*(a*v-u*m)+p*(a*d-u*l),t[9]=-(r*(l*v-d*m)-c*(n*v-s*m)+p*(n*d-s*l)),t[10]=r*(a*v-u*m)-o*(n*v-s*m)+p*(n*u-s*a),t[11]=-(r*(a*d-u*l)-o*(n*d-s*l)+c*(n*u-s*a)),t[12]=-(o*(l*g-f*m)-c*(a*g-h*m)+p*(a*f-h*l)),t[13]=r*(l*g-f*m)-c*(n*g-i*m)+p*(n*f-i*l),t[14]=-(r*(a*g-h*m)-o*(n*g-i*m)+p*(n*h-i*a)),t[15]=r*(a*f-h*l)-o*(n*f-i*l)+c*(n*h-i*a),t}function ie(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],h=t[7],u=t[8],c=t[9],l=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*s)*(l*g-f*m)-(e*a-n*s)*(c*g-f*p)+(e*h-i*s)*(c*m-l*p)+(r*a-n*o)*(u*g-f*d)-(r*h-i*o)*(u*m-l*d)+(n*h-i*a)*(u*p-c*d)}function se(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],v=e[14],y=e[15],b=r[0],w=r[1],M=r[2],x=r[3];return t[0]=b*n+w*a+M*l+x*m,t[1]=b*i+w*h+M*f+x*g,t[2]=b*s+w*u+M*d+x*v,t[3]=b*o+w*c+M*p+x*y,b=r[4],w=r[5],M=r[6],x=r[7],t[4]=b*n+w*a+M*l+x*m,t[5]=b*i+w*h+M*f+x*g,t[6]=b*s+w*u+M*d+x*v,t[7]=b*o+w*c+M*p+x*y,b=r[8],w=r[9],M=r[10],x=r[11],t[8]=b*n+w*a+M*l+x*m,t[9]=b*i+w*h+M*f+x*g,t[10]=b*s+w*u+M*d+x*v,t[11]=b*o+w*c+M*p+x*y,b=r[12],w=r[13],M=r[14],x=r[15],t[12]=b*n+w*a+M*l+x*m,t[13]=b*i+w*h+M*f+x*g,t[14]=b*s+w*u+M*d+x*v,t[15]=b*o+w*c+M*p+x*y,t}function oe(t,e,r){var n,i,s,o,a,h,u,c,l,f,d,p,m=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=h,t[6]=u,t[7]=c,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+a*g+l*v+e[12],t[13]=i*m+h*g+f*v+e[13],t[14]=s*m+u*g+d*v+e[14],t[15]=o*m+c*g+p*v+e[15]),t}function ae(t,e,r){var n=r[0],i=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function he(t,e,r,n){var i,s,o,a,h,u,c,l,f,p,m,g,v,y,b,w,M,x,_,S,P,A,O,E,k=n[0],I=n[1],C=n[2],B=Math.hypot(k,I,C);return B0?(r[0]=2*(a*o+c*n+h*s-u*i)/l,r[1]=2*(h*o+c*i+u*n-a*s)/l,r[2]=2*(u*o+c*s+a*i-h*n)/l):(r[0]=2*(a*o+c*n+h*s-u*i),r[1]=2*(h*o+c*i+u*n-a*s),r[2]=2*(u*o+c*s+a*i-h*n)),ye(t,e,r),t}function we(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Me(t,e){var r=e[0],n=e[1],i=e[2],s=e[4],o=e[5],a=e[6],h=e[8],u=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(s,o,a),t[2]=Math.hypot(h,u,c),t}function xe(t,e){var r=new p(3);Me(r,e);var n=1/r[0],i=1/r[1],s=1/r[2],o=e[0]*n,a=e[1]*i,h=e[2]*s,u=e[4]*n,c=e[5]*i,l=e[6]*s,f=e[8]*n,d=e[9]*i,m=e[10]*s,g=o+c+m,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(l-d)/v,t[1]=(f-h)/v,t[2]=(a-u)/v):o>c&&o>m?(v=2*Math.sqrt(1+o-c-m),t[3]=(l-d)/v,t[0]=.25*v,t[1]=(a+u)/v,t[2]=(f+h)/v):c>m?(v=2*Math.sqrt(1+c-o-m),t[3]=(f-h)/v,t[0]=(a+u)/v,t[1]=.25*v,t[2]=(l+d)/v):(v=2*Math.sqrt(1+m-o-c),t[3]=(a-u)/v,t[0]=(f+h)/v,t[1]=(l+d)/v,t[2]=.25*v),t}function _e(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3],h=i+i,u=s+s,c=o+o,l=i*h,f=i*u,d=i*c,p=s*u,m=s*c,g=o*c,v=a*h,y=a*u,b=a*c,w=n[0],M=n[1],x=n[2];return t[0]=(1-(p+g))*w,t[1]=(f+b)*w,t[2]=(d-y)*w,t[3]=0,t[4]=(f-b)*M,t[5]=(1-(l+g))*M,t[6]=(m+v)*M,t[7]=0,t[8]=(d+y)*x,t[9]=(m-v)*x,t[10]=(1-(l+p))*x,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function Se(t,e,r,n,i){var s=e[0],o=e[1],a=e[2],h=e[3],u=s+s,c=o+o,l=a+a,f=s*u,d=s*c,p=s*l,m=o*c,g=o*l,v=a*l,y=h*u,b=h*c,w=h*l,M=n[0],x=n[1],_=n[2],S=i[0],P=i[1],A=i[2],O=(1-(m+v))*M,E=(d+w)*M,k=(p-b)*M,I=(d-w)*x,C=(1-(f+v))*x,B=(g+y)*x,R=(p+b)*_,T=(g-y)*_,L=(1-(f+m))*_;return t[0]=O,t[1]=E,t[2]=k,t[3]=0,t[4]=I,t[5]=C,t[6]=B,t[7]=0,t[8]=R,t[9]=T,t[10]=L,t[11]=0,t[12]=r[0]+S-(O*S+I*P+R*A),t[13]=r[1]+P-(E*S+C*P+T*A),t[14]=r[2]+A-(k*S+B*P+L*A),t[15]=1,t}function Pe(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,h=i+i,u=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*h,m=s*o,g=s*a,v=s*h;return t[0]=1-l-p,t[1]=c+v,t[2]=f-g,t[3]=0,t[4]=c-v,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-u-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ae(t,e,r,n,i,s,o){var a=1/(r-e),h=1/(i-n),u=1/(s-o);return t[0]=2*s*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*h,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*h,t[10]=(o+s)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*u,t[15]=0,t}function Oe(t,e,r,n,i){var s,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(s=1/(n-i),t[10]=(i+n)*s,t[14]=2*i*n*s):(t[10]=-1,t[14]=-2*n),t}function Ee(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),h=2/(o+a),u=2/(i+s);return t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-a)*h*.5,t[9]=(i-s)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function ke(t,e,r,n,i,s,o){var a=1/(e-r),h=1/(n-i),u=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*h,t[14]=(o+s)*u,t[15]=1,t}function Ie(t,e,r,n){var i,s,o,a,h,u,c,l,f,p,m=e[0],g=e[1],v=e[2],y=n[0],b=n[1],w=n[2],M=r[0],x=r[1],_=r[2];return Math.abs(m-M)0&&(c*=d=1/Math.sqrt(d),l*=d,f*=d);var p=h*f-u*l,m=u*c-a*f,g=a*l-h*c;return(d=p*p+m*m+g*g)>0&&(p*=d=1/Math.sqrt(d),m*=d,g*=d),t[0]=p,t[1]=m,t[2]=g,t[3]=0,t[4]=l*g-f*m,t[5]=f*p-c*g,t[6]=c*m-l*p,t[7]=0,t[8]=c,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=s,t[14]=o,t[15]=1,t}function Be(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Re(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Te(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Le(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function Fe(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function je(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function De(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function ze(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],h=t[6],u=t[7],c=t[8],l=t[9],f=t[10],p=t[11],m=t[12],g=t[13],v=t[14],y=t[15],b=e[0],w=e[1],M=e[2],x=e[3],_=e[4],S=e[5],P=e[6],A=e[7],O=e[8],E=e[9],k=e[10],I=e[11],C=e[12],B=e[13],R=e[14],T=e[15];return Math.abs(r-b)<=d*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-w)<=d*Math.max(1,Math.abs(n),Math.abs(w))&&Math.abs(i-M)<=d*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(s-x)<=d*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(o-_)<=d*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(a-S)<=d*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(h-P)<=d*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(u-A)<=d*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(c-O)<=d*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(l-E)<=d*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(f-k)<=d*Math.max(1,Math.abs(f),Math.abs(k))&&Math.abs(p-I)<=d*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(m-C)<=d*Math.max(1,Math.abs(m),Math.abs(C))&&Math.abs(g-B)<=d*Math.max(1,Math.abs(g),Math.abs(B))&&Math.abs(v-R)<=d*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(y-T)<=d*Math.max(1,Math.abs(y),Math.abs(T))}var qe=se,Ne=Le;function Ue(){var t=new p(3);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ye(t){var e=new p(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Ve(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function Ze(t,e,r){var n=new p(3);return n[0]=t,n[1]=e,n[2]=r,n}function Ge(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function $e(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function Xe(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function He(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function We(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function Je(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function Qe(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Ke(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function tr(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function er(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function rr(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function nr(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function ir(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function sr(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function or(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function ar(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function hr(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function ur(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function cr(t,e){var r=e[0],n=e[1],i=e[2],s=r*r+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function lr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function fr(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],h=r[2];return t[0]=i*h-s*a,t[1]=s*o-n*h,t[2]=n*a-i*o,t}function dr(t,e,r,n){var i=e[0],s=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t}function pr(t,e,r,n,i,s){var o=s*s,a=o*(2*s-3)+1,h=o*(s-2)+s,u=o*(s-1),c=o*(3-2*s);return t[0]=e[0]*a+r[0]*h+n[0]*u+i[0]*c,t[1]=e[1]*a+r[1]*h+n[1]*u+i[1]*c,t[2]=e[2]*a+r[2]*h+n[2]*u+i[2]*c,t}function mr(t,e,r,n,i,s){var o=1-s,a=o*o,h=s*s,u=a*o,c=3*s*a,l=3*h*o,f=h*s;return t[0]=e[0]*u+r[0]*c+n[0]*l+i[0]*f,t[1]=e[1]*u+r[1]*c+n[1]*l+i[1]*f,t[2]=e[2]*u+r[2]*c+n[2]*l+i[2]*f,t}function gr(t,e){e=e||1;var r=2*m()*Math.PI,n=2*m()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}function vr(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[3]*n+r[7]*i+r[11]*s+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*s+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*s+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*s+r[14])/o,t}function yr(t,e,r){var n=e[0],i=e[1],s=e[2];return t[0]=n*r[0]+i*r[3]+s*r[6],t[1]=n*r[1]+i*r[4]+s*r[7],t[2]=n*r[2]+i*r[5]+s*r[8],t}function br(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],h=e[1],u=e[2],c=i*u-s*h,l=s*a-n*u,f=n*h-i*a,d=i*f-s*l,p=s*c-n*f,m=n*l-i*c,g=2*o;return c*=g,l*=g,f*=g,d*=2,p*=2,m*=2,t[0]=a+c+d,t[1]=h+l+p,t[2]=u+f+m,t}function wr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0],s[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),s[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function Mr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),s[1]=i[1],s[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function xr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),s[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),s[2]=i[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function _r(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2],h=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(s*s+o*o+a*a),u=h&&lr(t,e)/h;return Math.acos(Math.min(Math.max(u,-1),1))}function Sr(t){return t[0]=0,t[1]=0,t[2]=0,t}function Pr(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function Ar(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Or(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2];return Math.abs(r-s)<=d*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-o)<=d*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=d*Math.max(1,Math.abs(i),Math.abs(a))}var Er,kr=He,Ir=We,Cr=Je,Br=sr,Rr=or,Tr=Ve,Lr=ar,Fr=(Er=Ue(),function(t,e,r,n,i,s){var o,a;for(e||(e=3),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=s*o,t}function an(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function hn(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],s=r[0]*n[2]-r[2]*n[0],o=r[0]*n[3]-r[3]*n[0],a=r[1]*n[2]-r[2]*n[1],h=r[1]*n[3]-r[3]*n[1],u=r[2]*n[3]-r[3]*n[2],c=e[0],l=e[1],f=e[2],d=e[3];return t[0]=l*u-f*h+d*a,t[1]=-c*u+f*o-d*s,t[2]=c*h-l*o+d*i,t[3]=-c*a+l*s-f*i,t}function un(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t[3]=a+n*(r[3]-a),t}function cn(t,e){var r,n,i,s,o,a;e=e||1;do{o=(r=2*m()-1)*r+(n=2*m()-1)*n}while(o>=1);do{a=(i=2*m()-1)*i+(s=2*m()-1)*s}while(a>=1);var h=Math.sqrt((1-o)/a);return t[0]=e*r,t[1]=e*n,t[2]=e*i*h,t[3]=e*s*h,t}function ln(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*s+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*s+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*s+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*s+r[15]*o,t}function fn(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],h=r[2],u=r[3],c=u*n+a*s-h*i,l=u*i+h*n-o*s,f=u*s+o*i-a*n,d=-o*n-a*i-h*s;return t[0]=c*u+d*-o+l*-h-f*-a,t[1]=l*u+d*-a+f*-o-c*-h,t[2]=f*u+d*-h+c*-a-l*-o,t[3]=e[3],t}function dn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function pn(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function mn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function gn(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=e[0],a=e[1],h=e[2],u=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-h)<=d*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-u)<=d*Math.max(1,Math.abs(s),Math.abs(u))}var vn=Yr,yn=Vr,bn=Zr,wn=Kr,Mn=tn,xn=en,_n=rn,Sn=function(){var t=jr();return function(e,r,n,i,s,o){var a,h;for(r||(r=4),n||(n=0),h=i?Math.min(i*r+n,e.length):e.length,a=n;ad?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r}function kn(t,e){var r=ii(t,e);return Math.acos(2*r*r-1)}function In(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*c+o*a+i*u-s*h,t[1]=i*c+o*h+s*a-n*u,t[2]=s*c+o*u+n*h-i*a,t[3]=o*c-n*a-i*h-s*u,t}function Cn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+o*a,t[1]=i*h+s*a,t[2]=s*h-i*a,t[3]=o*h-n*a,t}function Bn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h-s*a,t[1]=i*h+o*a,t[2]=s*h+n*a,t[3]=o*h-i*a,t}function Rn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+i*a,t[1]=i*h-n*a,t[2]=s*h+o*a,t[3]=o*h-s*a,t}function Tn(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function Ln(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=Math.exp(s),h=o>0?a*Math.sin(o)/o:0;return t[0]=r*h,t[1]=n*h,t[2]=i*h,t[3]=a*Math.cos(o),t}function Fn(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=o>0?Math.atan2(o,s)/o:0;return t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=.5*Math.log(r*r+n*n+i*i+s*s),t}function jn(t,e,r){return Fn(t,e),ni(t,t,r),Ln(t,t),t}function Dn(t,e,r,n){var i,s,o,a,h,u=e[0],c=e[1],l=e[2],f=e[3],p=r[0],m=r[1],g=r[2],v=r[3];return(s=u*p+c*m+l*g+f*v)<0&&(s=-s,p=-p,m=-m,g=-g,v=-v),1-s>d?(i=Math.acos(s),o=Math.sin(i),a=Math.sin((1-n)*i)/o,h=Math.sin(n*i)/o):(a=1-n,h=n),t[0]=a*u+h*p,t[1]=a*c+h*m,t[2]=a*l+h*g,t[3]=a*f+h*v,t}function zn(t){var e=m(),r=m(),n=m(),i=Math.sqrt(1-e),s=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*r),t[1]=i*Math.cos(2*Math.PI*r),t[2]=s*Math.sin(2*Math.PI*n),t[3]=s*Math.cos(2*Math.PI*n),t}function qn(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s,a=o?1/o:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=s*a,t}function Nn(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Un(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var s=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*s+s]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*s+o]-e[3*o+s])*r,t[s]=(e[3*s+i]+e[3*i+s])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t}function Yn(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var s=Math.sin(e),o=Math.cos(e),a=Math.sin(r),h=Math.cos(r),u=Math.sin(n),c=Math.cos(n);return t[0]=s*h*c-o*a*u,t[1]=o*a*c+s*h*u,t[2]=o*h*u-s*a*c,t[3]=o*h*c+s*a*u,t}function Vn(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var Zn,Gn,$n,Xn,Hn,Wn,Jn=Dr,Qn=zr,Kn=qr,ti=Nr,ei=Ur,ri=In,ni=Jr,ii=an,si=un,oi=en,ai=oi,hi=rn,ui=hi,ci=on,li=mn,fi=gn,di=(Zn=Ue(),Gn=Ze(1,0,0),$n=Ze(0,1,0),function(t,e,r){var n=lr(e,r);return n<-.999999?(fr(Zn,Gn,e),Tr(Zn)<1e-6&&fr(Zn,$n,e),cr(Zn,Zn),On(t,Zn,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(fr(Zn,e,r),t[0]=Zn[0],t[1]=Zn[1],t[2]=Zn[2],t[3]=1+n,ci(t,t))}),pi=(Xn=Pn(),Hn=Pn(),function(t,e,r,n,i,s){return Dn(Xn,e,i,s),Dn(Hn,r,n,s),Dn(t,Xn,Hn,2*s*(1-s)),t}),mi=(Wn=vt(),function(t,e,r,n){return Wn[0]=r[0],Wn[3]=r[1],Wn[6]=r[2],Wn[1]=n[0],Wn[4]=n[1],Wn[7]=n[2],Wn[2]=-e[0],Wn[5]=-e[1],Wn[8]=-e[2],ci(t,Un(t,Wn))});function gi(){var t=new p(8);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function vi(t){var e=new p(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function yi(t,e,r,n,i,s,o,a){var h=new p(8);return h[0]=t,h[1]=e,h[2]=r,h[3]=n,h[4]=i,h[5]=s,h[6]=o,h[7]=a,h}function bi(t,e,r,n,i,s,o){var a=new p(8);a[0]=t,a[1]=e,a[2]=r,a[3]=n;var h=.5*i,u=.5*s,c=.5*o;return a[4]=h*n+u*r-c*e,a[5]=u*n+c*t-h*r,a[6]=c*n+h*e-u*t,a[7]=-h*t-u*e-c*r,a}function wi(t,e,r){var n=.5*r[0],i=.5*r[1],s=.5*r[2],o=e[0],a=e[1],h=e[2],u=e[3];return t[0]=o,t[1]=a,t[2]=h,t[3]=u,t[4]=n*u+i*h-s*a,t[5]=i*u+s*o-n*h,t[6]=s*u+n*a-i*o,t[7]=-n*o-i*a-s*h,t}function Mi(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function xi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function _i(t,e){var r=Pn();xe(r,e);var n=new p(3);return we(n,e),wi(t,r,n),t}function Si(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function Pi(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Ai(t,e,r,n,i,s,o,a,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t}var Oi=Kn;function Ei(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var ki=Kn;function Ii(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function Ci(t,e){var r=e[4],n=e[5],i=e[6],s=e[7],o=-e[0],a=-e[1],h=-e[2],u=e[3];return t[0]=2*(r*u+s*o+n*h-i*a),t[1]=2*(n*u+s*a+i*o-r*h),t[2]=2*(i*u+s*h+r*a-n*o),t}function Bi(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=.5*r[0],h=.5*r[1],u=.5*r[2],c=e[4],l=e[5],f=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=o*a+i*u-s*h+c,t[5]=o*h+s*a-n*u+l,t[6]=o*u+n*h-i*a+f,t[7]=-n*a-i*h-s*u+d,t}function Ri(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=a*o+c*n+h*s-u*i,f=h*o+c*i+u*n-a*s,d=u*o+c*s+a*i-h*n,p=c*o-a*n-h*i-u*s;return Cn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Ti(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=a*o+c*n+h*s-u*i,f=h*o+c*i+u*n-a*s,d=u*o+c*s+a*i-h*n,p=c*o-a*n-h*i-u*s;return Bn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Li(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=a*o+c*n+h*s-u*i,f=h*o+c*i+u*n-a*s,d=u*o+c*s+a*i-h*n,p=c*o-a*n-h*i-u*s;return Rn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Fi(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],h=e[1],u=e[2],c=e[3];return t[0]=a*o+c*n+h*s-u*i,t[1]=h*o+c*i+u*n-a*s,t[2]=u*o+c*s+a*i-h*n,t[3]=c*o-a*n-h*i-u*s,a=e[4],h=e[5],u=e[6],c=e[7],t[4]=a*o+c*n+h*s-u*i,t[5]=h*o+c*i+u*n-a*s,t[6]=u*o+c*s+a*i-h*n,t[7]=c*o-a*n-h*i-u*s,t}function ji(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*c+o*a+i*u-s*h,t[1]=i*c+o*h+s*a-n*u,t[2]=s*c+o*u+n*h-i*a,t[3]=o*c-n*a-i*h-s*u,a=r[4],h=r[5],u=r[6],c=r[7],t[4]=n*c+o*a+i*u-s*h,t[5]=i*c+o*h+s*a-n*u,t[6]=s*c+o*u+n*h-i*a,t[7]=o*c-n*a-i*h-s*u,t}function Di(t,e,r,n){if(Math.abs(n)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,s=e[2]/r,o=e[3]/r,a=e[4],h=e[5],u=e[6],c=e[7],l=n*a+i*h+s*u+o*c;t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=(a-n*l)/r,t[5]=(h-i*l)/r,t[6]=(u-s*l)/r,t[7]=(c-o*l)/r}return t}function Qi(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function Ki(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function ts(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],h=t[6],u=t[7],c=e[0],l=e[1],f=e[2],p=e[3],m=e[4],g=e[5],v=e[6],y=e[7];return Math.abs(r-c)<=d*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(n-l)<=d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-f)<=d*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(s-p)<=d*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(o-m)<=d*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(a-g)<=d*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(h-v)<=d*Math.max(1,Math.abs(h),Math.abs(v))&&Math.abs(u-y)<=d*Math.max(1,Math.abs(u),Math.abs(y))}function es(){var t=new p(2);return p!=Float32Array&&(t[0]=0,t[1]=0),t}function rs(t){var e=new p(2);return e[0]=t[0],e[1]=t[1],e}function ns(t,e){var r=new p(2);return r[0]=t,r[1]=e,r}function is(t,e){return t[0]=e[0],t[1]=e[1],t}function ss(t,e,r){return t[0]=e,t[1]=r,t}function os(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function as(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function hs(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function us(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function cs(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function ls(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function fs(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function ds(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function ps(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function ms(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function gs(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function vs(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function ys(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function bs(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function ws(t){var e=t[0],r=t[1];return e*e+r*r}function Ms(t,e){return t[0]=-e[0],t[1]=-e[1],t}function xs(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function _s(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function Ss(t,e){return t[0]*e[0]+t[1]*e[1]}function Ps(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function As(t,e,r,n){var i=e[0],s=e[1];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t}function Os(t,e){e=e||1;var r=2*m()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function Es(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function ks(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function Is(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function Cs(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function Bs(t,e,r,n){var i=e[0]-r[0],s=e[1]-r[1],o=Math.sin(n),a=Math.cos(n);return t[0]=i*a-s*o+r[0],t[1]=i*o+s*a+r[1],t}function Rs(t,e){var r=t[0],n=t[1],i=e[0],s=e[1],o=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+s*s),a=o&&(r*i+n*s)/o;return Math.acos(Math.min(Math.max(a,-1),1))}function Ts(t){return t[0]=0,t[1]=0,t}function Ls(t){return"vec2("+t[0]+", "+t[1]+")"}function Fs(t,e){return t[0]===e[0]&&t[1]===e[1]}function js(t,e){var r=t[0],n=t[1],i=e[0],s=e[1];return Math.abs(r-i)<=d*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))}var Ds=bs,zs=as,qs=hs,Ns=us,Us=vs,Ys=ys,Vs=ws,Zs=function(){var t=es();return function(e,r,n,i,s,o){var a,h;for(r||(r=2),n||(n=0),h=i?Math.min(i*r+n,e.length):e.length,a=n;a{t.exports=function t(e,r,n){function i(o,a){if(!r[o]){if(!e[o]){if(s)return s(o,!0);var h=new Error("Cannot find module '"+o+"'");throw h.code="MODULE_NOT_FOUND",h}var u=r[o]={exports:{}};e[o][0].call(u.exports,(function(t){return i(e[o][1][t]||t)}),u,u.exports,t,e,r,n)}return r[o].exports}for(var s=void 0,o=0;o>2,a=(3&e)<<4|r>>4,h=1>6:64,u=2>4,r=(15&o)<<4|(a=s.indexOf(t.charAt(u++)))>>2,n=(3&a)<<6|(h=s.indexOf(t.charAt(u++))),l[c++]=e,64!==a&&(l[c++]=r),64!==h&&(l[c++]=n);return l}},{"./support":30,"./utils":32}],2:[function(t,e,r){var n=t("./external"),i=t("./stream/DataWorker"),s=t("./stream/Crc32Probe"),o=t("./stream/DataLengthProbe");function a(t,e,r,n,i){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=n,this.compressedContent=i}a.prototype={getContentWorker:function(){var t=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(t,e,r){return t.pipe(new s).pipe(new o("uncompressedSize")).pipe(e.compressWorker(r)).pipe(new o("compressedSize")).withStreamInfo("compression",e)},e.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,r){var n=t("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(t){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,r){var n=t("./utils"),i=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==n.getTypeOf(t)?function(t,e,r){var n=i,s=0+r;t^=-1;for(var o=0;o>>8^n[255&(t^e[o])];return-1^t}(0|e,t,t.length):function(t,e,r){var n=i,s=0+r;t^=-1;for(var o=0;o>>8^n[255&(t^e.charCodeAt(o))];return-1^t}(0|e,t,t.length):0}},{"./utils":32}],5:[function(t,e,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(t,e,r){var n;n="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:n}},{lie:37}],7:[function(t,e,r){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=t("pako"),s=t("./utils"),o=t("./stream/GenericWorker"),a=n?"uint8array":"array";function h(t,e){o.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic="\b\0",s.inherits(h,o),h.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,t.data),!1)},h.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(t){return new h("Deflate",t)},r.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,r){function n(t,e){var r,n="";for(r=0;r>>=8;return n}function i(t,e,r,i,o,c){var l,f,d=t.file,p=t.compression,m=c!==a.utf8encode,g=s.transformTo("string",c(d.name)),v=s.transformTo("string",a.utf8encode(d.name)),y=d.comment,b=s.transformTo("string",c(y)),w=s.transformTo("string",a.utf8encode(y)),M=v.length!==d.name.length,x=w.length!==y.length,_="",S="",P="",A=d.dir,O=d.date,E={crc32:0,compressedSize:0,uncompressedSize:0};e&&!r||(E.crc32=t.crc32,E.compressedSize=t.compressedSize,E.uncompressedSize=t.uncompressedSize);var k=0;e&&(k|=8),m||!M&&!x||(k|=2048);var I,C=0,B=0;A&&(C|=16),"UNIX"===o?(B=798,C|=((I=d.unixPermissions)||(I=A?16893:33204),(65535&I)<<16)):(B=20,C|=63&(d.dosPermissions||0)),l=O.getUTCHours(),l<<=6,l|=O.getUTCMinutes(),l<<=5,l|=O.getUTCSeconds()/2,f=O.getUTCFullYear()-1980,f<<=4,f|=O.getUTCMonth()+1,f<<=5,f|=O.getUTCDate(),M&&(_+="up"+n((S=n(1,1)+n(h(g),4)+v).length,2)+S),x&&(_+="uc"+n((P=n(1,1)+n(h(b),4)+w).length,2)+P);var R="";return R+="\n\0",R+=n(k,2),R+=p.magic,R+=n(l,2),R+=n(f,2),R+=n(E.crc32,4),R+=n(E.compressedSize,4),R+=n(E.uncompressedSize,4),R+=n(g.length,2),R+=n(_.length,2),{fileRecord:u.LOCAL_FILE_HEADER+R+g+_,dirRecord:u.CENTRAL_FILE_HEADER+n(B,2)+R+n(b.length,2)+"\0\0\0\0"+n(C,4)+n(i,4)+g+_+b}}var s=t("../utils"),o=t("../stream/GenericWorker"),a=t("../utf8"),h=t("../crc32"),u=t("../signature");function c(t,e,r,n){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(c,o),c.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,o.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-n-1))/r:100}}))},c.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var r=i(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},c.prototype.closedSource=function(t){this.accumulate=!1;var e,r=this.streamFiles&&!t.file.dir,s=i(t,r,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(s.dirRecord),r)this.push({data:(e=t,u.DATA_DESCRIPTOR+n(e.crc32,4)+n(e.compressedSize,4)+n(e.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:s.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},c.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e=this.index;e--)r=(r<<8)+this.byteAt(e);return this.index+=t,r},readString:function(t){return n.transformTo("string",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readAndCheckSignature:function(t){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=i},{"../utils":32}],19:[function(t,e,r){var n=t("./Uint8ArrayReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,r){var n=t("./DataReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},i.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},i.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./DataReader":18}],21:[function(t,e,r){var n=t("./ArrayReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,r){var n=t("../utils"),i=t("../support"),s=t("./ArrayReader"),o=t("./StringReader"),a=t("./NodeBufferReader"),h=t("./Uint8ArrayReader");e.exports=function(t){var e=n.getTypeOf(t);return n.checkSupport(e),"string"!==e||i.uint8array?"nodebuffer"===e?new a(t):i.uint8array?new h(n.transformTo("uint8array",t)):new s(n.transformTo("array",t)):new o(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,r){r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,r){var n=t("./GenericWorker"),i=t("../utils");function s(t){n.call(this,"ConvertWorker to "+t),this.destType=t}i.inherits(s,n),s.prototype.processChunk=function(t){this.push({data:i.transformTo(this.destType,t.data),meta:t.meta})},e.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,r){var n=t("./GenericWorker"),i=t("../crc32");function s(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(s,n),s.prototype.processChunk=function(t){this.streamInfo.crc32=i(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,r){var n=t("../utils"),i=t("./GenericWorker");function s(t){i.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}n.inherits(s,i),s.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}i.prototype.processChunk.call(this,t)},e.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,r){var n=t("../utils"),i=t("./GenericWorker");function s(t){i.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=n.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}n.inherits(s,i),s.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,r){function n(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var r=0;r "+t:t}},e.exports=n},{}],29:[function(t,e,r){var n=t("../utils"),i=t("./ConvertWorker"),s=t("./GenericWorker"),o=t("../base64"),a=t("../support"),h=t("../external"),u=null;if(a.nodestream)try{u=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function c(t,e,r){var o=e;switch(e){case"blob":case"arraybuffer":o="uint8array";break;case"base64":o="string"}try{this._internalType=o,this._outputType=e,this._mimeType=r,n.checkSupport(o),this._worker=t.pipe(new i(o)),t.lock()}catch(t){this._worker=new s("error"),this._worker.error(t)}}c.prototype={accumulate:function(t){return e=this,r=t,new h.Promise((function(t,i){var s=[],a=e._internalType,h=e._outputType,u=e._mimeType;e.on("data",(function(t,e){s.push(t),r&&r(e)})).on("error",(function(t){s=[],i(t)})).on("end",(function(){try{var e=function(t,e,r){switch(t){case"blob":return n.newBlob(n.transformTo("arraybuffer",e),r);case"base64":return o.encode(e);default:return n.transformTo(t,e)}}(h,function(t,e){var r,n=0,i=null,s=0;for(r=0;r>>6:(r<65536?e[o++]=224|r>>>12:(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63),e[o++]=128|r>>>6&63),e[o++]=128|63&r);return e}(t)},r.utf8decode=function(t){return i.nodebuffer?n.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,r,i,s,o=t.length,h=new Array(2*o);for(e=r=0;e>10&1023,h[r++]=56320|1023&i)}return h.length!==r&&(h.subarray?h=h.subarray(0,r):h.length=r),n.applyFromCharCode(h)}(t=n.transformTo(i.uint8array?"uint8array":"array",t))},n.inherits(u,o),u.prototype.processChunk=function(t){var e=n.transformTo(i.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var s=e;(e=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),e.set(s,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var o=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+a[t[r]]>e?r:e}(e),h=e;o!==e.length&&(i.uint8array?(h=e.subarray(0,o),this.leftOver=e.subarray(o,e.length)):(h=e.slice(0,o),this.leftOver=e.slice(o,e.length))),this.push({data:r.utf8decode(h),meta:t.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=u,n.inherits(c,o),c.prototype.processChunk=function(t){this.push({data:r.utf8encode(t.data),meta:t.meta})},r.Utf8EncodeWorker=c},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,r){var n=t("./support"),i=t("./base64"),s=t("./nodejsUtils"),o=t("set-immediate-shim"),a=t("./external");function h(t){return t}function u(t,e){for(var r=0;r>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(t){if(this.extraFields[1]){var e=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e,r,n,i=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4>>6:(r<65536?e[o++]=224|r>>>12:(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63),e[o++]=128|r>>>6&63),e[o++]=128|63&r);return e},r.buf2binstring=function(t){return h(t,t.length)},r.binstring2buf=function(t){for(var e=new n.Buf8(t.length),r=0,i=e.length;r>10&1023,u[n++]=56320|1023&i)}return h(u,n)},r.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+o[t[r]]>e?r:e}},{"./common":41}],43:[function(t,e,r){e.exports=function(t,e,r,n){for(var i=65535&t|0,s=t>>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e,r,i){var s=n,o=i+r;t^=-1;for(var a=i;a>>8^s[255&(t^e[a])];return-1^t}},{}],46:[function(t,e,r){var n,i=t("../utils/common"),s=t("./trees"),o=t("./adler32"),a=t("./crc32"),h=t("./messages"),u=-2,c=258,l=262,f=113;function d(t,e){return t.msg=h[e],e}function p(t){return(t<<1)-(4t.avail_out&&(r=t.avail_out),0!==r&&(i.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function v(t,e){s._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,g(t.strm)}function y(t,e){t.pending_buf[t.pending++]=e}function b(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function w(t,e){var r,n,i=t.max_chain_length,s=t.strstart,o=t.prev_length,a=t.nice_match,h=t.strstart>t.w_size-l?t.strstart-(t.w_size-l):0,u=t.window,f=t.w_mask,d=t.prev,p=t.strstart+c,m=u[s+o-1],g=u[s+o];t.prev_length>=t.good_match&&(i>>=2),a>t.lookahead&&(a=t.lookahead);do{if(u[(r=e)+o]===g&&u[r+o-1]===m&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do{}while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&sh&&0!=--i);return o<=t.lookahead?o:t.lookahead}function M(t){var e,r,n,s,h,u,c,f,d,p,m=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=m+(m-l)){for(i.arraySet(t.window,t.window,m,m,0),t.match_start-=m,t.strstart-=m,t.block_start-=m,e=r=t.hash_size;n=t.head[--e],t.head[e]=m<=n?n-m:0,--r;);for(e=r=m;n=t.prev[--e],t.prev[e]=m<=n?n-m:0,--r;);s+=m}if(0===t.strm.avail_in)break;if(u=t.strm,c=t.window,f=t.strstart+t.lookahead,p=void 0,(d=s)<(p=u.avail_in)&&(p=d),r=0===p?0:(u.avail_in-=p,i.arraySet(c,u.input,u.next_in,p,f),1===u.state.wrap?u.adler=o(u.adler,c,p,f):2===u.state.wrap&&(u.adler=a(u.adler,c,p,f)),u.next_in+=p,u.total_in+=p,p),t.lookahead+=r,t.lookahead+t.insert>=3)for(h=t.strstart-t.insert,t.ins_h=t.window[h],t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3)if(n=s._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3&&t.match_length<=t.prev_length){for(i=t.strstart+t.lookahead-3,n=s._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=i&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(M(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,v(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-l&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(v(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(v(t,!1),t.strm.avail_out),1)})),new S(4,4,8,4,x),new S(4,5,16,8,x),new S(4,6,32,32,x),new S(4,4,16,16,_),new S(8,16,32,32,_),new S(8,16,128,128,_),new S(8,32,128,256,_),new S(32,128,258,1024,_),new S(32,258,258,4096,_)],r.deflateInit=function(t,e){return E(t,e,8,15,8,0)},r.deflateInit2=E,r.deflateReset=O,r.deflateResetKeep=A,r.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?u:(t.state.gzhead=e,0):u},r.deflate=function(t,e){var r,i,o,h;if(!t||!t.state||5>8&255),y(i,i.gzhead.time>>16&255),y(i,i.gzhead.time>>24&255),y(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),y(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(y(i,255&i.gzhead.extra.length),y(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=a(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(y(i,0),y(i,0),y(i,0),y(i,0),y(i,0),y(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),y(i,3),i.status=f);else{var l=8+(i.w_bits-8<<4)<<8;l|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(l|=32),l+=31-l%31,i.status=f,b(i,l),0!==i.strstart&&(b(i,t.adler>>>16),b(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),g(t),o=i.pending,i.pending!==i.pending_buf_size));)y(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),g(t),o=i.pending,i.pending===i.pending_buf_size)){h=1;break}h=i.gzindexo&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),0===h&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),g(t),o=i.pending,i.pending===i.pending_buf_size)){h=1;break}h=i.gzindexo&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),0===h&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&g(t),i.pending+2<=i.pending_buf_size&&(y(i,255&t.adler),y(i,t.adler>>8&255),t.adler=0,i.status=f)):i.status=f),0!==i.pending){if(g(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&p(e)<=p(r)&&4!==e)return d(t,-5);if(666===i.status&&0!==t.avail_in)return d(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&666!==i.status){var w=2===i.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(M(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(v(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(v(t,!1),0===t.strm.avail_out)?1:2}(i,e):3===i.strategy?function(t,e){for(var r,n,i,o,a=t.window;;){if(t.lookahead<=c){if(M(t),t.lookahead<=c&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&0t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=s._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(v(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(v(t,!1),0===t.strm.avail_out)?1:2}(i,e):n[i.level].func(i,e);if(3!==w&&4!==w||(i.status=666),1===w||3===w)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===w&&(1===e?s._tr_align(i):5!==e&&(s._tr_stored_block(i,0,0,!1),3===e&&(m(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),g(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(y(i,255&t.adler),y(i,t.adler>>8&255),y(i,t.adler>>16&255),y(i,t.adler>>24&255),y(i,255&t.total_in),y(i,t.total_in>>8&255),y(i,t.total_in>>16&255),y(i,t.total_in>>24&255)):(b(i,t.adler>>>16),b(i,65535&t.adler)),g(t),0=r.w_size&&(0===a&&(m(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new i.Buf8(r.w_size),i.arraySet(f,e,d-r.w_size,r.w_size,0),e=f,d=r.w_size),h=t.avail_in,c=t.next_in,l=t.input,t.avail_in=d,t.next_in=0,t.input=e,M(r);r.lookahead>=3;){for(n=r.strstart,s=r.lookahead-2;r.ins_h=(r.ins_h<>>=w=b>>>24,p-=w,0==(w=b>>>16&255))A[s++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=m[(65535&b)+(d&(1<>>=w,p-=w),p<15&&(d+=P[n++]<>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=g[(65535&b)+(d&(1<>>=w,p-=w,(w=s-o)>3,d&=(1<<(p-=M<<3))-1,t.next_in=n,t.next_out=s,t.avail_in=n>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function l(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(852),e.distcode=e.distdyn=new n.Buf32(592),e.sane=1,e.back=-1,0):h}function f(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,l(t)):h}function d(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15=o.wsize?(n.arraySet(o.window,e,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i<(s=o.wsize-o.wnext)&&(s=i),n.arraySet(o.window,e,r-i,s,o.wnext),(i-=s)?(n.arraySet(o.window,e,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=s(r.check,F,2,0),v=g=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&g)<<8)+(g>>8))%31){t.msg="incorrect header check",r.mode=30;break}if(8!=(15&g)){t.msg="unknown compression method",r.mode=30;break}if(v-=4,C=8+(15&(g>>>=4)),0===r.wbits)r.wbits=C;else if(C>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,r.check=s(r.check,F,2,0)),v=g=0,r.mode=3;case 3:for(;v<32;){if(0===p)break t;p--,g+=c[f++]<>>8&255,F[2]=g>>>16&255,F[3]=g>>>24&255,r.check=s(r.check,F,4,0)),v=g=0,r.mode=4;case 4:for(;v<16;){if(0===p)break t;p--,g+=c[f++]<>8),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,r.check=s(r.check,F,2,0)),v=g=0,r.mode=5;case 5:if(1024&r.flags){for(;v<16;){if(0===p)break t;p--,g+=c[f++]<>>8&255,r.check=s(r.check,F,2,0)),v=g=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(p<(x=r.length)&&(x=p),x&&(r.head&&(C=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,c,f,x,C)),512&r.flags&&(r.check=s(r.check,c,x,f)),p-=x,f+=x,r.length-=x),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===p)break t;for(x=0;C=c[f+x++],r.head&&C&&r.length<65536&&(r.head.name+=String.fromCharCode(C)),C&&x>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;v<32;){if(0===p)break t;p--,g+=c[f++]<>>=7&v,v-=7&v,r.mode=27;break}for(;v<3;){if(0===p)break t;p--,g+=c[f++]<>>=1)){case 0:r.mode=14;break;case 1:if(y(r),r.mode=20,6!==e)break;g>>>=2,v-=2;break t;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}g>>>=2,v-=2;break;case 14:for(g>>>=7&v,v-=7&v;v<32;){if(0===p)break t;p--,g+=c[f++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&g,v=g=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(x=r.length){if(p>>=5,v-=5,r.ndist=1+(31&g),g>>>=5,v-=5,r.ncode=4+(15&g),g>>>=4,v-=4,286>>=3,v-=3}for(;r.have<19;)r.lens[j[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,R={bits:r.lenbits},B=a(0,r.lens,0,19,r.lencode,0,r.work,R),r.lenbits=R.bits,B){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,O=65535&L,!((P=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<>>=P,v-=P,r.lens[r.have++]=O;else{if(16===O){for(T=P+2;v>>=P,v-=P,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}C=r.lens[r.have-1],x=3+(3&g),g>>>=2,v-=2}else if(17===O){for(T=P+3;v>>=P)),g>>>=3,v-=3}else{for(T=P+7;v>>=P)),g>>>=7,v-=7}if(r.have+x>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;x--;)r.lens[r.have++]=C}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,R={bits:r.lenbits},B=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,R),r.lenbits=R.bits,B){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,R={bits:r.distbits},B=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,R),r.distbits=R.bits,B){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(6<=p&&258<=m){t.next_out=d,t.avail_out=m,t.next_in=f,t.avail_in=p,r.hold=g,r.bits=v,o(t,M),d=t.next_out,l=t.output,m=t.avail_out,f=t.next_in,c=t.input,p=t.avail_in,g=r.hold,v=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;A=(L=r.lencode[g&(1<>>16&255,O=65535&L,!((P=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<>E)])>>>16&255,O=65535&L,!(E+(P=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<>>=E,v-=E,r.back+=E}if(g>>>=P,v-=P,r.back+=P,r.length=O,0===A){r.mode=26;break}if(32&A){r.back=-1,r.mode=12;break}if(64&A){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&A,r.mode=22;case 22:if(r.extra){for(T=r.extra;v>>=r.extra,v-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;A=(L=r.distcode[g&(1<>>16&255,O=65535&L,!((P=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<>E)])>>>16&255,O=65535&L,!(E+(P=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<>>=E,v-=E,r.back+=E}if(g>>>=P,v-=P,r.back+=P,64&A){t.msg="invalid distance code",r.mode=30;break}r.offset=O,r.extra=15&A,r.mode=24;case 24:if(r.extra){for(T=r.extra;v>>=r.extra,v-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===m)break t;if(x=M-m,r.offset>x){if((x=r.offset-x)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}_=x>r.wnext?(x-=r.wnext,r.wsize-x):r.wnext-x,x>r.length&&(x=r.length),S=r.window}else S=l,_=d-r.offset,x=r.length;for(my?(w=j[D+l[S]],R[T+l[S]]):(w=96,0),d=1<<_-k,P=p=1<>k)+(p-=d)]=b<<24|w<<16|M|0,0!==p;);for(d=1<<_-1;B&d;)d>>=1;if(0!==d?(B&=d-1,B+=d):B=0,S++,0==--L[_]){if(_===A)break;_=e[r+l[S]]}if(O<_&&(B&g)!==m){for(0===k&&(k=O),v+=P,I=1<<(E=_-k);E+k>>7)]}function x(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function _(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<>>=1,r<<=1,0<--e;);return r>>>1}function A(t,e,r){var n,i,o=new Array(16),a=0;for(n=1;n<=s;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=e;i++){var h=t[2*i+1];0!==h&&(t[2*i]=P(o[h]++,h))}}function O(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function E(t){8>1;1<=r;r--)I(t,o,r);for(i=u;r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],I(t,o,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,o[2*i]=o[2*r]+o[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,o[2*r+1]=o[2*n+1]=i,t.heap[1]=i++,I(t,o,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,o,a,h,u=e.dyn_tree,c=e.max_code,l=e.stat_desc.static_tree,f=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,m=e.stat_desc.max_length,g=0;for(o=0;o<=s;o++)t.bl_count[o]=0;for(u[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)m<(o=u[2*u[2*(n=t.heap[r])+1]+1]+1)&&(o=m,g++),u[2*n+1]=o,c>=7;n<30;n++)for(y[n]=i<<7,t=0;t<1<>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),B(t,t.l_desc),B(t,t.d_desc),o=function(t){var e;for(R(t,t.dyn_ltree,t.l_desc.max_code),R(t,t.dyn_dtree,t.d_desc.max_code),B(t,t.bl_desc),e=18;3<=e&&0===t.bl_tree[2*u[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==e?F(t,e,r,n):4===t.strategy||s===i?(_(t,2+(n?1:0),3),C(t,c,l)):(_(t,4+(n?1:0),3),function(t,e,r,n){var i;for(_(t,e-257,5),_(t,r-1,5),_(t,n-4,4),i=0;i>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(d[r]+256+1)]++,t.dyn_dtree[2*M(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){var e;_(t,2,3),S(t,256,c),16===(e=t).bi_valid?(x(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},{"../utils/common":41}],53:[function(t,e,r){e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,r){e.exports="function"==typeof setImmediate?setImmediate:function(){var t=[].slice.apply(arguments);t.splice(1,0,0),setTimeout.apply(null,t)}},{}]},{},[10])(10)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)},5666:t=>{var e=function(t){var e,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,s=Object.create(i.prototype),o=new E(n||[]);return s._invoke=function(t,e,r){var n=l;return function(i,s){if(n===d)throw new Error("Generator is already running");if(n===p){if("throw"===i)throw s;return I()}for(r.method=i,r.arg=s;;){var o=r.delegate;if(o){var a=P(o,r);if(a){if(a===m)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var h=c(t,e,r);if("normal"===h.type){if(n=r.done?p:f,h.arg===m)continue;return{value:h.arg,done:r.done}}"throw"===h.type&&(n=p,r.method="throw",r.arg=h.arg)}}}(t,r,o),s}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l="suspendedStart",f="suspendedYield",d="executing",p="completed",m={};function g(){}function v(){}function y(){}var b={};h(b,s,(function(){return this}));var w=Object.getPrototypeOf,M=w&&w(w(k([])));M&&M!==r&&n.call(M,s)&&(b=M);var x=y.prototype=g.prototype=Object.create(b);function _(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(i,s,o,a){var h=c(t[i],t,s);if("throw"!==h.type){var u=h.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,o,a)}),(function(t){r("throw",t,o,a)})):e.resolve(l).then((function(t){u.value=t,o(u)}),(function(t){return r("throw",t,o,a)}))}a(h.arg)}var i;this._invoke=function(t,n){function s(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(s,s):s()}}function P(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method))return m;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var i=c(n,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var s=i.arg;return s?s.done?(r[t.resultName]=s.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function k(t){if(t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i=0;--s){var o=this.tryEntries[s],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var h=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(h&&u){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;O(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:k(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},5072:function(t,e,r){var n,i;void 0===(i="function"==typeof(n=function(){return function(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var e=document.createElement("base");if(e.href=arguments[0],1===t)return e.href;var r=document.getElementsByTagName("head")[0];r.insertBefore(e,r.firstChild);for(var n,i=document.createElement("a"),s=1;s{var n;!function(){var i=.5*(Math.sqrt(3)-1),s=(3-Math.sqrt(3))/6,o=1/6,a=(Math.sqrt(5)-1)/4,h=(5-Math.sqrt(5))/20;function u(t){var e;e="function"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=l();t=i(" "),e=i(" "),r=i(" ");for(var s=0;s>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}u.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,o=this.permMod12,a=this.perm,h=this.grad3,u=0,c=0,l=0,f=(t+e)*i,d=Math.floor(t+f),p=Math.floor(e+f),m=(d+p)*s,g=t-(d-m),v=e-(p-m);g>v?(r=1,n=0):(r=0,n=1);var y=g-r+s,b=v-n+s,w=g-1+2*s,M=v-1+2*s,x=255&d,_=255&p,S=.5-g*g-v*v;if(S>=0){var P=3*o[x+a[_]];u=(S*=S)*S*(h[P]*g+h[P+1]*v)}var A=.5-y*y-b*b;if(A>=0){var O=3*o[x+r+a[_+n]];c=(A*=A)*A*(h[O]*y+h[O+1]*b)}var E=.5-w*w-M*M;if(E>=0){var k=3*o[x+1+a[_+1]];l=(E*=E)*E*(h[k]*w+h[k+1]*M)}return 70*(u+c+l)},noise3D:function(t,e,r){var n,i,s,a,h,u,c,l,f,d,p=this.permMod12,m=this.perm,g=this.grad3,v=.3333333333333333*(t+e+r),y=Math.floor(t+v),b=Math.floor(e+v),w=Math.floor(r+v),M=(y+b+w)*o,x=t-(y-M),_=e-(b-M),S=r-(w-M);x>=_?_>=S?(h=1,u=0,c=0,l=1,f=1,d=0):x>=S?(h=1,u=0,c=0,l=1,f=0,d=1):(h=0,u=0,c=1,l=1,f=0,d=1):_B?L++:F++,C>R?L++:j++,C>T?L++:D++,B>R?F++:j++,B>T?F++:D++,R>T?j++:D++;var z=C-(l=L>=3?1:0)+h,q=B-(f=F>=3?1:0)+h,N=R-(d=j>=3?1:0)+h,U=T-(p=D>=3?1:0)+h,Y=C-(m=L>=2?1:0)+2*h,V=B-(g=F>=2?1:0)+2*h,Z=R-(v=j>=2?1:0)+2*h,G=T-(y=D>=2?1:0)+2*h,$=C-(b=L>=1?1:0)+3*h,X=B-(w=F>=1?1:0)+3*h,H=R-(M=j>=1?1:0)+3*h,W=T-(x=D>=1?1:0)+3*h,J=C-1+4*h,Q=B-1+4*h,K=R-1+4*h,tt=T-1+4*h,et=255&A,rt=255&O,nt=255&E,it=255&k,st=.6-C*C-B*B-R*R-T*T;if(st<0)i=0;else{var ot=_[et+_[rt+_[nt+_[it]]]]%32*4;i=(st*=st)*st*(S[ot]*C+S[ot+1]*B+S[ot+2]*R+S[ot+3]*T)}var at=.6-z*z-q*q-N*N-U*U;if(at<0)s=0;else{var ht=_[et+l+_[rt+f+_[nt+d+_[it+p]]]]%32*4;s=(at*=at)*at*(S[ht]*z+S[ht+1]*q+S[ht+2]*N+S[ht+3]*U)}var ut=.6-Y*Y-V*V-Z*Z-G*G;if(ut<0)o=0;else{var ct=_[et+m+_[rt+g+_[nt+v+_[it+y]]]]%32*4;o=(ut*=ut)*ut*(S[ct]*Y+S[ct+1]*V+S[ct+2]*Z+S[ct+3]*G)}var lt=.6-$*$-X*X-H*H-W*W;if(lt<0)u=0;else{var ft=_[et+b+_[rt+w+_[nt+M+_[it+x]]]]%32*4;u=(lt*=lt)*lt*(S[ft]*$+S[ft+1]*X+S[ft+2]*H+S[ft+3]*W)}var dt=.6-J*J-Q*Q-K*K-tt*tt;if(dt<0)c=0;else{var pt=_[et+1+_[rt+1+_[nt+1+_[it+1]]]]%32*4;c=(dt*=dt)*dt*(S[pt]*J+S[pt+1]*Q+S[pt+2]*K+S[pt+3]*tt)}return 27*(i+s+o+u+c)}},u._buildPermutationTable=c,void 0===(n=function(){return u}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=u,t.exports=u}()},6479:(t,e,r)=>{var n;!function(){function i(t,e,r){var n=e.x,i=e.y,s=r.x-n,o=r.y-i;if(0!==s||0!==o){var a=((t.x-n)*s+(t.y-i)*o)/(s*s+o*o);a>1?(n=r.x,i=r.y):a>0&&(n+=s*a,i+=o*a)}return(s=t.x-n)*s+(o=t.y-i)*o}function s(t,e,r,n,o){for(var a,h=n,u=e+1;uh&&(a=u,h=c)}h>n&&(a-e>1&&s(t,e,a,n,o),o.push(t[a]),r-a>1&&s(t,a,r,n,o))}function o(t,e){var r=t.length-1,n=[t[0]];return s(t,0,r,e,n),n.push(t[r]),n}function a(t,e,r){if(t.length<=2)return t;var n=void 0!==e?e*e:1;return o(t=r?t:function(t,e){for(var r,n,i,s,o,a=t[0],h=[a],u=1,c=t.length;ue&&(h.push(r),a=r);return a!==r&&h.push(r),h}(t,n),n)}void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{r.d(n,{p:()=>t,Z:()=>c});var t={};r.r(t),r.d(t,{Animation:()=>e,Color:()=>s,DrawerCanvas:()=>i.BrowserDrawerCanvas,GCODEExporter:()=>a.GCODEExporter,Renderer:()=>o.Renderer,SVGExporter:()=>h.SVGExporter,SVGImporter:()=>u.SVGImporter,Timeline:()=>o.Timeline}),r(1714);var e=r(7518),i=r(2251),s=r(7358),o=r(1532),a=r(884),h=r(7773),u=r(5052);const c=t})();var i=n.p,s=n.Z;export{i as Urpflanze,s as default}; \ No newline at end of file +var t={50:t=>{t.exports=JSON.parse('{"name":"@ffmpeg/ffmpeg","version":"0.10.1","description":"FFmpeg WebAssembly version","main":"src/index.js","types":"src/index.d.ts","directories":{"example":"examples"},"scripts":{"start":"node scripts/server.js","build":"rimraf dist && webpack --config scripts/webpack.config.prod.js","prepublishOnly":"npm run build","lint":"eslint src","wait":"rimraf dist && wait-on http://localhost:3000/dist/ffmpeg.dev.js","test":"npm-run-all -p -r start test:all","test:all":"npm-run-all wait test:browser:ffmpeg test:node:all","test:node":"node --experimental-wasm-threads --experimental-wasm-bulk-memory node_modules/.bin/_mocha --exit --bail --require ./scripts/test-helper.js","test:node:all":"npm run test:node -- ./tests/*.test.js","test:browser":"mocha-headless-chrome -a allow-file-access-from-files -a incognito -a no-sandbox -a disable-setuid-sandbox -a disable-logging -t 300000","test:browser:ffmpeg":"npm run test:browser -- -f ./tests/ffmpeg.test.html"},"browser":{"./src/node/index.js":"./src/browser/index.js"},"repository":{"type":"git","url":"git+https://github.com/ffmpegwasm/ffmpeg.wasm.git"},"keywords":["ffmpeg","WebAssembly","video"],"author":"Jerome Wu ","license":"MIT","bugs":{"url":"https://github.com/ffmpegwasm/ffmpeg.wasm/issues"},"engines":{"node":">=12.16.1"},"homepage":"https://github.com/ffmpegwasm/ffmpeg.wasm#readme","dependencies":{"is-url":"^1.2.4","node-fetch":"^2.6.1","regenerator-runtime":"^0.13.7","resolve-url":"^0.2.1"},"devDependencies":{"@babel/core":"^7.12.3","@babel/preset-env":"^7.12.1","@ffmpeg/core":"^0.10.0","@types/emscripten":"^1.39.4","babel-loader":"^8.1.0","chai":"^4.2.0","cors":"^2.8.5","eslint":"^7.12.1","eslint-config-airbnb-base":"^14.1.0","eslint-plugin-import":"^2.22.1","express":"^4.17.1","mocha":"^8.2.1","mocha-headless-chrome":"^2.0.3","npm-run-all":"^4.1.5","wait-on":"^5.3.0","webpack":"^5.3.2","webpack-cli":"^4.1.0","webpack-dev-middleware":"^4.0.0"}}')},4076:(t,e,r)=>{r(5072);const{devDependencies:n}=r(50);t.exports={corePath:`https://unpkg.com/@ffmpeg/core@${n["@ffmpeg/core"].substring(1)}/dist/ffmpeg-core.js`}},2339:(t,e,r)=>{const n=r(5072);t.exports=async t=>{let e=t;if(void 0===t)return new Uint8Array;if("string"==typeof t)if(/data:_data\/([a-zA-Z]*);base64,([^"]*)/.test(t))e=atob(t.split(",")[1]).split("").map((t=>t.charCodeAt(0)));else{const r=await fetch(n(t));e=await r.arrayBuffer()}else(t instanceof File||t instanceof Blob)&&(e=await(r=t,new Promise(((t,e)=>{const n=new FileReader;n.onload=()=>{t(n.result)},n.onerror=({target:{error:{code:t}}})=>{e(Error(`File could not be read! Code=${t}`))},n.readAsArrayBuffer(r)}))));var r;return new Uint8Array(e)}},1440:(t,e,r)=>{const n=r(5072),{log:i}=r(888),s=async(t,e)=>{i("info",`fetch ${t}`);const r=await(await fetch(t)).arrayBuffer();i("info",`${t} file size = ${r.byteLength} bytes`);const n=new Blob([r],{type:e}),s=URL.createObjectURL(n);return i("info",`${t} blob URL = ${s}`),s};t.exports=async({corePath:t})=>{if("string"!=typeof t)throw Error("corePath should be a string!");const e=n(t),r=await s(e,"application/javascript"),o=await s(e.replace("ffmpeg-core.js","ffmpeg-core.wasm"),"application/wasm"),a=await s(e.replace("ffmpeg-core.js","ffmpeg-core.worker.js"),"application/javascript");return"undefined"==typeof createFFmpegCore?new Promise((t=>{const e=document.createElement("script"),n=()=>{e.removeEventListener("load",n),i("info","ffmpeg-core.js script loaded"),t({createFFmpegCore,corePath:r,wasmPath:o,workerPath:a})};e.src=r,e.type="text/javascript",e.addEventListener("load",n),document.getElementsByTagName("head")[0].appendChild(e)})):(i("info","ffmpeg-core.js script is loaded already"),Promise.resolve({createFFmpegCore,corePath:r,wasmPath:o,workerPath:a}))}},3451:(t,e,r)=>{const n=r(4076),i=r(1440),s=r(2339);t.exports={defaultOptions:n,getCreateFFmpegCore:i,fetchFile:s}},1617:t=>{t.exports={defaultArgs:["./ffmpeg","-nostdin","-y"],baseOptions:{log:!1,logger:()=>{},progress:()=>{},corePath:""}}},9289:(t,e,r)=>{const{defaultArgs:n,baseOptions:i}=r(1617),{setLogging:s,setCustomLogger:o,log:a}=r(888),h=r(6405),u=r(7010),{defaultOptions:c,getCreateFFmpegCore:l}=r(3451),{version:f}=r(50),d=Error("ffmpeg.wasm is not ready, make sure you have completed load().");t.exports=(t={})=>{const{log:e,logger:r,progress:p,...m}={...i,...c,...t};let g=null,v=null,y=null,b=!1,w=p;const M=({type:t,message:e})=>{a(t,e),h(e,w),(t=>{"FFMPEG_END"===t&&null!==y&&(y(),y=null,b=!1)})(e)};return s(e),o(r),a("info",`use ffmpeg.wasm v${f}`),{setProgress:t=>{w=t},setLogger:t=>{o(t)},setLogging:s,load:async()=>{if(a("info","load ffmpeg-core"),null!==g)throw Error("ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.");{a("info","loading ffmpeg-core");const{createFFmpegCore:t,corePath:e,workerPath:r,wasmPath:n}=await l(m);g=await t({mainScriptUrlOrBlob:e,printErr:t=>M({type:"fferr",message:t}),print:t=>M({type:"ffout",message:t}),locateFile:(t,e)=>{if("undefined"!=typeof window){if(void 0!==n&&t.endsWith("ffmpeg-core.wasm"))return n;if(void 0!==r&&t.endsWith("ffmpeg-core.worker.js"))return r}return e+t}}),v=g.cwrap("proxy_main","number",["number","number"]),a("info","ffmpeg-core loaded")}},isLoaded:()=>null!==g,run:(...t)=>{if(a("info",`run ffmpeg command: ${t.join(" ")}`),null===g)throw d;if(b)throw Error("ffmpeg.wasm can only run one command at a time");return b=!0,new Promise((e=>{const r=[...n,...t].filter((t=>0!==t.length));y=e,v(...u(g,r))}))},exit:()=>{if(null===g)throw d;b=!1,g.exit(1),g=null,v=null,y=null},FS:(t,...e)=>{if(a("info",`run FS.${t} ${e.map((t=>"string"==typeof t?t:`<${t.length} bytes binary file>`)).join(" ")}`),null===g)throw d;{let r=null;try{r=g.FS[t](...e)}catch(r){throw"readdir"===t?Error(`ffmpeg.FS('readdir', '${e[0]}') error. Check if the path exists, ex: ffmpeg.FS('readdir', '/')`):"readFile"===t?Error(`ffmpeg.FS('readFile', '${e[0]}') error. Check if the path exists`):Error("Oops, something went wrong in FS operation.")}return r}}}}},5045:(t,e,r)=>{r(5666);const n=r(9289),{fetchFile:i}=r(3451);t.exports={createFFmpeg:n,fetchFile:i}},888:t=>{let e=!1,r=()=>{};t.exports={logging:e,setLogging:t=>{e=t},setCustomLogger:t=>{r=t},log:(t,n)=>{r({type:t,message:n}),e&&console.log(`[${t}] ${n}`)}}},7010:t=>{t.exports=(t,e)=>{const r=t._malloc(e.length*Uint32Array.BYTES_PER_ELEMENT);return e.forEach(((e,n)=>{const i=t._malloc(e.length+1);t.writeAsciiToMemory(e,i),t.setValue(r+Uint32Array.BYTES_PER_ELEMENT*n,i,"i32")})),[e.length,r]}},6405:t=>{let e=0,r=0;const n=t=>{const[e,r,n]=t.split(":");return 60*parseFloat(e)*60+60*parseFloat(r)+parseFloat(n)};t.exports=(t,i)=>{if("string"==typeof t)if(t.startsWith(" Duration")){const s=t.split(", ")[0].split(": ")[1],o=n(s);i({duration:o,ratio:r}),(0===e||e>o)&&(e=o)}else if(t.startsWith("frame")||t.startsWith("size")){const s=t.split("time=")[1].split(" ")[0],o=n(s);r=o/e,i({ratio:r,time:o})}else t.startsWith("video:")&&(i({ratio:1}),e=0)}},2894:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.UncontrolledLoop=e.Static=e.Loop=e.Compose=e.Simple=e.resolveSimpleAnimation=void 0;const n=r(4825),i=r(2765);function s(t){const e=i.createAnimation(t);if(e)return t=>{var r;const n="number"==typeof t?t:(null===(r=t.shape.scene)||void 0===r?void 0:r.currentTime)||0;return e.update(n),e.value}}e.resolveSimpleAnimation=s,e.Simple=s,e.Compose=t=>{const e=n.composeAnimations(t);if(e)return t=>{var r;const n="number"==typeof t?t:(null===(r=t.shape.scene)||void 0===r?void 0:r.currentTime)||0;return e(n)}},e.Loop=t=>{const e=t;return void 0===e.interpolator&&(e.interpolator="wave"),e.interpolator&&("string"==typeof e.interpolator?"wave"!==e.interpolator&&(e.direction="alternate"):"object"==typeof e.interpolator&&"wave"!==e.interpolator.type&&(e.direction="alternate")),e.loop=!0,s(e)},e.Static=t=>{const e=t;return e.direction="normal",e.loop=!1,s(e)},e.UncontrolledLoop=t=>{const e=t;return e.direction="normal",e.loop=!0,s(e)}},9727:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=void 0;const r={linear:(t,e,r,n=1)=>r*t/n+e,quadraticIn:(t,e,r,n=1)=>r*(t/=n)*t+e,quadraticOut:(t,e,r,n=1)=>-r*(t/=n)*(t-2)+e,quadraticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t+e:-r/2*(--t*(t-2)-1)+e,cubicIn:(t,e,r,n=1)=>r*(t/=n)*t*t+e,cubicOut:(t,e,r,n=1)=>(t/=n,r*(--t*t*t+1)+e),cubicInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t+e:r/2*((t-=2)*t*t+2)+e,quarticIn:(t,e,r,n=1)=>r*(t/=n)*t*t*t+e,quarticOut:(t,e,r,n=1)=>(t/=n,-r*(--t*t*t*t-1)+e),quarticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t*t+e:-r/2*((t-=2)*t*t*t-2)+e,quinticIn:(t,e,r,n=1)=>r*(t/=n)*t*t*t*t+e,quinticOut:(t,e,r,n=1)=>(t/=n,r*(--t*t*t*t*t+1)+e),quinticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t*t*t+e:r/2*((t-=2)*t*t*t*t+2)+e,sinusoidalIn:(t,e,r,n=1)=>-r*Math.cos(t/n*(Math.PI/2))+r+e,sinusoidalOut:(t,e,r,n=1)=>r*Math.sin(t/n*(Math.PI/2))+e,sinusoidalInOut:(t,e,r,n=1)=>-r/2*(Math.cos(Math.PI*t/n)-1)+e,exponentialIn:(t,e,r,n=1)=>r*Math.pow(2,10*(t/n-1))+e,exponentialOut:(t,e,r,n=1)=>r*(1-Math.pow(2,-10*t/n))+e,exponentialInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*Math.pow(2,10*(t-1))+e:(t--,r/2*(2-Math.pow(2,-10*t))+e),circularIn:(t,e,r,n=1)=>(t/=n,-r*(Math.sqrt(1-t*t)-1)+e),circularOut:(t,e,r,n=1)=>(t/=n,t--,r*Math.sqrt(1-t*t)+e),circularInOut:(t,e,r,n=1)=>(t/=n/2)<1?-r/2*(Math.sqrt(1-t*t)-1)+e:(t-=2,r/2*(Math.sqrt(1-t*t)+1)+e),elasticIn:(t,e,r,n=1,i=1,s=.5)=>{if(0===t)return e;if(1==(t/=n))return e+r;s*=n;let o=0;return i{if(0===t)return e;if(1==(t/=n))return e+r;s*=n;let o=0;return i{if(0===t)return e;if(2==(t/=n/2))return e+r;s*=n;let o=0;return ir*(t/=n)*t*((i+1)*t-i)+e,backOut:(t,e,r,n=1,i=1.70158)=>r*((t=t/n-1)*t*((i+1)*t+i)+1)+e,backInOut:(t,e,r,n=1,i=1.70158)=>(t/=n/2)<1?r/2*(t*t*((1+(i*=1.525))*t-i))+e:r/2*((t-=2)*t*((1+(i*=1.525))*t+i)+2)+e,bounceIn:(t,e,n,i=1)=>n-r.bounceOut(i-t,0,n,i)+e,bounceOut:(t,e,r,n=1)=>(t/=n)<1/2.75?r*(7.5625*t*t)+e:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+e:r*(7.5625*(t-=2.625/2.75)*t+.984375)+e,bounceInOut:(t,e,n,i=1)=>t{Object.defineProperty(e,"__esModule",{value:!0}),e.composeAnimations=void 0;const n=r(7358),i=r(2765),s=r(8782);function o(t,e,r=.5){const i=Array.isArray(t)?t:[t],o=Array.isArray(e)?e:[e],a=[];for(let t=0,e=i.length;tvoid 0!==t)),r=e.length;if(r>0)return t=>{let n;for(let i=0;i{Object.defineProperty(e,"__esModule",{value:!0}),e.createAnimation=void 0;const n=r(9298);e.createAnimation=function(t){const e=n.createInterpolationCallback(t);if(void 0===e)return;const r=t.delay||0,i=t.afterDelay||0,s=t.direction||"normal",o=t.duration||1e3,a="normal"===s||"reverse"===s?o+r:2*o+r+i,h={delay:r,afterDelay:i,direction:s,duration:o,totalDuration:a,loop:"number"==typeof t.loop?t.loop:!!t.loop},u=n.createInterpolator(t.interpolator),c={loop:0,offset:0,loopDuration:a,direction:"alternate"===s?"normal":s,started:!1,ended:!1,value:void 0};return c.update=function(t,e,r,n){const{loop:i,totalDuration:s,delay:o,afterDelay:a,direction:h,duration:u}=e;return c=>{if("number"==typeof i&&c>=s*i||!1===i&&c>=e.totalDuration)return t.started=!1,t.ended=!0,t.offset=r("normal"===h?u:0,u),void(t.value=n(t.offset));if(t.loop=Math.ceil(c/s),c%=s,(c-=o)<=0)return t.started=!1,t.offset=r(0,u),void(t.value=n(t.offset));if(t.started=!0,"alternate"===h)c<=u?(t.direction="normal",t.offset=r(c,u)):(t.direction="reverse",c-=u,(c-=a)>=0?t.offset=1-r(c>=u?u:c,u):t.offset=1);else{const e=r(c>=u?u:c,u);t.offset="normal"===h?e:1-e}t.value=n(t.offset)}}(c,h,u,e),c}},9298:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createInterpolator=e.createInterpolationCallback=void 0;const n=r(7358),i=r(3431),s=r(9727),o=r(8782);e.createInterpolationCallback=function(t){const e=Array.isArray(t.from)?t.from:[t.from],r=Array.isArray(t.to)?t.to:[t.to],i=t.round,s="hue"===t.colorTransitionMode?o.interpolateColorHSL:o.interpolateColorRGB;if(e.length!==r.length)return;const a=[];for(let t=0,o=e.length;t1===t?s:0===t?n:Math.round((n+t*(s-n))*i)/i:t=>1===t?s:0===t?n:n+t*(s-n))}else{const i=e[t],o=r[t],h=n.parseColorAndConvert(i),u=n.parseColorAndConvert(o);void 0!==h&&void 0!==u&&a.push((t=>1===t?o:0===t?i:s(h,u,t)))}}return t=>{const e=a.map((e=>e(t)));return 1===e.length?e[0]:e}},e.createInterpolator=function(t){var e,r;switch(typeof t){case"function":return(e,r)=>t(e/r,e);case"string":switch(t){case"wave":return(t,e)=>.5+.5*Math.sin(t*Math.PI*2/e+1.5*Math.PI);default:if(t in s.Easings){const e=s.Easings[t];return(t,r)=>e(t,0,1,r)}return(t,e)=>s.Easings.linear(t,0,1,e)}case"object":switch(t.type){case"wave":{const r=1.5*Math.PI+((null===(e=t.params)||void 0===e?void 0:e.phase)||0);return(t,e)=>.5+.5*Math.sin(t*Math.PI*2/e+r)}case"elasticIn":case"elasticOut":case"elasticInOut":{const e=s.Easings[t.type],{amplitude:r,period:n}=t.params||{};return(t,i)=>e(t,0,1,i,r,n)}case"backIn":case"backOut":case"backInOut":{const e=s.Easings[t.type],n=(null===(r=t.params)||void 0===r?void 0:r.overshoot)||void 0;return(t,r)=>e(t,0,1,r,n)}case"cubicBezier":{const e=i.default(t.params[0],t.params[1],t.params[2],t.params[3]);return(t,r)=>e(t/r)}}}return(t,e)=>s.Easings.linear(t,0,1,e)}},7518:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(5240),e),i(r(8782),e),i(r(2765),e),i(r(9298),e),i(r(9727),e),i(r(2894),e)},5240:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},8782:(t,e)=>{function r(t,e,r=!0,n="alternate",i=0,s=0){const o="normal"===n||"reverse"===n?e+i:2*e+i+s;return"number"==typeof r&&t>=o*r||!1===r&&t>=o?"normal"===n?e:0:(t%=o,(t-=i)<=0?0:"alternate"===n?t<=e?t:(t-=e,(t-=s)>=0?e-(t>=e?e:t):e):t>=e?e:t)}Object.defineProperty(e,"__esModule",{value:!0}),e.interpolateColorHSL=e.interpolateColorRGB=e.cosp=e.sinp=e.clockOffset=e.clock=void 0,e.clock=r,e.clockOffset=function(t,e,n=!0,i="alternate",s=0,o=0){return r(t,e,n,i,s,o)/e};const n=2*Math.PI;e.sinp=function(t,e,r=0,i=!1){const s=Math.sin(t*n/e+r);return i?.5+.5*s:s},e.cosp=function(t,e,r=0,i=!1){const s=Math.cos(t*n/e+r);return i?.5+.5*s:s},e.interpolateColorRGB=function(t,e,r){const n=t.r+r*(e.r-t.r),i=t.g+r*(e.g-t.g),s=t.b+r*(e.b-t.b),o=t.alpha+r*(e.alpha-t.alpha);return`rgba(${Math.floor(n)},${Math.floor(i)},${Math.floor(s)},${o})`},e.interpolateColorHSL=function(t,e,r){return`hsla(${t.h+r*(e.h-t.h)},${t.s+r*(e.s-t.s)}%,${t.l+r*(e.l-t.l)}%,${t.alpha+r*(e.alpha-t.alpha)})`}},814:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.rgbToHsl=e.hslToRgb=e.rgbToHex=void 0,e.rgbToHex=function(t,e,r){return`#${((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}`},e.hslToRgb=function(t,e,r){let n,i,s;if(t/=360,r/=100,0==(e/=100))n=i=s=r;else{const o=(t,e,r)=>(r+=r<0?1:r>1?-1:0)<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,a=r<.5?r*(1+e):r+e-r*e,h=2*r-a;n=o(h,a,t+1/3),i=o(h,a,t),s=o(h,a,t-1/3)}return[.5+255*n<<0,.5+255*i<<0,.5+255*s<<0]},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;const n=Math.max(t,e,r),i=Math.min(t,e,r),s=(n+i)/2;let o,a;if(n===i)o=a=0;else{const h=n-i;switch(a=s>.5?h/(2-n-i):h/(n+i),n){case t:o=(e-r)/h+(e{Object.defineProperty(e,"__esModule",{value:!0}),e.default={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",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",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",rebeccapurple:"#663399",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",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},7358:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(6097),e),i(r(814),e),i(r(5576),e)},5576:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.parseColorAndConvert=void 0;const n=r(4947),i=r(814);function s(t){if("number"==typeof t)return t>16777215?{type:"rgb",a:t>>24&255,b:t>>16&255,c:t>>8&255,alpha:(255&t)/255}:{type:"rgb",a:t>>16&255,b:t>>8&255,c:255&t,alpha:1};t=t.replace(/\s/g,""),n.default[t]&&(t=n.default[t]);let e=/^#([0-9a-f]{3,8})$/i.exec(t);if(e){const t=e[1];return 3===t.length?{type:"rgb",a:parseInt(t[0]+t[0],16),b:parseInt(t[1]+t[1],16),c:parseInt(t[2]+t[2],16),alpha:1}:{type:"rgb",a:parseInt(t[0]+t[1],16),b:parseInt(t[2]+t[3],16),c:parseInt(t[4]+t[5],16),alpha:t.length>6?parseInt(t.substring(6),16)/255:1}}if(e=/^((hsl|rgb)a?)\((\d+),(\d+)%?,(\d+)%?,?(.+)?\)$/i.exec(t),e){const[,,t,r,n,i,s]=e;return{type:t,a:+r,b:+n,c:+i,alpha:s?+s:1}}}e.parseColorAndConvert=function(t){const e=s(t);if(e){if("hsl"===e.type){const[t,r,n]=i.hslToRgb(e.a,e.b,e.c);return{r:t,g:r,b:n,h:e.a,s:e.b,l:e.c,alpha:e.alpha}}{const[t,r,n]=i.rgbToHsl(e.a,e.b,e.c);return{h:t,s:r,l:n,r:e.a,g:e.b,b:e.c,alpha:e.alpha}}}},e.parseColor=s},6097:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},1172:t=>{window,t.exports=(()=>{var t={193:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Group=void 0;const n=r(107),i=r(15),s=r(485),o=r(658);class a extends i.SceneChild{constructor(t={}){t.type="Group",super(t),this.children=[],["id","name","data","order","type"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=o.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){"object"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=a},107:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Scene=void 0;const n=r(15),i=r(193),s=r(775),o=r(932);class a{constructor(t={}){this.width=400,this.height=400,this.background="hsla(0, 0%, 0%, 1)",this.color="hsla(0, 0%, 100%, 1)",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?(.5+.5*o.clamp(-1,1,t.anchor[0]))*this.width:"left"===t.anchor[0]?0:"right"===t.anchor[0]?this.width:this.center[0],"number"==typeof t.anchor[1]?(.5+.5*o.clamp(-1,1,t.anchor[1]))*this.height:"top"===t.anchor[1]?0:"bottom"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e="number"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,a.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{a.propagateToChilden(t,e)})):t instanceof s.Shape&&t.shape&&(t.shape.scene=e,a.propagateToChilden(t.shape,e))}}e.Scene=a},15:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||"SceneChild",this.name=t.name||this.type+"_"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){"string"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},932:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(21),i=r(345),s=r(271),o="undefined"!=typeof performance?performance:Date;function a(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return o.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=a,e.relativeClamp=function(t,e,r,n,i){return a(n,i,(r-t)/(e-t)*(i-n)+n)};const h={random:new n(Math.random)};e.noise=function(t="random",e=0,r=0,i=0){return void 0===h[t]&&(h[t]=new n(t)),h[t].noise3D(e,r,i)};const u={};function c(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),s=rn?[s,o]:[o,s]}function l(t,e){const r=t.length,n=r/2,i=2*(n+e),s=n-1;if(s>1){const n=r-2,o=Math.floor(e/s);let a=(i-(r+o*n))/2;const h=Math.round(s/a),u=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%h==0||e===n-2),p=o+(d?1:0),m=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);u[i]=(s=t(),o=t(),a=t(),h=t(),function(){let t=(s>>>=0)+(o>>>=0)|0;return s=o^o>>>9,o=(a>>>=0)+(a<<3)|0,t=t+(h=1+(h>>>=0)|0)|0,a=(a=a<<21|a>>>11)+t|0,(t>>>0)/4294967296})}var s,o,a,h;const c=e+u[i]()*(r-e);return void 0!==n?Math.round(c*10**n)/10**n:c},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return s.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=c,e.interpolate=function(t,e,r=.5){const[n,i]=c(t,e),s=Math.max(n.length,i.length),o="number"==typeof r?[r]:r,a=s/2;if(o.length!==a){const t=o.length;for(let e=0;e{Object.defineProperty(e,"__esModule",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return"number"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},348:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(887);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},888:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},658:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(700);var i;!function(t){t[t.None=0]="None",t[t.Scale=2]="Scale",t[t.Center=4]="Center",t[t.Fill=8]="Fill"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn("[Urplfanze:Bounding] cannot sum bounding")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn("[Urplfanze:Bounding] cannot bind bounding")}};class s extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return s.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=s.getBounding(t));const o=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,a=e>=i.Center?r.cx:0,h=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{Object.defineProperty(e,"__esModule",{value:!0}),e.Close=void 0;const n=r(700);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},991:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Mirror=void 0;const n=r(700);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let s=0;s{Object.defineProperty(e,"__esModule",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},62:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Offset=void 0;const n=r(700);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i},785:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Smooth=void 0;const n=r(932),i=r(364),s=r(700);class o extends s.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Solidify=void 0;const n=r(700);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const s=[],o=(e="number"==typeof e?[e]:e).length;let a,h,u=[[0,0],[0,0]],c=[[0,0],[0,0]];for(let r=0,l=0,f=t.length-2;r{Object.defineProperty(e,"__esModule",{value:!0}),e.Subdivide=void 0;const n=r(700);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Modifiers=void 0;const n=r(658),i=r(991),s=r(785),o=r(982),a=r(301),h=r(364),u=r(62),c={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:s.Smooth,Solidify:o.Solidify,Subdivide:a.Subdivide,Close:h.Close,Offset:u.Offset};e.Modifiers=c},775:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=void 0;const n=r(107),i=r(15),s=r(485);class o extends s.ShapeBase{constructor(t){t.type=t.type||"Shape",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn("[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\nYou passed:",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):o.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBase=void 0;const n=r(887),i=r(46),s=r(348),o=r(271),a=r(888),h=r(658),u=r(932),c=r(15),l=n.mat4.create(),f=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class m extends c.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?-1*u.clamp(-1,1,t.anchor[0]):"left"===t.anchor[0]?1:"right"===t.anchor[0]?-1:0,"number"==typeof t.anchor[1]?-1*u.clamp(-1,1,t.anchor[1]):"top"===t.anchor[1]?1:"bottom"===t.anchor[1]?-1:0]:[0,0],this.boundingType="string"==typeof t.boundingType?"relative"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return"function"!=typeof t.repetitions&&"function"!=typeof t.distance&&"function"!=typeof t.displace&&"function"!=typeof t.scale&&"function"!=typeof t.translate&&"function"!=typeof t.skewX&&"function"!=typeof t.skewY&&"function"!=typeof t.squeezeX&&"function"!=typeof t.squeezeY&&"function"!=typeof t.rotateX&&"function"!=typeof t.rotateY&&"function"!=typeof t.rotateZ&&"function"!=typeof t.transformOrigin&&"function"!=typeof t.perspective&&"function"!=typeof t.perspectiveOrigin}isStaticIndexed(){return"function"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return"function"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){"string"==typeof t?(r=r||"repetitions"==t,this.props[t]=e):(r=r||"repetitions"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var c,g;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const v=m.getEmptyPropArguments(this,r),y=v.repetition,b=this.getProp("repetitions",v,1),w=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,M=Array.isArray(b)?b[0]*(null!==(c=b[1])&&void 0!==c?c:b[0]):b,x=Array.isArray(b)?b[0]:M,_=Array.isArray(b)?null!==(g=b[1])&&void 0!==g?g:b[0]:1,S=y.row;S.count=x;const P=y.col;P.count=_,y.count=M,y.col.count=_,y.row.count=x,y.type=w;let A=0;const E=[];let O=0;const k=n.vec2.fromValues((_-1)/2,(x-1)/2),I=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],C=[void 0,void 0,void 0,void 0],B=[void 0,void 0,void 0,void 0];for(let r=0;r1?O/(M-1):1,y.angle=w===i.ERepetitionType.Ring?a.PI2/M*O:0,P.index=c+1,P.offset=_>1?c/(_-1):1,S.index=r+1,S.offset=x>1?r/(x-1):1;const m=this.generateBuffer(t,v),g=m.length,b=this.getShapeBounding();E[O]=new Float32Array(g),A+=g;{const t=s.toVec2(this.getProp("distance",v,s.VEC2_ZERO)),a=this.getProp("displace",v,0),M=s.toVec3(this.getProp("scale",v,s.VEC2_ONE),1),x=s.toVec3(this.getProp("translate",v,s.VEC2_ZERO),0),_=this.getProp("skewX",v,0),S=this.getProp("skewY",v,0),P=this.getProp("squeezeX",v,0),A=this.getProp("squeezeY",v,0),R=this.getProp("rotateX",v,0),T=this.getProp("rotateY",v,0),L=this.getProp("rotateZ",v,0),F=u.clamp(0,1,this.getProp("perspective",v,0)),j=s.toVec3(this.getProp("perspectiveOrigin",v,s.VEC2_ZERO),0),D=s.toVec3(this.getProp("transformOrigin",v,s.VEC2_ZERO),0);let z;switch(w){case i.ERepetitionType.Ring:z=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(z,z,s.VEC3_ZERO,y.angle+a);break;case i.ERepetitionType.Matrix:z=n.vec3.fromValues(t[1]*(c-k[0]),t[0]*(r-k[1]),0)}const q=F>0?Math.max(b.width,b.height)/2:1,N=F>0?q+10*q*(1-F):0,U=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==F||0!==D[0]||0!==D[1],Y=0!==j[0]||0!==j[1];U&&(this.boundingType===i.EBoundingType.Relative?(D[0]=D[0]*(b.width/2)+b.cx,D[1]=D[1]*(b.height/2)+b.cy):(D[0]*=b.width/2,D[1]*=b.height/2),D[2]=N);{n.mat4.identity(f),U&&n.mat4.translate(f,f,D),0===x[0]&&0===x[1]||n.mat4.translate(f,f,x),0===_&&0===S||(s.fromSkew(l,[_,S]),n.mat4.multiply(f,f,l)),0!==R&&n.mat4.rotateX(f,f,R),0!==T&&n.mat4.rotateY(f,f,T),0!==L&&n.mat4.rotateZ(f,f,L),1===M[0]&&1===M[1]||n.mat4.scale(f,f,M),U&&n.mat4.translate(f,f,n.vec3.scale(D,D,-1)),N>0&&(Y&&(this.boundingType===i.EBoundingType.Relative?(j[0]=j[0]*(b.width/2)+b.cx,j[1]=j[1]*(b.height/2)+b.cy):(j[0]*=b.width/2,j[1]*=b.height/2),j[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,z),e&&n.mat4.translate(p,p,I);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),w===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,y.angle+a)}h.Bounding.clear(B);for(let t=0;t0&&(Y&&n.vec3.add(e,e,j),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,N),Y&&n.vec3.sub(e,e,j)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=g/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,v)}E[O][t]=e[0],E[O][t+1]=e[1],h.Bounding.add(B,e[0],e[1]),h.Bounding.add(C,e[0],e[1])}}const R={cx:0,cy:0,x:-1,y:-1,width:2,height:2};h.Bounding.bind(R,B),this.bStaticIndexed&&this.bIndexed||this.addIndex(g,y,R)}h.Bounding.bind(this.bounding,C),this.buffer=new Float32Array(A);for(let t=0,e=0,r=E.length;t({index:1,offset:1,count:1}),m.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...m.getEmptySimpleRepetition(),row:m.getEmptySimpleRepetition(),col:m.getEmptySimpleRepetition()})},425:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBuffer=void 0;const n=r(658),i=r(436);class s extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||"ShapeBuffer",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn("[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property"),this.shape=s.EMPTY_BUFFER):this.shape="function"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return"function"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from("function"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,s=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&"function"!=typeof this.props.sideLength&&"function"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=s},549:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeFollow=void 0;const n=r(775);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeFollow",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},s=this.shape;s.generate(t,!1,i);let o=s.getBuffer();const a=o.length,h=new Float32Array(a*(n.length/2)),u=n.length/2;for(let e=0;e1?e/(u-1):1,count:u};this.shapeUseFollow&&(i.follow=r,s.generate(t,!1,i),o=s.getBuffer());const c=e*a,l=2*e,f=n[l],d=n[l+1];for(let t=0,e=o.length;t1?t/(e-1):1;for(let o=0,a=s.length;o{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeLoop=void 0;const n=r(888),i=r(658),s=r(436),o=r(485);class a extends s.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||"ShapeLoop",super(t),this.loopDependencies=(t.loopDependencies||[]).concat("sideLength"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes("propArguments"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}"loop"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||o.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?("function"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),s=this.getRepetitionSideLength(t),o=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,a={index:0,offset:0,current:0,count:n},h=a.count,u=new Float32Array(2*h);for(let n=0,i=0;n1?n/(a.count-1):1;a.current=s,a.index=n+1,a.offset=h;const c=o(a,t);u[i]=c[0],u[i+1]=c[1]}const c=[void 0,void 0,void 0,void 0],l=this.applyModifiers(u,t);for(let t=0,e=l.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapePrimitive=void 0;const n=r(348),i=r(485),s=r(700),o=r(658);class a extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=o.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:"function"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return"function"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:"number"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp("sideLength",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeRecursive=void 0;const n=r(775);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeRecursive",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionScale&&"function"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp("recursions",e,1)),n=Math.floor(this.getProp("recursionVertex",e,0)),s=this.getProp("recursionScale",e,2),o=this.shape;let a={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const h={...e,recursion:a};o.generate(t,!1,h);const u=o.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=u);let c=u;const l=[a];let f=0,d=1;const p=c.length,m=p/2,g=n<=0?m:Math.min(n,m),v=0===n?1:m/Math.min(n,m),y=new Float32Array(i.summmation(r,g)*p);for(let t=0;t1?e/(r-1):1,u=i.summmation(e,g)*p,m=e-1,b=0===m?0:i.summmation(m,g)*p;for(let i=0,m=g**e;i1?i/(m-1):1,count:m,level:{index:e+1,offset:n,count:r},parent:l[f]},l.push(a),this.shapeUseRecursion&&(h.recursion=a,o.generate(t,!1,h),c=o.getBuffer());const w=u+i*p,M=Math.floor(b+2*i*v),x=y[M],_=y[M+1],S=s**e;for(let t=0,e=p;t1?0:1,count:s}}},h=this.shape.getIndexedBuffer()||[];for(let t=0,e=h.length;t1?0:1,count:s}},i={...a,recursion:r},o=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:o})}if(s>1){const t=this.shape.getBufferLength({...i,parent:{...a}})/2,e=o<=0?t:Math.min(o,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let u=0,c=1;for(let t=1;t1?t/(s-1):1;for(let o=0,l=e**t;o1?o/(l-1):1;for(let d=0,p=h.length;d{Object.defineProperty(e,"__esModule",{value:!0}),e.Circle=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){t.type="Circle",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=s},702:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Line=void 0;const n=r(658),i=r(425);class s extends i.ShapeBuffer{constructor(t={}){t.type="Line",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Lissajous=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){t.type="Lissajous",t.loopDependencies=(t.loopDependencies||[]).concat(["wx","wy","wz"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp("wx",t),r=this.getProp("wy",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),s=this.getRepetitionSideLength(t);return 1/Math.pow(s[0]*s[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp("wx",t,1),this.wy=this.getProp("wy",t,2),this.wz=this.getProp("wz",t,2),super.generateLoopBuffer(t)}}e.Lissajous=s},873:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Polygon=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["sideNumber"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp("sideNumber",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=s},478:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Rect=void 0;const n=r(658),i=r(425);class s extends i.ShapeBuffer{constructor(t={}){t.type="Rect",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=s,s.buffer=[1,1,-1,1,-1,-1,1,-1]},710:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Rose=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){var e,r;t.type="Rose",t.loopDependencies=(t.loopDependencies||[]).concat(["n","d"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>s.getFinalAngleFromK(this.getProp("n",t),this.getProp("d",t)),inc:t=>{const e=this.getProp("n",t),r=this.getProp("d",t),i=this.getRepetitionSideLength(t),s=Math.pow(i[0]*i[1],.45),o=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp("n",t)/this.getProp("d",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=s},82:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Spiral=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type="Spiral",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat(["twists","twistsStart","spiral"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:s.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp("twistsStart",t),end:t=>n.PI2*(this.getProp("twistsStart",t)+this.getProp("twists",t)),inc:t=>{const e=this.getProp("twists",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp("spiral",t),this.r=s.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case s.types.ARCHIMEDE:return t=>t/10;case s.types.HYPERBOLIC:return t=>1/t*3;case s.types.FERMAT:return t=>t**.5/3;case s.types.LITUUS:return t=>t**-.5;case s.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=s,s.types={ARCHIMEDE:"ARCHIMEDE",HYPERBOLIC:"HYPERBOLIC",FERMAT:"FERMAT",LITUUS:"LITUUS",LOGARITHMIC:"LOGARITHMIC"}},490:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Star=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["spikes","innerRadius"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp("spikes",t,5),this.innerRadius=this.getProp("innerRadius",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=s},845:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SuperShape=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){var e,r,i,s,o,a;t.type="SuperShape",t.loopDependencies=(t.loopDependencies||[]).concat(["a","b","m","n1","n2","n3"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(s=t.n1)&&void 0!==s?s:1,this.props.n2=null!==(o=t.n2)&&void 0!==o?o:1,this.props.n3=null!==(a=t.n3)&&void 0!==a?a:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp("a",t),this.b=this.getProp("b",t),this.m=this.getProp("m",t),this.n1=this.getProp("n1",t),this.n2=this.getProp("n2",t),this.n3=this.getProp("n3",t),super.generateLoopBuffer(t)}}e.SuperShape=s},123:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Triangle=void 0;const n=r(658),i=r(425);class s extends i.ShapeBuffer{constructor(t={}){t.type="Triangle",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=s,s.buffer=[1,0,-1,1,-1,-1]},46:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(574),e),i(r(636),e),i(r(345),e),i(r(920),e),i(r(676),e),i(r(300),e),i(r(273),e),i(r(511),e)},574:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},636:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},345:(t,e)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]="Ring",r[r.Matrix=2]="Matrix"},920:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},676:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},300:(t,e)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]="Relative",r[r.Fixed=2]="Fixed"},273:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},511:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},887:(t,e,r)=>{r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>s,mat3:()=>o,mat4:()=>a,quat:()=>c,quat2:()=>l,vec2:()=>f,vec3:()=>h,vec4:()=>u});var n={};r.r(n),r.d(n,{ARRAY_TYPE:()=>p,EPSILON:()=>d,RANDOM:()=>m,equals:()=>b,setMatrixArrayType:()=>g,toRadian:()=>y});var i={};r.r(i),r.d(i,{LDU:()=>j,add:()=>D,adjoint:()=>O,clone:()=>M,copy:()=>x,create:()=>w,determinant:()=>k,equals:()=>N,exactEquals:()=>q,frob:()=>F,fromRotation:()=>R,fromScaling:()=>T,fromValues:()=>S,identity:()=>_,invert:()=>E,mul:()=>V,multiply:()=>I,multiplyScalar:()=>U,multiplyScalarAndAdd:()=>Y,rotate:()=>C,scale:()=>B,set:()=>P,str:()=>L,sub:()=>Z,subtract:()=>z,transpose:()=>A});var s={};r.r(s),r.d(s,{add:()=>ut,clone:()=>X,copy:()=>$,create:()=>G,determinant:()=>K,equals:()=>pt,exactEquals:()=>dt,frob:()=>ht,fromRotation:()=>it,fromScaling:()=>st,fromTranslation:()=>ot,fromValues:()=>W,identity:()=>H,invert:()=>J,mul:()=>mt,multiply:()=>tt,multiplyScalar:()=>lt,multiplyScalarAndAdd:()=>ft,rotate:()=>et,scale:()=>rt,set:()=>Q,str:()=>at,sub:()=>gt,subtract:()=>ct,translate:()=>nt});var o={};r.r(o),r.d(o,{add:()=>Nt,adjoint:()=>At,clone:()=>bt,copy:()=>wt,create:()=>vt,determinant:()=>Et,equals:()=>Gt,exactEquals:()=>Zt,frob:()=>qt,fromMat2d:()=>Lt,fromMat4:()=>yt,fromQuat:()=>Ft,fromRotation:()=>Rt,fromScaling:()=>Tt,fromTranslation:()=>Bt,fromValues:()=>Mt,identity:()=>_t,invert:()=>Pt,mul:()=>Xt,multiply:()=>Ot,multiplyScalar:()=>Yt,multiplyScalarAndAdd:()=>Vt,normalFromMat4:()=>jt,projection:()=>Dt,rotate:()=>It,scale:()=>Ct,set:()=>xt,str:()=>zt,sub:()=>$t,subtract:()=>Ut,translate:()=>kt,transpose:()=>St});var a={};r.r(a),r.d(a,{add:()=>Te,adjoint:()=>ne,clone:()=>Wt,copy:()=>Qt,create:()=>Ht,determinant:()=>ie,equals:()=>ze,exactEquals:()=>De,frob:()=>Re,fromQuat:()=>Pe,fromQuat2:()=>be,fromRotation:()=>pe,fromRotationTranslation:()=>ye,fromRotationTranslationScale:()=>_e,fromRotationTranslationScaleOrigin:()=>Se,fromScaling:()=>de,fromTranslation:()=>fe,fromValues:()=>Jt,fromXRotation:()=>me,fromYRotation:()=>ge,fromZRotation:()=>ve,frustum:()=>Ae,getRotation:()=>xe,getScaling:()=>Me,getTranslation:()=>we,identity:()=>te,invert:()=>re,lookAt:()=>Ie,mul:()=>qe,multiply:()=>se,multiplyScalar:()=>Fe,multiplyScalarAndAdd:()=>je,ortho:()=>ke,perspective:()=>Ee,perspectiveFromFieldOfView:()=>Oe,rotate:()=>he,rotateX:()=>ue,rotateY:()=>ce,rotateZ:()=>le,scale:()=>ae,set:()=>Kt,str:()=>Be,sub:()=>Ne,subtract:()=>Le,targetTo:()=>Ce,translate:()=>oe,transpose:()=>ee});var h={};r.r(h),r.d(h,{add:()=>$e,angle:()=>_r,bezier:()=>mr,ceil:()=>Je,clone:()=>Ye,copy:()=>Ge,create:()=>Ue,cross:()=>fr,dist:()=>Br,distance:()=>sr,div:()=>Cr,divide:()=>Qe,dot:()=>lr,equals:()=>Er,exactEquals:()=>Ar,floor:()=>Ke,forEach:()=>Fr,fromValues:()=>Ze,hermite:()=>pr,inverse:()=>ur,len:()=>Tr,length:()=>Ve,lerp:()=>dr,max:()=>er,min:()=>tr,mul:()=>Ir,multiply:()=>We,negate:()=>hr,normalize:()=>cr,random:()=>gr,rotateX:()=>wr,rotateY:()=>Mr,rotateZ:()=>xr,round:()=>rr,scale:()=>nr,scaleAndAdd:()=>ir,set:()=>Xe,sqrDist:()=>Rr,sqrLen:()=>Lr,squaredDistance:()=>or,squaredLength:()=>ar,str:()=>Pr,sub:()=>kr,subtract:()=>He,transformMat3:()=>yr,transformMat4:()=>vr,transformQuat:()=>br,zero:()=>Sr});var u={};r.r(u),r.d(u,{add:()=>Ur,ceil:()=>Gr,clone:()=>Dr,copy:()=>qr,create:()=>jr,cross:()=>hn,dist:()=>wn,distance:()=>Kr,div:()=>bn,divide:()=>Zr,dot:()=>an,equals:()=>gn,exactEquals:()=>mn,floor:()=>Xr,forEach:()=>Sn,fromValues:()=>zr,inverse:()=>sn,len:()=>xn,length:()=>en,lerp:()=>un,max:()=>Hr,min:()=>$r,mul:()=>yn,multiply:()=>Vr,negate:()=>nn,normalize:()=>on,random:()=>cn,round:()=>Wr,scale:()=>Qr,scaleAndAdd:()=>Jr,set:()=>Nr,sqrDist:()=>Mn,sqrLen:()=>_n,squaredDistance:()=>tn,squaredLength:()=>rn,str:()=>pn,sub:()=>vn,subtract:()=>Yr,transformMat4:()=>ln,transformQuat:()=>fn,zero:()=>dn});var c={};r.r(c),r.d(c,{add:()=>ei,calculateW:()=>Tn,clone:()=>Qn,conjugate:()=>Nn,copy:()=>Kn,create:()=>Pn,dot:()=>ii,equals:()=>fi,exactEquals:()=>li,exp:()=>Ln,fromEuler:()=>Yn,fromMat3:()=>Un,fromValues:()=>Jn,getAngle:()=>kn,getAxisAngle:()=>On,identity:()=>An,invert:()=>qn,len:()=>ai,length:()=>oi,lerp:()=>si,ln:()=>Fn,mul:()=>ri,multiply:()=>In,normalize:()=>ci,pow:()=>jn,random:()=>zn,rotateX:()=>Cn,rotateY:()=>Bn,rotateZ:()=>Rn,rotationTo:()=>di,scale:()=>ni,set:()=>ti,setAxes:()=>mi,setAxisAngle:()=>En,slerp:()=>Dn,sqlerp:()=>pi,sqrLen:()=>ui,squaredLength:()=>hi,str:()=>Vn});var l={};r.r(l),r.d(l,{add:()=>zi,clone:()=>vi,conjugate:()=>Gi,copy:()=>Si,create:()=>gi,dot:()=>Yi,equals:()=>ts,exactEquals:()=>Ki,fromMat4:()=>_i,fromRotation:()=>xi,fromRotationTranslation:()=>wi,fromRotationTranslationValues:()=>bi,fromTranslation:()=>Mi,fromValues:()=>yi,getDual:()=>Oi,getReal:()=>Ei,getTranslation:()=>Ci,identity:()=>Pi,invert:()=>Zi,len:()=>$i,length:()=>Xi,lerp:()=>Vi,mul:()=>Ni,multiply:()=>qi,normalize:()=>Qi,rotateAroundAxis:()=>Di,rotateByQuatAppend:()=>Fi,rotateByQuatPrepend:()=>ji,rotateX:()=>Ri,rotateY:()=>Ti,rotateZ:()=>Li,scale:()=>Ui,set:()=>Ai,setDual:()=>Ii,setReal:()=>ki,sqrLen:()=>Wi,squaredLength:()=>Hi,str:()=>Ji,translate:()=>Bi});var f={};r.r(f),r.d(f,{add:()=>os,angle:()=>Rs,ceil:()=>cs,clone:()=>rs,copy:()=>is,create:()=>es,cross:()=>Ps,dist:()=>Us,distance:()=>vs,div:()=>Ns,divide:()=>us,dot:()=>Ss,equals:()=>js,exactEquals:()=>Fs,floor:()=>ls,forEach:()=>Zs,fromValues:()=>ns,inverse:()=>xs,len:()=>Ds,length:()=>bs,lerp:()=>As,max:()=>ds,min:()=>fs,mul:()=>qs,multiply:()=>hs,negate:()=>Ms,normalize:()=>_s,random:()=>Es,rotate:()=>Bs,round:()=>ps,scale:()=>ms,scaleAndAdd:()=>gs,set:()=>ss,sqrDist:()=>Ys,sqrLen:()=>Vs,squaredDistance:()=>ys,squaredLength:()=>ws,str:()=>Ls,sub:()=>zs,subtract:()=>as,transformMat2:()=>Os,transformMat2d:()=>ks,transformMat3:()=>Is,transformMat4:()=>Cs,zero:()=>Ts});var d=1e-6,p="undefined"!=typeof Float32Array?Float32Array:Array,m=Math.random;function g(t){p=t}var v=Math.PI/180;function y(t){return t*v}function b(t,e){return Math.abs(t-e)<=d*Math.max(1,Math.abs(t),Math.abs(e))}function w(){var t=new p(4);return p!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function M(t){var e=new p(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function x(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function _(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function S(t,e,r,n){var i=new p(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function P(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function A(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function E(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*s-i*n;return o?(o=1/o,t[0]=s*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}function O(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function k(t){return t[0]*t[3]-t[2]*t[1]}function I(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*a+s*h,t[1]=i*a+o*h,t[2]=n*u+s*c,t[3]=i*u+o*c,t}function C(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+s*a,t[1]=i*h+o*a,t[2]=n*-a+s*h,t[3]=i*-a+o*h,t}function B(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1];return t[0]=n*a,t[1]=i*a,t[2]=s*h,t[3]=o*h,t}function R(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function T(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function L(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function F(t){return Math.hypot(t[0],t[1],t[2],t[3])}function j(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function D(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function z(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function q(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function N(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=e[0],a=e[1],h=e[2],u=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-h)<=d*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-u)<=d*Math.max(1,Math.abs(s),Math.abs(u))}function U(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Y(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var V=I,Z=z;function G(){var t=new p(6);return p!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function X(t){var e=new p(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function $(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function H(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function W(t,e,r,n,i,s){var o=new p(6);return o[0]=t,o[1]=e,o[2]=r,o[3]=n,o[4]=i,o[5]=s,o}function Q(t,e,r,n,i,s,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t}function J(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=r*s-n*i;return h?(h=1/h,t[0]=s*h,t[1]=-n*h,t[2]=-i*h,t[3]=r*h,t[4]=(i*a-s*o)*h,t[5]=(n*o-r*a)*h,t):null}function K(t){return t[0]*t[3]-t[1]*t[2]}function tt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1],l=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*u+s*c,t[1]=i*u+o*c,t[2]=n*l+s*f,t[3]=i*l+o*f,t[4]=n*d+s*p+a,t[5]=i*d+o*p+h,t}function et(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*u,t[1]=i*c+o*u,t[2]=n*-u+s*c,t[3]=i*-u+o*c,t[4]=a,t[5]=h,t}function rt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1];return t[0]=n*u,t[1]=i*u,t[2]=s*c,t[3]=o*c,t[4]=a,t[5]=h,t}function nt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=n*u+s*c+a,t[5]=i*u+o*c+h,t}function it(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function st(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function ot(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function at(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function ht(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function ut(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function ct(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function lt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function ft(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function dt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function pt(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],h=e[0],u=e[1],c=e[2],l=e[3],f=e[4],p=e[5];return Math.abs(r-h)<=d*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(n-u)<=d*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(i-c)<=d*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(s-l)<=d*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(o-f)<=d*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-p)<=d*Math.max(1,Math.abs(a),Math.abs(p))}var mt=tt,gt=ct;function vt(){var t=new p(9);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function bt(t){var e=new p(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function wt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Mt(t,e,r,n,i,s,o,a,h){var u=new p(9);return u[0]=t,u[1]=e,u[2]=r,u[3]=n,u[4]=i,u[5]=s,u[6]=o,u[7]=a,u[8]=h,u}function xt(t,e,r,n,i,s,o,a,h,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t}function _t(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function St(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function Pt(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=c*o-a*u,f=-c*s+a*h,d=u*s-o*h,p=r*l+n*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-c*n+i*u)*p,t[2]=(a*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*h)*p,t[5]=(-a*r+i*s)*p,t[6]=d*p,t[7]=(-u*r+n*h)*p,t[8]=(o*r-n*s)*p,t):null}function At(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8];return t[0]=o*c-a*u,t[1]=i*u-n*c,t[2]=n*a-i*o,t[3]=a*h-s*c,t[4]=r*c-i*h,t[5]=i*s-r*a,t[6]=s*u-o*h,t[7]=n*h-r*u,t[8]=r*o-n*s,t}function Et(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],h=t[7],u=t[8];return e*(u*s-o*h)+r*(-u*i+o*a)+n*(h*i-s*a)}function Ot(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=r[0],d=r[1],p=r[2],m=r[3],g=r[4],v=r[5],y=r[6],b=r[7],w=r[8];return t[0]=f*n+d*o+p*u,t[1]=f*i+d*a+p*c,t[2]=f*s+d*h+p*l,t[3]=m*n+g*o+v*u,t[4]=m*i+g*a+v*c,t[5]=m*s+g*h+v*l,t[6]=y*n+b*o+w*u,t[7]=y*i+b*a+w*c,t[8]=y*s+b*h+w*l,t}function kt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=h,t[6]=f*n+d*o+u,t[7]=f*i+d*a+c,t[8]=f*s+d*h+l,t}function It(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*a,t[2]=d*s+f*h,t[3]=d*o-f*n,t[4]=d*a-f*i,t[5]=d*h-f*s,t[6]=u,t[7]=c,t[8]=l,t}function Ct(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Bt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function Rt(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Tt(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Lt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function Ft(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,h=i+i,u=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*h,m=s*o,g=s*a,v=s*h;return t[0]=1-l-p,t[3]=c-v,t[6]=f+g,t[1]=c+v,t[4]=1-u-p,t[7]=d-m,t[2]=f-g,t[5]=d+m,t[8]=1-u-l,t}function jt(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*h-i*o,w=r*u-s*o,M=n*h-i*a,x=n*u-s*a,_=i*u-s*h,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,E=l*g-f*m,O=l*v-d*m,k=f*v-d*g,I=y*k-b*O+w*E+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-h*O+u*E)*I,t[1]=(h*A-o*k-u*P)*I,t[2]=(o*O-a*A+u*S)*I,t[3]=(i*O-n*k-s*E)*I,t[4]=(r*k-i*A+s*P)*I,t[5]=(n*A-r*O-s*S)*I,t[6]=(m*_-g*x+v*M)*I,t[7]=(g*w-p*_-v*b)*I,t[8]=(p*x-m*w+v*y)*I,t):null}function Dt(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function zt(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function qt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Nt(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function Ut(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function Yt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function Vt(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function Zt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function Gt(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],h=t[6],u=t[7],c=t[8],l=e[0],f=e[1],p=e[2],m=e[3],g=e[4],v=e[5],y=e[6],b=e[7],w=e[8];return Math.abs(r-l)<=d*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(n-f)<=d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-p)<=d*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(s-m)<=d*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(o-g)<=d*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(a-v)<=d*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(h-y)<=d*Math.max(1,Math.abs(h),Math.abs(y))&&Math.abs(u-b)<=d*Math.max(1,Math.abs(u),Math.abs(b))&&Math.abs(c-w)<=d*Math.max(1,Math.abs(c),Math.abs(w))}var Xt=Ot,$t=Ut;function Ht(){var t=new p(16);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Wt(t){var e=new p(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Qt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Jt(t,e,r,n,i,s,o,a,h,u,c,l,f,d,m,g){var v=new p(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=n,v[4]=i,v[5]=s,v[6]=o,v[7]=a,v[8]=h,v[9]=u,v[10]=c,v[11]=l,v[12]=f,v[13]=d,v[14]=m,v[15]=g,v}function Kt(t,e,r,n,i,s,o,a,h,u,c,l,f,d,p,m,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t[9]=c,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=g,t}function te(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ee(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=i,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function re(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*h-i*o,w=r*u-s*o,M=n*h-i*a,x=n*u-s*a,_=i*u-s*h,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,E=l*g-f*m,O=l*v-d*m,k=f*v-d*g,I=y*k-b*O+w*E+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-h*O+u*E)*I,t[1]=(i*O-n*k-s*E)*I,t[2]=(m*_-g*x+v*M)*I,t[3]=(f*x-l*_-d*M)*I,t[4]=(h*A-o*k-u*P)*I,t[5]=(r*k-i*A+s*P)*I,t[6]=(g*w-p*_-v*b)*I,t[7]=(c*_-f*w+d*b)*I,t[8]=(o*O-a*A+u*S)*I,t[9]=(n*A-r*O-s*S)*I,t[10]=(p*x-m*w+v*y)*I,t[11]=(l*w-c*x-d*y)*I,t[12]=(a*P-o*E-h*S)*I,t[13]=(r*E-n*P+i*S)*I,t[14]=(m*b-p*M-g*y)*I,t[15]=(c*M-l*b+f*y)*I,t):null}function ne(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15];return t[0]=a*(f*v-d*g)-l*(h*v-u*g)+m*(h*d-u*f),t[1]=-(n*(f*v-d*g)-l*(i*v-s*g)+m*(i*d-s*f)),t[2]=n*(h*v-u*g)-a*(i*v-s*g)+m*(i*u-s*h),t[3]=-(n*(h*d-u*f)-a*(i*d-s*f)+l*(i*u-s*h)),t[4]=-(o*(f*v-d*g)-c*(h*v-u*g)+p*(h*d-u*f)),t[5]=r*(f*v-d*g)-c*(i*v-s*g)+p*(i*d-s*f),t[6]=-(r*(h*v-u*g)-o*(i*v-s*g)+p*(i*u-s*h)),t[7]=r*(h*d-u*f)-o*(i*d-s*f)+c*(i*u-s*h),t[8]=o*(l*v-d*m)-c*(a*v-u*m)+p*(a*d-u*l),t[9]=-(r*(l*v-d*m)-c*(n*v-s*m)+p*(n*d-s*l)),t[10]=r*(a*v-u*m)-o*(n*v-s*m)+p*(n*u-s*a),t[11]=-(r*(a*d-u*l)-o*(n*d-s*l)+c*(n*u-s*a)),t[12]=-(o*(l*g-f*m)-c*(a*g-h*m)+p*(a*f-h*l)),t[13]=r*(l*g-f*m)-c*(n*g-i*m)+p*(n*f-i*l),t[14]=-(r*(a*g-h*m)-o*(n*g-i*m)+p*(n*h-i*a)),t[15]=r*(a*f-h*l)-o*(n*f-i*l)+c*(n*h-i*a),t}function ie(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],h=t[7],u=t[8],c=t[9],l=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*s)*(l*g-f*m)-(e*a-n*s)*(c*g-f*p)+(e*h-i*s)*(c*m-l*p)+(r*a-n*o)*(u*g-f*d)-(r*h-i*o)*(u*m-l*d)+(n*h-i*a)*(u*p-c*d)}function se(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],v=e[14],y=e[15],b=r[0],w=r[1],M=r[2],x=r[3];return t[0]=b*n+w*a+M*l+x*m,t[1]=b*i+w*h+M*f+x*g,t[2]=b*s+w*u+M*d+x*v,t[3]=b*o+w*c+M*p+x*y,b=r[4],w=r[5],M=r[6],x=r[7],t[4]=b*n+w*a+M*l+x*m,t[5]=b*i+w*h+M*f+x*g,t[6]=b*s+w*u+M*d+x*v,t[7]=b*o+w*c+M*p+x*y,b=r[8],w=r[9],M=r[10],x=r[11],t[8]=b*n+w*a+M*l+x*m,t[9]=b*i+w*h+M*f+x*g,t[10]=b*s+w*u+M*d+x*v,t[11]=b*o+w*c+M*p+x*y,b=r[12],w=r[13],M=r[14],x=r[15],t[12]=b*n+w*a+M*l+x*m,t[13]=b*i+w*h+M*f+x*g,t[14]=b*s+w*u+M*d+x*v,t[15]=b*o+w*c+M*p+x*y,t}function oe(t,e,r){var n,i,s,o,a,h,u,c,l,f,d,p,m=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=h,t[6]=u,t[7]=c,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+a*g+l*v+e[12],t[13]=i*m+h*g+f*v+e[13],t[14]=s*m+u*g+d*v+e[14],t[15]=o*m+c*g+p*v+e[15]),t}function ae(t,e,r){var n=r[0],i=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function he(t,e,r,n){var i,s,o,a,h,u,c,l,f,p,m,g,v,y,b,w,M,x,_,S,P,A,E,O,k=n[0],I=n[1],C=n[2],B=Math.hypot(k,I,C);return B0?(r[0]=2*(a*o+c*n+h*s-u*i)/l,r[1]=2*(h*o+c*i+u*n-a*s)/l,r[2]=2*(u*o+c*s+a*i-h*n)/l):(r[0]=2*(a*o+c*n+h*s-u*i),r[1]=2*(h*o+c*i+u*n-a*s),r[2]=2*(u*o+c*s+a*i-h*n)),ye(t,e,r),t}function we(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Me(t,e){var r=e[0],n=e[1],i=e[2],s=e[4],o=e[5],a=e[6],h=e[8],u=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(s,o,a),t[2]=Math.hypot(h,u,c),t}function xe(t,e){var r=new p(3);Me(r,e);var n=1/r[0],i=1/r[1],s=1/r[2],o=e[0]*n,a=e[1]*i,h=e[2]*s,u=e[4]*n,c=e[5]*i,l=e[6]*s,f=e[8]*n,d=e[9]*i,m=e[10]*s,g=o+c+m,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(l-d)/v,t[1]=(f-h)/v,t[2]=(a-u)/v):o>c&&o>m?(v=2*Math.sqrt(1+o-c-m),t[3]=(l-d)/v,t[0]=.25*v,t[1]=(a+u)/v,t[2]=(f+h)/v):c>m?(v=2*Math.sqrt(1+c-o-m),t[3]=(f-h)/v,t[0]=(a+u)/v,t[1]=.25*v,t[2]=(l+d)/v):(v=2*Math.sqrt(1+m-o-c),t[3]=(a-u)/v,t[0]=(f+h)/v,t[1]=(l+d)/v,t[2]=.25*v),t}function _e(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3],h=i+i,u=s+s,c=o+o,l=i*h,f=i*u,d=i*c,p=s*u,m=s*c,g=o*c,v=a*h,y=a*u,b=a*c,w=n[0],M=n[1],x=n[2];return t[0]=(1-(p+g))*w,t[1]=(f+b)*w,t[2]=(d-y)*w,t[3]=0,t[4]=(f-b)*M,t[5]=(1-(l+g))*M,t[6]=(m+v)*M,t[7]=0,t[8]=(d+y)*x,t[9]=(m-v)*x,t[10]=(1-(l+p))*x,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function Se(t,e,r,n,i){var s=e[0],o=e[1],a=e[2],h=e[3],u=s+s,c=o+o,l=a+a,f=s*u,d=s*c,p=s*l,m=o*c,g=o*l,v=a*l,y=h*u,b=h*c,w=h*l,M=n[0],x=n[1],_=n[2],S=i[0],P=i[1],A=i[2],E=(1-(m+v))*M,O=(d+w)*M,k=(p-b)*M,I=(d-w)*x,C=(1-(f+v))*x,B=(g+y)*x,R=(p+b)*_,T=(g-y)*_,L=(1-(f+m))*_;return t[0]=E,t[1]=O,t[2]=k,t[3]=0,t[4]=I,t[5]=C,t[6]=B,t[7]=0,t[8]=R,t[9]=T,t[10]=L,t[11]=0,t[12]=r[0]+S-(E*S+I*P+R*A),t[13]=r[1]+P-(O*S+C*P+T*A),t[14]=r[2]+A-(k*S+B*P+L*A),t[15]=1,t}function Pe(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,h=i+i,u=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*h,m=s*o,g=s*a,v=s*h;return t[0]=1-l-p,t[1]=c+v,t[2]=f-g,t[3]=0,t[4]=c-v,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-u-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ae(t,e,r,n,i,s,o){var a=1/(r-e),h=1/(i-n),u=1/(s-o);return t[0]=2*s*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*h,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*h,t[10]=(o+s)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*u,t[15]=0,t}function Ee(t,e,r,n,i){var s,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(s=1/(n-i),t[10]=(i+n)*s,t[14]=2*i*n*s):(t[10]=-1,t[14]=-2*n),t}function Oe(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),h=2/(o+a),u=2/(i+s);return t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-a)*h*.5,t[9]=(i-s)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function ke(t,e,r,n,i,s,o){var a=1/(e-r),h=1/(n-i),u=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*h,t[14]=(o+s)*u,t[15]=1,t}function Ie(t,e,r,n){var i,s,o,a,h,u,c,l,f,p,m=e[0],g=e[1],v=e[2],y=n[0],b=n[1],w=n[2],M=r[0],x=r[1],_=r[2];return Math.abs(m-M)0&&(c*=d=1/Math.sqrt(d),l*=d,f*=d);var p=h*f-u*l,m=u*c-a*f,g=a*l-h*c;return(d=p*p+m*m+g*g)>0&&(p*=d=1/Math.sqrt(d),m*=d,g*=d),t[0]=p,t[1]=m,t[2]=g,t[3]=0,t[4]=l*g-f*m,t[5]=f*p-c*g,t[6]=c*m-l*p,t[7]=0,t[8]=c,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=s,t[14]=o,t[15]=1,t}function Be(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Re(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Te(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Le(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function Fe(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function je(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function De(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function ze(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],h=t[6],u=t[7],c=t[8],l=t[9],f=t[10],p=t[11],m=t[12],g=t[13],v=t[14],y=t[15],b=e[0],w=e[1],M=e[2],x=e[3],_=e[4],S=e[5],P=e[6],A=e[7],E=e[8],O=e[9],k=e[10],I=e[11],C=e[12],B=e[13],R=e[14],T=e[15];return Math.abs(r-b)<=d*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-w)<=d*Math.max(1,Math.abs(n),Math.abs(w))&&Math.abs(i-M)<=d*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(s-x)<=d*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(o-_)<=d*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(a-S)<=d*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(h-P)<=d*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(u-A)<=d*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(c-E)<=d*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(l-O)<=d*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(f-k)<=d*Math.max(1,Math.abs(f),Math.abs(k))&&Math.abs(p-I)<=d*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(m-C)<=d*Math.max(1,Math.abs(m),Math.abs(C))&&Math.abs(g-B)<=d*Math.max(1,Math.abs(g),Math.abs(B))&&Math.abs(v-R)<=d*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(y-T)<=d*Math.max(1,Math.abs(y),Math.abs(T))}var qe=se,Ne=Le;function Ue(){var t=new p(3);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ye(t){var e=new p(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Ve(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function Ze(t,e,r){var n=new p(3);return n[0]=t,n[1]=e,n[2]=r,n}function Ge(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Xe(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function $e(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function He(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function We(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function Qe(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function Je(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Ke(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function tr(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function er(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function rr(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function nr(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function ir(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function sr(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function or(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function ar(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function hr(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function ur(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function cr(t,e){var r=e[0],n=e[1],i=e[2],s=r*r+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function lr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function fr(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],h=r[2];return t[0]=i*h-s*a,t[1]=s*o-n*h,t[2]=n*a-i*o,t}function dr(t,e,r,n){var i=e[0],s=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t}function pr(t,e,r,n,i,s){var o=s*s,a=o*(2*s-3)+1,h=o*(s-2)+s,u=o*(s-1),c=o*(3-2*s);return t[0]=e[0]*a+r[0]*h+n[0]*u+i[0]*c,t[1]=e[1]*a+r[1]*h+n[1]*u+i[1]*c,t[2]=e[2]*a+r[2]*h+n[2]*u+i[2]*c,t}function mr(t,e,r,n,i,s){var o=1-s,a=o*o,h=s*s,u=a*o,c=3*s*a,l=3*h*o,f=h*s;return t[0]=e[0]*u+r[0]*c+n[0]*l+i[0]*f,t[1]=e[1]*u+r[1]*c+n[1]*l+i[1]*f,t[2]=e[2]*u+r[2]*c+n[2]*l+i[2]*f,t}function gr(t,e){e=e||1;var r=2*m()*Math.PI,n=2*m()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}function vr(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[3]*n+r[7]*i+r[11]*s+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*s+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*s+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*s+r[14])/o,t}function yr(t,e,r){var n=e[0],i=e[1],s=e[2];return t[0]=n*r[0]+i*r[3]+s*r[6],t[1]=n*r[1]+i*r[4]+s*r[7],t[2]=n*r[2]+i*r[5]+s*r[8],t}function br(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],h=e[1],u=e[2],c=i*u-s*h,l=s*a-n*u,f=n*h-i*a,d=i*f-s*l,p=s*c-n*f,m=n*l-i*c,g=2*o;return c*=g,l*=g,f*=g,d*=2,p*=2,m*=2,t[0]=a+c+d,t[1]=h+l+p,t[2]=u+f+m,t}function wr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0],s[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),s[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function Mr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),s[1]=i[1],s[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function xr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),s[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),s[2]=i[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function _r(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2],h=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(s*s+o*o+a*a),u=h&&lr(t,e)/h;return Math.acos(Math.min(Math.max(u,-1),1))}function Sr(t){return t[0]=0,t[1]=0,t[2]=0,t}function Pr(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function Ar(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Er(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2];return Math.abs(r-s)<=d*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-o)<=d*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=d*Math.max(1,Math.abs(i),Math.abs(a))}var Or,kr=He,Ir=We,Cr=Qe,Br=sr,Rr=or,Tr=Ve,Lr=ar,Fr=(Or=Ue(),function(t,e,r,n,i,s){var o,a;for(e||(e=3),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=s*o,t}function an(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function hn(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],s=r[0]*n[2]-r[2]*n[0],o=r[0]*n[3]-r[3]*n[0],a=r[1]*n[2]-r[2]*n[1],h=r[1]*n[3]-r[3]*n[1],u=r[2]*n[3]-r[3]*n[2],c=e[0],l=e[1],f=e[2],d=e[3];return t[0]=l*u-f*h+d*a,t[1]=-c*u+f*o-d*s,t[2]=c*h-l*o+d*i,t[3]=-c*a+l*s-f*i,t}function un(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t[3]=a+n*(r[3]-a),t}function cn(t,e){var r,n,i,s,o,a;e=e||1;do{o=(r=2*m()-1)*r+(n=2*m()-1)*n}while(o>=1);do{a=(i=2*m()-1)*i+(s=2*m()-1)*s}while(a>=1);var h=Math.sqrt((1-o)/a);return t[0]=e*r,t[1]=e*n,t[2]=e*i*h,t[3]=e*s*h,t}function ln(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*s+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*s+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*s+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*s+r[15]*o,t}function fn(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],h=r[2],u=r[3],c=u*n+a*s-h*i,l=u*i+h*n-o*s,f=u*s+o*i-a*n,d=-o*n-a*i-h*s;return t[0]=c*u+d*-o+l*-h-f*-a,t[1]=l*u+d*-a+f*-o-c*-h,t[2]=f*u+d*-h+c*-a-l*-o,t[3]=e[3],t}function dn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function pn(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function mn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function gn(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=e[0],a=e[1],h=e[2],u=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-h)<=d*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-u)<=d*Math.max(1,Math.abs(s),Math.abs(u))}var vn=Yr,yn=Vr,bn=Zr,wn=Kr,Mn=tn,xn=en,_n=rn,Sn=function(){var t=jr();return function(e,r,n,i,s,o){var a,h;for(r||(r=4),n||(n=0),h=i?Math.min(i*r+n,e.length):e.length,a=n;ad?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r}function kn(t,e){var r=ii(t,e);return Math.acos(2*r*r-1)}function In(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*c+o*a+i*u-s*h,t[1]=i*c+o*h+s*a-n*u,t[2]=s*c+o*u+n*h-i*a,t[3]=o*c-n*a-i*h-s*u,t}function Cn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+o*a,t[1]=i*h+s*a,t[2]=s*h-i*a,t[3]=o*h-n*a,t}function Bn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h-s*a,t[1]=i*h+o*a,t[2]=s*h+n*a,t[3]=o*h-i*a,t}function Rn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+i*a,t[1]=i*h-n*a,t[2]=s*h+o*a,t[3]=o*h-s*a,t}function Tn(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function Ln(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=Math.exp(s),h=o>0?a*Math.sin(o)/o:0;return t[0]=r*h,t[1]=n*h,t[2]=i*h,t[3]=a*Math.cos(o),t}function Fn(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=o>0?Math.atan2(o,s)/o:0;return t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=.5*Math.log(r*r+n*n+i*i+s*s),t}function jn(t,e,r){return Fn(t,e),ni(t,t,r),Ln(t,t),t}function Dn(t,e,r,n){var i,s,o,a,h,u=e[0],c=e[1],l=e[2],f=e[3],p=r[0],m=r[1],g=r[2],v=r[3];return(s=u*p+c*m+l*g+f*v)<0&&(s=-s,p=-p,m=-m,g=-g,v=-v),1-s>d?(i=Math.acos(s),o=Math.sin(i),a=Math.sin((1-n)*i)/o,h=Math.sin(n*i)/o):(a=1-n,h=n),t[0]=a*u+h*p,t[1]=a*c+h*m,t[2]=a*l+h*g,t[3]=a*f+h*v,t}function zn(t){var e=m(),r=m(),n=m(),i=Math.sqrt(1-e),s=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*r),t[1]=i*Math.cos(2*Math.PI*r),t[2]=s*Math.sin(2*Math.PI*n),t[3]=s*Math.cos(2*Math.PI*n),t}function qn(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s,a=o?1/o:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=s*a,t}function Nn(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Un(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var s=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*s+s]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*s+o]-e[3*o+s])*r,t[s]=(e[3*s+i]+e[3*i+s])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t}function Yn(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var s=Math.sin(e),o=Math.cos(e),a=Math.sin(r),h=Math.cos(r),u=Math.sin(n),c=Math.cos(n);return t[0]=s*h*c-o*a*u,t[1]=o*a*c+s*h*u,t[2]=o*h*u-s*a*c,t[3]=o*h*c+s*a*u,t}function Vn(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var Zn,Gn,Xn,$n,Hn,Wn,Qn=Dr,Jn=zr,Kn=qr,ti=Nr,ei=Ur,ri=In,ni=Qr,ii=an,si=un,oi=en,ai=oi,hi=rn,ui=hi,ci=on,li=mn,fi=gn,di=(Zn=Ue(),Gn=Ze(1,0,0),Xn=Ze(0,1,0),function(t,e,r){var n=lr(e,r);return n<-.999999?(fr(Zn,Gn,e),Tr(Zn)<1e-6&&fr(Zn,Xn,e),cr(Zn,Zn),En(t,Zn,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(fr(Zn,e,r),t[0]=Zn[0],t[1]=Zn[1],t[2]=Zn[2],t[3]=1+n,ci(t,t))}),pi=($n=Pn(),Hn=Pn(),function(t,e,r,n,i,s){return Dn($n,e,i,s),Dn(Hn,r,n,s),Dn(t,$n,Hn,2*s*(1-s)),t}),mi=(Wn=vt(),function(t,e,r,n){return Wn[0]=r[0],Wn[3]=r[1],Wn[6]=r[2],Wn[1]=n[0],Wn[4]=n[1],Wn[7]=n[2],Wn[2]=-e[0],Wn[5]=-e[1],Wn[8]=-e[2],ci(t,Un(t,Wn))});function gi(){var t=new p(8);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function vi(t){var e=new p(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function yi(t,e,r,n,i,s,o,a){var h=new p(8);return h[0]=t,h[1]=e,h[2]=r,h[3]=n,h[4]=i,h[5]=s,h[6]=o,h[7]=a,h}function bi(t,e,r,n,i,s,o){var a=new p(8);a[0]=t,a[1]=e,a[2]=r,a[3]=n;var h=.5*i,u=.5*s,c=.5*o;return a[4]=h*n+u*r-c*e,a[5]=u*n+c*t-h*r,a[6]=c*n+h*e-u*t,a[7]=-h*t-u*e-c*r,a}function wi(t,e,r){var n=.5*r[0],i=.5*r[1],s=.5*r[2],o=e[0],a=e[1],h=e[2],u=e[3];return t[0]=o,t[1]=a,t[2]=h,t[3]=u,t[4]=n*u+i*h-s*a,t[5]=i*u+s*o-n*h,t[6]=s*u+n*a-i*o,t[7]=-n*o-i*a-s*h,t}function Mi(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function xi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function _i(t,e){var r=Pn();xe(r,e);var n=new p(3);return we(n,e),wi(t,r,n),t}function Si(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function Pi(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Ai(t,e,r,n,i,s,o,a,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t}var Ei=Kn;function Oi(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var ki=Kn;function Ii(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function Ci(t,e){var r=e[4],n=e[5],i=e[6],s=e[7],o=-e[0],a=-e[1],h=-e[2],u=e[3];return t[0]=2*(r*u+s*o+n*h-i*a),t[1]=2*(n*u+s*a+i*o-r*h),t[2]=2*(i*u+s*h+r*a-n*o),t}function Bi(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=.5*r[0],h=.5*r[1],u=.5*r[2],c=e[4],l=e[5],f=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=o*a+i*u-s*h+c,t[5]=o*h+s*a-n*u+l,t[6]=o*u+n*h-i*a+f,t[7]=-n*a-i*h-s*u+d,t}function Ri(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=a*o+c*n+h*s-u*i,f=h*o+c*i+u*n-a*s,d=u*o+c*s+a*i-h*n,p=c*o-a*n-h*i-u*s;return Cn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Ti(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=a*o+c*n+h*s-u*i,f=h*o+c*i+u*n-a*s,d=u*o+c*s+a*i-h*n,p=c*o-a*n-h*i-u*s;return Bn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Li(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=a*o+c*n+h*s-u*i,f=h*o+c*i+u*n-a*s,d=u*o+c*s+a*i-h*n,p=c*o-a*n-h*i-u*s;return Rn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Fi(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],h=e[1],u=e[2],c=e[3];return t[0]=a*o+c*n+h*s-u*i,t[1]=h*o+c*i+u*n-a*s,t[2]=u*o+c*s+a*i-h*n,t[3]=c*o-a*n-h*i-u*s,a=e[4],h=e[5],u=e[6],c=e[7],t[4]=a*o+c*n+h*s-u*i,t[5]=h*o+c*i+u*n-a*s,t[6]=u*o+c*s+a*i-h*n,t[7]=c*o-a*n-h*i-u*s,t}function ji(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*c+o*a+i*u-s*h,t[1]=i*c+o*h+s*a-n*u,t[2]=s*c+o*u+n*h-i*a,t[3]=o*c-n*a-i*h-s*u,a=r[4],h=r[5],u=r[6],c=r[7],t[4]=n*c+o*a+i*u-s*h,t[5]=i*c+o*h+s*a-n*u,t[6]=s*c+o*u+n*h-i*a,t[7]=o*c-n*a-i*h-s*u,t}function Di(t,e,r,n){if(Math.abs(n)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,s=e[2]/r,o=e[3]/r,a=e[4],h=e[5],u=e[6],c=e[7],l=n*a+i*h+s*u+o*c;t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=(a-n*l)/r,t[5]=(h-i*l)/r,t[6]=(u-s*l)/r,t[7]=(c-o*l)/r}return t}function Ji(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function Ki(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function ts(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],h=t[6],u=t[7],c=e[0],l=e[1],f=e[2],p=e[3],m=e[4],g=e[5],v=e[6],y=e[7];return Math.abs(r-c)<=d*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(n-l)<=d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-f)<=d*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(s-p)<=d*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(o-m)<=d*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(a-g)<=d*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(h-v)<=d*Math.max(1,Math.abs(h),Math.abs(v))&&Math.abs(u-y)<=d*Math.max(1,Math.abs(u),Math.abs(y))}function es(){var t=new p(2);return p!=Float32Array&&(t[0]=0,t[1]=0),t}function rs(t){var e=new p(2);return e[0]=t[0],e[1]=t[1],e}function ns(t,e){var r=new p(2);return r[0]=t,r[1]=e,r}function is(t,e){return t[0]=e[0],t[1]=e[1],t}function ss(t,e,r){return t[0]=e,t[1]=r,t}function os(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function as(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function hs(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function us(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function cs(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function ls(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function fs(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function ds(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function ps(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function ms(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function gs(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function vs(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function ys(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function bs(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function ws(t){var e=t[0],r=t[1];return e*e+r*r}function Ms(t,e){return t[0]=-e[0],t[1]=-e[1],t}function xs(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function _s(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function Ss(t,e){return t[0]*e[0]+t[1]*e[1]}function Ps(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function As(t,e,r,n){var i=e[0],s=e[1];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t}function Es(t,e){e=e||1;var r=2*m()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function Os(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function ks(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function Is(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function Cs(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function Bs(t,e,r,n){var i=e[0]-r[0],s=e[1]-r[1],o=Math.sin(n),a=Math.cos(n);return t[0]=i*a-s*o+r[0],t[1]=i*o+s*a+r[1],t}function Rs(t,e){var r=t[0],n=t[1],i=e[0],s=e[1],o=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+s*s),a=o&&(r*i+n*s)/o;return Math.acos(Math.min(Math.max(a,-1),1))}function Ts(t){return t[0]=0,t[1]=0,t}function Ls(t){return"vec2("+t[0]+", "+t[1]+")"}function Fs(t,e){return t[0]===e[0]&&t[1]===e[1]}function js(t,e){var r=t[0],n=t[1],i=e[0],s=e[1];return Math.abs(r-i)<=d*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))}var Ds=bs,zs=as,qs=hs,Ns=us,Us=vs,Ys=ys,Vs=ws,Zs=function(){var t=es();return function(e,r,n,i,s,o){var a,h;for(r||(r=2),n||(n=0),h=i?Math.min(i*r+n,e.length):e.length,a=n;a{var n;!function(){var i=.5*(Math.sqrt(3)-1),s=(3-Math.sqrt(3))/6,o=1/6,a=(Math.sqrt(5)-1)/4,h=(5-Math.sqrt(5))/20;function u(t){var e;e="function"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=l();t=i(" "),e=i(" "),r=i(" ");for(var s=0;s>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}u.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,o=this.permMod12,a=this.perm,h=this.grad3,u=0,c=0,l=0,f=(t+e)*i,d=Math.floor(t+f),p=Math.floor(e+f),m=(d+p)*s,g=t-(d-m),v=e-(p-m);g>v?(r=1,n=0):(r=0,n=1);var y=g-r+s,b=v-n+s,w=g-1+2*s,M=v-1+2*s,x=255&d,_=255&p,S=.5-g*g-v*v;if(S>=0){var P=3*o[x+a[_]];u=(S*=S)*S*(h[P]*g+h[P+1]*v)}var A=.5-y*y-b*b;if(A>=0){var E=3*o[x+r+a[_+n]];c=(A*=A)*A*(h[E]*y+h[E+1]*b)}var O=.5-w*w-M*M;if(O>=0){var k=3*o[x+1+a[_+1]];l=(O*=O)*O*(h[k]*w+h[k+1]*M)}return 70*(u+c+l)},noise3D:function(t,e,r){var n,i,s,a,h,u,c,l,f,d,p=this.permMod12,m=this.perm,g=this.grad3,v=.3333333333333333*(t+e+r),y=Math.floor(t+v),b=Math.floor(e+v),w=Math.floor(r+v),M=(y+b+w)*o,x=t-(y-M),_=e-(b-M),S=r-(w-M);x>=_?_>=S?(h=1,u=0,c=0,l=1,f=1,d=0):x>=S?(h=1,u=0,c=0,l=1,f=0,d=1):(h=0,u=0,c=1,l=1,f=0,d=1):_B?L++:F++,C>R?L++:j++,C>T?L++:D++,B>R?F++:j++,B>T?F++:D++,R>T?j++:D++;var z=C-(l=L>=3?1:0)+h,q=B-(f=F>=3?1:0)+h,N=R-(d=j>=3?1:0)+h,U=T-(p=D>=3?1:0)+h,Y=C-(m=L>=2?1:0)+2*h,V=B-(g=F>=2?1:0)+2*h,Z=R-(v=j>=2?1:0)+2*h,G=T-(y=D>=2?1:0)+2*h,X=C-(b=L>=1?1:0)+3*h,$=B-(w=F>=1?1:0)+3*h,H=R-(M=j>=1?1:0)+3*h,W=T-(x=D>=1?1:0)+3*h,Q=C-1+4*h,J=B-1+4*h,K=R-1+4*h,tt=T-1+4*h,et=255&A,rt=255&E,nt=255&O,it=255&k,st=.6-C*C-B*B-R*R-T*T;if(st<0)i=0;else{var ot=_[et+_[rt+_[nt+_[it]]]]%32*4;i=(st*=st)*st*(S[ot]*C+S[ot+1]*B+S[ot+2]*R+S[ot+3]*T)}var at=.6-z*z-q*q-N*N-U*U;if(at<0)s=0;else{var ht=_[et+l+_[rt+f+_[nt+d+_[it+p]]]]%32*4;s=(at*=at)*at*(S[ht]*z+S[ht+1]*q+S[ht+2]*N+S[ht+3]*U)}var ut=.6-Y*Y-V*V-Z*Z-G*G;if(ut<0)o=0;else{var ct=_[et+m+_[rt+g+_[nt+v+_[it+y]]]]%32*4;o=(ut*=ut)*ut*(S[ct]*Y+S[ct+1]*V+S[ct+2]*Z+S[ct+3]*G)}var lt=.6-X*X-$*$-H*H-W*W;if(lt<0)u=0;else{var ft=_[et+b+_[rt+w+_[nt+M+_[it+x]]]]%32*4;u=(lt*=lt)*lt*(S[ft]*X+S[ft+1]*$+S[ft+2]*H+S[ft+3]*W)}var dt=.6-Q*Q-J*J-K*K-tt*tt;if(dt<0)c=0;else{var pt=_[et+1+_[rt+1+_[nt+1+_[it+1]]]]%32*4;c=(dt*=dt)*dt*(S[pt]*Q+S[pt+1]*J+S[pt+2]*K+S[pt+3]*tt)}return 27*(i+s+o+u+c)}},u._buildPermutationTable=c,void 0===(n=function(){return u}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=u,t.exports=u}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(915)})()},2513:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Group=void 0;const n=r(1378),i=r(541),s=r(2648),o=r(5511);class a extends i.SceneChild{constructor(t={}){t.type="Group",super(t),this.children=[],["id","name","data","order","type"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=o.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){"object"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=a},1378:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Scene=void 0;const n=r(541),i=r(2513),s=r(6448),o=r(313);class a{constructor(t={}){this.width=400,this.height=400,this.background="hsla(0, 0%, 0%, 1)",this.color="hsla(0, 0%, 100%, 1)",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?(.5+.5*o.clamp(-1,1,t.anchor[0]))*this.width:"left"===t.anchor[0]?0:"right"===t.anchor[0]?this.width:this.center[0],"number"==typeof t.anchor[1]?(.5+.5*o.clamp(-1,1,t.anchor[1]))*this.height:"top"===t.anchor[1]?0:"bottom"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e="number"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,a.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{a.propagateToChilden(t,e)})):t instanceof s.Shape&&t.shape&&(t.shape.scene=e,a.propagateToChilden(t.shape,e))}}e.Scene=a},541:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||"SceneChild",this.name=t.name||this.type+"_"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){"string"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},313:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(21),i=r(2769),s=r(795),o="undefined"!=typeof performance?performance:Date;function a(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return o.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=a,e.relativeClamp=function(t,e,r,n,i){return a(n,i,(r-t)/(e-t)*(i-n)+n)};const h={random:new n(Math.random)};e.noise=function(t="random",e=0,r=0,i=0){return void 0===h[t]&&(h[t]=new n(t)),h[t].noise3D(e,r,i)};const u={};function c(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),s=rn?[s,o]:[o,s]}function l(t,e){const r=t.length,n=r/2,i=2*(n+e),s=n-1;if(s>1){const n=r-2,o=Math.floor(e/s);let a=(i-(r+o*n))/2;const h=Math.round(s/a),u=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%h==0||e===n-2),p=o+(d?1:0),m=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);u[i]=(s=t(),o=t(),a=t(),h=t(),function(){let t=(s>>>=0)+(o>>>=0)|0;return s=o^o>>>9,o=(a>>>=0)+(a<<3)|0,t=t+(h=1+(h>>>=0)|0)|0,a=(a=a<<21|a>>>11)+t|0,(t>>>0)/4294967296})}var s,o,a,h;const c=e+u[i]()*(r-e);return void 0!==n?Math.round(c*10**n)/10**n:c},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return s.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=c,e.interpolate=function(t,e,r=.5){const[n,i]=c(t,e),s=Math.max(n.length,i.length),o="number"==typeof r?[r]:r,a=s/2;if(o.length!==a){const t=o.length;for(let e=0;e{Object.defineProperty(e,"__esModule",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return"number"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},8721:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(887);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},3792:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},5511:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(9958);var i;!function(t){t[t.None=0]="None",t[t.Scale=2]="Scale",t[t.Center=4]="Center",t[t.Fill=8]="Fill"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn("[Urplfanze:Bounding] cannot sum bounding")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn("[Urplfanze:Bounding] cannot bind bounding")}};class s extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return s.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=s.getBounding(t));const o=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,a=e>=i.Center?r.cx:0,h=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{Object.defineProperty(e,"__esModule",{value:!0}),e.Close=void 0;const n=r(9958);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},1740:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Mirror=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let s=0;s{Object.defineProperty(e,"__esModule",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},3315:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Offset=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i},4660:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Smooth=void 0;const n=r(313),i=r(8301),s=r(9958);class o extends s.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Solidify=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const s=[],o=(e="number"==typeof e?[e]:e).length;let a,h,u=[[0,0],[0,0]],c=[[0,0],[0,0]];for(let r=0,l=0,f=t.length-2;r{Object.defineProperty(e,"__esModule",{value:!0}),e.Subdivide=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{e.q=void 0;const n=r(5511),i=r(1740),s=r(4660),o=r(5838),a=r(5588),h=r(8301),u=r(3315),c={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:s.Smooth,Solidify:o.Solidify,Subdivide:a.Subdivide,Close:h.Close,Offset:u.Offset};e.q=c},6448:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=void 0;const n=r(1378),i=r(541),s=r(2648);class o extends s.ShapeBase{constructor(t){t.type=t.type||"Shape",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn("[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\nYou passed:",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):o.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBase=void 0;const n=r(887),i=r(3757),s=r(8721),o=r(795),a=r(3792),h=r(5511),u=r(313),c=r(541),l=n.mat4.create(),f=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class m extends c.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?-1*u.clamp(-1,1,t.anchor[0]):"left"===t.anchor[0]?1:"right"===t.anchor[0]?-1:0,"number"==typeof t.anchor[1]?-1*u.clamp(-1,1,t.anchor[1]):"top"===t.anchor[1]?1:"bottom"===t.anchor[1]?-1:0]:[0,0],this.boundingType="string"==typeof t.boundingType?"relative"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return"function"!=typeof t.repetitions&&"function"!=typeof t.distance&&"function"!=typeof t.displace&&"function"!=typeof t.scale&&"function"!=typeof t.translate&&"function"!=typeof t.skewX&&"function"!=typeof t.skewY&&"function"!=typeof t.squeezeX&&"function"!=typeof t.squeezeY&&"function"!=typeof t.rotateX&&"function"!=typeof t.rotateY&&"function"!=typeof t.rotateZ&&"function"!=typeof t.transformOrigin&&"function"!=typeof t.perspective&&"function"!=typeof t.perspectiveOrigin}isStaticIndexed(){return"function"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return"function"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){"string"==typeof t?(r=r||"repetitions"==t,this.props[t]=e):(r=r||"repetitions"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var c,g;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const v=m.getEmptyPropArguments(this,r),y=v.repetition,b=this.getProp("repetitions",v,1),w=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,M=Array.isArray(b)?b[0]*(null!==(c=b[1])&&void 0!==c?c:b[0]):b,x=Array.isArray(b)?b[0]:M,_=Array.isArray(b)?null!==(g=b[1])&&void 0!==g?g:b[0]:1,S=y.row;S.count=x;const P=y.col;P.count=_,y.count=M,y.col.count=_,y.row.count=x,y.type=w;let A=0;const E=[];let O=0;const k=n.vec2.fromValues((_-1)/2,(x-1)/2),I=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],C=[void 0,void 0,void 0,void 0],B=[void 0,void 0,void 0,void 0];for(let r=0;r1?O/(M-1):1,y.angle=w===i.ERepetitionType.Ring?a.PI2/M*O:0,P.index=c+1,P.offset=_>1?c/(_-1):1,S.index=r+1,S.offset=x>1?r/(x-1):1;const m=this.generateBuffer(t,v),g=m.length,b=this.getShapeBounding();E[O]=new Float32Array(g),A+=g;{const t=s.toVec2(this.getProp("distance",v,s.VEC2_ZERO)),a=this.getProp("displace",v,0),M=s.toVec3(this.getProp("scale",v,s.VEC2_ONE),1),x=s.toVec3(this.getProp("translate",v,s.VEC2_ZERO),0),_=this.getProp("skewX",v,0),S=this.getProp("skewY",v,0),P=this.getProp("squeezeX",v,0),A=this.getProp("squeezeY",v,0),R=this.getProp("rotateX",v,0),T=this.getProp("rotateY",v,0),L=this.getProp("rotateZ",v,0),F=u.clamp(0,1,this.getProp("perspective",v,0)),j=s.toVec3(this.getProp("perspectiveOrigin",v,s.VEC2_ZERO),0),D=s.toVec3(this.getProp("transformOrigin",v,s.VEC2_ZERO),0);let z;switch(w){case i.ERepetitionType.Ring:z=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(z,z,s.VEC3_ZERO,y.angle+a);break;case i.ERepetitionType.Matrix:z=n.vec3.fromValues(t[1]*(c-k[0]),t[0]*(r-k[1]),0)}const q=F>0?Math.max(b.width,b.height)/2:1,N=F>0?q+10*q*(1-F):0,U=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==F||0!==D[0]||0!==D[1],Y=0!==j[0]||0!==j[1];U&&(this.boundingType===i.EBoundingType.Relative?(D[0]=D[0]*(b.width/2)+b.cx,D[1]=D[1]*(b.height/2)+b.cy):(D[0]*=b.width/2,D[1]*=b.height/2),D[2]=N);{n.mat4.identity(f),U&&n.mat4.translate(f,f,D),0===x[0]&&0===x[1]||n.mat4.translate(f,f,x),0===_&&0===S||(s.fromSkew(l,[_,S]),n.mat4.multiply(f,f,l)),0!==R&&n.mat4.rotateX(f,f,R),0!==T&&n.mat4.rotateY(f,f,T),0!==L&&n.mat4.rotateZ(f,f,L),1===M[0]&&1===M[1]||n.mat4.scale(f,f,M),U&&n.mat4.translate(f,f,n.vec3.scale(D,D,-1)),N>0&&(Y&&(this.boundingType===i.EBoundingType.Relative?(j[0]=j[0]*(b.width/2)+b.cx,j[1]=j[1]*(b.height/2)+b.cy):(j[0]*=b.width/2,j[1]*=b.height/2),j[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,z),e&&n.mat4.translate(p,p,I);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),w===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,y.angle+a)}h.Bounding.clear(B);for(let t=0;t0&&(Y&&n.vec3.add(e,e,j),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,N),Y&&n.vec3.sub(e,e,j)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=g/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,v)}E[O][t]=e[0],E[O][t+1]=e[1],h.Bounding.add(B,e[0],e[1]),h.Bounding.add(C,e[0],e[1])}}const R={cx:0,cy:0,x:-1,y:-1,width:2,height:2};h.Bounding.bind(R,B),this.bStaticIndexed&&this.bIndexed||this.addIndex(g,y,R)}h.Bounding.bind(this.bounding,C),this.buffer=new Float32Array(A);for(let t=0,e=0,r=E.length;t({index:1,offset:1,count:1}),m.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...m.getEmptySimpleRepetition(),row:m.getEmptySimpleRepetition(),col:m.getEmptySimpleRepetition()})},7439:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBuffer=void 0;const n=r(5511),i=r(3674);class s extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||"ShapeBuffer",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn("[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property"),this.shape=s.EMPTY_BUFFER):this.shape="function"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return"function"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from("function"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,s=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&"function"!=typeof this.props.sideLength&&"function"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=s},5382:(t,e,r)=>{e.S=void 0;const n=r(6448);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeFollow",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},s=this.shape;s.generate(t,!1,i);let o=s.getBuffer();const a=o.length,h=new Float32Array(a*(n.length/2)),u=n.length/2;for(let e=0;e1?e/(u-1):1,count:u};this.shapeUseFollow&&(i.follow=r,s.generate(t,!1,i),o=s.getBuffer());const c=e*a,l=2*e,f=n[l],d=n[l+1];for(let t=0,e=o.length;t1?t/(e-1):1;for(let o=0,a=s.length;o{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeLoop=void 0;const n=r(3792),i=r(5511),s=r(3674),o=r(2648);class a extends s.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||"ShapeLoop",super(t),this.loopDependencies=(t.loopDependencies||[]).concat("sideLength"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes("propArguments"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}"loop"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||o.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?("function"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),s=this.getRepetitionSideLength(t),o=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,a={index:0,offset:0,current:0,count:n},h=a.count,u=new Float32Array(2*h);for(let n=0,i=0;n1?n/(a.count-1):1;a.current=s,a.index=n+1,a.offset=h;const c=o(a,t);u[i]=c[0],u[i+1]=c[1]}const c=[void 0,void 0,void 0,void 0],l=this.applyModifiers(u,t);for(let t=0,e=l.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapePrimitive=void 0;const n=r(8721),i=r(2648),s=r(9958),o=r(5511);class a extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=o.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:"function"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return"function"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:"number"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp("sideLength",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{e.v=void 0;const n=r(6448);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeRecursive",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionScale&&"function"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp("recursions",e,1)),n=Math.floor(this.getProp("recursionVertex",e,0)),s=this.getProp("recursionScale",e,2),o=this.shape;let a={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const h={...e,recursion:a};o.generate(t,!1,h);const u=o.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=u);let c=u;const l=[a];let f=0,d=1;const p=c.length,m=p/2,g=n<=0?m:Math.min(n,m),v=0===n?1:m/Math.min(n,m),y=new Float32Array(i.summmation(r,g)*p);for(let t=0;t1?e/(r-1):1,u=i.summmation(e,g)*p,m=e-1,b=0===m?0:i.summmation(m,g)*p;for(let i=0,m=g**e;i1?i/(m-1):1,count:m,level:{index:e+1,offset:n,count:r},parent:l[f]},l.push(a),this.shapeUseRecursion&&(h.recursion=a,o.generate(t,!1,h),c=o.getBuffer());const w=u+i*p,M=Math.floor(b+2*i*v),x=y[M],_=y[M+1],S=s**e;for(let t=0,e=p;t1?0:1,count:s}}},h=this.shape.getIndexedBuffer()||[];for(let t=0,e=h.length;t1?0:1,count:s}},i={...a,recursion:r},o=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:o})}if(s>1){const t=this.shape.getBufferLength({...i,parent:{...a}})/2,e=o<=0?t:Math.min(o,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let u=0,c=1;for(let t=1;t1?t/(s-1):1;for(let o=0,l=e**t;o1?o/(l-1):1;for(let d=0,p=h.length;d{e.C=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){t.type="Circle",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.C=s},6329:(t,e,r)=>{e.x=void 0;const n=r(5511),i=r(7439);class s extends i.ShapeBuffer{constructor(t={}){t.type="Line",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{e.O=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){t.type="Lissajous",t.loopDependencies=(t.loopDependencies||[]).concat(["wx","wy","wz"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp("wx",t),r=this.getProp("wy",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),s=this.getRepetitionSideLength(t);return 1/Math.pow(s[0]*s[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp("wx",t,1),this.wy=this.getProp("wy",t,2),this.wz=this.getProp("wz",t,2),super.generateLoopBuffer(t)}}e.O=s},2982:(t,e,r)=>{e.m=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["sideNumber"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp("sideNumber",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.m=s},5510:(t,e,r)=>{e.U=void 0;const n=r(5511),i=r(7439);class s extends i.ShapeBuffer{constructor(t={}){t.type="Rect",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.U=s,s.buffer=[1,1,-1,1,-1,-1,1,-1]},894:(t,e,r)=>{e.h=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){var e,r;t.type="Rose",t.loopDependencies=(t.loopDependencies||[]).concat(["n","d"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>s.getFinalAngleFromK(this.getProp("n",t),this.getProp("d",t)),inc:t=>{const e=this.getProp("n",t),r=this.getProp("d",t),i=this.getRepetitionSideLength(t),s=Math.pow(i[0]*i[1],.45),o=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp("n",t)/this.getProp("d",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.h=s},5719:(t,e,r)=>{e.r=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type="Spiral",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat(["twists","twistsStart","spiral"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:s.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp("twistsStart",t),end:t=>n.PI2*(this.getProp("twistsStart",t)+this.getProp("twists",t)),inc:t=>{const e=this.getProp("twists",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp("spiral",t),this.r=s.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case s.types.ARCHIMEDE:return t=>t/10;case s.types.HYPERBOLIC:return t=>1/t*3;case s.types.FERMAT:return t=>t**.5/3;case s.types.LITUUS:return t=>t**-.5;case s.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.r=s,s.types={ARCHIMEDE:"ARCHIMEDE",HYPERBOLIC:"HYPERBOLIC",FERMAT:"FERMAT",LITUUS:"LITUUS",LOGARITHMIC:"LOGARITHMIC"}},9667:(t,e,r)=>{e.U=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["spikes","innerRadius"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp("spikes",t,5),this.innerRadius=this.getProp("innerRadius",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.U=s},3977:(t,e,r)=>{e.y=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){var e,r,i,s,o,a;t.type="SuperShape",t.loopDependencies=(t.loopDependencies||[]).concat(["a","b","m","n1","n2","n3"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(s=t.n1)&&void 0!==s?s:1,this.props.n2=null!==(o=t.n2)&&void 0!==o?o:1,this.props.n3=null!==(a=t.n3)&&void 0!==a?a:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp("a",t),this.b=this.getProp("b",t),this.m=this.getProp("m",t),this.n1=this.getProp("n1",t),this.n2=this.getProp("n2",t),this.n3=this.getProp("n3",t),super.generateLoopBuffer(t)}}e.y=s},4233:(t,e,r)=>{e.C=void 0;const n=r(5511),i=r(7439);class s extends i.ShapeBuffer{constructor(t={}){t.type="Triangle",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.C=s,s.buffer=[1,0,-1,1,-1,-1]},3757:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(7678),e),i(r(7066),e),i(r(2769),e),i(r(7266),e),i(r(3647),e),i(r(4526),e),i(r(1618),e),i(r(6787),e)},7678:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},7066:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2769:(t,e)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]="Ring",r[r.Matrix=2]="Matrix"},7266:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},3647:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4526:(t,e)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]="Relative",r[r.Fixed=2]="Fixed"},1618:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6787:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},9962:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DrawerCanvas=void 0;const n=r(7358),i=r(313),s=r(3792),o=r(795),a=r(292),h=r(1189),u=r(8909),c=r(9724);class l extends h.Emitter{constructor(t,e,r,n=6e4,i=60){var s,o,a,h,l;super(),this.drawerOptions={width:(null==r?void 0:r.width)||(null==t?void 0:t.width)||400,height:(null==r?void 0:r.height)||(null==t?void 0:t.height)||400,clear:null===(s=null==r?void 0:r.clear)||void 0===s||s,time:null!==(o=null==r?void 0:r.time)&&void 0!==o?o:0,simmetricLines:null!==(a=null==r?void 0:r.simmetricLines)&&void 0!==a?a:0,noBackground:null!==(h=null==r?void 0:r.noBackground)&&void 0!==h&&h,ghosts:(null==r?void 0:r.ghosts)||0,ghostAlpha:!1!==(null==r?void 0:r.ghostAlpha),ghostSkipTime:null!==(l=null==r?void 0:r.ghostSkipTime)&&void 0!==l?l:30,ghostSkipFunction:null==r?void 0:r.ghostSkipFunction,sceneFit:(null==r?void 0:r.sceneFit)||"contain",backgroundImage:null==r?void 0:r.backgroundImage,backgroundImageFit:(null==r?void 0:r.backgroundImageFit)||"cover"},this.timeline=new u.Timeline(n,i),this.timeline.setTime(this.drawerOptions.time),this.draw_id=null,this.redraw_id=null,this.animation_id=null,t&&this.setScene(t),(!c.bWorker||c.bWorker&&e instanceof OffscreenCanvas)&&this.setCanvas(e)}getOption(t,e){var r;return null!==(r=this.drawerOptions[t])&&void 0!==r?r:e}setCanvas(t){if(c.bWorker)t instanceof OffscreenCanvas?this.canvas=t:console.error("Cannot set cavas");else if(c.bBrowser){const e=a.createCanvas(this.drawerOptions.width,this.drawerOptions.height);if(t instanceof HTMLElement&&!(t instanceof HTMLCanvasElement||t instanceof OffscreenCanvas)){for(this.canvas=e;t.lastChild;)t.removeChild(t.lastChild);t.appendChild(e)}else this.canvas=void 0===t?e:t}else this.canvas=a.createCanvas(this.drawerOptions.width,this.drawerOptions.height);this.canvas&&(this.canvas.width=this.drawerOptions.width,this.canvas.height=this.drawerOptions.height,this.context=this.canvas.getContext("2d",{alpha:!0}))}getCanvas(){return this.canvas}setScene(t){this.scene=t}draw(){if(null===this.context||void 0===this.scene)return 0;const t=i.now(),e=this.timeline,r=e.getTime(),n={...this.drawerOptions,ghostIndex:void 0,clear:this.drawerOptions.clear||e.getCurrentFrame()<=1,time:r},o=e.getFrameAtTime(r);if(this.dispatch("drawer-canvas:before_draw",{currentFrame:o,currentTime:r}),n.simmetricLines>0&&(n.clear&&l.clear(this.context,n.width,n.height,!n.noBackground&&this.scene.background,n.backgroundImage,n.backgroundImageFit),l.drawSimmetricLines(this.context,n.simmetricLines,n.width,n.height,this.scene.color),n.clear=!1),n.ghosts){const t={...n},r=e.getTime(),i=e.getDuration(),o={offset:0,index:0,count:n.ghosts};for(let e=1;e<=n.ghosts;e++){o.index=e,o.offset=o.index/o.count;const a=r-(n.ghostSkipFunction?n.ghostSkipFunction(o,r):e*n.ghostSkipTime);t.ghostIndex=e,t.time=s.mod(a,i),t.clear=n.clear&&1===t.ghostIndex,this.realDraw(t)}n.clear=!1}return this.realDraw(n),i.now()-t}realDraw(t){var e;const r=this.drawerOptions.width,n=this.drawerOptions.height,i=this.context,s=this.scene,o=null!==(e=t.time)&&void 0!==e?e:0,a=void 0!==t.ghosts&&t.ghosts>0&&void 0!==t.ghostIndex&&t.ghostIndex>0,h=a?1-t.ghostIndex/(t.ghosts+.5):0,u=!0===t.ghostAlpha,f=c.fit(s.width,s.height,r,n,this.drawerOptions.sceneFit),d=f.x,p=f.y;t.clear&&l.clear(i,r,n,!t.noBackground&&s.background,t.backgroundImage,t.backgroundImageFit);let m=!1,g=!1;s.currentTime=o;const v=s.getChildren();for(let t=0,e=v.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=void 0,e.Emitter=class{constructor(){this.callbacks={}}attach(t,e){t in this.callbacks||(this.callbacks[t]=[]),this.callbacks[t].push(e)}detach(t,e){if(t in this.callbacks){const r=this.callbacks[t].indexOf(e);r>=0&&this.callbacks[t].splice(r,1)}}dispatch(t,e){if(t in this.callbacks&&this.callbacks[t].length>0)for(let r=0,n=this.callbacks[t].length;r{Object.defineProperty(e,"__esModule",{value:!0}),e.Renderer=void 0;const n=r(5045),i=r(313),s=r(5733),o=r(6151),a=r(1189),h=r(9724);class u extends a.Emitter{constructor(t,e){super(),this.drawer=t,this.ffmpegCorePath=void 0===e&&t instanceof o.default?"https://unpkg.com/@ffmpeg/core@0.10.0/dist/ffmpeg-core.js":e}async zip(t="image/png",e=1,r=600){const n=i.now(),o=new s,a=this.drawer.timeline.getFramesCount(),u=Math.ceil(a/r);this.dispatch("renderer:zip_start",{chunks:u,totalFrames:a,framesForChunk:r});const c="image/jpeg"===t?".jpg":".png",l=[];let f=0;for(let s=0,d=1;s{r.toBlob((t=>{if(!t)throw new Error("Blob error");n(t)}),t,"number"==typeof e?e:1)}))}}e.Renderer=u},8909:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=void 0;const n=r(313),i=r(3792),s=r(1189);class o extends s.Emitter{constructor(t=6e4,e=30){super(),this.fps_samples_size=30,this.fps_samples=[],this.fps_samples_index=0,this.paused_time=0,this.sequence={duration:t,framerate:e,frames:Math.round(t/1e3*e)},this.tick_time=1e3/this.sequence.framerate,this.fps=this.sequence.framerate,this.b_sequence_started=!1,this.currentFrame=0,this.currentTime=0,this.last_tick=0,this.start_time=0}getSequence(){return{...this.sequence}}setSequence(t,e,r){this.sequence.duration=t,this.sequence.framerate=e,this.tick_time=1e3/this.sequence.framerate,this.sequence.frames=Math.round(this.sequence.duration/1e3*this.sequence.framerate),void 0!==r?this.setTime(r):this.dispatch("timeline:update_sequence",this.getSequence())}setDuration(t){this.setSequence(t,this.sequence.framerate)}getDuration(){return this.sequence.duration}getFramerate(){return this.sequence.framerate}setFramerate(t){this.setSequence(this.sequence.duration,t)}getFramesCount(){return this.sequence.frames}bSequenceStarted(){return this.b_sequence_started}start(){this.b_sequence_started||(this.b_sequence_started=!0,this.start_time=this.paused_time,this.dispatch("timeline:change_status",o.START))}pause(){this.b_sequence_started&&(this.paused_time=n.now(),this.b_sequence_started=!1,this.dispatch("timeline:change_status",o.PAUSE))}stop(){this.b_sequence_started&&(this.b_sequence_started=!1,this.currentTime=0,this.currentFrame=0,this.start_time=0,this.paused_time=0,this.dispatch("timeline:change_status",o.STOP))}tick(t){if(this.b_sequence_started){this.start_time||(this.start_time=t,this.last_tick=-this.tick_time);const e=t-this.start_time,r=e-this.last_tick;if(r>=this.tick_time)return this.calculateFPS(1/(r/1e3)),this.last_tick=e,this.currentTime=(e-r%this.tick_time)%this.sequence.duration,this.currentFrame=this.getFrameAtTime(this.currentTime),this.dispatch("timeline:progress",{currentFrame:this.currentFrame,currentTime:this.currentTime,fps:this.fps}),!0}return!1}calculateFPS(t){const e=this.fps_samples.length;if(e>0){let t=0;for(let r=0;r{Object.defineProperty(e,"__esModule",{value:!0}),e.BrowserDrawerCanvas=void 0;const n=r(9962),i=r(9724);class s extends n.DrawerCanvas{constructor(t,e,r,n=6e4,i=60){super(t,e,r,n,i),this.dpi=1,this.dpi=(null==r?void 0:r.dpi)||1,this.draw_id=null,this.redraw_id=null,this.animation_id=null,this.draw=this.draw.bind(this),this.animate=this.animate.bind(this),this.startAnimation=this.startAnimation.bind(this),this.resize(this.drawerOptions.width,this.drawerOptions.height)}resize(t,e,r,n=this.dpi){this.drawerOptions.width=t*n,this.drawerOptions.height=e*n,this.canvas&&(this.canvas.width=t*n,this.canvas.height=e*n,i.bBrowser&&this.canvas instanceof HTMLCanvasElement&&(this.canvas.style.width=t+"px",this.canvas.style.height=e+"px")),void 0!==r&&(this.drawerOptions.sceneFit=r),this.dispatch("drawer-canvas:resize")}animate(t){this.timeline.bSequenceStarted()&&(this.animation_id=requestAnimationFrame(this.animate),this.timeline.tick(t)&&this.draw())}startAnimation(){this.stopAnimation(),this.timeline.start(),this.animation_id=requestAnimationFrame(this.animate)}stopAnimation(){this.timeline.stop(),this.animation_id&&cancelAnimationFrame(this.animation_id)}pauseAnimation(){this.timeline.pause(),this.animation_id&&cancelAnimationFrame(this.animation_id)}playAnimation(){this.timeline.start(),requestAnimationFrame(this.animate)}redraw(){this.timeline.bSequenceStarted()?void 0!==typeof this.drawerOptions.ghosts&&0!==this.drawerOptions.ghosts||(this.stopAnimation(),this.redraw_id&&cancelAnimationFrame(this.redraw_id),this.redraw_id=requestAnimationFrame(this.startAnimation)):(this.draw_id&&cancelAnimationFrame(this.draw_id),void 0!==typeof this.drawerOptions.ghosts&&0!==this.drawerOptions.ghosts||this.timeline.stop(),this.draw_id=requestAnimationFrame(this.draw))}}e.BrowserDrawerCanvas=s},6151:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(8909),e),i(r(9962),e),i(r(4425),e),i(r(2251),e);const s=r(2251);e.default=s.BrowserDrawerCanvas},1532:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(8909),e),i(r(9962),e),i(r(2251),e),i(r(4425),e)},9724:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fit=e.bWorker=e.bBrowser=e.bNode=void 0,e.bNode="undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node,e.bBrowser="undefined"!=typeof window&&void 0!==window.document,e.bWorker="object"==typeof self&&["ServiceWorkerGlobalScope","DedicatedWorkerGlobalScope"].includes(self.constructor.name),e.fit=function(t,e,r,n,i="none"){let s=0,o=0,a=1,h=t,u=e;const c=r/n,l=t/e;return"contain"===i?(h=c>l?t*n/e:r,u=c>l?n:e*r/t,a=Math.max(h,u)/Math.max(t,e)):"cover"===i&&(h=c{Object.defineProperty(e,"__esModule",{value:!0}),e.GCODEExporter=void 0;const n=r(1172),i=r(6479),s=r(310);class o{static parse(t,e){const r={...o.defaults,...e};return o.generate(t,r).join("\n")}static setUnit(t){return"inches"===t?"G20":"G21"}static useRelativePosition(){return"G91"}static useAbsolutePosition(){return"G90"}static goHome(t){return[t,"G28 X0 Y0"]}static setCurrentMachinePosition(t,e,r){return`G28.1 X${s.round(t,r)} Y${s.round(e,r)}`}static setCurrentWorkspacePosition(t,e,r){return`G92 X${s.round(t,r)} Y${s.round(e,r)}`}static goTo(t,e,r,n){return void 0!==n?`G1 X${s.round(t,r)} Y${s.round(e,r)} F${n}`:`G0 X${s.round(t,r)} Y${s.round(e,r)}`}static moveTo(t,e,r,n,i){return[t,this.goTo(r,n,i),e]}static lineTo(t,e,r,n){return this.goTo(t,e,n,r)}static generate(t,e){const r=e.maxX-e.minX,a=e.maxY-e.minY,h=r/a,u=t.width/t.height,c=[h>u?t.width*a/t.height:r,h>u?a:t.height*r/t.width],l=[(r-c[0])/2,(a-c[1])/2],f=h>u?t.width/c[0]:t.height/c[1],d=[];s.concat(d,e.penUpCommand),s.concat(d,this.setUnit(e.unit)),s.concat(d,this.useAbsolutePosition()),s.concat(d,this.setCurrentMachinePosition(e.minX,e.minY,e.decimals)),s.concat(d,this.setCurrentWorkspacePosition(e.minX,e.minY,e.decimals));const p=t.getChildren();for(let t=0,r=p.length;t{Object.defineProperty(e,"__esModule",{value:!0})},310:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.concat=e.round=void 0,e.round=(t,e)=>Math.round(t*10**e)/10**e,e.concat=(t,e)=>{"string"==typeof e?t.push(e):e.forEach((e=>t.push(e)))}},2674:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SVGExporter=void 0;const n=r(9887);class i{static parse(t,e={}){const r={...i.defaults,...e};return i.generate(t,r)}static getSVGProp(t,e,r){let n=e.shape.drawer[t];return"function"==typeof n&&(n=n(e)),null!=n?n:r}static bindColorAttribute(t,e,r,i){if(void 0!==e)if("none"===e)r.push(`${t}="none"`);else{const s=n.parseColorAndConvert(e);s&&(1!==s.alpha&&i.push(`${t}-opacity: ${s.alpha}`),r.push(`${t}="${n.rgbToHex(s.r,s.g,s.b)}"`))}}static generate(t,e){const r=i.generatePaths(t,e);let n;if(e.background){const e=[],r=[];i.bindColorAttribute("fill",t.background,e,r),r.length>0&&e.push(`styles="${r.join("; ")}"`),n=``}return`\n\t\x3c!-- Create with Urpflanze --\x3e`+(n?`\n\t${n}`:"")+`\n\t${r.join("\n\t")}\n`}static generatePaths(t,e){const r=[],n=t.getChildren();for(let s=0,o=n.length;s0&&l.push(`style="${f.join("; ")}"`);const g=``;r.push(g)}}return r}}e.SVGExporter=i,i.defaults={decimals:3,background:!0}},7773:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(4105),e),i(r(2674),e)},4105:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5917:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.rgbToHsl=e.hslToRgb=e.rgbToHex=void 0,e.rgbToHex=function(t,e,r){return`#${((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}`},e.hslToRgb=function(t,e,r){let n,i,s;if(t/=360,r/=100,0==(e/=100))n=i=s=r;else{const o=(t,e,r)=>(r+=r<0?1:r>1?-1:0)<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,a=r<.5?r*(1+e):r+e-r*e,h=2*r-a;n=o(h,a,t+1/3),i=o(h,a,t),s=o(h,a,t-1/3)}return[.5+255*n<<0,.5+255*i<<0,.5+255*s<<0]},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;const n=Math.max(t,e,r),i=Math.min(t,e,r),s=(n+i)/2;let o,a;if(n===i)o=a=0;else{const h=n-i;switch(a=s>.5?h/(2-n-i):h/(n+i),n){case t:o=(e-r)/h+(e{Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.parseColorAndConvert=void 0;const n=r(5917);function i(t){if("number"==typeof t)return t>16777215?{type:"rgb",a:t>>24&255,b:t>>16&255,c:t>>8&255,alpha:(255&t)/255}:{type:"rgb",a:t>>16&255,b:t>>8&255,c:255&t,alpha:1};t=t.replace(/\s/g,"");let e=/^#([0-9a-f]{3,8})$/i.exec(t);if(e){const t=e[1];return 3===t.length?{type:"rgb",a:parseInt(t[0]+t[0],16),b:parseInt(t[1]+t[1],16),c:parseInt(t[2]+t[2],16),alpha:1}:{type:"rgb",a:parseInt(t[0]+t[1],16),b:parseInt(t[2]+t[3],16),c:parseInt(t[4]+t[5],16),alpha:t.length>6?parseInt(t.substring(6),16)/255:1}}if(e=/^((hsl|rgb)a?)\((\d+),(\d+)%?,(\d+)%?,?(.+)?\)$/i.exec(t),e){const[,,t,r,n,i,s]=e;return{type:t,a:+r,b:+n,c:+i,alpha:s?+s:1}}}e.parseColorAndConvert=function(t){const e=i(t);if(e){if("hsl"===e.type){const[t,r,i]=n.hslToRgb(e.a,e.b,e.c);return{r:t,g:r,b:i,h:e.a,s:e.b,l:e.c,alpha:e.alpha}}{const[t,r,i]=n.rgbToHsl(e.a,e.b,e.c);return{h:t,s:r,l:i,r:e.a,g:e.b,b:e.c,alpha:e.alpha}}}},e.parseColor=i},6073:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5052:t=>{window,t.exports=(()=>{var t={877:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SVGImporter=void 0;const n=r(500),i=r(688),s=r(926),o=r(926),a=r(479),h=r(721),u=r(197),c=r(825);class l{static isSVG(t){return l.SVG_REGEX.test(t.replace(l.COMMENT_REGEX,""))}static getWindowInstance(){return l.windowInstance}static setWindowInstance(t){l.windowInstance=t}static stringToSVG(t){if(t=t.trim(),!l.isSVG(t))return console.warn("[Urpflanze:SVGImport] | Input is not valid SVG string",t),null;const e=l.windowInstance.document.createElement("div");return e.innerHTML=t,e.firstChild}static parse(t,e=.01,r){if(!1===l.isSVG(t))return console.warn("[Urpflanze:SVGImport] | Input is not valid svg",t),null;const n=l.svgToBuffers(t,e);return n?l.parsedToShape(n,r):null}static parsedToShape(t,e){const r=[];if(t.buffers.forEach(((t,n)=>{const i=new s.ShapeBuffer({shape:t.buffer,bClosed:t.bClosed,sideLength:e,drawer:t.drawer});i&&r.push(i)})),1===r.length)return r[0];const n=new s.Group;return r.forEach((t=>n.add(t))),new s.Shape({shape:n})}static svgToBuffers(t,e=.01){const r="string"==typeof t?l.stringToSVG(t):t;if(null===r)return console.error("[Urpflanze:SVGImport] | Cannot convert string to svg",t),null;const n=l.getViewbox(r);r.querySelectorAll("g").forEach(l.propagateGroupTransformAndStyleToChildren);const i=Array.from(r.querySelectorAll("rect, circle, ellipse, line, polyline, polygon, path")),o=[].concat(...i.map((t=>l.elementToPath(t)))),a=Math.max(n[2]-n[0],n[3]-n[1]).toExponential(1).match(/e(\+?[0-9]+)/),h=10/(1e3/Math.min(10**Math.max(a?+a[1]:0,0),1e3));let u=o.map((t=>l.pathToBuffer(t,h,n))).filter((t=>!!t&&t.length>=2));u=u.map((t=>l.simpliyBuffer(t,e))),u=u.map(((t,e)=>l.pathIsClosed(o[e])&&s.Vec2.distance([t[0],t[1]],[t[t.length-2],t[t.length-1]])<1?t.subarray(0,t.length-2):t));const f=Math.sqrt((n[2]-n[0])*(n[3]-n[1])),d=l.getStyleAttr("fill",r),p=l.getStyleAttr("stroke",r),m=l.getStyleAttr("stroke-width",r,f/100),g=[];for(let t=0;t=0?c.fromPercentage(parseFloat(e),f):parseFloat(e));const n=l.getStyleAttr("fill",o[t],d||void 0),i=l.getStyleAttr("stroke",o[t],n?void 0:p||"rgba(255,255,255)"),s=r||(i?m:void 0);g.push({buffer:u[t],bClosed:l.pathIsClosed(o[t]),drawer:{fill:n,stroke:i,lineWidth:s?s/(f/100):void 0}})}return i.forEach((t=>t.remove())),{viewBox:n,buffers:g}}static getStyleAttr(t,e,r){const n=e.getAttribute(t);if("none"===n)return;let s;if(null!=n)s=n;else{const r="stroke-width"===t?"strokeWidth":t;void 0!==e.style[r]&&e.style[r].length>0&&(s=e.style[r])}if(void 0===s)return r;if("stroke-width"===t)return parseFloat(s);let o=parseFloat(e.getAttribute("opacity")||"1");const a=e.getAttribute("style");if(a&&a.length){const e=new RegExp(`${t}-opacity: +?(\\d?.\\d|\\d)`,"i"),r=a.match(e);r&&(o=parseFloat(r[1]))}const h=i.parseColor(s);return h?(o=1!==h.alpha?h.alpha:o,"rgb"===h.type?`rgba(${h.a}, ${h.b}, ${h.c}, ${o})`:`hsla(${h.a}, ${h.b}%, ${h.c}%, ${o})`):r}static getViewbox(t){const e=t.getAttribute("viewBox");if(e)return e.split(" ").map((t=>parseFloat(t)));const r=t.getAttribute("width"),n=t.getAttribute("height");if(r&&n)return[0,0,parseFloat(r),parseFloat(n)];t=t.cloneNode(!0);const i=Array.from(t.querySelectorAll("rect, circle, ellipse, line, polyline, polygon, path")),s=[].concat.apply([],i.map(l.elementToPath));let a=0,h=0;for(let t=0,e=s.length;ta&&(a=t.width),t.height>h&&(h=t.height)}}return[0,0,a,h]}static pathIsClosed(t){var e;return"z"===(null===(e=t.getAttribute("d"))||void 0===e?void 0:e.trim().substr(-1).toLowerCase())}static simpliyBuffer(t,e=.01){const r=[];for(let e=0,n=t.length;e{i[2*e]=t.x,i[2*e+1]=t.y})),i}static sanitizePath(t,e){return h(t).abs().unarc().transform(e||"").toString()}static pathToBuffer(t,e=.01,r=[-1,-1,1,1]){const i=r[2]-r[0],s=r[3]-r[1],o=2/Math.max(i,s),a=t.getAttribute("d"),h=t.getAttribute("transform")||"",u=new n.Path({d:l.sanitizePath(a,h)}),c=Math.floor(u.length()),f=2*Math.floor(c/e),d=new Float32Array(f);let p=0;for(let t=0;t0){const r=u.compose(u.fromDefinition(u.fromTransformAttribute(e))),n=t.children;Array.from(n).forEach((t=>{let n=t.getAttribute("transform");if(n&&n.length>0){const t=u.compose(u.fromDefinition(u.fromTransformAttribute(n))),e=u.compose(r,t);n=u.toSVG(e)}else n=e;t.setAttribute("transform",n)}))}["fill","stroke","stroke-width","style"].forEach((e=>{const r=t.getAttribute(e);r&&Array.from(t.children).forEach((t=>{null===t.getAttribute(e)&&t.setAttribute(e,r)}))}))}static elementToPath(t){const e=l.windowInstance.document;let r=[];return"path"===t.nodeName?r=h(t.getAttribute("d")||"").abs().unarc().toString().split("M").filter((t=>t.length>0)).map((t=>"M"+t)):["rect","ellipse","circle","line","polyline","polygon"].includes(t.nodeName)?r=[c.conversion[t.nodeName](t)]:console.warn(`[Urpflanze:SVGImport] | Cannot convert ${t.nodeName} to path`),r.map((r=>{const n=e.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d",r),n.setAttribute("transform",t.getAttribute("transform")||""),n.setAttribute("style",t.getAttribute("style")||""),n.setAttribute("fill",l.getStyleAttr("fill",t,"")+""),n.setAttribute("stroke",l.getStyleAttr("stroke",t,"")+""),n.setAttribute("opacity",t.getAttribute("opacity")||"1"),n.setAttribute("stroke-width",l.getStyleAttr("stroke-width",t,"")+""),n}))}}e.SVGImporter=l,l.HEX_REGEX="#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})",l.SVG_REGEX=/^\s*(?:<\?xml[^>]*>\s*)?(?:]*\s*(?:\[?(?:\s*]*>\s*)*\]?)*[^>]*>\s*)?(?:]*>[^]*<\/svg>|]*\/\s*>)\s*$/i,l.COMMENT_REGEX=//g},625:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.SVGImporter=void 0;const s=r(877);Object.defineProperty(e,"SVGImporter",{enumerable:!0,get:function(){return s.SVGImporter}}),i(r(291),e),s.SVGImporter.setWindowInstance(window),e.default=s.SVGImporter},291:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},825:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.conversion=e.fromPercentage=void 0,e.fromPercentage=(t,e)=>/%$/.test(t+"")?100*parseFloat((t+"").replace("%",""))/e:+t;const r={rect:t=>{const r=parseFloat(t.getAttribute("width")||"0"),n=parseFloat(t.getAttribute("height")||"0"),i=parseFloat(t.getAttribute("x")||"0"),s=parseFloat(t.getAttribute("y")||"0");let o=t.getAttribute("rx")||"auto",a=t.getAttribute("ry")||"auto";"auto"===o&&"auto"===a?o=a=0:"auto"!==o&&"auto"===a?o=a=e.fromPercentage(o,r):"auto"!==a&&"auto"===o?a=o=e.fromPercentage(a,n):(o=e.fromPercentage(o,r),a=e.fromPercentage(a,n)),o>r/2&&(o=r/2),a>n/2&&(a=n/2);const h=o>0&&a>0;return[`M${i+o} ${s}`,"H"+(i+r-o),...h?[`A${o} ${a} 0 0 1 ${i+r} ${s+a}`]:[],"V"+(s+n-a),...h?[`A${o} ${a} 0 0 1 ${i+r-o} ${s+n}`]:[],`H${i+o}`,...h?[`A${o} ${a} 0 0 1 ${i} ${s+n-a}`]:[],`V${s+a}`,...h?[`A${o} ${a} 0 0 1 ${i+o} ${s}`]:[],"Z"].join(" ")},ellipse:t=>{var e,r,n,i;const s=parseFloat(t.getAttribute("cx")||"0"),o=parseFloat(t.getAttribute("cy")||"0"),a=parseFloat(null!==(r=null!==(e=t.getAttribute("rx"))&&void 0!==e?e:t.getAttribute("r"))&&void 0!==r?r:"0"),h=parseFloat(null!==(i=null!==(n=t.getAttribute("ry"))&&void 0!==n?n:t.getAttribute("r"))&&void 0!==i?i:"0");return[`M${s+a} ${o}`,`A${a} ${h} 0 0 1 ${s} ${o+h}`,`A${a} ${h} 0 0 1 ${s-a} ${o}`,`A${a} ${h} 0 0 1 ${s+a} ${o}`,"Z"].join(" ")},circle:t=>r.ellipse(t),line:t=>`M${t.getAttribute("x1")||"0"} ${t.getAttribute("y1")||"0"} L${t.getAttribute("x2")||"0"} ${t.getAttribute("y2")||"0"}`,polyline:t=>((t,e=2)=>{const r=[];for(;t.length>0;)r.push(t.splice(0,e));return r})((t.getAttribute("points")||"").trim().replace(/ +/g," ").split(" ").reduce(((t,e)=>[...t,...e.includes(",")?e.split(","):[e]]),[]),2).map((([t,e],r)=>`${0===r?"M":"L"}${t} ${e}`)).join(" "),polygon:t=>r.polyline(t)+" Z",path:t=>t.getAttribute("d")+""};e.conversion=r},500:(t,e,r)=>{r.r(e),r.d(e,{A:()=>ur,Animator:()=>Ye,Array:()=>Rt,Box:()=>mt,Circle:()=>ir,ClipPath:()=>sr,Color:()=>ut,Container:()=>zt,Controller:()=>pe,Defs:()=>qt,Dom:()=>Ft,Ease:()=>de,Element:()=>jt,Ellipse:()=>Qt,EventTarget:()=>Ot,ForeignObject:()=>or,Fragment:()=>Jt,G:()=>hr,Gradient:()=>ne,Image:()=>se,Line:()=>he,List:()=>vt,Marker:()=>ue,Mask:()=>cr,Matrix:()=>ft,Morphable:()=>ke,NonMorphable:()=>Ie,Number:()=>Tt,ObjectBag:()=>Re,PID:()=>ve,Path:()=>je,PathArray:()=>Ee,Pattern:()=>ie,Point:()=>ct,PointArray:()=>oe,Polygon:()=>ze,Polyline:()=>qe,Queue:()=>Ue,Rect:()=>Ne,Runner:()=>Xe,SVG:()=>mr,Shape:()=>Nt,Spring:()=>ge,Stop:()=>lr,Style:()=>fr,Svg:()=>Ke,Symbol:()=>tr,Text:()=>rr,TextPath:()=>dr,Timeline:()=>Ge,TransformBag:()=>Ce,Tspan:()=>nr,Use:()=>pr,adopt:()=>F,assignNewId:()=>Y,clearEvents:()=>St,create:()=>R,defaults:()=>Bt,dispatch:()=>Et,easing:()=>le,eid:()=>U,extend:()=>V,find:()=>bt,getClass:()=>q,getEventTarget:()=>_t,getEvents:()=>xt,getWindow:()=>k,makeInstance:()=>T,makeMorphable:()=>Fe,mockAdopt:()=>D,namespaces:()=>x,nodeOrNew:()=>L,off:()=>At,on:()=>Pt,parser:()=>dt,regex:()=>st,register:()=>z,registerMorphableType:()=>Le,registerWindow:()=>S,restoreWindow:()=>E,root:()=>B,saveWindow:()=>A,utils:()=>g,windowEvents:()=>Mt,withWindow:()=>O,wrapWithAttrCheck:()=>Z});const n={},i=[];function s(t,e){if(Array.isArray(t))for(const r of t)s(r,e);else if("object"!=typeof t)a(Object.getOwnPropertyNames(e)),n[t]=Object.assign(n[t]||{},e);else for(const e in t)s(e,t[e])}function o(t){return n[t]||{}}function a(t){i.push(...t)}function h(t,e){let r;const n=t.length,i=[];for(r=0;r=0;e--)Y(t.children[e]);return t.id?(t.id=U(t.nodeName),t):t}function V(t,e){let r,n;for(n=(t=Array.isArray(t)?t:[t]).length-1;n>=0;n--)for(r in e)t[n].prototype[r]=e[r]}function Z(t){return function(...e){const r=e[e.length-1];return!r||r.constructor!==Object||r instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(r)}}s("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=T(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=T(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=T(t)).before(this),this},insertAfter:function(t){return(t=T(t)).after(this),this}});const G=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,X=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,$=/rgb\((\d+),(\d+),(\d+)\)/,H=/(#[a-z_][a-z0-9\-_]*)/i,W=/\)\s*,?\s*/,Q=/\s/g,J=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,K=/^rgb\(/,tt=/^(\s+)?$/,et=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,rt=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,nt=/[\s,]+/,it=/[MLHVCSQTAZ]/i;var st={__proto__:null,numberAndUnit:G,hex:X,rgb:$,reference:H,transforms:W,whitespace:Q,isHex:J,isRgb:K,isBlank:tt,isNumber:et,isImage:rt,delimiter:nt,isPathLetter:it};function ot(t){const e=Math.round(t),r=Math.max(0,Math.min(255,e)).toString(16);return 1===r.length?"0"+r:r}function at(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function ht(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}s("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(nt)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),s("Dom",{css:function(t,e){const r={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);r[e[0]]=e[1]})),r;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=l(e);r[t]=this.node.style[t]}return r}if("string"==typeof t)return this.node.style[l(t)];if("object"==typeof t)for(const e in t)this.node.style[l(e)]=null==t[e]||tt.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[l(t)]=null==e||tt.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),s("Dom",{data:function(t,e,r){if(null==t)return this.data(h(u(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const r of t)e[r]=this.data(r);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===r||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),s("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class ut{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof ut||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e,r){const{random:n,round:i,sin:s,PI:o}=Math;if("vibrant"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new ut(t,e,r,"lch")}if("sine"===t){const t=i(80*s(2*o*(e=null==e?n():e)/.5+.01)+150),r=i(50*s(2*o*e/.5+4.6)+200),a=i(100*s(2*o*e/.5+2.3)+150);return new ut(t,r,a)}if("pastel"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new ut(t,e,r,"lch")}if("dark"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new ut(t,e,r,"lch")}if("rgb"===t){const t=255*n(),e=255*n(),r=255*n();return new ut(t,e,r)}if("lab"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new ut(t,e,r,"lab")}if("grey"===t){const t=255*n();return new ut(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(J.test(t)||K.test(t))}cmyk(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.min(1-n,1-i,1-s);return 1===o?new ut(0,0,0,1,"cmyk"):new ut((1-n-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.max(n,i,s),a=Math.min(n,i,s),h=(o+a)/2,u=o===a,c=o-a;return new ut(360*(u?0:o===n?((i-s)/c+(i.5?c/(2-o-a):c/(o+a)),100*h,"hsl")}init(t=0,e=0,r=0,n=0,i="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)i="string"==typeof n?n:i,n="string"==typeof n?0:n,Object.assign(this,{_a:t,_b:e,_c:r,_d:n,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const r=function(t,e){const r=at(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:at(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:at(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:at(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:at(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:at(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return r.space=e||r.space,r}(t,e);Object.assign(this,r)}else if("string"==typeof t)if(K.test(t)){const e=t.replace(Q,""),[r,n,i]=$.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}else{if(!J.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,r,n,i]=X.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:h}=this,u="rgb"===this.space?{r:s,g:o,b:a}:"xyz"===this.space?{x:s,y:o,z:a}:"hsl"===this.space?{h:s,s:o,l:a}:"lab"===this.space?{l:s,a:o,b:a}:"lch"===this.space?{l:s,c:o,h:a}:"cmyk"===this.space?{c:s,m:o,y:a,k:h}:{};Object.assign(this,u)}lab(){const{x:t,y:e,z:r}=this.xyz();return new ut(116*e-16,500*(t-e),200*(e-r),"lab")}lch(){const{l:t,a:e,b:r}=this.lab(),n=Math.sqrt(e**2+r**2);let i=180*Math.atan2(r,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new ut(t,n,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:n,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,r=Math.PI/180;i=t*Math.cos(r*e),s=t*Math.sin(r*e)}const o=(n+16)/116,a=i/500+o,h=o-s/200,u=16/116,c=.008856,l=7.787;t=.95047*(a**3>c?a**3:(a-u)/l),e=1*(o**3>c?o**3:(o-u)/l),r=1.08883*(h**3>c?h**3:(h-u)/l)}const n=3.2406*t+-1.5372*e+-.4986*r,i=-.9689*t+1.8758*e+.0415*r,s=.0557*t+-.204*e+1.057*r,o=Math.pow,a=.0031308,h=n>a?1.055*o(n,1/2.4)-.055:12.92*n,u=i>a?1.055*o(i,1/2.4)-.055:12.92*i,c=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new ut(255*h,255*u,255*c)}if("hsl"===this.space){let{h:t,s:e,l:r}=this;if(t/=360,e/=100,r/=100,0===e)return r*=255,new ut(r,r,r);const n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,s=255*ht(i,n,t+1/3),o=255*ht(i,n,t),a=255*ht(i,n,t-1/3);return new ut(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:r,k:n}=this,i=255*(1-Math.min(1,t*(1-n)+n)),s=255*(1-Math.min(1,e*(1-n)+n)),o=255*(1-Math.min(1,r*(1-n)+n));return new ut(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:r,_d:n,space:i}=this;return[t,e,r,n,i]}toHex(){const[t,e,r]=this._clamped().map(ot);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,h=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,u=(.4124*o+.3576*a+.1805*h)/.95047,c=(.2126*o+.7152*a+.0722*h)/1,l=(.0193*o+.1192*a+.9505*h)/1.08883,f=u>.008856?Math.pow(u,1/3):7.787*u+16/116,d=c>.008856?Math.pow(c,1/3):7.787*c+16/116,p=l>.008856?Math.pow(l,1/3):7.787*l+16/116;return new ut(f,d,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:r}=this.rgb(),{max:n,min:i,round:s}=Math;return[t,e,r].map((t=>n(0,i(s(t),255))))}}class ct{constructor(...t){this.init(...t)}clone(){return new ct(this)}init(t,e){const r=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==r.x?0:r.x,this.y=null==r.y?0:r.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){ft.isMatrixLike(t)||(t=new ft(t));const{x:e,y:r}=this;return this.x=t.a*e+t.c*r+t.e,this.y=t.b*e+t.d*r+t.f,this}}function lt(t,e,r){return Math.abs(e-t)<(r||1e-6)}class ft{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,r=t.flip&&(e||"x"===t.flip)?-1:1,n=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleX)?t.scaleX*r:r,a=t.scale&&t.scale.length?t.scale[1]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleY)?t.scaleY*n:n,h=t.shear||0,u=t.rotate||t.theta||0,c=new ct(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=c.x,f=c.y,d=new ct(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.y,g=new ct(t.translate||t.tx||t.translateX,t.ty||t.translateY),v=g.x,y=g.y,b=new ct(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:h,theta:u,rx:b.x,ry:b.y,tx:v,ty:y,ox:l,oy:f,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,r){const n=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,h=t.f+t.b*e.e+t.d*e.f;return r.a=n,r.b=i,r.c=s,r.d=o,r.e=a,r.f=h,r}around(t,e,r){return this.clone().aroundO(t,e,r)}aroundO(t,e,r){const n=t||0,i=e||0;return this.translateO(-n,-i).lmultiplyO(r).translateO(n,i)}clone(){return new ft(this)}decompose(t=0,e=0){const r=this.a,n=this.b,i=this.c,s=this.d,o=this.e,a=this.f,h=r*s-n*i,u=h>0?1:-1,c=u*Math.sqrt(r*r+n*n),l=Math.atan2(u*n,u*r),f=180/Math.PI*l,d=Math.cos(l),p=Math.sin(l),m=(r*i+n*s)/h,g=i*c/(m*r-n)||s*c/(m*n+r);return{scaleX:c,scaleY:g,shear:m,rotate:f,translateX:o-t+t*d*c+e*(m*d*c-p*g),translateY:a-e+t*p*c+e*(m*p*c+d*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new ft(t);return lt(this.a,e.a)&<(this.b,e.b)&<(this.c,e.c)&<(this.d,e.d)&<(this.e,e.e)&<(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=ft.fromArray([1,0,0,1,0,0]);return t=t instanceof jt?t.matrixify():"string"==typeof t?ft.fromArray(t.split(nt).map(parseFloat)):Array.isArray(t)?ft.fromArray(t):"object"==typeof t&&ft.isMatrixLike(t)?t:"object"==typeof t?(new ft).transform(t):6===arguments.length?ft.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,r=this.c,n=this.d,i=this.e,s=this.f,o=t*n-e*r;if(!o)throw new Error("Cannot invert "+this);const a=n/o,h=-e/o,u=-r/o,c=t/o,l=-(a*i+u*s),f=-(h*i+c*s);return this.a=a,this.b=h,this.c=u,this.d=c,this.e=l,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof ft?t:new ft(t);return ft.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof ft?t:new ft(t);return ft.matrixMultiply(this,e,this)}rotate(t,e,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=c(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:h,e:u,f:l}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-h*i,this.d=h*n+a*i,this.e=u*n-l*i+r*i-e*n+e,this.f=l*n+u*i-e*i-r*n+r,this}scale(t,e,r,n){return this.clone().scaleO(...arguments)}scaleO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t);const{a:i,b:s,c:o,d:a,e:h,f:u}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=h*t-r*t+r,this.f=u*e-n*e+n,this}shear(t,e,r){return this.clone().shearO(t,e,r)}shearO(t,e=0,r=0){const{a:n,b:i,c:s,d:o,e:a,f:h}=this;return this.a=n+i*t,this.c=s+o*t,this.e=a+h*t-r*t,this}skew(t,e,r,n){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=c(t),e=c(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:h,d:u,e:l,f}=this;return this.a=o+a*i,this.b=a+o*s,this.c=h+u*i,this.d=u+h*s,this.e=l+f*i-n*i,this.f=f+l*s-r*s,this}skewX(t,e,r){return this.skew(t,0,e,r)}skewY(t,e,r){return this.skew(0,t,e,r)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(ft.isMatrixLike(t))return new ft(t).multiplyO(this);const e=ft.formatTransforms(t),{x:r,y:n}=new ct(e.ox,e.oy).transform(this),i=(new ft).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-r,-n).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(r,n);if(isFinite(e.px)||isFinite(e.py)){const t=new ct(r,n).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function dt(){if(!dt.nodes){const t=T().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;dt.nodes={svg:t,path:e}}if(!dt.nodes.svg.node.parentNode){const t=_.document.body||_.document.documentElement;dt.nodes.svg.addTo(t)}return dt.nodes}function pt(t){return!(t.width||t.height||t.x||t.y)}z(ft,"Matrix");class mt{constructor(...t){this.init(...t)}addOffset(){return this.x+=_.window.pageXOffset,this.y+=_.window.pageYOffset,new mt(this)}init(t){return t="string"==typeof t?t.split(nt).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return pt(this)}merge(t){const e=Math.min(this.x,t.x),r=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-r;return new mt(e,r,n,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof ft||(t=new ft(t));let e=1/0,r=-1/0,n=1/0,i=-1/0;return[new ct(this.x,this.y),new ct(this.x2,this.y),new ct(this.x,this.y2),new ct(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),r=Math.max(r,s.x),n=Math.min(n,s.y),i=Math.max(i,s.y)})),new mt(e,n,r-e,i-n)}}function gt(t,e,r){let n;try{if(n=e(t.node),pt(n)&&(i=t.node)!==_.document&&!(_.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===_.document}).call(_.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){n=r(t)}var i;return n}s({viewbox:{viewbox(t,e,r,n){return null==t?new mt(this.attr("viewBox")):this.attr("viewBox",new mt(t,e,r,n))},zoom(t,e){let{width:r,height:n}=this.attr(["width","height"]);if((r||n)&&"string"!=typeof r&&"string"!=typeof n||(r=this.node.clientWidth,n=this.node.clientHeight),!r||!n)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=r/i.width,o=n/i.height,a=Math.min(s,o);if(null==t)return a;let h=a/t;h===1/0&&(h=Number.MAX_SAFE_INTEGER/100),e=e||new ct(r/2/s+i.x,n/2/o+i.y);const u=new mt(i).transform(new ft({scale:h,origin:e}));return this.viewbox(u)}}}),z(mt,"Box");class vt extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}V([vt],{each(t,...e){return"function"==typeof t?this.map(((e,r,n)=>t.call(e,e,r,n))):this.map((r=>r[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const yt=["toArray","constructor","each"];function bt(t,e){return new vt(h((e||_.document).querySelectorAll(t),(function(t){return F(t)})))}vt.extend=function(t){t=t.reduce(((t,e)=>(yt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),V([vt],t)};let wt=0;const Mt={};function xt(t){let e=t.getEventHolder();return e===_.window&&(e=Mt),e.events||(e.events={}),e.events}function _t(t){return t.getEventTarget()}function St(t){let e=t.getEventHolder();e===_.window&&(e=Mt),e.events&&(e.events={})}function Pt(t,e,r,n,i){const s=r.bind(n||t),o=T(t),a=xt(o),h=_t(o);e=Array.isArray(e)?e:e.split(nt),r._svgjsListenerId||(r._svgjsListenerId=++wt),e.forEach((function(t){const e=t.split(".")[0],n=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][r._svgjsListenerId]=s,h.addEventListener(e,s,i||!1)}))}function At(t,e,r,n){const i=T(t),s=xt(i),o=_t(i);("function"!=typeof r||(r=r._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(nt)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let h,u;if(r)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][r],n||!1),delete s[e][a||"*"][r]);else if(e&&a){if(s[e]&&s[e][a]){for(u in s[e][a])At(o,[e,a].join("."),u);delete s[e][a]}}else if(a)for(t in s)for(h in s[t])a===h&&At(o,[t,a].join("."));else if(e){if(s[e]){for(h in s[e])At(o,[e,h].join("."));delete s[e]}}else{for(t in s)At(o,t);St(i)}}))}function Et(t,e,r,n){const i=_t(t);return e instanceof _.window.Event||(e=new _.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}class Ot extends I{addEventListener(){}dispatch(t,e,r){return Et(this,t,e,r)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const r=e[t.type];for(const e in r)for(const n in r[e])r[e][n](t);return!t.defaultPrevented}fire(t,e,r){return this.dispatch(t,e,r),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e){return At(this,t,e),this}on(t,e,r,n){return Pt(this,t,e,r,n),this}removeEventListener(){}}function kt(){}z(Ot,"EventTarget");const It={duration:400,ease:">",delay:0},Ct={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};var Bt={__proto__:null,noop:kt,timeline:It,attrs:Ct};class Rt extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(nt).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class Tt{constructor(...t){this.init(...t)}convert(t){return new Tt(this.value,t)}divide(t){return t=new Tt(t),new Tt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(G))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof Tt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new Tt(t),new Tt(this-t,this.unit||t.unit)}plus(t){return t=new Tt(t),new Tt(this+t,this.unit||t.unit)}times(t){return t=new Tt(t),new Tt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const Lt=[];class Ft extends Ot{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=T(t)).removeNamespace&&this.node instanceof _.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return T(t).put(this,e)}children(){return new vt(h(this.node.children,(function(t){return F(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0){return this.writeDataToDom(),new this.constructor(Y(this.node.cloneNode(t)))}each(t,e){const r=this.children();let n,i;for(n=0,i=r.length;n=0}html(t,e){return this.xml(t,e,y)}id(t){return void 0!==t||this.node.id||(this.node.id=U(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return F(this.node.lastChild)}matches(t){const e=this.node,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return r&&r.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=F(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=F(e.node.parentNode));return e}put(t,e){return t=T(t),this.add(t,e),t}putIn(t,e){return T(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=T(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const r=10**t,n=this.attr(e);for(const t in n)"number"==typeof n[t]&&(n[t]=Math.round(n[t]*r)/r);return this.attr(n),this}svg(t,e){return this.xml(t,e,v)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const r=e.index(this);return e.put(t,r).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let r=this;if(null!=t){if(r=F(r.node.cloneNode(!0)),e){const e=t(r);if(r=e||r,!1===e)return""}r.each((function(){const e=t(this),r=e||this;!1===e?this.remove():e&&this!==r&&this.replace(r)}),!0)}return e?r.node.outerHTML:r.node.innerHTML}e=null!=e&&e;const n=R("wrapper",r),i=_.document.createDocumentFragment();n.innerHTML=t;for(let t=n.children.length;t--;)i.appendChild(n.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}V(Ft,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=et.test(r.nodeValue)?parseFloat(r.nodeValue):r.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?Ct[t]:et.test(e)?parseFloat(e):e;"number"==typeof(e=Lt.reduce(((e,r)=>r(t,e,this)),e))?e=new Tt(e):ut.isColor(e)?e=new ut(e):e.constructor===Array&&(e=new Rt(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof r?this.node.setAttributeNS(r,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return bt(t,this.node)},findOne:function(t){return F(this.node.querySelector(t))}}),z(Ft,"Dom");class jt extends Ft{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,t.hasAttribute("svgjs:data")&&this.setData(JSON.parse(t.getAttribute("svgjs:data"))||{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new Tt(t).plus(this.x()))}dy(t=0){return this.y(new Tt(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){t=T(t);const e=new vt;let r=this;for(;(r=r.parent())&&r.node!==_.document&&"#document-fragment"!==r.nodeName&&(e.push(r),r.node!==t.node););return e}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(H);return e?T(e[1]):null}root(){const t=this.parent(q(B));return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const r=p(this,t,e);return this.width(new Tt(r.width)).height(new Tt(r.height))}width(t){return this.attr("width",t)}writeDataToDom(){return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}V(jt,{bbox:function(){const t=gt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(dt().svg).show(),r=e.node.getBBox();return e.remove(),r}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new mt(t)},rbox:function(t){const e=gt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),r=new mt(e);return t?r.transform(t.screenCTM().inverseO()):r.addOffset()},inside:function(t,e){const r=this.bbox();return t>r.x&&e>r.y&&t=0;r--)null!=e[Dt[t][r]]&&this.attr(Dt.prefix(t,Dt[t][r]),e[Dt[t][r]]);return this},s(["Element","Runner"],e)})),s(["Element","Runner"],{matrix:function(t,e,r,n,i,s){return null==t?new ft(this):this.attr("transform",new ft(t,e,r,n,i,s))},rotate:function(t,e,r){return this.transform({rotate:t,ox:e,oy:r},!0)},skew:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:r},!0):this.transform({skew:[t,e],ox:r,oy:n},!0)},shear:function(t,e,r){return this.transform({shear:t,ox:e,oy:r},!0)},scale:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:r},!0):this.transform({scale:[t,e],ox:r,oy:n},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),s("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new Tt(t)):this.rx(t).ry(e)}}),s("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new ct(this.node.getPointAtLength(t))}}),s(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),s("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),s("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(W).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(nt).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(ft.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new ft)},toParent:function(t,e){if(this===t)return this;const r=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(n.multiply(r)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new ft(this).decompose();return null==t?e:e[t]}ft.isMatrixLike(t)||(t={...t,origin:m(t,this)});const r=new ft(!0===e?this:e||!1).transform(t);return this.attr("transform",r)}});class zt extends jt{flatten(t=this,e){return this.each((function(){if(this instanceof zt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(r,n){return n[n.length-r-1].toParent(t,e)})),this.remove()}}z(zt,"Container");class qt extends zt{constructor(t,e=t){super(L("defs",t),e)}flatten(){return this}ungroup(){return this}}z(qt,"Defs");class Nt extends jt{}function Ut(t){return this.attr("rx",t)}function Yt(t){return this.attr("ry",t)}function Vt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Zt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Gt(t){return this.attr("cx",t)}function Xt(t){return this.attr("cy",t)}function $t(t){return null==t?2*this.rx():this.rx(new Tt(t).divide(2))}function Ht(t){return null==t?2*this.ry():this.ry(new Tt(t).divide(2))}z(Nt,"Shape");var Wt={__proto__:null,rx:Ut,ry:Yt,x:Vt,y:Zt,cx:Gt,cy:Xt,width:$t,height:Ht};class Qt extends Nt{constructor(t,e=t){super(L("ellipse",t),e)}size(t,e){const r=p(this,t,e);return this.rx(new Tt(r.width).divide(2)).ry(new Tt(r.height).divide(2))}}V(Qt,Wt),s("Container",{ellipse:Z((function(t=0,e=t){return this.put(new Qt).size(t,e).move(0,0)}))}),z(Qt,"Ellipse");class Jt extends Ft{constructor(t=_.document.createDocumentFragment()){super(t)}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){const t=new Ft(R("wrapper",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}}function Kt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new Tt(t),fy:new Tt(e)}):this.attr({x1:new Tt(t),y1:new Tt(e)})}function te(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new Tt(t),cy:new Tt(e)}):this.attr({x2:new Tt(t),y2:new Tt(e)})}z(Jt,"Fragment");var ee,re={__proto__:null,from:Kt,to:te};class ne extends zt{constructor(t,e){super(L(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,r){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,r)}bbox(){return new mt}targets(){return bt('svg [fill*="'+this.id()+'"]')}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return'url("#'+this.id()+'")'}}V(ne,re),s({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:Z((function(t,e){return this.put(new ne(t)).update(e)}))}}),z(ne,"Gradient");class ie extends zt{constructor(t,e=t){super(L("pattern",t),e)}attr(t,e,r){return"transform"===t&&(t="patternTransform"),super.attr(t,e,r)}bbox(){return new mt}targets(){return bt('svg [fill*="'+this.id()+'"]')}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return'url("#'+this.id()+'")'}}s({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:Z((function(t,e,r){return this.put(new ie).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),z(ie,"Pattern");class se extends Nt{constructor(t,e=t){super(L("image",t),e)}load(t,e){if(!t)return this;const r=new _.window.Image;return Pt(r,"load",(function(t){const n=this.parent(ie);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof ie&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),Pt(r,"load error",(function(){At(r)})),this.attr("href",r.src=t,w)}}ee=function(t,e,r){return"fill"!==t&&"stroke"!==t||rt.test(e)&&(e=r.root().defs().image(e)),e instanceof se&&(e=r.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},Lt.push(ee),s({Container:{image:Z((function(t,e){return this.put(new se).size(0,0).load(t,e)}))}}),z(se,"Image");class oe extends Rt{bbox(){let t=-1/0,e=-1/0,r=1/0,n=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),r=Math.min(i[0],r),n=Math.min(i[1],n)})),new mt(r,n,t-r,e-n)}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(nt).map(parseFloat)).length%2!=0&&t.pop();for(let r=0,n=t.length;r=0;r--)n.width&&(this[r][0]=(this[r][0]-n.x)*t/n.width+n.x),n.height&&(this[r][1]=(this[r][1]-n.y)*e/n.height+n.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,r=this.length;e":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,r,n){return function(i){return i<0?t>0?e/t*i:r>0?n/r*i:0:i>1?r<1?(1-n)/(1-r)*i+(n-r)/(1-r):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*n+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let r=t;return"none"===e?--r:"both"===e&&++r,(n,i=!1)=>{let s=Math.floor(n*t);const o=n*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,n>=0&&s<0&&(s=0),n<=1&&s>r&&(s=r),s/r}}};class fe{done(){return!1}}class de extends fe{constructor(t=It.ease){super(),this.ease=le[t]||t}step(t,e,r){return"number"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}}class pe extends fe{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}}function me(){const t=(this._duration||500)/1e3,e=this._overshoot||0,r=Math.PI,n=Math.log(e/100+1e-10),i=-n/Math.sqrt(r*r+n*n),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}class ge extends pe{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;r>100&&(r=16),r/=1e3;const i=n.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*r+s*r*r/2;return n.velocity=i+s*r,n.done=Math.abs(e-o)+Math.abs(i)<.002,n.done?e:o}}V(ge,{duration:ce("_duration",me),overshoot:ce("_overshoot",me)});class ve extends pe{constructor(t=.1,e=.01,r=0,n=1e3){super(),this.p(t).i(e).d(r).windup(n)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;const i=e-t;let s=(n.integral||0)+i*r;const o=(i-(n.error||0))/r,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),n.error=i,n.integral=s,n.done=Math.abs(i)<.001,n.done?e:t+(this.P*i+this.I*s+this.D*o)}}V(ve,{windup:ce("_windup"),p:ce("P"),i:ce("I"),d:ce("D")});const ye={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},be={M:function(t,e,r){return e.x=r.x=t[0],e.y=r.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,r){return e.x=r.x,e.y=r.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},we="mlhvqtcsaz".split("");for(let t=0,e=we.length;t=0;n--)r=this[n][0],"M"===r||"L"===r||"T"===r?(this[n][1]+=t,this[n][2]+=e):"H"===r?this[n][1]+=t:"V"===r?this[n][1]+=e:"C"===r||"S"===r||"Q"===r?(this[n][1]+=t,this[n][2]+=e,this[n][3]+=t,this[n][4]+=e,"C"===r&&(this[n][5]+=t,this[n][6]+=e)):"A"===r&&(this[n][6]+=t,this[n][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let r=0,n="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new ct,p:new ct};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!xe(i,n))if("."!==n)if(isNaN(parseInt(n)))if(" "!==n&&","!==n)if("-"!==n)if("E"!==n.toUpperCase()){if(it.test(n)){if(i.inNumber)_e(i,!1);else{if(!Me(i))throw new Error("parser Error");Se(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!Ae(i)){_e(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else i.inNumber&&_e(i,!1);else{if("0"===i.number||Pe(i)){i.inNumber=!0,i.number=n,_e(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){_e(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&_e(i,!1),i.inSegment&&Me(i)&&Se(i),i.segments}(t)}size(t,e){const r=this.bbox();let n,i;for(r.width=0===r.width?1:r.width,r.height=0===r.height?1:r.height,n=this.length-1;n>=0;n--)i=this[n][0],"M"===i||"L"===i||"T"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):"H"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:"V"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:"C"===i||"S"===i||"Q"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,"C"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):"A"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this}toString(){return function(t){let e="";for(let r=0,n=t.length;r{const e=typeof t;return"number"===e?Tt:"string"===e?ut.isColor(t)?ut:nt.test(t)?it.test(t)?Ee:Rt:G.test(t)?Tt:Ie:Te.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Rt:"object"===e?Re:Ie};class ke{constructor(t){this._stepper=t||new de("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){const e=this;return this._morphObj.fromArray(this._from.map((function(r,n){return e._stepper.step(r,e._to[n],t,e._context[n],e._context)})))}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(Oe(t));let e=new this._type(t);return this._type===ut&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Re&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toArray(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class Ie{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class Ce{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,Ce.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}Ce.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Be=(t,e)=>t[0]e[0]?1:0;class Re{constructor(...t){this.init(...t)}align(t){for(let e=0,r=this.values.length;et.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const r=e.shift(),n=e.shift(),i=e.shift(),s=e.splice(0,i);t[r]=new n(s).valueOf()}return t}}const Te=[Ie,Ce,Re];function Le(t=[]){Te.push(...[].concat(t))}function Fe(){V(Te,{to(t){return(new ke).type(this.constructor).from(this.valueOf()).to(t)},fromArray(t){return this.init(t),this}})}class je extends Nt{constructor(t,e=t){super(L("path",t),e)}array(){return this._array||(this._array=new Ee(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new Ee(t))}size(t,e){const r=p(this,t,e);return this.attr("d",this.array().size(r.width,r.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}je.prototype.MorphArray=Ee,s({Container:{path:Z((function(t){return this.put(new je).plot(t||new Ee)}))}}),z(je,"Path");var De={__proto__:null,array:function(){return this._array||(this._array=new oe(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new oe(t))},size:function(t,e){const r=p(this,t,e);return this.attr("points",this.array().size(r.width,r.height))}};class ze extends Nt{constructor(t,e=t){super(L("polygon",t),e)}}s({Container:{polygon:Z((function(t){return this.put(new ze).plot(t||new oe)}))}}),V(ze,ae),V(ze,De),z(ze,"Polygon");class qe extends Nt{constructor(t,e=t){super(L("polyline",t),e)}}s({Container:{polyline:Z((function(t){return this.put(new qe).plot(t||new oe)}))}}),V(qe,ae),V(qe,De),z(qe,"Polyline");class Ne extends Nt{constructor(t,e=t){super(L("rect",t),e)}}V(Ne,{rx:Ut,ry:Yt}),s({Container:{rect:Z((function(t,e){return this.put(new Ne).size(t,e)}))}}),z(Ne,"Rect");class Ue{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Ye={nextDraw:null,frames:new Ue,timeouts:new Ue,immediates:new Ue,timer:()=>_.window.performance||_.window.Date,transforms:[],frame(t){const e=Ye.frames.push({run:t});return null===Ye.nextDraw&&(Ye.nextDraw=_.window.requestAnimationFrame(Ye._draw)),e},timeout(t,e){e=e||0;const r=Ye.timer().now()+e,n=Ye.timeouts.push({run:t,time:r});return null===Ye.nextDraw&&(Ye.nextDraw=_.window.requestAnimationFrame(Ye._draw)),n},immediate(t){const e=Ye.immediates.push(t);return null===Ye.nextDraw&&(Ye.nextDraw=_.window.requestAnimationFrame(Ye._draw)),e},cancelFrame(t){null!=t&&Ye.frames.remove(t)},clearTimeout(t){null!=t&&Ye.timeouts.remove(t)},cancelImmediate(t){null!=t&&Ye.immediates.remove(t)},_draw(t){let e=null;const r=Ye.timeouts.last();for(;(e=Ye.timeouts.shift())&&(t>=e.time?e.run():Ye.timeouts.push(e),e!==r););let n=null;const i=Ye.frames.last();for(;n!==i&&(n=Ye.frames.shift());)n.run(t);let s=null;for(;s=Ye.immediates.shift();)s();Ye.nextDraw=Ye.timeouts.first()||Ye.frames.first()?_.window.requestAnimationFrame(Ye._draw):null}},Ve=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},Ze=function(){const t=_.window;return(t.performance||t.Date).now()};class Ge extends Ot{constructor(t=Ze){super(),this._timeSource=t,this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const r=Math.abs(e);return this.speed(t?-r:r)}schedule(t,e,r){if(null==t)return this._runners.map(Ve);let n=0;const i=this.getEndTime();if(e=e||0,null==r||"last"===r||"after"===r)n=i;else if("absolute"===r||"start"===r)n=e,e=0;else if("now"===r)n=this._time;else if("relative"===r){const r=this.getRunnerInfoById(t.id);r&&(n=r.start+e,e=0)}else{if("with-last"!==r)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();n=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:n+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Ye.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Ye.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let r=e-this._lastSourceTime;t&&(r=0);const n=this._speed*r+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=n,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],r=e.runner;this._time-e.start<=0&&r.reset()}let i=!1;for(let t=0,e=this._runners.length;t0?this._continue():(this.pause(),this.fire("finished")),this}}s({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Ge,this._timeline):(this._timeline=t,this)}}});class Xe extends Ot{constructor(t){super(),this.id=Xe.id++,t="function"==typeof(t=null==t?It.duration:t)?new pe(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof pe,this._stepper=this._isDeclarative?t:new de,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new ft,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,r){let n=1,i=!1,s=0;return e=e||It.delay,r=r||"last","object"!=typeof(t=t||It.duration)||t instanceof fe||(e=t.delay||e,r=t.when||r,i=t.swing||i,n=t.times||n,s=t.wait||s,t=t.duration||It.duration),{duration:t,delay:e,swing:i,times:n,wait:s,when:r}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t,e){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,r){const n=Xe.sanitise(t,e,r),i=new Xe(n.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(n).schedule(n.delay,n.when)}clearTransform(){return this.transforms=new ft,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new de(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,r){return"object"==typeof t&&(e=t.swing,r=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=r||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),r=(this._time-t*e)/this._duration;return Math.min(t+r,this._times)}const r=t%1,n=e*Math.floor(t)+this._duration*r;return this.time(n)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,r=this._duration,n=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(n+r))/(n+r)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(n+r))/r+i;return Math.max(Math.min(a,1),0)},h=i*(n+r)-n;return a=e<=0?Math.round(t(1e-5)):e=0;this._lastPosition=e;const n=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime=n;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=n,this._reseted=!1;let a=!1;return(r||o)&&(this._initialise(r),this.transforms=new ft,a=this._run(o?t:e),this.fire("step",this)),this.done=this.done||a&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,r=this._queue.length;et.lmultiplyO(e),We=t=>t.transforms;function Qe(){const t=this._transformationRunners.runners.map(We).reduce(He,new ft);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Je{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new $e).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const r=this.ids.indexOf(t+1);return this.ids.splice(r,1,t+1),this.runners.splice(r,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;ee.id<=t.id)).map(We).reduce(He,new ft)},_addRunner(t){this._transformationRunners.add(t),Ye.cancelImmediate(this._frameId),this._frameId=Ye.immediate(Qe.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Je).add(new $e(new ft(this))))}}}),V(Xe,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,r){if("string"==typeof e)return this.styleAttr(t,{[e]:r});let n=e;if(this._tryRetarget(t,n))return this;let i=new ke(this._stepper).to(n),s=Object.keys(n);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const r=Object.keys(e),o=(a=s,r.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),r=new Re(i.from()).valueOf();Object.assign(r,e),i.from(r)}const h=new Re(i.to()).valueOf();Object.assign(h,e),i.to(h),s=r,n=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let r=new ke(this._stepper).to(new Tt(t));return this.queue((function(){r=r.from(this.element().zoom())}),(function(t){return this.element().zoom(r.at(t),e),r.done()}),(function(t,n){e=n,r.to(t)})),this._rememberMorpher("zoom",r),this},transform(t,e,r){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const n=ft.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new ke(this._stepper).type(r?Ce:ft);let s,o,a,h,u;return this.queue((function(){o=o||this.element(),s=s||m(t,o),u=new ft(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:l,y:f}=new ct(s).transform(o._currentTransform(this));let d=new ft({...t,origin:[l,f]}),p=this._isDeclarative&&a?a:u;if(r){d=d.decompose(l,f),p=p.decompose(l,f);const t=d.rotate,e=p.rotate,r=[t-360,t,t+360],n=r.map((t=>Math.abs(t-e))),i=Math.min(...n),s=n.indexOf(i);d.rotate=r[s]}e&&(n||(d.rotate=t.rotate||0),this._isDeclarative&&h&&(p.rotate=h)),i.from(p),i.to(d);const m=i.at(c);return h=m.rotate,a=new ft(m),this.addTransform(a),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=m(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t,e){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new Tt(e),this._tryRetarget(t,e))return this;const r=new ke(this._stepper).to(e);let n=null;return this.queue((function(){n=this.element()[t](),r.from(n),r.to(n+e)}),(function(e){return this.element()[t](r.at(e)),r.done()}),(function(t){r.to(n+new Tt(t))})),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new ke(this._stepper).to(e);return this.queue((function(){r.from(this.element()[t]())}),(function(e){return this.element()[t](r.at(e)),r.done()})),this._rememberMorpher(t,r),this},_queueNumber(t,e){return this._queueObject(t,new Tt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let r;return t&&e||(r=this._element.bbox()),t||(t=r.width/r.height*e),e||(e=r.height/r.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,r,n){if(4===arguments.length)return this.plot([t,e,r,n]);if(this._tryRetarget("plot",t))return this;const i=new ke(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,r,n){return this._queueObject("viewbox",new mt(t,e,r,n))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),V(Xe,{rx:Ut,ry:Yt,from:Kt,to:te}),z(Xe,"Runner");class Ke extends zt{constructor(t,e=t){super(L("svg",t),e),this.namespace()}defs(){return this.isRoot()?F(this.node.querySelector("defs"))||this.put(new qt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof _.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:v,version:"1.1"}).attr("xmlns:xlink",w,b).attr("xmlns:svgjs",M,b):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,b).attr("xmlns:svgjs",null,b)}root(){return this.isRoot()?this:super.root()}}s({Container:{nested:Z((function(){return this.put(new Ke)}))}}),z(Ke,"Svg",!0);class tr extends zt{constructor(t,e=t){super(L("symbol",t),e)}}s({Container:{symbol:Z((function(){return this.put(new tr)}))}}),z(tr,"Symbol");var er={__proto__:null,plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(_.document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)},move:function(t,e,r=this.bbox()){return this.x(t,r).y(e,r)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},center:function(t,e,r=this.bbox()){return this.cx(t,r).cy(e,r)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},amove:function(t,e){return this.ax(t).ay(e)},build:function(t){return this._build=!!t,this}};class rr extends Nt{constructor(t,e=t){super(L("text",t),e),this.dom.leading=new Tt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new Tt(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const r=this.dom.leading;this.each((function(n){const i=_.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=r*new Tt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",n?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new Tt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let r=0;t="";for(let n=0,i=e.length;n{let i;try{i=r.bbox()}catch(t){return}const s=new ft(r),o=s.translate(t,e).transform(s.inverse()),a=new ct(i.x,i.y).transform(o);r.move(a.x,a.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)},size:function(t,e,r=this.bbox()){const n=p(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach(((t,e)=>{const n=new ct(r).transform(new ft(t).inverse());t.scale(i,s,n.x,n.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}};class hr extends zt{constructor(t,e=t){super(L("g",t),e)}}V(hr,ar),s({Container:{group:Z((function(){return this.put(new hr)}))}}),z(hr,"G");class ur extends zt{constructor(t,e=t){super(L("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,w)}}V(ur,ar),s({Container:{link:Z((function(t){return this.put(new ur).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const r=e.index(t);return e.add(this,r),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new ur,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),z(ur,"A");class cr extends zt{constructor(t,e=t){super(L("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return bt('svg [mask*="'+this.id()+'"]')}}s({Container:{mask:Z((function(){return this.defs().put(new cr)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof cr?t:this.parent().mask().add(t);return this.attr("mask",'url("#'+e.id()+'")')},unmask(){return this.attr("mask",null)}}}),z(cr,"Mask");class lr extends jt{constructor(t,e=t){super(L("stop",t),e)}update(t){return("number"==typeof t||t instanceof Tt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new Tt(t.offset)),this}}s({Gradient:{stop:function(t,e,r){return this.put(new lr).update(t,e,r)}}}),z(lr,"Stop");class fr extends jt{constructor(t,e=t){super(L("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,r={}){return this.rule("@font-face",{fontFamily:t,src:e,...r})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let r=t+"{";for(const t in e)r+=f(t)+":"+e[t]+";";return r+="}",r}(t,e))}}s("Dom",{style(t,e){return this.put(new fr).rule(t,e)},fontface(t,e,r){return this.put(new fr).font(t,e,r)}}),z(fr,"Style");class dr extends rr{constructor(t,e=t){super(L("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let r=null;return e&&(r=e.plot(t)),null==t?r:this}track(){return this.reference("href")}}s({Container:{textPath:Z((function(t,e){return t instanceof rr||(t=this.text(t)),t.path(e)}))},Text:{path:Z((function(t,e=!0){const r=new dr;let n;if(t instanceof je||(t=this.defs().path(t)),r.attr("href","#"+t,w),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)})),textPath(){return this.findOne("textPath")}},Path:{text:Z((function(t){return t instanceof rr||(t=(new rr).addTo(this.parent()).text(t)),t.path(this)})),targets(){return bt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),dr.prototype.MorphArray=Ee,z(dr,"TextPath");class pr extends Nt{constructor(t,e=t){super(L("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,w)}}s({Container:{use:Z((function(t,e){return this.put(new pr).use(t,e)}))}}),z(pr,"Use");const mr=T;V([Ke,tr,se,ie,ue],o("viewbox")),V([he,qe,ze,je],o("marker")),V(rr,o("Text")),V(je,o("Path")),V(qt,o("Defs")),V([rr,nr],o("Tspan")),V([Ne,Qt,ne,Xe],o("radius")),V(Ot,o("EventTarget")),V(Ft,o("Dom")),V(jt,o("Element")),V(Nt,o("Shape")),V([zt,Jt],o("Container")),V(ne,o("Gradient")),V(Xe,o("Runner")),vt.extend([...new Set(i)]),Le([Tt,ut,mt,ft,Rt,oe,Ee]),Fe()},725:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.rgbToHsl=e.hslToRgb=e.rgbToHex=void 0,e.rgbToHex=function(t,e,r){return`#${((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}`},e.hslToRgb=function(t,e,r){let n,i,s;if(t/=360,r/=100,0==(e/=100))n=i=s=r;else{const o=(t,e,r)=>(r+=r<0?1:r>1?-1:0)<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,a=r<.5?r*(1+e):r+e-r*e,h=2*r-a;n=o(h,a,t+1/3),i=o(h,a,t),s=o(h,a,t-1/3)}return[.5+255*n<<0,.5+255*i<<0,.5+255*s<<0]},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;const n=Math.max(t,e,r),i=Math.min(t,e,r),s=(n+i)/2;let o,a;if(n===i)o=a=0;else{const h=n-i;switch(a=s>.5?h/(2-n-i):h/(n+i),n){case t:o=(e-r)/h+(e{Object.defineProperty(e,"__esModule",{value:!0}),e.default={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",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",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",rebeccapurple:"#663399",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",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},688:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(785),e),i(r(725),e),i(r(951),e)},951:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.parseColorAndConvert=void 0;const n=r(202),i=r(725);function s(t){if("number"==typeof t)return t>16777215?{type:"rgb",a:t>>24&255,b:t>>16&255,c:t>>8&255,alpha:(255&t)/255}:{type:"rgb",a:t>>16&255,b:t>>8&255,c:255&t,alpha:1};t=t.replace(/\s/g,""),n.default[t]&&(t=n.default[t]);let e=/^#([0-9a-f]{3,8})$/i.exec(t);if(e){const t=e[1];return 3===t.length?{type:"rgb",a:parseInt(t[0]+t[0],16),b:parseInt(t[1]+t[1],16),c:parseInt(t[2]+t[2],16),alpha:1}:{type:"rgb",a:parseInt(t[0]+t[1],16),b:parseInt(t[2]+t[3],16),c:parseInt(t[4]+t[5],16),alpha:t.length>6?parseInt(t.substring(6),16)/255:1}}if(e=/^((hsl|rgb)a?)\((\d+),(\d+)%?,(\d+)%?,?(.+)?\)$/i.exec(t),e){const[,,t,r,n,i,s]=e;return{type:t,a:+r,b:+n,c:+i,alpha:s?+s:1}}}e.parseColorAndConvert=function(t){const e=s(t);if(e){if("hsl"===e.type){const[t,r,n]=i.hslToRgb(e.a,e.b,e.c);return{r:t,g:r,b:n,h:e.a,s:e.b,l:e.c,alpha:e.alpha}}{const[t,r,n]=i.rgbToHsl(e.a,e.b,e.c);return{h:t,s:r,l:n,r:e.a,g:e.b,b:e.c,alpha:e.alpha}}}},e.parseColor=s},785:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},926:t=>{var e;window,e=function(){return(()=>{var t=[function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.log=e.PI2=e.PHI=e.Vec2=e.distributePointsInBuffer=e.prepareBufferForInterpolation=e.interpolate=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.now=e.toRadians=e.toDegrees=e.relativeClamp=e.clamp=e.lerp=void 0,i(r(1),e),r(10).glMatrix.setMatrixArrayType(Array),i(r(21),e),i(r(22),e),i(r(23),e),i(r(24),e),i(r(33),e),i(r(34),e),i(r(35),e),i(r(32),e),i(r(36),e),i(r(37),e),i(r(38),e),i(r(39),e),i(r(40),e),i(r(41),e),i(r(42),e),i(r(43),e),i(r(44),e),i(r(45),e),i(r(46),e),i(r(47),e),i(r(29),e),i(r(48),e);var s=r(30);Object.defineProperty(e,"lerp",{enumerable:!0,get:function(){return s.lerp}}),Object.defineProperty(e,"clamp",{enumerable:!0,get:function(){return s.clamp}}),Object.defineProperty(e,"relativeClamp",{enumerable:!0,get:function(){return s.relativeClamp}}),Object.defineProperty(e,"toDegrees",{enumerable:!0,get:function(){return s.toDegrees}}),Object.defineProperty(e,"toRadians",{enumerable:!0,get:function(){return s.toRadians}}),Object.defineProperty(e,"now",{enumerable:!0,get:function(){return s.now}}),Object.defineProperty(e,"noise",{enumerable:!0,get:function(){return s.noise}}),Object.defineProperty(e,"random",{enumerable:!0,get:function(){return s.random}}),Object.defineProperty(e,"angleFromRepetition",{enumerable:!0,get:function(){return s.angleFromRepetition}}),Object.defineProperty(e,"angle2FromRepetition",{enumerable:!0,get:function(){return s.angle2FromRepetition}}),Object.defineProperty(e,"distanceFromRepetition",{enumerable:!0,get:function(){return s.distanceFromRepetition}}),Object.defineProperty(e,"interpolate",{enumerable:!0,get:function(){return s.interpolate}}),Object.defineProperty(e,"prepareBufferForInterpolation",{enumerable:!0,get:function(){return s.prepareBufferForInterpolation}}),Object.defineProperty(e,"distributePointsInBuffer",{enumerable:!0,get:function(){return s.distributePointsInBuffer}});var o=r(26);Object.defineProperty(e,"Vec2",{enumerable:!0,get:function(){return o.default}});var a=r(27);Object.defineProperty(e,"PHI",{enumerable:!0,get:function(){return a.PHI}}),Object.defineProperty(e,"PI2",{enumerable:!0,get:function(){return a.PI2}}),Object.defineProperty(e,"log",{enumerable:!0,get:function(){return a.log}}),Object.defineProperty(e,"mod",{enumerable:!0,get:function(){return a.mod}})},function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(2),e),i(r(3),e),i(r(4),e),i(r(5),e),i(r(6),e),i(r(7),e),i(r(8),e),i(r(9),e)},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},(t,e)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]="Ring",r[r.Matrix=2]="Matrix"},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},(t,e)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]="Relative",r[r.Fixed=2]="Fixed"},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},(t,e,r)=>{r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>s,mat3:()=>o,mat4:()=>a,quat:()=>h,quat2:()=>u,vec2:()=>c,vec3:()=>l,vec4:()=>f});var n=r(11),i=r(12),s=r(13),o=r(14),a=r(15),h=r(16),u=r(19),c=r(20),l=r(18),f=r(17)},(t,e,r)=>{r.r(e),r.d(e,{EPSILON:()=>n,ARRAY_TYPE:()=>i,RANDOM:()=>s,setMatrixArrayType:()=>o,toRadian:()=>h,equals:()=>u});var n=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array,s=Math.random;function o(t){i=t}var a=Math.PI/180;function h(t){return t*a}function u(t,e){return Math.abs(t-e)<=n*Math.max(1,Math.abs(t),Math.abs(e))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},(t,e,r)=>{r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,identity:()=>a,fromValues:()=>h,set:()=>u,transpose:()=>c,invert:()=>l,adjoint:()=>f,determinant:()=>d,multiply:()=>p,rotate:()=>m,scale:()=>g,fromRotation:()=>v,fromScaling:()=>y,str:()=>b,frob:()=>w,LDU:()=>M,add:()=>x,subtract:()=>_,exactEquals:()=>S,equals:()=>P,multiplyScalar:()=>A,multiplyScalarAndAdd:()=>E,mul:()=>O,sub:()=>k});var n=r(11);function i(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function s(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function a(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function h(t,e,r,i){var s=new n.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=r,s[3]=i,s}function u(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function c(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function l(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*s-i*n;return o?(o=1/o,t[0]=s*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}function f(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function d(t){return t[0]*t[3]-t[2]*t[1]}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*a+s*h,t[1]=i*a+o*h,t[2]=n*u+s*c,t[3]=i*u+o*c,t}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+s*a,t[1]=i*h+o*a,t[2]=n*-a+s*h,t[3]=i*-a+o*h,t}function g(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1];return t[0]=n*a,t[1]=i*a,t[2]=s*h,t[3]=o*h,t}function v(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function y(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function b(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function w(t){return Math.hypot(t[0],t[1],t[2],t[3])}function M(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function x(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function _(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function S(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function P(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=e[0],h=e[1],u=e[2],c=e[3];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-h)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-u)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}function A(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function E(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}var O=p,k=_},(t,e,r)=>{r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,identity:()=>a,fromValues:()=>h,set:()=>u,invert:()=>c,determinant:()=>l,multiply:()=>f,rotate:()=>d,scale:()=>p,translate:()=>m,fromRotation:()=>g,fromScaling:()=>v,fromTranslation:()=>y,str:()=>b,frob:()=>w,add:()=>M,subtract:()=>x,multiplyScalar:()=>_,multiplyScalarAndAdd:()=>S,exactEquals:()=>P,equals:()=>A,mul:()=>E,sub:()=>O});var n=r(11);function i(){var t=new n.ARRAY_TYPE(6);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function s(t){var e=new n.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function a(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function h(t,e,r,i,s,o){var a=new n.ARRAY_TYPE(6);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a[4]=s,a[5]=o,a}function u(t,e,r,n,i,s,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t}function c(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=r*s-n*i;return h?(h=1/h,t[0]=s*h,t[1]=-n*h,t[2]=-i*h,t[3]=r*h,t[4]=(i*a-s*o)*h,t[5]=(n*o-r*a)*h,t):null}function l(t){return t[0]*t[3]-t[1]*t[2]}function f(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1],l=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*u+s*c,t[1]=i*u+o*c,t[2]=n*l+s*f,t[3]=i*l+o*f,t[4]=n*d+s*p+a,t[5]=i*d+o*p+h,t}function d(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*u,t[1]=i*c+o*u,t[2]=n*-u+s*c,t[3]=i*-u+o*c,t[4]=a,t[5]=h,t}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1];return t[0]=n*u,t[1]=i*u,t[2]=s*c,t[3]=o*c,t[4]=a,t[5]=h,t}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=n*u+s*c+a,t[5]=i*u+o*c+h,t}function g(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function v(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function y(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function b(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function w(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function M(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function x(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function _(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function S(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function P(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function A(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=e[0],c=e[1],l=e[2],f=e[3],d=e[4],p=e[5];return Math.abs(r-u)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-c)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(s-l)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(o-f)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-d)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(h-p)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(p))}var E=f,O=x},(t,e,r)=>{r.r(e),r.d(e,{create:()=>i,fromMat4:()=>s,clone:()=>o,copy:()=>a,fromValues:()=>h,set:()=>u,identity:()=>c,transpose:()=>l,invert:()=>f,adjoint:()=>d,determinant:()=>p,multiply:()=>m,translate:()=>g,rotate:()=>v,scale:()=>y,fromTranslation:()=>b,fromRotation:()=>w,fromScaling:()=>M,fromMat2d:()=>x,fromQuat:()=>_,normalFromMat4:()=>S,projection:()=>P,str:()=>A,frob:()=>E,add:()=>O,subtract:()=>k,multiplyScalar:()=>I,multiplyScalarAndAdd:()=>C,exactEquals:()=>B,equals:()=>R,mul:()=>T,sub:()=>L});var n=r(11);function i(){var t=new n.ARRAY_TYPE(9);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function o(t){var e=new n.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function h(t,e,r,i,s,o,a,h,u){var c=new n.ARRAY_TYPE(9);return c[0]=t,c[1]=e,c[2]=r,c[3]=i,c[4]=s,c[5]=o,c[6]=a,c[7]=h,c[8]=u,c}function u(t,e,r,n,i,s,o,a,h,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t}function c(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function l(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function f(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=c*o-a*u,f=-c*s+a*h,d=u*s-o*h,p=r*l+n*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-c*n+i*u)*p,t[2]=(a*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*h)*p,t[5]=(-a*r+i*s)*p,t[6]=d*p,t[7]=(-u*r+n*h)*p,t[8]=(o*r-n*s)*p,t):null}function d(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8];return t[0]=o*c-a*u,t[1]=i*u-n*c,t[2]=n*a-i*o,t[3]=a*h-s*c,t[4]=r*c-i*h,t[5]=i*s-r*a,t[6]=s*u-o*h,t[7]=n*h-r*u,t[8]=r*o-n*s,t}function p(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],h=t[7],u=t[8];return e*(u*s-o*h)+r*(-u*i+o*a)+n*(h*i-s*a)}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=r[0],d=r[1],p=r[2],m=r[3],g=r[4],v=r[5],y=r[6],b=r[7],w=r[8];return t[0]=f*n+d*o+p*u,t[1]=f*i+d*a+p*c,t[2]=f*s+d*h+p*l,t[3]=m*n+g*o+v*u,t[4]=m*i+g*a+v*c,t[5]=m*s+g*h+v*l,t[6]=y*n+b*o+w*u,t[7]=y*i+b*a+w*c,t[8]=y*s+b*h+w*l,t}function g(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=h,t[6]=f*n+d*o+u,t[7]=f*i+d*a+c,t[8]=f*s+d*h+l,t}function v(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*a,t[2]=d*s+f*h,t[3]=d*o-f*n,t[4]=d*a-f*i,t[5]=d*h-f*s,t[6]=u,t[7]=c,t[8]=l,t}function y(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function b(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function w(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function M(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function x(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function _(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,h=i+i,u=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*h,m=s*o,g=s*a,v=s*h;return t[0]=1-l-p,t[3]=c-v,t[6]=f+g,t[1]=c+v,t[4]=1-u-p,t[7]=d-m,t[2]=f-g,t[5]=d+m,t[8]=1-u-l,t}function S(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*h-i*o,w=r*u-s*o,M=n*h-i*a,x=n*u-s*a,_=i*u-s*h,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,E=l*g-f*m,O=l*v-d*m,k=f*v-d*g,I=y*k-b*O+w*E+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-h*O+u*E)*I,t[1]=(h*A-o*k-u*P)*I,t[2]=(o*O-a*A+u*S)*I,t[3]=(i*O-n*k-s*E)*I,t[4]=(r*k-i*A+s*P)*I,t[5]=(n*A-r*O-s*S)*I,t[6]=(m*_-g*x+v*M)*I,t[7]=(g*w-p*_-v*b)*I,t[8]=(p*x-m*w+v*y)*I,t):null}function P(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function A(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function E(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function O(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function k(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function I(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function C(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function B(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function R(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=t[6],c=t[7],l=t[8],f=e[0],d=e[1],p=e[2],m=e[3],g=e[4],v=e[5],y=e[6],b=e[7],w=e[8];return Math.abs(r-f)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(i-d)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(s-p)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(o-m)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(a-g)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(h-v)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(v))&&Math.abs(u-y)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-b)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(l-w)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(w))}var T=m,L=k},(t,e,r)=>{r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,fromValues:()=>a,set:()=>h,identity:()=>u,transpose:()=>c,invert:()=>l,adjoint:()=>f,determinant:()=>d,multiply:()=>p,translate:()=>m,scale:()=>g,rotate:()=>v,rotateX:()=>y,rotateY:()=>b,rotateZ:()=>w,fromTranslation:()=>M,fromScaling:()=>x,fromRotation:()=>_,fromXRotation:()=>S,fromYRotation:()=>P,fromZRotation:()=>A,fromRotationTranslation:()=>E,fromQuat2:()=>O,getTranslation:()=>k,getScaling:()=>I,getRotation:()=>C,fromRotationTranslationScale:()=>B,fromRotationTranslationScaleOrigin:()=>R,fromQuat:()=>T,frustum:()=>L,perspective:()=>F,perspectiveFromFieldOfView:()=>j,ortho:()=>D,lookAt:()=>z,targetTo:()=>q,str:()=>N,frob:()=>U,add:()=>Y,subtract:()=>V,multiplyScalar:()=>Z,multiplyScalarAndAdd:()=>G,exactEquals:()=>X,equals:()=>$,mul:()=>H,sub:()=>W});var n=r(11);function i(){var t=new n.ARRAY_TYPE(16);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function s(t){var e=new n.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function a(t,e,r,i,s,o,a,h,u,c,l,f,d,p,m,g){var v=new n.ARRAY_TYPE(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=i,v[4]=s,v[5]=o,v[6]=a,v[7]=h,v[8]=u,v[9]=c,v[10]=l,v[11]=f,v[12]=d,v[13]=p,v[14]=m,v[15]=g,v}function h(t,e,r,n,i,s,o,a,h,u,c,l,f,d,p,m,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t[9]=c,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=g,t}function u(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function c(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=i,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function l(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*h-i*o,w=r*u-s*o,M=n*h-i*a,x=n*u-s*a,_=i*u-s*h,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,E=l*g-f*m,O=l*v-d*m,k=f*v-d*g,I=y*k-b*O+w*E+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-h*O+u*E)*I,t[1]=(i*O-n*k-s*E)*I,t[2]=(m*_-g*x+v*M)*I,t[3]=(f*x-l*_-d*M)*I,t[4]=(h*A-o*k-u*P)*I,t[5]=(r*k-i*A+s*P)*I,t[6]=(g*w-p*_-v*b)*I,t[7]=(c*_-f*w+d*b)*I,t[8]=(o*O-a*A+u*S)*I,t[9]=(n*A-r*O-s*S)*I,t[10]=(p*x-m*w+v*y)*I,t[11]=(l*w-c*x-d*y)*I,t[12]=(a*P-o*E-h*S)*I,t[13]=(r*E-n*P+i*S)*I,t[14]=(m*b-p*M-g*y)*I,t[15]=(c*M-l*b+f*y)*I,t):null}function f(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15];return t[0]=a*(f*v-d*g)-l*(h*v-u*g)+m*(h*d-u*f),t[1]=-(n*(f*v-d*g)-l*(i*v-s*g)+m*(i*d-s*f)),t[2]=n*(h*v-u*g)-a*(i*v-s*g)+m*(i*u-s*h),t[3]=-(n*(h*d-u*f)-a*(i*d-s*f)+l*(i*u-s*h)),t[4]=-(o*(f*v-d*g)-c*(h*v-u*g)+p*(h*d-u*f)),t[5]=r*(f*v-d*g)-c*(i*v-s*g)+p*(i*d-s*f),t[6]=-(r*(h*v-u*g)-o*(i*v-s*g)+p*(i*u-s*h)),t[7]=r*(h*d-u*f)-o*(i*d-s*f)+c*(i*u-s*h),t[8]=o*(l*v-d*m)-c*(a*v-u*m)+p*(a*d-u*l),t[9]=-(r*(l*v-d*m)-c*(n*v-s*m)+p*(n*d-s*l)),t[10]=r*(a*v-u*m)-o*(n*v-s*m)+p*(n*u-s*a),t[11]=-(r*(a*d-u*l)-o*(n*d-s*l)+c*(n*u-s*a)),t[12]=-(o*(l*g-f*m)-c*(a*g-h*m)+p*(a*f-h*l)),t[13]=r*(l*g-f*m)-c*(n*g-i*m)+p*(n*f-i*l),t[14]=-(r*(a*g-h*m)-o*(n*g-i*m)+p*(n*h-i*a)),t[15]=r*(a*f-h*l)-o*(n*f-i*l)+c*(n*h-i*a),t}function d(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],h=t[7],u=t[8],c=t[9],l=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*s)*(l*g-f*m)-(e*a-n*s)*(c*g-f*p)+(e*h-i*s)*(c*m-l*p)+(r*a-n*o)*(u*g-f*d)-(r*h-i*o)*(u*m-l*d)+(n*h-i*a)*(u*p-c*d)}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],v=e[14],y=e[15],b=r[0],w=r[1],M=r[2],x=r[3];return t[0]=b*n+w*a+M*l+x*m,t[1]=b*i+w*h+M*f+x*g,t[2]=b*s+w*u+M*d+x*v,t[3]=b*o+w*c+M*p+x*y,b=r[4],w=r[5],M=r[6],x=r[7],t[4]=b*n+w*a+M*l+x*m,t[5]=b*i+w*h+M*f+x*g,t[6]=b*s+w*u+M*d+x*v,t[7]=b*o+w*c+M*p+x*y,b=r[8],w=r[9],M=r[10],x=r[11],t[8]=b*n+w*a+M*l+x*m,t[9]=b*i+w*h+M*f+x*g,t[10]=b*s+w*u+M*d+x*v,t[11]=b*o+w*c+M*p+x*y,b=r[12],w=r[13],M=r[14],x=r[15],t[12]=b*n+w*a+M*l+x*m,t[13]=b*i+w*h+M*f+x*g,t[14]=b*s+w*u+M*d+x*v,t[15]=b*o+w*c+M*p+x*y,t}function m(t,e,r){var n,i,s,o,a,h,u,c,l,f,d,p,m=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=h,t[6]=u,t[7]=c,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+a*g+l*v+e[12],t[13]=i*m+h*g+f*v+e[13],t[14]=s*m+u*g+d*v+e[14],t[15]=o*m+c*g+p*v+e[15]),t}function g(t,e,r){var n=r[0],i=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function v(t,e,r,i){var s,o,a,h,u,c,l,f,d,p,m,g,v,y,b,w,M,x,_,S,P,A,E,O,k=i[0],I=i[1],C=i[2],B=Math.hypot(k,I,C);return B0?(r[0]=2*(h*a+l*i+u*o-c*s)/f,r[1]=2*(u*a+l*s+c*i-h*o)/f,r[2]=2*(c*a+l*o+h*s-u*i)/f):(r[0]=2*(h*a+l*i+u*o-c*s),r[1]=2*(u*a+l*s+c*i-h*o),r[2]=2*(c*a+l*o+h*s-u*i)),E(t,e,r),t}function k(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function I(t,e){var r=e[0],n=e[1],i=e[2],s=e[4],o=e[5],a=e[6],h=e[8],u=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(s,o,a),t[2]=Math.hypot(h,u,c),t}function C(t,e){var r=new n.ARRAY_TYPE(3);I(r,e);var i=1/r[0],s=1/r[1],o=1/r[2],a=e[0]*i,h=e[1]*s,u=e[2]*o,c=e[4]*i,l=e[5]*s,f=e[6]*o,d=e[8]*i,p=e[9]*s,m=e[10]*o,g=a+l+m,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(f-p)/v,t[1]=(d-u)/v,t[2]=(h-c)/v):a>l&&a>m?(v=2*Math.sqrt(1+a-l-m),t[3]=(f-p)/v,t[0]=.25*v,t[1]=(h+c)/v,t[2]=(d+u)/v):l>m?(v=2*Math.sqrt(1+l-a-m),t[3]=(d-u)/v,t[0]=(h+c)/v,t[1]=.25*v,t[2]=(f+p)/v):(v=2*Math.sqrt(1+m-a-l),t[3]=(h-c)/v,t[0]=(d+u)/v,t[1]=(f+p)/v,t[2]=.25*v),t}function B(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3],h=i+i,u=s+s,c=o+o,l=i*h,f=i*u,d=i*c,p=s*u,m=s*c,g=o*c,v=a*h,y=a*u,b=a*c,w=n[0],M=n[1],x=n[2];return t[0]=(1-(p+g))*w,t[1]=(f+b)*w,t[2]=(d-y)*w,t[3]=0,t[4]=(f-b)*M,t[5]=(1-(l+g))*M,t[6]=(m+v)*M,t[7]=0,t[8]=(d+y)*x,t[9]=(m-v)*x,t[10]=(1-(l+p))*x,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function R(t,e,r,n,i){var s=e[0],o=e[1],a=e[2],h=e[3],u=s+s,c=o+o,l=a+a,f=s*u,d=s*c,p=s*l,m=o*c,g=o*l,v=a*l,y=h*u,b=h*c,w=h*l,M=n[0],x=n[1],_=n[2],S=i[0],P=i[1],A=i[2],E=(1-(m+v))*M,O=(d+w)*M,k=(p-b)*M,I=(d-w)*x,C=(1-(f+v))*x,B=(g+y)*x,R=(p+b)*_,T=(g-y)*_,L=(1-(f+m))*_;return t[0]=E,t[1]=O,t[2]=k,t[3]=0,t[4]=I,t[5]=C,t[6]=B,t[7]=0,t[8]=R,t[9]=T,t[10]=L,t[11]=0,t[12]=r[0]+S-(E*S+I*P+R*A),t[13]=r[1]+P-(O*S+C*P+T*A),t[14]=r[2]+A-(k*S+B*P+L*A),t[15]=1,t}function T(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,h=i+i,u=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*h,m=s*o,g=s*a,v=s*h;return t[0]=1-l-p,t[1]=c+v,t[2]=f-g,t[3]=0,t[4]=c-v,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-u-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function L(t,e,r,n,i,s,o){var a=1/(r-e),h=1/(i-n),u=1/(s-o);return t[0]=2*s*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*h,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*h,t[10]=(o+s)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*u,t[15]=0,t}function F(t,e,r,n,i){var s,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(s=1/(n-i),t[10]=(i+n)*s,t[14]=2*i*n*s):(t[10]=-1,t[14]=-2*n),t}function j(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),h=2/(o+a),u=2/(i+s);return t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-a)*h*.5,t[9]=(i-s)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function D(t,e,r,n,i,s,o){var a=1/(e-r),h=1/(n-i),u=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*h,t[14]=(o+s)*u,t[15]=1,t}function z(t,e,r,i){var s,o,a,h,c,l,f,d,p,m,g=e[0],v=e[1],y=e[2],b=i[0],w=i[1],M=i[2],x=r[0],_=r[1],S=r[2];return Math.abs(g-x)0&&(c*=d=1/Math.sqrt(d),l*=d,f*=d);var p=h*f-u*l,m=u*c-a*f,g=a*l-h*c;return(d=p*p+m*m+g*g)>0&&(p*=d=1/Math.sqrt(d),m*=d,g*=d),t[0]=p,t[1]=m,t[2]=g,t[3]=0,t[4]=l*g-f*m,t[5]=f*p-c*g,t[6]=c*m-l*p,t[7]=0,t[8]=c,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=s,t[14]=o,t[15]=1,t}function N(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function U(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Y(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function V(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function Z(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function G(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function X(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function $(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=t[6],c=t[7],l=t[8],f=t[9],d=t[10],p=t[11],m=t[12],g=t[13],v=t[14],y=t[15],b=e[0],w=e[1],M=e[2],x=e[3],_=e[4],S=e[5],P=e[6],A=e[7],E=e[8],O=e[9],k=e[10],I=e[11],C=e[12],B=e[13],R=e[14],T=e[15];return Math.abs(r-b)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-w)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(w))&&Math.abs(s-M)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(o-x)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(a-_)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(h-S)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(u-P)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(P))&&Math.abs(c-A)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(l-E)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(f-O)<=n.EPSILON*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(d-k)<=n.EPSILON*Math.max(1,Math.abs(d),Math.abs(k))&&Math.abs(p-I)<=n.EPSILON*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(m-C)<=n.EPSILON*Math.max(1,Math.abs(m),Math.abs(C))&&Math.abs(g-B)<=n.EPSILON*Math.max(1,Math.abs(g),Math.abs(B))&&Math.abs(v-R)<=n.EPSILON*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(y-T)<=n.EPSILON*Math.max(1,Math.abs(y),Math.abs(T))}var H=p,W=V},(t,e,r)=>{r.r(e),r.d(e,{create:()=>a,identity:()=>h,setAxisAngle:()=>u,getAxisAngle:()=>c,getAngle:()=>l,multiply:()=>f,rotateX:()=>d,rotateY:()=>p,rotateZ:()=>m,calculateW:()=>g,exp:()=>v,ln:()=>y,pow:()=>b,slerp:()=>w,random:()=>M,invert:()=>x,conjugate:()=>_,fromMat3:()=>S,fromEuler:()=>P,str:()=>A,clone:()=>R,fromValues:()=>T,copy:()=>L,set:()=>F,add:()=>j,mul:()=>D,scale:()=>z,dot:()=>q,lerp:()=>N,length:()=>U,len:()=>Y,squaredLength:()=>V,sqrLen:()=>Z,normalize:()=>G,exactEquals:()=>X,equals:()=>$,rotationTo:()=>H,sqlerp:()=>W,setAxes:()=>Q});var n=r(11),i=r(14),s=r(18),o=r(17);function a(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function h(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function u(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function c(t,e){var r=2*Math.acos(e[3]),i=Math.sin(r/2);return i>n.EPSILON?(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i):(t[0]=1,t[1]=0,t[2]=0),r}function l(t,e){var r=q(t,e);return Math.acos(2*r*r-1)}function f(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*c+o*a+i*u-s*h,t[1]=i*c+o*h+s*a-n*u,t[2]=s*c+o*u+n*h-i*a,t[3]=o*c-n*a-i*h-s*u,t}function d(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+o*a,t[1]=i*h+s*a,t[2]=s*h-i*a,t[3]=o*h-n*a,t}function p(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h-s*a,t[1]=i*h+o*a,t[2]=s*h+n*a,t[3]=o*h-i*a,t}function m(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+i*a,t[1]=i*h-n*a,t[2]=s*h+o*a,t[3]=o*h-s*a,t}function g(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function v(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=Math.exp(s),h=o>0?a*Math.sin(o)/o:0;return t[0]=r*h,t[1]=n*h,t[2]=i*h,t[3]=a*Math.cos(o),t}function y(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=o>0?Math.atan2(o,s)/o:0;return t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=.5*Math.log(r*r+n*n+i*i+s*s),t}function b(t,e,r){return y(t,e),z(t,t,r),v(t,t),t}function w(t,e,r,i){var s,o,a,h,u,c=e[0],l=e[1],f=e[2],d=e[3],p=r[0],m=r[1],g=r[2],v=r[3];return(o=c*p+l*m+f*g+d*v)<0&&(o=-o,p=-p,m=-m,g=-g,v=-v),1-o>n.EPSILON?(s=Math.acos(o),a=Math.sin(s),h=Math.sin((1-i)*s)/a,u=Math.sin(i*s)/a):(h=1-i,u=i),t[0]=h*c+u*p,t[1]=h*l+u*m,t[2]=h*f+u*g,t[3]=h*d+u*v,t}function M(t){var e=n.RANDOM(),r=n.RANDOM(),i=n.RANDOM(),s=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=s*Math.sin(2*Math.PI*r),t[1]=s*Math.cos(2*Math.PI*r),t[2]=o*Math.sin(2*Math.PI*i),t[3]=o*Math.cos(2*Math.PI*i),t}function x(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s,a=o?1/o:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=s*a,t}function _(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function S(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var s=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*s+s]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*s+o]-e[3*o+s])*r,t[s]=(e[3*s+i]+e[3*i+s])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t}function P(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var s=Math.sin(e),o=Math.cos(e),a=Math.sin(r),h=Math.cos(r),u=Math.sin(n),c=Math.cos(n);return t[0]=s*h*c-o*a*u,t[1]=o*a*c+s*h*u,t[2]=o*h*u-s*a*c,t[3]=o*h*c+s*a*u,t}function A(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var E,O,k,I,C,B,R=o.clone,T=o.fromValues,L=o.copy,F=o.set,j=o.add,D=f,z=o.scale,q=o.dot,N=o.lerp,U=o.length,Y=U,V=o.squaredLength,Z=V,G=o.normalize,X=o.exactEquals,$=o.equals,H=(E=s.create(),O=s.fromValues(1,0,0),k=s.fromValues(0,1,0),function(t,e,r){var n=s.dot(e,r);return n<-.999999?(s.cross(E,O,e),s.len(E)<1e-6&&s.cross(E,k,e),s.normalize(E,E),u(t,E,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(s.cross(E,e,r),t[0]=E[0],t[1]=E[1],t[2]=E[2],t[3]=1+n,G(t,t))}),W=(I=a(),C=a(),function(t,e,r,n,i,s){return w(I,e,i,s),w(C,r,n,s),w(t,I,C,2*s*(1-s)),t}),Q=(B=i.create(),function(t,e,r,n){return B[0]=r[0],B[3]=r[1],B[6]=r[2],B[1]=n[0],B[4]=n[1],B[7]=n[2],B[2]=-e[0],B[5]=-e[1],B[8]=-e[2],G(t,S(t,B))})},(t,e,r)=>{r.r(e),r.d(e,{create:()=>i,clone:()=>s,fromValues:()=>o,copy:()=>a,set:()=>h,add:()=>u,subtract:()=>c,multiply:()=>l,divide:()=>f,ceil:()=>d,floor:()=>p,min:()=>m,max:()=>g,round:()=>v,scale:()=>y,scaleAndAdd:()=>b,distance:()=>w,squaredDistance:()=>M,length:()=>x,squaredLength:()=>_,negate:()=>S,inverse:()=>P,normalize:()=>A,dot:()=>E,cross:()=>O,lerp:()=>k,random:()=>I,transformMat4:()=>C,transformQuat:()=>B,zero:()=>R,str:()=>T,exactEquals:()=>L,equals:()=>F,sub:()=>D,mul:()=>z,div:()=>q,dist:()=>N,sqrDist:()=>U,len:()=>Y,sqrLen:()=>V,forEach:()=>Z});var n=r(11);function i(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function s(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(t,e,r,i){var s=new n.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=r,s[3]=i,s}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function h(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function u(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function l(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}function f(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function m(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}function g(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}function v(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function y(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function b(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}function w(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return Math.hypot(r,n,i,s)}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return r*r+n*n+i*i+s*s}function x(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}function _(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function P(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function A(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s;return o>0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=s*o,t}function E(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function O(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],s=r[0]*n[2]-r[2]*n[0],o=r[0]*n[3]-r[3]*n[0],a=r[1]*n[2]-r[2]*n[1],h=r[1]*n[3]-r[3]*n[1],u=r[2]*n[3]-r[3]*n[2],c=e[0],l=e[1],f=e[2],d=e[3];return t[0]=l*u-f*h+d*a,t[1]=-c*u+f*o-d*s,t[2]=c*h-l*o+d*i,t[3]=-c*a+l*s-f*i,t}function k(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t[3]=a+n*(r[3]-a),t}function I(t,e){var r,i,s,o,a,h;e=e||1;do{a=(r=2*n.RANDOM()-1)*r+(i=2*n.RANDOM()-1)*i}while(a>=1);do{h=(s=2*n.RANDOM()-1)*s+(o=2*n.RANDOM()-1)*o}while(h>=1);var u=Math.sqrt((1-a)/h);return t[0]=e*r,t[1]=e*i,t[2]=e*s*u,t[3]=e*o*u,t}function C(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*s+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*s+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*s+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*s+r[15]*o,t}function B(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],h=r[2],u=r[3],c=u*n+a*s-h*i,l=u*i+h*n-o*s,f=u*s+o*i-a*n,d=-o*n-a*i-h*s;return t[0]=c*u+d*-o+l*-h-f*-a,t[1]=l*u+d*-a+f*-o-c*-h,t[2]=f*u+d*-h+c*-a-l*-o,t[3]=e[3],t}function R(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function T(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function L(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function F(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=e[0],h=e[1],u=e[2],c=e[3];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-h)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-u)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}var j,D=c,z=l,q=f,N=w,U=M,Y=x,V=_,Z=(j=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=4),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{r.r(e),r.d(e,{create:()=>i,clone:()=>s,length:()=>o,fromValues:()=>a,copy:()=>h,set:()=>u,add:()=>c,subtract:()=>l,multiply:()=>f,divide:()=>d,ceil:()=>p,floor:()=>m,min:()=>g,max:()=>v,round:()=>y,scale:()=>b,scaleAndAdd:()=>w,distance:()=>M,squaredDistance:()=>x,squaredLength:()=>_,negate:()=>S,inverse:()=>P,normalize:()=>A,dot:()=>E,cross:()=>O,lerp:()=>k,hermite:()=>I,bezier:()=>C,random:()=>B,transformMat4:()=>R,transformMat3:()=>T,transformQuat:()=>L,rotateX:()=>F,rotateY:()=>j,rotateZ:()=>D,angle:()=>z,zero:()=>q,str:()=>N,exactEquals:()=>U,equals:()=>Y,sub:()=>Z,mul:()=>G,div:()=>X,dist:()=>$,sqrDist:()=>H,len:()=>W,sqrLen:()=>Q,forEach:()=>J});var n=r(11);function i(){var t=new n.ARRAY_TYPE(3);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function s(t){var e=new n.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function o(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function a(t,e,r){var i=new n.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=r,i}function h(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function u(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function c(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function l(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function f(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function d(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function p(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function m(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function g(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function v(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function y(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function b(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function w(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function x(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function _(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function P(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function A(t,e){var r=e[0],n=e[1],i=e[2],s=r*r+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function E(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function O(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],h=r[2];return t[0]=i*h-s*a,t[1]=s*o-n*h,t[2]=n*a-i*o,t}function k(t,e,r,n){var i=e[0],s=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t}function I(t,e,r,n,i,s){var o=s*s,a=o*(2*s-3)+1,h=o*(s-2)+s,u=o*(s-1),c=o*(3-2*s);return t[0]=e[0]*a+r[0]*h+n[0]*u+i[0]*c,t[1]=e[1]*a+r[1]*h+n[1]*u+i[1]*c,t[2]=e[2]*a+r[2]*h+n[2]*u+i[2]*c,t}function C(t,e,r,n,i,s){var o=1-s,a=o*o,h=s*s,u=a*o,c=3*s*a,l=3*h*o,f=h*s;return t[0]=e[0]*u+r[0]*c+n[0]*l+i[0]*f,t[1]=e[1]*u+r[1]*c+n[1]*l+i[1]*f,t[2]=e[2]*u+r[2]*c+n[2]*l+i[2]*f,t}function B(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,s=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*s,t[1]=Math.sin(r)*s,t[2]=i*e,t}function R(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[3]*n+r[7]*i+r[11]*s+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*s+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*s+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*s+r[14])/o,t}function T(t,e,r){var n=e[0],i=e[1],s=e[2];return t[0]=n*r[0]+i*r[3]+s*r[6],t[1]=n*r[1]+i*r[4]+s*r[7],t[2]=n*r[2]+i*r[5]+s*r[8],t}function L(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],h=e[1],u=e[2],c=i*u-s*h,l=s*a-n*u,f=n*h-i*a,d=i*f-s*l,p=s*c-n*f,m=n*l-i*c,g=2*o;return c*=g,l*=g,f*=g,d*=2,p*=2,m*=2,t[0]=a+c+d,t[1]=h+l+p,t[2]=u+f+m,t}function F(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0],s[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),s[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function j(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),s[1]=i[1],s[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function D(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),s[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),s[2]=i[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function z(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2],h=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(s*s+o*o+a*a),u=h&&E(t,e)/h;return Math.acos(Math.min(Math.max(u,-1),1))}function q(t){return t[0]=0,t[1]=0,t[2]=0,t}function N(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function U(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Y(t,e){var r=t[0],i=t[1],s=t[2],o=e[0],a=e[1],h=e[2];return Math.abs(r-o)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-a)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(s-h)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(h))}var V,Z=l,G=f,X=d,$=M,H=x,W=o,Q=_,J=(V=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=3),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{r.r(e),r.d(e,{create:()=>o,clone:()=>a,fromValues:()=>h,fromRotationTranslationValues:()=>u,fromRotationTranslation:()=>c,fromTranslation:()=>l,fromRotation:()=>f,fromMat4:()=>d,copy:()=>p,identity:()=>m,set:()=>g,getReal:()=>v,getDual:()=>y,setReal:()=>b,setDual:()=>w,getTranslation:()=>M,translate:()=>x,rotateX:()=>_,rotateY:()=>S,rotateZ:()=>P,rotateByQuatAppend:()=>A,rotateByQuatPrepend:()=>E,rotateAroundAxis:()=>O,add:()=>k,multiply:()=>I,mul:()=>C,scale:()=>B,dot:()=>R,lerp:()=>T,invert:()=>L,conjugate:()=>F,length:()=>j,len:()=>D,squaredLength:()=>z,sqrLen:()=>q,normalize:()=>N,str:()=>U,exactEquals:()=>Y,equals:()=>V});var n=r(11),i=r(16),s=r(15);function o(){var t=new n.ARRAY_TYPE(8);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function a(t){var e=new n.ARRAY_TYPE(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function h(t,e,r,i,s,o,a,h){var u=new n.ARRAY_TYPE(8);return u[0]=t,u[1]=e,u[2]=r,u[3]=i,u[4]=s,u[5]=o,u[6]=a,u[7]=h,u}function u(t,e,r,i,s,o,a){var h=new n.ARRAY_TYPE(8);h[0]=t,h[1]=e,h[2]=r,h[3]=i;var u=.5*s,c=.5*o,l=.5*a;return h[4]=u*i+c*r-l*e,h[5]=c*i+l*t-u*r,h[6]=l*i+u*e-c*t,h[7]=-u*t-c*e-l*r,h}function c(t,e,r){var n=.5*r[0],i=.5*r[1],s=.5*r[2],o=e[0],a=e[1],h=e[2],u=e[3];return t[0]=o,t[1]=a,t[2]=h,t[3]=u,t[4]=n*u+i*h-s*a,t[5]=i*u+s*o-n*h,t[6]=s*u+n*a-i*o,t[7]=-n*o-i*a-s*h,t}function l(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function d(t,e){var r=i.create();s.getRotation(r,e);var o=new n.ARRAY_TYPE(3);return s.getTranslation(o,e),c(t,r,o),t}function p(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function m(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function g(t,e,r,n,i,s,o,a,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t}var v=i.copy;function y(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var b=i.copy;function w(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function M(t,e){var r=e[4],n=e[5],i=e[6],s=e[7],o=-e[0],a=-e[1],h=-e[2],u=e[3];return t[0]=2*(r*u+s*o+n*h-i*a),t[1]=2*(n*u+s*a+i*o-r*h),t[2]=2*(i*u+s*h+r*a-n*o),t}function x(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=.5*r[0],h=.5*r[1],u=.5*r[2],c=e[4],l=e[5],f=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=o*a+i*u-s*h+c,t[5]=o*h+s*a-n*u+l,t[6]=o*u+n*h-i*a+f,t[7]=-n*a-i*h-s*u+d,t}function _(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],h=e[4],u=e[5],c=e[6],l=e[7],f=h*a+l*n+u*o-c*s,d=u*a+l*s+c*n-h*o,p=c*a+l*o+h*s-u*n,m=l*a-h*n-u*s-c*o;return i.rotateX(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function S(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],h=e[4],u=e[5],c=e[6],l=e[7],f=h*a+l*n+u*o-c*s,d=u*a+l*s+c*n-h*o,p=c*a+l*o+h*s-u*n,m=l*a-h*n-u*s-c*o;return i.rotateY(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function P(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],h=e[4],u=e[5],c=e[6],l=e[7],f=h*a+l*n+u*o-c*s,d=u*a+l*s+c*n-h*o,p=c*a+l*o+h*s-u*n,m=l*a-h*n-u*s-c*o;return i.rotateZ(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function A(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],h=e[1],u=e[2],c=e[3];return t[0]=a*o+c*n+h*s-u*i,t[1]=h*o+c*i+u*n-a*s,t[2]=u*o+c*s+a*i-h*n,t[3]=c*o-a*n-h*i-u*s,a=e[4],h=e[5],u=e[6],c=e[7],t[4]=a*o+c*n+h*s-u*i,t[5]=h*o+c*i+u*n-a*s,t[6]=u*o+c*s+a*i-h*n,t[7]=c*o-a*n-h*i-u*s,t}function E(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*c+o*a+i*u-s*h,t[1]=i*c+o*h+s*a-n*u,t[2]=s*c+o*u+n*h-i*a,t[3]=o*c-n*a-i*h-s*u,a=r[4],h=r[5],u=r[6],c=r[7],t[4]=n*c+o*a+i*u-s*h,t[5]=i*c+o*h+s*a-n*u,t[6]=s*c+o*u+n*h-i*a,t[7]=o*c-n*a-i*h-s*u,t}function O(t,e,r,i){if(Math.abs(i)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,s=e[2]/r,o=e[3]/r,a=e[4],h=e[5],u=e[6],c=e[7],l=n*a+i*h+s*u+o*c;t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=(a-n*l)/r,t[5]=(h-i*l)/r,t[6]=(u-s*l)/r,t[7]=(c-o*l)/r}return t}function U(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function Y(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function V(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=t[6],c=t[7],l=e[0],f=e[1],d=e[2],p=e[3],m=e[4],g=e[5],v=e[6],y=e[7];return Math.abs(r-l)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(i-f)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(s-d)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(o-p)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-m)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(h-g)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(g))&&Math.abs(u-v)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(c-y)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(y))}},(t,e,r)=>{r.r(e),r.d(e,{create:()=>i,clone:()=>s,fromValues:()=>o,copy:()=>a,set:()=>h,add:()=>u,subtract:()=>c,multiply:()=>l,divide:()=>f,ceil:()=>d,floor:()=>p,min:()=>m,max:()=>g,round:()=>v,scale:()=>y,scaleAndAdd:()=>b,distance:()=>w,squaredDistance:()=>M,length:()=>x,squaredLength:()=>_,negate:()=>S,inverse:()=>P,normalize:()=>A,dot:()=>E,cross:()=>O,lerp:()=>k,random:()=>I,transformMat2:()=>C,transformMat2d:()=>B,transformMat3:()=>R,transformMat4:()=>T,rotate:()=>L,angle:()=>F,zero:()=>j,str:()=>D,exactEquals:()=>z,equals:()=>q,len:()=>U,sub:()=>Y,mul:()=>V,div:()=>Z,dist:()=>G,sqrDist:()=>X,sqrLen:()=>$,forEach:()=>H});var n=r(11);function i(){var t=new n.ARRAY_TYPE(2);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function s(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e}function o(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r}function a(t,e){return t[0]=e[0],t[1]=e[1],t}function h(t,e,r){return t[0]=e,t[1]=r,t}function u(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function l(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function f(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function m(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function g(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function v(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function y(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function b(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function w(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function x(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function _(t){var e=t[0],r=t[1];return e*e+r*r}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t}function P(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function A(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function E(t,e){return t[0]*e[0]+t[1]*e[1]}function O(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function k(t,e,r,n){var i=e[0],s=e[1];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t}function I(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function C(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function B(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function R(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function T(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function L(t,e,r,n){var i=e[0]-r[0],s=e[1]-r[1],o=Math.sin(n),a=Math.cos(n);return t[0]=i*a-s*o+r[0],t[1]=i*o+s*a+r[1],t}function F(t,e){var r=t[0],n=t[1],i=e[0],s=e[1],o=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+s*s),a=o&&(r*i+n*s)/o;return Math.acos(Math.min(Math.max(a,-1),1))}function j(t){return t[0]=0,t[1]=0,t}function D(t){return"vec2("+t[0]+", "+t[1]+")"}function z(t,e){return t[0]===e[0]&&t[1]===e[1]}function q(t,e){var r=t[0],i=t[1],s=e[0],o=e[1];return Math.abs(r-s)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-o)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))}var N,U=x,Y=c,V=l,Z=f,G=w,X=M,$=_,H=(N=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=2),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{Object.defineProperty(e,"__esModule",{value:!0}),e.Scene=void 0;const n=r(22),i=r(23),s=r(32),o=r(30);class a{constructor(t={}){this.width=400,this.height=400,this.background="hsla(0, 0%, 0%, 1)",this.color="hsla(0, 0%, 100%, 1)",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?(.5+.5*o.clamp(-1,1,t.anchor[0]))*this.width:"left"===t.anchor[0]?0:"right"===t.anchor[0]?this.width:this.center[0],"number"==typeof t.anchor[1]?(.5+.5*o.clamp(-1,1,t.anchor[1]))*this.height:"top"===t.anchor[1]?0:"bottom"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e="number"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,a.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{a.propagateToChilden(t,e)})):t instanceof s.Shape&&t.shape&&(t.shape.scene=e,a.propagateToChilden(t.shape,e))}}e.Scene=a},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||"SceneChild",this.name=t.name||this.type+"_"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){"string"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Group=void 0;const n=r(21),i=r(22),s=r(24),o=r(28);class a extends i.SceneChild{constructor(t={}){t.type="Group",super(t),this.children=[],["id","name","data","order","type"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=o.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){"object"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=a},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBase=void 0;const n=r(10),i=r(1),s=r(25),o=r(26),a=r(27),h=r(28),u=r(30),c=r(22),l=n.mat4.create(),f=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class m extends c.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?-1*u.clamp(-1,1,t.anchor[0]):"left"===t.anchor[0]?1:"right"===t.anchor[0]?-1:0,"number"==typeof t.anchor[1]?-1*u.clamp(-1,1,t.anchor[1]):"top"===t.anchor[1]?1:"bottom"===t.anchor[1]?-1:0]:[0,0],this.boundingType="string"==typeof t.boundingType?"relative"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return"function"!=typeof t.repetitions&&"function"!=typeof t.distance&&"function"!=typeof t.displace&&"function"!=typeof t.scale&&"function"!=typeof t.translate&&"function"!=typeof t.skewX&&"function"!=typeof t.skewY&&"function"!=typeof t.squeezeX&&"function"!=typeof t.squeezeY&&"function"!=typeof t.rotateX&&"function"!=typeof t.rotateY&&"function"!=typeof t.rotateZ&&"function"!=typeof t.transformOrigin&&"function"!=typeof t.perspective&&"function"!=typeof t.perspectiveOrigin}isStaticIndexed(){return"function"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return"function"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){"string"==typeof t?(r=r||"repetitions"==t,this.props[t]=e):(r=r||"repetitions"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var c,g;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const v=m.getEmptyPropArguments(this,r),y=v.repetition,b=this.getProp("repetitions",v,1),w=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,M=Array.isArray(b)?b[0]*(null!==(c=b[1])&&void 0!==c?c:b[0]):b,x=Array.isArray(b)?b[0]:M,_=Array.isArray(b)?null!==(g=b[1])&&void 0!==g?g:b[0]:1,S=y.row;S.count=x;const P=y.col;P.count=_,y.count=M,y.col.count=_,y.row.count=x,y.type=w;let A=0;const E=[];let O=0;const k=n.vec2.fromValues((_-1)/2,(x-1)/2),I=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],C=[void 0,void 0,void 0,void 0],B=[void 0,void 0,void 0,void 0];for(let r=0;r1?O/(M-1):1,y.angle=w===i.ERepetitionType.Ring?a.PI2/M*O:0,P.index=c+1,P.offset=_>1?c/(_-1):1,S.index=r+1,S.offset=x>1?r/(x-1):1;const m=this.generateBuffer(t,v),g=m.length,b=this.getShapeBounding();E[O]=new Float32Array(g),A+=g;{const t=s.toVec2(this.getProp("distance",v,s.VEC2_ZERO)),a=this.getProp("displace",v,0),M=s.toVec3(this.getProp("scale",v,s.VEC2_ONE),1),x=s.toVec3(this.getProp("translate",v,s.VEC2_ZERO),0),_=this.getProp("skewX",v,0),S=this.getProp("skewY",v,0),P=this.getProp("squeezeX",v,0),A=this.getProp("squeezeY",v,0),R=this.getProp("rotateX",v,0),T=this.getProp("rotateY",v,0),L=this.getProp("rotateZ",v,0),F=u.clamp(0,1,this.getProp("perspective",v,0)),j=s.toVec3(this.getProp("perspectiveOrigin",v,s.VEC2_ZERO),0),D=s.toVec3(this.getProp("transformOrigin",v,s.VEC2_ZERO),0);let z;switch(w){case i.ERepetitionType.Ring:z=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(z,z,s.VEC3_ZERO,y.angle+a);break;case i.ERepetitionType.Matrix:z=n.vec3.fromValues(t[1]*(c-k[0]),t[0]*(r-k[1]),0)}const q=F>0?Math.max(b.width,b.height)/2:1,N=F>0?q+10*q*(1-F):0,U=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==F||0!==D[0]||0!==D[1],Y=0!==j[0]||0!==j[1];U&&(this.boundingType===i.EBoundingType.Relative?(D[0]=D[0]*(b.width/2)+b.cx,D[1]=D[1]*(b.height/2)+b.cy):(D[0]*=b.width/2,D[1]*=b.height/2),D[2]=N);{n.mat4.identity(f),U&&n.mat4.translate(f,f,D),0===x[0]&&0===x[1]||n.mat4.translate(f,f,x),0===_&&0===S||(s.fromSkew(l,[_,S]),n.mat4.multiply(f,f,l)),0!==R&&n.mat4.rotateX(f,f,R),0!==T&&n.mat4.rotateY(f,f,T),0!==L&&n.mat4.rotateZ(f,f,L),1===M[0]&&1===M[1]||n.mat4.scale(f,f,M),U&&n.mat4.translate(f,f,n.vec3.scale(D,D,-1)),N>0&&(Y&&(this.boundingType===i.EBoundingType.Relative?(j[0]=j[0]*(b.width/2)+b.cx,j[1]=j[1]*(b.height/2)+b.cy):(j[0]*=b.width/2,j[1]*=b.height/2),j[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,z),e&&n.mat4.translate(p,p,I);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),w===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,y.angle+a)}h.Bounding.clear(B);for(let t=0;t0&&(Y&&n.vec3.add(e,e,j),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,N),Y&&n.vec3.sub(e,e,j)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=g/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,v)}E[O][t]=e[0],E[O][t+1]=e[1],h.Bounding.add(B,e[0],e[1]),h.Bounding.add(C,e[0],e[1])}}const R={cx:0,cy:0,x:-1,y:-1,width:2,height:2};h.Bounding.bind(R,B),this.bStaticIndexed&&this.bIndexed||this.addIndex(g,y,R)}h.Bounding.bind(this.bounding,C),this.buffer=new Float32Array(A);for(let t=0,e=0,r=E.length;t({index:1,offset:1,count:1}),m.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...m.getEmptySimpleRepetition(),row:m.getEmptySimpleRepetition(),col:m.getEmptySimpleRepetition()})},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(10);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return"number"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(29);var i;!function(t){t[t.None=0]="None",t[t.Scale=2]="Scale",t[t.Center=4]="Center",t[t.Fill=8]="Fill"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn("[Urplfanze:Bounding] cannot sum bounding")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn("[Urplfanze:Bounding] cannot bind bounding")}};class s extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return s.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=s.getBounding(t));const o=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,a=e>=i.Center?r.cx:0,h=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{Object.defineProperty(e,"__esModule",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(31),i=r(4),s=r(26),o="undefined"!=typeof performance?performance:Date;function a(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return o.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=a,e.relativeClamp=function(t,e,r,n,i){return a(n,i,(r-t)/(e-t)*(i-n)+n)};const h={random:new n(Math.random)};e.noise=function(t="random",e=0,r=0,i=0){return void 0===h[t]&&(h[t]=new n(t)),h[t].noise3D(e,r,i)};const u={};function c(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),s=rn?[s,o]:[o,s]}function l(t,e){const r=t.length,n=r/2,i=2*(n+e),s=n-1;if(s>1){const n=r-2,o=Math.floor(e/s);let a=(i-(r+o*n))/2;const h=Math.round(s/a),u=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%h==0||e===n-2),p=o+(d?1:0),m=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);u[i]=(s=t(),o=t(),a=t(),h=t(),function(){let t=(s>>>=0)+(o>>>=0)|0;return s=o^o>>>9,o=(a>>>=0)+(a<<3)|0,t=t+(h=1+(h>>>=0)|0)|0,a=(a=a<<21|a>>>11)+t|0,(t>>>0)/4294967296})}var s,o,a,h;const c=e+u[i]()*(r-e);return void 0!==n?Math.round(c*10**n)/10**n:c},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return s.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=c,e.interpolate=function(t,e,r=.5){const[n,i]=c(t,e),s=Math.max(n.length,i.length),o="number"==typeof r?[r]:r,a=s/2;if(o.length!==a){const t=o.length;for(let e=0;e{var n;!function(){var i=.5*(Math.sqrt(3)-1),s=(3-Math.sqrt(3))/6,o=1/6,a=(Math.sqrt(5)-1)/4,h=(5-Math.sqrt(5))/20;function u(t){var e;e="function"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=l();t=i(" "),e=i(" "),r=i(" ");for(var s=0;s>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}u.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,o=this.permMod12,a=this.perm,h=this.grad3,u=0,c=0,l=0,f=(t+e)*i,d=Math.floor(t+f),p=Math.floor(e+f),m=(d+p)*s,g=t-(d-m),v=e-(p-m);g>v?(r=1,n=0):(r=0,n=1);var y=g-r+s,b=v-n+s,w=g-1+2*s,M=v-1+2*s,x=255&d,_=255&p,S=.5-g*g-v*v;if(S>=0){var P=3*o[x+a[_]];u=(S*=S)*S*(h[P]*g+h[P+1]*v)}var A=.5-y*y-b*b;if(A>=0){var E=3*o[x+r+a[_+n]];c=(A*=A)*A*(h[E]*y+h[E+1]*b)}var O=.5-w*w-M*M;if(O>=0){var k=3*o[x+1+a[_+1]];l=(O*=O)*O*(h[k]*w+h[k+1]*M)}return 70*(u+c+l)},noise3D:function(t,e,r){var n,i,s,a,h,u,c,l,f,d,p=this.permMod12,m=this.perm,g=this.grad3,v=.3333333333333333*(t+e+r),y=Math.floor(t+v),b=Math.floor(e+v),w=Math.floor(r+v),M=(y+b+w)*o,x=t-(y-M),_=e-(b-M),S=r-(w-M);x>=_?_>=S?(h=1,u=0,c=0,l=1,f=1,d=0):x>=S?(h=1,u=0,c=0,l=1,f=0,d=1):(h=0,u=0,c=1,l=1,f=0,d=1):_B?L++:F++,C>R?L++:j++,C>T?L++:D++,B>R?F++:j++,B>T?F++:D++,R>T?j++:D++;var z=C-(l=L>=3?1:0)+h,q=B-(f=F>=3?1:0)+h,N=R-(d=j>=3?1:0)+h,U=T-(p=D>=3?1:0)+h,Y=C-(m=L>=2?1:0)+2*h,V=B-(g=F>=2?1:0)+2*h,Z=R-(v=j>=2?1:0)+2*h,G=T-(y=D>=2?1:0)+2*h,X=C-(b=L>=1?1:0)+3*h,$=B-(w=F>=1?1:0)+3*h,H=R-(M=j>=1?1:0)+3*h,W=T-(x=D>=1?1:0)+3*h,Q=C-1+4*h,J=B-1+4*h,K=R-1+4*h,tt=T-1+4*h,et=255&A,rt=255&E,nt=255&O,it=255&k,st=.6-C*C-B*B-R*R-T*T;if(st<0)i=0;else{var ot=_[et+_[rt+_[nt+_[it]]]]%32*4;i=(st*=st)*st*(S[ot]*C+S[ot+1]*B+S[ot+2]*R+S[ot+3]*T)}var at=.6-z*z-q*q-N*N-U*U;if(at<0)s=0;else{var ht=_[et+l+_[rt+f+_[nt+d+_[it+p]]]]%32*4;s=(at*=at)*at*(S[ht]*z+S[ht+1]*q+S[ht+2]*N+S[ht+3]*U)}var ut=.6-Y*Y-V*V-Z*Z-G*G;if(ut<0)o=0;else{var ct=_[et+m+_[rt+g+_[nt+v+_[it+y]]]]%32*4;o=(ut*=ut)*ut*(S[ct]*Y+S[ct+1]*V+S[ct+2]*Z+S[ct+3]*G)}var lt=.6-X*X-$*$-H*H-W*W;if(lt<0)u=0;else{var ft=_[et+b+_[rt+w+_[nt+M+_[it+x]]]]%32*4;u=(lt*=lt)*lt*(S[ft]*X+S[ft+1]*$+S[ft+2]*H+S[ft+3]*W)}var dt=.6-Q*Q-J*J-K*K-tt*tt;if(dt<0)c=0;else{var pt=_[et+1+_[rt+1+_[nt+1+_[it+1]]]]%32*4;c=(dt*=dt)*dt*(S[pt]*Q+S[pt+1]*J+S[pt+2]*K+S[pt+3]*tt)}return 27*(i+s+o+u+c)}},u._buildPermutationTable=c,void 0===(n=function(){return u}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=u,t.exports=u}()},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=void 0;const n=r(21),i=r(22),s=r(24);class o extends s.ShapeBase{constructor(t){t.type=t.type||"Shape",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn("[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\nYou passed:",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):o.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapePrimitive=void 0;const n=r(25),i=r(24),s=r(29),o=r(28);class a extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=o.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:"function"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return"function"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:"number"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp("sideLength",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeLoop=void 0;const n=r(27),i=r(28),s=r(33),o=r(24);class a extends s.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||"ShapeLoop",super(t),this.loopDependencies=(t.loopDependencies||[]).concat("sideLength"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes("propArguments"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}"loop"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||o.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?("function"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),s=this.getRepetitionSideLength(t),o=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,a={index:0,offset:0,current:0,count:n},h=a.count,u=new Float32Array(2*h);for(let n=0,i=0;n1?n/(a.count-1):1;a.current=s,a.index=n+1,a.offset=h;const c=o(a,t);u[i]=c[0],u[i+1]=c[1]}const c=[void 0,void 0,void 0,void 0],l=this.applyModifiers(u,t);for(let t=0,e=l.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBuffer=void 0;const n=r(28),i=r(33);class s extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||"ShapeBuffer",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn("[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property"),this.shape=s.EMPTY_BUFFER):this.shape="function"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return"function"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from("function"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,s=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&"function"!=typeof this.props.sideLength&&"function"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=s},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeRecursive=void 0;const n=r(32);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeRecursive",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionScale&&"function"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp("recursions",e,1)),n=Math.floor(this.getProp("recursionVertex",e,0)),s=this.getProp("recursionScale",e,2),o=this.shape;let a={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const h={...e,recursion:a};o.generate(t,!1,h);const u=o.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=u);let c=u;const l=[a];let f=0,d=1;const p=c.length,m=p/2,g=n<=0?m:Math.min(n,m),v=0===n?1:m/Math.min(n,m),y=new Float32Array(i.summmation(r,g)*p);for(let t=0;t1?e/(r-1):1,u=i.summmation(e,g)*p,m=e-1,b=0===m?0:i.summmation(m,g)*p;for(let i=0,m=g**e;i1?i/(m-1):1,count:m,level:{index:e+1,offset:n,count:r},parent:l[f]},l.push(a),this.shapeUseRecursion&&(h.recursion=a,o.generate(t,!1,h),c=o.getBuffer());const w=u+i*p,M=Math.floor(b+2*i*v),x=y[M],_=y[M+1],S=s**e;for(let t=0,e=p;t1?0:1,count:s}}},h=this.shape.getIndexedBuffer()||[];for(let t=0,e=h.length;t1?0:1,count:s}},i={...a,recursion:r},o=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:o})}if(s>1){const t=this.shape.getBufferLength({...i,parent:{...a}})/2,e=o<=0?t:Math.min(o,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let u=0,c=1;for(let t=1;t1?t/(s-1):1;for(let o=0,l=e**t;o1?o/(l-1):1;for(let d=0,p=h.length;d{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeFollow=void 0;const n=r(32);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeFollow",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},s=this.shape;s.generate(t,!1,i);let o=s.getBuffer();const a=o.length,h=new Float32Array(a*(n.length/2)),u=n.length/2;for(let e=0;e1?e/(u-1):1,count:u};this.shapeUseFollow&&(i.follow=r,s.generate(t,!1,i),o=s.getBuffer());const c=e*a,l=2*e,f=n[l],d=n[l+1];for(let t=0,e=o.length;t1?t/(e-1):1;for(let o=0,a=s.length;o{Object.defineProperty(e,"__esModule",{value:!0}),e.Line=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type="Line",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Triangle=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type="Triangle",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=s,s.buffer=[1,0,-1,1,-1,-1]},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Rect=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type="Rect",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=s,s.buffer=[1,1,-1,1,-1,-1,1,-1]},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Polygon=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["sideNumber"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp("sideNumber",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=s},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Circle=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type="Circle",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=s},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Star=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["spikes","innerRadius"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp("spikes",t,5),this.innerRadius=this.getProp("innerRadius",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=s},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Rose=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r;t.type="Rose",t.loopDependencies=(t.loopDependencies||[]).concat(["n","d"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>s.getFinalAngleFromK(this.getProp("n",t),this.getProp("d",t)),inc:t=>{const e=this.getProp("n",t),r=this.getProp("d",t),i=this.getRepetitionSideLength(t),s=Math.pow(i[0]*i[1],.45),o=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp("n",t)/this.getProp("d",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=s},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Spiral=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type="Spiral",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat(["twists","twistsStart","spiral"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:s.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp("twistsStart",t),end:t=>n.PI2*(this.getProp("twistsStart",t)+this.getProp("twists",t)),inc:t=>{const e=this.getProp("twists",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp("spiral",t),this.r=s.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case s.types.ARCHIMEDE:return t=>t/10;case s.types.HYPERBOLIC:return t=>1/t*3;case s.types.FERMAT:return t=>t**.5/3;case s.types.LITUUS:return t=>t**-.5;case s.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=s,s.types={ARCHIMEDE:"ARCHIMEDE",HYPERBOLIC:"HYPERBOLIC",FERMAT:"FERMAT",LITUUS:"LITUUS",LOGARITHMIC:"LOGARITHMIC"}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Lissajous=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type="Lissajous",t.loopDependencies=(t.loopDependencies||[]).concat(["wx","wy","wz"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp("wx",t),r=this.getProp("wy",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),s=this.getRepetitionSideLength(t);return 1/Math.pow(s[0]*s[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp("wx",t,1),this.wy=this.getProp("wy",t,2),this.wz=this.getProp("wz",t,2),super.generateLoopBuffer(t)}}e.Lissajous=s},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SuperShape=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r,i,s,o,a;t.type="SuperShape",t.loopDependencies=(t.loopDependencies||[]).concat(["a","b","m","n1","n2","n3"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(s=t.n1)&&void 0!==s?s:1,this.props.n2=null!==(o=t.n2)&&void 0!==o?o:1,this.props.n3=null!==(a=t.n3)&&void 0!==a?a:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp("a",t),this.b=this.getProp("b",t),this.m=this.getProp("m",t),this.n1=this.getProp("n1",t),this.n2=this.getProp("n2",t),this.n3=this.getProp("n3",t),super.generateLoopBuffer(t)}}e.SuperShape=s},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Modifiers=void 0;const n=r(28),i=r(49),s=r(50),o=r(52),a=r(53),h=r(51),u=r(54),c={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:s.Smooth,Solidify:o.Solidify,Subdivide:a.Subdivide,Close:h.Close,Offset:u.Offset};e.Modifiers=c},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Mirror=void 0;const n=r(29);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let s=0;s{Object.defineProperty(e,"__esModule",{value:!0}),e.Smooth=void 0;const n=r(30),i=r(51),s=r(29);class o extends s.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Close=void 0;const n=r(29);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Solidify=void 0;const n=r(29);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const s=[],o=(e="number"==typeof e?[e]:e).length;let a,h,u=[[0,0],[0,0]],c=[[0,0],[0,0]];for(let r=0,l=0,f=t.length-2;r{Object.defineProperty(e,"__esModule",{value:!0}),e.Subdivide=void 0;const n=r(29);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.Offset=void 0;const n=r(29);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i}],e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(0)})()},t.exports=e()},479:(t,e,r)=>{var n;!function(){function i(t,e,r){var n=e.x,i=e.y,s=r.x-n,o=r.y-i;if(0!==s||0!==o){var a=((t.x-n)*s+(t.y-i)*o)/(s*s+o*o);a>1?(n=r.x,i=r.y):a>0&&(n+=s*a,i+=o*a)}return(s=t.x-n)*s+(o=t.y-i)*o}function s(t,e,r,n,o){for(var a,h=n,u=e+1;uh&&(a=u,h=c)}h>n&&(a-e>1&&s(t,e,a,n,o),o.push(t[a]),r-a>1&&s(t,a,r,n,o))}function o(t,e){var r=t.length-1,n=[t[0]];return s(t,0,r,e,n),n.push(t[r]),n}function a(t,e,r){if(t.length<=2)return t;var n=void 0!==e?e*e:1;return o(t=r?t:function(t,e){for(var r,n,i,s,o,a=t[0],h=[a],u=1,c=t.length;ue&&(h.push(r),a=r);return a!==r&&h.push(r),h}(t,n),n)}void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()},721:(t,e,r)=>{t.exports=r(192)},921:t=>{var e=2*Math.PI;function r(t,e,r,n){var i=t*r+e*n;return i>1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)}function n(t,e){var r=4/3*Math.tan(e/4),n=Math.cos(t),i=Math.sin(t),s=Math.cos(t+e),o=Math.sin(t+e);return[n,i,n-i*r,i+n*r,s+o*r,o-s*r,s,o]}t.exports=function(t,i,s,o,a,h,u,c,l){var f=Math.sin(l*e/360),d=Math.cos(l*e/360),p=d*(t-s)/2+f*(i-o)/2,m=-f*(t-s)/2+d*(i-o)/2;if(0===p&&0===m)return[];if(0===u||0===c)return[];u=Math.abs(u),c=Math.abs(c);var g=p*p/(u*u)+m*m/(c*c);g>1&&(u*=Math.sqrt(g),c*=Math.sqrt(g));var v=function(t,n,i,s,o,a,h,u,c,l){var f=l*(t-i)/2+c*(n-s)/2,d=-c*(t-i)/2+l*(n-s)/2,p=h*h,m=u*u,g=f*f,v=d*d,y=p*m-p*v-m*g;y<0&&(y=0),y/=p*v+m*g;var b=(y=Math.sqrt(y)*(o===a?-1:1))*h/u*d,w=y*-u/h*f,M=l*b-c*w+(t+i)/2,x=c*b+l*w+(n+s)/2,_=(f-b)/h,S=(d-w)/u,P=(-f-b)/h,A=(-d-w)/u,E=r(1,0,_,S),O=r(_,S,P,A);return 0===a&&O>0&&(O-=e),1===a&&O<0&&(O+=e),[M,x,E,O]}(t,i,s,o,a,h,u,c,f,d),y=[],b=v[2],w=v[3],M=Math.max(Math.ceil(Math.abs(w)/(e/4)),1);w/=M;for(var x=0;x{var e=1e-10,r=Math.PI/180;function n(t,e,r){if(!(this instanceof n))return new n(t,e,r);this.rx=t,this.ry=e,this.ax=r}n.prototype.transform=function(t){var n=Math.cos(this.ax*r),i=Math.sin(this.ax*r),s=[this.rx*(t[0]*n+t[2]*i),this.rx*(t[1]*n+t[3]*i),this.ry*(-t[0]*i+t[2]*n),this.ry*(-t[1]*i+t[3]*n)],o=s[0]*s[0]+s[2]*s[2],a=s[1]*s[1]+s[3]*s[3],h=((s[0]-s[3])*(s[0]-s[3])+(s[2]+s[1])*(s[2]+s[1]))*((s[0]+s[3])*(s[0]+s[3])+(s[2]-s[1])*(s[2]-s[1])),u=(o+a)/2;if(hMath.abs(l-a)?(l-o)/c:c/(l-a))/Math.PI,this.ax>=0?(this.rx=Math.sqrt(l),this.ry=Math.sqrt(f)):(this.ax+=90,this.rx=Math.sqrt(f),this.ry=Math.sqrt(l)),this},n.prototype.isDegenerate=function(){return this.rx{function e(){if(!(this instanceof e))return new e;this.queue=[],this.cache=null}e.prototype.matrix=function(t){return 1===t[0]&&0===t[1]&&0===t[2]&&1===t[3]&&0===t[4]&&0===t[5]||(this.cache=null,this.queue.push(t)),this},e.prototype.translate=function(t,e){return 0===t&&0===e||(this.cache=null,this.queue.push([1,0,0,1,t,e])),this},e.prototype.scale=function(t,e){return 1===t&&1===e||(this.cache=null,this.queue.push([t,0,0,e,0,0])),this},e.prototype.rotate=function(t,e,r){var n,i,s;return 0!==t&&(this.translate(e,r),n=t*Math.PI/180,i=Math.cos(n),s=Math.sin(n),this.queue.push([i,s,-s,i,0,0]),this.cache=null,this.translate(-e,-r)),this},e.prototype.skewX=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},e.prototype.skewY=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},e.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],1===this.queue.length)return this.cache;for(var t=1;t{var e={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},r=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function n(t){return t>=48&&t<=57}function i(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function s(t){for(;t.index=5760&&r.indexOf(e)>=0);)t.index++;var e}function o(t){var e=t.path.charCodeAt(t.index);return 48===e?(t.param=0,void t.index++):49===e?(t.param=1,void t.index++):void(t.err="SvgPath: arc flag can be 0 or 1 only (at pos "+t.index+")")}function a(t){var e,r=t.index,i=r,s=t.max,o=!1,a=!1,h=!1,u=!1;if(i>=s)t.err="SvgPath: missed param (at pos "+i+")";else if(43!==(e=t.path.charCodeAt(i))&&45!==e||(e=++i2&&(t.result.push([r,i[0],i[1]]),i=i.slice(2),n="l",r="m"===r?"l":"L"),"r"===n)t.result.push([r].concat(i));else for(;i.length>=e[n]&&(t.result.push([r].concat(i.splice(0,e[n]))),e[n]););}function u(t){var r,n,i,u,c,l,f=t.max;if(t.segmentStart=t.index,n=97==(32|(r=t.path.charCodeAt(t.index))),function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}(r))if(u=e[t.path[t.index].toLowerCase()],t.index++,s(t),t.data=[],u){for(i=!1;;){for(c=u;c>0;c--){if(!n||3!==c&&4!==c?a(t):o(t),t.err.length)return;t.data.push(t.param),s(t),i=!1,t.index=t.max)break;if(!((l=t.path.charCodeAt(t.index))>=48&&l<=57||43===l||45===l||46===l))break}}h(t)}else h(t);else t.err="SvgPath: bad command "+t.path[t.index]+" (at pos "+t.index+")"}t.exports=function(t){var e=new i(t),r=e.max;for(s(e);e.index{var n=r(665),i=r(94),s=r(480),o=r(921),a=r(954);function h(t){if(!(this instanceof h))return new h(t);var e=n(t);this.segments=e.segments,this.err=e.err,this.__stack=[]}h.from=function(t){if("string"==typeof t)return new h(t);if(t instanceof h){var e=new h("");return e.err=t.err,e.segments=t.segments.map((function(t){return t.slice()})),e.__stack=t.__stack.map((function(t){return s().matrix(t.toArray())})),e}throw new Error("SvgPath.from: invalid param type "+t)},h.prototype.__matrix=function(t){var e,r=this;t.queue.length&&this.iterate((function(n,i,s,o){var h,u,c,l;switch(n[0]){case"v":u=0===(h=t.calc(0,n[1],!0))[0]?["v",h[1]]:["l",h[0],h[1]];break;case"V":u=(h=t.calc(s,n[1],!1))[0]===t.calc(s,o,!1)[0]?["V",h[1]]:["L",h[0],h[1]];break;case"h":u=0===(h=t.calc(n[1],0,!0))[1]?["h",h[0]]:["l",h[0],h[1]];break;case"H":u=(h=t.calc(n[1],o,!1))[1]===t.calc(s,o,!1)[1]?["H",h[0]]:["L",h[0],h[1]];break;case"a":case"A":var f=t.toArray(),d=a(n[1],n[2],n[3]).transform(f);if(f[0]*f[3]-f[1]*f[2]<0&&(n[5]=n[5]?"0":"1"),h=t.calc(n[6],n[7],"a"===n[0]),"A"===n[0]&&n[6]===s&&n[7]===o||"a"===n[0]&&0===n[6]&&0===n[7]){u=["a"===n[0]?"l":"L",h[0],h[1]];break}u=d.isDegenerate()?["a"===n[0]?"l":"L",h[0],h[1]]:[n[0],d.rx,d.ry,d.ax,n[4],n[5],h[0],h[1]];break;case"m":l=i>0,u=["m",(h=t.calc(n[1],n[2],l))[0],h[1]];break;default:for(u=[c=n[0]],l=c.toLowerCase()===c,e=1;e=0;)t.matrix(this.__stack[e].toArray());this.__matrix(t),this.__stack=[]}},h.prototype.toString=function(){var t,e,r=[];this.__evaluateStack();for(var n=0;n0&&"m"!==e&&"M"!==e&&e===this.segments[n-1][0],r=r.concat(t?this.segments[n].slice(1):this.segments[n]);return r.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")},h.prototype.translate=function(t,e){return this.__stack.push(s().translate(t,e||0)),this},h.prototype.scale=function(t,e){return this.__stack.push(s().scale(t,e||0===e?e:t)),this},h.prototype.rotate=function(t,e,r){return this.__stack.push(s().rotate(t,e||0,r||0)),this},h.prototype.skewX=function(t){return this.__stack.push(s().skewX(t)),this},h.prototype.skewY=function(t){return this.__stack.push(s().skewY(t)),this},h.prototype.matrix=function(t){return this.__stack.push(s().matrix(t)),this},h.prototype.transform=function(t){return t.trim()?(this.__stack.push(i(t)),this):this},h.prototype.round=function(t){var e,r=0,n=0,i=0,s=0;return t=t||0,this.__evaluateStack(),this.segments.forEach((function(o){var a=o[0].toLowerCase()===o[0];switch(o[0]){case"H":case"h":return a&&(o[1]+=i),i=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case"V":case"v":return a&&(o[1]+=s),s=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case"Z":case"z":return i=r,void(s=n);case"M":case"m":return a&&(o[1]+=i,o[2]+=s),i=o[1]-o[1].toFixed(t),s=o[2]-o[2].toFixed(t),r=i,n=s,o[1]=+o[1].toFixed(t),void(o[2]=+o[2].toFixed(t));case"A":case"a":return a&&(o[6]+=i,o[7]+=s),i=o[6]-o[6].toFixed(t),s=o[7]-o[7].toFixed(t),o[1]=+o[1].toFixed(t),o[2]=+o[2].toFixed(t),o[3]=+o[3].toFixed(t+2),o[6]=+o[6].toFixed(t),void(o[7]=+o[7].toFixed(t));default:return e=o.length,a&&(o[e-2]+=i,o[e-1]+=s),i=o[e-2]-o[e-2].toFixed(t),s=o[e-1]-o[e-1].toFixed(t),void o.forEach((function(e,r){r&&(o[r]=+o[r].toFixed(t))}))}})),this},h.prototype.iterate=function(t,e){var r,n,i,s=this.segments,o={},a=!1,h=0,u=0,c=0,l=0;if(e||this.__evaluateStack(),s.forEach((function(e,r){var n=t(e,r,h,u);Array.isArray(n)&&(o[r]=n,a=!0);var i=e[0]===e[0].toLowerCase();switch(e[0]){case"m":case"M":return h=e[1]+(i?h:0),u=e[2]+(i?u:0),c=h,void(l=u);case"h":case"H":return void(h=e[1]+(i?h:0));case"v":case"V":return void(u=e[1]+(i?u:0));case"z":case"Z":return h=c,void(u=l);default:h=e[e.length-2]+(i?h:0),u=e[e.length-1]+(i?u:0)}})),!a)return this;for(i=[],r=0;r{var n=r(480),i={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},s=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,o=/[\s,]+/;t.exports=function(t){var e,r,a=new n;return t.split(s).forEach((function(t){if(t.length)if(void 0===i[t])switch(r=t.split(o).map((function(t){return+t||0})),e){case"matrix":return void(6===r.length&&a.matrix(r));case"scale":return void(1===r.length?a.scale(r[0],r[0]):2===r.length&&a.scale(r[0],r[1]));case"rotate":return void(1===r.length?a.rotate(r[0],0,0):3===r.length&&a.rotate(r[0],r[1],r[2]));case"translate":return void(1===r.length?a.translate(r[0],0):2===r.length&&a.translate(r[0],r[1]));case"skewX":return void(1===r.length&&a.skewX(r[0]));case"skewY":return void(1===r.length&&a.skewY(r[0]))}else e=t})),a}},197:(t,e,r)=>{function n(t,e){return Array.isArray(e)?[t.a*e[0]+t.c*e[1]+t.e,t.b*e[0]+t.d*e[1]+t.f]:{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function i(t,e){return e.map((e=>n(t,e)))}function s(t){return{a:parseFloat(t.a),b:parseFloat(t.b),c:parseFloat(t.c),d:parseFloat(t.d),e:parseFloat(t.e),f:parseFloat(t.f)}}r.r(e),r.d(e,{applyToPoint:()=>n,applyToPoints:()=>i,compose:()=>m,fromDefinition:()=>C,fromObject:()=>s,fromString:()=>a,fromTransformAttribute:()=>T,fromTriangles:()=>I,identity:()=>h,inverse:()=>u,isAffineMatrix:()=>f,rotate:()=>b,rotateDEG:()=>w,scale:()=>M,shear:()=>x,skew:()=>S,skewDEG:()=>P,smoothMatrix:()=>k,toCSS:()=>A,toSVG:()=>E,toString:()=>O,transform:()=>p,translate:()=>d});const o=/^matrix\(\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*\)$/i;function a(t){const e=t.match(o);if(null===e||e.length<7)throw new Error(`'${t}' is not a matrix`);return{a:parseFloat(e[1]),b:parseFloat(e[2]),c:parseFloat(e[3]),d:parseFloat(e[4]),e:parseFloat(e[5]),f:parseFloat(e[6])}}function h(){return{a:1,c:0,e:0,b:0,d:1,f:0}}function u(t){const{a:e,b:r,c:n,d:i,e:s,f:o}=t,a=e*i-r*n;return{a:i/a,b:r/-a,c:n/-a,d:e/a,e:(i*s-n*o)/-a,f:(r*s-e*o)/a}}function c(t){return void 0===t}function l(t){return"number"==typeof t&&!Number.isNaN(t)&&Number.isFinite(t)}function f(t){return"object"==typeof(e=t)&&null!==e&&!Array.isArray(e)&&"a"in t&&l(t.a)&&"b"in t&&l(t.b)&&"c"in t&&l(t.c)&&"d"in t&&l(t.d)&&"e"in t&&l(t.e)&&"f"in t&&l(t.f);var e}function d(t,e=0){return{a:1,c:0,e:t,b:0,d:1,f:e}}function p(...t){const e=(t,e)=>({a:t.a*e.a+t.c*e.b,c:t.a*e.c+t.c*e.d,e:t.a*e.e+t.c*e.f+t.e,b:t.b*e.a+t.d*e.b,d:t.b*e.c+t.d*e.d,f:t.b*e.e+t.d*e.f+t.f});switch((t=Array.isArray(t[0])?t[0]:t).length){case 0:throw new Error("no matrices provided");case 1:return t[0];case 2:return e(t[0],t[1]);default:{const[r,n,...i]=t;return p(e(r,n),...i)}}}function m(...t){return p(...t)}const{cos:g,sin:v,PI:y}=Math;function b(t,e,r){const n=g(t),i=v(t),s={a:n,c:-i,e:0,b:i,d:n,f:0};return c(e)||c(r)?s:p([d(e,r),s,d(-e,-r)])}function w(t,e,r){return b(t*y/180,e,r)}function M(t,e,r,n){c(e)&&(e=t);const i={a:t,c:0,e:0,b:0,d:e,f:0};return c(r)||c(n)?i:p([d(r,n),i,d(-r,-n)])}function x(t,e){return{a:1,c:t,e:0,b:e,d:1,f:0}}const{tan:_}=Math;function S(t,e){return{a:1,c:_(t),e:0,b:_(e),d:1,f:0}}function P(t,e){return S(t*Math.PI/180,e*Math.PI/180)}function A(t){return O(t)}function E(t){return O(t)}function O(t){return`matrix(${t.a},${t.b},${t.c},${t.d},${t.e},${t.f})`}function k(t,e=1e10){return{a:Math.round(t.a*e)/e,b:Math.round(t.b*e)/e,c:Math.round(t.c*e)/e,d:Math.round(t.d*e)/e,e:Math.round(t.e*e)/e,f:Math.round(t.f*e)/e}}function I(t,e){const r=null!=t[0].x?t[0].x:t[0][0],n=null!=t[0].y?t[0].y:t[0][1],i=null!=e[0].x?e[0].x:e[0][0],s=null!=e[0].y?e[0].y:e[0][1],o=null!=t[1].x?t[1].x:t[1][0],a=null!=t[1].y?t[1].y:t[1][1],h=null!=e[1].x?e[1].x:e[1][0],c=null!=e[1].y?e[1].y:e[1][1],l=null!=t[2].x?t[2].x:t[2][0],f=null!=t[2].y?t[2].y:t[2][1],d=null!=e[2].x?e[2].x:e[2][0],m=null!=e[2].y?e[2].y:e[2][1];return k(p([{a:i-d,b:s-m,c:h-d,d:c-m,e:d,f:m},u({a:r-l,b:n-f,c:o-l,d:a-f,e:l,f})]))}function C(t){return Array.isArray(t)?t.map(e):e(t);function e(t){switch(t.type){case"matrix":if("a"in t&&"b"in t&&"c"in t&&"d"in t&&"e"in t&&"f"in t)return s(t);throw new Error("MISSING_MANDATORY_PARAM");case"translate":if(!("tx"in t))throw new Error("MISSING_MANDATORY_PARAM");return"ty"in t?d(t.tx,t.ty):d(t.tx);case"scale":if(!("sx"in t))throw new Error("MISSING_MANDATORY_PARAM");return"sy"in t?M(t.sx,t.sy):M(t.sx);case"rotate":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return"cx"in t&&"cy"in t?w(t.angle,t.cx,t.cy):w(t.angle);case"skewX":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return P(t.angle,0);case"skewY":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return P(0,t.angle);case"shear":if(!("shx"in t)||!("shy"in t))throw new Error("MISSING_MANDATORY_PARAM");return x(t.shx,t.shy);default:throw new Error("UNSUPPORTED_DESCRIPTOR")}}}function B(t,e,r,n){this.message=t,this.expected=e,this.found=r,this.location=n,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,B)}function R(t,e){e=void 0!==e?e:{};var r,n={},i={transformList:Z},s=Z,o="matrix",a="(",h=")",u="translate",c="scale",l="rotate",f="skewX",d="skewY",p=/^[eE]/,m=/^[+\-]/,g=/^[0-9]/,v=/^[ \t\r\n]/,y=j("matrix",!1),b=j("(",!1),w=j(")",!1),M=j("translate",!1),x=j("scale",!1),_=j("rotate",!1),S=j("skewX",!1),P=j("skewY",!1),A=j(",",!1),E={type:"other",description:"fractionalConstant"},O=D(["e","E"],!1,!1),k=D(["+","-"],!1,!1),I=D([["0","9"]],!1,!1),C=D([" ","\t","\r","\n"],!1,!1),R=0,T=[{line:1,column:1}],L=[],F=0;if("startRule"in e){if(!(e.startRule in i))throw new Error("Can't start parsing from rule \""+e.startRule+'".');s=i[e.startRule]}function j(t,e){return{type:"literal",text:t,ignoreCase:e}}function D(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function z(e){var r,n=T[e];if(n)return n;for(r=e-1;!T[r];)r--;for(n={line:(n=T[r]).line,column:n.column};r0;function Y(t,r){var n={};U&&(n.filename=e.filename);var i=z(t);n.start={offset:t,line:i.line,column:i.column};var s=z(r);return n.end={offset:r,line:s.line,column:s.column},n}function V(t){var e=L[L.length-1];Re.pos&&(e.pos=R,e.variants=[]),e.variants.push(t))}function Z(){var t,e,r,i;for(t=[],e=rt();e!==n;)t.push(e),e=rt();for((e=G())===n&&(e=null),r=[],i=rt();i!==n;)r.push(i),i=rt();return e}function G(){var t,e,r,i,s;if(t=R,(e=X())!==n){if(r=[],(i=W())!==n)for(;i!==n;)r.push(i),i=W();else r=n;r!==n&&(i=G())!==n?(s=i,t=e.concat(s)):(R=t,t=n)}else R=t,t=n;return t===n&&(t=X()),t}function X(){var e;return(e=function(){var e,r,i,s,u,c,l,f,d,p,m,g,v,M=function(t){0===F&&V(t)};if(e=R,M(y),t.substr(R,6)===o?(r=o,R+=6):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(M(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(u=[],c=rt();c!==n;)u.push(c),c=rt();if((c=$())!==n)if(W()!==n)if((l=$())!==n)if(W()!==n)if((f=$())!==n)if(W()!==n)if((d=$())!==n)if(W()!==n)if((p=$())!==n)if(W()!==n)if((m=$())!==n){for(g=[],v=rt();v!==n;)g.push(v),v=rt();M(w),41===t.charCodeAt(R)?(v=h,R++):v=n,v!==n?e=[{type:"matrix",a:c,b:l,c:f,d,e:p,f:m}]:(R=e,e=n)}else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,c,l,f,d,p,m,g=function(t){0===F&&V(t)};if(e=R,g(M),t.substr(R,9)===u?(r=u,R+=9):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(o=[],c=rt();c!==n;)o.push(c),c=rt();if((c=$())!==n){for((l=H())===n&&(l=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(w),41===t.charCodeAt(R)?(d=h,R++):d=n,d!==n?(m={type:"translate",tx:c},(p=l)&&(m.ty=p),e=[m]):(R=e,e=n)}else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,l,f,d,p,m,g=function(t){0===F&&V(t)};if(e=R,g(x),t.substr(R,5)===c?(r=c,R+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=$())!==n){for((l=H())===n&&(l=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(w),41===t.charCodeAt(R)?(d=h,R++):d=n,d!==n?(m={type:"scale",sx:u},(p=l)&&(m.sy=p),e=[m]):(R=e,e=n)}else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,c,f,d,p,m,g=function(t){0===F&&V(t)};if(e=R,g(_),t.substr(R,6)===l?(r=l,R+=6):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=$())!==n){for((c=function(){var t,e,r;return t=R,W()!==n&&(e=$())!==n&&W()!==n&&(r=$())!==n?t=[e,r]:(R=t,t=n),t}())===n&&(c=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(w),41===t.charCodeAt(R)?(d=h,R++):d=n,d!==n?(m={type:"rotate",angle:u},(p=c)&&(m.cx=p[0],m.cy=p[1]),e=[m]):(R=e,e=n)}else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,c,l,d=function(t){0===F&&V(t)};if(e=R,d(S),t.substr(R,5)===f?(r=f,R+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(d(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=$())!==n){for(c=[],l=rt();l!==n;)c.push(l),l=rt();d(w),41===t.charCodeAt(R)?(l=h,R++):l=n,l!==n?e=[{type:"skewX",angle:u}]:(R=e,e=n)}else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,c,l,f=function(t){0===F&&V(t)};if(e=R,f(P),t.substr(R,5)===d?(r=d,R+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(f(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=$())!==n){for(c=[],l=rt();l!==n;)c.push(l),l=rt();f(w),41===t.charCodeAt(R)?(l=h,R++):l=n,l!==n?e=[{type:"skewY",angle:u}]:(R=e,e=n)}else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}()),e}function $(){var e,r,i,s;return e=R,r=R,(i=K())===n&&(i=null),(s=function(){var e,r,i;return e=R,(r=function(){var e,r,i,s,o,a;return 0===F&&V(E),F++,e=R,(r=tt())===n&&(r=null),46===t.charCodeAt(R)?(i=".",R++):i=n,i!==n&&(s=tt())!==n?(a=s,e=[(o=r)?o.join(""):null,".",a.join("")].join("")):(R=e,e=n),e===n&&(e=R,(r=tt())!==n?(46===t.charCodeAt(R)?(i=".",R++):i=n,i!==n?e=r.join(""):(R=e,e=n)):(R=e,e=n)),F--,e}())!==n?((i=J())===n&&(i=null),e=[r,i||null].join("")):(R=e,e=n),e===n&&(e=R,(r=tt())!==n&&(i=J())!==n?e=[r,i].join(""):(R=e,e=n)),e}())!==n?r=i=[i,s]:(R=r,r=n),r!==n&&(r=parseFloat(r.join(""))),(e=r)===n&&(e=R,r=R,(i=K())===n&&(i=null),(s=function(){var t;return(t=tt())!==n&&(t=t.join("")),t}())!==n?r=i=[i,s]:(R=r,r=n),r!==n&&(r=parseInt(r.join(""))),e=r),e}function H(){var t,e;return t=R,W()!==n&&(e=$())!==n?t=e:(R=t,t=n),t}function W(){var t,e,r,i,s;if(t=R,e=[],(r=rt())!==n)for(;r!==n;)e.push(r),r=rt();else e=n;if(e!==n){for((r=Q())===n&&(r=null),i=[],s=rt();s!==n;)i.push(s),s=rt();t=e=[e,r,i]}else R=t,t=n;if(t===n)if(t=R,(e=Q())!==n){for(r=[],i=rt();i!==n;)r.push(i),i=rt();t=e=[e,r]}else R=t,t=n;return t}function Q(){var e;return 0===F&&V(A),44===t.charCodeAt(R)?(e=",",R++):e=n,e}function J(){var e,r,i,s;return e=R,0===F&&V(O),p.test(t.charAt(R))?(r=t.charAt(R),R++):r=n,r!==n?((i=K())===n&&(i=null),(s=tt())!==n?e=["e",i,s.join("")].join(""):(R=e,e=n)):(R=e,e=n),e}function K(){var e;return 0===F&&V(k),m.test(t.charAt(R))?(e=t.charAt(R),R++):e=n,e}function tt(){var t,e;if(t=[],(e=et())!==n)for(;e!==n;)t.push(e),e=et();else t=n;return t}function et(){var e;return 0===F&&V(I),g.test(t.charAt(R))?(e=t.charAt(R),R++):e=n,e}function rt(){var e;return 0===F&&V(C),v.test(t.charAt(R))?(e=t.charAt(R),R++):e=n,e}if(L.push({pos:R,variants:[]}),(r=s())!==n&&R===t.length)return r;throw r!==n&&R0){for(e=1,r=1;e{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(625)})()},3431:t=>{var e=.1,r="function"==typeof Float32Array;function n(t,e){return 1-3*e+3*t}function i(t,e){return 3*e-6*t}function s(t){return 3*t}function o(t,e,r){return((n(e,r)*t+i(e,r))*t+s(e))*t}function a(t,e,r){return 3*n(e,r)*t*t+2*i(e,r)*t+s(e)}function h(t){return t}t.exports=function(t,n,i,s){if(!(0<=t&&t<=1&&0<=i&&i<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===n&&i===s)return h;for(var u=r?new Float32Array(11):new Array(11),c=0;c<11;++c)u[c]=o(c*e,t,i);return function(r){return 0===r?0:1===r?1:o(function(r){for(var n=0,s=1;10!==s&&u[s]<=r;++s)n+=e;--s;var h=n+(r-u[s])/(u[s+1]-u[s])*e,c=a(h,t,i);return c>=.001?function(t,e,r,n){for(var i=0;i<4;++i){var s=a(e,r,n);if(0===s)return e;e-=(o(e,r,n)-t)/s}return e}(r,h,t,i):0===c?h:function(t,e,r,n,i){var s,a,h=0;do{(s=o(a=e+(r-e)/2,n,i)-t)>0?r=a:e=a}while(Math.abs(s)>1e-7&&++h<10);return a}(r,n,n+e,t,i)}(r),n,s)}}},292:(t,e,r)=>{const n=r(9850);e.parseFont=n,e.createCanvas=function(t,e){return Object.assign(document.createElement("canvas"),{width:t,height:e})},e.createImageData=function(t,e,r){switch(arguments.length){case 0:return new ImageData;case 1:return new ImageData(t);case 2:return new ImageData(t,e);default:return new ImageData(t,e,r)}},e.loadImage=function(t,e){return new Promise((function(r,n){const i=Object.assign(document.createElement("img"),e);function s(){i.onload=null,i.onerror=null}i.onload=function(){s(),r(i)},i.onerror=function(){s(),n(new Error('Failed to load the image "'+t+'"'))},i.src=t}))}},9850:t=>{const e="'([^']+)'|\"([^\"]+)\"|[\\w\\s-]+",r=new RegExp("(bold|bolder|lighter|[1-9]00) +","i"),n=new RegExp("(italic|oblique) +","i"),i=new RegExp("(small-caps) +","i"),s=new RegExp("(ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded) +","i"),o=new RegExp("([\\d\\.]+)(px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q) *((?:"+e+")( *, *(?:"+e+"))*)"),a={};t.exports=function(t){if(a[t])return a[t];const e=o.exec(t);if(!e)return;const h={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(e[1]),unit:e[2],family:e[3].replace(/["']/g,"").replace(/ *, */g,",")};let u,c,l,f,d=t.substring(0,e.index);switch((u=r.exec(d))&&(h.weight=u[1]),(c=n.exec(d))&&(h.style=c[1]),(l=i.exec(d))&&(h.variant=l[1]),(f=s.exec(d))&&(h.stretch=f[1]),h.unit){case"pt":h.size/=.75;break;case"pc":h.size*=16;break;case"in":h.size*=96;break;case"cm":h.size*=96/2.54;break;case"mm":h.size*=96/25.4;break;case"%":break;case"em":case"rem":h.size*=16/.75;break;case"q":h.size*=96/25.4/4}return a[t]=h}},887:(t,e,r)=>{r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>s,mat3:()=>o,mat4:()=>a,quat:()=>c,quat2:()=>l,vec2:()=>f,vec3:()=>h,vec4:()=>u});var n={};r.r(n),r.d(n,{ARRAY_TYPE:()=>p,EPSILON:()=>d,RANDOM:()=>m,equals:()=>b,setMatrixArrayType:()=>g,toRadian:()=>y});var i={};r.r(i),r.d(i,{LDU:()=>j,add:()=>D,adjoint:()=>O,clone:()=>M,copy:()=>x,create:()=>w,determinant:()=>k,equals:()=>N,exactEquals:()=>q,frob:()=>F,fromRotation:()=>R,fromScaling:()=>T,fromValues:()=>S,identity:()=>_,invert:()=>E,mul:()=>V,multiply:()=>I,multiplyScalar:()=>U,multiplyScalarAndAdd:()=>Y,rotate:()=>C,scale:()=>B,set:()=>P,str:()=>L,sub:()=>Z,subtract:()=>z,transpose:()=>A});var s={};r.r(s),r.d(s,{add:()=>ut,clone:()=>X,copy:()=>$,create:()=>G,determinant:()=>K,equals:()=>pt,exactEquals:()=>dt,frob:()=>ht,fromRotation:()=>it,fromScaling:()=>st,fromTranslation:()=>ot,fromValues:()=>W,identity:()=>H,invert:()=>J,mul:()=>mt,multiply:()=>tt,multiplyScalar:()=>lt,multiplyScalarAndAdd:()=>ft,rotate:()=>et,scale:()=>rt,set:()=>Q,str:()=>at,sub:()=>gt,subtract:()=>ct,translate:()=>nt});var o={};r.r(o),r.d(o,{add:()=>Nt,adjoint:()=>At,clone:()=>bt,copy:()=>wt,create:()=>vt,determinant:()=>Et,equals:()=>Gt,exactEquals:()=>Zt,frob:()=>qt,fromMat2d:()=>Lt,fromMat4:()=>yt,fromQuat:()=>Ft,fromRotation:()=>Rt,fromScaling:()=>Tt,fromTranslation:()=>Bt,fromValues:()=>Mt,identity:()=>_t,invert:()=>Pt,mul:()=>Xt,multiply:()=>Ot,multiplyScalar:()=>Yt,multiplyScalarAndAdd:()=>Vt,normalFromMat4:()=>jt,projection:()=>Dt,rotate:()=>It,scale:()=>Ct,set:()=>xt,str:()=>zt,sub:()=>$t,subtract:()=>Ut,translate:()=>kt,transpose:()=>St});var a={};r.r(a),r.d(a,{add:()=>Te,adjoint:()=>ne,clone:()=>Wt,copy:()=>Qt,create:()=>Ht,determinant:()=>ie,equals:()=>ze,exactEquals:()=>De,frob:()=>Re,fromQuat:()=>Pe,fromQuat2:()=>be,fromRotation:()=>pe,fromRotationTranslation:()=>ye,fromRotationTranslationScale:()=>_e,fromRotationTranslationScaleOrigin:()=>Se,fromScaling:()=>de,fromTranslation:()=>fe,fromValues:()=>Jt,fromXRotation:()=>me,fromYRotation:()=>ge,fromZRotation:()=>ve,frustum:()=>Ae,getRotation:()=>xe,getScaling:()=>Me,getTranslation:()=>we,identity:()=>te,invert:()=>re,lookAt:()=>Ie,mul:()=>qe,multiply:()=>se,multiplyScalar:()=>Fe,multiplyScalarAndAdd:()=>je,ortho:()=>ke,perspective:()=>Ee,perspectiveFromFieldOfView:()=>Oe,rotate:()=>he,rotateX:()=>ue,rotateY:()=>ce,rotateZ:()=>le,scale:()=>ae,set:()=>Kt,str:()=>Be,sub:()=>Ne,subtract:()=>Le,targetTo:()=>Ce,translate:()=>oe,transpose:()=>ee});var h={};r.r(h),r.d(h,{add:()=>$e,angle:()=>_r,bezier:()=>mr,ceil:()=>Je,clone:()=>Ye,copy:()=>Ge,create:()=>Ue,cross:()=>fr,dist:()=>Br,distance:()=>sr,div:()=>Cr,divide:()=>Qe,dot:()=>lr,equals:()=>Er,exactEquals:()=>Ar,floor:()=>Ke,forEach:()=>Fr,fromValues:()=>Ze,hermite:()=>pr,inverse:()=>ur,len:()=>Tr,length:()=>Ve,lerp:()=>dr,max:()=>er,min:()=>tr,mul:()=>Ir,multiply:()=>We,negate:()=>hr,normalize:()=>cr,random:()=>gr,rotateX:()=>wr,rotateY:()=>Mr,rotateZ:()=>xr,round:()=>rr,scale:()=>nr,scaleAndAdd:()=>ir,set:()=>Xe,sqrDist:()=>Rr,sqrLen:()=>Lr,squaredDistance:()=>or,squaredLength:()=>ar,str:()=>Pr,sub:()=>kr,subtract:()=>He,transformMat3:()=>yr,transformMat4:()=>vr,transformQuat:()=>br,zero:()=>Sr});var u={};r.r(u),r.d(u,{add:()=>Ur,ceil:()=>Gr,clone:()=>Dr,copy:()=>qr,create:()=>jr,cross:()=>hn,dist:()=>wn,distance:()=>Kr,div:()=>bn,divide:()=>Zr,dot:()=>an,equals:()=>gn,exactEquals:()=>mn,floor:()=>Xr,forEach:()=>Sn,fromValues:()=>zr,inverse:()=>sn,len:()=>xn,length:()=>en,lerp:()=>un,max:()=>Hr,min:()=>$r,mul:()=>yn,multiply:()=>Vr,negate:()=>nn,normalize:()=>on,random:()=>cn,round:()=>Wr,scale:()=>Qr,scaleAndAdd:()=>Jr,set:()=>Nr,sqrDist:()=>Mn,sqrLen:()=>_n,squaredDistance:()=>tn,squaredLength:()=>rn,str:()=>pn,sub:()=>vn,subtract:()=>Yr,transformMat4:()=>ln,transformQuat:()=>fn,zero:()=>dn});var c={};r.r(c),r.d(c,{add:()=>ei,calculateW:()=>Tn,clone:()=>Qn,conjugate:()=>Nn,copy:()=>Kn,create:()=>Pn,dot:()=>ii,equals:()=>fi,exactEquals:()=>li,exp:()=>Ln,fromEuler:()=>Yn,fromMat3:()=>Un,fromValues:()=>Jn,getAngle:()=>kn,getAxisAngle:()=>On,identity:()=>An,invert:()=>qn,len:()=>ai,length:()=>oi,lerp:()=>si,ln:()=>Fn,mul:()=>ri,multiply:()=>In,normalize:()=>ci,pow:()=>jn,random:()=>zn,rotateX:()=>Cn,rotateY:()=>Bn,rotateZ:()=>Rn,rotationTo:()=>di,scale:()=>ni,set:()=>ti,setAxes:()=>mi,setAxisAngle:()=>En,slerp:()=>Dn,sqlerp:()=>pi,sqrLen:()=>ui,squaredLength:()=>hi,str:()=>Vn});var l={};r.r(l),r.d(l,{add:()=>zi,clone:()=>vi,conjugate:()=>Gi,copy:()=>Si,create:()=>gi,dot:()=>Yi,equals:()=>ts,exactEquals:()=>Ki,fromMat4:()=>_i,fromRotation:()=>xi,fromRotationTranslation:()=>wi,fromRotationTranslationValues:()=>bi,fromTranslation:()=>Mi,fromValues:()=>yi,getDual:()=>Oi,getReal:()=>Ei,getTranslation:()=>Ci,identity:()=>Pi,invert:()=>Zi,len:()=>$i,length:()=>Xi,lerp:()=>Vi,mul:()=>Ni,multiply:()=>qi,normalize:()=>Qi,rotateAroundAxis:()=>Di,rotateByQuatAppend:()=>Fi,rotateByQuatPrepend:()=>ji,rotateX:()=>Ri,rotateY:()=>Ti,rotateZ:()=>Li,scale:()=>Ui,set:()=>Ai,setDual:()=>Ii,setReal:()=>ki,sqrLen:()=>Wi,squaredLength:()=>Hi,str:()=>Ji,translate:()=>Bi});var f={};r.r(f),r.d(f,{add:()=>os,angle:()=>Rs,ceil:()=>cs,clone:()=>rs,copy:()=>is,create:()=>es,cross:()=>Ps,dist:()=>Us,distance:()=>vs,div:()=>Ns,divide:()=>us,dot:()=>Ss,equals:()=>js,exactEquals:()=>Fs,floor:()=>ls,forEach:()=>Zs,fromValues:()=>ns,inverse:()=>xs,len:()=>Ds,length:()=>bs,lerp:()=>As,max:()=>ds,min:()=>fs,mul:()=>qs,multiply:()=>hs,negate:()=>Ms,normalize:()=>_s,random:()=>Es,rotate:()=>Bs,round:()=>ps,scale:()=>ms,scaleAndAdd:()=>gs,set:()=>ss,sqrDist:()=>Ys,sqrLen:()=>Vs,squaredDistance:()=>ys,squaredLength:()=>ws,str:()=>Ls,sub:()=>zs,subtract:()=>as,transformMat2:()=>Os,transformMat2d:()=>ks,transformMat3:()=>Is,transformMat4:()=>Cs,zero:()=>Ts});var d=1e-6,p="undefined"!=typeof Float32Array?Float32Array:Array,m=Math.random;function g(t){p=t}var v=Math.PI/180;function y(t){return t*v}function b(t,e){return Math.abs(t-e)<=d*Math.max(1,Math.abs(t),Math.abs(e))}function w(){var t=new p(4);return p!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function M(t){var e=new p(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function x(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function _(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function S(t,e,r,n){var i=new p(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function P(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function A(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function E(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*s-i*n;return o?(o=1/o,t[0]=s*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}function O(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function k(t){return t[0]*t[3]-t[2]*t[1]}function I(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*a+s*h,t[1]=i*a+o*h,t[2]=n*u+s*c,t[3]=i*u+o*c,t}function C(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+s*a,t[1]=i*h+o*a,t[2]=n*-a+s*h,t[3]=i*-a+o*h,t}function B(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1];return t[0]=n*a,t[1]=i*a,t[2]=s*h,t[3]=o*h,t}function R(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function T(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function L(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function F(t){return Math.hypot(t[0],t[1],t[2],t[3])}function j(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function D(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function z(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function q(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function N(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=e[0],a=e[1],h=e[2],u=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-h)<=d*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-u)<=d*Math.max(1,Math.abs(s),Math.abs(u))}function U(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Y(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var V=I,Z=z;function G(){var t=new p(6);return p!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function X(t){var e=new p(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function $(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function H(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function W(t,e,r,n,i,s){var o=new p(6);return o[0]=t,o[1]=e,o[2]=r,o[3]=n,o[4]=i,o[5]=s,o}function Q(t,e,r,n,i,s,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t}function J(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=r*s-n*i;return h?(h=1/h,t[0]=s*h,t[1]=-n*h,t[2]=-i*h,t[3]=r*h,t[4]=(i*a-s*o)*h,t[5]=(n*o-r*a)*h,t):null}function K(t){return t[0]*t[3]-t[1]*t[2]}function tt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1],l=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*u+s*c,t[1]=i*u+o*c,t[2]=n*l+s*f,t[3]=i*l+o*f,t[4]=n*d+s*p+a,t[5]=i*d+o*p+h,t}function et(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*u,t[1]=i*c+o*u,t[2]=n*-u+s*c,t[3]=i*-u+o*c,t[4]=a,t[5]=h,t}function rt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1];return t[0]=n*u,t[1]=i*u,t[2]=s*c,t[3]=o*c,t[4]=a,t[5]=h,t}function nt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=n*u+s*c+a,t[5]=i*u+o*c+h,t}function it(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function st(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function ot(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function at(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function ht(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function ut(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function ct(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function lt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function ft(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function dt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function pt(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],h=e[0],u=e[1],c=e[2],l=e[3],f=e[4],p=e[5];return Math.abs(r-h)<=d*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(n-u)<=d*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(i-c)<=d*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(s-l)<=d*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(o-f)<=d*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-p)<=d*Math.max(1,Math.abs(a),Math.abs(p))}var mt=tt,gt=ct;function vt(){var t=new p(9);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function bt(t){var e=new p(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function wt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Mt(t,e,r,n,i,s,o,a,h){var u=new p(9);return u[0]=t,u[1]=e,u[2]=r,u[3]=n,u[4]=i,u[5]=s,u[6]=o,u[7]=a,u[8]=h,u}function xt(t,e,r,n,i,s,o,a,h,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t}function _t(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function St(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function Pt(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=c*o-a*u,f=-c*s+a*h,d=u*s-o*h,p=r*l+n*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-c*n+i*u)*p,t[2]=(a*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*h)*p,t[5]=(-a*r+i*s)*p,t[6]=d*p,t[7]=(-u*r+n*h)*p,t[8]=(o*r-n*s)*p,t):null}function At(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8];return t[0]=o*c-a*u,t[1]=i*u-n*c,t[2]=n*a-i*o,t[3]=a*h-s*c,t[4]=r*c-i*h,t[5]=i*s-r*a,t[6]=s*u-o*h,t[7]=n*h-r*u,t[8]=r*o-n*s,t}function Et(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],h=t[7],u=t[8];return e*(u*s-o*h)+r*(-u*i+o*a)+n*(h*i-s*a)}function Ot(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=r[0],d=r[1],p=r[2],m=r[3],g=r[4],v=r[5],y=r[6],b=r[7],w=r[8];return t[0]=f*n+d*o+p*u,t[1]=f*i+d*a+p*c,t[2]=f*s+d*h+p*l,t[3]=m*n+g*o+v*u,t[4]=m*i+g*a+v*c,t[5]=m*s+g*h+v*l,t[6]=y*n+b*o+w*u,t[7]=y*i+b*a+w*c,t[8]=y*s+b*h+w*l,t}function kt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=h,t[6]=f*n+d*o+u,t[7]=f*i+d*a+c,t[8]=f*s+d*h+l,t}function It(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*a,t[2]=d*s+f*h,t[3]=d*o-f*n,t[4]=d*a-f*i,t[5]=d*h-f*s,t[6]=u,t[7]=c,t[8]=l,t}function Ct(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Bt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function Rt(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Tt(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Lt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function Ft(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,h=i+i,u=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*h,m=s*o,g=s*a,v=s*h;return t[0]=1-l-p,t[3]=c-v,t[6]=f+g,t[1]=c+v,t[4]=1-u-p,t[7]=d-m,t[2]=f-g,t[5]=d+m,t[8]=1-u-l,t}function jt(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*h-i*o,w=r*u-s*o,M=n*h-i*a,x=n*u-s*a,_=i*u-s*h,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,E=l*g-f*m,O=l*v-d*m,k=f*v-d*g,I=y*k-b*O+w*E+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-h*O+u*E)*I,t[1]=(h*A-o*k-u*P)*I,t[2]=(o*O-a*A+u*S)*I,t[3]=(i*O-n*k-s*E)*I,t[4]=(r*k-i*A+s*P)*I,t[5]=(n*A-r*O-s*S)*I,t[6]=(m*_-g*x+v*M)*I,t[7]=(g*w-p*_-v*b)*I,t[8]=(p*x-m*w+v*y)*I,t):null}function Dt(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function zt(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function qt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Nt(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function Ut(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function Yt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function Vt(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function Zt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function Gt(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],h=t[6],u=t[7],c=t[8],l=e[0],f=e[1],p=e[2],m=e[3],g=e[4],v=e[5],y=e[6],b=e[7],w=e[8];return Math.abs(r-l)<=d*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(n-f)<=d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-p)<=d*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(s-m)<=d*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(o-g)<=d*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(a-v)<=d*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(h-y)<=d*Math.max(1,Math.abs(h),Math.abs(y))&&Math.abs(u-b)<=d*Math.max(1,Math.abs(u),Math.abs(b))&&Math.abs(c-w)<=d*Math.max(1,Math.abs(c),Math.abs(w))}var Xt=Ot,$t=Ut;function Ht(){var t=new p(16);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Wt(t){var e=new p(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Qt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Jt(t,e,r,n,i,s,o,a,h,u,c,l,f,d,m,g){var v=new p(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=n,v[4]=i,v[5]=s,v[6]=o,v[7]=a,v[8]=h,v[9]=u,v[10]=c,v[11]=l,v[12]=f,v[13]=d,v[14]=m,v[15]=g,v}function Kt(t,e,r,n,i,s,o,a,h,u,c,l,f,d,p,m,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t[9]=c,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=g,t}function te(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ee(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=i,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function re(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*h-i*o,w=r*u-s*o,M=n*h-i*a,x=n*u-s*a,_=i*u-s*h,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,E=l*g-f*m,O=l*v-d*m,k=f*v-d*g,I=y*k-b*O+w*E+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-h*O+u*E)*I,t[1]=(i*O-n*k-s*E)*I,t[2]=(m*_-g*x+v*M)*I,t[3]=(f*x-l*_-d*M)*I,t[4]=(h*A-o*k-u*P)*I,t[5]=(r*k-i*A+s*P)*I,t[6]=(g*w-p*_-v*b)*I,t[7]=(c*_-f*w+d*b)*I,t[8]=(o*O-a*A+u*S)*I,t[9]=(n*A-r*O-s*S)*I,t[10]=(p*x-m*w+v*y)*I,t[11]=(l*w-c*x-d*y)*I,t[12]=(a*P-o*E-h*S)*I,t[13]=(r*E-n*P+i*S)*I,t[14]=(m*b-p*M-g*y)*I,t[15]=(c*M-l*b+f*y)*I,t):null}function ne(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15];return t[0]=a*(f*v-d*g)-l*(h*v-u*g)+m*(h*d-u*f),t[1]=-(n*(f*v-d*g)-l*(i*v-s*g)+m*(i*d-s*f)),t[2]=n*(h*v-u*g)-a*(i*v-s*g)+m*(i*u-s*h),t[3]=-(n*(h*d-u*f)-a*(i*d-s*f)+l*(i*u-s*h)),t[4]=-(o*(f*v-d*g)-c*(h*v-u*g)+p*(h*d-u*f)),t[5]=r*(f*v-d*g)-c*(i*v-s*g)+p*(i*d-s*f),t[6]=-(r*(h*v-u*g)-o*(i*v-s*g)+p*(i*u-s*h)),t[7]=r*(h*d-u*f)-o*(i*d-s*f)+c*(i*u-s*h),t[8]=o*(l*v-d*m)-c*(a*v-u*m)+p*(a*d-u*l),t[9]=-(r*(l*v-d*m)-c*(n*v-s*m)+p*(n*d-s*l)),t[10]=r*(a*v-u*m)-o*(n*v-s*m)+p*(n*u-s*a),t[11]=-(r*(a*d-u*l)-o*(n*d-s*l)+c*(n*u-s*a)),t[12]=-(o*(l*g-f*m)-c*(a*g-h*m)+p*(a*f-h*l)),t[13]=r*(l*g-f*m)-c*(n*g-i*m)+p*(n*f-i*l),t[14]=-(r*(a*g-h*m)-o*(n*g-i*m)+p*(n*h-i*a)),t[15]=r*(a*f-h*l)-o*(n*f-i*l)+c*(n*h-i*a),t}function ie(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],h=t[7],u=t[8],c=t[9],l=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*s)*(l*g-f*m)-(e*a-n*s)*(c*g-f*p)+(e*h-i*s)*(c*m-l*p)+(r*a-n*o)*(u*g-f*d)-(r*h-i*o)*(u*m-l*d)+(n*h-i*a)*(u*p-c*d)}function se(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],v=e[14],y=e[15],b=r[0],w=r[1],M=r[2],x=r[3];return t[0]=b*n+w*a+M*l+x*m,t[1]=b*i+w*h+M*f+x*g,t[2]=b*s+w*u+M*d+x*v,t[3]=b*o+w*c+M*p+x*y,b=r[4],w=r[5],M=r[6],x=r[7],t[4]=b*n+w*a+M*l+x*m,t[5]=b*i+w*h+M*f+x*g,t[6]=b*s+w*u+M*d+x*v,t[7]=b*o+w*c+M*p+x*y,b=r[8],w=r[9],M=r[10],x=r[11],t[8]=b*n+w*a+M*l+x*m,t[9]=b*i+w*h+M*f+x*g,t[10]=b*s+w*u+M*d+x*v,t[11]=b*o+w*c+M*p+x*y,b=r[12],w=r[13],M=r[14],x=r[15],t[12]=b*n+w*a+M*l+x*m,t[13]=b*i+w*h+M*f+x*g,t[14]=b*s+w*u+M*d+x*v,t[15]=b*o+w*c+M*p+x*y,t}function oe(t,e,r){var n,i,s,o,a,h,u,c,l,f,d,p,m=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=h,t[6]=u,t[7]=c,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+a*g+l*v+e[12],t[13]=i*m+h*g+f*v+e[13],t[14]=s*m+u*g+d*v+e[14],t[15]=o*m+c*g+p*v+e[15]),t}function ae(t,e,r){var n=r[0],i=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function he(t,e,r,n){var i,s,o,a,h,u,c,l,f,p,m,g,v,y,b,w,M,x,_,S,P,A,E,O,k=n[0],I=n[1],C=n[2],B=Math.hypot(k,I,C);return B0?(r[0]=2*(a*o+c*n+h*s-u*i)/l,r[1]=2*(h*o+c*i+u*n-a*s)/l,r[2]=2*(u*o+c*s+a*i-h*n)/l):(r[0]=2*(a*o+c*n+h*s-u*i),r[1]=2*(h*o+c*i+u*n-a*s),r[2]=2*(u*o+c*s+a*i-h*n)),ye(t,e,r),t}function we(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Me(t,e){var r=e[0],n=e[1],i=e[2],s=e[4],o=e[5],a=e[6],h=e[8],u=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(s,o,a),t[2]=Math.hypot(h,u,c),t}function xe(t,e){var r=new p(3);Me(r,e);var n=1/r[0],i=1/r[1],s=1/r[2],o=e[0]*n,a=e[1]*i,h=e[2]*s,u=e[4]*n,c=e[5]*i,l=e[6]*s,f=e[8]*n,d=e[9]*i,m=e[10]*s,g=o+c+m,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(l-d)/v,t[1]=(f-h)/v,t[2]=(a-u)/v):o>c&&o>m?(v=2*Math.sqrt(1+o-c-m),t[3]=(l-d)/v,t[0]=.25*v,t[1]=(a+u)/v,t[2]=(f+h)/v):c>m?(v=2*Math.sqrt(1+c-o-m),t[3]=(f-h)/v,t[0]=(a+u)/v,t[1]=.25*v,t[2]=(l+d)/v):(v=2*Math.sqrt(1+m-o-c),t[3]=(a-u)/v,t[0]=(f+h)/v,t[1]=(l+d)/v,t[2]=.25*v),t}function _e(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3],h=i+i,u=s+s,c=o+o,l=i*h,f=i*u,d=i*c,p=s*u,m=s*c,g=o*c,v=a*h,y=a*u,b=a*c,w=n[0],M=n[1],x=n[2];return t[0]=(1-(p+g))*w,t[1]=(f+b)*w,t[2]=(d-y)*w,t[3]=0,t[4]=(f-b)*M,t[5]=(1-(l+g))*M,t[6]=(m+v)*M,t[7]=0,t[8]=(d+y)*x,t[9]=(m-v)*x,t[10]=(1-(l+p))*x,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function Se(t,e,r,n,i){var s=e[0],o=e[1],a=e[2],h=e[3],u=s+s,c=o+o,l=a+a,f=s*u,d=s*c,p=s*l,m=o*c,g=o*l,v=a*l,y=h*u,b=h*c,w=h*l,M=n[0],x=n[1],_=n[2],S=i[0],P=i[1],A=i[2],E=(1-(m+v))*M,O=(d+w)*M,k=(p-b)*M,I=(d-w)*x,C=(1-(f+v))*x,B=(g+y)*x,R=(p+b)*_,T=(g-y)*_,L=(1-(f+m))*_;return t[0]=E,t[1]=O,t[2]=k,t[3]=0,t[4]=I,t[5]=C,t[6]=B,t[7]=0,t[8]=R,t[9]=T,t[10]=L,t[11]=0,t[12]=r[0]+S-(E*S+I*P+R*A),t[13]=r[1]+P-(O*S+C*P+T*A),t[14]=r[2]+A-(k*S+B*P+L*A),t[15]=1,t}function Pe(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,h=i+i,u=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*h,m=s*o,g=s*a,v=s*h;return t[0]=1-l-p,t[1]=c+v,t[2]=f-g,t[3]=0,t[4]=c-v,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-u-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ae(t,e,r,n,i,s,o){var a=1/(r-e),h=1/(i-n),u=1/(s-o);return t[0]=2*s*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*h,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*h,t[10]=(o+s)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*u,t[15]=0,t}function Ee(t,e,r,n,i){var s,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(s=1/(n-i),t[10]=(i+n)*s,t[14]=2*i*n*s):(t[10]=-1,t[14]=-2*n),t}function Oe(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),h=2/(o+a),u=2/(i+s);return t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-a)*h*.5,t[9]=(i-s)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function ke(t,e,r,n,i,s,o){var a=1/(e-r),h=1/(n-i),u=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*h,t[14]=(o+s)*u,t[15]=1,t}function Ie(t,e,r,n){var i,s,o,a,h,u,c,l,f,p,m=e[0],g=e[1],v=e[2],y=n[0],b=n[1],w=n[2],M=r[0],x=r[1],_=r[2];return Math.abs(m-M)0&&(c*=d=1/Math.sqrt(d),l*=d,f*=d);var p=h*f-u*l,m=u*c-a*f,g=a*l-h*c;return(d=p*p+m*m+g*g)>0&&(p*=d=1/Math.sqrt(d),m*=d,g*=d),t[0]=p,t[1]=m,t[2]=g,t[3]=0,t[4]=l*g-f*m,t[5]=f*p-c*g,t[6]=c*m-l*p,t[7]=0,t[8]=c,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=s,t[14]=o,t[15]=1,t}function Be(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Re(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Te(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Le(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function Fe(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function je(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function De(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function ze(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],h=t[6],u=t[7],c=t[8],l=t[9],f=t[10],p=t[11],m=t[12],g=t[13],v=t[14],y=t[15],b=e[0],w=e[1],M=e[2],x=e[3],_=e[4],S=e[5],P=e[6],A=e[7],E=e[8],O=e[9],k=e[10],I=e[11],C=e[12],B=e[13],R=e[14],T=e[15];return Math.abs(r-b)<=d*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-w)<=d*Math.max(1,Math.abs(n),Math.abs(w))&&Math.abs(i-M)<=d*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(s-x)<=d*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(o-_)<=d*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(a-S)<=d*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(h-P)<=d*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(u-A)<=d*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(c-E)<=d*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(l-O)<=d*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(f-k)<=d*Math.max(1,Math.abs(f),Math.abs(k))&&Math.abs(p-I)<=d*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(m-C)<=d*Math.max(1,Math.abs(m),Math.abs(C))&&Math.abs(g-B)<=d*Math.max(1,Math.abs(g),Math.abs(B))&&Math.abs(v-R)<=d*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(y-T)<=d*Math.max(1,Math.abs(y),Math.abs(T))}var qe=se,Ne=Le;function Ue(){var t=new p(3);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ye(t){var e=new p(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Ve(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function Ze(t,e,r){var n=new p(3);return n[0]=t,n[1]=e,n[2]=r,n}function Ge(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Xe(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function $e(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function He(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function We(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function Qe(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function Je(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Ke(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function tr(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function er(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function rr(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function nr(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function ir(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function sr(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function or(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function ar(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function hr(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function ur(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function cr(t,e){var r=e[0],n=e[1],i=e[2],s=r*r+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function lr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function fr(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],h=r[2];return t[0]=i*h-s*a,t[1]=s*o-n*h,t[2]=n*a-i*o,t}function dr(t,e,r,n){var i=e[0],s=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t}function pr(t,e,r,n,i,s){var o=s*s,a=o*(2*s-3)+1,h=o*(s-2)+s,u=o*(s-1),c=o*(3-2*s);return t[0]=e[0]*a+r[0]*h+n[0]*u+i[0]*c,t[1]=e[1]*a+r[1]*h+n[1]*u+i[1]*c,t[2]=e[2]*a+r[2]*h+n[2]*u+i[2]*c,t}function mr(t,e,r,n,i,s){var o=1-s,a=o*o,h=s*s,u=a*o,c=3*s*a,l=3*h*o,f=h*s;return t[0]=e[0]*u+r[0]*c+n[0]*l+i[0]*f,t[1]=e[1]*u+r[1]*c+n[1]*l+i[1]*f,t[2]=e[2]*u+r[2]*c+n[2]*l+i[2]*f,t}function gr(t,e){e=e||1;var r=2*m()*Math.PI,n=2*m()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}function vr(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[3]*n+r[7]*i+r[11]*s+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*s+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*s+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*s+r[14])/o,t}function yr(t,e,r){var n=e[0],i=e[1],s=e[2];return t[0]=n*r[0]+i*r[3]+s*r[6],t[1]=n*r[1]+i*r[4]+s*r[7],t[2]=n*r[2]+i*r[5]+s*r[8],t}function br(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],h=e[1],u=e[2],c=i*u-s*h,l=s*a-n*u,f=n*h-i*a,d=i*f-s*l,p=s*c-n*f,m=n*l-i*c,g=2*o;return c*=g,l*=g,f*=g,d*=2,p*=2,m*=2,t[0]=a+c+d,t[1]=h+l+p,t[2]=u+f+m,t}function wr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0],s[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),s[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function Mr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),s[1]=i[1],s[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function xr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),s[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),s[2]=i[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function _r(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2],h=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(s*s+o*o+a*a),u=h&&lr(t,e)/h;return Math.acos(Math.min(Math.max(u,-1),1))}function Sr(t){return t[0]=0,t[1]=0,t[2]=0,t}function Pr(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function Ar(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Er(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2];return Math.abs(r-s)<=d*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-o)<=d*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=d*Math.max(1,Math.abs(i),Math.abs(a))}var Or,kr=He,Ir=We,Cr=Qe,Br=sr,Rr=or,Tr=Ve,Lr=ar,Fr=(Or=Ue(),function(t,e,r,n,i,s){var o,a;for(e||(e=3),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=s*o,t}function an(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function hn(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],s=r[0]*n[2]-r[2]*n[0],o=r[0]*n[3]-r[3]*n[0],a=r[1]*n[2]-r[2]*n[1],h=r[1]*n[3]-r[3]*n[1],u=r[2]*n[3]-r[3]*n[2],c=e[0],l=e[1],f=e[2],d=e[3];return t[0]=l*u-f*h+d*a,t[1]=-c*u+f*o-d*s,t[2]=c*h-l*o+d*i,t[3]=-c*a+l*s-f*i,t}function un(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t[3]=a+n*(r[3]-a),t}function cn(t,e){var r,n,i,s,o,a;e=e||1;do{o=(r=2*m()-1)*r+(n=2*m()-1)*n}while(o>=1);do{a=(i=2*m()-1)*i+(s=2*m()-1)*s}while(a>=1);var h=Math.sqrt((1-o)/a);return t[0]=e*r,t[1]=e*n,t[2]=e*i*h,t[3]=e*s*h,t}function ln(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*s+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*s+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*s+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*s+r[15]*o,t}function fn(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],h=r[2],u=r[3],c=u*n+a*s-h*i,l=u*i+h*n-o*s,f=u*s+o*i-a*n,d=-o*n-a*i-h*s;return t[0]=c*u+d*-o+l*-h-f*-a,t[1]=l*u+d*-a+f*-o-c*-h,t[2]=f*u+d*-h+c*-a-l*-o,t[3]=e[3],t}function dn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function pn(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function mn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function gn(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=e[0],a=e[1],h=e[2],u=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-h)<=d*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-u)<=d*Math.max(1,Math.abs(s),Math.abs(u))}var vn=Yr,yn=Vr,bn=Zr,wn=Kr,Mn=tn,xn=en,_n=rn,Sn=function(){var t=jr();return function(e,r,n,i,s,o){var a,h;for(r||(r=4),n||(n=0),h=i?Math.min(i*r+n,e.length):e.length,a=n;ad?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r}function kn(t,e){var r=ii(t,e);return Math.acos(2*r*r-1)}function In(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*c+o*a+i*u-s*h,t[1]=i*c+o*h+s*a-n*u,t[2]=s*c+o*u+n*h-i*a,t[3]=o*c-n*a-i*h-s*u,t}function Cn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+o*a,t[1]=i*h+s*a,t[2]=s*h-i*a,t[3]=o*h-n*a,t}function Bn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h-s*a,t[1]=i*h+o*a,t[2]=s*h+n*a,t[3]=o*h-i*a,t}function Rn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+i*a,t[1]=i*h-n*a,t[2]=s*h+o*a,t[3]=o*h-s*a,t}function Tn(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function Ln(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=Math.exp(s),h=o>0?a*Math.sin(o)/o:0;return t[0]=r*h,t[1]=n*h,t[2]=i*h,t[3]=a*Math.cos(o),t}function Fn(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=o>0?Math.atan2(o,s)/o:0;return t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=.5*Math.log(r*r+n*n+i*i+s*s),t}function jn(t,e,r){return Fn(t,e),ni(t,t,r),Ln(t,t),t}function Dn(t,e,r,n){var i,s,o,a,h,u=e[0],c=e[1],l=e[2],f=e[3],p=r[0],m=r[1],g=r[2],v=r[3];return(s=u*p+c*m+l*g+f*v)<0&&(s=-s,p=-p,m=-m,g=-g,v=-v),1-s>d?(i=Math.acos(s),o=Math.sin(i),a=Math.sin((1-n)*i)/o,h=Math.sin(n*i)/o):(a=1-n,h=n),t[0]=a*u+h*p,t[1]=a*c+h*m,t[2]=a*l+h*g,t[3]=a*f+h*v,t}function zn(t){var e=m(),r=m(),n=m(),i=Math.sqrt(1-e),s=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*r),t[1]=i*Math.cos(2*Math.PI*r),t[2]=s*Math.sin(2*Math.PI*n),t[3]=s*Math.cos(2*Math.PI*n),t}function qn(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s,a=o?1/o:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=s*a,t}function Nn(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Un(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var s=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*s+s]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*s+o]-e[3*o+s])*r,t[s]=(e[3*s+i]+e[3*i+s])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t}function Yn(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var s=Math.sin(e),o=Math.cos(e),a=Math.sin(r),h=Math.cos(r),u=Math.sin(n),c=Math.cos(n);return t[0]=s*h*c-o*a*u,t[1]=o*a*c+s*h*u,t[2]=o*h*u-s*a*c,t[3]=o*h*c+s*a*u,t}function Vn(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var Zn,Gn,Xn,$n,Hn,Wn,Qn=Dr,Jn=zr,Kn=qr,ti=Nr,ei=Ur,ri=In,ni=Qr,ii=an,si=un,oi=en,ai=oi,hi=rn,ui=hi,ci=on,li=mn,fi=gn,di=(Zn=Ue(),Gn=Ze(1,0,0),Xn=Ze(0,1,0),function(t,e,r){var n=lr(e,r);return n<-.999999?(fr(Zn,Gn,e),Tr(Zn)<1e-6&&fr(Zn,Xn,e),cr(Zn,Zn),En(t,Zn,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(fr(Zn,e,r),t[0]=Zn[0],t[1]=Zn[1],t[2]=Zn[2],t[3]=1+n,ci(t,t))}),pi=($n=Pn(),Hn=Pn(),function(t,e,r,n,i,s){return Dn($n,e,i,s),Dn(Hn,r,n,s),Dn(t,$n,Hn,2*s*(1-s)),t}),mi=(Wn=vt(),function(t,e,r,n){return Wn[0]=r[0],Wn[3]=r[1],Wn[6]=r[2],Wn[1]=n[0],Wn[4]=n[1],Wn[7]=n[2],Wn[2]=-e[0],Wn[5]=-e[1],Wn[8]=-e[2],ci(t,Un(t,Wn))});function gi(){var t=new p(8);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function vi(t){var e=new p(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function yi(t,e,r,n,i,s,o,a){var h=new p(8);return h[0]=t,h[1]=e,h[2]=r,h[3]=n,h[4]=i,h[5]=s,h[6]=o,h[7]=a,h}function bi(t,e,r,n,i,s,o){var a=new p(8);a[0]=t,a[1]=e,a[2]=r,a[3]=n;var h=.5*i,u=.5*s,c=.5*o;return a[4]=h*n+u*r-c*e,a[5]=u*n+c*t-h*r,a[6]=c*n+h*e-u*t,a[7]=-h*t-u*e-c*r,a}function wi(t,e,r){var n=.5*r[0],i=.5*r[1],s=.5*r[2],o=e[0],a=e[1],h=e[2],u=e[3];return t[0]=o,t[1]=a,t[2]=h,t[3]=u,t[4]=n*u+i*h-s*a,t[5]=i*u+s*o-n*h,t[6]=s*u+n*a-i*o,t[7]=-n*o-i*a-s*h,t}function Mi(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function xi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function _i(t,e){var r=Pn();xe(r,e);var n=new p(3);return we(n,e),wi(t,r,n),t}function Si(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function Pi(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Ai(t,e,r,n,i,s,o,a,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t}var Ei=Kn;function Oi(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var ki=Kn;function Ii(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function Ci(t,e){var r=e[4],n=e[5],i=e[6],s=e[7],o=-e[0],a=-e[1],h=-e[2],u=e[3];return t[0]=2*(r*u+s*o+n*h-i*a),t[1]=2*(n*u+s*a+i*o-r*h),t[2]=2*(i*u+s*h+r*a-n*o),t}function Bi(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=.5*r[0],h=.5*r[1],u=.5*r[2],c=e[4],l=e[5],f=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=o*a+i*u-s*h+c,t[5]=o*h+s*a-n*u+l,t[6]=o*u+n*h-i*a+f,t[7]=-n*a-i*h-s*u+d,t}function Ri(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=a*o+c*n+h*s-u*i,f=h*o+c*i+u*n-a*s,d=u*o+c*s+a*i-h*n,p=c*o-a*n-h*i-u*s;return Cn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Ti(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=a*o+c*n+h*s-u*i,f=h*o+c*i+u*n-a*s,d=u*o+c*s+a*i-h*n,p=c*o-a*n-h*i-u*s;return Bn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Li(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=a*o+c*n+h*s-u*i,f=h*o+c*i+u*n-a*s,d=u*o+c*s+a*i-h*n,p=c*o-a*n-h*i-u*s;return Rn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Fi(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],h=e[1],u=e[2],c=e[3];return t[0]=a*o+c*n+h*s-u*i,t[1]=h*o+c*i+u*n-a*s,t[2]=u*o+c*s+a*i-h*n,t[3]=c*o-a*n-h*i-u*s,a=e[4],h=e[5],u=e[6],c=e[7],t[4]=a*o+c*n+h*s-u*i,t[5]=h*o+c*i+u*n-a*s,t[6]=u*o+c*s+a*i-h*n,t[7]=c*o-a*n-h*i-u*s,t}function ji(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*c+o*a+i*u-s*h,t[1]=i*c+o*h+s*a-n*u,t[2]=s*c+o*u+n*h-i*a,t[3]=o*c-n*a-i*h-s*u,a=r[4],h=r[5],u=r[6],c=r[7],t[4]=n*c+o*a+i*u-s*h,t[5]=i*c+o*h+s*a-n*u,t[6]=s*c+o*u+n*h-i*a,t[7]=o*c-n*a-i*h-s*u,t}function Di(t,e,r,n){if(Math.abs(n)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,s=e[2]/r,o=e[3]/r,a=e[4],h=e[5],u=e[6],c=e[7],l=n*a+i*h+s*u+o*c;t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=(a-n*l)/r,t[5]=(h-i*l)/r,t[6]=(u-s*l)/r,t[7]=(c-o*l)/r}return t}function Ji(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function Ki(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function ts(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],h=t[6],u=t[7],c=e[0],l=e[1],f=e[2],p=e[3],m=e[4],g=e[5],v=e[6],y=e[7];return Math.abs(r-c)<=d*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(n-l)<=d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-f)<=d*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(s-p)<=d*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(o-m)<=d*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(a-g)<=d*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(h-v)<=d*Math.max(1,Math.abs(h),Math.abs(v))&&Math.abs(u-y)<=d*Math.max(1,Math.abs(u),Math.abs(y))}function es(){var t=new p(2);return p!=Float32Array&&(t[0]=0,t[1]=0),t}function rs(t){var e=new p(2);return e[0]=t[0],e[1]=t[1],e}function ns(t,e){var r=new p(2);return r[0]=t,r[1]=e,r}function is(t,e){return t[0]=e[0],t[1]=e[1],t}function ss(t,e,r){return t[0]=e,t[1]=r,t}function os(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function as(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function hs(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function us(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function cs(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function ls(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function fs(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function ds(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function ps(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function ms(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function gs(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function vs(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function ys(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function bs(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function ws(t){var e=t[0],r=t[1];return e*e+r*r}function Ms(t,e){return t[0]=-e[0],t[1]=-e[1],t}function xs(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function _s(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function Ss(t,e){return t[0]*e[0]+t[1]*e[1]}function Ps(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function As(t,e,r,n){var i=e[0],s=e[1];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t}function Es(t,e){e=e||1;var r=2*m()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function Os(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function ks(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function Is(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function Cs(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function Bs(t,e,r,n){var i=e[0]-r[0],s=e[1]-r[1],o=Math.sin(n),a=Math.cos(n);return t[0]=i*a-s*o+r[0],t[1]=i*o+s*a+r[1],t}function Rs(t,e){var r=t[0],n=t[1],i=e[0],s=e[1],o=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+s*s),a=o&&(r*i+n*s)/o;return Math.acos(Math.min(Math.max(a,-1),1))}function Ts(t){return t[0]=0,t[1]=0,t}function Ls(t){return"vec2("+t[0]+", "+t[1]+")"}function Fs(t,e){return t[0]===e[0]&&t[1]===e[1]}function js(t,e){var r=t[0],n=t[1],i=e[0],s=e[1];return Math.abs(r-i)<=d*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))}var Ds=bs,zs=as,qs=hs,Ns=us,Us=vs,Ys=ys,Vs=ws,Zs=function(){var t=es();return function(e,r,n,i,s,o){var a,h;for(r||(r=2),n||(n=0),h=i?Math.min(i*r+n,e.length):e.length,a=n;a{t.exports=function t(e,r,n){function i(o,a){if(!r[o]){if(!e[o]){if(s)return s(o,!0);var h=new Error("Cannot find module '"+o+"'");throw h.code="MODULE_NOT_FOUND",h}var u=r[o]={exports:{}};e[o][0].call(u.exports,(function(t){return i(e[o][1][t]||t)}),u,u.exports,t,e,r,n)}return r[o].exports}for(var s=void 0,o=0;o>2,a=(3&e)<<4|r>>4,h=1>6:64,u=2>4,r=(15&o)<<4|(a=s.indexOf(t.charAt(u++)))>>2,n=(3&a)<<6|(h=s.indexOf(t.charAt(u++))),l[c++]=e,64!==a&&(l[c++]=r),64!==h&&(l[c++]=n);return l}},{"./support":30,"./utils":32}],2:[function(t,e,r){var n=t("./external"),i=t("./stream/DataWorker"),s=t("./stream/Crc32Probe"),o=t("./stream/DataLengthProbe");function a(t,e,r,n,i){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=n,this.compressedContent=i}a.prototype={getContentWorker:function(){var t=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(t,e,r){return t.pipe(new s).pipe(new o("uncompressedSize")).pipe(e.compressWorker(r)).pipe(new o("compressedSize")).withStreamInfo("compression",e)},e.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,r){var n=t("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(t){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,r){var n=t("./utils"),i=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==n.getTypeOf(t)?function(t,e,r){var n=i,s=0+r;t^=-1;for(var o=0;o>>8^n[255&(t^e[o])];return-1^t}(0|e,t,t.length):function(t,e,r){var n=i,s=0+r;t^=-1;for(var o=0;o>>8^n[255&(t^e.charCodeAt(o))];return-1^t}(0|e,t,t.length):0}},{"./utils":32}],5:[function(t,e,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(t,e,r){var n;n="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:n}},{lie:37}],7:[function(t,e,r){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=t("pako"),s=t("./utils"),o=t("./stream/GenericWorker"),a=n?"uint8array":"array";function h(t,e){o.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic="\b\0",s.inherits(h,o),h.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,t.data),!1)},h.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(t){return new h("Deflate",t)},r.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,r){function n(t,e){var r,n="";for(r=0;r>>=8;return n}function i(t,e,r,i,o,c){var l,f,d=t.file,p=t.compression,m=c!==a.utf8encode,g=s.transformTo("string",c(d.name)),v=s.transformTo("string",a.utf8encode(d.name)),y=d.comment,b=s.transformTo("string",c(y)),w=s.transformTo("string",a.utf8encode(y)),M=v.length!==d.name.length,x=w.length!==y.length,_="",S="",P="",A=d.dir,E=d.date,O={crc32:0,compressedSize:0,uncompressedSize:0};e&&!r||(O.crc32=t.crc32,O.compressedSize=t.compressedSize,O.uncompressedSize=t.uncompressedSize);var k=0;e&&(k|=8),m||!M&&!x||(k|=2048);var I,C=0,B=0;A&&(C|=16),"UNIX"===o?(B=798,C|=((I=d.unixPermissions)||(I=A?16893:33204),(65535&I)<<16)):(B=20,C|=63&(d.dosPermissions||0)),l=E.getUTCHours(),l<<=6,l|=E.getUTCMinutes(),l<<=5,l|=E.getUTCSeconds()/2,f=E.getUTCFullYear()-1980,f<<=4,f|=E.getUTCMonth()+1,f<<=5,f|=E.getUTCDate(),M&&(_+="up"+n((S=n(1,1)+n(h(g),4)+v).length,2)+S),x&&(_+="uc"+n((P=n(1,1)+n(h(b),4)+w).length,2)+P);var R="";return R+="\n\0",R+=n(k,2),R+=p.magic,R+=n(l,2),R+=n(f,2),R+=n(O.crc32,4),R+=n(O.compressedSize,4),R+=n(O.uncompressedSize,4),R+=n(g.length,2),R+=n(_.length,2),{fileRecord:u.LOCAL_FILE_HEADER+R+g+_,dirRecord:u.CENTRAL_FILE_HEADER+n(B,2)+R+n(b.length,2)+"\0\0\0\0"+n(C,4)+n(i,4)+g+_+b}}var s=t("../utils"),o=t("../stream/GenericWorker"),a=t("../utf8"),h=t("../crc32"),u=t("../signature");function c(t,e,r,n){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(c,o),c.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,o.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-n-1))/r:100}}))},c.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var r=i(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},c.prototype.closedSource=function(t){this.accumulate=!1;var e,r=this.streamFiles&&!t.file.dir,s=i(t,r,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(s.dirRecord),r)this.push({data:(e=t,u.DATA_DESCRIPTOR+n(e.crc32,4)+n(e.compressedSize,4)+n(e.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:s.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},c.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e=this.index;e--)r=(r<<8)+this.byteAt(e);return this.index+=t,r},readString:function(t){return n.transformTo("string",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readAndCheckSignature:function(t){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=i},{"../utils":32}],19:[function(t,e,r){var n=t("./Uint8ArrayReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,r){var n=t("./DataReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},i.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},i.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./DataReader":18}],21:[function(t,e,r){var n=t("./ArrayReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,r){var n=t("../utils"),i=t("../support"),s=t("./ArrayReader"),o=t("./StringReader"),a=t("./NodeBufferReader"),h=t("./Uint8ArrayReader");e.exports=function(t){var e=n.getTypeOf(t);return n.checkSupport(e),"string"!==e||i.uint8array?"nodebuffer"===e?new a(t):i.uint8array?new h(n.transformTo("uint8array",t)):new s(n.transformTo("array",t)):new o(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,r){r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,r){var n=t("./GenericWorker"),i=t("../utils");function s(t){n.call(this,"ConvertWorker to "+t),this.destType=t}i.inherits(s,n),s.prototype.processChunk=function(t){this.push({data:i.transformTo(this.destType,t.data),meta:t.meta})},e.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,r){var n=t("./GenericWorker"),i=t("../crc32");function s(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(s,n),s.prototype.processChunk=function(t){this.streamInfo.crc32=i(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,r){var n=t("../utils"),i=t("./GenericWorker");function s(t){i.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}n.inherits(s,i),s.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}i.prototype.processChunk.call(this,t)},e.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,r){var n=t("../utils"),i=t("./GenericWorker");function s(t){i.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=n.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}n.inherits(s,i),s.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,r){function n(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var r=0;r "+t:t}},e.exports=n},{}],29:[function(t,e,r){var n=t("../utils"),i=t("./ConvertWorker"),s=t("./GenericWorker"),o=t("../base64"),a=t("../support"),h=t("../external"),u=null;if(a.nodestream)try{u=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function c(t,e,r){var o=e;switch(e){case"blob":case"arraybuffer":o="uint8array";break;case"base64":o="string"}try{this._internalType=o,this._outputType=e,this._mimeType=r,n.checkSupport(o),this._worker=t.pipe(new i(o)),t.lock()}catch(t){this._worker=new s("error"),this._worker.error(t)}}c.prototype={accumulate:function(t){return e=this,r=t,new h.Promise((function(t,i){var s=[],a=e._internalType,h=e._outputType,u=e._mimeType;e.on("data",(function(t,e){s.push(t),r&&r(e)})).on("error",(function(t){s=[],i(t)})).on("end",(function(){try{var e=function(t,e,r){switch(t){case"blob":return n.newBlob(n.transformTo("arraybuffer",e),r);case"base64":return o.encode(e);default:return n.transformTo(t,e)}}(h,function(t,e){var r,n=0,i=null,s=0;for(r=0;r>>6:(r<65536?e[o++]=224|r>>>12:(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63),e[o++]=128|r>>>6&63),e[o++]=128|63&r);return e}(t)},r.utf8decode=function(t){return i.nodebuffer?n.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,r,i,s,o=t.length,h=new Array(2*o);for(e=r=0;e>10&1023,h[r++]=56320|1023&i)}return h.length!==r&&(h.subarray?h=h.subarray(0,r):h.length=r),n.applyFromCharCode(h)}(t=n.transformTo(i.uint8array?"uint8array":"array",t))},n.inherits(u,o),u.prototype.processChunk=function(t){var e=n.transformTo(i.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var s=e;(e=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),e.set(s,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var o=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+a[t[r]]>e?r:e}(e),h=e;o!==e.length&&(i.uint8array?(h=e.subarray(0,o),this.leftOver=e.subarray(o,e.length)):(h=e.slice(0,o),this.leftOver=e.slice(o,e.length))),this.push({data:r.utf8decode(h),meta:t.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=u,n.inherits(c,o),c.prototype.processChunk=function(t){this.push({data:r.utf8encode(t.data),meta:t.meta})},r.Utf8EncodeWorker=c},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,r){var n=t("./support"),i=t("./base64"),s=t("./nodejsUtils"),o=t("set-immediate-shim"),a=t("./external");function h(t){return t}function u(t,e){for(var r=0;r>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(t){if(this.extraFields[1]){var e=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e,r,n,i=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4>>6:(r<65536?e[o++]=224|r>>>12:(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63),e[o++]=128|r>>>6&63),e[o++]=128|63&r);return e},r.buf2binstring=function(t){return h(t,t.length)},r.binstring2buf=function(t){for(var e=new n.Buf8(t.length),r=0,i=e.length;r>10&1023,u[n++]=56320|1023&i)}return h(u,n)},r.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+o[t[r]]>e?r:e}},{"./common":41}],43:[function(t,e,r){e.exports=function(t,e,r,n){for(var i=65535&t|0,s=t>>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e,r,i){var s=n,o=i+r;t^=-1;for(var a=i;a>>8^s[255&(t^e[a])];return-1^t}},{}],46:[function(t,e,r){var n,i=t("../utils/common"),s=t("./trees"),o=t("./adler32"),a=t("./crc32"),h=t("./messages"),u=-2,c=258,l=262,f=113;function d(t,e){return t.msg=h[e],e}function p(t){return(t<<1)-(4t.avail_out&&(r=t.avail_out),0!==r&&(i.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function v(t,e){s._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,g(t.strm)}function y(t,e){t.pending_buf[t.pending++]=e}function b(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function w(t,e){var r,n,i=t.max_chain_length,s=t.strstart,o=t.prev_length,a=t.nice_match,h=t.strstart>t.w_size-l?t.strstart-(t.w_size-l):0,u=t.window,f=t.w_mask,d=t.prev,p=t.strstart+c,m=u[s+o-1],g=u[s+o];t.prev_length>=t.good_match&&(i>>=2),a>t.lookahead&&(a=t.lookahead);do{if(u[(r=e)+o]===g&&u[r+o-1]===m&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do{}while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&sh&&0!=--i);return o<=t.lookahead?o:t.lookahead}function M(t){var e,r,n,s,h,u,c,f,d,p,m=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=m+(m-l)){for(i.arraySet(t.window,t.window,m,m,0),t.match_start-=m,t.strstart-=m,t.block_start-=m,e=r=t.hash_size;n=t.head[--e],t.head[e]=m<=n?n-m:0,--r;);for(e=r=m;n=t.prev[--e],t.prev[e]=m<=n?n-m:0,--r;);s+=m}if(0===t.strm.avail_in)break;if(u=t.strm,c=t.window,f=t.strstart+t.lookahead,p=void 0,(d=s)<(p=u.avail_in)&&(p=d),r=0===p?0:(u.avail_in-=p,i.arraySet(c,u.input,u.next_in,p,f),1===u.state.wrap?u.adler=o(u.adler,c,p,f):2===u.state.wrap&&(u.adler=a(u.adler,c,p,f)),u.next_in+=p,u.total_in+=p,p),t.lookahead+=r,t.lookahead+t.insert>=3)for(h=t.strstart-t.insert,t.ins_h=t.window[h],t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3)if(n=s._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3&&t.match_length<=t.prev_length){for(i=t.strstart+t.lookahead-3,n=s._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=i&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(M(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,v(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-l&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(v(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(v(t,!1),t.strm.avail_out),1)})),new S(4,4,8,4,x),new S(4,5,16,8,x),new S(4,6,32,32,x),new S(4,4,16,16,_),new S(8,16,32,32,_),new S(8,16,128,128,_),new S(8,32,128,256,_),new S(32,128,258,1024,_),new S(32,258,258,4096,_)],r.deflateInit=function(t,e){return O(t,e,8,15,8,0)},r.deflateInit2=O,r.deflateReset=E,r.deflateResetKeep=A,r.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?u:(t.state.gzhead=e,0):u},r.deflate=function(t,e){var r,i,o,h;if(!t||!t.state||5>8&255),y(i,i.gzhead.time>>16&255),y(i,i.gzhead.time>>24&255),y(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),y(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(y(i,255&i.gzhead.extra.length),y(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=a(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(y(i,0),y(i,0),y(i,0),y(i,0),y(i,0),y(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),y(i,3),i.status=f);else{var l=8+(i.w_bits-8<<4)<<8;l|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(l|=32),l+=31-l%31,i.status=f,b(i,l),0!==i.strstart&&(b(i,t.adler>>>16),b(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),g(t),o=i.pending,i.pending!==i.pending_buf_size));)y(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),g(t),o=i.pending,i.pending===i.pending_buf_size)){h=1;break}h=i.gzindexo&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),0===h&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),g(t),o=i.pending,i.pending===i.pending_buf_size)){h=1;break}h=i.gzindexo&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),0===h&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&g(t),i.pending+2<=i.pending_buf_size&&(y(i,255&t.adler),y(i,t.adler>>8&255),t.adler=0,i.status=f)):i.status=f),0!==i.pending){if(g(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&p(e)<=p(r)&&4!==e)return d(t,-5);if(666===i.status&&0!==t.avail_in)return d(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&666!==i.status){var w=2===i.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(M(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(v(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(v(t,!1),0===t.strm.avail_out)?1:2}(i,e):3===i.strategy?function(t,e){for(var r,n,i,o,a=t.window;;){if(t.lookahead<=c){if(M(t),t.lookahead<=c&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&0t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=s._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(v(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(v(t,!1),0===t.strm.avail_out)?1:2}(i,e):n[i.level].func(i,e);if(3!==w&&4!==w||(i.status=666),1===w||3===w)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===w&&(1===e?s._tr_align(i):5!==e&&(s._tr_stored_block(i,0,0,!1),3===e&&(m(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),g(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(y(i,255&t.adler),y(i,t.adler>>8&255),y(i,t.adler>>16&255),y(i,t.adler>>24&255),y(i,255&t.total_in),y(i,t.total_in>>8&255),y(i,t.total_in>>16&255),y(i,t.total_in>>24&255)):(b(i,t.adler>>>16),b(i,65535&t.adler)),g(t),0=r.w_size&&(0===a&&(m(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new i.Buf8(r.w_size),i.arraySet(f,e,d-r.w_size,r.w_size,0),e=f,d=r.w_size),h=t.avail_in,c=t.next_in,l=t.input,t.avail_in=d,t.next_in=0,t.input=e,M(r);r.lookahead>=3;){for(n=r.strstart,s=r.lookahead-2;r.ins_h=(r.ins_h<>>=w=b>>>24,p-=w,0==(w=b>>>16&255))A[s++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=m[(65535&b)+(d&(1<>>=w,p-=w),p<15&&(d+=P[n++]<>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=g[(65535&b)+(d&(1<>>=w,p-=w,(w=s-o)>3,d&=(1<<(p-=M<<3))-1,t.next_in=n,t.next_out=s,t.avail_in=n>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function l(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(852),e.distcode=e.distdyn=new n.Buf32(592),e.sane=1,e.back=-1,0):h}function f(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,l(t)):h}function d(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15=o.wsize?(n.arraySet(o.window,e,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i<(s=o.wsize-o.wnext)&&(s=i),n.arraySet(o.window,e,r-i,s,o.wnext),(i-=s)?(n.arraySet(o.window,e,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=s(r.check,F,2,0),v=g=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&g)<<8)+(g>>8))%31){t.msg="incorrect header check",r.mode=30;break}if(8!=(15&g)){t.msg="unknown compression method",r.mode=30;break}if(v-=4,C=8+(15&(g>>>=4)),0===r.wbits)r.wbits=C;else if(C>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,r.check=s(r.check,F,2,0)),v=g=0,r.mode=3;case 3:for(;v<32;){if(0===p)break t;p--,g+=c[f++]<>>8&255,F[2]=g>>>16&255,F[3]=g>>>24&255,r.check=s(r.check,F,4,0)),v=g=0,r.mode=4;case 4:for(;v<16;){if(0===p)break t;p--,g+=c[f++]<>8),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,r.check=s(r.check,F,2,0)),v=g=0,r.mode=5;case 5:if(1024&r.flags){for(;v<16;){if(0===p)break t;p--,g+=c[f++]<>>8&255,r.check=s(r.check,F,2,0)),v=g=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(p<(x=r.length)&&(x=p),x&&(r.head&&(C=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,c,f,x,C)),512&r.flags&&(r.check=s(r.check,c,x,f)),p-=x,f+=x,r.length-=x),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===p)break t;for(x=0;C=c[f+x++],r.head&&C&&r.length<65536&&(r.head.name+=String.fromCharCode(C)),C&&x>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;v<32;){if(0===p)break t;p--,g+=c[f++]<>>=7&v,v-=7&v,r.mode=27;break}for(;v<3;){if(0===p)break t;p--,g+=c[f++]<>>=1)){case 0:r.mode=14;break;case 1:if(y(r),r.mode=20,6!==e)break;g>>>=2,v-=2;break t;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}g>>>=2,v-=2;break;case 14:for(g>>>=7&v,v-=7&v;v<32;){if(0===p)break t;p--,g+=c[f++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&g,v=g=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(x=r.length){if(p>>=5,v-=5,r.ndist=1+(31&g),g>>>=5,v-=5,r.ncode=4+(15&g),g>>>=4,v-=4,286>>=3,v-=3}for(;r.have<19;)r.lens[j[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,R={bits:r.lenbits},B=a(0,r.lens,0,19,r.lencode,0,r.work,R),r.lenbits=R.bits,B){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,E=65535&L,!((P=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<>>=P,v-=P,r.lens[r.have++]=E;else{if(16===E){for(T=P+2;v>>=P,v-=P,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}C=r.lens[r.have-1],x=3+(3&g),g>>>=2,v-=2}else if(17===E){for(T=P+3;v>>=P)),g>>>=3,v-=3}else{for(T=P+7;v>>=P)),g>>>=7,v-=7}if(r.have+x>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;x--;)r.lens[r.have++]=C}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,R={bits:r.lenbits},B=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,R),r.lenbits=R.bits,B){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,R={bits:r.distbits},B=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,R),r.distbits=R.bits,B){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(6<=p&&258<=m){t.next_out=d,t.avail_out=m,t.next_in=f,t.avail_in=p,r.hold=g,r.bits=v,o(t,M),d=t.next_out,l=t.output,m=t.avail_out,f=t.next_in,c=t.input,p=t.avail_in,g=r.hold,v=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;A=(L=r.lencode[g&(1<>>16&255,E=65535&L,!((P=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<>O)])>>>16&255,E=65535&L,!(O+(P=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<>>=O,v-=O,r.back+=O}if(g>>>=P,v-=P,r.back+=P,r.length=E,0===A){r.mode=26;break}if(32&A){r.back=-1,r.mode=12;break}if(64&A){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&A,r.mode=22;case 22:if(r.extra){for(T=r.extra;v>>=r.extra,v-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;A=(L=r.distcode[g&(1<>>16&255,E=65535&L,!((P=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<>O)])>>>16&255,E=65535&L,!(O+(P=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<>>=O,v-=O,r.back+=O}if(g>>>=P,v-=P,r.back+=P,64&A){t.msg="invalid distance code",r.mode=30;break}r.offset=E,r.extra=15&A,r.mode=24;case 24:if(r.extra){for(T=r.extra;v>>=r.extra,v-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===m)break t;if(x=M-m,r.offset>x){if((x=r.offset-x)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}_=x>r.wnext?(x-=r.wnext,r.wsize-x):r.wnext-x,x>r.length&&(x=r.length),S=r.window}else S=l,_=d-r.offset,x=r.length;for(my?(w=j[D+l[S]],R[T+l[S]]):(w=96,0),d=1<<_-k,P=p=1<>k)+(p-=d)]=b<<24|w<<16|M|0,0!==p;);for(d=1<<_-1;B&d;)d>>=1;if(0!==d?(B&=d-1,B+=d):B=0,S++,0==--L[_]){if(_===A)break;_=e[r+l[S]]}if(E<_&&(B&g)!==m){for(0===k&&(k=E),v+=P,I=1<<(O=_-k);O+k>>7)]}function x(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function _(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<>>=1,r<<=1,0<--e;);return r>>>1}function A(t,e,r){var n,i,o=new Array(16),a=0;for(n=1;n<=s;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=e;i++){var h=t[2*i+1];0!==h&&(t[2*i]=P(o[h]++,h))}}function E(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function O(t){8>1;1<=r;r--)I(t,o,r);for(i=u;r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],I(t,o,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,o[2*i]=o[2*r]+o[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,o[2*r+1]=o[2*n+1]=i,t.heap[1]=i++,I(t,o,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,o,a,h,u=e.dyn_tree,c=e.max_code,l=e.stat_desc.static_tree,f=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,m=e.stat_desc.max_length,g=0;for(o=0;o<=s;o++)t.bl_count[o]=0;for(u[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)m<(o=u[2*u[2*(n=t.heap[r])+1]+1]+1)&&(o=m,g++),u[2*n+1]=o,c>=7;n<30;n++)for(y[n]=i<<7,t=0;t<1<>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),B(t,t.l_desc),B(t,t.d_desc),o=function(t){var e;for(R(t,t.dyn_ltree,t.l_desc.max_code),R(t,t.dyn_dtree,t.d_desc.max_code),B(t,t.bl_desc),e=18;3<=e&&0===t.bl_tree[2*u[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==e?F(t,e,r,n):4===t.strategy||s===i?(_(t,2+(n?1:0),3),C(t,c,l)):(_(t,4+(n?1:0),3),function(t,e,r,n){var i;for(_(t,e-257,5),_(t,r-1,5),_(t,n-4,4),i=0;i>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(d[r]+256+1)]++,t.dyn_dtree[2*M(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){var e;_(t,2,3),S(t,256,c),16===(e=t).bi_valid?(x(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},{"../utils/common":41}],53:[function(t,e,r){e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,r){e.exports="function"==typeof setImmediate?setImmediate:function(){var t=[].slice.apply(arguments);t.splice(1,0,0),setTimeout.apply(null,t)}},{}]},{},[10])(10)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)},5666:t=>{var e=function(t){var e,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,s=Object.create(i.prototype),o=new O(n||[]);return s._invoke=function(t,e,r){var n=l;return function(i,s){if(n===d)throw new Error("Generator is already running");if(n===p){if("throw"===i)throw s;return I()}for(r.method=i,r.arg=s;;){var o=r.delegate;if(o){var a=P(o,r);if(a){if(a===m)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var h=c(t,e,r);if("normal"===h.type){if(n=r.done?p:f,h.arg===m)continue;return{value:h.arg,done:r.done}}"throw"===h.type&&(n=p,r.method="throw",r.arg=h.arg)}}}(t,r,o),s}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l="suspendedStart",f="suspendedYield",d="executing",p="completed",m={};function g(){}function v(){}function y(){}var b={};h(b,s,(function(){return this}));var w=Object.getPrototypeOf,M=w&&w(w(k([])));M&&M!==r&&n.call(M,s)&&(b=M);var x=y.prototype=g.prototype=Object.create(b);function _(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(i,s,o,a){var h=c(t[i],t,s);if("throw"!==h.type){var u=h.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,o,a)}),(function(t){r("throw",t,o,a)})):e.resolve(l).then((function(t){u.value=t,o(u)}),(function(t){return r("throw",t,o,a)}))}a(h.arg)}var i;this._invoke=function(t,n){function s(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(s,s):s()}}function P(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method))return m;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var i=c(n,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var s=i.arg;return s?s.done?(r[t.resultName]=s.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function k(t){if(t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i=0;--s){var o=this.tryEntries[s],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var h=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(h&&u){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:k(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},5072:function(t,e,r){var n,i;void 0===(i="function"==typeof(n=function(){return function(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var e=document.createElement("base");if(e.href=arguments[0],1===t)return e.href;var r=document.getElementsByTagName("head")[0];r.insertBefore(e,r.firstChild);for(var n,i=document.createElement("a"),s=1;s{var n;!function(){var i=.5*(Math.sqrt(3)-1),s=(3-Math.sqrt(3))/6,o=1/6,a=(Math.sqrt(5)-1)/4,h=(5-Math.sqrt(5))/20;function u(t){var e;e="function"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=l();t=i(" "),e=i(" "),r=i(" ");for(var s=0;s>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}u.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,o=this.permMod12,a=this.perm,h=this.grad3,u=0,c=0,l=0,f=(t+e)*i,d=Math.floor(t+f),p=Math.floor(e+f),m=(d+p)*s,g=t-(d-m),v=e-(p-m);g>v?(r=1,n=0):(r=0,n=1);var y=g-r+s,b=v-n+s,w=g-1+2*s,M=v-1+2*s,x=255&d,_=255&p,S=.5-g*g-v*v;if(S>=0){var P=3*o[x+a[_]];u=(S*=S)*S*(h[P]*g+h[P+1]*v)}var A=.5-y*y-b*b;if(A>=0){var E=3*o[x+r+a[_+n]];c=(A*=A)*A*(h[E]*y+h[E+1]*b)}var O=.5-w*w-M*M;if(O>=0){var k=3*o[x+1+a[_+1]];l=(O*=O)*O*(h[k]*w+h[k+1]*M)}return 70*(u+c+l)},noise3D:function(t,e,r){var n,i,s,a,h,u,c,l,f,d,p=this.permMod12,m=this.perm,g=this.grad3,v=.3333333333333333*(t+e+r),y=Math.floor(t+v),b=Math.floor(e+v),w=Math.floor(r+v),M=(y+b+w)*o,x=t-(y-M),_=e-(b-M),S=r-(w-M);x>=_?_>=S?(h=1,u=0,c=0,l=1,f=1,d=0):x>=S?(h=1,u=0,c=0,l=1,f=0,d=1):(h=0,u=0,c=1,l=1,f=0,d=1):_B?L++:F++,C>R?L++:j++,C>T?L++:D++,B>R?F++:j++,B>T?F++:D++,R>T?j++:D++;var z=C-(l=L>=3?1:0)+h,q=B-(f=F>=3?1:0)+h,N=R-(d=j>=3?1:0)+h,U=T-(p=D>=3?1:0)+h,Y=C-(m=L>=2?1:0)+2*h,V=B-(g=F>=2?1:0)+2*h,Z=R-(v=j>=2?1:0)+2*h,G=T-(y=D>=2?1:0)+2*h,X=C-(b=L>=1?1:0)+3*h,$=B-(w=F>=1?1:0)+3*h,H=R-(M=j>=1?1:0)+3*h,W=T-(x=D>=1?1:0)+3*h,Q=C-1+4*h,J=B-1+4*h,K=R-1+4*h,tt=T-1+4*h,et=255&A,rt=255&E,nt=255&O,it=255&k,st=.6-C*C-B*B-R*R-T*T;if(st<0)i=0;else{var ot=_[et+_[rt+_[nt+_[it]]]]%32*4;i=(st*=st)*st*(S[ot]*C+S[ot+1]*B+S[ot+2]*R+S[ot+3]*T)}var at=.6-z*z-q*q-N*N-U*U;if(at<0)s=0;else{var ht=_[et+l+_[rt+f+_[nt+d+_[it+p]]]]%32*4;s=(at*=at)*at*(S[ht]*z+S[ht+1]*q+S[ht+2]*N+S[ht+3]*U)}var ut=.6-Y*Y-V*V-Z*Z-G*G;if(ut<0)o=0;else{var ct=_[et+m+_[rt+g+_[nt+v+_[it+y]]]]%32*4;o=(ut*=ut)*ut*(S[ct]*Y+S[ct+1]*V+S[ct+2]*Z+S[ct+3]*G)}var lt=.6-X*X-$*$-H*H-W*W;if(lt<0)u=0;else{var ft=_[et+b+_[rt+w+_[nt+M+_[it+x]]]]%32*4;u=(lt*=lt)*lt*(S[ft]*X+S[ft+1]*$+S[ft+2]*H+S[ft+3]*W)}var dt=.6-Q*Q-J*J-K*K-tt*tt;if(dt<0)c=0;else{var pt=_[et+1+_[rt+1+_[nt+1+_[it+1]]]]%32*4;c=(dt*=dt)*dt*(S[pt]*Q+S[pt+1]*J+S[pt+2]*K+S[pt+3]*tt)}return 27*(i+s+o+u+c)}},u._buildPermutationTable=c,void 0===(n=function(){return u}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=u,t.exports=u}()},6479:(t,e,r)=>{var n;!function(){function i(t,e,r){var n=e.x,i=e.y,s=r.x-n,o=r.y-i;if(0!==s||0!==o){var a=((t.x-n)*s+(t.y-i)*o)/(s*s+o*o);a>1?(n=r.x,i=r.y):a>0&&(n+=s*a,i+=o*a)}return(s=t.x-n)*s+(o=t.y-i)*o}function s(t,e,r,n,o){for(var a,h=n,u=e+1;uh&&(a=u,h=c)}h>n&&(a-e>1&&s(t,e,a,n,o),o.push(t[a]),r-a>1&&s(t,a,r,n,o))}function o(t,e){var r=t.length-1,n=[t[0]];return s(t,0,r,e,n),n.push(t[r]),n}function a(t,e,r){if(t.length<=2)return t;var n=void 0!==e?e*e:1;return o(t=r?t:function(t,e){for(var r,n,i,s,o,a=t[0],h=[a],u=1,c=t.length;ue&&(h.push(r),a=r);return a!==r&&h.push(r),h}(t,n),n)}void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{r.d(n,{fw:()=>E,Cd:()=>g.C,Il:()=>k,YG:()=>O.BrowserDrawerCanvas,Z3:()=>C.GCODEExporter,ZA:()=>i.Group,x1:()=>f.x,O7:()=>w.O,Dg:()=>x.Modifier,qn:()=>_.q,Q_:()=>A.PHI,yo:()=>A.PI2,mg:()=>m.m,UL:()=>p.U,Th:()=>I.Renderer,he:()=>y.h,YY:()=>B.SVGExporter,Pm:()=>R.SVGImporter,xs:()=>t.Scene,YM:()=>e.SceneChild,bn:()=>u.Shape,pK:()=>s.ShapeBase,rR:()=>h.ShapeBuffer,Sj:()=>l.S,Xc:()=>a.ShapeLoop,Gx:()=>o.ShapePrimitive,vI:()=>c.v,rU:()=>b.r,Ux:()=>v.U,yq:()=>M.y,TY:()=>I.Timeline,CJ:()=>d.C,Sg:()=>P.default,X$:()=>t.__esModule,B7:()=>S.angle2FromRepetition,aT:()=>S.angleFromRepetition,uZ:()=>S.clamp,db:()=>S.distanceFromRepetition,NZ:()=>S.distributePointsInBuffer,sX:()=>S.interpolate,t7:()=>S.lerp,cM:()=>A.log,wQ:()=>A.mod,tF:()=>S.noise,zO:()=>S.now,tm:()=>S.prepareBufferForInterpolation,MX:()=>S.random,Sr:()=>S.relativeClamp,yx:()=>S.toDegrees,Yr:()=>S.toRadians});var t=r(1378),e=r(541),i=r(2513),s=r(2648),o=r(3674),a=r(6951),h=r(7439),u=r(6448),c=r(8563),l=r(5382),f=r(6329),d=r(4233),p=r(5510),m=r(2982),g=r(7520),v=r(9667),y=r(894),b=r(5719),w=r(1451),M=r(3977),x=r(9958),_=r(9514),S=r(313),P=r(795),A=r(3792),E=r(7518),O=r(2251),k=r(7358),I=r(1532),C=r(884),B=r(7773),R=r(5052)})();var i=n.fw,s=n.Cd,o=n.Il,a=n.YG,h=n.Z3,u=n.ZA,c=n.x1,l=n.O7,f=n.Dg,d=n.qn,p=n.Q_,m=n.yo,g=n.mg,v=n.UL,y=n.Th,b=n.he,w=n.YY,M=n.Pm,x=n.xs,_=n.YM,S=n.bn,P=n.pK,A=n.rR,E=n.Sj,O=n.Xc,k=n.Gx,I=n.vI,C=n.rU,B=n.Ux,R=n.yq,T=n.TY,L=n.CJ,F=n.Sg,j=n.X$,D=n.B7,z=n.aT,q=n.uZ,N=n.db,U=n.NZ,Y=n.sX,V=n.t7,Z=n.cM,G=n.wQ,X=n.tF,$=n.zO,H=n.tm,W=n.MX,Q=n.Sr,J=n.yx,K=n.Yr;export{i as Animation,s as Circle,o as Color,a as DrawerCanvas,h as GCODEExporter,u as Group,c as Line,l as Lissajous,f as Modifier,d as Modifiers,p as PHI,m as PI2,g as Polygon,v as Rect,y as Renderer,b as Rose,w as SVGExporter,M as SVGImporter,x as Scene,_ as SceneChild,S as Shape,P as ShapeBase,A as ShapeBuffer,E as ShapeFollow,O as ShapeLoop,k as ShapePrimitive,I as ShapeRecursive,C as Spiral,B as Star,R as SuperShape,T as Timeline,L as Triangle,F as Vec2,j as __esModule,D as angle2FromRepetition,z as angleFromRepetition,q as clamp,N as distanceFromRepetition,U as distributePointsInBuffer,Y as interpolate,V as lerp,Z as log,G as mod,X as noise,$ as now,H as prepareBufferForInterpolation,W as random,Q as relativeClamp,J as toDegrees,K as toRadians}; \ No newline at end of file diff --git a/build/esm/urpflanze.min.js.LICENSE.txt b/build/esm/urpflanze.min.js.LICENSE.txt index 8e66bad..3c47f5f 100644 --- a/build/esm/urpflanze.min.js.LICENSE.txt +++ b/build/esm/urpflanze.min.js.LICENSE.txt @@ -11,7 +11,7 @@ https://github.com/nodeca/pako/blob/master/LICENSE */ /*! - * @license UrpflanzeJS v"1.0.2" + * @license UrpflanzeJS v"1.0.3" * urpflanze.min.js * * Github: https://github.com/urpflanze-org/urpflanze diff --git a/build/umd/urpflanze-light.js b/build/umd/urpflanze-light.js index 81bc7a0..09cf901 100644 --- a/build/umd/urpflanze-light.js +++ b/build/umd/urpflanze-light.js @@ -1,5 +1,5 @@ /*! - * @license UrpflanzeJS v"1.0.2" + * @license UrpflanzeJS v"1.0.3" * urpflanze-light.js * * Github: https://github.com/urpflanze-org/urpflanze @@ -19,7 +19,26 @@ })(window, function() { return /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ([ -/* 0 */, +/* 0 */ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__webpack_require__(1), exports); +//# sourceMappingURL=index-light.js.map + +/***/ }), /* 1 */ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { @@ -61,21 +80,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.mod = exports.log = exports.PI2 = exports.PHI = exports.Vec2 = exports.distributePointsInBuffer = exports.prepareBufferForInterpolation = exports.interpolate = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.now = exports.toRadians = exports.toDegrees = exports.relativeClamp = exports.clamp = exports.lerp = void 0; -/** - * Types & Interface - */ __exportStar(__webpack_require__(3), exports); -// Set glMatrixArrayType -const gl_matrix_1 = __webpack_require__(12); -gl_matrix_1.glMatrix.setMatrixArrayType(Array); -/** - * Core - */ -__exportStar(__webpack_require__(23), exports); -__exportStar(__webpack_require__(24), exports); -__exportStar(__webpack_require__(25), exports); -// Shapes -__exportStar(__webpack_require__(26), exports); +__exportStar(__webpack_require__(4), exports); +__exportStar(__webpack_require__(5), exports); +__exportStar(__webpack_require__(6), exports); __exportStar(__webpack_require__(35), exports); __exportStar(__webpack_require__(36), exports); __exportStar(__webpack_require__(37), exports); @@ -92,10 +100,8 @@ __exportStar(__webpack_require__(46), exports); __exportStar(__webpack_require__(47), exports); __exportStar(__webpack_require__(48), exports); __exportStar(__webpack_require__(49), exports); -// Modifiers __exportStar(__webpack_require__(31), exports); __exportStar(__webpack_require__(50), exports); -// Utilities var Utilities_1 = __webpack_require__(32); Object.defineProperty(exports, "lerp", ({ enumerable: true, get: function () { return Utilities_1.lerp; } })); Object.defineProperty(exports, "clamp", ({ enumerable: true, get: function () { return Utilities_1.clamp; } })); @@ -118,7991 +124,571 @@ Object.defineProperty(exports, "PHI", ({ enumerable: true, get: function () { re Object.defineProperty(exports, "PI2", ({ enumerable: true, get: function () { return math_1.PI2; } })); Object.defineProperty(exports, "log", ({ enumerable: true, get: function () { return math_1.log; } })); Object.defineProperty(exports, "mod", ({ enumerable: true, get: function () { return math_1.mod; } })); -//# sourceMappingURL=index.js.map +//# sourceMappingURL=core.js.map /***/ }), /* 3 */ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__webpack_require__(4), exports); -__exportStar(__webpack_require__(5), exports); -__exportStar(__webpack_require__(6), exports); -__exportStar(__webpack_require__(7), exports); -__exportStar(__webpack_require__(8), exports); -__exportStar(__webpack_require__(9), exports); -__exportStar(__webpack_require__(10), exports); -__exportStar(__webpack_require__(11), exports); -//# sourceMappingURL=index.js.map - -/***/ }), -/* 4 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=indexedBuffer.js.map - -/***/ }), -/* 5 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=propArguments.js.map - -/***/ }), -/* 6 */ -/***/ ((__unused_webpack_module, exports) => { +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ERepetitionType = void 0; +exports.Scene = void 0; +const SceneChild_1 = __webpack_require__(4); +const Group_1 = __webpack_require__(5); +const Shape_1 = __webpack_require__(34); +const Utilities_1 = __webpack_require__(32); /** - * Repetition type enumerator. + * Container for all SceneChild. + * The main purpose is to manage the drawing order and update the child buffers * - * @category Core.Repetition - * @internal + * @order 1 + * @category Core.Scene + * @class Scene */ -var ERepetitionType; -(function (ERepetitionType) { +class Scene { /** - * Defines the type of repetition of the shape, - * in a circular way starting from the center of the scene - * @order 1 + * Creates an instance of Scene. + * You can see the default values in the property definitions */ - ERepetitionType[ERepetitionType["Ring"] = 1] = "Ring"; + constructor(settings = {}) { + /** + * Logical number, the drawer will take care of defining the unit of measure + */ + this.width = 400; + /** + * Logical number, the drawer will take care of defining the unit of measure + */ + this.height = 400; + /** + * Default background color (black) + */ + this.background = 'hsla(0, 0%, 0%, 1)'; + /** + * Default ScenePrimitive stroke color (white) + */ + this.color = 'hsla(0, 0%, 100%, 1)'; + /** + * Current time + */ + this.currentTime = 0; + if (typeof settings.width !== 'undefined') + this.width = settings.width; + if (typeof settings.height !== 'undefined') + this.height = settings.height; + if (typeof settings.background !== 'undefined') + this.background = settings.background; + if (typeof settings.color !== 'undefined') + this.color = settings.color; + this.children = []; + this.center = [this.width / 2, this.height / 2]; + this.anchor = + settings.anchor && Array.isArray(settings.anchor) + ? [ + typeof settings.anchor[0] === 'number' + ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[0]) * 0.5) * this.width + : settings.anchor[0] === 'left' + ? 0 + : settings.anchor[0] === 'right' + ? this.width + : this.center[0], + typeof settings.anchor[1] === 'number' + ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[1]) * 0.5) * this.height + : settings.anchor[1] === 'top' + ? 0 + : settings.anchor[1] === 'bottom' + ? this.height + : this.center[1], + ] + : [this.center[0], this.center[1]]; + } /** - * Defines the type of repetition of the shape, - * on a nxm grid starting from the center of the scene - * @order 2 + * Return width percentage + * + * @param {number} [percentage=100] + * @returns {number} */ - ERepetitionType[ERepetitionType["Matrix"] = 2] = "Matrix"; -})(ERepetitionType = exports.ERepetitionType || (exports.ERepetitionType = {})); -//# sourceMappingURL=repetitions.js.map - -/***/ }), -/* 7 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=scene-child.js.map - -/***/ }), -/* 8 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=scene.js.map - -/***/ }), -/* 9 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EBoundingType = void 0; -var EBoundingType; -(function (EBoundingType) { + getWidth(percentage = 100) { + return (this.width * percentage) / 100; + } /** - * Relative to the real bounding of the shape - * @order 2 + * Return height percentage + * + * @param {number} [percentage=100] + * @returns {number} */ - EBoundingType[EBoundingType["Relative"] = 1] = "Relative"; + getHeight(percentage = 100) { + return (this.height * percentage) / 100; + } /** - * Fixed to te width and height of the shape - * @order 3 + * Resize the scene size + * + * @param {number} width + * @param {number} [height=width] + * @memberof Scene */ - EBoundingType[EBoundingType["Fixed"] = 2] = "Fixed"; -})(EBoundingType = exports.EBoundingType || (exports.EBoundingType = {})); -//# sourceMappingURL=shape-base.js.map - -/***/ }), -/* 10 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -////// -//# sourceMappingURL=shape-primitives.js.map - -/***/ }), -/* 11 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -// Shape -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=shapes.js.map - -/***/ }), -/* 12 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "glMatrix": () => (/* reexport module object */ _common_js__WEBPACK_IMPORTED_MODULE_0__), -/* harmony export */ "mat2": () => (/* reexport module object */ _mat2_js__WEBPACK_IMPORTED_MODULE_1__), -/* harmony export */ "mat2d": () => (/* reexport module object */ _mat2d_js__WEBPACK_IMPORTED_MODULE_2__), -/* harmony export */ "mat3": () => (/* reexport module object */ _mat3_js__WEBPACK_IMPORTED_MODULE_3__), -/* harmony export */ "mat4": () => (/* reexport module object */ _mat4_js__WEBPACK_IMPORTED_MODULE_4__), -/* harmony export */ "quat": () => (/* reexport module object */ _quat_js__WEBPACK_IMPORTED_MODULE_5__), -/* harmony export */ "quat2": () => (/* reexport module object */ _quat2_js__WEBPACK_IMPORTED_MODULE_6__), -/* harmony export */ "vec2": () => (/* reexport module object */ _vec2_js__WEBPACK_IMPORTED_MODULE_7__), -/* harmony export */ "vec3": () => (/* reexport module object */ _vec3_js__WEBPACK_IMPORTED_MODULE_8__), -/* harmony export */ "vec4": () => (/* reexport module object */ _vec4_js__WEBPACK_IMPORTED_MODULE_9__) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); -/* harmony import */ var _mat2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14); -/* harmony import */ var _mat2d_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15); -/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16); -/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17); -/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(18); -/* harmony import */ var _quat2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(21); -/* harmony import */ var _vec2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22); -/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(20); -/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(19); - - - - - - - - - - - + resize(width, height = width) { + this.width = width; + this.height = height; + this.center = [this.width / 2, this.height / 2]; + const anchor = [this.width / this.anchor[0], this.height / this.anchor[1]]; + this.anchor = [this.width / anchor[0], this.height / anchor[1]]; + this.children.forEach(sceneChild => sceneChild.clearBuffer(true, false)); + } + /** + * Update all children, generate a streamable buffer for drawing + * + * @param {number} [atTime] time in ms + * @memberof Scene + */ + update(atTime = 0) { + this.currentTime = atTime; + for (let i = 0, len = this.children.length; i < len; i++) { + this.children[i].generate(this.currentTime, true); + } + } + /** + * Traverse the child buffer and use it with callback + * + * @param {(streamArguments: IStreamArguments) => void} callback + * @memberof Scene + */ + stream(callback) { + this.children.forEach(sceneChild => sceneChild.stream(callback)); + } + /* + |-------------------------------------------------------------------------- + | SceneChild + |-------------------------------------------------------------------------- + */ + /** + * Return a list of children + * + * @returns {Array} + * @memberof Scene + */ + getChildren() { + return this.children; + } + /** + * Add SceneChild to Scene, pass `order` as last parameter for drawing priorities + * + * @param {Array} items + * @param {number} [order] + * @memberof Scene + */ + add(...items /**, order: number */) { + const order = typeof items[items.length - 1] === 'number' ? items[items.length - 1] : undefined; + const len = items.length - (typeof order === 'undefined' ? 0 : 1); + for (let i = 0; i < len; i++) { + const item = items[i]; + item.order = + typeof order !== 'undefined' + ? order + i + : typeof item.order !== 'undefined' + ? item.order + : this.children.length > 0 + ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1 + : 0; + Scene.propagateToChilden(item, this); + this.children.push(item); + item.clearBuffer(true, false); + item.generate(0, true); + } + this.sortChildren(); + } + /** + * Sort children by order + * + * @memberof Scene + */ + sortChildren() { + this.children.sort((a, b) => a.order - b.order); + this.children = this.children.map((child, index) => { + child.order = index; + return child; + }); + } + /** + * Find sceneChild from id or name in the whole scene + * + * @param {string | number} idOrName + * @returns {(SceneChild | null)} + * @memberof Scene + */ + find(idOrName) { + const children = this.getChildren(); + for (let i = 0, len = children.length; i < len; i++) { + const result = children[i].find(idOrName); + if (result !== null) + return result; + } + return null; + } + /** + * Get shape by index + * + * @param {number} index + * @returns {(SceneChild | null)} + * @memberof Scene + */ + get(index) { + return index >= 0 && index < this.children.length ? this.children[index] : null; + } + /** + * Remove a shape by index + * + * @param {number} index + * @memberof Scene + */ + remove(index) { + index >= 0 && index < this.children.length && this.children.splice(index, 1); + } + /** + * Removes all children + * + * @memberof Scene + */ + removeChildren() { + this.children = []; + } + /** + * Remove sceneChild by id or name + * + * @param {number | number} idOrName + * @memberof Scene + */ + removeFromId(idOrName) { + for (let i = 0, len = this.children.length; i < len; i++) + if (this.children[i].id === idOrName || this.children[i].name === idOrName) { + this.children.splice(i, 1); + return; + } + } + /** + * Return true if sceneChild is direct children + * + * @param {SceneChild} sceneChild + * @returns {boolean} + * @memberof Scene + */ + isFirstLevelChild(sceneChild) { + for (let i = 0, len = this.children.length; i < len; i++) + if (this.children[i].id === sceneChild.id) + return true; + const parents = this.getParentsOfSceneChild(sceneChild); + return parents.length === 1 && parents[0] instanceof Group_1.Group; + } + /** + * Returns the list of sceneChild hierarchy starting from the scene + * + * @param {SceneChild} sceneChild + * @returns {Array} + * @memberof Scene + */ + getParentsOfSceneChild(sceneChild) { + const result = Scene.getParentsOfSceneChild(this, sceneChild); + if (result) { + result.splice(0, 1); + return result; + } + return []; + } + /** + * Returns the list of sceneChild hierarchy starting from the scene + * + * @static + * @param {(Scene | SceneChild)} current + * @param {SceneChild} sceneChild + * @param {(Array)} [parents=[]] + * @returns {(Array | null)} + * @memberof Scene + */ + static getParentsOfSceneChild(current, sceneChild, parents = []) { + let result; + if (current instanceof SceneChild_1.SceneChild) { + if (current.id == sceneChild.id) + return parents; + if (current instanceof Shape_1.Shape && current.shape) { + const tmpParents = parents.slice(); + tmpParents.push(current); + if ((result = Scene.getParentsOfSceneChild(current.shape, sceneChild, tmpParents))) + return result; + } + } + if (current instanceof Scene || current instanceof Group_1.Group) { + const children = current.getChildren(); + parents.push(current); + for (let i = 0, len = children.length; i < len; i++) { + const child = children[i]; + if ((result = Scene.getParentsOfSceneChild(child, sceneChild, parents))) + return result; + } + parents.pop(); + } + return null; + } + /** + * Walk through the scene + * + * @static + * @param {SceneChild} callbackk + * @param {(Scene | SceneChild)} current + * @memberof Scene + */ + static walk(callback, current) { + if (current instanceof SceneChild_1.SceneChild) { + if (callback(current) === false) + return false; + if (current instanceof Shape_1.Shape && current.shape) + if (Scene.walk(callback, current.shape) === false) + return false; + } + if (current instanceof Scene || current instanceof Group_1.Group) { + const children = current.getChildren(); + for (let i = 0, len = children.length; i < len; i++) { + const child = children[i]; + if (Scene.walk(callback, child) === false) + return false; + } + } + } + /** + * Propagate scene to sceneChild (and children) + * + * @static + * @param {SceneChild} sceneChild + * @param {Scene} scene + * @memberof Scene + */ + static propagateToChilden(sceneChild, scene) { + sceneChild.scene = scene; + if (sceneChild instanceof Group_1.Group) { + sceneChild.getChildren().forEach((item) => { + Scene.propagateToChilden(item, scene); + }); + } + else if (sceneChild instanceof Shape_1.Shape && sceneChild.shape) { + sceneChild.shape.scene = scene; + Scene.propagateToChilden(sceneChild.shape, scene); + } + } +} +exports.Scene = Scene; +//# sourceMappingURL=Scene.js.map /***/ }), -/* 13 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/* 4 */ +/***/ ((__unused_webpack_module, exports) => { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "EPSILON": () => (/* binding */ EPSILON), -/* harmony export */ "ARRAY_TYPE": () => (/* binding */ ARRAY_TYPE), -/* harmony export */ "RANDOM": () => (/* binding */ RANDOM), -/* harmony export */ "setMatrixArrayType": () => (/* binding */ setMatrixArrayType), -/* harmony export */ "toRadian": () => (/* binding */ toRadian), -/* harmony export */ "equals": () => (/* binding */ equals) -/* harmony export */ }); -/** - * Common utilities - * @module glMatrix - */ -// Configuration Constants -var EPSILON = 0.000001; -var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array; -var RANDOM = Math.random; -/** - * Sets the type of array used when creating new vectors and matrices - * - * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array - */ -function setMatrixArrayType(type) { - ARRAY_TYPE = type; -} -var degree = Math.PI / 180; -/** - * Convert Degree To Radian - * - * @param {Number} a Angle in Degrees +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SceneChild = void 0; +/** + * Autoincrement sceneChild default id + * + * @internal + * @ignore */ - -function toRadian(a) { - return a * degree; -} -/** - * Tests whether or not the arguments have approximately the same value, within an absolute - * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less - * than or equal to 1.0, and a relative tolerance is used for larger values) - * - * @param {Number} a The first number to test. - * @param {Number} b The second number to test. - * @returns {Boolean} True if the numbers are approximately equal, false otherwise. +let __id = 0; +/** + * The element to be added into a scene. + * Preserve props, drawing order, generate and return buffers. + * The only implementations of this class are Group and ShapeBase + * + * @abstract + * @category Core.Abstract + * @order 2 + * @class SceneChild */ - -function equals(a, b) { - return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b)); +class SceneChild { + /** + * Creates an instance of SceneChild. + * Base values will be assigned in case they are not passed + * + * @param {ISceneChildSettings} settings + */ + constructor(settings) { + var _a; + /** + * Shape generation id + * used for prevent buffer calculation + * + * @internal + * @ignore + */ + this.generateId = -1; + this.id = (_a = settings.id) !== null && _a !== void 0 ? _a : ++__id; + this.type = settings.type || 'SceneChild'; + this.name = settings.name || this.type + '_' + this.id; + this.data = settings.data || {}; + this.props = {}; + } + /** + * Find this or form or children. + * Overridden by classes that extend it + * + * @param {string | number} idOrName + * @returns {(SceneChild | null)} + */ + find(idOrName) { + if (this.id === idOrName || this.name === idOrName) + return this; + return null; + } + /** + * Return the sceneChild properties + * + * @returns {Props} + */ + getProps() { + return this.props; + } + /** + * Return a sceneChild prop or default value + * + * @param {keyof Props} key + * @param {PropArguments} [propArguments] + * @param {*} [defaultValue] + * @returns {*} + */ + getProp(key, propArguments, defaultValue) { + var _a; + return ((_a = this.props[key]) !== null && _a !== void 0 ? _a : defaultValue); + } + /** + * Check SceneChild has prop + * + * @param {keyof Props} key + * @returns + */ + hasProp(key) { + return typeof this.props[key] !== 'undefined'; + } + /** + * Set a single or multiple props + * + * @param {(keyof ISceneChildProps | ISceneChildProps)} key + * @param {*} [value] + */ + setPropUnsafe(key, value) { + if (typeof key == 'string') + this.props[key] = value; + else + Object.keys(key).forEach((k) => (this.props[k] = key[k])); + } } -if (!Math.hypot) Math.hypot = function () { - var y = 0, - i = arguments.length; - - while (i--) { - y += arguments[i] * arguments[i]; - } - - return Math.sqrt(y); -}; +exports.SceneChild = SceneChild; +//# sourceMappingURL=SceneChild.js.map /***/ }), -/* 14 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/* 5 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "transpose": () => (/* binding */ transpose), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "adjoint": () => (/* binding */ adjoint), -/* harmony export */ "determinant": () => (/* binding */ determinant), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "rotate": () => (/* binding */ rotate), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), -/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "frob": () => (/* binding */ frob), -/* harmony export */ "LDU": () => (/* binding */ LDU), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), -/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "sub": () => (/* binding */ sub) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); - -/** - * 2x2 Matrix - * @module mat2 - */ - -/** - * Creates a new identity mat2 - * - * @returns {mat2} a new 2x2 matrix - */ -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[1] = 0; - out[2] = 0; - } - - out[0] = 1; - out[3] = 1; - return out; -} -/** - * Creates a new mat2 initialized with values from an existing matrix - * - * @param {ReadonlyMat2} a matrix to clone - * @returns {mat2} a new 2x2 matrix - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - return out; -} -/** - * Copy the values from one mat2 to another - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the source matrix - * @returns {mat2} out +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Group = void 0; +const Scene_1 = __webpack_require__(3); +const SceneChild_1 = __webpack_require__(4); +const ShapeBase_1 = __webpack_require__(6); +const Adapt_1 = __webpack_require__(30); +/** + * A SceneChild container, propagates properties to children + * + * @order 3 + * @category Core.Scene + * @extends {SceneChild} + * @example + * ```javascript + * // Group example + * + * const rect = new Urpflanze.Rect({ + * distance: 100 // <- if a property is set the group will not overwrite it + * }) + * const group = new Urpflanze.Group({ + * repetitions: 3, + * distance: 200 + * }) + * + * group.add(rect) + * group.add(new Urpflanze.Triangle()) + * ``` + * @class Group */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - return out; -} -/** - * Set a mat2 to the identity matrix - * - * @param {mat2} out the receiving matrix - * @returns {mat2} out - */ - -function identity(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 1; - return out; -} -/** - * Create a new mat2 with the given values - * - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m10 Component in column 1, row 0 position (index 2) - * @param {Number} m11 Component in column 1, row 1 position (index 3) - * @returns {mat2} out A new 2x2 matrix - */ - -function fromValues(m00, m01, m10, m11) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - out[0] = m00; - out[1] = m01; - out[2] = m10; - out[3] = m11; - return out; -} -/** - * Set the components of a mat2 to the given values - * - * @param {mat2} out the receiving matrix - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m10 Component in column 1, row 0 position (index 2) - * @param {Number} m11 Component in column 1, row 1 position (index 3) - * @returns {mat2} out - */ - -function set(out, m00, m01, m10, m11) { - out[0] = m00; - out[1] = m01; - out[2] = m10; - out[3] = m11; - return out; -} -/** - * Transpose the values of a mat2 - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the source matrix - * @returns {mat2} out - */ - -function transpose(out, a) { - // If we are transposing ourselves we can skip a few steps but have to cache - // some values - if (out === a) { - var a1 = a[1]; - out[1] = a[2]; - out[2] = a1; - } else { - out[0] = a[0]; - out[1] = a[2]; - out[2] = a[1]; - out[3] = a[3]; - } - - return out; -} -/** - * Inverts a mat2 - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the source matrix - * @returns {mat2} out - */ - -function invert(out, a) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; // Calculate the determinant - - var det = a0 * a3 - a2 * a1; - - if (!det) { - return null; - } - - det = 1.0 / det; - out[0] = a3 * det; - out[1] = -a1 * det; - out[2] = -a2 * det; - out[3] = a0 * det; - return out; -} -/** - * Calculates the adjugate of a mat2 - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the source matrix - * @returns {mat2} out - */ - -function adjoint(out, a) { - // Caching this value is nessecary if out == a - var a0 = a[0]; - out[0] = a[3]; - out[1] = -a[1]; - out[2] = -a[2]; - out[3] = a0; - return out; -} -/** - * Calculates the determinant of a mat2 - * - * @param {ReadonlyMat2} a the source matrix - * @returns {Number} determinant of a - */ - -function determinant(a) { - return a[0] * a[3] - a[2] * a[1]; -} -/** - * Multiplies two mat2's - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the first operand - * @param {ReadonlyMat2} b the second operand - * @returns {mat2} out - */ - -function multiply(out, a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3]; - out[0] = a0 * b0 + a2 * b1; - out[1] = a1 * b0 + a3 * b1; - out[2] = a0 * b2 + a2 * b3; - out[3] = a1 * b2 + a3 * b3; - return out; -} -/** - * Rotates a mat2 by the given angle - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat2} out - */ - -function rotate(out, a, rad) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var s = Math.sin(rad); - var c = Math.cos(rad); - out[0] = a0 * c + a2 * s; - out[1] = a1 * c + a3 * s; - out[2] = a0 * -s + a2 * c; - out[3] = a1 * -s + a3 * c; - return out; -} -/** - * Scales the mat2 by the dimensions in the given vec2 - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the matrix to rotate - * @param {ReadonlyVec2} v the vec2 to scale the matrix by - * @returns {mat2} out - **/ - -function scale(out, a, v) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var v0 = v[0], - v1 = v[1]; - out[0] = a0 * v0; - out[1] = a1 * v0; - out[2] = a2 * v1; - out[3] = a3 * v1; - return out; -} -/** - * Creates a matrix from a given angle - * This is equivalent to (but much faster than): - * - * mat2.identity(dest); - * mat2.rotate(dest, dest, rad); - * - * @param {mat2} out mat2 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat2} out - */ - -function fromRotation(out, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); - out[0] = c; - out[1] = s; - out[2] = -s; - out[3] = c; - return out; -} -/** - * Creates a matrix from a vector scaling - * This is equivalent to (but much faster than): - * - * mat2.identity(dest); - * mat2.scale(dest, dest, vec); - * - * @param {mat2} out mat2 receiving operation result - * @param {ReadonlyVec2} v Scaling vector - * @returns {mat2} out - */ - -function fromScaling(out, v) { - out[0] = v[0]; - out[1] = 0; - out[2] = 0; - out[3] = v[1]; - return out; -} -/** - * Returns a string representation of a mat2 - * - * @param {ReadonlyMat2} a matrix to represent as a string - * @returns {String} string representation of the matrix - */ - -function str(a) { - return "mat2(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; -} -/** - * Returns Frobenius norm of a mat2 - * - * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of - * @returns {Number} Frobenius norm - */ - -function frob(a) { - return Math.hypot(a[0], a[1], a[2], a[3]); -} -/** - * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix - * @param {ReadonlyMat2} L the lower triangular matrix - * @param {ReadonlyMat2} D the diagonal matrix - * @param {ReadonlyMat2} U the upper triangular matrix - * @param {ReadonlyMat2} a the input matrix to factorize - */ - -function LDU(L, D, U, a) { - L[2] = a[2] / a[0]; - U[0] = a[0]; - U[1] = a[1]; - U[3] = a[3] - L[2] * U[1]; - return [L, D, U]; -} -/** - * Adds two mat2's - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the first operand - * @param {ReadonlyMat2} b the second operand - * @returns {mat2} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - return out; -} -/** - * Subtracts matrix b from matrix a - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the first operand - * @param {ReadonlyMat2} b the second operand - * @returns {mat2} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - out[3] = a[3] - b[3]; - return out; -} -/** - * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyMat2} a The first matrix. - * @param {ReadonlyMat2} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; -} -/** - * Returns whether or not the matrices have approximately the same elements in the same position. - * - * @param {ReadonlyMat2} a The first matrix. - * @param {ReadonlyMat2} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)); -} -/** - * Multiply each element of the matrix by a scalar. - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the matrix to scale - * @param {Number} b amount to scale the matrix's elements by - * @returns {mat2} out - */ - -function multiplyScalar(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - return out; -} -/** - * Adds two mat2's after multiplying each element of the second operand by a scalar value. - * - * @param {mat2} out the receiving vector - * @param {ReadonlyMat2} a the first operand - * @param {ReadonlyMat2} b the second operand - * @param {Number} scale the amount to scale b's elements by before adding - * @returns {mat2} out - */ - -function multiplyScalarAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - out[3] = a[3] + b[3] * scale; - return out; -} -/** - * Alias for {@link mat2.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link mat2.subtract} - * @function - */ - -var sub = subtract; - -/***/ }), -/* 15 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "determinant": () => (/* binding */ determinant), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "rotate": () => (/* binding */ rotate), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "translate": () => (/* binding */ translate), -/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), -/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), -/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "frob": () => (/* binding */ frob), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), -/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "sub": () => (/* binding */ sub) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); - -/** - * 2x3 Matrix - * @module mat2d - * @description - * A mat2d contains six elements defined as: - *
- * [a, b,
- *  c, d,
- *  tx, ty]
- * 
- * This is a short form for the 3x3 matrix: - *
- * [a, b, 0,
- *  c, d, 0,
- *  tx, ty, 1]
- * 
- * The last column is ignored so the array is shorter and operations are faster. - */ - -/** - * Creates a new identity mat2d - * - * @returns {mat2d} a new 2x3 matrix - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[1] = 0; - out[2] = 0; - out[4] = 0; - out[5] = 0; - } - - out[0] = 1; - out[3] = 1; - return out; -} -/** - * Creates a new mat2d initialized with values from an existing matrix - * - * @param {ReadonlyMat2d} a matrix to clone - * @returns {mat2d} a new 2x3 matrix - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - return out; -} -/** - * Copy the values from one mat2d to another - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the source matrix - * @returns {mat2d} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - return out; -} -/** - * Set a mat2d to the identity matrix - * - * @param {mat2d} out the receiving matrix - * @returns {mat2d} out - */ - -function identity(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 1; - out[4] = 0; - out[5] = 0; - return out; -} -/** - * Create a new mat2d with the given values - * - * @param {Number} a Component A (index 0) - * @param {Number} b Component B (index 1) - * @param {Number} c Component C (index 2) - * @param {Number} d Component D (index 3) - * @param {Number} tx Component TX (index 4) - * @param {Number} ty Component TY (index 5) - * @returns {mat2d} A new mat2d - */ - -function fromValues(a, b, c, d, tx, ty) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); - out[0] = a; - out[1] = b; - out[2] = c; - out[3] = d; - out[4] = tx; - out[5] = ty; - return out; -} -/** - * Set the components of a mat2d to the given values - * - * @param {mat2d} out the receiving matrix - * @param {Number} a Component A (index 0) - * @param {Number} b Component B (index 1) - * @param {Number} c Component C (index 2) - * @param {Number} d Component D (index 3) - * @param {Number} tx Component TX (index 4) - * @param {Number} ty Component TY (index 5) - * @returns {mat2d} out - */ - -function set(out, a, b, c, d, tx, ty) { - out[0] = a; - out[1] = b; - out[2] = c; - out[3] = d; - out[4] = tx; - out[5] = ty; - return out; -} -/** - * Inverts a mat2d - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the source matrix - * @returns {mat2d} out - */ - -function invert(out, a) { - var aa = a[0], - ab = a[1], - ac = a[2], - ad = a[3]; - var atx = a[4], - aty = a[5]; - var det = aa * ad - ab * ac; - - if (!det) { - return null; - } - - det = 1.0 / det; - out[0] = ad * det; - out[1] = -ab * det; - out[2] = -ac * det; - out[3] = aa * det; - out[4] = (ac * aty - ad * atx) * det; - out[5] = (ab * atx - aa * aty) * det; - return out; -} -/** - * Calculates the determinant of a mat2d - * - * @param {ReadonlyMat2d} a the source matrix - * @returns {Number} determinant of a - */ - -function determinant(a) { - return a[0] * a[3] - a[1] * a[2]; -} -/** - * Multiplies two mat2d's - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the first operand - * @param {ReadonlyMat2d} b the second operand - * @returns {mat2d} out - */ - -function multiply(out, a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3], - b4 = b[4], - b5 = b[5]; - out[0] = a0 * b0 + a2 * b1; - out[1] = a1 * b0 + a3 * b1; - out[2] = a0 * b2 + a2 * b3; - out[3] = a1 * b2 + a3 * b3; - out[4] = a0 * b4 + a2 * b5 + a4; - out[5] = a1 * b4 + a3 * b5 + a5; - return out; -} -/** - * Rotates a mat2d by the given angle - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat2d} out - */ - -function rotate(out, a, rad) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5]; - var s = Math.sin(rad); - var c = Math.cos(rad); - out[0] = a0 * c + a2 * s; - out[1] = a1 * c + a3 * s; - out[2] = a0 * -s + a2 * c; - out[3] = a1 * -s + a3 * c; - out[4] = a4; - out[5] = a5; - return out; -} -/** - * Scales the mat2d by the dimensions in the given vec2 - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the matrix to translate - * @param {ReadonlyVec2} v the vec2 to scale the matrix by - * @returns {mat2d} out - **/ - -function scale(out, a, v) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5]; - var v0 = v[0], - v1 = v[1]; - out[0] = a0 * v0; - out[1] = a1 * v0; - out[2] = a2 * v1; - out[3] = a3 * v1; - out[4] = a4; - out[5] = a5; - return out; -} -/** - * Translates the mat2d by the dimensions in the given vec2 - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the matrix to translate - * @param {ReadonlyVec2} v the vec2 to translate the matrix by - * @returns {mat2d} out - **/ - -function translate(out, a, v) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5]; - var v0 = v[0], - v1 = v[1]; - out[0] = a0; - out[1] = a1; - out[2] = a2; - out[3] = a3; - out[4] = a0 * v0 + a2 * v1 + a4; - out[5] = a1 * v0 + a3 * v1 + a5; - return out; -} -/** - * Creates a matrix from a given angle - * This is equivalent to (but much faster than): - * - * mat2d.identity(dest); - * mat2d.rotate(dest, dest, rad); - * - * @param {mat2d} out mat2d receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat2d} out - */ - -function fromRotation(out, rad) { - var s = Math.sin(rad), - c = Math.cos(rad); - out[0] = c; - out[1] = s; - out[2] = -s; - out[3] = c; - out[4] = 0; - out[5] = 0; - return out; -} -/** - * Creates a matrix from a vector scaling - * This is equivalent to (but much faster than): - * - * mat2d.identity(dest); - * mat2d.scale(dest, dest, vec); - * - * @param {mat2d} out mat2d receiving operation result - * @param {ReadonlyVec2} v Scaling vector - * @returns {mat2d} out - */ - -function fromScaling(out, v) { - out[0] = v[0]; - out[1] = 0; - out[2] = 0; - out[3] = v[1]; - out[4] = 0; - out[5] = 0; - return out; -} -/** - * Creates a matrix from a vector translation - * This is equivalent to (but much faster than): - * - * mat2d.identity(dest); - * mat2d.translate(dest, dest, vec); - * - * @param {mat2d} out mat2d receiving operation result - * @param {ReadonlyVec2} v Translation vector - * @returns {mat2d} out - */ - -function fromTranslation(out, v) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 1; - out[4] = v[0]; - out[5] = v[1]; - return out; -} -/** - * Returns a string representation of a mat2d - * - * @param {ReadonlyMat2d} a matrix to represent as a string - * @returns {String} string representation of the matrix - */ - -function str(a) { - return "mat2d(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ")"; -} -/** - * Returns Frobenius norm of a mat2d - * - * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of - * @returns {Number} Frobenius norm - */ - -function frob(a) { - return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1); -} -/** - * Adds two mat2d's - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the first operand - * @param {ReadonlyMat2d} b the second operand - * @returns {mat2d} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - out[4] = a[4] + b[4]; - out[5] = a[5] + b[5]; - return out; -} -/** - * Subtracts matrix b from matrix a - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the first operand - * @param {ReadonlyMat2d} b the second operand - * @returns {mat2d} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - out[3] = a[3] - b[3]; - out[4] = a[4] - b[4]; - out[5] = a[5] - b[5]; - return out; -} -/** - * Multiply each element of the matrix by a scalar. - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the matrix to scale - * @param {Number} b amount to scale the matrix's elements by - * @returns {mat2d} out - */ - -function multiplyScalar(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - out[4] = a[4] * b; - out[5] = a[5] * b; - return out; -} -/** - * Adds two mat2d's after multiplying each element of the second operand by a scalar value. - * - * @param {mat2d} out the receiving vector - * @param {ReadonlyMat2d} a the first operand - * @param {ReadonlyMat2d} b the second operand - * @param {Number} scale the amount to scale b's elements by before adding - * @returns {mat2d} out - */ - -function multiplyScalarAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - out[3] = a[3] + b[3] * scale; - out[4] = a[4] + b[4] * scale; - out[5] = a[5] + b[5] * scale; - return out; -} -/** - * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyMat2d} a The first matrix. - * @param {ReadonlyMat2d} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5]; -} -/** - * Returns whether or not the matrices have approximately the same elements in the same position. - * - * @param {ReadonlyMat2d} a The first matrix. - * @param {ReadonlyMat2d} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3], - b4 = b[4], - b5 = b[5]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)); -} -/** - * Alias for {@link mat2d.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link mat2d.subtract} - * @function - */ - -var sub = subtract; - -/***/ }), -/* 16 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "fromMat4": () => (/* binding */ fromMat4), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "transpose": () => (/* binding */ transpose), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "adjoint": () => (/* binding */ adjoint), -/* harmony export */ "determinant": () => (/* binding */ determinant), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "translate": () => (/* binding */ translate), -/* harmony export */ "rotate": () => (/* binding */ rotate), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), -/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), -/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), -/* harmony export */ "fromMat2d": () => (/* binding */ fromMat2d), -/* harmony export */ "fromQuat": () => (/* binding */ fromQuat), -/* harmony export */ "normalFromMat4": () => (/* binding */ normalFromMat4), -/* harmony export */ "projection": () => (/* binding */ projection), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "frob": () => (/* binding */ frob), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), -/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "sub": () => (/* binding */ sub) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); - -/** - * 3x3 Matrix - * @module mat3 - */ - -/** - * Creates a new identity mat3 - * - * @returns {mat3} a new 3x3 matrix - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[5] = 0; - out[6] = 0; - out[7] = 0; - } - - out[0] = 1; - out[4] = 1; - out[8] = 1; - return out; -} -/** - * Copies the upper-left 3x3 values into the given mat3. - * - * @param {mat3} out the receiving 3x3 matrix - * @param {ReadonlyMat4} a the source 4x4 matrix - * @returns {mat3} out - */ - -function fromMat4(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[4]; - out[4] = a[5]; - out[5] = a[6]; - out[6] = a[8]; - out[7] = a[9]; - out[8] = a[10]; - return out; -} -/** - * Creates a new mat3 initialized with values from an existing matrix - * - * @param {ReadonlyMat3} a matrix to clone - * @returns {mat3} a new 3x3 matrix - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - return out; -} -/** - * Copy the values from one mat3 to another - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the source matrix - * @returns {mat3} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - return out; -} -/** - * Create a new mat3 with the given values - * - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m02 Component in column 0, row 2 position (index 2) - * @param {Number} m10 Component in column 1, row 0 position (index 3) - * @param {Number} m11 Component in column 1, row 1 position (index 4) - * @param {Number} m12 Component in column 1, row 2 position (index 5) - * @param {Number} m20 Component in column 2, row 0 position (index 6) - * @param {Number} m21 Component in column 2, row 1 position (index 7) - * @param {Number} m22 Component in column 2, row 2 position (index 8) - * @returns {mat3} A new mat3 - */ - -function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); - out[0] = m00; - out[1] = m01; - out[2] = m02; - out[3] = m10; - out[4] = m11; - out[5] = m12; - out[6] = m20; - out[7] = m21; - out[8] = m22; - return out; -} -/** - * Set the components of a mat3 to the given values - * - * @param {mat3} out the receiving matrix - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m02 Component in column 0, row 2 position (index 2) - * @param {Number} m10 Component in column 1, row 0 position (index 3) - * @param {Number} m11 Component in column 1, row 1 position (index 4) - * @param {Number} m12 Component in column 1, row 2 position (index 5) - * @param {Number} m20 Component in column 2, row 0 position (index 6) - * @param {Number} m21 Component in column 2, row 1 position (index 7) - * @param {Number} m22 Component in column 2, row 2 position (index 8) - * @returns {mat3} out - */ - -function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) { - out[0] = m00; - out[1] = m01; - out[2] = m02; - out[3] = m10; - out[4] = m11; - out[5] = m12; - out[6] = m20; - out[7] = m21; - out[8] = m22; - return out; -} -/** - * Set a mat3 to the identity matrix - * - * @param {mat3} out the receiving matrix - * @returns {mat3} out - */ - -function identity(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 1; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 1; - return out; -} -/** - * Transpose the values of a mat3 - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the source matrix - * @returns {mat3} out - */ - -function transpose(out, a) { - // If we are transposing ourselves we can skip a few steps but have to cache some values - if (out === a) { - var a01 = a[1], - a02 = a[2], - a12 = a[5]; - out[1] = a[3]; - out[2] = a[6]; - out[3] = a01; - out[5] = a[7]; - out[6] = a02; - out[7] = a12; - } else { - out[0] = a[0]; - out[1] = a[3]; - out[2] = a[6]; - out[3] = a[1]; - out[4] = a[4]; - out[5] = a[7]; - out[6] = a[2]; - out[7] = a[5]; - out[8] = a[8]; - } - - return out; -} -/** - * Inverts a mat3 - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the source matrix - * @returns {mat3} out - */ - -function invert(out, a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2]; - var a10 = a[3], - a11 = a[4], - a12 = a[5]; - var a20 = a[6], - a21 = a[7], - a22 = a[8]; - var b01 = a22 * a11 - a12 * a21; - var b11 = -a22 * a10 + a12 * a20; - var b21 = a21 * a10 - a11 * a20; // Calculate the determinant - - var det = a00 * b01 + a01 * b11 + a02 * b21; - - if (!det) { - return null; - } - - det = 1.0 / det; - out[0] = b01 * det; - out[1] = (-a22 * a01 + a02 * a21) * det; - out[2] = (a12 * a01 - a02 * a11) * det; - out[3] = b11 * det; - out[4] = (a22 * a00 - a02 * a20) * det; - out[5] = (-a12 * a00 + a02 * a10) * det; - out[6] = b21 * det; - out[7] = (-a21 * a00 + a01 * a20) * det; - out[8] = (a11 * a00 - a01 * a10) * det; - return out; -} -/** - * Calculates the adjugate of a mat3 - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the source matrix - * @returns {mat3} out - */ - -function adjoint(out, a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2]; - var a10 = a[3], - a11 = a[4], - a12 = a[5]; - var a20 = a[6], - a21 = a[7], - a22 = a[8]; - out[0] = a11 * a22 - a12 * a21; - out[1] = a02 * a21 - a01 * a22; - out[2] = a01 * a12 - a02 * a11; - out[3] = a12 * a20 - a10 * a22; - out[4] = a00 * a22 - a02 * a20; - out[5] = a02 * a10 - a00 * a12; - out[6] = a10 * a21 - a11 * a20; - out[7] = a01 * a20 - a00 * a21; - out[8] = a00 * a11 - a01 * a10; - return out; -} -/** - * Calculates the determinant of a mat3 - * - * @param {ReadonlyMat3} a the source matrix - * @returns {Number} determinant of a - */ - -function determinant(a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2]; - var a10 = a[3], - a11 = a[4], - a12 = a[5]; - var a20 = a[6], - a21 = a[7], - a22 = a[8]; - return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); -} -/** - * Multiplies two mat3's - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the first operand - * @param {ReadonlyMat3} b the second operand - * @returns {mat3} out - */ - -function multiply(out, a, b) { - var a00 = a[0], - a01 = a[1], - a02 = a[2]; - var a10 = a[3], - a11 = a[4], - a12 = a[5]; - var a20 = a[6], - a21 = a[7], - a22 = a[8]; - var b00 = b[0], - b01 = b[1], - b02 = b[2]; - var b10 = b[3], - b11 = b[4], - b12 = b[5]; - var b20 = b[6], - b21 = b[7], - b22 = b[8]; - out[0] = b00 * a00 + b01 * a10 + b02 * a20; - out[1] = b00 * a01 + b01 * a11 + b02 * a21; - out[2] = b00 * a02 + b01 * a12 + b02 * a22; - out[3] = b10 * a00 + b11 * a10 + b12 * a20; - out[4] = b10 * a01 + b11 * a11 + b12 * a21; - out[5] = b10 * a02 + b11 * a12 + b12 * a22; - out[6] = b20 * a00 + b21 * a10 + b22 * a20; - out[7] = b20 * a01 + b21 * a11 + b22 * a21; - out[8] = b20 * a02 + b21 * a12 + b22 * a22; - return out; -} -/** - * Translate a mat3 by the given vector - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the matrix to translate - * @param {ReadonlyVec2} v vector to translate by - * @returns {mat3} out - */ - -function translate(out, a, v) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a10 = a[3], - a11 = a[4], - a12 = a[5], - a20 = a[6], - a21 = a[7], - a22 = a[8], - x = v[0], - y = v[1]; - out[0] = a00; - out[1] = a01; - out[2] = a02; - out[3] = a10; - out[4] = a11; - out[5] = a12; - out[6] = x * a00 + y * a10 + a20; - out[7] = x * a01 + y * a11 + a21; - out[8] = x * a02 + y * a12 + a22; - return out; -} -/** - * Rotates a mat3 by the given angle - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat3} out - */ - -function rotate(out, a, rad) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a10 = a[3], - a11 = a[4], - a12 = a[5], - a20 = a[6], - a21 = a[7], - a22 = a[8], - s = Math.sin(rad), - c = Math.cos(rad); - out[0] = c * a00 + s * a10; - out[1] = c * a01 + s * a11; - out[2] = c * a02 + s * a12; - out[3] = c * a10 - s * a00; - out[4] = c * a11 - s * a01; - out[5] = c * a12 - s * a02; - out[6] = a20; - out[7] = a21; - out[8] = a22; - return out; -} -/** - * Scales the mat3 by the dimensions in the given vec2 - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the matrix to rotate - * @param {ReadonlyVec2} v the vec2 to scale the matrix by - * @returns {mat3} out - **/ - -function scale(out, a, v) { - var x = v[0], - y = v[1]; - out[0] = x * a[0]; - out[1] = x * a[1]; - out[2] = x * a[2]; - out[3] = y * a[3]; - out[4] = y * a[4]; - out[5] = y * a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - return out; -} -/** - * Creates a matrix from a vector translation - * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.translate(dest, dest, vec); - * - * @param {mat3} out mat3 receiving operation result - * @param {ReadonlyVec2} v Translation vector - * @returns {mat3} out - */ - -function fromTranslation(out, v) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 1; - out[5] = 0; - out[6] = v[0]; - out[7] = v[1]; - out[8] = 1; - return out; -} -/** - * Creates a matrix from a given angle - * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.rotate(dest, dest, rad); - * - * @param {mat3} out mat3 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat3} out - */ - -function fromRotation(out, rad) { - var s = Math.sin(rad), - c = Math.cos(rad); - out[0] = c; - out[1] = s; - out[2] = 0; - out[3] = -s; - out[4] = c; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 1; - return out; -} -/** - * Creates a matrix from a vector scaling - * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.scale(dest, dest, vec); - * - * @param {mat3} out mat3 receiving operation result - * @param {ReadonlyVec2} v Scaling vector - * @returns {mat3} out - */ - -function fromScaling(out, v) { - out[0] = v[0]; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = v[1]; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 1; - return out; -} -/** - * Copies the values from a mat2d into a mat3 - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat2d} a the matrix to copy - * @returns {mat3} out - **/ - -function fromMat2d(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = 0; - out[3] = a[2]; - out[4] = a[3]; - out[5] = 0; - out[6] = a[4]; - out[7] = a[5]; - out[8] = 1; - return out; -} -/** - * Calculates a 3x3 matrix from the given quaternion - * - * @param {mat3} out mat3 receiving operation result - * @param {ReadonlyQuat} q Quaternion to create matrix from - * - * @returns {mat3} out - */ - -function fromQuat(out, q) { - var x = q[0], - y = q[1], - z = q[2], - w = q[3]; - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - var xx = x * x2; - var yx = y * x2; - var yy = y * y2; - var zx = z * x2; - var zy = z * y2; - var zz = z * z2; - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - out[0] = 1 - yy - zz; - out[3] = yx - wz; - out[6] = zx + wy; - out[1] = yx + wz; - out[4] = 1 - xx - zz; - out[7] = zy - wx; - out[2] = zx - wy; - out[5] = zy + wx; - out[8] = 1 - xx - yy; - return out; -} -/** - * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix - * - * @param {mat3} out mat3 receiving operation result - * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from - * - * @returns {mat3} out - */ - -function normalFromMat4(out, a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7]; - var a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; - var a30 = a[12], - a31 = a[13], - a32 = a[14], - a33 = a[15]; - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; // Calculate the determinant - - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) { - return null; - } - - det = 1.0 / det; - out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - return out; -} -/** - * Generates a 2D projection matrix with the given bounds - * - * @param {mat3} out mat3 frustum matrix will be written into - * @param {number} width Width of your gl context - * @param {number} height Height of gl context - * @returns {mat3} out - */ - -function projection(out, width, height) { - out[0] = 2 / width; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = -2 / height; - out[5] = 0; - out[6] = -1; - out[7] = 1; - out[8] = 1; - return out; -} -/** - * Returns a string representation of a mat3 - * - * @param {ReadonlyMat3} a matrix to represent as a string - * @returns {String} string representation of the matrix - */ - -function str(a) { - return "mat3(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ")"; -} -/** - * Returns Frobenius norm of a mat3 - * - * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of - * @returns {Number} Frobenius norm - */ - -function frob(a) { - return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]); -} -/** - * Adds two mat3's - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the first operand - * @param {ReadonlyMat3} b the second operand - * @returns {mat3} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - out[4] = a[4] + b[4]; - out[5] = a[5] + b[5]; - out[6] = a[6] + b[6]; - out[7] = a[7] + b[7]; - out[8] = a[8] + b[8]; - return out; -} -/** - * Subtracts matrix b from matrix a - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the first operand - * @param {ReadonlyMat3} b the second operand - * @returns {mat3} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - out[3] = a[3] - b[3]; - out[4] = a[4] - b[4]; - out[5] = a[5] - b[5]; - out[6] = a[6] - b[6]; - out[7] = a[7] - b[7]; - out[8] = a[8] - b[8]; - return out; -} -/** - * Multiply each element of the matrix by a scalar. - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the matrix to scale - * @param {Number} b amount to scale the matrix's elements by - * @returns {mat3} out - */ - -function multiplyScalar(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - out[4] = a[4] * b; - out[5] = a[5] * b; - out[6] = a[6] * b; - out[7] = a[7] * b; - out[8] = a[8] * b; - return out; -} -/** - * Adds two mat3's after multiplying each element of the second operand by a scalar value. - * - * @param {mat3} out the receiving vector - * @param {ReadonlyMat3} a the first operand - * @param {ReadonlyMat3} b the second operand - * @param {Number} scale the amount to scale b's elements by before adding - * @returns {mat3} out - */ - -function multiplyScalarAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - out[3] = a[3] + b[3] * scale; - out[4] = a[4] + b[4] * scale; - out[5] = a[5] + b[5] * scale; - out[6] = a[6] + b[6] * scale; - out[7] = a[7] + b[7] * scale; - out[8] = a[8] + b[8] * scale; - return out; -} -/** - * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyMat3} a The first matrix. - * @param {ReadonlyMat3} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8]; -} -/** - * Returns whether or not the matrices have approximately the same elements in the same position. - * - * @param {ReadonlyMat3} a The first matrix. - * @param {ReadonlyMat3} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5], - a6 = a[6], - a7 = a[7], - a8 = a[8]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3], - b4 = b[4], - b5 = b[5], - b6 = b[6], - b7 = b[7], - b8 = b[8]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)); -} -/** - * Alias for {@link mat3.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link mat3.subtract} - * @function - */ - -var sub = subtract; - -/***/ }), -/* 17 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "transpose": () => (/* binding */ transpose), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "adjoint": () => (/* binding */ adjoint), -/* harmony export */ "determinant": () => (/* binding */ determinant), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "translate": () => (/* binding */ translate), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "rotate": () => (/* binding */ rotate), -/* harmony export */ "rotateX": () => (/* binding */ rotateX), -/* harmony export */ "rotateY": () => (/* binding */ rotateY), -/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), -/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), -/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), -/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), -/* harmony export */ "fromXRotation": () => (/* binding */ fromXRotation), -/* harmony export */ "fromYRotation": () => (/* binding */ fromYRotation), -/* harmony export */ "fromZRotation": () => (/* binding */ fromZRotation), -/* harmony export */ "fromRotationTranslation": () => (/* binding */ fromRotationTranslation), -/* harmony export */ "fromQuat2": () => (/* binding */ fromQuat2), -/* harmony export */ "getTranslation": () => (/* binding */ getTranslation), -/* harmony export */ "getScaling": () => (/* binding */ getScaling), -/* harmony export */ "getRotation": () => (/* binding */ getRotation), -/* harmony export */ "fromRotationTranslationScale": () => (/* binding */ fromRotationTranslationScale), -/* harmony export */ "fromRotationTranslationScaleOrigin": () => (/* binding */ fromRotationTranslationScaleOrigin), -/* harmony export */ "fromQuat": () => (/* binding */ fromQuat), -/* harmony export */ "frustum": () => (/* binding */ frustum), -/* harmony export */ "perspective": () => (/* binding */ perspective), -/* harmony export */ "perspectiveFromFieldOfView": () => (/* binding */ perspectiveFromFieldOfView), -/* harmony export */ "ortho": () => (/* binding */ ortho), -/* harmony export */ "lookAt": () => (/* binding */ lookAt), -/* harmony export */ "targetTo": () => (/* binding */ targetTo), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "frob": () => (/* binding */ frob), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), -/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "sub": () => (/* binding */ sub) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); - -/** - * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied. - * @module mat4 - */ - -/** - * Creates a new identity mat4 - * - * @returns {mat4} a new 4x4 matrix - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - } - - out[0] = 1; - out[5] = 1; - out[10] = 1; - out[15] = 1; - return out; -} -/** - * Creates a new mat4 initialized with values from an existing matrix - * - * @param {ReadonlyMat4} a matrix to clone - * @returns {mat4} a new 4x4 matrix - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - return out; -} -/** - * Copy the values from one mat4 to another - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the source matrix - * @returns {mat4} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - return out; -} -/** - * Create a new mat4 with the given values - * - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m02 Component in column 0, row 2 position (index 2) - * @param {Number} m03 Component in column 0, row 3 position (index 3) - * @param {Number} m10 Component in column 1, row 0 position (index 4) - * @param {Number} m11 Component in column 1, row 1 position (index 5) - * @param {Number} m12 Component in column 1, row 2 position (index 6) - * @param {Number} m13 Component in column 1, row 3 position (index 7) - * @param {Number} m20 Component in column 2, row 0 position (index 8) - * @param {Number} m21 Component in column 2, row 1 position (index 9) - * @param {Number} m22 Component in column 2, row 2 position (index 10) - * @param {Number} m23 Component in column 2, row 3 position (index 11) - * @param {Number} m30 Component in column 3, row 0 position (index 12) - * @param {Number} m31 Component in column 3, row 1 position (index 13) - * @param {Number} m32 Component in column 3, row 2 position (index 14) - * @param {Number} m33 Component in column 3, row 3 position (index 15) - * @returns {mat4} A new mat4 - */ - -function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); - out[0] = m00; - out[1] = m01; - out[2] = m02; - out[3] = m03; - out[4] = m10; - out[5] = m11; - out[6] = m12; - out[7] = m13; - out[8] = m20; - out[9] = m21; - out[10] = m22; - out[11] = m23; - out[12] = m30; - out[13] = m31; - out[14] = m32; - out[15] = m33; - return out; -} -/** - * Set the components of a mat4 to the given values - * - * @param {mat4} out the receiving matrix - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m02 Component in column 0, row 2 position (index 2) - * @param {Number} m03 Component in column 0, row 3 position (index 3) - * @param {Number} m10 Component in column 1, row 0 position (index 4) - * @param {Number} m11 Component in column 1, row 1 position (index 5) - * @param {Number} m12 Component in column 1, row 2 position (index 6) - * @param {Number} m13 Component in column 1, row 3 position (index 7) - * @param {Number} m20 Component in column 2, row 0 position (index 8) - * @param {Number} m21 Component in column 2, row 1 position (index 9) - * @param {Number} m22 Component in column 2, row 2 position (index 10) - * @param {Number} m23 Component in column 2, row 3 position (index 11) - * @param {Number} m30 Component in column 3, row 0 position (index 12) - * @param {Number} m31 Component in column 3, row 1 position (index 13) - * @param {Number} m32 Component in column 3, row 2 position (index 14) - * @param {Number} m33 Component in column 3, row 3 position (index 15) - * @returns {mat4} out - */ - -function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { - out[0] = m00; - out[1] = m01; - out[2] = m02; - out[3] = m03; - out[4] = m10; - out[5] = m11; - out[6] = m12; - out[7] = m13; - out[8] = m20; - out[9] = m21; - out[10] = m22; - out[11] = m23; - out[12] = m30; - out[13] = m31; - out[14] = m32; - out[15] = m33; - return out; -} -/** - * Set a mat4 to the identity matrix - * - * @param {mat4} out the receiving matrix - * @returns {mat4} out - */ - -function identity(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Transpose the values of a mat4 - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the source matrix - * @returns {mat4} out - */ - -function transpose(out, a) { - // If we are transposing ourselves we can skip a few steps but have to cache some values - if (out === a) { - var a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a12 = a[6], - a13 = a[7]; - var a23 = a[11]; - out[1] = a[4]; - out[2] = a[8]; - out[3] = a[12]; - out[4] = a01; - out[6] = a[9]; - out[7] = a[13]; - out[8] = a02; - out[9] = a12; - out[11] = a[14]; - out[12] = a03; - out[13] = a13; - out[14] = a23; - } else { - out[0] = a[0]; - out[1] = a[4]; - out[2] = a[8]; - out[3] = a[12]; - out[4] = a[1]; - out[5] = a[5]; - out[6] = a[9]; - out[7] = a[13]; - out[8] = a[2]; - out[9] = a[6]; - out[10] = a[10]; - out[11] = a[14]; - out[12] = a[3]; - out[13] = a[7]; - out[14] = a[11]; - out[15] = a[15]; - } - - return out; -} -/** - * Inverts a mat4 - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the source matrix - * @returns {mat4} out - */ - -function invert(out, a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7]; - var a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; - var a30 = a[12], - a31 = a[13], - a32 = a[14], - a33 = a[15]; - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; // Calculate the determinant - - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) { - return null; - } - - det = 1.0 / det; - out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; - out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; - out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; - out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; - out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; - out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; - out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; - return out; -} -/** - * Calculates the adjugate of a mat4 - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the source matrix - * @returns {mat4} out - */ - -function adjoint(out, a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7]; - var a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; - var a30 = a[12], - a31 = a[13], - a32 = a[14], - a33 = a[15]; - out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22); - out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); - out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12); - out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); - out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); - out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22); - out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); - out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12); - out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21); - out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); - out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11); - out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); - out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); - out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21); - out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); - out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11); - return out; -} -/** - * Calculates the determinant of a mat4 - * - * @param {ReadonlyMat4} a the source matrix - * @returns {Number} determinant of a - */ - -function determinant(a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7]; - var a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; - var a30 = a[12], - a31 = a[13], - a32 = a[14], - a33 = a[15]; - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; // Calculate the determinant - - return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; -} -/** - * Multiplies two mat4s - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the first operand - * @param {ReadonlyMat4} b the second operand - * @returns {mat4} out - */ - -function multiply(out, a, b) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7]; - var a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; - var a30 = a[12], - a31 = a[13], - a32 = a[14], - a33 = a[15]; // Cache only the current line of the second matrix - - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3]; - out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - b0 = b[4]; - b1 = b[5]; - b2 = b[6]; - b3 = b[7]; - out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - b0 = b[8]; - b1 = b[9]; - b2 = b[10]; - b3 = b[11]; - out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - b0 = b[12]; - b1 = b[13]; - b2 = b[14]; - b3 = b[15]; - out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - return out; -} -/** - * Translate a mat4 by the given vector - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to translate - * @param {ReadonlyVec3} v vector to translate by - * @returns {mat4} out - */ - -function translate(out, a, v) { - var x = v[0], - y = v[1], - z = v[2]; - var a00, a01, a02, a03; - var a10, a11, a12, a13; - var a20, a21, a22, a23; - - if (a === out) { - out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - } else { - a00 = a[0]; - a01 = a[1]; - a02 = a[2]; - a03 = a[3]; - a10 = a[4]; - a11 = a[5]; - a12 = a[6]; - a13 = a[7]; - a20 = a[8]; - a21 = a[9]; - a22 = a[10]; - a23 = a[11]; - out[0] = a00; - out[1] = a01; - out[2] = a02; - out[3] = a03; - out[4] = a10; - out[5] = a11; - out[6] = a12; - out[7] = a13; - out[8] = a20; - out[9] = a21; - out[10] = a22; - out[11] = a23; - out[12] = a00 * x + a10 * y + a20 * z + a[12]; - out[13] = a01 * x + a11 * y + a21 * z + a[13]; - out[14] = a02 * x + a12 * y + a22 * z + a[14]; - out[15] = a03 * x + a13 * y + a23 * z + a[15]; - } - - return out; -} -/** - * Scales the mat4 by the dimensions in the given vec3 not using vectorization - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to scale - * @param {ReadonlyVec3} v the vec3 to scale the matrix by - * @returns {mat4} out - **/ - -function scale(out, a, v) { - var x = v[0], - y = v[1], - z = v[2]; - out[0] = a[0] * x; - out[1] = a[1] * x; - out[2] = a[2] * x; - out[3] = a[3] * x; - out[4] = a[4] * y; - out[5] = a[5] * y; - out[6] = a[6] * y; - out[7] = a[7] * y; - out[8] = a[8] * z; - out[9] = a[9] * z; - out[10] = a[10] * z; - out[11] = a[11] * z; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - return out; -} -/** - * Rotates a mat4 by the given angle around the given axis - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @param {ReadonlyVec3} axis the axis to rotate around - * @returns {mat4} out - */ - -function rotate(out, a, rad, axis) { - var x = axis[0], - y = axis[1], - z = axis[2]; - var len = Math.hypot(x, y, z); - var s, c, t; - var a00, a01, a02, a03; - var a10, a11, a12, a13; - var a20, a21, a22, a23; - var b00, b01, b02; - var b10, b11, b12; - var b20, b21, b22; - - if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - return null; - } - - len = 1 / len; - x *= len; - y *= len; - z *= len; - s = Math.sin(rad); - c = Math.cos(rad); - t = 1 - c; - a00 = a[0]; - a01 = a[1]; - a02 = a[2]; - a03 = a[3]; - a10 = a[4]; - a11 = a[5]; - a12 = a[6]; - a13 = a[7]; - a20 = a[8]; - a21 = a[9]; - a22 = a[10]; - a23 = a[11]; // Construct the elements of the rotation matrix - - b00 = x * x * t + c; - b01 = y * x * t + z * s; - b02 = z * x * t - y * s; - b10 = x * y * t - z * s; - b11 = y * y * t + c; - b12 = z * y * t + x * s; - b20 = x * z * t + y * s; - b21 = y * z * t - x * s; - b22 = z * z * t + c; // Perform rotation-specific matrix multiplication - - out[0] = a00 * b00 + a10 * b01 + a20 * b02; - out[1] = a01 * b00 + a11 * b01 + a21 * b02; - out[2] = a02 * b00 + a12 * b01 + a22 * b02; - out[3] = a03 * b00 + a13 * b01 + a23 * b02; - out[4] = a00 * b10 + a10 * b11 + a20 * b12; - out[5] = a01 * b10 + a11 * b11 + a21 * b12; - out[6] = a02 * b10 + a12 * b11 + a22 * b12; - out[7] = a03 * b10 + a13 * b11 + a23 * b12; - out[8] = a00 * b20 + a10 * b21 + a20 * b22; - out[9] = a01 * b20 + a11 * b21 + a21 * b22; - out[10] = a02 * b20 + a12 * b21 + a22 * b22; - out[11] = a03 * b20 + a13 * b21 + a23 * b22; - - if (a !== out) { - // If the source and destination differ, copy the unchanged last row - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - } - - return out; -} -/** - * Rotates a matrix by the given angle around the X axis - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function rotateX(out, a, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - if (a !== out) { - // If the source and destination differ, copy the unchanged rows - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - } // Perform axis-specific matrix multiplication - - - out[4] = a10 * c + a20 * s; - out[5] = a11 * c + a21 * s; - out[6] = a12 * c + a22 * s; - out[7] = a13 * c + a23 * s; - out[8] = a20 * c - a10 * s; - out[9] = a21 * c - a11 * s; - out[10] = a22 * c - a12 * s; - out[11] = a23 * c - a13 * s; - return out; -} -/** - * Rotates a matrix by the given angle around the Y axis - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function rotateY(out, a, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - if (a !== out) { - // If the source and destination differ, copy the unchanged rows - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - } // Perform axis-specific matrix multiplication - - - out[0] = a00 * c - a20 * s; - out[1] = a01 * c - a21 * s; - out[2] = a02 * c - a22 * s; - out[3] = a03 * c - a23 * s; - out[8] = a00 * s + a20 * c; - out[9] = a01 * s + a21 * c; - out[10] = a02 * s + a22 * c; - out[11] = a03 * s + a23 * c; - return out; -} -/** - * Rotates a matrix by the given angle around the Z axis - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function rotateZ(out, a, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - if (a !== out) { - // If the source and destination differ, copy the unchanged last row - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - } // Perform axis-specific matrix multiplication - - - out[0] = a00 * c + a10 * s; - out[1] = a01 * c + a11 * s; - out[2] = a02 * c + a12 * s; - out[3] = a03 * c + a13 * s; - out[4] = a10 * c - a00 * s; - out[5] = a11 * c - a01 * s; - out[6] = a12 * c - a02 * s; - out[7] = a13 * c - a03 * s; - return out; -} -/** - * Creates a matrix from a vector translation - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, dest, vec); - * - * @param {mat4} out mat4 receiving operation result - * @param {ReadonlyVec3} v Translation vector - * @returns {mat4} out - */ - -function fromTranslation(out, v) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = v[0]; - out[13] = v[1]; - out[14] = v[2]; - out[15] = 1; - return out; -} -/** - * Creates a matrix from a vector scaling - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.scale(dest, dest, vec); - * - * @param {mat4} out mat4 receiving operation result - * @param {ReadonlyVec3} v Scaling vector - * @returns {mat4} out - */ - -function fromScaling(out, v) { - out[0] = v[0]; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = v[1]; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = v[2]; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Creates a matrix from a given angle around a given axis - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotate(dest, dest, rad, axis); - * - * @param {mat4} out mat4 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @param {ReadonlyVec3} axis the axis to rotate around - * @returns {mat4} out - */ - -function fromRotation(out, rad, axis) { - var x = axis[0], - y = axis[1], - z = axis[2]; - var len = Math.hypot(x, y, z); - var s, c, t; - - if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - return null; - } - - len = 1 / len; - x *= len; - y *= len; - z *= len; - s = Math.sin(rad); - c = Math.cos(rad); - t = 1 - c; // Perform rotation-specific matrix multiplication - - out[0] = x * x * t + c; - out[1] = y * x * t + z * s; - out[2] = z * x * t - y * s; - out[3] = 0; - out[4] = x * y * t - z * s; - out[5] = y * y * t + c; - out[6] = z * y * t + x * s; - out[7] = 0; - out[8] = x * z * t + y * s; - out[9] = y * z * t - x * s; - out[10] = z * z * t + c; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Creates a matrix from the given angle around the X axis - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateX(dest, dest, rad); - * - * @param {mat4} out mat4 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function fromXRotation(out, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); // Perform axis-specific matrix multiplication - - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = c; - out[6] = s; - out[7] = 0; - out[8] = 0; - out[9] = -s; - out[10] = c; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Creates a matrix from the given angle around the Y axis - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateY(dest, dest, rad); - * - * @param {mat4} out mat4 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function fromYRotation(out, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); // Perform axis-specific matrix multiplication - - out[0] = c; - out[1] = 0; - out[2] = -s; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = s; - out[9] = 0; - out[10] = c; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Creates a matrix from the given angle around the Z axis - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateZ(dest, dest, rad); - * - * @param {mat4} out mat4 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function fromZRotation(out, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); // Perform axis-specific matrix multiplication - - out[0] = c; - out[1] = s; - out[2] = 0; - out[3] = 0; - out[4] = -s; - out[5] = c; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Creates a matrix from a quaternion rotation and vector translation - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * - * @param {mat4} out mat4 receiving operation result - * @param {quat4} q Rotation quaternion - * @param {ReadonlyVec3} v Translation vector - * @returns {mat4} out - */ - -function fromRotationTranslation(out, q, v) { - // Quaternion math - var x = q[0], - y = q[1], - z = q[2], - w = q[3]; - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - out[0] = 1 - (yy + zz); - out[1] = xy + wz; - out[2] = xz - wy; - out[3] = 0; - out[4] = xy - wz; - out[5] = 1 - (xx + zz); - out[6] = yz + wx; - out[7] = 0; - out[8] = xz + wy; - out[9] = yz - wx; - out[10] = 1 - (xx + yy); - out[11] = 0; - out[12] = v[0]; - out[13] = v[1]; - out[14] = v[2]; - out[15] = 1; - return out; -} -/** - * Creates a new mat4 from a dual quat. - * - * @param {mat4} out Matrix - * @param {ReadonlyQuat2} a Dual Quaternion - * @returns {mat4} mat4 receiving operation result - */ - -function fromQuat2(out, a) { - var translation = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - var bx = -a[0], - by = -a[1], - bz = -a[2], - bw = a[3], - ax = a[4], - ay = a[5], - az = a[6], - aw = a[7]; - var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense - - if (magnitude > 0) { - translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude; - translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude; - translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude; - } else { - translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; - translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; - translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; - } - - fromRotationTranslation(out, a, translation); - return out; -} -/** - * Returns the translation vector component of a transformation - * matrix. If a matrix is built with fromRotationTranslation, - * the returned vector will be the same as the translation vector - * originally supplied. - * @param {vec3} out Vector to receive translation component - * @param {ReadonlyMat4} mat Matrix to be decomposed (input) - * @return {vec3} out - */ - -function getTranslation(out, mat) { - out[0] = mat[12]; - out[1] = mat[13]; - out[2] = mat[14]; - return out; -} -/** - * Returns the scaling factor component of a transformation - * matrix. If a matrix is built with fromRotationTranslationScale - * with a normalized Quaternion paramter, the returned vector will be - * the same as the scaling vector - * originally supplied. - * @param {vec3} out Vector to receive scaling factor component - * @param {ReadonlyMat4} mat Matrix to be decomposed (input) - * @return {vec3} out - */ - -function getScaling(out, mat) { - var m11 = mat[0]; - var m12 = mat[1]; - var m13 = mat[2]; - var m21 = mat[4]; - var m22 = mat[5]; - var m23 = mat[6]; - var m31 = mat[8]; - var m32 = mat[9]; - var m33 = mat[10]; - out[0] = Math.hypot(m11, m12, m13); - out[1] = Math.hypot(m21, m22, m23); - out[2] = Math.hypot(m31, m32, m33); - return out; -} -/** - * Returns a quaternion representing the rotational component - * of a transformation matrix. If a matrix is built with - * fromRotationTranslation, the returned quaternion will be the - * same as the quaternion originally supplied. - * @param {quat} out Quaternion to receive the rotation component - * @param {ReadonlyMat4} mat Matrix to be decomposed (input) - * @return {quat} out - */ - -function getRotation(out, mat) { - var scaling = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - getScaling(scaling, mat); - var is1 = 1 / scaling[0]; - var is2 = 1 / scaling[1]; - var is3 = 1 / scaling[2]; - var sm11 = mat[0] * is1; - var sm12 = mat[1] * is2; - var sm13 = mat[2] * is3; - var sm21 = mat[4] * is1; - var sm22 = mat[5] * is2; - var sm23 = mat[6] * is3; - var sm31 = mat[8] * is1; - var sm32 = mat[9] * is2; - var sm33 = mat[10] * is3; - var trace = sm11 + sm22 + sm33; - var S = 0; - - if (trace > 0) { - S = Math.sqrt(trace + 1.0) * 2; - out[3] = 0.25 * S; - out[0] = (sm23 - sm32) / S; - out[1] = (sm31 - sm13) / S; - out[2] = (sm12 - sm21) / S; - } else if (sm11 > sm22 && sm11 > sm33) { - S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2; - out[3] = (sm23 - sm32) / S; - out[0] = 0.25 * S; - out[1] = (sm12 + sm21) / S; - out[2] = (sm31 + sm13) / S; - } else if (sm22 > sm33) { - S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2; - out[3] = (sm31 - sm13) / S; - out[0] = (sm12 + sm21) / S; - out[1] = 0.25 * S; - out[2] = (sm23 + sm32) / S; - } else { - S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2; - out[3] = (sm12 - sm21) / S; - out[0] = (sm31 + sm13) / S; - out[1] = (sm23 + sm32) / S; - out[2] = 0.25 * S; - } - - return out; -} -/** - * Creates a matrix from a quaternion rotation, vector translation and vector scale - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale) - * - * @param {mat4} out mat4 receiving operation result - * @param {quat4} q Rotation quaternion - * @param {ReadonlyVec3} v Translation vector - * @param {ReadonlyVec3} s Scaling vector - * @returns {mat4} out - */ - -function fromRotationTranslationScale(out, q, v, s) { - // Quaternion math - var x = q[0], - y = q[1], - z = q[2], - w = q[3]; - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - var sx = s[0]; - var sy = s[1]; - var sz = s[2]; - out[0] = (1 - (yy + zz)) * sx; - out[1] = (xy + wz) * sx; - out[2] = (xz - wy) * sx; - out[3] = 0; - out[4] = (xy - wz) * sy; - out[5] = (1 - (xx + zz)) * sy; - out[6] = (yz + wx) * sy; - out[7] = 0; - out[8] = (xz + wy) * sz; - out[9] = (yz - wx) * sz; - out[10] = (1 - (xx + yy)) * sz; - out[11] = 0; - out[12] = v[0]; - out[13] = v[1]; - out[14] = v[2]; - out[15] = 1; - return out; -} -/** - * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * mat4.translate(dest, origin); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale) - * mat4.translate(dest, negativeOrigin); - * - * @param {mat4} out mat4 receiving operation result - * @param {quat4} q Rotation quaternion - * @param {ReadonlyVec3} v Translation vector - * @param {ReadonlyVec3} s Scaling vector - * @param {ReadonlyVec3} o The origin vector around which to scale and rotate - * @returns {mat4} out - */ - -function fromRotationTranslationScaleOrigin(out, q, v, s, o) { - // Quaternion math - var x = q[0], - y = q[1], - z = q[2], - w = q[3]; - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - var sx = s[0]; - var sy = s[1]; - var sz = s[2]; - var ox = o[0]; - var oy = o[1]; - var oz = o[2]; - var out0 = (1 - (yy + zz)) * sx; - var out1 = (xy + wz) * sx; - var out2 = (xz - wy) * sx; - var out4 = (xy - wz) * sy; - var out5 = (1 - (xx + zz)) * sy; - var out6 = (yz + wx) * sy; - var out8 = (xz + wy) * sz; - var out9 = (yz - wx) * sz; - var out10 = (1 - (xx + yy)) * sz; - out[0] = out0; - out[1] = out1; - out[2] = out2; - out[3] = 0; - out[4] = out4; - out[5] = out5; - out[6] = out6; - out[7] = 0; - out[8] = out8; - out[9] = out9; - out[10] = out10; - out[11] = 0; - out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz); - out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz); - out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz); - out[15] = 1; - return out; -} -/** - * Calculates a 4x4 matrix from the given quaternion - * - * @param {mat4} out mat4 receiving operation result - * @param {ReadonlyQuat} q Quaternion to create matrix from - * - * @returns {mat4} out - */ - -function fromQuat(out, q) { - var x = q[0], - y = q[1], - z = q[2], - w = q[3]; - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - var xx = x * x2; - var yx = y * x2; - var yy = y * y2; - var zx = z * x2; - var zy = z * y2; - var zz = z * z2; - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - out[0] = 1 - yy - zz; - out[1] = yx + wz; - out[2] = zx - wy; - out[3] = 0; - out[4] = yx - wz; - out[5] = 1 - xx - zz; - out[6] = zy + wx; - out[7] = 0; - out[8] = zx + wy; - out[9] = zy - wx; - out[10] = 1 - xx - yy; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Generates a frustum matrix with the given bounds - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {Number} left Left bound of the frustum - * @param {Number} right Right bound of the frustum - * @param {Number} bottom Bottom bound of the frustum - * @param {Number} top Top bound of the frustum - * @param {Number} near Near bound of the frustum - * @param {Number} far Far bound of the frustum - * @returns {mat4} out - */ - -function frustum(out, left, right, bottom, top, near, far) { - var rl = 1 / (right - left); - var tb = 1 / (top - bottom); - var nf = 1 / (near - far); - out[0] = near * 2 * rl; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = near * 2 * tb; - out[6] = 0; - out[7] = 0; - out[8] = (right + left) * rl; - out[9] = (top + bottom) * tb; - out[10] = (far + near) * nf; - out[11] = -1; - out[12] = 0; - out[13] = 0; - out[14] = far * near * 2 * nf; - out[15] = 0; - return out; -} -/** - * Generates a perspective projection matrix with the given bounds. - * Passing null/undefined/no value for far will generate infinite projection matrix. - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {number} fovy Vertical field of view in radians - * @param {number} aspect Aspect ratio. typically viewport width/height - * @param {number} near Near bound of the frustum - * @param {number} far Far bound of the frustum, can be null or Infinity - * @returns {mat4} out - */ - -function perspective(out, fovy, aspect, near, far) { - var f = 1.0 / Math.tan(fovy / 2), - nf; - out[0] = f / aspect; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = f; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[11] = -1; - out[12] = 0; - out[13] = 0; - out[15] = 0; - - if (far != null && far !== Infinity) { - nf = 1 / (near - far); - out[10] = (far + near) * nf; - out[14] = 2 * far * near * nf; - } else { - out[10] = -1; - out[14] = -2 * near; - } - - return out; -} -/** - * Generates a perspective projection matrix with the given field of view. - * This is primarily useful for generating projection matrices to be used - * with the still experiemental WebVR API. - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees - * @param {number} near Near bound of the frustum - * @param {number} far Far bound of the frustum - * @returns {mat4} out - */ - -function perspectiveFromFieldOfView(out, fov, near, far) { - var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0); - var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0); - var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0); - var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0); - var xScale = 2.0 / (leftTan + rightTan); - var yScale = 2.0 / (upTan + downTan); - out[0] = xScale; - out[1] = 0.0; - out[2] = 0.0; - out[3] = 0.0; - out[4] = 0.0; - out[5] = yScale; - out[6] = 0.0; - out[7] = 0.0; - out[8] = -((leftTan - rightTan) * xScale * 0.5); - out[9] = (upTan - downTan) * yScale * 0.5; - out[10] = far / (near - far); - out[11] = -1.0; - out[12] = 0.0; - out[13] = 0.0; - out[14] = far * near / (near - far); - out[15] = 0.0; - return out; -} -/** - * Generates a orthogonal projection matrix with the given bounds - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {number} left Left bound of the frustum - * @param {number} right Right bound of the frustum - * @param {number} bottom Bottom bound of the frustum - * @param {number} top Top bound of the frustum - * @param {number} near Near bound of the frustum - * @param {number} far Far bound of the frustum - * @returns {mat4} out - */ - -function ortho(out, left, right, bottom, top, near, far) { - var lr = 1 / (left - right); - var bt = 1 / (bottom - top); - var nf = 1 / (near - far); - out[0] = -2 * lr; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = -2 * bt; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 2 * nf; - out[11] = 0; - out[12] = (left + right) * lr; - out[13] = (top + bottom) * bt; - out[14] = (far + near) * nf; - out[15] = 1; - return out; -} -/** - * Generates a look-at matrix with the given eye position, focal point, and up axis. - * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {ReadonlyVec3} eye Position of the viewer - * @param {ReadonlyVec3} center Point the viewer is looking at - * @param {ReadonlyVec3} up vec3 pointing up - * @returns {mat4} out - */ - -function lookAt(out, eye, center, up) { - var x0, x1, x2, y0, y1, y2, z0, z1, z2, len; - var eyex = eye[0]; - var eyey = eye[1]; - var eyez = eye[2]; - var upx = up[0]; - var upy = up[1]; - var upz = up[2]; - var centerx = center[0]; - var centery = center[1]; - var centerz = center[2]; - - if (Math.abs(eyex - centerx) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON && Math.abs(eyey - centery) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON && Math.abs(eyez - centerz) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - return identity(out); - } - - z0 = eyex - centerx; - z1 = eyey - centery; - z2 = eyez - centerz; - len = 1 / Math.hypot(z0, z1, z2); - z0 *= len; - z1 *= len; - z2 *= len; - x0 = upy * z2 - upz * z1; - x1 = upz * z0 - upx * z2; - x2 = upx * z1 - upy * z0; - len = Math.hypot(x0, x1, x2); - - if (!len) { - x0 = 0; - x1 = 0; - x2 = 0; - } else { - len = 1 / len; - x0 *= len; - x1 *= len; - x2 *= len; - } - - y0 = z1 * x2 - z2 * x1; - y1 = z2 * x0 - z0 * x2; - y2 = z0 * x1 - z1 * x0; - len = Math.hypot(y0, y1, y2); - - if (!len) { - y0 = 0; - y1 = 0; - y2 = 0; - } else { - len = 1 / len; - y0 *= len; - y1 *= len; - y2 *= len; - } - - out[0] = x0; - out[1] = y0; - out[2] = z0; - out[3] = 0; - out[4] = x1; - out[5] = y1; - out[6] = z1; - out[7] = 0; - out[8] = x2; - out[9] = y2; - out[10] = z2; - out[11] = 0; - out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); - out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); - out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); - out[15] = 1; - return out; -} -/** - * Generates a matrix that makes something look at something else. - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {ReadonlyVec3} eye Position of the viewer - * @param {ReadonlyVec3} center Point the viewer is looking at - * @param {ReadonlyVec3} up vec3 pointing up - * @returns {mat4} out - */ - -function targetTo(out, eye, target, up) { - var eyex = eye[0], - eyey = eye[1], - eyez = eye[2], - upx = up[0], - upy = up[1], - upz = up[2]; - var z0 = eyex - target[0], - z1 = eyey - target[1], - z2 = eyez - target[2]; - var len = z0 * z0 + z1 * z1 + z2 * z2; - - if (len > 0) { - len = 1 / Math.sqrt(len); - z0 *= len; - z1 *= len; - z2 *= len; - } - - var x0 = upy * z2 - upz * z1, - x1 = upz * z0 - upx * z2, - x2 = upx * z1 - upy * z0; - len = x0 * x0 + x1 * x1 + x2 * x2; - - if (len > 0) { - len = 1 / Math.sqrt(len); - x0 *= len; - x1 *= len; - x2 *= len; - } - - out[0] = x0; - out[1] = x1; - out[2] = x2; - out[3] = 0; - out[4] = z1 * x2 - z2 * x1; - out[5] = z2 * x0 - z0 * x2; - out[6] = z0 * x1 - z1 * x0; - out[7] = 0; - out[8] = z0; - out[9] = z1; - out[10] = z2; - out[11] = 0; - out[12] = eyex; - out[13] = eyey; - out[14] = eyez; - out[15] = 1; - return out; -} -/** - * Returns a string representation of a mat4 - * - * @param {ReadonlyMat4} a matrix to represent as a string - * @returns {String} string representation of the matrix - */ - -function str(a) { - return "mat4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ", " + a[9] + ", " + a[10] + ", " + a[11] + ", " + a[12] + ", " + a[13] + ", " + a[14] + ", " + a[15] + ")"; -} -/** - * Returns Frobenius norm of a mat4 - * - * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of - * @returns {Number} Frobenius norm - */ - -function frob(a) { - return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); -} -/** - * Adds two mat4's - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the first operand - * @param {ReadonlyMat4} b the second operand - * @returns {mat4} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - out[4] = a[4] + b[4]; - out[5] = a[5] + b[5]; - out[6] = a[6] + b[6]; - out[7] = a[7] + b[7]; - out[8] = a[8] + b[8]; - out[9] = a[9] + b[9]; - out[10] = a[10] + b[10]; - out[11] = a[11] + b[11]; - out[12] = a[12] + b[12]; - out[13] = a[13] + b[13]; - out[14] = a[14] + b[14]; - out[15] = a[15] + b[15]; - return out; -} -/** - * Subtracts matrix b from matrix a - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the first operand - * @param {ReadonlyMat4} b the second operand - * @returns {mat4} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - out[3] = a[3] - b[3]; - out[4] = a[4] - b[4]; - out[5] = a[5] - b[5]; - out[6] = a[6] - b[6]; - out[7] = a[7] - b[7]; - out[8] = a[8] - b[8]; - out[9] = a[9] - b[9]; - out[10] = a[10] - b[10]; - out[11] = a[11] - b[11]; - out[12] = a[12] - b[12]; - out[13] = a[13] - b[13]; - out[14] = a[14] - b[14]; - out[15] = a[15] - b[15]; - return out; -} -/** - * Multiply each element of the matrix by a scalar. - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to scale - * @param {Number} b amount to scale the matrix's elements by - * @returns {mat4} out - */ - -function multiplyScalar(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - out[4] = a[4] * b; - out[5] = a[5] * b; - out[6] = a[6] * b; - out[7] = a[7] * b; - out[8] = a[8] * b; - out[9] = a[9] * b; - out[10] = a[10] * b; - out[11] = a[11] * b; - out[12] = a[12] * b; - out[13] = a[13] * b; - out[14] = a[14] * b; - out[15] = a[15] * b; - return out; -} -/** - * Adds two mat4's after multiplying each element of the second operand by a scalar value. - * - * @param {mat4} out the receiving vector - * @param {ReadonlyMat4} a the first operand - * @param {ReadonlyMat4} b the second operand - * @param {Number} scale the amount to scale b's elements by before adding - * @returns {mat4} out - */ - -function multiplyScalarAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - out[3] = a[3] + b[3] * scale; - out[4] = a[4] + b[4] * scale; - out[5] = a[5] + b[5] * scale; - out[6] = a[6] + b[6] * scale; - out[7] = a[7] + b[7] * scale; - out[8] = a[8] + b[8] * scale; - out[9] = a[9] + b[9] * scale; - out[10] = a[10] + b[10] * scale; - out[11] = a[11] + b[11] * scale; - out[12] = a[12] + b[12] * scale; - out[13] = a[13] + b[13] * scale; - out[14] = a[14] + b[14] * scale; - out[15] = a[15] + b[15] * scale; - return out; -} -/** - * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyMat4} a The first matrix. - * @param {ReadonlyMat4} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15]; -} -/** - * Returns whether or not the matrices have approximately the same elements in the same position. - * - * @param {ReadonlyMat4} a The first matrix. - * @param {ReadonlyMat4} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var a4 = a[4], - a5 = a[5], - a6 = a[6], - a7 = a[7]; - var a8 = a[8], - a9 = a[9], - a10 = a[10], - a11 = a[11]; - var a12 = a[12], - a13 = a[13], - a14 = a[14], - a15 = a[15]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3]; - var b4 = b[4], - b5 = b[5], - b6 = b[6], - b7 = b[7]; - var b8 = b[8], - b9 = b[9], - b10 = b[10], - b11 = b[11]; - var b12 = b[12], - b13 = b[13], - b14 = b[14], - b15 = b[15]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15)); -} -/** - * Alias for {@link mat4.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link mat4.subtract} - * @function - */ - -var sub = subtract; - -/***/ }), -/* 18 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "setAxisAngle": () => (/* binding */ setAxisAngle), -/* harmony export */ "getAxisAngle": () => (/* binding */ getAxisAngle), -/* harmony export */ "getAngle": () => (/* binding */ getAngle), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "rotateX": () => (/* binding */ rotateX), -/* harmony export */ "rotateY": () => (/* binding */ rotateY), -/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), -/* harmony export */ "calculateW": () => (/* binding */ calculateW), -/* harmony export */ "exp": () => (/* binding */ exp), -/* harmony export */ "ln": () => (/* binding */ ln), -/* harmony export */ "pow": () => (/* binding */ pow), -/* harmony export */ "slerp": () => (/* binding */ slerp), -/* harmony export */ "random": () => (/* binding */ random), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "conjugate": () => (/* binding */ conjugate), -/* harmony export */ "fromMat3": () => (/* binding */ fromMat3), -/* harmony export */ "fromEuler": () => (/* binding */ fromEuler), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "dot": () => (/* binding */ dot), -/* harmony export */ "lerp": () => (/* binding */ lerp), -/* harmony export */ "length": () => (/* binding */ length), -/* harmony export */ "len": () => (/* binding */ len), -/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), -/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), -/* harmony export */ "normalize": () => (/* binding */ normalize), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "rotationTo": () => (/* binding */ rotationTo), -/* harmony export */ "sqlerp": () => (/* binding */ sqlerp), -/* harmony export */ "setAxes": () => (/* binding */ setAxes) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); -/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16); -/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20); -/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19); - - - - -/** - * Quaternion - * @module quat - */ - -/** - * Creates a new identity quat - * - * @returns {quat} a new quaternion - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - } - - out[3] = 1; - return out; -} -/** - * Set a quat to the identity quaternion - * - * @param {quat} out the receiving quaternion - * @returns {quat} out - */ - -function identity(out) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 1; - return out; -} -/** - * Sets a quat from the given angle and rotation axis, - * then returns it. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyVec3} axis the axis around which to rotate - * @param {Number} rad the angle in radians - * @returns {quat} out - **/ - -function setAxisAngle(out, axis, rad) { - rad = rad * 0.5; - var s = Math.sin(rad); - out[0] = s * axis[0]; - out[1] = s * axis[1]; - out[2] = s * axis[2]; - out[3] = Math.cos(rad); - return out; -} -/** - * Gets the rotation axis and angle for a given - * quaternion. If a quaternion is created with - * setAxisAngle, this method will return the same - * values as providied in the original parameter list - * OR functionally equivalent values. - * Example: The quaternion formed by axis [0, 0, 1] and - * angle -90 is the same as the quaternion formed by - * [0, 0, 1] and 270. This method favors the latter. - * @param {vec3} out_axis Vector receiving the axis of rotation - * @param {ReadonlyQuat} q Quaternion to be decomposed - * @return {Number} Angle, in radians, of the rotation - */ - -function getAxisAngle(out_axis, q) { - var rad = Math.acos(q[3]) * 2.0; - var s = Math.sin(rad / 2.0); - - if (s > _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - out_axis[0] = q[0] / s; - out_axis[1] = q[1] / s; - out_axis[2] = q[2] / s; - } else { - // If s is zero, return any axis (no rotation - axis does not matter) - out_axis[0] = 1; - out_axis[1] = 0; - out_axis[2] = 0; - } - - return rad; -} -/** - * Gets the angular distance between two unit quaternions - * - * @param {ReadonlyQuat} a Origin unit quaternion - * @param {ReadonlyQuat} b Destination unit quaternion - * @return {Number} Angle, in radians, between the two quaternions - */ - -function getAngle(a, b) { - var dotproduct = dot(a, b); - return Math.acos(2 * dotproduct * dotproduct - 1); -} -/** - * Multiplies two quat's - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @returns {quat} out - */ - -function multiply(out, a, b) { - var ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - var bx = b[0], - by = b[1], - bz = b[2], - bw = b[3]; - out[0] = ax * bw + aw * bx + ay * bz - az * by; - out[1] = ay * bw + aw * by + az * bx - ax * bz; - out[2] = az * bw + aw * bz + ax * by - ay * bx; - out[3] = aw * bw - ax * bx - ay * by - az * bz; - return out; -} -/** - * Rotates a quaternion by the given angle about the X axis - * - * @param {quat} out quat receiving operation result - * @param {ReadonlyQuat} a quat to rotate - * @param {number} rad angle (in radians) to rotate - * @returns {quat} out - */ - -function rotateX(out, a, rad) { - rad *= 0.5; - var ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - var bx = Math.sin(rad), - bw = Math.cos(rad); - out[0] = ax * bw + aw * bx; - out[1] = ay * bw + az * bx; - out[2] = az * bw - ay * bx; - out[3] = aw * bw - ax * bx; - return out; -} -/** - * Rotates a quaternion by the given angle about the Y axis - * - * @param {quat} out quat receiving operation result - * @param {ReadonlyQuat} a quat to rotate - * @param {number} rad angle (in radians) to rotate - * @returns {quat} out - */ - -function rotateY(out, a, rad) { - rad *= 0.5; - var ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - var by = Math.sin(rad), - bw = Math.cos(rad); - out[0] = ax * bw - az * by; - out[1] = ay * bw + aw * by; - out[2] = az * bw + ax * by; - out[3] = aw * bw - ay * by; - return out; -} -/** - * Rotates a quaternion by the given angle about the Z axis - * - * @param {quat} out quat receiving operation result - * @param {ReadonlyQuat} a quat to rotate - * @param {number} rad angle (in radians) to rotate - * @returns {quat} out - */ - -function rotateZ(out, a, rad) { - rad *= 0.5; - var ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - var bz = Math.sin(rad), - bw = Math.cos(rad); - out[0] = ax * bw + ay * bz; - out[1] = ay * bw - ax * bz; - out[2] = az * bw + aw * bz; - out[3] = aw * bw - az * bz; - return out; -} -/** - * Calculates the W component of a quat from the X, Y, and Z components. - * Assumes that quaternion is 1 unit in length. - * Any existing W component will be ignored. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate W component of - * @returns {quat} out - */ - -function calculateW(out, a) { - var x = a[0], - y = a[1], - z = a[2]; - out[0] = x; - out[1] = y; - out[2] = z; - out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z)); - return out; -} -/** - * Calculate the exponential of a unit quaternion. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate the exponential of - * @returns {quat} out - */ - -function exp(out, a) { - var x = a[0], - y = a[1], - z = a[2], - w = a[3]; - var r = Math.sqrt(x * x + y * y + z * z); - var et = Math.exp(w); - var s = r > 0 ? et * Math.sin(r) / r : 0; - out[0] = x * s; - out[1] = y * s; - out[2] = z * s; - out[3] = et * Math.cos(r); - return out; -} -/** - * Calculate the natural logarithm of a unit quaternion. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate the exponential of - * @returns {quat} out - */ - -function ln(out, a) { - var x = a[0], - y = a[1], - z = a[2], - w = a[3]; - var r = Math.sqrt(x * x + y * y + z * z); - var t = r > 0 ? Math.atan2(r, w) / r : 0; - out[0] = x * t; - out[1] = y * t; - out[2] = z * t; - out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w); - return out; -} -/** - * Calculate the scalar power of a unit quaternion. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate the exponential of - * @param {Number} b amount to scale the quaternion by - * @returns {quat} out - */ - -function pow(out, a, b) { - ln(out, a); - scale(out, out, b); - exp(out, out); - return out; -} -/** - * Performs a spherical linear interpolation between two quat - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {quat} out - */ - -function slerp(out, a, b, t) { - // benchmarks: - // http://jsperf.com/quaternion-slerp-implementations - var ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - var bx = b[0], - by = b[1], - bz = b[2], - bw = b[3]; - var omega, cosom, sinom, scale0, scale1; // calc cosine - - cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary) - - if (cosom < 0.0) { - cosom = -cosom; - bx = -bx; - by = -by; - bz = -bz; - bw = -bw; - } // calculate coefficients - - - if (1.0 - cosom > _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - // standard case (slerp) - omega = Math.acos(cosom); - sinom = Math.sin(omega); - scale0 = Math.sin((1.0 - t) * omega) / sinom; - scale1 = Math.sin(t * omega) / sinom; - } else { - // "from" and "to" quaternions are very close - // ... so we can do a linear interpolation - scale0 = 1.0 - t; - scale1 = t; - } // calculate final values - - - out[0] = scale0 * ax + scale1 * bx; - out[1] = scale0 * ay + scale1 * by; - out[2] = scale0 * az + scale1 * bz; - out[3] = scale0 * aw + scale1 * bw; - return out; -} -/** - * Generates a random unit quaternion - * - * @param {quat} out the receiving quaternion - * @returns {quat} out - */ - -function random(out) { - // Implementation of http://planning.cs.uiuc.edu/node198.html - // TODO: Calling random 3 times is probably not the fastest solution - var u1 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); - var u2 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); - var u3 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); - var sqrt1MinusU1 = Math.sqrt(1 - u1); - var sqrtU1 = Math.sqrt(u1); - out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2); - out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2); - out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3); - out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3); - return out; -} -/** - * Calculates the inverse of a quat - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate inverse of - * @returns {quat} out - */ - -function invert(out, a) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; - var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 - - out[0] = -a0 * invDot; - out[1] = -a1 * invDot; - out[2] = -a2 * invDot; - out[3] = a3 * invDot; - return out; -} -/** - * Calculates the conjugate of a quat - * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate conjugate of - * @returns {quat} out - */ - -function conjugate(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - out[2] = -a[2]; - out[3] = a[3]; - return out; -} -/** - * Creates a quaternion from the given 3x3 rotation matrix. - * - * NOTE: The resultant quaternion is not normalized, so you should be sure - * to renormalize the quaternion yourself where necessary. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyMat3} m rotation matrix - * @returns {quat} out - * @function - */ - -function fromMat3(out, m) { - // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes - // article "Quaternion Calculus and Fast Animation". - var fTrace = m[0] + m[4] + m[8]; - var fRoot; - - if (fTrace > 0.0) { - // |w| > 1/2, may as well choose w > 1/2 - fRoot = Math.sqrt(fTrace + 1.0); // 2w - - out[3] = 0.5 * fRoot; - fRoot = 0.5 / fRoot; // 1/(4w) - - out[0] = (m[5] - m[7]) * fRoot; - out[1] = (m[6] - m[2]) * fRoot; - out[2] = (m[1] - m[3]) * fRoot; - } else { - // |w| <= 1/2 - var i = 0; - if (m[4] > m[0]) i = 1; - if (m[8] > m[i * 3 + i]) i = 2; - var j = (i + 1) % 3; - var k = (i + 2) % 3; - fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0); - out[i] = 0.5 * fRoot; - fRoot = 0.5 / fRoot; - out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot; - out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; - out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; - } - - return out; -} -/** - * Creates a quaternion from the given euler angle x, y, z. - * - * @param {quat} out the receiving quaternion - * @param {x} Angle to rotate around X axis in degrees. - * @param {y} Angle to rotate around Y axis in degrees. - * @param {z} Angle to rotate around Z axis in degrees. - * @returns {quat} out - * @function - */ - -function fromEuler(out, x, y, z) { - var halfToRad = 0.5 * Math.PI / 180.0; - x *= halfToRad; - y *= halfToRad; - z *= halfToRad; - var sx = Math.sin(x); - var cx = Math.cos(x); - var sy = Math.sin(y); - var cy = Math.cos(y); - var sz = Math.sin(z); - var cz = Math.cos(z); - out[0] = sx * cy * cz - cx * sy * sz; - out[1] = cx * sy * cz + sx * cy * sz; - out[2] = cx * cy * sz - sx * sy * cz; - out[3] = cx * cy * cz + sx * sy * sz; - return out; -} -/** - * Returns a string representation of a quatenion - * - * @param {ReadonlyQuat} a vector to represent as a string - * @returns {String} string representation of the vector - */ - -function str(a) { - return "quat(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; -} -/** - * Creates a new quat initialized with values from an existing quaternion - * - * @param {ReadonlyQuat} a quaternion to clone - * @returns {quat} a new quaternion - * @function - */ - -var clone = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.clone; -/** - * Creates a new quat initialized with the given values - * - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @param {Number} w W component - * @returns {quat} a new quaternion - * @function - */ - -var fromValues = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.fromValues; -/** - * Copy the values from one quat to another - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the source quaternion - * @returns {quat} out - * @function - */ - -var copy = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.copy; -/** - * Set the components of a quat to the given values - * - * @param {quat} out the receiving quaternion - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @param {Number} w W component - * @returns {quat} out - * @function - */ - -var set = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.set; -/** - * Adds two quat's - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @returns {quat} out - * @function - */ - -var add = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.add; -/** - * Alias for {@link quat.multiply} - * @function - */ - -var mul = multiply; -/** - * Scales a quat by a scalar number - * - * @param {quat} out the receiving vector - * @param {ReadonlyQuat} a the vector to scale - * @param {Number} b amount to scale the vector by - * @returns {quat} out - * @function - */ - -var scale = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.scale; -/** - * Calculates the dot product of two quat's - * - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @returns {Number} dot product of a and b - * @function - */ - -var dot = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.dot; -/** - * Performs a linear interpolation between two quat's - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {quat} out - * @function - */ - -var lerp = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.lerp; -/** - * Calculates the length of a quat - * - * @param {ReadonlyQuat} a vector to calculate length of - * @returns {Number} length of a - */ - -var length = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.length; -/** - * Alias for {@link quat.length} - * @function - */ - -var len = length; -/** - * Calculates the squared length of a quat - * - * @param {ReadonlyQuat} a vector to calculate squared length of - * @returns {Number} squared length of a - * @function - */ - -var squaredLength = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.squaredLength; -/** - * Alias for {@link quat.squaredLength} - * @function - */ - -var sqrLen = squaredLength; -/** - * Normalize a quat - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quaternion to normalize - * @returns {quat} out - * @function - */ - -var normalize = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.normalize; -/** - * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyQuat} a The first quaternion. - * @param {ReadonlyQuat} b The second quaternion. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -var exactEquals = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.exactEquals; -/** - * Returns whether or not the quaternions have approximately the same elements in the same position. - * - * @param {ReadonlyQuat} a The first vector. - * @param {ReadonlyQuat} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -var equals = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.equals; -/** - * Sets a quaternion to represent the shortest rotation from one - * vector to another. - * - * Both vectors are assumed to be unit length. - * - * @param {quat} out the receiving quaternion. - * @param {ReadonlyVec3} a the initial vector - * @param {ReadonlyVec3} b the destination vector - * @returns {quat} out - */ - -var rotationTo = function () { - var tmpvec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.create(); - var xUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.fromValues(1, 0, 0); - var yUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.fromValues(0, 1, 0); - return function (out, a, b) { - var dot = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.dot(a, b); - - if (dot < -0.999999) { - _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, xUnitVec3, a); - if (_vec3_js__WEBPACK_IMPORTED_MODULE_2__.len(tmpvec3) < 0.000001) _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, yUnitVec3, a); - _vec3_js__WEBPACK_IMPORTED_MODULE_2__.normalize(tmpvec3, tmpvec3); - setAxisAngle(out, tmpvec3, Math.PI); - return out; - } else if (dot > 0.999999) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 1; - return out; - } else { - _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, a, b); - out[0] = tmpvec3[0]; - out[1] = tmpvec3[1]; - out[2] = tmpvec3[2]; - out[3] = 1 + dot; - return normalize(out, out); - } - }; -}(); -/** - * Performs a spherical linear interpolation with two control points - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @param {ReadonlyQuat} c the third operand - * @param {ReadonlyQuat} d the fourth operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {quat} out - */ - -var sqlerp = function () { - var temp1 = create(); - var temp2 = create(); - return function (out, a, b, c, d, t) { - slerp(temp1, a, d, t); - slerp(temp2, b, c, t); - slerp(out, temp1, temp2, 2 * t * (1 - t)); - return out; - }; -}(); -/** - * Sets the specified quaternion with values corresponding to the given - * axes. Each axis is a vec3 and is expected to be unit length and - * perpendicular to all other specified axes. - * - * @param {ReadonlyVec3} view the vector representing the viewing direction - * @param {ReadonlyVec3} right the vector representing the local "right" direction - * @param {ReadonlyVec3} up the vector representing the local "up" direction - * @returns {quat} out - */ - -var setAxes = function () { - var matr = _mat3_js__WEBPACK_IMPORTED_MODULE_3__.create(); - return function (out, view, right, up) { - matr[0] = right[0]; - matr[3] = right[1]; - matr[6] = right[2]; - matr[1] = up[0]; - matr[4] = up[1]; - matr[7] = up[2]; - matr[2] = -view[0]; - matr[5] = -view[1]; - matr[8] = -view[2]; - return normalize(out, fromMat3(out, matr)); - }; -}(); - -/***/ }), -/* 19 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "divide": () => (/* binding */ divide), -/* harmony export */ "ceil": () => (/* binding */ ceil), -/* harmony export */ "floor": () => (/* binding */ floor), -/* harmony export */ "min": () => (/* binding */ min), -/* harmony export */ "max": () => (/* binding */ max), -/* harmony export */ "round": () => (/* binding */ round), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), -/* harmony export */ "distance": () => (/* binding */ distance), -/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), -/* harmony export */ "length": () => (/* binding */ length), -/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), -/* harmony export */ "negate": () => (/* binding */ negate), -/* harmony export */ "inverse": () => (/* binding */ inverse), -/* harmony export */ "normalize": () => (/* binding */ normalize), -/* harmony export */ "dot": () => (/* binding */ dot), -/* harmony export */ "cross": () => (/* binding */ cross), -/* harmony export */ "lerp": () => (/* binding */ lerp), -/* harmony export */ "random": () => (/* binding */ random), -/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), -/* harmony export */ "transformQuat": () => (/* binding */ transformQuat), -/* harmony export */ "zero": () => (/* binding */ zero), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "sub": () => (/* binding */ sub), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "div": () => (/* binding */ div), -/* harmony export */ "dist": () => (/* binding */ dist), -/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), -/* harmony export */ "len": () => (/* binding */ len), -/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), -/* harmony export */ "forEach": () => (/* binding */ forEach) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); - -/** - * 4 Dimensional Vector - * @module vec4 - */ - -/** - * Creates a new, empty vec4 - * - * @returns {vec4} a new 4D vector - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 0; - } - - return out; -} -/** - * Creates a new vec4 initialized with values from an existing vector - * - * @param {ReadonlyVec4} a vector to clone - * @returns {vec4} a new 4D vector - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - return out; -} -/** - * Creates a new vec4 initialized with the given values - * - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @param {Number} w W component - * @returns {vec4} a new 4D vector - */ - -function fromValues(x, y, z, w) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - out[0] = x; - out[1] = y; - out[2] = z; - out[3] = w; - return out; -} -/** - * Copy the values from one vec4 to another - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the source vector - * @returns {vec4} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - return out; -} -/** - * Set the components of a vec4 to the given values - * - * @param {vec4} out the receiving vector - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @param {Number} w W component - * @returns {vec4} out - */ - -function set(out, x, y, z, w) { - out[0] = x; - out[1] = y; - out[2] = z; - out[3] = w; - return out; -} -/** - * Adds two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - return out; -} -/** - * Subtracts vector b from vector a - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - out[3] = a[3] - b[3]; - return out; -} -/** - * Multiplies two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function multiply(out, a, b) { - out[0] = a[0] * b[0]; - out[1] = a[1] * b[1]; - out[2] = a[2] * b[2]; - out[3] = a[3] * b[3]; - return out; -} -/** - * Divides two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function divide(out, a, b) { - out[0] = a[0] / b[0]; - out[1] = a[1] / b[1]; - out[2] = a[2] / b[2]; - out[3] = a[3] / b[3]; - return out; -} -/** - * Math.ceil the components of a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to ceil - * @returns {vec4} out - */ - -function ceil(out, a) { - out[0] = Math.ceil(a[0]); - out[1] = Math.ceil(a[1]); - out[2] = Math.ceil(a[2]); - out[3] = Math.ceil(a[3]); - return out; -} -/** - * Math.floor the components of a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to floor - * @returns {vec4} out - */ - -function floor(out, a) { - out[0] = Math.floor(a[0]); - out[1] = Math.floor(a[1]); - out[2] = Math.floor(a[2]); - out[3] = Math.floor(a[3]); - return out; -} -/** - * Returns the minimum of two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function min(out, a, b) { - out[0] = Math.min(a[0], b[0]); - out[1] = Math.min(a[1], b[1]); - out[2] = Math.min(a[2], b[2]); - out[3] = Math.min(a[3], b[3]); - return out; -} -/** - * Returns the maximum of two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function max(out, a, b) { - out[0] = Math.max(a[0], b[0]); - out[1] = Math.max(a[1], b[1]); - out[2] = Math.max(a[2], b[2]); - out[3] = Math.max(a[3], b[3]); - return out; -} -/** - * Math.round the components of a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to round - * @returns {vec4} out - */ - -function round(out, a) { - out[0] = Math.round(a[0]); - out[1] = Math.round(a[1]); - out[2] = Math.round(a[2]); - out[3] = Math.round(a[3]); - return out; -} -/** - * Scales a vec4 by a scalar number - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the vector to scale - * @param {Number} b amount to scale the vector by - * @returns {vec4} out - */ - -function scale(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - return out; -} -/** - * Adds two vec4's after scaling the second operand by a scalar value - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @param {Number} scale the amount to scale b by before adding - * @returns {vec4} out - */ - -function scaleAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - out[3] = a[3] + b[3] * scale; - return out; -} -/** - * Calculates the euclidian distance between two vec4's - * - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {Number} distance between a and b - */ - -function distance(a, b) { - var x = b[0] - a[0]; - var y = b[1] - a[1]; - var z = b[2] - a[2]; - var w = b[3] - a[3]; - return Math.hypot(x, y, z, w); -} -/** - * Calculates the squared euclidian distance between two vec4's - * - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {Number} squared distance between a and b - */ - -function squaredDistance(a, b) { - var x = b[0] - a[0]; - var y = b[1] - a[1]; - var z = b[2] - a[2]; - var w = b[3] - a[3]; - return x * x + y * y + z * z + w * w; -} -/** - * Calculates the length of a vec4 - * - * @param {ReadonlyVec4} a vector to calculate length of - * @returns {Number} length of a - */ - -function length(a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - var w = a[3]; - return Math.hypot(x, y, z, w); -} -/** - * Calculates the squared length of a vec4 - * - * @param {ReadonlyVec4} a vector to calculate squared length of - * @returns {Number} squared length of a - */ - -function squaredLength(a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - var w = a[3]; - return x * x + y * y + z * z + w * w; -} -/** - * Negates the components of a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to negate - * @returns {vec4} out - */ - -function negate(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - out[2] = -a[2]; - out[3] = -a[3]; - return out; -} -/** - * Returns the inverse of the components of a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to invert - * @returns {vec4} out - */ - -function inverse(out, a) { - out[0] = 1.0 / a[0]; - out[1] = 1.0 / a[1]; - out[2] = 1.0 / a[2]; - out[3] = 1.0 / a[3]; - return out; -} -/** - * Normalize a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to normalize - * @returns {vec4} out - */ - -function normalize(out, a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - var w = a[3]; - var len = x * x + y * y + z * z + w * w; - - if (len > 0) { - len = 1 / Math.sqrt(len); - } - - out[0] = x * len; - out[1] = y * len; - out[2] = z * len; - out[3] = w * len; - return out; -} -/** - * Calculates the dot product of two vec4's - * - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {Number} dot product of a and b - */ - -function dot(a, b) { - return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; -} -/** - * Returns the cross-product of three vectors in a 4-dimensional space - * - * @param {ReadonlyVec4} result the receiving vector - * @param {ReadonlyVec4} U the first vector - * @param {ReadonlyVec4} V the second vector - * @param {ReadonlyVec4} W the third vector - * @returns {vec4} result - */ - -function cross(out, u, v, w) { - var A = v[0] * w[1] - v[1] * w[0], - B = v[0] * w[2] - v[2] * w[0], - C = v[0] * w[3] - v[3] * w[0], - D = v[1] * w[2] - v[2] * w[1], - E = v[1] * w[3] - v[3] * w[1], - F = v[2] * w[3] - v[3] * w[2]; - var G = u[0]; - var H = u[1]; - var I = u[2]; - var J = u[3]; - out[0] = H * F - I * E + J * D; - out[1] = -(G * F) + I * C - J * B; - out[2] = G * E - H * C + J * A; - out[3] = -(G * D) + H * B - I * A; - return out; -} -/** - * Performs a linear interpolation between two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {vec4} out - */ - -function lerp(out, a, b, t) { - var ax = a[0]; - var ay = a[1]; - var az = a[2]; - var aw = a[3]; - out[0] = ax + t * (b[0] - ax); - out[1] = ay + t * (b[1] - ay); - out[2] = az + t * (b[2] - az); - out[3] = aw + t * (b[3] - aw); - return out; -} -/** - * Generates a random vector with the given scale - * - * @param {vec4} out the receiving vector - * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned - * @returns {vec4} out - */ - -function random(out, scale) { - scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a - // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646. - // http://projecteuclid.org/euclid.aoms/1177692644; - - var v1, v2, v3, v4; - var s1, s2; - - do { - v1 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; - v2 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; - s1 = v1 * v1 + v2 * v2; - } while (s1 >= 1); - - do { - v3 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; - v4 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; - s2 = v3 * v3 + v4 * v4; - } while (s2 >= 1); - - var d = Math.sqrt((1 - s1) / s2); - out[0] = scale * v1; - out[1] = scale * v2; - out[2] = scale * v3 * d; - out[3] = scale * v4 * d; - return out; -} -/** - * Transforms the vec4 with a mat4. - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the vector to transform - * @param {ReadonlyMat4} m matrix to transform with - * @returns {vec4} out - */ - -function transformMat4(out, a, m) { - var x = a[0], - y = a[1], - z = a[2], - w = a[3]; - out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; - out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; - out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; - out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; - return out; -} -/** - * Transforms the vec4 with a quat - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the vector to transform - * @param {ReadonlyQuat} q quaternion to transform with - * @returns {vec4} out - */ - -function transformQuat(out, a, q) { - var x = a[0], - y = a[1], - z = a[2]; - var qx = q[0], - qy = q[1], - qz = q[2], - qw = q[3]; // calculate quat * vec - - var ix = qw * x + qy * z - qz * y; - var iy = qw * y + qz * x - qx * z; - var iz = qw * z + qx * y - qy * x; - var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat - - out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy; - out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz; - out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx; - out[3] = a[3]; - return out; -} -/** - * Set the components of a vec4 to zero - * - * @param {vec4} out the receiving vector - * @returns {vec4} out - */ - -function zero(out) { - out[0] = 0.0; - out[1] = 0.0; - out[2] = 0.0; - out[3] = 0.0; - return out; -} -/** - * Returns a string representation of a vector - * - * @param {ReadonlyVec4} a vector to represent as a string - * @returns {String} string representation of the vector - */ - -function str(a) { - return "vec4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; -} -/** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyVec4} a The first vector. - * @param {ReadonlyVec4} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; -} -/** - * Returns whether or not the vectors have approximately the same elements in the same position. - * - * @param {ReadonlyVec4} a The first vector. - * @param {ReadonlyVec4} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)); -} -/** - * Alias for {@link vec4.subtract} - * @function - */ - -var sub = subtract; -/** - * Alias for {@link vec4.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link vec4.divide} - * @function - */ - -var div = divide; -/** - * Alias for {@link vec4.distance} - * @function - */ - -var dist = distance; -/** - * Alias for {@link vec4.squaredDistance} - * @function - */ - -var sqrDist = squaredDistance; -/** - * Alias for {@link vec4.length} - * @function - */ - -var len = length; -/** - * Alias for {@link vec4.squaredLength} - * @function - */ - -var sqrLen = squaredLength; -/** - * Perform some operation over an array of vec4s. - * - * @param {Array} a the array of vectors to iterate over - * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed - * @param {Number} offset Number of elements to skip at the beginning of the array - * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array - * @param {Function} fn Function to call for each vector in the array - * @param {Object} [arg] additional argument to pass to fn - * @returns {Array} a - * @function - */ - -var forEach = function () { - var vec = create(); - return function (a, stride, offset, count, fn, arg) { - var i, l; - - if (!stride) { - stride = 4; - } - - if (!offset) { - offset = 0; - } - - if (count) { - l = Math.min(count * stride + offset, a.length); - } else { - l = a.length; - } - - for (i = offset; i < l; i += stride) { - vec[0] = a[i]; - vec[1] = a[i + 1]; - vec[2] = a[i + 2]; - vec[3] = a[i + 3]; - fn(vec, vec, arg); - a[i] = vec[0]; - a[i + 1] = vec[1]; - a[i + 2] = vec[2]; - a[i + 3] = vec[3]; - } - - return a; - }; -}(); - -/***/ }), -/* 20 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "length": () => (/* binding */ length), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "divide": () => (/* binding */ divide), -/* harmony export */ "ceil": () => (/* binding */ ceil), -/* harmony export */ "floor": () => (/* binding */ floor), -/* harmony export */ "min": () => (/* binding */ min), -/* harmony export */ "max": () => (/* binding */ max), -/* harmony export */ "round": () => (/* binding */ round), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), -/* harmony export */ "distance": () => (/* binding */ distance), -/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), -/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), -/* harmony export */ "negate": () => (/* binding */ negate), -/* harmony export */ "inverse": () => (/* binding */ inverse), -/* harmony export */ "normalize": () => (/* binding */ normalize), -/* harmony export */ "dot": () => (/* binding */ dot), -/* harmony export */ "cross": () => (/* binding */ cross), -/* harmony export */ "lerp": () => (/* binding */ lerp), -/* harmony export */ "hermite": () => (/* binding */ hermite), -/* harmony export */ "bezier": () => (/* binding */ bezier), -/* harmony export */ "random": () => (/* binding */ random), -/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), -/* harmony export */ "transformMat3": () => (/* binding */ transformMat3), -/* harmony export */ "transformQuat": () => (/* binding */ transformQuat), -/* harmony export */ "rotateX": () => (/* binding */ rotateX), -/* harmony export */ "rotateY": () => (/* binding */ rotateY), -/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), -/* harmony export */ "angle": () => (/* binding */ angle), -/* harmony export */ "zero": () => (/* binding */ zero), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "sub": () => (/* binding */ sub), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "div": () => (/* binding */ div), -/* harmony export */ "dist": () => (/* binding */ dist), -/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), -/* harmony export */ "len": () => (/* binding */ len), -/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), -/* harmony export */ "forEach": () => (/* binding */ forEach) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); - -/** - * 3 Dimensional Vector - * @module vec3 - */ - -/** - * Creates a new, empty vec3 - * - * @returns {vec3} a new 3D vector - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - } - - return out; -} -/** - * Creates a new vec3 initialized with values from an existing vector - * - * @param {ReadonlyVec3} a vector to clone - * @returns {vec3} a new 3D vector - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - return out; -} -/** - * Calculates the length of a vec3 - * - * @param {ReadonlyVec3} a vector to calculate length of - * @returns {Number} length of a - */ - -function length(a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - return Math.hypot(x, y, z); -} -/** - * Creates a new vec3 initialized with the given values - * - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @returns {vec3} a new 3D vector - */ - -function fromValues(x, y, z) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - out[0] = x; - out[1] = y; - out[2] = z; - return out; -} -/** - * Copy the values from one vec3 to another - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the source vector - * @returns {vec3} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - return out; -} -/** - * Set the components of a vec3 to the given values - * - * @param {vec3} out the receiving vector - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @returns {vec3} out - */ - -function set(out, x, y, z) { - out[0] = x; - out[1] = y; - out[2] = z; - return out; -} -/** - * Adds two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - return out; -} -/** - * Subtracts vector b from vector a - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - return out; -} -/** - * Multiplies two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function multiply(out, a, b) { - out[0] = a[0] * b[0]; - out[1] = a[1] * b[1]; - out[2] = a[2] * b[2]; - return out; -} -/** - * Divides two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function divide(out, a, b) { - out[0] = a[0] / b[0]; - out[1] = a[1] / b[1]; - out[2] = a[2] / b[2]; - return out; -} -/** - * Math.ceil the components of a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to ceil - * @returns {vec3} out - */ - -function ceil(out, a) { - out[0] = Math.ceil(a[0]); - out[1] = Math.ceil(a[1]); - out[2] = Math.ceil(a[2]); - return out; -} -/** - * Math.floor the components of a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to floor - * @returns {vec3} out - */ - -function floor(out, a) { - out[0] = Math.floor(a[0]); - out[1] = Math.floor(a[1]); - out[2] = Math.floor(a[2]); - return out; -} -/** - * Returns the minimum of two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function min(out, a, b) { - out[0] = Math.min(a[0], b[0]); - out[1] = Math.min(a[1], b[1]); - out[2] = Math.min(a[2], b[2]); - return out; -} -/** - * Returns the maximum of two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function max(out, a, b) { - out[0] = Math.max(a[0], b[0]); - out[1] = Math.max(a[1], b[1]); - out[2] = Math.max(a[2], b[2]); - return out; -} -/** - * Math.round the components of a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to round - * @returns {vec3} out - */ - -function round(out, a) { - out[0] = Math.round(a[0]); - out[1] = Math.round(a[1]); - out[2] = Math.round(a[2]); - return out; -} -/** - * Scales a vec3 by a scalar number - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the vector to scale - * @param {Number} b amount to scale the vector by - * @returns {vec3} out - */ - -function scale(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - return out; -} -/** - * Adds two vec3's after scaling the second operand by a scalar value - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @param {Number} scale the amount to scale b by before adding - * @returns {vec3} out - */ - -function scaleAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - return out; -} -/** - * Calculates the euclidian distance between two vec3's - * - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {Number} distance between a and b - */ - -function distance(a, b) { - var x = b[0] - a[0]; - var y = b[1] - a[1]; - var z = b[2] - a[2]; - return Math.hypot(x, y, z); -} -/** - * Calculates the squared euclidian distance between two vec3's - * - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {Number} squared distance between a and b - */ - -function squaredDistance(a, b) { - var x = b[0] - a[0]; - var y = b[1] - a[1]; - var z = b[2] - a[2]; - return x * x + y * y + z * z; -} -/** - * Calculates the squared length of a vec3 - * - * @param {ReadonlyVec3} a vector to calculate squared length of - * @returns {Number} squared length of a - */ - -function squaredLength(a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - return x * x + y * y + z * z; -} -/** - * Negates the components of a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to negate - * @returns {vec3} out - */ - -function negate(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - out[2] = -a[2]; - return out; -} -/** - * Returns the inverse of the components of a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to invert - * @returns {vec3} out - */ - -function inverse(out, a) { - out[0] = 1.0 / a[0]; - out[1] = 1.0 / a[1]; - out[2] = 1.0 / a[2]; - return out; -} -/** - * Normalize a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to normalize - * @returns {vec3} out - */ - -function normalize(out, a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - var len = x * x + y * y + z * z; - - if (len > 0) { - //TODO: evaluate use of glm_invsqrt here? - len = 1 / Math.sqrt(len); - } - - out[0] = a[0] * len; - out[1] = a[1] * len; - out[2] = a[2] * len; - return out; -} -/** - * Calculates the dot product of two vec3's - * - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {Number} dot product of a and b - */ - -function dot(a, b) { - return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; -} -/** - * Computes the cross product of two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function cross(out, a, b) { - var ax = a[0], - ay = a[1], - az = a[2]; - var bx = b[0], - by = b[1], - bz = b[2]; - out[0] = ay * bz - az * by; - out[1] = az * bx - ax * bz; - out[2] = ax * by - ay * bx; - return out; -} -/** - * Performs a linear interpolation between two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {vec3} out - */ - -function lerp(out, a, b, t) { - var ax = a[0]; - var ay = a[1]; - var az = a[2]; - out[0] = ax + t * (b[0] - ax); - out[1] = ay + t * (b[1] - ay); - out[2] = az + t * (b[2] - az); - return out; -} -/** - * Performs a hermite interpolation with two control points - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @param {ReadonlyVec3} c the third operand - * @param {ReadonlyVec3} d the fourth operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {vec3} out - */ - -function hermite(out, a, b, c, d, t) { - var factorTimes2 = t * t; - var factor1 = factorTimes2 * (2 * t - 3) + 1; - var factor2 = factorTimes2 * (t - 2) + t; - var factor3 = factorTimes2 * (t - 1); - var factor4 = factorTimes2 * (3 - 2 * t); - out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; - out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; - out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; - return out; -} -/** - * Performs a bezier interpolation with two control points - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @param {ReadonlyVec3} c the third operand - * @param {ReadonlyVec3} d the fourth operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {vec3} out - */ - -function bezier(out, a, b, c, d, t) { - var inverseFactor = 1 - t; - var inverseFactorTimesTwo = inverseFactor * inverseFactor; - var factorTimes2 = t * t; - var factor1 = inverseFactorTimesTwo * inverseFactor; - var factor2 = 3 * t * inverseFactorTimesTwo; - var factor3 = 3 * factorTimes2 * inverseFactor; - var factor4 = factorTimes2 * t; - out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; - out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; - out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; - return out; -} -/** - * Generates a random vector with the given scale - * - * @param {vec3} out the receiving vector - * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned - * @returns {vec3} out - */ - -function random(out, scale) { - scale = scale || 1.0; - var r = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 * Math.PI; - var z = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 - 1.0; - var zScale = Math.sqrt(1.0 - z * z) * scale; - out[0] = Math.cos(r) * zScale; - out[1] = Math.sin(r) * zScale; - out[2] = z * scale; - return out; -} -/** - * Transforms the vec3 with a mat4. - * 4th vector component is implicitly '1' - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the vector to transform - * @param {ReadonlyMat4} m matrix to transform with - * @returns {vec3} out - */ - -function transformMat4(out, a, m) { - var x = a[0], - y = a[1], - z = a[2]; - var w = m[3] * x + m[7] * y + m[11] * z + m[15]; - w = w || 1.0; - out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w; - out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w; - out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w; - return out; -} -/** - * Transforms the vec3 with a mat3. - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the vector to transform - * @param {ReadonlyMat3} m the 3x3 matrix to transform with - * @returns {vec3} out - */ - -function transformMat3(out, a, m) { - var x = a[0], - y = a[1], - z = a[2]; - out[0] = x * m[0] + y * m[3] + z * m[6]; - out[1] = x * m[1] + y * m[4] + z * m[7]; - out[2] = x * m[2] + y * m[5] + z * m[8]; - return out; -} -/** - * Transforms the vec3 with a quat - * Can also be used for dual quaternions. (Multiply it with the real part) - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the vector to transform - * @param {ReadonlyQuat} q quaternion to transform with - * @returns {vec3} out - */ - -function transformQuat(out, a, q) { - // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed - var qx = q[0], - qy = q[1], - qz = q[2], - qw = q[3]; - var x = a[0], - y = a[1], - z = a[2]; // var qvec = [qx, qy, qz]; - // var uv = vec3.cross([], qvec, a); - - var uvx = qy * z - qz * y, - uvy = qz * x - qx * z, - uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv); - - var uuvx = qy * uvz - qz * uvy, - uuvy = qz * uvx - qx * uvz, - uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w); - - var w2 = qw * 2; - uvx *= w2; - uvy *= w2; - uvz *= w2; // vec3.scale(uuv, uuv, 2); - - uuvx *= 2; - uuvy *= 2; - uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv)); - - out[0] = x + uvx + uuvx; - out[1] = y + uvy + uuvy; - out[2] = z + uvz + uuvz; - return out; -} -/** - * Rotate a 3D vector around the x-axis - * @param {vec3} out The receiving vec3 - * @param {ReadonlyVec3} a The vec3 point to rotate - * @param {ReadonlyVec3} b The origin of the rotation - * @param {Number} rad The angle of rotation in radians - * @returns {vec3} out - */ - -function rotateX(out, a, b, rad) { - var p = [], - r = []; //Translate point to the origin - - p[0] = a[0] - b[0]; - p[1] = a[1] - b[1]; - p[2] = a[2] - b[2]; //perform rotation - - r[0] = p[0]; - r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad); - r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position - - out[0] = r[0] + b[0]; - out[1] = r[1] + b[1]; - out[2] = r[2] + b[2]; - return out; -} -/** - * Rotate a 3D vector around the y-axis - * @param {vec3} out The receiving vec3 - * @param {ReadonlyVec3} a The vec3 point to rotate - * @param {ReadonlyVec3} b The origin of the rotation - * @param {Number} rad The angle of rotation in radians - * @returns {vec3} out - */ - -function rotateY(out, a, b, rad) { - var p = [], - r = []; //Translate point to the origin - - p[0] = a[0] - b[0]; - p[1] = a[1] - b[1]; - p[2] = a[2] - b[2]; //perform rotation - - r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad); - r[1] = p[1]; - r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position - - out[0] = r[0] + b[0]; - out[1] = r[1] + b[1]; - out[2] = r[2] + b[2]; - return out; -} -/** - * Rotate a 3D vector around the z-axis - * @param {vec3} out The receiving vec3 - * @param {ReadonlyVec3} a The vec3 point to rotate - * @param {ReadonlyVec3} b The origin of the rotation - * @param {Number} rad The angle of rotation in radians - * @returns {vec3} out - */ - -function rotateZ(out, a, b, rad) { - var p = [], - r = []; //Translate point to the origin - - p[0] = a[0] - b[0]; - p[1] = a[1] - b[1]; - p[2] = a[2] - b[2]; //perform rotation - - r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad); - r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad); - r[2] = p[2]; //translate to correct position - - out[0] = r[0] + b[0]; - out[1] = r[1] + b[1]; - out[2] = r[2] + b[2]; - return out; -} -/** - * Get the angle between two 3D vectors - * @param {ReadonlyVec3} a The first operand - * @param {ReadonlyVec3} b The second operand - * @returns {Number} The angle in radians - */ - -function angle(a, b) { - var ax = a[0], - ay = a[1], - az = a[2], - bx = b[0], - by = b[1], - bz = b[2], - mag1 = Math.sqrt(ax * ax + ay * ay + az * az), - mag2 = Math.sqrt(bx * bx + by * by + bz * bz), - mag = mag1 * mag2, - cosine = mag && dot(a, b) / mag; - return Math.acos(Math.min(Math.max(cosine, -1), 1)); -} -/** - * Set the components of a vec3 to zero - * - * @param {vec3} out the receiving vector - * @returns {vec3} out - */ - -function zero(out) { - out[0] = 0.0; - out[1] = 0.0; - out[2] = 0.0; - return out; -} -/** - * Returns a string representation of a vector - * - * @param {ReadonlyVec3} a vector to represent as a string - * @returns {String} string representation of the vector - */ - -function str(a) { - return "vec3(" + a[0] + ", " + a[1] + ", " + a[2] + ")"; -} -/** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyVec3} a The first vector. - * @param {ReadonlyVec3} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; -} -/** - * Returns whether or not the vectors have approximately the same elements in the same position. - * - * @param {ReadonlyVec3} a The first vector. - * @param {ReadonlyVec3} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2]; - var b0 = b[0], - b1 = b[1], - b2 = b[2]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)); -} -/** - * Alias for {@link vec3.subtract} - * @function - */ - -var sub = subtract; -/** - * Alias for {@link vec3.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link vec3.divide} - * @function - */ - -var div = divide; -/** - * Alias for {@link vec3.distance} - * @function - */ - -var dist = distance; -/** - * Alias for {@link vec3.squaredDistance} - * @function - */ - -var sqrDist = squaredDistance; -/** - * Alias for {@link vec3.length} - * @function - */ - -var len = length; -/** - * Alias for {@link vec3.squaredLength} - * @function - */ - -var sqrLen = squaredLength; -/** - * Perform some operation over an array of vec3s. - * - * @param {Array} a the array of vectors to iterate over - * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed - * @param {Number} offset Number of elements to skip at the beginning of the array - * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array - * @param {Function} fn Function to call for each vector in the array - * @param {Object} [arg] additional argument to pass to fn - * @returns {Array} a - * @function - */ - -var forEach = function () { - var vec = create(); - return function (a, stride, offset, count, fn, arg) { - var i, l; - - if (!stride) { - stride = 3; - } - - if (!offset) { - offset = 0; - } - - if (count) { - l = Math.min(count * stride + offset, a.length); - } else { - l = a.length; - } - - for (i = offset; i < l; i += stride) { - vec[0] = a[i]; - vec[1] = a[i + 1]; - vec[2] = a[i + 2]; - fn(vec, vec, arg); - a[i] = vec[0]; - a[i + 1] = vec[1]; - a[i + 2] = vec[2]; - } - - return a; - }; -}(); - -/***/ }), -/* 21 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "fromRotationTranslationValues": () => (/* binding */ fromRotationTranslationValues), -/* harmony export */ "fromRotationTranslation": () => (/* binding */ fromRotationTranslation), -/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), -/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), -/* harmony export */ "fromMat4": () => (/* binding */ fromMat4), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "getReal": () => (/* binding */ getReal), -/* harmony export */ "getDual": () => (/* binding */ getDual), -/* harmony export */ "setReal": () => (/* binding */ setReal), -/* harmony export */ "setDual": () => (/* binding */ setDual), -/* harmony export */ "getTranslation": () => (/* binding */ getTranslation), -/* harmony export */ "translate": () => (/* binding */ translate), -/* harmony export */ "rotateX": () => (/* binding */ rotateX), -/* harmony export */ "rotateY": () => (/* binding */ rotateY), -/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), -/* harmony export */ "rotateByQuatAppend": () => (/* binding */ rotateByQuatAppend), -/* harmony export */ "rotateByQuatPrepend": () => (/* binding */ rotateByQuatPrepend), -/* harmony export */ "rotateAroundAxis": () => (/* binding */ rotateAroundAxis), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "dot": () => (/* binding */ dot), -/* harmony export */ "lerp": () => (/* binding */ lerp), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "conjugate": () => (/* binding */ conjugate), -/* harmony export */ "length": () => (/* binding */ length), -/* harmony export */ "len": () => (/* binding */ len), -/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), -/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), -/* harmony export */ "normalize": () => (/* binding */ normalize), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); -/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18); -/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17); - - - -/** - * Dual Quaternion
- * Format: [real, dual]
- * Quaternion format: XYZW
- * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
- * @module quat2 - */ - -/** - * Creates a new identity dual quat - * - * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation] - */ - -function create() { - var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - dq[0] = 0; - dq[1] = 0; - dq[2] = 0; - dq[4] = 0; - dq[5] = 0; - dq[6] = 0; - dq[7] = 0; - } - - dq[3] = 1; - return dq; -} -/** - * Creates a new quat initialized with values from an existing quaternion - * - * @param {ReadonlyQuat2} a dual quaternion to clone - * @returns {quat2} new dual quaternion - * @function - */ - -function clone(a) { - var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); - dq[0] = a[0]; - dq[1] = a[1]; - dq[2] = a[2]; - dq[3] = a[3]; - dq[4] = a[4]; - dq[5] = a[5]; - dq[6] = a[6]; - dq[7] = a[7]; - return dq; -} -/** - * Creates a new dual quat initialized with the given values - * - * @param {Number} x1 X component - * @param {Number} y1 Y component - * @param {Number} z1 Z component - * @param {Number} w1 W component - * @param {Number} x2 X component - * @param {Number} y2 Y component - * @param {Number} z2 Z component - * @param {Number} w2 W component - * @returns {quat2} new dual quaternion - * @function - */ - -function fromValues(x1, y1, z1, w1, x2, y2, z2, w2) { - var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); - dq[0] = x1; - dq[1] = y1; - dq[2] = z1; - dq[3] = w1; - dq[4] = x2; - dq[5] = y2; - dq[6] = z2; - dq[7] = w2; - return dq; -} -/** - * Creates a new dual quat from the given values (quat and translation) - * - * @param {Number} x1 X component - * @param {Number} y1 Y component - * @param {Number} z1 Z component - * @param {Number} w1 W component - * @param {Number} x2 X component (translation) - * @param {Number} y2 Y component (translation) - * @param {Number} z2 Z component (translation) - * @returns {quat2} new dual quaternion - * @function - */ - -function fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) { - var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); - dq[0] = x1; - dq[1] = y1; - dq[2] = z1; - dq[3] = w1; - var ax = x2 * 0.5, - ay = y2 * 0.5, - az = z2 * 0.5; - dq[4] = ax * w1 + ay * z1 - az * y1; - dq[5] = ay * w1 + az * x1 - ax * z1; - dq[6] = az * w1 + ax * y1 - ay * x1; - dq[7] = -ax * x1 - ay * y1 - az * z1; - return dq; -} -/** - * Creates a dual quat from a quaternion and a translation - * - * @param {ReadonlyQuat2} dual quaternion receiving operation result - * @param {ReadonlyQuat} q a normalized quaternion - * @param {ReadonlyVec3} t tranlation vector - * @returns {quat2} dual quaternion receiving operation result - * @function - */ - -function fromRotationTranslation(out, q, t) { - var ax = t[0] * 0.5, - ay = t[1] * 0.5, - az = t[2] * 0.5, - bx = q[0], - by = q[1], - bz = q[2], - bw = q[3]; - out[0] = bx; - out[1] = by; - out[2] = bz; - out[3] = bw; - out[4] = ax * bw + ay * bz - az * by; - out[5] = ay * bw + az * bx - ax * bz; - out[6] = az * bw + ax * by - ay * bx; - out[7] = -ax * bx - ay * by - az * bz; - return out; -} -/** - * Creates a dual quat from a translation - * - * @param {ReadonlyQuat2} dual quaternion receiving operation result - * @param {ReadonlyVec3} t translation vector - * @returns {quat2} dual quaternion receiving operation result - * @function - */ - -function fromTranslation(out, t) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 1; - out[4] = t[0] * 0.5; - out[5] = t[1] * 0.5; - out[6] = t[2] * 0.5; - out[7] = 0; - return out; -} -/** - * Creates a dual quat from a quaternion - * - * @param {ReadonlyQuat2} dual quaternion receiving operation result - * @param {ReadonlyQuat} q the quaternion - * @returns {quat2} dual quaternion receiving operation result - * @function - */ - -function fromRotation(out, q) { - out[0] = q[0]; - out[1] = q[1]; - out[2] = q[2]; - out[3] = q[3]; - out[4] = 0; - out[5] = 0; - out[6] = 0; - out[7] = 0; - return out; -} -/** - * Creates a new dual quat from a matrix (4x4) - * - * @param {quat2} out the dual quaternion - * @param {ReadonlyMat4} a the matrix - * @returns {quat2} dual quat receiving operation result - * @function - */ - -function fromMat4(out, a) { - //TODO Optimize this - var outer = _quat_js__WEBPACK_IMPORTED_MODULE_1__.create(); - _mat4_js__WEBPACK_IMPORTED_MODULE_2__.getRotation(outer, a); - var t = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - _mat4_js__WEBPACK_IMPORTED_MODULE_2__.getTranslation(t, a); - fromRotationTranslation(out, outer, t); - return out; -} -/** - * Copy the values from one dual quat to another - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the source dual quaternion - * @returns {quat2} out - * @function - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - return out; -} -/** - * Set a dual quat to the identity dual quaternion - * - * @param {quat2} out the receiving quaternion - * @returns {quat2} out - */ - -function identity(out) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 1; - out[4] = 0; - out[5] = 0; - out[6] = 0; - out[7] = 0; - return out; -} -/** - * Set the components of a dual quat to the given values - * - * @param {quat2} out the receiving quaternion - * @param {Number} x1 X component - * @param {Number} y1 Y component - * @param {Number} z1 Z component - * @param {Number} w1 W component - * @param {Number} x2 X component - * @param {Number} y2 Y component - * @param {Number} z2 Z component - * @param {Number} w2 W component - * @returns {quat2} out - * @function - */ - -function set(out, x1, y1, z1, w1, x2, y2, z2, w2) { - out[0] = x1; - out[1] = y1; - out[2] = z1; - out[3] = w1; - out[4] = x2; - out[5] = y2; - out[6] = z2; - out[7] = w2; - return out; -} -/** - * Gets the real part of a dual quat - * @param {quat} out real part - * @param {ReadonlyQuat2} a Dual Quaternion - * @return {quat} real part - */ - -var getReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__.copy; -/** - * Gets the dual part of a dual quat - * @param {quat} out dual part - * @param {ReadonlyQuat2} a Dual Quaternion - * @return {quat} dual part - */ - -function getDual(out, a) { - out[0] = a[4]; - out[1] = a[5]; - out[2] = a[6]; - out[3] = a[7]; - return out; -} -/** - * Set the real component of a dual quat to the given quaternion - * - * @param {quat2} out the receiving quaternion - * @param {ReadonlyQuat} q a quaternion representing the real part - * @returns {quat2} out - * @function - */ - -var setReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__.copy; -/** - * Set the dual component of a dual quat to the given quaternion - * - * @param {quat2} out the receiving quaternion - * @param {ReadonlyQuat} q a quaternion representing the dual part - * @returns {quat2} out - * @function - */ - -function setDual(out, q) { - out[4] = q[0]; - out[5] = q[1]; - out[6] = q[2]; - out[7] = q[3]; - return out; -} -/** - * Gets the translation of a normalized dual quat - * @param {vec3} out translation - * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed - * @return {vec3} translation - */ - -function getTranslation(out, a) { - var ax = a[4], - ay = a[5], - az = a[6], - aw = a[7], - bx = -a[0], - by = -a[1], - bz = -a[2], - bw = a[3]; - out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; - out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; - out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; - return out; -} -/** - * Translates a dual quat by the given vector - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to translate - * @param {ReadonlyVec3} v vector to translate by - * @returns {quat2} out - */ - -function translate(out, a, v) { - var ax1 = a[0], - ay1 = a[1], - az1 = a[2], - aw1 = a[3], - bx1 = v[0] * 0.5, - by1 = v[1] * 0.5, - bz1 = v[2] * 0.5, - ax2 = a[4], - ay2 = a[5], - az2 = a[6], - aw2 = a[7]; - out[0] = ax1; - out[1] = ay1; - out[2] = az1; - out[3] = aw1; - out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2; - out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2; - out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2; - out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2; - return out; -} -/** - * Rotates a dual quat around the X axis - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @param {number} rad how far should the rotation be - * @returns {quat2} out - */ - -function rotateX(out, a, rad) { - var bx = -a[0], - by = -a[1], - bz = -a[2], - bw = a[3], - ax = a[4], - ay = a[5], - az = a[6], - aw = a[7], - ax1 = ax * bw + aw * bx + ay * bz - az * by, - ay1 = ay * bw + aw * by + az * bx - ax * bz, - az1 = az * bw + aw * bz + ax * by - ay * bx, - aw1 = aw * bw - ax * bx - ay * by - az * bz; - _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateX(out, a, rad); - bx = out[0]; - by = out[1]; - bz = out[2]; - bw = out[3]; - out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; - out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; - out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; - out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; - return out; -} -/** - * Rotates a dual quat around the Y axis - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @param {number} rad how far should the rotation be - * @returns {quat2} out - */ - -function rotateY(out, a, rad) { - var bx = -a[0], - by = -a[1], - bz = -a[2], - bw = a[3], - ax = a[4], - ay = a[5], - az = a[6], - aw = a[7], - ax1 = ax * bw + aw * bx + ay * bz - az * by, - ay1 = ay * bw + aw * by + az * bx - ax * bz, - az1 = az * bw + aw * bz + ax * by - ay * bx, - aw1 = aw * bw - ax * bx - ay * by - az * bz; - _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateY(out, a, rad); - bx = out[0]; - by = out[1]; - bz = out[2]; - bw = out[3]; - out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; - out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; - out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; - out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; - return out; -} -/** - * Rotates a dual quat around the Z axis - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @param {number} rad how far should the rotation be - * @returns {quat2} out - */ - -function rotateZ(out, a, rad) { - var bx = -a[0], - by = -a[1], - bz = -a[2], - bw = a[3], - ax = a[4], - ay = a[5], - az = a[6], - aw = a[7], - ax1 = ax * bw + aw * bx + ay * bz - az * by, - ay1 = ay * bw + aw * by + az * bx - ax * bz, - az1 = az * bw + aw * bz + ax * by - ay * bx, - aw1 = aw * bw - ax * bx - ay * by - az * bz; - _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateZ(out, a, rad); - bx = out[0]; - by = out[1]; - bz = out[2]; - bw = out[3]; - out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; - out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; - out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; - out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; - return out; -} -/** - * Rotates a dual quat by a given quaternion (a * q) - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @param {ReadonlyQuat} q quaternion to rotate by - * @returns {quat2} out - */ - -function rotateByQuatAppend(out, a, q) { - var qx = q[0], - qy = q[1], - qz = q[2], - qw = q[3], - ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - out[0] = ax * qw + aw * qx + ay * qz - az * qy; - out[1] = ay * qw + aw * qy + az * qx - ax * qz; - out[2] = az * qw + aw * qz + ax * qy - ay * qx; - out[3] = aw * qw - ax * qx - ay * qy - az * qz; - ax = a[4]; - ay = a[5]; - az = a[6]; - aw = a[7]; - out[4] = ax * qw + aw * qx + ay * qz - az * qy; - out[5] = ay * qw + aw * qy + az * qx - ax * qz; - out[6] = az * qw + aw * qz + ax * qy - ay * qx; - out[7] = aw * qw - ax * qx - ay * qy - az * qz; - return out; -} -/** - * Rotates a dual quat by a given quaternion (q * a) - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat} q quaternion to rotate by - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @returns {quat2} out - */ - -function rotateByQuatPrepend(out, q, a) { - var qx = q[0], - qy = q[1], - qz = q[2], - qw = q[3], - bx = a[0], - by = a[1], - bz = a[2], - bw = a[3]; - out[0] = qx * bw + qw * bx + qy * bz - qz * by; - out[1] = qy * bw + qw * by + qz * bx - qx * bz; - out[2] = qz * bw + qw * bz + qx * by - qy * bx; - out[3] = qw * bw - qx * bx - qy * by - qz * bz; - bx = a[4]; - by = a[5]; - bz = a[6]; - bw = a[7]; - out[4] = qx * bw + qw * bx + qy * bz - qz * by; - out[5] = qy * bw + qw * by + qz * bx - qx * bz; - out[6] = qz * bw + qw * bz + qx * by - qy * bx; - out[7] = qw * bw - qx * bx - qy * by - qz * bz; - return out; -} -/** - * Rotates a dual quat around a given axis. Does the normalisation automatically - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @param {ReadonlyVec3} axis the axis to rotate around - * @param {Number} rad how far the rotation should be - * @returns {quat2} out - */ - -function rotateAroundAxis(out, a, axis, rad) { - //Special case for rad = 0 - if (Math.abs(rad) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - return copy(out, a); - } - - var axisLength = Math.hypot(axis[0], axis[1], axis[2]); - rad = rad * 0.5; - var s = Math.sin(rad); - var bx = s * axis[0] / axisLength; - var by = s * axis[1] / axisLength; - var bz = s * axis[2] / axisLength; - var bw = Math.cos(rad); - var ax1 = a[0], - ay1 = a[1], - az1 = a[2], - aw1 = a[3]; - out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; - out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; - out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; - out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; - var ax = a[4], - ay = a[5], - az = a[6], - aw = a[7]; - out[4] = ax * bw + aw * bx + ay * bz - az * by; - out[5] = ay * bw + aw * by + az * bx - ax * bz; - out[6] = az * bw + aw * bz + ax * by - ay * bx; - out[7] = aw * bw - ax * bx - ay * by - az * bz; - return out; -} -/** - * Adds two dual quat's - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the first operand - * @param {ReadonlyQuat2} b the second operand - * @returns {quat2} out - * @function - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - out[4] = a[4] + b[4]; - out[5] = a[5] + b[5]; - out[6] = a[6] + b[6]; - out[7] = a[7] + b[7]; - return out; -} -/** - * Multiplies two dual quat's - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the first operand - * @param {ReadonlyQuat2} b the second operand - * @returns {quat2} out - */ - -function multiply(out, a, b) { - var ax0 = a[0], - ay0 = a[1], - az0 = a[2], - aw0 = a[3], - bx1 = b[4], - by1 = b[5], - bz1 = b[6], - bw1 = b[7], - ax1 = a[4], - ay1 = a[5], - az1 = a[6], - aw1 = a[7], - bx0 = b[0], - by0 = b[1], - bz0 = b[2], - bw0 = b[3]; - out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0; - out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0; - out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0; - out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0; - out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0; - out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0; - out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0; - out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0; - return out; -} -/** - * Alias for {@link quat2.multiply} - * @function - */ - -var mul = multiply; -/** - * Scales a dual quat by a scalar number - * - * @param {quat2} out the receiving dual quat - * @param {ReadonlyQuat2} a the dual quat to scale - * @param {Number} b amount to scale the dual quat by - * @returns {quat2} out - * @function - */ - -function scale(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - out[4] = a[4] * b; - out[5] = a[5] * b; - out[6] = a[6] * b; - out[7] = a[7] * b; - return out; -} -/** - * Calculates the dot product of two dual quat's (The dot product of the real parts) - * - * @param {ReadonlyQuat2} a the first operand - * @param {ReadonlyQuat2} b the second operand - * @returns {Number} dot product of a and b - * @function - */ - -var dot = _quat_js__WEBPACK_IMPORTED_MODULE_1__.dot; -/** - * Performs a linear interpolation between two dual quats's - * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5) - * - * @param {quat2} out the receiving dual quat - * @param {ReadonlyQuat2} a the first operand - * @param {ReadonlyQuat2} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {quat2} out - */ - -function lerp(out, a, b, t) { - var mt = 1 - t; - if (dot(a, b) < 0) t = -t; - out[0] = a[0] * mt + b[0] * t; - out[1] = a[1] * mt + b[1] * t; - out[2] = a[2] * mt + b[2] * t; - out[3] = a[3] * mt + b[3] * t; - out[4] = a[4] * mt + b[4] * t; - out[5] = a[5] * mt + b[5] * t; - out[6] = a[6] * mt + b[6] * t; - out[7] = a[7] * mt + b[7] * t; - return out; -} -/** - * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a dual quat to calculate inverse of - * @returns {quat2} out - */ - -function invert(out, a) { - var sqlen = squaredLength(a); - out[0] = -a[0] / sqlen; - out[1] = -a[1] / sqlen; - out[2] = -a[2] / sqlen; - out[3] = a[3] / sqlen; - out[4] = -a[4] / sqlen; - out[5] = -a[5] / sqlen; - out[6] = -a[6] / sqlen; - out[7] = a[7] / sqlen; - return out; -} -/** - * Calculates the conjugate of a dual quat - * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result. - * - * @param {quat2} out the receiving quaternion - * @param {ReadonlyQuat2} a quat to calculate conjugate of - * @returns {quat2} out - */ - -function conjugate(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - out[2] = -a[2]; - out[3] = a[3]; - out[4] = -a[4]; - out[5] = -a[5]; - out[6] = -a[6]; - out[7] = a[7]; - return out; -} -/** - * Calculates the length of a dual quat - * - * @param {ReadonlyQuat2} a dual quat to calculate length of - * @returns {Number} length of a - * @function - */ - -var length = _quat_js__WEBPACK_IMPORTED_MODULE_1__.length; -/** - * Alias for {@link quat2.length} - * @function - */ - -var len = length; -/** - * Calculates the squared length of a dual quat - * - * @param {ReadonlyQuat2} a dual quat to calculate squared length of - * @returns {Number} squared length of a - * @function - */ - -var squaredLength = _quat_js__WEBPACK_IMPORTED_MODULE_1__.squaredLength; -/** - * Alias for {@link quat2.squaredLength} - * @function - */ - -var sqrLen = squaredLength; -/** - * Normalize a dual quat - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a dual quaternion to normalize - * @returns {quat2} out - * @function - */ - -function normalize(out, a) { - var magnitude = squaredLength(a); - - if (magnitude > 0) { - magnitude = Math.sqrt(magnitude); - var a0 = a[0] / magnitude; - var a1 = a[1] / magnitude; - var a2 = a[2] / magnitude; - var a3 = a[3] / magnitude; - var b0 = a[4]; - var b1 = a[5]; - var b2 = a[6]; - var b3 = a[7]; - var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3; - out[0] = a0; - out[1] = a1; - out[2] = a2; - out[3] = a3; - out[4] = (b0 - a0 * a_dot_b) / magnitude; - out[5] = (b1 - a1 * a_dot_b) / magnitude; - out[6] = (b2 - a2 * a_dot_b) / magnitude; - out[7] = (b3 - a3 * a_dot_b) / magnitude; - } - - return out; -} -/** - * Returns a string representation of a dual quatenion - * - * @param {ReadonlyQuat2} a dual quaternion to represent as a string - * @returns {String} string representation of the dual quat - */ - -function str(a) { - return "quat2(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ")"; -} -/** - * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyQuat2} a the first dual quaternion. - * @param {ReadonlyQuat2} b the second dual quaternion. - * @returns {Boolean} true if the dual quaternions are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7]; -} -/** - * Returns whether or not the dual quaternions have approximately the same elements in the same position. - * - * @param {ReadonlyQuat2} a the first dual quat. - * @param {ReadonlyQuat2} b the second dual quat. - * @returns {Boolean} true if the dual quats are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5], - a6 = a[6], - a7 = a[7]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3], - b4 = b[4], - b5 = b[5], - b6 = b[6], - b7 = b[7]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)); -} - -/***/ }), -/* 22 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "divide": () => (/* binding */ divide), -/* harmony export */ "ceil": () => (/* binding */ ceil), -/* harmony export */ "floor": () => (/* binding */ floor), -/* harmony export */ "min": () => (/* binding */ min), -/* harmony export */ "max": () => (/* binding */ max), -/* harmony export */ "round": () => (/* binding */ round), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), -/* harmony export */ "distance": () => (/* binding */ distance), -/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), -/* harmony export */ "length": () => (/* binding */ length), -/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), -/* harmony export */ "negate": () => (/* binding */ negate), -/* harmony export */ "inverse": () => (/* binding */ inverse), -/* harmony export */ "normalize": () => (/* binding */ normalize), -/* harmony export */ "dot": () => (/* binding */ dot), -/* harmony export */ "cross": () => (/* binding */ cross), -/* harmony export */ "lerp": () => (/* binding */ lerp), -/* harmony export */ "random": () => (/* binding */ random), -/* harmony export */ "transformMat2": () => (/* binding */ transformMat2), -/* harmony export */ "transformMat2d": () => (/* binding */ transformMat2d), -/* harmony export */ "transformMat3": () => (/* binding */ transformMat3), -/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), -/* harmony export */ "rotate": () => (/* binding */ rotate), -/* harmony export */ "angle": () => (/* binding */ angle), -/* harmony export */ "zero": () => (/* binding */ zero), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "len": () => (/* binding */ len), -/* harmony export */ "sub": () => (/* binding */ sub), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "div": () => (/* binding */ div), -/* harmony export */ "dist": () => (/* binding */ dist), -/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), -/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), -/* harmony export */ "forEach": () => (/* binding */ forEach) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); - -/** - * 2 Dimensional Vector - * @module vec2 - */ - -/** - * Creates a new, empty vec2 - * - * @returns {vec2} a new 2D vector - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[0] = 0; - out[1] = 0; - } - - return out; -} -/** - * Creates a new vec2 initialized with values from an existing vector - * - * @param {ReadonlyVec2} a vector to clone - * @returns {vec2} a new 2D vector - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); - out[0] = a[0]; - out[1] = a[1]; - return out; -} -/** - * Creates a new vec2 initialized with the given values - * - * @param {Number} x X component - * @param {Number} y Y component - * @returns {vec2} a new 2D vector - */ - -function fromValues(x, y) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); - out[0] = x; - out[1] = y; - return out; -} -/** - * Copy the values from one vec2 to another - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the source vector - * @returns {vec2} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - return out; -} -/** - * Set the components of a vec2 to the given values - * - * @param {vec2} out the receiving vector - * @param {Number} x X component - * @param {Number} y Y component - * @returns {vec2} out - */ - -function set(out, x, y) { - out[0] = x; - out[1] = y; - return out; -} -/** - * Adds two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - return out; -} -/** - * Subtracts vector b from vector a - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - return out; -} -/** - * Multiplies two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function multiply(out, a, b) { - out[0] = a[0] * b[0]; - out[1] = a[1] * b[1]; - return out; -} -/** - * Divides two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function divide(out, a, b) { - out[0] = a[0] / b[0]; - out[1] = a[1] / b[1]; - return out; -} -/** - * Math.ceil the components of a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to ceil - * @returns {vec2} out - */ - -function ceil(out, a) { - out[0] = Math.ceil(a[0]); - out[1] = Math.ceil(a[1]); - return out; -} -/** - * Math.floor the components of a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to floor - * @returns {vec2} out - */ - -function floor(out, a) { - out[0] = Math.floor(a[0]); - out[1] = Math.floor(a[1]); - return out; -} -/** - * Returns the minimum of two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function min(out, a, b) { - out[0] = Math.min(a[0], b[0]); - out[1] = Math.min(a[1], b[1]); - return out; -} -/** - * Returns the maximum of two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function max(out, a, b) { - out[0] = Math.max(a[0], b[0]); - out[1] = Math.max(a[1], b[1]); - return out; -} -/** - * Math.round the components of a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to round - * @returns {vec2} out - */ - -function round(out, a) { - out[0] = Math.round(a[0]); - out[1] = Math.round(a[1]); - return out; -} -/** - * Scales a vec2 by a scalar number - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the vector to scale - * @param {Number} b amount to scale the vector by - * @returns {vec2} out - */ - -function scale(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - return out; -} -/** - * Adds two vec2's after scaling the second operand by a scalar value - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @param {Number} scale the amount to scale b by before adding - * @returns {vec2} out - */ - -function scaleAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - return out; -} -/** - * Calculates the euclidian distance between two vec2's - * - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {Number} distance between a and b - */ - -function distance(a, b) { - var x = b[0] - a[0], - y = b[1] - a[1]; - return Math.hypot(x, y); -} -/** - * Calculates the squared euclidian distance between two vec2's - * - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {Number} squared distance between a and b - */ - -function squaredDistance(a, b) { - var x = b[0] - a[0], - y = b[1] - a[1]; - return x * x + y * y; -} -/** - * Calculates the length of a vec2 - * - * @param {ReadonlyVec2} a vector to calculate length of - * @returns {Number} length of a - */ - -function length(a) { - var x = a[0], - y = a[1]; - return Math.hypot(x, y); -} -/** - * Calculates the squared length of a vec2 - * - * @param {ReadonlyVec2} a vector to calculate squared length of - * @returns {Number} squared length of a - */ - -function squaredLength(a) { - var x = a[0], - y = a[1]; - return x * x + y * y; -} -/** - * Negates the components of a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to negate - * @returns {vec2} out - */ - -function negate(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - return out; -} -/** - * Returns the inverse of the components of a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to invert - * @returns {vec2} out - */ - -function inverse(out, a) { - out[0] = 1.0 / a[0]; - out[1] = 1.0 / a[1]; - return out; -} -/** - * Normalize a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to normalize - * @returns {vec2} out - */ - -function normalize(out, a) { - var x = a[0], - y = a[1]; - var len = x * x + y * y; - - if (len > 0) { - //TODO: evaluate use of glm_invsqrt here? - len = 1 / Math.sqrt(len); - } - - out[0] = a[0] * len; - out[1] = a[1] * len; - return out; -} -/** - * Calculates the dot product of two vec2's - * - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {Number} dot product of a and b - */ - -function dot(a, b) { - return a[0] * b[0] + a[1] * b[1]; -} -/** - * Computes the cross product of two vec2's - * Note that the cross product must by definition produce a 3D vector - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec3} out - */ - -function cross(out, a, b) { - var z = a[0] * b[1] - a[1] * b[0]; - out[0] = out[1] = 0; - out[2] = z; - return out; -} -/** - * Performs a linear interpolation between two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {vec2} out - */ - -function lerp(out, a, b, t) { - var ax = a[0], - ay = a[1]; - out[0] = ax + t * (b[0] - ax); - out[1] = ay + t * (b[1] - ay); - return out; -} -/** - * Generates a random vector with the given scale - * - * @param {vec2} out the receiving vector - * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned - * @returns {vec2} out - */ - -function random(out, scale) { - scale = scale || 1.0; - var r = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 * Math.PI; - out[0] = Math.cos(r) * scale; - out[1] = Math.sin(r) * scale; - return out; -} -/** - * Transforms the vec2 with a mat2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the vector to transform - * @param {ReadonlyMat2} m matrix to transform with - * @returns {vec2} out - */ - -function transformMat2(out, a, m) { - var x = a[0], - y = a[1]; - out[0] = m[0] * x + m[2] * y; - out[1] = m[1] * x + m[3] * y; - return out; -} -/** - * Transforms the vec2 with a mat2d - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the vector to transform - * @param {ReadonlyMat2d} m matrix to transform with - * @returns {vec2} out - */ - -function transformMat2d(out, a, m) { - var x = a[0], - y = a[1]; - out[0] = m[0] * x + m[2] * y + m[4]; - out[1] = m[1] * x + m[3] * y + m[5]; - return out; -} -/** - * Transforms the vec2 with a mat3 - * 3rd vector component is implicitly '1' - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the vector to transform - * @param {ReadonlyMat3} m matrix to transform with - * @returns {vec2} out - */ - -function transformMat3(out, a, m) { - var x = a[0], - y = a[1]; - out[0] = m[0] * x + m[3] * y + m[6]; - out[1] = m[1] * x + m[4] * y + m[7]; - return out; -} -/** - * Transforms the vec2 with a mat4 - * 3rd vector component is implicitly '0' - * 4th vector component is implicitly '1' - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the vector to transform - * @param {ReadonlyMat4} m matrix to transform with - * @returns {vec2} out - */ - -function transformMat4(out, a, m) { - var x = a[0]; - var y = a[1]; - out[0] = m[0] * x + m[4] * y + m[12]; - out[1] = m[1] * x + m[5] * y + m[13]; - return out; -} -/** - * Rotate a 2D vector - * @param {vec2} out The receiving vec2 - * @param {ReadonlyVec2} a The vec2 point to rotate - * @param {ReadonlyVec2} b The origin of the rotation - * @param {Number} rad The angle of rotation in radians - * @returns {vec2} out - */ - -function rotate(out, a, b, rad) { - //Translate point to the origin - var p0 = a[0] - b[0], - p1 = a[1] - b[1], - sinC = Math.sin(rad), - cosC = Math.cos(rad); //perform rotation and translate to correct position - - out[0] = p0 * cosC - p1 * sinC + b[0]; - out[1] = p0 * sinC + p1 * cosC + b[1]; - return out; -} -/** - * Get the angle between two 2D vectors - * @param {ReadonlyVec2} a The first operand - * @param {ReadonlyVec2} b The second operand - * @returns {Number} The angle in radians - */ - -function angle(a, b) { - var x1 = a[0], - y1 = a[1], - x2 = b[0], - y2 = b[1], - // mag is the product of the magnitudes of a and b - mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2), - // mag &&.. short circuits if mag == 0 - cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1 - - return Math.acos(Math.min(Math.max(cosine, -1), 1)); -} -/** - * Set the components of a vec2 to zero - * - * @param {vec2} out the receiving vector - * @returns {vec2} out - */ - -function zero(out) { - out[0] = 0.0; - out[1] = 0.0; - return out; -} -/** - * Returns a string representation of a vector - * - * @param {ReadonlyVec2} a vector to represent as a string - * @returns {String} string representation of the vector - */ - -function str(a) { - return "vec2(" + a[0] + ", " + a[1] + ")"; -} -/** - * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===) - * - * @param {ReadonlyVec2} a The first vector. - * @param {ReadonlyVec2} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1]; -} -/** - * Returns whether or not the vectors have approximately the same elements in the same position. - * - * @param {ReadonlyVec2} a The first vector. - * @param {ReadonlyVec2} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1]; - var b0 = b[0], - b1 = b[1]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)); -} -/** - * Alias for {@link vec2.length} - * @function - */ - -var len = length; -/** - * Alias for {@link vec2.subtract} - * @function - */ - -var sub = subtract; -/** - * Alias for {@link vec2.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link vec2.divide} - * @function - */ - -var div = divide; -/** - * Alias for {@link vec2.distance} - * @function - */ - -var dist = distance; -/** - * Alias for {@link vec2.squaredDistance} - * @function - */ - -var sqrDist = squaredDistance; -/** - * Alias for {@link vec2.squaredLength} - * @function - */ - -var sqrLen = squaredLength; -/** - * Perform some operation over an array of vec2s. - * - * @param {Array} a the array of vectors to iterate over - * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed - * @param {Number} offset Number of elements to skip at the beginning of the array - * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array - * @param {Function} fn Function to call for each vector in the array - * @param {Object} [arg] additional argument to pass to fn - * @returns {Array} a - * @function - */ - -var forEach = function () { - var vec = create(); - return function (a, stride, offset, count, fn, arg) { - var i, l; - - if (!stride) { - stride = 2; - } - - if (!offset) { - offset = 0; - } - - if (count) { - l = Math.min(count * stride + offset, a.length); - } else { - l = a.length; - } - - for (i = offset; i < l; i += stride) { - vec[0] = a[i]; - vec[1] = a[i + 1]; - fn(vec, vec, arg); - a[i] = vec[0]; - a[i + 1] = vec[1]; - } - - return a; - }; -}(); - -/***/ }), -/* 23 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Scene = void 0; -const SceneChild_1 = __webpack_require__(24); -const Group_1 = __webpack_require__(25); -const Shape_1 = __webpack_require__(34); -const Utilities_1 = __webpack_require__(32); -/** - * Container for all SceneChild. - * The main purpose is to manage the drawing order and update the child buffers - * - * @order 1 - * @category Core.Scene - * @class Scene - */ -class Scene { +class Group extends SceneChild_1.SceneChild { /** - * Creates an instance of Scene. - * You can see the default values in the property definitions + * Creates an instance of Group + * + * @param {ISceneChildSettings} [settings={}] + * @memberof Group */ constructor(settings = {}) { - /** - * Logical number, the drawer will take care of defining the unit of measure - */ - this.width = 400; - /** - * Logical number, the drawer will take care of defining the unit of measure - */ - this.height = 400; - /** - * Default background color (black) - */ - this.background = 'hsla(0, 0%, 0%, 1)'; - /** - * Default ScenePrimitive stroke color (white) - */ - this.color = 'hsla(0, 0%, 100%, 1)'; - /** - * Current time - */ - this.currentTime = 0; - if (typeof settings.width !== 'undefined') - this.width = settings.width; - if (typeof settings.height !== 'undefined') - this.height = settings.height; - if (typeof settings.background !== 'undefined') - this.background = settings.background; - if (typeof settings.color !== 'undefined') - this.color = settings.color; + settings.type = 'Group'; + super(settings); this.children = []; - this.center = [this.width / 2, this.height / 2]; - this.anchor = - settings.anchor && Array.isArray(settings.anchor) - ? [ - typeof settings.anchor[0] === 'number' - ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[0]) * 0.5) * this.width - : settings.anchor[0] === 'left' - ? 0 - : settings.anchor[0] === 'right' - ? this.width - : this.center[0], - typeof settings.anchor[1] === 'number' - ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[1]) * 0.5) * this.height - : settings.anchor[1] === 'top' - ? 0 - : settings.anchor[1] === 'bottom' - ? this.height - : this.center[1], - ] - : [this.center[0], this.center[1]]; - } - /** - * Return width percentage - * - * @param {number} [percentage=100] - * @returns {number} - */ - getWidth(percentage = 100) { - return (this.width * percentage) / 100; - } - /** - * Return height percentage - * - * @param {number} [percentage=100] - * @returns {number} - */ - getHeight(percentage = 100) { - return (this.height * percentage) / 100; - } - /** - * Resize the scene size - * - * @param {number} width - * @param {number} [height=width] - * @memberof Scene - */ - resize(width, height = width) { - this.width = width; - this.height = height; - this.center = [this.width / 2, this.height / 2]; - const anchor = [this.width / this.anchor[0], this.height / this.anchor[1]]; - this.anchor = [this.width / anchor[0], this.height / anchor[1]]; - this.children.forEach(sceneChild => sceneChild.clearBuffer(true, false)); - } - /** - * Update all children, generate a streamable buffer for drawing - * - * @param {number} [atTime] time in ms - * @memberof Scene - */ - update(atTime = 0) { - this.currentTime = atTime; - for (let i = 0, len = this.children.length; i < len; i++) { - this.children[i].generate(this.currentTime, true); - } + ['id', 'name', 'data', 'order', 'type'].forEach((prop) => { + if (prop in settings) + delete settings[prop]; + }); + this.props = settings; } /** - * Traverse the child buffer and use it with callback + * Check group has static children * - * @param {(streamArguments: IStreamArguments) => void} callback - * @memberof Scene + * @returns {boolean} + * @memberof Group */ - stream(callback) { - this.children.forEach(sceneChild => sceneChild.stream(callback)); + isStatic() { + const children = this.children; + for (let i = 0, len = children.length; i < len; i++) + if (!children[i].isStatic()) + return false; + return true; } - /* - |-------------------------------------------------------------------------- - | SceneChild - |-------------------------------------------------------------------------- - */ /** - * Return a list of children + * Check group has static children indexed * - * @returns {Array} - * @memberof Scene + * @returns {boolean} + * @memberof Group */ - getChildren() { - return this.children; + isStaticIndexed() { + const children = this.children; + for (let i = 0, len = children.length; i < len; i++) + if (!children[i].isStaticIndexed()) + return false; + return true; } /** - * Add SceneChild to Scene, pass `order` as last parameter for drawing priorities + * Add item to Group * * @param {Array} items - * @param {number} [order] - * @memberof Scene + * @memberof Group */ - add(...items /**, order: number */) { - const order = typeof items[items.length - 1] === 'number' ? items[items.length - 1] : undefined; - const len = items.length - (typeof order === 'undefined' ? 0 : 1); - for (let i = 0; i < len; i++) { + add(...items) { + for (let i = 0, len = items.length; i < len; i++) { const item = items[i]; + const rawItemProps = item.getProps(); + Object.keys(this.props).forEach((propKey) => { + if (typeof rawItemProps[propKey] === 'undefined') + item.setProp(propKey, this.props[propKey]); + }); item.order = - typeof order !== 'undefined' - ? order + i - : typeof item.order !== 'undefined' - ? item.order - : this.children.length > 0 - ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1 - : 0; - Scene.propagateToChilden(item, this); + typeof item.order !== 'undefined' + ? item.order + : this.children.length > 0 + ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1 + : 0; + this.scene && Scene_1.Scene.propagateToChilden(item, this.scene); this.children.push(item); - item.clearBuffer(true, false); - item.generate(0, true); } this.sortChildren(); } /** - * Sort children by order + * Sort children * - * @memberof Scene + * @memberof Group */ sortChildren() { this.children.sort((a, b) => a.order - b.order); @@ -8110,15 +696,27 @@ class Scene { child.order = index; return child; }); + this.clearBuffer(true); } /** - * Find sceneChild from id or name in the whole scene + * Return shape children * - * @param {string | number} idOrName + * @returns {Array} + * @memberof Group + */ + getChildren() { + return this.children; + } + /** + * Find scene child from id or name + * + * @param {number | string} idOrName * @returns {(SceneChild | null)} - * @memberof Scene + * @memberof Group */ find(idOrName) { + if (this.id === idOrName || this.name === idOrName) + return this; const children = this.getChildren(); for (let i = 0, len = children.length; i < len; i++) { const result = children[i].find(idOrName); @@ -8128,1108 +726,8516 @@ class Scene { return null; } /** - * Get shape by index + * Get item from group * * @param {number} index * @returns {(SceneChild | null)} - * @memberof Scene + * @memberof Group */ get(index) { return index >= 0 && index < this.children.length ? this.children[index] : null; } /** - * Remove a shape by index + * Remove item from group * * @param {number} index - * @memberof Scene + * @returns {(false | Array)} + * @memberof Group */ remove(index) { - index >= 0 && index < this.children.length && this.children.splice(index, 1); - } - /** - * Removes all children - * - * @memberof Scene - */ - removeChildren() { - this.children = []; - } - /** - * Remove sceneChild by id or name - * - * @param {number | number} idOrName - * @memberof Scene - */ - removeFromId(idOrName) { - for (let i = 0, len = this.children.length; i < len; i++) - if (this.children[i].id === idOrName || this.children[i].name === idOrName) { - this.children.splice(i, 1); - return; - } - } - /** - * Return true if sceneChild is direct children - * - * @param {SceneChild} sceneChild - * @returns {boolean} - * @memberof Scene - */ - isFirstLevelChild(sceneChild) { - for (let i = 0, len = this.children.length; i < len; i++) - if (this.children[i].id === sceneChild.id) - return true; - const parents = this.getParentsOfSceneChild(sceneChild); - return parents.length === 1 && parents[0] instanceof Group_1.Group; + if (index >= 0 && index < this.children.length) { + const removed = this.children.splice(index, 1); + this.clearBuffer(true); + return removed; + } + return false; } /** - * Returns the list of sceneChild hierarchy starting from the scene + * Remove from id * - * @param {SceneChild} sceneChild - * @returns {Array} + * @param {number} id * @memberof Scene */ - getParentsOfSceneChild(sceneChild) { - const result = Scene.getParentsOfSceneChild(this, sceneChild); - if (result) { - result.splice(0, 1); - return result; + removeFromId(id) { + for (let i = 0, len = this.children.length; i < len; i++) { + if (this.children[i].id == id) { + this.children.splice(i, 1); + return this.clearBuffer(true); + } } - return []; } /** - * Returns the list of sceneChild hierarchy starting from the scene + * Generate children buffers * - * @static - * @param {(Scene | SceneChild)} current - * @param {SceneChild} sceneChild - * @param {(Array)} [parents=[]] - * @returns {(Array | null)} - * @memberof Scene + * @param {number} generateId + * @param {boolean} [bDirectSceneChild=false] + * @param {IPropArguments} [parentPropArguments] + * @memberof Group */ - static getParentsOfSceneChild(current, sceneChild, parents = []) { - let result; - if (current instanceof SceneChild_1.SceneChild) { - if (current.id == sceneChild.id) - return parents; - if (current instanceof Shape_1.Shape && current.shape) { - const tmpParents = parents.slice(); - tmpParents.push(current); - if ((result = Scene.getParentsOfSceneChild(current.shape, sceneChild, tmpParents))) - return result; - } - } - if (current instanceof Scene || current instanceof Group_1.Group) { - const children = current.getChildren(); - parents.push(current); - for (let i = 0, len = children.length; i < len; i++) { - const child = children[i]; - if ((result = Scene.getParentsOfSceneChild(child, sceneChild, parents))) - return result; - } - parents.pop(); - } - return null; + generate(generateId, bDirectSceneChild = false, parentPropArguments) { + this.generateId = generateId; + this.children.forEach(item => item.generate(generateId, bDirectSceneChild, parentPropArguments)); } /** - * Walk through the scene + * Sum the children bounding * - * @static - * @param {SceneChild} callbackk - * @param {(Scene | SceneChild)} current - * @memberof Scene + * @return {IShapeBounding} */ - static walk(callback, current) { - if (current instanceof SceneChild_1.SceneChild) { - if (callback(current) === false) - return false; - if (current instanceof Shape_1.Shape && current.shape) - if (Scene.walk(callback, current.shape) === false) - return false; - } - if (current instanceof Scene || current instanceof Group_1.Group) { - const children = current.getChildren(); - for (let i = 0, len = children.length; i < len; i++) { - const child = children[i]; - if (Scene.walk(callback, child) === false) - return false; + getBounding() { + const boundings = []; + const bounding = Adapt_1.Bounding.empty(); + if (this.children.length > 0) { + this.children.forEach(item => boundings.push(item.getBounding())); + for (let i = 0, len = this.children.length; i < len; i++) { + bounding.x = bounding.x > boundings[i].x ? boundings[i].x : bounding.x; + bounding.y = bounding.y > boundings[i].y ? boundings[i].y : bounding.y; + bounding.width = bounding.width < boundings[i].width ? boundings[i].width : bounding.width; + bounding.height = bounding.height < boundings[i].height ? boundings[i].height : bounding.height; } + bounding.cx = bounding.x + bounding.width / 2; + bounding.cy = bounding.y + bounding.height / 2; } + return bounding; } /** - * Propagate scene to sceneChild (and children) + * Chear children buffer * - * @static - * @param {SceneChild} sceneChild - * @param {Scene} scene - * @memberof Scene + * @param {boolean} [bClearIndexed=false] + * @param {boolean} [bPropagateToParents=false] + * @memberof Group */ - static propagateToChilden(sceneChild, scene) { - sceneChild.scene = scene; - if (sceneChild instanceof Group_1.Group) { - sceneChild.getChildren().forEach((item) => { - Scene.propagateToChilden(item, scene); - }); - } - else if (sceneChild instanceof Shape_1.Shape && sceneChild.shape) { - sceneChild.shape.scene = scene; - Scene.propagateToChilden(sceneChild.shape, scene); + clearBuffer(bClearIndexed = false, bPropagateToParents = true) { + this.children.forEach(item => item.clearBuffer(bClearIndexed, false)); + if (this.scene && bPropagateToParents) { + const parents = this.scene.getParentsOfSceneChild(this); + parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */); } + // if (bPropagateToParents && this.scene) + // { + // const parents = this.scene.getParentsOfSceneChild(this) + // parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, true, false) + // } + // if (bPropagateToChildren) + // { + // this.children.forEach(sceneChild => sceneChild.clearBuffer(bClearIndexed, false, true)) + // } } -} -exports.Scene = Scene; -//# sourceMappingURL=Scene.js.map - -/***/ }), -/* 24 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SceneChild = void 0; -/** - * Autoincrement sceneChild default id - * - * @internal - * @ignore - */ -let __id = 0; -/** - * The element to be added into a scene. - * Preserve props, drawing order, generate and return buffers. - * The only implementations of this class are Group and ShapeBase - * - * @abstract - * @category Core.Abstract - * @order 2 - * @class SceneChild - */ -class SceneChild { /** - * Creates an instance of SceneChild. - * Base values will be assigned in case they are not passed + * Set a single or multiple props * - * @param {ISceneChildSettings} settings + * @abstract + * @param {(keyof ISceneChildProps | ISceneChildProps)} key + * @param {*} [value] + * @memberof SceneChild */ - constructor(settings) { - var _a; - /** - * Shape generation id - * used for prevent buffer calculation - * - * @internal - * @ignore - */ - this.generateId = -1; - this.id = (_a = settings.id) !== null && _a !== void 0 ? _a : ++__id; - this.type = settings.type || 'SceneChild'; - this.name = settings.name || this.type + '_' + this.id; - this.data = settings.data || {}; - this.props = {}; + setProp(key, value) { + if (typeof key === 'object') + Object.keys(key).forEach((k) => (this.props[k] = key[k])); + else + this.props[key] = value; + this.children.forEach(item => item.setProp(key, value)); } /** - * Find this or form or children. - * Overridden by classes that extend it + * Set a single or multiple props * - * @param {string | number} idOrName - * @returns {(SceneChild | null)} + * @param {(keyof ISceneChildProps | ISceneChildProps)} key + * @param {*} [value] + * @memberof ShapeBase */ - find(idOrName) { - if (this.id === idOrName || this.name === idOrName) - return this; - return null; + setPropUnsafe(key, value) { + super.setPropUnsafe(key, value); + this.children.forEach(item => item.setPropUnsafe(key, value)); } /** - * Return the sceneChild properties + * Return length of buffer * - * @returns {Props} + * @param {IPropArguments} propArguments + * @returns {number} + * @memberof Group */ - getProps() { - return this.props; + getBufferLength(propArguments) { + return this.children.map(sceneChild => sceneChild.getBufferLength(propArguments)).reduce((p, c) => p + c, 0); } /** - * Return a sceneChild prop or default value + * return a single buffer binded from children * - * @param {keyof Props} key - * @param {PropArguments} [propArguments] - * @param {*} [defaultValue] - * @returns {*} + * @returns {Float32Array} + * @memberof Group */ - getProp(key, propArguments, defaultValue) { - var _a; - return ((_a = this.props[key]) !== null && _a !== void 0 ? _a : defaultValue); + getBuffer() { + const buffers = this.children + .map(item => item.getBuffer()) + .filter(b => b !== undefined); + const size = buffers.reduce((currLength, buffer) => currLength + buffer.length, 0); + if (size > 0) { + const result = new Float32Array(size); + result.set(buffers[0], 0); + for (let i = 1, offset = 0, len = buffers.length; i < len; i++) { + offset += buffers[i - 1].length; + result.set(buffers[i], offset); + } + return result; + } + return ShapeBase_1.ShapeBase.EMPTY_BUFFER; } /** - * Check SceneChild has prop + * return a single buffer binded from children * - * @param {keyof Props} key - * @returns + * @returns {(Array | undefined)} + * @memberof Group */ - hasProp(key) { - return typeof this.props[key] !== 'undefined'; + getIndexedBuffer() { + const indexed = this.children.map(item => item.getIndexedBuffer()).filter(b => b !== undefined); + return [].concat.apply([], indexed); } /** - * Set a single or multiple props + * Call strem on children * - * @param {(keyof ISceneChildProps | ISceneChildProps)} key - * @param {*} [value] + * @param {(streamArguments: IStreamArguments) => void} callback + * @memberof Group */ - setPropUnsafe(key, value) { - if (typeof key == 'string') - this.props[key] = value; - else - Object.keys(key).forEach((k) => (this.props[k] = key[k])); + stream(callback) { + this.children.forEach(item => item.stream(callback)); } } -exports.SceneChild = SceneChild; -//# sourceMappingURL=SceneChild.js.map +exports.Group = Group; +//# sourceMappingURL=Group.js.map /***/ }), -/* 25 */ +/* 6 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Group = void 0; -const Scene_1 = __webpack_require__(23); -const SceneChild_1 = __webpack_require__(24); -const ShapeBase_1 = __webpack_require__(26); +exports.ShapeBase = void 0; +const gl_matrix_1 = __webpack_require__(7); +const types_1 = __webpack_require__(18); +const glme = __webpack_require__(27); +const Vec2_1 = __webpack_require__(28); +const math_1 = __webpack_require__(29); const Adapt_1 = __webpack_require__(30); +const Utilities_1 = __webpack_require__(32); +const SceneChild_1 = __webpack_require__(4); +const tmpMatrix = gl_matrix_1.mat4.create(); +const transformMatrix = gl_matrix_1.mat4.create(); +const perspectiveMatrix = gl_matrix_1.mat4.create(); +const repetitionMatrix = gl_matrix_1.mat4.create(); /** - * A SceneChild container, propagates properties to children + * Main class for shape generation * - * @order 3 - * @category Core.Scene + * @category Core.Abstract + * @abstract + * @class ShapeBase + * @order 4 * @extends {SceneChild} - * @example - * ```javascript - * // Group example - * - * const rect = new Urpflanze.Rect({ - * distance: 100 // <- if a property is set the group will not overwrite it - * }) - * const group = new Urpflanze.Group({ - * repetitions: 3, - * distance: 200 - * }) - * - * group.add(rect) - * group.add(new Urpflanze.Triangle()) - * ``` - * @class Group */ -class Group extends SceneChild_1.SceneChild { +class ShapeBase extends SceneChild_1.SceneChild { /** - * Creates an instance of Group + * Creates an instance of ShapeBase * * @param {ISceneChildSettings} [settings={}] - * @memberof Group */ constructor(settings = {}) { - settings.type = 'Group'; super(settings); - this.children = []; - ['id', 'name', 'data', 'order', 'type'].forEach((prop) => { - if (prop in settings) - delete settings[prop]; - }); - this.props = settings; + /** + * Flag used to determine if indexedBuffer has been generated + * + * @internal + * @ignore + */ + this.bIndexed = false; + /** + * Array used for index a vertex buffer + * only for first level scene children + * + * @internal + * @ignore + */ + this.indexedBuffer = []; + /** + * The bounding inside the scene + * + * @type {IShapeBounding} + */ + this.bounding = { + cx: 0, + cy: 0, + x: -1, + y: -1, + width: 2, + height: 2, + }; + this.props = { + distance: settings.distance, + repetitions: settings.repetitions, + rotateX: settings.rotateX, + rotateY: settings.rotateY, + rotateZ: settings.rotateZ, + skewX: settings.skewX, + skewY: settings.skewY, + squeezeX: settings.squeezeX, + squeezeY: settings.squeezeY, + displace: settings.displace, + translate: settings.translate, + scale: settings.scale, + transformOrigin: settings.transformOrigin, + perspective: settings.perspective, + perspectiveOrigin: settings.perspectiveOrigin, + }; + this.anchor = + settings.anchor && Array.isArray(settings.anchor) + ? [ + typeof settings.anchor[0] === 'number' + ? Utilities_1.clamp(-1, 1, settings.anchor[0]) * -1 + : settings.anchor[0] === 'left' + ? 1 + : settings.anchor[0] === 'right' + ? -1 + : 0, + typeof settings.anchor[1] === 'number' + ? Utilities_1.clamp(-1, 1, settings.anchor[1]) * -1 + : settings.anchor[1] === 'top' + ? 1 + : settings.anchor[1] === 'bottom' + ? -1 + : 0, + ] + : [0, 0]; + this.boundingType = + typeof settings.boundingType === 'string' + ? settings.boundingType === 'relative' + ? types_1.EBoundingType.Relative + : types_1.EBoundingType.Fixed + : settings.boundingType || types_1.EBoundingType.Fixed; + this.vertexCallback = settings.vertexCallback; } /** - * Check group has static children + * Check if the shape should be generated every time * * @returns {boolean} - * @memberof Group */ isStatic() { - const children = this.children; - for (let i = 0, len = children.length; i < len; i++) - if (!children[i].isStatic()) - return false; - return true; + const props = this.props; + return (typeof props.repetitions !== 'function' && + typeof props.distance !== 'function' && + typeof props.displace !== 'function' && + typeof props.scale !== 'function' && + typeof props.translate !== 'function' && + typeof props.skewX !== 'function' && + typeof props.skewY !== 'function' && + typeof props.squeezeX !== 'function' && + typeof props.squeezeY !== 'function' && + typeof props.rotateX !== 'function' && + typeof props.rotateY !== 'function' && + typeof props.rotateZ !== 'function' && + typeof props.transformOrigin !== 'function' && + typeof props.perspective !== 'function' && + typeof props.perspectiveOrigin !== 'function'); } /** - * Check group has static children indexed + * Check if the indexedBuffer array needs to be recreated every time, + * this can happen when a shape generates an array of vertices different in length at each repetition * * @returns {boolean} - * @memberof Group */ isStaticIndexed() { - const children = this.children; - for (let i = 0, len = children.length; i < len; i++) - if (!children[i].isStaticIndexed()) - return false; - return true; + return typeof this.props.repetitions !== 'function'; } /** - * Add item to Group + * Return a prop value * - * @param {Array} items - * @memberof Group + * @param {keyof ISceneChildProps} key + * @param {PropArguments} [propArguments] + * @param {*} [defaultValue] + * @returns {*} */ - add(...items) { - for (let i = 0, len = items.length; i < len; i++) { - const item = items[i]; - const rawItemProps = item.getProps(); - Object.keys(this.props).forEach((propKey) => { - if (typeof rawItemProps[propKey] === 'undefined') - item.setProp(propKey, this.props[propKey]); - }); - item.order = - typeof item.order !== 'undefined' - ? item.order - : this.children.length > 0 - ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1 - : 0; - this.scene && Scene_1.Scene.propagateToChilden(item, this.scene); - this.children.push(item); + getProp(key, propArguments, defaultValue) { + let attribute = this.props[key]; + if (typeof attribute === 'function') { + attribute = attribute(propArguments); } - this.sortChildren(); - } - /** - * Sort children - * - * @memberof Group - */ - sortChildren() { - this.children.sort((a, b) => a.order - b.order); - this.children = this.children.map((child, index) => { - child.order = index; - return child; - }); - this.clearBuffer(true); - } - /** - * Return shape children - * - * @returns {Array} - * @memberof Group - */ - getChildren() { - return this.children; + return typeof attribute === 'undefined' || Number.isNaN(attribute) ? defaultValue : attribute; } /** - * Find scene child from id or name + * Set a single or multiple props * - * @param {number | string} idOrName - * @returns {(SceneChild | null)} - * @memberof Group + * @param {(keyof ISceneChildProps | ISceneChildProps)} key + * @param {*} [value] + * @param {boolean} [bClearIndexed=false] */ - find(idOrName) { - if (this.id === idOrName || this.name === idOrName) - return this; - const children = this.getChildren(); - for (let i = 0, len = children.length; i < len; i++) { - const result = children[i].find(idOrName); - if (result !== null) - return result; + setProp(key, value, bClearIndexed = false) { + if (typeof key === 'string') { + bClearIndexed = bClearIndexed || key == 'repetitions'; + this.props[key] = value; } - return null; - } - /** - * Get item from group - * - * @param {number} index - * @returns {(SceneChild | null)} - * @memberof Group - */ - get(index) { - return index >= 0 && index < this.children.length ? this.children[index] : null; - } - /** - * Remove item from group - * - * @param {number} index - * @returns {(false | Array)} - * @memberof Group - */ - remove(index) { - if (index >= 0 && index < this.children.length) { - const removed = this.children.splice(index, 1); - this.clearBuffer(true); - return removed; + else { + bClearIndexed = bClearIndexed || 'repetitions' in key; + Object.keys(key).forEach((k) => (this.props[k] = key[k])); } - return false; + this.clearBuffer(bClearIndexed, true); } /** - * Remove from id + * Unset buffer * - * @param {number} id - * @memberof Scene + * @param {boolean} [bClearIndexed=false] + * @param {boolean} [bPropagateToParents=false] + * @param {boolean} [bPropagateToChildren=false] */ - removeFromId(id) { - for (let i = 0, len = this.children.length; i < len; i++) { - if (this.children[i].id == id) { - this.children.splice(i, 1); - return this.clearBuffer(true); - } + clearBuffer(bClearIndexed = false, bPropagateToParents = true) { + this.buffer = undefined; + if (bClearIndexed) { + this.bIndexed = false; + this.indexedBuffer = []; + } + this.bStatic = this.isStatic(); + this.bStaticIndexed = this.isStaticIndexed(); + if (bPropagateToParents && this.scene && !this.scene.isFirstLevelChild(this)) { + const parents = this.scene.getParentsOfSceneChild(this); + parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */); } } /** - * Generate children buffers + * Update the vertex array if the shape is not static and update the indexedBuffer if it is also not static * - * @param {number} generateId - * @param {boolean} [bDirectSceneChild=false] - * @param {IPropArguments} [parentPropArguments] - * @memberof Group + * @param {number} generateId generation id + * @param {boolean} [bDirectSceneChild=false] adjust shape of center of scene + * @param {PropArguments} [parentPropArguments] */ - generate(generateId, bDirectSceneChild = false, parentPropArguments) { + generate(generateId = 0, bDirectSceneChild = false, parentPropArguments) { + var _a, _b; + if (this.buffer && this.bStatic) { + return; + } this.generateId = generateId; - this.children.forEach(item => item.generate(generateId, bDirectSceneChild, parentPropArguments)); + if (!this.bStaticIndexed || !this.bIndexed) + this.indexedBuffer = []; + const propArguments = ShapeBase.getEmptyPropArguments(this, parentPropArguments); + const repetition = propArguments.repetition; + const repetitions = this.getProp('repetitions', propArguments, 1); + const repetitionType = Array.isArray(repetitions) ? types_1.ERepetitionType.Matrix : types_1.ERepetitionType.Ring; + const repetitionCount = Array.isArray(repetitions) + ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) + : repetitions; + const repetitionRowCount = Array.isArray(repetitions) ? repetitions[0] : repetitionCount; + const repetitionColCount = Array.isArray(repetitions) ? (_b = repetitions[1]) !== null && _b !== void 0 ? _b : repetitions[0] : 1; + const rowRepetition = repetition.row; + rowRepetition.count = repetitionRowCount; + const colRepetition = repetition.col; + colRepetition.count = repetitionColCount; + repetition.count = repetitionCount; + repetition.col.count = repetitionColCount; + repetition.row.count = repetitionRowCount; + repetition.type = repetitionType; + let totalBufferLength = 0; + const buffers = []; + let currentIndex = 0; + const centerMatrix = gl_matrix_1.vec2.fromValues((repetitionColCount - 1) / 2, (repetitionRowCount - 1) / 2); + const sceneAnchor = this.scene ? [this.scene.anchor[0], this.scene.anchor[1], 0] : [0, 0, 0]; + const tmpTotalShapeBounding = [undefined, undefined, undefined, undefined]; + const tmpSingleRepetitionBounding = [undefined, undefined, undefined, undefined]; + for (let currentRowRepetition = 0; currentRowRepetition < repetitionRowCount; currentRowRepetition++) { + for (let currentColRepetition = 0; currentColRepetition < repetitionColCount; currentColRepetition++, currentIndex++) { + repetition.index = currentIndex + 1; + repetition.offset = repetitionCount > 1 ? currentIndex / (repetitionCount - 1) : 1; + repetition.angle = repetitionType === types_1.ERepetitionType.Ring ? (math_1.PI2 / repetitionCount) * currentIndex : 0; + colRepetition.index = currentColRepetition + 1; + colRepetition.offset = repetitionColCount > 1 ? currentColRepetition / (repetitionColCount - 1) : 1; + rowRepetition.index = currentRowRepetition + 1; + rowRepetition.offset = repetitionRowCount > 1 ? currentRowRepetition / (repetitionRowCount - 1) : 1; + // Generate primitives buffer recursively + const buffer = this.generateBuffer(generateId, propArguments); + const bufferLength = buffer.length; + const bounding = this.getShapeBounding(); + buffers[currentIndex] = new Float32Array(bufferLength); + totalBufferLength += bufferLength; + { + const distance = glme.toVec2(this.getProp('distance', propArguments, glme.VEC2_ZERO)); + const displace = this.getProp('displace', propArguments, 0); + const scale = glme.toVec3(this.getProp('scale', propArguments, glme.VEC2_ONE), 1); + const translate = glme.toVec3(this.getProp('translate', propArguments, glme.VEC2_ZERO), 0); + const skewX = this.getProp('skewX', propArguments, 0); + const skewY = this.getProp('skewY', propArguments, 0); + const squeezeX = this.getProp('squeezeX', propArguments, 0); + const squeezeY = this.getProp('squeezeY', propArguments, 0); + const rotateX = this.getProp('rotateX', propArguments, 0); + const rotateY = this.getProp('rotateY', propArguments, 0); + const rotateZ = this.getProp('rotateZ', propArguments, 0); + const perspective = Utilities_1.clamp(0, 1, this.getProp('perspective', propArguments, 0)); + const perspectiveOrigin = glme.toVec3(this.getProp('perspectiveOrigin', propArguments, glme.VEC2_ZERO), 0); + const transformOrigin = glme.toVec3(this.getProp('transformOrigin', propArguments, glme.VEC2_ZERO), 0); + let offset; + switch (repetitionType) { + case types_1.ERepetitionType.Ring: + offset = gl_matrix_1.vec3.fromValues(distance[0], 0, 0); + gl_matrix_1.vec3.rotateZ(offset, offset, glme.VEC3_ZERO, repetition.angle + displace); + break; + case types_1.ERepetitionType.Matrix: + offset = gl_matrix_1.vec3.fromValues(distance[1] * (currentColRepetition - centerMatrix[0]), distance[0] * (currentRowRepetition - centerMatrix[1]), 0); + break; + } + const perspectiveSize = perspective > 0 ? Math.max(bounding.width, bounding.height) / 2 : 1; + const perspectiveValue = perspective > 0 ? perspectiveSize + (1 - perspective) * (perspectiveSize * 10) : 0; + const bTransformOrigin = (this.boundingType === types_1.EBoundingType.Relative ? bounding.cx !== 0 || bounding.cy !== 0 : true) || + perspective !== 0 || + transformOrigin[0] !== 0 || + transformOrigin[1] !== 0; + const bPerspectiveOrigin = perspectiveOrigin[0] !== 0 || perspectiveOrigin[1] !== 0; + if (bTransformOrigin) { + if (this.boundingType === types_1.EBoundingType.Relative) { + transformOrigin[0] = transformOrigin[0] * (bounding.width / 2) + bounding.cx; + transformOrigin[1] = transformOrigin[1] * (bounding.height / 2) + bounding.cy; + } + else { + transformOrigin[0] *= bounding.width / 2; + transformOrigin[1] *= bounding.height / 2; + } + transformOrigin[2] = perspectiveValue; + } + /** + * Create Matrices + */ + { + /** + * Create Transformation matrix + */ + gl_matrix_1.mat4.identity(transformMatrix); + bTransformOrigin && gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, transformOrigin); + if (translate[0] !== 0 || translate[1] !== 0) + gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, translate); + if (skewX !== 0 || skewY !== 0) { + glme.fromSkew(tmpMatrix, [skewX, skewY]); + gl_matrix_1.mat4.multiply(transformMatrix, transformMatrix, tmpMatrix); + } + rotateX !== 0 && gl_matrix_1.mat4.rotateX(transformMatrix, transformMatrix, rotateX); + rotateY !== 0 && gl_matrix_1.mat4.rotateY(transformMatrix, transformMatrix, rotateY); + rotateZ !== 0 && gl_matrix_1.mat4.rotateZ(transformMatrix, transformMatrix, rotateZ); + if (scale[0] !== 1 || scale[1] !== 1) + gl_matrix_1.mat4.scale(transformMatrix, transformMatrix, scale); + bTransformOrigin && + gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, gl_matrix_1.vec3.scale(transformOrigin, transformOrigin, -1)); + /** + * Create Perspective matrix + */ + if (perspectiveValue > 0) { + if (bPerspectiveOrigin) { + if (this.boundingType === types_1.EBoundingType.Relative) { + perspectiveOrigin[0] = perspectiveOrigin[0] * (bounding.width / 2) + bounding.cx; + perspectiveOrigin[1] = perspectiveOrigin[1] * (bounding.height / 2) + bounding.cy; + } + else { + perspectiveOrigin[0] *= bounding.width / 2; + perspectiveOrigin[1] *= bounding.height / 2; + } + perspectiveOrigin[2] = 0; + } + gl_matrix_1.mat4.perspective(perspectiveMatrix, -Math.PI / 2, 1, 0, Infinity); + } + /** + * Create Repetition matrix + */ + gl_matrix_1.mat4.identity(repetitionMatrix); + gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, offset); + if (bDirectSceneChild) { + gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, sceneAnchor); + } + /** + * Apply anchor + */ + const shapeAnchor = [this.anchor[0] * (bounding.width / 2), this.anchor[1] * (bounding.height / 2), 0]; + gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, shapeAnchor); + if (repetitionType === types_1.ERepetitionType.Ring) + gl_matrix_1.mat4.rotateZ(repetitionMatrix, repetitionMatrix, repetition.angle + displace); + } + Adapt_1.Bounding.clear(tmpSingleRepetitionBounding); + // Apply matrices on vertex + for (let bufferIndex = 0; bufferIndex < bufferLength; bufferIndex += 2) { + const vertex = [buffer[bufferIndex], buffer[bufferIndex + 1], perspectiveValue]; + { + // Apply squeeze, can be insert into transformMatrix? + squeezeX !== 0 && Vec2_1.default.squeezeX(vertex, squeezeX); + squeezeY !== 0 && Vec2_1.default.squeezeY(vertex, squeezeY); + // Apply transforms + gl_matrix_1.vec3.transformMat4(vertex, vertex, transformMatrix); + // Apply perspective + if (perspectiveValue > 0) { + bPerspectiveOrigin && gl_matrix_1.vec3.add(vertex, vertex, perspectiveOrigin); + gl_matrix_1.vec3.transformMat4(vertex, vertex, perspectiveMatrix); + gl_matrix_1.vec3.scale(vertex, vertex, perspectiveValue); + bPerspectiveOrigin && gl_matrix_1.vec3.sub(vertex, vertex, perspectiveOrigin); + } + // apply repetition matrix + gl_matrix_1.vec3.transformMat4(vertex, vertex, repetitionMatrix); + // custom vertex manipulation + if (typeof this.vertexCallback !== 'undefined') { + const index = bufferIndex / 2; + const count = bufferLength / 2; + const vertexRepetition = { + index: index + 1, + count, + offset: count > 1 ? index / (count - 1) : 1, + }; + this.vertexCallback(vertex, vertexRepetition, propArguments); + } + } + buffers[currentIndex][bufferIndex] = vertex[0]; + buffers[currentIndex][bufferIndex + 1] = vertex[1]; + Adapt_1.Bounding.add(tmpSingleRepetitionBounding, vertex[0], vertex[1]); + Adapt_1.Bounding.add(tmpTotalShapeBounding, vertex[0], vertex[1]); + } + } + // Bounding.sum(tmpTotalShapeBounding, tmpSingleRepetitionBounding) + // After buffer creation, add a frame into indexedBuffer if not static or update bounding + const singleRepetitionBounding = { cx: 0, cy: 0, x: -1, y: -1, width: 2, height: 2 }; + Adapt_1.Bounding.bind(singleRepetitionBounding, tmpSingleRepetitionBounding); + if (!this.bStaticIndexed || !this.bIndexed) { + this.addIndex(bufferLength, repetition, singleRepetitionBounding); + } + } + } + Adapt_1.Bounding.bind(this.bounding, tmpTotalShapeBounding); + this.buffer = new Float32Array(totalBufferLength); + for (let i = 0, offset = 0, len = buffers.length; i < len; offset += buffers[i].length, i++) + this.buffer.set(buffers[i], offset); + this.bIndexed = true; } /** - * Sum the children bounding + * Return current shape (whit repetions) bounding * - * @return {IShapeBounding} + * @return {*} {IShapeBounding} */ getBounding() { - const boundings = []; - const bounding = Adapt_1.Bounding.empty(); - if (this.children.length > 0) { - this.children.forEach(item => boundings.push(item.getBounding())); - for (let i = 0, len = this.children.length; i < len; i++) { - bounding.x = bounding.x > boundings[i].x ? boundings[i].x : bounding.x; - bounding.y = bounding.y > boundings[i].y ? boundings[i].y : bounding.y; - bounding.width = bounding.width < boundings[i].width ? boundings[i].width : bounding.width; - bounding.height = bounding.height < boundings[i].height ? boundings[i].height : bounding.height; - } - bounding.cx = bounding.x + bounding.width / 2; - bounding.cy = bounding.y + bounding.height / 2; - } - return bounding; + return this.bounding; } /** - * Chear children buffer - * - * @param {boolean} [bClearIndexed=false] - * @param {boolean} [bPropagateToParents=false] - * @memberof Group + * Get number of repetitions + * + * @returns {number} */ - clearBuffer(bClearIndexed = false, bPropagateToParents = true) { - this.children.forEach(item => item.clearBuffer(bClearIndexed, false)); - if (this.scene && bPropagateToParents) { - const parents = this.scene.getParentsOfSceneChild(this); - parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */); - } - // if (bPropagateToParents && this.scene) - // { - // const parents = this.scene.getParentsOfSceneChild(this) - // parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, true, false) - // } - // if (bPropagateToChildren) - // { - // this.children.forEach(sceneChild => sceneChild.clearBuffer(bClearIndexed, false, true)) - // } + getRepetitionCount() { + var _a; + const repetitions = this.getProp('repetitions', undefined, 1); + return Array.isArray(repetitions) ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) : repetitions; } /** - * Set a single or multiple props + * Return buffer * - * @abstract - * @param {(keyof ISceneChildProps | ISceneChildProps)} key - * @param {*} [value] - * @memberof SceneChild + * @returns {(Float32Array | undefined)} */ - setProp(key, value) { - if (typeof key === 'object') - Object.keys(key).forEach((k) => (this.props[k] = key[k])); - else - this.props[key] = value; - this.children.forEach(item => item.setProp(key, value)); + getBuffer() { + return this.buffer; } /** - * Set a single or multiple props + * Return indexed buffer * - * @param {(keyof ISceneChildProps | ISceneChildProps)} key - * @param {*} [value] - * @memberof ShapeBase + * @returns {(Array> | undefined)} */ - setPropUnsafe(key, value) { - super.setPropUnsafe(key, value); - this.children.forEach(item => item.setPropUnsafe(key, value)); + getIndexedBuffer() { + return this.indexedBuffer; } /** - * Return length of buffer + * Return number of encapsulation * - * @param {IPropArguments} propArguments + * @param {IBufferIndex} index * @returns {number} - * @memberof Group */ - getBufferLength(propArguments) { - return this.children.map(sceneChild => sceneChild.getBufferLength(propArguments)).reduce((p, c) => p + c, 0); + static getIndexParentLevel(index) { + if (typeof index.parent === 'undefined') + return 0; + let currentParent = index.parent; + let currentParentLevel = 1; + while (typeof currentParent.parent !== 'undefined') { + currentParentLevel++; + currentParent = currentParent.parent; + } + return currentParentLevel; } /** - * return a single buffer binded from children + * Stream buffer * - * @returns {Float32Array} - * @memberof Group + * @param {(TStreamCallback} callback */ - getBuffer() { - const buffers = this.children - .map(item => item.getBuffer()) - .filter(b => b !== undefined); - const size = buffers.reduce((currLength, buffer) => currLength + buffer.length, 0); - if (size > 0) { - const result = new Float32Array(size); - result.set(buffers[0], 0); - for (let i = 1, offset = 0, len = buffers.length; i < len; i++) { - offset += buffers[i - 1].length; - result.set(buffers[i], offset); + stream(callback) { + if (this.buffer && this.indexedBuffer) { + for (let i = 0, j = 0, len = this.indexedBuffer.length; i < len; i++) { + const currentIndexing = this.indexedBuffer[i]; + callback({ + buffer: this.buffer, + frameLength: currentIndexing.frameLength, + frameBufferIndex: j, + currentIndexing: currentIndexing, + currentShapeIndex: i, + totalShapes: len, + }); + j += currentIndexing.frameLength; } - return result; } - return ShapeBase_1.ShapeBase.EMPTY_BUFFER; } - /** - * return a single buffer binded from children - * - * @returns {(Array | undefined)} - * @memberof Group - */ - getIndexedBuffer() { - const indexed = this.children.map(item => item.getIndexedBuffer()).filter(b => b !== undefined); - return [].concat.apply([], indexed); + /** + * Return empty propArguments + * + * @static + * @param {ShapeBase} shape + * @return {*} {PropArguments} + */ + static getEmptyPropArguments(shape, parentPropArguments) { + const repetition = { + type: types_1.ERepetitionType.Ring, + angle: 0, + index: 1, + offset: 1, + count: 1, + row: { index: 1, offset: 1, count: 1 }, + col: { index: 1, offset: 1, count: 1 }, + }; + return { + repetition, + shape, + parent: parentPropArguments, + }; + } +} +exports.ShapeBase = ShapeBase; +/** + * Empty buffer + * + * @internal + * @ignore + */ +ShapeBase.EMPTY_BUFFER = new Float32Array(0); +/** + * Empty BaseRepetition + * + * @internal + * @ignore + */ +ShapeBase.getEmptySimpleRepetition = () => ({ + index: 1, + offset: 1, + count: 1, +}); +/** + * Empty Repetition + * + * @internal + * @ignore + */ +ShapeBase.getEmptyRepetition = () => ({ + type: types_1.ERepetitionType.Ring, + angle: 0, + ...ShapeBase.getEmptySimpleRepetition(), + row: ShapeBase.getEmptySimpleRepetition(), + col: ShapeBase.getEmptySimpleRepetition(), +}); +//# sourceMappingURL=ShapeBase.js.map + +/***/ }), +/* 7 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "glMatrix": () => (/* reexport module object */ _common_js__WEBPACK_IMPORTED_MODULE_0__), +/* harmony export */ "mat2": () => (/* reexport module object */ _mat2_js__WEBPACK_IMPORTED_MODULE_1__), +/* harmony export */ "mat2d": () => (/* reexport module object */ _mat2d_js__WEBPACK_IMPORTED_MODULE_2__), +/* harmony export */ "mat3": () => (/* reexport module object */ _mat3_js__WEBPACK_IMPORTED_MODULE_3__), +/* harmony export */ "mat4": () => (/* reexport module object */ _mat4_js__WEBPACK_IMPORTED_MODULE_4__), +/* harmony export */ "quat": () => (/* reexport module object */ _quat_js__WEBPACK_IMPORTED_MODULE_5__), +/* harmony export */ "quat2": () => (/* reexport module object */ _quat2_js__WEBPACK_IMPORTED_MODULE_6__), +/* harmony export */ "vec2": () => (/* reexport module object */ _vec2_js__WEBPACK_IMPORTED_MODULE_7__), +/* harmony export */ "vec3": () => (/* reexport module object */ _vec3_js__WEBPACK_IMPORTED_MODULE_8__), +/* harmony export */ "vec4": () => (/* reexport module object */ _vec4_js__WEBPACK_IMPORTED_MODULE_9__) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); +/* harmony import */ var _mat2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9); +/* harmony import */ var _mat2d_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10); +/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11); +/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12); +/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(13); +/* harmony import */ var _quat2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(16); +/* harmony import */ var _vec2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(17); +/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(15); +/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(14); + + + + + + + + + + + + +/***/ }), +/* 8 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "EPSILON": () => (/* binding */ EPSILON), +/* harmony export */ "ARRAY_TYPE": () => (/* binding */ ARRAY_TYPE), +/* harmony export */ "RANDOM": () => (/* binding */ RANDOM), +/* harmony export */ "setMatrixArrayType": () => (/* binding */ setMatrixArrayType), +/* harmony export */ "toRadian": () => (/* binding */ toRadian), +/* harmony export */ "equals": () => (/* binding */ equals) +/* harmony export */ }); +/** + * Common utilities + * @module glMatrix + */ +// Configuration Constants +var EPSILON = 0.000001; +var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array; +var RANDOM = Math.random; +/** + * Sets the type of array used when creating new vectors and matrices + * + * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array + */ + +function setMatrixArrayType(type) { + ARRAY_TYPE = type; +} +var degree = Math.PI / 180; +/** + * Convert Degree To Radian + * + * @param {Number} a Angle in Degrees + */ + +function toRadian(a) { + return a * degree; +} +/** + * Tests whether or not the arguments have approximately the same value, within an absolute + * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less + * than or equal to 1.0, and a relative tolerance is used for larger values) + * + * @param {Number} a The first number to test. + * @param {Number} b The second number to test. + * @returns {Boolean} True if the numbers are approximately equal, false otherwise. + */ + +function equals(a, b) { + return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b)); +} +if (!Math.hypot) Math.hypot = function () { + var y = 0, + i = arguments.length; + + while (i--) { + y += arguments[i] * arguments[i]; + } + + return Math.sqrt(y); +}; + +/***/ }), +/* 9 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "transpose": () => (/* binding */ transpose), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "adjoint": () => (/* binding */ adjoint), +/* harmony export */ "determinant": () => (/* binding */ determinant), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "rotate": () => (/* binding */ rotate), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), +/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "frob": () => (/* binding */ frob), +/* harmony export */ "LDU": () => (/* binding */ LDU), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), +/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "sub": () => (/* binding */ sub) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); + +/** + * 2x2 Matrix + * @module mat2 + */ + +/** + * Creates a new identity mat2 + * + * @returns {mat2} a new 2x2 matrix + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[1] = 0; + out[2] = 0; + } + + out[0] = 1; + out[3] = 1; + return out; +} +/** + * Creates a new mat2 initialized with values from an existing matrix + * + * @param {ReadonlyMat2} a matrix to clone + * @returns {mat2} a new 2x2 matrix + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; +} +/** + * Copy the values from one mat2 to another + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the source matrix + * @returns {mat2} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; +} +/** + * Set a mat2 to the identity matrix + * + * @param {mat2} out the receiving matrix + * @returns {mat2} out + */ + +function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; +} +/** + * Create a new mat2 with the given values + * + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m10 Component in column 1, row 0 position (index 2) + * @param {Number} m11 Component in column 1, row 1 position (index 3) + * @returns {mat2} out A new 2x2 matrix + */ + +function fromValues(m00, m01, m10, m11) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + out[0] = m00; + out[1] = m01; + out[2] = m10; + out[3] = m11; + return out; +} +/** + * Set the components of a mat2 to the given values + * + * @param {mat2} out the receiving matrix + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m10 Component in column 1, row 0 position (index 2) + * @param {Number} m11 Component in column 1, row 1 position (index 3) + * @returns {mat2} out + */ + +function set(out, m00, m01, m10, m11) { + out[0] = m00; + out[1] = m01; + out[2] = m10; + out[3] = m11; + return out; +} +/** + * Transpose the values of a mat2 + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the source matrix + * @returns {mat2} out + */ + +function transpose(out, a) { + // If we are transposing ourselves we can skip a few steps but have to cache + // some values + if (out === a) { + var a1 = a[1]; + out[1] = a[2]; + out[2] = a1; + } else { + out[0] = a[0]; + out[1] = a[2]; + out[2] = a[1]; + out[3] = a[3]; + } + + return out; +} +/** + * Inverts a mat2 + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the source matrix + * @returns {mat2} out + */ + +function invert(out, a) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; // Calculate the determinant + + var det = a0 * a3 - a2 * a1; + + if (!det) { + return null; + } + + det = 1.0 / det; + out[0] = a3 * det; + out[1] = -a1 * det; + out[2] = -a2 * det; + out[3] = a0 * det; + return out; +} +/** + * Calculates the adjugate of a mat2 + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the source matrix + * @returns {mat2} out + */ + +function adjoint(out, a) { + // Caching this value is nessecary if out == a + var a0 = a[0]; + out[0] = a[3]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a0; + return out; +} +/** + * Calculates the determinant of a mat2 + * + * @param {ReadonlyMat2} a the source matrix + * @returns {Number} determinant of a + */ + +function determinant(a) { + return a[0] * a[3] - a[2] * a[1]; +} +/** + * Multiplies two mat2's + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the first operand + * @param {ReadonlyMat2} b the second operand + * @returns {mat2} out + */ + +function multiply(out, a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + return out; +} +/** + * Rotates a mat2 by the given angle + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat2} out + */ + +function rotate(out, a, rad) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + return out; +} +/** + * Scales the mat2 by the dimensions in the given vec2 + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the matrix to rotate + * @param {ReadonlyVec2} v the vec2 to scale the matrix by + * @returns {mat2} out + **/ + +function scale(out, a, v) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var v0 = v[0], + v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + return out; +} +/** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * mat2.identity(dest); + * mat2.rotate(dest, dest, rad); + * + * @param {mat2} out mat2 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat2} out + */ + +function fromRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + return out; +} +/** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat2.identity(dest); + * mat2.scale(dest, dest, vec); + * + * @param {mat2} out mat2 receiving operation result + * @param {ReadonlyVec2} v Scaling vector + * @returns {mat2} out + */ + +function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + return out; +} +/** + * Returns a string representation of a mat2 + * + * @param {ReadonlyMat2} a matrix to represent as a string + * @returns {String} string representation of the matrix + */ + +function str(a) { + return "mat2(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; +} +/** + * Returns Frobenius norm of a mat2 + * + * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of + * @returns {Number} Frobenius norm + */ + +function frob(a) { + return Math.hypot(a[0], a[1], a[2], a[3]); +} +/** + * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix + * @param {ReadonlyMat2} L the lower triangular matrix + * @param {ReadonlyMat2} D the diagonal matrix + * @param {ReadonlyMat2} U the upper triangular matrix + * @param {ReadonlyMat2} a the input matrix to factorize + */ + +function LDU(L, D, U, a) { + L[2] = a[2] / a[0]; + U[0] = a[0]; + U[1] = a[1]; + U[3] = a[3] - L[2] * U[1]; + return [L, D, U]; +} +/** + * Adds two mat2's + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the first operand + * @param {ReadonlyMat2} b the second operand + * @returns {mat2} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; +} +/** + * Subtracts matrix b from matrix a + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the first operand + * @param {ReadonlyMat2} b the second operand + * @returns {mat2} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; +} +/** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyMat2} a The first matrix. + * @param {ReadonlyMat2} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; +} +/** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {ReadonlyMat2} a The first matrix. + * @param {ReadonlyMat2} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)); +} +/** + * Multiply each element of the matrix by a scalar. + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the matrix to scale + * @param {Number} b amount to scale the matrix's elements by + * @returns {mat2} out + */ + +function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + return out; +} +/** + * Adds two mat2's after multiplying each element of the second operand by a scalar value. + * + * @param {mat2} out the receiving vector + * @param {ReadonlyMat2} a the first operand + * @param {ReadonlyMat2} b the second operand + * @param {Number} scale the amount to scale b's elements by before adding + * @returns {mat2} out + */ + +function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; +} +/** + * Alias for {@link mat2.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link mat2.subtract} + * @function + */ + +var sub = subtract; + +/***/ }), +/* 10 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "determinant": () => (/* binding */ determinant), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "rotate": () => (/* binding */ rotate), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "translate": () => (/* binding */ translate), +/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), +/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), +/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "frob": () => (/* binding */ frob), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), +/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "sub": () => (/* binding */ sub) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); + +/** + * 2x3 Matrix + * @module mat2d + * @description + * A mat2d contains six elements defined as: + *
+ * [a, b,
+ *  c, d,
+ *  tx, ty]
+ * 
+ * This is a short form for the 3x3 matrix: + *
+ * [a, b, 0,
+ *  c, d, 0,
+ *  tx, ty, 1]
+ * 
+ * The last column is ignored so the array is shorter and operations are faster. + */ + +/** + * Creates a new identity mat2d + * + * @returns {mat2d} a new 2x3 matrix + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[1] = 0; + out[2] = 0; + out[4] = 0; + out[5] = 0; + } + + out[0] = 1; + out[3] = 1; + return out; +} +/** + * Creates a new mat2d initialized with values from an existing matrix + * + * @param {ReadonlyMat2d} a matrix to clone + * @returns {mat2d} a new 2x3 matrix + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + return out; +} +/** + * Copy the values from one mat2d to another + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the source matrix + * @returns {mat2d} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + return out; +} +/** + * Set a mat2d to the identity matrix + * + * @param {mat2d} out the receiving matrix + * @returns {mat2d} out + */ + +function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; +} +/** + * Create a new mat2d with the given values + * + * @param {Number} a Component A (index 0) + * @param {Number} b Component B (index 1) + * @param {Number} c Component C (index 2) + * @param {Number} d Component D (index 3) + * @param {Number} tx Component TX (index 4) + * @param {Number} ty Component TY (index 5) + * @returns {mat2d} A new mat2d + */ + +function fromValues(a, b, c, d, tx, ty) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); + out[0] = a; + out[1] = b; + out[2] = c; + out[3] = d; + out[4] = tx; + out[5] = ty; + return out; +} +/** + * Set the components of a mat2d to the given values + * + * @param {mat2d} out the receiving matrix + * @param {Number} a Component A (index 0) + * @param {Number} b Component B (index 1) + * @param {Number} c Component C (index 2) + * @param {Number} d Component D (index 3) + * @param {Number} tx Component TX (index 4) + * @param {Number} ty Component TY (index 5) + * @returns {mat2d} out + */ + +function set(out, a, b, c, d, tx, ty) { + out[0] = a; + out[1] = b; + out[2] = c; + out[3] = d; + out[4] = tx; + out[5] = ty; + return out; +} +/** + * Inverts a mat2d + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the source matrix + * @returns {mat2d} out + */ + +function invert(out, a) { + var aa = a[0], + ab = a[1], + ac = a[2], + ad = a[3]; + var atx = a[4], + aty = a[5]; + var det = aa * ad - ab * ac; + + if (!det) { + return null; + } + + det = 1.0 / det; + out[0] = ad * det; + out[1] = -ab * det; + out[2] = -ac * det; + out[3] = aa * det; + out[4] = (ac * aty - ad * atx) * det; + out[5] = (ab * atx - aa * aty) * det; + return out; +} +/** + * Calculates the determinant of a mat2d + * + * @param {ReadonlyMat2d} a the source matrix + * @returns {Number} determinant of a + */ + +function determinant(a) { + return a[0] * a[3] - a[1] * a[2]; +} +/** + * Multiplies two mat2d's + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the first operand + * @param {ReadonlyMat2d} b the second operand + * @returns {mat2d} out + */ + +function multiply(out, a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3], + b4 = b[4], + b5 = b[5]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + out[4] = a0 * b4 + a2 * b5 + a4; + out[5] = a1 * b4 + a3 * b5 + a5; + return out; +} +/** + * Rotates a mat2d by the given angle + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat2d} out + */ + +function rotate(out, a, rad) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5]; + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + out[4] = a4; + out[5] = a5; + return out; +} +/** + * Scales the mat2d by the dimensions in the given vec2 + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the matrix to translate + * @param {ReadonlyVec2} v the vec2 to scale the matrix by + * @returns {mat2d} out + **/ + +function scale(out, a, v) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5]; + var v0 = v[0], + v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + out[4] = a4; + out[5] = a5; + return out; +} +/** + * Translates the mat2d by the dimensions in the given vec2 + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the matrix to translate + * @param {ReadonlyVec2} v the vec2 to translate the matrix by + * @returns {mat2d} out + **/ + +function translate(out, a, v) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5]; + var v0 = v[0], + v1 = v[1]; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = a0 * v0 + a2 * v1 + a4; + out[5] = a1 * v0 + a3 * v1 + a5; + return out; +} +/** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * mat2d.identity(dest); + * mat2d.rotate(dest, dest, rad); + * + * @param {mat2d} out mat2d receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat2d} out + */ + +function fromRotation(out, rad) { + var s = Math.sin(rad), + c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + out[4] = 0; + out[5] = 0; + return out; +} +/** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat2d.identity(dest); + * mat2d.scale(dest, dest, vec); + * + * @param {mat2d} out mat2d receiving operation result + * @param {ReadonlyVec2} v Scaling vector + * @returns {mat2d} out + */ + +function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + out[4] = 0; + out[5] = 0; + return out; +} +/** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * mat2d.identity(dest); + * mat2d.translate(dest, dest, vec); + * + * @param {mat2d} out mat2d receiving operation result + * @param {ReadonlyVec2} v Translation vector + * @returns {mat2d} out + */ + +function fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = v[0]; + out[5] = v[1]; + return out; +} +/** + * Returns a string representation of a mat2d + * + * @param {ReadonlyMat2d} a matrix to represent as a string + * @returns {String} string representation of the matrix + */ + +function str(a) { + return "mat2d(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ")"; +} +/** + * Returns Frobenius norm of a mat2d + * + * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of + * @returns {Number} Frobenius norm + */ + +function frob(a) { + return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1); +} +/** + * Adds two mat2d's + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the first operand + * @param {ReadonlyMat2d} b the second operand + * @returns {mat2d} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + return out; +} +/** + * Subtracts matrix b from matrix a + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the first operand + * @param {ReadonlyMat2d} b the second operand + * @returns {mat2d} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + return out; +} +/** + * Multiply each element of the matrix by a scalar. + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the matrix to scale + * @param {Number} b amount to scale the matrix's elements by + * @returns {mat2d} out + */ + +function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + return out; +} +/** + * Adds two mat2d's after multiplying each element of the second operand by a scalar value. + * + * @param {mat2d} out the receiving vector + * @param {ReadonlyMat2d} a the first operand + * @param {ReadonlyMat2d} b the second operand + * @param {Number} scale the amount to scale b's elements by before adding + * @returns {mat2d} out + */ + +function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + return out; +} +/** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyMat2d} a The first matrix. + * @param {ReadonlyMat2d} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5]; +} +/** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {ReadonlyMat2d} a The first matrix. + * @param {ReadonlyMat2d} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3], + b4 = b[4], + b5 = b[5]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)); +} +/** + * Alias for {@link mat2d.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link mat2d.subtract} + * @function + */ + +var sub = subtract; + +/***/ }), +/* 11 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "fromMat4": () => (/* binding */ fromMat4), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "transpose": () => (/* binding */ transpose), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "adjoint": () => (/* binding */ adjoint), +/* harmony export */ "determinant": () => (/* binding */ determinant), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "translate": () => (/* binding */ translate), +/* harmony export */ "rotate": () => (/* binding */ rotate), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), +/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), +/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), +/* harmony export */ "fromMat2d": () => (/* binding */ fromMat2d), +/* harmony export */ "fromQuat": () => (/* binding */ fromQuat), +/* harmony export */ "normalFromMat4": () => (/* binding */ normalFromMat4), +/* harmony export */ "projection": () => (/* binding */ projection), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "frob": () => (/* binding */ frob), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), +/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "sub": () => (/* binding */ sub) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); + +/** + * 3x3 Matrix + * @module mat3 + */ + +/** + * Creates a new identity mat3 + * + * @returns {mat3} a new 3x3 matrix + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + } + + out[0] = 1; + out[4] = 1; + out[8] = 1; + return out; +} +/** + * Copies the upper-left 3x3 values into the given mat3. + * + * @param {mat3} out the receiving 3x3 matrix + * @param {ReadonlyMat4} a the source 4x4 matrix + * @returns {mat3} out + */ + +function fromMat4(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[4]; + out[4] = a[5]; + out[5] = a[6]; + out[6] = a[8]; + out[7] = a[9]; + out[8] = a[10]; + return out; +} +/** + * Creates a new mat3 initialized with values from an existing matrix + * + * @param {ReadonlyMat3} a matrix to clone + * @returns {mat3} a new 3x3 matrix + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; +} +/** + * Copy the values from one mat3 to another + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the source matrix + * @returns {mat3} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; +} +/** + * Create a new mat3 with the given values + * + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m02 Component in column 0, row 2 position (index 2) + * @param {Number} m10 Component in column 1, row 0 position (index 3) + * @param {Number} m11 Component in column 1, row 1 position (index 4) + * @param {Number} m12 Component in column 1, row 2 position (index 5) + * @param {Number} m20 Component in column 2, row 0 position (index 6) + * @param {Number} m21 Component in column 2, row 1 position (index 7) + * @param {Number} m22 Component in column 2, row 2 position (index 8) + * @returns {mat3} A new mat3 + */ + +function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m10; + out[4] = m11; + out[5] = m12; + out[6] = m20; + out[7] = m21; + out[8] = m22; + return out; +} +/** + * Set the components of a mat3 to the given values + * + * @param {mat3} out the receiving matrix + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m02 Component in column 0, row 2 position (index 2) + * @param {Number} m10 Component in column 1, row 0 position (index 3) + * @param {Number} m11 Component in column 1, row 1 position (index 4) + * @param {Number} m12 Component in column 1, row 2 position (index 5) + * @param {Number} m20 Component in column 2, row 0 position (index 6) + * @param {Number} m21 Component in column 2, row 1 position (index 7) + * @param {Number} m22 Component in column 2, row 2 position (index 8) + * @returns {mat3} out + */ + +function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) { + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m10; + out[4] = m11; + out[5] = m12; + out[6] = m20; + out[7] = m21; + out[8] = m22; + return out; +} +/** + * Set a mat3 to the identity matrix + * + * @param {mat3} out the receiving matrix + * @returns {mat3} out + */ + +function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; +} +/** + * Transpose the values of a mat3 + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the source matrix + * @returns {mat3} out + */ + +function transpose(out, a) { + // If we are transposing ourselves we can skip a few steps but have to cache some values + if (out === a) { + var a01 = a[1], + a02 = a[2], + a12 = a[5]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a01; + out[5] = a[7]; + out[6] = a02; + out[7] = a12; + } else { + out[0] = a[0]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a[1]; + out[4] = a[4]; + out[5] = a[7]; + out[6] = a[2]; + out[7] = a[5]; + out[8] = a[8]; + } + + return out; +} +/** + * Inverts a mat3 + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the source matrix + * @returns {mat3} out + */ + +function invert(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2]; + var a10 = a[3], + a11 = a[4], + a12 = a[5]; + var a20 = a[6], + a21 = a[7], + a22 = a[8]; + var b01 = a22 * a11 - a12 * a21; + var b11 = -a22 * a10 + a12 * a20; + var b21 = a21 * a10 - a11 * a20; // Calculate the determinant + + var det = a00 * b01 + a01 * b11 + a02 * b21; + + if (!det) { + return null; + } + + det = 1.0 / det; + out[0] = b01 * det; + out[1] = (-a22 * a01 + a02 * a21) * det; + out[2] = (a12 * a01 - a02 * a11) * det; + out[3] = b11 * det; + out[4] = (a22 * a00 - a02 * a20) * det; + out[5] = (-a12 * a00 + a02 * a10) * det; + out[6] = b21 * det; + out[7] = (-a21 * a00 + a01 * a20) * det; + out[8] = (a11 * a00 - a01 * a10) * det; + return out; +} +/** + * Calculates the adjugate of a mat3 + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the source matrix + * @returns {mat3} out + */ + +function adjoint(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2]; + var a10 = a[3], + a11 = a[4], + a12 = a[5]; + var a20 = a[6], + a21 = a[7], + a22 = a[8]; + out[0] = a11 * a22 - a12 * a21; + out[1] = a02 * a21 - a01 * a22; + out[2] = a01 * a12 - a02 * a11; + out[3] = a12 * a20 - a10 * a22; + out[4] = a00 * a22 - a02 * a20; + out[5] = a02 * a10 - a00 * a12; + out[6] = a10 * a21 - a11 * a20; + out[7] = a01 * a20 - a00 * a21; + out[8] = a00 * a11 - a01 * a10; + return out; +} +/** + * Calculates the determinant of a mat3 + * + * @param {ReadonlyMat3} a the source matrix + * @returns {Number} determinant of a + */ + +function determinant(a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2]; + var a10 = a[3], + a11 = a[4], + a12 = a[5]; + var a20 = a[6], + a21 = a[7], + a22 = a[8]; + return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); +} +/** + * Multiplies two mat3's + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the first operand + * @param {ReadonlyMat3} b the second operand + * @returns {mat3} out + */ + +function multiply(out, a, b) { + var a00 = a[0], + a01 = a[1], + a02 = a[2]; + var a10 = a[3], + a11 = a[4], + a12 = a[5]; + var a20 = a[6], + a21 = a[7], + a22 = a[8]; + var b00 = b[0], + b01 = b[1], + b02 = b[2]; + var b10 = b[3], + b11 = b[4], + b12 = b[5]; + var b20 = b[6], + b21 = b[7], + b22 = b[8]; + out[0] = b00 * a00 + b01 * a10 + b02 * a20; + out[1] = b00 * a01 + b01 * a11 + b02 * a21; + out[2] = b00 * a02 + b01 * a12 + b02 * a22; + out[3] = b10 * a00 + b11 * a10 + b12 * a20; + out[4] = b10 * a01 + b11 * a11 + b12 * a21; + out[5] = b10 * a02 + b11 * a12 + b12 * a22; + out[6] = b20 * a00 + b21 * a10 + b22 * a20; + out[7] = b20 * a01 + b21 * a11 + b22 * a21; + out[8] = b20 * a02 + b21 * a12 + b22 * a22; + return out; +} +/** + * Translate a mat3 by the given vector + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the matrix to translate + * @param {ReadonlyVec2} v vector to translate by + * @returns {mat3} out + */ + +function translate(out, a, v) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a10 = a[3], + a11 = a[4], + a12 = a[5], + a20 = a[6], + a21 = a[7], + a22 = a[8], + x = v[0], + y = v[1]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a10; + out[4] = a11; + out[5] = a12; + out[6] = x * a00 + y * a10 + a20; + out[7] = x * a01 + y * a11 + a21; + out[8] = x * a02 + y * a12 + a22; + return out; +} +/** + * Rotates a mat3 by the given angle + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat3} out + */ + +function rotate(out, a, rad) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a10 = a[3], + a11 = a[4], + a12 = a[5], + a20 = a[6], + a21 = a[7], + a22 = a[8], + s = Math.sin(rad), + c = Math.cos(rad); + out[0] = c * a00 + s * a10; + out[1] = c * a01 + s * a11; + out[2] = c * a02 + s * a12; + out[3] = c * a10 - s * a00; + out[4] = c * a11 - s * a01; + out[5] = c * a12 - s * a02; + out[6] = a20; + out[7] = a21; + out[8] = a22; + return out; +} +/** + * Scales the mat3 by the dimensions in the given vec2 + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the matrix to rotate + * @param {ReadonlyVec2} v the vec2 to scale the matrix by + * @returns {mat3} out + **/ + +function scale(out, a, v) { + var x = v[0], + y = v[1]; + out[0] = x * a[0]; + out[1] = x * a[1]; + out[2] = x * a[2]; + out[3] = y * a[3]; + out[4] = y * a[4]; + out[5] = y * a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; +} +/** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyVec2} v Translation vector + * @returns {mat3} out + */ + +function fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = v[0]; + out[7] = v[1]; + out[8] = 1; + return out; +} +/** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.rotate(dest, dest, rad); + * + * @param {mat3} out mat3 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat3} out + */ + +function fromRotation(out, rad) { + var s = Math.sin(rad), + c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = -s; + out[4] = c; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; +} +/** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyVec2} v Scaling vector + * @returns {mat3} out + */ + +function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = v[1]; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; +} +/** + * Copies the values from a mat2d into a mat3 + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat2d} a the matrix to copy + * @returns {mat3} out + **/ + +function fromMat2d(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = 0; + out[3] = a[2]; + out[4] = a[3]; + out[5] = 0; + out[6] = a[4]; + out[7] = a[5]; + out[8] = 1; + return out; +} +/** + * Calculates a 3x3 matrix from the given quaternion + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyQuat} q Quaternion to create matrix from + * + * @returns {mat3} out + */ + +function fromQuat(out, q) { + var x = q[0], + y = q[1], + z = q[2], + w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var yx = y * x2; + var yy = y * y2; + var zx = z * x2; + var zy = z * y2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + out[0] = 1 - yy - zz; + out[3] = yx - wz; + out[6] = zx + wy; + out[1] = yx + wz; + out[4] = 1 - xx - zz; + out[7] = zy - wx; + out[2] = zx - wy; + out[5] = zy + wx; + out[8] = 1 - xx - yy; + return out; +} +/** + * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from + * + * @returns {mat3} out + */ + +function normalFromMat4(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; // Calculate the determinant + + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) { + return null; + } + + det = 1.0 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + return out; +} +/** + * Generates a 2D projection matrix with the given bounds + * + * @param {mat3} out mat3 frustum matrix will be written into + * @param {number} width Width of your gl context + * @param {number} height Height of gl context + * @returns {mat3} out + */ + +function projection(out, width, height) { + out[0] = 2 / width; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = -2 / height; + out[5] = 0; + out[6] = -1; + out[7] = 1; + out[8] = 1; + return out; +} +/** + * Returns a string representation of a mat3 + * + * @param {ReadonlyMat3} a matrix to represent as a string + * @returns {String} string representation of the matrix + */ + +function str(a) { + return "mat3(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ")"; +} +/** + * Returns Frobenius norm of a mat3 + * + * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of + * @returns {Number} Frobenius norm + */ + +function frob(a) { + return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]); +} +/** + * Adds two mat3's + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the first operand + * @param {ReadonlyMat3} b the second operand + * @returns {mat3} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + return out; +} +/** + * Subtracts matrix b from matrix a + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the first operand + * @param {ReadonlyMat3} b the second operand + * @returns {mat3} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + return out; +} +/** + * Multiply each element of the matrix by a scalar. + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the matrix to scale + * @param {Number} b amount to scale the matrix's elements by + * @returns {mat3} out + */ + +function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + return out; +} +/** + * Adds two mat3's after multiplying each element of the second operand by a scalar value. + * + * @param {mat3} out the receiving vector + * @param {ReadonlyMat3} a the first operand + * @param {ReadonlyMat3} b the second operand + * @param {Number} scale the amount to scale b's elements by before adding + * @returns {mat3} out + */ + +function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + return out; +} +/** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyMat3} a The first matrix. + * @param {ReadonlyMat3} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8]; +} +/** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {ReadonlyMat3} a The first matrix. + * @param {ReadonlyMat3} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5], + a6 = a[6], + a7 = a[7], + a8 = a[8]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3], + b4 = b[4], + b5 = b[5], + b6 = b[6], + b7 = b[7], + b8 = b[8]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)); +} +/** + * Alias for {@link mat3.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link mat3.subtract} + * @function + */ + +var sub = subtract; + +/***/ }), +/* 12 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "transpose": () => (/* binding */ transpose), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "adjoint": () => (/* binding */ adjoint), +/* harmony export */ "determinant": () => (/* binding */ determinant), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "translate": () => (/* binding */ translate), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "rotate": () => (/* binding */ rotate), +/* harmony export */ "rotateX": () => (/* binding */ rotateX), +/* harmony export */ "rotateY": () => (/* binding */ rotateY), +/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), +/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), +/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), +/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), +/* harmony export */ "fromXRotation": () => (/* binding */ fromXRotation), +/* harmony export */ "fromYRotation": () => (/* binding */ fromYRotation), +/* harmony export */ "fromZRotation": () => (/* binding */ fromZRotation), +/* harmony export */ "fromRotationTranslation": () => (/* binding */ fromRotationTranslation), +/* harmony export */ "fromQuat2": () => (/* binding */ fromQuat2), +/* harmony export */ "getTranslation": () => (/* binding */ getTranslation), +/* harmony export */ "getScaling": () => (/* binding */ getScaling), +/* harmony export */ "getRotation": () => (/* binding */ getRotation), +/* harmony export */ "fromRotationTranslationScale": () => (/* binding */ fromRotationTranslationScale), +/* harmony export */ "fromRotationTranslationScaleOrigin": () => (/* binding */ fromRotationTranslationScaleOrigin), +/* harmony export */ "fromQuat": () => (/* binding */ fromQuat), +/* harmony export */ "frustum": () => (/* binding */ frustum), +/* harmony export */ "perspective": () => (/* binding */ perspective), +/* harmony export */ "perspectiveFromFieldOfView": () => (/* binding */ perspectiveFromFieldOfView), +/* harmony export */ "ortho": () => (/* binding */ ortho), +/* harmony export */ "lookAt": () => (/* binding */ lookAt), +/* harmony export */ "targetTo": () => (/* binding */ targetTo), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "frob": () => (/* binding */ frob), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), +/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "sub": () => (/* binding */ sub) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); + +/** + * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied. + * @module mat4 + */ + +/** + * Creates a new identity mat4 + * + * @returns {mat4} a new 4x4 matrix + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + } + + out[0] = 1; + out[5] = 1; + out[10] = 1; + out[15] = 1; + return out; +} +/** + * Creates a new mat4 initialized with values from an existing matrix + * + * @param {ReadonlyMat4} a matrix to clone + * @returns {mat4} a new 4x4 matrix + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; +} +/** + * Copy the values from one mat4 to another + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the source matrix + * @returns {mat4} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; +} +/** + * Create a new mat4 with the given values + * + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m02 Component in column 0, row 2 position (index 2) + * @param {Number} m03 Component in column 0, row 3 position (index 3) + * @param {Number} m10 Component in column 1, row 0 position (index 4) + * @param {Number} m11 Component in column 1, row 1 position (index 5) + * @param {Number} m12 Component in column 1, row 2 position (index 6) + * @param {Number} m13 Component in column 1, row 3 position (index 7) + * @param {Number} m20 Component in column 2, row 0 position (index 8) + * @param {Number} m21 Component in column 2, row 1 position (index 9) + * @param {Number} m22 Component in column 2, row 2 position (index 10) + * @param {Number} m23 Component in column 2, row 3 position (index 11) + * @param {Number} m30 Component in column 3, row 0 position (index 12) + * @param {Number} m31 Component in column 3, row 1 position (index 13) + * @param {Number} m32 Component in column 3, row 2 position (index 14) + * @param {Number} m33 Component in column 3, row 3 position (index 15) + * @returns {mat4} A new mat4 + */ + +function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m03; + out[4] = m10; + out[5] = m11; + out[6] = m12; + out[7] = m13; + out[8] = m20; + out[9] = m21; + out[10] = m22; + out[11] = m23; + out[12] = m30; + out[13] = m31; + out[14] = m32; + out[15] = m33; + return out; +} +/** + * Set the components of a mat4 to the given values + * + * @param {mat4} out the receiving matrix + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m02 Component in column 0, row 2 position (index 2) + * @param {Number} m03 Component in column 0, row 3 position (index 3) + * @param {Number} m10 Component in column 1, row 0 position (index 4) + * @param {Number} m11 Component in column 1, row 1 position (index 5) + * @param {Number} m12 Component in column 1, row 2 position (index 6) + * @param {Number} m13 Component in column 1, row 3 position (index 7) + * @param {Number} m20 Component in column 2, row 0 position (index 8) + * @param {Number} m21 Component in column 2, row 1 position (index 9) + * @param {Number} m22 Component in column 2, row 2 position (index 10) + * @param {Number} m23 Component in column 2, row 3 position (index 11) + * @param {Number} m30 Component in column 3, row 0 position (index 12) + * @param {Number} m31 Component in column 3, row 1 position (index 13) + * @param {Number} m32 Component in column 3, row 2 position (index 14) + * @param {Number} m33 Component in column 3, row 3 position (index 15) + * @returns {mat4} out + */ + +function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m03; + out[4] = m10; + out[5] = m11; + out[6] = m12; + out[7] = m13; + out[8] = m20; + out[9] = m21; + out[10] = m22; + out[11] = m23; + out[12] = m30; + out[13] = m31; + out[14] = m32; + out[15] = m33; + return out; +} +/** + * Set a mat4 to the identity matrix + * + * @param {mat4} out the receiving matrix + * @returns {mat4} out + */ + +function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Transpose the values of a mat4 + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the source matrix + * @returns {mat4} out + */ + +function transpose(out, a) { + // If we are transposing ourselves we can skip a few steps but have to cache some values + if (out === a) { + var a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a12 = a[6], + a13 = a[7]; + var a23 = a[11]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a01; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a02; + out[9] = a12; + out[11] = a[14]; + out[12] = a03; + out[13] = a13; + out[14] = a23; + } else { + out[0] = a[0]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a[1]; + out[5] = a[5]; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a[2]; + out[9] = a[6]; + out[10] = a[10]; + out[11] = a[14]; + out[12] = a[3]; + out[13] = a[7]; + out[14] = a[11]; + out[15] = a[15]; + } + + return out; +} +/** + * Inverts a mat4 + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the source matrix + * @returns {mat4} out + */ + +function invert(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; // Calculate the determinant + + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) { + return null; + } + + det = 1.0 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + return out; +} +/** + * Calculates the adjugate of a mat4 + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the source matrix + * @returns {mat4} out + */ + +function adjoint(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22); + out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); + out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12); + out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); + out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); + out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22); + out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); + out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12); + out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21); + out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); + out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11); + out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); + out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); + out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21); + out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); + out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11); + return out; +} +/** + * Calculates the determinant of a mat4 + * + * @param {ReadonlyMat4} a the source matrix + * @returns {Number} determinant of a + */ + +function determinant(a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; // Calculate the determinant + + return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; +} +/** + * Multiplies two mat4s + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the first operand + * @param {ReadonlyMat4} b the second operand + * @returns {mat4} out + */ + +function multiply(out, a, b) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; // Cache only the current line of the second matrix + + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + return out; +} +/** + * Translate a mat4 by the given vector + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to translate + * @param {ReadonlyVec3} v vector to translate by + * @returns {mat4} out + */ + +function translate(out, a, v) { + var x = v[0], + y = v[1], + z = v[2]; + var a00, a01, a02, a03; + var a10, a11, a12, a13; + var a20, a21, a22, a23; + + if (a === out) { + out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + } else { + a00 = a[0]; + a01 = a[1]; + a02 = a[2]; + a03 = a[3]; + a10 = a[4]; + a11 = a[5]; + a12 = a[6]; + a13 = a[7]; + a20 = a[8]; + a21 = a[9]; + a22 = a[10]; + a23 = a[11]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a03; + out[4] = a10; + out[5] = a11; + out[6] = a12; + out[7] = a13; + out[8] = a20; + out[9] = a21; + out[10] = a22; + out[11] = a23; + out[12] = a00 * x + a10 * y + a20 * z + a[12]; + out[13] = a01 * x + a11 * y + a21 * z + a[13]; + out[14] = a02 * x + a12 * y + a22 * z + a[14]; + out[15] = a03 * x + a13 * y + a23 * z + a[15]; + } + + return out; +} +/** + * Scales the mat4 by the dimensions in the given vec3 not using vectorization + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to scale + * @param {ReadonlyVec3} v the vec3 to scale the matrix by + * @returns {mat4} out + **/ + +function scale(out, a, v) { + var x = v[0], + y = v[1], + z = v[2]; + out[0] = a[0] * x; + out[1] = a[1] * x; + out[2] = a[2] * x; + out[3] = a[3] * x; + out[4] = a[4] * y; + out[5] = a[5] * y; + out[6] = a[6] * y; + out[7] = a[7] * y; + out[8] = a[8] * z; + out[9] = a[9] * z; + out[10] = a[10] * z; + out[11] = a[11] * z; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; +} +/** + * Rotates a mat4 by the given angle around the given axis + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @param {ReadonlyVec3} axis the axis to rotate around + * @returns {mat4} out + */ + +function rotate(out, a, rad, axis) { + var x = axis[0], + y = axis[1], + z = axis[2]; + var len = Math.hypot(x, y, z); + var s, c, t; + var a00, a01, a02, a03; + var a10, a11, a12, a13; + var a20, a21, a22, a23; + var b00, b01, b02; + var b10, b11, b12; + var b20, b21, b22; + + if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + return null; + } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + s = Math.sin(rad); + c = Math.cos(rad); + t = 1 - c; + a00 = a[0]; + a01 = a[1]; + a02 = a[2]; + a03 = a[3]; + a10 = a[4]; + a11 = a[5]; + a12 = a[6]; + a13 = a[7]; + a20 = a[8]; + a21 = a[9]; + a22 = a[10]; + a23 = a[11]; // Construct the elements of the rotation matrix + + b00 = x * x * t + c; + b01 = y * x * t + z * s; + b02 = z * x * t - y * s; + b10 = x * y * t - z * s; + b11 = y * y * t + c; + b12 = z * y * t + x * s; + b20 = x * z * t + y * s; + b21 = y * z * t - x * s; + b22 = z * z * t + c; // Perform rotation-specific matrix multiplication + + out[0] = a00 * b00 + a10 * b01 + a20 * b02; + out[1] = a01 * b00 + a11 * b01 + a21 * b02; + out[2] = a02 * b00 + a12 * b01 + a22 * b02; + out[3] = a03 * b00 + a13 * b01 + a23 * b02; + out[4] = a00 * b10 + a10 * b11 + a20 * b12; + out[5] = a01 * b10 + a11 * b11 + a21 * b12; + out[6] = a02 * b10 + a12 * b11 + a22 * b12; + out[7] = a03 * b10 + a13 * b11 + a23 * b12; + out[8] = a00 * b20 + a10 * b21 + a20 * b22; + out[9] = a01 * b20 + a11 * b21 + a21 * b22; + out[10] = a02 * b20 + a12 * b21 + a22 * b22; + out[11] = a03 * b20 + a13 * b21 + a23 * b22; + + if (a !== out) { + // If the source and destination differ, copy the unchanged last row + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + + return out; +} +/** + * Rotates a matrix by the given angle around the X axis + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function rotateX(out, a, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + if (a !== out) { + // If the source and destination differ, copy the unchanged rows + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } // Perform axis-specific matrix multiplication + + + out[4] = a10 * c + a20 * s; + out[5] = a11 * c + a21 * s; + out[6] = a12 * c + a22 * s; + out[7] = a13 * c + a23 * s; + out[8] = a20 * c - a10 * s; + out[9] = a21 * c - a11 * s; + out[10] = a22 * c - a12 * s; + out[11] = a23 * c - a13 * s; + return out; +} +/** + * Rotates a matrix by the given angle around the Y axis + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function rotateY(out, a, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + if (a !== out) { + // If the source and destination differ, copy the unchanged rows + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } // Perform axis-specific matrix multiplication + + + out[0] = a00 * c - a20 * s; + out[1] = a01 * c - a21 * s; + out[2] = a02 * c - a22 * s; + out[3] = a03 * c - a23 * s; + out[8] = a00 * s + a20 * c; + out[9] = a01 * s + a21 * c; + out[10] = a02 * s + a22 * c; + out[11] = a03 * s + a23 * c; + return out; +} +/** + * Rotates a matrix by the given angle around the Z axis + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function rotateZ(out, a, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + if (a !== out) { + // If the source and destination differ, copy the unchanged last row + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } // Perform axis-specific matrix multiplication + + + out[0] = a00 * c + a10 * s; + out[1] = a01 * c + a11 * s; + out[2] = a02 * c + a12 * s; + out[3] = a03 * c + a13 * s; + out[4] = a10 * c - a00 * s; + out[5] = a11 * c - a01 * s; + out[6] = a12 * c - a02 * s; + out[7] = a13 * c - a03 * s; + return out; +} +/** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * + * @param {mat4} out mat4 receiving operation result + * @param {ReadonlyVec3} v Translation vector + * @returns {mat4} out + */ + +function fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; +} +/** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * + * @param {mat4} out mat4 receiving operation result + * @param {ReadonlyVec3} v Scaling vector + * @returns {mat4} out + */ + +function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = v[1]; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = v[2]; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Creates a matrix from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @param {ReadonlyVec3} axis the axis to rotate around + * @returns {mat4} out + */ + +function fromRotation(out, rad, axis) { + var x = axis[0], + y = axis[1], + z = axis[2]; + var len = Math.hypot(x, y, z); + var s, c, t; + + if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + return null; + } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + s = Math.sin(rad); + c = Math.cos(rad); + t = 1 - c; // Perform rotation-specific matrix multiplication + + out[0] = x * x * t + c; + out[1] = y * x * t + z * s; + out[2] = z * x * t - y * s; + out[3] = 0; + out[4] = x * y * t - z * s; + out[5] = y * y * t + c; + out[6] = z * y * t + x * s; + out[7] = 0; + out[8] = x * z * t + y * s; + out[9] = y * z * t - x * s; + out[10] = z * z * t + c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function fromXRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); // Perform axis-specific matrix multiplication + + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = c; + out[6] = s; + out[7] = 0; + out[8] = 0; + out[9] = -s; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function fromYRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); // Perform axis-specific matrix multiplication + + out[0] = c; + out[1] = 0; + out[2] = -s; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = s; + out[9] = 0; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function fromZRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); // Perform axis-specific matrix multiplication + + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = 0; + out[4] = -s; + out[5] = c; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Creates a matrix from a quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * + * @param {mat4} out mat4 receiving operation result + * @param {quat4} q Rotation quaternion + * @param {ReadonlyVec3} v Translation vector + * @returns {mat4} out + */ + +function fromRotationTranslation(out, q, v) { + // Quaternion math + var x = q[0], + y = q[1], + z = q[2], + w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; +} +/** + * Creates a new mat4 from a dual quat. + * + * @param {mat4} out Matrix + * @param {ReadonlyQuat2} a Dual Quaternion + * @returns {mat4} mat4 receiving operation result + */ + +function fromQuat2(out, a) { + var translation = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + var bx = -a[0], + by = -a[1], + bz = -a[2], + bw = a[3], + ax = a[4], + ay = a[5], + az = a[6], + aw = a[7]; + var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense + + if (magnitude > 0) { + translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude; + translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude; + translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude; + } else { + translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + } + + fromRotationTranslation(out, a, translation); + return out; +} +/** + * Returns the translation vector component of a transformation + * matrix. If a matrix is built with fromRotationTranslation, + * the returned vector will be the same as the translation vector + * originally supplied. + * @param {vec3} out Vector to receive translation component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + +function getTranslation(out, mat) { + out[0] = mat[12]; + out[1] = mat[13]; + out[2] = mat[14]; + return out; +} +/** + * Returns the scaling factor component of a transformation + * matrix. If a matrix is built with fromRotationTranslationScale + * with a normalized Quaternion paramter, the returned vector will be + * the same as the scaling vector + * originally supplied. + * @param {vec3} out Vector to receive scaling factor component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + +function getScaling(out, mat) { + var m11 = mat[0]; + var m12 = mat[1]; + var m13 = mat[2]; + var m21 = mat[4]; + var m22 = mat[5]; + var m23 = mat[6]; + var m31 = mat[8]; + var m32 = mat[9]; + var m33 = mat[10]; + out[0] = Math.hypot(m11, m12, m13); + out[1] = Math.hypot(m21, m22, m23); + out[2] = Math.hypot(m31, m32, m33); + return out; +} +/** + * Returns a quaternion representing the rotational component + * of a transformation matrix. If a matrix is built with + * fromRotationTranslation, the returned quaternion will be the + * same as the quaternion originally supplied. + * @param {quat} out Quaternion to receive the rotation component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {quat} out + */ + +function getRotation(out, mat) { + var scaling = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + getScaling(scaling, mat); + var is1 = 1 / scaling[0]; + var is2 = 1 / scaling[1]; + var is3 = 1 / scaling[2]; + var sm11 = mat[0] * is1; + var sm12 = mat[1] * is2; + var sm13 = mat[2] * is3; + var sm21 = mat[4] * is1; + var sm22 = mat[5] * is2; + var sm23 = mat[6] * is3; + var sm31 = mat[8] * is1; + var sm32 = mat[9] * is2; + var sm33 = mat[10] * is3; + var trace = sm11 + sm22 + sm33; + var S = 0; + + if (trace > 0) { + S = Math.sqrt(trace + 1.0) * 2; + out[3] = 0.25 * S; + out[0] = (sm23 - sm32) / S; + out[1] = (sm31 - sm13) / S; + out[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2; + out[3] = (sm23 - sm32) / S; + out[0] = 0.25 * S; + out[1] = (sm12 + sm21) / S; + out[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2; + out[3] = (sm31 - sm13) / S; + out[0] = (sm12 + sm21) / S; + out[1] = 0.25 * S; + out[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2; + out[3] = (sm12 - sm21) / S; + out[0] = (sm31 + sm13) / S; + out[1] = (sm23 + sm32) / S; + out[2] = 0.25 * S; + } + + return out; +} +/** + * Creates a matrix from a quaternion rotation, vector translation and vector scale + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * + * @param {mat4} out mat4 receiving operation result + * @param {quat4} q Rotation quaternion + * @param {ReadonlyVec3} v Translation vector + * @param {ReadonlyVec3} s Scaling vector + * @returns {mat4} out + */ + +function fromRotationTranslationScale(out, q, v, s) { + // Quaternion math + var x = q[0], + y = q[1], + z = q[2], + w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + var sx = s[0]; + var sy = s[1]; + var sz = s[2]; + out[0] = (1 - (yy + zz)) * sx; + out[1] = (xy + wz) * sx; + out[2] = (xz - wy) * sx; + out[3] = 0; + out[4] = (xy - wz) * sy; + out[5] = (1 - (xx + zz)) * sy; + out[6] = (yz + wx) * sy; + out[7] = 0; + out[8] = (xz + wy) * sz; + out[9] = (yz - wx) * sz; + out[10] = (1 - (xx + yy)) * sz; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; +} +/** + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * + * @param {mat4} out mat4 receiving operation result + * @param {quat4} q Rotation quaternion + * @param {ReadonlyVec3} v Translation vector + * @param {ReadonlyVec3} s Scaling vector + * @param {ReadonlyVec3} o The origin vector around which to scale and rotate + * @returns {mat4} out + */ + +function fromRotationTranslationScaleOrigin(out, q, v, s, o) { + // Quaternion math + var x = q[0], + y = q[1], + z = q[2], + w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + var sx = s[0]; + var sy = s[1]; + var sz = s[2]; + var ox = o[0]; + var oy = o[1]; + var oz = o[2]; + var out0 = (1 - (yy + zz)) * sx; + var out1 = (xy + wz) * sx; + var out2 = (xz - wy) * sx; + var out4 = (xy - wz) * sy; + var out5 = (1 - (xx + zz)) * sy; + var out6 = (yz + wx) * sy; + var out8 = (xz + wy) * sz; + var out9 = (yz - wx) * sz; + var out10 = (1 - (xx + yy)) * sz; + out[0] = out0; + out[1] = out1; + out[2] = out2; + out[3] = 0; + out[4] = out4; + out[5] = out5; + out[6] = out6; + out[7] = 0; + out[8] = out8; + out[9] = out9; + out[10] = out10; + out[11] = 0; + out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz); + out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz); + out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz); + out[15] = 1; + return out; +} +/** + * Calculates a 4x4 matrix from the given quaternion + * + * @param {mat4} out mat4 receiving operation result + * @param {ReadonlyQuat} q Quaternion to create matrix from + * + * @returns {mat4} out + */ + +function fromQuat(out, q) { + var x = q[0], + y = q[1], + z = q[2], + w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var yx = y * x2; + var yy = y * y2; + var zx = z * x2; + var zy = z * y2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + out[0] = 1 - yy - zz; + out[1] = yx + wz; + out[2] = zx - wy; + out[3] = 0; + out[4] = yx - wz; + out[5] = 1 - xx - zz; + out[6] = zy + wx; + out[7] = 0; + out[8] = zx + wy; + out[9] = zy - wx; + out[10] = 1 - xx - yy; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Generates a frustum matrix with the given bounds + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {Number} left Left bound of the frustum + * @param {Number} right Right bound of the frustum + * @param {Number} bottom Bottom bound of the frustum + * @param {Number} top Top bound of the frustum + * @param {Number} near Near bound of the frustum + * @param {Number} far Far bound of the frustum + * @returns {mat4} out + */ + +function frustum(out, left, right, bottom, top, near, far) { + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + var nf = 1 / (near - far); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[10] = (far + near) * nf; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[14] = far * near * 2 * nf; + out[15] = 0; + return out; +} +/** + * Generates a perspective projection matrix with the given bounds. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {number} fovy Vertical field of view in radians + * @param {number} aspect Aspect ratio. typically viewport width/height + * @param {number} near Near bound of the frustum + * @param {number} far Far bound of the frustum, can be null or Infinity + * @returns {mat4} out + */ + +function perspective(out, fovy, aspect, near, far) { + var f = 1.0 / Math.tan(fovy / 2), + nf; + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + + if (far != null && far !== Infinity) { + nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + + return out; +} +/** + * Generates a perspective projection matrix with the given field of view. + * This is primarily useful for generating projection matrices to be used + * with the still experiemental WebVR API. + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param {number} near Near bound of the frustum + * @param {number} far Far bound of the frustum + * @returns {mat4} out + */ + +function perspectiveFromFieldOfView(out, fov, near, far) { + var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0); + var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0); + var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0); + var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0); + var xScale = 2.0 / (leftTan + rightTan); + var yScale = 2.0 / (upTan + downTan); + out[0] = xScale; + out[1] = 0.0; + out[2] = 0.0; + out[3] = 0.0; + out[4] = 0.0; + out[5] = yScale; + out[6] = 0.0; + out[7] = 0.0; + out[8] = -((leftTan - rightTan) * xScale * 0.5); + out[9] = (upTan - downTan) * yScale * 0.5; + out[10] = far / (near - far); + out[11] = -1.0; + out[12] = 0.0; + out[13] = 0.0; + out[14] = far * near / (near - far); + out[15] = 0.0; + return out; +} +/** + * Generates a orthogonal projection matrix with the given bounds + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {number} left Left bound of the frustum + * @param {number} right Right bound of the frustum + * @param {number} bottom Bottom bound of the frustum + * @param {number} top Top bound of the frustum + * @param {number} near Near bound of the frustum + * @param {number} far Far bound of the frustum + * @returns {mat4} out + */ + +function ortho(out, left, right, bottom, top, near, far) { + var lr = 1 / (left - right); + var bt = 1 / (bottom - top); + var nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 2 * nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = (far + near) * nf; + out[15] = 1; + return out; +} +/** + * Generates a look-at matrix with the given eye position, focal point, and up axis. + * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {ReadonlyVec3} eye Position of the viewer + * @param {ReadonlyVec3} center Point the viewer is looking at + * @param {ReadonlyVec3} up vec3 pointing up + * @returns {mat4} out + */ + +function lookAt(out, eye, center, up) { + var x0, x1, x2, y0, y1, y2, z0, z1, z2, len; + var eyex = eye[0]; + var eyey = eye[1]; + var eyez = eye[2]; + var upx = up[0]; + var upy = up[1]; + var upz = up[2]; + var centerx = center[0]; + var centery = center[1]; + var centerz = center[2]; + + if (Math.abs(eyex - centerx) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON && Math.abs(eyey - centery) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON && Math.abs(eyez - centerz) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + return identity(out); + } + + z0 = eyex - centerx; + z1 = eyey - centery; + z2 = eyez - centerz; + len = 1 / Math.hypot(z0, z1, z2); + z0 *= len; + z1 *= len; + z2 *= len; + x0 = upy * z2 - upz * z1; + x1 = upz * z0 - upx * z2; + x2 = upx * z1 - upy * z0; + len = Math.hypot(x0, x1, x2); + + if (!len) { + x0 = 0; + x1 = 0; + x2 = 0; + } else { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + + y0 = z1 * x2 - z2 * x1; + y1 = z2 * x0 - z0 * x2; + y2 = z0 * x1 - z1 * x0; + len = Math.hypot(y0, y1, y2); + + if (!len) { + y0 = 0; + y1 = 0; + y2 = 0; + } else { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + + out[0] = x0; + out[1] = y0; + out[2] = z0; + out[3] = 0; + out[4] = x1; + out[5] = y1; + out[6] = z1; + out[7] = 0; + out[8] = x2; + out[9] = y2; + out[10] = z2; + out[11] = 0; + out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); + out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); + out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); + out[15] = 1; + return out; +} +/** + * Generates a matrix that makes something look at something else. + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {ReadonlyVec3} eye Position of the viewer + * @param {ReadonlyVec3} center Point the viewer is looking at + * @param {ReadonlyVec3} up vec3 pointing up + * @returns {mat4} out + */ + +function targetTo(out, eye, target, up) { + var eyex = eye[0], + eyey = eye[1], + eyez = eye[2], + upx = up[0], + upy = up[1], + upz = up[2]; + var z0 = eyex - target[0], + z1 = eyey - target[1], + z2 = eyez - target[2]; + var len = z0 * z0 + z1 * z1 + z2 * z2; + + if (len > 0) { + len = 1 / Math.sqrt(len); + z0 *= len; + z1 *= len; + z2 *= len; + } + + var x0 = upy * z2 - upz * z1, + x1 = upz * z0 - upx * z2, + x2 = upx * z1 - upy * z0; + len = x0 * x0 + x1 * x1 + x2 * x2; + + if (len > 0) { + len = 1 / Math.sqrt(len); + x0 *= len; + x1 *= len; + x2 *= len; + } + + out[0] = x0; + out[1] = x1; + out[2] = x2; + out[3] = 0; + out[4] = z1 * x2 - z2 * x1; + out[5] = z2 * x0 - z0 * x2; + out[6] = z0 * x1 - z1 * x0; + out[7] = 0; + out[8] = z0; + out[9] = z1; + out[10] = z2; + out[11] = 0; + out[12] = eyex; + out[13] = eyey; + out[14] = eyez; + out[15] = 1; + return out; +} +/** + * Returns a string representation of a mat4 + * + * @param {ReadonlyMat4} a matrix to represent as a string + * @returns {String} string representation of the matrix + */ + +function str(a) { + return "mat4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ", " + a[9] + ", " + a[10] + ", " + a[11] + ", " + a[12] + ", " + a[13] + ", " + a[14] + ", " + a[15] + ")"; +} +/** + * Returns Frobenius norm of a mat4 + * + * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of + * @returns {Number} Frobenius norm + */ + +function frob(a) { + return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); +} +/** + * Adds two mat4's + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the first operand + * @param {ReadonlyMat4} b the second operand + * @returns {mat4} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + out[9] = a[9] + b[9]; + out[10] = a[10] + b[10]; + out[11] = a[11] + b[11]; + out[12] = a[12] + b[12]; + out[13] = a[13] + b[13]; + out[14] = a[14] + b[14]; + out[15] = a[15] + b[15]; + return out; +} +/** + * Subtracts matrix b from matrix a + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the first operand + * @param {ReadonlyMat4} b the second operand + * @returns {mat4} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + out[9] = a[9] - b[9]; + out[10] = a[10] - b[10]; + out[11] = a[11] - b[11]; + out[12] = a[12] - b[12]; + out[13] = a[13] - b[13]; + out[14] = a[14] - b[14]; + out[15] = a[15] - b[15]; + return out; +} +/** + * Multiply each element of the matrix by a scalar. + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to scale + * @param {Number} b amount to scale the matrix's elements by + * @returns {mat4} out + */ + +function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + out[9] = a[9] * b; + out[10] = a[10] * b; + out[11] = a[11] * b; + out[12] = a[12] * b; + out[13] = a[13] * b; + out[14] = a[14] * b; + out[15] = a[15] * b; + return out; +} +/** + * Adds two mat4's after multiplying each element of the second operand by a scalar value. + * + * @param {mat4} out the receiving vector + * @param {ReadonlyMat4} a the first operand + * @param {ReadonlyMat4} b the second operand + * @param {Number} scale the amount to scale b's elements by before adding + * @returns {mat4} out + */ + +function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + out[9] = a[9] + b[9] * scale; + out[10] = a[10] + b[10] * scale; + out[11] = a[11] + b[11] * scale; + out[12] = a[12] + b[12] * scale; + out[13] = a[13] + b[13] * scale; + out[14] = a[14] + b[14] * scale; + out[15] = a[15] + b[15] * scale; + return out; +} +/** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyMat4} a The first matrix. + * @param {ReadonlyMat4} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15]; +} +/** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {ReadonlyMat4} a The first matrix. + * @param {ReadonlyMat4} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var a4 = a[4], + a5 = a[5], + a6 = a[6], + a7 = a[7]; + var a8 = a[8], + a9 = a[9], + a10 = a[10], + a11 = a[11]; + var a12 = a[12], + a13 = a[13], + a14 = a[14], + a15 = a[15]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + var b4 = b[4], + b5 = b[5], + b6 = b[6], + b7 = b[7]; + var b8 = b[8], + b9 = b[9], + b10 = b[10], + b11 = b[11]; + var b12 = b[12], + b13 = b[13], + b14 = b[14], + b15 = b[15]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15)); +} +/** + * Alias for {@link mat4.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link mat4.subtract} + * @function + */ + +var sub = subtract; + +/***/ }), +/* 13 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "setAxisAngle": () => (/* binding */ setAxisAngle), +/* harmony export */ "getAxisAngle": () => (/* binding */ getAxisAngle), +/* harmony export */ "getAngle": () => (/* binding */ getAngle), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "rotateX": () => (/* binding */ rotateX), +/* harmony export */ "rotateY": () => (/* binding */ rotateY), +/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), +/* harmony export */ "calculateW": () => (/* binding */ calculateW), +/* harmony export */ "exp": () => (/* binding */ exp), +/* harmony export */ "ln": () => (/* binding */ ln), +/* harmony export */ "pow": () => (/* binding */ pow), +/* harmony export */ "slerp": () => (/* binding */ slerp), +/* harmony export */ "random": () => (/* binding */ random), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "conjugate": () => (/* binding */ conjugate), +/* harmony export */ "fromMat3": () => (/* binding */ fromMat3), +/* harmony export */ "fromEuler": () => (/* binding */ fromEuler), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "dot": () => (/* binding */ dot), +/* harmony export */ "lerp": () => (/* binding */ lerp), +/* harmony export */ "length": () => (/* binding */ length), +/* harmony export */ "len": () => (/* binding */ len), +/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), +/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), +/* harmony export */ "normalize": () => (/* binding */ normalize), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "rotationTo": () => (/* binding */ rotationTo), +/* harmony export */ "sqlerp": () => (/* binding */ sqlerp), +/* harmony export */ "setAxes": () => (/* binding */ setAxes) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); +/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11); +/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15); +/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14); + + + + +/** + * Quaternion + * @module quat + */ + +/** + * Creates a new identity quat + * + * @returns {quat} a new quaternion + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + } + + out[3] = 1; + return out; +} +/** + * Set a quat to the identity quaternion + * + * @param {quat} out the receiving quaternion + * @returns {quat} out + */ + +function identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; +} +/** + * Sets a quat from the given angle and rotation axis, + * then returns it. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyVec3} axis the axis around which to rotate + * @param {Number} rad the angle in radians + * @returns {quat} out + **/ + +function setAxisAngle(out, axis, rad) { + rad = rad * 0.5; + var s = Math.sin(rad); + out[0] = s * axis[0]; + out[1] = s * axis[1]; + out[2] = s * axis[2]; + out[3] = Math.cos(rad); + return out; +} +/** + * Gets the rotation axis and angle for a given + * quaternion. If a quaternion is created with + * setAxisAngle, this method will return the same + * values as providied in the original parameter list + * OR functionally equivalent values. + * Example: The quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @param {vec3} out_axis Vector receiving the axis of rotation + * @param {ReadonlyQuat} q Quaternion to be decomposed + * @return {Number} Angle, in radians, of the rotation + */ + +function getAxisAngle(out_axis, q) { + var rad = Math.acos(q[3]) * 2.0; + var s = Math.sin(rad / 2.0); + + if (s > _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + out_axis[0] = q[0] / s; + out_axis[1] = q[1] / s; + out_axis[2] = q[2] / s; + } else { + // If s is zero, return any axis (no rotation - axis does not matter) + out_axis[0] = 1; + out_axis[1] = 0; + out_axis[2] = 0; + } + + return rad; +} +/** + * Gets the angular distance between two unit quaternions + * + * @param {ReadonlyQuat} a Origin unit quaternion + * @param {ReadonlyQuat} b Destination unit quaternion + * @return {Number} Angle, in radians, between the two quaternions + */ + +function getAngle(a, b) { + var dotproduct = dot(a, b); + return Math.acos(2 * dotproduct * dotproduct - 1); +} +/** + * Multiplies two quat's + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @returns {quat} out + */ + +function multiply(out, a, b) { + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var bx = b[0], + by = b[1], + bz = b[2], + bw = b[3]; + out[0] = ax * bw + aw * bx + ay * bz - az * by; + out[1] = ay * bw + aw * by + az * bx - ax * bz; + out[2] = az * bw + aw * bz + ax * by - ay * bx; + out[3] = aw * bw - ax * bx - ay * by - az * bz; + return out; +} +/** + * Rotates a quaternion by the given angle about the X axis + * + * @param {quat} out quat receiving operation result + * @param {ReadonlyQuat} a quat to rotate + * @param {number} rad angle (in radians) to rotate + * @returns {quat} out + */ + +function rotateX(out, a, rad) { + rad *= 0.5; + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var bx = Math.sin(rad), + bw = Math.cos(rad); + out[0] = ax * bw + aw * bx; + out[1] = ay * bw + az * bx; + out[2] = az * bw - ay * bx; + out[3] = aw * bw - ax * bx; + return out; +} +/** + * Rotates a quaternion by the given angle about the Y axis + * + * @param {quat} out quat receiving operation result + * @param {ReadonlyQuat} a quat to rotate + * @param {number} rad angle (in radians) to rotate + * @returns {quat} out + */ + +function rotateY(out, a, rad) { + rad *= 0.5; + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var by = Math.sin(rad), + bw = Math.cos(rad); + out[0] = ax * bw - az * by; + out[1] = ay * bw + aw * by; + out[2] = az * bw + ax * by; + out[3] = aw * bw - ay * by; + return out; +} +/** + * Rotates a quaternion by the given angle about the Z axis + * + * @param {quat} out quat receiving operation result + * @param {ReadonlyQuat} a quat to rotate + * @param {number} rad angle (in radians) to rotate + * @returns {quat} out + */ + +function rotateZ(out, a, rad) { + rad *= 0.5; + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var bz = Math.sin(rad), + bw = Math.cos(rad); + out[0] = ax * bw + ay * bz; + out[1] = ay * bw - ax * bz; + out[2] = az * bw + aw * bz; + out[3] = aw * bw - az * bz; + return out; +} +/** + * Calculates the W component of a quat from the X, Y, and Z components. + * Assumes that quaternion is 1 unit in length. + * Any existing W component will be ignored. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate W component of + * @returns {quat} out + */ + +function calculateW(out, a) { + var x = a[0], + y = a[1], + z = a[2]; + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z)); + return out; +} +/** + * Calculate the exponential of a unit quaternion. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate the exponential of + * @returns {quat} out + */ + +function exp(out, a) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3]; + var r = Math.sqrt(x * x + y * y + z * z); + var et = Math.exp(w); + var s = r > 0 ? et * Math.sin(r) / r : 0; + out[0] = x * s; + out[1] = y * s; + out[2] = z * s; + out[3] = et * Math.cos(r); + return out; +} +/** + * Calculate the natural logarithm of a unit quaternion. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate the exponential of + * @returns {quat} out + */ + +function ln(out, a) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3]; + var r = Math.sqrt(x * x + y * y + z * z); + var t = r > 0 ? Math.atan2(r, w) / r : 0; + out[0] = x * t; + out[1] = y * t; + out[2] = z * t; + out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w); + return out; +} +/** + * Calculate the scalar power of a unit quaternion. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate the exponential of + * @param {Number} b amount to scale the quaternion by + * @returns {quat} out + */ + +function pow(out, a, b) { + ln(out, a); + scale(out, out, b); + exp(out, out); + return out; +} +/** + * Performs a spherical linear interpolation between two quat + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {quat} out + */ + +function slerp(out, a, b, t) { + // benchmarks: + // http://jsperf.com/quaternion-slerp-implementations + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var bx = b[0], + by = b[1], + bz = b[2], + bw = b[3]; + var omega, cosom, sinom, scale0, scale1; // calc cosine + + cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary) + + if (cosom < 0.0) { + cosom = -cosom; + bx = -bx; + by = -by; + bz = -bz; + bw = -bw; + } // calculate coefficients + + + if (1.0 - cosom > _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + // standard case (slerp) + omega = Math.acos(cosom); + sinom = Math.sin(omega); + scale0 = Math.sin((1.0 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } else { + // "from" and "to" quaternions are very close + // ... so we can do a linear interpolation + scale0 = 1.0 - t; + scale1 = t; + } // calculate final values + + + out[0] = scale0 * ax + scale1 * bx; + out[1] = scale0 * ay + scale1 * by; + out[2] = scale0 * az + scale1 * bz; + out[3] = scale0 * aw + scale1 * bw; + return out; +} +/** + * Generates a random unit quaternion + * + * @param {quat} out the receiving quaternion + * @returns {quat} out + */ + +function random(out) { + // Implementation of http://planning.cs.uiuc.edu/node198.html + // TODO: Calling random 3 times is probably not the fastest solution + var u1 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); + var u2 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); + var u3 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); + var sqrt1MinusU1 = Math.sqrt(1 - u1); + var sqrtU1 = Math.sqrt(u1); + out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2); + out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2); + out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3); + out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3); + return out; +} +/** + * Calculates the inverse of a quat + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate inverse of + * @returns {quat} out + */ + +function invert(out, a) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; + var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 + + out[0] = -a0 * invDot; + out[1] = -a1 * invDot; + out[2] = -a2 * invDot; + out[3] = a3 * invDot; + return out; +} +/** + * Calculates the conjugate of a quat + * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate conjugate of + * @returns {quat} out + */ + +function conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + return out; +} +/** + * Creates a quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant quaternion is not normalized, so you should be sure + * to renormalize the quaternion yourself where necessary. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyMat3} m rotation matrix + * @returns {quat} out + * @function + */ + +function fromMat3(out, m) { + // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes + // article "Quaternion Calculus and Fast Animation". + var fTrace = m[0] + m[4] + m[8]; + var fRoot; + + if (fTrace > 0.0) { + // |w| > 1/2, may as well choose w > 1/2 + fRoot = Math.sqrt(fTrace + 1.0); // 2w + + out[3] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; // 1/(4w) + + out[0] = (m[5] - m[7]) * fRoot; + out[1] = (m[6] - m[2]) * fRoot; + out[2] = (m[1] - m[3]) * fRoot; + } else { + // |w| <= 1/2 + var i = 0; + if (m[4] > m[0]) i = 1; + if (m[8] > m[i * 3 + i]) i = 2; + var j = (i + 1) % 3; + var k = (i + 2) % 3; + fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0); + out[i] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot; + out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; + out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; + } + + return out; +} +/** + * Creates a quaternion from the given euler angle x, y, z. + * + * @param {quat} out the receiving quaternion + * @param {x} Angle to rotate around X axis in degrees. + * @param {y} Angle to rotate around Y axis in degrees. + * @param {z} Angle to rotate around Z axis in degrees. + * @returns {quat} out + * @function + */ + +function fromEuler(out, x, y, z) { + var halfToRad = 0.5 * Math.PI / 180.0; + x *= halfToRad; + y *= halfToRad; + z *= halfToRad; + var sx = Math.sin(x); + var cx = Math.cos(x); + var sy = Math.sin(y); + var cy = Math.cos(y); + var sz = Math.sin(z); + var cz = Math.cos(z); + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + return out; +} +/** + * Returns a string representation of a quatenion + * + * @param {ReadonlyQuat} a vector to represent as a string + * @returns {String} string representation of the vector + */ + +function str(a) { + return "quat(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; +} +/** + * Creates a new quat initialized with values from an existing quaternion + * + * @param {ReadonlyQuat} a quaternion to clone + * @returns {quat} a new quaternion + * @function + */ + +var clone = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.clone; +/** + * Creates a new quat initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {quat} a new quaternion + * @function + */ + +var fromValues = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.fromValues; +/** + * Copy the values from one quat to another + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the source quaternion + * @returns {quat} out + * @function + */ + +var copy = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.copy; +/** + * Set the components of a quat to the given values + * + * @param {quat} out the receiving quaternion + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {quat} out + * @function + */ + +var set = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.set; +/** + * Adds two quat's + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @returns {quat} out + * @function + */ + +var add = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.add; +/** + * Alias for {@link quat.multiply} + * @function + */ + +var mul = multiply; +/** + * Scales a quat by a scalar number + * + * @param {quat} out the receiving vector + * @param {ReadonlyQuat} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {quat} out + * @function + */ + +var scale = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.scale; +/** + * Calculates the dot product of two quat's + * + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @returns {Number} dot product of a and b + * @function + */ + +var dot = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.dot; +/** + * Performs a linear interpolation between two quat's + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {quat} out + * @function + */ + +var lerp = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.lerp; +/** + * Calculates the length of a quat + * + * @param {ReadonlyQuat} a vector to calculate length of + * @returns {Number} length of a + */ + +var length = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.length; +/** + * Alias for {@link quat.length} + * @function + */ + +var len = length; +/** + * Calculates the squared length of a quat + * + * @param {ReadonlyQuat} a vector to calculate squared length of + * @returns {Number} squared length of a + * @function + */ + +var squaredLength = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.squaredLength; +/** + * Alias for {@link quat.squaredLength} + * @function + */ + +var sqrLen = squaredLength; +/** + * Normalize a quat + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quaternion to normalize + * @returns {quat} out + * @function + */ + +var normalize = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.normalize; +/** + * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyQuat} a The first quaternion. + * @param {ReadonlyQuat} b The second quaternion. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +var exactEquals = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.exactEquals; +/** + * Returns whether or not the quaternions have approximately the same elements in the same position. + * + * @param {ReadonlyQuat} a The first vector. + * @param {ReadonlyQuat} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +var equals = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.equals; +/** + * Sets a quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * + * @param {quat} out the receiving quaternion. + * @param {ReadonlyVec3} a the initial vector + * @param {ReadonlyVec3} b the destination vector + * @returns {quat} out + */ + +var rotationTo = function () { + var tmpvec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.create(); + var xUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.fromValues(1, 0, 0); + var yUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.fromValues(0, 1, 0); + return function (out, a, b) { + var dot = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.dot(a, b); + + if (dot < -0.999999) { + _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, xUnitVec3, a); + if (_vec3_js__WEBPACK_IMPORTED_MODULE_2__.len(tmpvec3) < 0.000001) _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, yUnitVec3, a); + _vec3_js__WEBPACK_IMPORTED_MODULE_2__.normalize(tmpvec3, tmpvec3); + setAxisAngle(out, tmpvec3, Math.PI); + return out; + } else if (dot > 0.999999) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } else { + _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, a, b); + out[0] = tmpvec3[0]; + out[1] = tmpvec3[1]; + out[2] = tmpvec3[2]; + out[3] = 1 + dot; + return normalize(out, out); + } + }; +}(); +/** + * Performs a spherical linear interpolation with two control points + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @param {ReadonlyQuat} c the third operand + * @param {ReadonlyQuat} d the fourth operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {quat} out + */ + +var sqlerp = function () { + var temp1 = create(); + var temp2 = create(); + return function (out, a, b, c, d, t) { + slerp(temp1, a, d, t); + slerp(temp2, b, c, t); + slerp(out, temp1, temp2, 2 * t * (1 - t)); + return out; + }; +}(); +/** + * Sets the specified quaternion with values corresponding to the given + * axes. Each axis is a vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * + * @param {ReadonlyVec3} view the vector representing the viewing direction + * @param {ReadonlyVec3} right the vector representing the local "right" direction + * @param {ReadonlyVec3} up the vector representing the local "up" direction + * @returns {quat} out + */ + +var setAxes = function () { + var matr = _mat3_js__WEBPACK_IMPORTED_MODULE_3__.create(); + return function (out, view, right, up) { + matr[0] = right[0]; + matr[3] = right[1]; + matr[6] = right[2]; + matr[1] = up[0]; + matr[4] = up[1]; + matr[7] = up[2]; + matr[2] = -view[0]; + matr[5] = -view[1]; + matr[8] = -view[2]; + return normalize(out, fromMat3(out, matr)); + }; +}(); + +/***/ }), +/* 14 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "divide": () => (/* binding */ divide), +/* harmony export */ "ceil": () => (/* binding */ ceil), +/* harmony export */ "floor": () => (/* binding */ floor), +/* harmony export */ "min": () => (/* binding */ min), +/* harmony export */ "max": () => (/* binding */ max), +/* harmony export */ "round": () => (/* binding */ round), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), +/* harmony export */ "distance": () => (/* binding */ distance), +/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), +/* harmony export */ "length": () => (/* binding */ length), +/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), +/* harmony export */ "negate": () => (/* binding */ negate), +/* harmony export */ "inverse": () => (/* binding */ inverse), +/* harmony export */ "normalize": () => (/* binding */ normalize), +/* harmony export */ "dot": () => (/* binding */ dot), +/* harmony export */ "cross": () => (/* binding */ cross), +/* harmony export */ "lerp": () => (/* binding */ lerp), +/* harmony export */ "random": () => (/* binding */ random), +/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), +/* harmony export */ "transformQuat": () => (/* binding */ transformQuat), +/* harmony export */ "zero": () => (/* binding */ zero), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "sub": () => (/* binding */ sub), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "div": () => (/* binding */ div), +/* harmony export */ "dist": () => (/* binding */ dist), +/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), +/* harmony export */ "len": () => (/* binding */ len), +/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), +/* harmony export */ "forEach": () => (/* binding */ forEach) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); + +/** + * 4 Dimensional Vector + * @module vec4 + */ + +/** + * Creates a new, empty vec4 + * + * @returns {vec4} a new 4D vector + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 0; + } + + return out; +} +/** + * Creates a new vec4 initialized with values from an existing vector + * + * @param {ReadonlyVec4} a vector to clone + * @returns {vec4} a new 4D vector + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; +} +/** + * Creates a new vec4 initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {vec4} a new 4D vector + */ + +function fromValues(x, y, z, w) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = w; + return out; +} +/** + * Copy the values from one vec4 to another + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the source vector + * @returns {vec4} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; +} +/** + * Set the components of a vec4 to the given values + * + * @param {vec4} out the receiving vector + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {vec4} out + */ + +function set(out, x, y, z, w) { + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = w; + return out; +} +/** + * Adds two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; +} +/** + * Subtracts vector b from vector a + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; +} +/** + * Multiplies two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + out[3] = a[3] * b[3]; + return out; +} +/** + * Divides two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + out[3] = a[3] / b[3]; + return out; +} +/** + * Math.ceil the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to ceil + * @returns {vec4} out + */ + +function ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + out[3] = Math.ceil(a[3]); + return out; +} +/** + * Math.floor the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to floor + * @returns {vec4} out + */ + +function floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + out[3] = Math.floor(a[3]); + return out; +} +/** + * Returns the minimum of two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + out[3] = Math.min(a[3], b[3]); + return out; +} +/** + * Returns the maximum of two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + out[3] = Math.max(a[3], b[3]); + return out; +} +/** + * Math.round the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to round + * @returns {vec4} out + */ + +function round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + out[2] = Math.round(a[2]); + out[3] = Math.round(a[3]); + return out; +} +/** + * Scales a vec4 by a scalar number + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {vec4} out + */ + +function scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + return out; +} +/** + * Adds two vec4's after scaling the second operand by a scalar value + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @param {Number} scale the amount to scale b by before adding + * @returns {vec4} out + */ + +function scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; +} +/** + * Calculates the euclidian distance between two vec4's + * + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {Number} distance between a and b + */ + +function distance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + var w = b[3] - a[3]; + return Math.hypot(x, y, z, w); +} +/** + * Calculates the squared euclidian distance between two vec4's + * + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {Number} squared distance between a and b + */ + +function squaredDistance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + var w = b[3] - a[3]; + return x * x + y * y + z * z + w * w; +} +/** + * Calculates the length of a vec4 + * + * @param {ReadonlyVec4} a vector to calculate length of + * @returns {Number} length of a + */ + +function length(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var w = a[3]; + return Math.hypot(x, y, z, w); +} +/** + * Calculates the squared length of a vec4 + * + * @param {ReadonlyVec4} a vector to calculate squared length of + * @returns {Number} squared length of a + */ + +function squaredLength(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var w = a[3]; + return x * x + y * y + z * z + w * w; +} +/** + * Negates the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to negate + * @returns {vec4} out + */ + +function negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = -a[3]; + return out; +} +/** + * Returns the inverse of the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to invert + * @returns {vec4} out + */ + +function inverse(out, a) { + out[0] = 1.0 / a[0]; + out[1] = 1.0 / a[1]; + out[2] = 1.0 / a[2]; + out[3] = 1.0 / a[3]; + return out; +} +/** + * Normalize a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to normalize + * @returns {vec4} out + */ + +function normalize(out, a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var w = a[3]; + var len = x * x + y * y + z * z + w * w; + + if (len > 0) { + len = 1 / Math.sqrt(len); + } + + out[0] = x * len; + out[1] = y * len; + out[2] = z * len; + out[3] = w * len; + return out; +} +/** + * Calculates the dot product of two vec4's + * + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {Number} dot product of a and b + */ + +function dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; +} +/** + * Returns the cross-product of three vectors in a 4-dimensional space + * + * @param {ReadonlyVec4} result the receiving vector + * @param {ReadonlyVec4} U the first vector + * @param {ReadonlyVec4} V the second vector + * @param {ReadonlyVec4} W the third vector + * @returns {vec4} result + */ + +function cross(out, u, v, w) { + var A = v[0] * w[1] - v[1] * w[0], + B = v[0] * w[2] - v[2] * w[0], + C = v[0] * w[3] - v[3] * w[0], + D = v[1] * w[2] - v[2] * w[1], + E = v[1] * w[3] - v[3] * w[1], + F = v[2] * w[3] - v[3] * w[2]; + var G = u[0]; + var H = u[1]; + var I = u[2]; + var J = u[3]; + out[0] = H * F - I * E + J * D; + out[1] = -(G * F) + I * C - J * B; + out[2] = G * E - H * C + J * A; + out[3] = -(G * D) + H * B - I * A; + return out; +} +/** + * Performs a linear interpolation between two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {vec4} out + */ + +function lerp(out, a, b, t) { + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var aw = a[3]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + out[3] = aw + t * (b[3] - aw); + return out; +} +/** + * Generates a random vector with the given scale + * + * @param {vec4} out the receiving vector + * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns {vec4} out + */ + +function random(out, scale) { + scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a + // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646. + // http://projecteuclid.org/euclid.aoms/1177692644; + + var v1, v2, v3, v4; + var s1, s2; + + do { + v1 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; + v2 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; + s1 = v1 * v1 + v2 * v2; + } while (s1 >= 1); + + do { + v3 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; + v4 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; + s2 = v3 * v3 + v4 * v4; + } while (s2 >= 1); + + var d = Math.sqrt((1 - s1) / s2); + out[0] = scale * v1; + out[1] = scale * v2; + out[2] = scale * v3 * d; + out[3] = scale * v4 * d; + return out; +} +/** + * Transforms the vec4 with a mat4. + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the vector to transform + * @param {ReadonlyMat4} m matrix to transform with + * @returns {vec4} out + */ + +function transformMat4(out, a, m) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3]; + out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + return out; +} +/** + * Transforms the vec4 with a quat + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the vector to transform + * @param {ReadonlyQuat} q quaternion to transform with + * @returns {vec4} out + */ + +function transformQuat(out, a, q) { + var x = a[0], + y = a[1], + z = a[2]; + var qx = q[0], + qy = q[1], + qz = q[2], + qw = q[3]; // calculate quat * vec + + var ix = qw * x + qy * z - qz * y; + var iy = qw * y + qz * x - qx * z; + var iz = qw * z + qx * y - qy * x; + var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat + + out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy; + out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz; + out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx; + out[3] = a[3]; + return out; +} +/** + * Set the components of a vec4 to zero + * + * @param {vec4} out the receiving vector + * @returns {vec4} out + */ + +function zero(out) { + out[0] = 0.0; + out[1] = 0.0; + out[2] = 0.0; + out[3] = 0.0; + return out; +} +/** + * Returns a string representation of a vector + * + * @param {ReadonlyVec4} a vector to represent as a string + * @returns {String} string representation of the vector + */ + +function str(a) { + return "vec4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; +} +/** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyVec4} a The first vector. + * @param {ReadonlyVec4} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; +} +/** + * Returns whether or not the vectors have approximately the same elements in the same position. + * + * @param {ReadonlyVec4} a The first vector. + * @param {ReadonlyVec4} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)); +} +/** + * Alias for {@link vec4.subtract} + * @function + */ + +var sub = subtract; +/** + * Alias for {@link vec4.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link vec4.divide} + * @function + */ + +var div = divide; +/** + * Alias for {@link vec4.distance} + * @function + */ + +var dist = distance; +/** + * Alias for {@link vec4.squaredDistance} + * @function + */ + +var sqrDist = squaredDistance; +/** + * Alias for {@link vec4.length} + * @function + */ + +var len = length; +/** + * Alias for {@link vec4.squaredLength} + * @function + */ + +var sqrLen = squaredLength; +/** + * Perform some operation over an array of vec4s. + * + * @param {Array} a the array of vectors to iterate over + * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed + * @param {Number} offset Number of elements to skip at the beginning of the array + * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array + * @param {Function} fn Function to call for each vector in the array + * @param {Object} [arg] additional argument to pass to fn + * @returns {Array} a + * @function + */ + +var forEach = function () { + var vec = create(); + return function (a, stride, offset, count, fn, arg) { + var i, l; + + if (!stride) { + stride = 4; } - /** - * Call strem on children - * - * @param {(streamArguments: IStreamArguments) => void} callback - * @memberof Group - */ - stream(callback) { - this.children.forEach(item => item.stream(callback)); + + if (!offset) { + offset = 0; + } + + if (count) { + l = Math.min(count * stride + offset, a.length); + } else { + l = a.length; + } + + for (i = offset; i < l; i += stride) { + vec[0] = a[i]; + vec[1] = a[i + 1]; + vec[2] = a[i + 2]; + vec[3] = a[i + 3]; + fn(vec, vec, arg); + a[i] = vec[0]; + a[i + 1] = vec[1]; + a[i + 2] = vec[2]; + a[i + 3] = vec[3]; } + + return a; + }; +}(); + +/***/ }), +/* 15 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "length": () => (/* binding */ length), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "divide": () => (/* binding */ divide), +/* harmony export */ "ceil": () => (/* binding */ ceil), +/* harmony export */ "floor": () => (/* binding */ floor), +/* harmony export */ "min": () => (/* binding */ min), +/* harmony export */ "max": () => (/* binding */ max), +/* harmony export */ "round": () => (/* binding */ round), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), +/* harmony export */ "distance": () => (/* binding */ distance), +/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), +/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), +/* harmony export */ "negate": () => (/* binding */ negate), +/* harmony export */ "inverse": () => (/* binding */ inverse), +/* harmony export */ "normalize": () => (/* binding */ normalize), +/* harmony export */ "dot": () => (/* binding */ dot), +/* harmony export */ "cross": () => (/* binding */ cross), +/* harmony export */ "lerp": () => (/* binding */ lerp), +/* harmony export */ "hermite": () => (/* binding */ hermite), +/* harmony export */ "bezier": () => (/* binding */ bezier), +/* harmony export */ "random": () => (/* binding */ random), +/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), +/* harmony export */ "transformMat3": () => (/* binding */ transformMat3), +/* harmony export */ "transformQuat": () => (/* binding */ transformQuat), +/* harmony export */ "rotateX": () => (/* binding */ rotateX), +/* harmony export */ "rotateY": () => (/* binding */ rotateY), +/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), +/* harmony export */ "angle": () => (/* binding */ angle), +/* harmony export */ "zero": () => (/* binding */ zero), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "sub": () => (/* binding */ sub), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "div": () => (/* binding */ div), +/* harmony export */ "dist": () => (/* binding */ dist), +/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), +/* harmony export */ "len": () => (/* binding */ len), +/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), +/* harmony export */ "forEach": () => (/* binding */ forEach) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); + +/** + * 3 Dimensional Vector + * @module vec3 + */ + +/** + * Creates a new, empty vec3 + * + * @returns {vec3} a new 3D vector + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + } + + return out; +} +/** + * Creates a new vec3 initialized with values from an existing vector + * + * @param {ReadonlyVec3} a vector to clone + * @returns {vec3} a new 3D vector + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + return out; +} +/** + * Calculates the length of a vec3 + * + * @param {ReadonlyVec3} a vector to calculate length of + * @returns {Number} length of a + */ + +function length(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + return Math.hypot(x, y, z); +} +/** + * Creates a new vec3 initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @returns {vec3} a new 3D vector + */ + +function fromValues(x, y, z) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + out[0] = x; + out[1] = y; + out[2] = z; + return out; +} +/** + * Copy the values from one vec3 to another + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the source vector + * @returns {vec3} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + return out; +} +/** + * Set the components of a vec3 to the given values + * + * @param {vec3} out the receiving vector + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @returns {vec3} out + */ + +function set(out, x, y, z) { + out[0] = x; + out[1] = y; + out[2] = z; + return out; +} +/** + * Adds two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + return out; +} +/** + * Subtracts vector b from vector a + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + return out; +} +/** + * Multiplies two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + return out; +} +/** + * Divides two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + return out; +} +/** + * Math.ceil the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to ceil + * @returns {vec3} out + */ + +function ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + return out; +} +/** + * Math.floor the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to floor + * @returns {vec3} out + */ + +function floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + return out; +} +/** + * Returns the minimum of two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + return out; +} +/** + * Returns the maximum of two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + return out; +} +/** + * Math.round the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to round + * @returns {vec3} out + */ + +function round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + out[2] = Math.round(a[2]); + return out; +} +/** + * Scales a vec3 by a scalar number + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {vec3} out + */ + +function scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + return out; +} +/** + * Adds two vec3's after scaling the second operand by a scalar value + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @param {Number} scale the amount to scale b by before adding + * @returns {vec3} out + */ + +function scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + return out; +} +/** + * Calculates the euclidian distance between two vec3's + * + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {Number} distance between a and b + */ + +function distance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + return Math.hypot(x, y, z); +} +/** + * Calculates the squared euclidian distance between two vec3's + * + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {Number} squared distance between a and b + */ + +function squaredDistance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + return x * x + y * y + z * z; +} +/** + * Calculates the squared length of a vec3 + * + * @param {ReadonlyVec3} a vector to calculate squared length of + * @returns {Number} squared length of a + */ + +function squaredLength(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + return x * x + y * y + z * z; +} +/** + * Negates the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to negate + * @returns {vec3} out + */ + +function negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + return out; +} +/** + * Returns the inverse of the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to invert + * @returns {vec3} out + */ + +function inverse(out, a) { + out[0] = 1.0 / a[0]; + out[1] = 1.0 / a[1]; + out[2] = 1.0 / a[2]; + return out; +} +/** + * Normalize a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to normalize + * @returns {vec3} out + */ + +function normalize(out, a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var len = x * x + y * y + z * z; + + if (len > 0) { + //TODO: evaluate use of glm_invsqrt here? + len = 1 / Math.sqrt(len); + } + + out[0] = a[0] * len; + out[1] = a[1] * len; + out[2] = a[2] * len; + return out; +} +/** + * Calculates the dot product of two vec3's + * + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {Number} dot product of a and b + */ + +function dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; +} +/** + * Computes the cross product of two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function cross(out, a, b) { + var ax = a[0], + ay = a[1], + az = a[2]; + var bx = b[0], + by = b[1], + bz = b[2]; + out[0] = ay * bz - az * by; + out[1] = az * bx - ax * bz; + out[2] = ax * by - ay * bx; + return out; +} +/** + * Performs a linear interpolation between two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {vec3} out + */ + +function lerp(out, a, b, t) { + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + return out; +} +/** + * Performs a hermite interpolation with two control points + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @param {ReadonlyVec3} c the third operand + * @param {ReadonlyVec3} d the fourth operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {vec3} out + */ + +function hermite(out, a, b, c, d, t) { + var factorTimes2 = t * t; + var factor1 = factorTimes2 * (2 * t - 3) + 1; + var factor2 = factorTimes2 * (t - 2) + t; + var factor3 = factorTimes2 * (t - 1); + var factor4 = factorTimes2 * (3 - 2 * t); + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; +} +/** + * Performs a bezier interpolation with two control points + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @param {ReadonlyVec3} c the third operand + * @param {ReadonlyVec3} d the fourth operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {vec3} out + */ + +function bezier(out, a, b, c, d, t) { + var inverseFactor = 1 - t; + var inverseFactorTimesTwo = inverseFactor * inverseFactor; + var factorTimes2 = t * t; + var factor1 = inverseFactorTimesTwo * inverseFactor; + var factor2 = 3 * t * inverseFactorTimesTwo; + var factor3 = 3 * factorTimes2 * inverseFactor; + var factor4 = factorTimes2 * t; + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; +} +/** + * Generates a random vector with the given scale + * + * @param {vec3} out the receiving vector + * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns {vec3} out + */ + +function random(out, scale) { + scale = scale || 1.0; + var r = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 * Math.PI; + var z = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 - 1.0; + var zScale = Math.sqrt(1.0 - z * z) * scale; + out[0] = Math.cos(r) * zScale; + out[1] = Math.sin(r) * zScale; + out[2] = z * scale; + return out; +} +/** + * Transforms the vec3 with a mat4. + * 4th vector component is implicitly '1' + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the vector to transform + * @param {ReadonlyMat4} m matrix to transform with + * @returns {vec3} out + */ + +function transformMat4(out, a, m) { + var x = a[0], + y = a[1], + z = a[2]; + var w = m[3] * x + m[7] * y + m[11] * z + m[15]; + w = w || 1.0; + out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w; + out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w; + out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w; + return out; +} +/** + * Transforms the vec3 with a mat3. + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the vector to transform + * @param {ReadonlyMat3} m the 3x3 matrix to transform with + * @returns {vec3} out + */ + +function transformMat3(out, a, m) { + var x = a[0], + y = a[1], + z = a[2]; + out[0] = x * m[0] + y * m[3] + z * m[6]; + out[1] = x * m[1] + y * m[4] + z * m[7]; + out[2] = x * m[2] + y * m[5] + z * m[8]; + return out; +} +/** + * Transforms the vec3 with a quat + * Can also be used for dual quaternions. (Multiply it with the real part) + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the vector to transform + * @param {ReadonlyQuat} q quaternion to transform with + * @returns {vec3} out + */ + +function transformQuat(out, a, q) { + // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed + var qx = q[0], + qy = q[1], + qz = q[2], + qw = q[3]; + var x = a[0], + y = a[1], + z = a[2]; // var qvec = [qx, qy, qz]; + // var uv = vec3.cross([], qvec, a); + + var uvx = qy * z - qz * y, + uvy = qz * x - qx * z, + uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv); + + var uuvx = qy * uvz - qz * uvy, + uuvy = qz * uvx - qx * uvz, + uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w); + + var w2 = qw * 2; + uvx *= w2; + uvy *= w2; + uvz *= w2; // vec3.scale(uuv, uuv, 2); + + uuvx *= 2; + uuvy *= 2; + uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv)); + + out[0] = x + uvx + uuvx; + out[1] = y + uvy + uuvy; + out[2] = z + uvz + uuvz; + return out; +} +/** + * Rotate a 3D vector around the x-axis + * @param {vec3} out The receiving vec3 + * @param {ReadonlyVec3} a The vec3 point to rotate + * @param {ReadonlyVec3} b The origin of the rotation + * @param {Number} rad The angle of rotation in radians + * @returns {vec3} out + */ + +function rotateX(out, a, b, rad) { + var p = [], + r = []; //Translate point to the origin + + p[0] = a[0] - b[0]; + p[1] = a[1] - b[1]; + p[2] = a[2] - b[2]; //perform rotation + + r[0] = p[0]; + r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad); + r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position + + out[0] = r[0] + b[0]; + out[1] = r[1] + b[1]; + out[2] = r[2] + b[2]; + return out; +} +/** + * Rotate a 3D vector around the y-axis + * @param {vec3} out The receiving vec3 + * @param {ReadonlyVec3} a The vec3 point to rotate + * @param {ReadonlyVec3} b The origin of the rotation + * @param {Number} rad The angle of rotation in radians + * @returns {vec3} out + */ + +function rotateY(out, a, b, rad) { + var p = [], + r = []; //Translate point to the origin + + p[0] = a[0] - b[0]; + p[1] = a[1] - b[1]; + p[2] = a[2] - b[2]; //perform rotation + + r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad); + r[1] = p[1]; + r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position + + out[0] = r[0] + b[0]; + out[1] = r[1] + b[1]; + out[2] = r[2] + b[2]; + return out; +} +/** + * Rotate a 3D vector around the z-axis + * @param {vec3} out The receiving vec3 + * @param {ReadonlyVec3} a The vec3 point to rotate + * @param {ReadonlyVec3} b The origin of the rotation + * @param {Number} rad The angle of rotation in radians + * @returns {vec3} out + */ + +function rotateZ(out, a, b, rad) { + var p = [], + r = []; //Translate point to the origin + + p[0] = a[0] - b[0]; + p[1] = a[1] - b[1]; + p[2] = a[2] - b[2]; //perform rotation + + r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad); + r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad); + r[2] = p[2]; //translate to correct position + + out[0] = r[0] + b[0]; + out[1] = r[1] + b[1]; + out[2] = r[2] + b[2]; + return out; +} +/** + * Get the angle between two 3D vectors + * @param {ReadonlyVec3} a The first operand + * @param {ReadonlyVec3} b The second operand + * @returns {Number} The angle in radians + */ + +function angle(a, b) { + var ax = a[0], + ay = a[1], + az = a[2], + bx = b[0], + by = b[1], + bz = b[2], + mag1 = Math.sqrt(ax * ax + ay * ay + az * az), + mag2 = Math.sqrt(bx * bx + by * by + bz * bz), + mag = mag1 * mag2, + cosine = mag && dot(a, b) / mag; + return Math.acos(Math.min(Math.max(cosine, -1), 1)); +} +/** + * Set the components of a vec3 to zero + * + * @param {vec3} out the receiving vector + * @returns {vec3} out + */ + +function zero(out) { + out[0] = 0.0; + out[1] = 0.0; + out[2] = 0.0; + return out; +} +/** + * Returns a string representation of a vector + * + * @param {ReadonlyVec3} a vector to represent as a string + * @returns {String} string representation of the vector + */ + +function str(a) { + return "vec3(" + a[0] + ", " + a[1] + ", " + a[2] + ")"; +} +/** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyVec3} a The first vector. + * @param {ReadonlyVec3} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; } -exports.Group = Group; -//# sourceMappingURL=Group.js.map +/** + * Returns whether or not the vectors have approximately the same elements in the same position. + * + * @param {ReadonlyVec3} a The first vector. + * @param {ReadonlyVec3} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ -/***/ }), -/* 26 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2]; + var b0 = b[0], + b1 = b[1], + b2 = b[2]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)); +} +/** + * Alias for {@link vec3.subtract} + * @function + */ -"use strict"; +var sub = subtract; +/** + * Alias for {@link vec3.multiply} + * @function + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ShapeBase = void 0; -const gl_matrix_1 = __webpack_require__(12); -const types_1 = __webpack_require__(3); -const glme = __webpack_require__(27); -const Vec2_1 = __webpack_require__(28); -const math_1 = __webpack_require__(29); -const Adapt_1 = __webpack_require__(30); -const Utilities_1 = __webpack_require__(32); -const SceneChild_1 = __webpack_require__(24); -const tmpMatrix = gl_matrix_1.mat4.create(); -const transformMatrix = gl_matrix_1.mat4.create(); -const perspectiveMatrix = gl_matrix_1.mat4.create(); -const repetitionMatrix = gl_matrix_1.mat4.create(); -/** - * Main class for shape generation - * - * @category Core.Abstract - * @abstract - * @class ShapeBase - * @order 4 - * @extends {SceneChild} +var mul = multiply; +/** + * Alias for {@link vec3.divide} + * @function */ -class ShapeBase extends SceneChild_1.SceneChild { - /** - * Creates an instance of ShapeBase - * - * @param {ISceneChildSettings} [settings={}] - */ - constructor(settings = {}) { - super(settings); - /** - * Flag used to determine if indexedBuffer has been generated - * - * @internal - * @ignore - */ - this.bIndexed = false; - /** - * Array used for index a vertex buffer - * only for first level scene children - * - * @internal - * @ignore - */ - this.indexedBuffer = []; - /** - * The bounding inside the scene - * - * @type {IShapeBounding} - */ - this.bounding = { - cx: 0, - cy: 0, - x: -1, - y: -1, - width: 2, - height: 2, - }; - this.props = { - distance: settings.distance, - repetitions: settings.repetitions, - rotateX: settings.rotateX, - rotateY: settings.rotateY, - rotateZ: settings.rotateZ, - skewX: settings.skewX, - skewY: settings.skewY, - squeezeX: settings.squeezeX, - squeezeY: settings.squeezeY, - displace: settings.displace, - translate: settings.translate, - scale: settings.scale, - transformOrigin: settings.transformOrigin, - perspective: settings.perspective, - perspectiveOrigin: settings.perspectiveOrigin, - }; - this.anchor = - settings.anchor && Array.isArray(settings.anchor) - ? [ - typeof settings.anchor[0] === 'number' - ? Utilities_1.clamp(-1, 1, settings.anchor[0]) * -1 - : settings.anchor[0] === 'left' - ? 1 - : settings.anchor[0] === 'right' - ? -1 - : 0, - typeof settings.anchor[1] === 'number' - ? Utilities_1.clamp(-1, 1, settings.anchor[1]) * -1 - : settings.anchor[1] === 'top' - ? 1 - : settings.anchor[1] === 'bottom' - ? -1 - : 0, - ] - : [0, 0]; - this.boundingType = - typeof settings.boundingType === 'string' - ? settings.boundingType === 'relative' - ? types_1.EBoundingType.Relative - : types_1.EBoundingType.Fixed - : settings.boundingType || types_1.EBoundingType.Fixed; - this.vertexCallback = settings.vertexCallback; - } - /** - * Check if the shape should be generated every time - * - * @returns {boolean} - */ - isStatic() { - const props = this.props; - return (typeof props.repetitions !== 'function' && - typeof props.distance !== 'function' && - typeof props.displace !== 'function' && - typeof props.scale !== 'function' && - typeof props.translate !== 'function' && - typeof props.skewX !== 'function' && - typeof props.skewY !== 'function' && - typeof props.squeezeX !== 'function' && - typeof props.squeezeY !== 'function' && - typeof props.rotateX !== 'function' && - typeof props.rotateY !== 'function' && - typeof props.rotateZ !== 'function' && - typeof props.transformOrigin !== 'function' && - typeof props.perspective !== 'function' && - typeof props.perspectiveOrigin !== 'function'); - } - /** - * Check if the indexedBuffer array needs to be recreated every time, - * this can happen when a shape generates an array of vertices different in length at each repetition - * - * @returns {boolean} - */ - isStaticIndexed() { - return typeof this.props.repetitions !== 'function'; - } - /** - * Return a prop value - * - * @param {keyof ISceneChildProps} key - * @param {PropArguments} [propArguments] - * @param {*} [defaultValue] - * @returns {*} - */ - getProp(key, propArguments, defaultValue) { - let attribute = this.props[key]; - if (typeof attribute === 'function') { - attribute = attribute(propArguments); - } - return typeof attribute === 'undefined' || Number.isNaN(attribute) ? defaultValue : attribute; - } - /** - * Set a single or multiple props - * - * @param {(keyof ISceneChildProps | ISceneChildProps)} key - * @param {*} [value] - * @param {boolean} [bClearIndexed=false] - */ - setProp(key, value, bClearIndexed = false) { - if (typeof key === 'string') { - bClearIndexed = bClearIndexed || key == 'repetitions'; - this.props[key] = value; - } - else { - bClearIndexed = bClearIndexed || 'repetitions' in key; - Object.keys(key).forEach((k) => (this.props[k] = key[k])); - } - this.clearBuffer(bClearIndexed, true); - } - /** - * Unset buffer - * - * @param {boolean} [bClearIndexed=false] - * @param {boolean} [bPropagateToParents=false] - * @param {boolean} [bPropagateToChildren=false] - */ - clearBuffer(bClearIndexed = false, bPropagateToParents = true) { - this.buffer = undefined; - if (bClearIndexed) { - this.bIndexed = false; - this.indexedBuffer = []; - } - this.bStatic = this.isStatic(); - this.bStaticIndexed = this.isStaticIndexed(); - if (bPropagateToParents && this.scene && !this.scene.isFirstLevelChild(this)) { - const parents = this.scene.getParentsOfSceneChild(this); - parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */); - } + +var div = divide; +/** + * Alias for {@link vec3.distance} + * @function + */ + +var dist = distance; +/** + * Alias for {@link vec3.squaredDistance} + * @function + */ + +var sqrDist = squaredDistance; +/** + * Alias for {@link vec3.length} + * @function + */ + +var len = length; +/** + * Alias for {@link vec3.squaredLength} + * @function + */ + +var sqrLen = squaredLength; +/** + * Perform some operation over an array of vec3s. + * + * @param {Array} a the array of vectors to iterate over + * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed + * @param {Number} offset Number of elements to skip at the beginning of the array + * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array + * @param {Function} fn Function to call for each vector in the array + * @param {Object} [arg] additional argument to pass to fn + * @returns {Array} a + * @function + */ + +var forEach = function () { + var vec = create(); + return function (a, stride, offset, count, fn, arg) { + var i, l; + + if (!stride) { + stride = 3; } - /** - * Update the vertex array if the shape is not static and update the indexedBuffer if it is also not static - * - * @param {number} generateId generation id - * @param {boolean} [bDirectSceneChild=false] adjust shape of center of scene - * @param {PropArguments} [parentPropArguments] - */ - generate(generateId = 0, bDirectSceneChild = false, parentPropArguments) { - var _a, _b; - if (this.buffer && this.bStatic) { - return; - } - this.generateId = generateId; - if (!this.bStaticIndexed || !this.bIndexed) - this.indexedBuffer = []; - const propArguments = ShapeBase.getEmptyPropArguments(this, parentPropArguments); - const repetition = propArguments.repetition; - const repetitions = this.getProp('repetitions', propArguments, 1); - const repetitionType = Array.isArray(repetitions) ? types_1.ERepetitionType.Matrix : types_1.ERepetitionType.Ring; - const repetitionCount = Array.isArray(repetitions) - ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) - : repetitions; - const repetitionRowCount = Array.isArray(repetitions) ? repetitions[0] : repetitionCount; - const repetitionColCount = Array.isArray(repetitions) ? (_b = repetitions[1]) !== null && _b !== void 0 ? _b : repetitions[0] : 1; - const rowRepetition = repetition.row; - rowRepetition.count = repetitionRowCount; - const colRepetition = repetition.col; - colRepetition.count = repetitionColCount; - repetition.count = repetitionCount; - repetition.col.count = repetitionColCount; - repetition.row.count = repetitionRowCount; - repetition.type = repetitionType; - let totalBufferLength = 0; - const buffers = []; - let currentIndex = 0; - const centerMatrix = gl_matrix_1.vec2.fromValues((repetitionColCount - 1) / 2, (repetitionRowCount - 1) / 2); - const sceneAnchor = this.scene ? [this.scene.anchor[0], this.scene.anchor[1], 0] : [0, 0, 0]; - const tmpTotalShapeBounding = [undefined, undefined, undefined, undefined]; - const tmpSingleRepetitionBounding = [undefined, undefined, undefined, undefined]; - for (let currentRowRepetition = 0; currentRowRepetition < repetitionRowCount; currentRowRepetition++) { - for (let currentColRepetition = 0; currentColRepetition < repetitionColCount; currentColRepetition++, currentIndex++) { - repetition.index = currentIndex + 1; - repetition.offset = repetitionCount > 1 ? currentIndex / (repetitionCount - 1) : 1; - repetition.angle = repetitionType === types_1.ERepetitionType.Ring ? (math_1.PI2 / repetitionCount) * currentIndex : 0; - colRepetition.index = currentColRepetition + 1; - colRepetition.offset = repetitionColCount > 1 ? currentColRepetition / (repetitionColCount - 1) : 1; - rowRepetition.index = currentRowRepetition + 1; - rowRepetition.offset = repetitionRowCount > 1 ? currentRowRepetition / (repetitionRowCount - 1) : 1; - // Generate primitives buffer recursively - const buffer = this.generateBuffer(generateId, propArguments); - const bufferLength = buffer.length; - const bounding = this.getShapeBounding(); - buffers[currentIndex] = new Float32Array(bufferLength); - totalBufferLength += bufferLength; - { - const distance = glme.toVec2(this.getProp('distance', propArguments, glme.VEC2_ZERO)); - const displace = this.getProp('displace', propArguments, 0); - const scale = glme.toVec3(this.getProp('scale', propArguments, glme.VEC2_ONE), 1); - const translate = glme.toVec3(this.getProp('translate', propArguments, glme.VEC2_ZERO), 0); - const skewX = this.getProp('skewX', propArguments, 0); - const skewY = this.getProp('skewY', propArguments, 0); - const squeezeX = this.getProp('squeezeX', propArguments, 0); - const squeezeY = this.getProp('squeezeY', propArguments, 0); - const rotateX = this.getProp('rotateX', propArguments, 0); - const rotateY = this.getProp('rotateY', propArguments, 0); - const rotateZ = this.getProp('rotateZ', propArguments, 0); - const perspective = Utilities_1.clamp(0, 1, this.getProp('perspective', propArguments, 0)); - const perspectiveOrigin = glme.toVec3(this.getProp('perspectiveOrigin', propArguments, glme.VEC2_ZERO), 0); - const transformOrigin = glme.toVec3(this.getProp('transformOrigin', propArguments, glme.VEC2_ZERO), 0); - let offset; - switch (repetitionType) { - case types_1.ERepetitionType.Ring: - offset = gl_matrix_1.vec3.fromValues(distance[0], 0, 0); - gl_matrix_1.vec3.rotateZ(offset, offset, glme.VEC3_ZERO, repetition.angle + displace); - break; - case types_1.ERepetitionType.Matrix: - offset = gl_matrix_1.vec3.fromValues(distance[1] * (currentColRepetition - centerMatrix[0]), distance[0] * (currentRowRepetition - centerMatrix[1]), 0); - break; - } - const perspectiveSize = perspective > 0 ? Math.max(bounding.width, bounding.height) / 2 : 1; - const perspectiveValue = perspective > 0 ? perspectiveSize + (1 - perspective) * (perspectiveSize * 10) : 0; - const bTransformOrigin = (this.boundingType === types_1.EBoundingType.Relative ? bounding.cx !== 0 || bounding.cy !== 0 : true) || - perspective !== 0 || - transformOrigin[0] !== 0 || - transformOrigin[1] !== 0; - const bPerspectiveOrigin = perspectiveOrigin[0] !== 0 || perspectiveOrigin[1] !== 0; - if (bTransformOrigin) { - if (this.boundingType === types_1.EBoundingType.Relative) { - transformOrigin[0] = transformOrigin[0] * (bounding.width / 2) + bounding.cx; - transformOrigin[1] = transformOrigin[1] * (bounding.height / 2) + bounding.cy; - } - else { - transformOrigin[0] *= bounding.width / 2; - transformOrigin[1] *= bounding.height / 2; - } - transformOrigin[2] = perspectiveValue; - } - /** - * Create Matrices - */ - { - /** - * Create Transformation matrix - */ - gl_matrix_1.mat4.identity(transformMatrix); - bTransformOrigin && gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, transformOrigin); - if (translate[0] !== 0 || translate[1] !== 0) - gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, translate); - if (skewX !== 0 || skewY !== 0) { - glme.fromSkew(tmpMatrix, [skewX, skewY]); - gl_matrix_1.mat4.multiply(transformMatrix, transformMatrix, tmpMatrix); - } - rotateX !== 0 && gl_matrix_1.mat4.rotateX(transformMatrix, transformMatrix, rotateX); - rotateY !== 0 && gl_matrix_1.mat4.rotateY(transformMatrix, transformMatrix, rotateY); - rotateZ !== 0 && gl_matrix_1.mat4.rotateZ(transformMatrix, transformMatrix, rotateZ); - if (scale[0] !== 1 || scale[1] !== 1) - gl_matrix_1.mat4.scale(transformMatrix, transformMatrix, scale); - bTransformOrigin && - gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, gl_matrix_1.vec3.scale(transformOrigin, transformOrigin, -1)); - /** - * Create Perspective matrix - */ - if (perspectiveValue > 0) { - if (bPerspectiveOrigin) { - if (this.boundingType === types_1.EBoundingType.Relative) { - perspectiveOrigin[0] = perspectiveOrigin[0] * (bounding.width / 2) + bounding.cx; - perspectiveOrigin[1] = perspectiveOrigin[1] * (bounding.height / 2) + bounding.cy; - } - else { - perspectiveOrigin[0] *= bounding.width / 2; - perspectiveOrigin[1] *= bounding.height / 2; - } - perspectiveOrigin[2] = 0; - } - gl_matrix_1.mat4.perspective(perspectiveMatrix, -Math.PI / 2, 1, 0, Infinity); - } - /** - * Create Repetition matrix - */ - gl_matrix_1.mat4.identity(repetitionMatrix); - gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, offset); - if (bDirectSceneChild) { - gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, sceneAnchor); - } - /** - * Apply anchor - */ - const shapeAnchor = [this.anchor[0] * (bounding.width / 2), this.anchor[1] * (bounding.height / 2), 0]; - gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, shapeAnchor); - if (repetitionType === types_1.ERepetitionType.Ring) - gl_matrix_1.mat4.rotateZ(repetitionMatrix, repetitionMatrix, repetition.angle + displace); - } - Adapt_1.Bounding.clear(tmpSingleRepetitionBounding); - // Apply matrices on vertex - for (let bufferIndex = 0; bufferIndex < bufferLength; bufferIndex += 2) { - const vertex = [buffer[bufferIndex], buffer[bufferIndex + 1], perspectiveValue]; - { - // Apply squeeze, can be insert into transformMatrix? - squeezeX !== 0 && Vec2_1.default.squeezeX(vertex, squeezeX); - squeezeY !== 0 && Vec2_1.default.squeezeY(vertex, squeezeY); - // Apply transforms - gl_matrix_1.vec3.transformMat4(vertex, vertex, transformMatrix); - // Apply perspective - if (perspectiveValue > 0) { - bPerspectiveOrigin && gl_matrix_1.vec3.add(vertex, vertex, perspectiveOrigin); - gl_matrix_1.vec3.transformMat4(vertex, vertex, perspectiveMatrix); - gl_matrix_1.vec3.scale(vertex, vertex, perspectiveValue); - bPerspectiveOrigin && gl_matrix_1.vec3.sub(vertex, vertex, perspectiveOrigin); - } - // apply repetition matrix - gl_matrix_1.vec3.transformMat4(vertex, vertex, repetitionMatrix); - // custom vertex manipulation - if (typeof this.vertexCallback !== 'undefined') { - const index = bufferIndex / 2; - const count = bufferLength / 2; - const vertexRepetition = { - index: index + 1, - count, - offset: count > 1 ? index / (count - 1) : 1, - }; - this.vertexCallback(vertex, vertexRepetition, propArguments); - } - } - buffers[currentIndex][bufferIndex] = vertex[0]; - buffers[currentIndex][bufferIndex + 1] = vertex[1]; - Adapt_1.Bounding.add(tmpSingleRepetitionBounding, vertex[0], vertex[1]); - Adapt_1.Bounding.add(tmpTotalShapeBounding, vertex[0], vertex[1]); - } - } - // Bounding.sum(tmpTotalShapeBounding, tmpSingleRepetitionBounding) - // After buffer creation, add a frame into indexedBuffer if not static or update bounding - const singleRepetitionBounding = { cx: 0, cy: 0, x: -1, y: -1, width: 2, height: 2 }; - Adapt_1.Bounding.bind(singleRepetitionBounding, tmpSingleRepetitionBounding); - if (!this.bStaticIndexed || !this.bIndexed) { - this.addIndex(bufferLength, repetition, singleRepetitionBounding); - } - } - } - Adapt_1.Bounding.bind(this.bounding, tmpTotalShapeBounding); - this.buffer = new Float32Array(totalBufferLength); - for (let i = 0, offset = 0, len = buffers.length; i < len; offset += buffers[i].length, i++) - this.buffer.set(buffers[i], offset); - this.bIndexed = true; + + if (!offset) { + offset = 0; } - /** - * Return current shape (whit repetions) bounding - * - * @return {*} {IShapeBounding} - */ - getBounding() { - return this.bounding; + + if (count) { + l = Math.min(count * stride + offset, a.length); + } else { + l = a.length; } - /** - * Get number of repetitions - * - * @returns {number} - */ - getRepetitionCount() { - var _a; - const repetitions = this.getProp('repetitions', undefined, 1); - return Array.isArray(repetitions) ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) : repetitions; + + for (i = offset; i < l; i += stride) { + vec[0] = a[i]; + vec[1] = a[i + 1]; + vec[2] = a[i + 2]; + fn(vec, vec, arg); + a[i] = vec[0]; + a[i + 1] = vec[1]; + a[i + 2] = vec[2]; + } + + return a; + }; +}(); + +/***/ }), +/* 16 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "fromRotationTranslationValues": () => (/* binding */ fromRotationTranslationValues), +/* harmony export */ "fromRotationTranslation": () => (/* binding */ fromRotationTranslation), +/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), +/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), +/* harmony export */ "fromMat4": () => (/* binding */ fromMat4), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "getReal": () => (/* binding */ getReal), +/* harmony export */ "getDual": () => (/* binding */ getDual), +/* harmony export */ "setReal": () => (/* binding */ setReal), +/* harmony export */ "setDual": () => (/* binding */ setDual), +/* harmony export */ "getTranslation": () => (/* binding */ getTranslation), +/* harmony export */ "translate": () => (/* binding */ translate), +/* harmony export */ "rotateX": () => (/* binding */ rotateX), +/* harmony export */ "rotateY": () => (/* binding */ rotateY), +/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), +/* harmony export */ "rotateByQuatAppend": () => (/* binding */ rotateByQuatAppend), +/* harmony export */ "rotateByQuatPrepend": () => (/* binding */ rotateByQuatPrepend), +/* harmony export */ "rotateAroundAxis": () => (/* binding */ rotateAroundAxis), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "dot": () => (/* binding */ dot), +/* harmony export */ "lerp": () => (/* binding */ lerp), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "conjugate": () => (/* binding */ conjugate), +/* harmony export */ "length": () => (/* binding */ length), +/* harmony export */ "len": () => (/* binding */ len), +/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), +/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), +/* harmony export */ "normalize": () => (/* binding */ normalize), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); +/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13); +/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12); + + + +/** + * Dual Quaternion
+ * Format: [real, dual]
+ * Quaternion format: XYZW
+ * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
+ * @module quat2 + */ + +/** + * Creates a new identity dual quat + * + * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation] + */ + +function create() { + var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + dq[0] = 0; + dq[1] = 0; + dq[2] = 0; + dq[4] = 0; + dq[5] = 0; + dq[6] = 0; + dq[7] = 0; + } + + dq[3] = 1; + return dq; +} +/** + * Creates a new quat initialized with values from an existing quaternion + * + * @param {ReadonlyQuat2} a dual quaternion to clone + * @returns {quat2} new dual quaternion + * @function + */ + +function clone(a) { + var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); + dq[0] = a[0]; + dq[1] = a[1]; + dq[2] = a[2]; + dq[3] = a[3]; + dq[4] = a[4]; + dq[5] = a[5]; + dq[6] = a[6]; + dq[7] = a[7]; + return dq; +} +/** + * Creates a new dual quat initialized with the given values + * + * @param {Number} x1 X component + * @param {Number} y1 Y component + * @param {Number} z1 Z component + * @param {Number} w1 W component + * @param {Number} x2 X component + * @param {Number} y2 Y component + * @param {Number} z2 Z component + * @param {Number} w2 W component + * @returns {quat2} new dual quaternion + * @function + */ + +function fromValues(x1, y1, z1, w1, x2, y2, z2, w2) { + var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); + dq[0] = x1; + dq[1] = y1; + dq[2] = z1; + dq[3] = w1; + dq[4] = x2; + dq[5] = y2; + dq[6] = z2; + dq[7] = w2; + return dq; +} +/** + * Creates a new dual quat from the given values (quat and translation) + * + * @param {Number} x1 X component + * @param {Number} y1 Y component + * @param {Number} z1 Z component + * @param {Number} w1 W component + * @param {Number} x2 X component (translation) + * @param {Number} y2 Y component (translation) + * @param {Number} z2 Z component (translation) + * @returns {quat2} new dual quaternion + * @function + */ + +function fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) { + var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); + dq[0] = x1; + dq[1] = y1; + dq[2] = z1; + dq[3] = w1; + var ax = x2 * 0.5, + ay = y2 * 0.5, + az = z2 * 0.5; + dq[4] = ax * w1 + ay * z1 - az * y1; + dq[5] = ay * w1 + az * x1 - ax * z1; + dq[6] = az * w1 + ax * y1 - ay * x1; + dq[7] = -ax * x1 - ay * y1 - az * z1; + return dq; +} +/** + * Creates a dual quat from a quaternion and a translation + * + * @param {ReadonlyQuat2} dual quaternion receiving operation result + * @param {ReadonlyQuat} q a normalized quaternion + * @param {ReadonlyVec3} t tranlation vector + * @returns {quat2} dual quaternion receiving operation result + * @function + */ + +function fromRotationTranslation(out, q, t) { + var ax = t[0] * 0.5, + ay = t[1] * 0.5, + az = t[2] * 0.5, + bx = q[0], + by = q[1], + bz = q[2], + bw = q[3]; + out[0] = bx; + out[1] = by; + out[2] = bz; + out[3] = bw; + out[4] = ax * bw + ay * bz - az * by; + out[5] = ay * bw + az * bx - ax * bz; + out[6] = az * bw + ax * by - ay * bx; + out[7] = -ax * bx - ay * by - az * bz; + return out; +} +/** + * Creates a dual quat from a translation + * + * @param {ReadonlyQuat2} dual quaternion receiving operation result + * @param {ReadonlyVec3} t translation vector + * @returns {quat2} dual quaternion receiving operation result + * @function + */ + +function fromTranslation(out, t) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = t[0] * 0.5; + out[5] = t[1] * 0.5; + out[6] = t[2] * 0.5; + out[7] = 0; + return out; +} +/** + * Creates a dual quat from a quaternion + * + * @param {ReadonlyQuat2} dual quaternion receiving operation result + * @param {ReadonlyQuat} q the quaternion + * @returns {quat2} dual quaternion receiving operation result + * @function + */ + +function fromRotation(out, q) { + out[0] = q[0]; + out[1] = q[1]; + out[2] = q[2]; + out[3] = q[3]; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; +} +/** + * Creates a new dual quat from a matrix (4x4) + * + * @param {quat2} out the dual quaternion + * @param {ReadonlyMat4} a the matrix + * @returns {quat2} dual quat receiving operation result + * @function + */ + +function fromMat4(out, a) { + //TODO Optimize this + var outer = _quat_js__WEBPACK_IMPORTED_MODULE_1__.create(); + _mat4_js__WEBPACK_IMPORTED_MODULE_2__.getRotation(outer, a); + var t = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + _mat4_js__WEBPACK_IMPORTED_MODULE_2__.getTranslation(t, a); + fromRotationTranslation(out, outer, t); + return out; +} +/** + * Copy the values from one dual quat to another + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the source dual quaternion + * @returns {quat2} out + * @function + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + return out; +} +/** + * Set a dual quat to the identity dual quaternion + * + * @param {quat2} out the receiving quaternion + * @returns {quat2} out + */ + +function identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; +} +/** + * Set the components of a dual quat to the given values + * + * @param {quat2} out the receiving quaternion + * @param {Number} x1 X component + * @param {Number} y1 Y component + * @param {Number} z1 Z component + * @param {Number} w1 W component + * @param {Number} x2 X component + * @param {Number} y2 Y component + * @param {Number} z2 Z component + * @param {Number} w2 W component + * @returns {quat2} out + * @function + */ + +function set(out, x1, y1, z1, w1, x2, y2, z2, w2) { + out[0] = x1; + out[1] = y1; + out[2] = z1; + out[3] = w1; + out[4] = x2; + out[5] = y2; + out[6] = z2; + out[7] = w2; + return out; +} +/** + * Gets the real part of a dual quat + * @param {quat} out real part + * @param {ReadonlyQuat2} a Dual Quaternion + * @return {quat} real part + */ + +var getReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__.copy; +/** + * Gets the dual part of a dual quat + * @param {quat} out dual part + * @param {ReadonlyQuat2} a Dual Quaternion + * @return {quat} dual part + */ + +function getDual(out, a) { + out[0] = a[4]; + out[1] = a[5]; + out[2] = a[6]; + out[3] = a[7]; + return out; +} +/** + * Set the real component of a dual quat to the given quaternion + * + * @param {quat2} out the receiving quaternion + * @param {ReadonlyQuat} q a quaternion representing the real part + * @returns {quat2} out + * @function + */ + +var setReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__.copy; +/** + * Set the dual component of a dual quat to the given quaternion + * + * @param {quat2} out the receiving quaternion + * @param {ReadonlyQuat} q a quaternion representing the dual part + * @returns {quat2} out + * @function + */ + +function setDual(out, q) { + out[4] = q[0]; + out[5] = q[1]; + out[6] = q[2]; + out[7] = q[3]; + return out; +} +/** + * Gets the translation of a normalized dual quat + * @param {vec3} out translation + * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed + * @return {vec3} translation + */ + +function getTranslation(out, a) { + var ax = a[4], + ay = a[5], + az = a[6], + aw = a[7], + bx = -a[0], + by = -a[1], + bz = -a[2], + bw = a[3]; + out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + return out; +} +/** + * Translates a dual quat by the given vector + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to translate + * @param {ReadonlyVec3} v vector to translate by + * @returns {quat2} out + */ + +function translate(out, a, v) { + var ax1 = a[0], + ay1 = a[1], + az1 = a[2], + aw1 = a[3], + bx1 = v[0] * 0.5, + by1 = v[1] * 0.5, + bz1 = v[2] * 0.5, + ax2 = a[4], + ay2 = a[5], + az2 = a[6], + aw2 = a[7]; + out[0] = ax1; + out[1] = ay1; + out[2] = az1; + out[3] = aw1; + out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2; + out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2; + out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2; + out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2; + return out; +} +/** + * Rotates a dual quat around the X axis + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @param {number} rad how far should the rotation be + * @returns {quat2} out + */ + +function rotateX(out, a, rad) { + var bx = -a[0], + by = -a[1], + bz = -a[2], + bw = a[3], + ax = a[4], + ay = a[5], + az = a[6], + aw = a[7], + ax1 = ax * bw + aw * bx + ay * bz - az * by, + ay1 = ay * bw + aw * by + az * bx - ax * bz, + az1 = az * bw + aw * bz + ax * by - ay * bx, + aw1 = aw * bw - ax * bx - ay * by - az * bz; + _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateX(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; +} +/** + * Rotates a dual quat around the Y axis + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @param {number} rad how far should the rotation be + * @returns {quat2} out + */ + +function rotateY(out, a, rad) { + var bx = -a[0], + by = -a[1], + bz = -a[2], + bw = a[3], + ax = a[4], + ay = a[5], + az = a[6], + aw = a[7], + ax1 = ax * bw + aw * bx + ay * bz - az * by, + ay1 = ay * bw + aw * by + az * bx - ax * bz, + az1 = az * bw + aw * bz + ax * by - ay * bx, + aw1 = aw * bw - ax * bx - ay * by - az * bz; + _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateY(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; +} +/** + * Rotates a dual quat around the Z axis + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @param {number} rad how far should the rotation be + * @returns {quat2} out + */ + +function rotateZ(out, a, rad) { + var bx = -a[0], + by = -a[1], + bz = -a[2], + bw = a[3], + ax = a[4], + ay = a[5], + az = a[6], + aw = a[7], + ax1 = ax * bw + aw * bx + ay * bz - az * by, + ay1 = ay * bw + aw * by + az * bx - ax * bz, + az1 = az * bw + aw * bz + ax * by - ay * bx, + aw1 = aw * bw - ax * bx - ay * by - az * bz; + _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateZ(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; +} +/** + * Rotates a dual quat by a given quaternion (a * q) + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @param {ReadonlyQuat} q quaternion to rotate by + * @returns {quat2} out + */ + +function rotateByQuatAppend(out, a, q) { + var qx = q[0], + qy = q[1], + qz = q[2], + qw = q[3], + ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + out[0] = ax * qw + aw * qx + ay * qz - az * qy; + out[1] = ay * qw + aw * qy + az * qx - ax * qz; + out[2] = az * qw + aw * qz + ax * qy - ay * qx; + out[3] = aw * qw - ax * qx - ay * qy - az * qz; + ax = a[4]; + ay = a[5]; + az = a[6]; + aw = a[7]; + out[4] = ax * qw + aw * qx + ay * qz - az * qy; + out[5] = ay * qw + aw * qy + az * qx - ax * qz; + out[6] = az * qw + aw * qz + ax * qy - ay * qx; + out[7] = aw * qw - ax * qx - ay * qy - az * qz; + return out; +} +/** + * Rotates a dual quat by a given quaternion (q * a) + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat} q quaternion to rotate by + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @returns {quat2} out + */ + +function rotateByQuatPrepend(out, q, a) { + var qx = q[0], + qy = q[1], + qz = q[2], + qw = q[3], + bx = a[0], + by = a[1], + bz = a[2], + bw = a[3]; + out[0] = qx * bw + qw * bx + qy * bz - qz * by; + out[1] = qy * bw + qw * by + qz * bx - qx * bz; + out[2] = qz * bw + qw * bz + qx * by - qy * bx; + out[3] = qw * bw - qx * bx - qy * by - qz * bz; + bx = a[4]; + by = a[5]; + bz = a[6]; + bw = a[7]; + out[4] = qx * bw + qw * bx + qy * bz - qz * by; + out[5] = qy * bw + qw * by + qz * bx - qx * bz; + out[6] = qz * bw + qw * bz + qx * by - qy * bx; + out[7] = qw * bw - qx * bx - qy * by - qz * bz; + return out; +} +/** + * Rotates a dual quat around a given axis. Does the normalisation automatically + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @param {ReadonlyVec3} axis the axis to rotate around + * @param {Number} rad how far the rotation should be + * @returns {quat2} out + */ + +function rotateAroundAxis(out, a, axis, rad) { + //Special case for rad = 0 + if (Math.abs(rad) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + return copy(out, a); + } + + var axisLength = Math.hypot(axis[0], axis[1], axis[2]); + rad = rad * 0.5; + var s = Math.sin(rad); + var bx = s * axis[0] / axisLength; + var by = s * axis[1] / axisLength; + var bz = s * axis[2] / axisLength; + var bw = Math.cos(rad); + var ax1 = a[0], + ay1 = a[1], + az1 = a[2], + aw1 = a[3]; + out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + var ax = a[4], + ay = a[5], + az = a[6], + aw = a[7]; + out[4] = ax * bw + aw * bx + ay * bz - az * by; + out[5] = ay * bw + aw * by + az * bx - ax * bz; + out[6] = az * bw + aw * bz + ax * by - ay * bx; + out[7] = aw * bw - ax * bx - ay * by - az * bz; + return out; +} +/** + * Adds two dual quat's + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the first operand + * @param {ReadonlyQuat2} b the second operand + * @returns {quat2} out + * @function + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + return out; +} +/** + * Multiplies two dual quat's + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the first operand + * @param {ReadonlyQuat2} b the second operand + * @returns {quat2} out + */ + +function multiply(out, a, b) { + var ax0 = a[0], + ay0 = a[1], + az0 = a[2], + aw0 = a[3], + bx1 = b[4], + by1 = b[5], + bz1 = b[6], + bw1 = b[7], + ax1 = a[4], + ay1 = a[5], + az1 = a[6], + aw1 = a[7], + bx0 = b[0], + by0 = b[1], + bz0 = b[2], + bw0 = b[3]; + out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0; + out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0; + out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0; + out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0; + out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0; + out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0; + out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0; + out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0; + return out; +} +/** + * Alias for {@link quat2.multiply} + * @function + */ + +var mul = multiply; +/** + * Scales a dual quat by a scalar number + * + * @param {quat2} out the receiving dual quat + * @param {ReadonlyQuat2} a the dual quat to scale + * @param {Number} b amount to scale the dual quat by + * @returns {quat2} out + * @function + */ + +function scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + return out; +} +/** + * Calculates the dot product of two dual quat's (The dot product of the real parts) + * + * @param {ReadonlyQuat2} a the first operand + * @param {ReadonlyQuat2} b the second operand + * @returns {Number} dot product of a and b + * @function + */ + +var dot = _quat_js__WEBPACK_IMPORTED_MODULE_1__.dot; +/** + * Performs a linear interpolation between two dual quats's + * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5) + * + * @param {quat2} out the receiving dual quat + * @param {ReadonlyQuat2} a the first operand + * @param {ReadonlyQuat2} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {quat2} out + */ + +function lerp(out, a, b, t) { + var mt = 1 - t; + if (dot(a, b) < 0) t = -t; + out[0] = a[0] * mt + b[0] * t; + out[1] = a[1] * mt + b[1] * t; + out[2] = a[2] * mt + b[2] * t; + out[3] = a[3] * mt + b[3] * t; + out[4] = a[4] * mt + b[4] * t; + out[5] = a[5] * mt + b[5] * t; + out[6] = a[6] * mt + b[6] * t; + out[7] = a[7] * mt + b[7] * t; + return out; +} +/** + * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a dual quat to calculate inverse of + * @returns {quat2} out + */ + +function invert(out, a) { + var sqlen = squaredLength(a); + out[0] = -a[0] / sqlen; + out[1] = -a[1] / sqlen; + out[2] = -a[2] / sqlen; + out[3] = a[3] / sqlen; + out[4] = -a[4] / sqlen; + out[5] = -a[5] / sqlen; + out[6] = -a[6] / sqlen; + out[7] = a[7] / sqlen; + return out; +} +/** + * Calculates the conjugate of a dual quat + * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result. + * + * @param {quat2} out the receiving quaternion + * @param {ReadonlyQuat2} a quat to calculate conjugate of + * @returns {quat2} out + */ + +function conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + out[4] = -a[4]; + out[5] = -a[5]; + out[6] = -a[6]; + out[7] = a[7]; + return out; +} +/** + * Calculates the length of a dual quat + * + * @param {ReadonlyQuat2} a dual quat to calculate length of + * @returns {Number} length of a + * @function + */ + +var length = _quat_js__WEBPACK_IMPORTED_MODULE_1__.length; +/** + * Alias for {@link quat2.length} + * @function + */ + +var len = length; +/** + * Calculates the squared length of a dual quat + * + * @param {ReadonlyQuat2} a dual quat to calculate squared length of + * @returns {Number} squared length of a + * @function + */ + +var squaredLength = _quat_js__WEBPACK_IMPORTED_MODULE_1__.squaredLength; +/** + * Alias for {@link quat2.squaredLength} + * @function + */ + +var sqrLen = squaredLength; +/** + * Normalize a dual quat + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a dual quaternion to normalize + * @returns {quat2} out + * @function + */ + +function normalize(out, a) { + var magnitude = squaredLength(a); + + if (magnitude > 0) { + magnitude = Math.sqrt(magnitude); + var a0 = a[0] / magnitude; + var a1 = a[1] / magnitude; + var a2 = a[2] / magnitude; + var a3 = a[3] / magnitude; + var b0 = a[4]; + var b1 = a[5]; + var b2 = a[6]; + var b3 = a[7]; + var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = (b0 - a0 * a_dot_b) / magnitude; + out[5] = (b1 - a1 * a_dot_b) / magnitude; + out[6] = (b2 - a2 * a_dot_b) / magnitude; + out[7] = (b3 - a3 * a_dot_b) / magnitude; + } + + return out; +} +/** + * Returns a string representation of a dual quatenion + * + * @param {ReadonlyQuat2} a dual quaternion to represent as a string + * @returns {String} string representation of the dual quat + */ + +function str(a) { + return "quat2(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ")"; +} +/** + * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyQuat2} a the first dual quaternion. + * @param {ReadonlyQuat2} b the second dual quaternion. + * @returns {Boolean} true if the dual quaternions are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7]; +} +/** + * Returns whether or not the dual quaternions have approximately the same elements in the same position. + * + * @param {ReadonlyQuat2} a the first dual quat. + * @param {ReadonlyQuat2} b the second dual quat. + * @returns {Boolean} true if the dual quats are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5], + a6 = a[6], + a7 = a[7]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3], + b4 = b[4], + b5 = b[5], + b6 = b[6], + b7 = b[7]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)); +} + +/***/ }), +/* 17 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "divide": () => (/* binding */ divide), +/* harmony export */ "ceil": () => (/* binding */ ceil), +/* harmony export */ "floor": () => (/* binding */ floor), +/* harmony export */ "min": () => (/* binding */ min), +/* harmony export */ "max": () => (/* binding */ max), +/* harmony export */ "round": () => (/* binding */ round), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), +/* harmony export */ "distance": () => (/* binding */ distance), +/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), +/* harmony export */ "length": () => (/* binding */ length), +/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), +/* harmony export */ "negate": () => (/* binding */ negate), +/* harmony export */ "inverse": () => (/* binding */ inverse), +/* harmony export */ "normalize": () => (/* binding */ normalize), +/* harmony export */ "dot": () => (/* binding */ dot), +/* harmony export */ "cross": () => (/* binding */ cross), +/* harmony export */ "lerp": () => (/* binding */ lerp), +/* harmony export */ "random": () => (/* binding */ random), +/* harmony export */ "transformMat2": () => (/* binding */ transformMat2), +/* harmony export */ "transformMat2d": () => (/* binding */ transformMat2d), +/* harmony export */ "transformMat3": () => (/* binding */ transformMat3), +/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), +/* harmony export */ "rotate": () => (/* binding */ rotate), +/* harmony export */ "angle": () => (/* binding */ angle), +/* harmony export */ "zero": () => (/* binding */ zero), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "len": () => (/* binding */ len), +/* harmony export */ "sub": () => (/* binding */ sub), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "div": () => (/* binding */ div), +/* harmony export */ "dist": () => (/* binding */ dist), +/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), +/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), +/* harmony export */ "forEach": () => (/* binding */ forEach) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); + +/** + * 2 Dimensional Vector + * @module vec2 + */ + +/** + * Creates a new, empty vec2 + * + * @returns {vec2} a new 2D vector + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[0] = 0; + out[1] = 0; + } + + return out; +} +/** + * Creates a new vec2 initialized with values from an existing vector + * + * @param {ReadonlyVec2} a vector to clone + * @returns {vec2} a new 2D vector + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); + out[0] = a[0]; + out[1] = a[1]; + return out; +} +/** + * Creates a new vec2 initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @returns {vec2} a new 2D vector + */ + +function fromValues(x, y) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); + out[0] = x; + out[1] = y; + return out; +} +/** + * Copy the values from one vec2 to another + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the source vector + * @returns {vec2} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + return out; +} +/** + * Set the components of a vec2 to the given values + * + * @param {vec2} out the receiving vector + * @param {Number} x X component + * @param {Number} y Y component + * @returns {vec2} out + */ + +function set(out, x, y) { + out[0] = x; + out[1] = y; + return out; +} +/** + * Adds two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + return out; +} +/** + * Subtracts vector b from vector a + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + return out; +} +/** + * Multiplies two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + return out; +} +/** + * Divides two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + return out; +} +/** + * Math.ceil the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to ceil + * @returns {vec2} out + */ + +function ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + return out; +} +/** + * Math.floor the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to floor + * @returns {vec2} out + */ + +function floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + return out; +} +/** + * Returns the minimum of two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + return out; +} +/** + * Returns the maximum of two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + return out; +} +/** + * Math.round the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to round + * @returns {vec2} out + */ + +function round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + return out; +} +/** + * Scales a vec2 by a scalar number + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {vec2} out + */ + +function scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + return out; +} +/** + * Adds two vec2's after scaling the second operand by a scalar value + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @param {Number} scale the amount to scale b by before adding + * @returns {vec2} out + */ + +function scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + return out; +} +/** + * Calculates the euclidian distance between two vec2's + * + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {Number} distance between a and b + */ + +function distance(a, b) { + var x = b[0] - a[0], + y = b[1] - a[1]; + return Math.hypot(x, y); +} +/** + * Calculates the squared euclidian distance between two vec2's + * + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {Number} squared distance between a and b + */ + +function squaredDistance(a, b) { + var x = b[0] - a[0], + y = b[1] - a[1]; + return x * x + y * y; +} +/** + * Calculates the length of a vec2 + * + * @param {ReadonlyVec2} a vector to calculate length of + * @returns {Number} length of a + */ + +function length(a) { + var x = a[0], + y = a[1]; + return Math.hypot(x, y); +} +/** + * Calculates the squared length of a vec2 + * + * @param {ReadonlyVec2} a vector to calculate squared length of + * @returns {Number} squared length of a + */ + +function squaredLength(a) { + var x = a[0], + y = a[1]; + return x * x + y * y; +} +/** + * Negates the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to negate + * @returns {vec2} out + */ + +function negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + return out; +} +/** + * Returns the inverse of the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to invert + * @returns {vec2} out + */ + +function inverse(out, a) { + out[0] = 1.0 / a[0]; + out[1] = 1.0 / a[1]; + return out; +} +/** + * Normalize a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to normalize + * @returns {vec2} out + */ + +function normalize(out, a) { + var x = a[0], + y = a[1]; + var len = x * x + y * y; + + if (len > 0) { + //TODO: evaluate use of glm_invsqrt here? + len = 1 / Math.sqrt(len); + } + + out[0] = a[0] * len; + out[1] = a[1] * len; + return out; +} +/** + * Calculates the dot product of two vec2's + * + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {Number} dot product of a and b + */ + +function dot(a, b) { + return a[0] * b[0] + a[1] * b[1]; +} +/** + * Computes the cross product of two vec2's + * Note that the cross product must by definition produce a 3D vector + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec3} out + */ + +function cross(out, a, b) { + var z = a[0] * b[1] - a[1] * b[0]; + out[0] = out[1] = 0; + out[2] = z; + return out; +} +/** + * Performs a linear interpolation between two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {vec2} out + */ + +function lerp(out, a, b, t) { + var ax = a[0], + ay = a[1]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + return out; +} +/** + * Generates a random vector with the given scale + * + * @param {vec2} out the receiving vector + * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns {vec2} out + */ + +function random(out, scale) { + scale = scale || 1.0; + var r = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 * Math.PI; + out[0] = Math.cos(r) * scale; + out[1] = Math.sin(r) * scale; + return out; +} +/** + * Transforms the vec2 with a mat2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the vector to transform + * @param {ReadonlyMat2} m matrix to transform with + * @returns {vec2} out + */ + +function transformMat2(out, a, m) { + var x = a[0], + y = a[1]; + out[0] = m[0] * x + m[2] * y; + out[1] = m[1] * x + m[3] * y; + return out; +} +/** + * Transforms the vec2 with a mat2d + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the vector to transform + * @param {ReadonlyMat2d} m matrix to transform with + * @returns {vec2} out + */ + +function transformMat2d(out, a, m) { + var x = a[0], + y = a[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; +} +/** + * Transforms the vec2 with a mat3 + * 3rd vector component is implicitly '1' + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the vector to transform + * @param {ReadonlyMat3} m matrix to transform with + * @returns {vec2} out + */ + +function transformMat3(out, a, m) { + var x = a[0], + y = a[1]; + out[0] = m[0] * x + m[3] * y + m[6]; + out[1] = m[1] * x + m[4] * y + m[7]; + return out; +} +/** + * Transforms the vec2 with a mat4 + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the vector to transform + * @param {ReadonlyMat4} m matrix to transform with + * @returns {vec2} out + */ + +function transformMat4(out, a, m) { + var x = a[0]; + var y = a[1]; + out[0] = m[0] * x + m[4] * y + m[12]; + out[1] = m[1] * x + m[5] * y + m[13]; + return out; +} +/** + * Rotate a 2D vector + * @param {vec2} out The receiving vec2 + * @param {ReadonlyVec2} a The vec2 point to rotate + * @param {ReadonlyVec2} b The origin of the rotation + * @param {Number} rad The angle of rotation in radians + * @returns {vec2} out + */ + +function rotate(out, a, b, rad) { + //Translate point to the origin + var p0 = a[0] - b[0], + p1 = a[1] - b[1], + sinC = Math.sin(rad), + cosC = Math.cos(rad); //perform rotation and translate to correct position + + out[0] = p0 * cosC - p1 * sinC + b[0]; + out[1] = p0 * sinC + p1 * cosC + b[1]; + return out; +} +/** + * Get the angle between two 2D vectors + * @param {ReadonlyVec2} a The first operand + * @param {ReadonlyVec2} b The second operand + * @returns {Number} The angle in radians + */ + +function angle(a, b) { + var x1 = a[0], + y1 = a[1], + x2 = b[0], + y2 = b[1], + // mag is the product of the magnitudes of a and b + mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2), + // mag &&.. short circuits if mag == 0 + cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1 + + return Math.acos(Math.min(Math.max(cosine, -1), 1)); +} +/** + * Set the components of a vec2 to zero + * + * @param {vec2} out the receiving vector + * @returns {vec2} out + */ + +function zero(out) { + out[0] = 0.0; + out[1] = 0.0; + return out; +} +/** + * Returns a string representation of a vector + * + * @param {ReadonlyVec2} a vector to represent as a string + * @returns {String} string representation of the vector + */ + +function str(a) { + return "vec2(" + a[0] + ", " + a[1] + ")"; +} +/** + * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===) + * + * @param {ReadonlyVec2} a The first vector. + * @param {ReadonlyVec2} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1]; +} +/** + * Returns whether or not the vectors have approximately the same elements in the same position. + * + * @param {ReadonlyVec2} a The first vector. + * @param {ReadonlyVec2} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1]; + var b0 = b[0], + b1 = b[1]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)); +} +/** + * Alias for {@link vec2.length} + * @function + */ + +var len = length; +/** + * Alias for {@link vec2.subtract} + * @function + */ + +var sub = subtract; +/** + * Alias for {@link vec2.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link vec2.divide} + * @function + */ + +var div = divide; +/** + * Alias for {@link vec2.distance} + * @function + */ + +var dist = distance; +/** + * Alias for {@link vec2.squaredDistance} + * @function + */ + +var sqrDist = squaredDistance; +/** + * Alias for {@link vec2.squaredLength} + * @function + */ + +var sqrLen = squaredLength; +/** + * Perform some operation over an array of vec2s. + * + * @param {Array} a the array of vectors to iterate over + * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed + * @param {Number} offset Number of elements to skip at the beginning of the array + * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array + * @param {Function} fn Function to call for each vector in the array + * @param {Object} [arg] additional argument to pass to fn + * @returns {Array} a + * @function + */ + +var forEach = function () { + var vec = create(); + return function (a, stride, offset, count, fn, arg) { + var i, l; + + if (!stride) { + stride = 2; } - /** - * Return buffer - * - * @returns {(Float32Array | undefined)} - */ - getBuffer() { - return this.buffer; + + if (!offset) { + offset = 0; + } + + if (count) { + l = Math.min(count * stride + offset, a.length); + } else { + l = a.length; } + + for (i = offset; i < l; i += stride) { + vec[0] = a[i]; + vec[1] = a[i + 1]; + fn(vec, vec, arg); + a[i] = vec[0]; + a[i + 1] = vec[1]; + } + + return a; + }; +}(); + +/***/ }), +/* 18 */ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__webpack_require__(19), exports); +__exportStar(__webpack_require__(20), exports); +__exportStar(__webpack_require__(21), exports); +__exportStar(__webpack_require__(22), exports); +__exportStar(__webpack_require__(23), exports); +__exportStar(__webpack_require__(24), exports); +__exportStar(__webpack_require__(25), exports); +__exportStar(__webpack_require__(26), exports); +//# sourceMappingURL=index.js.map + +/***/ }), +/* 19 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=indexedBuffer.js.map + +/***/ }), +/* 20 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=propArguments.js.map + +/***/ }), +/* 21 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ERepetitionType = void 0; +/** + * Repetition type enumerator. + * + * @category Core.Repetition + * @internal + */ +var ERepetitionType; +(function (ERepetitionType) { /** - * Return indexed buffer - * - * @returns {(Array> | undefined)} + * Defines the type of repetition of the shape, + * in a circular way starting from the center of the scene + * @order 1 */ - getIndexedBuffer() { - return this.indexedBuffer; - } + ERepetitionType[ERepetitionType["Ring"] = 1] = "Ring"; /** - * Return number of encapsulation - * - * @param {IBufferIndex} index - * @returns {number} + * Defines the type of repetition of the shape, + * on a nxm grid starting from the center of the scene + * @order 2 */ - static getIndexParentLevel(index) { - if (typeof index.parent === 'undefined') - return 0; - let currentParent = index.parent; - let currentParentLevel = 1; - while (typeof currentParent.parent !== 'undefined') { - currentParentLevel++; - currentParent = currentParent.parent; - } - return currentParentLevel; - } + ERepetitionType[ERepetitionType["Matrix"] = 2] = "Matrix"; +})(ERepetitionType = exports.ERepetitionType || (exports.ERepetitionType = {})); +//# sourceMappingURL=repetitions.js.map + +/***/ }), +/* 22 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=scene-child.js.map + +/***/ }), +/* 23 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=scene.js.map + +/***/ }), +/* 24 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.EBoundingType = void 0; +var EBoundingType; +(function (EBoundingType) { /** - * Stream buffer - * - * @param {(TStreamCallback} callback + * Relative to the real bounding of the shape + * @order 2 */ - stream(callback) { - if (this.buffer && this.indexedBuffer) { - for (let i = 0, j = 0, len = this.indexedBuffer.length; i < len; i++) { - const currentIndexing = this.indexedBuffer[i]; - callback({ - buffer: this.buffer, - frameLength: currentIndexing.frameLength, - frameBufferIndex: j, - currentIndexing: currentIndexing, - currentShapeIndex: i, - totalShapes: len, - }); - j += currentIndexing.frameLength; - } - } - } + EBoundingType[EBoundingType["Relative"] = 1] = "Relative"; /** - * Return empty propArguments - * - * @static - * @param {ShapeBase} shape - * @return {*} {PropArguments} + * Fixed to te width and height of the shape + * @order 3 */ - static getEmptyPropArguments(shape, parentPropArguments) { - const repetition = { - type: types_1.ERepetitionType.Ring, - angle: 0, - index: 1, - offset: 1, - count: 1, - row: { index: 1, offset: 1, count: 1 }, - col: { index: 1, offset: 1, count: 1 }, - }; - return { - repetition, - shape, - parent: parentPropArguments, - }; - } -} -exports.ShapeBase = ShapeBase; -/** - * Empty buffer - * - * @internal - * @ignore - */ -ShapeBase.EMPTY_BUFFER = new Float32Array(0); -/** - * Empty BaseRepetition - * - * @internal - * @ignore - */ -ShapeBase.getEmptySimpleRepetition = () => ({ - index: 1, - offset: 1, - count: 1, -}); -/** - * Empty Repetition - * - * @internal - * @ignore - */ -ShapeBase.getEmptyRepetition = () => ({ - type: types_1.ERepetitionType.Ring, - angle: 0, - ...ShapeBase.getEmptySimpleRepetition(), - row: ShapeBase.getEmptySimpleRepetition(), - col: ShapeBase.getEmptySimpleRepetition(), -}); -//# sourceMappingURL=ShapeBase.js.map + EBoundingType[EBoundingType["Fixed"] = 2] = "Fixed"; +})(EBoundingType = exports.EBoundingType || (exports.EBoundingType = {})); +//# sourceMappingURL=shape-base.js.map + +/***/ }), +/* 25 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +////// +//# sourceMappingURL=shape-primitives.js.map + +/***/ }), +/* 26 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +// Shape +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=shapes.js.map /***/ }), /* 27 */ @@ -9239,7 +9245,7 @@ ShapeBase.getEmptyRepetition = () => ({ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.toVec3 = exports.toVec2 = exports.fromSkew = exports.VEC2_ONE = exports.VEC2_ZERO = exports.VEC3_ONE = exports.VEC3_ZERO = void 0; -const gl_matrix_1 = __webpack_require__(12); +const gl_matrix_1 = __webpack_require__(7); exports.VEC3_ZERO = [0, 0, 0]; exports.VEC3_ONE = [1, 1, 1]; exports.VEC2_ZERO = [0, 0]; @@ -9752,7 +9758,7 @@ exports.Modifier = Modifier; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.distributePointsInBuffer = exports.interpolate = exports.prepareBufferForInterpolation = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.relativeClamp = exports.clamp = exports.lerp = exports.toRadians = exports.toDegrees = exports.now = void 0; const SimplexNoise = __webpack_require__(33); -const repetitions_1 = __webpack_require__(6); +const repetitions_1 = __webpack_require__(21); const Vec2_1 = __webpack_require__(28); // isDef: (object: any): boolean => typeof object !== 'undefined' && object !== null, const measurement = typeof performance !== 'undefined' ? performance : Date; @@ -10598,9 +10604,9 @@ Better rank ordering method by Stefan Gustavson in 2012. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Shape = void 0; -const Scene_1 = __webpack_require__(23); -const SceneChild_1 = __webpack_require__(24); -const ShapeBase_1 = __webpack_require__(26); +const Scene_1 = __webpack_require__(3); +const SceneChild_1 = __webpack_require__(4); +const ShapeBase_1 = __webpack_require__(6); /** * Container of ShapeBase or Group, it applies transformations on each repetition * @@ -10785,7 +10791,7 @@ exports.Shape = Shape; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ShapePrimitive = void 0; const glme = __webpack_require__(27); -const ShapeBase_1 = __webpack_require__(26); +const ShapeBase_1 = __webpack_require__(6); const Modifier_1 = __webpack_require__(31); const Adapt_1 = __webpack_require__(30); /** @@ -10939,7 +10945,7 @@ exports.ShapeLoop = void 0; const math_1 = __webpack_require__(29); const Adapt_1 = __webpack_require__(30); const ShapePrimitive_1 = __webpack_require__(35); -const ShapeBase_1 = __webpack_require__(26); +const ShapeBase_1 = __webpack_require__(6); /** * Shape Loop * @@ -15466,20 +15472,12 @@ exports.fit = fit; /******/ })(); /******/ /************************************************************************/ -var __webpack_exports__ = {}; -// This entry need to be wrapped in an IIFE because it need to be in strict mode. -(() => { -"use strict"; -var exports = __webpack_exports__; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Urpflanze = void 0; -const Urpflanze = __webpack_require__(1); -exports.Urpflanze = Urpflanze; -exports.default = Urpflanze; -//# sourceMappingURL=index-light.js.map -})(); - +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module is referenced by other modules so it can't be inlined +/******/ var __webpack_exports__ = __webpack_require__(0); +/******/ /******/ return __webpack_exports__; /******/ })() ; diff --git a/build/umd/urpflanze-light.js.map b/build/umd/urpflanze-light.js.map index 47d9c7d..d47a4e0 100644 --- a/build/umd/urpflanze-light.js.map +++ b/build/umd/urpflanze-light.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://Urpflanze/webpack/universalModuleDefinition","webpack://Urpflanze/./dist/cjs/modules-light.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/index.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/index.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/indexedBuffer.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/propArguments.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/repetitions.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/scene-child.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/scene.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/shape-base.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/shape-primitives.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/shapes.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/index.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/common.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/mat2.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/mat2d.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/mat3.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/mat4.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/quat.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/vec4.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/vec3.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/quat2.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/vec2.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/Scene.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/SceneChild.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/Group.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeBase.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/math/gl-matrix-extensions.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/math/Vec2.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/math/index.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Adapt.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Modifier.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/Utilities.js","webpack://Urpflanze/./node_modules/simplex-noise/simplex-noise.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/Shape.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapePrimitive.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeLoop.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeBuffer.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeRecursive.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeFollow.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Line.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Triangle.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Rect.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Polygon.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Circle.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Star.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Rose.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Spiral.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Lissajous.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/SuperShape.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/index.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Mirror.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Smooth.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Close.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Solidify.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Subdivide.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Offset.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/index.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/types.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/utilities.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/createAnimation.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/createInterpolator.js","webpack://Urpflanze/./node_modules/@urpflanze/color/dist/cjs/index.js","webpack://Urpflanze/./node_modules/@urpflanze/color/dist/cjs/types.js","webpack://Urpflanze/./node_modules/@urpflanze/color/dist/cjs/conversions.js","webpack://Urpflanze/./node_modules/@urpflanze/color/dist/cjs/parsing.js","webpack://Urpflanze/./node_modules/@urpflanze/color/dist/cjs/htmlcolors.js","webpack://Urpflanze/./node_modules/bezier-easing/src/index.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/Easings.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/Animation.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/composeAnimations.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/browser/BrowserDrawerCanvas.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/DrawerCanvas.js","webpack://Urpflanze/./node_modules/canvas/browser.js","webpack://Urpflanze/./node_modules/canvas/lib/parse-font.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/Emitter.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/Timeline.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/utils.js","webpack://Urpflanze/webpack/bootstrap","webpack://Urpflanze/webpack/runtime/define property getters","webpack://Urpflanze/webpack/runtime/hasOwnProperty shorthand","webpack://Urpflanze/webpack/runtime/make namespace object","webpack://Urpflanze/./dist/cjs/index-light.js"],"names":[],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;ACVa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,oBAAoB,GAAG,iBAAiB;AACxC,aAAa,mBAAO,CAAC,CAA0B;AAC/C,2CAA4D;AAC5D,4BAA4B,mBAAO,CAAC,EAA+D;AACnG,gDAA+C,CAAC,qCAAqC,kDAAkD,EAAE,EAAE,EAAC;AAC5I,yC;;;;;;;ACjBa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,YAAY,GAAG,gCAAgC,GAAG,qCAAqC,GAAG,mBAAmB,GAAG,8BAA8B,GAAG,4BAA4B,GAAG,2BAA2B,GAAG,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,qBAAqB,GAAG,aAAa,GAAG,YAAY;AACjZ;AACA;AACA;AACA,aAAa,mBAAO,CAAC,CAAS;AAC9B;AACA,oBAAoB,mBAAO,CAAC,EAAW;AACvC;AACA;AACA;AACA;AACA,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAc;AACnC,aAAa,mBAAO,CAAC,EAAS;AAC9B;AACA,aAAa,mBAAO,CAAC,EAAoB;AACzC,aAAa,mBAAO,CAAC,EAAyB;AAC9C,aAAa,mBAAO,CAAC,EAAoB;AACzC,aAAa,mBAAO,CAAC,EAAsB;AAC3C,aAAa,mBAAO,CAAC,EAAgB;AACrC,aAAa,mBAAO,CAAC,EAAyB;AAC9C,aAAa,mBAAO,CAAC,EAAsB;AAC3C,aAAa,mBAAO,CAAC,EAA0B;AAC/C,aAAa,mBAAO,CAAC,EAA8B;AACnD,aAAa,mBAAO,CAAC,EAA0B;AAC/C,aAAa,mBAAO,CAAC,EAA6B;AAClD,aAAa,mBAAO,CAAC,EAA4B;AACjD,aAAa,mBAAO,CAAC,EAA0B;AAC/C,aAAa,mBAAO,CAAC,EAA0B;AAC/C,aAAa,mBAAO,CAAC,EAA4B;AACjD,aAAa,mBAAO,CAAC,EAA+B;AACpD,aAAa,mBAAO,CAAC,EAAgC;AACrD;AACA,aAAa,mBAAO,CAAC,EAAsB;AAC3C,aAAa,mBAAO,CAAC,EAAa;AAClC;AACA,kBAAkB,mBAAO,CAAC,EAAa;AACvC,wCAAuC,CAAC,qCAAqC,yBAAyB,EAAE,EAAE,EAAC;AAC3G,yCAAwC,CAAC,qCAAqC,0BAA0B,EAAE,EAAE,EAAC;AAC7G,iDAAgD,CAAC,qCAAqC,kCAAkC,EAAE,EAAE,EAAC;AAC7H,6CAA4C,CAAC,qCAAqC,8BAA8B,EAAE,EAAE,EAAC;AACrH,6CAA4C,CAAC,qCAAqC,8BAA8B,EAAE,EAAE,EAAC;AACrH,uCAAsC,CAAC,qCAAqC,wBAAwB,EAAE,EAAE,EAAC;AACzG,yCAAwC,CAAC,qCAAqC,0BAA0B,EAAE,EAAE,EAAC;AAC7G,0CAAyC,CAAC,qCAAqC,2BAA2B,EAAE,EAAE,EAAC;AAC/G,uDAAsD,CAAC,qCAAqC,wCAAwC,EAAE,EAAE,EAAC;AACzI,wDAAuD,CAAC,qCAAqC,yCAAyC,EAAE,EAAE,EAAC;AAC3I,0DAAyD,CAAC,qCAAqC,2CAA2C,EAAE,EAAE,EAAC;AAC/I,+CAA8C,CAAC,qCAAqC,gCAAgC,EAAE,EAAE,EAAC;AACzH,iEAAgE,CAAC,qCAAqC,kDAAkD,EAAE,EAAE,EAAC;AAC7J,4DAA2D,CAAC,qCAAqC,6CAA6C,EAAE,EAAE,EAAC;AACnJ,aAAa,mBAAO,CAAC,EAAa;AAClC,wCAAuC,CAAC,qCAAqC,uBAAuB,EAAE,EAAE,EAAC;AACzG,aAAa,mBAAO,CAAC,EAAQ;AAC7B,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,iC;;;;;;;ACtEa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,CAAiB;AACtC,aAAa,mBAAO,CAAC,CAAiB;AACtC,aAAa,mBAAO,CAAC,CAAe;AACpC,aAAa,mBAAO,CAAC,CAAe;AACpC,aAAa,mBAAO,CAAC,CAAS;AAC9B,aAAa,mBAAO,CAAC,CAAc;AACnC,aAAa,mBAAO,CAAC,EAAoB;AACzC,aAAa,mBAAO,CAAC,EAAU;AAC/B,iC;;;;;;;ACpBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD,uBAAuB,KAAK;AAC7E,uC;;;;;;;ACxBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C,qBAAqB,KAAK;AACvE,sC;;;;;;;AChBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA,4C;;;;;;;ACHa;AACb;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACHwC;AACN;AACE;AACF;AACA;AACA;AACE;AACF;AACA;AACA;;;;;;;;;;;;;;;;;ACTlC;AACA;AACA;AACA;AACA;AACO;AACA;AACA;AACP;AACA;AACA;AACA,WAAW,2CAA2C;AACtD;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjDwC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA,gBAAgB;;AAEhB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AAC7S;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC/aiC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACvd;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACreiC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACttB;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzwBiC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY,+CAAgB;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA,YAAY,+CAAgB;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP,wBAAwB,kDAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;;AAExD;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,YAAY,KAAK;AACjB;;AAEO;AACP,oBAAoB,kDAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,+CAAgB,+BAA+B,+CAAgB,+BAA+B,+CAAgB;AAC/I;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,uEAAuE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB;AAC/zC;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrxDiC;AACN;AACA;AACA;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,OAAO;AACnB;;AAEO;AACP;AACA;;AAEA,UAAU,+CAAgB;AAC1B;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,aAAa;AACzB,YAAY,aAAa;AACzB,YAAY,OAAO;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;;AAE1C,gDAAgD;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH,oBAAoB,+CAAgB;AACpC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA,WAAW,8CAAe;AAC1B,WAAW,8CAAe;AAC1B,WAAW,8CAAe;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,mCAAmC;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAoC;;AAEpC;AACA,wBAAwB;;AAExB;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,EAAE;AACb,WAAW,EAAE;AACb,WAAW,EAAE;AACb,aAAa,KAAK;AAClB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,YAAY,2CAAU;AAC7B;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,iBAAiB,gDAAe;AACvC;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,WAAW,0CAAS;AAC3B;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,YAAY,2CAAU;AAC7B;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,WAAW,0CAAS;AAC3B;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO,aAAa,4CAAW;AAC/B;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;AACA;;AAEO,oBAAoB,mDAAkB;AAC7C;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,gBAAgB,+CAAc;AACrC;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO,kBAAkB,iDAAgB;AACzC;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO,aAAa,4CAAW;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,4CAAW;AAC3B,kBAAkB,gDAAe;AACjC,kBAAkB,gDAAe;AACjC;AACA,cAAc,yCAAQ;;AAEtB;AACA,MAAM,2CAAU;AAChB,UAAU,yCAAQ,sBAAsB,2CAAU;AAClD,MAAM,+CAAc;AACpB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,MAAM,2CAAU;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,aAAa,4CAAW;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrsBuC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,uBAAuB;AACvB;AACA;;AAEA;AACA;;AAEA;AACA,SAAS,8CAAe;AACxB,SAAS,8CAAe;AACxB;AACA,GAAG;;AAEH;AACA,SAAS,8CAAe;AACxB,SAAS,8CAAe;AACxB;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;;AAEhB;AACA;AACA;AACA,qCAAqC;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AAC7S;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtpBuC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,UAAU,8CAAe;AACzB,UAAU,8CAAe;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;;AAEA;AACA;AACA,4BAA4B;;AAE5B;AACA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA,YAAY;;AAEZ;AACA;AACA,YAAY;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACxN;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClxBuC;AACN;AACA;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;;AAEO;AACP,eAAe,kDAAmB;;AAElC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA,cAAc,4CAAW;AACzB,EAAE,iDAAgB;AAClB,cAAc,kDAAmB;AACjC,EAAE,oDAAmB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO,cAAc,0CAAS;AAC9B;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO,cAAc,0CAAS;AAC9B;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA,sBAAsB,+CAAgB;AACtC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,aAAa,4CAAW;AAC/B;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,oBAAoB,mDAAkB;AAC7C;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACjoB,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACl0BwC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,UAAU,8CAAe;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA,2BAA2B;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;;AAE5C;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB;AACnI;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;AC/mBY;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,qBAAqB,mBAAO,CAAC,EAAc;AAC3C,gBAAgB,mBAAO,CAAC,EAAS;AACjC,gBAAgB,mBAAO,CAAC,EAAgB;AACxC,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB;AACpC,eAAe,WAAW;AAC1B,eAAe,4BAA4B;AAC3C,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,qBAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACxVa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,eAAe,cAAc;AAC7B,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0EAA0E;AACzF,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sC;;;;;;;AClGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,gBAAgB,mBAAO,CAAC,EAAS;AACjC,qBAAqB,mBAAO,CAAC,EAAc;AAC3C,oBAAoB,mBAAO,CAAC,EAAoB;AAChD,gBAAgB,mBAAO,CAAC,EAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,SAAS;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACxTa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,oBAAoB,mBAAO,CAAC,EAAW;AACvC,gBAAgB,mBAAO,CAAC,CAAU;AAClC,aAAa,mBAAO,CAAC,EAA8B;AACnD,eAAe,mBAAO,CAAC,EAAc;AACrC,eAAe,mBAAO,CAAC,EAAS;AAChC,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,oBAAoB,mBAAO,CAAC,EAAc;AAC1C,qBAAqB,mBAAO,CAAC,EAAe;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,cAAc;AAC7B,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0EAA0E;AACzF,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,2CAA2C;AACrF,8CAA8C,2CAA2C;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,4BAA4B;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,SAAS;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;AACA,mEAAmE,SAAS;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,gCAAgC;AAClD,kBAAkB,gCAAgC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qC;;;;;;;ACzgBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc,GAAG,cAAc,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,iBAAiB;AAChI,oBAAoB,mBAAO,CAAC,EAAW;AACvC,iBAAiB;AACjB,gBAAgB;AAChB,iBAAiB;AACjB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,gD;;;;;;;AC5Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,gBAAgB;AAChB;AACA,6BAA6B,OAAO,OAAO,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,gC;;;;;;;ACpNa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,iC;;;;;;;AClCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,GAAG,gBAAgB,GAAG,kBAAkB;AACrD,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC,kBAAkB,KAAK;AAC9D;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6BAA6B;AAC5C,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,iC;;;;;;;ACrKa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB;AACA;AACA,gBAAgB;AAChB,oC;;;;;;;ACNa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gCAAgC,GAAG,mBAAmB,GAAG,qCAAqC,GAAG,8BAA8B,GAAG,4BAA4B,GAAG,2BAA2B,GAAG,cAAc,GAAG,aAAa,GAAG,qBAAqB,GAAG,aAAa,GAAG,YAAY,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,WAAW;AAC1U,qBAAqB,mBAAO,CAAC,EAAe;AAC5C,sBAAsB,mBAAO,CAAC,CAAqB;AACnD,eAAe,mBAAO,CAAC,EAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,mBAAmB,iBAAiB;AACpC,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,gBAAgB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA,4BAA4B,qBAAqB;AACjD;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,eAAe;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yBAAyB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC,qC;;;;;;ACxWA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA,qBAAqB;AACrB;AACA,wBAAwB;AACxB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,4BAA4B;AAC5B;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,kCAAkC;AAClC;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA,6BAA6B;AAC7B;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA,mCAAmC;AACnC,qBAAqB;AACrB;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,yBAAyB;AACzB,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,iBAAiB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,gDAAgD;AAChD;AACA;;AAEA;AACA,MAAM,IAA2C,EAAE,mCAAO,YAAY,qBAAqB;AAAA,kGAAC;AAC5F;AACA,MAAM,IAA8B,EAAE,oBAAoB;AAC1D;AACA,OAAO,EAAsE;AAC7E;AACA,MAAM,IAA6B;AACnC;AACA;;AAEA,CAAC;;;;;;;;ACxdY;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,gBAAgB,mBAAO,CAAC,EAAU;AAClC,qBAAqB,mBAAO,CAAC,EAAe;AAC5C,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc,aAAa;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA,4DAA4D,SAAS;AACrE,wCAAwC;AACxC;AACA;AACA;AACA,yCAAyC,4BAA4B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,aAAa;AAC5B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACnLa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,sBAAsB;AACtB,aAAa,mBAAO,CAAC,EAA8B;AACnD,oBAAoB,mBAAO,CAAC,EAAa;AACzC,mBAAmB,mBAAO,CAAC,EAAuB;AAClD,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB,aAAa;AACpD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,0C;;;;;;;ACjJa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,eAAe,mBAAO,CAAC,EAAS;AAChC,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,yBAAyB,mBAAO,CAAC,EAA0B;AAC3D,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB,aAAa;AAC/C,eAAe,QAAQ;AACvB;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB;AACA;AACA;AACA,iDAAiD,eAAe;AAChE,sDAAsD,QAAQ;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA,eAAe,6BAA6B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,kBAAkB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,eAAe,sBAAsB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,8CAA8C;AAC9E;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,qC;;;;;;;AChOa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB;AACnB,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,yBAAyB,mBAAO,CAAC,EAA0B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB,aAAa;AACjD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,gCAAgC,8CAA8C;AAC9E;AACA;AACA;AACA;AACA,mBAAmB;AACnB,uC;;;;;;;ACnIa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,sBAAsB;AACtB,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB,aAAa;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,qDAAqD;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,6BAA6B;AACpD;AACA;AACA;AACA;AACA,sCAAsC,+BAA+B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iIAAiI,6DAA6D;AAC9L;AACA;AACA;AACA;AACA,4BAA4B,uEAAuE;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,SAAS;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,4BAA4B,8DAA8D;AAC1F,iBAAiB;AACjB;AACA;AACA,mFAAmF,gCAAgC;AACnH,wCAAwC;AACxC;AACA;AACA;AACA;AACA,4BAA4B,8DAA8D;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,oEAAoE,4BAA4B,iBAAiB,EAAE;AACnH;AACA;AACA;AACA,+BAA+B,gBAAgB;AAC/C;AACA,2DAA2D,SAAS;AACpE;AACA,+FAA+F,gCAAgC;AAC/H,oDAAoD;AACpD;AACA;AACA;AACA;AACA,wCAAwC,wDAAwD;AAChG;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;AACA,qDAAqD,4BAA4B;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA,sBAAsB;AACtB,0C;;;;;;;AChUa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB;AACnB,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB,aAAa;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,uDAAuD;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,SAAS;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,mFAAmF,gCAAgC;AACnH,uEAAuE,iCAAiC,4BAA4B,iBAAiB,EAAE;AACvJ,kDAAkD,SAAS;AAC3D;AACA,2FAA2F,gCAAgC;AAC3H,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA,iDAAiD,4BAA4B;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA,mBAAmB;AACnB,uC;;;;;;;AC3Na;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,YAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,SAAS;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,gC;;;;;;;AC5Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA,oC;;;;;;;AC1Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,gC;;;;;;;AC3Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,mC;;;;;;;ACxCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACpCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ,gC;;;;;;;AClDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc,aAAa;AAC1C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ,gC;;;;;;;ACtEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe,aAAa;AAC3C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kC;;;;;;;AC5Fa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB,aAAa;AAC/C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,qC;;;;;;;ACtDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB;AAClB,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sC;;;;;;;AC9Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,gBAAgB,mBAAO,CAAC,EAAS;AACjC,iBAAiB,mBAAO,CAAC,EAAU;AACnC,iBAAiB,mBAAO,CAAC,EAAU;AACnC,mBAAmB,mBAAO,CAAC,EAAY;AACvC,oBAAoB,mBAAO,CAAC,EAAa;AACzC,gBAAgB,mBAAO,CAAC,EAAS;AACjC,iBAAiB,mBAAO,CAAC,EAAU;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,iC;;;;;;;ACpBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACtDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,oBAAoB,mBAAO,CAAC,EAAc;AAC1C,gBAAgB,mBAAO,CAAC,EAAS;AACjC,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,SAAS;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACvEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;AC3Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,oC;;;;;;;ACvHa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,WAAW;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,qC;;;;;;;ACxDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,wBAAwB,yBAAyB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACfa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAa;AAClC,aAAa,mBAAO,CAAC,EAAmB;AACxC,aAAa,mBAAO,CAAC,EAAsB;AAC3C,aAAa,mBAAO,CAAC,EAAW;AAChC,aAAa,mBAAO,CAAC,EAAa;AAClC,iC;;;;;;;AClBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,2BAA2B,GAAG,2BAA2B,GAAG,YAAY,GAAG,YAAY,GAAG,mBAAmB,GAAG,aAAa;AAC7H;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,mBAAmB;AAC9B,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,EAAE,GAAG,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,mBAAmB;AAC9B,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,mBAAmB,cAAc,GAAG,cAAc,GAAG,cAAc,GAAG,MAAM;AAC5E;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA,mBAAmB,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,MAAM;AAC1C;AACA,2BAA2B;AAC3B,qC;;;;;;;AC9Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uBAAuB;AACvB,6BAA6B,mBAAO,CAAC,EAAsB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8DAA8D;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2C;;;;;;;ACpGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,0BAA0B,GAAG,mCAAmC;AAChE,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,wBAAwB,mBAAO,CAAC,EAAe;AAC/C,kBAAkB,mBAAO,CAAC,EAAW;AACrC,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,8C;;;;;;;ACxGa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAe;AACpC,aAAa,mBAAO,CAAC,EAAW;AAChC,iC;;;;;;;ACfa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6DAA6D;AAC5E;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,uC;;;;;;;ACzFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB,GAAG,4BAA4B;AACjD,qBAAqB,mBAAO,CAAC,EAAc;AAC3C,sBAAsB,mBAAO,CAAC,EAAe;AAC7C;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,6BAA6B,IAAI;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,mC;;;;;;;AC1Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,sC;;;;;;AClJA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,uBAAuB,oCAAoC;AAC3D,uBAAuB,8BAA8B;AACrD,uBAAuB,kBAAkB;;AAEzC;AACA,oCAAoC,8DAA8D;;AAElG;AACA,kCAAkC,sEAAsE;;AAExG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;;AAEA;AACA;AACA;AACA;;AAEA,UAAU,mEAAmE;AAC7E;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe;AACf,mC;;;;;;;AChca;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,wBAAwB,GAAG,cAAc,GAAG,YAAY,GAAG,eAAe,GAAG,cAAc,GAAG,8BAA8B;AAC5H,4BAA4B,mBAAO,CAAC,EAAqB;AACzD,0BAA0B,mBAAO,CAAC,EAAmB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB,qC;;;;;;;ACpEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yBAAyB;AACzB,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,0BAA0B,mBAAO,CAAC,EAAmB;AACrD,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA,WAAW,wBAAwB;AACnC,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6C;;;;;;;ACxDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,2BAA2B;AAC3B,uBAAuB,mBAAO,CAAC,EAAiB;AAChD,gBAAgB,mBAAO,CAAC,EAAU;AAClC;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,+C;;;;;;;AChGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,oBAAoB;AACpB,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,oBAAoB,mBAAO,CAAC,EAAoC;AAChE,eAAe,mBAAO,CAAC,EAA+B;AACtD,eAAe,mBAAO,CAAC,EAAoC;AAC3D,iBAAiB,mBAAO,CAAC,EAAQ;AACjC,kBAAkB,mBAAO,CAAC,EAAW;AACrC,mBAAmB,mBAAO,CAAC,EAAY;AACvC,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6BAA6B;AAC5C,eAAe,wBAAwB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,2BAA2B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,0BAA0B;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qGAAqG,uCAAuC;AAC5I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,KAAK;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oGAAoG,OAAO;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,eAAe,QAAQ;AACvB,eAAe,qBAAqB;AACpC,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB,eAAe,OAAO;AACtB,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW;AAC7E,8BAA8B,SAAS,GAAG,SAAS,IAAI,SAAS,IAAI,WAAW;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,wC;;;;;;ACvXA;;AAEA,kBAAkB,mBAAO,CAAC,EAAkB;;AAE5C,iBAAiB;;AAEjB,oBAAoB;AACpB,0DAA0D,+BAA+B;AACzF;;AAEA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA;AACA;;AAEA,gCAAgC,WAAW;AAC3C,iCAAiC,WAAW;;AAE5C;AACA,GAAG;AACH;;;;;;;;AClCY;;AAEZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACrGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,6CAA6C;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,8CAA8C;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,6BAA6B;AAC5C;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,mC;;;;;;;AC3Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,oBAAoB,mBAAO,CAAC,EAAoC;AAChE,eAAe,mBAAO,CAAC,EAA+B;AACtD,kBAAkB,mBAAO,CAAC,EAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,2BAA2B,aAAa;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oC;;;;;;;ACxRa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,eAAe,GAAG,gBAAgB,GAAG,aAAa;AAChE,aAAa;AACb;AACA;AACA,gBAAgB;AAChB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,+BAA+B;AAC1C,YAAY,EAAE,IAAI,WAAW,WAAW,eAAe,gBAAgB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,iC;;;;;UClDA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,wCAAwC,yCAAyC;WACjF;WACA;WACA,E;;;;;WCPA,wF;;;;;WCAA;WACA;WACA;WACA,sDAAsD,kBAAkB;WACxE;WACA,+CAA+C,cAAc;WAC7D,E;;;;;;;;;ACNa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,kBAAkB,mBAAO,CAAC,CAAiB;AAC3C,iBAAiB;AACjB,eAAe;AACf,uC","file":"urpflanze-light.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Urpflanze\"] = factory();\n\telse\n\t\troot[\"Urpflanze\"] = factory();\n})(window, function() {\nreturn ","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DrawerCanvas = exports.Animation = void 0;\n__exportStar(require(\"@urpflanze/core/dist/cjs\"), exports);\nexports.Animation = require(\"@urpflanze/animation/dist/cjs\");\nvar BrowserDrawerCanvas_1 = require(\"@urpflanze/drawer-canvas/dist/cjs/browser/BrowserDrawerCanvas\");\nObject.defineProperty(exports, \"DrawerCanvas\", { enumerable: true, get: function () { return BrowserDrawerCanvas_1.BrowserDrawerCanvas; } });\n//# sourceMappingURL=modules-light.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mod = exports.log = exports.PI2 = exports.PHI = exports.Vec2 = exports.distributePointsInBuffer = exports.prepareBufferForInterpolation = exports.interpolate = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.now = exports.toRadians = exports.toDegrees = exports.relativeClamp = exports.clamp = exports.lerp = void 0;\n/**\n * Types & Interface\n */\n__exportStar(require(\"./types\"), exports);\n// Set glMatrixArrayType\nconst gl_matrix_1 = require(\"gl-matrix\");\ngl_matrix_1.glMatrix.setMatrixArrayType(Array);\n/**\n * Core\n */\n__exportStar(require(\"./Scene\"), exports);\n__exportStar(require(\"./SceneChild\"), exports);\n__exportStar(require(\"./Group\"), exports);\n// Shapes\n__exportStar(require(\"./shapes/ShapeBase\"), exports);\n__exportStar(require(\"./shapes/ShapePrimitive\"), exports);\n__exportStar(require(\"./shapes/ShapeLoop\"), exports);\n__exportStar(require(\"./shapes/ShapeBuffer\"), exports);\n__exportStar(require(\"./shapes/Shape\"), exports);\n__exportStar(require(\"./shapes/ShapeRecursive\"), exports);\n__exportStar(require(\"./shapes/ShapeFollow\"), exports);\n__exportStar(require(\"./shapes/primitives/Line\"), exports);\n__exportStar(require(\"./shapes/primitives/Triangle\"), exports);\n__exportStar(require(\"./shapes/primitives/Rect\"), exports);\n__exportStar(require(\"./shapes/primitives/Polygon\"), exports);\n__exportStar(require(\"./shapes/primitives/Circle\"), exports);\n__exportStar(require(\"./shapes/primitives/Star\"), exports);\n__exportStar(require(\"./shapes/primitives/Rose\"), exports);\n__exportStar(require(\"./shapes/primitives/Spiral\"), exports);\n__exportStar(require(\"./shapes/primitives/Lissajous\"), exports);\n__exportStar(require(\"./shapes/primitives/SuperShape\"), exports);\n// Modifiers\n__exportStar(require(\"./modifiers/Modifier\"), exports);\n__exportStar(require(\"./modifiers\"), exports);\n// Utilities\nvar Utilities_1 = require(\"./Utilities\");\nObject.defineProperty(exports, \"lerp\", { enumerable: true, get: function () { return Utilities_1.lerp; } });\nObject.defineProperty(exports, \"clamp\", { enumerable: true, get: function () { return Utilities_1.clamp; } });\nObject.defineProperty(exports, \"relativeClamp\", { enumerable: true, get: function () { return Utilities_1.relativeClamp; } });\nObject.defineProperty(exports, \"toDegrees\", { enumerable: true, get: function () { return Utilities_1.toDegrees; } });\nObject.defineProperty(exports, \"toRadians\", { enumerable: true, get: function () { return Utilities_1.toRadians; } });\nObject.defineProperty(exports, \"now\", { enumerable: true, get: function () { return Utilities_1.now; } });\nObject.defineProperty(exports, \"noise\", { enumerable: true, get: function () { return Utilities_1.noise; } });\nObject.defineProperty(exports, \"random\", { enumerable: true, get: function () { return Utilities_1.random; } });\nObject.defineProperty(exports, \"angleFromRepetition\", { enumerable: true, get: function () { return Utilities_1.angleFromRepetition; } });\nObject.defineProperty(exports, \"angle2FromRepetition\", { enumerable: true, get: function () { return Utilities_1.angle2FromRepetition; } });\nObject.defineProperty(exports, \"distanceFromRepetition\", { enumerable: true, get: function () { return Utilities_1.distanceFromRepetition; } });\nObject.defineProperty(exports, \"interpolate\", { enumerable: true, get: function () { return Utilities_1.interpolate; } });\nObject.defineProperty(exports, \"prepareBufferForInterpolation\", { enumerable: true, get: function () { return Utilities_1.prepareBufferForInterpolation; } });\nObject.defineProperty(exports, \"distributePointsInBuffer\", { enumerable: true, get: function () { return Utilities_1.distributePointsInBuffer; } });\nvar Vec2_1 = require(\"./math/Vec2\");\nObject.defineProperty(exports, \"Vec2\", { enumerable: true, get: function () { return Vec2_1.default; } });\nvar math_1 = require(\"./math\");\nObject.defineProperty(exports, \"PHI\", { enumerable: true, get: function () { return math_1.PHI; } });\nObject.defineProperty(exports, \"PI2\", { enumerable: true, get: function () { return math_1.PI2; } });\nObject.defineProperty(exports, \"log\", { enumerable: true, get: function () { return math_1.log; } });\nObject.defineProperty(exports, \"mod\", { enumerable: true, get: function () { return math_1.mod; } });\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./indexedBuffer\"), exports);\n__exportStar(require(\"./propArguments\"), exports);\n__exportStar(require(\"./repetitions\"), exports);\n__exportStar(require(\"./scene-child\"), exports);\n__exportStar(require(\"./scene\"), exports);\n__exportStar(require(\"./shape-base\"), exports);\n__exportStar(require(\"./shape-primitives\"), exports);\n__exportStar(require(\"./shapes\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=indexedBuffer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=propArguments.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ERepetitionType = void 0;\n/**\n * Repetition type enumerator.\n *\n * @category Core.Repetition\n * @internal\n */\nvar ERepetitionType;\n(function (ERepetitionType) {\n /**\n * Defines the type of repetition of the shape,\n * in a circular way starting from the center of the scene\n * @order 1\n */\n ERepetitionType[ERepetitionType[\"Ring\"] = 1] = \"Ring\";\n /**\n * Defines the type of repetition of the shape,\n * on a nxm grid starting from the center of the scene\n * @order 2\n */\n ERepetitionType[ERepetitionType[\"Matrix\"] = 2] = \"Matrix\";\n})(ERepetitionType = exports.ERepetitionType || (exports.ERepetitionType = {}));\n//# sourceMappingURL=repetitions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=scene-child.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=scene.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EBoundingType = void 0;\nvar EBoundingType;\n(function (EBoundingType) {\n /**\n * Relative to the real bounding of the shape\n * @order 2\n */\n EBoundingType[EBoundingType[\"Relative\"] = 1] = \"Relative\";\n /**\n * Fixed to te width and height of the shape\n * @order 3\n */\n EBoundingType[EBoundingType[\"Fixed\"] = 2] = \"Fixed\";\n})(EBoundingType = exports.EBoundingType || (exports.EBoundingType = {}));\n//# sourceMappingURL=shape-base.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//////\n//# sourceMappingURL=shape-primitives.js.map","\"use strict\";\n// Shape\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=shapes.js.map","import * as glMatrix from \"./common.js\";\nimport * as mat2 from \"./mat2.js\";\nimport * as mat2d from \"./mat2d.js\";\nimport * as mat3 from \"./mat3.js\";\nimport * as mat4 from \"./mat4.js\";\nimport * as quat from \"./quat.js\";\nimport * as quat2 from \"./quat2.js\";\nimport * as vec2 from \"./vec2.js\";\nimport * as vec3 from \"./vec3.js\";\nimport * as vec4 from \"./vec4.js\";\nexport { glMatrix, mat2, mat2d, mat3, mat4, quat, quat2, vec2, vec3, vec4 };","/**\r\n * Common utilities\r\n * @module glMatrix\r\n */\n// Configuration Constants\nexport var EPSILON = 0.000001;\nexport var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexport var RANDOM = Math.random;\n/**\r\n * Sets the type of array used when creating new vectors and matrices\r\n *\r\n * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array\r\n */\n\nexport function setMatrixArrayType(type) {\n ARRAY_TYPE = type;\n}\nvar degree = Math.PI / 180;\n/**\r\n * Convert Degree To Radian\r\n *\r\n * @param {Number} a Angle in Degrees\r\n */\n\nexport function toRadian(a) {\n return a * degree;\n}\n/**\r\n * Tests whether or not the arguments have approximately the same value, within an absolute\r\n * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less\r\n * than or equal to 1.0, and a relative tolerance is used for larger values)\r\n *\r\n * @param {Number} a The first number to test.\r\n * @param {Number} b The second number to test.\r\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n}\nif (!Math.hypot) Math.hypot = function () {\n var y = 0,\n i = arguments.length;\n\n while (i--) {\n y += arguments[i] * arguments[i];\n }\n\n return Math.sqrt(y);\n};","import * as glMatrix from \"./common.js\";\n/**\r\n * 2x2 Matrix\r\n * @module mat2\r\n */\n\n/**\r\n * Creates a new identity mat2\r\n *\r\n * @returns {mat2} a new 2x2 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\r\n * Creates a new mat2 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat2} a matrix to clone\r\n * @returns {mat2} a new 2x2 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Copy the values from one mat2 to another\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set a mat2 to the identity matrix\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @returns {mat2} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\r\n * Create a new mat2 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\r\n * @returns {mat2} out A new 2x2 matrix\r\n */\n\nexport function fromValues(m00, m01, m10, m11) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\r\n * Set the components of a mat2 to the given values\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\r\n * @returns {mat2} out\r\n */\n\nexport function set(out, m00, m01, m10, m11) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\r\n * Transpose the values of a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache\n // some values\n if (out === a) {\n var a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3]; // Calculate the determinant\n\n var det = a0 * a3 - a2 * a1;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function adjoint(out, a) {\n // Caching this value is nessecary if out == a\n var a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat2\r\n *\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n}\n/**\r\n * Multiplies two mat2's\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n}\n/**\r\n * Rotates a mat2 by the given angle\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n}\n/**\r\n * Scales the mat2 by the dimensions in the given vec2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to rotate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat2} out\r\n **/\n\nexport function scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n *\r\n * @param {mat2} out mat2 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n *\r\n * @param {mat2} out mat2 receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat2} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n}\n/**\r\n * Returns a string representation of a mat2\r\n *\r\n * @param {ReadonlyMat2} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat2\r\n *\r\n * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3]);\n}\n/**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @param {ReadonlyMat2} L the lower triangular matrix\r\n * @param {ReadonlyMat2} D the diagonal matrix\r\n * @param {ReadonlyMat2} U the upper triangular matrix\r\n * @param {ReadonlyMat2} a the input matrix to factorize\r\n */\n\nexport function LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n}\n/**\r\n * Adds two mat2's\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat2} a The first matrix.\r\n * @param {ReadonlyMat2} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat2} a The first matrix.\r\n * @param {ReadonlyMat2} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat2} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\r\n * Adds two mat2's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat2} out the receiving vector\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat2} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\r\n * Alias for {@link mat2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat2.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 2x3 Matrix\r\n * @module mat2d\r\n * @description\r\n * A mat2d contains six elements defined as:\r\n *
\r\n * [a, b,\r\n *  c, d,\r\n *  tx, ty]\r\n * 
\r\n * This is a short form for the 3x3 matrix:\r\n *
\r\n * [a, b, 0,\r\n *  c, d, 0,\r\n *  tx, ty, 1]\r\n * 
\r\n * The last column is ignored so the array is shorter and operations are faster.\r\n */\n\n/**\r\n * Creates a new identity mat2d\r\n *\r\n * @returns {mat2d} a new 2x3 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(6);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[4] = 0;\n out[5] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\r\n * Creates a new mat2d initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat2d} a matrix to clone\r\n * @returns {mat2d} a new 2x3 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\r\n * Copy the values from one mat2d to another\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\r\n * Set a mat2d to the identity matrix\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Create a new mat2d with the given values\r\n *\r\n * @param {Number} a Component A (index 0)\r\n * @param {Number} b Component B (index 1)\r\n * @param {Number} c Component C (index 2)\r\n * @param {Number} d Component D (index 3)\r\n * @param {Number} tx Component TX (index 4)\r\n * @param {Number} ty Component TY (index 5)\r\n * @returns {mat2d} A new mat2d\r\n */\n\nexport function fromValues(a, b, c, d, tx, ty) {\n var out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\r\n * Set the components of a mat2d to the given values\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {Number} a Component A (index 0)\r\n * @param {Number} b Component B (index 1)\r\n * @param {Number} c Component C (index 2)\r\n * @param {Number} d Component D (index 3)\r\n * @param {Number} tx Component TX (index 4)\r\n * @param {Number} ty Component TY (index 5)\r\n * @returns {mat2d} out\r\n */\n\nexport function set(out, a, b, c, d, tx, ty) {\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\r\n * Inverts a mat2d\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function invert(out, a) {\n var aa = a[0],\n ab = a[1],\n ac = a[2],\n ad = a[3];\n var atx = a[4],\n aty = a[5];\n var det = aa * ad - ab * ac;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n}\n/**\r\n * Multiplies two mat2d's\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n}\n/**\r\n * Rotates a mat2d by the given angle\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2d} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\r\n * Scales the mat2d by the dimensions in the given vec2\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to translate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat2d} out\r\n **/\n\nexport function scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\r\n * Translates the mat2d by the dimensions in the given vec2\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to translate\r\n * @param {ReadonlyVec2} v the vec2 to translate the matrix by\r\n * @returns {mat2d} out\r\n **/\n\nexport function translate(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.rotate(dest, dest, rad);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2d} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.scale(dest, dest, vec);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat2d} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.translate(dest, dest, vec);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {ReadonlyVec2} v Translation vector\r\n * @returns {mat2d} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n}\n/**\r\n * Returns a string representation of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat2d(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1);\n}\n/**\r\n * Adds two mat2d's\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat2d} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n}\n/**\r\n * Adds two mat2d's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat2d} out the receiving vector\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat2d} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat2d} a The first matrix.\r\n * @param {ReadonlyMat2d} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat2d} a The first matrix.\r\n * @param {ReadonlyMat2d} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5));\n}\n/**\r\n * Alias for {@link mat2d.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat2d.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 3x3 Matrix\r\n * @module mat3\r\n */\n\n/**\r\n * Creates a new identity mat3\r\n *\r\n * @returns {mat3} a new 3x3 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(9);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n }\n\n out[0] = 1;\n out[4] = 1;\n out[8] = 1;\n return out;\n}\n/**\r\n * Copies the upper-left 3x3 values into the given mat3.\r\n *\r\n * @param {mat3} out the receiving 3x3 matrix\r\n * @param {ReadonlyMat4} a the source 4x4 matrix\r\n * @returns {mat3} out\r\n */\n\nexport function fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n}\n/**\r\n * Creates a new mat3 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat3} a matrix to clone\r\n * @returns {mat3} a new 3x3 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Copy the values from one mat3 to another\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Create a new mat3 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\r\n * @returns {mat3} A new mat3\r\n */\n\nexport function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\r\n * Set the components of a mat3 to the given values\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\r\n * @returns {mat3} out\r\n */\n\nexport function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\r\n * Set a mat3 to the identity matrix\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @returns {mat3} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Transpose the values of a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b01 = a22 * a11 - a12 * a21;\n var b11 = -a22 * a10 + a12 * a20;\n var b21 = a21 * a10 - a11 * a20; // Calculate the determinant\n\n var det = a00 * b01 + a01 * b11 + a02 * b21;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat3\r\n *\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n}\n/**\r\n * Multiplies two mat3's\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b00 = b[0],\n b01 = b[1],\n b02 = b[2];\n var b10 = b[3],\n b11 = b[4],\n b12 = b[5];\n var b20 = b[6],\n b21 = b[7],\n b22 = b[8];\n out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n return out;\n}\n/**\r\n * Translate a mat3 by the given vector\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to translate\r\n * @param {ReadonlyVec2} v vector to translate by\r\n * @returns {mat3} out\r\n */\n\nexport function translate(out, a, v) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n x = v[0],\n y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n}\n/**\r\n * Rotates a mat3 by the given angle\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat3} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n}\n/**\r\n * Scales the mat3 by the dimensions in the given vec2\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to rotate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat3} out\r\n **/\n\nexport function scale(out, a, v) {\n var x = v[0],\n y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyVec2} v Translation vector\r\n * @returns {mat3} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat3} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat3} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Copies the values from a mat2d into a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to copy\r\n * @returns {mat3} out\r\n **/\n\nexport function fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n}\n/**\r\n * Calculates a 3x3 matrix from the given quaternion\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyQuat} q Quaternion to create matrix from\r\n *\r\n * @returns {mat3} out\r\n */\n\nexport function fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n}\n/**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n *\r\n * @returns {mat3} out\r\n */\n\nexport function normalFromMat4(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n}\n/**\r\n * Generates a 2D projection matrix with the given bounds\r\n *\r\n * @param {mat3} out mat3 frustum matrix will be written into\r\n * @param {number} width Width of your gl context\r\n * @param {number} height Height of gl context\r\n * @returns {mat3} out\r\n */\n\nexport function projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n}\n/**\r\n * Returns a string representation of a mat3\r\n *\r\n * @param {ReadonlyMat3} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat3\r\n *\r\n * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);\n}\n/**\r\n * Adds two mat3's\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat3} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n}\n/**\r\n * Adds two mat3's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat3} out the receiving vector\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat3} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat3} a The first matrix.\r\n * @param {ReadonlyMat3} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat3} a The first matrix.\r\n * @param {ReadonlyMat3} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7],\n a8 = a[8];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7],\n b8 = b[8];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8));\n}\n/**\r\n * Alias for {@link mat3.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat3.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied.\r\n * @module mat4\r\n */\n\n/**\r\n * Creates a new identity mat4\r\n *\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(16);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n }\n\n out[0] = 1;\n out[5] = 1;\n out[10] = 1;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a new mat4 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat4} a matrix to clone\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Copy the values from one mat4 to another\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Create a new mat4 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} A new mat4\r\n */\n\nexport function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\r\n * Set the components of a mat4 to the given values\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} out\r\n */\n\nexport function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\r\n * Set a mat4 to the identity matrix\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @returns {mat4} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Transpose the values of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a12 = a[6],\n a13 = a[7];\n var a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22);\n out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\n out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12);\n out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\n out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\n out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22);\n out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\n out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12);\n out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21);\n out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\n out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11);\n out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\n out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\n out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21);\n out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\n out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11);\n return out;\n}\n/**\r\n * Calculates the determinant of a mat4\r\n *\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n}\n/**\r\n * Multiplies two mat4s\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15]; // Cache only the current line of the second matrix\n\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n/**\r\n * Translate a mat4 by the given vector\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to translate\r\n * @param {ReadonlyVec3} v vector to translate by\r\n * @returns {mat4} out\r\n */\n\nexport function translate(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n\n return out;\n}\n/**\r\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to scale\r\n * @param {ReadonlyVec3} v the vec3 to scale the matrix by\r\n * @returns {mat4} out\r\n **/\n\nexport function scale(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Rotates a mat4 by the given angle around the given axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nexport function rotate(out, a, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n var b00, b01, b02;\n var b10, b11, b12;\n var b20, b21, b22;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11]; // Construct the elements of the rotation matrix\n\n b00 = x * x * t + c;\n b01 = y * x * t + z * s;\n b02 = z * x * t - y * s;\n b10 = x * y * t - z * s;\n b11 = y * y * t + c;\n b12 = z * y * t + x * s;\n b20 = x * z * t + y * s;\n b21 = y * z * t - x * s;\n b22 = z * z * t + c; // Perform rotation-specific matrix multiplication\n\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the X axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateX(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Y axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateY(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Z axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyVec3} v Scaling vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotation(out, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c; // Perform rotation-specific matrix multiplication\n\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromXRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromYRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromZRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslation(out, q, v) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a new mat4 from a dual quat.\r\n *\r\n * @param {mat4} out Matrix\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @returns {mat4} mat4 receiving operation result\r\n */\n\nexport function fromQuat2(out, a) {\n var translation = new glMatrix.ARRAY_TYPE(3);\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense\n\n if (magnitude > 0) {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n\n fromRotationTranslation(out, a, translation);\n return out;\n}\n/**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nexport function getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n}\n/**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion paramter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nexport function getScaling(out, mat) {\n var m11 = mat[0];\n var m12 = mat[1];\n var m13 = mat[2];\n var m21 = mat[4];\n var m22 = mat[5];\n var m23 = mat[6];\n var m31 = mat[8];\n var m32 = mat[9];\n var m33 = mat[10];\n out[0] = Math.hypot(m11, m12, m13);\n out[1] = Math.hypot(m21, m22, m23);\n out[2] = Math.hypot(m31, m32, m33);\n return out;\n}\n/**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @param {quat} out Quaternion to receive the rotation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {quat} out\r\n */\n\nexport function getRotation(out, mat) {\n var scaling = new glMatrix.ARRAY_TYPE(3);\n getScaling(scaling, mat);\n var is1 = 1 / scaling[0];\n var is2 = 1 / scaling[1];\n var is3 = 1 / scaling[2];\n var sm11 = mat[0] * is1;\n var sm12 = mat[1] * is2;\n var sm13 = mat[2] * is3;\n var sm21 = mat[4] * is1;\n var sm22 = mat[5] * is2;\n var sm23 = mat[6] * is3;\n var sm31 = mat[8] * is1;\n var sm32 = mat[9] * is2;\n var sm33 = mat[10] * is3;\n var trace = sm11 + sm22 + sm33;\n var S = 0;\n\n if (trace > 0) {\n S = Math.sqrt(trace + 1.0) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @param {ReadonlyVec3} s Scaling vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslationScale(out, q, v, s) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @param {ReadonlyVec3} s Scaling vector\r\n * @param {ReadonlyVec3} o The origin vector around which to scale and rotate\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n var ox = o[0];\n var oy = o[1];\n var oz = o[2];\n var out0 = (1 - (yy + zz)) * sx;\n var out1 = (xy + wz) * sx;\n var out2 = (xz - wy) * sx;\n var out4 = (xy - wz) * sy;\n var out5 = (1 - (xx + zz)) * sy;\n var out6 = (yz + wx) * sy;\n var out8 = (xz + wy) * sz;\n var out9 = (yz - wx) * sz;\n var out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n}\n/**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyQuat} q Quaternion to create matrix from\r\n *\r\n * @returns {mat4} out\r\n */\n\nexport function fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a frustum matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Number} left Left bound of the frustum\r\n * @param {Number} right Right bound of the frustum\r\n * @param {Number} bottom Bottom bound of the frustum\r\n * @param {Number} top Top bound of the frustum\r\n * @param {Number} near Near bound of the frustum\r\n * @param {Number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function frustum(out, left, right, bottom, top, near, far) {\n var rl = 1 / (right - left);\n var tb = 1 / (top - bottom);\n var nf = 1 / (near - far);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near * 2 * nf;\n out[15] = 0;\n return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} fovy Vertical field of view in radians\r\n * @param {number} aspect Aspect ratio. typically viewport width/height\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum, can be null or Infinity\r\n * @returns {mat4} out\r\n */\n\nexport function perspective(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n\n return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function perspectiveFromFieldOfView(out, fov, near, far) {\n var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);\n var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);\n var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);\n var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);\n var xScale = 2.0 / (leftTan + rightTan);\n var yScale = 2.0 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n out[4] = 0.0;\n out[5] = yScale;\n out[6] = 0.0;\n out[7] = 0.0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1.0;\n out[12] = 0.0;\n out[13] = 0.0;\n out[14] = far * near / (near - far);\n out[15] = 0.0;\n return out;\n}\n/**\r\n * Generates a orthogonal projection matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} left Left bound of the frustum\r\n * @param {number} right Right bound of the frustum\r\n * @param {number} bottom Bottom bound of the frustum\r\n * @param {number} top Top bound of the frustum\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function ortho(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {ReadonlyVec3} eye Position of the viewer\r\n * @param {ReadonlyVec3} center Point the viewer is looking at\r\n * @param {ReadonlyVec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nexport function lookAt(out, eye, center, up) {\n var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;\n var eyex = eye[0];\n var eyey = eye[1];\n var eyez = eye[2];\n var upx = up[0];\n var upy = up[1];\n var upz = up[2];\n var centerx = center[0];\n var centery = center[1];\n var centerz = center[2];\n\n if (Math.abs(eyex - centerx) < glMatrix.EPSILON && Math.abs(eyey - centery) < glMatrix.EPSILON && Math.abs(eyez - centerz) < glMatrix.EPSILON) {\n return identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n len = 1 / Math.hypot(z0, z1, z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.hypot(x0, x1, x2);\n\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n len = Math.hypot(y0, y1, y2);\n\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a matrix that makes something look at something else.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {ReadonlyVec3} eye Position of the viewer\r\n * @param {ReadonlyVec3} center Point the viewer is looking at\r\n * @param {ReadonlyVec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nexport function targetTo(out, eye, target, up) {\n var eyex = eye[0],\n eyey = eye[1],\n eyez = eye[2],\n upx = up[0],\n upy = up[1],\n upz = up[2];\n var z0 = eyex - target[0],\n z1 = eyey - target[1],\n z2 = eyez - target[2];\n var len = z0 * z0 + z1 * z1 + z2 * z2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n\n var x0 = upy * z2 - upz * z1,\n x1 = upz * z0 - upx * z2,\n x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n}\n/**\r\n * Returns a string representation of a mat4\r\n *\r\n * @param {ReadonlyMat4} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \", \" + a[9] + \", \" + a[10] + \", \" + a[11] + \", \" + a[12] + \", \" + a[13] + \", \" + a[14] + \", \" + a[15] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat4\r\n *\r\n * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);\n}\n/**\r\n * Adds two mat4's\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat4} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n}\n/**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat4} out the receiving vector\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat4} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat4} a The first matrix.\r\n * @param {ReadonlyMat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat4} a The first matrix.\r\n * @param {ReadonlyMat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var a8 = a[8],\n a9 = a[9],\n a10 = a[10],\n a11 = a[11];\n var a12 = a[12],\n a13 = a[13],\n a14 = a[14],\n a15 = a[15];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n var b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n var b8 = b[8],\n b9 = b[9],\n b10 = b[10],\n b11 = b[11];\n var b12 = b[12],\n b13 = b[13],\n b14 = b[14],\n b15 = b[15];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15));\n}\n/**\r\n * Alias for {@link mat4.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat4.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\nimport * as mat3 from \"./mat3.js\";\nimport * as vec3 from \"./vec3.js\";\nimport * as vec4 from \"./vec4.js\";\n/**\r\n * Quaternion\r\n * @module quat\r\n */\n\n/**\r\n * Creates a new identity quat\r\n *\r\n * @returns {quat} a new quaternion\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n out[3] = 1;\n return out;\n}\n/**\r\n * Set a quat to the identity quaternion\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @returns {quat} out\r\n */\n\nexport function identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyVec3} axis the axis around which to rotate\r\n * @param {Number} rad the angle in radians\r\n * @returns {quat} out\r\n **/\n\nexport function setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n var s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n}\n/**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @param {vec3} out_axis Vector receiving the axis of rotation\r\n * @param {ReadonlyQuat} q Quaternion to be decomposed\r\n * @return {Number} Angle, in radians, of the rotation\r\n */\n\nexport function getAxisAngle(out_axis, q) {\n var rad = Math.acos(q[3]) * 2.0;\n var s = Math.sin(rad / 2.0);\n\n if (s > glMatrix.EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n // If s is zero, return any axis (no rotation - axis does not matter)\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n\n return rad;\n}\n/**\r\n * Gets the angular distance between two unit quaternions\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\n\nexport function getAngle(a, b) {\n var dotproduct = dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n}\n/**\r\n * Multiplies two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {quat} out\r\n */\n\nexport function multiply(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the X axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateX(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateY(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var by = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bz = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n}\n/**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate W component of\r\n * @returns {quat} out\r\n */\n\nexport function calculateW(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\n return out;\n}\n/**\r\n * Calculate the exponential of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @returns {quat} out\r\n */\n\nexport function exp(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var et = Math.exp(w);\n var s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n}\n/**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @returns {quat} out\r\n */\n\nexport function ln(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n}\n/**\r\n * Calculate the scalar power of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @param {Number} b amount to scale the quaternion by\r\n * @returns {quat} out\r\n */\n\nexport function pow(out, a, b) {\n ln(out, a);\n scale(out, out, b);\n exp(out, out);\n return out;\n}\n/**\r\n * Performs a spherical linear interpolation between two quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n */\n\nexport function slerp(out, a, b, t) {\n // benchmarks:\n // http://jsperf.com/quaternion-slerp-implementations\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n var omega, cosom, sinom, scale0, scale1; // calc cosine\n\n cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary)\n\n if (cosom < 0.0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n } // calculate coefficients\n\n\n if (1.0 - cosom > glMatrix.EPSILON) {\n // standard case (slerp)\n omega = Math.acos(cosom);\n sinom = Math.sin(omega);\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n // \"from\" and \"to\" quaternions are very close\n // ... so we can do a linear interpolation\n scale0 = 1.0 - t;\n scale1 = t;\n } // calculate final values\n\n\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n}\n/**\r\n * Generates a random unit quaternion\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @returns {quat} out\r\n */\n\nexport function random(out) {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n var u1 = glMatrix.RANDOM();\n var u2 = glMatrix.RANDOM();\n var u3 = glMatrix.RANDOM();\n var sqrt1MinusU1 = Math.sqrt(1 - u1);\n var sqrtU1 = Math.sqrt(u1);\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n}\n/**\r\n * Calculates the inverse of a quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate inverse of\r\n * @returns {quat} out\r\n */\n\nexport function invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\n\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n}\n/**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate conjugate of\r\n * @returns {quat} out\r\n */\n\nexport function conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyMat3} m rotation matrix\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport function fromMat3(out, m) {\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n var fTrace = m[0] + m[4] + m[8];\n var fRoot;\n\n if (fTrace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\n\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot; // 1/(4w)\n\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n // |w| <= 1/2\n var i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n var j = (i + 1) % 3;\n var k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n\n return out;\n}\n/**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {x} Angle to rotate around X axis in degrees.\r\n * @param {y} Angle to rotate around Y axis in degrees.\r\n * @param {z} Angle to rotate around Z axis in degrees.\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport function fromEuler(out, x, y, z) {\n var halfToRad = 0.5 * Math.PI / 180.0;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n var sx = Math.sin(x);\n var cx = Math.cos(x);\n var sy = Math.sin(y);\n var cy = Math.cos(y);\n var sz = Math.sin(z);\n var cz = Math.cos(z);\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n return out;\n}\n/**\r\n * Returns a string representation of a quatenion\r\n *\r\n * @param {ReadonlyQuat} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"quat(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n *\r\n * @param {ReadonlyQuat} a quaternion to clone\r\n * @returns {quat} a new quaternion\r\n * @function\r\n */\n\nexport var clone = vec4.clone;\n/**\r\n * Creates a new quat initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {quat} a new quaternion\r\n * @function\r\n */\n\nexport var fromValues = vec4.fromValues;\n/**\r\n * Copy the values from one quat to another\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the source quaternion\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var copy = vec4.copy;\n/**\r\n * Set the components of a quat to the given values\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var set = vec4.set;\n/**\r\n * Adds two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var add = vec4.add;\n/**\r\n * Alias for {@link quat.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Scales a quat by a scalar number\r\n *\r\n * @param {quat} out the receiving vector\r\n * @param {ReadonlyQuat} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var scale = vec4.scale;\n/**\r\n * Calculates the dot product of two quat's\r\n *\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {Number} dot product of a and b\r\n * @function\r\n */\n\nexport var dot = vec4.dot;\n/**\r\n * Performs a linear interpolation between two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var lerp = vec4.lerp;\n/**\r\n * Calculates the length of a quat\r\n *\r\n * @param {ReadonlyQuat} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport var length = vec4.length;\n/**\r\n * Alias for {@link quat.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Calculates the squared length of a quat\r\n *\r\n * @param {ReadonlyQuat} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n * @function\r\n */\n\nexport var squaredLength = vec4.squaredLength;\n/**\r\n * Alias for {@link quat.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Normalize a quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quaternion to normalize\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var normalize = vec4.normalize;\n/**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyQuat} a The first quaternion.\r\n * @param {ReadonlyQuat} b The second quaternion.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport var exactEquals = vec4.exactEquals;\n/**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyQuat} a The first vector.\r\n * @param {ReadonlyQuat} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport var equals = vec4.equals;\n/**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n *\r\n * @param {quat} out the receiving quaternion.\r\n * @param {ReadonlyVec3} a the initial vector\r\n * @param {ReadonlyVec3} b the destination vector\r\n * @returns {quat} out\r\n */\n\nexport var rotationTo = function () {\n var tmpvec3 = vec3.create();\n var xUnitVec3 = vec3.fromValues(1, 0, 0);\n var yUnitVec3 = vec3.fromValues(0, 1, 0);\n return function (out, a, b) {\n var dot = vec3.dot(a, b);\n\n if (dot < -0.999999) {\n vec3.cross(tmpvec3, xUnitVec3, a);\n if (vec3.len(tmpvec3) < 0.000001) vec3.cross(tmpvec3, yUnitVec3, a);\n vec3.normalize(tmpvec3, tmpvec3);\n setAxisAngle(out, tmpvec3, Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n vec3.cross(tmpvec3, a, b);\n out[0] = tmpvec3[0];\n out[1] = tmpvec3[1];\n out[2] = tmpvec3[2];\n out[3] = 1 + dot;\n return normalize(out, out);\n }\n };\n}();\n/**\r\n * Performs a spherical linear interpolation with two control points\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {ReadonlyQuat} c the third operand\r\n * @param {ReadonlyQuat} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n */\n\nexport var sqlerp = function () {\n var temp1 = create();\n var temp2 = create();\n return function (out, a, b, c, d, t) {\n slerp(temp1, a, d, t);\n slerp(temp2, b, c, t);\n slerp(out, temp1, temp2, 2 * t * (1 - t));\n return out;\n };\n}();\n/**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n *\r\n * @param {ReadonlyVec3} view the vector representing the viewing direction\r\n * @param {ReadonlyVec3} right the vector representing the local \"right\" direction\r\n * @param {ReadonlyVec3} up the vector representing the local \"up\" direction\r\n * @returns {quat} out\r\n */\n\nexport var setAxes = function () {\n var matr = mat3.create();\n return function (out, view, right, up) {\n matr[0] = right[0];\n matr[3] = right[1];\n matr[6] = right[2];\n matr[1] = up[0];\n matr[4] = up[1];\n matr[7] = up[2];\n matr[2] = -view[0];\n matr[5] = -view[1];\n matr[8] = -view[2];\n return normalize(out, fromMat3(out, matr));\n };\n}();","import * as glMatrix from \"./common.js\";\n/**\r\n * 4 Dimensional Vector\r\n * @module vec4\r\n */\n\n/**\r\n * Creates a new, empty vec4\r\n *\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec4 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec4} a vector to clone\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Creates a new vec4 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function fromValues(x, y, z, w) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\r\n * Copy the values from one vec4 to another\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the source vector\r\n * @returns {vec4} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set the components of a vec4 to the given values\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} out\r\n */\n\nexport function set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\r\n * Adds two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\r\n * Multiplies two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n}\n/**\r\n * Divides two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to ceil\r\n * @returns {vec4} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to floor\r\n * @returns {vec4} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n}\n/**\r\n * Math.round the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to round\r\n * @returns {vec4} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n}\n/**\r\n * Scales a vec4 by a scalar number\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec4} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\r\n * Adds two vec4's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec4} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Calculates the length of a vec4\r\n *\r\n * @param {ReadonlyVec4} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\r\n * Calculates the squared length of a vec4\r\n *\r\n * @param {ReadonlyVec4} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Negates the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to negate\r\n * @returns {vec4} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to invert\r\n * @returns {vec4} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n out[3] = 1.0 / a[3];\n return out;\n}\n/**\r\n * Normalize a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to normalize\r\n * @returns {vec4} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n var len = x * x + y * y + z * z + w * w;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n}\n/**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n *\r\n * @param {ReadonlyVec4} result the receiving vector\r\n * @param {ReadonlyVec4} U the first vector\r\n * @param {ReadonlyVec4} V the second vector\r\n * @param {ReadonlyVec4} W the third vector\r\n * @returns {vec4} result\r\n */\n\nexport function cross(out, u, v, w) {\n var A = v[0] * w[1] - v[1] * w[0],\n B = v[0] * w[2] - v[2] * w[0],\n C = v[0] * w[3] - v[3] * w[0],\n D = v[1] * w[2] - v[2] * w[1],\n E = v[1] * w[3] - v[3] * w[1],\n F = v[2] * w[3] - v[3] * w[2];\n var G = u[0];\n var H = u[1];\n var I = u[2];\n var J = u[3];\n out[0] = H * F - I * E + J * D;\n out[1] = -(G * F) + I * C - J * B;\n out[2] = G * E - H * C + J * A;\n out[3] = -(G * D) + H * B - I * A;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec4} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n var aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec4} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n\n var v1, v2, v3, v4;\n var s1, s2;\n\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n\n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n}\n/**\r\n * Transforms the vec4 with a mat4.\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec4} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n}\n/**\r\n * Transforms the vec4 with a quat\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to transform\r\n * @param {ReadonlyQuat} q quaternion to transform with\r\n * @returns {vec4} out\r\n */\n\nexport function transformQuat(out, a, q) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3]; // calculate quat * vec\n\n var ix = qw * x + qy * z - qz * y;\n var iy = qw * y + qz * x - qx * z;\n var iz = qw * z + qx * y - qy * x;\n var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set the components of a vec4 to zero\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @returns {vec4} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec4} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec4} a The first vector.\r\n * @param {ReadonlyVec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec4} a The first vector.\r\n * @param {ReadonlyVec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\r\n * Alias for {@link vec4.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec4.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec4.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec4.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec4.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec4.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec4.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec4s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 4;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n vec[3] = a[i + 3];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n a[i + 3] = vec[3];\n }\n\n return a;\n };\n}();","import * as glMatrix from \"./common.js\";\n/**\r\n * 3 Dimensional Vector\r\n * @module vec3\r\n */\n\n/**\r\n * Creates a new, empty vec3\r\n *\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(3);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec3} a vector to clone\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\r\n * Calculates the length of a vec3\r\n *\r\n * @param {ReadonlyVec3} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return Math.hypot(x, y, z);\n}\n/**\r\n * Creates a new vec3 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function fromValues(x, y, z) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\r\n * Copy the values from one vec3 to another\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the source vector\r\n * @returns {vec3} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\r\n * Set the components of a vec3 to the given values\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} out\r\n */\n\nexport function set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\r\n * Adds two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n}\n/**\r\n * Multiplies two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n}\n/**\r\n * Divides two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to ceil\r\n * @returns {vec3} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to floor\r\n * @returns {vec3} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n}\n/**\r\n * Math.round the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to round\r\n * @returns {vec3} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n return out;\n}\n/**\r\n * Scales a vec3 by a scalar number\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec3} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n return out;\n}\n/**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec3} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return Math.hypot(x, y, z);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return x * x + y * y + z * z;\n}\n/**\r\n * Calculates the squared length of a vec3\r\n *\r\n * @param {ReadonlyVec3} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return x * x + y * y + z * z;\n}\n/**\r\n * Negates the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to negate\r\n * @returns {vec3} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to invert\r\n * @returns {vec3} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n return out;\n}\n/**\r\n * Normalize a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to normalize\r\n * @returns {vec3} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var len = x * x + y * y + z * z;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n/**\r\n * Computes the cross product of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function cross(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2];\n var bx = b[0],\n by = b[1],\n bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n}\n/**\r\n * Performs a hermite interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {ReadonlyVec3} c the third operand\r\n * @param {ReadonlyVec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function hermite(out, a, b, c, d, t) {\n var factorTimes2 = t * t;\n var factor1 = factorTimes2 * (2 * t - 3) + 1;\n var factor2 = factorTimes2 * (t - 2) + t;\n var factor3 = factorTimes2 * (t - 1);\n var factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\r\n * Performs a bezier interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {ReadonlyVec3} c the third operand\r\n * @param {ReadonlyVec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function bezier(out, a, b, c, d, t) {\n var inverseFactor = 1 - t;\n var inverseFactorTimesTwo = inverseFactor * inverseFactor;\n var factorTimes2 = t * t;\n var factor1 = inverseFactorTimesTwo * inverseFactor;\n var factor2 = 3 * t * inverseFactorTimesTwo;\n var factor3 = 3 * factorTimes2 * inverseFactor;\n var factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec3} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n var z = glMatrix.RANDOM() * 2.0 - 1.0;\n var zScale = Math.sqrt(1.0 - z * z) * scale;\n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n}\n/**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n/**\r\n * Transforms the vec3 with a mat3.\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyMat3} m the 3x3 matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformMat3(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n}\n/**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyQuat} q quaternion to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformQuat(out, a, q) {\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3];\n var x = a[0],\n y = a[1],\n z = a[2]; // var qvec = [qx, qy, qz];\n // var uv = vec3.cross([], qvec, a);\n\n var uvx = qy * z - qz * y,\n uvy = qz * x - qx * z,\n uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv);\n\n var uuvx = qy * uvz - qz * uvy,\n uuvy = qz * uvx - qx * uvz,\n uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w);\n\n var w2 = qw * 2;\n uvx *= w2;\n uvy *= w2;\n uvz *= w2; // vec3.scale(uuv, uuv, 2);\n\n uuvx *= 2;\n uuvy *= 2;\n uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv));\n\n out[0] = x + uvx + uuvx;\n out[1] = y + uvy + uuvy;\n out[2] = z + uvz + uuvz;\n return out;\n}\n/**\r\n * Rotate a 3D vector around the x-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateX(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Rotate a 3D vector around the y-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateY(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Rotate a 3D vector around the z-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateZ(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2]; //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Get the angle between two 3D vectors\r\n * @param {ReadonlyVec3} a The first operand\r\n * @param {ReadonlyVec3} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nexport function angle(a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n bx = b[0],\n by = b[1],\n bz = b[2],\n mag1 = Math.sqrt(ax * ax + ay * ay + az * az),\n mag2 = Math.sqrt(bx * bx + by * by + bz * bz),\n mag = mag1 * mag2,\n cosine = mag && dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\r\n * Set the components of a vec3 to zero\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @returns {vec3} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec3} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \")\";\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec3} a The first vector.\r\n * @param {ReadonlyVec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec3} a The first vector.\r\n * @param {ReadonlyVec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2));\n}\n/**\r\n * Alias for {@link vec3.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec3.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec3.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec3.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec3.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec3.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec3.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec3s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 3;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n }\n\n return a;\n };\n}();","import * as glMatrix from \"./common.js\";\nimport * as quat from \"./quat.js\";\nimport * as mat4 from \"./mat4.js\";\n/**\r\n * Dual Quaternion
\r\n * Format: [real, dual]
\r\n * Quaternion format: XYZW
\r\n * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
\r\n * @module quat2\r\n */\n\n/**\r\n * Creates a new identity dual quat\r\n *\r\n * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation]\r\n */\n\nexport function create() {\n var dq = new glMatrix.ARRAY_TYPE(8);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n dq[0] = 0;\n dq[1] = 0;\n dq[2] = 0;\n dq[4] = 0;\n dq[5] = 0;\n dq[6] = 0;\n dq[7] = 0;\n }\n\n dq[3] = 1;\n return dq;\n}\n/**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n *\r\n * @param {ReadonlyQuat2} a dual quaternion to clone\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function clone(a) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = a[0];\n dq[1] = a[1];\n dq[2] = a[2];\n dq[3] = a[3];\n dq[4] = a[4];\n dq[5] = a[5];\n dq[6] = a[6];\n dq[7] = a[7];\n return dq;\n}\n/**\r\n * Creates a new dual quat initialized with the given values\r\n *\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component\r\n * @param {Number} y2 Y component\r\n * @param {Number} z2 Z component\r\n * @param {Number} w2 W component\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n dq[4] = x2;\n dq[5] = y2;\n dq[6] = z2;\n dq[7] = w2;\n return dq;\n}\n/**\r\n * Creates a new dual quat from the given values (quat and translation)\r\n *\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component (translation)\r\n * @param {Number} y2 Y component (translation)\r\n * @param {Number} z2 Z component (translation)\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n var ax = x2 * 0.5,\n ay = y2 * 0.5,\n az = z2 * 0.5;\n dq[4] = ax * w1 + ay * z1 - az * y1;\n dq[5] = ay * w1 + az * x1 - ax * z1;\n dq[6] = az * w1 + ax * y1 - ay * x1;\n dq[7] = -ax * x1 - ay * y1 - az * z1;\n return dq;\n}\n/**\r\n * Creates a dual quat from a quaternion and a translation\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyQuat} q a normalized quaternion\r\n * @param {ReadonlyVec3} t tranlation vector\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromRotationTranslation(out, q, t) {\n var ax = t[0] * 0.5,\n ay = t[1] * 0.5,\n az = t[2] * 0.5,\n bx = q[0],\n by = q[1],\n bz = q[2],\n bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Creates a dual quat from a translation\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyVec3} t translation vector\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n}\n/**\r\n * Creates a dual quat from a quaternion\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyQuat} q the quaternion\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\r\n * Creates a new dual quat from a matrix (4x4)\r\n *\r\n * @param {quat2} out the dual quaternion\r\n * @param {ReadonlyMat4} a the matrix\r\n * @returns {quat2} dual quat receiving operation result\r\n * @function\r\n */\n\nexport function fromMat4(out, a) {\n //TODO Optimize this\n var outer = quat.create();\n mat4.getRotation(outer, a);\n var t = new glMatrix.ARRAY_TYPE(3);\n mat4.getTranslation(t, a);\n fromRotationTranslation(out, outer, t);\n return out;\n}\n/**\r\n * Copy the values from one dual quat to another\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the source dual quaternion\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n}\n/**\r\n * Set a dual quat to the identity dual quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @returns {quat2} out\r\n */\n\nexport function identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\r\n * Set the components of a dual quat to the given values\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component\r\n * @param {Number} y2 Y component\r\n * @param {Number} z2 Z component\r\n * @param {Number} w2 W component\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n}\n/**\r\n * Gets the real part of a dual quat\r\n * @param {quat} out real part\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @return {quat} real part\r\n */\n\nexport var getReal = quat.copy;\n/**\r\n * Gets the dual part of a dual quat\r\n * @param {quat} out dual part\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @return {quat} dual part\r\n */\n\nexport function getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n}\n/**\r\n * Set the real component of a dual quat to the given quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat} q a quaternion representing the real part\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport var setReal = quat.copy;\n/**\r\n * Set the dual component of a dual quat to the given quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat} q a quaternion representing the dual part\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function setDual(out, q) {\n out[4] = q[0];\n out[5] = q[1];\n out[6] = q[2];\n out[7] = q[3];\n return out;\n}\n/**\r\n * Gets the translation of a normalized dual quat\r\n * @param {vec3} out translation\r\n * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed\r\n * @return {vec3} translation\r\n */\n\nexport function getTranslation(out, a) {\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n}\n/**\r\n * Translates a dual quat by the given vector\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to translate\r\n * @param {ReadonlyVec3} v vector to translate by\r\n * @returns {quat2} out\r\n */\n\nexport function translate(out, a, v) {\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3],\n bx1 = v[0] * 0.5,\n by1 = v[1] * 0.5,\n bz1 = v[2] * 0.5,\n ax2 = a[4],\n ay2 = a[5],\n az2 = a[6],\n aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n}\n/**\r\n * Rotates a dual quat around the X axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateX(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around the Y axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateY(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around the Z axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat by a given quaternion (a * q)\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {ReadonlyQuat} q quaternion to rotate by\r\n * @returns {quat2} out\r\n */\n\nexport function rotateByQuatAppend(out, a, q) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n}\n/**\r\n * Rotates a dual quat by a given quaternion (q * a)\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat} q quaternion to rotate by\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @returns {quat2} out\r\n */\n\nexport function rotateByQuatPrepend(out, q, a) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n bx = a[0],\n by = a[1],\n bz = a[2],\n bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around a given axis. Does the normalisation automatically\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @param {Number} rad how far the rotation should be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateAroundAxis(out, a, axis, rad) {\n //Special case for rad = 0\n if (Math.abs(rad) < glMatrix.EPSILON) {\n return copy(out, a);\n }\n\n var axisLength = Math.hypot(axis[0], axis[1], axis[2]);\n rad = rad * 0.5;\n var s = Math.sin(rad);\n var bx = s * axis[0] / axisLength;\n var by = s * axis[1] / axisLength;\n var bz = s * axis[2] / axisLength;\n var bw = Math.cos(rad);\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Adds two dual quat's\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n}\n/**\r\n * Multiplies two dual quat's\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {quat2} out\r\n */\n\nexport function multiply(out, a, b) {\n var ax0 = a[0],\n ay0 = a[1],\n az0 = a[2],\n aw0 = a[3],\n bx1 = b[4],\n by1 = b[5],\n bz1 = b[6],\n bw1 = b[7],\n ax1 = a[4],\n ay1 = a[5],\n az1 = a[6],\n aw1 = a[7],\n bx0 = b[0],\n by0 = b[1],\n bz0 = b[2],\n bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n}\n/**\r\n * Alias for {@link quat2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Scales a dual quat by a scalar number\r\n *\r\n * @param {quat2} out the receiving dual quat\r\n * @param {ReadonlyQuat2} a the dual quat to scale\r\n * @param {Number} b amount to scale the dual quat by\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n}\n/**\r\n * Calculates the dot product of two dual quat's (The dot product of the real parts)\r\n *\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {Number} dot product of a and b\r\n * @function\r\n */\n\nexport var dot = quat.dot;\n/**\r\n * Performs a linear interpolation between two dual quats's\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5)\r\n *\r\n * @param {quat2} out the receiving dual quat\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat2} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var mt = 1 - t;\n if (dot(a, b) < 0) t = -t;\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n}\n/**\r\n * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a dual quat to calculate inverse of\r\n * @returns {quat2} out\r\n */\n\nexport function invert(out, a) {\n var sqlen = squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n}\n/**\r\n * Calculates the conjugate of a dual quat\r\n * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result.\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat2} a quat to calculate conjugate of\r\n * @returns {quat2} out\r\n */\n\nexport function conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n}\n/**\r\n * Calculates the length of a dual quat\r\n *\r\n * @param {ReadonlyQuat2} a dual quat to calculate length of\r\n * @returns {Number} length of a\r\n * @function\r\n */\n\nexport var length = quat.length;\n/**\r\n * Alias for {@link quat2.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Calculates the squared length of a dual quat\r\n *\r\n * @param {ReadonlyQuat2} a dual quat to calculate squared length of\r\n * @returns {Number} squared length of a\r\n * @function\r\n */\n\nexport var squaredLength = quat.squaredLength;\n/**\r\n * Alias for {@link quat2.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Normalize a dual quat\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a dual quaternion to normalize\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function normalize(out, a) {\n var magnitude = squaredLength(a);\n\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n var a0 = a[0] / magnitude;\n var a1 = a[1] / magnitude;\n var a2 = a[2] / magnitude;\n var a3 = a[3] / magnitude;\n var b0 = a[4];\n var b1 = a[5];\n var b2 = a[6];\n var b3 = a[7];\n var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n\n return out;\n}\n/**\r\n * Returns a string representation of a dual quatenion\r\n *\r\n * @param {ReadonlyQuat2} a dual quaternion to represent as a string\r\n * @returns {String} string representation of the dual quat\r\n */\n\nexport function str(a) {\n return \"quat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \")\";\n}\n/**\r\n * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyQuat2} a the first dual quaternion.\r\n * @param {ReadonlyQuat2} b the second dual quaternion.\r\n * @returns {Boolean} true if the dual quaternions are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7];\n}\n/**\r\n * Returns whether or not the dual quaternions have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyQuat2} a the first dual quat.\r\n * @param {ReadonlyQuat2} b the second dual quat.\r\n * @returns {Boolean} true if the dual quats are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7));\n}","import * as glMatrix from \"./common.js\";\n/**\r\n * 2 Dimensional Vector\r\n * @module vec2\r\n */\n\n/**\r\n * Creates a new, empty vec2\r\n *\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(2);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec2 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec2} a vector to clone\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\r\n * Creates a new vec2 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function fromValues(x, y) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\r\n * Copy the values from one vec2 to another\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the source vector\r\n * @returns {vec2} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\r\n * Set the components of a vec2 to the given values\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} out\r\n */\n\nexport function set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\r\n * Adds two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n}\n/**\r\n * Multiplies two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n}\n/**\r\n * Divides two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to ceil\r\n * @returns {vec2} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to floor\r\n * @returns {vec2} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n}\n/**\r\n * Math.round the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to round\r\n * @returns {vec2} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n}\n/**\r\n * Scales a vec2 by a scalar number\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec2} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n}\n/**\r\n * Adds two vec2's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec2} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return Math.hypot(x, y);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return x * x + y * y;\n}\n/**\r\n * Calculates the length of a vec2\r\n *\r\n * @param {ReadonlyVec2} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0],\n y = a[1];\n return Math.hypot(x, y);\n}\n/**\r\n * Calculates the squared length of a vec2\r\n *\r\n * @param {ReadonlyVec2} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0],\n y = a[1];\n return x * x + y * y;\n}\n/**\r\n * Negates the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to negate\r\n * @returns {vec2} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to invert\r\n * @returns {vec2} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n return out;\n}\n/**\r\n * Normalize a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to normalize\r\n * @returns {vec2} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0],\n y = a[1];\n var len = x * x + y * y;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n}\n/**\r\n * Computes the cross product of two vec2's\r\n * Note that the cross product must by definition produce a 3D vector\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function cross(out, a, b) {\n var z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec2} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0],\n ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec2} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n out[0] = Math.cos(r) * scale;\n out[1] = Math.sin(r) * scale;\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat2} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat2(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat2d\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat2d} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat2d(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat3\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat3} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat3(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat4\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0];\n var y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n}\n/**\r\n * Rotate a 2D vector\r\n * @param {vec2} out The receiving vec2\r\n * @param {ReadonlyVec2} a The vec2 point to rotate\r\n * @param {ReadonlyVec2} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec2} out\r\n */\n\nexport function rotate(out, a, b, rad) {\n //Translate point to the origin\n var p0 = a[0] - b[0],\n p1 = a[1] - b[1],\n sinC = Math.sin(rad),\n cosC = Math.cos(rad); //perform rotation and translate to correct position\n\n out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n}\n/**\r\n * Get the angle between two 2D vectors\r\n * @param {ReadonlyVec2} a The first operand\r\n * @param {ReadonlyVec2} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nexport function angle(a, b) {\n var x1 = a[0],\n y1 = a[1],\n x2 = b[0],\n y2 = b[1],\n // mag is the product of the magnitudes of a and b\n mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2),\n // mag &&.. short circuits if mag == 0\n cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\n\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\r\n * Set the components of a vec2 to zero\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @returns {vec2} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec2} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec2(\" + a[0] + \", \" + a[1] + \")\";\n}\n/**\r\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec2} a The first vector.\r\n * @param {ReadonlyVec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec2} a The first vector.\r\n * @param {ReadonlyVec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1];\n var b0 = b[0],\n b1 = b[1];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1));\n}\n/**\r\n * Alias for {@link vec2.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec2.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec2.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec2.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec2.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec2.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec2s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 2;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n }\n\n return a;\n };\n}();","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Scene = void 0;\nconst SceneChild_1 = require(\"./SceneChild\");\nconst Group_1 = require(\"./Group\");\nconst Shape_1 = require(\"./shapes/Shape\");\nconst Utilities_1 = require(\"./Utilities\");\n/**\n * Container for all SceneChild.\n * The main purpose is to manage the drawing order and update the child buffers\n *\n * @order 1\n * @category Core.Scene\n * @class Scene\n */\nclass Scene {\n /**\n * Creates an instance of Scene.\n * You can see the default values in the property definitions\n */\n constructor(settings = {}) {\n /**\n * Logical number, the drawer will take care of defining the unit of measure\n */\n this.width = 400;\n /**\n * Logical number, the drawer will take care of defining the unit of measure\n */\n this.height = 400;\n /**\n * Default background color (black)\n */\n this.background = 'hsla(0, 0%, 0%, 1)';\n /**\n * Default ScenePrimitive stroke color (white)\n */\n this.color = 'hsla(0, 0%, 100%, 1)';\n /**\n * Current time\n */\n this.currentTime = 0;\n if (typeof settings.width !== 'undefined')\n this.width = settings.width;\n if (typeof settings.height !== 'undefined')\n this.height = settings.height;\n if (typeof settings.background !== 'undefined')\n this.background = settings.background;\n if (typeof settings.color !== 'undefined')\n this.color = settings.color;\n this.children = [];\n this.center = [this.width / 2, this.height / 2];\n this.anchor =\n settings.anchor && Array.isArray(settings.anchor)\n ? [\n typeof settings.anchor[0] === 'number'\n ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[0]) * 0.5) * this.width\n : settings.anchor[0] === 'left'\n ? 0\n : settings.anchor[0] === 'right'\n ? this.width\n : this.center[0],\n typeof settings.anchor[1] === 'number'\n ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[1]) * 0.5) * this.height\n : settings.anchor[1] === 'top'\n ? 0\n : settings.anchor[1] === 'bottom'\n ? this.height\n : this.center[1],\n ]\n : [this.center[0], this.center[1]];\n }\n /**\n * Return width percentage\n *\n * @param {number} [percentage=100]\n * @returns {number}\n */\n getWidth(percentage = 100) {\n return (this.width * percentage) / 100;\n }\n /**\n * Return height percentage\n *\n * @param {number} [percentage=100]\n * @returns {number}\n */\n getHeight(percentage = 100) {\n return (this.height * percentage) / 100;\n }\n /**\n * Resize the scene size\n *\n * @param {number} width\n * @param {number} [height=width]\n * @memberof Scene\n */\n resize(width, height = width) {\n this.width = width;\n this.height = height;\n this.center = [this.width / 2, this.height / 2];\n const anchor = [this.width / this.anchor[0], this.height / this.anchor[1]];\n this.anchor = [this.width / anchor[0], this.height / anchor[1]];\n this.children.forEach(sceneChild => sceneChild.clearBuffer(true, false));\n }\n /**\n * Update all children, generate a streamable buffer for drawing\n *\n * @param {number} [atTime] time in ms\n * @memberof Scene\n */\n update(atTime = 0) {\n this.currentTime = atTime;\n for (let i = 0, len = this.children.length; i < len; i++) {\n this.children[i].generate(this.currentTime, true);\n }\n }\n /**\n * Traverse the child buffer and use it with callback\n *\n * @param {(streamArguments: IStreamArguments) => void} callback\n * @memberof Scene\n */\n stream(callback) {\n this.children.forEach(sceneChild => sceneChild.stream(callback));\n }\n /*\n |--------------------------------------------------------------------------\n | SceneChild\n |--------------------------------------------------------------------------\n */\n /**\n * Return a list of children\n *\n * @returns {Array}\n * @memberof Scene\n */\n getChildren() {\n return this.children;\n }\n /**\n * Add SceneChild to Scene, pass `order` as last parameter for drawing priorities\n *\n * @param {Array} items\n * @param {number} [order]\n * @memberof Scene\n */\n add(...items /**, order: number */) {\n const order = typeof items[items.length - 1] === 'number' ? items[items.length - 1] : undefined;\n const len = items.length - (typeof order === 'undefined' ? 0 : 1);\n for (let i = 0; i < len; i++) {\n const item = items[i];\n item.order =\n typeof order !== 'undefined'\n ? order + i\n : typeof item.order !== 'undefined'\n ? item.order\n : this.children.length > 0\n ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1\n : 0;\n Scene.propagateToChilden(item, this);\n this.children.push(item);\n item.clearBuffer(true, false);\n item.generate(0, true);\n }\n this.sortChildren();\n }\n /**\n * Sort children by order\n *\n * @memberof Scene\n */\n sortChildren() {\n this.children.sort((a, b) => a.order - b.order);\n this.children = this.children.map((child, index) => {\n child.order = index;\n return child;\n });\n }\n /**\n * Find sceneChild from id or name in the whole scene\n *\n * @param {string | number} idOrName\n * @returns {(SceneChild | null)}\n * @memberof Scene\n */\n find(idOrName) {\n const children = this.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const result = children[i].find(idOrName);\n if (result !== null)\n return result;\n }\n return null;\n }\n /**\n * Get shape by index\n *\n * @param {number} index\n * @returns {(SceneChild | null)}\n * @memberof Scene\n */\n get(index) {\n return index >= 0 && index < this.children.length ? this.children[index] : null;\n }\n /**\n * Remove a shape by index\n *\n * @param {number} index\n * @memberof Scene\n */\n remove(index) {\n index >= 0 && index < this.children.length && this.children.splice(index, 1);\n }\n /**\n * Removes all children\n *\n * @memberof Scene\n */\n removeChildren() {\n this.children = [];\n }\n /**\n * Remove sceneChild by id or name\n *\n * @param {number | number} idOrName\n * @memberof Scene\n */\n removeFromId(idOrName) {\n for (let i = 0, len = this.children.length; i < len; i++)\n if (this.children[i].id === idOrName || this.children[i].name === idOrName) {\n this.children.splice(i, 1);\n return;\n }\n }\n /**\n * Return true if sceneChild is direct children\n *\n * @param {SceneChild} sceneChild\n * @returns {boolean}\n * @memberof Scene\n */\n isFirstLevelChild(sceneChild) {\n for (let i = 0, len = this.children.length; i < len; i++)\n if (this.children[i].id === sceneChild.id)\n return true;\n const parents = this.getParentsOfSceneChild(sceneChild);\n return parents.length === 1 && parents[0] instanceof Group_1.Group;\n }\n /**\n * Returns the list of sceneChild hierarchy starting from the scene\n *\n * @param {SceneChild} sceneChild\n * @returns {Array}\n * @memberof Scene\n */\n getParentsOfSceneChild(sceneChild) {\n const result = Scene.getParentsOfSceneChild(this, sceneChild);\n if (result) {\n result.splice(0, 1);\n return result;\n }\n return [];\n }\n /**\n * Returns the list of sceneChild hierarchy starting from the scene\n *\n * @static\n * @param {(Scene | SceneChild)} current\n * @param {SceneChild} sceneChild\n * @param {(Array)} [parents=[]]\n * @returns {(Array | null)}\n * @memberof Scene\n */\n static getParentsOfSceneChild(current, sceneChild, parents = []) {\n let result;\n if (current instanceof SceneChild_1.SceneChild) {\n if (current.id == sceneChild.id)\n return parents;\n if (current instanceof Shape_1.Shape && current.shape) {\n const tmpParents = parents.slice();\n tmpParents.push(current);\n if ((result = Scene.getParentsOfSceneChild(current.shape, sceneChild, tmpParents)))\n return result;\n }\n }\n if (current instanceof Scene || current instanceof Group_1.Group) {\n const children = current.getChildren();\n parents.push(current);\n for (let i = 0, len = children.length; i < len; i++) {\n const child = children[i];\n if ((result = Scene.getParentsOfSceneChild(child, sceneChild, parents)))\n return result;\n }\n parents.pop();\n }\n return null;\n }\n /**\n * Walk through the scene\n *\n * @static\n * @param {SceneChild} callbackk\n * @param {(Scene | SceneChild)} current\n * @memberof Scene\n */\n static walk(callback, current) {\n if (current instanceof SceneChild_1.SceneChild) {\n if (callback(current) === false)\n return false;\n if (current instanceof Shape_1.Shape && current.shape)\n if (Scene.walk(callback, current.shape) === false)\n return false;\n }\n if (current instanceof Scene || current instanceof Group_1.Group) {\n const children = current.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const child = children[i];\n if (Scene.walk(callback, child) === false)\n return false;\n }\n }\n }\n /**\n * Propagate scene to sceneChild (and children)\n *\n * @static\n * @param {SceneChild} sceneChild\n * @param {Scene} scene\n * @memberof Scene\n */\n static propagateToChilden(sceneChild, scene) {\n sceneChild.scene = scene;\n if (sceneChild instanceof Group_1.Group) {\n sceneChild.getChildren().forEach((item) => {\n Scene.propagateToChilden(item, scene);\n });\n }\n else if (sceneChild instanceof Shape_1.Shape && sceneChild.shape) {\n sceneChild.shape.scene = scene;\n Scene.propagateToChilden(sceneChild.shape, scene);\n }\n }\n}\nexports.Scene = Scene;\n//# sourceMappingURL=Scene.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SceneChild = void 0;\n/**\n * Autoincrement sceneChild default id\n *\n * @internal\n * @ignore\n */\nlet __id = 0;\n/**\n * The element to be added into a scene.\n * Preserve props, drawing order, generate and return buffers.\n * The only implementations of this class are Group and ShapeBase\n *\n * @abstract\n * @category Core.Abstract\n * @order 2\n * @class SceneChild\n */\nclass SceneChild {\n /**\n * Creates an instance of SceneChild.\n * Base values will be assigned in case they are not passed\n *\n * @param {ISceneChildSettings} settings\n */\n constructor(settings) {\n var _a;\n /**\n * Shape generation id\n * used for prevent buffer calculation\n *\n * @internal\n * @ignore\n */\n this.generateId = -1;\n this.id = (_a = settings.id) !== null && _a !== void 0 ? _a : ++__id;\n this.type = settings.type || 'SceneChild';\n this.name = settings.name || this.type + '_' + this.id;\n this.data = settings.data || {};\n this.props = {};\n }\n /**\n * Find this or form or children.\n * Overridden by classes that extend it\n *\n * @param {string | number} idOrName\n * @returns {(SceneChild | null)}\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n return null;\n }\n /**\n * Return the sceneChild properties\n *\n * @returns {Props}\n */\n getProps() {\n return this.props;\n }\n /**\n * Return a sceneChild prop or default value\n *\n * @param {keyof Props} key\n * @param {PropArguments} [propArguments]\n * @param {*} [defaultValue]\n * @returns {*}\n */\n getProp(key, propArguments, defaultValue) {\n var _a;\n return ((_a = this.props[key]) !== null && _a !== void 0 ? _a : defaultValue);\n }\n /**\n * Check SceneChild has prop\n *\n * @param {keyof Props} key\n * @returns\n */\n hasProp(key) {\n return typeof this.props[key] !== 'undefined';\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n */\n setPropUnsafe(key, value) {\n if (typeof key == 'string')\n this.props[key] = value;\n else\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n }\n}\nexports.SceneChild = SceneChild;\n//# sourceMappingURL=SceneChild.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Group = void 0;\nconst Scene_1 = require(\"./Scene\");\nconst SceneChild_1 = require(\"./SceneChild\");\nconst ShapeBase_1 = require(\"./shapes/ShapeBase\");\nconst Adapt_1 = require(\"./modifiers/Adapt\");\n/**\n * A SceneChild container, propagates properties to children\n *\n * @order 3\n * @category Core.Scene\n * @extends {SceneChild}\n * @example\n * ```javascript\n * // Group example\n *\n * const rect = new Urpflanze.Rect({\n * \tdistance: 100 // <- if a property is set the group will not overwrite it\n * })\n * const group = new Urpflanze.Group({\n * \trepetitions: 3,\n * \tdistance: 200\n * })\n *\n * group.add(rect)\n * group.add(new Urpflanze.Triangle())\n * ```\n * @class Group\n */\nclass Group extends SceneChild_1.SceneChild {\n /**\n * Creates an instance of Group\n *\n * @param {ISceneChildSettings} [settings={}]\n * @memberof Group\n */\n constructor(settings = {}) {\n settings.type = 'Group';\n super(settings);\n this.children = [];\n ['id', 'name', 'data', 'order', 'type'].forEach((prop) => {\n if (prop in settings)\n delete settings[prop];\n });\n this.props = settings;\n }\n /**\n * Check group has static children\n *\n * @returns {boolean}\n * @memberof Group\n */\n isStatic() {\n const children = this.children;\n for (let i = 0, len = children.length; i < len; i++)\n if (!children[i].isStatic())\n return false;\n return true;\n }\n /**\n * Check group has static children indexed\n *\n * @returns {boolean}\n * @memberof Group\n */\n isStaticIndexed() {\n const children = this.children;\n for (let i = 0, len = children.length; i < len; i++)\n if (!children[i].isStaticIndexed())\n return false;\n return true;\n }\n /**\n * Add item to Group\n *\n * @param {Array} items\n * @memberof Group\n */\n add(...items) {\n for (let i = 0, len = items.length; i < len; i++) {\n const item = items[i];\n const rawItemProps = item.getProps();\n Object.keys(this.props).forEach((propKey) => {\n if (typeof rawItemProps[propKey] === 'undefined')\n item.setProp(propKey, this.props[propKey]);\n });\n item.order =\n typeof item.order !== 'undefined'\n ? item.order\n : this.children.length > 0\n ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1\n : 0;\n this.scene && Scene_1.Scene.propagateToChilden(item, this.scene);\n this.children.push(item);\n }\n this.sortChildren();\n }\n /**\n * Sort children\n *\n * @memberof Group\n */\n sortChildren() {\n this.children.sort((a, b) => a.order - b.order);\n this.children = this.children.map((child, index) => {\n child.order = index;\n return child;\n });\n this.clearBuffer(true);\n }\n /**\n * Return shape children\n *\n * @returns {Array}\n * @memberof Group\n */\n getChildren() {\n return this.children;\n }\n /**\n * Find scene child from id or name\n *\n * @param {number | string} idOrName\n * @returns {(SceneChild | null)}\n * @memberof Group\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n const children = this.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const result = children[i].find(idOrName);\n if (result !== null)\n return result;\n }\n return null;\n }\n /**\n * Get item from group\n *\n * @param {number} index\n * @returns {(SceneChild | null)}\n * @memberof Group\n */\n get(index) {\n return index >= 0 && index < this.children.length ? this.children[index] : null;\n }\n /**\n * Remove item from group\n *\n * @param {number} index\n * @returns {(false | Array)}\n * @memberof Group\n */\n remove(index) {\n if (index >= 0 && index < this.children.length) {\n const removed = this.children.splice(index, 1);\n this.clearBuffer(true);\n return removed;\n }\n return false;\n }\n /**\n * Remove from id\n *\n * @param {number} id\n * @memberof Scene\n */\n removeFromId(id) {\n for (let i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i].id == id) {\n this.children.splice(i, 1);\n return this.clearBuffer(true);\n }\n }\n }\n /**\n * Generate children buffers\n *\n * @param {number} generateId\n * @param {boolean} [bDirectSceneChild=false]\n * @param {IPropArguments} [parentPropArguments]\n * @memberof Group\n */\n generate(generateId, bDirectSceneChild = false, parentPropArguments) {\n this.generateId = generateId;\n this.children.forEach(item => item.generate(generateId, bDirectSceneChild, parentPropArguments));\n }\n /**\n * Sum the children bounding\n *\n * @return {IShapeBounding}\n */\n getBounding() {\n const boundings = [];\n const bounding = Adapt_1.Bounding.empty();\n if (this.children.length > 0) {\n this.children.forEach(item => boundings.push(item.getBounding()));\n for (let i = 0, len = this.children.length; i < len; i++) {\n bounding.x = bounding.x > boundings[i].x ? boundings[i].x : bounding.x;\n bounding.y = bounding.y > boundings[i].y ? boundings[i].y : bounding.y;\n bounding.width = bounding.width < boundings[i].width ? boundings[i].width : bounding.width;\n bounding.height = bounding.height < boundings[i].height ? boundings[i].height : bounding.height;\n }\n bounding.cx = bounding.x + bounding.width / 2;\n bounding.cy = bounding.y + bounding.height / 2;\n }\n return bounding;\n }\n /**\n * Chear children buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @memberof Group\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.children.forEach(item => item.clearBuffer(bClearIndexed, false));\n if (this.scene && bPropagateToParents) {\n const parents = this.scene.getParentsOfSceneChild(this);\n parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */);\n }\n // if (bPropagateToParents && this.scene)\n // {\n // const parents = this.scene.getParentsOfSceneChild(this)\n // parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, true, false)\n // }\n // if (bPropagateToChildren)\n // {\n // this.children.forEach(sceneChild => sceneChild.clearBuffer(bClearIndexed, false, true))\n // }\n }\n /**\n * Set a single or multiple props\n *\n * @abstract\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @memberof SceneChild\n */\n setProp(key, value) {\n if (typeof key === 'object')\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n else\n this.props[key] = value;\n this.children.forEach(item => item.setProp(key, value));\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @memberof ShapeBase\n */\n setPropUnsafe(key, value) {\n super.setPropUnsafe(key, value);\n this.children.forEach(item => item.setPropUnsafe(key, value));\n }\n /**\n * Return length of buffer\n *\n * @param {IPropArguments} propArguments\n * @returns {number}\n * @memberof Group\n */\n getBufferLength(propArguments) {\n return this.children.map(sceneChild => sceneChild.getBufferLength(propArguments)).reduce((p, c) => p + c, 0);\n }\n /**\n * return a single buffer binded from children\n *\n * @returns {Float32Array}\n * @memberof Group\n */\n getBuffer() {\n const buffers = this.children\n .map(item => item.getBuffer())\n .filter(b => b !== undefined);\n const size = buffers.reduce((currLength, buffer) => currLength + buffer.length, 0);\n if (size > 0) {\n const result = new Float32Array(size);\n result.set(buffers[0], 0);\n for (let i = 1, offset = 0, len = buffers.length; i < len; i++) {\n offset += buffers[i - 1].length;\n result.set(buffers[i], offset);\n }\n return result;\n }\n return ShapeBase_1.ShapeBase.EMPTY_BUFFER;\n }\n /**\n * return a single buffer binded from children\n *\n * @returns {(Array | undefined)}\n * @memberof Group\n */\n getIndexedBuffer() {\n const indexed = this.children.map(item => item.getIndexedBuffer()).filter(b => b !== undefined);\n return [].concat.apply([], indexed);\n }\n /**\n * Call strem on children\n *\n * @param {(streamArguments: IStreamArguments) => void} callback\n * @memberof Group\n */\n stream(callback) {\n this.children.forEach(item => item.stream(callback));\n }\n}\nexports.Group = Group;\n//# sourceMappingURL=Group.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeBase = void 0;\nconst gl_matrix_1 = require(\"gl-matrix\");\nconst types_1 = require(\"../types\");\nconst glme = require(\"../math/gl-matrix-extensions\");\nconst Vec2_1 = require(\"../math/Vec2\");\nconst math_1 = require(\"../math\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst Utilities_1 = require(\"../Utilities\");\nconst SceneChild_1 = require(\"../SceneChild\");\nconst tmpMatrix = gl_matrix_1.mat4.create();\nconst transformMatrix = gl_matrix_1.mat4.create();\nconst perspectiveMatrix = gl_matrix_1.mat4.create();\nconst repetitionMatrix = gl_matrix_1.mat4.create();\n/**\n * Main class for shape generation\n *\n * @category Core.Abstract\n * @abstract\n * @class ShapeBase\n * @order 4\n * @extends {SceneChild}\n */\nclass ShapeBase extends SceneChild_1.SceneChild {\n /**\n * Creates an instance of ShapeBase\n *\n * @param {ISceneChildSettings} [settings={}]\n */\n constructor(settings = {}) {\n super(settings);\n /**\n * Flag used to determine if indexedBuffer has been generated\n *\n * @internal\n * @ignore\n */\n this.bIndexed = false;\n /**\n * Array used for index a vertex buffer\n * only for first level scene children\n *\n * @internal\n * @ignore\n */\n this.indexedBuffer = [];\n /**\n * The bounding inside the scene\n *\n * @type {IShapeBounding}\n */\n this.bounding = {\n cx: 0,\n cy: 0,\n x: -1,\n y: -1,\n width: 2,\n height: 2,\n };\n this.props = {\n distance: settings.distance,\n repetitions: settings.repetitions,\n rotateX: settings.rotateX,\n rotateY: settings.rotateY,\n rotateZ: settings.rotateZ,\n skewX: settings.skewX,\n skewY: settings.skewY,\n squeezeX: settings.squeezeX,\n squeezeY: settings.squeezeY,\n displace: settings.displace,\n translate: settings.translate,\n scale: settings.scale,\n transformOrigin: settings.transformOrigin,\n perspective: settings.perspective,\n perspectiveOrigin: settings.perspectiveOrigin,\n };\n this.anchor =\n settings.anchor && Array.isArray(settings.anchor)\n ? [\n typeof settings.anchor[0] === 'number'\n ? Utilities_1.clamp(-1, 1, settings.anchor[0]) * -1\n : settings.anchor[0] === 'left'\n ? 1\n : settings.anchor[0] === 'right'\n ? -1\n : 0,\n typeof settings.anchor[1] === 'number'\n ? Utilities_1.clamp(-1, 1, settings.anchor[1]) * -1\n : settings.anchor[1] === 'top'\n ? 1\n : settings.anchor[1] === 'bottom'\n ? -1\n : 0,\n ]\n : [0, 0];\n this.boundingType =\n typeof settings.boundingType === 'string'\n ? settings.boundingType === 'relative'\n ? types_1.EBoundingType.Relative\n : types_1.EBoundingType.Fixed\n : settings.boundingType || types_1.EBoundingType.Fixed;\n this.vertexCallback = settings.vertexCallback;\n }\n /**\n * Check if the shape should be generated every time\n *\n * @returns {boolean}\n */\n isStatic() {\n const props = this.props;\n return (typeof props.repetitions !== 'function' &&\n typeof props.distance !== 'function' &&\n typeof props.displace !== 'function' &&\n typeof props.scale !== 'function' &&\n typeof props.translate !== 'function' &&\n typeof props.skewX !== 'function' &&\n typeof props.skewY !== 'function' &&\n typeof props.squeezeX !== 'function' &&\n typeof props.squeezeY !== 'function' &&\n typeof props.rotateX !== 'function' &&\n typeof props.rotateY !== 'function' &&\n typeof props.rotateZ !== 'function' &&\n typeof props.transformOrigin !== 'function' &&\n typeof props.perspective !== 'function' &&\n typeof props.perspectiveOrigin !== 'function');\n }\n /**\n * Check if the indexedBuffer array needs to be recreated every time,\n * this can happen when a shape generates an array of vertices different in length at each repetition\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return typeof this.props.repetitions !== 'function';\n }\n /**\n * Return a prop value\n *\n * @param {keyof ISceneChildProps} key\n * @param {PropArguments} [propArguments]\n * @param {*} [defaultValue]\n * @returns {*}\n */\n getProp(key, propArguments, defaultValue) {\n let attribute = this.props[key];\n if (typeof attribute === 'function') {\n attribute = attribute(propArguments);\n }\n return typeof attribute === 'undefined' || Number.isNaN(attribute) ? defaultValue : attribute;\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @param {boolean} [bClearIndexed=false]\n */\n setProp(key, value, bClearIndexed = false) {\n if (typeof key === 'string') {\n bClearIndexed = bClearIndexed || key == 'repetitions';\n this.props[key] = value;\n }\n else {\n bClearIndexed = bClearIndexed || 'repetitions' in key;\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n }\n this.clearBuffer(bClearIndexed, true);\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.buffer = undefined;\n if (bClearIndexed) {\n this.bIndexed = false;\n this.indexedBuffer = [];\n }\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n if (bPropagateToParents && this.scene && !this.scene.isFirstLevelChild(this)) {\n const parents = this.scene.getParentsOfSceneChild(this);\n parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */);\n }\n }\n /**\n * Update the vertex array if the shape is not static and update the indexedBuffer if it is also not static\n *\n * @param {number} generateId generation id\n * @param {boolean} [bDirectSceneChild=false] adjust shape of center of scene\n * @param {PropArguments} [parentPropArguments]\n */\n generate(generateId = 0, bDirectSceneChild = false, parentPropArguments) {\n var _a, _b;\n if (this.buffer && this.bStatic) {\n return;\n }\n this.generateId = generateId;\n if (!this.bStaticIndexed || !this.bIndexed)\n this.indexedBuffer = [];\n const propArguments = ShapeBase.getEmptyPropArguments(this, parentPropArguments);\n const repetition = propArguments.repetition;\n const repetitions = this.getProp('repetitions', propArguments, 1);\n const repetitionType = Array.isArray(repetitions) ? types_1.ERepetitionType.Matrix : types_1.ERepetitionType.Ring;\n const repetitionCount = Array.isArray(repetitions)\n ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0])\n : repetitions;\n const repetitionRowCount = Array.isArray(repetitions) ? repetitions[0] : repetitionCount;\n const repetitionColCount = Array.isArray(repetitions) ? (_b = repetitions[1]) !== null && _b !== void 0 ? _b : repetitions[0] : 1;\n const rowRepetition = repetition.row;\n rowRepetition.count = repetitionRowCount;\n const colRepetition = repetition.col;\n colRepetition.count = repetitionColCount;\n repetition.count = repetitionCount;\n repetition.col.count = repetitionColCount;\n repetition.row.count = repetitionRowCount;\n repetition.type = repetitionType;\n let totalBufferLength = 0;\n const buffers = [];\n let currentIndex = 0;\n const centerMatrix = gl_matrix_1.vec2.fromValues((repetitionColCount - 1) / 2, (repetitionRowCount - 1) / 2);\n const sceneAnchor = this.scene ? [this.scene.anchor[0], this.scene.anchor[1], 0] : [0, 0, 0];\n const tmpTotalShapeBounding = [undefined, undefined, undefined, undefined];\n const tmpSingleRepetitionBounding = [undefined, undefined, undefined, undefined];\n for (let currentRowRepetition = 0; currentRowRepetition < repetitionRowCount; currentRowRepetition++) {\n for (let currentColRepetition = 0; currentColRepetition < repetitionColCount; currentColRepetition++, currentIndex++) {\n repetition.index = currentIndex + 1;\n repetition.offset = repetitionCount > 1 ? currentIndex / (repetitionCount - 1) : 1;\n repetition.angle = repetitionType === types_1.ERepetitionType.Ring ? (math_1.PI2 / repetitionCount) * currentIndex : 0;\n colRepetition.index = currentColRepetition + 1;\n colRepetition.offset = repetitionColCount > 1 ? currentColRepetition / (repetitionColCount - 1) : 1;\n rowRepetition.index = currentRowRepetition + 1;\n rowRepetition.offset = repetitionRowCount > 1 ? currentRowRepetition / (repetitionRowCount - 1) : 1;\n // Generate primitives buffer recursively\n const buffer = this.generateBuffer(generateId, propArguments);\n const bufferLength = buffer.length;\n const bounding = this.getShapeBounding();\n buffers[currentIndex] = new Float32Array(bufferLength);\n totalBufferLength += bufferLength;\n {\n const distance = glme.toVec2(this.getProp('distance', propArguments, glme.VEC2_ZERO));\n const displace = this.getProp('displace', propArguments, 0);\n const scale = glme.toVec3(this.getProp('scale', propArguments, glme.VEC2_ONE), 1);\n const translate = glme.toVec3(this.getProp('translate', propArguments, glme.VEC2_ZERO), 0);\n const skewX = this.getProp('skewX', propArguments, 0);\n const skewY = this.getProp('skewY', propArguments, 0);\n const squeezeX = this.getProp('squeezeX', propArguments, 0);\n const squeezeY = this.getProp('squeezeY', propArguments, 0);\n const rotateX = this.getProp('rotateX', propArguments, 0);\n const rotateY = this.getProp('rotateY', propArguments, 0);\n const rotateZ = this.getProp('rotateZ', propArguments, 0);\n const perspective = Utilities_1.clamp(0, 1, this.getProp('perspective', propArguments, 0));\n const perspectiveOrigin = glme.toVec3(this.getProp('perspectiveOrigin', propArguments, glme.VEC2_ZERO), 0);\n const transformOrigin = glme.toVec3(this.getProp('transformOrigin', propArguments, glme.VEC2_ZERO), 0);\n let offset;\n switch (repetitionType) {\n case types_1.ERepetitionType.Ring:\n offset = gl_matrix_1.vec3.fromValues(distance[0], 0, 0);\n gl_matrix_1.vec3.rotateZ(offset, offset, glme.VEC3_ZERO, repetition.angle + displace);\n break;\n case types_1.ERepetitionType.Matrix:\n offset = gl_matrix_1.vec3.fromValues(distance[1] * (currentColRepetition - centerMatrix[0]), distance[0] * (currentRowRepetition - centerMatrix[1]), 0);\n break;\n }\n const perspectiveSize = perspective > 0 ? Math.max(bounding.width, bounding.height) / 2 : 1;\n const perspectiveValue = perspective > 0 ? perspectiveSize + (1 - perspective) * (perspectiveSize * 10) : 0;\n const bTransformOrigin = (this.boundingType === types_1.EBoundingType.Relative ? bounding.cx !== 0 || bounding.cy !== 0 : true) ||\n perspective !== 0 ||\n transformOrigin[0] !== 0 ||\n transformOrigin[1] !== 0;\n const bPerspectiveOrigin = perspectiveOrigin[0] !== 0 || perspectiveOrigin[1] !== 0;\n if (bTransformOrigin) {\n if (this.boundingType === types_1.EBoundingType.Relative) {\n transformOrigin[0] = transformOrigin[0] * (bounding.width / 2) + bounding.cx;\n transformOrigin[1] = transformOrigin[1] * (bounding.height / 2) + bounding.cy;\n }\n else {\n transformOrigin[0] *= bounding.width / 2;\n transformOrigin[1] *= bounding.height / 2;\n }\n transformOrigin[2] = perspectiveValue;\n }\n /**\n * Create Matrices\n */\n {\n /**\n * Create Transformation matrix\n */\n gl_matrix_1.mat4.identity(transformMatrix);\n bTransformOrigin && gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, transformOrigin);\n if (translate[0] !== 0 || translate[1] !== 0)\n gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, translate);\n if (skewX !== 0 || skewY !== 0) {\n glme.fromSkew(tmpMatrix, [skewX, skewY]);\n gl_matrix_1.mat4.multiply(transformMatrix, transformMatrix, tmpMatrix);\n }\n rotateX !== 0 && gl_matrix_1.mat4.rotateX(transformMatrix, transformMatrix, rotateX);\n rotateY !== 0 && gl_matrix_1.mat4.rotateY(transformMatrix, transformMatrix, rotateY);\n rotateZ !== 0 && gl_matrix_1.mat4.rotateZ(transformMatrix, transformMatrix, rotateZ);\n if (scale[0] !== 1 || scale[1] !== 1)\n gl_matrix_1.mat4.scale(transformMatrix, transformMatrix, scale);\n bTransformOrigin &&\n gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, gl_matrix_1.vec3.scale(transformOrigin, transformOrigin, -1));\n /**\n * Create Perspective matrix\n */\n if (perspectiveValue > 0) {\n if (bPerspectiveOrigin) {\n if (this.boundingType === types_1.EBoundingType.Relative) {\n perspectiveOrigin[0] = perspectiveOrigin[0] * (bounding.width / 2) + bounding.cx;\n perspectiveOrigin[1] = perspectiveOrigin[1] * (bounding.height / 2) + bounding.cy;\n }\n else {\n perspectiveOrigin[0] *= bounding.width / 2;\n perspectiveOrigin[1] *= bounding.height / 2;\n }\n perspectiveOrigin[2] = 0;\n }\n gl_matrix_1.mat4.perspective(perspectiveMatrix, -Math.PI / 2, 1, 0, Infinity);\n }\n /**\n * Create Repetition matrix\n */\n gl_matrix_1.mat4.identity(repetitionMatrix);\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, offset);\n if (bDirectSceneChild) {\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, sceneAnchor);\n }\n /**\n * Apply anchor\n */\n const shapeAnchor = [this.anchor[0] * (bounding.width / 2), this.anchor[1] * (bounding.height / 2), 0];\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, shapeAnchor);\n if (repetitionType === types_1.ERepetitionType.Ring)\n gl_matrix_1.mat4.rotateZ(repetitionMatrix, repetitionMatrix, repetition.angle + displace);\n }\n Adapt_1.Bounding.clear(tmpSingleRepetitionBounding);\n // Apply matrices on vertex\n for (let bufferIndex = 0; bufferIndex < bufferLength; bufferIndex += 2) {\n const vertex = [buffer[bufferIndex], buffer[bufferIndex + 1], perspectiveValue];\n {\n // Apply squeeze, can be insert into transformMatrix?\n squeezeX !== 0 && Vec2_1.default.squeezeX(vertex, squeezeX);\n squeezeY !== 0 && Vec2_1.default.squeezeY(vertex, squeezeY);\n // Apply transforms\n gl_matrix_1.vec3.transformMat4(vertex, vertex, transformMatrix);\n // Apply perspective\n if (perspectiveValue > 0) {\n bPerspectiveOrigin && gl_matrix_1.vec3.add(vertex, vertex, perspectiveOrigin);\n gl_matrix_1.vec3.transformMat4(vertex, vertex, perspectiveMatrix);\n gl_matrix_1.vec3.scale(vertex, vertex, perspectiveValue);\n bPerspectiveOrigin && gl_matrix_1.vec3.sub(vertex, vertex, perspectiveOrigin);\n }\n // apply repetition matrix\n gl_matrix_1.vec3.transformMat4(vertex, vertex, repetitionMatrix);\n // custom vertex manipulation\n if (typeof this.vertexCallback !== 'undefined') {\n const index = bufferIndex / 2;\n const count = bufferLength / 2;\n const vertexRepetition = {\n index: index + 1,\n count,\n offset: count > 1 ? index / (count - 1) : 1,\n };\n this.vertexCallback(vertex, vertexRepetition, propArguments);\n }\n }\n buffers[currentIndex][bufferIndex] = vertex[0];\n buffers[currentIndex][bufferIndex + 1] = vertex[1];\n Adapt_1.Bounding.add(tmpSingleRepetitionBounding, vertex[0], vertex[1]);\n Adapt_1.Bounding.add(tmpTotalShapeBounding, vertex[0], vertex[1]);\n }\n }\n // Bounding.sum(tmpTotalShapeBounding, tmpSingleRepetitionBounding)\n // After buffer creation, add a frame into indexedBuffer if not static or update bounding\n const singleRepetitionBounding = { cx: 0, cy: 0, x: -1, y: -1, width: 2, height: 2 };\n Adapt_1.Bounding.bind(singleRepetitionBounding, tmpSingleRepetitionBounding);\n if (!this.bStaticIndexed || !this.bIndexed) {\n this.addIndex(bufferLength, repetition, singleRepetitionBounding);\n }\n }\n }\n Adapt_1.Bounding.bind(this.bounding, tmpTotalShapeBounding);\n this.buffer = new Float32Array(totalBufferLength);\n for (let i = 0, offset = 0, len = buffers.length; i < len; offset += buffers[i].length, i++)\n this.buffer.set(buffers[i], offset);\n this.bIndexed = true;\n }\n /**\n * Return current shape (whit repetions) bounding\n *\n * @return {*} {IShapeBounding}\n */\n getBounding() {\n return this.bounding;\n }\n /**\n * Get number of repetitions\n *\n * @returns {number}\n */\n getRepetitionCount() {\n var _a;\n const repetitions = this.getProp('repetitions', undefined, 1);\n return Array.isArray(repetitions) ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) : repetitions;\n }\n /**\n * Return buffer\n *\n * @returns {(Float32Array | undefined)}\n */\n getBuffer() {\n return this.buffer;\n }\n /**\n * Return indexed buffer\n *\n * @returns {(Array> | undefined)}\n */\n getIndexedBuffer() {\n return this.indexedBuffer;\n }\n /**\n * Return number of encapsulation\n *\n * @param {IBufferIndex} index\n * @returns {number}\n */\n static getIndexParentLevel(index) {\n if (typeof index.parent === 'undefined')\n return 0;\n let currentParent = index.parent;\n let currentParentLevel = 1;\n while (typeof currentParent.parent !== 'undefined') {\n currentParentLevel++;\n currentParent = currentParent.parent;\n }\n return currentParentLevel;\n }\n /**\n * Stream buffer\n *\n * @param {(TStreamCallback} callback\n */\n stream(callback) {\n if (this.buffer && this.indexedBuffer) {\n for (let i = 0, j = 0, len = this.indexedBuffer.length; i < len; i++) {\n const currentIndexing = this.indexedBuffer[i];\n callback({\n buffer: this.buffer,\n frameLength: currentIndexing.frameLength,\n frameBufferIndex: j,\n currentIndexing: currentIndexing,\n currentShapeIndex: i,\n totalShapes: len,\n });\n j += currentIndexing.frameLength;\n }\n }\n }\n /**\n * Return empty propArguments\n *\n * @static\n * @param {ShapeBase} shape\n * @return {*} {PropArguments}\n */\n static getEmptyPropArguments(shape, parentPropArguments) {\n const repetition = {\n type: types_1.ERepetitionType.Ring,\n angle: 0,\n index: 1,\n offset: 1,\n count: 1,\n row: { index: 1, offset: 1, count: 1 },\n col: { index: 1, offset: 1, count: 1 },\n };\n return {\n repetition,\n shape,\n parent: parentPropArguments,\n };\n }\n}\nexports.ShapeBase = ShapeBase;\n/**\n * Empty buffer\n *\n * @internal\n * @ignore\n */\nShapeBase.EMPTY_BUFFER = new Float32Array(0);\n/**\n * Empty BaseRepetition\n *\n * @internal\n * @ignore\n */\nShapeBase.getEmptySimpleRepetition = () => ({\n index: 1,\n offset: 1,\n count: 1,\n});\n/**\n * Empty Repetition\n *\n * @internal\n * @ignore\n */\nShapeBase.getEmptyRepetition = () => ({\n type: types_1.ERepetitionType.Ring,\n angle: 0,\n ...ShapeBase.getEmptySimpleRepetition(),\n row: ShapeBase.getEmptySimpleRepetition(),\n col: ShapeBase.getEmptySimpleRepetition(),\n});\n//# sourceMappingURL=ShapeBase.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toVec3 = exports.toVec2 = exports.fromSkew = exports.VEC2_ONE = exports.VEC2_ZERO = exports.VEC3_ONE = exports.VEC3_ZERO = void 0;\nconst gl_matrix_1 = require(\"gl-matrix\");\nexports.VEC3_ZERO = [0, 0, 0];\nexports.VEC3_ONE = [1, 1, 1];\nexports.VEC2_ZERO = [0, 0];\nexports.VEC2_ONE = [1, 1];\ngl_matrix_1.glMatrix.setMatrixArrayType(Array);\n/**\n * Skew matrix\n *\n * @internal\n * @ignore\n */\nfunction fromSkew(out, skew) {\n out[0] = 1;\n out[1] = Math.tan(skew[1]);\n out[2] = 0;\n out[3] = 0;\n out[4] = Math.tan(skew[0]);\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\nexports.fromSkew = fromSkew;\n/**\n * number to vec 2\n *\n * @internal\n * @ignore\n */\nfunction toVec2(x) {\n if (Array.isArray(x))\n return [x[0], x[1]];\n return [x, x];\n}\nexports.toVec2 = toVec2;\n/**\n * number to vec 3\n *\n * @internal\n * @ignore\n */\nfunction toVec3(x, defaultZValue = 0) {\n if (Array.isArray(x)) {\n return [x[0], x[1], defaultZValue];\n }\n return [x, x, defaultZValue];\n}\nexports.toVec3 = toVec3;\n//# sourceMappingURL=gl-matrix-extensions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Temporany matrix\n *\n * @internal\n * @ignore\n */\nconst MATRIX = new Array(4);\n/**\n * Vec2 operation\n *\n * @category Core.Utilities\n */\nconst Vec2 = {\n /**\n * from new vertex\n *\n * @param {Array | number} [x=0]\n * @param {number} [y]\n * @returns {Array}\n */\n from: (x = 0, y) => {\n const out = new Array(2);\n if (typeof x === 'number') {\n out[0] = x;\n out[1] = y !== null && y !== void 0 ? y : x;\n }\n else {\n out[0] = x[0];\n out[1] = x[1];\n }\n return out;\n },\n normalize: (v) => {\n const len = Vec2.length(v);\n return len !== 0 ? [v[0] / len, v[1] / len] : [0, 0];\n },\n /**\n * Distance between two points\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n distance: (a, b) => Math.hypot(a[0] - b[0], a[1] - b[1]),\n /**\n * dot product\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n dot: (a, b) => a[0] * b[0] + a[1] * b[1],\n /**\n * length of point\n *\n * @param {Array} vec\n * @returns {number}\n */\n length: (vec) => Math.hypot(vec[0], vec[1]),\n /**\n * angle between two point\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n angle: (a, b) => {\n a = Vec2.normalize(a);\n b = Vec2.normalize(b);\n return Math.acos(Vec2.dot(a, b));\n },\n /**\n * skewX point\n *\n * @param {Array} vec\n * @param {number} m\n */\n skewX: (vec, m) => {\n vec[0] += Math.tan(m) * vec[1];\n },\n /**\n * skewY point\n *\n * @param {Array} vec\n * @param {number} m\n */\n skewY: (vec, m) => {\n vec[1] += Math.tan(m) * vec[0];\n },\n /**\n * squeezeX point\n *\n * @param {Array} vec\n * @param {number} m\n */\n squeezeX: (vec, m) => {\n vec[1] += vec[1] * (vec[0] * -m);\n },\n /**\n * squeezeY point\n *\n * @param {Array} vec\n * @param {number} m\n */\n squeezeY: (vec, m) => {\n vec[0] += vec[0] * (vec[1] * m);\n },\n /**\n * Rotate point\n *\n * @param {Array} vec\n * @param {Array} MATRIX\n * @param {Array} fromPoint\n * @internal\n */\n rotate: (vec, MATRIX, fromPoint) => {\n const p0 = vec[0] - fromPoint[0];\n const p1 = vec[1] - fromPoint[1];\n vec[0] = p0 * MATRIX[0] + p1 * MATRIX[1] + fromPoint[0];\n vec[1] = p0 * MATRIX[2] + p1 * MATRIX[3] + fromPoint[1];\n },\n /**\n * RotateX point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateX: (vec, fromPoint, rad) => {\n MATRIX[0] = 1;\n MATRIX[1] = 0;\n MATRIX[2] = 0;\n MATRIX[3] = Math.cos(rad);\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * RotateY point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateY: (vec, fromPoint, rad) => {\n MATRIX[0] = Math.cos(rad);\n MATRIX[1] = 0;\n MATRIX[2] = 0;\n MATRIX[3] = 1;\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * RotateZ point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateZ: (vec, fromPoint, rad) => {\n MATRIX[0] = Math.cos(rad);\n MATRIX[1] = -Math.sin(rad);\n MATRIX[2] = Math.sin(rad);\n MATRIX[3] = Math.cos(rad);\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * Translate vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n translate: (vec, to) => {\n vec[0] += to[0];\n vec[1] += to[1];\n },\n /**\n * Scale vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n scale: (vec, to) => {\n vec[0] *= to[0];\n vec[1] *= to[1];\n },\n /**\n * Scale vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n divide: (vec, to) => {\n vec[0] /= to[0];\n vec[1] /= to[1];\n },\n /**\n * Vec to string\n *\n * @param {Array} vec\n * @return {string}\n */\n toString: (vec) => `x: ${vec[0]}, y: ${vec[1]}`,\n /**\n * Vertex [0, 0]\n */\n ZERO: Array.from([0, 0]),\n /**\n * Vertex [1, 1]\n */\n ONE: Array.from([1, 1]),\n};\nexports.default = Vec2;\n//# sourceMappingURL=Vec2.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mod = exports.PHI = exports.PI2 = exports.log = void 0;\n/**\n * Return logarith value and base\n *\n * @category Core.Utilities\n *\n * @param n number\n * @param base number\n */\nconst log = (n, base) => Math.log(n) / Math.log(base);\nexports.log = log;\n/**\n * @category Core.Utilities\n */\nexports.PI2 = Math.PI * 2;\n/**\n * @category Core.Utilities\n */\nexports.PHI = (1 + Math.sqrt(5)) / 2;\n/**\n * Return a positive module of positive or negative value\n *\n * @category Core.Utilities\n *\n * @param value number\n * @param base number\n */\nconst mod = (value, base) => {\n const result = value % base;\n return result < 0 ? result + base : result;\n};\nexports.mod = mod;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Adapt = exports.Bounding = exports.EAdaptMode = void 0;\nconst Modifier_1 = require(\"./Modifier\");\n/**\n *\n *\n * @category Core.Enums\n */\nvar EAdaptMode;\n(function (EAdaptMode) {\n /**\n * The buffer is not changed\n * @order 1\n */\n EAdaptMode[EAdaptMode[\"None\"] = 0] = \"None\";\n /**\n * The buffer is scaled in a range between [-1, -1] and [1,1]\n * @order 2\n */\n EAdaptMode[EAdaptMode[\"Scale\"] = 2] = \"Scale\";\n /**\n * The buffer is scaled in a range between [-1, -1] and [1,1] and is centered\n * @order 3\n */\n EAdaptMode[EAdaptMode[\"Center\"] = 4] = \"Center\";\n /**\n * The buffer is adapted centrally and expanded in a range between [-1, -1] and [1,1]\n * @order 4\n */\n EAdaptMode[EAdaptMode[\"Fill\"] = 8] = \"Fill\";\n})(EAdaptMode = exports.EAdaptMode || (exports.EAdaptMode = {}));\n/**\n * @internal\n * @ignore\n */\nexports.Bounding = {\n empty: () => ({\n cx: 0,\n cy: 0,\n x: -1,\n y: -1,\n width: 2,\n height: 2,\n }),\n clear: (tmpBounding) => {\n tmpBounding[0] = undefined;\n tmpBounding[1] = undefined;\n tmpBounding[2] = undefined;\n tmpBounding[3] = undefined;\n },\n add: (tmpBounding, x, y) => {\n if (typeof tmpBounding[0] === 'undefined' || x < tmpBounding[0])\n tmpBounding[0] = x;\n if (typeof tmpBounding[2] === 'undefined' || x > tmpBounding[2])\n tmpBounding[2] = x;\n if (typeof tmpBounding[1] === 'undefined' || y < tmpBounding[1])\n tmpBounding[1] = y;\n if (typeof tmpBounding[3] === 'undefined' || y > tmpBounding[3])\n tmpBounding[3] = y;\n },\n sum: (dest, bounding) => {\n if (typeof bounding[0] !== 'undefined' &&\n typeof bounding[1] !== 'undefined' &&\n typeof bounding[2] !== 'undefined' &&\n typeof bounding[3] !== 'undefined') {\n if (typeof dest[0] === 'undefined' ||\n typeof dest[1] === 'undefined' ||\n typeof dest[2] === 'undefined' ||\n typeof dest[3] === 'undefined') {\n dest[0] = bounding[0];\n dest[1] = bounding[1];\n dest[2] = bounding[2];\n dest[3] = bounding[3];\n }\n else {\n if (dest[0] < bounding[0])\n dest[0] = bounding[0];\n if (dest[2] > bounding[2])\n dest[2] = bounding[2];\n if (dest[1] < bounding[1])\n dest[1] = bounding[1];\n if (dest[3] > bounding[3])\n dest[3] = bounding[3];\n }\n }\n else {\n console.warn('[Urplfanze:Bounding] cannot sum bounding');\n }\n },\n bind: (bounding, tmpBounding) => {\n if (typeof tmpBounding[0] !== 'undefined' &&\n typeof tmpBounding[1] !== 'undefined' &&\n typeof tmpBounding[2] !== 'undefined' &&\n typeof tmpBounding[3] !== 'undefined') {\n bounding.x = tmpBounding[0];\n bounding.y = tmpBounding[1];\n bounding.width = tmpBounding[2] - tmpBounding[0];\n bounding.height = tmpBounding[3] - tmpBounding[1];\n bounding.cx = bounding.x + bounding.width / 2;\n bounding.cy = bounding.y + bounding.height / 2;\n }\n else {\n console.warn('[Urplfanze:Bounding] cannot bind bounding');\n }\n },\n};\nclass Adapt extends Modifier_1.Modifier {\n constructor(args) {\n super();\n this.mode = args.mode || EAdaptMode.Fill;\n this.rect = args.rect;\n }\n apply(buffer, bClosed) {\n return Adapt.adapt(buffer, this.mode, this.rect);\n }\n /**\n * Return adapted buffer between [-1,-1] and [1,1]\n *\n * @public\n * @static\n * @param {Float32Array} input\n * @param {EAdaptMode} mode\n * @returns {Float32Array}\n * @memberof ShapeBuffer\n */\n static adapt(input, mode, rect) {\n if (mode === EAdaptMode.None)\n return Float32Array.from(input);\n const output = new Float32Array(input.length);\n if (!rect) {\n rect = Adapt.getBounding(input);\n }\n const scale = rect.width >= 2 || rect.height >= 2 || (mode >= EAdaptMode.Fill && (rect.width < 2 || rect.height < 2))\n ? 2 / Math.max(rect.width, rect.height)\n : 1;\n const translateX = mode >= EAdaptMode.Center ? rect.cx : 0;\n const translateY = mode >= EAdaptMode.Center ? rect.cy : 0;\n for (let i = 0, len = input.length; i < len; i += 2) {\n output[i] = (input[i] - translateX) * scale;\n output[i + 1] = (input[i + 1] - translateY) * scale;\n }\n return output;\n }\n /**\n * Get buffer bounding\n *\n * @static\n * @param {Float32Array | Array} buffer\n * @returns {IShapeBounding}\n * @memberof ShapePrimitive\n */\n static getBounding(buffer, bounding) {\n if (typeof bounding === 'undefined')\n bounding = exports.Bounding.empty();\n const tmp_bounding = [undefined, undefined, undefined, undefined];\n for (let i = 0, len = buffer.length; i < len; i += 2) {\n exports.Bounding.add(tmp_bounding, buffer[i], buffer[i + 1]);\n }\n exports.Bounding.bind(bounding, tmp_bounding);\n return bounding;\n }\n}\nexports.Adapt = Adapt;\nAdapt.MODES = EAdaptMode;\n//# sourceMappingURL=Adapt.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Modifier = void 0;\nclass Modifier {\n}\nexports.Modifier = Modifier;\n//# sourceMappingURL=Modifier.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.distributePointsInBuffer = exports.interpolate = exports.prepareBufferForInterpolation = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.relativeClamp = exports.clamp = exports.lerp = exports.toRadians = exports.toDegrees = exports.now = void 0;\nconst SimplexNoise = require(\"simplex-noise\");\nconst repetitions_1 = require(\"./types/repetitions\");\nconst Vec2_1 = require(\"./math/Vec2\");\n// isDef: (object: any): boolean => typeof object !== 'undefined' && object !== null,\nconst measurement = typeof performance !== 'undefined' ? performance : Date;\n/**\n * Get current timestamp in milliseconds\n *\n * @category Utilities\n * @returns {number}\n */\nfunction now() {\n return measurement.now();\n}\nexports.now = now;\n// aOr: (...args: Array): any => {\n// \tfor (let i = 0; i < args.length; i++) if (Utilities.isDef(args[i])) return args[i]\n// },\n/**\n * Convert number from radians to degrees\n *\n * @category Utilities\n *\n * @example\n * ```javascript\n * Urpflanze.toDegrees(Math.PI) // 180\n * ```\n *\n * @param {number} radians\n * @returns {number}\n */\nfunction toDegrees(radians) {\n return (radians * 180) / Math.PI;\n}\nexports.toDegrees = toDegrees;\n/**\n * Convert angle from degrees to radians\n * @example\n * ```javascript\n * Urpflanze.toRadians(180) // 3.141592653589793\n * ```\n *\n * @category Utilities\n * @param {number} degrees\n * @returns {number}\n */\nfunction toRadians(degrees) {\n return (degrees * Math.PI) / 180;\n}\nexports.toRadians = toRadians;\n// perf: (name: string, callback: any, log: boolean = false): number => {\n// \tconst t1 = now()\n// \tcallback()\n// \tconst t2 = now()\n// \tlog && console.log('perf ' + name + ': ' + (t2 - t1))\n// \treturn t2 - t1\n// }\n/**\n * Linear interpolation from `a` when `i` as 0 an `b` when `i' as 1\n *\n * @category Utilities\n * @param {number} a\n * @param {number} b\n * @param {number} i\n * @returns {number}\n */\nfunction lerp(a, b, i) {\n return (1 - i) * a + i * b;\n}\nexports.lerp = lerp;\n/**\n * Return number between min and max\n *\n * @category Utilities\n * @example\n * ```javascript\n * Urpflanze.clamp(0, 1, 1.2) // 1\n * Urpflanze.clamp(0, 1, -2) // 0\n * ```\n * @param {number} min\n * @param {number} max\n * @param {number} value\n * @returns {number}\n */\nfunction clamp(min, max, value) {\n return value <= min ? min : value >= max ? max : value;\n}\nexports.clamp = clamp;\n/**\n * Map number between refMin e refMax from min and max\n *\n * @category Utilities\n *\n * @example\n * ```javascript\n * Urpflanze.relativeClamp(0, 1, 0.5, 100, 200) // 150\n * ```\n *\n * @param {number} refMin\n * @param {number} refMax\n * @param {number} value\n * @param {number} toMin\n * @param {number} toMax\n * @returns {number}\n */\nfunction relativeClamp(refMin, refMax, value, toMin, toMax) {\n return clamp(toMin, toMax, ((value - refMin) / (refMax - refMin)) * (toMax - toMin) + toMin);\n}\nexports.relativeClamp = relativeClamp;\n/**\n * @internal\n * @ignore\n */\nconst noises = {\n random: new SimplexNoise(Math.random),\n};\n/**\n * SimplexNoise\n * Use 'random' as seed property for random seed.\n * Return value between -1 and 1\n *\n * @category Utilities\n *\n * @param {string} [seed='random']\n * @param {number} [x=0]\n * @param {number} [y=0]\n * @param {number} [z=0]\n * @returns {number} between -1 and 1\n */\nfunction noise(seed = 'random', x = 0, y = 0, z = 0) {\n if (typeof noises[seed] === 'undefined') {\n noises[seed] = new SimplexNoise(seed);\n }\n return noises[seed].noise3D(x, y, z);\n}\nexports.noise = noise;\n/**\n * Random number generator\n */\nconst randoms = {};\n/**\n * random number generator\n * @param seed\n * @returns\n */\nfunction random(seed, min = 0, max = 1, decimals) {\n const key = seed + '';\n if (typeof randoms[key] === 'undefined') {\n const seed = xmur3(key);\n randoms[key] = sfc32(seed(), seed(), seed(), seed());\n }\n const value = min + randoms[key]() * (max - min);\n return typeof decimals !== 'undefined' ? Math.round(value * 10 ** decimals) / 10 ** decimals : value;\n}\nexports.random = random;\n/**\n *\n * @internal\n * @param str\n * @returns\n */\nfunction xmur3(str) {\n let i = 0, h = 1779033703 ^ str.length;\n for (; i < str.length; i++)\n (h = Math.imul(h ^ str.charCodeAt(i), 3432918353)), (h = (h << 13) | (h >>> 19));\n return function () {\n h = Math.imul(h ^ (h >>> 16), 2246822507);\n h = Math.imul(h ^ (h >>> 13), 3266489909);\n return (h ^= h >>> 16) >>> 0;\n };\n}\n/**\n * @internal\n * @param a\n * @param b\n * @param c\n * @param d\n * @returns\n */\nfunction sfc32(a, b, c, d) {\n return function () {\n a >>>= 0;\n b >>>= 0;\n c >>>= 0;\n d >>>= 0;\n let t = (a + b) | 0;\n a = b ^ (b >>> 9);\n b = (c + (c << 3)) | 0;\n c = (c << 21) | (c >>> 11);\n d = (d + 1) | 0;\n t = (t + d) | 0;\n c = (c + t) | 0;\n return (t >>> 0) / 4294967296;\n };\n}\n/**\n * Return angle (atan) from offset (or center) for matrix repetition.\n * Offset is array between [-1, -1] and [1, 1].\n * The return value is between -Math.PI / 2 and Math.PI / 2\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter\n * @returns {number} between -Math.PI / 2 and Math.PI / 2\n */\nfunction angleFromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [(repetition.col.count - 1) / 2, (repetition.row.count - 1) / 2];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const x = repetition.col.index - 1 - centerMatrix[0];\n const y = repetition.row.index - 1 - centerMatrix[1];\n return x === 0 ? 0 : Math.atan(y / x);\n }\n return (repetition.angle - Math.PI) / 2;\n}\nexports.angleFromRepetition = angleFromRepetition;\n/**\n * Return angle (atan2, 4 quadrants) from offset (or center) for matrix repetition.\n * Offset is array between [-1, -1] and [1, 1].\n * The return value is between -Math.PI an Math.PI\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter\n * @returns {number} between -Math.PI an Math.PI\n */\nfunction angle2FromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [(repetition.col.count - 1) / 2, (repetition.row.count - 1) / 2];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const x = repetition.col.index - 1 - centerMatrix[0];\n const y = repetition.row.index - 1 - centerMatrix[1];\n return x === 0 ? 0 : Math.atan2(y, x);\n }\n return repetition.angle - Math.PI;\n}\nexports.angle2FromRepetition = angle2FromRepetition;\n/**\n * Return distance from offset (or center) for matrix repetition.\n * The return value is between 0 and 1\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter offset relative to distance prop\n * @returns {number} between 0 and 1\n */\nfunction distanceFromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [0.5, 0.5];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const current = [repetition.col.offset, repetition.row.offset];\n return Vec2_1.default.distance(current, centerMatrix);\n }\n return 1;\n}\nexports.distanceFromRepetition = distanceFromRepetition;\n/// Interpolation\n/**\n *\n * @param from\n * @param to\n * @returns\n */\nfunction prepareBufferForInterpolation(from, to) {\n const fromBufferLength = from.length;\n const toBufferLength = to.length;\n if (fromBufferLength === toBufferLength) {\n return [from, to];\n }\n const maxBufferLength = fromBufferLength > toBufferLength ? fromBufferLength : toBufferLength;\n const difference = Math.abs(fromBufferLength - toBufferLength);\n const minBufferLength = maxBufferLength - difference;\n /////\n const b = fromBufferLength < toBufferLength ? to : from;\n const t = fromBufferLength < toBufferLength ? from : to;\n const a = distributePointsInBuffer(t, Math.floor(difference / 2));\n // a[maxBufferLength - 2] = t[minBufferLength - 2]\n // a[maxBufferLength - 1] = t[minBufferLength - 1]\n return fromBufferLength > toBufferLength ? [b, a] : [a, b];\n}\nexports.prepareBufferForInterpolation = prepareBufferForInterpolation;\n/**\n *\n * @param from\n * @param to\n * @param offset\n * @returns\n */\nfunction interpolate(from, to, initialOffset = 0.5) {\n const [a, b] = prepareBufferForInterpolation(from, to);\n const maxBufferLength = Math.max(a.length, b.length);\n const offset = typeof initialOffset === 'number' ? [initialOffset] : initialOffset;\n const maxPoints = maxBufferLength / 2;\n if (offset.length !== maxPoints) {\n const tl = offset.length;\n for (let i = 0; i < maxPoints; i++) {\n offset[i] = offset[i % tl];\n }\n }\n ////\n const result = new Float32Array(maxBufferLength);\n for (let i = 0, off = 0; i < maxBufferLength; i += 2, off++) {\n result[i] = (1 - offset[off]) * a[i] + offset[off] * b[i];\n result[i + 1] = (1 - offset[off]) * a[i + 1] + offset[off] * b[i + 1];\n }\n return result;\n}\nexports.interpolate = interpolate;\nfunction distributePointsInBuffer(buffer, count) {\n const bufferLen = buffer.length;\n const pointsLen = bufferLen / 2;\n const finalBufferLength = (pointsLen + count) * 2;\n const edges = pointsLen - 1;\n if (edges > 1) {\n const lastPoint = bufferLen - 2;\n const newPointsOnEdge = Math.floor(count / edges);\n const bufferWithPointsEveryEdge = bufferLen + newPointsOnEdge * lastPoint;\n let remainingPoints = (finalBufferLength - bufferWithPointsEveryEdge) / 2;\n const edgeRemainingIndex = Math.round(edges / remainingPoints);\n const result = new Float32Array(finalBufferLength);\n for (let i = 0, edgeIndex = 0, r = 0; i < lastPoint; i += 2, edgeIndex++, r += 2) {\n const ax = buffer[i];\n const ay = buffer[i + 1];\n const bx = buffer[i + 2];\n const by = buffer[i + 3];\n result[r] = ax;\n result[r + 1] = ay;\n const addReminingPoints = remainingPoints > 0 && (edgeIndex % edgeRemainingIndex === 0 || i === lastPoint - 2);\n const currentPointsOnEdge = newPointsOnEdge + (addReminingPoints ? 1 : 0);\n const newPointOffset = 1 / (currentPointsOnEdge + 1);\n for (let h = 0; h < currentPointsOnEdge; h++, r += 2) {\n const o = newPointOffset * (h + 1);\n result[r + 2] = (1 - o) * ax + o * bx;\n result[r + 3] = (1 - o) * ay + o * by;\n }\n if (addReminingPoints) {\n remainingPoints--;\n }\n }\n result[finalBufferLength - 2] = buffer[bufferLen - 2];\n result[finalBufferLength - 1] = buffer[bufferLen - 1];\n return result;\n }\n const result = new Float32Array(finalBufferLength);\n for (let i = 0; i < finalBufferLength; i += 2) {\n result[i] = buffer[i % bufferLen];\n result[i + 1] = buffer[(i + 1) % bufferLen];\n }\n return result;\n}\nexports.distributePointsInBuffer = distributePointsInBuffer;\n//# sourceMappingURL=Utilities.js.map","/*\n * A fast javascript implementation of simplex noise by Jonas Wagner\n\nBased on a speed-improved simplex noise algorithm for 2D, 3D and 4D in Java.\nWhich is based on example code by Stefan Gustavson (stegu@itn.liu.se).\nWith Optimisations by Peter Eastman (peastman@drizzle.stanford.edu).\nBetter rank ordering method by Stefan Gustavson in 2012.\n\n\n Copyright (c) 2018 Jonas Wagner\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n(function() {\n 'use strict';\n\n var F2 = 0.5 * (Math.sqrt(3.0) - 1.0);\n var G2 = (3.0 - Math.sqrt(3.0)) / 6.0;\n var F3 = 1.0 / 3.0;\n var G3 = 1.0 / 6.0;\n var F4 = (Math.sqrt(5.0) - 1.0) / 4.0;\n var G4 = (5.0 - Math.sqrt(5.0)) / 20.0;\n\n function SimplexNoise(randomOrSeed) {\n var random;\n if (typeof randomOrSeed == 'function') {\n random = randomOrSeed;\n }\n else if (randomOrSeed) {\n random = alea(randomOrSeed);\n } else {\n random = Math.random;\n }\n this.p = buildPermutationTable(random);\n this.perm = new Uint8Array(512);\n this.permMod12 = new Uint8Array(512);\n for (var i = 0; i < 512; i++) {\n this.perm[i] = this.p[i & 255];\n this.permMod12[i] = this.perm[i] % 12;\n }\n\n }\n SimplexNoise.prototype = {\n grad3: new Float32Array([1, 1, 0,\n -1, 1, 0,\n 1, -1, 0,\n\n -1, -1, 0,\n 1, 0, 1,\n -1, 0, 1,\n\n 1, 0, -1,\n -1, 0, -1,\n 0, 1, 1,\n\n 0, -1, 1,\n 0, 1, -1,\n 0, -1, -1]),\n grad4: new Float32Array([0, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1,\n 0, -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1,\n 1, 0, 1, 1, 1, 0, 1, -1, 1, 0, -1, 1, 1, 0, -1, -1,\n -1, 0, 1, 1, -1, 0, 1, -1, -1, 0, -1, 1, -1, 0, -1, -1,\n 1, 1, 0, 1, 1, 1, 0, -1, 1, -1, 0, 1, 1, -1, 0, -1,\n -1, 1, 0, 1, -1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, -1,\n 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0,\n -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1, 0]),\n noise2D: function(xin, yin) {\n var permMod12 = this.permMod12;\n var perm = this.perm;\n var grad3 = this.grad3;\n var n0 = 0; // Noise contributions from the three corners\n var n1 = 0;\n var n2 = 0;\n // Skew the input space to determine which simplex cell we're in\n var s = (xin + yin) * F2; // Hairy factor for 2D\n var i = Math.floor(xin + s);\n var j = Math.floor(yin + s);\n var t = (i + j) * G2;\n var X0 = i - t; // Unskew the cell origin back to (x,y) space\n var Y0 = j - t;\n var x0 = xin - X0; // The x,y distances from the cell origin\n var y0 = yin - Y0;\n // For the 2D case, the simplex shape is an equilateral triangle.\n // Determine which simplex we are in.\n var i1, j1; // Offsets for second (middle) corner of simplex in (i,j) coords\n if (x0 > y0) {\n i1 = 1;\n j1 = 0;\n } // lower triangle, XY order: (0,0)->(1,0)->(1,1)\n else {\n i1 = 0;\n j1 = 1;\n } // upper triangle, YX order: (0,0)->(0,1)->(1,1)\n // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and\n // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where\n // c = (3-sqrt(3))/6\n var x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords\n var y1 = y0 - j1 + G2;\n var x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords\n var y2 = y0 - 1.0 + 2.0 * G2;\n // Work out the hashed gradient indices of the three simplex corners\n var ii = i & 255;\n var jj = j & 255;\n // Calculate the contribution from the three corners\n var t0 = 0.5 - x0 * x0 - y0 * y0;\n if (t0 >= 0) {\n var gi0 = permMod12[ii + perm[jj]] * 3;\n t0 *= t0;\n n0 = t0 * t0 * (grad3[gi0] * x0 + grad3[gi0 + 1] * y0); // (x,y) of grad3 used for 2D gradient\n }\n var t1 = 0.5 - x1 * x1 - y1 * y1;\n if (t1 >= 0) {\n var gi1 = permMod12[ii + i1 + perm[jj + j1]] * 3;\n t1 *= t1;\n n1 = t1 * t1 * (grad3[gi1] * x1 + grad3[gi1 + 1] * y1);\n }\n var t2 = 0.5 - x2 * x2 - y2 * y2;\n if (t2 >= 0) {\n var gi2 = permMod12[ii + 1 + perm[jj + 1]] * 3;\n t2 *= t2;\n n2 = t2 * t2 * (grad3[gi2] * x2 + grad3[gi2 + 1] * y2);\n }\n // Add contributions from each corner to get the final noise value.\n // The result is scaled to return values in the interval [-1,1].\n return 70.0 * (n0 + n1 + n2);\n },\n // 3D simplex noise\n noise3D: function(xin, yin, zin) {\n var permMod12 = this.permMod12;\n var perm = this.perm;\n var grad3 = this.grad3;\n var n0, n1, n2, n3; // Noise contributions from the four corners\n // Skew the input space to determine which simplex cell we're in\n var s = (xin + yin + zin) * F3; // Very nice and simple skew factor for 3D\n var i = Math.floor(xin + s);\n var j = Math.floor(yin + s);\n var k = Math.floor(zin + s);\n var t = (i + j + k) * G3;\n var X0 = i - t; // Unskew the cell origin back to (x,y,z) space\n var Y0 = j - t;\n var Z0 = k - t;\n var x0 = xin - X0; // The x,y,z distances from the cell origin\n var y0 = yin - Y0;\n var z0 = zin - Z0;\n // For the 3D case, the simplex shape is a slightly irregular tetrahedron.\n // Determine which simplex we are in.\n var i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords\n var i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords\n if (x0 >= y0) {\n if (y0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 1;\n k2 = 0;\n } // X Y Z order\n else if (x0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n } // X Z Y order\n else {\n i1 = 0;\n j1 = 0;\n k1 = 1;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n } // Z X Y order\n }\n else { // x0 y0) rankx++;\n else ranky++;\n if (x0 > z0) rankx++;\n else rankz++;\n if (x0 > w0) rankx++;\n else rankw++;\n if (y0 > z0) ranky++;\n else rankz++;\n if (y0 > w0) ranky++;\n else rankw++;\n if (z0 > w0) rankz++;\n else rankw++;\n var i1, j1, k1, l1; // The integer offsets for the second simplex corner\n var i2, j2, k2, l2; // The integer offsets for the third simplex corner\n var i3, j3, k3, l3; // The integer offsets for the fourth simplex corner\n // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order.\n // Many values of c will never occur, since e.g. x>y>z>w makes x= 3 ? 1 : 0;\n j1 = ranky >= 3 ? 1 : 0;\n k1 = rankz >= 3 ? 1 : 0;\n l1 = rankw >= 3 ? 1 : 0;\n // Rank 2 denotes the second largest coordinate.\n i2 = rankx >= 2 ? 1 : 0;\n j2 = ranky >= 2 ? 1 : 0;\n k2 = rankz >= 2 ? 1 : 0;\n l2 = rankw >= 2 ? 1 : 0;\n // Rank 1 denotes the second smallest coordinate.\n i3 = rankx >= 1 ? 1 : 0;\n j3 = ranky >= 1 ? 1 : 0;\n k3 = rankz >= 1 ? 1 : 0;\n l3 = rankw >= 1 ? 1 : 0;\n // The fifth corner has all coordinate offsets = 1, so no need to compute that.\n var x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords\n var y1 = y0 - j1 + G4;\n var z1 = z0 - k1 + G4;\n var w1 = w0 - l1 + G4;\n var x2 = x0 - i2 + 2.0 * G4; // Offsets for third corner in (x,y,z,w) coords\n var y2 = y0 - j2 + 2.0 * G4;\n var z2 = z0 - k2 + 2.0 * G4;\n var w2 = w0 - l2 + 2.0 * G4;\n var x3 = x0 - i3 + 3.0 * G4; // Offsets for fourth corner in (x,y,z,w) coords\n var y3 = y0 - j3 + 3.0 * G4;\n var z3 = z0 - k3 + 3.0 * G4;\n var w3 = w0 - l3 + 3.0 * G4;\n var x4 = x0 - 1.0 + 4.0 * G4; // Offsets for last corner in (x,y,z,w) coords\n var y4 = y0 - 1.0 + 4.0 * G4;\n var z4 = z0 - 1.0 + 4.0 * G4;\n var w4 = w0 - 1.0 + 4.0 * G4;\n // Work out the hashed gradient indices of the five simplex corners\n var ii = i & 255;\n var jj = j & 255;\n var kk = k & 255;\n var ll = l & 255;\n // Calculate the contribution from the five corners\n var t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0;\n if (t0 < 0) n0 = 0.0;\n else {\n var gi0 = (perm[ii + perm[jj + perm[kk + perm[ll]]]] % 32) * 4;\n t0 *= t0;\n n0 = t0 * t0 * (grad4[gi0] * x0 + grad4[gi0 + 1] * y0 + grad4[gi0 + 2] * z0 + grad4[gi0 + 3] * w0);\n }\n var t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1;\n if (t1 < 0) n1 = 0.0;\n else {\n var gi1 = (perm[ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]]] % 32) * 4;\n t1 *= t1;\n n1 = t1 * t1 * (grad4[gi1] * x1 + grad4[gi1 + 1] * y1 + grad4[gi1 + 2] * z1 + grad4[gi1 + 3] * w1);\n }\n var t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2;\n if (t2 < 0) n2 = 0.0;\n else {\n var gi2 = (perm[ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]]] % 32) * 4;\n t2 *= t2;\n n2 = t2 * t2 * (grad4[gi2] * x2 + grad4[gi2 + 1] * y2 + grad4[gi2 + 2] * z2 + grad4[gi2 + 3] * w2);\n }\n var t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3;\n if (t3 < 0) n3 = 0.0;\n else {\n var gi3 = (perm[ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]]] % 32) * 4;\n t3 *= t3;\n n3 = t3 * t3 * (grad4[gi3] * x3 + grad4[gi3 + 1] * y3 + grad4[gi3 + 2] * z3 + grad4[gi3 + 3] * w3);\n }\n var t4 = 0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4;\n if (t4 < 0) n4 = 0.0;\n else {\n var gi4 = (perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32) * 4;\n t4 *= t4;\n n4 = t4 * t4 * (grad4[gi4] * x4 + grad4[gi4 + 1] * y4 + grad4[gi4 + 2] * z4 + grad4[gi4 + 3] * w4);\n }\n // Sum up and scale the result to cover the range [-1,1]\n return 27.0 * (n0 + n1 + n2 + n3 + n4);\n }\n };\n\n function buildPermutationTable(random) {\n var i;\n var p = new Uint8Array(256);\n for (i = 0; i < 256; i++) {\n p[i] = i;\n }\n for (i = 0; i < 255; i++) {\n var r = i + ~~(random() * (256 - i));\n var aux = p[i];\n p[i] = p[r];\n p[r] = aux;\n }\n return p;\n }\n SimplexNoise._buildPermutationTable = buildPermutationTable;\n\n function alea() {\n // Johannes Baagøe , 2010\n var s0 = 0;\n var s1 = 0;\n var s2 = 0;\n var c = 1;\n\n var mash = masher();\n s0 = mash(' ');\n s1 = mash(' ');\n s2 = mash(' ');\n\n for (var i = 0; i < arguments.length; i++) {\n s0 -= mash(arguments[i]);\n if (s0 < 0) {\n s0 += 1;\n }\n s1 -= mash(arguments[i]);\n if (s1 < 0) {\n s1 += 1;\n }\n s2 -= mash(arguments[i]);\n if (s2 < 0) {\n s2 += 1;\n }\n }\n mash = null;\n return function() {\n var t = 2091639 * s0 + c * 2.3283064365386963e-10; // 2^-32\n s0 = s1;\n s1 = s2;\n return s2 = t - (c = t | 0);\n };\n }\n function masher() {\n var n = 0xefc8249d;\n return function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n }\n\n // amd\n if (typeof define !== 'undefined' && define.amd) define(function() {return SimplexNoise;});\n // common js\n if (typeof exports !== 'undefined') exports.SimplexNoise = SimplexNoise;\n // browser\n else if (typeof window !== 'undefined') window.SimplexNoise = SimplexNoise;\n // nodejs\n if (typeof module !== 'undefined') {\n module.exports = SimplexNoise;\n }\n\n})();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Shape = void 0;\nconst Scene_1 = require(\"../Scene\");\nconst SceneChild_1 = require(\"../SceneChild\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\n/**\n * Container of ShapeBase or Group, it applies transformations on each repetition\n *\n * @category Core.Shapes\n */\nclass Shape extends ShapeBase_1.ShapeBase {\n /**\n * Creates an instance of Shape.\n *\n * @param {ShapeSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'Shape';\n super(settings);\n if (settings.shape instanceof SceneChild_1.SceneChild) {\n this.shape = settings.shape;\n }\n else {\n console.warn(\"[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\\nYou passed:\", settings.shape);\n }\n this.shapeUseParent = !!settings.shapeUseParent;\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n */\n isStatic() {\n // return super.isStatic() && !this.shapeUseParent\n return super.isStatic() && (this.shape ? this.shape.isStatic() : true);\n }\n /**\n * Check if shape has static index\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return super.isStaticIndexed() && (this.shape ? this.shape.isStaticIndexed() : true);\n }\n /**\n * Find shape by id or name\n *\n * @param {number | string} idOrName\n * @returns {(SceneChild | null)}\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n if (this.shape)\n return this.shape.find(idOrName);\n return null;\n }\n /**\n * Return length of buffer\n *\n * @param {PropArguments} propArguments\n * @returns {number}\n */\n getBufferLength(propArguments) {\n if (this.bStatic && this.buffer && this.buffer.length > 0)\n return this.buffer.length;\n const childBufferLength = this.shape ? this.shape.getBufferLength(propArguments) : 0;\n return childBufferLength * this.getRepetitionCount();\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape) {\n if (this.shapeUseParent || this.shape.generateId !== generateId) {\n if (this.shapeUseParent) {\n this.shape.clearBuffer(true, false);\n }\n this.shape.generate(generateId, false, propArguments);\n }\n return this.shape.getBuffer();\n }\n return Shape.EMPTY_BUFFER;\n }\n /**\n * Return bounding\n *\n * @param {boolean} bDirectSceneChild\n * @returns {IShapeBounding}\n */\n getShapeBounding() {\n if (this.shape) {\n return this.shape.getBounding();\n }\n return this.bounding; // empty bounding defined in ShapeBase\n }\n /**\n * Add to indexed buffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n const parentBufferIndex = {\n shape: this,\n frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n };\n for (let i = 0, len = childIndexedBuffer.length; i < len; i++) {\n const currentIndexed = { ...childIndexedBuffer[i] };\n const parent = currentIndexed.parent\n ? Shape.setIndexedParent(currentIndexed.parent, parentBufferIndex)\n : parentBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n }\n }\n }\n /**\n * Set parent of indexed\n *\n * @static\n * @param {(IBufferIndex )} current\n * @param {IBufferIndex} parent\n * @returns {(IBufferIndex )}\n */\n static setIndexedParent(current, parent) {\n const index = {\n ...current,\n };\n index.parent = current.parent ? Shape.setIndexedParent(current.parent, parent) : parent;\n return index;\n }\n /**\n * Set shape\n *\n * @param {(SceneChild | undefined)} [shape]\n */\n setShape(shape) {\n if (typeof shape === 'undefined') {\n this.shape = undefined;\n this.clearBuffer(true, true);\n }\n else {\n this.scene && Scene_1.Scene.propagateToChilden(shape, this.scene);\n this.shape = shape;\n this.shape.clearBuffer(true, true);\n }\n }\n}\nexports.Shape = Shape;\n//# sourceMappingURL=Shape.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapePrimitive = void 0;\nconst glme = require(\"../math/gl-matrix-extensions\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\nconst Modifier_1 = require(\"../modifiers/Modifier\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\n/**\n * @category Core.Abstract\n */\nclass ShapePrimitive extends ShapeBase_1.ShapeBase {\n /**\n * Creates an instance of ShapePrimitive.\n *\n * @param {IShapePrimitiveSettings} [settings={}]\n */\n constructor(settings = {}) {\n var _a;\n super(settings);\n /**\n * Contain the bounding of the last generated buffer\n *\n * @type {IShapeBounding}\n */\n this.currentGenerationPrimitiveBounding = Adapt_1.Bounding.empty();\n this.props.sideLength =\n typeof settings.sideLength === 'undefined'\n ? undefined\n : typeof settings.sideLength === 'function'\n ? settings.sideLength\n : glme.toVec2(settings.sideLength);\n this.drawer = settings.drawer || {};\n this.modifiers = settings.modifiers;\n this.bClosed = (_a = settings.bClosed) !== null && _a !== void 0 ? _a : true;\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n * @memberof ShapePrimitive\n */\n isStatic() {\n return typeof this.props.sideLength !== 'function' && super.isStatic();\n }\n /**\n * Return sideLength for current repetition\n *\n * @param propArguments\n * @returns\n */\n getRepetitionSideLength(propArguments) {\n if (this.bStatic) {\n // not set default value into constructor because it can be overridden by group\n if (typeof this.props.sideLength === 'undefined') {\n this.props.sideLength = [50, 50];\n }\n else if (typeof this.props.sideLength === 'number') {\n this.props.sideLength = [this.props.sideLength, this.props.sideLength];\n }\n return this.props.sideLength;\n }\n return glme.toVec2(this.getProp('sideLength', propArguments, [50, 50]));\n }\n /**\n * Apply modifiers on single repetition buffer\n *\n * @param buffer\n * @returns\n */\n applyModifiers(buffer, propArguments) {\n if (typeof this.modifiers === 'undefined')\n return buffer;\n let modified = buffer;\n const modifiers = Array.isArray(this.modifiers) ? this.modifiers : [this.modifiers];\n for (let i = 0, len = modifiers.length; i < len; i++) {\n const modifier = modifiers[i] instanceof Modifier_1.Modifier\n ? modifiers[i]\n : modifiers[i](propArguments);\n //@ts-ignore\n modified = modifier.apply(modified, this.bClosed, this);\n }\n return modified;\n }\n /**\n * Return a bounding of generated buffer if is direct scene child\n *\n * @returns {IShapeBounding}\n * @memberof ShapePrimitive\n */\n getShapeBounding() {\n return this.currentGenerationPrimitiveBounding;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n const index = {\n shape: this,\n frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n };\n this.indexedBuffer.push(index);\n }\n /**\n * Return bClosed\n *\n * @returns {boolean}\n * @memberof ShapePrimitive\n */\n isClosed() {\n return this.bClosed;\n }\n /**\n * Set bClosed\n *\n * @param {boolean} bClosed\n * @memberof ShapePrimitive\n */\n setClosed(bClosed) {\n this.bClosed = bClosed;\n }\n}\nexports.ShapePrimitive = ShapePrimitive;\n//# sourceMappingURL=ShapePrimitive.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeLoop = void 0;\nconst math_1 = require(\"../math\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst ShapePrimitive_1 = require(\"../shapes/ShapePrimitive\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\n/**\n * Shape Loop\n *\n * @category Core.Shapes\n * @public\n * @class ShapeLoop\n * @extends {ShapePrimitive}\n */\nclass ShapeLoop extends ShapePrimitive_1.ShapePrimitive {\n /**\n * Creates an instance of ShapeLoop.\n *\n * @param {IShapeLoopSettings} [settings={}]\n * @param {boolean} [bPreventGeneration=false]\n */\n constructor(settings = {}, bPreventGeneration = false) {\n settings.type = settings.type || 'ShapeLoop';\n super(settings);\n this.loopDependencies = (settings.loopDependencies || []).concat('sideLength');\n this.props.loop = settings.loop;\n if (!bPreventGeneration) {\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: math_1.PI2 / 10,\n vertex: () => [0, 0],\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n }\n /**\n * Check if currentOrSingleLoopBuffer is static\n *\n * @returns {boolean}\n */\n isStaticLoop() {\n if (this.loopDependencies.includes('propArguments'))\n return false;\n for (let i = 0, len = this.loopDependencies.length; i < len; i++)\n if (typeof this.props[this.loopDependencies[i]] === 'function')\n return false;\n return true;\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n */\n isStatic() {\n return this.bStaticLoop && super.isStatic();\n }\n /**\n * Check if shape has static indexed\n * The number of vertices is defined by number of loop iteration\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n // return this.bStaticLoop && super.isStaticIndexed()\n return (super.isStaticIndexed() &&\n (typeof this.props.loop !== 'undefined'\n ? typeof this.props.loop.start !== 'function' &&\n typeof this.props.loop.end !== 'function' &&\n typeof this.props.loop.inc !== 'function'\n : true));\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.bStaticLoop = this.isStaticLoop();\n if (bClearIndexed) {\n this.currentOrSingleLoopBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n * Set single or multiple props\n *\n * @param {(Props)} key\n * @param {*} [value]\n * @param {boolean} [bClearIndexed=false]\n */\n setProp(key, value) {\n let bClearIndexed = false;\n const keys = (typeof key === 'string' ? { [key]: value } : key);\n for (let i = this.loopDependencies.length - 1; i >= 0; i--) {\n if (this.loopDependencies[i] in keys) {\n // this.props.loop = undefined\n bClearIndexed = true;\n break;\n }\n }\n if ('loop' in keys) {\n keys.loop = { ...this.props.loop, ...keys.loop };\n bClearIndexed = true;\n }\n super.setProp(keys, value, bClearIndexed);\n }\n /**\n * Return length of buffer\n *\n * @param {PropArguments} [propArguments]\n * @returns {number}\n */\n getBufferLength(propArguments) {\n if (this.bStatic && typeof this.buffer !== 'undefined')\n return this.buffer.length;\n if (this.bStaticLoop && typeof this.currentOrSingleLoopBuffer !== 'undefined')\n return this.currentOrSingleLoopBuffer.length * this.getRepetitionCount();\n const { count } = this.getLoop(propArguments || ShapeBase_1.ShapeBase.getEmptyPropArguments(this));\n return this.getRepetitionCount() * count * 2;\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (!this.bStaticLoop)\n return this.generateLoopBuffer(propArguments);\n if (typeof this.props.sideLength === 'function' || typeof this.currentOrSingleLoopBuffer === 'undefined')\n this.currentOrSingleLoopBuffer = this.generateLoopBuffer(propArguments);\n return this.currentOrSingleLoopBuffer;\n }\n /**\n * Generate loop buffer\n *\n * @protected\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateLoopBuffer(propArguments) {\n const { start, inc, /*end,*/ count } = this.getLoop(propArguments);\n const sideLength = this.getRepetitionSideLength(propArguments);\n const getVertex = (this.props.loop && this.props.loop.vertex ? this.props.loop.vertex : this.loop.vertex);\n const shapeLoop = {\n index: 0,\n offset: 0,\n current: 0,\n count: count,\n };\n const vertexLength = shapeLoop.count;\n const bufferLength = vertexLength * 2;\n const currentOrSingleLoopBuffer = new Float32Array(bufferLength);\n for (let i = 0, j = 0; i < vertexLength; i++, j += 2) {\n const current = start + inc * i;\n const offset = shapeLoop.count > 1 ? i / (shapeLoop.count - 1) : 1;\n // const angle = (end - start) * offset + start\n shapeLoop.current = current;\n shapeLoop.index = i + 1;\n shapeLoop.offset = offset;\n const vertex = getVertex(shapeLoop, propArguments);\n currentOrSingleLoopBuffer[j] = vertex[0];\n currentOrSingleLoopBuffer[j + 1] = vertex[1];\n // currentOrSingleLoopBuffer[j] *= sideLength[0]\n // currentOrSingleLoopBuffer[j + 1] *= sideLength[1]\n // Bounding.add(tmpBounding, currentOrSingleLoopBuffer[j], currentOrSingleLoopBuffer[j + 1])\n }\n const tmpBounding = [undefined, undefined, undefined, undefined];\n const buffer = this.applyModifiers(currentOrSingleLoopBuffer, propArguments);\n for (let i = 0, len = buffer.length; i < len; i += 2) {\n buffer[i] = buffer[i] * sideLength[0];\n buffer[i + 1] = buffer[i + 1] * sideLength[1];\n Adapt_1.Bounding.add(tmpBounding, buffer[i], buffer[i + 1]);\n }\n Adapt_1.Bounding.bind(this.currentGenerationPrimitiveBounding, tmpBounding);\n return buffer;\n }\n /**\n * Return information about a client loop gnerator\n *\n * @public\n * @param {PropArguments} propArguments\n * @returns {ShapeLoopInformation}\n */\n getLoop(propArguments) {\n var _a, _b, _c, _d, _e, _f;\n let start = (_b = (_a = this.props.loop) === null || _a === void 0 ? void 0 : _a.start) !== null && _b !== void 0 ? _b : this.loop.start;\n let end = (_d = (_c = this.props.loop) === null || _c === void 0 ? void 0 : _c.end) !== null && _d !== void 0 ? _d : this.loop.end;\n let inc = (_f = (_e = this.props.loop) === null || _e === void 0 ? void 0 : _e.inc) !== null && _f !== void 0 ? _f : this.loop.inc;\n start = (typeof start === 'function' ? start(propArguments) : start);\n end = (typeof end === 'function' ? end(propArguments) : end);\n inc = (typeof inc === 'function' ? inc(propArguments) : inc);\n const count = Math.ceil((end - start) / inc);\n return { start, end, inc, count: count <= 0 ? 0 : count };\n }\n /**\n * Set shape from loop generator\n *\n * @param {(IShapeLoopGenerator)} [shape]\n */\n setShape(loop) {\n this.setProp('loop', loop);\n }\n /**\n * Get static buffer\n *\n * @param sideLength\n * @returns\n */\n static getBuffer(props) {\n const shape = new this({ ...props, sideLength: props.sideLength || 1 });\n shape.generate();\n return shape.getBuffer() || new Float32Array();\n }\n}\nexports.ShapeLoop = ShapeLoop;\nShapeLoop.PId2 = Math.PI / 2;\n//# sourceMappingURL=ShapeLoop.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeBuffer = void 0;\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst ShapePrimitive_1 = require(\"../shapes/ShapePrimitive\");\n/**\n * @category Core.Shapes\n */\nclass ShapeBuffer extends ShapePrimitive_1.ShapePrimitive {\n /**\n * Creates an instance of ShapeBuffer.\n *\n * @param {IShapeBufferSettings} [settings={}]\n */\n constructor(settings = {}) {\n var _a, _b;\n settings.type = settings.type || 'ShapeBuffer';\n settings.adaptMode = (_a = settings.adaptMode) !== null && _a !== void 0 ? _a : Adapt_1.EAdaptMode.Scale;\n super(settings);\n this.adaptMode = (_b = settings.adaptMode) !== null && _b !== void 0 ? _b : Adapt_1.EAdaptMode.Fill;\n if (typeof settings.shape === 'undefined') {\n console.warn('[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property');\n this.shape = ShapeBuffer.EMPTY_BUFFER;\n }\n else {\n this.shape = typeof settings.shape !== 'function' ? Adapt_1.Adapt.adapt(settings.shape, this.adaptMode) : settings.shape;\n }\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n /**\n * Check shape is static\n *\n * @returns boolean\n */\n isStatic() {\n return typeof this.shape !== 'function' && super.isStatic();\n }\n /**\n * Check shape is static indexed\n *\n * @returns boolean\n */\n isStaticIndexed() {\n return typeof this.shape !== 'function' && super.isStaticIndexed();\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n this.shapeBuffer = undefined;\n }\n /**\n * Apply sideLength on .shape buffer and calculate bounding\n *\n * @protected\n */\n bindBuffer(propArguments) {\n const sideLength = this.getRepetitionSideLength(propArguments);\n const shapeBuffer = this.applyModifiers(Float32Array.from(typeof this.shape === 'function' ? this.shape(propArguments) : this.shape), propArguments);\n const tmpBounding = [undefined, undefined, undefined, undefined];\n for (let i = 0, len = shapeBuffer.length; i < len; i += 2) {\n shapeBuffer[i] = shapeBuffer[i] * sideLength[0];\n shapeBuffer[i + 1] = shapeBuffer[i + 1] * sideLength[1];\n Adapt_1.Bounding.add(tmpBounding, shapeBuffer[i], shapeBuffer[i + 1]);\n }\n Adapt_1.Bounding.bind(this.currentGenerationPrimitiveBounding, tmpBounding);\n this.shapeBuffer = shapeBuffer;\n }\n /**\n * Return length of buffer\n *\n * @param {IPropArguments} propArguments\n * @returns {number}\n */\n getBufferLength( /*propArguments?: IPropArguments*/) {\n if (this.buffer && this.buffer.length > 0)\n return this.buffer.length;\n return this.shape.length * this.getRepetitionCount();\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (typeof this.shapeBuffer === 'undefined' ||\n typeof this.props.sideLength === 'function' ||\n typeof this.shape === 'function') {\n this.bindBuffer(propArguments);\n }\n return this.shapeBuffer;\n }\n /**\n * Set shape\n *\n * @param {(Float32Array)} [shape]\n */\n setShape(shape) {\n this.shape = Adapt_1.Adapt.adapt(shape, this.adaptMode);\n this.clearBuffer(true);\n }\n /**\n * Return adaptMode\n *\n * @returns {EAdaptMode}\n * @memberof ShapeBase\n */\n getAdaptMode() {\n return this.adaptMode;\n }\n /**\n * Get static buffer\n *\n * @param sideLength\n * @returns\n */\n static getBuffer(props = {}) {\n const shape = new this({ ...props, sideLength: props.sideLength || 1 });\n shape.generate();\n return shape.getBuffer() || new Float32Array();\n }\n}\nexports.ShapeBuffer = ShapeBuffer;\n//# sourceMappingURL=ShapeBuffer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeRecursive = void 0;\nconst Shape_1 = require(\"./Shape\");\n/**\n * @category Core.Shapes\n */\nclass ShapeRecursive extends Shape_1.Shape {\n /**\n * Creates an instance of ShapeRecursive.\n *\n * @param {IShapeRecursiveSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'ShapeRecursive';\n super(settings);\n this.props.recursions = settings.recursions || 1;\n this.props.recursionScale = settings.recursionScale || 2;\n this.props.recursionVertex = settings.recursionVertex || 0;\n // this.bInner = settings.bInner ?? false\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n this.shapeUseRecursion = !!settings.shapeUseRecursion;\n // this.currentGenerationRecursiveBounding = Bounding.empty()\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n if (bClearIndexed) {\n this.shapeRecursiveBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n * Set type of recursion\n *\n * @param {boolean} inner\n */\n // public setRecursionnInner(inner: boolean): void {\n // \tthis.bInner = inner\n // \tthis.clearBuffer(true)\n // }\n /**\n *\n * @returns {boolean}\n */\n isStatic() {\n return (typeof this.props.recursions !== 'function' &&\n typeof this.props.recursionScale !== 'function' &&\n typeof this.props.recursionVertex !== 'function' &&\n super.isStatic());\n }\n /**\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return (typeof this.props.recursions !== 'function' &&\n typeof this.props.recursionVertex !== 'function' &&\n super.isStaticIndexed());\n }\n /**\n * Return a buffer of children shape with recursion\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape) {\n if (typeof this.shapeRecursiveBuffer === 'undefined' ||\n this.shapeUseParent ||\n this.shape.generateId !== generateId) {\n this.bindBuffer(generateId, propArguments);\n }\n return this.shapeRecursiveBuffer;\n }\n return Shape_1.Shape.EMPTY_BUFFER;\n }\n /**\n * Generate Recoursive shape buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n */\n bindBuffer(generateId, propArguments) {\n const recursions = Math.floor(this.getProp('recursions', propArguments, 1));\n const recursionVertex = Math.floor(this.getProp('recursionVertex', propArguments, 0));\n const recursionScale = this.getProp('recursionScale', propArguments, 2);\n const childShape = this.shape;\n let currentRecursionRepetition = {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: 1 },\n };\n const recursionPropArguments = {\n ...propArguments,\n recursion: currentRecursionRepetition,\n };\n childShape.generate(generateId, false, recursionPropArguments);\n const firstGenerationChildBuffer = childShape.getBuffer();\n if (recursions <= 1) {\n // this.currentGenerationRecursiveBounding = this.shape.getBounding()\n this.shapeRecursiveBuffer = firstGenerationChildBuffer;\n return;\n }\n let shapeBuffer = firstGenerationChildBuffer;\n const storedRecursion = [currentRecursionRepetition];\n let paretRecursionIndex = 0, added = 1;\n // const tmpBounding = [undefined, undefined, undefined, undefined]\n const singleShapeBufferLength = shapeBuffer.length;\n const realVertexCount = singleShapeBufferLength / 2;\n const singleShapeVertexCount = recursionVertex <= 0 ? realVertexCount : Math.min(recursionVertex, realVertexCount);\n const recursionOffsetMultiplier = recursionVertex === 0 ? 1 : realVertexCount / Math.min(recursionVertex, realVertexCount);\n const recusiveShapeBuffer = new Float32Array(ShapeRecursive.summmation(recursions, singleShapeVertexCount) * singleShapeBufferLength);\n for (let i = 0; i < singleShapeBufferLength; i += 2) {\n recusiveShapeBuffer[i] = shapeBuffer[i];\n recusiveShapeBuffer[i + 1] = shapeBuffer[i + 1];\n // Bounding.add(tmpBounding, recusiveShapeBuffer[i], recusiveShapeBuffer[i + 1])\n }\n for (let currentRecursion = 1; currentRecursion < recursions; currentRecursion++) {\n const level_offset = recursions > 1 ? currentRecursion / (recursions - 1) : 1;\n const currentRecursionVertexCount = ShapeRecursive.summmation(currentRecursion, singleShapeVertexCount);\n const recursionBufferStartIndex = currentRecursionVertexCount * singleShapeBufferLength;\n const parentRecursion = currentRecursion - 1;\n const parentRecursionBufferStartIndex = parentRecursion === 0\n ? 0\n : ShapeRecursive.summmation(parentRecursion, singleShapeVertexCount) * singleShapeBufferLength;\n for (let currentShapeRecursionRepetition = 0, totalRecursionRepetitions = singleShapeVertexCount ** currentRecursion; currentShapeRecursionRepetition < totalRecursionRepetitions; currentShapeRecursionRepetition++, added++) {\n currentRecursionRepetition = {\n index: currentShapeRecursionRepetition + 1,\n offset: totalRecursionRepetitions > 1 ? currentShapeRecursionRepetition / (totalRecursionRepetitions - 1) : 1,\n count: totalRecursionRepetitions,\n level: { index: currentRecursion + 1, offset: level_offset, count: recursions },\n parent: storedRecursion[paretRecursionIndex],\n };\n storedRecursion.push(currentRecursionRepetition);\n if (this.shapeUseRecursion) {\n recursionPropArguments.recursion = currentRecursionRepetition;\n childShape.generate(generateId, false, recursionPropArguments);\n shapeBuffer = childShape.getBuffer();\n }\n const shapeVertexBufferIndex = recursionBufferStartIndex + currentShapeRecursionRepetition * singleShapeBufferLength;\n // const centerVertexIndex = parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2\n const centerVertexIndex = Math.floor(parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2 * recursionOffsetMultiplier);\n const centerX = recusiveShapeBuffer[centerVertexIndex];\n const centerY = recusiveShapeBuffer[centerVertexIndex + 1];\n const currentRecursionScale = recursionScale ** currentRecursion;\n for (let i = 0, len = singleShapeBufferLength; i < len; i += 2) {\n // if (this.bInner) {\n // \tconst parentCurrentVertex =\n // \t\tparentRecursionBufferStartIndex +\n // \t\tMath.floor(currentShapeRecursionRepetition / singleShapeVertexCount) *\n // \t\t\tsingleShapeVertexCount *\n // \t\t\trecursionOffsetMultiplier *\n // \t\t\t2\n // \tconst parentX = recusiveShapeBuffer[parentCurrentVertex + i]\n // \tconst parentY = recusiveShapeBuffer[parentCurrentVertex + i + 1]\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i] = (centerX - parentX) / recursionScale + parentX\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = (centerY - parentY) / recursionScale + parentY\n // const parentX = shapeBuffer[i] / recursionScale ** currentRecursion\n // const parentY = shapeBuffer[i + 1] / recursionScale ** currentRecursion\n // recusiveShapeBuffer[shapeVertexBufferIndex + i] = (centerX - parentX) / recursionScale + parentX\n // recusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = (centerY - parentY) / recursionScale + parentY\n // } else {\n const parentXScaled = shapeBuffer[i] / currentRecursionScale;\n const parentYScaled = shapeBuffer[i + 1] / currentRecursionScale;\n recusiveShapeBuffer[shapeVertexBufferIndex + i] = centerX + parentXScaled;\n recusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = centerY + parentYScaled;\n // }\n // Bounding.add(\n // \ttmpBounding,\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i],\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i + 1]\n // )\n }\n if (added % singleShapeVertexCount === 0) {\n paretRecursionIndex += 1;\n }\n }\n }\n // Bounding.bind(this.currentGenerationRecursiveBounding, tmpBounding)\n this.shapeRecursiveBuffer = recusiveShapeBuffer;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const propArguments = { repetition, shape: this };\n const recursions = Math.floor(this.getProp('recursions', propArguments, 1));\n const recursionVertex = Math.floor(this.getProp('recursionVertex', propArguments, 0));\n // const realFrameLength = ShapeRecursive.summmation(recursions, this.shape.getBufferLength() / 2)\n const bufferIndex = {\n shape: this,\n frameLength: frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n recursion: {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: recursions },\n },\n };\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentRecursionRepetition = {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: recursions },\n };\n const recursionBufferIndex = {\n ...bufferIndex,\n recursion: currentRecursionRepetition,\n };\n const parent = (currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, recursionBufferIndex)\n : recursionBufferIndex);\n this.indexedBuffer.push({\n ...currentIndexed,\n parent,\n });\n }\n if (recursions > 1) {\n const realVertexCount = this.shape.getBufferLength({ ...propArguments, parent: { ...bufferIndex } }) / 2;\n const vertexCount = recursionVertex <= 0 ? realVertexCount : Math.min(recursionVertex, realVertexCount);\n const storedRecursion = this.indexedBuffer.map(indexed => [indexed.parent.recursion]);\n let paretRecursionIndex = 0, added = 1;\n for (let i = 1; i < recursions; i++) {\n const level_offset = recursions > 1 ? i / (recursions - 1) : 1;\n for (let j = 0, len = vertexCount ** i; j < len; j++, added++) {\n const recursionOffset = len > 1 ? j / (len - 1) : 1;\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentRecursionRepetition = {\n index: j + 1,\n offset: recursionOffset,\n count: len,\n level: { index: i + 1, offset: level_offset, count: recursions },\n parent: storedRecursion[childIndexed][paretRecursionIndex],\n };\n const recursionBufferIndex = { ...bufferIndex, recursion: currentRecursionRepetition };\n const parent = currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, recursionBufferIndex)\n : recursionBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n storedRecursion[childIndexed].push(currentRecursionRepetition);\n if (added % vertexCount === 0) {\n paretRecursionIndex += 1;\n }\n }\n }\n }\n }\n }\n }\n /**\n * Retturn summation value\n *\n * @static\n * @param {number} recursion\n * @param {number} vertexCount\n * @returns {number}\n */\n static summmation(recursion, vertexCount) {\n if (recursion === 1)\n return 1;\n let result = 1;\n for (let i = 1; i < recursion; i++)\n result += vertexCount ** i;\n return result;\n }\n /**\n * Empty recursion repetition\n *\n * @static\n * @return {*} {IRecursionRepetition}\n */\n static getEmptyRecursion() {\n return {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: 1, count: 1 },\n };\n }\n}\nexports.ShapeRecursive = ShapeRecursive;\n//# sourceMappingURL=ShapeRecursive.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeFollow = void 0;\nconst Shape_1 = require(\"./Shape\");\n/**\n * @category Core.Shapes\n */\nclass ShapeFollow extends Shape_1.Shape {\n /**\n * Creates an instance of ShapeFollow.\n *\n * @param {IShapeFollowSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'ShapeFollow';\n super(settings);\n this.follow = settings.follow || settings.shape;\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n this.shapeUseFollow = !!settings.shapeUseFollow;\n // this.currentGenerationRecursiveBounding = Bounding.empty()\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n if (bClearIndexed) {\n this.shapeFollowBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n *\n * @returns {boolean}\n */\n isStatic() {\n return (this.follow ? this.follow.isStatic() : true) && super.isStatic();\n }\n /**\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return (this.follow ? this.follow.isStaticIndexed() : true) && super.isStaticIndexed();\n }\n /**\n * Return a buffer of children shape with recursion\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape && this.follow) {\n if (typeof this.shapeFollowBuffer === 'undefined' ||\n this.shapeUseParent ||\n this.shape.generateId !== generateId ||\n this.follow.generateId !== generateId) {\n this.bindBuffer(generateId, propArguments);\n }\n return this.shapeFollowBuffer;\n }\n return Shape_1.Shape.EMPTY_BUFFER;\n }\n /**\n * Generate Recoursive shape buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n */\n bindBuffer(generateId, propArguments) {\n const followShape = this.follow;\n followShape.generate(generateId, false, propArguments);\n const followBuffer = followShape.getBuffer();\n // const followIndexed = followShape.getIndexedBuffer() as Array\n const followPropArguments = {\n ...propArguments,\n follow: {\n index: 1,\n offset: 1,\n count: 1,\n },\n // follow_repetition: followIndexed[0].repetition,\n };\n const childShape = this.shape;\n childShape.generate(generateId, false, followPropArguments);\n let shapeBuffer = childShape.getBuffer();\n // const tmpBounding = [undefined, undefined, undefined, undefined]\n const singleShapeBufferLength = shapeBuffer.length;\n const followShapeBuffer = new Float32Array(singleShapeBufferLength * (followBuffer.length / 2));\n const totalFollowVertexCount = followBuffer.length / 2;\n for (let currentShapeFollowRepetition = 0; currentShapeFollowRepetition < totalFollowVertexCount; currentShapeFollowRepetition++) {\n const currentFollowRepetition = {\n index: currentShapeFollowRepetition + 1,\n offset: totalFollowVertexCount > 1 ? currentShapeFollowRepetition / (totalFollowVertexCount - 1) : 1,\n count: totalFollowVertexCount,\n };\n if (this.shapeUseFollow) {\n followPropArguments.follow = currentFollowRepetition;\n // followPropArguments.follow_repetition = followIndexed[currentShapeFollowRepetition].repetition\n childShape.generate(generateId, false, followPropArguments);\n shapeBuffer = childShape.getBuffer();\n }\n const shapeVertexBufferIndex = currentShapeFollowRepetition * singleShapeBufferLength;\n // const centerVertexIndex = parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2\n const centerVertexIndex = currentShapeFollowRepetition * 2;\n const centerX = followBuffer[centerVertexIndex];\n const centerY = followBuffer[centerVertexIndex + 1];\n for (let i = 0, len = shapeBuffer.length; i < len; i += 2) {\n followShapeBuffer[shapeVertexBufferIndex + i] = centerX + shapeBuffer[i];\n followShapeBuffer[shapeVertexBufferIndex + i + 1] = centerY + shapeBuffer[i + 1];\n // Bounding.add(\n // \ttmpBounding,\n // \tfollowShapeBuffer[shapeVertexBufferIndex + i],\n // \tfollowShapeBuffer[shapeVertexBufferIndex + i + 1]\n // )\n }\n }\n // Bounding.bind(this.currentGenerationRecursiveBounding, tmpBounding)\n this.shapeFollowBuffer = followShapeBuffer;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const propArguments = { repetition, shape: this };\n const bufferIndex = {\n shape: this,\n frameLength: frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n follow: {\n index: 1,\n offset: 1,\n count: 1,\n },\n };\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const vertexCount = this.follow.getBuffer().length / 2; // this.follow.getBufferLength({ ...propArguments, parent: { ...bufferIndex } }) / 2\n for (let j = 0, len = vertexCount; j < len; j++) {\n const followOffset = len > 1 ? j / (len - 1) : 1;\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentFollowRepetition = {\n index: j + 1,\n offset: followOffset,\n count: len,\n };\n const followBufferIndex = { ...bufferIndex, follow: currentFollowRepetition };\n const parent = currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, followBufferIndex)\n : followBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n }\n }\n }\n }\n }\n /**\n * Retturn summation value\n *\n * @static\n * @param {number} recursion\n * @param {number} vertexCount\n * @returns {number}\n */\n static summmation(recursion, vertexCount) {\n if (recursion === 1)\n return 1;\n let result = 1;\n for (let i = 1; i < recursion; i++)\n result += vertexCount ** i;\n return result;\n }\n /**\n * Empty recursion repetition\n *\n * @static\n * @return {*} {IRecursionRepetition}\n */\n static getEmptyRecursion() {\n return {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: 1, count: 1 },\n };\n }\n}\nexports.ShapeFollow = ShapeFollow;\n//# sourceMappingURL=ShapeFollow.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Line = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n *\n * @category Core.Primitives\n * @class Line\n * @extends {ShapeBuffer}\n */\nclass Line extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Two point, based on ShapeBuffer\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Line\n */\n constructor(settings = {}) {\n settings.type = 'Line';\n settings.shape = Line.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n settings.bClosed = false;\n super(settings);\n }\n /**\n * @link https://gist.github.com/pborissow/5c92b77a804688385c77749d1187ba07\n */\n static toPolygon(buffer, thickness) {\n const solidified = [];\n //Convert thickness into an array as needed\n if (!Array.isArray(thickness)) {\n const _thickness = thickness;\n const points = buffer.length / 2;\n thickness = new Array(points);\n for (let i = 0; i < points; i++) {\n thickness[i] = _thickness;\n }\n }\n function getOffsets(ax, ay, bx, by, thickness) {\n const dx = bx - ax, dy = by - ay, len = Math.sqrt(dx * dx + dy * dy), scale = thickness / (2 * len);\n return [-scale * dy, scale * dx];\n }\n function getIntersection(a1, b1, a2, b2) {\n // directional constants\n const k1 = (b1[1] - a1[1]) / (b1[0] - a1[0]), k2 = (b2[1] - a2[1]) / (b2[0] - a2[0]);\n // if the directional constants are equal, the lines are parallel\n if (Math.abs(k1 - k2) < 0.00001) {\n return;\n }\n // y offset constants for both lines\n const m1 = a1[1] - k1 * a1[0];\n const m2 = a2[1] - k2 * a2[0];\n // compute x\n const x = (m1 - m2) / (k2 - k1);\n // use y = k * x + m to get y coordinate\n const y = k1 * x + m1;\n return [x, y];\n }\n let bFirst, bLast, prevA = [\n [0, 0],\n [0, 0],\n ], prevB = [\n [0, 0],\n [0, 0],\n ];\n for (let i = 0, len = buffer.length - 2; i < len; i += 2) {\n bFirst = i === 0;\n bLast = i === len - 2;\n const off = getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], thickness[i]);\n const p0a = [buffer[i] + off[0], buffer[i + 1] + off[1]];\n const p1a = [buffer[i + 2] + off[0], buffer[i + 3] + off[1]];\n const p0b = [buffer[i] - off[0], buffer[i + 1] - off[1]];\n const p1b = [buffer[i + 2] - off[0], buffer[i + 3] - off[1]];\n if (!bFirst) {\n const interA = getIntersection(prevA[0], prevA[1], p0a, p1a);\n if (interA) {\n solidified.unshift(interA[1]);\n solidified.unshift(interA[0]);\n }\n const interB = getIntersection(prevB[0], prevB[1], p0b, p1b);\n if (interB) {\n solidified.push(interB[0]);\n solidified.push(interB[1]);\n }\n }\n if (bFirst) {\n solidified.unshift(p0a[1]);\n solidified.unshift(p0a[0]);\n solidified.push(p0b[0]);\n solidified.push(p0b[1]);\n }\n if (bLast) {\n solidified.unshift(p1a[1]);\n solidified.unshift(p1a[0]);\n solidified.push(p1b[0]);\n solidified.push(p1b[1]);\n }\n if (!bLast) {\n prevA = [p0a, p1a];\n prevB = [p0b, p1b];\n }\n }\n return Float32Array.from(solidified);\n }\n}\nexports.Line = Line;\nLine.buffer = [-1, 0, 1, 0];\n//# sourceMappingURL=Line.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Triangle = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n * Triangle ShapeBuffer\n *\n * @category Core.Primitives\n */\nclass Triangle extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Creates an instance of Triangleeee.\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Triangle\n */\n constructor(settings = {}) {\n settings.type = 'Triangle';\n settings.shape = Triangle.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n super(settings);\n }\n}\nexports.Triangle = Triangle;\nTriangle.buffer = [1, 0, -1, 1, -1, -1];\n//# sourceMappingURL=Triangle.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Rect = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n *\n * @category Core.Primitives\n * @class Rect\n * @extends {ShapeBuffer}\n */\nclass Rect extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Creates an instance of Rect.\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Rect\n */\n constructor(settings = {}) {\n settings.type = 'Rect';\n settings.shape = Rect.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n super(settings);\n }\n}\nexports.Rect = Rect;\nRect.buffer = [1, 1, -1, 1, -1, -1, 1, -1];\n//# sourceMappingURL=Rect.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Polygon = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Polygon shape\n *\n * @category Core.Primitives\n * @class Polygon\n * @extends {ShapeLoop}\n */\nclass Polygon extends ShapeLoop_1.ShapeLoop {\n /**\n * Is based on ShapeLoop and you can pass `sideNumber` property to define\n * a number of sides.\n *\n * @param settings\n */\n constructor(settings = {}) {\n settings.type = settings.type || 'Polygon';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['sideNumber']);\n super(settings, true);\n this.props.sideNumber = settings.sideNumber;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: (propArguments) => {\n return math_1.PI2 / this.getProp('sideNumber', propArguments, 5);\n },\n vertex: shapeLoopRepetition => {\n return [Math.cos(shapeLoopRepetition.current), Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n}\nexports.Polygon = Polygon;\n//# sourceMappingURL=Polygon.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Circle = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n *\n * @category Core.Primitives\n * @class Circle\n * @extends {ShapeLoop}\n */\nclass Circle extends ShapeLoop_1.ShapeLoop {\n /**\n * Based on ShapeLoop, the number of point (resolution) is based on sideLength.\n *\n * @param {ShapeLoopSettings} [settings={}]\n * @memberof Circle\n */\n constructor(settings = {}) {\n settings.type = 'Circle';\n super(settings, true);\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const sideLength = this.getRepetitionSideLength(propArguments);\n return (1 / Math.pow(sideLength[0] * sideLength[1], 0.25)) * ShapeLoop_1.ShapeLoop.PId2;\n },\n vertex: shapeLoopRepetition => [Math.cos(shapeLoopRepetition.current), Math.sin(shapeLoopRepetition.current)],\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n}\nexports.Circle = Circle;\n//# sourceMappingURL=Circle.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Star = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Polygon shape\n *\n * @category Core.Primitives\n * @class Polygon\n * @extends {ShapeLoop}\n */\nclass Star extends ShapeLoop_1.ShapeLoop {\n /**\n * Is based on ShapeLoop and you can pass `spikes` property to define\n * a number of spikes and `innerRadius`\n *\n * @param settings\n */\n constructor(settings = {}) {\n settings.type = settings.type || 'Polygon';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['spikes', 'innerRadius']);\n super(settings, true);\n this.props.spikes = settings.spikes;\n this.props.innerRadius = settings.innerRadius;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: (propArguments) => {\n // dyamic binding in `generateLoopBuffer`\n return this.inc;\n },\n vertex: shapeLoopRepetition => {\n const angle = (Math.PI / this.spikes) * shapeLoopRepetition.index;\n const radius = shapeLoopRepetition.index % 2 === 0 ? 1 : this.innerRadius;\n return [Math.cos(angle) * radius, Math.sin(angle) * radius];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.spikes = this.getProp('spikes', propArguments, 5);\n this.innerRadius = this.getProp('innerRadius', propArguments, 0.5);\n this.inc = Math.PI / this.spikes;\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.Star = Star;\n//# sourceMappingURL=Star.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Rose = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Rose shape\n *\n * @category Core.Primitives\n * @class Rose\n * @extends {ShapeLoop}\n */\nclass Rose extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Rose.\n *\n * @param {IRoseSettings} [settings={}]\n * @memberof Rose\n */\n constructor(settings = {}) {\n var _a, _b;\n settings.type = 'Rose';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['n', 'd']);\n super(settings, true);\n this.props.n = (_a = settings.n) !== null && _a !== void 0 ? _a : 1;\n this.props.d = (_b = settings.d) !== null && _b !== void 0 ? _b : 2;\n this.loop = {\n start: 0,\n end: (propArguments) => Rose.getFinalAngleFromK(this.getProp('n', propArguments), this.getProp('d', propArguments)),\n inc: (propArguments) => {\n const n = this.getProp('n', propArguments);\n const d = this.getProp('d', propArguments);\n const sideLength = this.getRepetitionSideLength(propArguments);\n const sides = Math.pow(sideLength[0] * sideLength[1], 0.45);\n const k = d < n ? n / d : 1.5;\n return math_1.PI2 / (sides * k);\n },\n vertex: (shapeLoopRepetition) => {\n const f = Math.cos(this.k * shapeLoopRepetition.current);\n return [f * Math.cos(shapeLoopRepetition.current), f * Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.k = this.getProp('n', propArguments) / this.getProp('d', propArguments);\n return super.generateLoopBuffer(propArguments);\n }\n /**\n * Return end angle of rose\n *\n * @static\n * @param {number} n\n * @param {number} d\n * @returns {number}\n * @memberof Rose\n */\n static getFinalAngleFromK(n, d) {\n if (n == d)\n return math_1.PI2;\n const k = n / d;\n const p = n * d;\n if (!Number.isInteger(k) && k % 0.5 == 0)\n return 4 * Math.PI;\n return Math.PI * d * (p % 2 == 0 ? 2 : 1);\n }\n}\nexports.Rose = Rose;\n//# sourceMappingURL=Rose.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Spiral = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n * Spiral shape\n *\n * @category Core.Primitives\n * @class Spiral\n * @extends {ShapeLoop}\n */\nclass Spiral extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Spiral.\n *\n * @param {SpiralSettings} [settings={}]\n * @memberof Spiral\n */\n constructor(settings = {}) {\n var _a, _b, _c;\n settings.type = 'Spiral';\n settings.bClosed = false;\n settings.loopDependencies = (settings.loopDependencies || []).concat(['twists', 'twistsStart', 'spiral']);\n super(settings, true);\n this.props.spiral = (_a = settings.spiral) !== null && _a !== void 0 ? _a : Spiral.types.ARCHIMEDE;\n this.props.twists = (_b = settings.twists) !== null && _b !== void 0 ? _b : 2;\n this.props.twistsStart = (_c = settings.twistsStart) !== null && _c !== void 0 ? _c : 0;\n this.loop = {\n start: (propArguments) => math_1.PI2 * this.getProp('twistsStart', propArguments),\n end: (propArguments) => math_1.PI2 *\n (this.getProp('twistsStart', propArguments) + this.getProp('twists', propArguments)),\n inc: (propArguments) => {\n const twists = this.getProp('twists', propArguments);\n const rep = math_1.PI2 * twists;\n const sideLength = this.getRepetitionSideLength(propArguments);\n const radius = 4 + Math.sqrt(sideLength[0] * sideLength[1]);\n return rep / (radius * twists);\n },\n vertex: (shapeLoopRepetition) => {\n const r = this.r(shapeLoopRepetition.current);\n return [r * Math.cos(shapeLoopRepetition.current), r * Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.spiral = this.getProp('spiral', propArguments);\n this.r = Spiral.getRFromTSpiralType(this.spiral);\n return super.generateLoopBuffer(propArguments);\n }\n /**\n * Point position and scale factor for spiral types\n *\n * @static\n * @param {TSpiralType} spiral\n * @returns {number}\n * @memberof Spiral\n */\n static getRFromTSpiralType(spiral) {\n switch (spiral) {\n case Spiral.types.ARCHIMEDE:\n return angle => angle / 10;\n case Spiral.types.HYPERBOLIC:\n return angle => (1 / angle) * 3;\n case Spiral.types.FERMAT:\n return angle => angle ** 0.5 / 3;\n case Spiral.types.LITUUS:\n return angle => angle ** -0.5;\n case Spiral.types.LOGARITHMIC:\n return angle => Math.E ** (angle * 0.2) / 10;\n }\n return angle => angle;\n }\n}\nexports.Spiral = Spiral;\n/**\n * Spural types\n *\n * @static\n * @type {{ [name in TSpiralType]: TSpiralType }}\n * @memberof Spiral\n */\nSpiral.types = {\n ARCHIMEDE: 'ARCHIMEDE',\n HYPERBOLIC: 'HYPERBOLIC',\n FERMAT: 'FERMAT',\n LITUUS: 'LITUUS',\n LOGARITHMIC: 'LOGARITHMIC',\n};\n//# sourceMappingURL=Spiral.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Lissajous = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Lissajous shape\n *\n * @category Core.Primitives\n * @class Lissajous\n * @extends {ShapeLoop}\n */\nclass Lissajous extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Lissajous.\n *\n * @param {ILissajousSettings} [settings={}]\n * @memberof Lissajous\n */\n constructor(settings = {}) {\n settings.type = 'Lissajous';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['wx', 'wy', 'wz']);\n super(settings, true);\n this.props.wx = settings.wx || 1;\n this.props.wy = settings.wy || 2;\n this.props.wz = settings.wz || 0;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const wx = this.getProp('wx', propArguments);\n const wy = this.getProp('wy', propArguments);\n const ratio = wx == wy ? ShapeLoop_1.ShapeLoop.PId2 : 0.5 - Math.min(49, wx + wy) * 0.01;\n const sideLength = this.getRepetitionSideLength(propArguments);\n return (1 / Math.pow(sideLength[0] * sideLength[1], 0.25)) * ratio;\n },\n vertex: (shapeLoopRepetition) => {\n return this.wx === this.wy\n ? [Math.cos(shapeLoopRepetition.current + this.wz), Math.sin(shapeLoopRepetition.current)]\n : [Math.cos(this.wx * shapeLoopRepetition.current + this.wz), Math.sin(this.wy * shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.wx = this.getProp('wx', propArguments, 1);\n this.wy = this.getProp('wy', propArguments, 2);\n this.wz = this.getProp('wz', propArguments, 2);\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.Lissajous = Lissajous;\n//# sourceMappingURL=Lissajous.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SuperShape = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n * ShperShape\n *\n * @category Core.Primitives\n * @class SuperShape\n * @extends {ShapeLoop}\n */\nclass SuperShape extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of SuperShape.\n *\n * @param {ISuperShapeSettings} [settings={}]\n * @memberof SuperShape\n */\n constructor(settings = {}) {\n var _a, _b, _c, _d, _e, _f;\n settings.type = 'SuperShape';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['a', 'b', 'm', 'n1', 'n2', 'n3']);\n super(settings, true);\n this.props.a = (_a = settings.a) !== null && _a !== void 0 ? _a : 1;\n this.props.b = (_b = settings.b) !== null && _b !== void 0 ? _b : 1;\n this.props.m = (_c = settings.m) !== null && _c !== void 0 ? _c : 6;\n this.props.n1 = (_d = settings.n1) !== null && _d !== void 0 ? _d : 1;\n this.props.n2 = (_e = settings.n2) !== null && _e !== void 0 ? _e : 1;\n this.props.n3 = (_f = settings.n3) !== null && _f !== void 0 ? _f : 1;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const sideLength = this.getRepetitionSideLength(propArguments);\n return Math.PI / Math.pow(sideLength[0] * sideLength[1], 0.5);\n },\n vertex: (shapeLoopRepetition) => {\n const angle = shapeLoopRepetition.current;\n const m = (this.m * angle) / 4;\n const a = Math.abs(Math.cos(m) / this.a) ** this.n2;\n const b = Math.abs(Math.sin(m) / this.b) ** this.n3;\n const raux = (a + b) ** (1 / this.n1);\n const r = raux === 0 ? 1 : 1 / raux;\n return [r * Math.cos(angle), r * Math.sin(angle)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.a = this.getProp('a', propArguments);\n this.b = this.getProp('b', propArguments);\n this.m = this.getProp('m', propArguments);\n this.n1 = this.getProp('n1', propArguments);\n this.n2 = this.getProp('n2', propArguments);\n this.n3 = this.getProp('n3', propArguments);\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.SuperShape = SuperShape;\n//# sourceMappingURL=SuperShape.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Modifiers = void 0;\nconst Adapt_1 = require(\"./Adapt\");\nconst Mirror_1 = require(\"./Mirror\");\nconst Smooth_1 = require(\"./Smooth\");\nconst Solidify_1 = require(\"./Solidify\");\nconst Subdivide_1 = require(\"./Subdivide\");\nconst Close_1 = require(\"./Close\");\nconst Offset_1 = require(\"./Offset\");\nconst Modifiers = {\n Adapt: Adapt_1.Adapt,\n Mirror: Mirror_1.Mirror,\n Smooth: Smooth_1.Smooth,\n Solidify: Solidify_1.Solidify,\n Subdivide: Subdivide_1.Subdivide,\n Close: Close_1.Close,\n Offset: Offset_1.Offset,\n};\nexports.Modifiers = Modifiers;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Mirror = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Mirror extends Modifier_1.Modifier {\n constructor(args = { x: true, y: true }) {\n super();\n this.x = args.x === true;\n this.y = args.y === true;\n }\n apply(buffer, bClosed) {\n const bufferLength = buffer.length;\n const mirror = new Float32Array(bufferLength * (this.x ? 2 : 1) * (this.y ? 2 : 1));\n const sideLengthX = 1;\n const sideLengthY = 1;\n if (this.x && this.y) {\n const bufferLengthX2 = bufferLength + bufferLength;\n const bufferLengthX3 = bufferLengthX2 + bufferLength;\n // |1|2|\n // |4|3|\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i] - sideLengthX;\n mirror[i + 1] = buffer[i + 1] - sideLengthY;\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i] * -1 + sideLengthX;\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1] - sideLengthY;\n mirror[bufferLengthX2 + i] = buffer[i] * -1 + sideLengthX;\n mirror[bufferLengthX2 + i + 1] = buffer[i + 1] * -1 + sideLengthY;\n mirror[bufferLengthX3 + i] = buffer[bufferLength - 2 - i] - sideLengthX;\n mirror[bufferLengthX3 + i + 1] = buffer[bufferLength - 2 - i + 1] * -1 + sideLengthY;\n }\n }\n else if (this.x) {\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i] - sideLengthX;\n mirror[i + 1] = buffer[i + 1];\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i] * -1 + sideLengthX;\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1];\n }\n }\n else if (this.y) {\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i];\n mirror[i + 1] = buffer[i + 1] - sideLengthY;\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i];\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1] * -1 + sideLengthY;\n }\n }\n else {\n return buffer;\n }\n return mirror;\n }\n}\nexports.Mirror = Mirror;\n//# sourceMappingURL=Mirror.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Smooth = void 0;\nconst Utilities_1 = require(\"../Utilities\");\nconst Close_1 = require(\"./Close\");\nconst Modifier_1 = require(\"./Modifier\");\nclass Smooth extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.level = args.level || 1;\n const tension = Array.isArray(args.tension) ? args.tension : [args.tension];\n this.tension = new Array(this.level).fill(0.5).map((v, i) => Utilities_1.clamp(0, 1, tension[i] || v));\n this.level = this.level < 1 ? 1 : this.level;\n this.closed = args.closed === true;\n }\n apply(buffer, bClosed) {\n if (bClosed && !Close_1.Close.isClosed(buffer)) {\n const bufferLen = buffer.length;\n const mofified = new Float32Array(bufferLen + 2);\n mofified.set(buffer, 0);\n mofified[bufferLen] = buffer[0];\n mofified[bufferLen + 1] = buffer[1];\n buffer = mofified;\n }\n let smoothed = buffer;\n for (let i = 0, len = this.level; i < len; i++)\n smoothed = Smooth.smooth(smoothed, this.tension[i], bClosed || this.closed);\n return smoothed;\n }\n /**\n * Chaikin smooth\n *\n * the tension factor defines a scale between corner cutting distance in segment half length,\n * i.e. between 0.05 and 0.45. The opposite corner will be cut by the inverse\n * (i.e. 1-cutting distance) to keep symmetry.\n * with a tension value of 0.5 this amounts to 0.25 = 1/4 and 0.75 = 3/4,\n * the original Chaikin values\n *\n * @link https://www.codeproject.com/Articles/1093960/D-Polyline-Vertex-Smoothing\n * @param buffer\n */\n static smooth(buffer, tension = 0.5, bClosed = false) {\n const bufferLength = buffer.length;\n const smoothed = new Float32Array((buffer.length - (bClosed ? 1 : 0)) * 2);\n if (!bClosed) {\n smoothed[0] = buffer[0];\n smoothed[1] = buffer[1];\n }\n const cutdist = 0.05 + tension * 0.4;\n const ncutdist = 1 - cutdist;\n let smoothedLength = bClosed ? 0 : 2;\n for (let i = 0, len = bufferLength - 2; i < len; i += 2, smoothedLength += 4) {\n // q\n smoothed[smoothedLength] = ncutdist * buffer[i] + cutdist * buffer[i + 2];\n smoothed[smoothedLength + 1] = ncutdist * buffer[i + 1] + cutdist * buffer[i + 3];\n // r\n smoothed[smoothedLength + 2] = cutdist * buffer[i] + ncutdist * buffer[i + 2];\n smoothed[smoothedLength + 3] = cutdist * buffer[i + 1] + ncutdist * buffer[i + 3];\n }\n if (!bClosed) {\n smoothed[smoothedLength] = buffer[bufferLength - 2];\n smoothed[smoothedLength + 1] = buffer[bufferLength - 1];\n }\n else {\n smoothed[smoothedLength] = smoothed[0];\n smoothed[smoothedLength + 1] = smoothed[1];\n }\n return smoothed;\n }\n}\nexports.Smooth = Smooth;\n//# sourceMappingURL=Smooth.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Close = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Close extends Modifier_1.Modifier {\n constructor() {\n super();\n }\n apply(buffer, bClosed, shape) {\n return Close.call(buffer);\n }\n static call(buffer) {\n const len = buffer.length;\n if (Close.isClosed(buffer))\n return buffer;\n const result = new Float32Array(len + 2);\n result.set(buffer, 0);\n result[len] = result[0];\n result[len + 1] = result[1];\n return result;\n }\n static isClosed(buffer) {\n const len = buffer.length;\n return buffer[0] === buffer[len - 2] && buffer[1] === buffer[len - 1];\n }\n}\nexports.Close = Close;\n//# sourceMappingURL=Close.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Solidify = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Solidify extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.closed = args.closed === true;\n this.thickness = args.thickness || 0.2;\n this.error = args.error;\n }\n apply(buffer, bClosed) {\n return Solidify.solidify(buffer, this.thickness, this.closed, this.error);\n }\n /**\n * @link https://gist.github.com/kekscom/4194148\n */\n static solidify(buffer, thickness, bClosed = false, error) {\n const solidified = [];\n thickness = typeof thickness === 'number' ? [thickness] : thickness;\n const thicknessLength = thickness.length;\n let bFirst, bLast, prevA = [\n [0, 0],\n [0, 0],\n ], prevB = [\n [0, 0],\n [0, 0],\n ];\n for (let i = 0, t = 0, len = buffer.length - 2; i < len; i += 2, t++) {\n bFirst = i === 0;\n bLast = i === len - 2;\n const currentThicknessRep = {\n index: i + 1,\n offset: i / len,\n count: len,\n };\n const nextThicknessRep = {\n index: i + 2,\n offset: (i + 1) / len,\n count: len,\n };\n const currentThickness = typeof thickness === 'function' ? thickness(currentThicknessRep) : thickness[t % thicknessLength];\n const nextThickness = typeof thickness === 'function' ? thickness(nextThicknessRep) : thickness[(t + 1) % thicknessLength];\n const off = Solidify.getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], currentThickness);\n const off2 = Solidify.getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], nextThickness);\n const p0a = [buffer[i] + off[0], buffer[i + 1] + off[1]];\n const p1a = [buffer[i + 2] + off2[0], buffer[i + 3] + off2[1]];\n const p0b = [buffer[i] - off[0], buffer[i + 1] - off[1]];\n const p1b = [buffer[i + 2] - off2[0], buffer[i + 3] - off2[1]];\n if (!bFirst) {\n const interA = Solidify.getIntersection(prevA[0], prevA[1], p0a, p1a, error);\n if (interA) {\n solidified.unshift(interA[1]);\n solidified.unshift(interA[0]);\n }\n const interB = Solidify.getIntersection(prevB[0], prevB[1], p0b, p1b, error);\n if (interB) {\n solidified.push(interB[0]);\n solidified.push(interB[1]);\n }\n }\n if (bFirst) {\n solidified.unshift(p0a[1]);\n solidified.unshift(p0a[0]);\n solidified.push(p0b[0]);\n solidified.push(p0b[1]);\n }\n if (bLast) {\n solidified.unshift(p1a[1]);\n solidified.unshift(p1a[0]);\n solidified.push(p1b[0]);\n solidified.push(p1b[1]);\n }\n if (!bLast) {\n prevA = [p0a, p1a];\n prevB = [p0b, p1b];\n }\n }\n if (bClosed) {\n const centerIndex = buffer.length - 2;\n const lastIndex = solidified.length - 2;\n const x = 0.5 * solidified[0] + solidified[centerIndex] * 0.5;\n const y = 0.5 * solidified[1] + solidified[centerIndex + 1] * 0.5;\n const x2 = 0.5 * solidified[centerIndex + 2] + solidified[lastIndex] * 0.5;\n const y2 = 0.5 * solidified[centerIndex + 3] + solidified[lastIndex + 1] * 0.5;\n solidified[0] = x;\n solidified[1] = y;\n solidified[centerIndex] = x;\n solidified[centerIndex + 1] = y;\n solidified[centerIndex + 2] = x2;\n solidified[centerIndex + 3] = y2;\n solidified[lastIndex] = x2;\n solidified[lastIndex + 1] = y2;\n }\n return Float32Array.from(solidified);\n }\n static getOffsets(ax, ay, bx, by, thickness) {\n const dx = bx - ax, dy = by - ay, len = Math.sqrt(dx * dx + dy * dy), scale = thickness / (2 * len);\n return [-scale * dy, scale * dx];\n }\n static getIntersection(a1, b1, a2, b2, error = 0.00001) {\n // directional constants\n const k1 = (b1[1] - a1[1]) / (b1[0] - a1[0]), k2 = (b2[1] - a2[1]) / (b2[0] - a2[0]);\n // if the directional constants are equal, the lines are parallel\n // if (Math.abs(k1 - k2) < 0.00001) {\n if (Math.abs(k1 - k2) < error) {\n return;\n }\n // y offset constants for both lines\n const m1 = a1[1] - k1 * a1[0];\n const m2 = a2[1] - k2 * a2[0];\n // compute x\n const x = (m1 - m2) / (k2 - k1);\n // use y = k * x + m to get y coordinate\n const y = k1 * x + m1;\n return [x, y];\n }\n}\nexports.Solidify = Solidify;\n//# sourceMappingURL=Solidify.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Subdivide = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Subdivide extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.level = args.level || 1;\n this.level = this.level < 1 ? 1 : this.level;\n }\n apply(buffer, bClosed) {\n const level = this.level;\n let subdivided = buffer;\n if (subdivided && subdivided.length > 0) {\n for (let i = 0; i < level; i++)\n subdivided = Subdivide.subdivide(subdivided, bClosed);\n }\n return subdivided;\n }\n /**\n * Subdivide buffer\n *\n * @static\n * @param {Float32Array} shape\n * @param {boolean} [bClosed=true]\n * @returns {(Float32Array)}\n */\n static subdivide(buffer, bClosed = false) {\n const bufferLength = buffer.length;\n const subdivided = new Float32Array(bufferLength * 2 - (bClosed ? 0 : 2));\n for (let i = 0; i < bufferLength; i += 2) {\n if (i === 0) {\n subdivided[0] = buffer[0];\n subdivided[1] = buffer[1];\n }\n else {\n const px = buffer[i - 2];\n const py = buffer[i - 1];\n const x = buffer[i];\n const y = buffer[i + 1];\n const nx = (x + px) / 2;\n const ny = (y + py) / 2;\n subdivided[(i - 1) * 2] = nx;\n subdivided[(i - 1) * 2 + 1] = ny;\n subdivided[i * 2] = x;\n subdivided[i * 2 + 1] = y;\n }\n }\n if (bClosed) {\n subdivided[(bufferLength - 1) * 2] = (buffer[0] + buffer[bufferLength - 2]) / 2;\n subdivided[(bufferLength - 1) * 2 + 1] = (buffer[1] + buffer[bufferLength - 1]) / 2;\n }\n return subdivided;\n }\n}\nexports.Subdivide = Subdivide;\n//# sourceMappingURL=Subdivide.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Offset = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Offset extends Modifier_1.Modifier {\n constructor(args = { from: 0, to: undefined }) {\n super();\n this.from = args.from;\n this.to = args.to;\n }\n apply(buffer, bClosed) {\n return buffer.subarray(this.from, this.to ? (this.to < 0 ? buffer.length + this.to : this.to) : undefined);\n }\n}\nexports.Offset = Offset;\n//# sourceMappingURL=Offset.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./utilities\"), exports);\n__exportStar(require(\"./createAnimation\"), exports);\n__exportStar(require(\"./createInterpolator\"), exports);\n__exportStar(require(\"./Easings\"), exports);\n__exportStar(require(\"./Animation\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.interpolateColorHSL = exports.interpolateColorRGB = exports.cosp = exports.sinp = exports.clockOffset = exports.clock = void 0;\n/**\n * Return time (from 0 to duration) in milliseconds\n *\n * @export\n * @param {number} time Current time\n * @param {number} duration Clock duration\n * @param {(number | boolean)} [loop=true]\n * @param {('normal' | 'reverse' | 'alternate')} [direction='alternate']\n * @param {number} [delay=0]\n * @param {number} [afterDelay=0]\n * @return {*} {number} Between 0 and duration\n */\nfunction clock(time, duration, loop = true, direction = 'alternate', delay = 0, afterDelay = 0) {\n const totalDuration = direction === 'normal'\n ? duration + delay\n : direction === 'reverse'\n ? duration + delay\n : duration * 2 + delay + afterDelay;\n if ((typeof loop === 'number' && time >= totalDuration * loop) || (loop === false && time >= totalDuration)) {\n return direction === 'normal' ? duration : 0;\n }\n time %= totalDuration;\n if ((time -= delay) <= 0) {\n return 0;\n }\n if (direction === 'alternate') {\n if (time <= duration) {\n // normal\n return time;\n }\n else {\n // reverse\n time -= duration;\n if ((time -= afterDelay) >= 0) {\n return duration - (time >= duration ? duration : time);\n }\n return duration;\n }\n }\n else {\n return time >= duration ? duration : time;\n }\n}\nexports.clock = clock;\n/**\n * Return offset between 0 and 1 from current time based on duration and other parameters\n *\n * @export\n * @param {number} time\n * @param {number} duration\n * @param {(number | boolean)} [loop=true]\n * @param {('normal' | 'reverse' | 'alternate')} [direction='alternate']\n * @param {number} [delay=0]\n * @param {number} [afterDelay=0]\n * @return {*} {number}\n */\nfunction clockOffset(time, duration, loop = true, direction = 'alternate', delay = 0, afterDelay = 0) {\n return clock(time, duration, loop, direction, delay, afterDelay) / duration;\n}\nexports.clockOffset = clockOffset;\nconst PI2 = Math.PI * 2;\n/**\n * Return sin of period 'durate' in time 'time'\n *\n * @export\n * @param {number} time\n * @param {number} durate\n * @param {number} phase\n * @param {boolean} [normalize=false]\n * @return {*} {number}\n */\nfunction sinp(time, durate, phase = 0, normalize = false) {\n const value = Math.sin((time * PI2) / durate + phase);\n return normalize ? 0.5 + value * 0.5 : value;\n}\nexports.sinp = sinp;\n/**\n * Return cos of period 'durate' in time 'time'\n *\n * @export\n * @param {number} time\n * @param {number} durate\n * @param {number} phase\n * @param {boolean} [normalize=false]\n * @return {*} {number}\n */\nfunction cosp(time, durate, phase = 0, normalize = false) {\n const value = Math.cos((time * PI2) / durate + phase);\n return normalize ? 0.5 + value * 0.5 : value;\n}\nexports.cosp = cosp;\nfunction interpolateColorRGB(start, end, offset) {\n const r = start.r + offset * (end.r - start.r);\n const g = start.g + offset * (end.g - start.g);\n const b = start.b + offset * (end.b - start.b);\n const alpha = start.alpha + offset * (end.alpha - start.alpha);\n return `rgba(${Math.floor(r)},${Math.floor(g)},${Math.floor(b)},${alpha})`;\n}\nexports.interpolateColorRGB = interpolateColorRGB;\nfunction interpolateColorHSL(start, end, offset) {\n const h = start.h + offset * (end.h - start.h);\n const s = start.s + offset * (end.s - start.s);\n const l = start.l + offset * (end.l - start.l);\n const alpha = start.alpha + offset * (end.alpha - start.alpha);\n return `hsla(${h},${s}%,${l}%,${alpha})`;\n}\nexports.interpolateColorHSL = interpolateColorHSL;\n//# sourceMappingURL=utilities.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createAnimation = void 0;\nconst createInterpolator_1 = require(\"./createInterpolator\");\n/**\n * Create TAnimation from object\n *\n * @param simpleAnimation\n * @returns\n */\nfunction createAnimation(simpleAnimation) {\n const interpolate = createInterpolator_1.createInterpolationCallback(simpleAnimation);\n if (typeof interpolate === 'undefined')\n return undefined;\n const delay = simpleAnimation.delay || 0;\n const afterDelay = simpleAnimation.afterDelay || 0;\n const direction = simpleAnimation.direction || 'normal';\n const duration = simpleAnimation.duration || 1000;\n const totalDuration = direction === 'normal'\n ? duration + delay\n : direction === 'reverse'\n ? duration + delay\n : duration * 2 + delay + afterDelay;\n const loop = typeof simpleAnimation.loop === 'number' ? simpleAnimation.loop : !!simpleAnimation.loop;\n const bindedValues = {\n delay,\n afterDelay,\n direction,\n duration,\n totalDuration,\n loop,\n };\n const animationFunction = createInterpolator_1.createInterpolator(simpleAnimation.interpolator);\n const animation = {\n loop: 0,\n offset: 0,\n loopDuration: totalDuration,\n direction: direction === 'alternate' ? 'normal' : direction,\n started: false,\n ended: false,\n value: undefined,\n };\n animation.update = createUpdate(animation, bindedValues, animationFunction, interpolate);\n return animation;\n}\nexports.createAnimation = createAnimation;\n/**\n *\n * @internal\n * @param animation\n * @param bindedValues\n * @param animationFunction\n * @param interpolate\n * @returns\n */\nfunction createUpdate(animation, bindedValues, animationFunction, interpolate) {\n const { loop, totalDuration, delay, afterDelay, direction, duration } = bindedValues;\n return (time) => {\n // Check animation is ended\n if ((typeof loop === 'number' && time >= totalDuration * loop) ||\n (loop === false && time >= bindedValues.totalDuration)) {\n animation.started = false;\n animation.ended = true;\n animation.offset = animationFunction(direction === 'normal' ? duration : 0, duration);\n animation.value = interpolate(animation.offset);\n return;\n }\n animation.loop = Math.ceil(time / totalDuration);\n time %= totalDuration;\n if ((time -= delay) <= 0) {\n animation.started = false;\n animation.offset = animationFunction(0, duration);\n animation.value = interpolate(animation.offset);\n return;\n }\n animation.started = true;\n if (direction === 'alternate') {\n if (time <= duration) {\n animation.direction = 'normal';\n animation.offset = animationFunction(time, duration);\n }\n else {\n animation.direction = 'reverse';\n time -= duration;\n // wait afterDelay\n if ((time -= afterDelay) >= 0) {\n animation.offset = 1 - animationFunction(time >= duration ? duration : time, duration);\n }\n else {\n animation.offset = 1;\n }\n }\n }\n else {\n const animationValue = animationFunction(time >= duration ? duration : time, duration);\n animation.offset = direction === 'normal' ? animationValue : 1 - animationValue;\n }\n animation.value = interpolate(animation.offset);\n };\n}\n//# sourceMappingURL=createAnimation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createInterpolator = exports.createInterpolationCallback = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst bezier_easing_1 = require(\"bezier-easing\");\nconst Easings_1 = require(\"./Easings\");\nconst utilities_1 = require(\"./utilities\");\n/**\n * Return a callback for value interpolation passing offset from 0 to 1\n *\n * @param simpleAnimation\n * @returns\n */\nfunction createInterpolationCallback(simpleAnimation) {\n const from = Array.isArray(simpleAnimation.from) ? simpleAnimation.from : [simpleAnimation.from];\n const to = Array.isArray(simpleAnimation.to) ? simpleAnimation.to : [simpleAnimation.to];\n const round = simpleAnimation.round;\n const colorInterpolation = simpleAnimation.colorTransitionMode === 'hue' ? utilities_1.interpolateColorHSL : utilities_1.interpolateColorRGB;\n if (from.length !== to.length)\n return undefined;\n const callbacks = [];\n for (let i = 0, len = from.length; i < len; i++) {\n if (typeof from[i] !== typeof to[i]) {\n console.warn('[@urpflanze/animation]: `from` and `to` values mismatch');\n return undefined;\n }\n else {\n if (typeof from[i] !== 'string') {\n const a = from[i], b = to[i];\n callbacks.push(typeof round !== 'undefined'\n ? (offset) => offset === 1 ? b : offset === 0 ? a : Math.round((a + offset * (b - a)) * round) / round\n : (offset) => (offset === 1 ? b : offset === 0 ? a : a + offset * (b - a)));\n }\n else {\n const a = from[i];\n const b = to[i];\n const parsed_a = color_1.parseColorAndConvert(a);\n const parsed_b = color_1.parseColorAndConvert(b);\n if (typeof parsed_a !== 'undefined' && typeof parsed_b !== 'undefined') {\n callbacks.push((offset) => offset === 1 ? b : offset === 0 ? a : colorInterpolation(parsed_a, parsed_b, offset));\n }\n }\n }\n }\n return (offset) => {\n const values = callbacks.map(c => c(offset));\n return values.length === 1 ? values[0] : values;\n };\n}\nexports.createInterpolationCallback = createInterpolationCallback;\n/**\n * Return a callback for calculate offset (0 to 1) from elapsed time and animation duration\n *\n * @param type\n * @returns\n */\nfunction createInterpolator(type) {\n var _a, _b;\n switch (typeof type) {\n case 'function':\n return (elapsed, duration) => type(elapsed / duration, elapsed);\n case 'string':\n switch (type) {\n case 'wave':\n return (elapsed, duration) => 0.5 + Math.sin((elapsed * Math.PI * 2) / duration + Math.PI * 1.5) * 0.5;\n default: {\n if (type in Easings_1.Easings) {\n const easing = Easings_1.Easings[type];\n return (elapsed, duration) => easing(elapsed, 0, 1, duration);\n }\n return (elapsed, duration) => Easings_1.Easings.linear(elapsed, 0, 1, duration);\n }\n }\n case 'object':\n switch (type.type) {\n case 'wave': {\n const phase = Math.PI * 1.5 + (((_a = type.params) === null || _a === void 0 ? void 0 : _a.phase) || 0);\n return (elapsed, duration) => {\n return 0.5 + Math.sin((elapsed * Math.PI * 2) / duration + phase) * 0.5;\n };\n }\n case 'elasticIn':\n case 'elasticOut':\n case 'elasticInOut': {\n const easing = Easings_1.Easings[type.type];\n const { amplitude, period } = type.params || {};\n return (elapsed, duration) => easing(elapsed, 0, 1, duration, amplitude, period);\n }\n case 'backIn':\n case 'backOut':\n case 'backInOut': {\n const easing = Easings_1.Easings[type.type];\n const overshoot = ((_b = type.params) === null || _b === void 0 ? void 0 : _b.overshoot) || undefined;\n return (elapsed, duration) => easing(elapsed, 0, 1, duration, overshoot);\n }\n case 'cubicBezier': {\n const easing = bezier_easing_1.default(type.params[0], type.params[1], type.params[2], type.params[3]);\n return (elapsed, duration) => easing(elapsed / duration);\n }\n }\n }\n return (elapsed, duration) => Easings_1.Easings.linear(elapsed, 0, 1, duration);\n}\nexports.createInterpolator = createInterpolator;\n//# sourceMappingURL=createInterpolator.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./conversions\"), exports);\n__exportStar(require(\"./parsing\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.rgbToHsl = exports.hslToRgb = exports.rgbToHex = void 0;\n/**\n * Convert rgb to hex\n *\n * @param r number between 0 - 255\n * @param g number between 0 - 255\n * @param b number between 0 - 255\n * @returns #ffffff\n */\nfunction rgbToHex(r, g, b) {\n return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;\n}\nexports.rgbToHex = rgbToHex;\n/**\n * Convert hsl (0-360, 0-100, 0-100) color to rgb(0-255, 0-255, 0-255)\n *\n * @param {number} h number between 0 - 360\n * @param {number} s number between 0 - 100\n * @param {number} l number between 0 - 100\n * @returns {[number, number, number]} [0-255, 0-255, 0-255]\n */\nfunction hslToRgb(h, s, l) {\n h /= 360;\n s /= 100;\n l /= 100;\n let r, g, b;\n if (s == 0) {\n r = g = b = l; // achromatic\n }\n else {\n const hue2rgb = (p, q, t) => {\n t += t < 0 ? 1 : t > 1 ? -1 : 0;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n };\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return [(0.5 + r * 255) << 0, (0.5 + g * 255) << 0, (0.5 + b * 255) << 0];\n}\nexports.hslToRgb = hslToRgb;\n/**\n * Convert rbg (0-255, 0-255, 0-255) to hsl (0-360, 0-100, 0-100)\n *\n * @param {number} r number between 0 - 255\n * @param {number} g number between 0 - 255\n * @param {number} b number between 0 - 255\n * @returns {[number, number, number]} (0-360, 0-100, 0-100)\n */\nfunction rgbToHsl(r, g, b) {\n r /= 255;\n g /= 255;\n b /= 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s;\n if (max === min) {\n h = s = 0;\n }\n else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h = h / 6;\n }\n return [(0.5 + h * 360) << 0, (0.5 + s * 100) << 0, (0.5 + l * 100) << 0];\n}\nexports.rgbToHsl = rgbToHsl;\n//# sourceMappingURL=conversions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseColor = exports.parseColorAndConvert = void 0;\nconst htmlcolors_1 = require(\"./htmlcolors\");\nconst conversions_1 = require(\"./conversions\");\n/**\n * Convert color to IConvertedColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IConvertedColor | undefined)}\n */\nfunction parseColorAndConvert(color) {\n const parsed = parseColor(color);\n if (parsed) {\n if (parsed.type === 'hsl') {\n const [r, g, b] = conversions_1.hslToRgb(parsed.a, parsed.b, parsed.c);\n return {\n r,\n g,\n b,\n h: parsed.a,\n s: parsed.b,\n l: parsed.c,\n alpha: parsed.alpha,\n };\n }\n else {\n const [h, s, l] = conversions_1.rgbToHsl(parsed.a, parsed.b, parsed.c);\n return {\n h,\n s,\n l,\n r: parsed.a,\n g: parsed.b,\n b: parsed.c,\n alpha: parsed.alpha,\n };\n }\n }\n}\nexports.parseColorAndConvert = parseColorAndConvert;\n/**\n * Convert color to IColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IColor | undefined)}\n */\nfunction parseColor(color) {\n if (typeof color === 'number') {\n if (color > 0xffffff) {\n return {\n type: 'rgb',\n a: (color >> 24) & 255,\n b: (color >> 16) & 255,\n c: (color >> 8) & 255,\n alpha: (color & 255) / 255,\n };\n }\n else {\n return { type: 'rgb', a: (color >> 16) & 255, b: (color >> 8) & 255, c: color & 255, alpha: 1 };\n }\n }\n color = color.replace(/\\s/g, '');\n if (htmlcolors_1.default[color])\n color = htmlcolors_1.default[color];\n let match = /^#([0-9a-f]{3,8})$/i.exec(color);\n if (match) {\n const hex = match[1];\n if (hex.length === 3) {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[0], 16),\n b: parseInt(hex[1] + hex[1], 16),\n c: parseInt(hex[2] + hex[2], 16),\n alpha: 1,\n };\n }\n else {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[1], 16),\n b: parseInt(hex[2] + hex[3], 16),\n c: parseInt(hex[4] + hex[5], 16),\n alpha: hex.length > 6 ? parseInt(hex.substring(6), 16) / 255 : 1,\n };\n }\n }\n match = /^((hsl|rgb)a?)\\((\\d+),(\\d+)%?,(\\d+)%?,?(.+)?\\)$/i.exec(color);\n if (match) {\n const [, , type, a, b, c, alpha] = match;\n return {\n type: type,\n a: +a,\n b: +b,\n c: +c,\n alpha: alpha ? +alpha : 1,\n };\n }\n}\nexports.parseColor = parseColor;\n//# sourceMappingURL=parsing.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst colors = {\n aliceblue: '#f0f8ff',\n antiquewhite: '#faebd7',\n aqua: '#00ffff',\n aquamarine: '#7fffd4',\n azure: '#f0ffff',\n beige: '#f5f5dc',\n bisque: '#ffe4c4',\n black: '#000000',\n blanchedalmond: '#ffebcd',\n blue: '#0000ff',\n blueviolet: '#8a2be2',\n brown: '#a52a2a',\n burlywood: '#deb887',\n cadetblue: '#5f9ea0',\n chartreuse: '#7fff00',\n chocolate: '#d2691e',\n coral: '#ff7f50',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyan: '#00ffff',\n darkblue: '#00008b',\n darkcyan: '#008b8b',\n darkgoldenrod: '#b8860b',\n darkgray: '#a9a9a9',\n darkgreen: '#006400',\n darkkhaki: '#bdb76b',\n darkmagenta: '#8b008b',\n darkolivegreen: '#556b2f',\n darkorange: '#ff8c00',\n darkorchid: '#9932cc',\n darkred: '#8b0000',\n darksalmon: '#e9967a',\n darkseagreen: '#8fbc8f',\n darkslateblue: '#483d8b',\n darkslategray: '#2f4f4f',\n darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n gold: '#ffd700',\n goldenrod: '#daa520',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n indianred: '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n lavender: '#e6e6fa',\n lavenderblush: '#fff0f5',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrodyellow: '#fafad2',\n lightgrey: '#d3d3d3',\n lightgreen: '#90ee90',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\n maroon: '#800000',\n mediumaquamarine: '#66cdaa',\n mediumblue: '#0000cd',\n mediumorchid: '#ba55d3',\n mediumpurple: '#9370d8',\n mediumseagreen: '#3cb371',\n mediumslateblue: '#7b68ee',\n mediumspringgreen: '#00fa9a',\n mediumturquoise: '#48d1cc',\n mediumvioletred: '#c71585',\n midnightblue: '#191970',\n mintcream: '#f5fffa',\n mistyrose: '#ffe4e1',\n moccasin: '#ffe4b5',\n navajowhite: '#ffdead',\n navy: '#000080',\n oldlace: '#fdf5e6',\n olive: '#808000',\n olivedrab: '#6b8e23',\n orange: '#ffa500',\n orangered: '#ff4500',\n orchid: '#da70d6',\n palegoldenrod: '#eee8aa',\n palegreen: '#98fb98',\n paleturquoise: '#afeeee',\n palevioletred: '#d87093',\n papayawhip: '#ffefd5',\n peachpuff: '#ffdab9',\n peru: '#cd853f',\n pink: '#ffc0cb',\n plum: '#dda0dd',\n powderblue: '#b0e0e6',\n purple: '#800080',\n rebeccapurple: '#663399',\n red: '#ff0000',\n rosybrown: '#bc8f8f',\n royalblue: '#4169e1',\n saddlebrown: '#8b4513',\n salmon: '#fa8072',\n sandybrown: '#f4a460',\n seagreen: '#2e8b57',\n seashell: '#fff5ee',\n sienna: '#a0522d',\n silver: '#c0c0c0',\n skyblue: '#87ceeb',\n slateblue: '#6a5acd',\n slategray: '#708090',\n snow: '#fffafa',\n springgreen: '#00ff7f',\n steelblue: '#4682b4',\n tan: '#d2b48c',\n teal: '#008080',\n thistle: '#d8bfd8',\n tomato: '#ff6347',\n turquoise: '#40e0d0',\n violet: '#ee82ee',\n wheat: '#f5deb3',\n white: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32',\n};\nexports.default = colors;\n//# sourceMappingURL=htmlcolors.js.map","/**\n * https://github.com/gre/bezier-easing\n * BezierEasing - use bezier curve for transition easing function\n * by Gaëtan Renaudeau 2014 - 2015 – MIT License\n */\n\n// These values are established by empiricism with tests (tradeoff: performance VS precision)\nvar NEWTON_ITERATIONS = 4;\nvar NEWTON_MIN_SLOPE = 0.001;\nvar SUBDIVISION_PRECISION = 0.0000001;\nvar SUBDIVISION_MAX_ITERATIONS = 10;\n\nvar kSplineTableSize = 11;\nvar kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\nvar float32ArraySupported = typeof Float32Array === 'function';\n\nfunction A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\nfunction B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\nfunction C (aA1) { return 3.0 * aA1; }\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nfunction calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }\n\n// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\nfunction getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); }\n\nfunction binarySubdivide (aX, aA, aB, mX1, mX2) {\n var currentX, currentT, i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n return currentT;\n}\n\nfunction newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {\n for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n if (currentSlope === 0.0) {\n return aGuessT;\n }\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n}\n\nfunction LinearEasing (x) {\n return x;\n}\n\nmodule.exports = function bezier (mX1, mY1, mX2, mY2) {\n if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {\n throw new Error('bezier x values must be in [0, 1] range');\n }\n\n if (mX1 === mY1 && mX2 === mY2) {\n return LinearEasing;\n }\n\n // Precompute samples table\n var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n for (var i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n\n function getTForX (aX) {\n var intervalStart = 0.0;\n var currentSample = 1;\n var lastSample = kSplineTableSize - 1;\n\n for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n --currentSample;\n\n // Interpolate to provide an initial guess for t\n var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n var guessForT = intervalStart + dist * kSampleStepSize;\n\n var initialSlope = getSlope(guessForT, mX1, mX2);\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if (initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n }\n\n return function BezierEasing (x) {\n // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n if (x === 0) {\n return 0;\n }\n if (x === 1) {\n return 1;\n }\n return calcBezier(getTForX(x), mY1, mY2);\n };\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Easings = void 0;\n/**\n * Easing functions\n *\n * @category Services.Animation\n */\nconst Easings = {\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n linear: (timeOrOffset, start, end, duration = 1) => (end * timeOrOffset) / duration + start,\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return -end * timeOrOffset * (timeOrOffset - 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset + start;\n timeOrOffset--;\n return (-end / 2) * (timeOrOffset * (timeOrOffset - 2) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * (timeOrOffset * timeOrOffset * timeOrOffset + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return -end * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (-end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset - 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalIn: (timeOrOffset, start, end, duration = 1) => {\n return -end * Math.cos((timeOrOffset / duration) * (Math.PI / 2)) + end + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalOut: (timeOrOffset, start, end, duration = 1) => {\n return end * Math.sin((timeOrOffset / duration) * (Math.PI / 2)) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalInOut: (timeOrOffset, start, end, duration = 1) => {\n return (-end / 2) * (Math.cos((Math.PI * timeOrOffset) / duration) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialIn: (timeOrOffset, start, end, duration = 1) => {\n return end * Math.pow(2, 10 * (timeOrOffset / duration - 1)) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialOut: (timeOrOffset, start, end, duration = 1) => {\n return end * (-Math.pow(2, (-10 * timeOrOffset) / duration) + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * Math.pow(2, 10 * (timeOrOffset - 1)) + start;\n timeOrOffset--;\n return (end / 2) * (-Math.pow(2, -10 * timeOrOffset) + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return -end * (Math.sqrt(1 - timeOrOffset * timeOrOffset) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * Math.sqrt(1 - timeOrOffset * timeOrOffset) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (-end / 2) * (Math.sqrt(1 - timeOrOffset * timeOrOffset) - 1) + start;\n timeOrOffset -= 2;\n return (end / 2) * (Math.sqrt(1 - timeOrOffset * timeOrOffset) + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticIn: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration) === 1) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n return (-(amplitude *\n Math.pow(2, 10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period)) + start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticOut: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration) === 1) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n return (amplitude * Math.pow(2, -10 * timeOrOffset) * Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period) +\n end +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticInOut: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration / 2) === 2) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n if (timeOrOffset < 1) {\n return (-0.5 *\n (amplitude *\n Math.pow(2, 10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period)) +\n start);\n }\n return (amplitude *\n Math.pow(2, -10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period) *\n 0.5 +\n end +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} overshoot (optional)\n * @return {number}\n */\n backIn: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n return end * (timeOrOffset /= duration) * timeOrOffset * ((overshoot + 1) * timeOrOffset - overshoot) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} s overshoot (optional)\n * @return {number}\n */\n backOut: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n return (end *\n ((timeOrOffset = timeOrOffset / duration - 1) * timeOrOffset * ((overshoot + 1) * timeOrOffset + overshoot) +\n 1) +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} overshoot (optional)\n * @return {number}\n */\n backInOut: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n if ((timeOrOffset /= duration / 2) < 1) {\n return (end / 2) * (timeOrOffset * timeOrOffset * (((overshoot *= 1.525) + 1) * timeOrOffset - overshoot)) + start;\n }\n return ((end / 2) * ((timeOrOffset -= 2) * timeOrOffset * (((overshoot *= 1.525) + 1) * timeOrOffset + overshoot) + 2) +\n start);\n },\n /**\n * @param {number} t current time\n * @param {number} b start value\n * @param {number} c end value\n * @param {number} d duration\n * @return {number}\n */\n bounceIn: (timeOrOffset, start, end, duration = 1) => {\n return end - Easings.bounceOut(duration - timeOrOffset, 0, end, duration) + start;\n },\n /**\n * @param {number} t current time\n * @param {number} b start value\n * @param {number} c end value\n * @param {number} d duration\n * @return {number}\n */\n bounceOut: (timeOrOffset, start, end, duration = 1) => {\n if ((timeOrOffset /= duration) < 1 / 2.75) {\n return end * (7.5625 * timeOrOffset * timeOrOffset) + start;\n }\n else if (timeOrOffset < 2 / 2.75) {\n return end * (7.5625 * (timeOrOffset -= 1.5 / 2.75) * timeOrOffset + 0.75) + start;\n }\n else if (timeOrOffset < 2.5 / 2.75) {\n return end * (7.5625 * (timeOrOffset -= 2.25 / 2.75) * timeOrOffset + 0.9375) + start;\n }\n return end * (7.5625 * (timeOrOffset -= 2.625 / 2.75) * timeOrOffset + 0.984375) + start;\n },\n /**\n *\n *\n * @param {number} time\n * @param {number} start\n * @param {number} end\n * @param {number} duration\n * @returns\n */\n bounceInOut: (timeOrOffset, start, end, duration = 1) => {\n if (timeOrOffset < duration / 2) {\n return Easings.bounceIn(timeOrOffset * 2, 0, end, duration) * 0.5 + start;\n }\n return Easings.bounceOut(timeOrOffset * 2 - duration, 0, end, duration) * 0.5 + end * 0.5 + start;\n },\n};\nexports.Easings = Easings;\n//# sourceMappingURL=Easings.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UncontrolledLoop = exports.Static = exports.Loop = exports.Compose = exports.Simple = exports.resolveSimpleAnimation = void 0;\nconst composeAnimations_1 = require(\"./composeAnimations\");\nconst createAnimation_1 = require(\"./createAnimation\");\nfunction resolveSimpleAnimation(simpleAnimation) {\n const animation = createAnimation_1.createAnimation(simpleAnimation);\n if (animation) {\n return (propArgumentsOrCurrentTime) => {\n var _a;\n const currentTime = typeof propArgumentsOrCurrentTime === 'number'\n ? propArgumentsOrCurrentTime\n : ((_a = propArgumentsOrCurrentTime.shape.scene) === null || _a === void 0 ? void 0 : _a.currentTime) || 0;\n animation.update(currentTime);\n return animation.value;\n };\n }\n}\nexports.resolveSimpleAnimation = resolveSimpleAnimation;\n// Alias\nexports.Simple = resolveSimpleAnimation;\n// Compose multiple animations\nconst Compose = (animations) => {\n const composed = composeAnimations_1.composeAnimations(animations);\n if (composed) {\n return (propArgumentsOrCurrentTime) => {\n var _a;\n const currentTime = typeof propArgumentsOrCurrentTime === 'number'\n ? propArgumentsOrCurrentTime\n : ((_a = propArgumentsOrCurrentTime.shape.scene) === null || _a === void 0 ? void 0 : _a.currentTime) || 0;\n return composed(currentTime);\n };\n }\n};\nexports.Compose = Compose;\nconst Loop = (loopAnimation) => {\n const simpleAnimation = loopAnimation;\n if (typeof simpleAnimation.interpolator === 'undefined') {\n simpleAnimation.interpolator = 'wave';\n }\n if (simpleAnimation.interpolator) {\n if (typeof simpleAnimation.interpolator === 'string') {\n if (simpleAnimation.interpolator !== 'wave') {\n simpleAnimation.direction = 'alternate';\n }\n }\n else if (typeof simpleAnimation.interpolator === 'object' && simpleAnimation.interpolator.type !== 'wave') {\n simpleAnimation.direction = 'alternate';\n }\n }\n simpleAnimation.loop = true;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.Loop = Loop;\nconst Static = (staticAnimation) => {\n const simpleAnimation = staticAnimation;\n simpleAnimation.direction = 'normal';\n simpleAnimation.loop = false;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.Static = Static;\nconst UncontrolledLoop = (uncontrolledLoopAnimation) => {\n const simpleAnimation = uncontrolledLoopAnimation;\n simpleAnimation.direction = 'normal';\n simpleAnimation.loop = true;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.UncontrolledLoop = UncontrolledLoop;\n//# sourceMappingURL=Animation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.composeAnimations = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst createAnimation_1 = require(\"./createAnimation\");\nconst utilities_1 = require(\"./utilities\");\n/**\n *\n *\n * @export\n * @param {Array} simpleAnimations\n * @return {*} {(((currentTime: number) => string | number | Array | undefined) | undefined)}\n */\nfunction composeAnimations(simpleAnimations) {\n const animations = simpleAnimations.map(createAnimation_1.createAnimation).filter(a => typeof a !== 'undefined');\n const animationsLength = animations.length;\n if (animationsLength > 0) {\n return (currentTime) => {\n let value = undefined;\n for (let i = 0; i < animationsLength; i++) {\n const animation = animations[i];\n animation.update(currentTime);\n value = typeof value === 'undefined' ? animation.value : interpolate(value, animation.value);\n }\n return value;\n };\n }\n}\nexports.composeAnimations = composeAnimations;\nfunction interpolate(a, b, offset = 0.5) {\n const from = Array.isArray(a) ? a : [a];\n const to = Array.isArray(b) ? b : [b];\n const results = [];\n for (let i = 0, len = from.length; i < len; i++) {\n if (typeof from[i] !== typeof to[i]) {\n console.error('[@urpflanze/animation]: cannot interpolate');\n return undefined;\n }\n else {\n if (typeof from[i] !== 'string') {\n const a = from[i], b = to[i];\n results.push(a + offset * (b - a));\n }\n else {\n const a = from[i];\n const b = to[i];\n const parsed_a = color_1.parseColorAndConvert(a);\n const parsed_b = color_1.parseColorAndConvert(b);\n if (typeof parsed_a !== 'undefined' && typeof parsed_b !== 'undefined') {\n results.push(utilities_1.interpolateColorRGB(parsed_a, parsed_b, offset));\n }\n }\n }\n }\n return results.length === 1 ? results[0] : results;\n}\n//# sourceMappingURL=composeAnimations.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BrowserDrawerCanvas = void 0;\nconst DrawerCanvas_1 = require(\"../DrawerCanvas\");\nconst utils_1 = require(\"../utils\");\n/**\n *\n * @category DrawerCanvas\n * @class BrowserDrawerCanvas\n * @extends {DrawerCanvas}\n */\nclass BrowserDrawerCanvas extends DrawerCanvas_1.DrawerCanvas {\n constructor(scene, canvasOrContainer, drawerOptions, duration = 60000, framerate = 60) {\n super(scene, canvasOrContainer, drawerOptions, duration, framerate);\n this.dpi = 1;\n this.dpi = (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.dpi) || 1;\n this.draw_id = null;\n this.redraw_id = null;\n this.animation_id = null;\n this.draw = this.draw.bind(this);\n this.animate = this.animate.bind(this);\n this.startAnimation = this.startAnimation.bind(this);\n this.resize(this.drawerOptions.width, this.drawerOptions.height);\n }\n resize(width, height, sceneFit, dpi = this.dpi) {\n this.drawerOptions.width = width * dpi;\n this.drawerOptions.height = height * dpi;\n if (this.canvas) {\n this.canvas.width = width * dpi;\n this.canvas.height = height * dpi;\n if (utils_1.bBrowser && this.canvas instanceof HTMLCanvasElement) {\n this.canvas.style.width = width + 'px';\n this.canvas.style.height = height + 'px';\n }\n }\n if (typeof sceneFit !== 'undefined') {\n this.drawerOptions.sceneFit = sceneFit;\n }\n this.dispatch('drawer-canvas:resize');\n }\n /**\n * Internal tick animation\n */\n animate(timestamp) {\n if (this.timeline.bSequenceStarted()) {\n this.animation_id = requestAnimationFrame(this.animate);\n if (this.timeline.tick(timestamp))\n this.draw();\n }\n }\n /**\n * Start animation drawing\n */\n startAnimation() {\n this.stopAnimation();\n this.timeline.start();\n this.animation_id = requestAnimationFrame(this.animate);\n }\n /**\n * Stop animation drawing\n */\n stopAnimation() {\n this.timeline.stop();\n if (this.animation_id)\n cancelAnimationFrame(this.animation_id);\n }\n /**\n * Pause animation drawing\n */\n pauseAnimation() {\n this.timeline.pause();\n if (this.animation_id)\n cancelAnimationFrame(this.animation_id);\n }\n /**\n * Play animation drawing\n */\n playAnimation() {\n this.timeline.start();\n requestAnimationFrame(this.animate);\n }\n redraw() {\n if (!this.timeline.bSequenceStarted()) {\n this.draw_id && cancelAnimationFrame(this.draw_id);\n if (typeof this.drawerOptions.ghosts === undefined || this.drawerOptions.ghosts === 0)\n this.timeline.stop();\n this.draw_id = requestAnimationFrame(this.draw);\n }\n else if (typeof this.drawerOptions.ghosts === undefined || this.drawerOptions.ghosts === 0) {\n this.stopAnimation();\n this.redraw_id && cancelAnimationFrame(this.redraw_id);\n this.redraw_id = requestAnimationFrame(this.startAnimation);\n }\n }\n}\nexports.BrowserDrawerCanvas = BrowserDrawerCanvas;\n//# sourceMappingURL=BrowserDrawerCanvas.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DrawerCanvas = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nconst math_1 = require(\"@urpflanze/core/dist/cjs/math\");\nconst Vec2_1 = require(\"@urpflanze/core/dist/cjs/math/Vec2\");\nconst canvas_1 = require(\"canvas\");\nconst Emitter_1 = require(\"./Emitter\");\nconst Timeline_1 = require(\"./Timeline\");\nconst utils_1 = require(\"./utils\");\n/**\n *\n * @category DrawerCanvas\n * @extends {Emitter}\n */\nclass DrawerCanvas extends Emitter_1.Emitter {\n constructor(scene, canvasOrContainer, drawerOptions, duration = 60000, framerate = 60) {\n var _a, _b, _c, _d, _e;\n super();\n this.drawerOptions = {\n width: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.width) || (scene === null || scene === void 0 ? void 0 : scene.width) || 400,\n height: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.height) || (scene === null || scene === void 0 ? void 0 : scene.height) || 400,\n clear: (_a = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.clear) !== null && _a !== void 0 ? _a : true,\n time: (_b = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.time) !== null && _b !== void 0 ? _b : 0,\n simmetricLines: (_c = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.simmetricLines) !== null && _c !== void 0 ? _c : 0,\n noBackground: (_d = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.noBackground) !== null && _d !== void 0 ? _d : false,\n ghosts: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghosts) || 0,\n ghostAlpha: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostAlpha) === false ? false : true,\n ghostSkipTime: (_e = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostSkipTime) !== null && _e !== void 0 ? _e : 30,\n ghostSkipFunction: drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostSkipFunction,\n sceneFit: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.sceneFit) || 'contain',\n backgroundImage: drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.backgroundImage,\n backgroundImageFit: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.backgroundImageFit) || 'cover',\n };\n this.timeline = new Timeline_1.Timeline(duration, framerate);\n this.timeline.setTime(this.drawerOptions.time);\n this.draw_id = null;\n this.redraw_id = null;\n this.animation_id = null;\n if (scene) {\n this.setScene(scene);\n }\n if (!utils_1.bWorker || (utils_1.bWorker && canvasOrContainer instanceof OffscreenCanvas))\n this.setCanvas(canvasOrContainer);\n }\n /**\n * Return option value or default\n *\n * @param {K keyof IDrawerCanvasOptions} name\n * @param {IDrawerCanvasOptions[K]} defaultValue\n */\n getOption(name, defaultValue) {\n var _a;\n return (_a = this.drawerOptions[name]) !== null && _a !== void 0 ? _a : defaultValue;\n }\n /**\n * Create instance of canvas (HTMLCanvasElement in browser o Canvas in Node)\n */\n setCanvas(canvasOrContainer) {\n if (utils_1.bWorker) {\n if (canvasOrContainer instanceof OffscreenCanvas) {\n this.canvas = canvasOrContainer;\n }\n else {\n console.error('Cannot set cavas');\n }\n }\n else {\n if (utils_1.bBrowser) {\n const canvas = canvas_1.createCanvas(this.drawerOptions.width, this.drawerOptions.height);\n if (canvasOrContainer instanceof HTMLElement &&\n !(canvasOrContainer instanceof HTMLCanvasElement || canvasOrContainer instanceof OffscreenCanvas)) {\n this.canvas = canvas;\n while (canvasOrContainer.lastChild)\n canvasOrContainer.removeChild(canvasOrContainer.lastChild);\n canvasOrContainer.appendChild(canvas);\n }\n else {\n this.canvas = typeof canvasOrContainer === 'undefined' ? canvas : canvasOrContainer;\n }\n }\n else {\n this.canvas = canvas_1.createCanvas(this.drawerOptions.width, this.drawerOptions.height);\n }\n }\n if (this.canvas) {\n this.canvas.width = this.drawerOptions.width;\n this.canvas.height = this.drawerOptions.height;\n this.context = this.canvas.getContext('2d', {\n alpha: true,\n // desynchronized: true,\n });\n }\n }\n /**\n * Return instance of canvas\n *\n * @returns canvas\n */\n getCanvas() {\n return this.canvas;\n }\n setScene(scene) {\n this.scene = scene;\n }\n draw() {\n if (this.context === null || typeof this.scene === 'undefined')\n return 0;\n const start_time = Utilities_1.now();\n const timeline = this.timeline;\n const drawAtTime = timeline.getTime();\n const drawerOptions = {\n ...this.drawerOptions,\n ghostIndex: undefined,\n clear: this.drawerOptions.clear || timeline.getCurrentFrame() <= 1,\n time: drawAtTime,\n };\n const currentFrame = timeline.getFrameAtTime(drawAtTime);\n this.dispatch('drawer-canvas:before_draw', {\n currentFrame: currentFrame,\n currentTime: drawAtTime,\n });\n if (drawerOptions.simmetricLines > 0) {\n if (drawerOptions.clear) {\n DrawerCanvas.clear(this.context, drawerOptions.width, drawerOptions.height, drawerOptions.noBackground ? false : this.scene.background, drawerOptions.backgroundImage, drawerOptions.backgroundImageFit);\n }\n DrawerCanvas.drawSimmetricLines(this.context, drawerOptions.simmetricLines, drawerOptions.width, drawerOptions.height, this.scene.color);\n drawerOptions.clear = false;\n }\n if (drawerOptions.ghosts) {\n const ghostDrawerOptions = {\n ...drawerOptions,\n };\n const drawAtTime = timeline.getTime();\n const sequenceDuration = timeline.getDuration();\n const ghostRepetition = {\n offset: 0,\n index: 0,\n count: drawerOptions.ghosts,\n };\n for (let i = 1; i <= drawerOptions.ghosts; i++) {\n ghostRepetition.index = i;\n ghostRepetition.offset = ghostRepetition.index / ghostRepetition.count;\n const ghostTime = drawAtTime -\n (drawerOptions.ghostSkipFunction\n ? drawerOptions.ghostSkipFunction(ghostRepetition, drawAtTime)\n : i * drawerOptions.ghostSkipTime);\n ghostDrawerOptions.ghostIndex = i;\n ghostDrawerOptions.time = math_1.mod(ghostTime, sequenceDuration);\n ghostDrawerOptions.clear = drawerOptions.clear && ghostDrawerOptions.ghostIndex === 1;\n this.realDraw(ghostDrawerOptions);\n }\n drawerOptions.clear = false;\n }\n this.realDraw(drawerOptions);\n return Utilities_1.now() - start_time;\n }\n realDraw(options) {\n var _a;\n const width = this.drawerOptions.width;\n const height = this.drawerOptions.height;\n const context = this.context;\n const scene = this.scene;\n const time = (_a = options.time) !== null && _a !== void 0 ? _a : 0;\n const bGhost = typeof options.ghosts !== 'undefined' &&\n options.ghosts > 0 &&\n typeof options.ghostIndex !== 'undefined' &&\n options.ghostIndex > 0;\n const ghostMultiplier = bGhost ? 1 - options.ghostIndex / (options.ghosts + 0.5) : 0;\n const ghostAlpha = options.ghostAlpha === true;\n const sceneFit = utils_1.fit(scene.width, scene.height, width, height, this.drawerOptions.sceneFit);\n const translateX = sceneFit.x;\n const translateY = sceneFit.y;\n options.clear &&\n DrawerCanvas.clear(context, width, height, options.noBackground ? false : scene.background, options.backgroundImage, options.backgroundImageFit);\n let logFillColorWarn = false;\n let logStrokeColorWarn = false;\n scene.currentTime = time;\n const sceneChilds = scene.getChildren();\n for (let i = 0, len = sceneChilds.length; i < len; i++) {\n const sceneChild = sceneChilds[i];\n if (!sceneChild.data ||\n (!(sceneChild.data.visible === false) && !(bGhost && sceneChild.data.disableGhost === true))) {\n sceneChilds[i].generate(time, true);\n const childIndexedBuffer = sceneChilds[i].getIndexedBuffer() || [];\n const childBuffer = sceneChilds[i].getBuffer() || [];\n let childVertexIndex = 0;\n for (let currentBufferIndex = 0, len = childIndexedBuffer.length; currentBufferIndex < len; currentBufferIndex++) {\n const currentIndexing = childIndexedBuffer[currentBufferIndex];\n const shape = currentIndexing.shape;\n const propArguments = {\n canvasContext: context,\n ...currentIndexing,\n };\n const composite = DrawerCanvas.getStreamDrawerProp(shape, 'composite', propArguments, 'source-over');\n context.globalCompositeOperation = composite;\n context.beginPath();\n context.moveTo(childBuffer[childVertexIndex] * sceneFit.scale + translateX, childBuffer[childVertexIndex + 1] * sceneFit.scale + translateY);\n childVertexIndex += 2;\n for (let currentFrameLength = childVertexIndex + currentIndexing.frameLength - 2; childVertexIndex < currentFrameLength; childVertexIndex += 2)\n context.lineTo(childBuffer[childVertexIndex] * sceneFit.scale + translateX, childBuffer[childVertexIndex + 1] * sceneFit.scale + translateY);\n if (shape.isClosed())\n context.closePath();\n const alpha = DrawerCanvas.getStreamDrawerProp(shape, 'opacity', propArguments, 1);\n context.globalAlpha = alpha;\n const shadowColor = DrawerCanvas.getStreamDrawerProp(shape, 'shadowColor', propArguments);\n const shadowBlur = DrawerCanvas.getStreamDrawerProp(shape, 'shadowBlur', propArguments);\n const shadowOffsetX = DrawerCanvas.getStreamDrawerProp(shape, 'shadowOffsetX', propArguments);\n const shadowOffsetY = DrawerCanvas.getStreamDrawerProp(shape, 'shadowOffsetY', propArguments);\n context.shadowColor = shadowColor;\n context.shadowBlur = shadowBlur;\n shadowOffsetX && (context.shadowOffsetX = shadowOffsetX);\n shadowOffsetY && (context.shadowOffsetY = shadowOffsetY);\n let fill = DrawerCanvas.getStreamDrawerProp(shape, 'fill', propArguments);\n if (typeof fill !== 'undefined') {\n if (bGhost && ghostAlpha) {\n const color = DrawerCanvas.ghostifyColor(fill, ghostMultiplier);\n if (color) {\n fill = color;\n }\n else if (!logFillColorWarn) {\n console.warn(`[Urpflanze:DrawerCanvas] Unable ghost fill color '${fill}',\n\t\t\t\t\t\t\t\tplease enter a rgba or hsla color`);\n logFillColorWarn = true;\n }\n }\n context.fillStyle = fill;\n context.fill();\n }\n let stroke = DrawerCanvas.getStreamDrawerProp(shape, 'stroke', propArguments, typeof fill === 'undefined' ? scene.color : undefined);\n let lineWidth = DrawerCanvas.getStreamDrawerProp(shape, 'lineWidth', propArguments, 1);\n if (stroke) {\n if (bGhost && ghostAlpha) {\n const color = DrawerCanvas.ghostifyColor(stroke, ghostMultiplier);\n if (color) {\n stroke = color;\n }\n else if (!logStrokeColorWarn) {\n console.warn(`[Urpflanze:DrawerCanvas] Unable ghost stroke color '${stroke}',\n\t\t\t\t\t\t\t\tplease enter a rgba or hsla color`);\n logStrokeColorWarn = true;\n }\n lineWidth *= ghostMultiplier;\n }\n const lineJoin = DrawerCanvas.getStreamDrawerProp(shape, 'lineJoin', propArguments);\n const lineCap = DrawerCanvas.getStreamDrawerProp(shape, 'lineCap', propArguments);\n const lineDash = DrawerCanvas.getStreamDrawerProp(shape, 'lineDash', propArguments);\n const lineDashOffset = DrawerCanvas.getStreamDrawerProp(shape, 'lineDashOffset', propArguments);\n const miterLimit = DrawerCanvas.getStreamDrawerProp(shape, 'miterLimit', propArguments);\n context.setLineDash.call(context, lineDash || []);\n context.lineJoin = lineJoin;\n context.lineCap = lineCap;\n context.lineDashOffset = lineDashOffset;\n context.miterLimit = miterLimit;\n context.lineWidth = lineWidth * sceneFit.scale;\n context.strokeStyle = stroke;\n context.stroke();\n }\n }\n context.restore();\n }\n }\n }\n /**\n * Return a drawer value\n *\n * @static\n * @template T\n * @param {ShapePrimitive} shape\n * @param {keyof T} key\n * @param {IDrawerPropArguments} propArguments\n * @param {*} [defaultValue]\n * @returns {*}\n */\n static getStreamDrawerProp(shape, key, propArguments, defaultValue) {\n let attribute = shape.drawer[key];\n if (typeof attribute === 'function') {\n attribute = attribute(propArguments);\n }\n return attribute !== null && attribute !== void 0 ? attribute : defaultValue;\n }\n /**\n * Create color based on ghostMultiplier\n *\n * @static\n * @param {any} color\n * @param {number} ghostMultiplier\n * @return {*} {(string | undefined)}\n */\n static ghostifyColor(color, ghostMultiplier) {\n if (typeof color === 'string' || typeof color === 'number') {\n const parsed = color_1.parseColor(color);\n if (parsed) {\n const ghostAlpha = parsed.alpha * ghostMultiplier;\n return parsed.type === 'rgb'\n ? `rgba(${parsed.a},${parsed.b},${parsed.c},${ghostAlpha})`\n : `hsla(${parsed.a},${parsed.b}%,${parsed.c}%,${ghostAlpha})`;\n }\n }\n return color;\n }\n /**\n * Clear canvas, draw background or image (and fit)\n *\n * @param context\n * @param width\n * @param height\n * @param background\n * @param backgroundImage\n * @param backgroundImageFit\n */\n static clear(context, width, height, background, backgroundImage, backgroundImageFit) {\n if (typeof background === 'boolean' && background === false) {\n context.clearRect(0, 0, width, height);\n }\n else {\n context.globalCompositeOperation = 'source-over';\n context.fillStyle = background; // or true\n context.fillRect(0, 0, width, height);\n if (backgroundImage) {\n const sourceWidth = backgroundImage instanceof SVGImageElement ? backgroundImage.width.baseVal.value : backgroundImage.width;\n const sourceHeight = backgroundImage instanceof SVGImageElement ? backgroundImage.height.baseVal.value : backgroundImage.height;\n const fitRect = utils_1.fit(sourceWidth, sourceHeight, width, height, backgroundImageFit);\n context.drawImage(backgroundImage, fitRect.x, fitRect.y, fitRect.width, fitRect.height);\n }\n }\n }\n /**\n * Draw utility lines\n *\n * @param context\n * @param simmetricLines\n * @param width\n * @param height\n * @param color\n */\n static drawSimmetricLines(context, simmetricLines, width, height, color) {\n const offset = Math.PI / simmetricLines;\n const size = Math.max(width, height);\n const sizeMin = Math.min(width, height);\n const k = width < height ? 1 : 0;\n const centerX = [size / 2, size / 2];\n const centerY = [sizeMin / 2, sizeMin / 2];\n for (let i = 0; i < simmetricLines; i++) {\n const a = [-size, -size];\n const b = [size * 2, size * 2];\n const rotate = i * offset + Math.PI / 4;\n Vec2_1.default.rotateZ(a, i % 2 === k ? centerX : centerY, rotate);\n Vec2_1.default.rotateZ(b, i % 2 === k ? centerX : centerY, rotate);\n context.beginPath();\n context.strokeStyle = color;\n context.lineWidth = 1;\n context.moveTo(a[0], a[1]);\n context.lineTo(b[0], b[1]);\n context.stroke();\n }\n }\n}\nexports.DrawerCanvas = DrawerCanvas;\n// const sourceRatio = sourceWidth / sourceHeight\n// let x = 0,\n// \ty = 0,\n// \tbgWidth = width,\n// \tbgHeight = height\n// if (sourceRatio !== ratio) {\n// \tif (options.backgroundImageFit === 'contain') {\n// \t\tbgWidth = ratio > sourceRatio ? (sourceWidth * height) / sourceHeight : width\n// \t\tbgHeight = ratio > sourceRatio ? height : (sourceHeight * width) / sourceWidth\n// \t} else {\n// \t\tbgWidth = ratio < sourceRatio ? (sourceWidth * height) / sourceHeight : width\n// \t\tbgHeight = ratio < sourceRatio ? height : (sourceHeight * width) / sourceWidth\n// \t}\n// \tx = (width - bgWidth) / 2\n// \ty = (height - bgHeight) / 2\n//# sourceMappingURL=DrawerCanvas.js.map","/* globals document, ImageData */\n\nconst parseFont = require('./lib/parse-font')\n\nexports.parseFont = parseFont\n\nexports.createCanvas = function (width, height) {\n return Object.assign(document.createElement('canvas'), { width: width, height: height })\n}\n\nexports.createImageData = function (array, width, height) {\n // Browser implementation of ImageData looks at the number of arguments passed\n switch (arguments.length) {\n case 0: return new ImageData()\n case 1: return new ImageData(array)\n case 2: return new ImageData(array, width)\n default: return new ImageData(array, width, height)\n }\n}\n\nexports.loadImage = function (src, options) {\n return new Promise(function (resolve, reject) {\n const image = Object.assign(document.createElement('img'), options)\n\n function cleanup () {\n image.onload = null\n image.onerror = null\n }\n\n image.onload = function () { cleanup(); resolve(image) }\n image.onerror = function () { cleanup(); reject(new Error('Failed to load the image \"' + src + '\"')) }\n\n image.src = src\n })\n}\n","'use strict'\n\n/**\n * Font RegExp helpers.\n */\n\nconst weights = 'bold|bolder|lighter|[1-9]00'\n , styles = 'italic|oblique'\n , variants = 'small-caps'\n , stretches = 'ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded'\n , units = 'px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q'\n , string = '\\'([^\\']+)\\'|\"([^\"]+)\"|[\\\\w\\\\s-]+'\n\n// [ [ <‘font-style’> || || <‘font-weight’> || <‘font-stretch’> ]?\n// <‘font-size’> [ / <‘line-height’> ]? <‘font-family’> ]\n// https://drafts.csswg.org/css-fonts-3/#font-prop\nconst weightRe = new RegExp('(' + weights + ') +', 'i')\nconst styleRe = new RegExp('(' + styles + ') +', 'i')\nconst variantRe = new RegExp('(' + variants + ') +', 'i')\nconst stretchRe = new RegExp('(' + stretches + ') +', 'i')\nconst sizeFamilyRe = new RegExp(\n '([\\\\d\\\\.]+)(' + units + ') *'\n + '((?:' + string + ')( *, *(?:' + string + '))*)')\n\n/**\n * Cache font parsing.\n */\n\nconst cache = {}\n\nconst defaultHeight = 16 // pt, common browser default\n\n/**\n * Parse font `str`.\n *\n * @param {String} str\n * @return {Object} Parsed font. `size` is in device units. `unit` is the unit\n * appearing in the input string.\n * @api private\n */\n\nmodule.exports = function (str) {\n // Cached\n if (cache[str]) return cache[str]\n\n // Try for required properties first.\n const sizeFamily = sizeFamilyRe.exec(str)\n if (!sizeFamily) return // invalid\n\n // Default values and required properties\n const font = {\n weight: 'normal',\n style: 'normal',\n stretch: 'normal',\n variant: 'normal',\n size: parseFloat(sizeFamily[1]),\n unit: sizeFamily[2],\n family: sizeFamily[3].replace(/[\"']/g, '').replace(/ *, */g, ',')\n }\n\n // Optional, unordered properties.\n let weight, style, variant, stretch\n // Stop search at `sizeFamily.index`\n let substr = str.substring(0, sizeFamily.index)\n if ((weight = weightRe.exec(substr))) font.weight = weight[1]\n if ((style = styleRe.exec(substr))) font.style = style[1]\n if ((variant = variantRe.exec(substr))) font.variant = variant[1]\n if ((stretch = stretchRe.exec(substr))) font.stretch = stretch[1]\n\n // Convert to device units. (`font.unit` is the original unit)\n // TODO: ch, ex\n switch (font.unit) {\n case 'pt':\n font.size /= 0.75\n break\n case 'pc':\n font.size *= 16\n break\n case 'in':\n font.size *= 96\n break\n case 'cm':\n font.size *= 96.0 / 2.54\n break\n case 'mm':\n font.size *= 96.0 / 25.4\n break\n case '%':\n // TODO disabled because existing unit tests assume 100\n // font.size *= defaultHeight / 100 / 0.75\n break\n case 'em':\n case 'rem':\n font.size *= defaultHeight / 0.75\n break\n case 'q':\n font.size *= 96 / 25.4 / 4\n break\n }\n\n return (cache[str] = font)\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Emitter = void 0;\n/**\n * Class used for emit and dispatch events\n *\n * @category Emitter\n * @abstract\n * @class Emitter\n * @template EventTypes\n */\nclass Emitter {\n constructor() {\n this.callbacks = {};\n }\n /**\n * Attach callback at event\n *\n * @param {keyof EventTypes} e\n * @param {(value: EventTypes[keyof EventTypes]) => any} callback\n * @memberof Emitter\n */\n attach(e, callback) {\n if (!(e in this.callbacks)) {\n this.callbacks[e] = [];\n }\n this.callbacks[e].push(callback);\n }\n /**\n * Remove callbach listener at event\n *\n * @param {keyof EventTypes} e\n * @param {(value: EventTypes[keyof EventTypes]) => void} callback\n * @memberof Emitter\n */\n detach(e, callback) {\n if (e in this.callbacks) {\n const index = this.callbacks[e].indexOf(callback);\n if (index >= 0) {\n this.callbacks[e].splice(index, 1);\n }\n }\n }\n /**\n * Dispatch event\n *\n * @param {keyof EventTypes} e\n * @param {EventTypes[keyof EventTypes]} [params]\n * @memberof Emitter\n */\n dispatch(e, params) {\n if (e in this.callbacks && this.callbacks[e].length > 0) {\n for (let i = 0, len = this.callbacks[e].length; i < len; i++)\n if (this.callbacks[e][i](params) === false)\n break;\n }\n }\n}\nexports.Emitter = Emitter;\n//# sourceMappingURL=Emitter.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Timeline = void 0;\nconst Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nconst math_1 = require(\"@urpflanze/core/dist/cjs/math\");\nconst Emitter_1 = require(\"./Emitter\");\n/**\n * Is used for sequence time management.\n * It is necessary to set the duration and the number of frames per second (frame rate).\n *\n * @category Timeline\n * @class Timeline\n * @extends {Emitter}\n */\nclass Timeline extends Emitter_1.Emitter {\n constructor(duration = 60000, framerate = 30) {\n super();\n this.fps_samples_size = 30;\n this.fps_samples = [];\n this.fps_samples_index = 0;\n this.paused_time = 0;\n this.sequence = {\n duration,\n framerate,\n frames: Math.round((duration / 1000) * framerate),\n };\n this.tick_time = 1000 / this.sequence.framerate;\n this.fps = this.sequence.framerate;\n this.b_sequence_started = false;\n this.currentFrame = 0;\n this.currentTime = 0;\n this.last_tick = 0;\n this.start_time = 0;\n }\n //#region sequence meta\n /**\n * Return the sequence\n *\n * @returns {Sequence}\n */\n getSequence() {\n return { ...this.sequence };\n }\n /**\n * Set Sequence\n *\n * @param {number} duration in ms\n * @param {number} framerate\n * @param {number} atTime\n */\n setSequence(duration, framerate, atTime) {\n this.sequence.duration = duration;\n this.sequence.framerate = framerate;\n this.tick_time = 1000 / this.sequence.framerate;\n this.sequence.frames = Math.round((this.sequence.duration / 1000) * this.sequence.framerate);\n if (typeof atTime !== 'undefined') {\n this.setTime(atTime);\n }\n else {\n this.dispatch('timeline:update_sequence', this.getSequence());\n }\n }\n /**\n * Set duration of timeline\n *\n * @param {number} framerate\n */\n setDuration(duration) {\n this.setSequence(duration, this.sequence.framerate);\n }\n /**\n * Get timeline duration\n *\n * @returns {number}\n */\n getDuration() {\n return this.sequence.duration;\n }\n /**\n * Return framerate\n *\n * @returns {number}\n */\n getFramerate() {\n return this.sequence.framerate;\n }\n /**\n * Set a framerate\n *\n * @param {number} framerate\n */\n setFramerate(framerate) {\n this.setSequence(this.sequence.duration, framerate);\n }\n /**\n * Get number of frames based on duration and framerate\n *\n * @returns {number}\n */\n getFramesCount() {\n return this.sequence.frames;\n }\n //#endregion meta\n //#region change status\n bSequenceStarted() {\n return this.b_sequence_started;\n }\n /**\n * Start the sequence\n *\n */\n start() {\n if (!this.b_sequence_started) {\n this.b_sequence_started = true;\n this.start_time = this.paused_time;\n this.dispatch('timeline:change_status', Timeline.START);\n }\n }\n /**\n * Pause the sequence\n *\n */\n pause() {\n if (this.b_sequence_started) {\n this.paused_time = Utilities_1.now();\n this.b_sequence_started = false;\n this.dispatch('timeline:change_status', Timeline.PAUSE);\n }\n }\n /**\n * Stop the sequence and reset\n *\n */\n stop() {\n if (this.b_sequence_started) {\n this.b_sequence_started = false;\n this.currentTime = 0;\n this.currentFrame = 0;\n this.start_time = 0;\n this.paused_time = 0;\n this.dispatch('timeline:change_status', Timeline.STOP);\n }\n }\n /**\n * Animation tick\n *\n * @param {number} timestamp current timestamp\n * @returns {boolean}\n */\n tick(timestamp) {\n if (this.b_sequence_started) {\n if (!this.start_time) {\n this.start_time = timestamp;\n this.last_tick = -this.tick_time;\n }\n const currentTime = timestamp - this.start_time;\n const elapsed = currentTime - this.last_tick;\n if (elapsed >= this.tick_time) {\n this.calculateFPS(1 / (elapsed / 1000));\n this.last_tick = currentTime;\n this.currentTime = (currentTime - (elapsed % this.tick_time)) % this.sequence.duration;\n this.currentFrame = this.getFrameAtTime(this.currentTime);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n return true;\n }\n }\n return false;\n }\n /**\n * Calculate fps\n *\n * @private\n * @param {number} currentFPS\n */\n calculateFPS(currentFPS) {\n const samples = this.fps_samples.length;\n if (samples > 0) {\n let average = 0;\n for (let i = 0; i < samples; i++)\n average += this.fps_samples[i];\n this.fps = Math.round(average / samples);\n }\n this.fps_samples[this.fps_samples_index] = Math.round(currentFPS);\n this.fps_samples_index = (this.fps_samples_index + 1) % this.fps_samples_size;\n }\n //#endregion\n //#region Frame and Time\n /**\n * Return current animation frame\n *\n * @returns {number}\n */\n getCurrentFrame() {\n return this.currentFrame;\n }\n /**\n * get the time at specific frame number\n *\n * @param {number} frame\n * @returns {number}\n */\n getFrameTime(frame) {\n frame = math_1.mod(frame, this.sequence.frames);\n return (frame * this.tick_time) % this.sequence.duration;\n }\n /**\n * Return frame number at time\n *\n * @param {number} time\n * @returns {number}\n */\n getFrameAtTime(time) {\n return Math.round((time % this.sequence.duration) / this.tick_time);\n }\n /**\n * set current frame\n *\n * @param {number} frame\n */\n setFrame(frame) {\n this.currentFrame = math_1.mod(frame, this.sequence.frames);\n this.currentTime = this.getFrameTime(this.currentFrame);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n }\n /**\n * Return tick time (based on framerate)\n *\n * @returns {number}\n */\n getTickTime() {\n return this.tick_time;\n }\n /**\n * Return the current time\n *\n * @returns {number}\n */\n getTime() {\n return this.currentTime;\n }\n /**\n * Set animation at time\n *\n * @param {number} time\n */\n setTime(time) {\n time = math_1.mod(time, this.sequence.duration);\n this.currentTime = time;\n this.currentFrame = this.getFrameAtTime(time);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n }\n}\nexports.Timeline = Timeline;\n/**\n * Animation status started\n * @internal\n */\nTimeline.START = 'start';\n/**\n * Animation status paused\n * @internal\n */\nTimeline.PAUSE = 'pause';\n/**\n * Animation status stop\n * @internal\n */\nTimeline.STOP = 'stop';\n//# sourceMappingURL=Timeline.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fit = exports.bWorker = exports.bBrowser = exports.bNode = void 0;\nexports.bNode = typeof process !== 'undefined' &&\n typeof process.versions !== 'undefined' &&\n typeof process.versions.node !== 'undefined';\nexports.bBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';\nexports.bWorker = typeof self === 'object' && ['ServiceWorkerGlobalScope', 'DedicatedWorkerGlobalScope'].includes(self.constructor.name);\n/**\n * Utiltites\n *\n * @category Utilities\n * @export\n * @param {number} sourceWidth\n * @param {number} sourceHeight\n * @param {number} destWidth\n * @param {number} destHeight\n * @param {('cover' | 'contain' | 'none')} [fit='none']\n * @return {*} {{ x: number; y: number; width: number; height: number; scale: number }}\n */\nfunction fit(sourceWidth, sourceHeight, destWidth, destHeight, fit = 'none') {\n let x = 0, y = 0, scale = 1, finalWidth = sourceWidth, finalHeight = sourceHeight;\n const ratio = destWidth / destHeight;\n const sourceRatio = sourceWidth / sourceHeight;\n if (fit === 'contain') {\n finalWidth = ratio > sourceRatio ? (sourceWidth * destHeight) / sourceHeight : destWidth;\n finalHeight = ratio > sourceRatio ? destHeight : (sourceHeight * destWidth) / sourceWidth;\n scale = Math.max(finalWidth, finalHeight) / Math.max(sourceWidth, sourceHeight);\n }\n else if (fit === 'cover') {\n finalWidth = ratio < sourceRatio ? (sourceWidth * destHeight) / sourceHeight : destWidth;\n finalHeight = ratio < sourceRatio ? destHeight : (sourceHeight * destWidth) / sourceWidth;\n // scale = Math.min(sourceWidth, sourceHeight) / Math.min(finalWidth, finalHeight)\n scale = Math.max(finalWidth, finalHeight) / Math.max(sourceWidth, sourceHeight);\n }\n else {\n // finalWidth = sourceWidth\n // finalHeight = sourceHeight\n }\n x = (destWidth - finalWidth) / 2;\n y = (destHeight - finalHeight) / 2;\n return {\n x,\n y,\n width: finalWidth,\n height: finalHeight,\n scale,\n };\n}\nexports.fit = fit;\n//# sourceMappingURL=utils.js.map","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Urpflanze = void 0;\nconst Urpflanze = require(\"./modules-light\");\nexports.Urpflanze = Urpflanze;\nexports.default = Urpflanze;\n//# sourceMappingURL=index-light.js.map"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://Urpflanze/webpack/universalModuleDefinition","webpack://Urpflanze/./dist/cjs/index-light.js","webpack://Urpflanze/./dist/cjs/modules-light.js","webpack://Urpflanze/./dist/cjs/core.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/Scene.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/SceneChild.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/Group.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeBase.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/index.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/common.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/mat2.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/mat2d.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/mat3.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/mat4.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/quat.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/vec4.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/vec3.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/quat2.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/vec2.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/index.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/indexedBuffer.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/propArguments.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/repetitions.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/scene-child.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/scene.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/shape-base.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/shape-primitives.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/shapes.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/math/gl-matrix-extensions.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/math/Vec2.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/math/index.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Adapt.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Modifier.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/Utilities.js","webpack://Urpflanze/./node_modules/simplex-noise/simplex-noise.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/Shape.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapePrimitive.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeLoop.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeBuffer.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeRecursive.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeFollow.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Line.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Triangle.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Rect.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Polygon.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Circle.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Star.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Rose.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Spiral.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Lissajous.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/SuperShape.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/index.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Mirror.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Smooth.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Close.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Solidify.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Subdivide.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Offset.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/index.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/types.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/utilities.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/createAnimation.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/createInterpolator.js","webpack://Urpflanze/./node_modules/@urpflanze/color/dist/cjs/index.js","webpack://Urpflanze/./node_modules/@urpflanze/color/dist/cjs/types.js","webpack://Urpflanze/./node_modules/@urpflanze/color/dist/cjs/conversions.js","webpack://Urpflanze/./node_modules/@urpflanze/color/dist/cjs/parsing.js","webpack://Urpflanze/./node_modules/@urpflanze/color/dist/cjs/htmlcolors.js","webpack://Urpflanze/./node_modules/bezier-easing/src/index.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/Easings.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/Animation.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/composeAnimations.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/browser/BrowserDrawerCanvas.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/DrawerCanvas.js","webpack://Urpflanze/./node_modules/canvas/browser.js","webpack://Urpflanze/./node_modules/canvas/lib/parse-font.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/Emitter.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/Timeline.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/utils.js","webpack://Urpflanze/webpack/bootstrap","webpack://Urpflanze/webpack/runtime/define property getters","webpack://Urpflanze/webpack/runtime/hasOwnProperty shorthand","webpack://Urpflanze/webpack/runtime/make namespace object","webpack://Urpflanze/webpack/startup"],"names":[],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;ACVa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,CAAiB;AACtC,uC;;;;;;;ACba;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,oBAAoB,GAAG,iBAAiB;AACxC,aAAa,mBAAO,CAAC,CAAQ;AAC7B,2CAA4D;AAC5D,4BAA4B,mBAAO,CAAC,EAA+D;AACnG,gDAA+C,CAAC,qCAAqC,kDAAkD,EAAE,EAAE,EAAC;AAC5I,yC;;;;;;;ACjBa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,YAAY,GAAG,gCAAgC,GAAG,qCAAqC,GAAG,mBAAmB,GAAG,8BAA8B,GAAG,4BAA4B,GAAG,2BAA2B,GAAG,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,qBAAqB,GAAG,aAAa,GAAG,YAAY;AACjZ,aAAa,mBAAO,CAAC,CAAgC;AACrD,aAAa,mBAAO,CAAC,CAAqC;AAC1D,aAAa,mBAAO,CAAC,CAAgC;AACrD,aAAa,mBAAO,CAAC,CAA2C;AAChE,aAAa,mBAAO,CAAC,EAAgD;AACrE,aAAa,mBAAO,CAAC,EAA2C;AAChE,aAAa,mBAAO,CAAC,EAA6C;AAClE,aAAa,mBAAO,CAAC,EAAuC;AAC5D,aAAa,mBAAO,CAAC,EAAgD;AACrE,aAAa,mBAAO,CAAC,EAA6C;AAClE,aAAa,mBAAO,CAAC,EAAiD;AACtE,aAAa,mBAAO,CAAC,EAAqD;AAC1E,aAAa,mBAAO,CAAC,EAAiD;AACtE,aAAa,mBAAO,CAAC,EAAoD;AACzE,aAAa,mBAAO,CAAC,EAAmD;AACxE,aAAa,mBAAO,CAAC,EAAiD;AACtE,aAAa,mBAAO,CAAC,EAAiD;AACtE,aAAa,mBAAO,CAAC,EAAmD;AACxE,aAAa,mBAAO,CAAC,EAAsD;AAC3E,aAAa,mBAAO,CAAC,EAAuD;AAC5E,aAAa,mBAAO,CAAC,EAA6C;AAClE,aAAa,mBAAO,CAAC,EAAoC;AACzD,kBAAkB,mBAAO,CAAC,EAAoC;AAC9D,wCAAuC,CAAC,qCAAqC,yBAAyB,EAAE,EAAE,EAAC;AAC3G,yCAAwC,CAAC,qCAAqC,0BAA0B,EAAE,EAAE,EAAC;AAC7G,iDAAgD,CAAC,qCAAqC,kCAAkC,EAAE,EAAE,EAAC;AAC7H,6CAA4C,CAAC,qCAAqC,8BAA8B,EAAE,EAAE,EAAC;AACrH,6CAA4C,CAAC,qCAAqC,8BAA8B,EAAE,EAAE,EAAC;AACrH,uCAAsC,CAAC,qCAAqC,wBAAwB,EAAE,EAAE,EAAC;AACzG,yCAAwC,CAAC,qCAAqC,0BAA0B,EAAE,EAAE,EAAC;AAC7G,0CAAyC,CAAC,qCAAqC,2BAA2B,EAAE,EAAE,EAAC;AAC/G,uDAAsD,CAAC,qCAAqC,wCAAwC,EAAE,EAAE,EAAC;AACzI,wDAAuD,CAAC,qCAAqC,yCAAyC,EAAE,EAAE,EAAC;AAC3I,0DAAyD,CAAC,qCAAqC,2CAA2C,EAAE,EAAE,EAAC;AAC/I,+CAA8C,CAAC,qCAAqC,gCAAgC,EAAE,EAAE,EAAC;AACzH,iEAAgE,CAAC,qCAAqC,kDAAkD,EAAE,EAAE,EAAC;AAC7J,4DAA2D,CAAC,qCAAqC,6CAA6C,EAAE,EAAE,EAAC;AACnJ,aAAa,mBAAO,CAAC,EAAoC;AACzD,wCAAuC,CAAC,qCAAqC,uBAAuB,EAAE,EAAE,EAAC;AACzG,aAAa,mBAAO,CAAC,EAA+B;AACpD,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,gC;;;;;;;ACzDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,qBAAqB,mBAAO,CAAC,CAAc;AAC3C,gBAAgB,mBAAO,CAAC,CAAS;AACjC,gBAAgB,mBAAO,CAAC,EAAgB;AACxC,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB;AACpC,eAAe,WAAW;AAC1B,eAAe,4BAA4B;AAC3C,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,qBAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACxVa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,eAAe,cAAc;AAC7B,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0EAA0E;AACzF,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sC;;;;;;;AClGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,gBAAgB,mBAAO,CAAC,CAAS;AACjC,qBAAqB,mBAAO,CAAC,CAAc;AAC3C,oBAAoB,mBAAO,CAAC,CAAoB;AAChD,gBAAgB,mBAAO,CAAC,EAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,SAAS;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACxTa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,oBAAoB,mBAAO,CAAC,CAAW;AACvC,gBAAgB,mBAAO,CAAC,EAAU;AAClC,aAAa,mBAAO,CAAC,EAA8B;AACnD,eAAe,mBAAO,CAAC,EAAc;AACrC,eAAe,mBAAO,CAAC,EAAS;AAChC,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,oBAAoB,mBAAO,CAAC,EAAc;AAC1C,qBAAqB,mBAAO,CAAC,CAAe;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,cAAc;AAC7B,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0EAA0E;AACzF,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,2CAA2C;AACrF,8CAA8C,2CAA2C;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,4BAA4B;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,SAAS;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;AACA,mEAAmE,SAAS;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,gCAAgC;AAClD,kBAAkB,gCAAgC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzgBwC;AACN;AACE;AACF;AACA;AACA;AACE;AACF;AACA;AACA;;;;;;;;;;;;;;;;;ACTlC;AACA;AACA;AACA;AACA;AACO;AACA;AACA;AACP;AACA;AACA;AACA,WAAW,2CAA2C;AACtD;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjDwC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA,gBAAgB;;AAEhB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AAC7S;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC/aiC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACvd;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACreiC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACttB;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzwBiC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY,+CAAgB;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA,YAAY,+CAAgB;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP,wBAAwB,kDAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;;AAExD;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,YAAY,KAAK;AACjB;;AAEO;AACP,oBAAoB,kDAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,+CAAgB,+BAA+B,+CAAgB,+BAA+B,+CAAgB;AAC/I;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,uEAAuE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB;AAC/zC;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrxDiC;AACN;AACA;AACA;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,OAAO;AACnB;;AAEO;AACP;AACA;;AAEA,UAAU,+CAAgB;AAC1B;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,aAAa;AACzB,YAAY,aAAa;AACzB,YAAY,OAAO;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;;AAE1C,gDAAgD;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH,oBAAoB,+CAAgB;AACpC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA,WAAW,8CAAe;AAC1B,WAAW,8CAAe;AAC1B,WAAW,8CAAe;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,mCAAmC;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAoC;;AAEpC;AACA,wBAAwB;;AAExB;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,EAAE;AACb,WAAW,EAAE;AACb,WAAW,EAAE;AACb,aAAa,KAAK;AAClB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,YAAY,2CAAU;AAC7B;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,iBAAiB,gDAAe;AACvC;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,WAAW,0CAAS;AAC3B;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,YAAY,2CAAU;AAC7B;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,WAAW,0CAAS;AAC3B;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO,aAAa,4CAAW;AAC/B;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;AACA;;AAEO,oBAAoB,mDAAkB;AAC7C;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,gBAAgB,+CAAc;AACrC;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO,kBAAkB,iDAAgB;AACzC;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO,aAAa,4CAAW;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,4CAAW;AAC3B,kBAAkB,gDAAe;AACjC,kBAAkB,gDAAe;AACjC;AACA,cAAc,yCAAQ;;AAEtB;AACA,MAAM,2CAAU;AAChB,UAAU,yCAAQ,sBAAsB,2CAAU;AAClD,MAAM,+CAAc;AACpB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,MAAM,2CAAU;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,aAAa,4CAAW;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrsBuC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,uBAAuB;AACvB;AACA;;AAEA;AACA;;AAEA;AACA,SAAS,8CAAe;AACxB,SAAS,8CAAe;AACxB;AACA,GAAG;;AAEH;AACA,SAAS,8CAAe;AACxB,SAAS,8CAAe;AACxB;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;;AAEhB;AACA;AACA;AACA,qCAAqC;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AAC7S;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtpBuC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,UAAU,8CAAe;AACzB,UAAU,8CAAe;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;;AAEA;AACA;AACA,4BAA4B;;AAE5B;AACA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA,YAAY;;AAEZ;AACA;AACA,YAAY;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACxN;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClxBuC;AACN;AACA;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;;AAEO;AACP,eAAe,kDAAmB;;AAElC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA,cAAc,4CAAW;AACzB,EAAE,iDAAgB;AAClB,cAAc,kDAAmB;AACjC,EAAE,oDAAmB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO,cAAc,0CAAS;AAC9B;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO,cAAc,0CAAS;AAC9B;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA,sBAAsB,+CAAgB;AACtC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,aAAa,4CAAW;AAC/B;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,oBAAoB,mDAAkB;AAC7C;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACjoB,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACl0BwC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,UAAU,8CAAe;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA,2BAA2B;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;;AAE5C;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB;AACnI;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;AC/mBY;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAiB;AACtC,aAAa,mBAAO,CAAC,EAAiB;AACtC,aAAa,mBAAO,CAAC,EAAe;AACpC,aAAa,mBAAO,CAAC,EAAe;AACpC,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAc;AACnC,aAAa,mBAAO,CAAC,EAAoB;AACzC,aAAa,mBAAO,CAAC,EAAU;AAC/B,iC;;;;;;;ACpBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD,uBAAuB,KAAK;AAC7E,uC;;;;;;;ACxBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C,qBAAqB,KAAK;AACvE,sC;;;;;;;AChBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA,4C;;;;;;;ACHa;AACb;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kC;;;;;;;ACHa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc,GAAG,cAAc,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,iBAAiB;AAChI,oBAAoB,mBAAO,CAAC,CAAW;AACvC,iBAAiB;AACjB,gBAAgB;AAChB,iBAAiB;AACjB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,gD;;;;;;;AC5Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,gBAAgB;AAChB;AACA,6BAA6B,OAAO,OAAO,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,gC;;;;;;;ACpNa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,iC;;;;;;;AClCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,GAAG,gBAAgB,GAAG,kBAAkB;AACrD,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC,kBAAkB,KAAK;AAC9D;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6BAA6B;AAC5C,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,iC;;;;;;;ACrKa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB;AACA;AACA,gBAAgB;AAChB,oC;;;;;;;ACNa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gCAAgC,GAAG,mBAAmB,GAAG,qCAAqC,GAAG,8BAA8B,GAAG,4BAA4B,GAAG,2BAA2B,GAAG,cAAc,GAAG,aAAa,GAAG,qBAAqB,GAAG,aAAa,GAAG,YAAY,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,WAAW;AAC1U,qBAAqB,mBAAO,CAAC,EAAe;AAC5C,sBAAsB,mBAAO,CAAC,EAAqB;AACnD,eAAe,mBAAO,CAAC,EAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,mBAAmB,iBAAiB;AACpC,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,gBAAgB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA,4BAA4B,qBAAqB;AACjD;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,eAAe;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yBAAyB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC,qC;;;;;;ACxWA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA,qBAAqB;AACrB;AACA,wBAAwB;AACxB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,4BAA4B;AAC5B;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,kCAAkC;AAClC;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA,6BAA6B;AAC7B;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA,mCAAmC;AACnC,qBAAqB;AACrB;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,yBAAyB;AACzB,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,iBAAiB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,gDAAgD;AAChD;AACA;;AAEA;AACA,MAAM,IAA2C,EAAE,mCAAO,YAAY,qBAAqB;AAAA,kGAAC;AAC5F;AACA,MAAM,IAA8B,EAAE,oBAAoB;AAC1D;AACA,OAAO,EAAsE;AAC7E;AACA,MAAM,IAA6B;AACnC;AACA;;AAEA,CAAC;;;;;;;;ACxdY;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,gBAAgB,mBAAO,CAAC,CAAU;AAClC,qBAAqB,mBAAO,CAAC,CAAe;AAC5C,oBAAoB,mBAAO,CAAC,CAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc,aAAa;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA,4DAA4D,SAAS;AACrE,wCAAwC;AACxC;AACA;AACA;AACA,yCAAyC,4BAA4B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,aAAa;AAC5B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACnLa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,sBAAsB;AACtB,aAAa,mBAAO,CAAC,EAA8B;AACnD,oBAAoB,mBAAO,CAAC,CAAa;AACzC,mBAAmB,mBAAO,CAAC,EAAuB;AAClD,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB,aAAa;AACpD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,0C;;;;;;;ACjJa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,eAAe,mBAAO,CAAC,EAAS;AAChC,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,yBAAyB,mBAAO,CAAC,EAA0B;AAC3D,oBAAoB,mBAAO,CAAC,CAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB,aAAa;AAC/C,eAAe,QAAQ;AACvB;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB;AACA;AACA;AACA,iDAAiD,eAAe;AAChE,sDAAsD,QAAQ;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA,eAAe,6BAA6B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,kBAAkB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,eAAe,sBAAsB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,8CAA8C;AAC9E;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,qC;;;;;;;AChOa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB;AACnB,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,yBAAyB,mBAAO,CAAC,EAA0B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB,aAAa;AACjD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,gCAAgC,8CAA8C;AAC9E;AACA;AACA;AACA;AACA,mBAAmB;AACnB,uC;;;;;;;ACnIa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,sBAAsB;AACtB,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB,aAAa;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,qDAAqD;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,6BAA6B;AACpD;AACA;AACA;AACA;AACA,sCAAsC,+BAA+B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iIAAiI,6DAA6D;AAC9L;AACA;AACA;AACA;AACA,4BAA4B,uEAAuE;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,SAAS;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,4BAA4B,8DAA8D;AAC1F,iBAAiB;AACjB;AACA;AACA,mFAAmF,gCAAgC;AACnH,wCAAwC;AACxC;AACA;AACA;AACA;AACA,4BAA4B,8DAA8D;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,oEAAoE,4BAA4B,iBAAiB,EAAE;AACnH;AACA;AACA;AACA,+BAA+B,gBAAgB;AAC/C;AACA,2DAA2D,SAAS;AACpE;AACA,+FAA+F,gCAAgC;AAC/H,oDAAoD;AACpD;AACA;AACA;AACA;AACA,wCAAwC,wDAAwD;AAChG;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;AACA,qDAAqD,4BAA4B;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA,sBAAsB;AACtB,0C;;;;;;;AChUa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB;AACnB,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB,aAAa;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,uDAAuD;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,SAAS;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,mFAAmF,gCAAgC;AACnH,uEAAuE,iCAAiC,4BAA4B,iBAAiB,EAAE;AACvJ,kDAAkD,SAAS;AAC3D;AACA,2FAA2F,gCAAgC;AAC3H,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA,iDAAiD,4BAA4B;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA,mBAAmB;AACnB,uC;;;;;;;AC3Na;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,YAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,SAAS;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,gC;;;;;;;AC5Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA,oC;;;;;;;AC1Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,gC;;;;;;;AC3Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,mC;;;;;;;ACxCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACpCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ,gC;;;;;;;AClDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc,aAAa;AAC1C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ,gC;;;;;;;ACtEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe,aAAa;AAC3C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kC;;;;;;;AC5Fa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB,aAAa;AAC/C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,qC;;;;;;;ACtDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB;AAClB,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sC;;;;;;;AC9Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,gBAAgB,mBAAO,CAAC,EAAS;AACjC,iBAAiB,mBAAO,CAAC,EAAU;AACnC,iBAAiB,mBAAO,CAAC,EAAU;AACnC,mBAAmB,mBAAO,CAAC,EAAY;AACvC,oBAAoB,mBAAO,CAAC,EAAa;AACzC,gBAAgB,mBAAO,CAAC,EAAS;AACjC,iBAAiB,mBAAO,CAAC,EAAU;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,iC;;;;;;;ACpBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACtDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,oBAAoB,mBAAO,CAAC,EAAc;AAC1C,gBAAgB,mBAAO,CAAC,EAAS;AACjC,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,SAAS;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACvEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;AC3Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,oC;;;;;;;ACvHa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,WAAW;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,qC;;;;;;;ACxDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,wBAAwB,yBAAyB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACfa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAa;AAClC,aAAa,mBAAO,CAAC,EAAmB;AACxC,aAAa,mBAAO,CAAC,EAAsB;AAC3C,aAAa,mBAAO,CAAC,EAAW;AAChC,aAAa,mBAAO,CAAC,EAAa;AAClC,iC;;;;;;;AClBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,2BAA2B,GAAG,2BAA2B,GAAG,YAAY,GAAG,YAAY,GAAG,mBAAmB,GAAG,aAAa;AAC7H;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,mBAAmB;AAC9B,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,EAAE,GAAG,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,mBAAmB;AAC9B,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,mBAAmB,cAAc,GAAG,cAAc,GAAG,cAAc,GAAG,MAAM;AAC5E;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA,mBAAmB,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,MAAM;AAC1C;AACA,2BAA2B;AAC3B,qC;;;;;;;AC9Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uBAAuB;AACvB,6BAA6B,mBAAO,CAAC,EAAsB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8DAA8D;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2C;;;;;;;ACpGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,0BAA0B,GAAG,mCAAmC;AAChE,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,wBAAwB,mBAAO,CAAC,EAAe;AAC/C,kBAAkB,mBAAO,CAAC,EAAW;AACrC,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,8C;;;;;;;ACxGa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAe;AACpC,aAAa,mBAAO,CAAC,EAAW;AAChC,iC;;;;;;;ACfa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6DAA6D;AAC5E;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,uC;;;;;;;ACzFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB,GAAG,4BAA4B;AACjD,qBAAqB,mBAAO,CAAC,EAAc;AAC3C,sBAAsB,mBAAO,CAAC,EAAe;AAC7C;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,6BAA6B,IAAI;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,mC;;;;;;;AC1Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,sC;;;;;;AClJA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,uBAAuB,oCAAoC;AAC3D,uBAAuB,8BAA8B;AACrD,uBAAuB,kBAAkB;;AAEzC;AACA,oCAAoC,8DAA8D;;AAElG;AACA,kCAAkC,sEAAsE;;AAExG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;;AAEA;AACA;AACA;AACA;;AAEA,UAAU,mEAAmE;AAC7E;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe;AACf,mC;;;;;;;AChca;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,wBAAwB,GAAG,cAAc,GAAG,YAAY,GAAG,eAAe,GAAG,cAAc,GAAG,8BAA8B;AAC5H,4BAA4B,mBAAO,CAAC,EAAqB;AACzD,0BAA0B,mBAAO,CAAC,EAAmB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB,qC;;;;;;;ACpEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yBAAyB;AACzB,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,0BAA0B,mBAAO,CAAC,EAAmB;AACrD,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA,WAAW,wBAAwB;AACnC,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6C;;;;;;;ACxDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,2BAA2B;AAC3B,uBAAuB,mBAAO,CAAC,EAAiB;AAChD,gBAAgB,mBAAO,CAAC,EAAU;AAClC;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,+C;;;;;;;AChGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,oBAAoB;AACpB,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,oBAAoB,mBAAO,CAAC,EAAoC;AAChE,eAAe,mBAAO,CAAC,EAA+B;AACtD,eAAe,mBAAO,CAAC,EAAoC;AAC3D,iBAAiB,mBAAO,CAAC,EAAQ;AACjC,kBAAkB,mBAAO,CAAC,EAAW;AACrC,mBAAmB,mBAAO,CAAC,EAAY;AACvC,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6BAA6B;AAC5C,eAAe,wBAAwB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,2BAA2B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,0BAA0B;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qGAAqG,uCAAuC;AAC5I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,KAAK;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oGAAoG,OAAO;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,eAAe,QAAQ;AACvB,eAAe,qBAAqB;AACpC,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB,eAAe,OAAO;AACtB,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW;AAC7E,8BAA8B,SAAS,GAAG,SAAS,IAAI,SAAS,IAAI,WAAW;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,wC;;;;;;ACvXA;;AAEA,kBAAkB,mBAAO,CAAC,EAAkB;;AAE5C,iBAAiB;;AAEjB,oBAAoB;AACpB,0DAA0D,+BAA+B;AACzF;;AAEA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA;AACA;;AAEA,gCAAgC,WAAW;AAC3C,iCAAiC,WAAW;;AAE5C;AACA,GAAG;AACH;;;;;;;;AClCY;;AAEZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACrGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,6CAA6C;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,8CAA8C;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,6BAA6B;AAC5C;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,mC;;;;;;;AC3Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,oBAAoB,mBAAO,CAAC,EAAoC;AAChE,eAAe,mBAAO,CAAC,EAA+B;AACtD,kBAAkB,mBAAO,CAAC,EAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,2BAA2B,aAAa;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oC;;;;;;;ACxRa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,eAAe,GAAG,gBAAgB,GAAG,aAAa;AAChE,aAAa;AACb;AACA;AACA,gBAAgB;AAChB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,+BAA+B;AAC1C,YAAY,EAAE,IAAI,WAAW,WAAW,eAAe,gBAAgB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,iC;;;;;UClDA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,wCAAwC,yCAAyC;WACjF;WACA;WACA,E;;;;;WCPA,wF;;;;;WCAA;WACA;WACA;WACA,sDAAsD,kBAAkB;WACxE;WACA,+CAA+C,cAAc;WAC7D,E;;;;;UCNA;UACA;UACA;UACA","file":"urpflanze-light.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Urpflanze\"] = factory();\n\telse\n\t\troot[\"Urpflanze\"] = factory();\n})(window, function() {\nreturn ","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./modules-light\"), exports);\n//# sourceMappingURL=index-light.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DrawerCanvas = exports.Animation = void 0;\n__exportStar(require(\"./core\"), exports);\nexports.Animation = require(\"@urpflanze/animation/dist/cjs\");\nvar BrowserDrawerCanvas_1 = require(\"@urpflanze/drawer-canvas/dist/cjs/browser/BrowserDrawerCanvas\");\nObject.defineProperty(exports, \"DrawerCanvas\", { enumerable: true, get: function () { return BrowserDrawerCanvas_1.BrowserDrawerCanvas; } });\n//# sourceMappingURL=modules-light.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mod = exports.log = exports.PI2 = exports.PHI = exports.Vec2 = exports.distributePointsInBuffer = exports.prepareBufferForInterpolation = exports.interpolate = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.now = exports.toRadians = exports.toDegrees = exports.relativeClamp = exports.clamp = exports.lerp = void 0;\n__exportStar(require(\"@urpflanze/core/dist/cjs/Scene\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/SceneChild\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/Group\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/ShapeBase\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/ShapePrimitive\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/ShapeLoop\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/ShapeBuffer\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/Shape\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/ShapeRecursive\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/ShapeFollow\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/primitives/Line\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/primitives/Triangle\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/primitives/Rect\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/primitives/Polygon\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/primitives/Circle\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/primitives/Star\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/primitives/Rose\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/primitives/Spiral\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/primitives/Lissajous\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/primitives/SuperShape\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/modifiers/Modifier\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/modifiers\"), exports);\nvar Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nObject.defineProperty(exports, \"lerp\", { enumerable: true, get: function () { return Utilities_1.lerp; } });\nObject.defineProperty(exports, \"clamp\", { enumerable: true, get: function () { return Utilities_1.clamp; } });\nObject.defineProperty(exports, \"relativeClamp\", { enumerable: true, get: function () { return Utilities_1.relativeClamp; } });\nObject.defineProperty(exports, \"toDegrees\", { enumerable: true, get: function () { return Utilities_1.toDegrees; } });\nObject.defineProperty(exports, \"toRadians\", { enumerable: true, get: function () { return Utilities_1.toRadians; } });\nObject.defineProperty(exports, \"now\", { enumerable: true, get: function () { return Utilities_1.now; } });\nObject.defineProperty(exports, \"noise\", { enumerable: true, get: function () { return Utilities_1.noise; } });\nObject.defineProperty(exports, \"random\", { enumerable: true, get: function () { return Utilities_1.random; } });\nObject.defineProperty(exports, \"angleFromRepetition\", { enumerable: true, get: function () { return Utilities_1.angleFromRepetition; } });\nObject.defineProperty(exports, \"angle2FromRepetition\", { enumerable: true, get: function () { return Utilities_1.angle2FromRepetition; } });\nObject.defineProperty(exports, \"distanceFromRepetition\", { enumerable: true, get: function () { return Utilities_1.distanceFromRepetition; } });\nObject.defineProperty(exports, \"interpolate\", { enumerable: true, get: function () { return Utilities_1.interpolate; } });\nObject.defineProperty(exports, \"prepareBufferForInterpolation\", { enumerable: true, get: function () { return Utilities_1.prepareBufferForInterpolation; } });\nObject.defineProperty(exports, \"distributePointsInBuffer\", { enumerable: true, get: function () { return Utilities_1.distributePointsInBuffer; } });\nvar Vec2_1 = require(\"@urpflanze/core/dist/cjs/math/Vec2\");\nObject.defineProperty(exports, \"Vec2\", { enumerable: true, get: function () { return Vec2_1.default; } });\nvar math_1 = require(\"@urpflanze/core/dist/cjs/math\");\nObject.defineProperty(exports, \"PHI\", { enumerable: true, get: function () { return math_1.PHI; } });\nObject.defineProperty(exports, \"PI2\", { enumerable: true, get: function () { return math_1.PI2; } });\nObject.defineProperty(exports, \"log\", { enumerable: true, get: function () { return math_1.log; } });\nObject.defineProperty(exports, \"mod\", { enumerable: true, get: function () { return math_1.mod; } });\n//# sourceMappingURL=core.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Scene = void 0;\nconst SceneChild_1 = require(\"./SceneChild\");\nconst Group_1 = require(\"./Group\");\nconst Shape_1 = require(\"./shapes/Shape\");\nconst Utilities_1 = require(\"./Utilities\");\n/**\n * Container for all SceneChild.\n * The main purpose is to manage the drawing order and update the child buffers\n *\n * @order 1\n * @category Core.Scene\n * @class Scene\n */\nclass Scene {\n /**\n * Creates an instance of Scene.\n * You can see the default values in the property definitions\n */\n constructor(settings = {}) {\n /**\n * Logical number, the drawer will take care of defining the unit of measure\n */\n this.width = 400;\n /**\n * Logical number, the drawer will take care of defining the unit of measure\n */\n this.height = 400;\n /**\n * Default background color (black)\n */\n this.background = 'hsla(0, 0%, 0%, 1)';\n /**\n * Default ScenePrimitive stroke color (white)\n */\n this.color = 'hsla(0, 0%, 100%, 1)';\n /**\n * Current time\n */\n this.currentTime = 0;\n if (typeof settings.width !== 'undefined')\n this.width = settings.width;\n if (typeof settings.height !== 'undefined')\n this.height = settings.height;\n if (typeof settings.background !== 'undefined')\n this.background = settings.background;\n if (typeof settings.color !== 'undefined')\n this.color = settings.color;\n this.children = [];\n this.center = [this.width / 2, this.height / 2];\n this.anchor =\n settings.anchor && Array.isArray(settings.anchor)\n ? [\n typeof settings.anchor[0] === 'number'\n ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[0]) * 0.5) * this.width\n : settings.anchor[0] === 'left'\n ? 0\n : settings.anchor[0] === 'right'\n ? this.width\n : this.center[0],\n typeof settings.anchor[1] === 'number'\n ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[1]) * 0.5) * this.height\n : settings.anchor[1] === 'top'\n ? 0\n : settings.anchor[1] === 'bottom'\n ? this.height\n : this.center[1],\n ]\n : [this.center[0], this.center[1]];\n }\n /**\n * Return width percentage\n *\n * @param {number} [percentage=100]\n * @returns {number}\n */\n getWidth(percentage = 100) {\n return (this.width * percentage) / 100;\n }\n /**\n * Return height percentage\n *\n * @param {number} [percentage=100]\n * @returns {number}\n */\n getHeight(percentage = 100) {\n return (this.height * percentage) / 100;\n }\n /**\n * Resize the scene size\n *\n * @param {number} width\n * @param {number} [height=width]\n * @memberof Scene\n */\n resize(width, height = width) {\n this.width = width;\n this.height = height;\n this.center = [this.width / 2, this.height / 2];\n const anchor = [this.width / this.anchor[0], this.height / this.anchor[1]];\n this.anchor = [this.width / anchor[0], this.height / anchor[1]];\n this.children.forEach(sceneChild => sceneChild.clearBuffer(true, false));\n }\n /**\n * Update all children, generate a streamable buffer for drawing\n *\n * @param {number} [atTime] time in ms\n * @memberof Scene\n */\n update(atTime = 0) {\n this.currentTime = atTime;\n for (let i = 0, len = this.children.length; i < len; i++) {\n this.children[i].generate(this.currentTime, true);\n }\n }\n /**\n * Traverse the child buffer and use it with callback\n *\n * @param {(streamArguments: IStreamArguments) => void} callback\n * @memberof Scene\n */\n stream(callback) {\n this.children.forEach(sceneChild => sceneChild.stream(callback));\n }\n /*\n |--------------------------------------------------------------------------\n | SceneChild\n |--------------------------------------------------------------------------\n */\n /**\n * Return a list of children\n *\n * @returns {Array}\n * @memberof Scene\n */\n getChildren() {\n return this.children;\n }\n /**\n * Add SceneChild to Scene, pass `order` as last parameter for drawing priorities\n *\n * @param {Array} items\n * @param {number} [order]\n * @memberof Scene\n */\n add(...items /**, order: number */) {\n const order = typeof items[items.length - 1] === 'number' ? items[items.length - 1] : undefined;\n const len = items.length - (typeof order === 'undefined' ? 0 : 1);\n for (let i = 0; i < len; i++) {\n const item = items[i];\n item.order =\n typeof order !== 'undefined'\n ? order + i\n : typeof item.order !== 'undefined'\n ? item.order\n : this.children.length > 0\n ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1\n : 0;\n Scene.propagateToChilden(item, this);\n this.children.push(item);\n item.clearBuffer(true, false);\n item.generate(0, true);\n }\n this.sortChildren();\n }\n /**\n * Sort children by order\n *\n * @memberof Scene\n */\n sortChildren() {\n this.children.sort((a, b) => a.order - b.order);\n this.children = this.children.map((child, index) => {\n child.order = index;\n return child;\n });\n }\n /**\n * Find sceneChild from id or name in the whole scene\n *\n * @param {string | number} idOrName\n * @returns {(SceneChild | null)}\n * @memberof Scene\n */\n find(idOrName) {\n const children = this.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const result = children[i].find(idOrName);\n if (result !== null)\n return result;\n }\n return null;\n }\n /**\n * Get shape by index\n *\n * @param {number} index\n * @returns {(SceneChild | null)}\n * @memberof Scene\n */\n get(index) {\n return index >= 0 && index < this.children.length ? this.children[index] : null;\n }\n /**\n * Remove a shape by index\n *\n * @param {number} index\n * @memberof Scene\n */\n remove(index) {\n index >= 0 && index < this.children.length && this.children.splice(index, 1);\n }\n /**\n * Removes all children\n *\n * @memberof Scene\n */\n removeChildren() {\n this.children = [];\n }\n /**\n * Remove sceneChild by id or name\n *\n * @param {number | number} idOrName\n * @memberof Scene\n */\n removeFromId(idOrName) {\n for (let i = 0, len = this.children.length; i < len; i++)\n if (this.children[i].id === idOrName || this.children[i].name === idOrName) {\n this.children.splice(i, 1);\n return;\n }\n }\n /**\n * Return true if sceneChild is direct children\n *\n * @param {SceneChild} sceneChild\n * @returns {boolean}\n * @memberof Scene\n */\n isFirstLevelChild(sceneChild) {\n for (let i = 0, len = this.children.length; i < len; i++)\n if (this.children[i].id === sceneChild.id)\n return true;\n const parents = this.getParentsOfSceneChild(sceneChild);\n return parents.length === 1 && parents[0] instanceof Group_1.Group;\n }\n /**\n * Returns the list of sceneChild hierarchy starting from the scene\n *\n * @param {SceneChild} sceneChild\n * @returns {Array}\n * @memberof Scene\n */\n getParentsOfSceneChild(sceneChild) {\n const result = Scene.getParentsOfSceneChild(this, sceneChild);\n if (result) {\n result.splice(0, 1);\n return result;\n }\n return [];\n }\n /**\n * Returns the list of sceneChild hierarchy starting from the scene\n *\n * @static\n * @param {(Scene | SceneChild)} current\n * @param {SceneChild} sceneChild\n * @param {(Array)} [parents=[]]\n * @returns {(Array | null)}\n * @memberof Scene\n */\n static getParentsOfSceneChild(current, sceneChild, parents = []) {\n let result;\n if (current instanceof SceneChild_1.SceneChild) {\n if (current.id == sceneChild.id)\n return parents;\n if (current instanceof Shape_1.Shape && current.shape) {\n const tmpParents = parents.slice();\n tmpParents.push(current);\n if ((result = Scene.getParentsOfSceneChild(current.shape, sceneChild, tmpParents)))\n return result;\n }\n }\n if (current instanceof Scene || current instanceof Group_1.Group) {\n const children = current.getChildren();\n parents.push(current);\n for (let i = 0, len = children.length; i < len; i++) {\n const child = children[i];\n if ((result = Scene.getParentsOfSceneChild(child, sceneChild, parents)))\n return result;\n }\n parents.pop();\n }\n return null;\n }\n /**\n * Walk through the scene\n *\n * @static\n * @param {SceneChild} callbackk\n * @param {(Scene | SceneChild)} current\n * @memberof Scene\n */\n static walk(callback, current) {\n if (current instanceof SceneChild_1.SceneChild) {\n if (callback(current) === false)\n return false;\n if (current instanceof Shape_1.Shape && current.shape)\n if (Scene.walk(callback, current.shape) === false)\n return false;\n }\n if (current instanceof Scene || current instanceof Group_1.Group) {\n const children = current.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const child = children[i];\n if (Scene.walk(callback, child) === false)\n return false;\n }\n }\n }\n /**\n * Propagate scene to sceneChild (and children)\n *\n * @static\n * @param {SceneChild} sceneChild\n * @param {Scene} scene\n * @memberof Scene\n */\n static propagateToChilden(sceneChild, scene) {\n sceneChild.scene = scene;\n if (sceneChild instanceof Group_1.Group) {\n sceneChild.getChildren().forEach((item) => {\n Scene.propagateToChilden(item, scene);\n });\n }\n else if (sceneChild instanceof Shape_1.Shape && sceneChild.shape) {\n sceneChild.shape.scene = scene;\n Scene.propagateToChilden(sceneChild.shape, scene);\n }\n }\n}\nexports.Scene = Scene;\n//# sourceMappingURL=Scene.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SceneChild = void 0;\n/**\n * Autoincrement sceneChild default id\n *\n * @internal\n * @ignore\n */\nlet __id = 0;\n/**\n * The element to be added into a scene.\n * Preserve props, drawing order, generate and return buffers.\n * The only implementations of this class are Group and ShapeBase\n *\n * @abstract\n * @category Core.Abstract\n * @order 2\n * @class SceneChild\n */\nclass SceneChild {\n /**\n * Creates an instance of SceneChild.\n * Base values will be assigned in case they are not passed\n *\n * @param {ISceneChildSettings} settings\n */\n constructor(settings) {\n var _a;\n /**\n * Shape generation id\n * used for prevent buffer calculation\n *\n * @internal\n * @ignore\n */\n this.generateId = -1;\n this.id = (_a = settings.id) !== null && _a !== void 0 ? _a : ++__id;\n this.type = settings.type || 'SceneChild';\n this.name = settings.name || this.type + '_' + this.id;\n this.data = settings.data || {};\n this.props = {};\n }\n /**\n * Find this or form or children.\n * Overridden by classes that extend it\n *\n * @param {string | number} idOrName\n * @returns {(SceneChild | null)}\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n return null;\n }\n /**\n * Return the sceneChild properties\n *\n * @returns {Props}\n */\n getProps() {\n return this.props;\n }\n /**\n * Return a sceneChild prop or default value\n *\n * @param {keyof Props} key\n * @param {PropArguments} [propArguments]\n * @param {*} [defaultValue]\n * @returns {*}\n */\n getProp(key, propArguments, defaultValue) {\n var _a;\n return ((_a = this.props[key]) !== null && _a !== void 0 ? _a : defaultValue);\n }\n /**\n * Check SceneChild has prop\n *\n * @param {keyof Props} key\n * @returns\n */\n hasProp(key) {\n return typeof this.props[key] !== 'undefined';\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n */\n setPropUnsafe(key, value) {\n if (typeof key == 'string')\n this.props[key] = value;\n else\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n }\n}\nexports.SceneChild = SceneChild;\n//# sourceMappingURL=SceneChild.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Group = void 0;\nconst Scene_1 = require(\"./Scene\");\nconst SceneChild_1 = require(\"./SceneChild\");\nconst ShapeBase_1 = require(\"./shapes/ShapeBase\");\nconst Adapt_1 = require(\"./modifiers/Adapt\");\n/**\n * A SceneChild container, propagates properties to children\n *\n * @order 3\n * @category Core.Scene\n * @extends {SceneChild}\n * @example\n * ```javascript\n * // Group example\n *\n * const rect = new Urpflanze.Rect({\n * \tdistance: 100 // <- if a property is set the group will not overwrite it\n * })\n * const group = new Urpflanze.Group({\n * \trepetitions: 3,\n * \tdistance: 200\n * })\n *\n * group.add(rect)\n * group.add(new Urpflanze.Triangle())\n * ```\n * @class Group\n */\nclass Group extends SceneChild_1.SceneChild {\n /**\n * Creates an instance of Group\n *\n * @param {ISceneChildSettings} [settings={}]\n * @memberof Group\n */\n constructor(settings = {}) {\n settings.type = 'Group';\n super(settings);\n this.children = [];\n ['id', 'name', 'data', 'order', 'type'].forEach((prop) => {\n if (prop in settings)\n delete settings[prop];\n });\n this.props = settings;\n }\n /**\n * Check group has static children\n *\n * @returns {boolean}\n * @memberof Group\n */\n isStatic() {\n const children = this.children;\n for (let i = 0, len = children.length; i < len; i++)\n if (!children[i].isStatic())\n return false;\n return true;\n }\n /**\n * Check group has static children indexed\n *\n * @returns {boolean}\n * @memberof Group\n */\n isStaticIndexed() {\n const children = this.children;\n for (let i = 0, len = children.length; i < len; i++)\n if (!children[i].isStaticIndexed())\n return false;\n return true;\n }\n /**\n * Add item to Group\n *\n * @param {Array} items\n * @memberof Group\n */\n add(...items) {\n for (let i = 0, len = items.length; i < len; i++) {\n const item = items[i];\n const rawItemProps = item.getProps();\n Object.keys(this.props).forEach((propKey) => {\n if (typeof rawItemProps[propKey] === 'undefined')\n item.setProp(propKey, this.props[propKey]);\n });\n item.order =\n typeof item.order !== 'undefined'\n ? item.order\n : this.children.length > 0\n ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1\n : 0;\n this.scene && Scene_1.Scene.propagateToChilden(item, this.scene);\n this.children.push(item);\n }\n this.sortChildren();\n }\n /**\n * Sort children\n *\n * @memberof Group\n */\n sortChildren() {\n this.children.sort((a, b) => a.order - b.order);\n this.children = this.children.map((child, index) => {\n child.order = index;\n return child;\n });\n this.clearBuffer(true);\n }\n /**\n * Return shape children\n *\n * @returns {Array}\n * @memberof Group\n */\n getChildren() {\n return this.children;\n }\n /**\n * Find scene child from id or name\n *\n * @param {number | string} idOrName\n * @returns {(SceneChild | null)}\n * @memberof Group\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n const children = this.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const result = children[i].find(idOrName);\n if (result !== null)\n return result;\n }\n return null;\n }\n /**\n * Get item from group\n *\n * @param {number} index\n * @returns {(SceneChild | null)}\n * @memberof Group\n */\n get(index) {\n return index >= 0 && index < this.children.length ? this.children[index] : null;\n }\n /**\n * Remove item from group\n *\n * @param {number} index\n * @returns {(false | Array)}\n * @memberof Group\n */\n remove(index) {\n if (index >= 0 && index < this.children.length) {\n const removed = this.children.splice(index, 1);\n this.clearBuffer(true);\n return removed;\n }\n return false;\n }\n /**\n * Remove from id\n *\n * @param {number} id\n * @memberof Scene\n */\n removeFromId(id) {\n for (let i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i].id == id) {\n this.children.splice(i, 1);\n return this.clearBuffer(true);\n }\n }\n }\n /**\n * Generate children buffers\n *\n * @param {number} generateId\n * @param {boolean} [bDirectSceneChild=false]\n * @param {IPropArguments} [parentPropArguments]\n * @memberof Group\n */\n generate(generateId, bDirectSceneChild = false, parentPropArguments) {\n this.generateId = generateId;\n this.children.forEach(item => item.generate(generateId, bDirectSceneChild, parentPropArguments));\n }\n /**\n * Sum the children bounding\n *\n * @return {IShapeBounding}\n */\n getBounding() {\n const boundings = [];\n const bounding = Adapt_1.Bounding.empty();\n if (this.children.length > 0) {\n this.children.forEach(item => boundings.push(item.getBounding()));\n for (let i = 0, len = this.children.length; i < len; i++) {\n bounding.x = bounding.x > boundings[i].x ? boundings[i].x : bounding.x;\n bounding.y = bounding.y > boundings[i].y ? boundings[i].y : bounding.y;\n bounding.width = bounding.width < boundings[i].width ? boundings[i].width : bounding.width;\n bounding.height = bounding.height < boundings[i].height ? boundings[i].height : bounding.height;\n }\n bounding.cx = bounding.x + bounding.width / 2;\n bounding.cy = bounding.y + bounding.height / 2;\n }\n return bounding;\n }\n /**\n * Chear children buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @memberof Group\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.children.forEach(item => item.clearBuffer(bClearIndexed, false));\n if (this.scene && bPropagateToParents) {\n const parents = this.scene.getParentsOfSceneChild(this);\n parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */);\n }\n // if (bPropagateToParents && this.scene)\n // {\n // const parents = this.scene.getParentsOfSceneChild(this)\n // parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, true, false)\n // }\n // if (bPropagateToChildren)\n // {\n // this.children.forEach(sceneChild => sceneChild.clearBuffer(bClearIndexed, false, true))\n // }\n }\n /**\n * Set a single or multiple props\n *\n * @abstract\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @memberof SceneChild\n */\n setProp(key, value) {\n if (typeof key === 'object')\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n else\n this.props[key] = value;\n this.children.forEach(item => item.setProp(key, value));\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @memberof ShapeBase\n */\n setPropUnsafe(key, value) {\n super.setPropUnsafe(key, value);\n this.children.forEach(item => item.setPropUnsafe(key, value));\n }\n /**\n * Return length of buffer\n *\n * @param {IPropArguments} propArguments\n * @returns {number}\n * @memberof Group\n */\n getBufferLength(propArguments) {\n return this.children.map(sceneChild => sceneChild.getBufferLength(propArguments)).reduce((p, c) => p + c, 0);\n }\n /**\n * return a single buffer binded from children\n *\n * @returns {Float32Array}\n * @memberof Group\n */\n getBuffer() {\n const buffers = this.children\n .map(item => item.getBuffer())\n .filter(b => b !== undefined);\n const size = buffers.reduce((currLength, buffer) => currLength + buffer.length, 0);\n if (size > 0) {\n const result = new Float32Array(size);\n result.set(buffers[0], 0);\n for (let i = 1, offset = 0, len = buffers.length; i < len; i++) {\n offset += buffers[i - 1].length;\n result.set(buffers[i], offset);\n }\n return result;\n }\n return ShapeBase_1.ShapeBase.EMPTY_BUFFER;\n }\n /**\n * return a single buffer binded from children\n *\n * @returns {(Array | undefined)}\n * @memberof Group\n */\n getIndexedBuffer() {\n const indexed = this.children.map(item => item.getIndexedBuffer()).filter(b => b !== undefined);\n return [].concat.apply([], indexed);\n }\n /**\n * Call strem on children\n *\n * @param {(streamArguments: IStreamArguments) => void} callback\n * @memberof Group\n */\n stream(callback) {\n this.children.forEach(item => item.stream(callback));\n }\n}\nexports.Group = Group;\n//# sourceMappingURL=Group.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeBase = void 0;\nconst gl_matrix_1 = require(\"gl-matrix\");\nconst types_1 = require(\"../types\");\nconst glme = require(\"../math/gl-matrix-extensions\");\nconst Vec2_1 = require(\"../math/Vec2\");\nconst math_1 = require(\"../math\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst Utilities_1 = require(\"../Utilities\");\nconst SceneChild_1 = require(\"../SceneChild\");\nconst tmpMatrix = gl_matrix_1.mat4.create();\nconst transformMatrix = gl_matrix_1.mat4.create();\nconst perspectiveMatrix = gl_matrix_1.mat4.create();\nconst repetitionMatrix = gl_matrix_1.mat4.create();\n/**\n * Main class for shape generation\n *\n * @category Core.Abstract\n * @abstract\n * @class ShapeBase\n * @order 4\n * @extends {SceneChild}\n */\nclass ShapeBase extends SceneChild_1.SceneChild {\n /**\n * Creates an instance of ShapeBase\n *\n * @param {ISceneChildSettings} [settings={}]\n */\n constructor(settings = {}) {\n super(settings);\n /**\n * Flag used to determine if indexedBuffer has been generated\n *\n * @internal\n * @ignore\n */\n this.bIndexed = false;\n /**\n * Array used for index a vertex buffer\n * only for first level scene children\n *\n * @internal\n * @ignore\n */\n this.indexedBuffer = [];\n /**\n * The bounding inside the scene\n *\n * @type {IShapeBounding}\n */\n this.bounding = {\n cx: 0,\n cy: 0,\n x: -1,\n y: -1,\n width: 2,\n height: 2,\n };\n this.props = {\n distance: settings.distance,\n repetitions: settings.repetitions,\n rotateX: settings.rotateX,\n rotateY: settings.rotateY,\n rotateZ: settings.rotateZ,\n skewX: settings.skewX,\n skewY: settings.skewY,\n squeezeX: settings.squeezeX,\n squeezeY: settings.squeezeY,\n displace: settings.displace,\n translate: settings.translate,\n scale: settings.scale,\n transformOrigin: settings.transformOrigin,\n perspective: settings.perspective,\n perspectiveOrigin: settings.perspectiveOrigin,\n };\n this.anchor =\n settings.anchor && Array.isArray(settings.anchor)\n ? [\n typeof settings.anchor[0] === 'number'\n ? Utilities_1.clamp(-1, 1, settings.anchor[0]) * -1\n : settings.anchor[0] === 'left'\n ? 1\n : settings.anchor[0] === 'right'\n ? -1\n : 0,\n typeof settings.anchor[1] === 'number'\n ? Utilities_1.clamp(-1, 1, settings.anchor[1]) * -1\n : settings.anchor[1] === 'top'\n ? 1\n : settings.anchor[1] === 'bottom'\n ? -1\n : 0,\n ]\n : [0, 0];\n this.boundingType =\n typeof settings.boundingType === 'string'\n ? settings.boundingType === 'relative'\n ? types_1.EBoundingType.Relative\n : types_1.EBoundingType.Fixed\n : settings.boundingType || types_1.EBoundingType.Fixed;\n this.vertexCallback = settings.vertexCallback;\n }\n /**\n * Check if the shape should be generated every time\n *\n * @returns {boolean}\n */\n isStatic() {\n const props = this.props;\n return (typeof props.repetitions !== 'function' &&\n typeof props.distance !== 'function' &&\n typeof props.displace !== 'function' &&\n typeof props.scale !== 'function' &&\n typeof props.translate !== 'function' &&\n typeof props.skewX !== 'function' &&\n typeof props.skewY !== 'function' &&\n typeof props.squeezeX !== 'function' &&\n typeof props.squeezeY !== 'function' &&\n typeof props.rotateX !== 'function' &&\n typeof props.rotateY !== 'function' &&\n typeof props.rotateZ !== 'function' &&\n typeof props.transformOrigin !== 'function' &&\n typeof props.perspective !== 'function' &&\n typeof props.perspectiveOrigin !== 'function');\n }\n /**\n * Check if the indexedBuffer array needs to be recreated every time,\n * this can happen when a shape generates an array of vertices different in length at each repetition\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return typeof this.props.repetitions !== 'function';\n }\n /**\n * Return a prop value\n *\n * @param {keyof ISceneChildProps} key\n * @param {PropArguments} [propArguments]\n * @param {*} [defaultValue]\n * @returns {*}\n */\n getProp(key, propArguments, defaultValue) {\n let attribute = this.props[key];\n if (typeof attribute === 'function') {\n attribute = attribute(propArguments);\n }\n return typeof attribute === 'undefined' || Number.isNaN(attribute) ? defaultValue : attribute;\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @param {boolean} [bClearIndexed=false]\n */\n setProp(key, value, bClearIndexed = false) {\n if (typeof key === 'string') {\n bClearIndexed = bClearIndexed || key == 'repetitions';\n this.props[key] = value;\n }\n else {\n bClearIndexed = bClearIndexed || 'repetitions' in key;\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n }\n this.clearBuffer(bClearIndexed, true);\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.buffer = undefined;\n if (bClearIndexed) {\n this.bIndexed = false;\n this.indexedBuffer = [];\n }\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n if (bPropagateToParents && this.scene && !this.scene.isFirstLevelChild(this)) {\n const parents = this.scene.getParentsOfSceneChild(this);\n parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */);\n }\n }\n /**\n * Update the vertex array if the shape is not static and update the indexedBuffer if it is also not static\n *\n * @param {number} generateId generation id\n * @param {boolean} [bDirectSceneChild=false] adjust shape of center of scene\n * @param {PropArguments} [parentPropArguments]\n */\n generate(generateId = 0, bDirectSceneChild = false, parentPropArguments) {\n var _a, _b;\n if (this.buffer && this.bStatic) {\n return;\n }\n this.generateId = generateId;\n if (!this.bStaticIndexed || !this.bIndexed)\n this.indexedBuffer = [];\n const propArguments = ShapeBase.getEmptyPropArguments(this, parentPropArguments);\n const repetition = propArguments.repetition;\n const repetitions = this.getProp('repetitions', propArguments, 1);\n const repetitionType = Array.isArray(repetitions) ? types_1.ERepetitionType.Matrix : types_1.ERepetitionType.Ring;\n const repetitionCount = Array.isArray(repetitions)\n ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0])\n : repetitions;\n const repetitionRowCount = Array.isArray(repetitions) ? repetitions[0] : repetitionCount;\n const repetitionColCount = Array.isArray(repetitions) ? (_b = repetitions[1]) !== null && _b !== void 0 ? _b : repetitions[0] : 1;\n const rowRepetition = repetition.row;\n rowRepetition.count = repetitionRowCount;\n const colRepetition = repetition.col;\n colRepetition.count = repetitionColCount;\n repetition.count = repetitionCount;\n repetition.col.count = repetitionColCount;\n repetition.row.count = repetitionRowCount;\n repetition.type = repetitionType;\n let totalBufferLength = 0;\n const buffers = [];\n let currentIndex = 0;\n const centerMatrix = gl_matrix_1.vec2.fromValues((repetitionColCount - 1) / 2, (repetitionRowCount - 1) / 2);\n const sceneAnchor = this.scene ? [this.scene.anchor[0], this.scene.anchor[1], 0] : [0, 0, 0];\n const tmpTotalShapeBounding = [undefined, undefined, undefined, undefined];\n const tmpSingleRepetitionBounding = [undefined, undefined, undefined, undefined];\n for (let currentRowRepetition = 0; currentRowRepetition < repetitionRowCount; currentRowRepetition++) {\n for (let currentColRepetition = 0; currentColRepetition < repetitionColCount; currentColRepetition++, currentIndex++) {\n repetition.index = currentIndex + 1;\n repetition.offset = repetitionCount > 1 ? currentIndex / (repetitionCount - 1) : 1;\n repetition.angle = repetitionType === types_1.ERepetitionType.Ring ? (math_1.PI2 / repetitionCount) * currentIndex : 0;\n colRepetition.index = currentColRepetition + 1;\n colRepetition.offset = repetitionColCount > 1 ? currentColRepetition / (repetitionColCount - 1) : 1;\n rowRepetition.index = currentRowRepetition + 1;\n rowRepetition.offset = repetitionRowCount > 1 ? currentRowRepetition / (repetitionRowCount - 1) : 1;\n // Generate primitives buffer recursively\n const buffer = this.generateBuffer(generateId, propArguments);\n const bufferLength = buffer.length;\n const bounding = this.getShapeBounding();\n buffers[currentIndex] = new Float32Array(bufferLength);\n totalBufferLength += bufferLength;\n {\n const distance = glme.toVec2(this.getProp('distance', propArguments, glme.VEC2_ZERO));\n const displace = this.getProp('displace', propArguments, 0);\n const scale = glme.toVec3(this.getProp('scale', propArguments, glme.VEC2_ONE), 1);\n const translate = glme.toVec3(this.getProp('translate', propArguments, glme.VEC2_ZERO), 0);\n const skewX = this.getProp('skewX', propArguments, 0);\n const skewY = this.getProp('skewY', propArguments, 0);\n const squeezeX = this.getProp('squeezeX', propArguments, 0);\n const squeezeY = this.getProp('squeezeY', propArguments, 0);\n const rotateX = this.getProp('rotateX', propArguments, 0);\n const rotateY = this.getProp('rotateY', propArguments, 0);\n const rotateZ = this.getProp('rotateZ', propArguments, 0);\n const perspective = Utilities_1.clamp(0, 1, this.getProp('perspective', propArguments, 0));\n const perspectiveOrigin = glme.toVec3(this.getProp('perspectiveOrigin', propArguments, glme.VEC2_ZERO), 0);\n const transformOrigin = glme.toVec3(this.getProp('transformOrigin', propArguments, glme.VEC2_ZERO), 0);\n let offset;\n switch (repetitionType) {\n case types_1.ERepetitionType.Ring:\n offset = gl_matrix_1.vec3.fromValues(distance[0], 0, 0);\n gl_matrix_1.vec3.rotateZ(offset, offset, glme.VEC3_ZERO, repetition.angle + displace);\n break;\n case types_1.ERepetitionType.Matrix:\n offset = gl_matrix_1.vec3.fromValues(distance[1] * (currentColRepetition - centerMatrix[0]), distance[0] * (currentRowRepetition - centerMatrix[1]), 0);\n break;\n }\n const perspectiveSize = perspective > 0 ? Math.max(bounding.width, bounding.height) / 2 : 1;\n const perspectiveValue = perspective > 0 ? perspectiveSize + (1 - perspective) * (perspectiveSize * 10) : 0;\n const bTransformOrigin = (this.boundingType === types_1.EBoundingType.Relative ? bounding.cx !== 0 || bounding.cy !== 0 : true) ||\n perspective !== 0 ||\n transformOrigin[0] !== 0 ||\n transformOrigin[1] !== 0;\n const bPerspectiveOrigin = perspectiveOrigin[0] !== 0 || perspectiveOrigin[1] !== 0;\n if (bTransformOrigin) {\n if (this.boundingType === types_1.EBoundingType.Relative) {\n transformOrigin[0] = transformOrigin[0] * (bounding.width / 2) + bounding.cx;\n transformOrigin[1] = transformOrigin[1] * (bounding.height / 2) + bounding.cy;\n }\n else {\n transformOrigin[0] *= bounding.width / 2;\n transformOrigin[1] *= bounding.height / 2;\n }\n transformOrigin[2] = perspectiveValue;\n }\n /**\n * Create Matrices\n */\n {\n /**\n * Create Transformation matrix\n */\n gl_matrix_1.mat4.identity(transformMatrix);\n bTransformOrigin && gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, transformOrigin);\n if (translate[0] !== 0 || translate[1] !== 0)\n gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, translate);\n if (skewX !== 0 || skewY !== 0) {\n glme.fromSkew(tmpMatrix, [skewX, skewY]);\n gl_matrix_1.mat4.multiply(transformMatrix, transformMatrix, tmpMatrix);\n }\n rotateX !== 0 && gl_matrix_1.mat4.rotateX(transformMatrix, transformMatrix, rotateX);\n rotateY !== 0 && gl_matrix_1.mat4.rotateY(transformMatrix, transformMatrix, rotateY);\n rotateZ !== 0 && gl_matrix_1.mat4.rotateZ(transformMatrix, transformMatrix, rotateZ);\n if (scale[0] !== 1 || scale[1] !== 1)\n gl_matrix_1.mat4.scale(transformMatrix, transformMatrix, scale);\n bTransformOrigin &&\n gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, gl_matrix_1.vec3.scale(transformOrigin, transformOrigin, -1));\n /**\n * Create Perspective matrix\n */\n if (perspectiveValue > 0) {\n if (bPerspectiveOrigin) {\n if (this.boundingType === types_1.EBoundingType.Relative) {\n perspectiveOrigin[0] = perspectiveOrigin[0] * (bounding.width / 2) + bounding.cx;\n perspectiveOrigin[1] = perspectiveOrigin[1] * (bounding.height / 2) + bounding.cy;\n }\n else {\n perspectiveOrigin[0] *= bounding.width / 2;\n perspectiveOrigin[1] *= bounding.height / 2;\n }\n perspectiveOrigin[2] = 0;\n }\n gl_matrix_1.mat4.perspective(perspectiveMatrix, -Math.PI / 2, 1, 0, Infinity);\n }\n /**\n * Create Repetition matrix\n */\n gl_matrix_1.mat4.identity(repetitionMatrix);\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, offset);\n if (bDirectSceneChild) {\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, sceneAnchor);\n }\n /**\n * Apply anchor\n */\n const shapeAnchor = [this.anchor[0] * (bounding.width / 2), this.anchor[1] * (bounding.height / 2), 0];\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, shapeAnchor);\n if (repetitionType === types_1.ERepetitionType.Ring)\n gl_matrix_1.mat4.rotateZ(repetitionMatrix, repetitionMatrix, repetition.angle + displace);\n }\n Adapt_1.Bounding.clear(tmpSingleRepetitionBounding);\n // Apply matrices on vertex\n for (let bufferIndex = 0; bufferIndex < bufferLength; bufferIndex += 2) {\n const vertex = [buffer[bufferIndex], buffer[bufferIndex + 1], perspectiveValue];\n {\n // Apply squeeze, can be insert into transformMatrix?\n squeezeX !== 0 && Vec2_1.default.squeezeX(vertex, squeezeX);\n squeezeY !== 0 && Vec2_1.default.squeezeY(vertex, squeezeY);\n // Apply transforms\n gl_matrix_1.vec3.transformMat4(vertex, vertex, transformMatrix);\n // Apply perspective\n if (perspectiveValue > 0) {\n bPerspectiveOrigin && gl_matrix_1.vec3.add(vertex, vertex, perspectiveOrigin);\n gl_matrix_1.vec3.transformMat4(vertex, vertex, perspectiveMatrix);\n gl_matrix_1.vec3.scale(vertex, vertex, perspectiveValue);\n bPerspectiveOrigin && gl_matrix_1.vec3.sub(vertex, vertex, perspectiveOrigin);\n }\n // apply repetition matrix\n gl_matrix_1.vec3.transformMat4(vertex, vertex, repetitionMatrix);\n // custom vertex manipulation\n if (typeof this.vertexCallback !== 'undefined') {\n const index = bufferIndex / 2;\n const count = bufferLength / 2;\n const vertexRepetition = {\n index: index + 1,\n count,\n offset: count > 1 ? index / (count - 1) : 1,\n };\n this.vertexCallback(vertex, vertexRepetition, propArguments);\n }\n }\n buffers[currentIndex][bufferIndex] = vertex[0];\n buffers[currentIndex][bufferIndex + 1] = vertex[1];\n Adapt_1.Bounding.add(tmpSingleRepetitionBounding, vertex[0], vertex[1]);\n Adapt_1.Bounding.add(tmpTotalShapeBounding, vertex[0], vertex[1]);\n }\n }\n // Bounding.sum(tmpTotalShapeBounding, tmpSingleRepetitionBounding)\n // After buffer creation, add a frame into indexedBuffer if not static or update bounding\n const singleRepetitionBounding = { cx: 0, cy: 0, x: -1, y: -1, width: 2, height: 2 };\n Adapt_1.Bounding.bind(singleRepetitionBounding, tmpSingleRepetitionBounding);\n if (!this.bStaticIndexed || !this.bIndexed) {\n this.addIndex(bufferLength, repetition, singleRepetitionBounding);\n }\n }\n }\n Adapt_1.Bounding.bind(this.bounding, tmpTotalShapeBounding);\n this.buffer = new Float32Array(totalBufferLength);\n for (let i = 0, offset = 0, len = buffers.length; i < len; offset += buffers[i].length, i++)\n this.buffer.set(buffers[i], offset);\n this.bIndexed = true;\n }\n /**\n * Return current shape (whit repetions) bounding\n *\n * @return {*} {IShapeBounding}\n */\n getBounding() {\n return this.bounding;\n }\n /**\n * Get number of repetitions\n *\n * @returns {number}\n */\n getRepetitionCount() {\n var _a;\n const repetitions = this.getProp('repetitions', undefined, 1);\n return Array.isArray(repetitions) ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) : repetitions;\n }\n /**\n * Return buffer\n *\n * @returns {(Float32Array | undefined)}\n */\n getBuffer() {\n return this.buffer;\n }\n /**\n * Return indexed buffer\n *\n * @returns {(Array> | undefined)}\n */\n getIndexedBuffer() {\n return this.indexedBuffer;\n }\n /**\n * Return number of encapsulation\n *\n * @param {IBufferIndex} index\n * @returns {number}\n */\n static getIndexParentLevel(index) {\n if (typeof index.parent === 'undefined')\n return 0;\n let currentParent = index.parent;\n let currentParentLevel = 1;\n while (typeof currentParent.parent !== 'undefined') {\n currentParentLevel++;\n currentParent = currentParent.parent;\n }\n return currentParentLevel;\n }\n /**\n * Stream buffer\n *\n * @param {(TStreamCallback} callback\n */\n stream(callback) {\n if (this.buffer && this.indexedBuffer) {\n for (let i = 0, j = 0, len = this.indexedBuffer.length; i < len; i++) {\n const currentIndexing = this.indexedBuffer[i];\n callback({\n buffer: this.buffer,\n frameLength: currentIndexing.frameLength,\n frameBufferIndex: j,\n currentIndexing: currentIndexing,\n currentShapeIndex: i,\n totalShapes: len,\n });\n j += currentIndexing.frameLength;\n }\n }\n }\n /**\n * Return empty propArguments\n *\n * @static\n * @param {ShapeBase} shape\n * @return {*} {PropArguments}\n */\n static getEmptyPropArguments(shape, parentPropArguments) {\n const repetition = {\n type: types_1.ERepetitionType.Ring,\n angle: 0,\n index: 1,\n offset: 1,\n count: 1,\n row: { index: 1, offset: 1, count: 1 },\n col: { index: 1, offset: 1, count: 1 },\n };\n return {\n repetition,\n shape,\n parent: parentPropArguments,\n };\n }\n}\nexports.ShapeBase = ShapeBase;\n/**\n * Empty buffer\n *\n * @internal\n * @ignore\n */\nShapeBase.EMPTY_BUFFER = new Float32Array(0);\n/**\n * Empty BaseRepetition\n *\n * @internal\n * @ignore\n */\nShapeBase.getEmptySimpleRepetition = () => ({\n index: 1,\n offset: 1,\n count: 1,\n});\n/**\n * Empty Repetition\n *\n * @internal\n * @ignore\n */\nShapeBase.getEmptyRepetition = () => ({\n type: types_1.ERepetitionType.Ring,\n angle: 0,\n ...ShapeBase.getEmptySimpleRepetition(),\n row: ShapeBase.getEmptySimpleRepetition(),\n col: ShapeBase.getEmptySimpleRepetition(),\n});\n//# sourceMappingURL=ShapeBase.js.map","import * as glMatrix from \"./common.js\";\nimport * as mat2 from \"./mat2.js\";\nimport * as mat2d from \"./mat2d.js\";\nimport * as mat3 from \"./mat3.js\";\nimport * as mat4 from \"./mat4.js\";\nimport * as quat from \"./quat.js\";\nimport * as quat2 from \"./quat2.js\";\nimport * as vec2 from \"./vec2.js\";\nimport * as vec3 from \"./vec3.js\";\nimport * as vec4 from \"./vec4.js\";\nexport { glMatrix, mat2, mat2d, mat3, mat4, quat, quat2, vec2, vec3, vec4 };","/**\r\n * Common utilities\r\n * @module glMatrix\r\n */\n// Configuration Constants\nexport var EPSILON = 0.000001;\nexport var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexport var RANDOM = Math.random;\n/**\r\n * Sets the type of array used when creating new vectors and matrices\r\n *\r\n * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array\r\n */\n\nexport function setMatrixArrayType(type) {\n ARRAY_TYPE = type;\n}\nvar degree = Math.PI / 180;\n/**\r\n * Convert Degree To Radian\r\n *\r\n * @param {Number} a Angle in Degrees\r\n */\n\nexport function toRadian(a) {\n return a * degree;\n}\n/**\r\n * Tests whether or not the arguments have approximately the same value, within an absolute\r\n * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less\r\n * than or equal to 1.0, and a relative tolerance is used for larger values)\r\n *\r\n * @param {Number} a The first number to test.\r\n * @param {Number} b The second number to test.\r\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n}\nif (!Math.hypot) Math.hypot = function () {\n var y = 0,\n i = arguments.length;\n\n while (i--) {\n y += arguments[i] * arguments[i];\n }\n\n return Math.sqrt(y);\n};","import * as glMatrix from \"./common.js\";\n/**\r\n * 2x2 Matrix\r\n * @module mat2\r\n */\n\n/**\r\n * Creates a new identity mat2\r\n *\r\n * @returns {mat2} a new 2x2 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\r\n * Creates a new mat2 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat2} a matrix to clone\r\n * @returns {mat2} a new 2x2 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Copy the values from one mat2 to another\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set a mat2 to the identity matrix\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @returns {mat2} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\r\n * Create a new mat2 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\r\n * @returns {mat2} out A new 2x2 matrix\r\n */\n\nexport function fromValues(m00, m01, m10, m11) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\r\n * Set the components of a mat2 to the given values\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\r\n * @returns {mat2} out\r\n */\n\nexport function set(out, m00, m01, m10, m11) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\r\n * Transpose the values of a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache\n // some values\n if (out === a) {\n var a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3]; // Calculate the determinant\n\n var det = a0 * a3 - a2 * a1;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function adjoint(out, a) {\n // Caching this value is nessecary if out == a\n var a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat2\r\n *\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n}\n/**\r\n * Multiplies two mat2's\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n}\n/**\r\n * Rotates a mat2 by the given angle\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n}\n/**\r\n * Scales the mat2 by the dimensions in the given vec2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to rotate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat2} out\r\n **/\n\nexport function scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n *\r\n * @param {mat2} out mat2 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n *\r\n * @param {mat2} out mat2 receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat2} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n}\n/**\r\n * Returns a string representation of a mat2\r\n *\r\n * @param {ReadonlyMat2} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat2\r\n *\r\n * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3]);\n}\n/**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @param {ReadonlyMat2} L the lower triangular matrix\r\n * @param {ReadonlyMat2} D the diagonal matrix\r\n * @param {ReadonlyMat2} U the upper triangular matrix\r\n * @param {ReadonlyMat2} a the input matrix to factorize\r\n */\n\nexport function LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n}\n/**\r\n * Adds two mat2's\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat2} a The first matrix.\r\n * @param {ReadonlyMat2} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat2} a The first matrix.\r\n * @param {ReadonlyMat2} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat2} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\r\n * Adds two mat2's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat2} out the receiving vector\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat2} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\r\n * Alias for {@link mat2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat2.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 2x3 Matrix\r\n * @module mat2d\r\n * @description\r\n * A mat2d contains six elements defined as:\r\n *
\r\n * [a, b,\r\n *  c, d,\r\n *  tx, ty]\r\n * 
\r\n * This is a short form for the 3x3 matrix:\r\n *
\r\n * [a, b, 0,\r\n *  c, d, 0,\r\n *  tx, ty, 1]\r\n * 
\r\n * The last column is ignored so the array is shorter and operations are faster.\r\n */\n\n/**\r\n * Creates a new identity mat2d\r\n *\r\n * @returns {mat2d} a new 2x3 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(6);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[4] = 0;\n out[5] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\r\n * Creates a new mat2d initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat2d} a matrix to clone\r\n * @returns {mat2d} a new 2x3 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\r\n * Copy the values from one mat2d to another\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\r\n * Set a mat2d to the identity matrix\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Create a new mat2d with the given values\r\n *\r\n * @param {Number} a Component A (index 0)\r\n * @param {Number} b Component B (index 1)\r\n * @param {Number} c Component C (index 2)\r\n * @param {Number} d Component D (index 3)\r\n * @param {Number} tx Component TX (index 4)\r\n * @param {Number} ty Component TY (index 5)\r\n * @returns {mat2d} A new mat2d\r\n */\n\nexport function fromValues(a, b, c, d, tx, ty) {\n var out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\r\n * Set the components of a mat2d to the given values\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {Number} a Component A (index 0)\r\n * @param {Number} b Component B (index 1)\r\n * @param {Number} c Component C (index 2)\r\n * @param {Number} d Component D (index 3)\r\n * @param {Number} tx Component TX (index 4)\r\n * @param {Number} ty Component TY (index 5)\r\n * @returns {mat2d} out\r\n */\n\nexport function set(out, a, b, c, d, tx, ty) {\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\r\n * Inverts a mat2d\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function invert(out, a) {\n var aa = a[0],\n ab = a[1],\n ac = a[2],\n ad = a[3];\n var atx = a[4],\n aty = a[5];\n var det = aa * ad - ab * ac;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n}\n/**\r\n * Multiplies two mat2d's\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n}\n/**\r\n * Rotates a mat2d by the given angle\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2d} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\r\n * Scales the mat2d by the dimensions in the given vec2\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to translate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat2d} out\r\n **/\n\nexport function scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\r\n * Translates the mat2d by the dimensions in the given vec2\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to translate\r\n * @param {ReadonlyVec2} v the vec2 to translate the matrix by\r\n * @returns {mat2d} out\r\n **/\n\nexport function translate(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.rotate(dest, dest, rad);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2d} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.scale(dest, dest, vec);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat2d} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.translate(dest, dest, vec);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {ReadonlyVec2} v Translation vector\r\n * @returns {mat2d} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n}\n/**\r\n * Returns a string representation of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat2d(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1);\n}\n/**\r\n * Adds two mat2d's\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat2d} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n}\n/**\r\n * Adds two mat2d's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat2d} out the receiving vector\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat2d} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat2d} a The first matrix.\r\n * @param {ReadonlyMat2d} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat2d} a The first matrix.\r\n * @param {ReadonlyMat2d} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5));\n}\n/**\r\n * Alias for {@link mat2d.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat2d.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 3x3 Matrix\r\n * @module mat3\r\n */\n\n/**\r\n * Creates a new identity mat3\r\n *\r\n * @returns {mat3} a new 3x3 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(9);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n }\n\n out[0] = 1;\n out[4] = 1;\n out[8] = 1;\n return out;\n}\n/**\r\n * Copies the upper-left 3x3 values into the given mat3.\r\n *\r\n * @param {mat3} out the receiving 3x3 matrix\r\n * @param {ReadonlyMat4} a the source 4x4 matrix\r\n * @returns {mat3} out\r\n */\n\nexport function fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n}\n/**\r\n * Creates a new mat3 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat3} a matrix to clone\r\n * @returns {mat3} a new 3x3 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Copy the values from one mat3 to another\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Create a new mat3 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\r\n * @returns {mat3} A new mat3\r\n */\n\nexport function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\r\n * Set the components of a mat3 to the given values\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\r\n * @returns {mat3} out\r\n */\n\nexport function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\r\n * Set a mat3 to the identity matrix\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @returns {mat3} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Transpose the values of a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b01 = a22 * a11 - a12 * a21;\n var b11 = -a22 * a10 + a12 * a20;\n var b21 = a21 * a10 - a11 * a20; // Calculate the determinant\n\n var det = a00 * b01 + a01 * b11 + a02 * b21;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat3\r\n *\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n}\n/**\r\n * Multiplies two mat3's\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b00 = b[0],\n b01 = b[1],\n b02 = b[2];\n var b10 = b[3],\n b11 = b[4],\n b12 = b[5];\n var b20 = b[6],\n b21 = b[7],\n b22 = b[8];\n out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n return out;\n}\n/**\r\n * Translate a mat3 by the given vector\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to translate\r\n * @param {ReadonlyVec2} v vector to translate by\r\n * @returns {mat3} out\r\n */\n\nexport function translate(out, a, v) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n x = v[0],\n y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n}\n/**\r\n * Rotates a mat3 by the given angle\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat3} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n}\n/**\r\n * Scales the mat3 by the dimensions in the given vec2\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to rotate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat3} out\r\n **/\n\nexport function scale(out, a, v) {\n var x = v[0],\n y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyVec2} v Translation vector\r\n * @returns {mat3} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat3} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat3} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Copies the values from a mat2d into a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to copy\r\n * @returns {mat3} out\r\n **/\n\nexport function fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n}\n/**\r\n * Calculates a 3x3 matrix from the given quaternion\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyQuat} q Quaternion to create matrix from\r\n *\r\n * @returns {mat3} out\r\n */\n\nexport function fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n}\n/**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n *\r\n * @returns {mat3} out\r\n */\n\nexport function normalFromMat4(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n}\n/**\r\n * Generates a 2D projection matrix with the given bounds\r\n *\r\n * @param {mat3} out mat3 frustum matrix will be written into\r\n * @param {number} width Width of your gl context\r\n * @param {number} height Height of gl context\r\n * @returns {mat3} out\r\n */\n\nexport function projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n}\n/**\r\n * Returns a string representation of a mat3\r\n *\r\n * @param {ReadonlyMat3} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat3\r\n *\r\n * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);\n}\n/**\r\n * Adds two mat3's\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat3} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n}\n/**\r\n * Adds two mat3's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat3} out the receiving vector\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat3} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat3} a The first matrix.\r\n * @param {ReadonlyMat3} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat3} a The first matrix.\r\n * @param {ReadonlyMat3} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7],\n a8 = a[8];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7],\n b8 = b[8];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8));\n}\n/**\r\n * Alias for {@link mat3.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat3.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied.\r\n * @module mat4\r\n */\n\n/**\r\n * Creates a new identity mat4\r\n *\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(16);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n }\n\n out[0] = 1;\n out[5] = 1;\n out[10] = 1;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a new mat4 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat4} a matrix to clone\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Copy the values from one mat4 to another\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Create a new mat4 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} A new mat4\r\n */\n\nexport function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\r\n * Set the components of a mat4 to the given values\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} out\r\n */\n\nexport function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\r\n * Set a mat4 to the identity matrix\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @returns {mat4} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Transpose the values of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a12 = a[6],\n a13 = a[7];\n var a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22);\n out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\n out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12);\n out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\n out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\n out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22);\n out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\n out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12);\n out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21);\n out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\n out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11);\n out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\n out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\n out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21);\n out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\n out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11);\n return out;\n}\n/**\r\n * Calculates the determinant of a mat4\r\n *\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n}\n/**\r\n * Multiplies two mat4s\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15]; // Cache only the current line of the second matrix\n\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n/**\r\n * Translate a mat4 by the given vector\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to translate\r\n * @param {ReadonlyVec3} v vector to translate by\r\n * @returns {mat4} out\r\n */\n\nexport function translate(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n\n return out;\n}\n/**\r\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to scale\r\n * @param {ReadonlyVec3} v the vec3 to scale the matrix by\r\n * @returns {mat4} out\r\n **/\n\nexport function scale(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Rotates a mat4 by the given angle around the given axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nexport function rotate(out, a, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n var b00, b01, b02;\n var b10, b11, b12;\n var b20, b21, b22;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11]; // Construct the elements of the rotation matrix\n\n b00 = x * x * t + c;\n b01 = y * x * t + z * s;\n b02 = z * x * t - y * s;\n b10 = x * y * t - z * s;\n b11 = y * y * t + c;\n b12 = z * y * t + x * s;\n b20 = x * z * t + y * s;\n b21 = y * z * t - x * s;\n b22 = z * z * t + c; // Perform rotation-specific matrix multiplication\n\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the X axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateX(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Y axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateY(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Z axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyVec3} v Scaling vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotation(out, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c; // Perform rotation-specific matrix multiplication\n\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromXRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromYRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromZRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslation(out, q, v) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a new mat4 from a dual quat.\r\n *\r\n * @param {mat4} out Matrix\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @returns {mat4} mat4 receiving operation result\r\n */\n\nexport function fromQuat2(out, a) {\n var translation = new glMatrix.ARRAY_TYPE(3);\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense\n\n if (magnitude > 0) {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n\n fromRotationTranslation(out, a, translation);\n return out;\n}\n/**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nexport function getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n}\n/**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion paramter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nexport function getScaling(out, mat) {\n var m11 = mat[0];\n var m12 = mat[1];\n var m13 = mat[2];\n var m21 = mat[4];\n var m22 = mat[5];\n var m23 = mat[6];\n var m31 = mat[8];\n var m32 = mat[9];\n var m33 = mat[10];\n out[0] = Math.hypot(m11, m12, m13);\n out[1] = Math.hypot(m21, m22, m23);\n out[2] = Math.hypot(m31, m32, m33);\n return out;\n}\n/**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @param {quat} out Quaternion to receive the rotation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {quat} out\r\n */\n\nexport function getRotation(out, mat) {\n var scaling = new glMatrix.ARRAY_TYPE(3);\n getScaling(scaling, mat);\n var is1 = 1 / scaling[0];\n var is2 = 1 / scaling[1];\n var is3 = 1 / scaling[2];\n var sm11 = mat[0] * is1;\n var sm12 = mat[1] * is2;\n var sm13 = mat[2] * is3;\n var sm21 = mat[4] * is1;\n var sm22 = mat[5] * is2;\n var sm23 = mat[6] * is3;\n var sm31 = mat[8] * is1;\n var sm32 = mat[9] * is2;\n var sm33 = mat[10] * is3;\n var trace = sm11 + sm22 + sm33;\n var S = 0;\n\n if (trace > 0) {\n S = Math.sqrt(trace + 1.0) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @param {ReadonlyVec3} s Scaling vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslationScale(out, q, v, s) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @param {ReadonlyVec3} s Scaling vector\r\n * @param {ReadonlyVec3} o The origin vector around which to scale and rotate\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n var ox = o[0];\n var oy = o[1];\n var oz = o[2];\n var out0 = (1 - (yy + zz)) * sx;\n var out1 = (xy + wz) * sx;\n var out2 = (xz - wy) * sx;\n var out4 = (xy - wz) * sy;\n var out5 = (1 - (xx + zz)) * sy;\n var out6 = (yz + wx) * sy;\n var out8 = (xz + wy) * sz;\n var out9 = (yz - wx) * sz;\n var out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n}\n/**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyQuat} q Quaternion to create matrix from\r\n *\r\n * @returns {mat4} out\r\n */\n\nexport function fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a frustum matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Number} left Left bound of the frustum\r\n * @param {Number} right Right bound of the frustum\r\n * @param {Number} bottom Bottom bound of the frustum\r\n * @param {Number} top Top bound of the frustum\r\n * @param {Number} near Near bound of the frustum\r\n * @param {Number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function frustum(out, left, right, bottom, top, near, far) {\n var rl = 1 / (right - left);\n var tb = 1 / (top - bottom);\n var nf = 1 / (near - far);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near * 2 * nf;\n out[15] = 0;\n return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} fovy Vertical field of view in radians\r\n * @param {number} aspect Aspect ratio. typically viewport width/height\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum, can be null or Infinity\r\n * @returns {mat4} out\r\n */\n\nexport function perspective(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n\n return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function perspectiveFromFieldOfView(out, fov, near, far) {\n var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);\n var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);\n var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);\n var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);\n var xScale = 2.0 / (leftTan + rightTan);\n var yScale = 2.0 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n out[4] = 0.0;\n out[5] = yScale;\n out[6] = 0.0;\n out[7] = 0.0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1.0;\n out[12] = 0.0;\n out[13] = 0.0;\n out[14] = far * near / (near - far);\n out[15] = 0.0;\n return out;\n}\n/**\r\n * Generates a orthogonal projection matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} left Left bound of the frustum\r\n * @param {number} right Right bound of the frustum\r\n * @param {number} bottom Bottom bound of the frustum\r\n * @param {number} top Top bound of the frustum\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function ortho(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {ReadonlyVec3} eye Position of the viewer\r\n * @param {ReadonlyVec3} center Point the viewer is looking at\r\n * @param {ReadonlyVec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nexport function lookAt(out, eye, center, up) {\n var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;\n var eyex = eye[0];\n var eyey = eye[1];\n var eyez = eye[2];\n var upx = up[0];\n var upy = up[1];\n var upz = up[2];\n var centerx = center[0];\n var centery = center[1];\n var centerz = center[2];\n\n if (Math.abs(eyex - centerx) < glMatrix.EPSILON && Math.abs(eyey - centery) < glMatrix.EPSILON && Math.abs(eyez - centerz) < glMatrix.EPSILON) {\n return identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n len = 1 / Math.hypot(z0, z1, z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.hypot(x0, x1, x2);\n\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n len = Math.hypot(y0, y1, y2);\n\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a matrix that makes something look at something else.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {ReadonlyVec3} eye Position of the viewer\r\n * @param {ReadonlyVec3} center Point the viewer is looking at\r\n * @param {ReadonlyVec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nexport function targetTo(out, eye, target, up) {\n var eyex = eye[0],\n eyey = eye[1],\n eyez = eye[2],\n upx = up[0],\n upy = up[1],\n upz = up[2];\n var z0 = eyex - target[0],\n z1 = eyey - target[1],\n z2 = eyez - target[2];\n var len = z0 * z0 + z1 * z1 + z2 * z2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n\n var x0 = upy * z2 - upz * z1,\n x1 = upz * z0 - upx * z2,\n x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n}\n/**\r\n * Returns a string representation of a mat4\r\n *\r\n * @param {ReadonlyMat4} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \", \" + a[9] + \", \" + a[10] + \", \" + a[11] + \", \" + a[12] + \", \" + a[13] + \", \" + a[14] + \", \" + a[15] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat4\r\n *\r\n * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);\n}\n/**\r\n * Adds two mat4's\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat4} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n}\n/**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat4} out the receiving vector\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat4} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat4} a The first matrix.\r\n * @param {ReadonlyMat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat4} a The first matrix.\r\n * @param {ReadonlyMat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var a8 = a[8],\n a9 = a[9],\n a10 = a[10],\n a11 = a[11];\n var a12 = a[12],\n a13 = a[13],\n a14 = a[14],\n a15 = a[15];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n var b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n var b8 = b[8],\n b9 = b[9],\n b10 = b[10],\n b11 = b[11];\n var b12 = b[12],\n b13 = b[13],\n b14 = b[14],\n b15 = b[15];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15));\n}\n/**\r\n * Alias for {@link mat4.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat4.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\nimport * as mat3 from \"./mat3.js\";\nimport * as vec3 from \"./vec3.js\";\nimport * as vec4 from \"./vec4.js\";\n/**\r\n * Quaternion\r\n * @module quat\r\n */\n\n/**\r\n * Creates a new identity quat\r\n *\r\n * @returns {quat} a new quaternion\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n out[3] = 1;\n return out;\n}\n/**\r\n * Set a quat to the identity quaternion\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @returns {quat} out\r\n */\n\nexport function identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyVec3} axis the axis around which to rotate\r\n * @param {Number} rad the angle in radians\r\n * @returns {quat} out\r\n **/\n\nexport function setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n var s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n}\n/**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @param {vec3} out_axis Vector receiving the axis of rotation\r\n * @param {ReadonlyQuat} q Quaternion to be decomposed\r\n * @return {Number} Angle, in radians, of the rotation\r\n */\n\nexport function getAxisAngle(out_axis, q) {\n var rad = Math.acos(q[3]) * 2.0;\n var s = Math.sin(rad / 2.0);\n\n if (s > glMatrix.EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n // If s is zero, return any axis (no rotation - axis does not matter)\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n\n return rad;\n}\n/**\r\n * Gets the angular distance between two unit quaternions\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\n\nexport function getAngle(a, b) {\n var dotproduct = dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n}\n/**\r\n * Multiplies two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {quat} out\r\n */\n\nexport function multiply(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the X axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateX(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateY(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var by = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bz = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n}\n/**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate W component of\r\n * @returns {quat} out\r\n */\n\nexport function calculateW(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\n return out;\n}\n/**\r\n * Calculate the exponential of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @returns {quat} out\r\n */\n\nexport function exp(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var et = Math.exp(w);\n var s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n}\n/**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @returns {quat} out\r\n */\n\nexport function ln(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n}\n/**\r\n * Calculate the scalar power of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @param {Number} b amount to scale the quaternion by\r\n * @returns {quat} out\r\n */\n\nexport function pow(out, a, b) {\n ln(out, a);\n scale(out, out, b);\n exp(out, out);\n return out;\n}\n/**\r\n * Performs a spherical linear interpolation between two quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n */\n\nexport function slerp(out, a, b, t) {\n // benchmarks:\n // http://jsperf.com/quaternion-slerp-implementations\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n var omega, cosom, sinom, scale0, scale1; // calc cosine\n\n cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary)\n\n if (cosom < 0.0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n } // calculate coefficients\n\n\n if (1.0 - cosom > glMatrix.EPSILON) {\n // standard case (slerp)\n omega = Math.acos(cosom);\n sinom = Math.sin(omega);\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n // \"from\" and \"to\" quaternions are very close\n // ... so we can do a linear interpolation\n scale0 = 1.0 - t;\n scale1 = t;\n } // calculate final values\n\n\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n}\n/**\r\n * Generates a random unit quaternion\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @returns {quat} out\r\n */\n\nexport function random(out) {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n var u1 = glMatrix.RANDOM();\n var u2 = glMatrix.RANDOM();\n var u3 = glMatrix.RANDOM();\n var sqrt1MinusU1 = Math.sqrt(1 - u1);\n var sqrtU1 = Math.sqrt(u1);\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n}\n/**\r\n * Calculates the inverse of a quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate inverse of\r\n * @returns {quat} out\r\n */\n\nexport function invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\n\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n}\n/**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate conjugate of\r\n * @returns {quat} out\r\n */\n\nexport function conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyMat3} m rotation matrix\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport function fromMat3(out, m) {\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n var fTrace = m[0] + m[4] + m[8];\n var fRoot;\n\n if (fTrace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\n\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot; // 1/(4w)\n\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n // |w| <= 1/2\n var i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n var j = (i + 1) % 3;\n var k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n\n return out;\n}\n/**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {x} Angle to rotate around X axis in degrees.\r\n * @param {y} Angle to rotate around Y axis in degrees.\r\n * @param {z} Angle to rotate around Z axis in degrees.\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport function fromEuler(out, x, y, z) {\n var halfToRad = 0.5 * Math.PI / 180.0;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n var sx = Math.sin(x);\n var cx = Math.cos(x);\n var sy = Math.sin(y);\n var cy = Math.cos(y);\n var sz = Math.sin(z);\n var cz = Math.cos(z);\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n return out;\n}\n/**\r\n * Returns a string representation of a quatenion\r\n *\r\n * @param {ReadonlyQuat} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"quat(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n *\r\n * @param {ReadonlyQuat} a quaternion to clone\r\n * @returns {quat} a new quaternion\r\n * @function\r\n */\n\nexport var clone = vec4.clone;\n/**\r\n * Creates a new quat initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {quat} a new quaternion\r\n * @function\r\n */\n\nexport var fromValues = vec4.fromValues;\n/**\r\n * Copy the values from one quat to another\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the source quaternion\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var copy = vec4.copy;\n/**\r\n * Set the components of a quat to the given values\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var set = vec4.set;\n/**\r\n * Adds two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var add = vec4.add;\n/**\r\n * Alias for {@link quat.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Scales a quat by a scalar number\r\n *\r\n * @param {quat} out the receiving vector\r\n * @param {ReadonlyQuat} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var scale = vec4.scale;\n/**\r\n * Calculates the dot product of two quat's\r\n *\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {Number} dot product of a and b\r\n * @function\r\n */\n\nexport var dot = vec4.dot;\n/**\r\n * Performs a linear interpolation between two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var lerp = vec4.lerp;\n/**\r\n * Calculates the length of a quat\r\n *\r\n * @param {ReadonlyQuat} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport var length = vec4.length;\n/**\r\n * Alias for {@link quat.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Calculates the squared length of a quat\r\n *\r\n * @param {ReadonlyQuat} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n * @function\r\n */\n\nexport var squaredLength = vec4.squaredLength;\n/**\r\n * Alias for {@link quat.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Normalize a quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quaternion to normalize\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var normalize = vec4.normalize;\n/**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyQuat} a The first quaternion.\r\n * @param {ReadonlyQuat} b The second quaternion.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport var exactEquals = vec4.exactEquals;\n/**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyQuat} a The first vector.\r\n * @param {ReadonlyQuat} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport var equals = vec4.equals;\n/**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n *\r\n * @param {quat} out the receiving quaternion.\r\n * @param {ReadonlyVec3} a the initial vector\r\n * @param {ReadonlyVec3} b the destination vector\r\n * @returns {quat} out\r\n */\n\nexport var rotationTo = function () {\n var tmpvec3 = vec3.create();\n var xUnitVec3 = vec3.fromValues(1, 0, 0);\n var yUnitVec3 = vec3.fromValues(0, 1, 0);\n return function (out, a, b) {\n var dot = vec3.dot(a, b);\n\n if (dot < -0.999999) {\n vec3.cross(tmpvec3, xUnitVec3, a);\n if (vec3.len(tmpvec3) < 0.000001) vec3.cross(tmpvec3, yUnitVec3, a);\n vec3.normalize(tmpvec3, tmpvec3);\n setAxisAngle(out, tmpvec3, Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n vec3.cross(tmpvec3, a, b);\n out[0] = tmpvec3[0];\n out[1] = tmpvec3[1];\n out[2] = tmpvec3[2];\n out[3] = 1 + dot;\n return normalize(out, out);\n }\n };\n}();\n/**\r\n * Performs a spherical linear interpolation with two control points\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {ReadonlyQuat} c the third operand\r\n * @param {ReadonlyQuat} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n */\n\nexport var sqlerp = function () {\n var temp1 = create();\n var temp2 = create();\n return function (out, a, b, c, d, t) {\n slerp(temp1, a, d, t);\n slerp(temp2, b, c, t);\n slerp(out, temp1, temp2, 2 * t * (1 - t));\n return out;\n };\n}();\n/**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n *\r\n * @param {ReadonlyVec3} view the vector representing the viewing direction\r\n * @param {ReadonlyVec3} right the vector representing the local \"right\" direction\r\n * @param {ReadonlyVec3} up the vector representing the local \"up\" direction\r\n * @returns {quat} out\r\n */\n\nexport var setAxes = function () {\n var matr = mat3.create();\n return function (out, view, right, up) {\n matr[0] = right[0];\n matr[3] = right[1];\n matr[6] = right[2];\n matr[1] = up[0];\n matr[4] = up[1];\n matr[7] = up[2];\n matr[2] = -view[0];\n matr[5] = -view[1];\n matr[8] = -view[2];\n return normalize(out, fromMat3(out, matr));\n };\n}();","import * as glMatrix from \"./common.js\";\n/**\r\n * 4 Dimensional Vector\r\n * @module vec4\r\n */\n\n/**\r\n * Creates a new, empty vec4\r\n *\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec4 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec4} a vector to clone\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Creates a new vec4 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function fromValues(x, y, z, w) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\r\n * Copy the values from one vec4 to another\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the source vector\r\n * @returns {vec4} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set the components of a vec4 to the given values\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} out\r\n */\n\nexport function set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\r\n * Adds two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\r\n * Multiplies two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n}\n/**\r\n * Divides two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to ceil\r\n * @returns {vec4} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to floor\r\n * @returns {vec4} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n}\n/**\r\n * Math.round the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to round\r\n * @returns {vec4} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n}\n/**\r\n * Scales a vec4 by a scalar number\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec4} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\r\n * Adds two vec4's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec4} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Calculates the length of a vec4\r\n *\r\n * @param {ReadonlyVec4} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\r\n * Calculates the squared length of a vec4\r\n *\r\n * @param {ReadonlyVec4} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Negates the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to negate\r\n * @returns {vec4} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to invert\r\n * @returns {vec4} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n out[3] = 1.0 / a[3];\n return out;\n}\n/**\r\n * Normalize a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to normalize\r\n * @returns {vec4} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n var len = x * x + y * y + z * z + w * w;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n}\n/**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n *\r\n * @param {ReadonlyVec4} result the receiving vector\r\n * @param {ReadonlyVec4} U the first vector\r\n * @param {ReadonlyVec4} V the second vector\r\n * @param {ReadonlyVec4} W the third vector\r\n * @returns {vec4} result\r\n */\n\nexport function cross(out, u, v, w) {\n var A = v[0] * w[1] - v[1] * w[0],\n B = v[0] * w[2] - v[2] * w[0],\n C = v[0] * w[3] - v[3] * w[0],\n D = v[1] * w[2] - v[2] * w[1],\n E = v[1] * w[3] - v[3] * w[1],\n F = v[2] * w[3] - v[3] * w[2];\n var G = u[0];\n var H = u[1];\n var I = u[2];\n var J = u[3];\n out[0] = H * F - I * E + J * D;\n out[1] = -(G * F) + I * C - J * B;\n out[2] = G * E - H * C + J * A;\n out[3] = -(G * D) + H * B - I * A;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec4} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n var aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec4} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n\n var v1, v2, v3, v4;\n var s1, s2;\n\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n\n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n}\n/**\r\n * Transforms the vec4 with a mat4.\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec4} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n}\n/**\r\n * Transforms the vec4 with a quat\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to transform\r\n * @param {ReadonlyQuat} q quaternion to transform with\r\n * @returns {vec4} out\r\n */\n\nexport function transformQuat(out, a, q) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3]; // calculate quat * vec\n\n var ix = qw * x + qy * z - qz * y;\n var iy = qw * y + qz * x - qx * z;\n var iz = qw * z + qx * y - qy * x;\n var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set the components of a vec4 to zero\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @returns {vec4} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec4} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec4} a The first vector.\r\n * @param {ReadonlyVec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec4} a The first vector.\r\n * @param {ReadonlyVec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\r\n * Alias for {@link vec4.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec4.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec4.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec4.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec4.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec4.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec4.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec4s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 4;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n vec[3] = a[i + 3];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n a[i + 3] = vec[3];\n }\n\n return a;\n };\n}();","import * as glMatrix from \"./common.js\";\n/**\r\n * 3 Dimensional Vector\r\n * @module vec3\r\n */\n\n/**\r\n * Creates a new, empty vec3\r\n *\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(3);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec3} a vector to clone\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\r\n * Calculates the length of a vec3\r\n *\r\n * @param {ReadonlyVec3} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return Math.hypot(x, y, z);\n}\n/**\r\n * Creates a new vec3 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function fromValues(x, y, z) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\r\n * Copy the values from one vec3 to another\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the source vector\r\n * @returns {vec3} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\r\n * Set the components of a vec3 to the given values\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} out\r\n */\n\nexport function set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\r\n * Adds two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n}\n/**\r\n * Multiplies two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n}\n/**\r\n * Divides two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to ceil\r\n * @returns {vec3} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to floor\r\n * @returns {vec3} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n}\n/**\r\n * Math.round the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to round\r\n * @returns {vec3} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n return out;\n}\n/**\r\n * Scales a vec3 by a scalar number\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec3} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n return out;\n}\n/**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec3} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return Math.hypot(x, y, z);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return x * x + y * y + z * z;\n}\n/**\r\n * Calculates the squared length of a vec3\r\n *\r\n * @param {ReadonlyVec3} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return x * x + y * y + z * z;\n}\n/**\r\n * Negates the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to negate\r\n * @returns {vec3} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to invert\r\n * @returns {vec3} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n return out;\n}\n/**\r\n * Normalize a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to normalize\r\n * @returns {vec3} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var len = x * x + y * y + z * z;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n/**\r\n * Computes the cross product of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function cross(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2];\n var bx = b[0],\n by = b[1],\n bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n}\n/**\r\n * Performs a hermite interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {ReadonlyVec3} c the third operand\r\n * @param {ReadonlyVec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function hermite(out, a, b, c, d, t) {\n var factorTimes2 = t * t;\n var factor1 = factorTimes2 * (2 * t - 3) + 1;\n var factor2 = factorTimes2 * (t - 2) + t;\n var factor3 = factorTimes2 * (t - 1);\n var factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\r\n * Performs a bezier interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {ReadonlyVec3} c the third operand\r\n * @param {ReadonlyVec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function bezier(out, a, b, c, d, t) {\n var inverseFactor = 1 - t;\n var inverseFactorTimesTwo = inverseFactor * inverseFactor;\n var factorTimes2 = t * t;\n var factor1 = inverseFactorTimesTwo * inverseFactor;\n var factor2 = 3 * t * inverseFactorTimesTwo;\n var factor3 = 3 * factorTimes2 * inverseFactor;\n var factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec3} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n var z = glMatrix.RANDOM() * 2.0 - 1.0;\n var zScale = Math.sqrt(1.0 - z * z) * scale;\n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n}\n/**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n/**\r\n * Transforms the vec3 with a mat3.\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyMat3} m the 3x3 matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformMat3(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n}\n/**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyQuat} q quaternion to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformQuat(out, a, q) {\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3];\n var x = a[0],\n y = a[1],\n z = a[2]; // var qvec = [qx, qy, qz];\n // var uv = vec3.cross([], qvec, a);\n\n var uvx = qy * z - qz * y,\n uvy = qz * x - qx * z,\n uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv);\n\n var uuvx = qy * uvz - qz * uvy,\n uuvy = qz * uvx - qx * uvz,\n uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w);\n\n var w2 = qw * 2;\n uvx *= w2;\n uvy *= w2;\n uvz *= w2; // vec3.scale(uuv, uuv, 2);\n\n uuvx *= 2;\n uuvy *= 2;\n uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv));\n\n out[0] = x + uvx + uuvx;\n out[1] = y + uvy + uuvy;\n out[2] = z + uvz + uuvz;\n return out;\n}\n/**\r\n * Rotate a 3D vector around the x-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateX(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Rotate a 3D vector around the y-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateY(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Rotate a 3D vector around the z-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateZ(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2]; //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Get the angle between two 3D vectors\r\n * @param {ReadonlyVec3} a The first operand\r\n * @param {ReadonlyVec3} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nexport function angle(a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n bx = b[0],\n by = b[1],\n bz = b[2],\n mag1 = Math.sqrt(ax * ax + ay * ay + az * az),\n mag2 = Math.sqrt(bx * bx + by * by + bz * bz),\n mag = mag1 * mag2,\n cosine = mag && dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\r\n * Set the components of a vec3 to zero\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @returns {vec3} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec3} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \")\";\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec3} a The first vector.\r\n * @param {ReadonlyVec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec3} a The first vector.\r\n * @param {ReadonlyVec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2));\n}\n/**\r\n * Alias for {@link vec3.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec3.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec3.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec3.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec3.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec3.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec3.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec3s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 3;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n }\n\n return a;\n };\n}();","import * as glMatrix from \"./common.js\";\nimport * as quat from \"./quat.js\";\nimport * as mat4 from \"./mat4.js\";\n/**\r\n * Dual Quaternion
\r\n * Format: [real, dual]
\r\n * Quaternion format: XYZW
\r\n * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
\r\n * @module quat2\r\n */\n\n/**\r\n * Creates a new identity dual quat\r\n *\r\n * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation]\r\n */\n\nexport function create() {\n var dq = new glMatrix.ARRAY_TYPE(8);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n dq[0] = 0;\n dq[1] = 0;\n dq[2] = 0;\n dq[4] = 0;\n dq[5] = 0;\n dq[6] = 0;\n dq[7] = 0;\n }\n\n dq[3] = 1;\n return dq;\n}\n/**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n *\r\n * @param {ReadonlyQuat2} a dual quaternion to clone\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function clone(a) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = a[0];\n dq[1] = a[1];\n dq[2] = a[2];\n dq[3] = a[3];\n dq[4] = a[4];\n dq[5] = a[5];\n dq[6] = a[6];\n dq[7] = a[7];\n return dq;\n}\n/**\r\n * Creates a new dual quat initialized with the given values\r\n *\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component\r\n * @param {Number} y2 Y component\r\n * @param {Number} z2 Z component\r\n * @param {Number} w2 W component\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n dq[4] = x2;\n dq[5] = y2;\n dq[6] = z2;\n dq[7] = w2;\n return dq;\n}\n/**\r\n * Creates a new dual quat from the given values (quat and translation)\r\n *\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component (translation)\r\n * @param {Number} y2 Y component (translation)\r\n * @param {Number} z2 Z component (translation)\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n var ax = x2 * 0.5,\n ay = y2 * 0.5,\n az = z2 * 0.5;\n dq[4] = ax * w1 + ay * z1 - az * y1;\n dq[5] = ay * w1 + az * x1 - ax * z1;\n dq[6] = az * w1 + ax * y1 - ay * x1;\n dq[7] = -ax * x1 - ay * y1 - az * z1;\n return dq;\n}\n/**\r\n * Creates a dual quat from a quaternion and a translation\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyQuat} q a normalized quaternion\r\n * @param {ReadonlyVec3} t tranlation vector\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromRotationTranslation(out, q, t) {\n var ax = t[0] * 0.5,\n ay = t[1] * 0.5,\n az = t[2] * 0.5,\n bx = q[0],\n by = q[1],\n bz = q[2],\n bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Creates a dual quat from a translation\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyVec3} t translation vector\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n}\n/**\r\n * Creates a dual quat from a quaternion\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyQuat} q the quaternion\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\r\n * Creates a new dual quat from a matrix (4x4)\r\n *\r\n * @param {quat2} out the dual quaternion\r\n * @param {ReadonlyMat4} a the matrix\r\n * @returns {quat2} dual quat receiving operation result\r\n * @function\r\n */\n\nexport function fromMat4(out, a) {\n //TODO Optimize this\n var outer = quat.create();\n mat4.getRotation(outer, a);\n var t = new glMatrix.ARRAY_TYPE(3);\n mat4.getTranslation(t, a);\n fromRotationTranslation(out, outer, t);\n return out;\n}\n/**\r\n * Copy the values from one dual quat to another\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the source dual quaternion\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n}\n/**\r\n * Set a dual quat to the identity dual quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @returns {quat2} out\r\n */\n\nexport function identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\r\n * Set the components of a dual quat to the given values\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component\r\n * @param {Number} y2 Y component\r\n * @param {Number} z2 Z component\r\n * @param {Number} w2 W component\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n}\n/**\r\n * Gets the real part of a dual quat\r\n * @param {quat} out real part\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @return {quat} real part\r\n */\n\nexport var getReal = quat.copy;\n/**\r\n * Gets the dual part of a dual quat\r\n * @param {quat} out dual part\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @return {quat} dual part\r\n */\n\nexport function getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n}\n/**\r\n * Set the real component of a dual quat to the given quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat} q a quaternion representing the real part\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport var setReal = quat.copy;\n/**\r\n * Set the dual component of a dual quat to the given quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat} q a quaternion representing the dual part\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function setDual(out, q) {\n out[4] = q[0];\n out[5] = q[1];\n out[6] = q[2];\n out[7] = q[3];\n return out;\n}\n/**\r\n * Gets the translation of a normalized dual quat\r\n * @param {vec3} out translation\r\n * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed\r\n * @return {vec3} translation\r\n */\n\nexport function getTranslation(out, a) {\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n}\n/**\r\n * Translates a dual quat by the given vector\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to translate\r\n * @param {ReadonlyVec3} v vector to translate by\r\n * @returns {quat2} out\r\n */\n\nexport function translate(out, a, v) {\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3],\n bx1 = v[0] * 0.5,\n by1 = v[1] * 0.5,\n bz1 = v[2] * 0.5,\n ax2 = a[4],\n ay2 = a[5],\n az2 = a[6],\n aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n}\n/**\r\n * Rotates a dual quat around the X axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateX(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around the Y axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateY(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around the Z axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat by a given quaternion (a * q)\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {ReadonlyQuat} q quaternion to rotate by\r\n * @returns {quat2} out\r\n */\n\nexport function rotateByQuatAppend(out, a, q) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n}\n/**\r\n * Rotates a dual quat by a given quaternion (q * a)\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat} q quaternion to rotate by\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @returns {quat2} out\r\n */\n\nexport function rotateByQuatPrepend(out, q, a) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n bx = a[0],\n by = a[1],\n bz = a[2],\n bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around a given axis. Does the normalisation automatically\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @param {Number} rad how far the rotation should be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateAroundAxis(out, a, axis, rad) {\n //Special case for rad = 0\n if (Math.abs(rad) < glMatrix.EPSILON) {\n return copy(out, a);\n }\n\n var axisLength = Math.hypot(axis[0], axis[1], axis[2]);\n rad = rad * 0.5;\n var s = Math.sin(rad);\n var bx = s * axis[0] / axisLength;\n var by = s * axis[1] / axisLength;\n var bz = s * axis[2] / axisLength;\n var bw = Math.cos(rad);\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Adds two dual quat's\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n}\n/**\r\n * Multiplies two dual quat's\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {quat2} out\r\n */\n\nexport function multiply(out, a, b) {\n var ax0 = a[0],\n ay0 = a[1],\n az0 = a[2],\n aw0 = a[3],\n bx1 = b[4],\n by1 = b[5],\n bz1 = b[6],\n bw1 = b[7],\n ax1 = a[4],\n ay1 = a[5],\n az1 = a[6],\n aw1 = a[7],\n bx0 = b[0],\n by0 = b[1],\n bz0 = b[2],\n bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n}\n/**\r\n * Alias for {@link quat2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Scales a dual quat by a scalar number\r\n *\r\n * @param {quat2} out the receiving dual quat\r\n * @param {ReadonlyQuat2} a the dual quat to scale\r\n * @param {Number} b amount to scale the dual quat by\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n}\n/**\r\n * Calculates the dot product of two dual quat's (The dot product of the real parts)\r\n *\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {Number} dot product of a and b\r\n * @function\r\n */\n\nexport var dot = quat.dot;\n/**\r\n * Performs a linear interpolation between two dual quats's\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5)\r\n *\r\n * @param {quat2} out the receiving dual quat\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat2} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var mt = 1 - t;\n if (dot(a, b) < 0) t = -t;\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n}\n/**\r\n * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a dual quat to calculate inverse of\r\n * @returns {quat2} out\r\n */\n\nexport function invert(out, a) {\n var sqlen = squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n}\n/**\r\n * Calculates the conjugate of a dual quat\r\n * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result.\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat2} a quat to calculate conjugate of\r\n * @returns {quat2} out\r\n */\n\nexport function conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n}\n/**\r\n * Calculates the length of a dual quat\r\n *\r\n * @param {ReadonlyQuat2} a dual quat to calculate length of\r\n * @returns {Number} length of a\r\n * @function\r\n */\n\nexport var length = quat.length;\n/**\r\n * Alias for {@link quat2.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Calculates the squared length of a dual quat\r\n *\r\n * @param {ReadonlyQuat2} a dual quat to calculate squared length of\r\n * @returns {Number} squared length of a\r\n * @function\r\n */\n\nexport var squaredLength = quat.squaredLength;\n/**\r\n * Alias for {@link quat2.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Normalize a dual quat\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a dual quaternion to normalize\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function normalize(out, a) {\n var magnitude = squaredLength(a);\n\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n var a0 = a[0] / magnitude;\n var a1 = a[1] / magnitude;\n var a2 = a[2] / magnitude;\n var a3 = a[3] / magnitude;\n var b0 = a[4];\n var b1 = a[5];\n var b2 = a[6];\n var b3 = a[7];\n var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n\n return out;\n}\n/**\r\n * Returns a string representation of a dual quatenion\r\n *\r\n * @param {ReadonlyQuat2} a dual quaternion to represent as a string\r\n * @returns {String} string representation of the dual quat\r\n */\n\nexport function str(a) {\n return \"quat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \")\";\n}\n/**\r\n * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyQuat2} a the first dual quaternion.\r\n * @param {ReadonlyQuat2} b the second dual quaternion.\r\n * @returns {Boolean} true if the dual quaternions are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7];\n}\n/**\r\n * Returns whether or not the dual quaternions have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyQuat2} a the first dual quat.\r\n * @param {ReadonlyQuat2} b the second dual quat.\r\n * @returns {Boolean} true if the dual quats are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7));\n}","import * as glMatrix from \"./common.js\";\n/**\r\n * 2 Dimensional Vector\r\n * @module vec2\r\n */\n\n/**\r\n * Creates a new, empty vec2\r\n *\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(2);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec2 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec2} a vector to clone\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\r\n * Creates a new vec2 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function fromValues(x, y) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\r\n * Copy the values from one vec2 to another\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the source vector\r\n * @returns {vec2} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\r\n * Set the components of a vec2 to the given values\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} out\r\n */\n\nexport function set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\r\n * Adds two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n}\n/**\r\n * Multiplies two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n}\n/**\r\n * Divides two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to ceil\r\n * @returns {vec2} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to floor\r\n * @returns {vec2} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n}\n/**\r\n * Math.round the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to round\r\n * @returns {vec2} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n}\n/**\r\n * Scales a vec2 by a scalar number\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec2} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n}\n/**\r\n * Adds two vec2's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec2} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return Math.hypot(x, y);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return x * x + y * y;\n}\n/**\r\n * Calculates the length of a vec2\r\n *\r\n * @param {ReadonlyVec2} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0],\n y = a[1];\n return Math.hypot(x, y);\n}\n/**\r\n * Calculates the squared length of a vec2\r\n *\r\n * @param {ReadonlyVec2} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0],\n y = a[1];\n return x * x + y * y;\n}\n/**\r\n * Negates the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to negate\r\n * @returns {vec2} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to invert\r\n * @returns {vec2} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n return out;\n}\n/**\r\n * Normalize a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to normalize\r\n * @returns {vec2} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0],\n y = a[1];\n var len = x * x + y * y;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n}\n/**\r\n * Computes the cross product of two vec2's\r\n * Note that the cross product must by definition produce a 3D vector\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function cross(out, a, b) {\n var z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec2} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0],\n ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec2} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n out[0] = Math.cos(r) * scale;\n out[1] = Math.sin(r) * scale;\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat2} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat2(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat2d\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat2d} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat2d(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat3\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat3} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat3(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat4\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0];\n var y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n}\n/**\r\n * Rotate a 2D vector\r\n * @param {vec2} out The receiving vec2\r\n * @param {ReadonlyVec2} a The vec2 point to rotate\r\n * @param {ReadonlyVec2} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec2} out\r\n */\n\nexport function rotate(out, a, b, rad) {\n //Translate point to the origin\n var p0 = a[0] - b[0],\n p1 = a[1] - b[1],\n sinC = Math.sin(rad),\n cosC = Math.cos(rad); //perform rotation and translate to correct position\n\n out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n}\n/**\r\n * Get the angle between two 2D vectors\r\n * @param {ReadonlyVec2} a The first operand\r\n * @param {ReadonlyVec2} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nexport function angle(a, b) {\n var x1 = a[0],\n y1 = a[1],\n x2 = b[0],\n y2 = b[1],\n // mag is the product of the magnitudes of a and b\n mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2),\n // mag &&.. short circuits if mag == 0\n cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\n\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\r\n * Set the components of a vec2 to zero\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @returns {vec2} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec2} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec2(\" + a[0] + \", \" + a[1] + \")\";\n}\n/**\r\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec2} a The first vector.\r\n * @param {ReadonlyVec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec2} a The first vector.\r\n * @param {ReadonlyVec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1];\n var b0 = b[0],\n b1 = b[1];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1));\n}\n/**\r\n * Alias for {@link vec2.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec2.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec2.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec2.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec2.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec2.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec2s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 2;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n }\n\n return a;\n };\n}();","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./indexedBuffer\"), exports);\n__exportStar(require(\"./propArguments\"), exports);\n__exportStar(require(\"./repetitions\"), exports);\n__exportStar(require(\"./scene-child\"), exports);\n__exportStar(require(\"./scene\"), exports);\n__exportStar(require(\"./shape-base\"), exports);\n__exportStar(require(\"./shape-primitives\"), exports);\n__exportStar(require(\"./shapes\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=indexedBuffer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=propArguments.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ERepetitionType = void 0;\n/**\n * Repetition type enumerator.\n *\n * @category Core.Repetition\n * @internal\n */\nvar ERepetitionType;\n(function (ERepetitionType) {\n /**\n * Defines the type of repetition of the shape,\n * in a circular way starting from the center of the scene\n * @order 1\n */\n ERepetitionType[ERepetitionType[\"Ring\"] = 1] = \"Ring\";\n /**\n * Defines the type of repetition of the shape,\n * on a nxm grid starting from the center of the scene\n * @order 2\n */\n ERepetitionType[ERepetitionType[\"Matrix\"] = 2] = \"Matrix\";\n})(ERepetitionType = exports.ERepetitionType || (exports.ERepetitionType = {}));\n//# sourceMappingURL=repetitions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=scene-child.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=scene.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EBoundingType = void 0;\nvar EBoundingType;\n(function (EBoundingType) {\n /**\n * Relative to the real bounding of the shape\n * @order 2\n */\n EBoundingType[EBoundingType[\"Relative\"] = 1] = \"Relative\";\n /**\n * Fixed to te width and height of the shape\n * @order 3\n */\n EBoundingType[EBoundingType[\"Fixed\"] = 2] = \"Fixed\";\n})(EBoundingType = exports.EBoundingType || (exports.EBoundingType = {}));\n//# sourceMappingURL=shape-base.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//////\n//# sourceMappingURL=shape-primitives.js.map","\"use strict\";\n// Shape\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=shapes.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toVec3 = exports.toVec2 = exports.fromSkew = exports.VEC2_ONE = exports.VEC2_ZERO = exports.VEC3_ONE = exports.VEC3_ZERO = void 0;\nconst gl_matrix_1 = require(\"gl-matrix\");\nexports.VEC3_ZERO = [0, 0, 0];\nexports.VEC3_ONE = [1, 1, 1];\nexports.VEC2_ZERO = [0, 0];\nexports.VEC2_ONE = [1, 1];\ngl_matrix_1.glMatrix.setMatrixArrayType(Array);\n/**\n * Skew matrix\n *\n * @internal\n * @ignore\n */\nfunction fromSkew(out, skew) {\n out[0] = 1;\n out[1] = Math.tan(skew[1]);\n out[2] = 0;\n out[3] = 0;\n out[4] = Math.tan(skew[0]);\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\nexports.fromSkew = fromSkew;\n/**\n * number to vec 2\n *\n * @internal\n * @ignore\n */\nfunction toVec2(x) {\n if (Array.isArray(x))\n return [x[0], x[1]];\n return [x, x];\n}\nexports.toVec2 = toVec2;\n/**\n * number to vec 3\n *\n * @internal\n * @ignore\n */\nfunction toVec3(x, defaultZValue = 0) {\n if (Array.isArray(x)) {\n return [x[0], x[1], defaultZValue];\n }\n return [x, x, defaultZValue];\n}\nexports.toVec3 = toVec3;\n//# sourceMappingURL=gl-matrix-extensions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Temporany matrix\n *\n * @internal\n * @ignore\n */\nconst MATRIX = new Array(4);\n/**\n * Vec2 operation\n *\n * @category Core.Utilities\n */\nconst Vec2 = {\n /**\n * from new vertex\n *\n * @param {Array | number} [x=0]\n * @param {number} [y]\n * @returns {Array}\n */\n from: (x = 0, y) => {\n const out = new Array(2);\n if (typeof x === 'number') {\n out[0] = x;\n out[1] = y !== null && y !== void 0 ? y : x;\n }\n else {\n out[0] = x[0];\n out[1] = x[1];\n }\n return out;\n },\n normalize: (v) => {\n const len = Vec2.length(v);\n return len !== 0 ? [v[0] / len, v[1] / len] : [0, 0];\n },\n /**\n * Distance between two points\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n distance: (a, b) => Math.hypot(a[0] - b[0], a[1] - b[1]),\n /**\n * dot product\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n dot: (a, b) => a[0] * b[0] + a[1] * b[1],\n /**\n * length of point\n *\n * @param {Array} vec\n * @returns {number}\n */\n length: (vec) => Math.hypot(vec[0], vec[1]),\n /**\n * angle between two point\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n angle: (a, b) => {\n a = Vec2.normalize(a);\n b = Vec2.normalize(b);\n return Math.acos(Vec2.dot(a, b));\n },\n /**\n * skewX point\n *\n * @param {Array} vec\n * @param {number} m\n */\n skewX: (vec, m) => {\n vec[0] += Math.tan(m) * vec[1];\n },\n /**\n * skewY point\n *\n * @param {Array} vec\n * @param {number} m\n */\n skewY: (vec, m) => {\n vec[1] += Math.tan(m) * vec[0];\n },\n /**\n * squeezeX point\n *\n * @param {Array} vec\n * @param {number} m\n */\n squeezeX: (vec, m) => {\n vec[1] += vec[1] * (vec[0] * -m);\n },\n /**\n * squeezeY point\n *\n * @param {Array} vec\n * @param {number} m\n */\n squeezeY: (vec, m) => {\n vec[0] += vec[0] * (vec[1] * m);\n },\n /**\n * Rotate point\n *\n * @param {Array} vec\n * @param {Array} MATRIX\n * @param {Array} fromPoint\n * @internal\n */\n rotate: (vec, MATRIX, fromPoint) => {\n const p0 = vec[0] - fromPoint[0];\n const p1 = vec[1] - fromPoint[1];\n vec[0] = p0 * MATRIX[0] + p1 * MATRIX[1] + fromPoint[0];\n vec[1] = p0 * MATRIX[2] + p1 * MATRIX[3] + fromPoint[1];\n },\n /**\n * RotateX point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateX: (vec, fromPoint, rad) => {\n MATRIX[0] = 1;\n MATRIX[1] = 0;\n MATRIX[2] = 0;\n MATRIX[3] = Math.cos(rad);\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * RotateY point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateY: (vec, fromPoint, rad) => {\n MATRIX[0] = Math.cos(rad);\n MATRIX[1] = 0;\n MATRIX[2] = 0;\n MATRIX[3] = 1;\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * RotateZ point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateZ: (vec, fromPoint, rad) => {\n MATRIX[0] = Math.cos(rad);\n MATRIX[1] = -Math.sin(rad);\n MATRIX[2] = Math.sin(rad);\n MATRIX[3] = Math.cos(rad);\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * Translate vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n translate: (vec, to) => {\n vec[0] += to[0];\n vec[1] += to[1];\n },\n /**\n * Scale vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n scale: (vec, to) => {\n vec[0] *= to[0];\n vec[1] *= to[1];\n },\n /**\n * Scale vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n divide: (vec, to) => {\n vec[0] /= to[0];\n vec[1] /= to[1];\n },\n /**\n * Vec to string\n *\n * @param {Array} vec\n * @return {string}\n */\n toString: (vec) => `x: ${vec[0]}, y: ${vec[1]}`,\n /**\n * Vertex [0, 0]\n */\n ZERO: Array.from([0, 0]),\n /**\n * Vertex [1, 1]\n */\n ONE: Array.from([1, 1]),\n};\nexports.default = Vec2;\n//# sourceMappingURL=Vec2.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mod = exports.PHI = exports.PI2 = exports.log = void 0;\n/**\n * Return logarith value and base\n *\n * @category Core.Utilities\n *\n * @param n number\n * @param base number\n */\nconst log = (n, base) => Math.log(n) / Math.log(base);\nexports.log = log;\n/**\n * @category Core.Utilities\n */\nexports.PI2 = Math.PI * 2;\n/**\n * @category Core.Utilities\n */\nexports.PHI = (1 + Math.sqrt(5)) / 2;\n/**\n * Return a positive module of positive or negative value\n *\n * @category Core.Utilities\n *\n * @param value number\n * @param base number\n */\nconst mod = (value, base) => {\n const result = value % base;\n return result < 0 ? result + base : result;\n};\nexports.mod = mod;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Adapt = exports.Bounding = exports.EAdaptMode = void 0;\nconst Modifier_1 = require(\"./Modifier\");\n/**\n *\n *\n * @category Core.Enums\n */\nvar EAdaptMode;\n(function (EAdaptMode) {\n /**\n * The buffer is not changed\n * @order 1\n */\n EAdaptMode[EAdaptMode[\"None\"] = 0] = \"None\";\n /**\n * The buffer is scaled in a range between [-1, -1] and [1,1]\n * @order 2\n */\n EAdaptMode[EAdaptMode[\"Scale\"] = 2] = \"Scale\";\n /**\n * The buffer is scaled in a range between [-1, -1] and [1,1] and is centered\n * @order 3\n */\n EAdaptMode[EAdaptMode[\"Center\"] = 4] = \"Center\";\n /**\n * The buffer is adapted centrally and expanded in a range between [-1, -1] and [1,1]\n * @order 4\n */\n EAdaptMode[EAdaptMode[\"Fill\"] = 8] = \"Fill\";\n})(EAdaptMode = exports.EAdaptMode || (exports.EAdaptMode = {}));\n/**\n * @internal\n * @ignore\n */\nexports.Bounding = {\n empty: () => ({\n cx: 0,\n cy: 0,\n x: -1,\n y: -1,\n width: 2,\n height: 2,\n }),\n clear: (tmpBounding) => {\n tmpBounding[0] = undefined;\n tmpBounding[1] = undefined;\n tmpBounding[2] = undefined;\n tmpBounding[3] = undefined;\n },\n add: (tmpBounding, x, y) => {\n if (typeof tmpBounding[0] === 'undefined' || x < tmpBounding[0])\n tmpBounding[0] = x;\n if (typeof tmpBounding[2] === 'undefined' || x > tmpBounding[2])\n tmpBounding[2] = x;\n if (typeof tmpBounding[1] === 'undefined' || y < tmpBounding[1])\n tmpBounding[1] = y;\n if (typeof tmpBounding[3] === 'undefined' || y > tmpBounding[3])\n tmpBounding[3] = y;\n },\n sum: (dest, bounding) => {\n if (typeof bounding[0] !== 'undefined' &&\n typeof bounding[1] !== 'undefined' &&\n typeof bounding[2] !== 'undefined' &&\n typeof bounding[3] !== 'undefined') {\n if (typeof dest[0] === 'undefined' ||\n typeof dest[1] === 'undefined' ||\n typeof dest[2] === 'undefined' ||\n typeof dest[3] === 'undefined') {\n dest[0] = bounding[0];\n dest[1] = bounding[1];\n dest[2] = bounding[2];\n dest[3] = bounding[3];\n }\n else {\n if (dest[0] < bounding[0])\n dest[0] = bounding[0];\n if (dest[2] > bounding[2])\n dest[2] = bounding[2];\n if (dest[1] < bounding[1])\n dest[1] = bounding[1];\n if (dest[3] > bounding[3])\n dest[3] = bounding[3];\n }\n }\n else {\n console.warn('[Urplfanze:Bounding] cannot sum bounding');\n }\n },\n bind: (bounding, tmpBounding) => {\n if (typeof tmpBounding[0] !== 'undefined' &&\n typeof tmpBounding[1] !== 'undefined' &&\n typeof tmpBounding[2] !== 'undefined' &&\n typeof tmpBounding[3] !== 'undefined') {\n bounding.x = tmpBounding[0];\n bounding.y = tmpBounding[1];\n bounding.width = tmpBounding[2] - tmpBounding[0];\n bounding.height = tmpBounding[3] - tmpBounding[1];\n bounding.cx = bounding.x + bounding.width / 2;\n bounding.cy = bounding.y + bounding.height / 2;\n }\n else {\n console.warn('[Urplfanze:Bounding] cannot bind bounding');\n }\n },\n};\nclass Adapt extends Modifier_1.Modifier {\n constructor(args) {\n super();\n this.mode = args.mode || EAdaptMode.Fill;\n this.rect = args.rect;\n }\n apply(buffer, bClosed) {\n return Adapt.adapt(buffer, this.mode, this.rect);\n }\n /**\n * Return adapted buffer between [-1,-1] and [1,1]\n *\n * @public\n * @static\n * @param {Float32Array} input\n * @param {EAdaptMode} mode\n * @returns {Float32Array}\n * @memberof ShapeBuffer\n */\n static adapt(input, mode, rect) {\n if (mode === EAdaptMode.None)\n return Float32Array.from(input);\n const output = new Float32Array(input.length);\n if (!rect) {\n rect = Adapt.getBounding(input);\n }\n const scale = rect.width >= 2 || rect.height >= 2 || (mode >= EAdaptMode.Fill && (rect.width < 2 || rect.height < 2))\n ? 2 / Math.max(rect.width, rect.height)\n : 1;\n const translateX = mode >= EAdaptMode.Center ? rect.cx : 0;\n const translateY = mode >= EAdaptMode.Center ? rect.cy : 0;\n for (let i = 0, len = input.length; i < len; i += 2) {\n output[i] = (input[i] - translateX) * scale;\n output[i + 1] = (input[i + 1] - translateY) * scale;\n }\n return output;\n }\n /**\n * Get buffer bounding\n *\n * @static\n * @param {Float32Array | Array} buffer\n * @returns {IShapeBounding}\n * @memberof ShapePrimitive\n */\n static getBounding(buffer, bounding) {\n if (typeof bounding === 'undefined')\n bounding = exports.Bounding.empty();\n const tmp_bounding = [undefined, undefined, undefined, undefined];\n for (let i = 0, len = buffer.length; i < len; i += 2) {\n exports.Bounding.add(tmp_bounding, buffer[i], buffer[i + 1]);\n }\n exports.Bounding.bind(bounding, tmp_bounding);\n return bounding;\n }\n}\nexports.Adapt = Adapt;\nAdapt.MODES = EAdaptMode;\n//# sourceMappingURL=Adapt.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Modifier = void 0;\nclass Modifier {\n}\nexports.Modifier = Modifier;\n//# sourceMappingURL=Modifier.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.distributePointsInBuffer = exports.interpolate = exports.prepareBufferForInterpolation = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.relativeClamp = exports.clamp = exports.lerp = exports.toRadians = exports.toDegrees = exports.now = void 0;\nconst SimplexNoise = require(\"simplex-noise\");\nconst repetitions_1 = require(\"./types/repetitions\");\nconst Vec2_1 = require(\"./math/Vec2\");\n// isDef: (object: any): boolean => typeof object !== 'undefined' && object !== null,\nconst measurement = typeof performance !== 'undefined' ? performance : Date;\n/**\n * Get current timestamp in milliseconds\n *\n * @category Utilities\n * @returns {number}\n */\nfunction now() {\n return measurement.now();\n}\nexports.now = now;\n// aOr: (...args: Array): any => {\n// \tfor (let i = 0; i < args.length; i++) if (Utilities.isDef(args[i])) return args[i]\n// },\n/**\n * Convert number from radians to degrees\n *\n * @category Utilities\n *\n * @example\n * ```javascript\n * Urpflanze.toDegrees(Math.PI) // 180\n * ```\n *\n * @param {number} radians\n * @returns {number}\n */\nfunction toDegrees(radians) {\n return (radians * 180) / Math.PI;\n}\nexports.toDegrees = toDegrees;\n/**\n * Convert angle from degrees to radians\n * @example\n * ```javascript\n * Urpflanze.toRadians(180) // 3.141592653589793\n * ```\n *\n * @category Utilities\n * @param {number} degrees\n * @returns {number}\n */\nfunction toRadians(degrees) {\n return (degrees * Math.PI) / 180;\n}\nexports.toRadians = toRadians;\n// perf: (name: string, callback: any, log: boolean = false): number => {\n// \tconst t1 = now()\n// \tcallback()\n// \tconst t2 = now()\n// \tlog && console.log('perf ' + name + ': ' + (t2 - t1))\n// \treturn t2 - t1\n// }\n/**\n * Linear interpolation from `a` when `i` as 0 an `b` when `i' as 1\n *\n * @category Utilities\n * @param {number} a\n * @param {number} b\n * @param {number} i\n * @returns {number}\n */\nfunction lerp(a, b, i) {\n return (1 - i) * a + i * b;\n}\nexports.lerp = lerp;\n/**\n * Return number between min and max\n *\n * @category Utilities\n * @example\n * ```javascript\n * Urpflanze.clamp(0, 1, 1.2) // 1\n * Urpflanze.clamp(0, 1, -2) // 0\n * ```\n * @param {number} min\n * @param {number} max\n * @param {number} value\n * @returns {number}\n */\nfunction clamp(min, max, value) {\n return value <= min ? min : value >= max ? max : value;\n}\nexports.clamp = clamp;\n/**\n * Map number between refMin e refMax from min and max\n *\n * @category Utilities\n *\n * @example\n * ```javascript\n * Urpflanze.relativeClamp(0, 1, 0.5, 100, 200) // 150\n * ```\n *\n * @param {number} refMin\n * @param {number} refMax\n * @param {number} value\n * @param {number} toMin\n * @param {number} toMax\n * @returns {number}\n */\nfunction relativeClamp(refMin, refMax, value, toMin, toMax) {\n return clamp(toMin, toMax, ((value - refMin) / (refMax - refMin)) * (toMax - toMin) + toMin);\n}\nexports.relativeClamp = relativeClamp;\n/**\n * @internal\n * @ignore\n */\nconst noises = {\n random: new SimplexNoise(Math.random),\n};\n/**\n * SimplexNoise\n * Use 'random' as seed property for random seed.\n * Return value between -1 and 1\n *\n * @category Utilities\n *\n * @param {string} [seed='random']\n * @param {number} [x=0]\n * @param {number} [y=0]\n * @param {number} [z=0]\n * @returns {number} between -1 and 1\n */\nfunction noise(seed = 'random', x = 0, y = 0, z = 0) {\n if (typeof noises[seed] === 'undefined') {\n noises[seed] = new SimplexNoise(seed);\n }\n return noises[seed].noise3D(x, y, z);\n}\nexports.noise = noise;\n/**\n * Random number generator\n */\nconst randoms = {};\n/**\n * random number generator\n * @param seed\n * @returns\n */\nfunction random(seed, min = 0, max = 1, decimals) {\n const key = seed + '';\n if (typeof randoms[key] === 'undefined') {\n const seed = xmur3(key);\n randoms[key] = sfc32(seed(), seed(), seed(), seed());\n }\n const value = min + randoms[key]() * (max - min);\n return typeof decimals !== 'undefined' ? Math.round(value * 10 ** decimals) / 10 ** decimals : value;\n}\nexports.random = random;\n/**\n *\n * @internal\n * @param str\n * @returns\n */\nfunction xmur3(str) {\n let i = 0, h = 1779033703 ^ str.length;\n for (; i < str.length; i++)\n (h = Math.imul(h ^ str.charCodeAt(i), 3432918353)), (h = (h << 13) | (h >>> 19));\n return function () {\n h = Math.imul(h ^ (h >>> 16), 2246822507);\n h = Math.imul(h ^ (h >>> 13), 3266489909);\n return (h ^= h >>> 16) >>> 0;\n };\n}\n/**\n * @internal\n * @param a\n * @param b\n * @param c\n * @param d\n * @returns\n */\nfunction sfc32(a, b, c, d) {\n return function () {\n a >>>= 0;\n b >>>= 0;\n c >>>= 0;\n d >>>= 0;\n let t = (a + b) | 0;\n a = b ^ (b >>> 9);\n b = (c + (c << 3)) | 0;\n c = (c << 21) | (c >>> 11);\n d = (d + 1) | 0;\n t = (t + d) | 0;\n c = (c + t) | 0;\n return (t >>> 0) / 4294967296;\n };\n}\n/**\n * Return angle (atan) from offset (or center) for matrix repetition.\n * Offset is array between [-1, -1] and [1, 1].\n * The return value is between -Math.PI / 2 and Math.PI / 2\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter\n * @returns {number} between -Math.PI / 2 and Math.PI / 2\n */\nfunction angleFromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [(repetition.col.count - 1) / 2, (repetition.row.count - 1) / 2];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const x = repetition.col.index - 1 - centerMatrix[0];\n const y = repetition.row.index - 1 - centerMatrix[1];\n return x === 0 ? 0 : Math.atan(y / x);\n }\n return (repetition.angle - Math.PI) / 2;\n}\nexports.angleFromRepetition = angleFromRepetition;\n/**\n * Return angle (atan2, 4 quadrants) from offset (or center) for matrix repetition.\n * Offset is array between [-1, -1] and [1, 1].\n * The return value is between -Math.PI an Math.PI\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter\n * @returns {number} between -Math.PI an Math.PI\n */\nfunction angle2FromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [(repetition.col.count - 1) / 2, (repetition.row.count - 1) / 2];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const x = repetition.col.index - 1 - centerMatrix[0];\n const y = repetition.row.index - 1 - centerMatrix[1];\n return x === 0 ? 0 : Math.atan2(y, x);\n }\n return repetition.angle - Math.PI;\n}\nexports.angle2FromRepetition = angle2FromRepetition;\n/**\n * Return distance from offset (or center) for matrix repetition.\n * The return value is between 0 and 1\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter offset relative to distance prop\n * @returns {number} between 0 and 1\n */\nfunction distanceFromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [0.5, 0.5];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const current = [repetition.col.offset, repetition.row.offset];\n return Vec2_1.default.distance(current, centerMatrix);\n }\n return 1;\n}\nexports.distanceFromRepetition = distanceFromRepetition;\n/// Interpolation\n/**\n *\n * @param from\n * @param to\n * @returns\n */\nfunction prepareBufferForInterpolation(from, to) {\n const fromBufferLength = from.length;\n const toBufferLength = to.length;\n if (fromBufferLength === toBufferLength) {\n return [from, to];\n }\n const maxBufferLength = fromBufferLength > toBufferLength ? fromBufferLength : toBufferLength;\n const difference = Math.abs(fromBufferLength - toBufferLength);\n const minBufferLength = maxBufferLength - difference;\n /////\n const b = fromBufferLength < toBufferLength ? to : from;\n const t = fromBufferLength < toBufferLength ? from : to;\n const a = distributePointsInBuffer(t, Math.floor(difference / 2));\n // a[maxBufferLength - 2] = t[minBufferLength - 2]\n // a[maxBufferLength - 1] = t[minBufferLength - 1]\n return fromBufferLength > toBufferLength ? [b, a] : [a, b];\n}\nexports.prepareBufferForInterpolation = prepareBufferForInterpolation;\n/**\n *\n * @param from\n * @param to\n * @param offset\n * @returns\n */\nfunction interpolate(from, to, initialOffset = 0.5) {\n const [a, b] = prepareBufferForInterpolation(from, to);\n const maxBufferLength = Math.max(a.length, b.length);\n const offset = typeof initialOffset === 'number' ? [initialOffset] : initialOffset;\n const maxPoints = maxBufferLength / 2;\n if (offset.length !== maxPoints) {\n const tl = offset.length;\n for (let i = 0; i < maxPoints; i++) {\n offset[i] = offset[i % tl];\n }\n }\n ////\n const result = new Float32Array(maxBufferLength);\n for (let i = 0, off = 0; i < maxBufferLength; i += 2, off++) {\n result[i] = (1 - offset[off]) * a[i] + offset[off] * b[i];\n result[i + 1] = (1 - offset[off]) * a[i + 1] + offset[off] * b[i + 1];\n }\n return result;\n}\nexports.interpolate = interpolate;\nfunction distributePointsInBuffer(buffer, count) {\n const bufferLen = buffer.length;\n const pointsLen = bufferLen / 2;\n const finalBufferLength = (pointsLen + count) * 2;\n const edges = pointsLen - 1;\n if (edges > 1) {\n const lastPoint = bufferLen - 2;\n const newPointsOnEdge = Math.floor(count / edges);\n const bufferWithPointsEveryEdge = bufferLen + newPointsOnEdge * lastPoint;\n let remainingPoints = (finalBufferLength - bufferWithPointsEveryEdge) / 2;\n const edgeRemainingIndex = Math.round(edges / remainingPoints);\n const result = new Float32Array(finalBufferLength);\n for (let i = 0, edgeIndex = 0, r = 0; i < lastPoint; i += 2, edgeIndex++, r += 2) {\n const ax = buffer[i];\n const ay = buffer[i + 1];\n const bx = buffer[i + 2];\n const by = buffer[i + 3];\n result[r] = ax;\n result[r + 1] = ay;\n const addReminingPoints = remainingPoints > 0 && (edgeIndex % edgeRemainingIndex === 0 || i === lastPoint - 2);\n const currentPointsOnEdge = newPointsOnEdge + (addReminingPoints ? 1 : 0);\n const newPointOffset = 1 / (currentPointsOnEdge + 1);\n for (let h = 0; h < currentPointsOnEdge; h++, r += 2) {\n const o = newPointOffset * (h + 1);\n result[r + 2] = (1 - o) * ax + o * bx;\n result[r + 3] = (1 - o) * ay + o * by;\n }\n if (addReminingPoints) {\n remainingPoints--;\n }\n }\n result[finalBufferLength - 2] = buffer[bufferLen - 2];\n result[finalBufferLength - 1] = buffer[bufferLen - 1];\n return result;\n }\n const result = new Float32Array(finalBufferLength);\n for (let i = 0; i < finalBufferLength; i += 2) {\n result[i] = buffer[i % bufferLen];\n result[i + 1] = buffer[(i + 1) % bufferLen];\n }\n return result;\n}\nexports.distributePointsInBuffer = distributePointsInBuffer;\n//# sourceMappingURL=Utilities.js.map","/*\n * A fast javascript implementation of simplex noise by Jonas Wagner\n\nBased on a speed-improved simplex noise algorithm for 2D, 3D and 4D in Java.\nWhich is based on example code by Stefan Gustavson (stegu@itn.liu.se).\nWith Optimisations by Peter Eastman (peastman@drizzle.stanford.edu).\nBetter rank ordering method by Stefan Gustavson in 2012.\n\n\n Copyright (c) 2018 Jonas Wagner\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n(function() {\n 'use strict';\n\n var F2 = 0.5 * (Math.sqrt(3.0) - 1.0);\n var G2 = (3.0 - Math.sqrt(3.0)) / 6.0;\n var F3 = 1.0 / 3.0;\n var G3 = 1.0 / 6.0;\n var F4 = (Math.sqrt(5.0) - 1.0) / 4.0;\n var G4 = (5.0 - Math.sqrt(5.0)) / 20.0;\n\n function SimplexNoise(randomOrSeed) {\n var random;\n if (typeof randomOrSeed == 'function') {\n random = randomOrSeed;\n }\n else if (randomOrSeed) {\n random = alea(randomOrSeed);\n } else {\n random = Math.random;\n }\n this.p = buildPermutationTable(random);\n this.perm = new Uint8Array(512);\n this.permMod12 = new Uint8Array(512);\n for (var i = 0; i < 512; i++) {\n this.perm[i] = this.p[i & 255];\n this.permMod12[i] = this.perm[i] % 12;\n }\n\n }\n SimplexNoise.prototype = {\n grad3: new Float32Array([1, 1, 0,\n -1, 1, 0,\n 1, -1, 0,\n\n -1, -1, 0,\n 1, 0, 1,\n -1, 0, 1,\n\n 1, 0, -1,\n -1, 0, -1,\n 0, 1, 1,\n\n 0, -1, 1,\n 0, 1, -1,\n 0, -1, -1]),\n grad4: new Float32Array([0, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1,\n 0, -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1,\n 1, 0, 1, 1, 1, 0, 1, -1, 1, 0, -1, 1, 1, 0, -1, -1,\n -1, 0, 1, 1, -1, 0, 1, -1, -1, 0, -1, 1, -1, 0, -1, -1,\n 1, 1, 0, 1, 1, 1, 0, -1, 1, -1, 0, 1, 1, -1, 0, -1,\n -1, 1, 0, 1, -1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, -1,\n 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0,\n -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1, 0]),\n noise2D: function(xin, yin) {\n var permMod12 = this.permMod12;\n var perm = this.perm;\n var grad3 = this.grad3;\n var n0 = 0; // Noise contributions from the three corners\n var n1 = 0;\n var n2 = 0;\n // Skew the input space to determine which simplex cell we're in\n var s = (xin + yin) * F2; // Hairy factor for 2D\n var i = Math.floor(xin + s);\n var j = Math.floor(yin + s);\n var t = (i + j) * G2;\n var X0 = i - t; // Unskew the cell origin back to (x,y) space\n var Y0 = j - t;\n var x0 = xin - X0; // The x,y distances from the cell origin\n var y0 = yin - Y0;\n // For the 2D case, the simplex shape is an equilateral triangle.\n // Determine which simplex we are in.\n var i1, j1; // Offsets for second (middle) corner of simplex in (i,j) coords\n if (x0 > y0) {\n i1 = 1;\n j1 = 0;\n } // lower triangle, XY order: (0,0)->(1,0)->(1,1)\n else {\n i1 = 0;\n j1 = 1;\n } // upper triangle, YX order: (0,0)->(0,1)->(1,1)\n // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and\n // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where\n // c = (3-sqrt(3))/6\n var x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords\n var y1 = y0 - j1 + G2;\n var x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords\n var y2 = y0 - 1.0 + 2.0 * G2;\n // Work out the hashed gradient indices of the three simplex corners\n var ii = i & 255;\n var jj = j & 255;\n // Calculate the contribution from the three corners\n var t0 = 0.5 - x0 * x0 - y0 * y0;\n if (t0 >= 0) {\n var gi0 = permMod12[ii + perm[jj]] * 3;\n t0 *= t0;\n n0 = t0 * t0 * (grad3[gi0] * x0 + grad3[gi0 + 1] * y0); // (x,y) of grad3 used for 2D gradient\n }\n var t1 = 0.5 - x1 * x1 - y1 * y1;\n if (t1 >= 0) {\n var gi1 = permMod12[ii + i1 + perm[jj + j1]] * 3;\n t1 *= t1;\n n1 = t1 * t1 * (grad3[gi1] * x1 + grad3[gi1 + 1] * y1);\n }\n var t2 = 0.5 - x2 * x2 - y2 * y2;\n if (t2 >= 0) {\n var gi2 = permMod12[ii + 1 + perm[jj + 1]] * 3;\n t2 *= t2;\n n2 = t2 * t2 * (grad3[gi2] * x2 + grad3[gi2 + 1] * y2);\n }\n // Add contributions from each corner to get the final noise value.\n // The result is scaled to return values in the interval [-1,1].\n return 70.0 * (n0 + n1 + n2);\n },\n // 3D simplex noise\n noise3D: function(xin, yin, zin) {\n var permMod12 = this.permMod12;\n var perm = this.perm;\n var grad3 = this.grad3;\n var n0, n1, n2, n3; // Noise contributions from the four corners\n // Skew the input space to determine which simplex cell we're in\n var s = (xin + yin + zin) * F3; // Very nice and simple skew factor for 3D\n var i = Math.floor(xin + s);\n var j = Math.floor(yin + s);\n var k = Math.floor(zin + s);\n var t = (i + j + k) * G3;\n var X0 = i - t; // Unskew the cell origin back to (x,y,z) space\n var Y0 = j - t;\n var Z0 = k - t;\n var x0 = xin - X0; // The x,y,z distances from the cell origin\n var y0 = yin - Y0;\n var z0 = zin - Z0;\n // For the 3D case, the simplex shape is a slightly irregular tetrahedron.\n // Determine which simplex we are in.\n var i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords\n var i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords\n if (x0 >= y0) {\n if (y0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 1;\n k2 = 0;\n } // X Y Z order\n else if (x0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n } // X Z Y order\n else {\n i1 = 0;\n j1 = 0;\n k1 = 1;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n } // Z X Y order\n }\n else { // x0 y0) rankx++;\n else ranky++;\n if (x0 > z0) rankx++;\n else rankz++;\n if (x0 > w0) rankx++;\n else rankw++;\n if (y0 > z0) ranky++;\n else rankz++;\n if (y0 > w0) ranky++;\n else rankw++;\n if (z0 > w0) rankz++;\n else rankw++;\n var i1, j1, k1, l1; // The integer offsets for the second simplex corner\n var i2, j2, k2, l2; // The integer offsets for the third simplex corner\n var i3, j3, k3, l3; // The integer offsets for the fourth simplex corner\n // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order.\n // Many values of c will never occur, since e.g. x>y>z>w makes x= 3 ? 1 : 0;\n j1 = ranky >= 3 ? 1 : 0;\n k1 = rankz >= 3 ? 1 : 0;\n l1 = rankw >= 3 ? 1 : 0;\n // Rank 2 denotes the second largest coordinate.\n i2 = rankx >= 2 ? 1 : 0;\n j2 = ranky >= 2 ? 1 : 0;\n k2 = rankz >= 2 ? 1 : 0;\n l2 = rankw >= 2 ? 1 : 0;\n // Rank 1 denotes the second smallest coordinate.\n i3 = rankx >= 1 ? 1 : 0;\n j3 = ranky >= 1 ? 1 : 0;\n k3 = rankz >= 1 ? 1 : 0;\n l3 = rankw >= 1 ? 1 : 0;\n // The fifth corner has all coordinate offsets = 1, so no need to compute that.\n var x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords\n var y1 = y0 - j1 + G4;\n var z1 = z0 - k1 + G4;\n var w1 = w0 - l1 + G4;\n var x2 = x0 - i2 + 2.0 * G4; // Offsets for third corner in (x,y,z,w) coords\n var y2 = y0 - j2 + 2.0 * G4;\n var z2 = z0 - k2 + 2.0 * G4;\n var w2 = w0 - l2 + 2.0 * G4;\n var x3 = x0 - i3 + 3.0 * G4; // Offsets for fourth corner in (x,y,z,w) coords\n var y3 = y0 - j3 + 3.0 * G4;\n var z3 = z0 - k3 + 3.0 * G4;\n var w3 = w0 - l3 + 3.0 * G4;\n var x4 = x0 - 1.0 + 4.0 * G4; // Offsets for last corner in (x,y,z,w) coords\n var y4 = y0 - 1.0 + 4.0 * G4;\n var z4 = z0 - 1.0 + 4.0 * G4;\n var w4 = w0 - 1.0 + 4.0 * G4;\n // Work out the hashed gradient indices of the five simplex corners\n var ii = i & 255;\n var jj = j & 255;\n var kk = k & 255;\n var ll = l & 255;\n // Calculate the contribution from the five corners\n var t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0;\n if (t0 < 0) n0 = 0.0;\n else {\n var gi0 = (perm[ii + perm[jj + perm[kk + perm[ll]]]] % 32) * 4;\n t0 *= t0;\n n0 = t0 * t0 * (grad4[gi0] * x0 + grad4[gi0 + 1] * y0 + grad4[gi0 + 2] * z0 + grad4[gi0 + 3] * w0);\n }\n var t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1;\n if (t1 < 0) n1 = 0.0;\n else {\n var gi1 = (perm[ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]]] % 32) * 4;\n t1 *= t1;\n n1 = t1 * t1 * (grad4[gi1] * x1 + grad4[gi1 + 1] * y1 + grad4[gi1 + 2] * z1 + grad4[gi1 + 3] * w1);\n }\n var t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2;\n if (t2 < 0) n2 = 0.0;\n else {\n var gi2 = (perm[ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]]] % 32) * 4;\n t2 *= t2;\n n2 = t2 * t2 * (grad4[gi2] * x2 + grad4[gi2 + 1] * y2 + grad4[gi2 + 2] * z2 + grad4[gi2 + 3] * w2);\n }\n var t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3;\n if (t3 < 0) n3 = 0.0;\n else {\n var gi3 = (perm[ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]]] % 32) * 4;\n t3 *= t3;\n n3 = t3 * t3 * (grad4[gi3] * x3 + grad4[gi3 + 1] * y3 + grad4[gi3 + 2] * z3 + grad4[gi3 + 3] * w3);\n }\n var t4 = 0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4;\n if (t4 < 0) n4 = 0.0;\n else {\n var gi4 = (perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32) * 4;\n t4 *= t4;\n n4 = t4 * t4 * (grad4[gi4] * x4 + grad4[gi4 + 1] * y4 + grad4[gi4 + 2] * z4 + grad4[gi4 + 3] * w4);\n }\n // Sum up and scale the result to cover the range [-1,1]\n return 27.0 * (n0 + n1 + n2 + n3 + n4);\n }\n };\n\n function buildPermutationTable(random) {\n var i;\n var p = new Uint8Array(256);\n for (i = 0; i < 256; i++) {\n p[i] = i;\n }\n for (i = 0; i < 255; i++) {\n var r = i + ~~(random() * (256 - i));\n var aux = p[i];\n p[i] = p[r];\n p[r] = aux;\n }\n return p;\n }\n SimplexNoise._buildPermutationTable = buildPermutationTable;\n\n function alea() {\n // Johannes Baagøe , 2010\n var s0 = 0;\n var s1 = 0;\n var s2 = 0;\n var c = 1;\n\n var mash = masher();\n s0 = mash(' ');\n s1 = mash(' ');\n s2 = mash(' ');\n\n for (var i = 0; i < arguments.length; i++) {\n s0 -= mash(arguments[i]);\n if (s0 < 0) {\n s0 += 1;\n }\n s1 -= mash(arguments[i]);\n if (s1 < 0) {\n s1 += 1;\n }\n s2 -= mash(arguments[i]);\n if (s2 < 0) {\n s2 += 1;\n }\n }\n mash = null;\n return function() {\n var t = 2091639 * s0 + c * 2.3283064365386963e-10; // 2^-32\n s0 = s1;\n s1 = s2;\n return s2 = t - (c = t | 0);\n };\n }\n function masher() {\n var n = 0xefc8249d;\n return function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n }\n\n // amd\n if (typeof define !== 'undefined' && define.amd) define(function() {return SimplexNoise;});\n // common js\n if (typeof exports !== 'undefined') exports.SimplexNoise = SimplexNoise;\n // browser\n else if (typeof window !== 'undefined') window.SimplexNoise = SimplexNoise;\n // nodejs\n if (typeof module !== 'undefined') {\n module.exports = SimplexNoise;\n }\n\n})();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Shape = void 0;\nconst Scene_1 = require(\"../Scene\");\nconst SceneChild_1 = require(\"../SceneChild\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\n/**\n * Container of ShapeBase or Group, it applies transformations on each repetition\n *\n * @category Core.Shapes\n */\nclass Shape extends ShapeBase_1.ShapeBase {\n /**\n * Creates an instance of Shape.\n *\n * @param {ShapeSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'Shape';\n super(settings);\n if (settings.shape instanceof SceneChild_1.SceneChild) {\n this.shape = settings.shape;\n }\n else {\n console.warn(\"[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\\nYou passed:\", settings.shape);\n }\n this.shapeUseParent = !!settings.shapeUseParent;\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n */\n isStatic() {\n // return super.isStatic() && !this.shapeUseParent\n return super.isStatic() && (this.shape ? this.shape.isStatic() : true);\n }\n /**\n * Check if shape has static index\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return super.isStaticIndexed() && (this.shape ? this.shape.isStaticIndexed() : true);\n }\n /**\n * Find shape by id or name\n *\n * @param {number | string} idOrName\n * @returns {(SceneChild | null)}\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n if (this.shape)\n return this.shape.find(idOrName);\n return null;\n }\n /**\n * Return length of buffer\n *\n * @param {PropArguments} propArguments\n * @returns {number}\n */\n getBufferLength(propArguments) {\n if (this.bStatic && this.buffer && this.buffer.length > 0)\n return this.buffer.length;\n const childBufferLength = this.shape ? this.shape.getBufferLength(propArguments) : 0;\n return childBufferLength * this.getRepetitionCount();\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape) {\n if (this.shapeUseParent || this.shape.generateId !== generateId) {\n if (this.shapeUseParent) {\n this.shape.clearBuffer(true, false);\n }\n this.shape.generate(generateId, false, propArguments);\n }\n return this.shape.getBuffer();\n }\n return Shape.EMPTY_BUFFER;\n }\n /**\n * Return bounding\n *\n * @param {boolean} bDirectSceneChild\n * @returns {IShapeBounding}\n */\n getShapeBounding() {\n if (this.shape) {\n return this.shape.getBounding();\n }\n return this.bounding; // empty bounding defined in ShapeBase\n }\n /**\n * Add to indexed buffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n const parentBufferIndex = {\n shape: this,\n frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n };\n for (let i = 0, len = childIndexedBuffer.length; i < len; i++) {\n const currentIndexed = { ...childIndexedBuffer[i] };\n const parent = currentIndexed.parent\n ? Shape.setIndexedParent(currentIndexed.parent, parentBufferIndex)\n : parentBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n }\n }\n }\n /**\n * Set parent of indexed\n *\n * @static\n * @param {(IBufferIndex )} current\n * @param {IBufferIndex} parent\n * @returns {(IBufferIndex )}\n */\n static setIndexedParent(current, parent) {\n const index = {\n ...current,\n };\n index.parent = current.parent ? Shape.setIndexedParent(current.parent, parent) : parent;\n return index;\n }\n /**\n * Set shape\n *\n * @param {(SceneChild | undefined)} [shape]\n */\n setShape(shape) {\n if (typeof shape === 'undefined') {\n this.shape = undefined;\n this.clearBuffer(true, true);\n }\n else {\n this.scene && Scene_1.Scene.propagateToChilden(shape, this.scene);\n this.shape = shape;\n this.shape.clearBuffer(true, true);\n }\n }\n}\nexports.Shape = Shape;\n//# sourceMappingURL=Shape.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapePrimitive = void 0;\nconst glme = require(\"../math/gl-matrix-extensions\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\nconst Modifier_1 = require(\"../modifiers/Modifier\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\n/**\n * @category Core.Abstract\n */\nclass ShapePrimitive extends ShapeBase_1.ShapeBase {\n /**\n * Creates an instance of ShapePrimitive.\n *\n * @param {IShapePrimitiveSettings} [settings={}]\n */\n constructor(settings = {}) {\n var _a;\n super(settings);\n /**\n * Contain the bounding of the last generated buffer\n *\n * @type {IShapeBounding}\n */\n this.currentGenerationPrimitiveBounding = Adapt_1.Bounding.empty();\n this.props.sideLength =\n typeof settings.sideLength === 'undefined'\n ? undefined\n : typeof settings.sideLength === 'function'\n ? settings.sideLength\n : glme.toVec2(settings.sideLength);\n this.drawer = settings.drawer || {};\n this.modifiers = settings.modifiers;\n this.bClosed = (_a = settings.bClosed) !== null && _a !== void 0 ? _a : true;\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n * @memberof ShapePrimitive\n */\n isStatic() {\n return typeof this.props.sideLength !== 'function' && super.isStatic();\n }\n /**\n * Return sideLength for current repetition\n *\n * @param propArguments\n * @returns\n */\n getRepetitionSideLength(propArguments) {\n if (this.bStatic) {\n // not set default value into constructor because it can be overridden by group\n if (typeof this.props.sideLength === 'undefined') {\n this.props.sideLength = [50, 50];\n }\n else if (typeof this.props.sideLength === 'number') {\n this.props.sideLength = [this.props.sideLength, this.props.sideLength];\n }\n return this.props.sideLength;\n }\n return glme.toVec2(this.getProp('sideLength', propArguments, [50, 50]));\n }\n /**\n * Apply modifiers on single repetition buffer\n *\n * @param buffer\n * @returns\n */\n applyModifiers(buffer, propArguments) {\n if (typeof this.modifiers === 'undefined')\n return buffer;\n let modified = buffer;\n const modifiers = Array.isArray(this.modifiers) ? this.modifiers : [this.modifiers];\n for (let i = 0, len = modifiers.length; i < len; i++) {\n const modifier = modifiers[i] instanceof Modifier_1.Modifier\n ? modifiers[i]\n : modifiers[i](propArguments);\n //@ts-ignore\n modified = modifier.apply(modified, this.bClosed, this);\n }\n return modified;\n }\n /**\n * Return a bounding of generated buffer if is direct scene child\n *\n * @returns {IShapeBounding}\n * @memberof ShapePrimitive\n */\n getShapeBounding() {\n return this.currentGenerationPrimitiveBounding;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n const index = {\n shape: this,\n frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n };\n this.indexedBuffer.push(index);\n }\n /**\n * Return bClosed\n *\n * @returns {boolean}\n * @memberof ShapePrimitive\n */\n isClosed() {\n return this.bClosed;\n }\n /**\n * Set bClosed\n *\n * @param {boolean} bClosed\n * @memberof ShapePrimitive\n */\n setClosed(bClosed) {\n this.bClosed = bClosed;\n }\n}\nexports.ShapePrimitive = ShapePrimitive;\n//# sourceMappingURL=ShapePrimitive.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeLoop = void 0;\nconst math_1 = require(\"../math\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst ShapePrimitive_1 = require(\"../shapes/ShapePrimitive\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\n/**\n * Shape Loop\n *\n * @category Core.Shapes\n * @public\n * @class ShapeLoop\n * @extends {ShapePrimitive}\n */\nclass ShapeLoop extends ShapePrimitive_1.ShapePrimitive {\n /**\n * Creates an instance of ShapeLoop.\n *\n * @param {IShapeLoopSettings} [settings={}]\n * @param {boolean} [bPreventGeneration=false]\n */\n constructor(settings = {}, bPreventGeneration = false) {\n settings.type = settings.type || 'ShapeLoop';\n super(settings);\n this.loopDependencies = (settings.loopDependencies || []).concat('sideLength');\n this.props.loop = settings.loop;\n if (!bPreventGeneration) {\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: math_1.PI2 / 10,\n vertex: () => [0, 0],\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n }\n /**\n * Check if currentOrSingleLoopBuffer is static\n *\n * @returns {boolean}\n */\n isStaticLoop() {\n if (this.loopDependencies.includes('propArguments'))\n return false;\n for (let i = 0, len = this.loopDependencies.length; i < len; i++)\n if (typeof this.props[this.loopDependencies[i]] === 'function')\n return false;\n return true;\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n */\n isStatic() {\n return this.bStaticLoop && super.isStatic();\n }\n /**\n * Check if shape has static indexed\n * The number of vertices is defined by number of loop iteration\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n // return this.bStaticLoop && super.isStaticIndexed()\n return (super.isStaticIndexed() &&\n (typeof this.props.loop !== 'undefined'\n ? typeof this.props.loop.start !== 'function' &&\n typeof this.props.loop.end !== 'function' &&\n typeof this.props.loop.inc !== 'function'\n : true));\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.bStaticLoop = this.isStaticLoop();\n if (bClearIndexed) {\n this.currentOrSingleLoopBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n * Set single or multiple props\n *\n * @param {(Props)} key\n * @param {*} [value]\n * @param {boolean} [bClearIndexed=false]\n */\n setProp(key, value) {\n let bClearIndexed = false;\n const keys = (typeof key === 'string' ? { [key]: value } : key);\n for (let i = this.loopDependencies.length - 1; i >= 0; i--) {\n if (this.loopDependencies[i] in keys) {\n // this.props.loop = undefined\n bClearIndexed = true;\n break;\n }\n }\n if ('loop' in keys) {\n keys.loop = { ...this.props.loop, ...keys.loop };\n bClearIndexed = true;\n }\n super.setProp(keys, value, bClearIndexed);\n }\n /**\n * Return length of buffer\n *\n * @param {PropArguments} [propArguments]\n * @returns {number}\n */\n getBufferLength(propArguments) {\n if (this.bStatic && typeof this.buffer !== 'undefined')\n return this.buffer.length;\n if (this.bStaticLoop && typeof this.currentOrSingleLoopBuffer !== 'undefined')\n return this.currentOrSingleLoopBuffer.length * this.getRepetitionCount();\n const { count } = this.getLoop(propArguments || ShapeBase_1.ShapeBase.getEmptyPropArguments(this));\n return this.getRepetitionCount() * count * 2;\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (!this.bStaticLoop)\n return this.generateLoopBuffer(propArguments);\n if (typeof this.props.sideLength === 'function' || typeof this.currentOrSingleLoopBuffer === 'undefined')\n this.currentOrSingleLoopBuffer = this.generateLoopBuffer(propArguments);\n return this.currentOrSingleLoopBuffer;\n }\n /**\n * Generate loop buffer\n *\n * @protected\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateLoopBuffer(propArguments) {\n const { start, inc, /*end,*/ count } = this.getLoop(propArguments);\n const sideLength = this.getRepetitionSideLength(propArguments);\n const getVertex = (this.props.loop && this.props.loop.vertex ? this.props.loop.vertex : this.loop.vertex);\n const shapeLoop = {\n index: 0,\n offset: 0,\n current: 0,\n count: count,\n };\n const vertexLength = shapeLoop.count;\n const bufferLength = vertexLength * 2;\n const currentOrSingleLoopBuffer = new Float32Array(bufferLength);\n for (let i = 0, j = 0; i < vertexLength; i++, j += 2) {\n const current = start + inc * i;\n const offset = shapeLoop.count > 1 ? i / (shapeLoop.count - 1) : 1;\n // const angle = (end - start) * offset + start\n shapeLoop.current = current;\n shapeLoop.index = i + 1;\n shapeLoop.offset = offset;\n const vertex = getVertex(shapeLoop, propArguments);\n currentOrSingleLoopBuffer[j] = vertex[0];\n currentOrSingleLoopBuffer[j + 1] = vertex[1];\n // currentOrSingleLoopBuffer[j] *= sideLength[0]\n // currentOrSingleLoopBuffer[j + 1] *= sideLength[1]\n // Bounding.add(tmpBounding, currentOrSingleLoopBuffer[j], currentOrSingleLoopBuffer[j + 1])\n }\n const tmpBounding = [undefined, undefined, undefined, undefined];\n const buffer = this.applyModifiers(currentOrSingleLoopBuffer, propArguments);\n for (let i = 0, len = buffer.length; i < len; i += 2) {\n buffer[i] = buffer[i] * sideLength[0];\n buffer[i + 1] = buffer[i + 1] * sideLength[1];\n Adapt_1.Bounding.add(tmpBounding, buffer[i], buffer[i + 1]);\n }\n Adapt_1.Bounding.bind(this.currentGenerationPrimitiveBounding, tmpBounding);\n return buffer;\n }\n /**\n * Return information about a client loop gnerator\n *\n * @public\n * @param {PropArguments} propArguments\n * @returns {ShapeLoopInformation}\n */\n getLoop(propArguments) {\n var _a, _b, _c, _d, _e, _f;\n let start = (_b = (_a = this.props.loop) === null || _a === void 0 ? void 0 : _a.start) !== null && _b !== void 0 ? _b : this.loop.start;\n let end = (_d = (_c = this.props.loop) === null || _c === void 0 ? void 0 : _c.end) !== null && _d !== void 0 ? _d : this.loop.end;\n let inc = (_f = (_e = this.props.loop) === null || _e === void 0 ? void 0 : _e.inc) !== null && _f !== void 0 ? _f : this.loop.inc;\n start = (typeof start === 'function' ? start(propArguments) : start);\n end = (typeof end === 'function' ? end(propArguments) : end);\n inc = (typeof inc === 'function' ? inc(propArguments) : inc);\n const count = Math.ceil((end - start) / inc);\n return { start, end, inc, count: count <= 0 ? 0 : count };\n }\n /**\n * Set shape from loop generator\n *\n * @param {(IShapeLoopGenerator)} [shape]\n */\n setShape(loop) {\n this.setProp('loop', loop);\n }\n /**\n * Get static buffer\n *\n * @param sideLength\n * @returns\n */\n static getBuffer(props) {\n const shape = new this({ ...props, sideLength: props.sideLength || 1 });\n shape.generate();\n return shape.getBuffer() || new Float32Array();\n }\n}\nexports.ShapeLoop = ShapeLoop;\nShapeLoop.PId2 = Math.PI / 2;\n//# sourceMappingURL=ShapeLoop.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeBuffer = void 0;\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst ShapePrimitive_1 = require(\"../shapes/ShapePrimitive\");\n/**\n * @category Core.Shapes\n */\nclass ShapeBuffer extends ShapePrimitive_1.ShapePrimitive {\n /**\n * Creates an instance of ShapeBuffer.\n *\n * @param {IShapeBufferSettings} [settings={}]\n */\n constructor(settings = {}) {\n var _a, _b;\n settings.type = settings.type || 'ShapeBuffer';\n settings.adaptMode = (_a = settings.adaptMode) !== null && _a !== void 0 ? _a : Adapt_1.EAdaptMode.Scale;\n super(settings);\n this.adaptMode = (_b = settings.adaptMode) !== null && _b !== void 0 ? _b : Adapt_1.EAdaptMode.Fill;\n if (typeof settings.shape === 'undefined') {\n console.warn('[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property');\n this.shape = ShapeBuffer.EMPTY_BUFFER;\n }\n else {\n this.shape = typeof settings.shape !== 'function' ? Adapt_1.Adapt.adapt(settings.shape, this.adaptMode) : settings.shape;\n }\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n /**\n * Check shape is static\n *\n * @returns boolean\n */\n isStatic() {\n return typeof this.shape !== 'function' && super.isStatic();\n }\n /**\n * Check shape is static indexed\n *\n * @returns boolean\n */\n isStaticIndexed() {\n return typeof this.shape !== 'function' && super.isStaticIndexed();\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n this.shapeBuffer = undefined;\n }\n /**\n * Apply sideLength on .shape buffer and calculate bounding\n *\n * @protected\n */\n bindBuffer(propArguments) {\n const sideLength = this.getRepetitionSideLength(propArguments);\n const shapeBuffer = this.applyModifiers(Float32Array.from(typeof this.shape === 'function' ? this.shape(propArguments) : this.shape), propArguments);\n const tmpBounding = [undefined, undefined, undefined, undefined];\n for (let i = 0, len = shapeBuffer.length; i < len; i += 2) {\n shapeBuffer[i] = shapeBuffer[i] * sideLength[0];\n shapeBuffer[i + 1] = shapeBuffer[i + 1] * sideLength[1];\n Adapt_1.Bounding.add(tmpBounding, shapeBuffer[i], shapeBuffer[i + 1]);\n }\n Adapt_1.Bounding.bind(this.currentGenerationPrimitiveBounding, tmpBounding);\n this.shapeBuffer = shapeBuffer;\n }\n /**\n * Return length of buffer\n *\n * @param {IPropArguments} propArguments\n * @returns {number}\n */\n getBufferLength( /*propArguments?: IPropArguments*/) {\n if (this.buffer && this.buffer.length > 0)\n return this.buffer.length;\n return this.shape.length * this.getRepetitionCount();\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (typeof this.shapeBuffer === 'undefined' ||\n typeof this.props.sideLength === 'function' ||\n typeof this.shape === 'function') {\n this.bindBuffer(propArguments);\n }\n return this.shapeBuffer;\n }\n /**\n * Set shape\n *\n * @param {(Float32Array)} [shape]\n */\n setShape(shape) {\n this.shape = Adapt_1.Adapt.adapt(shape, this.adaptMode);\n this.clearBuffer(true);\n }\n /**\n * Return adaptMode\n *\n * @returns {EAdaptMode}\n * @memberof ShapeBase\n */\n getAdaptMode() {\n return this.adaptMode;\n }\n /**\n * Get static buffer\n *\n * @param sideLength\n * @returns\n */\n static getBuffer(props = {}) {\n const shape = new this({ ...props, sideLength: props.sideLength || 1 });\n shape.generate();\n return shape.getBuffer() || new Float32Array();\n }\n}\nexports.ShapeBuffer = ShapeBuffer;\n//# sourceMappingURL=ShapeBuffer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeRecursive = void 0;\nconst Shape_1 = require(\"./Shape\");\n/**\n * @category Core.Shapes\n */\nclass ShapeRecursive extends Shape_1.Shape {\n /**\n * Creates an instance of ShapeRecursive.\n *\n * @param {IShapeRecursiveSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'ShapeRecursive';\n super(settings);\n this.props.recursions = settings.recursions || 1;\n this.props.recursionScale = settings.recursionScale || 2;\n this.props.recursionVertex = settings.recursionVertex || 0;\n // this.bInner = settings.bInner ?? false\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n this.shapeUseRecursion = !!settings.shapeUseRecursion;\n // this.currentGenerationRecursiveBounding = Bounding.empty()\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n if (bClearIndexed) {\n this.shapeRecursiveBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n * Set type of recursion\n *\n * @param {boolean} inner\n */\n // public setRecursionnInner(inner: boolean): void {\n // \tthis.bInner = inner\n // \tthis.clearBuffer(true)\n // }\n /**\n *\n * @returns {boolean}\n */\n isStatic() {\n return (typeof this.props.recursions !== 'function' &&\n typeof this.props.recursionScale !== 'function' &&\n typeof this.props.recursionVertex !== 'function' &&\n super.isStatic());\n }\n /**\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return (typeof this.props.recursions !== 'function' &&\n typeof this.props.recursionVertex !== 'function' &&\n super.isStaticIndexed());\n }\n /**\n * Return a buffer of children shape with recursion\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape) {\n if (typeof this.shapeRecursiveBuffer === 'undefined' ||\n this.shapeUseParent ||\n this.shape.generateId !== generateId) {\n this.bindBuffer(generateId, propArguments);\n }\n return this.shapeRecursiveBuffer;\n }\n return Shape_1.Shape.EMPTY_BUFFER;\n }\n /**\n * Generate Recoursive shape buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n */\n bindBuffer(generateId, propArguments) {\n const recursions = Math.floor(this.getProp('recursions', propArguments, 1));\n const recursionVertex = Math.floor(this.getProp('recursionVertex', propArguments, 0));\n const recursionScale = this.getProp('recursionScale', propArguments, 2);\n const childShape = this.shape;\n let currentRecursionRepetition = {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: 1 },\n };\n const recursionPropArguments = {\n ...propArguments,\n recursion: currentRecursionRepetition,\n };\n childShape.generate(generateId, false, recursionPropArguments);\n const firstGenerationChildBuffer = childShape.getBuffer();\n if (recursions <= 1) {\n // this.currentGenerationRecursiveBounding = this.shape.getBounding()\n this.shapeRecursiveBuffer = firstGenerationChildBuffer;\n return;\n }\n let shapeBuffer = firstGenerationChildBuffer;\n const storedRecursion = [currentRecursionRepetition];\n let paretRecursionIndex = 0, added = 1;\n // const tmpBounding = [undefined, undefined, undefined, undefined]\n const singleShapeBufferLength = shapeBuffer.length;\n const realVertexCount = singleShapeBufferLength / 2;\n const singleShapeVertexCount = recursionVertex <= 0 ? realVertexCount : Math.min(recursionVertex, realVertexCount);\n const recursionOffsetMultiplier = recursionVertex === 0 ? 1 : realVertexCount / Math.min(recursionVertex, realVertexCount);\n const recusiveShapeBuffer = new Float32Array(ShapeRecursive.summmation(recursions, singleShapeVertexCount) * singleShapeBufferLength);\n for (let i = 0; i < singleShapeBufferLength; i += 2) {\n recusiveShapeBuffer[i] = shapeBuffer[i];\n recusiveShapeBuffer[i + 1] = shapeBuffer[i + 1];\n // Bounding.add(tmpBounding, recusiveShapeBuffer[i], recusiveShapeBuffer[i + 1])\n }\n for (let currentRecursion = 1; currentRecursion < recursions; currentRecursion++) {\n const level_offset = recursions > 1 ? currentRecursion / (recursions - 1) : 1;\n const currentRecursionVertexCount = ShapeRecursive.summmation(currentRecursion, singleShapeVertexCount);\n const recursionBufferStartIndex = currentRecursionVertexCount * singleShapeBufferLength;\n const parentRecursion = currentRecursion - 1;\n const parentRecursionBufferStartIndex = parentRecursion === 0\n ? 0\n : ShapeRecursive.summmation(parentRecursion, singleShapeVertexCount) * singleShapeBufferLength;\n for (let currentShapeRecursionRepetition = 0, totalRecursionRepetitions = singleShapeVertexCount ** currentRecursion; currentShapeRecursionRepetition < totalRecursionRepetitions; currentShapeRecursionRepetition++, added++) {\n currentRecursionRepetition = {\n index: currentShapeRecursionRepetition + 1,\n offset: totalRecursionRepetitions > 1 ? currentShapeRecursionRepetition / (totalRecursionRepetitions - 1) : 1,\n count: totalRecursionRepetitions,\n level: { index: currentRecursion + 1, offset: level_offset, count: recursions },\n parent: storedRecursion[paretRecursionIndex],\n };\n storedRecursion.push(currentRecursionRepetition);\n if (this.shapeUseRecursion) {\n recursionPropArguments.recursion = currentRecursionRepetition;\n childShape.generate(generateId, false, recursionPropArguments);\n shapeBuffer = childShape.getBuffer();\n }\n const shapeVertexBufferIndex = recursionBufferStartIndex + currentShapeRecursionRepetition * singleShapeBufferLength;\n // const centerVertexIndex = parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2\n const centerVertexIndex = Math.floor(parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2 * recursionOffsetMultiplier);\n const centerX = recusiveShapeBuffer[centerVertexIndex];\n const centerY = recusiveShapeBuffer[centerVertexIndex + 1];\n const currentRecursionScale = recursionScale ** currentRecursion;\n for (let i = 0, len = singleShapeBufferLength; i < len; i += 2) {\n // if (this.bInner) {\n // \tconst parentCurrentVertex =\n // \t\tparentRecursionBufferStartIndex +\n // \t\tMath.floor(currentShapeRecursionRepetition / singleShapeVertexCount) *\n // \t\t\tsingleShapeVertexCount *\n // \t\t\trecursionOffsetMultiplier *\n // \t\t\t2\n // \tconst parentX = recusiveShapeBuffer[parentCurrentVertex + i]\n // \tconst parentY = recusiveShapeBuffer[parentCurrentVertex + i + 1]\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i] = (centerX - parentX) / recursionScale + parentX\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = (centerY - parentY) / recursionScale + parentY\n // const parentX = shapeBuffer[i] / recursionScale ** currentRecursion\n // const parentY = shapeBuffer[i + 1] / recursionScale ** currentRecursion\n // recusiveShapeBuffer[shapeVertexBufferIndex + i] = (centerX - parentX) / recursionScale + parentX\n // recusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = (centerY - parentY) / recursionScale + parentY\n // } else {\n const parentXScaled = shapeBuffer[i] / currentRecursionScale;\n const parentYScaled = shapeBuffer[i + 1] / currentRecursionScale;\n recusiveShapeBuffer[shapeVertexBufferIndex + i] = centerX + parentXScaled;\n recusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = centerY + parentYScaled;\n // }\n // Bounding.add(\n // \ttmpBounding,\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i],\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i + 1]\n // )\n }\n if (added % singleShapeVertexCount === 0) {\n paretRecursionIndex += 1;\n }\n }\n }\n // Bounding.bind(this.currentGenerationRecursiveBounding, tmpBounding)\n this.shapeRecursiveBuffer = recusiveShapeBuffer;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const propArguments = { repetition, shape: this };\n const recursions = Math.floor(this.getProp('recursions', propArguments, 1));\n const recursionVertex = Math.floor(this.getProp('recursionVertex', propArguments, 0));\n // const realFrameLength = ShapeRecursive.summmation(recursions, this.shape.getBufferLength() / 2)\n const bufferIndex = {\n shape: this,\n frameLength: frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n recursion: {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: recursions },\n },\n };\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentRecursionRepetition = {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: recursions },\n };\n const recursionBufferIndex = {\n ...bufferIndex,\n recursion: currentRecursionRepetition,\n };\n const parent = (currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, recursionBufferIndex)\n : recursionBufferIndex);\n this.indexedBuffer.push({\n ...currentIndexed,\n parent,\n });\n }\n if (recursions > 1) {\n const realVertexCount = this.shape.getBufferLength({ ...propArguments, parent: { ...bufferIndex } }) / 2;\n const vertexCount = recursionVertex <= 0 ? realVertexCount : Math.min(recursionVertex, realVertexCount);\n const storedRecursion = this.indexedBuffer.map(indexed => [indexed.parent.recursion]);\n let paretRecursionIndex = 0, added = 1;\n for (let i = 1; i < recursions; i++) {\n const level_offset = recursions > 1 ? i / (recursions - 1) : 1;\n for (let j = 0, len = vertexCount ** i; j < len; j++, added++) {\n const recursionOffset = len > 1 ? j / (len - 1) : 1;\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentRecursionRepetition = {\n index: j + 1,\n offset: recursionOffset,\n count: len,\n level: { index: i + 1, offset: level_offset, count: recursions },\n parent: storedRecursion[childIndexed][paretRecursionIndex],\n };\n const recursionBufferIndex = { ...bufferIndex, recursion: currentRecursionRepetition };\n const parent = currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, recursionBufferIndex)\n : recursionBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n storedRecursion[childIndexed].push(currentRecursionRepetition);\n if (added % vertexCount === 0) {\n paretRecursionIndex += 1;\n }\n }\n }\n }\n }\n }\n }\n /**\n * Retturn summation value\n *\n * @static\n * @param {number} recursion\n * @param {number} vertexCount\n * @returns {number}\n */\n static summmation(recursion, vertexCount) {\n if (recursion === 1)\n return 1;\n let result = 1;\n for (let i = 1; i < recursion; i++)\n result += vertexCount ** i;\n return result;\n }\n /**\n * Empty recursion repetition\n *\n * @static\n * @return {*} {IRecursionRepetition}\n */\n static getEmptyRecursion() {\n return {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: 1, count: 1 },\n };\n }\n}\nexports.ShapeRecursive = ShapeRecursive;\n//# sourceMappingURL=ShapeRecursive.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeFollow = void 0;\nconst Shape_1 = require(\"./Shape\");\n/**\n * @category Core.Shapes\n */\nclass ShapeFollow extends Shape_1.Shape {\n /**\n * Creates an instance of ShapeFollow.\n *\n * @param {IShapeFollowSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'ShapeFollow';\n super(settings);\n this.follow = settings.follow || settings.shape;\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n this.shapeUseFollow = !!settings.shapeUseFollow;\n // this.currentGenerationRecursiveBounding = Bounding.empty()\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n if (bClearIndexed) {\n this.shapeFollowBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n *\n * @returns {boolean}\n */\n isStatic() {\n return (this.follow ? this.follow.isStatic() : true) && super.isStatic();\n }\n /**\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return (this.follow ? this.follow.isStaticIndexed() : true) && super.isStaticIndexed();\n }\n /**\n * Return a buffer of children shape with recursion\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape && this.follow) {\n if (typeof this.shapeFollowBuffer === 'undefined' ||\n this.shapeUseParent ||\n this.shape.generateId !== generateId ||\n this.follow.generateId !== generateId) {\n this.bindBuffer(generateId, propArguments);\n }\n return this.shapeFollowBuffer;\n }\n return Shape_1.Shape.EMPTY_BUFFER;\n }\n /**\n * Generate Recoursive shape buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n */\n bindBuffer(generateId, propArguments) {\n const followShape = this.follow;\n followShape.generate(generateId, false, propArguments);\n const followBuffer = followShape.getBuffer();\n // const followIndexed = followShape.getIndexedBuffer() as Array\n const followPropArguments = {\n ...propArguments,\n follow: {\n index: 1,\n offset: 1,\n count: 1,\n },\n // follow_repetition: followIndexed[0].repetition,\n };\n const childShape = this.shape;\n childShape.generate(generateId, false, followPropArguments);\n let shapeBuffer = childShape.getBuffer();\n // const tmpBounding = [undefined, undefined, undefined, undefined]\n const singleShapeBufferLength = shapeBuffer.length;\n const followShapeBuffer = new Float32Array(singleShapeBufferLength * (followBuffer.length / 2));\n const totalFollowVertexCount = followBuffer.length / 2;\n for (let currentShapeFollowRepetition = 0; currentShapeFollowRepetition < totalFollowVertexCount; currentShapeFollowRepetition++) {\n const currentFollowRepetition = {\n index: currentShapeFollowRepetition + 1,\n offset: totalFollowVertexCount > 1 ? currentShapeFollowRepetition / (totalFollowVertexCount - 1) : 1,\n count: totalFollowVertexCount,\n };\n if (this.shapeUseFollow) {\n followPropArguments.follow = currentFollowRepetition;\n // followPropArguments.follow_repetition = followIndexed[currentShapeFollowRepetition].repetition\n childShape.generate(generateId, false, followPropArguments);\n shapeBuffer = childShape.getBuffer();\n }\n const shapeVertexBufferIndex = currentShapeFollowRepetition * singleShapeBufferLength;\n // const centerVertexIndex = parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2\n const centerVertexIndex = currentShapeFollowRepetition * 2;\n const centerX = followBuffer[centerVertexIndex];\n const centerY = followBuffer[centerVertexIndex + 1];\n for (let i = 0, len = shapeBuffer.length; i < len; i += 2) {\n followShapeBuffer[shapeVertexBufferIndex + i] = centerX + shapeBuffer[i];\n followShapeBuffer[shapeVertexBufferIndex + i + 1] = centerY + shapeBuffer[i + 1];\n // Bounding.add(\n // \ttmpBounding,\n // \tfollowShapeBuffer[shapeVertexBufferIndex + i],\n // \tfollowShapeBuffer[shapeVertexBufferIndex + i + 1]\n // )\n }\n }\n // Bounding.bind(this.currentGenerationRecursiveBounding, tmpBounding)\n this.shapeFollowBuffer = followShapeBuffer;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const propArguments = { repetition, shape: this };\n const bufferIndex = {\n shape: this,\n frameLength: frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n follow: {\n index: 1,\n offset: 1,\n count: 1,\n },\n };\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const vertexCount = this.follow.getBuffer().length / 2; // this.follow.getBufferLength({ ...propArguments, parent: { ...bufferIndex } }) / 2\n for (let j = 0, len = vertexCount; j < len; j++) {\n const followOffset = len > 1 ? j / (len - 1) : 1;\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentFollowRepetition = {\n index: j + 1,\n offset: followOffset,\n count: len,\n };\n const followBufferIndex = { ...bufferIndex, follow: currentFollowRepetition };\n const parent = currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, followBufferIndex)\n : followBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n }\n }\n }\n }\n }\n /**\n * Retturn summation value\n *\n * @static\n * @param {number} recursion\n * @param {number} vertexCount\n * @returns {number}\n */\n static summmation(recursion, vertexCount) {\n if (recursion === 1)\n return 1;\n let result = 1;\n for (let i = 1; i < recursion; i++)\n result += vertexCount ** i;\n return result;\n }\n /**\n * Empty recursion repetition\n *\n * @static\n * @return {*} {IRecursionRepetition}\n */\n static getEmptyRecursion() {\n return {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: 1, count: 1 },\n };\n }\n}\nexports.ShapeFollow = ShapeFollow;\n//# sourceMappingURL=ShapeFollow.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Line = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n *\n * @category Core.Primitives\n * @class Line\n * @extends {ShapeBuffer}\n */\nclass Line extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Two point, based on ShapeBuffer\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Line\n */\n constructor(settings = {}) {\n settings.type = 'Line';\n settings.shape = Line.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n settings.bClosed = false;\n super(settings);\n }\n /**\n * @link https://gist.github.com/pborissow/5c92b77a804688385c77749d1187ba07\n */\n static toPolygon(buffer, thickness) {\n const solidified = [];\n //Convert thickness into an array as needed\n if (!Array.isArray(thickness)) {\n const _thickness = thickness;\n const points = buffer.length / 2;\n thickness = new Array(points);\n for (let i = 0; i < points; i++) {\n thickness[i] = _thickness;\n }\n }\n function getOffsets(ax, ay, bx, by, thickness) {\n const dx = bx - ax, dy = by - ay, len = Math.sqrt(dx * dx + dy * dy), scale = thickness / (2 * len);\n return [-scale * dy, scale * dx];\n }\n function getIntersection(a1, b1, a2, b2) {\n // directional constants\n const k1 = (b1[1] - a1[1]) / (b1[0] - a1[0]), k2 = (b2[1] - a2[1]) / (b2[0] - a2[0]);\n // if the directional constants are equal, the lines are parallel\n if (Math.abs(k1 - k2) < 0.00001) {\n return;\n }\n // y offset constants for both lines\n const m1 = a1[1] - k1 * a1[0];\n const m2 = a2[1] - k2 * a2[0];\n // compute x\n const x = (m1 - m2) / (k2 - k1);\n // use y = k * x + m to get y coordinate\n const y = k1 * x + m1;\n return [x, y];\n }\n let bFirst, bLast, prevA = [\n [0, 0],\n [0, 0],\n ], prevB = [\n [0, 0],\n [0, 0],\n ];\n for (let i = 0, len = buffer.length - 2; i < len; i += 2) {\n bFirst = i === 0;\n bLast = i === len - 2;\n const off = getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], thickness[i]);\n const p0a = [buffer[i] + off[0], buffer[i + 1] + off[1]];\n const p1a = [buffer[i + 2] + off[0], buffer[i + 3] + off[1]];\n const p0b = [buffer[i] - off[0], buffer[i + 1] - off[1]];\n const p1b = [buffer[i + 2] - off[0], buffer[i + 3] - off[1]];\n if (!bFirst) {\n const interA = getIntersection(prevA[0], prevA[1], p0a, p1a);\n if (interA) {\n solidified.unshift(interA[1]);\n solidified.unshift(interA[0]);\n }\n const interB = getIntersection(prevB[0], prevB[1], p0b, p1b);\n if (interB) {\n solidified.push(interB[0]);\n solidified.push(interB[1]);\n }\n }\n if (bFirst) {\n solidified.unshift(p0a[1]);\n solidified.unshift(p0a[0]);\n solidified.push(p0b[0]);\n solidified.push(p0b[1]);\n }\n if (bLast) {\n solidified.unshift(p1a[1]);\n solidified.unshift(p1a[0]);\n solidified.push(p1b[0]);\n solidified.push(p1b[1]);\n }\n if (!bLast) {\n prevA = [p0a, p1a];\n prevB = [p0b, p1b];\n }\n }\n return Float32Array.from(solidified);\n }\n}\nexports.Line = Line;\nLine.buffer = [-1, 0, 1, 0];\n//# sourceMappingURL=Line.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Triangle = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n * Triangle ShapeBuffer\n *\n * @category Core.Primitives\n */\nclass Triangle extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Creates an instance of Triangleeee.\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Triangle\n */\n constructor(settings = {}) {\n settings.type = 'Triangle';\n settings.shape = Triangle.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n super(settings);\n }\n}\nexports.Triangle = Triangle;\nTriangle.buffer = [1, 0, -1, 1, -1, -1];\n//# sourceMappingURL=Triangle.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Rect = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n *\n * @category Core.Primitives\n * @class Rect\n * @extends {ShapeBuffer}\n */\nclass Rect extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Creates an instance of Rect.\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Rect\n */\n constructor(settings = {}) {\n settings.type = 'Rect';\n settings.shape = Rect.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n super(settings);\n }\n}\nexports.Rect = Rect;\nRect.buffer = [1, 1, -1, 1, -1, -1, 1, -1];\n//# sourceMappingURL=Rect.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Polygon = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Polygon shape\n *\n * @category Core.Primitives\n * @class Polygon\n * @extends {ShapeLoop}\n */\nclass Polygon extends ShapeLoop_1.ShapeLoop {\n /**\n * Is based on ShapeLoop and you can pass `sideNumber` property to define\n * a number of sides.\n *\n * @param settings\n */\n constructor(settings = {}) {\n settings.type = settings.type || 'Polygon';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['sideNumber']);\n super(settings, true);\n this.props.sideNumber = settings.sideNumber;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: (propArguments) => {\n return math_1.PI2 / this.getProp('sideNumber', propArguments, 5);\n },\n vertex: shapeLoopRepetition => {\n return [Math.cos(shapeLoopRepetition.current), Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n}\nexports.Polygon = Polygon;\n//# sourceMappingURL=Polygon.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Circle = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n *\n * @category Core.Primitives\n * @class Circle\n * @extends {ShapeLoop}\n */\nclass Circle extends ShapeLoop_1.ShapeLoop {\n /**\n * Based on ShapeLoop, the number of point (resolution) is based on sideLength.\n *\n * @param {ShapeLoopSettings} [settings={}]\n * @memberof Circle\n */\n constructor(settings = {}) {\n settings.type = 'Circle';\n super(settings, true);\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const sideLength = this.getRepetitionSideLength(propArguments);\n return (1 / Math.pow(sideLength[0] * sideLength[1], 0.25)) * ShapeLoop_1.ShapeLoop.PId2;\n },\n vertex: shapeLoopRepetition => [Math.cos(shapeLoopRepetition.current), Math.sin(shapeLoopRepetition.current)],\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n}\nexports.Circle = Circle;\n//# sourceMappingURL=Circle.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Star = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Polygon shape\n *\n * @category Core.Primitives\n * @class Polygon\n * @extends {ShapeLoop}\n */\nclass Star extends ShapeLoop_1.ShapeLoop {\n /**\n * Is based on ShapeLoop and you can pass `spikes` property to define\n * a number of spikes and `innerRadius`\n *\n * @param settings\n */\n constructor(settings = {}) {\n settings.type = settings.type || 'Polygon';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['spikes', 'innerRadius']);\n super(settings, true);\n this.props.spikes = settings.spikes;\n this.props.innerRadius = settings.innerRadius;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: (propArguments) => {\n // dyamic binding in `generateLoopBuffer`\n return this.inc;\n },\n vertex: shapeLoopRepetition => {\n const angle = (Math.PI / this.spikes) * shapeLoopRepetition.index;\n const radius = shapeLoopRepetition.index % 2 === 0 ? 1 : this.innerRadius;\n return [Math.cos(angle) * radius, Math.sin(angle) * radius];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.spikes = this.getProp('spikes', propArguments, 5);\n this.innerRadius = this.getProp('innerRadius', propArguments, 0.5);\n this.inc = Math.PI / this.spikes;\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.Star = Star;\n//# sourceMappingURL=Star.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Rose = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Rose shape\n *\n * @category Core.Primitives\n * @class Rose\n * @extends {ShapeLoop}\n */\nclass Rose extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Rose.\n *\n * @param {IRoseSettings} [settings={}]\n * @memberof Rose\n */\n constructor(settings = {}) {\n var _a, _b;\n settings.type = 'Rose';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['n', 'd']);\n super(settings, true);\n this.props.n = (_a = settings.n) !== null && _a !== void 0 ? _a : 1;\n this.props.d = (_b = settings.d) !== null && _b !== void 0 ? _b : 2;\n this.loop = {\n start: 0,\n end: (propArguments) => Rose.getFinalAngleFromK(this.getProp('n', propArguments), this.getProp('d', propArguments)),\n inc: (propArguments) => {\n const n = this.getProp('n', propArguments);\n const d = this.getProp('d', propArguments);\n const sideLength = this.getRepetitionSideLength(propArguments);\n const sides = Math.pow(sideLength[0] * sideLength[1], 0.45);\n const k = d < n ? n / d : 1.5;\n return math_1.PI2 / (sides * k);\n },\n vertex: (shapeLoopRepetition) => {\n const f = Math.cos(this.k * shapeLoopRepetition.current);\n return [f * Math.cos(shapeLoopRepetition.current), f * Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.k = this.getProp('n', propArguments) / this.getProp('d', propArguments);\n return super.generateLoopBuffer(propArguments);\n }\n /**\n * Return end angle of rose\n *\n * @static\n * @param {number} n\n * @param {number} d\n * @returns {number}\n * @memberof Rose\n */\n static getFinalAngleFromK(n, d) {\n if (n == d)\n return math_1.PI2;\n const k = n / d;\n const p = n * d;\n if (!Number.isInteger(k) && k % 0.5 == 0)\n return 4 * Math.PI;\n return Math.PI * d * (p % 2 == 0 ? 2 : 1);\n }\n}\nexports.Rose = Rose;\n//# sourceMappingURL=Rose.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Spiral = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n * Spiral shape\n *\n * @category Core.Primitives\n * @class Spiral\n * @extends {ShapeLoop}\n */\nclass Spiral extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Spiral.\n *\n * @param {SpiralSettings} [settings={}]\n * @memberof Spiral\n */\n constructor(settings = {}) {\n var _a, _b, _c;\n settings.type = 'Spiral';\n settings.bClosed = false;\n settings.loopDependencies = (settings.loopDependencies || []).concat(['twists', 'twistsStart', 'spiral']);\n super(settings, true);\n this.props.spiral = (_a = settings.spiral) !== null && _a !== void 0 ? _a : Spiral.types.ARCHIMEDE;\n this.props.twists = (_b = settings.twists) !== null && _b !== void 0 ? _b : 2;\n this.props.twistsStart = (_c = settings.twistsStart) !== null && _c !== void 0 ? _c : 0;\n this.loop = {\n start: (propArguments) => math_1.PI2 * this.getProp('twistsStart', propArguments),\n end: (propArguments) => math_1.PI2 *\n (this.getProp('twistsStart', propArguments) + this.getProp('twists', propArguments)),\n inc: (propArguments) => {\n const twists = this.getProp('twists', propArguments);\n const rep = math_1.PI2 * twists;\n const sideLength = this.getRepetitionSideLength(propArguments);\n const radius = 4 + Math.sqrt(sideLength[0] * sideLength[1]);\n return rep / (radius * twists);\n },\n vertex: (shapeLoopRepetition) => {\n const r = this.r(shapeLoopRepetition.current);\n return [r * Math.cos(shapeLoopRepetition.current), r * Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.spiral = this.getProp('spiral', propArguments);\n this.r = Spiral.getRFromTSpiralType(this.spiral);\n return super.generateLoopBuffer(propArguments);\n }\n /**\n * Point position and scale factor for spiral types\n *\n * @static\n * @param {TSpiralType} spiral\n * @returns {number}\n * @memberof Spiral\n */\n static getRFromTSpiralType(spiral) {\n switch (spiral) {\n case Spiral.types.ARCHIMEDE:\n return angle => angle / 10;\n case Spiral.types.HYPERBOLIC:\n return angle => (1 / angle) * 3;\n case Spiral.types.FERMAT:\n return angle => angle ** 0.5 / 3;\n case Spiral.types.LITUUS:\n return angle => angle ** -0.5;\n case Spiral.types.LOGARITHMIC:\n return angle => Math.E ** (angle * 0.2) / 10;\n }\n return angle => angle;\n }\n}\nexports.Spiral = Spiral;\n/**\n * Spural types\n *\n * @static\n * @type {{ [name in TSpiralType]: TSpiralType }}\n * @memberof Spiral\n */\nSpiral.types = {\n ARCHIMEDE: 'ARCHIMEDE',\n HYPERBOLIC: 'HYPERBOLIC',\n FERMAT: 'FERMAT',\n LITUUS: 'LITUUS',\n LOGARITHMIC: 'LOGARITHMIC',\n};\n//# sourceMappingURL=Spiral.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Lissajous = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Lissajous shape\n *\n * @category Core.Primitives\n * @class Lissajous\n * @extends {ShapeLoop}\n */\nclass Lissajous extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Lissajous.\n *\n * @param {ILissajousSettings} [settings={}]\n * @memberof Lissajous\n */\n constructor(settings = {}) {\n settings.type = 'Lissajous';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['wx', 'wy', 'wz']);\n super(settings, true);\n this.props.wx = settings.wx || 1;\n this.props.wy = settings.wy || 2;\n this.props.wz = settings.wz || 0;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const wx = this.getProp('wx', propArguments);\n const wy = this.getProp('wy', propArguments);\n const ratio = wx == wy ? ShapeLoop_1.ShapeLoop.PId2 : 0.5 - Math.min(49, wx + wy) * 0.01;\n const sideLength = this.getRepetitionSideLength(propArguments);\n return (1 / Math.pow(sideLength[0] * sideLength[1], 0.25)) * ratio;\n },\n vertex: (shapeLoopRepetition) => {\n return this.wx === this.wy\n ? [Math.cos(shapeLoopRepetition.current + this.wz), Math.sin(shapeLoopRepetition.current)]\n : [Math.cos(this.wx * shapeLoopRepetition.current + this.wz), Math.sin(this.wy * shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.wx = this.getProp('wx', propArguments, 1);\n this.wy = this.getProp('wy', propArguments, 2);\n this.wz = this.getProp('wz', propArguments, 2);\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.Lissajous = Lissajous;\n//# sourceMappingURL=Lissajous.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SuperShape = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n * ShperShape\n *\n * @category Core.Primitives\n * @class SuperShape\n * @extends {ShapeLoop}\n */\nclass SuperShape extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of SuperShape.\n *\n * @param {ISuperShapeSettings} [settings={}]\n * @memberof SuperShape\n */\n constructor(settings = {}) {\n var _a, _b, _c, _d, _e, _f;\n settings.type = 'SuperShape';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['a', 'b', 'm', 'n1', 'n2', 'n3']);\n super(settings, true);\n this.props.a = (_a = settings.a) !== null && _a !== void 0 ? _a : 1;\n this.props.b = (_b = settings.b) !== null && _b !== void 0 ? _b : 1;\n this.props.m = (_c = settings.m) !== null && _c !== void 0 ? _c : 6;\n this.props.n1 = (_d = settings.n1) !== null && _d !== void 0 ? _d : 1;\n this.props.n2 = (_e = settings.n2) !== null && _e !== void 0 ? _e : 1;\n this.props.n3 = (_f = settings.n3) !== null && _f !== void 0 ? _f : 1;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const sideLength = this.getRepetitionSideLength(propArguments);\n return Math.PI / Math.pow(sideLength[0] * sideLength[1], 0.5);\n },\n vertex: (shapeLoopRepetition) => {\n const angle = shapeLoopRepetition.current;\n const m = (this.m * angle) / 4;\n const a = Math.abs(Math.cos(m) / this.a) ** this.n2;\n const b = Math.abs(Math.sin(m) / this.b) ** this.n3;\n const raux = (a + b) ** (1 / this.n1);\n const r = raux === 0 ? 1 : 1 / raux;\n return [r * Math.cos(angle), r * Math.sin(angle)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.a = this.getProp('a', propArguments);\n this.b = this.getProp('b', propArguments);\n this.m = this.getProp('m', propArguments);\n this.n1 = this.getProp('n1', propArguments);\n this.n2 = this.getProp('n2', propArguments);\n this.n3 = this.getProp('n3', propArguments);\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.SuperShape = SuperShape;\n//# sourceMappingURL=SuperShape.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Modifiers = void 0;\nconst Adapt_1 = require(\"./Adapt\");\nconst Mirror_1 = require(\"./Mirror\");\nconst Smooth_1 = require(\"./Smooth\");\nconst Solidify_1 = require(\"./Solidify\");\nconst Subdivide_1 = require(\"./Subdivide\");\nconst Close_1 = require(\"./Close\");\nconst Offset_1 = require(\"./Offset\");\nconst Modifiers = {\n Adapt: Adapt_1.Adapt,\n Mirror: Mirror_1.Mirror,\n Smooth: Smooth_1.Smooth,\n Solidify: Solidify_1.Solidify,\n Subdivide: Subdivide_1.Subdivide,\n Close: Close_1.Close,\n Offset: Offset_1.Offset,\n};\nexports.Modifiers = Modifiers;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Mirror = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Mirror extends Modifier_1.Modifier {\n constructor(args = { x: true, y: true }) {\n super();\n this.x = args.x === true;\n this.y = args.y === true;\n }\n apply(buffer, bClosed) {\n const bufferLength = buffer.length;\n const mirror = new Float32Array(bufferLength * (this.x ? 2 : 1) * (this.y ? 2 : 1));\n const sideLengthX = 1;\n const sideLengthY = 1;\n if (this.x && this.y) {\n const bufferLengthX2 = bufferLength + bufferLength;\n const bufferLengthX3 = bufferLengthX2 + bufferLength;\n // |1|2|\n // |4|3|\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i] - sideLengthX;\n mirror[i + 1] = buffer[i + 1] - sideLengthY;\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i] * -1 + sideLengthX;\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1] - sideLengthY;\n mirror[bufferLengthX2 + i] = buffer[i] * -1 + sideLengthX;\n mirror[bufferLengthX2 + i + 1] = buffer[i + 1] * -1 + sideLengthY;\n mirror[bufferLengthX3 + i] = buffer[bufferLength - 2 - i] - sideLengthX;\n mirror[bufferLengthX3 + i + 1] = buffer[bufferLength - 2 - i + 1] * -1 + sideLengthY;\n }\n }\n else if (this.x) {\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i] - sideLengthX;\n mirror[i + 1] = buffer[i + 1];\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i] * -1 + sideLengthX;\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1];\n }\n }\n else if (this.y) {\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i];\n mirror[i + 1] = buffer[i + 1] - sideLengthY;\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i];\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1] * -1 + sideLengthY;\n }\n }\n else {\n return buffer;\n }\n return mirror;\n }\n}\nexports.Mirror = Mirror;\n//# sourceMappingURL=Mirror.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Smooth = void 0;\nconst Utilities_1 = require(\"../Utilities\");\nconst Close_1 = require(\"./Close\");\nconst Modifier_1 = require(\"./Modifier\");\nclass Smooth extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.level = args.level || 1;\n const tension = Array.isArray(args.tension) ? args.tension : [args.tension];\n this.tension = new Array(this.level).fill(0.5).map((v, i) => Utilities_1.clamp(0, 1, tension[i] || v));\n this.level = this.level < 1 ? 1 : this.level;\n this.closed = args.closed === true;\n }\n apply(buffer, bClosed) {\n if (bClosed && !Close_1.Close.isClosed(buffer)) {\n const bufferLen = buffer.length;\n const mofified = new Float32Array(bufferLen + 2);\n mofified.set(buffer, 0);\n mofified[bufferLen] = buffer[0];\n mofified[bufferLen + 1] = buffer[1];\n buffer = mofified;\n }\n let smoothed = buffer;\n for (let i = 0, len = this.level; i < len; i++)\n smoothed = Smooth.smooth(smoothed, this.tension[i], bClosed || this.closed);\n return smoothed;\n }\n /**\n * Chaikin smooth\n *\n * the tension factor defines a scale between corner cutting distance in segment half length,\n * i.e. between 0.05 and 0.45. The opposite corner will be cut by the inverse\n * (i.e. 1-cutting distance) to keep symmetry.\n * with a tension value of 0.5 this amounts to 0.25 = 1/4 and 0.75 = 3/4,\n * the original Chaikin values\n *\n * @link https://www.codeproject.com/Articles/1093960/D-Polyline-Vertex-Smoothing\n * @param buffer\n */\n static smooth(buffer, tension = 0.5, bClosed = false) {\n const bufferLength = buffer.length;\n const smoothed = new Float32Array((buffer.length - (bClosed ? 1 : 0)) * 2);\n if (!bClosed) {\n smoothed[0] = buffer[0];\n smoothed[1] = buffer[1];\n }\n const cutdist = 0.05 + tension * 0.4;\n const ncutdist = 1 - cutdist;\n let smoothedLength = bClosed ? 0 : 2;\n for (let i = 0, len = bufferLength - 2; i < len; i += 2, smoothedLength += 4) {\n // q\n smoothed[smoothedLength] = ncutdist * buffer[i] + cutdist * buffer[i + 2];\n smoothed[smoothedLength + 1] = ncutdist * buffer[i + 1] + cutdist * buffer[i + 3];\n // r\n smoothed[smoothedLength + 2] = cutdist * buffer[i] + ncutdist * buffer[i + 2];\n smoothed[smoothedLength + 3] = cutdist * buffer[i + 1] + ncutdist * buffer[i + 3];\n }\n if (!bClosed) {\n smoothed[smoothedLength] = buffer[bufferLength - 2];\n smoothed[smoothedLength + 1] = buffer[bufferLength - 1];\n }\n else {\n smoothed[smoothedLength] = smoothed[0];\n smoothed[smoothedLength + 1] = smoothed[1];\n }\n return smoothed;\n }\n}\nexports.Smooth = Smooth;\n//# sourceMappingURL=Smooth.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Close = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Close extends Modifier_1.Modifier {\n constructor() {\n super();\n }\n apply(buffer, bClosed, shape) {\n return Close.call(buffer);\n }\n static call(buffer) {\n const len = buffer.length;\n if (Close.isClosed(buffer))\n return buffer;\n const result = new Float32Array(len + 2);\n result.set(buffer, 0);\n result[len] = result[0];\n result[len + 1] = result[1];\n return result;\n }\n static isClosed(buffer) {\n const len = buffer.length;\n return buffer[0] === buffer[len - 2] && buffer[1] === buffer[len - 1];\n }\n}\nexports.Close = Close;\n//# sourceMappingURL=Close.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Solidify = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Solidify extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.closed = args.closed === true;\n this.thickness = args.thickness || 0.2;\n this.error = args.error;\n }\n apply(buffer, bClosed) {\n return Solidify.solidify(buffer, this.thickness, this.closed, this.error);\n }\n /**\n * @link https://gist.github.com/kekscom/4194148\n */\n static solidify(buffer, thickness, bClosed = false, error) {\n const solidified = [];\n thickness = typeof thickness === 'number' ? [thickness] : thickness;\n const thicknessLength = thickness.length;\n let bFirst, bLast, prevA = [\n [0, 0],\n [0, 0],\n ], prevB = [\n [0, 0],\n [0, 0],\n ];\n for (let i = 0, t = 0, len = buffer.length - 2; i < len; i += 2, t++) {\n bFirst = i === 0;\n bLast = i === len - 2;\n const currentThicknessRep = {\n index: i + 1,\n offset: i / len,\n count: len,\n };\n const nextThicknessRep = {\n index: i + 2,\n offset: (i + 1) / len,\n count: len,\n };\n const currentThickness = typeof thickness === 'function' ? thickness(currentThicknessRep) : thickness[t % thicknessLength];\n const nextThickness = typeof thickness === 'function' ? thickness(nextThicknessRep) : thickness[(t + 1) % thicknessLength];\n const off = Solidify.getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], currentThickness);\n const off2 = Solidify.getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], nextThickness);\n const p0a = [buffer[i] + off[0], buffer[i + 1] + off[1]];\n const p1a = [buffer[i + 2] + off2[0], buffer[i + 3] + off2[1]];\n const p0b = [buffer[i] - off[0], buffer[i + 1] - off[1]];\n const p1b = [buffer[i + 2] - off2[0], buffer[i + 3] - off2[1]];\n if (!bFirst) {\n const interA = Solidify.getIntersection(prevA[0], prevA[1], p0a, p1a, error);\n if (interA) {\n solidified.unshift(interA[1]);\n solidified.unshift(interA[0]);\n }\n const interB = Solidify.getIntersection(prevB[0], prevB[1], p0b, p1b, error);\n if (interB) {\n solidified.push(interB[0]);\n solidified.push(interB[1]);\n }\n }\n if (bFirst) {\n solidified.unshift(p0a[1]);\n solidified.unshift(p0a[0]);\n solidified.push(p0b[0]);\n solidified.push(p0b[1]);\n }\n if (bLast) {\n solidified.unshift(p1a[1]);\n solidified.unshift(p1a[0]);\n solidified.push(p1b[0]);\n solidified.push(p1b[1]);\n }\n if (!bLast) {\n prevA = [p0a, p1a];\n prevB = [p0b, p1b];\n }\n }\n if (bClosed) {\n const centerIndex = buffer.length - 2;\n const lastIndex = solidified.length - 2;\n const x = 0.5 * solidified[0] + solidified[centerIndex] * 0.5;\n const y = 0.5 * solidified[1] + solidified[centerIndex + 1] * 0.5;\n const x2 = 0.5 * solidified[centerIndex + 2] + solidified[lastIndex] * 0.5;\n const y2 = 0.5 * solidified[centerIndex + 3] + solidified[lastIndex + 1] * 0.5;\n solidified[0] = x;\n solidified[1] = y;\n solidified[centerIndex] = x;\n solidified[centerIndex + 1] = y;\n solidified[centerIndex + 2] = x2;\n solidified[centerIndex + 3] = y2;\n solidified[lastIndex] = x2;\n solidified[lastIndex + 1] = y2;\n }\n return Float32Array.from(solidified);\n }\n static getOffsets(ax, ay, bx, by, thickness) {\n const dx = bx - ax, dy = by - ay, len = Math.sqrt(dx * dx + dy * dy), scale = thickness / (2 * len);\n return [-scale * dy, scale * dx];\n }\n static getIntersection(a1, b1, a2, b2, error = 0.00001) {\n // directional constants\n const k1 = (b1[1] - a1[1]) / (b1[0] - a1[0]), k2 = (b2[1] - a2[1]) / (b2[0] - a2[0]);\n // if the directional constants are equal, the lines are parallel\n // if (Math.abs(k1 - k2) < 0.00001) {\n if (Math.abs(k1 - k2) < error) {\n return;\n }\n // y offset constants for both lines\n const m1 = a1[1] - k1 * a1[0];\n const m2 = a2[1] - k2 * a2[0];\n // compute x\n const x = (m1 - m2) / (k2 - k1);\n // use y = k * x + m to get y coordinate\n const y = k1 * x + m1;\n return [x, y];\n }\n}\nexports.Solidify = Solidify;\n//# sourceMappingURL=Solidify.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Subdivide = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Subdivide extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.level = args.level || 1;\n this.level = this.level < 1 ? 1 : this.level;\n }\n apply(buffer, bClosed) {\n const level = this.level;\n let subdivided = buffer;\n if (subdivided && subdivided.length > 0) {\n for (let i = 0; i < level; i++)\n subdivided = Subdivide.subdivide(subdivided, bClosed);\n }\n return subdivided;\n }\n /**\n * Subdivide buffer\n *\n * @static\n * @param {Float32Array} shape\n * @param {boolean} [bClosed=true]\n * @returns {(Float32Array)}\n */\n static subdivide(buffer, bClosed = false) {\n const bufferLength = buffer.length;\n const subdivided = new Float32Array(bufferLength * 2 - (bClosed ? 0 : 2));\n for (let i = 0; i < bufferLength; i += 2) {\n if (i === 0) {\n subdivided[0] = buffer[0];\n subdivided[1] = buffer[1];\n }\n else {\n const px = buffer[i - 2];\n const py = buffer[i - 1];\n const x = buffer[i];\n const y = buffer[i + 1];\n const nx = (x + px) / 2;\n const ny = (y + py) / 2;\n subdivided[(i - 1) * 2] = nx;\n subdivided[(i - 1) * 2 + 1] = ny;\n subdivided[i * 2] = x;\n subdivided[i * 2 + 1] = y;\n }\n }\n if (bClosed) {\n subdivided[(bufferLength - 1) * 2] = (buffer[0] + buffer[bufferLength - 2]) / 2;\n subdivided[(bufferLength - 1) * 2 + 1] = (buffer[1] + buffer[bufferLength - 1]) / 2;\n }\n return subdivided;\n }\n}\nexports.Subdivide = Subdivide;\n//# sourceMappingURL=Subdivide.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Offset = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Offset extends Modifier_1.Modifier {\n constructor(args = { from: 0, to: undefined }) {\n super();\n this.from = args.from;\n this.to = args.to;\n }\n apply(buffer, bClosed) {\n return buffer.subarray(this.from, this.to ? (this.to < 0 ? buffer.length + this.to : this.to) : undefined);\n }\n}\nexports.Offset = Offset;\n//# sourceMappingURL=Offset.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./utilities\"), exports);\n__exportStar(require(\"./createAnimation\"), exports);\n__exportStar(require(\"./createInterpolator\"), exports);\n__exportStar(require(\"./Easings\"), exports);\n__exportStar(require(\"./Animation\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.interpolateColorHSL = exports.interpolateColorRGB = exports.cosp = exports.sinp = exports.clockOffset = exports.clock = void 0;\n/**\n * Return time (from 0 to duration) in milliseconds\n *\n * @export\n * @param {number} time Current time\n * @param {number} duration Clock duration\n * @param {(number | boolean)} [loop=true]\n * @param {('normal' | 'reverse' | 'alternate')} [direction='alternate']\n * @param {number} [delay=0]\n * @param {number} [afterDelay=0]\n * @return {*} {number} Between 0 and duration\n */\nfunction clock(time, duration, loop = true, direction = 'alternate', delay = 0, afterDelay = 0) {\n const totalDuration = direction === 'normal'\n ? duration + delay\n : direction === 'reverse'\n ? duration + delay\n : duration * 2 + delay + afterDelay;\n if ((typeof loop === 'number' && time >= totalDuration * loop) || (loop === false && time >= totalDuration)) {\n return direction === 'normal' ? duration : 0;\n }\n time %= totalDuration;\n if ((time -= delay) <= 0) {\n return 0;\n }\n if (direction === 'alternate') {\n if (time <= duration) {\n // normal\n return time;\n }\n else {\n // reverse\n time -= duration;\n if ((time -= afterDelay) >= 0) {\n return duration - (time >= duration ? duration : time);\n }\n return duration;\n }\n }\n else {\n return time >= duration ? duration : time;\n }\n}\nexports.clock = clock;\n/**\n * Return offset between 0 and 1 from current time based on duration and other parameters\n *\n * @export\n * @param {number} time\n * @param {number} duration\n * @param {(number | boolean)} [loop=true]\n * @param {('normal' | 'reverse' | 'alternate')} [direction='alternate']\n * @param {number} [delay=0]\n * @param {number} [afterDelay=0]\n * @return {*} {number}\n */\nfunction clockOffset(time, duration, loop = true, direction = 'alternate', delay = 0, afterDelay = 0) {\n return clock(time, duration, loop, direction, delay, afterDelay) / duration;\n}\nexports.clockOffset = clockOffset;\nconst PI2 = Math.PI * 2;\n/**\n * Return sin of period 'durate' in time 'time'\n *\n * @export\n * @param {number} time\n * @param {number} durate\n * @param {number} phase\n * @param {boolean} [normalize=false]\n * @return {*} {number}\n */\nfunction sinp(time, durate, phase = 0, normalize = false) {\n const value = Math.sin((time * PI2) / durate + phase);\n return normalize ? 0.5 + value * 0.5 : value;\n}\nexports.sinp = sinp;\n/**\n * Return cos of period 'durate' in time 'time'\n *\n * @export\n * @param {number} time\n * @param {number} durate\n * @param {number} phase\n * @param {boolean} [normalize=false]\n * @return {*} {number}\n */\nfunction cosp(time, durate, phase = 0, normalize = false) {\n const value = Math.cos((time * PI2) / durate + phase);\n return normalize ? 0.5 + value * 0.5 : value;\n}\nexports.cosp = cosp;\nfunction interpolateColorRGB(start, end, offset) {\n const r = start.r + offset * (end.r - start.r);\n const g = start.g + offset * (end.g - start.g);\n const b = start.b + offset * (end.b - start.b);\n const alpha = start.alpha + offset * (end.alpha - start.alpha);\n return `rgba(${Math.floor(r)},${Math.floor(g)},${Math.floor(b)},${alpha})`;\n}\nexports.interpolateColorRGB = interpolateColorRGB;\nfunction interpolateColorHSL(start, end, offset) {\n const h = start.h + offset * (end.h - start.h);\n const s = start.s + offset * (end.s - start.s);\n const l = start.l + offset * (end.l - start.l);\n const alpha = start.alpha + offset * (end.alpha - start.alpha);\n return `hsla(${h},${s}%,${l}%,${alpha})`;\n}\nexports.interpolateColorHSL = interpolateColorHSL;\n//# sourceMappingURL=utilities.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createAnimation = void 0;\nconst createInterpolator_1 = require(\"./createInterpolator\");\n/**\n * Create TAnimation from object\n *\n * @param simpleAnimation\n * @returns\n */\nfunction createAnimation(simpleAnimation) {\n const interpolate = createInterpolator_1.createInterpolationCallback(simpleAnimation);\n if (typeof interpolate === 'undefined')\n return undefined;\n const delay = simpleAnimation.delay || 0;\n const afterDelay = simpleAnimation.afterDelay || 0;\n const direction = simpleAnimation.direction || 'normal';\n const duration = simpleAnimation.duration || 1000;\n const totalDuration = direction === 'normal'\n ? duration + delay\n : direction === 'reverse'\n ? duration + delay\n : duration * 2 + delay + afterDelay;\n const loop = typeof simpleAnimation.loop === 'number' ? simpleAnimation.loop : !!simpleAnimation.loop;\n const bindedValues = {\n delay,\n afterDelay,\n direction,\n duration,\n totalDuration,\n loop,\n };\n const animationFunction = createInterpolator_1.createInterpolator(simpleAnimation.interpolator);\n const animation = {\n loop: 0,\n offset: 0,\n loopDuration: totalDuration,\n direction: direction === 'alternate' ? 'normal' : direction,\n started: false,\n ended: false,\n value: undefined,\n };\n animation.update = createUpdate(animation, bindedValues, animationFunction, interpolate);\n return animation;\n}\nexports.createAnimation = createAnimation;\n/**\n *\n * @internal\n * @param animation\n * @param bindedValues\n * @param animationFunction\n * @param interpolate\n * @returns\n */\nfunction createUpdate(animation, bindedValues, animationFunction, interpolate) {\n const { loop, totalDuration, delay, afterDelay, direction, duration } = bindedValues;\n return (time) => {\n // Check animation is ended\n if ((typeof loop === 'number' && time >= totalDuration * loop) ||\n (loop === false && time >= bindedValues.totalDuration)) {\n animation.started = false;\n animation.ended = true;\n animation.offset = animationFunction(direction === 'normal' ? duration : 0, duration);\n animation.value = interpolate(animation.offset);\n return;\n }\n animation.loop = Math.ceil(time / totalDuration);\n time %= totalDuration;\n if ((time -= delay) <= 0) {\n animation.started = false;\n animation.offset = animationFunction(0, duration);\n animation.value = interpolate(animation.offset);\n return;\n }\n animation.started = true;\n if (direction === 'alternate') {\n if (time <= duration) {\n animation.direction = 'normal';\n animation.offset = animationFunction(time, duration);\n }\n else {\n animation.direction = 'reverse';\n time -= duration;\n // wait afterDelay\n if ((time -= afterDelay) >= 0) {\n animation.offset = 1 - animationFunction(time >= duration ? duration : time, duration);\n }\n else {\n animation.offset = 1;\n }\n }\n }\n else {\n const animationValue = animationFunction(time >= duration ? duration : time, duration);\n animation.offset = direction === 'normal' ? animationValue : 1 - animationValue;\n }\n animation.value = interpolate(animation.offset);\n };\n}\n//# sourceMappingURL=createAnimation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createInterpolator = exports.createInterpolationCallback = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst bezier_easing_1 = require(\"bezier-easing\");\nconst Easings_1 = require(\"./Easings\");\nconst utilities_1 = require(\"./utilities\");\n/**\n * Return a callback for value interpolation passing offset from 0 to 1\n *\n * @param simpleAnimation\n * @returns\n */\nfunction createInterpolationCallback(simpleAnimation) {\n const from = Array.isArray(simpleAnimation.from) ? simpleAnimation.from : [simpleAnimation.from];\n const to = Array.isArray(simpleAnimation.to) ? simpleAnimation.to : [simpleAnimation.to];\n const round = simpleAnimation.round;\n const colorInterpolation = simpleAnimation.colorTransitionMode === 'hue' ? utilities_1.interpolateColorHSL : utilities_1.interpolateColorRGB;\n if (from.length !== to.length)\n return undefined;\n const callbacks = [];\n for (let i = 0, len = from.length; i < len; i++) {\n if (typeof from[i] !== typeof to[i]) {\n console.warn('[@urpflanze/animation]: `from` and `to` values mismatch');\n return undefined;\n }\n else {\n if (typeof from[i] !== 'string') {\n const a = from[i], b = to[i];\n callbacks.push(typeof round !== 'undefined'\n ? (offset) => offset === 1 ? b : offset === 0 ? a : Math.round((a + offset * (b - a)) * round) / round\n : (offset) => (offset === 1 ? b : offset === 0 ? a : a + offset * (b - a)));\n }\n else {\n const a = from[i];\n const b = to[i];\n const parsed_a = color_1.parseColorAndConvert(a);\n const parsed_b = color_1.parseColorAndConvert(b);\n if (typeof parsed_a !== 'undefined' && typeof parsed_b !== 'undefined') {\n callbacks.push((offset) => offset === 1 ? b : offset === 0 ? a : colorInterpolation(parsed_a, parsed_b, offset));\n }\n }\n }\n }\n return (offset) => {\n const values = callbacks.map(c => c(offset));\n return values.length === 1 ? values[0] : values;\n };\n}\nexports.createInterpolationCallback = createInterpolationCallback;\n/**\n * Return a callback for calculate offset (0 to 1) from elapsed time and animation duration\n *\n * @param type\n * @returns\n */\nfunction createInterpolator(type) {\n var _a, _b;\n switch (typeof type) {\n case 'function':\n return (elapsed, duration) => type(elapsed / duration, elapsed);\n case 'string':\n switch (type) {\n case 'wave':\n return (elapsed, duration) => 0.5 + Math.sin((elapsed * Math.PI * 2) / duration + Math.PI * 1.5) * 0.5;\n default: {\n if (type in Easings_1.Easings) {\n const easing = Easings_1.Easings[type];\n return (elapsed, duration) => easing(elapsed, 0, 1, duration);\n }\n return (elapsed, duration) => Easings_1.Easings.linear(elapsed, 0, 1, duration);\n }\n }\n case 'object':\n switch (type.type) {\n case 'wave': {\n const phase = Math.PI * 1.5 + (((_a = type.params) === null || _a === void 0 ? void 0 : _a.phase) || 0);\n return (elapsed, duration) => {\n return 0.5 + Math.sin((elapsed * Math.PI * 2) / duration + phase) * 0.5;\n };\n }\n case 'elasticIn':\n case 'elasticOut':\n case 'elasticInOut': {\n const easing = Easings_1.Easings[type.type];\n const { amplitude, period } = type.params || {};\n return (elapsed, duration) => easing(elapsed, 0, 1, duration, amplitude, period);\n }\n case 'backIn':\n case 'backOut':\n case 'backInOut': {\n const easing = Easings_1.Easings[type.type];\n const overshoot = ((_b = type.params) === null || _b === void 0 ? void 0 : _b.overshoot) || undefined;\n return (elapsed, duration) => easing(elapsed, 0, 1, duration, overshoot);\n }\n case 'cubicBezier': {\n const easing = bezier_easing_1.default(type.params[0], type.params[1], type.params[2], type.params[3]);\n return (elapsed, duration) => easing(elapsed / duration);\n }\n }\n }\n return (elapsed, duration) => Easings_1.Easings.linear(elapsed, 0, 1, duration);\n}\nexports.createInterpolator = createInterpolator;\n//# sourceMappingURL=createInterpolator.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./conversions\"), exports);\n__exportStar(require(\"./parsing\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.rgbToHsl = exports.hslToRgb = exports.rgbToHex = void 0;\n/**\n * Convert rgb to hex\n *\n * @param r number between 0 - 255\n * @param g number between 0 - 255\n * @param b number between 0 - 255\n * @returns #ffffff\n */\nfunction rgbToHex(r, g, b) {\n return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;\n}\nexports.rgbToHex = rgbToHex;\n/**\n * Convert hsl (0-360, 0-100, 0-100) color to rgb(0-255, 0-255, 0-255)\n *\n * @param {number} h number between 0 - 360\n * @param {number} s number between 0 - 100\n * @param {number} l number between 0 - 100\n * @returns {[number, number, number]} [0-255, 0-255, 0-255]\n */\nfunction hslToRgb(h, s, l) {\n h /= 360;\n s /= 100;\n l /= 100;\n let r, g, b;\n if (s == 0) {\n r = g = b = l; // achromatic\n }\n else {\n const hue2rgb = (p, q, t) => {\n t += t < 0 ? 1 : t > 1 ? -1 : 0;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n };\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return [(0.5 + r * 255) << 0, (0.5 + g * 255) << 0, (0.5 + b * 255) << 0];\n}\nexports.hslToRgb = hslToRgb;\n/**\n * Convert rbg (0-255, 0-255, 0-255) to hsl (0-360, 0-100, 0-100)\n *\n * @param {number} r number between 0 - 255\n * @param {number} g number between 0 - 255\n * @param {number} b number between 0 - 255\n * @returns {[number, number, number]} (0-360, 0-100, 0-100)\n */\nfunction rgbToHsl(r, g, b) {\n r /= 255;\n g /= 255;\n b /= 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s;\n if (max === min) {\n h = s = 0;\n }\n else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h = h / 6;\n }\n return [(0.5 + h * 360) << 0, (0.5 + s * 100) << 0, (0.5 + l * 100) << 0];\n}\nexports.rgbToHsl = rgbToHsl;\n//# sourceMappingURL=conversions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseColor = exports.parseColorAndConvert = void 0;\nconst htmlcolors_1 = require(\"./htmlcolors\");\nconst conversions_1 = require(\"./conversions\");\n/**\n * Convert color to IConvertedColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IConvertedColor | undefined)}\n */\nfunction parseColorAndConvert(color) {\n const parsed = parseColor(color);\n if (parsed) {\n if (parsed.type === 'hsl') {\n const [r, g, b] = conversions_1.hslToRgb(parsed.a, parsed.b, parsed.c);\n return {\n r,\n g,\n b,\n h: parsed.a,\n s: parsed.b,\n l: parsed.c,\n alpha: parsed.alpha,\n };\n }\n else {\n const [h, s, l] = conversions_1.rgbToHsl(parsed.a, parsed.b, parsed.c);\n return {\n h,\n s,\n l,\n r: parsed.a,\n g: parsed.b,\n b: parsed.c,\n alpha: parsed.alpha,\n };\n }\n }\n}\nexports.parseColorAndConvert = parseColorAndConvert;\n/**\n * Convert color to IColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IColor | undefined)}\n */\nfunction parseColor(color) {\n if (typeof color === 'number') {\n if (color > 0xffffff) {\n return {\n type: 'rgb',\n a: (color >> 24) & 255,\n b: (color >> 16) & 255,\n c: (color >> 8) & 255,\n alpha: (color & 255) / 255,\n };\n }\n else {\n return { type: 'rgb', a: (color >> 16) & 255, b: (color >> 8) & 255, c: color & 255, alpha: 1 };\n }\n }\n color = color.replace(/\\s/g, '');\n if (htmlcolors_1.default[color])\n color = htmlcolors_1.default[color];\n let match = /^#([0-9a-f]{3,8})$/i.exec(color);\n if (match) {\n const hex = match[1];\n if (hex.length === 3) {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[0], 16),\n b: parseInt(hex[1] + hex[1], 16),\n c: parseInt(hex[2] + hex[2], 16),\n alpha: 1,\n };\n }\n else {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[1], 16),\n b: parseInt(hex[2] + hex[3], 16),\n c: parseInt(hex[4] + hex[5], 16),\n alpha: hex.length > 6 ? parseInt(hex.substring(6), 16) / 255 : 1,\n };\n }\n }\n match = /^((hsl|rgb)a?)\\((\\d+),(\\d+)%?,(\\d+)%?,?(.+)?\\)$/i.exec(color);\n if (match) {\n const [, , type, a, b, c, alpha] = match;\n return {\n type: type,\n a: +a,\n b: +b,\n c: +c,\n alpha: alpha ? +alpha : 1,\n };\n }\n}\nexports.parseColor = parseColor;\n//# sourceMappingURL=parsing.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst colors = {\n aliceblue: '#f0f8ff',\n antiquewhite: '#faebd7',\n aqua: '#00ffff',\n aquamarine: '#7fffd4',\n azure: '#f0ffff',\n beige: '#f5f5dc',\n bisque: '#ffe4c4',\n black: '#000000',\n blanchedalmond: '#ffebcd',\n blue: '#0000ff',\n blueviolet: '#8a2be2',\n brown: '#a52a2a',\n burlywood: '#deb887',\n cadetblue: '#5f9ea0',\n chartreuse: '#7fff00',\n chocolate: '#d2691e',\n coral: '#ff7f50',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyan: '#00ffff',\n darkblue: '#00008b',\n darkcyan: '#008b8b',\n darkgoldenrod: '#b8860b',\n darkgray: '#a9a9a9',\n darkgreen: '#006400',\n darkkhaki: '#bdb76b',\n darkmagenta: '#8b008b',\n darkolivegreen: '#556b2f',\n darkorange: '#ff8c00',\n darkorchid: '#9932cc',\n darkred: '#8b0000',\n darksalmon: '#e9967a',\n darkseagreen: '#8fbc8f',\n darkslateblue: '#483d8b',\n darkslategray: '#2f4f4f',\n darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n gold: '#ffd700',\n goldenrod: '#daa520',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n indianred: '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n lavender: '#e6e6fa',\n lavenderblush: '#fff0f5',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrodyellow: '#fafad2',\n lightgrey: '#d3d3d3',\n lightgreen: '#90ee90',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\n maroon: '#800000',\n mediumaquamarine: '#66cdaa',\n mediumblue: '#0000cd',\n mediumorchid: '#ba55d3',\n mediumpurple: '#9370d8',\n mediumseagreen: '#3cb371',\n mediumslateblue: '#7b68ee',\n mediumspringgreen: '#00fa9a',\n mediumturquoise: '#48d1cc',\n mediumvioletred: '#c71585',\n midnightblue: '#191970',\n mintcream: '#f5fffa',\n mistyrose: '#ffe4e1',\n moccasin: '#ffe4b5',\n navajowhite: '#ffdead',\n navy: '#000080',\n oldlace: '#fdf5e6',\n olive: '#808000',\n olivedrab: '#6b8e23',\n orange: '#ffa500',\n orangered: '#ff4500',\n orchid: '#da70d6',\n palegoldenrod: '#eee8aa',\n palegreen: '#98fb98',\n paleturquoise: '#afeeee',\n palevioletred: '#d87093',\n papayawhip: '#ffefd5',\n peachpuff: '#ffdab9',\n peru: '#cd853f',\n pink: '#ffc0cb',\n plum: '#dda0dd',\n powderblue: '#b0e0e6',\n purple: '#800080',\n rebeccapurple: '#663399',\n red: '#ff0000',\n rosybrown: '#bc8f8f',\n royalblue: '#4169e1',\n saddlebrown: '#8b4513',\n salmon: '#fa8072',\n sandybrown: '#f4a460',\n seagreen: '#2e8b57',\n seashell: '#fff5ee',\n sienna: '#a0522d',\n silver: '#c0c0c0',\n skyblue: '#87ceeb',\n slateblue: '#6a5acd',\n slategray: '#708090',\n snow: '#fffafa',\n springgreen: '#00ff7f',\n steelblue: '#4682b4',\n tan: '#d2b48c',\n teal: '#008080',\n thistle: '#d8bfd8',\n tomato: '#ff6347',\n turquoise: '#40e0d0',\n violet: '#ee82ee',\n wheat: '#f5deb3',\n white: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32',\n};\nexports.default = colors;\n//# sourceMappingURL=htmlcolors.js.map","/**\n * https://github.com/gre/bezier-easing\n * BezierEasing - use bezier curve for transition easing function\n * by Gaëtan Renaudeau 2014 - 2015 – MIT License\n */\n\n// These values are established by empiricism with tests (tradeoff: performance VS precision)\nvar NEWTON_ITERATIONS = 4;\nvar NEWTON_MIN_SLOPE = 0.001;\nvar SUBDIVISION_PRECISION = 0.0000001;\nvar SUBDIVISION_MAX_ITERATIONS = 10;\n\nvar kSplineTableSize = 11;\nvar kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\nvar float32ArraySupported = typeof Float32Array === 'function';\n\nfunction A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\nfunction B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\nfunction C (aA1) { return 3.0 * aA1; }\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nfunction calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }\n\n// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\nfunction getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); }\n\nfunction binarySubdivide (aX, aA, aB, mX1, mX2) {\n var currentX, currentT, i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n return currentT;\n}\n\nfunction newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {\n for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n if (currentSlope === 0.0) {\n return aGuessT;\n }\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n}\n\nfunction LinearEasing (x) {\n return x;\n}\n\nmodule.exports = function bezier (mX1, mY1, mX2, mY2) {\n if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {\n throw new Error('bezier x values must be in [0, 1] range');\n }\n\n if (mX1 === mY1 && mX2 === mY2) {\n return LinearEasing;\n }\n\n // Precompute samples table\n var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n for (var i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n\n function getTForX (aX) {\n var intervalStart = 0.0;\n var currentSample = 1;\n var lastSample = kSplineTableSize - 1;\n\n for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n --currentSample;\n\n // Interpolate to provide an initial guess for t\n var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n var guessForT = intervalStart + dist * kSampleStepSize;\n\n var initialSlope = getSlope(guessForT, mX1, mX2);\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if (initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n }\n\n return function BezierEasing (x) {\n // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n if (x === 0) {\n return 0;\n }\n if (x === 1) {\n return 1;\n }\n return calcBezier(getTForX(x), mY1, mY2);\n };\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Easings = void 0;\n/**\n * Easing functions\n *\n * @category Services.Animation\n */\nconst Easings = {\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n linear: (timeOrOffset, start, end, duration = 1) => (end * timeOrOffset) / duration + start,\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return -end * timeOrOffset * (timeOrOffset - 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset + start;\n timeOrOffset--;\n return (-end / 2) * (timeOrOffset * (timeOrOffset - 2) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * (timeOrOffset * timeOrOffset * timeOrOffset + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return -end * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (-end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset - 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalIn: (timeOrOffset, start, end, duration = 1) => {\n return -end * Math.cos((timeOrOffset / duration) * (Math.PI / 2)) + end + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalOut: (timeOrOffset, start, end, duration = 1) => {\n return end * Math.sin((timeOrOffset / duration) * (Math.PI / 2)) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalInOut: (timeOrOffset, start, end, duration = 1) => {\n return (-end / 2) * (Math.cos((Math.PI * timeOrOffset) / duration) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialIn: (timeOrOffset, start, end, duration = 1) => {\n return end * Math.pow(2, 10 * (timeOrOffset / duration - 1)) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialOut: (timeOrOffset, start, end, duration = 1) => {\n return end * (-Math.pow(2, (-10 * timeOrOffset) / duration) + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * Math.pow(2, 10 * (timeOrOffset - 1)) + start;\n timeOrOffset--;\n return (end / 2) * (-Math.pow(2, -10 * timeOrOffset) + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return -end * (Math.sqrt(1 - timeOrOffset * timeOrOffset) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * Math.sqrt(1 - timeOrOffset * timeOrOffset) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (-end / 2) * (Math.sqrt(1 - timeOrOffset * timeOrOffset) - 1) + start;\n timeOrOffset -= 2;\n return (end / 2) * (Math.sqrt(1 - timeOrOffset * timeOrOffset) + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticIn: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration) === 1) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n return (-(amplitude *\n Math.pow(2, 10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period)) + start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticOut: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration) === 1) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n return (amplitude * Math.pow(2, -10 * timeOrOffset) * Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period) +\n end +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticInOut: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration / 2) === 2) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n if (timeOrOffset < 1) {\n return (-0.5 *\n (amplitude *\n Math.pow(2, 10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period)) +\n start);\n }\n return (amplitude *\n Math.pow(2, -10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period) *\n 0.5 +\n end +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} overshoot (optional)\n * @return {number}\n */\n backIn: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n return end * (timeOrOffset /= duration) * timeOrOffset * ((overshoot + 1) * timeOrOffset - overshoot) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} s overshoot (optional)\n * @return {number}\n */\n backOut: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n return (end *\n ((timeOrOffset = timeOrOffset / duration - 1) * timeOrOffset * ((overshoot + 1) * timeOrOffset + overshoot) +\n 1) +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} overshoot (optional)\n * @return {number}\n */\n backInOut: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n if ((timeOrOffset /= duration / 2) < 1) {\n return (end / 2) * (timeOrOffset * timeOrOffset * (((overshoot *= 1.525) + 1) * timeOrOffset - overshoot)) + start;\n }\n return ((end / 2) * ((timeOrOffset -= 2) * timeOrOffset * (((overshoot *= 1.525) + 1) * timeOrOffset + overshoot) + 2) +\n start);\n },\n /**\n * @param {number} t current time\n * @param {number} b start value\n * @param {number} c end value\n * @param {number} d duration\n * @return {number}\n */\n bounceIn: (timeOrOffset, start, end, duration = 1) => {\n return end - Easings.bounceOut(duration - timeOrOffset, 0, end, duration) + start;\n },\n /**\n * @param {number} t current time\n * @param {number} b start value\n * @param {number} c end value\n * @param {number} d duration\n * @return {number}\n */\n bounceOut: (timeOrOffset, start, end, duration = 1) => {\n if ((timeOrOffset /= duration) < 1 / 2.75) {\n return end * (7.5625 * timeOrOffset * timeOrOffset) + start;\n }\n else if (timeOrOffset < 2 / 2.75) {\n return end * (7.5625 * (timeOrOffset -= 1.5 / 2.75) * timeOrOffset + 0.75) + start;\n }\n else if (timeOrOffset < 2.5 / 2.75) {\n return end * (7.5625 * (timeOrOffset -= 2.25 / 2.75) * timeOrOffset + 0.9375) + start;\n }\n return end * (7.5625 * (timeOrOffset -= 2.625 / 2.75) * timeOrOffset + 0.984375) + start;\n },\n /**\n *\n *\n * @param {number} time\n * @param {number} start\n * @param {number} end\n * @param {number} duration\n * @returns\n */\n bounceInOut: (timeOrOffset, start, end, duration = 1) => {\n if (timeOrOffset < duration / 2) {\n return Easings.bounceIn(timeOrOffset * 2, 0, end, duration) * 0.5 + start;\n }\n return Easings.bounceOut(timeOrOffset * 2 - duration, 0, end, duration) * 0.5 + end * 0.5 + start;\n },\n};\nexports.Easings = Easings;\n//# sourceMappingURL=Easings.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UncontrolledLoop = exports.Static = exports.Loop = exports.Compose = exports.Simple = exports.resolveSimpleAnimation = void 0;\nconst composeAnimations_1 = require(\"./composeAnimations\");\nconst createAnimation_1 = require(\"./createAnimation\");\nfunction resolveSimpleAnimation(simpleAnimation) {\n const animation = createAnimation_1.createAnimation(simpleAnimation);\n if (animation) {\n return (propArgumentsOrCurrentTime) => {\n var _a;\n const currentTime = typeof propArgumentsOrCurrentTime === 'number'\n ? propArgumentsOrCurrentTime\n : ((_a = propArgumentsOrCurrentTime.shape.scene) === null || _a === void 0 ? void 0 : _a.currentTime) || 0;\n animation.update(currentTime);\n return animation.value;\n };\n }\n}\nexports.resolveSimpleAnimation = resolveSimpleAnimation;\n// Alias\nexports.Simple = resolveSimpleAnimation;\n// Compose multiple animations\nconst Compose = (animations) => {\n const composed = composeAnimations_1.composeAnimations(animations);\n if (composed) {\n return (propArgumentsOrCurrentTime) => {\n var _a;\n const currentTime = typeof propArgumentsOrCurrentTime === 'number'\n ? propArgumentsOrCurrentTime\n : ((_a = propArgumentsOrCurrentTime.shape.scene) === null || _a === void 0 ? void 0 : _a.currentTime) || 0;\n return composed(currentTime);\n };\n }\n};\nexports.Compose = Compose;\nconst Loop = (loopAnimation) => {\n const simpleAnimation = loopAnimation;\n if (typeof simpleAnimation.interpolator === 'undefined') {\n simpleAnimation.interpolator = 'wave';\n }\n if (simpleAnimation.interpolator) {\n if (typeof simpleAnimation.interpolator === 'string') {\n if (simpleAnimation.interpolator !== 'wave') {\n simpleAnimation.direction = 'alternate';\n }\n }\n else if (typeof simpleAnimation.interpolator === 'object' && simpleAnimation.interpolator.type !== 'wave') {\n simpleAnimation.direction = 'alternate';\n }\n }\n simpleAnimation.loop = true;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.Loop = Loop;\nconst Static = (staticAnimation) => {\n const simpleAnimation = staticAnimation;\n simpleAnimation.direction = 'normal';\n simpleAnimation.loop = false;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.Static = Static;\nconst UncontrolledLoop = (uncontrolledLoopAnimation) => {\n const simpleAnimation = uncontrolledLoopAnimation;\n simpleAnimation.direction = 'normal';\n simpleAnimation.loop = true;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.UncontrolledLoop = UncontrolledLoop;\n//# sourceMappingURL=Animation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.composeAnimations = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst createAnimation_1 = require(\"./createAnimation\");\nconst utilities_1 = require(\"./utilities\");\n/**\n *\n *\n * @export\n * @param {Array} simpleAnimations\n * @return {*} {(((currentTime: number) => string | number | Array | undefined) | undefined)}\n */\nfunction composeAnimations(simpleAnimations) {\n const animations = simpleAnimations.map(createAnimation_1.createAnimation).filter(a => typeof a !== 'undefined');\n const animationsLength = animations.length;\n if (animationsLength > 0) {\n return (currentTime) => {\n let value = undefined;\n for (let i = 0; i < animationsLength; i++) {\n const animation = animations[i];\n animation.update(currentTime);\n value = typeof value === 'undefined' ? animation.value : interpolate(value, animation.value);\n }\n return value;\n };\n }\n}\nexports.composeAnimations = composeAnimations;\nfunction interpolate(a, b, offset = 0.5) {\n const from = Array.isArray(a) ? a : [a];\n const to = Array.isArray(b) ? b : [b];\n const results = [];\n for (let i = 0, len = from.length; i < len; i++) {\n if (typeof from[i] !== typeof to[i]) {\n console.error('[@urpflanze/animation]: cannot interpolate');\n return undefined;\n }\n else {\n if (typeof from[i] !== 'string') {\n const a = from[i], b = to[i];\n results.push(a + offset * (b - a));\n }\n else {\n const a = from[i];\n const b = to[i];\n const parsed_a = color_1.parseColorAndConvert(a);\n const parsed_b = color_1.parseColorAndConvert(b);\n if (typeof parsed_a !== 'undefined' && typeof parsed_b !== 'undefined') {\n results.push(utilities_1.interpolateColorRGB(parsed_a, parsed_b, offset));\n }\n }\n }\n }\n return results.length === 1 ? results[0] : results;\n}\n//# sourceMappingURL=composeAnimations.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BrowserDrawerCanvas = void 0;\nconst DrawerCanvas_1 = require(\"../DrawerCanvas\");\nconst utils_1 = require(\"../utils\");\n/**\n *\n * @category DrawerCanvas\n * @class BrowserDrawerCanvas\n * @extends {DrawerCanvas}\n */\nclass BrowserDrawerCanvas extends DrawerCanvas_1.DrawerCanvas {\n constructor(scene, canvasOrContainer, drawerOptions, duration = 60000, framerate = 60) {\n super(scene, canvasOrContainer, drawerOptions, duration, framerate);\n this.dpi = 1;\n this.dpi = (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.dpi) || 1;\n this.draw_id = null;\n this.redraw_id = null;\n this.animation_id = null;\n this.draw = this.draw.bind(this);\n this.animate = this.animate.bind(this);\n this.startAnimation = this.startAnimation.bind(this);\n this.resize(this.drawerOptions.width, this.drawerOptions.height);\n }\n resize(width, height, sceneFit, dpi = this.dpi) {\n this.drawerOptions.width = width * dpi;\n this.drawerOptions.height = height * dpi;\n if (this.canvas) {\n this.canvas.width = width * dpi;\n this.canvas.height = height * dpi;\n if (utils_1.bBrowser && this.canvas instanceof HTMLCanvasElement) {\n this.canvas.style.width = width + 'px';\n this.canvas.style.height = height + 'px';\n }\n }\n if (typeof sceneFit !== 'undefined') {\n this.drawerOptions.sceneFit = sceneFit;\n }\n this.dispatch('drawer-canvas:resize');\n }\n /**\n * Internal tick animation\n */\n animate(timestamp) {\n if (this.timeline.bSequenceStarted()) {\n this.animation_id = requestAnimationFrame(this.animate);\n if (this.timeline.tick(timestamp))\n this.draw();\n }\n }\n /**\n * Start animation drawing\n */\n startAnimation() {\n this.stopAnimation();\n this.timeline.start();\n this.animation_id = requestAnimationFrame(this.animate);\n }\n /**\n * Stop animation drawing\n */\n stopAnimation() {\n this.timeline.stop();\n if (this.animation_id)\n cancelAnimationFrame(this.animation_id);\n }\n /**\n * Pause animation drawing\n */\n pauseAnimation() {\n this.timeline.pause();\n if (this.animation_id)\n cancelAnimationFrame(this.animation_id);\n }\n /**\n * Play animation drawing\n */\n playAnimation() {\n this.timeline.start();\n requestAnimationFrame(this.animate);\n }\n redraw() {\n if (!this.timeline.bSequenceStarted()) {\n this.draw_id && cancelAnimationFrame(this.draw_id);\n if (typeof this.drawerOptions.ghosts === undefined || this.drawerOptions.ghosts === 0)\n this.timeline.stop();\n this.draw_id = requestAnimationFrame(this.draw);\n }\n else if (typeof this.drawerOptions.ghosts === undefined || this.drawerOptions.ghosts === 0) {\n this.stopAnimation();\n this.redraw_id && cancelAnimationFrame(this.redraw_id);\n this.redraw_id = requestAnimationFrame(this.startAnimation);\n }\n }\n}\nexports.BrowserDrawerCanvas = BrowserDrawerCanvas;\n//# sourceMappingURL=BrowserDrawerCanvas.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DrawerCanvas = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nconst math_1 = require(\"@urpflanze/core/dist/cjs/math\");\nconst Vec2_1 = require(\"@urpflanze/core/dist/cjs/math/Vec2\");\nconst canvas_1 = require(\"canvas\");\nconst Emitter_1 = require(\"./Emitter\");\nconst Timeline_1 = require(\"./Timeline\");\nconst utils_1 = require(\"./utils\");\n/**\n *\n * @category DrawerCanvas\n * @extends {Emitter}\n */\nclass DrawerCanvas extends Emitter_1.Emitter {\n constructor(scene, canvasOrContainer, drawerOptions, duration = 60000, framerate = 60) {\n var _a, _b, _c, _d, _e;\n super();\n this.drawerOptions = {\n width: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.width) || (scene === null || scene === void 0 ? void 0 : scene.width) || 400,\n height: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.height) || (scene === null || scene === void 0 ? void 0 : scene.height) || 400,\n clear: (_a = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.clear) !== null && _a !== void 0 ? _a : true,\n time: (_b = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.time) !== null && _b !== void 0 ? _b : 0,\n simmetricLines: (_c = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.simmetricLines) !== null && _c !== void 0 ? _c : 0,\n noBackground: (_d = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.noBackground) !== null && _d !== void 0 ? _d : false,\n ghosts: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghosts) || 0,\n ghostAlpha: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostAlpha) === false ? false : true,\n ghostSkipTime: (_e = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostSkipTime) !== null && _e !== void 0 ? _e : 30,\n ghostSkipFunction: drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostSkipFunction,\n sceneFit: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.sceneFit) || 'contain',\n backgroundImage: drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.backgroundImage,\n backgroundImageFit: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.backgroundImageFit) || 'cover',\n };\n this.timeline = new Timeline_1.Timeline(duration, framerate);\n this.timeline.setTime(this.drawerOptions.time);\n this.draw_id = null;\n this.redraw_id = null;\n this.animation_id = null;\n if (scene) {\n this.setScene(scene);\n }\n if (!utils_1.bWorker || (utils_1.bWorker && canvasOrContainer instanceof OffscreenCanvas))\n this.setCanvas(canvasOrContainer);\n }\n /**\n * Return option value or default\n *\n * @param {K keyof IDrawerCanvasOptions} name\n * @param {IDrawerCanvasOptions[K]} defaultValue\n */\n getOption(name, defaultValue) {\n var _a;\n return (_a = this.drawerOptions[name]) !== null && _a !== void 0 ? _a : defaultValue;\n }\n /**\n * Create instance of canvas (HTMLCanvasElement in browser o Canvas in Node)\n */\n setCanvas(canvasOrContainer) {\n if (utils_1.bWorker) {\n if (canvasOrContainer instanceof OffscreenCanvas) {\n this.canvas = canvasOrContainer;\n }\n else {\n console.error('Cannot set cavas');\n }\n }\n else {\n if (utils_1.bBrowser) {\n const canvas = canvas_1.createCanvas(this.drawerOptions.width, this.drawerOptions.height);\n if (canvasOrContainer instanceof HTMLElement &&\n !(canvasOrContainer instanceof HTMLCanvasElement || canvasOrContainer instanceof OffscreenCanvas)) {\n this.canvas = canvas;\n while (canvasOrContainer.lastChild)\n canvasOrContainer.removeChild(canvasOrContainer.lastChild);\n canvasOrContainer.appendChild(canvas);\n }\n else {\n this.canvas = typeof canvasOrContainer === 'undefined' ? canvas : canvasOrContainer;\n }\n }\n else {\n this.canvas = canvas_1.createCanvas(this.drawerOptions.width, this.drawerOptions.height);\n }\n }\n if (this.canvas) {\n this.canvas.width = this.drawerOptions.width;\n this.canvas.height = this.drawerOptions.height;\n this.context = this.canvas.getContext('2d', {\n alpha: true,\n // desynchronized: true,\n });\n }\n }\n /**\n * Return instance of canvas\n *\n * @returns canvas\n */\n getCanvas() {\n return this.canvas;\n }\n setScene(scene) {\n this.scene = scene;\n }\n draw() {\n if (this.context === null || typeof this.scene === 'undefined')\n return 0;\n const start_time = Utilities_1.now();\n const timeline = this.timeline;\n const drawAtTime = timeline.getTime();\n const drawerOptions = {\n ...this.drawerOptions,\n ghostIndex: undefined,\n clear: this.drawerOptions.clear || timeline.getCurrentFrame() <= 1,\n time: drawAtTime,\n };\n const currentFrame = timeline.getFrameAtTime(drawAtTime);\n this.dispatch('drawer-canvas:before_draw', {\n currentFrame: currentFrame,\n currentTime: drawAtTime,\n });\n if (drawerOptions.simmetricLines > 0) {\n if (drawerOptions.clear) {\n DrawerCanvas.clear(this.context, drawerOptions.width, drawerOptions.height, drawerOptions.noBackground ? false : this.scene.background, drawerOptions.backgroundImage, drawerOptions.backgroundImageFit);\n }\n DrawerCanvas.drawSimmetricLines(this.context, drawerOptions.simmetricLines, drawerOptions.width, drawerOptions.height, this.scene.color);\n drawerOptions.clear = false;\n }\n if (drawerOptions.ghosts) {\n const ghostDrawerOptions = {\n ...drawerOptions,\n };\n const drawAtTime = timeline.getTime();\n const sequenceDuration = timeline.getDuration();\n const ghostRepetition = {\n offset: 0,\n index: 0,\n count: drawerOptions.ghosts,\n };\n for (let i = 1; i <= drawerOptions.ghosts; i++) {\n ghostRepetition.index = i;\n ghostRepetition.offset = ghostRepetition.index / ghostRepetition.count;\n const ghostTime = drawAtTime -\n (drawerOptions.ghostSkipFunction\n ? drawerOptions.ghostSkipFunction(ghostRepetition, drawAtTime)\n : i * drawerOptions.ghostSkipTime);\n ghostDrawerOptions.ghostIndex = i;\n ghostDrawerOptions.time = math_1.mod(ghostTime, sequenceDuration);\n ghostDrawerOptions.clear = drawerOptions.clear && ghostDrawerOptions.ghostIndex === 1;\n this.realDraw(ghostDrawerOptions);\n }\n drawerOptions.clear = false;\n }\n this.realDraw(drawerOptions);\n return Utilities_1.now() - start_time;\n }\n realDraw(options) {\n var _a;\n const width = this.drawerOptions.width;\n const height = this.drawerOptions.height;\n const context = this.context;\n const scene = this.scene;\n const time = (_a = options.time) !== null && _a !== void 0 ? _a : 0;\n const bGhost = typeof options.ghosts !== 'undefined' &&\n options.ghosts > 0 &&\n typeof options.ghostIndex !== 'undefined' &&\n options.ghostIndex > 0;\n const ghostMultiplier = bGhost ? 1 - options.ghostIndex / (options.ghosts + 0.5) : 0;\n const ghostAlpha = options.ghostAlpha === true;\n const sceneFit = utils_1.fit(scene.width, scene.height, width, height, this.drawerOptions.sceneFit);\n const translateX = sceneFit.x;\n const translateY = sceneFit.y;\n options.clear &&\n DrawerCanvas.clear(context, width, height, options.noBackground ? false : scene.background, options.backgroundImage, options.backgroundImageFit);\n let logFillColorWarn = false;\n let logStrokeColorWarn = false;\n scene.currentTime = time;\n const sceneChilds = scene.getChildren();\n for (let i = 0, len = sceneChilds.length; i < len; i++) {\n const sceneChild = sceneChilds[i];\n if (!sceneChild.data ||\n (!(sceneChild.data.visible === false) && !(bGhost && sceneChild.data.disableGhost === true))) {\n sceneChilds[i].generate(time, true);\n const childIndexedBuffer = sceneChilds[i].getIndexedBuffer() || [];\n const childBuffer = sceneChilds[i].getBuffer() || [];\n let childVertexIndex = 0;\n for (let currentBufferIndex = 0, len = childIndexedBuffer.length; currentBufferIndex < len; currentBufferIndex++) {\n const currentIndexing = childIndexedBuffer[currentBufferIndex];\n const shape = currentIndexing.shape;\n const propArguments = {\n canvasContext: context,\n ...currentIndexing,\n };\n const composite = DrawerCanvas.getStreamDrawerProp(shape, 'composite', propArguments, 'source-over');\n context.globalCompositeOperation = composite;\n context.beginPath();\n context.moveTo(childBuffer[childVertexIndex] * sceneFit.scale + translateX, childBuffer[childVertexIndex + 1] * sceneFit.scale + translateY);\n childVertexIndex += 2;\n for (let currentFrameLength = childVertexIndex + currentIndexing.frameLength - 2; childVertexIndex < currentFrameLength; childVertexIndex += 2)\n context.lineTo(childBuffer[childVertexIndex] * sceneFit.scale + translateX, childBuffer[childVertexIndex + 1] * sceneFit.scale + translateY);\n if (shape.isClosed())\n context.closePath();\n const alpha = DrawerCanvas.getStreamDrawerProp(shape, 'opacity', propArguments, 1);\n context.globalAlpha = alpha;\n const shadowColor = DrawerCanvas.getStreamDrawerProp(shape, 'shadowColor', propArguments);\n const shadowBlur = DrawerCanvas.getStreamDrawerProp(shape, 'shadowBlur', propArguments);\n const shadowOffsetX = DrawerCanvas.getStreamDrawerProp(shape, 'shadowOffsetX', propArguments);\n const shadowOffsetY = DrawerCanvas.getStreamDrawerProp(shape, 'shadowOffsetY', propArguments);\n context.shadowColor = shadowColor;\n context.shadowBlur = shadowBlur;\n shadowOffsetX && (context.shadowOffsetX = shadowOffsetX);\n shadowOffsetY && (context.shadowOffsetY = shadowOffsetY);\n let fill = DrawerCanvas.getStreamDrawerProp(shape, 'fill', propArguments);\n if (typeof fill !== 'undefined') {\n if (bGhost && ghostAlpha) {\n const color = DrawerCanvas.ghostifyColor(fill, ghostMultiplier);\n if (color) {\n fill = color;\n }\n else if (!logFillColorWarn) {\n console.warn(`[Urpflanze:DrawerCanvas] Unable ghost fill color '${fill}',\n\t\t\t\t\t\t\t\tplease enter a rgba or hsla color`);\n logFillColorWarn = true;\n }\n }\n context.fillStyle = fill;\n context.fill();\n }\n let stroke = DrawerCanvas.getStreamDrawerProp(shape, 'stroke', propArguments, typeof fill === 'undefined' ? scene.color : undefined);\n let lineWidth = DrawerCanvas.getStreamDrawerProp(shape, 'lineWidth', propArguments, 1);\n if (stroke) {\n if (bGhost && ghostAlpha) {\n const color = DrawerCanvas.ghostifyColor(stroke, ghostMultiplier);\n if (color) {\n stroke = color;\n }\n else if (!logStrokeColorWarn) {\n console.warn(`[Urpflanze:DrawerCanvas] Unable ghost stroke color '${stroke}',\n\t\t\t\t\t\t\t\tplease enter a rgba or hsla color`);\n logStrokeColorWarn = true;\n }\n lineWidth *= ghostMultiplier;\n }\n const lineJoin = DrawerCanvas.getStreamDrawerProp(shape, 'lineJoin', propArguments);\n const lineCap = DrawerCanvas.getStreamDrawerProp(shape, 'lineCap', propArguments);\n const lineDash = DrawerCanvas.getStreamDrawerProp(shape, 'lineDash', propArguments);\n const lineDashOffset = DrawerCanvas.getStreamDrawerProp(shape, 'lineDashOffset', propArguments);\n const miterLimit = DrawerCanvas.getStreamDrawerProp(shape, 'miterLimit', propArguments);\n context.setLineDash.call(context, lineDash || []);\n context.lineJoin = lineJoin;\n context.lineCap = lineCap;\n context.lineDashOffset = lineDashOffset;\n context.miterLimit = miterLimit;\n context.lineWidth = lineWidth * sceneFit.scale;\n context.strokeStyle = stroke;\n context.stroke();\n }\n }\n context.restore();\n }\n }\n }\n /**\n * Return a drawer value\n *\n * @static\n * @template T\n * @param {ShapePrimitive} shape\n * @param {keyof T} key\n * @param {IDrawerPropArguments} propArguments\n * @param {*} [defaultValue]\n * @returns {*}\n */\n static getStreamDrawerProp(shape, key, propArguments, defaultValue) {\n let attribute = shape.drawer[key];\n if (typeof attribute === 'function') {\n attribute = attribute(propArguments);\n }\n return attribute !== null && attribute !== void 0 ? attribute : defaultValue;\n }\n /**\n * Create color based on ghostMultiplier\n *\n * @static\n * @param {any} color\n * @param {number} ghostMultiplier\n * @return {*} {(string | undefined)}\n */\n static ghostifyColor(color, ghostMultiplier) {\n if (typeof color === 'string' || typeof color === 'number') {\n const parsed = color_1.parseColor(color);\n if (parsed) {\n const ghostAlpha = parsed.alpha * ghostMultiplier;\n return parsed.type === 'rgb'\n ? `rgba(${parsed.a},${parsed.b},${parsed.c},${ghostAlpha})`\n : `hsla(${parsed.a},${parsed.b}%,${parsed.c}%,${ghostAlpha})`;\n }\n }\n return color;\n }\n /**\n * Clear canvas, draw background or image (and fit)\n *\n * @param context\n * @param width\n * @param height\n * @param background\n * @param backgroundImage\n * @param backgroundImageFit\n */\n static clear(context, width, height, background, backgroundImage, backgroundImageFit) {\n if (typeof background === 'boolean' && background === false) {\n context.clearRect(0, 0, width, height);\n }\n else {\n context.globalCompositeOperation = 'source-over';\n context.fillStyle = background; // or true\n context.fillRect(0, 0, width, height);\n if (backgroundImage) {\n const sourceWidth = backgroundImage instanceof SVGImageElement ? backgroundImage.width.baseVal.value : backgroundImage.width;\n const sourceHeight = backgroundImage instanceof SVGImageElement ? backgroundImage.height.baseVal.value : backgroundImage.height;\n const fitRect = utils_1.fit(sourceWidth, sourceHeight, width, height, backgroundImageFit);\n context.drawImage(backgroundImage, fitRect.x, fitRect.y, fitRect.width, fitRect.height);\n }\n }\n }\n /**\n * Draw utility lines\n *\n * @param context\n * @param simmetricLines\n * @param width\n * @param height\n * @param color\n */\n static drawSimmetricLines(context, simmetricLines, width, height, color) {\n const offset = Math.PI / simmetricLines;\n const size = Math.max(width, height);\n const sizeMin = Math.min(width, height);\n const k = width < height ? 1 : 0;\n const centerX = [size / 2, size / 2];\n const centerY = [sizeMin / 2, sizeMin / 2];\n for (let i = 0; i < simmetricLines; i++) {\n const a = [-size, -size];\n const b = [size * 2, size * 2];\n const rotate = i * offset + Math.PI / 4;\n Vec2_1.default.rotateZ(a, i % 2 === k ? centerX : centerY, rotate);\n Vec2_1.default.rotateZ(b, i % 2 === k ? centerX : centerY, rotate);\n context.beginPath();\n context.strokeStyle = color;\n context.lineWidth = 1;\n context.moveTo(a[0], a[1]);\n context.lineTo(b[0], b[1]);\n context.stroke();\n }\n }\n}\nexports.DrawerCanvas = DrawerCanvas;\n// const sourceRatio = sourceWidth / sourceHeight\n// let x = 0,\n// \ty = 0,\n// \tbgWidth = width,\n// \tbgHeight = height\n// if (sourceRatio !== ratio) {\n// \tif (options.backgroundImageFit === 'contain') {\n// \t\tbgWidth = ratio > sourceRatio ? (sourceWidth * height) / sourceHeight : width\n// \t\tbgHeight = ratio > sourceRatio ? height : (sourceHeight * width) / sourceWidth\n// \t} else {\n// \t\tbgWidth = ratio < sourceRatio ? (sourceWidth * height) / sourceHeight : width\n// \t\tbgHeight = ratio < sourceRatio ? height : (sourceHeight * width) / sourceWidth\n// \t}\n// \tx = (width - bgWidth) / 2\n// \ty = (height - bgHeight) / 2\n//# sourceMappingURL=DrawerCanvas.js.map","/* globals document, ImageData */\n\nconst parseFont = require('./lib/parse-font')\n\nexports.parseFont = parseFont\n\nexports.createCanvas = function (width, height) {\n return Object.assign(document.createElement('canvas'), { width: width, height: height })\n}\n\nexports.createImageData = function (array, width, height) {\n // Browser implementation of ImageData looks at the number of arguments passed\n switch (arguments.length) {\n case 0: return new ImageData()\n case 1: return new ImageData(array)\n case 2: return new ImageData(array, width)\n default: return new ImageData(array, width, height)\n }\n}\n\nexports.loadImage = function (src, options) {\n return new Promise(function (resolve, reject) {\n const image = Object.assign(document.createElement('img'), options)\n\n function cleanup () {\n image.onload = null\n image.onerror = null\n }\n\n image.onload = function () { cleanup(); resolve(image) }\n image.onerror = function () { cleanup(); reject(new Error('Failed to load the image \"' + src + '\"')) }\n\n image.src = src\n })\n}\n","'use strict'\n\n/**\n * Font RegExp helpers.\n */\n\nconst weights = 'bold|bolder|lighter|[1-9]00'\n , styles = 'italic|oblique'\n , variants = 'small-caps'\n , stretches = 'ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded'\n , units = 'px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q'\n , string = '\\'([^\\']+)\\'|\"([^\"]+)\"|[\\\\w\\\\s-]+'\n\n// [ [ <‘font-style’> || || <‘font-weight’> || <‘font-stretch’> ]?\n// <‘font-size’> [ / <‘line-height’> ]? <‘font-family’> ]\n// https://drafts.csswg.org/css-fonts-3/#font-prop\nconst weightRe = new RegExp('(' + weights + ') +', 'i')\nconst styleRe = new RegExp('(' + styles + ') +', 'i')\nconst variantRe = new RegExp('(' + variants + ') +', 'i')\nconst stretchRe = new RegExp('(' + stretches + ') +', 'i')\nconst sizeFamilyRe = new RegExp(\n '([\\\\d\\\\.]+)(' + units + ') *'\n + '((?:' + string + ')( *, *(?:' + string + '))*)')\n\n/**\n * Cache font parsing.\n */\n\nconst cache = {}\n\nconst defaultHeight = 16 // pt, common browser default\n\n/**\n * Parse font `str`.\n *\n * @param {String} str\n * @return {Object} Parsed font. `size` is in device units. `unit` is the unit\n * appearing in the input string.\n * @api private\n */\n\nmodule.exports = function (str) {\n // Cached\n if (cache[str]) return cache[str]\n\n // Try for required properties first.\n const sizeFamily = sizeFamilyRe.exec(str)\n if (!sizeFamily) return // invalid\n\n // Default values and required properties\n const font = {\n weight: 'normal',\n style: 'normal',\n stretch: 'normal',\n variant: 'normal',\n size: parseFloat(sizeFamily[1]),\n unit: sizeFamily[2],\n family: sizeFamily[3].replace(/[\"']/g, '').replace(/ *, */g, ',')\n }\n\n // Optional, unordered properties.\n let weight, style, variant, stretch\n // Stop search at `sizeFamily.index`\n let substr = str.substring(0, sizeFamily.index)\n if ((weight = weightRe.exec(substr))) font.weight = weight[1]\n if ((style = styleRe.exec(substr))) font.style = style[1]\n if ((variant = variantRe.exec(substr))) font.variant = variant[1]\n if ((stretch = stretchRe.exec(substr))) font.stretch = stretch[1]\n\n // Convert to device units. (`font.unit` is the original unit)\n // TODO: ch, ex\n switch (font.unit) {\n case 'pt':\n font.size /= 0.75\n break\n case 'pc':\n font.size *= 16\n break\n case 'in':\n font.size *= 96\n break\n case 'cm':\n font.size *= 96.0 / 2.54\n break\n case 'mm':\n font.size *= 96.0 / 25.4\n break\n case '%':\n // TODO disabled because existing unit tests assume 100\n // font.size *= defaultHeight / 100 / 0.75\n break\n case 'em':\n case 'rem':\n font.size *= defaultHeight / 0.75\n break\n case 'q':\n font.size *= 96 / 25.4 / 4\n break\n }\n\n return (cache[str] = font)\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Emitter = void 0;\n/**\n * Class used for emit and dispatch events\n *\n * @category Emitter\n * @abstract\n * @class Emitter\n * @template EventTypes\n */\nclass Emitter {\n constructor() {\n this.callbacks = {};\n }\n /**\n * Attach callback at event\n *\n * @param {keyof EventTypes} e\n * @param {(value: EventTypes[keyof EventTypes]) => any} callback\n * @memberof Emitter\n */\n attach(e, callback) {\n if (!(e in this.callbacks)) {\n this.callbacks[e] = [];\n }\n this.callbacks[e].push(callback);\n }\n /**\n * Remove callbach listener at event\n *\n * @param {keyof EventTypes} e\n * @param {(value: EventTypes[keyof EventTypes]) => void} callback\n * @memberof Emitter\n */\n detach(e, callback) {\n if (e in this.callbacks) {\n const index = this.callbacks[e].indexOf(callback);\n if (index >= 0) {\n this.callbacks[e].splice(index, 1);\n }\n }\n }\n /**\n * Dispatch event\n *\n * @param {keyof EventTypes} e\n * @param {EventTypes[keyof EventTypes]} [params]\n * @memberof Emitter\n */\n dispatch(e, params) {\n if (e in this.callbacks && this.callbacks[e].length > 0) {\n for (let i = 0, len = this.callbacks[e].length; i < len; i++)\n if (this.callbacks[e][i](params) === false)\n break;\n }\n }\n}\nexports.Emitter = Emitter;\n//# sourceMappingURL=Emitter.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Timeline = void 0;\nconst Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nconst math_1 = require(\"@urpflanze/core/dist/cjs/math\");\nconst Emitter_1 = require(\"./Emitter\");\n/**\n * Is used for sequence time management.\n * It is necessary to set the duration and the number of frames per second (frame rate).\n *\n * @category Timeline\n * @class Timeline\n * @extends {Emitter}\n */\nclass Timeline extends Emitter_1.Emitter {\n constructor(duration = 60000, framerate = 30) {\n super();\n this.fps_samples_size = 30;\n this.fps_samples = [];\n this.fps_samples_index = 0;\n this.paused_time = 0;\n this.sequence = {\n duration,\n framerate,\n frames: Math.round((duration / 1000) * framerate),\n };\n this.tick_time = 1000 / this.sequence.framerate;\n this.fps = this.sequence.framerate;\n this.b_sequence_started = false;\n this.currentFrame = 0;\n this.currentTime = 0;\n this.last_tick = 0;\n this.start_time = 0;\n }\n //#region sequence meta\n /**\n * Return the sequence\n *\n * @returns {Sequence}\n */\n getSequence() {\n return { ...this.sequence };\n }\n /**\n * Set Sequence\n *\n * @param {number} duration in ms\n * @param {number} framerate\n * @param {number} atTime\n */\n setSequence(duration, framerate, atTime) {\n this.sequence.duration = duration;\n this.sequence.framerate = framerate;\n this.tick_time = 1000 / this.sequence.framerate;\n this.sequence.frames = Math.round((this.sequence.duration / 1000) * this.sequence.framerate);\n if (typeof atTime !== 'undefined') {\n this.setTime(atTime);\n }\n else {\n this.dispatch('timeline:update_sequence', this.getSequence());\n }\n }\n /**\n * Set duration of timeline\n *\n * @param {number} framerate\n */\n setDuration(duration) {\n this.setSequence(duration, this.sequence.framerate);\n }\n /**\n * Get timeline duration\n *\n * @returns {number}\n */\n getDuration() {\n return this.sequence.duration;\n }\n /**\n * Return framerate\n *\n * @returns {number}\n */\n getFramerate() {\n return this.sequence.framerate;\n }\n /**\n * Set a framerate\n *\n * @param {number} framerate\n */\n setFramerate(framerate) {\n this.setSequence(this.sequence.duration, framerate);\n }\n /**\n * Get number of frames based on duration and framerate\n *\n * @returns {number}\n */\n getFramesCount() {\n return this.sequence.frames;\n }\n //#endregion meta\n //#region change status\n bSequenceStarted() {\n return this.b_sequence_started;\n }\n /**\n * Start the sequence\n *\n */\n start() {\n if (!this.b_sequence_started) {\n this.b_sequence_started = true;\n this.start_time = this.paused_time;\n this.dispatch('timeline:change_status', Timeline.START);\n }\n }\n /**\n * Pause the sequence\n *\n */\n pause() {\n if (this.b_sequence_started) {\n this.paused_time = Utilities_1.now();\n this.b_sequence_started = false;\n this.dispatch('timeline:change_status', Timeline.PAUSE);\n }\n }\n /**\n * Stop the sequence and reset\n *\n */\n stop() {\n if (this.b_sequence_started) {\n this.b_sequence_started = false;\n this.currentTime = 0;\n this.currentFrame = 0;\n this.start_time = 0;\n this.paused_time = 0;\n this.dispatch('timeline:change_status', Timeline.STOP);\n }\n }\n /**\n * Animation tick\n *\n * @param {number} timestamp current timestamp\n * @returns {boolean}\n */\n tick(timestamp) {\n if (this.b_sequence_started) {\n if (!this.start_time) {\n this.start_time = timestamp;\n this.last_tick = -this.tick_time;\n }\n const currentTime = timestamp - this.start_time;\n const elapsed = currentTime - this.last_tick;\n if (elapsed >= this.tick_time) {\n this.calculateFPS(1 / (elapsed / 1000));\n this.last_tick = currentTime;\n this.currentTime = (currentTime - (elapsed % this.tick_time)) % this.sequence.duration;\n this.currentFrame = this.getFrameAtTime(this.currentTime);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n return true;\n }\n }\n return false;\n }\n /**\n * Calculate fps\n *\n * @private\n * @param {number} currentFPS\n */\n calculateFPS(currentFPS) {\n const samples = this.fps_samples.length;\n if (samples > 0) {\n let average = 0;\n for (let i = 0; i < samples; i++)\n average += this.fps_samples[i];\n this.fps = Math.round(average / samples);\n }\n this.fps_samples[this.fps_samples_index] = Math.round(currentFPS);\n this.fps_samples_index = (this.fps_samples_index + 1) % this.fps_samples_size;\n }\n //#endregion\n //#region Frame and Time\n /**\n * Return current animation frame\n *\n * @returns {number}\n */\n getCurrentFrame() {\n return this.currentFrame;\n }\n /**\n * get the time at specific frame number\n *\n * @param {number} frame\n * @returns {number}\n */\n getFrameTime(frame) {\n frame = math_1.mod(frame, this.sequence.frames);\n return (frame * this.tick_time) % this.sequence.duration;\n }\n /**\n * Return frame number at time\n *\n * @param {number} time\n * @returns {number}\n */\n getFrameAtTime(time) {\n return Math.round((time % this.sequence.duration) / this.tick_time);\n }\n /**\n * set current frame\n *\n * @param {number} frame\n */\n setFrame(frame) {\n this.currentFrame = math_1.mod(frame, this.sequence.frames);\n this.currentTime = this.getFrameTime(this.currentFrame);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n }\n /**\n * Return tick time (based on framerate)\n *\n * @returns {number}\n */\n getTickTime() {\n return this.tick_time;\n }\n /**\n * Return the current time\n *\n * @returns {number}\n */\n getTime() {\n return this.currentTime;\n }\n /**\n * Set animation at time\n *\n * @param {number} time\n */\n setTime(time) {\n time = math_1.mod(time, this.sequence.duration);\n this.currentTime = time;\n this.currentFrame = this.getFrameAtTime(time);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n }\n}\nexports.Timeline = Timeline;\n/**\n * Animation status started\n * @internal\n */\nTimeline.START = 'start';\n/**\n * Animation status paused\n * @internal\n */\nTimeline.PAUSE = 'pause';\n/**\n * Animation status stop\n * @internal\n */\nTimeline.STOP = 'stop';\n//# sourceMappingURL=Timeline.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fit = exports.bWorker = exports.bBrowser = exports.bNode = void 0;\nexports.bNode = typeof process !== 'undefined' &&\n typeof process.versions !== 'undefined' &&\n typeof process.versions.node !== 'undefined';\nexports.bBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';\nexports.bWorker = typeof self === 'object' && ['ServiceWorkerGlobalScope', 'DedicatedWorkerGlobalScope'].includes(self.constructor.name);\n/**\n * Utiltites\n *\n * @category Utilities\n * @export\n * @param {number} sourceWidth\n * @param {number} sourceHeight\n * @param {number} destWidth\n * @param {number} destHeight\n * @param {('cover' | 'contain' | 'none')} [fit='none']\n * @return {*} {{ x: number; y: number; width: number; height: number; scale: number }}\n */\nfunction fit(sourceWidth, sourceHeight, destWidth, destHeight, fit = 'none') {\n let x = 0, y = 0, scale = 1, finalWidth = sourceWidth, finalHeight = sourceHeight;\n const ratio = destWidth / destHeight;\n const sourceRatio = sourceWidth / sourceHeight;\n if (fit === 'contain') {\n finalWidth = ratio > sourceRatio ? (sourceWidth * destHeight) / sourceHeight : destWidth;\n finalHeight = ratio > sourceRatio ? destHeight : (sourceHeight * destWidth) / sourceWidth;\n scale = Math.max(finalWidth, finalHeight) / Math.max(sourceWidth, sourceHeight);\n }\n else if (fit === 'cover') {\n finalWidth = ratio < sourceRatio ? (sourceWidth * destHeight) / sourceHeight : destWidth;\n finalHeight = ratio < sourceRatio ? destHeight : (sourceHeight * destWidth) / sourceWidth;\n // scale = Math.min(sourceWidth, sourceHeight) / Math.min(finalWidth, finalHeight)\n scale = Math.max(finalWidth, finalHeight) / Math.max(sourceWidth, sourceHeight);\n }\n else {\n // finalWidth = sourceWidth\n // finalHeight = sourceHeight\n }\n x = (destWidth - finalWidth) / 2;\n y = (destHeight - finalHeight) / 2;\n return {\n x,\n y,\n width: finalWidth,\n height: finalHeight,\n scale,\n };\n}\nexports.fit = fit;\n//# sourceMappingURL=utils.js.map","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(0);\n"],"sourceRoot":""} \ No newline at end of file diff --git a/build/umd/urpflanze-light.min.js b/build/umd/urpflanze-light.min.js index 311b10d..13f842a 100644 --- a/build/umd/urpflanze-light.min.js +++ b/build/umd/urpflanze-light.min.js @@ -1,2 +1,2 @@ /*! For license information please see urpflanze-light.min.js.LICENSE.txt */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Urpflanze=e():t.Urpflanze=e()}(window,(function(){return(()=>{var t={9367:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.DrawerCanvas=e.Animation=void 0,i(r(1714),e),e.Animation=r(7518);var a=r(2251);Object.defineProperty(e,"DrawerCanvas",{enumerable:!0,get:function(){return a.BrowserDrawerCanvas}})},2894:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UncontrolledLoop=e.Static=e.Loop=e.Compose=e.Simple=e.resolveSimpleAnimation=void 0;const n=r(4825),i=r(2765);function a(t){const e=i.createAnimation(t);if(e)return t=>{var r;const n="number"==typeof t?t:(null===(r=t.shape.scene)||void 0===r?void 0:r.currentTime)||0;return e.update(n),e.value}}e.resolveSimpleAnimation=a,e.Simple=a,e.Compose=t=>{const e=n.composeAnimations(t);if(e)return t=>{var r;const n="number"==typeof t?t:(null===(r=t.shape.scene)||void 0===r?void 0:r.currentTime)||0;return e(n)}},e.Loop=t=>{const e=t;return void 0===e.interpolator&&(e.interpolator="wave"),e.interpolator&&("string"==typeof e.interpolator?"wave"!==e.interpolator&&(e.direction="alternate"):"object"==typeof e.interpolator&&"wave"!==e.interpolator.type&&(e.direction="alternate")),e.loop=!0,a(e)},e.Static=t=>{const e=t;return e.direction="normal",e.loop=!1,a(e)},e.UncontrolledLoop=t=>{const e=t;return e.direction="normal",e.loop=!0,a(e)}},9727:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=void 0;const r={linear:(t,e,r,n=1)=>r*t/n+e,quadraticIn:(t,e,r,n=1)=>r*(t/=n)*t+e,quadraticOut:(t,e,r,n=1)=>-r*(t/=n)*(t-2)+e,quadraticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t+e:-r/2*(--t*(t-2)-1)+e,cubicIn:(t,e,r,n=1)=>r*(t/=n)*t*t+e,cubicOut:(t,e,r,n=1)=>(t/=n,r*(--t*t*t+1)+e),cubicInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t+e:r/2*((t-=2)*t*t+2)+e,quarticIn:(t,e,r,n=1)=>r*(t/=n)*t*t*t+e,quarticOut:(t,e,r,n=1)=>(t/=n,-r*(--t*t*t*t-1)+e),quarticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t*t+e:-r/2*((t-=2)*t*t*t-2)+e,quinticIn:(t,e,r,n=1)=>r*(t/=n)*t*t*t*t+e,quinticOut:(t,e,r,n=1)=>(t/=n,r*(--t*t*t*t*t+1)+e),quinticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t*t*t+e:r/2*((t-=2)*t*t*t*t+2)+e,sinusoidalIn:(t,e,r,n=1)=>-r*Math.cos(t/n*(Math.PI/2))+r+e,sinusoidalOut:(t,e,r,n=1)=>r*Math.sin(t/n*(Math.PI/2))+e,sinusoidalInOut:(t,e,r,n=1)=>-r/2*(Math.cos(Math.PI*t/n)-1)+e,exponentialIn:(t,e,r,n=1)=>r*Math.pow(2,10*(t/n-1))+e,exponentialOut:(t,e,r,n=1)=>r*(1-Math.pow(2,-10*t/n))+e,exponentialInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*Math.pow(2,10*(t-1))+e:(t--,r/2*(2-Math.pow(2,-10*t))+e),circularIn:(t,e,r,n=1)=>(t/=n,-r*(Math.sqrt(1-t*t)-1)+e),circularOut:(t,e,r,n=1)=>(t/=n,t--,r*Math.sqrt(1-t*t)+e),circularInOut:(t,e,r,n=1)=>(t/=n/2)<1?-r/2*(Math.sqrt(1-t*t)-1)+e:(t-=2,r/2*(Math.sqrt(1-t*t)+1)+e),elasticIn:(t,e,r,n=1,i=1,a=.5)=>{if(0===t)return e;if(1==(t/=n))return e+r;a*=n;let o=0;return i{if(0===t)return e;if(1==(t/=n))return e+r;a*=n;let o=0;return i{if(0===t)return e;if(2==(t/=n/2))return e+r;a*=n;let o=0;return ir*(t/=n)*t*((i+1)*t-i)+e,backOut:(t,e,r,n=1,i=1.70158)=>r*((t=t/n-1)*t*((i+1)*t+i)+1)+e,backInOut:(t,e,r,n=1,i=1.70158)=>(t/=n/2)<1?r/2*(t*t*((1+(i*=1.525))*t-i))+e:r/2*((t-=2)*t*((1+(i*=1.525))*t+i)+2)+e,bounceIn:(t,e,n,i=1)=>n-r.bounceOut(i-t,0,n,i)+e,bounceOut:(t,e,r,n=1)=>(t/=n)<1/2.75?r*(7.5625*t*t)+e:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+e:r*(7.5625*(t-=2.625/2.75)*t+.984375)+e,bounceInOut:(t,e,n,i=1)=>t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.composeAnimations=void 0;const n=r(7358),i=r(2765),a=r(8782);function o(t,e,r=.5){const i=Array.isArray(t)?t:[t],o=Array.isArray(e)?e:[e],s=[];for(let t=0,e=i.length;tvoid 0!==t)),r=e.length;if(r>0)return t=>{let n;for(let i=0;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createAnimation=void 0;const n=r(9298);e.createAnimation=function(t){const e=n.createInterpolationCallback(t);if(void 0===e)return;const r=t.delay||0,i=t.afterDelay||0,a=t.direction||"normal",o=t.duration||1e3,s="normal"===a||"reverse"===a?o+r:2*o+r+i,c={delay:r,afterDelay:i,direction:a,duration:o,totalDuration:s,loop:"number"==typeof t.loop?t.loop:!!t.loop},u=n.createInterpolator(t.interpolator),h={loop:0,offset:0,loopDuration:s,direction:"alternate"===a?"normal":a,started:!1,ended:!1,value:void 0};return h.update=function(t,e,r,n){const{loop:i,totalDuration:a,delay:o,afterDelay:s,direction:c,duration:u}=e;return h=>{if("number"==typeof i&&h>=a*i||!1===i&&h>=e.totalDuration)return t.started=!1,t.ended=!0,t.offset=r("normal"===c?u:0,u),void(t.value=n(t.offset));if(t.loop=Math.ceil(h/a),h%=a,(h-=o)<=0)return t.started=!1,t.offset=r(0,u),void(t.value=n(t.offset));if(t.started=!0,"alternate"===c)h<=u?(t.direction="normal",t.offset=r(h,u)):(t.direction="reverse",h-=u,(h-=s)>=0?t.offset=1-r(h>=u?u:h,u):t.offset=1);else{const e=r(h>=u?u:h,u);t.offset="normal"===c?e:1-e}t.value=n(t.offset)}}(h,c,u,e),h}},9298:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createInterpolator=e.createInterpolationCallback=void 0;const n=r(7358),i=r(3431),a=r(9727),o=r(8782);e.createInterpolationCallback=function(t){const e=Array.isArray(t.from)?t.from:[t.from],r=Array.isArray(t.to)?t.to:[t.to],i=t.round,a="hue"===t.colorTransitionMode?o.interpolateColorHSL:o.interpolateColorRGB;if(e.length!==r.length)return;const s=[];for(let t=0,o=e.length;t1===t?a:0===t?n:Math.round((n+t*(a-n))*i)/i:t=>1===t?a:0===t?n:n+t*(a-n))}else{const i=e[t],o=r[t],c=n.parseColorAndConvert(i),u=n.parseColorAndConvert(o);void 0!==c&&void 0!==u&&s.push((t=>1===t?o:0===t?i:a(c,u,t)))}}return t=>{const e=s.map((e=>e(t)));return 1===e.length?e[0]:e}},e.createInterpolator=function(t){var e,r;switch(typeof t){case"function":return(e,r)=>t(e/r,e);case"string":switch(t){case"wave":return(t,e)=>.5+.5*Math.sin(t*Math.PI*2/e+1.5*Math.PI);default:if(t in a.Easings){const e=a.Easings[t];return(t,r)=>e(t,0,1,r)}return(t,e)=>a.Easings.linear(t,0,1,e)}case"object":switch(t.type){case"wave":{const r=1.5*Math.PI+((null===(e=t.params)||void 0===e?void 0:e.phase)||0);return(t,e)=>.5+.5*Math.sin(t*Math.PI*2/e+r)}case"elasticIn":case"elasticOut":case"elasticInOut":{const e=a.Easings[t.type],{amplitude:r,period:n}=t.params||{};return(t,i)=>e(t,0,1,i,r,n)}case"backIn":case"backOut":case"backInOut":{const e=a.Easings[t.type],n=(null===(r=t.params)||void 0===r?void 0:r.overshoot)||void 0;return(t,r)=>e(t,0,1,r,n)}case"cubicBezier":{const e=i.default(t.params[0],t.params[1],t.params[2],t.params[3]);return(t,r)=>e(t/r)}}}return(t,e)=>a.Easings.linear(t,0,1,e)}},7518:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(5240),e),i(r(8782),e),i(r(2765),e),i(r(9298),e),i(r(9727),e),i(r(2894),e)},5240:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},8782:(t,e)=>{"use strict";function r(t,e,r=!0,n="alternate",i=0,a=0){const o="normal"===n||"reverse"===n?e+i:2*e+i+a;return"number"==typeof r&&t>=o*r||!1===r&&t>=o?"normal"===n?e:0:(t%=o,(t-=i)<=0?0:"alternate"===n?t<=e?t:(t-=e,(t-=a)>=0?e-(t>=e?e:t):e):t>=e?e:t)}Object.defineProperty(e,"__esModule",{value:!0}),e.interpolateColorHSL=e.interpolateColorRGB=e.cosp=e.sinp=e.clockOffset=e.clock=void 0,e.clock=r,e.clockOffset=function(t,e,n=!0,i="alternate",a=0,o=0){return r(t,e,n,i,a,o)/e};const n=2*Math.PI;e.sinp=function(t,e,r=0,i=!1){const a=Math.sin(t*n/e+r);return i?.5+.5*a:a},e.cosp=function(t,e,r=0,i=!1){const a=Math.cos(t*n/e+r);return i?.5+.5*a:a},e.interpolateColorRGB=function(t,e,r){const n=t.r+r*(e.r-t.r),i=t.g+r*(e.g-t.g),a=t.b+r*(e.b-t.b),o=t.alpha+r*(e.alpha-t.alpha);return`rgba(${Math.floor(n)},${Math.floor(i)},${Math.floor(a)},${o})`},e.interpolateColorHSL=function(t,e,r){return`hsla(${t.h+r*(e.h-t.h)},${t.s+r*(e.s-t.s)}%,${t.l+r*(e.l-t.l)}%,${t.alpha+r*(e.alpha-t.alpha)})`}},814:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rgbToHsl=e.hslToRgb=e.rgbToHex=void 0,e.rgbToHex=function(t,e,r){return`#${((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}`},e.hslToRgb=function(t,e,r){let n,i,a;if(t/=360,r/=100,0==(e/=100))n=i=a=r;else{const o=(t,e,r)=>(r+=r<0?1:r>1?-1:0)<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,s=r<.5?r*(1+e):r+e-r*e,c=2*r-s;n=o(c,s,t+1/3),i=o(c,s,t),a=o(c,s,t-1/3)}return[.5+255*n<<0,.5+255*i<<0,.5+255*a<<0]},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;const n=Math.max(t,e,r),i=Math.min(t,e,r),a=(n+i)/2;let o,s;if(n===i)o=s=0;else{const c=n-i;switch(s=a>.5?c/(2-n-i):c/(n+i),n){case t:o=(e-r)/c+(e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={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",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",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",rebeccapurple:"#663399",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",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},7358:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(6097),e),i(r(814),e),i(r(5576),e)},5576:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.parseColorAndConvert=void 0;const n=r(4947),i=r(814);function a(t){if("number"==typeof t)return t>16777215?{type:"rgb",a:t>>24&255,b:t>>16&255,c:t>>8&255,alpha:(255&t)/255}:{type:"rgb",a:t>>16&255,b:t>>8&255,c:255&t,alpha:1};t=t.replace(/\s/g,""),n.default[t]&&(t=n.default[t]);let e=/^#([0-9a-f]{3,8})$/i.exec(t);if(e){const t=e[1];return 3===t.length?{type:"rgb",a:parseInt(t[0]+t[0],16),b:parseInt(t[1]+t[1],16),c:parseInt(t[2]+t[2],16),alpha:1}:{type:"rgb",a:parseInt(t[0]+t[1],16),b:parseInt(t[2]+t[3],16),c:parseInt(t[4]+t[5],16),alpha:t.length>6?parseInt(t.substring(6),16)/255:1}}if(e=/^((hsl|rgb)a?)\((\d+),(\d+)%?,(\d+)%?,?(.+)?\)$/i.exec(t),e){const[,,t,r,n,i,a]=e;return{type:t,a:+r,b:+n,c:+i,alpha:a?+a:1}}}e.parseColorAndConvert=function(t){const e=a(t);if(e){if("hsl"===e.type){const[t,r,n]=i.hslToRgb(e.a,e.b,e.c);return{r:t,g:r,b:n,h:e.a,s:e.b,l:e.c,alpha:e.alpha}}{const[t,r,n]=i.rgbToHsl(e.a,e.b,e.c);return{h:t,s:r,l:n,r:e.a,g:e.b,b:e.c,alpha:e.alpha}}}},e.parseColor=a},6097:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},2513:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Group=void 0;const n=r(1378),i=r(541),a=r(2648),o=r(5511);class s extends i.SceneChild{constructor(t={}){t.type="Group",super(t),this.children=[],["id","name","data","order","type"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=o.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){"object"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=s},1378:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Scene=void 0;const n=r(541),i=r(2513),a=r(6448),o=r(313);class s{constructor(t={}){this.width=400,this.height=400,this.background="hsla(0, 0%, 0%, 1)",this.color="hsla(0, 0%, 100%, 1)",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?(.5+.5*o.clamp(-1,1,t.anchor[0]))*this.width:"left"===t.anchor[0]?0:"right"===t.anchor[0]?this.width:this.center[0],"number"==typeof t.anchor[1]?(.5+.5*o.clamp(-1,1,t.anchor[1]))*this.height:"top"===t.anchor[1]?0:"bottom"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e="number"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,s.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{s.propagateToChilden(t,e)})):t instanceof a.Shape&&t.shape&&(t.shape.scene=e,s.propagateToChilden(t.shape,e))}}e.Scene=s},541:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||"SceneChild",this.name=t.name||this.type+"_"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){"string"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},313:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(21),i=r(2769),a=r(795),o="undefined"!=typeof performance?performance:Date;function s(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return o.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=s,e.relativeClamp=function(t,e,r,n,i){return s(n,i,(r-t)/(e-t)*(i-n)+n)};const c={random:new n(Math.random)};e.noise=function(t="random",e=0,r=0,i=0){return void 0===c[t]&&(c[t]=new n(t)),c[t].noise3D(e,r,i)};const u={};function h(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),a=rn?[a,o]:[o,a]}function l(t,e){const r=t.length,n=r/2,i=2*(n+e),a=n-1;if(a>1){const n=r-2,o=Math.floor(e/a);let s=(i-(r+o*n))/2;const c=Math.round(a/s),u=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%c==0||e===n-2),p=o+(d?1:0),g=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);u[i]=(a=t(),o=t(),s=t(),c=t(),function(){let t=(a>>>=0)+(o>>>=0)|0;return a=o^o>>>9,o=(s>>>=0)+(s<<3)|0,t=t+(c=1+(c>>>=0)|0)|0,s=(s=s<<21|s>>>11)+t|0,(t>>>0)/4294967296})}var a,o,s,c;const h=e+u[i]()*(r-e);return void 0!==n?Math.round(h*10**n)/10**n:h},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return a.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=h,e.interpolate=function(t,e,r=.5){const[n,i]=h(t,e),a=Math.max(n.length,i.length),o="number"==typeof r?[r]:r,s=a/2;if(o.length!==s){const t=o.length;for(let e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return"number"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},8721:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(887);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},3792:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},5511:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(9958);var i;!function(t){t[t.None=0]="None",t[t.Scale=2]="Scale",t[t.Center=4]="Center",t[t.Fill=8]="Fill"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn("[Urplfanze:Bounding] cannot sum bounding")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn("[Urplfanze:Bounding] cannot bind bounding")}};class a extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return a.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=a.getBounding(t));const o=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,s=e>=i.Center?r.cx:0,c=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Close=void 0;const n=r(9958);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},1740:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Mirror=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let a=0;a{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},3315:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Offset=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i},4660:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Smooth=void 0;const n=r(313),i=r(8301),a=r(9958);class o extends a.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Solidify=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const a=[],o=(e="number"==typeof e?[e]:e).length;let s,c,u=[[0,0],[0,0]],h=[[0,0],[0,0]];for(let r=0,l=0,f=t.length-2;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Subdivide=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Modifiers=void 0;const n=r(5511),i=r(1740),a=r(4660),o=r(5838),s=r(5588),c=r(8301),u=r(3315),h={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:a.Smooth,Solidify:o.Solidify,Subdivide:s.Subdivide,Close:c.Close,Offset:u.Offset};e.Modifiers=h},6448:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=void 0;const n=r(1378),i=r(541),a=r(2648);class o extends a.ShapeBase{constructor(t){t.type=t.type||"Shape",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn("[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\nYou passed:",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):o.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBase=void 0;const n=r(887),i=r(3757),a=r(8721),o=r(795),s=r(3792),c=r(5511),u=r(313),h=r(541),l=n.mat4.create(),f=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class g extends h.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?-1*u.clamp(-1,1,t.anchor[0]):"left"===t.anchor[0]?1:"right"===t.anchor[0]?-1:0,"number"==typeof t.anchor[1]?-1*u.clamp(-1,1,t.anchor[1]):"top"===t.anchor[1]?1:"bottom"===t.anchor[1]?-1:0]:[0,0],this.boundingType="string"==typeof t.boundingType?"relative"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return"function"!=typeof t.repetitions&&"function"!=typeof t.distance&&"function"!=typeof t.displace&&"function"!=typeof t.scale&&"function"!=typeof t.translate&&"function"!=typeof t.skewX&&"function"!=typeof t.skewY&&"function"!=typeof t.squeezeX&&"function"!=typeof t.squeezeY&&"function"!=typeof t.rotateX&&"function"!=typeof t.rotateY&&"function"!=typeof t.rotateZ&&"function"!=typeof t.transformOrigin&&"function"!=typeof t.perspective&&"function"!=typeof t.perspectiveOrigin}isStaticIndexed(){return"function"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return"function"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){"string"==typeof t?(r=r||"repetitions"==t,this.props[t]=e):(r=r||"repetitions"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var h,m;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const v=g.getEmptyPropArguments(this,r),M=v.repetition,b=this.getProp("repetitions",v,1),y=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,x=Array.isArray(b)?b[0]*(null!==(h=b[1])&&void 0!==h?h:b[0]):b,w=Array.isArray(b)?b[0]:x,S=Array.isArray(b)?null!==(m=b[1])&&void 0!==m?m:b[0]:1,P=M.row;P.count=w;const _=M.col;_.count=S,M.count=x,M.col.count=S,M.row.count=w,M.type=y;let I=0;const O=[];let B=0;const A=n.vec2.fromValues((S-1)/2,(w-1)/2),C=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],R=[void 0,void 0,void 0,void 0],k=[void 0,void 0,void 0,void 0];for(let r=0;r1?B/(x-1):1,M.angle=y===i.ERepetitionType.Ring?s.PI2/x*B:0,_.index=h+1,_.offset=S>1?h/(S-1):1,P.index=r+1,P.offset=w>1?r/(w-1):1;const g=this.generateBuffer(t,v),m=g.length,b=this.getShapeBounding();O[B]=new Float32Array(m),I+=m;{const t=a.toVec2(this.getProp("distance",v,a.VEC2_ZERO)),s=this.getProp("displace",v,0),x=a.toVec3(this.getProp("scale",v,a.VEC2_ONE),1),w=a.toVec3(this.getProp("translate",v,a.VEC2_ZERO),0),S=this.getProp("skewX",v,0),P=this.getProp("skewY",v,0),_=this.getProp("squeezeX",v,0),I=this.getProp("squeezeY",v,0),E=this.getProp("rotateX",v,0),F=this.getProp("rotateY",v,0),q=this.getProp("rotateZ",v,0),L=u.clamp(0,1,this.getProp("perspective",v,0)),T=a.toVec3(this.getProp("perspectiveOrigin",v,a.VEC2_ZERO),0),j=a.toVec3(this.getProp("transformOrigin",v,a.VEC2_ZERO),0);let D;switch(y){case i.ERepetitionType.Ring:D=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(D,D,a.VEC3_ZERO,M.angle+s);break;case i.ERepetitionType.Matrix:D=n.vec3.fromValues(t[1]*(h-A[0]),t[0]*(r-A[1]),0)}const z=L>0?Math.max(b.width,b.height)/2:1,V=L>0?z+10*z*(1-L):0,U=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==L||0!==j[0]||0!==j[1],Y=0!==T[0]||0!==T[1];U&&(this.boundingType===i.EBoundingType.Relative?(j[0]=j[0]*(b.width/2)+b.cx,j[1]=j[1]*(b.height/2)+b.cy):(j[0]*=b.width/2,j[1]*=b.height/2),j[2]=V);{n.mat4.identity(f),U&&n.mat4.translate(f,f,j),0===w[0]&&0===w[1]||n.mat4.translate(f,f,w),0===S&&0===P||(a.fromSkew(l,[S,P]),n.mat4.multiply(f,f,l)),0!==E&&n.mat4.rotateX(f,f,E),0!==F&&n.mat4.rotateY(f,f,F),0!==q&&n.mat4.rotateZ(f,f,q),1===x[0]&&1===x[1]||n.mat4.scale(f,f,x),U&&n.mat4.translate(f,f,n.vec3.scale(j,j,-1)),V>0&&(Y&&(this.boundingType===i.EBoundingType.Relative?(T[0]=T[0]*(b.width/2)+b.cx,T[1]=T[1]*(b.height/2)+b.cy):(T[0]*=b.width/2,T[1]*=b.height/2),T[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,D),e&&n.mat4.translate(p,p,C);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),y===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,M.angle+s)}c.Bounding.clear(k);for(let t=0;t0&&(Y&&n.vec3.add(e,e,T),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,V),Y&&n.vec3.sub(e,e,T)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=m/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,v)}O[B][t]=e[0],O[B][t+1]=e[1],c.Bounding.add(k,e[0],e[1]),c.Bounding.add(R,e[0],e[1])}}const E={cx:0,cy:0,x:-1,y:-1,width:2,height:2};c.Bounding.bind(E,k),this.bStaticIndexed&&this.bIndexed||this.addIndex(m,M,E)}c.Bounding.bind(this.bounding,R),this.buffer=new Float32Array(I);for(let t=0,e=0,r=O.length;t({index:1,offset:1,count:1}),g.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...g.getEmptySimpleRepetition(),row:g.getEmptySimpleRepetition(),col:g.getEmptySimpleRepetition()})},7439:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBuffer=void 0;const n=r(5511),i=r(3674);class a extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||"ShapeBuffer",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn("[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property"),this.shape=a.EMPTY_BUFFER):this.shape="function"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return"function"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from("function"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,a=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&"function"!=typeof this.props.sideLength&&"function"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=a},5382:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeFollow=void 0;const n=r(6448);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeFollow",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},a=this.shape;a.generate(t,!1,i);let o=a.getBuffer();const s=o.length,c=new Float32Array(s*(n.length/2)),u=n.length/2;for(let e=0;e1?e/(u-1):1,count:u};this.shapeUseFollow&&(i.follow=r,a.generate(t,!1,i),o=a.getBuffer());const h=e*s,l=2*e,f=n[l],d=n[l+1];for(let t=0,e=o.length;t1?t/(e-1):1;for(let o=0,s=a.length;o{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeLoop=void 0;const n=r(3792),i=r(5511),a=r(3674),o=r(2648);class s extends a.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||"ShapeLoop",super(t),this.loopDependencies=(t.loopDependencies||[]).concat("sideLength"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes("propArguments"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}"loop"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||o.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?("function"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),a=this.getRepetitionSideLength(t),o=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,s={index:0,offset:0,current:0,count:n},c=s.count,u=new Float32Array(2*c);for(let n=0,i=0;n1?n/(s.count-1):1;s.current=a,s.index=n+1,s.offset=c;const h=o(s,t);u[i]=h[0],u[i+1]=h[1]}const h=[void 0,void 0,void 0,void 0],l=this.applyModifiers(u,t);for(let t=0,e=l.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapePrimitive=void 0;const n=r(8721),i=r(2648),a=r(9958),o=r(5511);class s extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=o.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:"function"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return"function"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:"number"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp("sideLength",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeRecursive=void 0;const n=r(6448);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeRecursive",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionScale&&"function"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp("recursions",e,1)),n=Math.floor(this.getProp("recursionVertex",e,0)),a=this.getProp("recursionScale",e,2),o=this.shape;let s={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const c={...e,recursion:s};o.generate(t,!1,c);const u=o.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=u);let h=u;const l=[s];let f=0,d=1;const p=h.length,g=p/2,m=n<=0?g:Math.min(n,g),v=0===n?1:g/Math.min(n,g),M=new Float32Array(i.summmation(r,m)*p);for(let t=0;t1?e/(r-1):1,u=i.summmation(e,m)*p,g=e-1,b=0===g?0:i.summmation(g,m)*p;for(let i=0,g=m**e;i1?i/(g-1):1,count:g,level:{index:e+1,offset:n,count:r},parent:l[f]},l.push(s),this.shapeUseRecursion&&(c.recursion=s,o.generate(t,!1,c),h=o.getBuffer());const y=u+i*p,x=Math.floor(b+2*i*v),w=M[x],S=M[x+1],P=a**e;for(let t=0,e=p;t1?0:1,count:a}}},c=this.shape.getIndexedBuffer()||[];for(let t=0,e=c.length;t1?0:1,count:a}},i={...s,recursion:r},o=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:o})}if(a>1){const t=this.shape.getBufferLength({...i,parent:{...s}})/2,e=o<=0?t:Math.min(o,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let u=0,h=1;for(let t=1;t1?t/(a-1):1;for(let o=0,l=e**t;o1?o/(l-1):1;for(let d=0,p=c.length;d{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Circle=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){t.type="Circle",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=a},6329:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Line=void 0;const n=r(5511),i=r(7439);class a extends i.ShapeBuffer{constructor(t={}){t.type="Line",t.shape=a.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lissajous=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){t.type="Lissajous",t.loopDependencies=(t.loopDependencies||[]).concat(["wx","wy","wz"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp("wx",t),r=this.getProp("wy",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),a=this.getRepetitionSideLength(t);return 1/Math.pow(a[0]*a[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp("wx",t,1),this.wy=this.getProp("wy",t,2),this.wz=this.getProp("wz",t,2),super.generateLoopBuffer(t)}}e.Lissajous=a},2982:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Polygon=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["sideNumber"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp("sideNumber",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=a},5510:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Rect=void 0;const n=r(5511),i=r(7439);class a extends i.ShapeBuffer{constructor(t={}){t.type="Rect",t.shape=a.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=a,a.buffer=[1,1,-1,1,-1,-1,1,-1]},894:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Rose=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){var e,r;t.type="Rose",t.loopDependencies=(t.loopDependencies||[]).concat(["n","d"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>a.getFinalAngleFromK(this.getProp("n",t),this.getProp("d",t)),inc:t=>{const e=this.getProp("n",t),r=this.getProp("d",t),i=this.getRepetitionSideLength(t),a=Math.pow(i[0]*i[1],.45),o=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp("n",t)/this.getProp("d",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=a},5719:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Spiral=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type="Spiral",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat(["twists","twistsStart","spiral"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:a.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp("twistsStart",t),end:t=>n.PI2*(this.getProp("twistsStart",t)+this.getProp("twists",t)),inc:t=>{const e=this.getProp("twists",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp("spiral",t),this.r=a.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case a.types.ARCHIMEDE:return t=>t/10;case a.types.HYPERBOLIC:return t=>1/t*3;case a.types.FERMAT:return t=>t**.5/3;case a.types.LITUUS:return t=>t**-.5;case a.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=a,a.types={ARCHIMEDE:"ARCHIMEDE",HYPERBOLIC:"HYPERBOLIC",FERMAT:"FERMAT",LITUUS:"LITUUS",LOGARITHMIC:"LOGARITHMIC"}},9667:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Star=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["spikes","innerRadius"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp("spikes",t,5),this.innerRadius=this.getProp("innerRadius",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=a},3977:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SuperShape=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){var e,r,i,a,o,s;t.type="SuperShape",t.loopDependencies=(t.loopDependencies||[]).concat(["a","b","m","n1","n2","n3"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(a=t.n1)&&void 0!==a?a:1,this.props.n2=null!==(o=t.n2)&&void 0!==o?o:1,this.props.n3=null!==(s=t.n3)&&void 0!==s?s:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp("a",t),this.b=this.getProp("b",t),this.m=this.getProp("m",t),this.n1=this.getProp("n1",t),this.n2=this.getProp("n2",t),this.n3=this.getProp("n3",t),super.generateLoopBuffer(t)}}e.SuperShape=a},4233:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Triangle=void 0;const n=r(5511),i=r(7439);class a extends i.ShapeBuffer{constructor(t={}){t.type="Triangle",t.shape=a.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=a,a.buffer=[1,0,-1,1,-1,-1]},3757:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(7678),e),i(r(7066),e),i(r(2769),e),i(r(7266),e),i(r(3647),e),i(r(4526),e),i(r(1618),e),i(r(6787),e)},7678:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},7066:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},2769:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]="Ring",r[r.Matrix=2]="Matrix"},7266:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3647:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4526:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]="Relative",r[r.Fixed=2]="Fixed"},1618:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6787:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},9962:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DrawerCanvas=void 0;const n=r(7358),i=r(313),a=r(3792),o=r(795),s=r(292),c=r(1189),u=r(8909),h=r(9724);class l extends c.Emitter{constructor(t,e,r,n=6e4,i=60){var a,o,s,c,l;super(),this.drawerOptions={width:(null==r?void 0:r.width)||(null==t?void 0:t.width)||400,height:(null==r?void 0:r.height)||(null==t?void 0:t.height)||400,clear:null===(a=null==r?void 0:r.clear)||void 0===a||a,time:null!==(o=null==r?void 0:r.time)&&void 0!==o?o:0,simmetricLines:null!==(s=null==r?void 0:r.simmetricLines)&&void 0!==s?s:0,noBackground:null!==(c=null==r?void 0:r.noBackground)&&void 0!==c&&c,ghosts:(null==r?void 0:r.ghosts)||0,ghostAlpha:!1!==(null==r?void 0:r.ghostAlpha),ghostSkipTime:null!==(l=null==r?void 0:r.ghostSkipTime)&&void 0!==l?l:30,ghostSkipFunction:null==r?void 0:r.ghostSkipFunction,sceneFit:(null==r?void 0:r.sceneFit)||"contain",backgroundImage:null==r?void 0:r.backgroundImage,backgroundImageFit:(null==r?void 0:r.backgroundImageFit)||"cover"},this.timeline=new u.Timeline(n,i),this.timeline.setTime(this.drawerOptions.time),this.draw_id=null,this.redraw_id=null,this.animation_id=null,t&&this.setScene(t),(!h.bWorker||h.bWorker&&e instanceof OffscreenCanvas)&&this.setCanvas(e)}getOption(t,e){var r;return null!==(r=this.drawerOptions[t])&&void 0!==r?r:e}setCanvas(t){if(h.bWorker)t instanceof OffscreenCanvas?this.canvas=t:console.error("Cannot set cavas");else if(h.bBrowser){const e=s.createCanvas(this.drawerOptions.width,this.drawerOptions.height);if(t instanceof HTMLElement&&!(t instanceof HTMLCanvasElement||t instanceof OffscreenCanvas)){for(this.canvas=e;t.lastChild;)t.removeChild(t.lastChild);t.appendChild(e)}else this.canvas=void 0===t?e:t}else this.canvas=s.createCanvas(this.drawerOptions.width,this.drawerOptions.height);this.canvas&&(this.canvas.width=this.drawerOptions.width,this.canvas.height=this.drawerOptions.height,this.context=this.canvas.getContext("2d",{alpha:!0}))}getCanvas(){return this.canvas}setScene(t){this.scene=t}draw(){if(null===this.context||void 0===this.scene)return 0;const t=i.now(),e=this.timeline,r=e.getTime(),n={...this.drawerOptions,ghostIndex:void 0,clear:this.drawerOptions.clear||e.getCurrentFrame()<=1,time:r},o=e.getFrameAtTime(r);if(this.dispatch("drawer-canvas:before_draw",{currentFrame:o,currentTime:r}),n.simmetricLines>0&&(n.clear&&l.clear(this.context,n.width,n.height,!n.noBackground&&this.scene.background,n.backgroundImage,n.backgroundImageFit),l.drawSimmetricLines(this.context,n.simmetricLines,n.width,n.height,this.scene.color),n.clear=!1),n.ghosts){const t={...n},r=e.getTime(),i=e.getDuration(),o={offset:0,index:0,count:n.ghosts};for(let e=1;e<=n.ghosts;e++){o.index=e,o.offset=o.index/o.count;const s=r-(n.ghostSkipFunction?n.ghostSkipFunction(o,r):e*n.ghostSkipTime);t.ghostIndex=e,t.time=a.mod(s,i),t.clear=n.clear&&1===t.ghostIndex,this.realDraw(t)}n.clear=!1}return this.realDraw(n),i.now()-t}realDraw(t){var e;const r=this.drawerOptions.width,n=this.drawerOptions.height,i=this.context,a=this.scene,o=null!==(e=t.time)&&void 0!==e?e:0,s=void 0!==t.ghosts&&t.ghosts>0&&void 0!==t.ghostIndex&&t.ghostIndex>0,c=s?1-t.ghostIndex/(t.ghosts+.5):0,u=!0===t.ghostAlpha,f=h.fit(a.width,a.height,r,n,this.drawerOptions.sceneFit),d=f.x,p=f.y;t.clear&&l.clear(i,r,n,!t.noBackground&&a.background,t.backgroundImage,t.backgroundImageFit);let g=!1,m=!1;a.currentTime=o;const v=a.getChildren();for(let t=0,e=v.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=void 0,e.Emitter=class{constructor(){this.callbacks={}}attach(t,e){t in this.callbacks||(this.callbacks[t]=[]),this.callbacks[t].push(e)}detach(t,e){if(t in this.callbacks){const r=this.callbacks[t].indexOf(e);r>=0&&this.callbacks[t].splice(r,1)}}dispatch(t,e){if(t in this.callbacks&&this.callbacks[t].length>0)for(let r=0,n=this.callbacks[t].length;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=void 0;const n=r(313),i=r(3792),a=r(1189);class o extends a.Emitter{constructor(t=6e4,e=30){super(),this.fps_samples_size=30,this.fps_samples=[],this.fps_samples_index=0,this.paused_time=0,this.sequence={duration:t,framerate:e,frames:Math.round(t/1e3*e)},this.tick_time=1e3/this.sequence.framerate,this.fps=this.sequence.framerate,this.b_sequence_started=!1,this.currentFrame=0,this.currentTime=0,this.last_tick=0,this.start_time=0}getSequence(){return{...this.sequence}}setSequence(t,e,r){this.sequence.duration=t,this.sequence.framerate=e,this.tick_time=1e3/this.sequence.framerate,this.sequence.frames=Math.round(this.sequence.duration/1e3*this.sequence.framerate),void 0!==r?this.setTime(r):this.dispatch("timeline:update_sequence",this.getSequence())}setDuration(t){this.setSequence(t,this.sequence.framerate)}getDuration(){return this.sequence.duration}getFramerate(){return this.sequence.framerate}setFramerate(t){this.setSequence(this.sequence.duration,t)}getFramesCount(){return this.sequence.frames}bSequenceStarted(){return this.b_sequence_started}start(){this.b_sequence_started||(this.b_sequence_started=!0,this.start_time=this.paused_time,this.dispatch("timeline:change_status",o.START))}pause(){this.b_sequence_started&&(this.paused_time=n.now(),this.b_sequence_started=!1,this.dispatch("timeline:change_status",o.PAUSE))}stop(){this.b_sequence_started&&(this.b_sequence_started=!1,this.currentTime=0,this.currentFrame=0,this.start_time=0,this.paused_time=0,this.dispatch("timeline:change_status",o.STOP))}tick(t){if(this.b_sequence_started){this.start_time||(this.start_time=t,this.last_tick=-this.tick_time);const e=t-this.start_time,r=e-this.last_tick;if(r>=this.tick_time)return this.calculateFPS(1/(r/1e3)),this.last_tick=e,this.currentTime=(e-r%this.tick_time)%this.sequence.duration,this.currentFrame=this.getFrameAtTime(this.currentTime),this.dispatch("timeline:progress",{currentFrame:this.currentFrame,currentTime:this.currentTime,fps:this.fps}),!0}return!1}calculateFPS(t){const e=this.fps_samples.length;if(e>0){let t=0;for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BrowserDrawerCanvas=void 0;const n=r(9962),i=r(9724);class a extends n.DrawerCanvas{constructor(t,e,r,n=6e4,i=60){super(t,e,r,n,i),this.dpi=1,this.dpi=(null==r?void 0:r.dpi)||1,this.draw_id=null,this.redraw_id=null,this.animation_id=null,this.draw=this.draw.bind(this),this.animate=this.animate.bind(this),this.startAnimation=this.startAnimation.bind(this),this.resize(this.drawerOptions.width,this.drawerOptions.height)}resize(t,e,r,n=this.dpi){this.drawerOptions.width=t*n,this.drawerOptions.height=e*n,this.canvas&&(this.canvas.width=t*n,this.canvas.height=e*n,i.bBrowser&&this.canvas instanceof HTMLCanvasElement&&(this.canvas.style.width=t+"px",this.canvas.style.height=e+"px")),void 0!==r&&(this.drawerOptions.sceneFit=r),this.dispatch("drawer-canvas:resize")}animate(t){this.timeline.bSequenceStarted()&&(this.animation_id=requestAnimationFrame(this.animate),this.timeline.tick(t)&&this.draw())}startAnimation(){this.stopAnimation(),this.timeline.start(),this.animation_id=requestAnimationFrame(this.animate)}stopAnimation(){this.timeline.stop(),this.animation_id&&cancelAnimationFrame(this.animation_id)}pauseAnimation(){this.timeline.pause(),this.animation_id&&cancelAnimationFrame(this.animation_id)}playAnimation(){this.timeline.start(),requestAnimationFrame(this.animate)}redraw(){this.timeline.bSequenceStarted()?void 0!==typeof this.drawerOptions.ghosts&&0!==this.drawerOptions.ghosts||(this.stopAnimation(),this.redraw_id&&cancelAnimationFrame(this.redraw_id),this.redraw_id=requestAnimationFrame(this.startAnimation)):(this.draw_id&&cancelAnimationFrame(this.draw_id),void 0!==typeof this.drawerOptions.ghosts&&0!==this.drawerOptions.ghosts||this.timeline.stop(),this.draw_id=requestAnimationFrame(this.draw))}}e.BrowserDrawerCanvas=a},9724:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fit=e.bWorker=e.bBrowser=e.bNode=void 0,e.bNode="undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node,e.bBrowser="undefined"!=typeof window&&void 0!==window.document,e.bWorker="object"==typeof self&&["ServiceWorkerGlobalScope","DedicatedWorkerGlobalScope"].includes(self.constructor.name),e.fit=function(t,e,r,n,i="none"){let a=0,o=0,s=1,c=t,u=e;const h=r/n,l=t/e;return"contain"===i?(c=h>l?t*n/e:r,u=h>l?n:e*r/t,s=Math.max(c,u)/Math.max(t,e)):"cover"===i&&(c=h{var e=.1,r="function"==typeof Float32Array;function n(t,e){return 1-3*e+3*t}function i(t,e){return 3*e-6*t}function a(t){return 3*t}function o(t,e,r){return((n(e,r)*t+i(e,r))*t+a(e))*t}function s(t,e,r){return 3*n(e,r)*t*t+2*i(e,r)*t+a(e)}function c(t){return t}t.exports=function(t,n,i,a){if(!(0<=t&&t<=1&&0<=i&&i<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===n&&i===a)return c;for(var u=r?new Float32Array(11):new Array(11),h=0;h<11;++h)u[h]=o(h*e,t,i);return function(r){return 0===r?0:1===r?1:o(function(r){for(var n=0,a=1;10!==a&&u[a]<=r;++a)n+=e;--a;var c=n+(r-u[a])/(u[a+1]-u[a])*e,h=s(c,t,i);return h>=.001?function(t,e,r,n){for(var i=0;i<4;++i){var a=s(e,r,n);if(0===a)return e;e-=(o(e,r,n)-t)/a}return e}(r,c,t,i):0===h?c:function(t,e,r,n,i){var a,s,c=0;do{(a=o(s=e+(r-e)/2,n,i)-t)>0?r=s:e=s}while(Math.abs(a)>1e-7&&++c<10);return s}(r,n,n+e,t,i)}(r),n,a)}}},292:(t,e,r)=>{const n=r(9850);e.parseFont=n,e.createCanvas=function(t,e){return Object.assign(document.createElement("canvas"),{width:t,height:e})},e.createImageData=function(t,e,r){switch(arguments.length){case 0:return new ImageData;case 1:return new ImageData(t);case 2:return new ImageData(t,e);default:return new ImageData(t,e,r)}},e.loadImage=function(t,e){return new Promise((function(r,n){const i=Object.assign(document.createElement("img"),e);function a(){i.onload=null,i.onerror=null}i.onload=function(){a(),r(i)},i.onerror=function(){a(),n(new Error('Failed to load the image "'+t+'"'))},i.src=t}))}},9850:t=>{"use strict";const e="'([^']+)'|\"([^\"]+)\"|[\\w\\s-]+",r=new RegExp("(bold|bolder|lighter|[1-9]00) +","i"),n=new RegExp("(italic|oblique) +","i"),i=new RegExp("(small-caps) +","i"),a=new RegExp("(ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded) +","i"),o=new RegExp("([\\d\\.]+)(px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q) *((?:"+e+")( *, *(?:"+e+"))*)"),s={};t.exports=function(t){if(s[t])return s[t];const e=o.exec(t);if(!e)return;const c={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(e[1]),unit:e[2],family:e[3].replace(/["']/g,"").replace(/ *, */g,",")};let u,h,l,f,d=t.substring(0,e.index);switch((u=r.exec(d))&&(c.weight=u[1]),(h=n.exec(d))&&(c.style=h[1]),(l=i.exec(d))&&(c.variant=l[1]),(f=a.exec(d))&&(c.stretch=f[1]),c.unit){case"pt":c.size/=.75;break;case"pc":c.size*=16;break;case"in":c.size*=96;break;case"cm":c.size*=96/2.54;break;case"mm":c.size*=96/25.4;break;case"%":break;case"em":case"rem":c.size*=16/.75;break;case"q":c.size*=96/25.4/4}return s[t]=c}},887:(t,e,r)=>{"use strict";r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>a,mat3:()=>o,mat4:()=>s,quat:()=>h,quat2:()=>l,vec2:()=>f,vec3:()=>c,vec4:()=>u});var n={};r.r(n),r.d(n,{ARRAY_TYPE:()=>p,EPSILON:()=>d,RANDOM:()=>g,equals:()=>b,setMatrixArrayType:()=>m,toRadian:()=>M});var i={};r.r(i),r.d(i,{LDU:()=>T,add:()=>j,adjoint:()=>B,clone:()=>x,copy:()=>w,create:()=>y,determinant:()=>A,equals:()=>V,exactEquals:()=>z,frob:()=>L,fromRotation:()=>E,fromScaling:()=>F,fromValues:()=>P,identity:()=>S,invert:()=>O,mul:()=>H,multiply:()=>C,multiplyScalar:()=>U,multiplyScalarAndAdd:()=>Y,rotate:()=>R,scale:()=>k,set:()=>_,str:()=>q,sub:()=>N,subtract:()=>D,transpose:()=>I});var a={};r.r(a),r.d(a,{add:()=>ut,clone:()=>X,copy:()=>G,create:()=>Z,determinant:()=>K,equals:()=>pt,exactEquals:()=>dt,frob:()=>ct,fromRotation:()=>it,fromScaling:()=>at,fromTranslation:()=>ot,fromValues:()=>W,identity:()=>$,invert:()=>J,mul:()=>gt,multiply:()=>tt,multiplyScalar:()=>lt,multiplyScalarAndAdd:()=>ft,rotate:()=>et,scale:()=>rt,set:()=>Q,str:()=>st,sub:()=>mt,subtract:()=>ht,translate:()=>nt});var o={};r.r(o),r.d(o,{add:()=>Vt,adjoint:()=>It,clone:()=>bt,copy:()=>yt,create:()=>vt,determinant:()=>Ot,equals:()=>Zt,exactEquals:()=>Nt,frob:()=>zt,fromMat2d:()=>qt,fromMat4:()=>Mt,fromQuat:()=>Lt,fromRotation:()=>Et,fromScaling:()=>Ft,fromTranslation:()=>kt,fromValues:()=>xt,identity:()=>St,invert:()=>_t,mul:()=>Xt,multiply:()=>Bt,multiplyScalar:()=>Yt,multiplyScalarAndAdd:()=>Ht,normalFromMat4:()=>Tt,projection:()=>jt,rotate:()=>Ct,scale:()=>Rt,set:()=>wt,str:()=>Dt,sub:()=>Gt,subtract:()=>Ut,translate:()=>At,transpose:()=>Pt});var s={};r.r(s),r.d(s,{add:()=>Fe,adjoint:()=>ne,clone:()=>Wt,copy:()=>Qt,create:()=>$t,determinant:()=>ie,equals:()=>De,exactEquals:()=>je,frob:()=>Ee,fromQuat:()=>_e,fromQuat2:()=>be,fromRotation:()=>pe,fromRotationTranslation:()=>Me,fromRotationTranslationScale:()=>Se,fromRotationTranslationScaleOrigin:()=>Pe,fromScaling:()=>de,fromTranslation:()=>fe,fromValues:()=>Jt,fromXRotation:()=>ge,fromYRotation:()=>me,fromZRotation:()=>ve,frustum:()=>Ie,getRotation:()=>we,getScaling:()=>xe,getTranslation:()=>ye,identity:()=>te,invert:()=>re,lookAt:()=>Ce,mul:()=>ze,multiply:()=>ae,multiplyScalar:()=>Le,multiplyScalarAndAdd:()=>Te,ortho:()=>Ae,perspective:()=>Oe,perspectiveFromFieldOfView:()=>Be,rotate:()=>ce,rotateX:()=>ue,rotateY:()=>he,rotateZ:()=>le,scale:()=>se,set:()=>Kt,str:()=>ke,sub:()=>Ve,subtract:()=>qe,targetTo:()=>Re,translate:()=>oe,transpose:()=>ee});var c={};r.r(c),r.d(c,{add:()=>Ge,angle:()=>Sr,bezier:()=>gr,ceil:()=>Je,clone:()=>Ye,copy:()=>Ze,create:()=>Ue,cross:()=>fr,dist:()=>kr,distance:()=>ar,div:()=>Rr,divide:()=>Qe,dot:()=>lr,equals:()=>Or,exactEquals:()=>Ir,floor:()=>Ke,forEach:()=>Lr,fromValues:()=>Ne,hermite:()=>pr,inverse:()=>ur,len:()=>Fr,length:()=>He,lerp:()=>dr,max:()=>er,min:()=>tr,mul:()=>Cr,multiply:()=>We,negate:()=>cr,normalize:()=>hr,random:()=>mr,rotateX:()=>yr,rotateY:()=>xr,rotateZ:()=>wr,round:()=>rr,scale:()=>nr,scaleAndAdd:()=>ir,set:()=>Xe,sqrDist:()=>Er,sqrLen:()=>qr,squaredDistance:()=>or,squaredLength:()=>sr,str:()=>_r,sub:()=>Ar,subtract:()=>$e,transformMat3:()=>Mr,transformMat4:()=>vr,transformQuat:()=>br,zero:()=>Pr});var u={};r.r(u),r.d(u,{add:()=>Ur,ceil:()=>Zr,clone:()=>jr,copy:()=>zr,create:()=>Tr,cross:()=>cn,dist:()=>yn,distance:()=>Kr,div:()=>bn,divide:()=>Nr,dot:()=>sn,equals:()=>mn,exactEquals:()=>gn,floor:()=>Xr,forEach:()=>Pn,fromValues:()=>Dr,inverse:()=>an,len:()=>wn,length:()=>en,lerp:()=>un,max:()=>$r,min:()=>Gr,mul:()=>Mn,multiply:()=>Hr,negate:()=>nn,normalize:()=>on,random:()=>hn,round:()=>Wr,scale:()=>Qr,scaleAndAdd:()=>Jr,set:()=>Vr,sqrDist:()=>xn,sqrLen:()=>Sn,squaredDistance:()=>tn,squaredLength:()=>rn,str:()=>pn,sub:()=>vn,subtract:()=>Yr,transformMat4:()=>ln,transformQuat:()=>fn,zero:()=>dn});var h={};r.r(h),r.d(h,{add:()=>ei,calculateW:()=>Fn,clone:()=>Qn,conjugate:()=>Vn,copy:()=>Kn,create:()=>_n,dot:()=>ii,equals:()=>fi,exactEquals:()=>li,exp:()=>qn,fromEuler:()=>Yn,fromMat3:()=>Un,fromValues:()=>Jn,getAngle:()=>An,getAxisAngle:()=>Bn,identity:()=>In,invert:()=>zn,len:()=>si,length:()=>oi,lerp:()=>ai,ln:()=>Ln,mul:()=>ri,multiply:()=>Cn,normalize:()=>hi,pow:()=>Tn,random:()=>Dn,rotateX:()=>Rn,rotateY:()=>kn,rotateZ:()=>En,rotationTo:()=>di,scale:()=>ni,set:()=>ti,setAxes:()=>gi,setAxisAngle:()=>On,slerp:()=>jn,sqlerp:()=>pi,sqrLen:()=>ui,squaredLength:()=>ci,str:()=>Hn});var l={};r.r(l),r.d(l,{add:()=>Di,clone:()=>vi,conjugate:()=>Zi,copy:()=>Pi,create:()=>mi,dot:()=>Yi,equals:()=>ta,exactEquals:()=>Ki,fromMat4:()=>Si,fromRotation:()=>wi,fromRotationTranslation:()=>yi,fromRotationTranslationValues:()=>bi,fromTranslation:()=>xi,fromValues:()=>Mi,getDual:()=>Bi,getReal:()=>Oi,getTranslation:()=>Ri,identity:()=>_i,invert:()=>Ni,len:()=>Gi,length:()=>Xi,lerp:()=>Hi,mul:()=>Vi,multiply:()=>zi,normalize:()=>Qi,rotateAroundAxis:()=>ji,rotateByQuatAppend:()=>Li,rotateByQuatPrepend:()=>Ti,rotateX:()=>Ei,rotateY:()=>Fi,rotateZ:()=>qi,scale:()=>Ui,set:()=>Ii,setDual:()=>Ci,setReal:()=>Ai,sqrLen:()=>Wi,squaredLength:()=>$i,str:()=>Ji,translate:()=>ki});var f={};r.r(f),r.d(f,{add:()=>oa,angle:()=>Ea,ceil:()=>ha,clone:()=>ra,copy:()=>ia,create:()=>ea,cross:()=>_a,dist:()=>Ua,distance:()=>va,div:()=>Va,divide:()=>ua,dot:()=>Pa,equals:()=>Ta,exactEquals:()=>La,floor:()=>la,forEach:()=>Na,fromValues:()=>na,inverse:()=>wa,len:()=>ja,length:()=>ba,lerp:()=>Ia,max:()=>da,min:()=>fa,mul:()=>za,multiply:()=>ca,negate:()=>xa,normalize:()=>Sa,random:()=>Oa,rotate:()=>ka,round:()=>pa,scale:()=>ga,scaleAndAdd:()=>ma,set:()=>aa,sqrDist:()=>Ya,sqrLen:()=>Ha,squaredDistance:()=>Ma,squaredLength:()=>ya,str:()=>qa,sub:()=>Da,subtract:()=>sa,transformMat2:()=>Ba,transformMat2d:()=>Aa,transformMat3:()=>Ca,transformMat4:()=>Ra,zero:()=>Fa});var d=1e-6,p="undefined"!=typeof Float32Array?Float32Array:Array,g=Math.random;function m(t){p=t}var v=Math.PI/180;function M(t){return t*v}function b(t,e){return Math.abs(t-e)<=d*Math.max(1,Math.abs(t),Math.abs(e))}function y(){var t=new p(4);return p!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function x(t){var e=new p(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function w(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function S(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function P(t,e,r,n){var i=new p(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function _(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function I(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function O(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*a-i*n;return o?(o=1/o,t[0]=a*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}function B(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function A(t){return t[0]*t[3]-t[2]*t[1]}function C(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],c=r[1],u=r[2],h=r[3];return t[0]=n*s+a*c,t[1]=i*s+o*c,t[2]=n*u+a*h,t[3]=i*u+o*h,t}function R(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),c=Math.cos(r);return t[0]=n*c+a*s,t[1]=i*c+o*s,t[2]=n*-s+a*c,t[3]=i*-s+o*c,t}function k(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],c=r[1];return t[0]=n*s,t[1]=i*s,t[2]=a*c,t[3]=o*c,t}function E(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function F(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function q(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function L(t){return Math.hypot(t[0],t[1],t[2],t[3])}function T(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function j(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function D(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function z(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function V(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],c=e[2],u=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-c)<=d*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(a-u)<=d*Math.max(1,Math.abs(a),Math.abs(u))}function U(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Y(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var H=C,N=D;function Z(){var t=new p(6);return p!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function X(t){var e=new p(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function G(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function $(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function W(t,e,r,n,i,a){var o=new p(6);return o[0]=t,o[1]=e,o[2]=r,o[3]=n,o[4]=i,o[5]=a,o}function Q(t,e,r,n,i,a,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t}function J(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=r*a-n*i;return c?(c=1/c,t[0]=a*c,t[1]=-n*c,t[2]=-i*c,t[3]=r*c,t[4]=(i*s-a*o)*c,t[5]=(n*o-r*s)*c,t):null}function K(t){return t[0]*t[3]-t[1]*t[2]}function tt(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],u=r[0],h=r[1],l=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*u+a*h,t[1]=i*u+o*h,t[2]=n*l+a*f,t[3]=i*l+o*f,t[4]=n*d+a*p+s,t[5]=i*d+o*p+c,t}function et(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],u=Math.sin(r),h=Math.cos(r);return t[0]=n*h+a*u,t[1]=i*h+o*u,t[2]=n*-u+a*h,t[3]=i*-u+o*h,t[4]=s,t[5]=c,t}function rt(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],u=r[0],h=r[1];return t[0]=n*u,t[1]=i*u,t[2]=a*h,t[3]=o*h,t[4]=s,t[5]=c,t}function nt(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],u=r[0],h=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=n*u+a*h+s,t[5]=i*u+o*h+c,t}function it(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function at(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function ot(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function st(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function ct(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function ut(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function ht(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function lt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function ft(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function dt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function pt(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=e[0],u=e[1],h=e[2],l=e[3],f=e[4],p=e[5];return Math.abs(r-c)<=d*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(n-u)<=d*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(i-h)<=d*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-l)<=d*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(o-f)<=d*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(s-p)<=d*Math.max(1,Math.abs(s),Math.abs(p))}var gt=tt,mt=ht;function vt(){var t=new p(9);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Mt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function bt(t){var e=new p(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function xt(t,e,r,n,i,a,o,s,c){var u=new p(9);return u[0]=t,u[1]=e,u[2]=r,u[3]=n,u[4]=i,u[5]=a,u[6]=o,u[7]=s,u[8]=c,u}function wt(t,e,r,n,i,a,o,s,c,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=u,t}function St(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Pt(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function _t(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],u=e[7],h=e[8],l=h*o-s*u,f=-h*a+s*c,d=u*a-o*c,p=r*l+n*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-h*n+i*u)*p,t[2]=(s*n-i*o)*p,t[3]=f*p,t[4]=(h*r-i*c)*p,t[5]=(-s*r+i*a)*p,t[6]=d*p,t[7]=(-u*r+n*c)*p,t[8]=(o*r-n*a)*p,t):null}function It(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],u=e[7],h=e[8];return t[0]=o*h-s*u,t[1]=i*u-n*h,t[2]=n*s-i*o,t[3]=s*c-a*h,t[4]=r*h-i*c,t[5]=i*a-r*s,t[6]=a*u-o*c,t[7]=n*c-r*u,t[8]=r*o-n*a,t}function Ot(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],u=t[8];return e*(u*a-o*c)+r*(-u*i+o*s)+n*(c*i-a*s)}function Bt(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],u=e[6],h=e[7],l=e[8],f=r[0],d=r[1],p=r[2],g=r[3],m=r[4],v=r[5],M=r[6],b=r[7],y=r[8];return t[0]=f*n+d*o+p*u,t[1]=f*i+d*s+p*h,t[2]=f*a+d*c+p*l,t[3]=g*n+m*o+v*u,t[4]=g*i+m*s+v*h,t[5]=g*a+m*c+v*l,t[6]=M*n+b*o+y*u,t[7]=M*i+b*s+y*h,t[8]=M*a+b*c+y*l,t}function At(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],u=e[6],h=e[7],l=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=c,t[6]=f*n+d*o+u,t[7]=f*i+d*s+h,t[8]=f*a+d*c+l,t}function Ct(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],u=e[6],h=e[7],l=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*s,t[2]=d*a+f*c,t[3]=d*o-f*n,t[4]=d*s-f*i,t[5]=d*c-f*a,t[6]=u,t[7]=h,t[8]=l,t}function Rt(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function kt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function Et(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Ft(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function qt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function Lt(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,c=i+i,u=r*o,h=n*o,l=n*s,f=i*o,d=i*s,p=i*c,g=a*o,m=a*s,v=a*c;return t[0]=1-l-p,t[3]=h-v,t[6]=f+m,t[1]=h+v,t[4]=1-u-p,t[7]=d-g,t[2]=f-m,t[5]=d+g,t[8]=1-u-l,t}function Tt(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],u=e[7],h=e[8],l=e[9],f=e[10],d=e[11],p=e[12],g=e[13],m=e[14],v=e[15],M=r*s-n*o,b=r*c-i*o,y=r*u-a*o,x=n*c-i*s,w=n*u-a*s,S=i*u-a*c,P=h*g-l*p,_=h*m-f*p,I=h*v-d*p,O=l*m-f*g,B=l*v-d*g,A=f*v-d*m,C=M*A-b*B+y*O+x*I-w*_+S*P;return C?(C=1/C,t[0]=(s*A-c*B+u*O)*C,t[1]=(c*I-o*A-u*_)*C,t[2]=(o*B-s*I+u*P)*C,t[3]=(i*B-n*A-a*O)*C,t[4]=(r*A-i*I+a*_)*C,t[5]=(n*I-r*B-a*P)*C,t[6]=(g*S-m*w+v*x)*C,t[7]=(m*y-p*S-v*b)*C,t[8]=(p*w-g*y+v*M)*C,t):null}function jt(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function Dt(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function zt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Vt(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function Ut(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function Yt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function Ht(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function Nt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function Zt(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],u=t[7],h=t[8],l=e[0],f=e[1],p=e[2],g=e[3],m=e[4],v=e[5],M=e[6],b=e[7],y=e[8];return Math.abs(r-l)<=d*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(n-f)<=d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-p)<=d*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(a-g)<=d*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(o-m)<=d*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(s-v)<=d*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(c-M)<=d*Math.max(1,Math.abs(c),Math.abs(M))&&Math.abs(u-b)<=d*Math.max(1,Math.abs(u),Math.abs(b))&&Math.abs(h-y)<=d*Math.max(1,Math.abs(h),Math.abs(y))}var Xt=Bt,Gt=Ut;function $t(){var t=new p(16);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Wt(t){var e=new p(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Qt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Jt(t,e,r,n,i,a,o,s,c,u,h,l,f,d,g,m){var v=new p(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=n,v[4]=i,v[5]=a,v[6]=o,v[7]=s,v[8]=c,v[9]=u,v[10]=h,v[11]=l,v[12]=f,v[13]=d,v[14]=g,v[15]=m,v}function Kt(t,e,r,n,i,a,o,s,c,u,h,l,f,d,p,g,m){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=u,t[9]=h,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=g,t[15]=m,t}function te(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ee(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function re(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],u=e[7],h=e[8],l=e[9],f=e[10],d=e[11],p=e[12],g=e[13],m=e[14],v=e[15],M=r*s-n*o,b=r*c-i*o,y=r*u-a*o,x=n*c-i*s,w=n*u-a*s,S=i*u-a*c,P=h*g-l*p,_=h*m-f*p,I=h*v-d*p,O=l*m-f*g,B=l*v-d*g,A=f*v-d*m,C=M*A-b*B+y*O+x*I-w*_+S*P;return C?(C=1/C,t[0]=(s*A-c*B+u*O)*C,t[1]=(i*B-n*A-a*O)*C,t[2]=(g*S-m*w+v*x)*C,t[3]=(f*w-l*S-d*x)*C,t[4]=(c*I-o*A-u*_)*C,t[5]=(r*A-i*I+a*_)*C,t[6]=(m*y-p*S-v*b)*C,t[7]=(h*S-f*y+d*b)*C,t[8]=(o*B-s*I+u*P)*C,t[9]=(n*I-r*B-a*P)*C,t[10]=(p*w-g*y+v*M)*C,t[11]=(l*y-h*w-d*M)*C,t[12]=(s*_-o*O-c*P)*C,t[13]=(r*O-n*_+i*P)*C,t[14]=(g*b-p*x-m*M)*C,t[15]=(h*x-l*b+f*M)*C,t):null}function ne(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],u=e[7],h=e[8],l=e[9],f=e[10],d=e[11],p=e[12],g=e[13],m=e[14],v=e[15];return t[0]=s*(f*v-d*m)-l*(c*v-u*m)+g*(c*d-u*f),t[1]=-(n*(f*v-d*m)-l*(i*v-a*m)+g*(i*d-a*f)),t[2]=n*(c*v-u*m)-s*(i*v-a*m)+g*(i*u-a*c),t[3]=-(n*(c*d-u*f)-s*(i*d-a*f)+l*(i*u-a*c)),t[4]=-(o*(f*v-d*m)-h*(c*v-u*m)+p*(c*d-u*f)),t[5]=r*(f*v-d*m)-h*(i*v-a*m)+p*(i*d-a*f),t[6]=-(r*(c*v-u*m)-o*(i*v-a*m)+p*(i*u-a*c)),t[7]=r*(c*d-u*f)-o*(i*d-a*f)+h*(i*u-a*c),t[8]=o*(l*v-d*g)-h*(s*v-u*g)+p*(s*d-u*l),t[9]=-(r*(l*v-d*g)-h*(n*v-a*g)+p*(n*d-a*l)),t[10]=r*(s*v-u*g)-o*(n*v-a*g)+p*(n*u-a*s),t[11]=-(r*(s*d-u*l)-o*(n*d-a*l)+h*(n*u-a*s)),t[12]=-(o*(l*m-f*g)-h*(s*m-c*g)+p*(s*f-c*l)),t[13]=r*(l*m-f*g)-h*(n*m-i*g)+p*(n*f-i*l),t[14]=-(r*(s*m-c*g)-o*(n*m-i*g)+p*(n*c-i*s)),t[15]=r*(s*f-c*l)-o*(n*f-i*l)+h*(n*c-i*s),t}function ie(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],u=t[8],h=t[9],l=t[10],f=t[11],d=t[12],p=t[13],g=t[14],m=t[15];return(e*o-r*a)*(l*m-f*g)-(e*s-n*a)*(h*m-f*p)+(e*c-i*a)*(h*g-l*p)+(r*s-n*o)*(u*m-f*d)-(r*c-i*o)*(u*g-l*d)+(n*c-i*s)*(u*p-h*d)}function ae(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],u=e[6],h=e[7],l=e[8],f=e[9],d=e[10],p=e[11],g=e[12],m=e[13],v=e[14],M=e[15],b=r[0],y=r[1],x=r[2],w=r[3];return t[0]=b*n+y*s+x*l+w*g,t[1]=b*i+y*c+x*f+w*m,t[2]=b*a+y*u+x*d+w*v,t[3]=b*o+y*h+x*p+w*M,b=r[4],y=r[5],x=r[6],w=r[7],t[4]=b*n+y*s+x*l+w*g,t[5]=b*i+y*c+x*f+w*m,t[6]=b*a+y*u+x*d+w*v,t[7]=b*o+y*h+x*p+w*M,b=r[8],y=r[9],x=r[10],w=r[11],t[8]=b*n+y*s+x*l+w*g,t[9]=b*i+y*c+x*f+w*m,t[10]=b*a+y*u+x*d+w*v,t[11]=b*o+y*h+x*p+w*M,b=r[12],y=r[13],x=r[14],w=r[15],t[12]=b*n+y*s+x*l+w*g,t[13]=b*i+y*c+x*f+w*m,t[14]=b*a+y*u+x*d+w*v,t[15]=b*o+y*h+x*p+w*M,t}function oe(t,e,r){var n,i,a,o,s,c,u,h,l,f,d,p,g=r[0],m=r[1],v=r[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*v+e[12],t[13]=e[1]*g+e[5]*m+e[9]*v+e[13],t[14]=e[2]*g+e[6]*m+e[10]*v+e[14],t[15]=e[3]*g+e[7]*m+e[11]*v+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],u=e[6],h=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=c,t[6]=u,t[7]=h,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*g+s*m+l*v+e[12],t[13]=i*g+c*m+f*v+e[13],t[14]=a*g+u*m+d*v+e[14],t[15]=o*g+h*m+p*v+e[15]),t}function se(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ce(t,e,r,n){var i,a,o,s,c,u,h,l,f,p,g,m,v,M,b,y,x,w,S,P,_,I,O,B,A=n[0],C=n[1],R=n[2],k=Math.hypot(A,C,R);return k0?(r[0]=2*(s*o+h*n+c*a-u*i)/l,r[1]=2*(c*o+h*i+u*n-s*a)/l,r[2]=2*(u*o+h*a+s*i-c*n)/l):(r[0]=2*(s*o+h*n+c*a-u*i),r[1]=2*(c*o+h*i+u*n-s*a),r[2]=2*(u*o+h*a+s*i-c*n)),Me(t,e,r),t}function ye(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function xe(t,e){var r=e[0],n=e[1],i=e[2],a=e[4],o=e[5],s=e[6],c=e[8],u=e[9],h=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(a,o,s),t[2]=Math.hypot(c,u,h),t}function we(t,e){var r=new p(3);xe(r,e);var n=1/r[0],i=1/r[1],a=1/r[2],o=e[0]*n,s=e[1]*i,c=e[2]*a,u=e[4]*n,h=e[5]*i,l=e[6]*a,f=e[8]*n,d=e[9]*i,g=e[10]*a,m=o+h+g,v=0;return m>0?(v=2*Math.sqrt(m+1),t[3]=.25*v,t[0]=(l-d)/v,t[1]=(f-c)/v,t[2]=(s-u)/v):o>h&&o>g?(v=2*Math.sqrt(1+o-h-g),t[3]=(l-d)/v,t[0]=.25*v,t[1]=(s+u)/v,t[2]=(f+c)/v):h>g?(v=2*Math.sqrt(1+h-o-g),t[3]=(f-c)/v,t[0]=(s+u)/v,t[1]=.25*v,t[2]=(l+d)/v):(v=2*Math.sqrt(1+g-o-h),t[3]=(s-u)/v,t[0]=(f+c)/v,t[1]=(l+d)/v,t[2]=.25*v),t}function Se(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],c=i+i,u=a+a,h=o+o,l=i*c,f=i*u,d=i*h,p=a*u,g=a*h,m=o*h,v=s*c,M=s*u,b=s*h,y=n[0],x=n[1],w=n[2];return t[0]=(1-(p+m))*y,t[1]=(f+b)*y,t[2]=(d-M)*y,t[3]=0,t[4]=(f-b)*x,t[5]=(1-(l+m))*x,t[6]=(g+v)*x,t[7]=0,t[8]=(d+M)*w,t[9]=(g-v)*w,t[10]=(1-(l+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function Pe(t,e,r,n,i){var a=e[0],o=e[1],s=e[2],c=e[3],u=a+a,h=o+o,l=s+s,f=a*u,d=a*h,p=a*l,g=o*h,m=o*l,v=s*l,M=c*u,b=c*h,y=c*l,x=n[0],w=n[1],S=n[2],P=i[0],_=i[1],I=i[2],O=(1-(g+v))*x,B=(d+y)*x,A=(p-b)*x,C=(d-y)*w,R=(1-(f+v))*w,k=(m+M)*w,E=(p+b)*S,F=(m-M)*S,q=(1-(f+g))*S;return t[0]=O,t[1]=B,t[2]=A,t[3]=0,t[4]=C,t[5]=R,t[6]=k,t[7]=0,t[8]=E,t[9]=F,t[10]=q,t[11]=0,t[12]=r[0]+P-(O*P+C*_+E*I),t[13]=r[1]+_-(B*P+R*_+F*I),t[14]=r[2]+I-(A*P+k*_+q*I),t[15]=1,t}function _e(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,c=i+i,u=r*o,h=n*o,l=n*s,f=i*o,d=i*s,p=i*c,g=a*o,m=a*s,v=a*c;return t[0]=1-l-p,t[1]=h+v,t[2]=f-m,t[3]=0,t[4]=h-v,t[5]=1-u-p,t[6]=d+g,t[7]=0,t[8]=f+m,t[9]=d-g,t[10]=1-u-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ie(t,e,r,n,i,a,o){var s=1/(r-e),c=1/(i-n),u=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*c,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*c,t[10]=(o+a)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*u,t[15]=0,t}function Oe(t,e,r,n,i){var a,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(a=1/(n-i),t[10]=(i+n)*a,t[14]=2*i*n*a):(t[10]=-1,t[14]=-2*n),t}function Be(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),c=2/(o+s),u=2/(i+a);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-s)*c*.5,t[9]=(i-a)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function Ae(t,e,r,n,i,a,o){var s=1/(e-r),c=1/(n-i),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*c,t[14]=(o+a)*u,t[15]=1,t}function Ce(t,e,r,n){var i,a,o,s,c,u,h,l,f,p,g=e[0],m=e[1],v=e[2],M=n[0],b=n[1],y=n[2],x=r[0],w=r[1],S=r[2];return Math.abs(g-x)0&&(h*=d=1/Math.sqrt(d),l*=d,f*=d);var p=c*f-u*l,g=u*h-s*f,m=s*l-c*h;return(d=p*p+g*g+m*m)>0&&(p*=d=1/Math.sqrt(d),g*=d,m*=d),t[0]=p,t[1]=g,t[2]=m,t[3]=0,t[4]=l*m-f*g,t[5]=f*p-h*m,t[6]=h*g-l*p,t[7]=0,t[8]=h,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=a,t[14]=o,t[15]=1,t}function ke(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Ee(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Fe(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function qe(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function Le(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function Te(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function je(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function De(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],u=t[7],h=t[8],l=t[9],f=t[10],p=t[11],g=t[12],m=t[13],v=t[14],M=t[15],b=e[0],y=e[1],x=e[2],w=e[3],S=e[4],P=e[5],_=e[6],I=e[7],O=e[8],B=e[9],A=e[10],C=e[11],R=e[12],k=e[13],E=e[14],F=e[15];return Math.abs(r-b)<=d*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-y)<=d*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-x)<=d*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-w)<=d*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(o-S)<=d*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(s-P)<=d*Math.max(1,Math.abs(s),Math.abs(P))&&Math.abs(c-_)<=d*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-I)<=d*Math.max(1,Math.abs(u),Math.abs(I))&&Math.abs(h-O)<=d*Math.max(1,Math.abs(h),Math.abs(O))&&Math.abs(l-B)<=d*Math.max(1,Math.abs(l),Math.abs(B))&&Math.abs(f-A)<=d*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(p-C)<=d*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(g-R)<=d*Math.max(1,Math.abs(g),Math.abs(R))&&Math.abs(m-k)<=d*Math.max(1,Math.abs(m),Math.abs(k))&&Math.abs(v-E)<=d*Math.max(1,Math.abs(v),Math.abs(E))&&Math.abs(M-F)<=d*Math.max(1,Math.abs(M),Math.abs(F))}var ze=ae,Ve=qe;function Ue(){var t=new p(3);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ye(t){var e=new p(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function He(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function Ne(t,e,r){var n=new p(3);return n[0]=t,n[1]=e,n[2]=r,n}function Ze(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Xe(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function Ge(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function $e(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function We(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function Qe(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function Je(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Ke(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function tr(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function er(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function rr(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function nr(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function ir(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function ar(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function or(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function sr(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function cr(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function ur(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function hr(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function lr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function fr(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],c=r[2];return t[0]=i*c-a*s,t[1]=a*o-n*c,t[2]=n*s-i*o,t}function dr(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t}function pr(t,e,r,n,i,a){var o=a*a,s=o*(2*a-3)+1,c=o*(a-2)+a,u=o*(a-1),h=o*(3-2*a);return t[0]=e[0]*s+r[0]*c+n[0]*u+i[0]*h,t[1]=e[1]*s+r[1]*c+n[1]*u+i[1]*h,t[2]=e[2]*s+r[2]*c+n[2]*u+i[2]*h,t}function gr(t,e,r,n,i,a){var o=1-a,s=o*o,c=a*a,u=s*o,h=3*a*s,l=3*c*o,f=c*a;return t[0]=e[0]*u+r[0]*h+n[0]*l+i[0]*f,t[1]=e[1]*u+r[1]*h+n[1]*l+i[1]*f,t[2]=e[2]*u+r[2]*h+n[2]*l+i[2]*f,t}function mr(t,e){e=e||1;var r=2*g()*Math.PI,n=2*g()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}function vr(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t}function Mr(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t}function br(t,e,r){var n=r[0],i=r[1],a=r[2],o=r[3],s=e[0],c=e[1],u=e[2],h=i*u-a*c,l=a*s-n*u,f=n*c-i*s,d=i*f-a*l,p=a*h-n*f,g=n*l-i*h,m=2*o;return h*=m,l*=m,f*=m,d*=2,p*=2,g*=2,t[0]=s+h+d,t[1]=c+l+p,t[2]=u+f+g,t}function yr(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t}function xr(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t}function wr(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t}function Sr(t,e){var r=t[0],n=t[1],i=t[2],a=e[0],o=e[1],s=e[2],c=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(a*a+o*o+s*s),u=c&&lr(t,e)/c;return Math.acos(Math.min(Math.max(u,-1),1))}function Pr(t){return t[0]=0,t[1]=0,t[2]=0,t}function _r(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function Ir(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Or(t,e){var r=t[0],n=t[1],i=t[2],a=e[0],o=e[1],s=e[2];return Math.abs(r-a)<=d*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-o)<=d*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=d*Math.max(1,Math.abs(i),Math.abs(s))}var Br,Ar=$e,Cr=We,Rr=Qe,kr=ar,Er=or,Fr=He,qr=sr,Lr=(Br=Ue(),function(t,e,r,n,i,a){var o,s;for(e||(e=3),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,o=r;o0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o,t}function sn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function cn(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],a=r[0]*n[2]-r[2]*n[0],o=r[0]*n[3]-r[3]*n[0],s=r[1]*n[2]-r[2]*n[1],c=r[1]*n[3]-r[3]*n[1],u=r[2]*n[3]-r[3]*n[2],h=e[0],l=e[1],f=e[2],d=e[3];return t[0]=l*u-f*c+d*s,t[1]=-h*u+f*o-d*a,t[2]=h*c-l*o+d*i,t[3]=-h*s+l*a-f*i,t}function un(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}function hn(t,e){var r,n,i,a,o,s;e=e||1;do{o=(r=2*g()-1)*r+(n=2*g()-1)*n}while(o>=1);do{s=(i=2*g()-1)*i+(a=2*g()-1)*a}while(s>=1);var c=Math.sqrt((1-o)/s);return t[0]=e*r,t[1]=e*n,t[2]=e*i*c,t[3]=e*a*c,t}function ln(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}function fn(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],c=r[2],u=r[3],h=u*n+s*a-c*i,l=u*i+c*n-o*a,f=u*a+o*i-s*n,d=-o*n-s*i-c*a;return t[0]=h*u+d*-o+l*-c-f*-s,t[1]=l*u+d*-s+f*-o-h*-c,t[2]=f*u+d*-c+h*-s-l*-o,t[3]=e[3],t}function dn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function pn(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function gn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function mn(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],c=e[2],u=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-c)<=d*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(a-u)<=d*Math.max(1,Math.abs(a),Math.abs(u))}var vn=Yr,Mn=Hr,bn=Nr,yn=Kr,xn=tn,wn=en,Sn=rn,Pn=function(){var t=Tr();return function(e,r,n,i,a,o){var s,c;for(r||(r=4),n||(n=0),c=i?Math.min(i*r+n,e.length):e.length,s=n;sd?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r}function An(t,e){var r=ii(t,e);return Math.acos(2*r*r-1)}function Cn(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],c=r[1],u=r[2],h=r[3];return t[0]=n*h+o*s+i*u-a*c,t[1]=i*h+o*c+a*s-n*u,t[2]=a*h+o*u+n*c-i*s,t[3]=o*h-n*s-i*c-a*u,t}function Rn(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),c=Math.cos(r);return t[0]=n*c+o*s,t[1]=i*c+a*s,t[2]=a*c-i*s,t[3]=o*c-n*s,t}function kn(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),c=Math.cos(r);return t[0]=n*c-a*s,t[1]=i*c+o*s,t[2]=a*c+n*s,t[3]=o*c-i*s,t}function En(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),c=Math.cos(r);return t[0]=n*c+i*s,t[1]=i*c-n*s,t[2]=a*c+o*s,t[3]=o*c-a*s,t}function Fn(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function qn(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=Math.sqrt(r*r+n*n+i*i),s=Math.exp(a),c=o>0?s*Math.sin(o)/o:0;return t[0]=r*c,t[1]=n*c,t[2]=i*c,t[3]=s*Math.cos(o),t}function Ln(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=Math.sqrt(r*r+n*n+i*i),s=o>0?Math.atan2(o,a)/o:0;return t[0]=r*s,t[1]=n*s,t[2]=i*s,t[3]=.5*Math.log(r*r+n*n+i*i+a*a),t}function Tn(t,e,r){return Ln(t,e),ni(t,t,r),qn(t,t),t}function jn(t,e,r,n){var i,a,o,s,c,u=e[0],h=e[1],l=e[2],f=e[3],p=r[0],g=r[1],m=r[2],v=r[3];return(a=u*p+h*g+l*m+f*v)<0&&(a=-a,p=-p,g=-g,m=-m,v=-v),1-a>d?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,c=Math.sin(n*i)/o):(s=1-n,c=n),t[0]=s*u+c*p,t[1]=s*h+c*g,t[2]=s*l+c*m,t[3]=s*f+c*v,t}function Dn(t){var e=g(),r=g(),n=g(),i=Math.sqrt(1-e),a=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*r),t[1]=i*Math.cos(2*Math.PI*r),t[2]=a*Math.sin(2*Math.PI*n),t[3]=a*Math.cos(2*Math.PI*n),t}function zn(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=a*s,t}function Vn(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Un(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*a+o]-e[3*o+a])*r,t[a]=(e[3*a+i]+e[3*i+a])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t}function Yn(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var a=Math.sin(e),o=Math.cos(e),s=Math.sin(r),c=Math.cos(r),u=Math.sin(n),h=Math.cos(n);return t[0]=a*c*h-o*s*u,t[1]=o*s*h+a*c*u,t[2]=o*c*u-a*s*h,t[3]=o*c*h+a*s*u,t}function Hn(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var Nn,Zn,Xn,Gn,$n,Wn,Qn=jr,Jn=Dr,Kn=zr,ti=Vr,ei=Ur,ri=Cn,ni=Qr,ii=sn,ai=un,oi=en,si=oi,ci=rn,ui=ci,hi=on,li=gn,fi=mn,di=(Nn=Ue(),Zn=Ne(1,0,0),Xn=Ne(0,1,0),function(t,e,r){var n=lr(e,r);return n<-.999999?(fr(Nn,Zn,e),Fr(Nn)<1e-6&&fr(Nn,Xn,e),hr(Nn,Nn),On(t,Nn,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(fr(Nn,e,r),t[0]=Nn[0],t[1]=Nn[1],t[2]=Nn[2],t[3]=1+n,hi(t,t))}),pi=(Gn=_n(),$n=_n(),function(t,e,r,n,i,a){return jn(Gn,e,i,a),jn($n,r,n,a),jn(t,Gn,$n,2*a*(1-a)),t}),gi=(Wn=vt(),function(t,e,r,n){return Wn[0]=r[0],Wn[3]=r[1],Wn[6]=r[2],Wn[1]=n[0],Wn[4]=n[1],Wn[7]=n[2],Wn[2]=-e[0],Wn[5]=-e[1],Wn[8]=-e[2],hi(t,Un(t,Wn))});function mi(){var t=new p(8);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function vi(t){var e=new p(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function Mi(t,e,r,n,i,a,o,s){var c=new p(8);return c[0]=t,c[1]=e,c[2]=r,c[3]=n,c[4]=i,c[5]=a,c[6]=o,c[7]=s,c}function bi(t,e,r,n,i,a,o){var s=new p(8);s[0]=t,s[1]=e,s[2]=r,s[3]=n;var c=.5*i,u=.5*a,h=.5*o;return s[4]=c*n+u*r-h*e,s[5]=u*n+h*t-c*r,s[6]=h*n+c*e-u*t,s[7]=-c*t-u*e-h*r,s}function yi(t,e,r){var n=.5*r[0],i=.5*r[1],a=.5*r[2],o=e[0],s=e[1],c=e[2],u=e[3];return t[0]=o,t[1]=s,t[2]=c,t[3]=u,t[4]=n*u+i*c-a*s,t[5]=i*u+a*o-n*c,t[6]=a*u+n*s-i*o,t[7]=-n*o-i*s-a*c,t}function xi(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function wi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Si(t,e){var r=_n();we(r,e);var n=new p(3);return ye(n,e),yi(t,r,n),t}function Pi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function _i(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Ii(t,e,r,n,i,a,o,s,c){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t}var Oi=Kn;function Bi(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var Ai=Kn;function Ci(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function Ri(t,e){var r=e[4],n=e[5],i=e[6],a=e[7],o=-e[0],s=-e[1],c=-e[2],u=e[3];return t[0]=2*(r*u+a*o+n*c-i*s),t[1]=2*(n*u+a*s+i*o-r*c),t[2]=2*(i*u+a*c+r*s-n*o),t}function ki(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=.5*r[0],c=.5*r[1],u=.5*r[2],h=e[4],l=e[5],f=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=o*s+i*u-a*c+h,t[5]=o*c+a*s-n*u+l,t[6]=o*u+n*c-i*s+f,t[7]=-n*s-i*c-a*u+d,t}function Ei(t,e,r){var n=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],c=e[5],u=e[6],h=e[7],l=s*o+h*n+c*a-u*i,f=c*o+h*i+u*n-s*a,d=u*o+h*a+s*i-c*n,p=h*o-s*n-c*i-u*a;return Rn(t,e,r),n=t[0],i=t[1],a=t[2],o=t[3],t[4]=l*o+p*n+f*a-d*i,t[5]=f*o+p*i+d*n-l*a,t[6]=d*o+p*a+l*i-f*n,t[7]=p*o-l*n-f*i-d*a,t}function Fi(t,e,r){var n=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],c=e[5],u=e[6],h=e[7],l=s*o+h*n+c*a-u*i,f=c*o+h*i+u*n-s*a,d=u*o+h*a+s*i-c*n,p=h*o-s*n-c*i-u*a;return kn(t,e,r),n=t[0],i=t[1],a=t[2],o=t[3],t[4]=l*o+p*n+f*a-d*i,t[5]=f*o+p*i+d*n-l*a,t[6]=d*o+p*a+l*i-f*n,t[7]=p*o-l*n-f*i-d*a,t}function qi(t,e,r){var n=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],c=e[5],u=e[6],h=e[7],l=s*o+h*n+c*a-u*i,f=c*o+h*i+u*n-s*a,d=u*o+h*a+s*i-c*n,p=h*o-s*n-c*i-u*a;return En(t,e,r),n=t[0],i=t[1],a=t[2],o=t[3],t[4]=l*o+p*n+f*a-d*i,t[5]=f*o+p*i+d*n-l*a,t[6]=d*o+p*a+l*i-f*n,t[7]=p*o-l*n-f*i-d*a,t}function Li(t,e,r){var n=r[0],i=r[1],a=r[2],o=r[3],s=e[0],c=e[1],u=e[2],h=e[3];return t[0]=s*o+h*n+c*a-u*i,t[1]=c*o+h*i+u*n-s*a,t[2]=u*o+h*a+s*i-c*n,t[3]=h*o-s*n-c*i-u*a,s=e[4],c=e[5],u=e[6],h=e[7],t[4]=s*o+h*n+c*a-u*i,t[5]=c*o+h*i+u*n-s*a,t[6]=u*o+h*a+s*i-c*n,t[7]=h*o-s*n-c*i-u*a,t}function Ti(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],c=r[1],u=r[2],h=r[3];return t[0]=n*h+o*s+i*u-a*c,t[1]=i*h+o*c+a*s-n*u,t[2]=a*h+o*u+n*c-i*s,t[3]=o*h-n*s-i*c-a*u,s=r[4],c=r[5],u=r[6],h=r[7],t[4]=n*h+o*s+i*u-a*c,t[5]=i*h+o*c+a*s-n*u,t[6]=a*h+o*u+n*c-i*s,t[7]=o*h-n*s-i*c-a*u,t}function ji(t,e,r,n){if(Math.abs(n)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,a=e[2]/r,o=e[3]/r,s=e[4],c=e[5],u=e[6],h=e[7],l=n*s+i*c+a*u+o*h;t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=(s-n*l)/r,t[5]=(c-i*l)/r,t[6]=(u-a*l)/r,t[7]=(h-o*l)/r}return t}function Ji(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function Ki(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function ta(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],u=t[7],h=e[0],l=e[1],f=e[2],p=e[3],g=e[4],m=e[5],v=e[6],M=e[7];return Math.abs(r-h)<=d*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(n-l)<=d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-f)<=d*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(a-p)<=d*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(o-g)<=d*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(s-m)<=d*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(c-v)<=d*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(u-M)<=d*Math.max(1,Math.abs(u),Math.abs(M))}function ea(){var t=new p(2);return p!=Float32Array&&(t[0]=0,t[1]=0),t}function ra(t){var e=new p(2);return e[0]=t[0],e[1]=t[1],e}function na(t,e){var r=new p(2);return r[0]=t,r[1]=e,r}function ia(t,e){return t[0]=e[0],t[1]=e[1],t}function aa(t,e,r){return t[0]=e,t[1]=r,t}function oa(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function sa(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function ca(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function ua(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function ha(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function la(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function fa(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function da(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function pa(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function ga(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function ma(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function va(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function Ma(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function ba(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function ya(t){var e=t[0],r=t[1];return e*e+r*r}function xa(t,e){return t[0]=-e[0],t[1]=-e[1],t}function wa(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function Sa(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function Pa(t,e){return t[0]*e[0]+t[1]*e[1]}function _a(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function Ia(t,e,r,n){var i=e[0],a=e[1];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t}function Oa(t,e){e=e||1;var r=2*g()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function Ba(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function Aa(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function Ca(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function Ra(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function ka(t,e,r,n){var i=e[0]-r[0],a=e[1]-r[1],o=Math.sin(n),s=Math.cos(n);return t[0]=i*s-a*o+r[0],t[1]=i*o+a*s+r[1],t}function Ea(t,e){var r=t[0],n=t[1],i=e[0],a=e[1],o=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+a*a),s=o&&(r*i+n*a)/o;return Math.acos(Math.min(Math.max(s,-1),1))}function Fa(t){return t[0]=0,t[1]=0,t}function qa(t){return"vec2("+t[0]+", "+t[1]+")"}function La(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ta(t,e){var r=t[0],n=t[1],i=e[0],a=e[1];return Math.abs(r-i)<=d*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))}var ja=ba,Da=sa,za=ca,Va=ua,Ua=va,Ya=Ma,Ha=ya,Na=function(){var t=ea();return function(e,r,n,i,a,o){var s,c;for(r||(r=2),n||(n=0),c=i?Math.min(i*r+n,e.length):e.length,s=n;s{var n;!function(){"use strict";var i=.5*(Math.sqrt(3)-1),a=(3-Math.sqrt(3))/6,o=1/6,s=(Math.sqrt(5)-1)/4,c=(5-Math.sqrt(5))/20;function u(t){var e;e="function"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=l();t=i(" "),e=i(" "),r=i(" ");for(var a=0;a>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}u.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,o=this.permMod12,s=this.perm,c=this.grad3,u=0,h=0,l=0,f=(t+e)*i,d=Math.floor(t+f),p=Math.floor(e+f),g=(d+p)*a,m=t-(d-g),v=e-(p-g);m>v?(r=1,n=0):(r=0,n=1);var M=m-r+a,b=v-n+a,y=m-1+2*a,x=v-1+2*a,w=255&d,S=255&p,P=.5-m*m-v*v;if(P>=0){var _=3*o[w+s[S]];u=(P*=P)*P*(c[_]*m+c[_+1]*v)}var I=.5-M*M-b*b;if(I>=0){var O=3*o[w+r+s[S+n]];h=(I*=I)*I*(c[O]*M+c[O+1]*b)}var B=.5-y*y-x*x;if(B>=0){var A=3*o[w+1+s[S+1]];l=(B*=B)*B*(c[A]*y+c[A+1]*x)}return 70*(u+h+l)},noise3D:function(t,e,r){var n,i,a,s,c,u,h,l,f,d,p=this.permMod12,g=this.perm,m=this.grad3,v=.3333333333333333*(t+e+r),M=Math.floor(t+v),b=Math.floor(e+v),y=Math.floor(r+v),x=(M+b+y)*o,w=t-(M-x),S=e-(b-x),P=r-(y-x);w>=S?S>=P?(c=1,u=0,h=0,l=1,f=1,d=0):w>=P?(c=1,u=0,h=0,l=1,f=0,d=1):(c=0,u=0,h=1,l=1,f=0,d=1):Sk?q++:L++,R>E?q++:T++,R>F?q++:j++,k>E?L++:T++,k>F?L++:j++,E>F?T++:j++;var D=R-(l=q>=3?1:0)+c,z=k-(f=L>=3?1:0)+c,V=E-(d=T>=3?1:0)+c,U=F-(p=j>=3?1:0)+c,Y=R-(g=q>=2?1:0)+2*c,H=k-(m=L>=2?1:0)+2*c,N=E-(v=T>=2?1:0)+2*c,Z=F-(M=j>=2?1:0)+2*c,X=R-(b=q>=1?1:0)+3*c,G=k-(y=L>=1?1:0)+3*c,$=E-(x=T>=1?1:0)+3*c,W=F-(w=j>=1?1:0)+3*c,Q=R-1+4*c,J=k-1+4*c,K=E-1+4*c,tt=F-1+4*c,et=255&I,rt=255&O,nt=255&B,it=255&A,at=.6-R*R-k*k-E*E-F*F;if(at<0)i=0;else{var ot=S[et+S[rt+S[nt+S[it]]]]%32*4;i=(at*=at)*at*(P[ot]*R+P[ot+1]*k+P[ot+2]*E+P[ot+3]*F)}var st=.6-D*D-z*z-V*V-U*U;if(st<0)a=0;else{var ct=S[et+l+S[rt+f+S[nt+d+S[it+p]]]]%32*4;a=(st*=st)*st*(P[ct]*D+P[ct+1]*z+P[ct+2]*V+P[ct+3]*U)}var ut=.6-Y*Y-H*H-N*N-Z*Z;if(ut<0)o=0;else{var ht=S[et+g+S[rt+m+S[nt+v+S[it+M]]]]%32*4;o=(ut*=ut)*ut*(P[ht]*Y+P[ht+1]*H+P[ht+2]*N+P[ht+3]*Z)}var lt=.6-X*X-G*G-$*$-W*W;if(lt<0)u=0;else{var ft=S[et+b+S[rt+y+S[nt+x+S[it+w]]]]%32*4;u=(lt*=lt)*lt*(P[ft]*X+P[ft+1]*G+P[ft+2]*$+P[ft+3]*W)}var dt=.6-Q*Q-J*J-K*K-tt*tt;if(dt<0)h=0;else{var pt=S[et+1+S[rt+1+S[nt+1+S[it+1]]]]%32*4;h=(dt*=dt)*dt*(P[pt]*Q+P[pt+1]*J+P[pt+2]*K+P[pt+3]*tt)}return 27*(i+a+o+u+h)}},u._buildPermutationTable=h,void 0===(n=function(){return u}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=u,t.exports=u}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n].call(a.exports,a,a.exports,r),a.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";var t=n;Object.defineProperty(t,"__esModule",{value:!0}),t.Urpflanze=void 0;const e=r(9367);t.Urpflanze=e,t.default=e})(),n})()})); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Urpflanze=e():t.Urpflanze=e()}(window,(function(){return(()=>{var t={1346:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.log=e.PI2=e.PHI=e.Vec2=e.distributePointsInBuffer=e.prepareBufferForInterpolation=e.interpolate=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.now=e.toRadians=e.toDegrees=e.relativeClamp=e.clamp=e.lerp=void 0,i(r(1378),e),i(r(541),e),i(r(2513),e),i(r(2648),e),i(r(3674),e),i(r(6951),e),i(r(7439),e),i(r(6448),e),i(r(8563),e),i(r(5382),e),i(r(6329),e),i(r(4233),e),i(r(5510),e),i(r(2982),e),i(r(7520),e),i(r(9667),e),i(r(894),e),i(r(5719),e),i(r(1451),e),i(r(3977),e),i(r(9958),e),i(r(9514),e);var a=r(313);Object.defineProperty(e,"lerp",{enumerable:!0,get:function(){return a.lerp}}),Object.defineProperty(e,"clamp",{enumerable:!0,get:function(){return a.clamp}}),Object.defineProperty(e,"relativeClamp",{enumerable:!0,get:function(){return a.relativeClamp}}),Object.defineProperty(e,"toDegrees",{enumerable:!0,get:function(){return a.toDegrees}}),Object.defineProperty(e,"toRadians",{enumerable:!0,get:function(){return a.toRadians}}),Object.defineProperty(e,"now",{enumerable:!0,get:function(){return a.now}}),Object.defineProperty(e,"noise",{enumerable:!0,get:function(){return a.noise}}),Object.defineProperty(e,"random",{enumerable:!0,get:function(){return a.random}}),Object.defineProperty(e,"angleFromRepetition",{enumerable:!0,get:function(){return a.angleFromRepetition}}),Object.defineProperty(e,"angle2FromRepetition",{enumerable:!0,get:function(){return a.angle2FromRepetition}}),Object.defineProperty(e,"distanceFromRepetition",{enumerable:!0,get:function(){return a.distanceFromRepetition}}),Object.defineProperty(e,"interpolate",{enumerable:!0,get:function(){return a.interpolate}}),Object.defineProperty(e,"prepareBufferForInterpolation",{enumerable:!0,get:function(){return a.prepareBufferForInterpolation}}),Object.defineProperty(e,"distributePointsInBuffer",{enumerable:!0,get:function(){return a.distributePointsInBuffer}});var o=r(795);Object.defineProperty(e,"Vec2",{enumerable:!0,get:function(){return o.default}});var s=r(3792);Object.defineProperty(e,"PHI",{enumerable:!0,get:function(){return s.PHI}}),Object.defineProperty(e,"PI2",{enumerable:!0,get:function(){return s.PI2}}),Object.defineProperty(e,"log",{enumerable:!0,get:function(){return s.log}}),Object.defineProperty(e,"mod",{enumerable:!0,get:function(){return s.mod}})},5174:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(9367),e)},9367:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.DrawerCanvas=e.Animation=void 0,i(r(1346),e),e.Animation=r(7518);var a=r(2251);Object.defineProperty(e,"DrawerCanvas",{enumerable:!0,get:function(){return a.BrowserDrawerCanvas}})},2894:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UncontrolledLoop=e.Static=e.Loop=e.Compose=e.Simple=e.resolveSimpleAnimation=void 0;const n=r(4825),i=r(2765);function a(t){const e=i.createAnimation(t);if(e)return t=>{var r;const n="number"==typeof t?t:(null===(r=t.shape.scene)||void 0===r?void 0:r.currentTime)||0;return e.update(n),e.value}}e.resolveSimpleAnimation=a,e.Simple=a,e.Compose=t=>{const e=n.composeAnimations(t);if(e)return t=>{var r;const n="number"==typeof t?t:(null===(r=t.shape.scene)||void 0===r?void 0:r.currentTime)||0;return e(n)}},e.Loop=t=>{const e=t;return void 0===e.interpolator&&(e.interpolator="wave"),e.interpolator&&("string"==typeof e.interpolator?"wave"!==e.interpolator&&(e.direction="alternate"):"object"==typeof e.interpolator&&"wave"!==e.interpolator.type&&(e.direction="alternate")),e.loop=!0,a(e)},e.Static=t=>{const e=t;return e.direction="normal",e.loop=!1,a(e)},e.UncontrolledLoop=t=>{const e=t;return e.direction="normal",e.loop=!0,a(e)}},9727:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=void 0;const r={linear:(t,e,r,n=1)=>r*t/n+e,quadraticIn:(t,e,r,n=1)=>r*(t/=n)*t+e,quadraticOut:(t,e,r,n=1)=>-r*(t/=n)*(t-2)+e,quadraticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t+e:-r/2*(--t*(t-2)-1)+e,cubicIn:(t,e,r,n=1)=>r*(t/=n)*t*t+e,cubicOut:(t,e,r,n=1)=>(t/=n,r*(--t*t*t+1)+e),cubicInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t+e:r/2*((t-=2)*t*t+2)+e,quarticIn:(t,e,r,n=1)=>r*(t/=n)*t*t*t+e,quarticOut:(t,e,r,n=1)=>(t/=n,-r*(--t*t*t*t-1)+e),quarticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t*t+e:-r/2*((t-=2)*t*t*t-2)+e,quinticIn:(t,e,r,n=1)=>r*(t/=n)*t*t*t*t+e,quinticOut:(t,e,r,n=1)=>(t/=n,r*(--t*t*t*t*t+1)+e),quinticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t*t*t+e:r/2*((t-=2)*t*t*t*t+2)+e,sinusoidalIn:(t,e,r,n=1)=>-r*Math.cos(t/n*(Math.PI/2))+r+e,sinusoidalOut:(t,e,r,n=1)=>r*Math.sin(t/n*(Math.PI/2))+e,sinusoidalInOut:(t,e,r,n=1)=>-r/2*(Math.cos(Math.PI*t/n)-1)+e,exponentialIn:(t,e,r,n=1)=>r*Math.pow(2,10*(t/n-1))+e,exponentialOut:(t,e,r,n=1)=>r*(1-Math.pow(2,-10*t/n))+e,exponentialInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*Math.pow(2,10*(t-1))+e:(t--,r/2*(2-Math.pow(2,-10*t))+e),circularIn:(t,e,r,n=1)=>(t/=n,-r*(Math.sqrt(1-t*t)-1)+e),circularOut:(t,e,r,n=1)=>(t/=n,t--,r*Math.sqrt(1-t*t)+e),circularInOut:(t,e,r,n=1)=>(t/=n/2)<1?-r/2*(Math.sqrt(1-t*t)-1)+e:(t-=2,r/2*(Math.sqrt(1-t*t)+1)+e),elasticIn:(t,e,r,n=1,i=1,a=.5)=>{if(0===t)return e;if(1==(t/=n))return e+r;a*=n;let o=0;return i{if(0===t)return e;if(1==(t/=n))return e+r;a*=n;let o=0;return i{if(0===t)return e;if(2==(t/=n/2))return e+r;a*=n;let o=0;return ir*(t/=n)*t*((i+1)*t-i)+e,backOut:(t,e,r,n=1,i=1.70158)=>r*((t=t/n-1)*t*((i+1)*t+i)+1)+e,backInOut:(t,e,r,n=1,i=1.70158)=>(t/=n/2)<1?r/2*(t*t*((1+(i*=1.525))*t-i))+e:r/2*((t-=2)*t*((1+(i*=1.525))*t+i)+2)+e,bounceIn:(t,e,n,i=1)=>n-r.bounceOut(i-t,0,n,i)+e,bounceOut:(t,e,r,n=1)=>(t/=n)<1/2.75?r*(7.5625*t*t)+e:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+e:r*(7.5625*(t-=2.625/2.75)*t+.984375)+e,bounceInOut:(t,e,n,i=1)=>t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.composeAnimations=void 0;const n=r(7358),i=r(2765),a=r(8782);function o(t,e,r=.5){const i=Array.isArray(t)?t:[t],o=Array.isArray(e)?e:[e],s=[];for(let t=0,e=i.length;tvoid 0!==t)),r=e.length;if(r>0)return t=>{let n;for(let i=0;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createAnimation=void 0;const n=r(9298);e.createAnimation=function(t){const e=n.createInterpolationCallback(t);if(void 0===e)return;const r=t.delay||0,i=t.afterDelay||0,a=t.direction||"normal",o=t.duration||1e3,s="normal"===a||"reverse"===a?o+r:2*o+r+i,c={delay:r,afterDelay:i,direction:a,duration:o,totalDuration:s,loop:"number"==typeof t.loop?t.loop:!!t.loop},u=n.createInterpolator(t.interpolator),h={loop:0,offset:0,loopDuration:s,direction:"alternate"===a?"normal":a,started:!1,ended:!1,value:void 0};return h.update=function(t,e,r,n){const{loop:i,totalDuration:a,delay:o,afterDelay:s,direction:c,duration:u}=e;return h=>{if("number"==typeof i&&h>=a*i||!1===i&&h>=e.totalDuration)return t.started=!1,t.ended=!0,t.offset=r("normal"===c?u:0,u),void(t.value=n(t.offset));if(t.loop=Math.ceil(h/a),h%=a,(h-=o)<=0)return t.started=!1,t.offset=r(0,u),void(t.value=n(t.offset));if(t.started=!0,"alternate"===c)h<=u?(t.direction="normal",t.offset=r(h,u)):(t.direction="reverse",h-=u,(h-=s)>=0?t.offset=1-r(h>=u?u:h,u):t.offset=1);else{const e=r(h>=u?u:h,u);t.offset="normal"===c?e:1-e}t.value=n(t.offset)}}(h,c,u,e),h}},9298:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createInterpolator=e.createInterpolationCallback=void 0;const n=r(7358),i=r(3431),a=r(9727),o=r(8782);e.createInterpolationCallback=function(t){const e=Array.isArray(t.from)?t.from:[t.from],r=Array.isArray(t.to)?t.to:[t.to],i=t.round,a="hue"===t.colorTransitionMode?o.interpolateColorHSL:o.interpolateColorRGB;if(e.length!==r.length)return;const s=[];for(let t=0,o=e.length;t1===t?a:0===t?n:Math.round((n+t*(a-n))*i)/i:t=>1===t?a:0===t?n:n+t*(a-n))}else{const i=e[t],o=r[t],c=n.parseColorAndConvert(i),u=n.parseColorAndConvert(o);void 0!==c&&void 0!==u&&s.push((t=>1===t?o:0===t?i:a(c,u,t)))}}return t=>{const e=s.map((e=>e(t)));return 1===e.length?e[0]:e}},e.createInterpolator=function(t){var e,r;switch(typeof t){case"function":return(e,r)=>t(e/r,e);case"string":switch(t){case"wave":return(t,e)=>.5+.5*Math.sin(t*Math.PI*2/e+1.5*Math.PI);default:if(t in a.Easings){const e=a.Easings[t];return(t,r)=>e(t,0,1,r)}return(t,e)=>a.Easings.linear(t,0,1,e)}case"object":switch(t.type){case"wave":{const r=1.5*Math.PI+((null===(e=t.params)||void 0===e?void 0:e.phase)||0);return(t,e)=>.5+.5*Math.sin(t*Math.PI*2/e+r)}case"elasticIn":case"elasticOut":case"elasticInOut":{const e=a.Easings[t.type],{amplitude:r,period:n}=t.params||{};return(t,i)=>e(t,0,1,i,r,n)}case"backIn":case"backOut":case"backInOut":{const e=a.Easings[t.type],n=(null===(r=t.params)||void 0===r?void 0:r.overshoot)||void 0;return(t,r)=>e(t,0,1,r,n)}case"cubicBezier":{const e=i.default(t.params[0],t.params[1],t.params[2],t.params[3]);return(t,r)=>e(t/r)}}}return(t,e)=>a.Easings.linear(t,0,1,e)}},7518:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(5240),e),i(r(8782),e),i(r(2765),e),i(r(9298),e),i(r(9727),e),i(r(2894),e)},5240:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},8782:(t,e)=>{"use strict";function r(t,e,r=!0,n="alternate",i=0,a=0){const o="normal"===n||"reverse"===n?e+i:2*e+i+a;return"number"==typeof r&&t>=o*r||!1===r&&t>=o?"normal"===n?e:0:(t%=o,(t-=i)<=0?0:"alternate"===n?t<=e?t:(t-=e,(t-=a)>=0?e-(t>=e?e:t):e):t>=e?e:t)}Object.defineProperty(e,"__esModule",{value:!0}),e.interpolateColorHSL=e.interpolateColorRGB=e.cosp=e.sinp=e.clockOffset=e.clock=void 0,e.clock=r,e.clockOffset=function(t,e,n=!0,i="alternate",a=0,o=0){return r(t,e,n,i,a,o)/e};const n=2*Math.PI;e.sinp=function(t,e,r=0,i=!1){const a=Math.sin(t*n/e+r);return i?.5+.5*a:a},e.cosp=function(t,e,r=0,i=!1){const a=Math.cos(t*n/e+r);return i?.5+.5*a:a},e.interpolateColorRGB=function(t,e,r){const n=t.r+r*(e.r-t.r),i=t.g+r*(e.g-t.g),a=t.b+r*(e.b-t.b),o=t.alpha+r*(e.alpha-t.alpha);return`rgba(${Math.floor(n)},${Math.floor(i)},${Math.floor(a)},${o})`},e.interpolateColorHSL=function(t,e,r){return`hsla(${t.h+r*(e.h-t.h)},${t.s+r*(e.s-t.s)}%,${t.l+r*(e.l-t.l)}%,${t.alpha+r*(e.alpha-t.alpha)})`}},814:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rgbToHsl=e.hslToRgb=e.rgbToHex=void 0,e.rgbToHex=function(t,e,r){return`#${((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}`},e.hslToRgb=function(t,e,r){let n,i,a;if(t/=360,r/=100,0==(e/=100))n=i=a=r;else{const o=(t,e,r)=>(r+=r<0?1:r>1?-1:0)<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,s=r<.5?r*(1+e):r+e-r*e,c=2*r-s;n=o(c,s,t+1/3),i=o(c,s,t),a=o(c,s,t-1/3)}return[.5+255*n<<0,.5+255*i<<0,.5+255*a<<0]},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;const n=Math.max(t,e,r),i=Math.min(t,e,r),a=(n+i)/2;let o,s;if(n===i)o=s=0;else{const c=n-i;switch(s=a>.5?c/(2-n-i):c/(n+i),n){case t:o=(e-r)/c+(e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={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",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",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",rebeccapurple:"#663399",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",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},7358:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(6097),e),i(r(814),e),i(r(5576),e)},5576:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.parseColorAndConvert=void 0;const n=r(4947),i=r(814);function a(t){if("number"==typeof t)return t>16777215?{type:"rgb",a:t>>24&255,b:t>>16&255,c:t>>8&255,alpha:(255&t)/255}:{type:"rgb",a:t>>16&255,b:t>>8&255,c:255&t,alpha:1};t=t.replace(/\s/g,""),n.default[t]&&(t=n.default[t]);let e=/^#([0-9a-f]{3,8})$/i.exec(t);if(e){const t=e[1];return 3===t.length?{type:"rgb",a:parseInt(t[0]+t[0],16),b:parseInt(t[1]+t[1],16),c:parseInt(t[2]+t[2],16),alpha:1}:{type:"rgb",a:parseInt(t[0]+t[1],16),b:parseInt(t[2]+t[3],16),c:parseInt(t[4]+t[5],16),alpha:t.length>6?parseInt(t.substring(6),16)/255:1}}if(e=/^((hsl|rgb)a?)\((\d+),(\d+)%?,(\d+)%?,?(.+)?\)$/i.exec(t),e){const[,,t,r,n,i,a]=e;return{type:t,a:+r,b:+n,c:+i,alpha:a?+a:1}}}e.parseColorAndConvert=function(t){const e=a(t);if(e){if("hsl"===e.type){const[t,r,n]=i.hslToRgb(e.a,e.b,e.c);return{r:t,g:r,b:n,h:e.a,s:e.b,l:e.c,alpha:e.alpha}}{const[t,r,n]=i.rgbToHsl(e.a,e.b,e.c);return{h:t,s:r,l:n,r:e.a,g:e.b,b:e.c,alpha:e.alpha}}}},e.parseColor=a},6097:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},2513:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Group=void 0;const n=r(1378),i=r(541),a=r(2648),o=r(5511);class s extends i.SceneChild{constructor(t={}){t.type="Group",super(t),this.children=[],["id","name","data","order","type"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=o.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){"object"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=s},1378:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Scene=void 0;const n=r(541),i=r(2513),a=r(6448),o=r(313);class s{constructor(t={}){this.width=400,this.height=400,this.background="hsla(0, 0%, 0%, 1)",this.color="hsla(0, 0%, 100%, 1)",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?(.5+.5*o.clamp(-1,1,t.anchor[0]))*this.width:"left"===t.anchor[0]?0:"right"===t.anchor[0]?this.width:this.center[0],"number"==typeof t.anchor[1]?(.5+.5*o.clamp(-1,1,t.anchor[1]))*this.height:"top"===t.anchor[1]?0:"bottom"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e="number"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,s.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{s.propagateToChilden(t,e)})):t instanceof a.Shape&&t.shape&&(t.shape.scene=e,s.propagateToChilden(t.shape,e))}}e.Scene=s},541:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||"SceneChild",this.name=t.name||this.type+"_"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){"string"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},313:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(21),i=r(2769),a=r(795),o="undefined"!=typeof performance?performance:Date;function s(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return o.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=s,e.relativeClamp=function(t,e,r,n,i){return s(n,i,(r-t)/(e-t)*(i-n)+n)};const c={random:new n(Math.random)};e.noise=function(t="random",e=0,r=0,i=0){return void 0===c[t]&&(c[t]=new n(t)),c[t].noise3D(e,r,i)};const u={};function h(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),a=rn?[a,o]:[o,a]}function l(t,e){const r=t.length,n=r/2,i=2*(n+e),a=n-1;if(a>1){const n=r-2,o=Math.floor(e/a);let s=(i-(r+o*n))/2;const c=Math.round(a/s),u=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%c==0||e===n-2),p=o+(d?1:0),g=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);u[i]=(a=t(),o=t(),s=t(),c=t(),function(){let t=(a>>>=0)+(o>>>=0)|0;return a=o^o>>>9,o=(s>>>=0)+(s<<3)|0,t=t+(c=1+(c>>>=0)|0)|0,s=(s=s<<21|s>>>11)+t|0,(t>>>0)/4294967296})}var a,o,s,c;const h=e+u[i]()*(r-e);return void 0!==n?Math.round(h*10**n)/10**n:h},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return a.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=h,e.interpolate=function(t,e,r=.5){const[n,i]=h(t,e),a=Math.max(n.length,i.length),o="number"==typeof r?[r]:r,s=a/2;if(o.length!==s){const t=o.length;for(let e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return"number"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},8721:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(887);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},3792:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},5511:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(9958);var i;!function(t){t[t.None=0]="None",t[t.Scale=2]="Scale",t[t.Center=4]="Center",t[t.Fill=8]="Fill"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn("[Urplfanze:Bounding] cannot sum bounding")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn("[Urplfanze:Bounding] cannot bind bounding")}};class a extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return a.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=a.getBounding(t));const o=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,s=e>=i.Center?r.cx:0,c=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Close=void 0;const n=r(9958);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},1740:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Mirror=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let a=0;a{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},3315:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Offset=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i},4660:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Smooth=void 0;const n=r(313),i=r(8301),a=r(9958);class o extends a.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Solidify=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const a=[],o=(e="number"==typeof e?[e]:e).length;let s,c,u=[[0,0],[0,0]],h=[[0,0],[0,0]];for(let r=0,l=0,f=t.length-2;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Subdivide=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Modifiers=void 0;const n=r(5511),i=r(1740),a=r(4660),o=r(5838),s=r(5588),c=r(8301),u=r(3315),h={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:a.Smooth,Solidify:o.Solidify,Subdivide:s.Subdivide,Close:c.Close,Offset:u.Offset};e.Modifiers=h},6448:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=void 0;const n=r(1378),i=r(541),a=r(2648);class o extends a.ShapeBase{constructor(t){t.type=t.type||"Shape",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn("[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\nYou passed:",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):o.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBase=void 0;const n=r(887),i=r(3757),a=r(8721),o=r(795),s=r(3792),c=r(5511),u=r(313),h=r(541),l=n.mat4.create(),f=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class g extends h.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?-1*u.clamp(-1,1,t.anchor[0]):"left"===t.anchor[0]?1:"right"===t.anchor[0]?-1:0,"number"==typeof t.anchor[1]?-1*u.clamp(-1,1,t.anchor[1]):"top"===t.anchor[1]?1:"bottom"===t.anchor[1]?-1:0]:[0,0],this.boundingType="string"==typeof t.boundingType?"relative"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return"function"!=typeof t.repetitions&&"function"!=typeof t.distance&&"function"!=typeof t.displace&&"function"!=typeof t.scale&&"function"!=typeof t.translate&&"function"!=typeof t.skewX&&"function"!=typeof t.skewY&&"function"!=typeof t.squeezeX&&"function"!=typeof t.squeezeY&&"function"!=typeof t.rotateX&&"function"!=typeof t.rotateY&&"function"!=typeof t.rotateZ&&"function"!=typeof t.transformOrigin&&"function"!=typeof t.perspective&&"function"!=typeof t.perspectiveOrigin}isStaticIndexed(){return"function"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return"function"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){"string"==typeof t?(r=r||"repetitions"==t,this.props[t]=e):(r=r||"repetitions"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var h,m;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const v=g.getEmptyPropArguments(this,r),M=v.repetition,b=this.getProp("repetitions",v,1),y=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,x=Array.isArray(b)?b[0]*(null!==(h=b[1])&&void 0!==h?h:b[0]):b,w=Array.isArray(b)?b[0]:x,S=Array.isArray(b)?null!==(m=b[1])&&void 0!==m?m:b[0]:1,P=M.row;P.count=w;const _=M.col;_.count=S,M.count=x,M.col.count=S,M.row.count=w,M.type=y;let I=0;const O=[];let B=0;const A=n.vec2.fromValues((S-1)/2,(w-1)/2),C=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],R=[void 0,void 0,void 0,void 0],k=[void 0,void 0,void 0,void 0];for(let r=0;r1?B/(x-1):1,M.angle=y===i.ERepetitionType.Ring?s.PI2/x*B:0,_.index=h+1,_.offset=S>1?h/(S-1):1,P.index=r+1,P.offset=w>1?r/(w-1):1;const g=this.generateBuffer(t,v),m=g.length,b=this.getShapeBounding();O[B]=new Float32Array(m),I+=m;{const t=a.toVec2(this.getProp("distance",v,a.VEC2_ZERO)),s=this.getProp("displace",v,0),x=a.toVec3(this.getProp("scale",v,a.VEC2_ONE),1),w=a.toVec3(this.getProp("translate",v,a.VEC2_ZERO),0),S=this.getProp("skewX",v,0),P=this.getProp("skewY",v,0),_=this.getProp("squeezeX",v,0),I=this.getProp("squeezeY",v,0),E=this.getProp("rotateX",v,0),F=this.getProp("rotateY",v,0),q=this.getProp("rotateZ",v,0),L=u.clamp(0,1,this.getProp("perspective",v,0)),T=a.toVec3(this.getProp("perspectiveOrigin",v,a.VEC2_ZERO),0),j=a.toVec3(this.getProp("transformOrigin",v,a.VEC2_ZERO),0);let D;switch(y){case i.ERepetitionType.Ring:D=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(D,D,a.VEC3_ZERO,M.angle+s);break;case i.ERepetitionType.Matrix:D=n.vec3.fromValues(t[1]*(h-A[0]),t[0]*(r-A[1]),0)}const z=L>0?Math.max(b.width,b.height)/2:1,V=L>0?z+10*z*(1-L):0,U=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==L||0!==j[0]||0!==j[1],Y=0!==T[0]||0!==T[1];U&&(this.boundingType===i.EBoundingType.Relative?(j[0]=j[0]*(b.width/2)+b.cx,j[1]=j[1]*(b.height/2)+b.cy):(j[0]*=b.width/2,j[1]*=b.height/2),j[2]=V);{n.mat4.identity(f),U&&n.mat4.translate(f,f,j),0===w[0]&&0===w[1]||n.mat4.translate(f,f,w),0===S&&0===P||(a.fromSkew(l,[S,P]),n.mat4.multiply(f,f,l)),0!==E&&n.mat4.rotateX(f,f,E),0!==F&&n.mat4.rotateY(f,f,F),0!==q&&n.mat4.rotateZ(f,f,q),1===x[0]&&1===x[1]||n.mat4.scale(f,f,x),U&&n.mat4.translate(f,f,n.vec3.scale(j,j,-1)),V>0&&(Y&&(this.boundingType===i.EBoundingType.Relative?(T[0]=T[0]*(b.width/2)+b.cx,T[1]=T[1]*(b.height/2)+b.cy):(T[0]*=b.width/2,T[1]*=b.height/2),T[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,D),e&&n.mat4.translate(p,p,C);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),y===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,M.angle+s)}c.Bounding.clear(k);for(let t=0;t0&&(Y&&n.vec3.add(e,e,T),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,V),Y&&n.vec3.sub(e,e,T)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=m/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,v)}O[B][t]=e[0],O[B][t+1]=e[1],c.Bounding.add(k,e[0],e[1]),c.Bounding.add(R,e[0],e[1])}}const E={cx:0,cy:0,x:-1,y:-1,width:2,height:2};c.Bounding.bind(E,k),this.bStaticIndexed&&this.bIndexed||this.addIndex(m,M,E)}c.Bounding.bind(this.bounding,R),this.buffer=new Float32Array(I);for(let t=0,e=0,r=O.length;t({index:1,offset:1,count:1}),g.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...g.getEmptySimpleRepetition(),row:g.getEmptySimpleRepetition(),col:g.getEmptySimpleRepetition()})},7439:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBuffer=void 0;const n=r(5511),i=r(3674);class a extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||"ShapeBuffer",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn("[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property"),this.shape=a.EMPTY_BUFFER):this.shape="function"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return"function"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from("function"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,a=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&"function"!=typeof this.props.sideLength&&"function"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=a},5382:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeFollow=void 0;const n=r(6448);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeFollow",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},a=this.shape;a.generate(t,!1,i);let o=a.getBuffer();const s=o.length,c=new Float32Array(s*(n.length/2)),u=n.length/2;for(let e=0;e1?e/(u-1):1,count:u};this.shapeUseFollow&&(i.follow=r,a.generate(t,!1,i),o=a.getBuffer());const h=e*s,l=2*e,f=n[l],d=n[l+1];for(let t=0,e=o.length;t1?t/(e-1):1;for(let o=0,s=a.length;o{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeLoop=void 0;const n=r(3792),i=r(5511),a=r(3674),o=r(2648);class s extends a.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||"ShapeLoop",super(t),this.loopDependencies=(t.loopDependencies||[]).concat("sideLength"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes("propArguments"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}"loop"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||o.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?("function"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),a=this.getRepetitionSideLength(t),o=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,s={index:0,offset:0,current:0,count:n},c=s.count,u=new Float32Array(2*c);for(let n=0,i=0;n1?n/(s.count-1):1;s.current=a,s.index=n+1,s.offset=c;const h=o(s,t);u[i]=h[0],u[i+1]=h[1]}const h=[void 0,void 0,void 0,void 0],l=this.applyModifiers(u,t);for(let t=0,e=l.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapePrimitive=void 0;const n=r(8721),i=r(2648),a=r(9958),o=r(5511);class s extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=o.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:"function"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return"function"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:"number"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp("sideLength",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeRecursive=void 0;const n=r(6448);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeRecursive",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionScale&&"function"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp("recursions",e,1)),n=Math.floor(this.getProp("recursionVertex",e,0)),a=this.getProp("recursionScale",e,2),o=this.shape;let s={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const c={...e,recursion:s};o.generate(t,!1,c);const u=o.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=u);let h=u;const l=[s];let f=0,d=1;const p=h.length,g=p/2,m=n<=0?g:Math.min(n,g),v=0===n?1:g/Math.min(n,g),M=new Float32Array(i.summmation(r,m)*p);for(let t=0;t1?e/(r-1):1,u=i.summmation(e,m)*p,g=e-1,b=0===g?0:i.summmation(g,m)*p;for(let i=0,g=m**e;i1?i/(g-1):1,count:g,level:{index:e+1,offset:n,count:r},parent:l[f]},l.push(s),this.shapeUseRecursion&&(c.recursion=s,o.generate(t,!1,c),h=o.getBuffer());const y=u+i*p,x=Math.floor(b+2*i*v),w=M[x],S=M[x+1],P=a**e;for(let t=0,e=p;t1?0:1,count:a}}},c=this.shape.getIndexedBuffer()||[];for(let t=0,e=c.length;t1?0:1,count:a}},i={...s,recursion:r},o=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:o})}if(a>1){const t=this.shape.getBufferLength({...i,parent:{...s}})/2,e=o<=0?t:Math.min(o,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let u=0,h=1;for(let t=1;t1?t/(a-1):1;for(let o=0,l=e**t;o1?o/(l-1):1;for(let d=0,p=c.length;d{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Circle=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){t.type="Circle",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=a},6329:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Line=void 0;const n=r(5511),i=r(7439);class a extends i.ShapeBuffer{constructor(t={}){t.type="Line",t.shape=a.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lissajous=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){t.type="Lissajous",t.loopDependencies=(t.loopDependencies||[]).concat(["wx","wy","wz"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp("wx",t),r=this.getProp("wy",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),a=this.getRepetitionSideLength(t);return 1/Math.pow(a[0]*a[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp("wx",t,1),this.wy=this.getProp("wy",t,2),this.wz=this.getProp("wz",t,2),super.generateLoopBuffer(t)}}e.Lissajous=a},2982:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Polygon=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["sideNumber"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp("sideNumber",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=a},5510:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Rect=void 0;const n=r(5511),i=r(7439);class a extends i.ShapeBuffer{constructor(t={}){t.type="Rect",t.shape=a.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=a,a.buffer=[1,1,-1,1,-1,-1,1,-1]},894:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Rose=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){var e,r;t.type="Rose",t.loopDependencies=(t.loopDependencies||[]).concat(["n","d"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>a.getFinalAngleFromK(this.getProp("n",t),this.getProp("d",t)),inc:t=>{const e=this.getProp("n",t),r=this.getProp("d",t),i=this.getRepetitionSideLength(t),a=Math.pow(i[0]*i[1],.45),o=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp("n",t)/this.getProp("d",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=a},5719:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Spiral=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type="Spiral",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat(["twists","twistsStart","spiral"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:a.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp("twistsStart",t),end:t=>n.PI2*(this.getProp("twistsStart",t)+this.getProp("twists",t)),inc:t=>{const e=this.getProp("twists",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp("spiral",t),this.r=a.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case a.types.ARCHIMEDE:return t=>t/10;case a.types.HYPERBOLIC:return t=>1/t*3;case a.types.FERMAT:return t=>t**.5/3;case a.types.LITUUS:return t=>t**-.5;case a.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=a,a.types={ARCHIMEDE:"ARCHIMEDE",HYPERBOLIC:"HYPERBOLIC",FERMAT:"FERMAT",LITUUS:"LITUUS",LOGARITHMIC:"LOGARITHMIC"}},9667:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Star=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["spikes","innerRadius"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp("spikes",t,5),this.innerRadius=this.getProp("innerRadius",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=a},3977:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SuperShape=void 0;const n=r(3792),i=r(6951);class a extends i.ShapeLoop{constructor(t={}){var e,r,i,a,o,s;t.type="SuperShape",t.loopDependencies=(t.loopDependencies||[]).concat(["a","b","m","n1","n2","n3"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(a=t.n1)&&void 0!==a?a:1,this.props.n2=null!==(o=t.n2)&&void 0!==o?o:1,this.props.n3=null!==(s=t.n3)&&void 0!==s?s:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp("a",t),this.b=this.getProp("b",t),this.m=this.getProp("m",t),this.n1=this.getProp("n1",t),this.n2=this.getProp("n2",t),this.n3=this.getProp("n3",t),super.generateLoopBuffer(t)}}e.SuperShape=a},4233:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Triangle=void 0;const n=r(5511),i=r(7439);class a extends i.ShapeBuffer{constructor(t={}){t.type="Triangle",t.shape=a.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=a,a.buffer=[1,0,-1,1,-1,-1]},3757:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(7678),e),i(r(7066),e),i(r(2769),e),i(r(7266),e),i(r(3647),e),i(r(4526),e),i(r(1618),e),i(r(6787),e)},7678:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},7066:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},2769:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]="Ring",r[r.Matrix=2]="Matrix"},7266:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3647:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4526:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]="Relative",r[r.Fixed=2]="Fixed"},1618:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6787:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},9962:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DrawerCanvas=void 0;const n=r(7358),i=r(313),a=r(3792),o=r(795),s=r(292),c=r(1189),u=r(8909),h=r(9724);class l extends c.Emitter{constructor(t,e,r,n=6e4,i=60){var a,o,s,c,l;super(),this.drawerOptions={width:(null==r?void 0:r.width)||(null==t?void 0:t.width)||400,height:(null==r?void 0:r.height)||(null==t?void 0:t.height)||400,clear:null===(a=null==r?void 0:r.clear)||void 0===a||a,time:null!==(o=null==r?void 0:r.time)&&void 0!==o?o:0,simmetricLines:null!==(s=null==r?void 0:r.simmetricLines)&&void 0!==s?s:0,noBackground:null!==(c=null==r?void 0:r.noBackground)&&void 0!==c&&c,ghosts:(null==r?void 0:r.ghosts)||0,ghostAlpha:!1!==(null==r?void 0:r.ghostAlpha),ghostSkipTime:null!==(l=null==r?void 0:r.ghostSkipTime)&&void 0!==l?l:30,ghostSkipFunction:null==r?void 0:r.ghostSkipFunction,sceneFit:(null==r?void 0:r.sceneFit)||"contain",backgroundImage:null==r?void 0:r.backgroundImage,backgroundImageFit:(null==r?void 0:r.backgroundImageFit)||"cover"},this.timeline=new u.Timeline(n,i),this.timeline.setTime(this.drawerOptions.time),this.draw_id=null,this.redraw_id=null,this.animation_id=null,t&&this.setScene(t),(!h.bWorker||h.bWorker&&e instanceof OffscreenCanvas)&&this.setCanvas(e)}getOption(t,e){var r;return null!==(r=this.drawerOptions[t])&&void 0!==r?r:e}setCanvas(t){if(h.bWorker)t instanceof OffscreenCanvas?this.canvas=t:console.error("Cannot set cavas");else if(h.bBrowser){const e=s.createCanvas(this.drawerOptions.width,this.drawerOptions.height);if(t instanceof HTMLElement&&!(t instanceof HTMLCanvasElement||t instanceof OffscreenCanvas)){for(this.canvas=e;t.lastChild;)t.removeChild(t.lastChild);t.appendChild(e)}else this.canvas=void 0===t?e:t}else this.canvas=s.createCanvas(this.drawerOptions.width,this.drawerOptions.height);this.canvas&&(this.canvas.width=this.drawerOptions.width,this.canvas.height=this.drawerOptions.height,this.context=this.canvas.getContext("2d",{alpha:!0}))}getCanvas(){return this.canvas}setScene(t){this.scene=t}draw(){if(null===this.context||void 0===this.scene)return 0;const t=i.now(),e=this.timeline,r=e.getTime(),n={...this.drawerOptions,ghostIndex:void 0,clear:this.drawerOptions.clear||e.getCurrentFrame()<=1,time:r},o=e.getFrameAtTime(r);if(this.dispatch("drawer-canvas:before_draw",{currentFrame:o,currentTime:r}),n.simmetricLines>0&&(n.clear&&l.clear(this.context,n.width,n.height,!n.noBackground&&this.scene.background,n.backgroundImage,n.backgroundImageFit),l.drawSimmetricLines(this.context,n.simmetricLines,n.width,n.height,this.scene.color),n.clear=!1),n.ghosts){const t={...n},r=e.getTime(),i=e.getDuration(),o={offset:0,index:0,count:n.ghosts};for(let e=1;e<=n.ghosts;e++){o.index=e,o.offset=o.index/o.count;const s=r-(n.ghostSkipFunction?n.ghostSkipFunction(o,r):e*n.ghostSkipTime);t.ghostIndex=e,t.time=a.mod(s,i),t.clear=n.clear&&1===t.ghostIndex,this.realDraw(t)}n.clear=!1}return this.realDraw(n),i.now()-t}realDraw(t){var e;const r=this.drawerOptions.width,n=this.drawerOptions.height,i=this.context,a=this.scene,o=null!==(e=t.time)&&void 0!==e?e:0,s=void 0!==t.ghosts&&t.ghosts>0&&void 0!==t.ghostIndex&&t.ghostIndex>0,c=s?1-t.ghostIndex/(t.ghosts+.5):0,u=!0===t.ghostAlpha,f=h.fit(a.width,a.height,r,n,this.drawerOptions.sceneFit),d=f.x,p=f.y;t.clear&&l.clear(i,r,n,!t.noBackground&&a.background,t.backgroundImage,t.backgroundImageFit);let g=!1,m=!1;a.currentTime=o;const v=a.getChildren();for(let t=0,e=v.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=void 0,e.Emitter=class{constructor(){this.callbacks={}}attach(t,e){t in this.callbacks||(this.callbacks[t]=[]),this.callbacks[t].push(e)}detach(t,e){if(t in this.callbacks){const r=this.callbacks[t].indexOf(e);r>=0&&this.callbacks[t].splice(r,1)}}dispatch(t,e){if(t in this.callbacks&&this.callbacks[t].length>0)for(let r=0,n=this.callbacks[t].length;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=void 0;const n=r(313),i=r(3792),a=r(1189);class o extends a.Emitter{constructor(t=6e4,e=30){super(),this.fps_samples_size=30,this.fps_samples=[],this.fps_samples_index=0,this.paused_time=0,this.sequence={duration:t,framerate:e,frames:Math.round(t/1e3*e)},this.tick_time=1e3/this.sequence.framerate,this.fps=this.sequence.framerate,this.b_sequence_started=!1,this.currentFrame=0,this.currentTime=0,this.last_tick=0,this.start_time=0}getSequence(){return{...this.sequence}}setSequence(t,e,r){this.sequence.duration=t,this.sequence.framerate=e,this.tick_time=1e3/this.sequence.framerate,this.sequence.frames=Math.round(this.sequence.duration/1e3*this.sequence.framerate),void 0!==r?this.setTime(r):this.dispatch("timeline:update_sequence",this.getSequence())}setDuration(t){this.setSequence(t,this.sequence.framerate)}getDuration(){return this.sequence.duration}getFramerate(){return this.sequence.framerate}setFramerate(t){this.setSequence(this.sequence.duration,t)}getFramesCount(){return this.sequence.frames}bSequenceStarted(){return this.b_sequence_started}start(){this.b_sequence_started||(this.b_sequence_started=!0,this.start_time=this.paused_time,this.dispatch("timeline:change_status",o.START))}pause(){this.b_sequence_started&&(this.paused_time=n.now(),this.b_sequence_started=!1,this.dispatch("timeline:change_status",o.PAUSE))}stop(){this.b_sequence_started&&(this.b_sequence_started=!1,this.currentTime=0,this.currentFrame=0,this.start_time=0,this.paused_time=0,this.dispatch("timeline:change_status",o.STOP))}tick(t){if(this.b_sequence_started){this.start_time||(this.start_time=t,this.last_tick=-this.tick_time);const e=t-this.start_time,r=e-this.last_tick;if(r>=this.tick_time)return this.calculateFPS(1/(r/1e3)),this.last_tick=e,this.currentTime=(e-r%this.tick_time)%this.sequence.duration,this.currentFrame=this.getFrameAtTime(this.currentTime),this.dispatch("timeline:progress",{currentFrame:this.currentFrame,currentTime:this.currentTime,fps:this.fps}),!0}return!1}calculateFPS(t){const e=this.fps_samples.length;if(e>0){let t=0;for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BrowserDrawerCanvas=void 0;const n=r(9962),i=r(9724);class a extends n.DrawerCanvas{constructor(t,e,r,n=6e4,i=60){super(t,e,r,n,i),this.dpi=1,this.dpi=(null==r?void 0:r.dpi)||1,this.draw_id=null,this.redraw_id=null,this.animation_id=null,this.draw=this.draw.bind(this),this.animate=this.animate.bind(this),this.startAnimation=this.startAnimation.bind(this),this.resize(this.drawerOptions.width,this.drawerOptions.height)}resize(t,e,r,n=this.dpi){this.drawerOptions.width=t*n,this.drawerOptions.height=e*n,this.canvas&&(this.canvas.width=t*n,this.canvas.height=e*n,i.bBrowser&&this.canvas instanceof HTMLCanvasElement&&(this.canvas.style.width=t+"px",this.canvas.style.height=e+"px")),void 0!==r&&(this.drawerOptions.sceneFit=r),this.dispatch("drawer-canvas:resize")}animate(t){this.timeline.bSequenceStarted()&&(this.animation_id=requestAnimationFrame(this.animate),this.timeline.tick(t)&&this.draw())}startAnimation(){this.stopAnimation(),this.timeline.start(),this.animation_id=requestAnimationFrame(this.animate)}stopAnimation(){this.timeline.stop(),this.animation_id&&cancelAnimationFrame(this.animation_id)}pauseAnimation(){this.timeline.pause(),this.animation_id&&cancelAnimationFrame(this.animation_id)}playAnimation(){this.timeline.start(),requestAnimationFrame(this.animate)}redraw(){this.timeline.bSequenceStarted()?void 0!==typeof this.drawerOptions.ghosts&&0!==this.drawerOptions.ghosts||(this.stopAnimation(),this.redraw_id&&cancelAnimationFrame(this.redraw_id),this.redraw_id=requestAnimationFrame(this.startAnimation)):(this.draw_id&&cancelAnimationFrame(this.draw_id),void 0!==typeof this.drawerOptions.ghosts&&0!==this.drawerOptions.ghosts||this.timeline.stop(),this.draw_id=requestAnimationFrame(this.draw))}}e.BrowserDrawerCanvas=a},9724:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fit=e.bWorker=e.bBrowser=e.bNode=void 0,e.bNode="undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node,e.bBrowser="undefined"!=typeof window&&void 0!==window.document,e.bWorker="object"==typeof self&&["ServiceWorkerGlobalScope","DedicatedWorkerGlobalScope"].includes(self.constructor.name),e.fit=function(t,e,r,n,i="none"){let a=0,o=0,s=1,c=t,u=e;const h=r/n,l=t/e;return"contain"===i?(c=h>l?t*n/e:r,u=h>l?n:e*r/t,s=Math.max(c,u)/Math.max(t,e)):"cover"===i&&(c=h{var e=.1,r="function"==typeof Float32Array;function n(t,e){return 1-3*e+3*t}function i(t,e){return 3*e-6*t}function a(t){return 3*t}function o(t,e,r){return((n(e,r)*t+i(e,r))*t+a(e))*t}function s(t,e,r){return 3*n(e,r)*t*t+2*i(e,r)*t+a(e)}function c(t){return t}t.exports=function(t,n,i,a){if(!(0<=t&&t<=1&&0<=i&&i<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===n&&i===a)return c;for(var u=r?new Float32Array(11):new Array(11),h=0;h<11;++h)u[h]=o(h*e,t,i);return function(r){return 0===r?0:1===r?1:o(function(r){for(var n=0,a=1;10!==a&&u[a]<=r;++a)n+=e;--a;var c=n+(r-u[a])/(u[a+1]-u[a])*e,h=s(c,t,i);return h>=.001?function(t,e,r,n){for(var i=0;i<4;++i){var a=s(e,r,n);if(0===a)return e;e-=(o(e,r,n)-t)/a}return e}(r,c,t,i):0===h?c:function(t,e,r,n,i){var a,s,c=0;do{(a=o(s=e+(r-e)/2,n,i)-t)>0?r=s:e=s}while(Math.abs(a)>1e-7&&++c<10);return s}(r,n,n+e,t,i)}(r),n,a)}}},292:(t,e,r)=>{const n=r(9850);e.parseFont=n,e.createCanvas=function(t,e){return Object.assign(document.createElement("canvas"),{width:t,height:e})},e.createImageData=function(t,e,r){switch(arguments.length){case 0:return new ImageData;case 1:return new ImageData(t);case 2:return new ImageData(t,e);default:return new ImageData(t,e,r)}},e.loadImage=function(t,e){return new Promise((function(r,n){const i=Object.assign(document.createElement("img"),e);function a(){i.onload=null,i.onerror=null}i.onload=function(){a(),r(i)},i.onerror=function(){a(),n(new Error('Failed to load the image "'+t+'"'))},i.src=t}))}},9850:t=>{"use strict";const e="'([^']+)'|\"([^\"]+)\"|[\\w\\s-]+",r=new RegExp("(bold|bolder|lighter|[1-9]00) +","i"),n=new RegExp("(italic|oblique) +","i"),i=new RegExp("(small-caps) +","i"),a=new RegExp("(ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded) +","i"),o=new RegExp("([\\d\\.]+)(px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q) *((?:"+e+")( *, *(?:"+e+"))*)"),s={};t.exports=function(t){if(s[t])return s[t];const e=o.exec(t);if(!e)return;const c={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(e[1]),unit:e[2],family:e[3].replace(/["']/g,"").replace(/ *, */g,",")};let u,h,l,f,d=t.substring(0,e.index);switch((u=r.exec(d))&&(c.weight=u[1]),(h=n.exec(d))&&(c.style=h[1]),(l=i.exec(d))&&(c.variant=l[1]),(f=a.exec(d))&&(c.stretch=f[1]),c.unit){case"pt":c.size/=.75;break;case"pc":c.size*=16;break;case"in":c.size*=96;break;case"cm":c.size*=96/2.54;break;case"mm":c.size*=96/25.4;break;case"%":break;case"em":case"rem":c.size*=16/.75;break;case"q":c.size*=96/25.4/4}return s[t]=c}},887:(t,e,r)=>{"use strict";r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>a,mat3:()=>o,mat4:()=>s,quat:()=>h,quat2:()=>l,vec2:()=>f,vec3:()=>c,vec4:()=>u});var n={};r.r(n),r.d(n,{ARRAY_TYPE:()=>p,EPSILON:()=>d,RANDOM:()=>g,equals:()=>b,setMatrixArrayType:()=>m,toRadian:()=>M});var i={};r.r(i),r.d(i,{LDU:()=>T,add:()=>j,adjoint:()=>B,clone:()=>x,copy:()=>w,create:()=>y,determinant:()=>A,equals:()=>V,exactEquals:()=>z,frob:()=>L,fromRotation:()=>E,fromScaling:()=>F,fromValues:()=>P,identity:()=>S,invert:()=>O,mul:()=>H,multiply:()=>C,multiplyScalar:()=>U,multiplyScalarAndAdd:()=>Y,rotate:()=>R,scale:()=>k,set:()=>_,str:()=>q,sub:()=>N,subtract:()=>D,transpose:()=>I});var a={};r.r(a),r.d(a,{add:()=>ut,clone:()=>X,copy:()=>G,create:()=>Z,determinant:()=>K,equals:()=>pt,exactEquals:()=>dt,frob:()=>ct,fromRotation:()=>it,fromScaling:()=>at,fromTranslation:()=>ot,fromValues:()=>W,identity:()=>$,invert:()=>J,mul:()=>gt,multiply:()=>tt,multiplyScalar:()=>lt,multiplyScalarAndAdd:()=>ft,rotate:()=>et,scale:()=>rt,set:()=>Q,str:()=>st,sub:()=>mt,subtract:()=>ht,translate:()=>nt});var o={};r.r(o),r.d(o,{add:()=>Vt,adjoint:()=>It,clone:()=>bt,copy:()=>yt,create:()=>vt,determinant:()=>Ot,equals:()=>Zt,exactEquals:()=>Nt,frob:()=>zt,fromMat2d:()=>qt,fromMat4:()=>Mt,fromQuat:()=>Lt,fromRotation:()=>Et,fromScaling:()=>Ft,fromTranslation:()=>kt,fromValues:()=>xt,identity:()=>St,invert:()=>_t,mul:()=>Xt,multiply:()=>Bt,multiplyScalar:()=>Yt,multiplyScalarAndAdd:()=>Ht,normalFromMat4:()=>Tt,projection:()=>jt,rotate:()=>Ct,scale:()=>Rt,set:()=>wt,str:()=>Dt,sub:()=>Gt,subtract:()=>Ut,translate:()=>At,transpose:()=>Pt});var s={};r.r(s),r.d(s,{add:()=>Fe,adjoint:()=>ne,clone:()=>Wt,copy:()=>Qt,create:()=>$t,determinant:()=>ie,equals:()=>De,exactEquals:()=>je,frob:()=>Ee,fromQuat:()=>_e,fromQuat2:()=>be,fromRotation:()=>pe,fromRotationTranslation:()=>Me,fromRotationTranslationScale:()=>Se,fromRotationTranslationScaleOrigin:()=>Pe,fromScaling:()=>de,fromTranslation:()=>fe,fromValues:()=>Jt,fromXRotation:()=>ge,fromYRotation:()=>me,fromZRotation:()=>ve,frustum:()=>Ie,getRotation:()=>we,getScaling:()=>xe,getTranslation:()=>ye,identity:()=>te,invert:()=>re,lookAt:()=>Ce,mul:()=>ze,multiply:()=>ae,multiplyScalar:()=>Le,multiplyScalarAndAdd:()=>Te,ortho:()=>Ae,perspective:()=>Oe,perspectiveFromFieldOfView:()=>Be,rotate:()=>ce,rotateX:()=>ue,rotateY:()=>he,rotateZ:()=>le,scale:()=>se,set:()=>Kt,str:()=>ke,sub:()=>Ve,subtract:()=>qe,targetTo:()=>Re,translate:()=>oe,transpose:()=>ee});var c={};r.r(c),r.d(c,{add:()=>Ge,angle:()=>Sr,bezier:()=>gr,ceil:()=>Je,clone:()=>Ye,copy:()=>Ze,create:()=>Ue,cross:()=>fr,dist:()=>kr,distance:()=>ar,div:()=>Rr,divide:()=>Qe,dot:()=>lr,equals:()=>Or,exactEquals:()=>Ir,floor:()=>Ke,forEach:()=>Lr,fromValues:()=>Ne,hermite:()=>pr,inverse:()=>ur,len:()=>Fr,length:()=>He,lerp:()=>dr,max:()=>er,min:()=>tr,mul:()=>Cr,multiply:()=>We,negate:()=>cr,normalize:()=>hr,random:()=>mr,rotateX:()=>yr,rotateY:()=>xr,rotateZ:()=>wr,round:()=>rr,scale:()=>nr,scaleAndAdd:()=>ir,set:()=>Xe,sqrDist:()=>Er,sqrLen:()=>qr,squaredDistance:()=>or,squaredLength:()=>sr,str:()=>_r,sub:()=>Ar,subtract:()=>$e,transformMat3:()=>Mr,transformMat4:()=>vr,transformQuat:()=>br,zero:()=>Pr});var u={};r.r(u),r.d(u,{add:()=>Ur,ceil:()=>Zr,clone:()=>jr,copy:()=>zr,create:()=>Tr,cross:()=>cn,dist:()=>yn,distance:()=>Kr,div:()=>bn,divide:()=>Nr,dot:()=>sn,equals:()=>mn,exactEquals:()=>gn,floor:()=>Xr,forEach:()=>Pn,fromValues:()=>Dr,inverse:()=>an,len:()=>wn,length:()=>en,lerp:()=>un,max:()=>$r,min:()=>Gr,mul:()=>Mn,multiply:()=>Hr,negate:()=>nn,normalize:()=>on,random:()=>hn,round:()=>Wr,scale:()=>Qr,scaleAndAdd:()=>Jr,set:()=>Vr,sqrDist:()=>xn,sqrLen:()=>Sn,squaredDistance:()=>tn,squaredLength:()=>rn,str:()=>pn,sub:()=>vn,subtract:()=>Yr,transformMat4:()=>ln,transformQuat:()=>fn,zero:()=>dn});var h={};r.r(h),r.d(h,{add:()=>ei,calculateW:()=>Fn,clone:()=>Qn,conjugate:()=>Vn,copy:()=>Kn,create:()=>_n,dot:()=>ii,equals:()=>fi,exactEquals:()=>li,exp:()=>qn,fromEuler:()=>Yn,fromMat3:()=>Un,fromValues:()=>Jn,getAngle:()=>An,getAxisAngle:()=>Bn,identity:()=>In,invert:()=>zn,len:()=>si,length:()=>oi,lerp:()=>ai,ln:()=>Ln,mul:()=>ri,multiply:()=>Cn,normalize:()=>hi,pow:()=>Tn,random:()=>Dn,rotateX:()=>Rn,rotateY:()=>kn,rotateZ:()=>En,rotationTo:()=>di,scale:()=>ni,set:()=>ti,setAxes:()=>gi,setAxisAngle:()=>On,slerp:()=>jn,sqlerp:()=>pi,sqrLen:()=>ui,squaredLength:()=>ci,str:()=>Hn});var l={};r.r(l),r.d(l,{add:()=>Di,clone:()=>vi,conjugate:()=>Zi,copy:()=>Pi,create:()=>mi,dot:()=>Yi,equals:()=>ta,exactEquals:()=>Ki,fromMat4:()=>Si,fromRotation:()=>wi,fromRotationTranslation:()=>yi,fromRotationTranslationValues:()=>bi,fromTranslation:()=>xi,fromValues:()=>Mi,getDual:()=>Bi,getReal:()=>Oi,getTranslation:()=>Ri,identity:()=>_i,invert:()=>Ni,len:()=>Gi,length:()=>Xi,lerp:()=>Hi,mul:()=>Vi,multiply:()=>zi,normalize:()=>Qi,rotateAroundAxis:()=>ji,rotateByQuatAppend:()=>Li,rotateByQuatPrepend:()=>Ti,rotateX:()=>Ei,rotateY:()=>Fi,rotateZ:()=>qi,scale:()=>Ui,set:()=>Ii,setDual:()=>Ci,setReal:()=>Ai,sqrLen:()=>Wi,squaredLength:()=>$i,str:()=>Ji,translate:()=>ki});var f={};r.r(f),r.d(f,{add:()=>oa,angle:()=>Ea,ceil:()=>ha,clone:()=>ra,copy:()=>ia,create:()=>ea,cross:()=>_a,dist:()=>Ua,distance:()=>va,div:()=>Va,divide:()=>ua,dot:()=>Pa,equals:()=>Ta,exactEquals:()=>La,floor:()=>la,forEach:()=>Na,fromValues:()=>na,inverse:()=>wa,len:()=>ja,length:()=>ba,lerp:()=>Ia,max:()=>da,min:()=>fa,mul:()=>za,multiply:()=>ca,negate:()=>xa,normalize:()=>Sa,random:()=>Oa,rotate:()=>ka,round:()=>pa,scale:()=>ga,scaleAndAdd:()=>ma,set:()=>aa,sqrDist:()=>Ya,sqrLen:()=>Ha,squaredDistance:()=>Ma,squaredLength:()=>ya,str:()=>qa,sub:()=>Da,subtract:()=>sa,transformMat2:()=>Ba,transformMat2d:()=>Aa,transformMat3:()=>Ca,transformMat4:()=>Ra,zero:()=>Fa});var d=1e-6,p="undefined"!=typeof Float32Array?Float32Array:Array,g=Math.random;function m(t){p=t}var v=Math.PI/180;function M(t){return t*v}function b(t,e){return Math.abs(t-e)<=d*Math.max(1,Math.abs(t),Math.abs(e))}function y(){var t=new p(4);return p!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function x(t){var e=new p(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function w(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function S(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function P(t,e,r,n){var i=new p(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function _(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function I(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function O(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*a-i*n;return o?(o=1/o,t[0]=a*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}function B(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function A(t){return t[0]*t[3]-t[2]*t[1]}function C(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],c=r[1],u=r[2],h=r[3];return t[0]=n*s+a*c,t[1]=i*s+o*c,t[2]=n*u+a*h,t[3]=i*u+o*h,t}function R(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),c=Math.cos(r);return t[0]=n*c+a*s,t[1]=i*c+o*s,t[2]=n*-s+a*c,t[3]=i*-s+o*c,t}function k(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],c=r[1];return t[0]=n*s,t[1]=i*s,t[2]=a*c,t[3]=o*c,t}function E(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function F(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function q(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function L(t){return Math.hypot(t[0],t[1],t[2],t[3])}function T(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function j(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function D(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function z(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function V(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],c=e[2],u=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-c)<=d*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(a-u)<=d*Math.max(1,Math.abs(a),Math.abs(u))}function U(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Y(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var H=C,N=D;function Z(){var t=new p(6);return p!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function X(t){var e=new p(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function G(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function $(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function W(t,e,r,n,i,a){var o=new p(6);return o[0]=t,o[1]=e,o[2]=r,o[3]=n,o[4]=i,o[5]=a,o}function Q(t,e,r,n,i,a,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t}function J(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=r*a-n*i;return c?(c=1/c,t[0]=a*c,t[1]=-n*c,t[2]=-i*c,t[3]=r*c,t[4]=(i*s-a*o)*c,t[5]=(n*o-r*s)*c,t):null}function K(t){return t[0]*t[3]-t[1]*t[2]}function tt(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],u=r[0],h=r[1],l=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*u+a*h,t[1]=i*u+o*h,t[2]=n*l+a*f,t[3]=i*l+o*f,t[4]=n*d+a*p+s,t[5]=i*d+o*p+c,t}function et(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],u=Math.sin(r),h=Math.cos(r);return t[0]=n*h+a*u,t[1]=i*h+o*u,t[2]=n*-u+a*h,t[3]=i*-u+o*h,t[4]=s,t[5]=c,t}function rt(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],u=r[0],h=r[1];return t[0]=n*u,t[1]=i*u,t[2]=a*h,t[3]=o*h,t[4]=s,t[5]=c,t}function nt(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],u=r[0],h=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=n*u+a*h+s,t[5]=i*u+o*h+c,t}function it(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function at(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function ot(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function st(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function ct(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function ut(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function ht(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function lt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function ft(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function dt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function pt(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=e[0],u=e[1],h=e[2],l=e[3],f=e[4],p=e[5];return Math.abs(r-c)<=d*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(n-u)<=d*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(i-h)<=d*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-l)<=d*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(o-f)<=d*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(s-p)<=d*Math.max(1,Math.abs(s),Math.abs(p))}var gt=tt,mt=ht;function vt(){var t=new p(9);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Mt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function bt(t){var e=new p(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function xt(t,e,r,n,i,a,o,s,c){var u=new p(9);return u[0]=t,u[1]=e,u[2]=r,u[3]=n,u[4]=i,u[5]=a,u[6]=o,u[7]=s,u[8]=c,u}function wt(t,e,r,n,i,a,o,s,c,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=u,t}function St(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Pt(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function _t(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],u=e[7],h=e[8],l=h*o-s*u,f=-h*a+s*c,d=u*a-o*c,p=r*l+n*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-h*n+i*u)*p,t[2]=(s*n-i*o)*p,t[3]=f*p,t[4]=(h*r-i*c)*p,t[5]=(-s*r+i*a)*p,t[6]=d*p,t[7]=(-u*r+n*c)*p,t[8]=(o*r-n*a)*p,t):null}function It(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],u=e[7],h=e[8];return t[0]=o*h-s*u,t[1]=i*u-n*h,t[2]=n*s-i*o,t[3]=s*c-a*h,t[4]=r*h-i*c,t[5]=i*a-r*s,t[6]=a*u-o*c,t[7]=n*c-r*u,t[8]=r*o-n*a,t}function Ot(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],u=t[8];return e*(u*a-o*c)+r*(-u*i+o*s)+n*(c*i-a*s)}function Bt(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],u=e[6],h=e[7],l=e[8],f=r[0],d=r[1],p=r[2],g=r[3],m=r[4],v=r[5],M=r[6],b=r[7],y=r[8];return t[0]=f*n+d*o+p*u,t[1]=f*i+d*s+p*h,t[2]=f*a+d*c+p*l,t[3]=g*n+m*o+v*u,t[4]=g*i+m*s+v*h,t[5]=g*a+m*c+v*l,t[6]=M*n+b*o+y*u,t[7]=M*i+b*s+y*h,t[8]=M*a+b*c+y*l,t}function At(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],u=e[6],h=e[7],l=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=c,t[6]=f*n+d*o+u,t[7]=f*i+d*s+h,t[8]=f*a+d*c+l,t}function Ct(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],u=e[6],h=e[7],l=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*s,t[2]=d*a+f*c,t[3]=d*o-f*n,t[4]=d*s-f*i,t[5]=d*c-f*a,t[6]=u,t[7]=h,t[8]=l,t}function Rt(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function kt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function Et(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Ft(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function qt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function Lt(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,c=i+i,u=r*o,h=n*o,l=n*s,f=i*o,d=i*s,p=i*c,g=a*o,m=a*s,v=a*c;return t[0]=1-l-p,t[3]=h-v,t[6]=f+m,t[1]=h+v,t[4]=1-u-p,t[7]=d-g,t[2]=f-m,t[5]=d+g,t[8]=1-u-l,t}function Tt(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],u=e[7],h=e[8],l=e[9],f=e[10],d=e[11],p=e[12],g=e[13],m=e[14],v=e[15],M=r*s-n*o,b=r*c-i*o,y=r*u-a*o,x=n*c-i*s,w=n*u-a*s,S=i*u-a*c,P=h*g-l*p,_=h*m-f*p,I=h*v-d*p,O=l*m-f*g,B=l*v-d*g,A=f*v-d*m,C=M*A-b*B+y*O+x*I-w*_+S*P;return C?(C=1/C,t[0]=(s*A-c*B+u*O)*C,t[1]=(c*I-o*A-u*_)*C,t[2]=(o*B-s*I+u*P)*C,t[3]=(i*B-n*A-a*O)*C,t[4]=(r*A-i*I+a*_)*C,t[5]=(n*I-r*B-a*P)*C,t[6]=(g*S-m*w+v*x)*C,t[7]=(m*y-p*S-v*b)*C,t[8]=(p*w-g*y+v*M)*C,t):null}function jt(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function Dt(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function zt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Vt(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function Ut(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function Yt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function Ht(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function Nt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function Zt(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],u=t[7],h=t[8],l=e[0],f=e[1],p=e[2],g=e[3],m=e[4],v=e[5],M=e[6],b=e[7],y=e[8];return Math.abs(r-l)<=d*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(n-f)<=d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-p)<=d*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(a-g)<=d*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(o-m)<=d*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(s-v)<=d*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(c-M)<=d*Math.max(1,Math.abs(c),Math.abs(M))&&Math.abs(u-b)<=d*Math.max(1,Math.abs(u),Math.abs(b))&&Math.abs(h-y)<=d*Math.max(1,Math.abs(h),Math.abs(y))}var Xt=Bt,Gt=Ut;function $t(){var t=new p(16);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Wt(t){var e=new p(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Qt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Jt(t,e,r,n,i,a,o,s,c,u,h,l,f,d,g,m){var v=new p(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=n,v[4]=i,v[5]=a,v[6]=o,v[7]=s,v[8]=c,v[9]=u,v[10]=h,v[11]=l,v[12]=f,v[13]=d,v[14]=g,v[15]=m,v}function Kt(t,e,r,n,i,a,o,s,c,u,h,l,f,d,p,g,m){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=u,t[9]=h,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=g,t[15]=m,t}function te(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ee(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function re(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],u=e[7],h=e[8],l=e[9],f=e[10],d=e[11],p=e[12],g=e[13],m=e[14],v=e[15],M=r*s-n*o,b=r*c-i*o,y=r*u-a*o,x=n*c-i*s,w=n*u-a*s,S=i*u-a*c,P=h*g-l*p,_=h*m-f*p,I=h*v-d*p,O=l*m-f*g,B=l*v-d*g,A=f*v-d*m,C=M*A-b*B+y*O+x*I-w*_+S*P;return C?(C=1/C,t[0]=(s*A-c*B+u*O)*C,t[1]=(i*B-n*A-a*O)*C,t[2]=(g*S-m*w+v*x)*C,t[3]=(f*w-l*S-d*x)*C,t[4]=(c*I-o*A-u*_)*C,t[5]=(r*A-i*I+a*_)*C,t[6]=(m*y-p*S-v*b)*C,t[7]=(h*S-f*y+d*b)*C,t[8]=(o*B-s*I+u*P)*C,t[9]=(n*I-r*B-a*P)*C,t[10]=(p*w-g*y+v*M)*C,t[11]=(l*y-h*w-d*M)*C,t[12]=(s*_-o*O-c*P)*C,t[13]=(r*O-n*_+i*P)*C,t[14]=(g*b-p*x-m*M)*C,t[15]=(h*x-l*b+f*M)*C,t):null}function ne(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],u=e[7],h=e[8],l=e[9],f=e[10],d=e[11],p=e[12],g=e[13],m=e[14],v=e[15];return t[0]=s*(f*v-d*m)-l*(c*v-u*m)+g*(c*d-u*f),t[1]=-(n*(f*v-d*m)-l*(i*v-a*m)+g*(i*d-a*f)),t[2]=n*(c*v-u*m)-s*(i*v-a*m)+g*(i*u-a*c),t[3]=-(n*(c*d-u*f)-s*(i*d-a*f)+l*(i*u-a*c)),t[4]=-(o*(f*v-d*m)-h*(c*v-u*m)+p*(c*d-u*f)),t[5]=r*(f*v-d*m)-h*(i*v-a*m)+p*(i*d-a*f),t[6]=-(r*(c*v-u*m)-o*(i*v-a*m)+p*(i*u-a*c)),t[7]=r*(c*d-u*f)-o*(i*d-a*f)+h*(i*u-a*c),t[8]=o*(l*v-d*g)-h*(s*v-u*g)+p*(s*d-u*l),t[9]=-(r*(l*v-d*g)-h*(n*v-a*g)+p*(n*d-a*l)),t[10]=r*(s*v-u*g)-o*(n*v-a*g)+p*(n*u-a*s),t[11]=-(r*(s*d-u*l)-o*(n*d-a*l)+h*(n*u-a*s)),t[12]=-(o*(l*m-f*g)-h*(s*m-c*g)+p*(s*f-c*l)),t[13]=r*(l*m-f*g)-h*(n*m-i*g)+p*(n*f-i*l),t[14]=-(r*(s*m-c*g)-o*(n*m-i*g)+p*(n*c-i*s)),t[15]=r*(s*f-c*l)-o*(n*f-i*l)+h*(n*c-i*s),t}function ie(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],u=t[8],h=t[9],l=t[10],f=t[11],d=t[12],p=t[13],g=t[14],m=t[15];return(e*o-r*a)*(l*m-f*g)-(e*s-n*a)*(h*m-f*p)+(e*c-i*a)*(h*g-l*p)+(r*s-n*o)*(u*m-f*d)-(r*c-i*o)*(u*g-l*d)+(n*c-i*s)*(u*p-h*d)}function ae(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],u=e[6],h=e[7],l=e[8],f=e[9],d=e[10],p=e[11],g=e[12],m=e[13],v=e[14],M=e[15],b=r[0],y=r[1],x=r[2],w=r[3];return t[0]=b*n+y*s+x*l+w*g,t[1]=b*i+y*c+x*f+w*m,t[2]=b*a+y*u+x*d+w*v,t[3]=b*o+y*h+x*p+w*M,b=r[4],y=r[5],x=r[6],w=r[7],t[4]=b*n+y*s+x*l+w*g,t[5]=b*i+y*c+x*f+w*m,t[6]=b*a+y*u+x*d+w*v,t[7]=b*o+y*h+x*p+w*M,b=r[8],y=r[9],x=r[10],w=r[11],t[8]=b*n+y*s+x*l+w*g,t[9]=b*i+y*c+x*f+w*m,t[10]=b*a+y*u+x*d+w*v,t[11]=b*o+y*h+x*p+w*M,b=r[12],y=r[13],x=r[14],w=r[15],t[12]=b*n+y*s+x*l+w*g,t[13]=b*i+y*c+x*f+w*m,t[14]=b*a+y*u+x*d+w*v,t[15]=b*o+y*h+x*p+w*M,t}function oe(t,e,r){var n,i,a,o,s,c,u,h,l,f,d,p,g=r[0],m=r[1],v=r[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*v+e[12],t[13]=e[1]*g+e[5]*m+e[9]*v+e[13],t[14]=e[2]*g+e[6]*m+e[10]*v+e[14],t[15]=e[3]*g+e[7]*m+e[11]*v+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],u=e[6],h=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=c,t[6]=u,t[7]=h,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*g+s*m+l*v+e[12],t[13]=i*g+c*m+f*v+e[13],t[14]=a*g+u*m+d*v+e[14],t[15]=o*g+h*m+p*v+e[15]),t}function se(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ce(t,e,r,n){var i,a,o,s,c,u,h,l,f,p,g,m,v,M,b,y,x,w,S,P,_,I,O,B,A=n[0],C=n[1],R=n[2],k=Math.hypot(A,C,R);return k0?(r[0]=2*(s*o+h*n+c*a-u*i)/l,r[1]=2*(c*o+h*i+u*n-s*a)/l,r[2]=2*(u*o+h*a+s*i-c*n)/l):(r[0]=2*(s*o+h*n+c*a-u*i),r[1]=2*(c*o+h*i+u*n-s*a),r[2]=2*(u*o+h*a+s*i-c*n)),Me(t,e,r),t}function ye(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function xe(t,e){var r=e[0],n=e[1],i=e[2],a=e[4],o=e[5],s=e[6],c=e[8],u=e[9],h=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(a,o,s),t[2]=Math.hypot(c,u,h),t}function we(t,e){var r=new p(3);xe(r,e);var n=1/r[0],i=1/r[1],a=1/r[2],o=e[0]*n,s=e[1]*i,c=e[2]*a,u=e[4]*n,h=e[5]*i,l=e[6]*a,f=e[8]*n,d=e[9]*i,g=e[10]*a,m=o+h+g,v=0;return m>0?(v=2*Math.sqrt(m+1),t[3]=.25*v,t[0]=(l-d)/v,t[1]=(f-c)/v,t[2]=(s-u)/v):o>h&&o>g?(v=2*Math.sqrt(1+o-h-g),t[3]=(l-d)/v,t[0]=.25*v,t[1]=(s+u)/v,t[2]=(f+c)/v):h>g?(v=2*Math.sqrt(1+h-o-g),t[3]=(f-c)/v,t[0]=(s+u)/v,t[1]=.25*v,t[2]=(l+d)/v):(v=2*Math.sqrt(1+g-o-h),t[3]=(s-u)/v,t[0]=(f+c)/v,t[1]=(l+d)/v,t[2]=.25*v),t}function Se(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],c=i+i,u=a+a,h=o+o,l=i*c,f=i*u,d=i*h,p=a*u,g=a*h,m=o*h,v=s*c,M=s*u,b=s*h,y=n[0],x=n[1],w=n[2];return t[0]=(1-(p+m))*y,t[1]=(f+b)*y,t[2]=(d-M)*y,t[3]=0,t[4]=(f-b)*x,t[5]=(1-(l+m))*x,t[6]=(g+v)*x,t[7]=0,t[8]=(d+M)*w,t[9]=(g-v)*w,t[10]=(1-(l+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function Pe(t,e,r,n,i){var a=e[0],o=e[1],s=e[2],c=e[3],u=a+a,h=o+o,l=s+s,f=a*u,d=a*h,p=a*l,g=o*h,m=o*l,v=s*l,M=c*u,b=c*h,y=c*l,x=n[0],w=n[1],S=n[2],P=i[0],_=i[1],I=i[2],O=(1-(g+v))*x,B=(d+y)*x,A=(p-b)*x,C=(d-y)*w,R=(1-(f+v))*w,k=(m+M)*w,E=(p+b)*S,F=(m-M)*S,q=(1-(f+g))*S;return t[0]=O,t[1]=B,t[2]=A,t[3]=0,t[4]=C,t[5]=R,t[6]=k,t[7]=0,t[8]=E,t[9]=F,t[10]=q,t[11]=0,t[12]=r[0]+P-(O*P+C*_+E*I),t[13]=r[1]+_-(B*P+R*_+F*I),t[14]=r[2]+I-(A*P+k*_+q*I),t[15]=1,t}function _e(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,c=i+i,u=r*o,h=n*o,l=n*s,f=i*o,d=i*s,p=i*c,g=a*o,m=a*s,v=a*c;return t[0]=1-l-p,t[1]=h+v,t[2]=f-m,t[3]=0,t[4]=h-v,t[5]=1-u-p,t[6]=d+g,t[7]=0,t[8]=f+m,t[9]=d-g,t[10]=1-u-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ie(t,e,r,n,i,a,o){var s=1/(r-e),c=1/(i-n),u=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*c,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*c,t[10]=(o+a)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*u,t[15]=0,t}function Oe(t,e,r,n,i){var a,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(a=1/(n-i),t[10]=(i+n)*a,t[14]=2*i*n*a):(t[10]=-1,t[14]=-2*n),t}function Be(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),c=2/(o+s),u=2/(i+a);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-s)*c*.5,t[9]=(i-a)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function Ae(t,e,r,n,i,a,o){var s=1/(e-r),c=1/(n-i),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*c,t[14]=(o+a)*u,t[15]=1,t}function Ce(t,e,r,n){var i,a,o,s,c,u,h,l,f,p,g=e[0],m=e[1],v=e[2],M=n[0],b=n[1],y=n[2],x=r[0],w=r[1],S=r[2];return Math.abs(g-x)0&&(h*=d=1/Math.sqrt(d),l*=d,f*=d);var p=c*f-u*l,g=u*h-s*f,m=s*l-c*h;return(d=p*p+g*g+m*m)>0&&(p*=d=1/Math.sqrt(d),g*=d,m*=d),t[0]=p,t[1]=g,t[2]=m,t[3]=0,t[4]=l*m-f*g,t[5]=f*p-h*m,t[6]=h*g-l*p,t[7]=0,t[8]=h,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=a,t[14]=o,t[15]=1,t}function ke(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Ee(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Fe(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function qe(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function Le(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function Te(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function je(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function De(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],u=t[7],h=t[8],l=t[9],f=t[10],p=t[11],g=t[12],m=t[13],v=t[14],M=t[15],b=e[0],y=e[1],x=e[2],w=e[3],S=e[4],P=e[5],_=e[6],I=e[7],O=e[8],B=e[9],A=e[10],C=e[11],R=e[12],k=e[13],E=e[14],F=e[15];return Math.abs(r-b)<=d*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-y)<=d*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-x)<=d*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-w)<=d*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(o-S)<=d*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(s-P)<=d*Math.max(1,Math.abs(s),Math.abs(P))&&Math.abs(c-_)<=d*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-I)<=d*Math.max(1,Math.abs(u),Math.abs(I))&&Math.abs(h-O)<=d*Math.max(1,Math.abs(h),Math.abs(O))&&Math.abs(l-B)<=d*Math.max(1,Math.abs(l),Math.abs(B))&&Math.abs(f-A)<=d*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(p-C)<=d*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(g-R)<=d*Math.max(1,Math.abs(g),Math.abs(R))&&Math.abs(m-k)<=d*Math.max(1,Math.abs(m),Math.abs(k))&&Math.abs(v-E)<=d*Math.max(1,Math.abs(v),Math.abs(E))&&Math.abs(M-F)<=d*Math.max(1,Math.abs(M),Math.abs(F))}var ze=ae,Ve=qe;function Ue(){var t=new p(3);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ye(t){var e=new p(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function He(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function Ne(t,e,r){var n=new p(3);return n[0]=t,n[1]=e,n[2]=r,n}function Ze(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Xe(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function Ge(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function $e(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function We(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function Qe(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function Je(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Ke(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function tr(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function er(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function rr(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function nr(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function ir(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function ar(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function or(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function sr(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function cr(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function ur(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function hr(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function lr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function fr(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],c=r[2];return t[0]=i*c-a*s,t[1]=a*o-n*c,t[2]=n*s-i*o,t}function dr(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t}function pr(t,e,r,n,i,a){var o=a*a,s=o*(2*a-3)+1,c=o*(a-2)+a,u=o*(a-1),h=o*(3-2*a);return t[0]=e[0]*s+r[0]*c+n[0]*u+i[0]*h,t[1]=e[1]*s+r[1]*c+n[1]*u+i[1]*h,t[2]=e[2]*s+r[2]*c+n[2]*u+i[2]*h,t}function gr(t,e,r,n,i,a){var o=1-a,s=o*o,c=a*a,u=s*o,h=3*a*s,l=3*c*o,f=c*a;return t[0]=e[0]*u+r[0]*h+n[0]*l+i[0]*f,t[1]=e[1]*u+r[1]*h+n[1]*l+i[1]*f,t[2]=e[2]*u+r[2]*h+n[2]*l+i[2]*f,t}function mr(t,e){e=e||1;var r=2*g()*Math.PI,n=2*g()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}function vr(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t}function Mr(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t}function br(t,e,r){var n=r[0],i=r[1],a=r[2],o=r[3],s=e[0],c=e[1],u=e[2],h=i*u-a*c,l=a*s-n*u,f=n*c-i*s,d=i*f-a*l,p=a*h-n*f,g=n*l-i*h,m=2*o;return h*=m,l*=m,f*=m,d*=2,p*=2,g*=2,t[0]=s+h+d,t[1]=c+l+p,t[2]=u+f+g,t}function yr(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t}function xr(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t}function wr(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t}function Sr(t,e){var r=t[0],n=t[1],i=t[2],a=e[0],o=e[1],s=e[2],c=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(a*a+o*o+s*s),u=c&&lr(t,e)/c;return Math.acos(Math.min(Math.max(u,-1),1))}function Pr(t){return t[0]=0,t[1]=0,t[2]=0,t}function _r(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function Ir(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Or(t,e){var r=t[0],n=t[1],i=t[2],a=e[0],o=e[1],s=e[2];return Math.abs(r-a)<=d*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-o)<=d*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=d*Math.max(1,Math.abs(i),Math.abs(s))}var Br,Ar=$e,Cr=We,Rr=Qe,kr=ar,Er=or,Fr=He,qr=sr,Lr=(Br=Ue(),function(t,e,r,n,i,a){var o,s;for(e||(e=3),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,o=r;o0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o,t}function sn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function cn(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],a=r[0]*n[2]-r[2]*n[0],o=r[0]*n[3]-r[3]*n[0],s=r[1]*n[2]-r[2]*n[1],c=r[1]*n[3]-r[3]*n[1],u=r[2]*n[3]-r[3]*n[2],h=e[0],l=e[1],f=e[2],d=e[3];return t[0]=l*u-f*c+d*s,t[1]=-h*u+f*o-d*a,t[2]=h*c-l*o+d*i,t[3]=-h*s+l*a-f*i,t}function un(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}function hn(t,e){var r,n,i,a,o,s;e=e||1;do{o=(r=2*g()-1)*r+(n=2*g()-1)*n}while(o>=1);do{s=(i=2*g()-1)*i+(a=2*g()-1)*a}while(s>=1);var c=Math.sqrt((1-o)/s);return t[0]=e*r,t[1]=e*n,t[2]=e*i*c,t[3]=e*a*c,t}function ln(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}function fn(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],c=r[2],u=r[3],h=u*n+s*a-c*i,l=u*i+c*n-o*a,f=u*a+o*i-s*n,d=-o*n-s*i-c*a;return t[0]=h*u+d*-o+l*-c-f*-s,t[1]=l*u+d*-s+f*-o-h*-c,t[2]=f*u+d*-c+h*-s-l*-o,t[3]=e[3],t}function dn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function pn(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function gn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function mn(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],c=e[2],u=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-c)<=d*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(a-u)<=d*Math.max(1,Math.abs(a),Math.abs(u))}var vn=Yr,Mn=Hr,bn=Nr,yn=Kr,xn=tn,wn=en,Sn=rn,Pn=function(){var t=Tr();return function(e,r,n,i,a,o){var s,c;for(r||(r=4),n||(n=0),c=i?Math.min(i*r+n,e.length):e.length,s=n;sd?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r}function An(t,e){var r=ii(t,e);return Math.acos(2*r*r-1)}function Cn(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],c=r[1],u=r[2],h=r[3];return t[0]=n*h+o*s+i*u-a*c,t[1]=i*h+o*c+a*s-n*u,t[2]=a*h+o*u+n*c-i*s,t[3]=o*h-n*s-i*c-a*u,t}function Rn(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),c=Math.cos(r);return t[0]=n*c+o*s,t[1]=i*c+a*s,t[2]=a*c-i*s,t[3]=o*c-n*s,t}function kn(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),c=Math.cos(r);return t[0]=n*c-a*s,t[1]=i*c+o*s,t[2]=a*c+n*s,t[3]=o*c-i*s,t}function En(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),c=Math.cos(r);return t[0]=n*c+i*s,t[1]=i*c-n*s,t[2]=a*c+o*s,t[3]=o*c-a*s,t}function Fn(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function qn(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=Math.sqrt(r*r+n*n+i*i),s=Math.exp(a),c=o>0?s*Math.sin(o)/o:0;return t[0]=r*c,t[1]=n*c,t[2]=i*c,t[3]=s*Math.cos(o),t}function Ln(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=Math.sqrt(r*r+n*n+i*i),s=o>0?Math.atan2(o,a)/o:0;return t[0]=r*s,t[1]=n*s,t[2]=i*s,t[3]=.5*Math.log(r*r+n*n+i*i+a*a),t}function Tn(t,e,r){return Ln(t,e),ni(t,t,r),qn(t,t),t}function jn(t,e,r,n){var i,a,o,s,c,u=e[0],h=e[1],l=e[2],f=e[3],p=r[0],g=r[1],m=r[2],v=r[3];return(a=u*p+h*g+l*m+f*v)<0&&(a=-a,p=-p,g=-g,m=-m,v=-v),1-a>d?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,c=Math.sin(n*i)/o):(s=1-n,c=n),t[0]=s*u+c*p,t[1]=s*h+c*g,t[2]=s*l+c*m,t[3]=s*f+c*v,t}function Dn(t){var e=g(),r=g(),n=g(),i=Math.sqrt(1-e),a=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*r),t[1]=i*Math.cos(2*Math.PI*r),t[2]=a*Math.sin(2*Math.PI*n),t[3]=a*Math.cos(2*Math.PI*n),t}function zn(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=a*s,t}function Vn(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Un(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*a+o]-e[3*o+a])*r,t[a]=(e[3*a+i]+e[3*i+a])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t}function Yn(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var a=Math.sin(e),o=Math.cos(e),s=Math.sin(r),c=Math.cos(r),u=Math.sin(n),h=Math.cos(n);return t[0]=a*c*h-o*s*u,t[1]=o*s*h+a*c*u,t[2]=o*c*u-a*s*h,t[3]=o*c*h+a*s*u,t}function Hn(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var Nn,Zn,Xn,Gn,$n,Wn,Qn=jr,Jn=Dr,Kn=zr,ti=Vr,ei=Ur,ri=Cn,ni=Qr,ii=sn,ai=un,oi=en,si=oi,ci=rn,ui=ci,hi=on,li=gn,fi=mn,di=(Nn=Ue(),Zn=Ne(1,0,0),Xn=Ne(0,1,0),function(t,e,r){var n=lr(e,r);return n<-.999999?(fr(Nn,Zn,e),Fr(Nn)<1e-6&&fr(Nn,Xn,e),hr(Nn,Nn),On(t,Nn,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(fr(Nn,e,r),t[0]=Nn[0],t[1]=Nn[1],t[2]=Nn[2],t[3]=1+n,hi(t,t))}),pi=(Gn=_n(),$n=_n(),function(t,e,r,n,i,a){return jn(Gn,e,i,a),jn($n,r,n,a),jn(t,Gn,$n,2*a*(1-a)),t}),gi=(Wn=vt(),function(t,e,r,n){return Wn[0]=r[0],Wn[3]=r[1],Wn[6]=r[2],Wn[1]=n[0],Wn[4]=n[1],Wn[7]=n[2],Wn[2]=-e[0],Wn[5]=-e[1],Wn[8]=-e[2],hi(t,Un(t,Wn))});function mi(){var t=new p(8);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function vi(t){var e=new p(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function Mi(t,e,r,n,i,a,o,s){var c=new p(8);return c[0]=t,c[1]=e,c[2]=r,c[3]=n,c[4]=i,c[5]=a,c[6]=o,c[7]=s,c}function bi(t,e,r,n,i,a,o){var s=new p(8);s[0]=t,s[1]=e,s[2]=r,s[3]=n;var c=.5*i,u=.5*a,h=.5*o;return s[4]=c*n+u*r-h*e,s[5]=u*n+h*t-c*r,s[6]=h*n+c*e-u*t,s[7]=-c*t-u*e-h*r,s}function yi(t,e,r){var n=.5*r[0],i=.5*r[1],a=.5*r[2],o=e[0],s=e[1],c=e[2],u=e[3];return t[0]=o,t[1]=s,t[2]=c,t[3]=u,t[4]=n*u+i*c-a*s,t[5]=i*u+a*o-n*c,t[6]=a*u+n*s-i*o,t[7]=-n*o-i*s-a*c,t}function xi(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function wi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Si(t,e){var r=_n();we(r,e);var n=new p(3);return ye(n,e),yi(t,r,n),t}function Pi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function _i(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Ii(t,e,r,n,i,a,o,s,c){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t}var Oi=Kn;function Bi(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var Ai=Kn;function Ci(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function Ri(t,e){var r=e[4],n=e[5],i=e[6],a=e[7],o=-e[0],s=-e[1],c=-e[2],u=e[3];return t[0]=2*(r*u+a*o+n*c-i*s),t[1]=2*(n*u+a*s+i*o-r*c),t[2]=2*(i*u+a*c+r*s-n*o),t}function ki(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=.5*r[0],c=.5*r[1],u=.5*r[2],h=e[4],l=e[5],f=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=o*s+i*u-a*c+h,t[5]=o*c+a*s-n*u+l,t[6]=o*u+n*c-i*s+f,t[7]=-n*s-i*c-a*u+d,t}function Ei(t,e,r){var n=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],c=e[5],u=e[6],h=e[7],l=s*o+h*n+c*a-u*i,f=c*o+h*i+u*n-s*a,d=u*o+h*a+s*i-c*n,p=h*o-s*n-c*i-u*a;return Rn(t,e,r),n=t[0],i=t[1],a=t[2],o=t[3],t[4]=l*o+p*n+f*a-d*i,t[5]=f*o+p*i+d*n-l*a,t[6]=d*o+p*a+l*i-f*n,t[7]=p*o-l*n-f*i-d*a,t}function Fi(t,e,r){var n=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],c=e[5],u=e[6],h=e[7],l=s*o+h*n+c*a-u*i,f=c*o+h*i+u*n-s*a,d=u*o+h*a+s*i-c*n,p=h*o-s*n-c*i-u*a;return kn(t,e,r),n=t[0],i=t[1],a=t[2],o=t[3],t[4]=l*o+p*n+f*a-d*i,t[5]=f*o+p*i+d*n-l*a,t[6]=d*o+p*a+l*i-f*n,t[7]=p*o-l*n-f*i-d*a,t}function qi(t,e,r){var n=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],c=e[5],u=e[6],h=e[7],l=s*o+h*n+c*a-u*i,f=c*o+h*i+u*n-s*a,d=u*o+h*a+s*i-c*n,p=h*o-s*n-c*i-u*a;return En(t,e,r),n=t[0],i=t[1],a=t[2],o=t[3],t[4]=l*o+p*n+f*a-d*i,t[5]=f*o+p*i+d*n-l*a,t[6]=d*o+p*a+l*i-f*n,t[7]=p*o-l*n-f*i-d*a,t}function Li(t,e,r){var n=r[0],i=r[1],a=r[2],o=r[3],s=e[0],c=e[1],u=e[2],h=e[3];return t[0]=s*o+h*n+c*a-u*i,t[1]=c*o+h*i+u*n-s*a,t[2]=u*o+h*a+s*i-c*n,t[3]=h*o-s*n-c*i-u*a,s=e[4],c=e[5],u=e[6],h=e[7],t[4]=s*o+h*n+c*a-u*i,t[5]=c*o+h*i+u*n-s*a,t[6]=u*o+h*a+s*i-c*n,t[7]=h*o-s*n-c*i-u*a,t}function Ti(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],c=r[1],u=r[2],h=r[3];return t[0]=n*h+o*s+i*u-a*c,t[1]=i*h+o*c+a*s-n*u,t[2]=a*h+o*u+n*c-i*s,t[3]=o*h-n*s-i*c-a*u,s=r[4],c=r[5],u=r[6],h=r[7],t[4]=n*h+o*s+i*u-a*c,t[5]=i*h+o*c+a*s-n*u,t[6]=a*h+o*u+n*c-i*s,t[7]=o*h-n*s-i*c-a*u,t}function ji(t,e,r,n){if(Math.abs(n)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,a=e[2]/r,o=e[3]/r,s=e[4],c=e[5],u=e[6],h=e[7],l=n*s+i*c+a*u+o*h;t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=(s-n*l)/r,t[5]=(c-i*l)/r,t[6]=(u-a*l)/r,t[7]=(h-o*l)/r}return t}function Ji(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function Ki(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function ta(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],u=t[7],h=e[0],l=e[1],f=e[2],p=e[3],g=e[4],m=e[5],v=e[6],M=e[7];return Math.abs(r-h)<=d*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(n-l)<=d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-f)<=d*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(a-p)<=d*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(o-g)<=d*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(s-m)<=d*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(c-v)<=d*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(u-M)<=d*Math.max(1,Math.abs(u),Math.abs(M))}function ea(){var t=new p(2);return p!=Float32Array&&(t[0]=0,t[1]=0),t}function ra(t){var e=new p(2);return e[0]=t[0],e[1]=t[1],e}function na(t,e){var r=new p(2);return r[0]=t,r[1]=e,r}function ia(t,e){return t[0]=e[0],t[1]=e[1],t}function aa(t,e,r){return t[0]=e,t[1]=r,t}function oa(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function sa(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function ca(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function ua(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function ha(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function la(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function fa(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function da(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function pa(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function ga(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function ma(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function va(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function Ma(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function ba(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function ya(t){var e=t[0],r=t[1];return e*e+r*r}function xa(t,e){return t[0]=-e[0],t[1]=-e[1],t}function wa(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function Sa(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function Pa(t,e){return t[0]*e[0]+t[1]*e[1]}function _a(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function Ia(t,e,r,n){var i=e[0],a=e[1];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t}function Oa(t,e){e=e||1;var r=2*g()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function Ba(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function Aa(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function Ca(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function Ra(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function ka(t,e,r,n){var i=e[0]-r[0],a=e[1]-r[1],o=Math.sin(n),s=Math.cos(n);return t[0]=i*s-a*o+r[0],t[1]=i*o+a*s+r[1],t}function Ea(t,e){var r=t[0],n=t[1],i=e[0],a=e[1],o=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+a*a),s=o&&(r*i+n*a)/o;return Math.acos(Math.min(Math.max(s,-1),1))}function Fa(t){return t[0]=0,t[1]=0,t}function qa(t){return"vec2("+t[0]+", "+t[1]+")"}function La(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ta(t,e){var r=t[0],n=t[1],i=e[0],a=e[1];return Math.abs(r-i)<=d*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))}var ja=ba,Da=sa,za=ca,Va=ua,Ua=va,Ya=Ma,Ha=ya,Na=function(){var t=ea();return function(e,r,n,i,a,o){var s,c;for(r||(r=2),n||(n=0),c=i?Math.min(i*r+n,e.length):e.length,s=n;s{var n;!function(){"use strict";var i=.5*(Math.sqrt(3)-1),a=(3-Math.sqrt(3))/6,o=1/6,s=(Math.sqrt(5)-1)/4,c=(5-Math.sqrt(5))/20;function u(t){var e;e="function"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=l();t=i(" "),e=i(" "),r=i(" ");for(var a=0;a>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}u.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,o=this.permMod12,s=this.perm,c=this.grad3,u=0,h=0,l=0,f=(t+e)*i,d=Math.floor(t+f),p=Math.floor(e+f),g=(d+p)*a,m=t-(d-g),v=e-(p-g);m>v?(r=1,n=0):(r=0,n=1);var M=m-r+a,b=v-n+a,y=m-1+2*a,x=v-1+2*a,w=255&d,S=255&p,P=.5-m*m-v*v;if(P>=0){var _=3*o[w+s[S]];u=(P*=P)*P*(c[_]*m+c[_+1]*v)}var I=.5-M*M-b*b;if(I>=0){var O=3*o[w+r+s[S+n]];h=(I*=I)*I*(c[O]*M+c[O+1]*b)}var B=.5-y*y-x*x;if(B>=0){var A=3*o[w+1+s[S+1]];l=(B*=B)*B*(c[A]*y+c[A+1]*x)}return 70*(u+h+l)},noise3D:function(t,e,r){var n,i,a,s,c,u,h,l,f,d,p=this.permMod12,g=this.perm,m=this.grad3,v=.3333333333333333*(t+e+r),M=Math.floor(t+v),b=Math.floor(e+v),y=Math.floor(r+v),x=(M+b+y)*o,w=t-(M-x),S=e-(b-x),P=r-(y-x);w>=S?S>=P?(c=1,u=0,h=0,l=1,f=1,d=0):w>=P?(c=1,u=0,h=0,l=1,f=0,d=1):(c=0,u=0,h=1,l=1,f=0,d=1):Sk?q++:L++,R>E?q++:T++,R>F?q++:j++,k>E?L++:T++,k>F?L++:j++,E>F?T++:j++;var D=R-(l=q>=3?1:0)+c,z=k-(f=L>=3?1:0)+c,V=E-(d=T>=3?1:0)+c,U=F-(p=j>=3?1:0)+c,Y=R-(g=q>=2?1:0)+2*c,H=k-(m=L>=2?1:0)+2*c,N=E-(v=T>=2?1:0)+2*c,Z=F-(M=j>=2?1:0)+2*c,X=R-(b=q>=1?1:0)+3*c,G=k-(y=L>=1?1:0)+3*c,$=E-(x=T>=1?1:0)+3*c,W=F-(w=j>=1?1:0)+3*c,Q=R-1+4*c,J=k-1+4*c,K=E-1+4*c,tt=F-1+4*c,et=255&I,rt=255&O,nt=255&B,it=255&A,at=.6-R*R-k*k-E*E-F*F;if(at<0)i=0;else{var ot=S[et+S[rt+S[nt+S[it]]]]%32*4;i=(at*=at)*at*(P[ot]*R+P[ot+1]*k+P[ot+2]*E+P[ot+3]*F)}var st=.6-D*D-z*z-V*V-U*U;if(st<0)a=0;else{var ct=S[et+l+S[rt+f+S[nt+d+S[it+p]]]]%32*4;a=(st*=st)*st*(P[ct]*D+P[ct+1]*z+P[ct+2]*V+P[ct+3]*U)}var ut=.6-Y*Y-H*H-N*N-Z*Z;if(ut<0)o=0;else{var ht=S[et+g+S[rt+m+S[nt+v+S[it+M]]]]%32*4;o=(ut*=ut)*ut*(P[ht]*Y+P[ht+1]*H+P[ht+2]*N+P[ht+3]*Z)}var lt=.6-X*X-G*G-$*$-W*W;if(lt<0)u=0;else{var ft=S[et+b+S[rt+y+S[nt+x+S[it+w]]]]%32*4;u=(lt*=lt)*lt*(P[ft]*X+P[ft+1]*G+P[ft+2]*$+P[ft+3]*W)}var dt=.6-Q*Q-J*J-K*K-tt*tt;if(dt<0)h=0;else{var pt=S[et+1+S[rt+1+S[nt+1+S[it+1]]]]%32*4;h=(dt*=dt)*dt*(P[pt]*Q+P[pt+1]*J+P[pt+2]*K+P[pt+3]*tt)}return 27*(i+a+o+u+h)}},u._buildPermutationTable=h,void 0===(n=function(){return u}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=u,t.exports=u}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n].call(a.exports,a,a.exports,r),a.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(5174)})()})); \ No newline at end of file diff --git a/build/umd/urpflanze-light.min.js.LICENSE.txt b/build/umd/urpflanze-light.min.js.LICENSE.txt index cd9329a..b1d6200 100644 --- a/build/umd/urpflanze-light.min.js.LICENSE.txt +++ b/build/umd/urpflanze-light.min.js.LICENSE.txt @@ -1,5 +1,5 @@ /*! - * @license UrpflanzeJS v"1.0.2" + * @license UrpflanzeJS v"1.0.3" * urpflanze-light.min.js * * Github: https://github.com/urpflanze-org/urpflanze diff --git a/build/umd/urpflanze.js b/build/umd/urpflanze.js index 8da46dc..a17066c 100644 --- a/build/umd/urpflanze.js +++ b/build/umd/urpflanze.js @@ -1,5 +1,5 @@ /*! - * @license UrpflanzeJS v"1.0.2" + * @license UrpflanzeJS v"1.0.3" * urpflanze.js * * Github: https://github.com/urpflanze-org/urpflanze @@ -19,7 +19,26 @@ })(window, function() { return /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ([ -/* 0 */, +/* 0 */ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__webpack_require__(1), exports); +//# sourceMappingURL=index.js.map + +/***/ }), /* 1 */ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { @@ -38,7 +57,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SVGImporter = exports.SVGExporter = exports.GCODEExporter = exports.Timeline = exports.Renderer = exports.Color = void 0; __exportStar(__webpack_require__(2), exports); -__exportStar(__webpack_require__(2), exports); exports.Color = __webpack_require__(63); var cjs_1 = __webpack_require__(79); Object.defineProperty(exports, "Renderer", ({ enumerable: true, get: function () { return cjs_1.Renderer; } })); @@ -93,21 +111,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.mod = exports.log = exports.PI2 = exports.PHI = exports.Vec2 = exports.distributePointsInBuffer = exports.prepareBufferForInterpolation = exports.interpolate = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.now = exports.toRadians = exports.toDegrees = exports.relativeClamp = exports.clamp = exports.lerp = void 0; -/** - * Types & Interface - */ __exportStar(__webpack_require__(4), exports); -// Set glMatrixArrayType -const gl_matrix_1 = __webpack_require__(13); -gl_matrix_1.glMatrix.setMatrixArrayType(Array); -/** - * Core - */ -__exportStar(__webpack_require__(24), exports); -__exportStar(__webpack_require__(25), exports); -__exportStar(__webpack_require__(26), exports); -// Shapes -__exportStar(__webpack_require__(27), exports); +__exportStar(__webpack_require__(5), exports); +__exportStar(__webpack_require__(6), exports); +__exportStar(__webpack_require__(7), exports); __exportStar(__webpack_require__(36), exports); __exportStar(__webpack_require__(37), exports); __exportStar(__webpack_require__(38), exports); @@ -124,10 +131,8 @@ __exportStar(__webpack_require__(47), exports); __exportStar(__webpack_require__(48), exports); __exportStar(__webpack_require__(49), exports); __exportStar(__webpack_require__(50), exports); -// Modifiers __exportStar(__webpack_require__(32), exports); __exportStar(__webpack_require__(51), exports); -// Utilities var Utilities_1 = __webpack_require__(33); Object.defineProperty(exports, "lerp", ({ enumerable: true, get: function () { return Utilities_1.lerp; } })); Object.defineProperty(exports, "clamp", ({ enumerable: true, get: function () { return Utilities_1.clamp; } })); @@ -150,7991 +155,571 @@ Object.defineProperty(exports, "PHI", ({ enumerable: true, get: function () { re Object.defineProperty(exports, "PI2", ({ enumerable: true, get: function () { return math_1.PI2; } })); Object.defineProperty(exports, "log", ({ enumerable: true, get: function () { return math_1.log; } })); Object.defineProperty(exports, "mod", ({ enumerable: true, get: function () { return math_1.mod; } })); -//# sourceMappingURL=index.js.map +//# sourceMappingURL=core.js.map /***/ }), /* 4 */ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__webpack_require__(5), exports); -__exportStar(__webpack_require__(6), exports); -__exportStar(__webpack_require__(7), exports); -__exportStar(__webpack_require__(8), exports); -__exportStar(__webpack_require__(9), exports); -__exportStar(__webpack_require__(10), exports); -__exportStar(__webpack_require__(11), exports); -__exportStar(__webpack_require__(12), exports); -//# sourceMappingURL=index.js.map - -/***/ }), -/* 5 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=indexedBuffer.js.map - -/***/ }), -/* 6 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=propArguments.js.map - -/***/ }), -/* 7 */ -/***/ ((__unused_webpack_module, exports) => { +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ERepetitionType = void 0; +exports.Scene = void 0; +const SceneChild_1 = __webpack_require__(5); +const Group_1 = __webpack_require__(6); +const Shape_1 = __webpack_require__(35); +const Utilities_1 = __webpack_require__(33); /** - * Repetition type enumerator. + * Container for all SceneChild. + * The main purpose is to manage the drawing order and update the child buffers * - * @category Core.Repetition - * @internal + * @order 1 + * @category Core.Scene + * @class Scene */ -var ERepetitionType; -(function (ERepetitionType) { +class Scene { /** - * Defines the type of repetition of the shape, - * in a circular way starting from the center of the scene - * @order 1 + * Creates an instance of Scene. + * You can see the default values in the property definitions */ - ERepetitionType[ERepetitionType["Ring"] = 1] = "Ring"; + constructor(settings = {}) { + /** + * Logical number, the drawer will take care of defining the unit of measure + */ + this.width = 400; + /** + * Logical number, the drawer will take care of defining the unit of measure + */ + this.height = 400; + /** + * Default background color (black) + */ + this.background = 'hsla(0, 0%, 0%, 1)'; + /** + * Default ScenePrimitive stroke color (white) + */ + this.color = 'hsla(0, 0%, 100%, 1)'; + /** + * Current time + */ + this.currentTime = 0; + if (typeof settings.width !== 'undefined') + this.width = settings.width; + if (typeof settings.height !== 'undefined') + this.height = settings.height; + if (typeof settings.background !== 'undefined') + this.background = settings.background; + if (typeof settings.color !== 'undefined') + this.color = settings.color; + this.children = []; + this.center = [this.width / 2, this.height / 2]; + this.anchor = + settings.anchor && Array.isArray(settings.anchor) + ? [ + typeof settings.anchor[0] === 'number' + ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[0]) * 0.5) * this.width + : settings.anchor[0] === 'left' + ? 0 + : settings.anchor[0] === 'right' + ? this.width + : this.center[0], + typeof settings.anchor[1] === 'number' + ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[1]) * 0.5) * this.height + : settings.anchor[1] === 'top' + ? 0 + : settings.anchor[1] === 'bottom' + ? this.height + : this.center[1], + ] + : [this.center[0], this.center[1]]; + } /** - * Defines the type of repetition of the shape, - * on a nxm grid starting from the center of the scene - * @order 2 + * Return width percentage + * + * @param {number} [percentage=100] + * @returns {number} */ - ERepetitionType[ERepetitionType["Matrix"] = 2] = "Matrix"; -})(ERepetitionType = exports.ERepetitionType || (exports.ERepetitionType = {})); -//# sourceMappingURL=repetitions.js.map - -/***/ }), -/* 8 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=scene-child.js.map - -/***/ }), -/* 9 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=scene.js.map - -/***/ }), -/* 10 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EBoundingType = void 0; -var EBoundingType; -(function (EBoundingType) { + getWidth(percentage = 100) { + return (this.width * percentage) / 100; + } /** - * Relative to the real bounding of the shape - * @order 2 + * Return height percentage + * + * @param {number} [percentage=100] + * @returns {number} */ - EBoundingType[EBoundingType["Relative"] = 1] = "Relative"; + getHeight(percentage = 100) { + return (this.height * percentage) / 100; + } /** - * Fixed to te width and height of the shape - * @order 3 + * Resize the scene size + * + * @param {number} width + * @param {number} [height=width] + * @memberof Scene */ - EBoundingType[EBoundingType["Fixed"] = 2] = "Fixed"; -})(EBoundingType = exports.EBoundingType || (exports.EBoundingType = {})); -//# sourceMappingURL=shape-base.js.map - -/***/ }), -/* 11 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -////// -//# sourceMappingURL=shape-primitives.js.map - -/***/ }), -/* 12 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -// Shape -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=shapes.js.map - -/***/ }), -/* 13 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "glMatrix": () => (/* reexport module object */ _common_js__WEBPACK_IMPORTED_MODULE_0__), -/* harmony export */ "mat2": () => (/* reexport module object */ _mat2_js__WEBPACK_IMPORTED_MODULE_1__), -/* harmony export */ "mat2d": () => (/* reexport module object */ _mat2d_js__WEBPACK_IMPORTED_MODULE_2__), -/* harmony export */ "mat3": () => (/* reexport module object */ _mat3_js__WEBPACK_IMPORTED_MODULE_3__), -/* harmony export */ "mat4": () => (/* reexport module object */ _mat4_js__WEBPACK_IMPORTED_MODULE_4__), -/* harmony export */ "quat": () => (/* reexport module object */ _quat_js__WEBPACK_IMPORTED_MODULE_5__), -/* harmony export */ "quat2": () => (/* reexport module object */ _quat2_js__WEBPACK_IMPORTED_MODULE_6__), -/* harmony export */ "vec2": () => (/* reexport module object */ _vec2_js__WEBPACK_IMPORTED_MODULE_7__), -/* harmony export */ "vec3": () => (/* reexport module object */ _vec3_js__WEBPACK_IMPORTED_MODULE_8__), -/* harmony export */ "vec4": () => (/* reexport module object */ _vec4_js__WEBPACK_IMPORTED_MODULE_9__) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); -/* harmony import */ var _mat2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15); -/* harmony import */ var _mat2d_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16); -/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17); -/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(18); -/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(19); -/* harmony import */ var _quat2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(22); -/* harmony import */ var _vec2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(23); -/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(21); -/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(20); - - - - - - - - - - - + resize(width, height = width) { + this.width = width; + this.height = height; + this.center = [this.width / 2, this.height / 2]; + const anchor = [this.width / this.anchor[0], this.height / this.anchor[1]]; + this.anchor = [this.width / anchor[0], this.height / anchor[1]]; + this.children.forEach(sceneChild => sceneChild.clearBuffer(true, false)); + } + /** + * Update all children, generate a streamable buffer for drawing + * + * @param {number} [atTime] time in ms + * @memberof Scene + */ + update(atTime = 0) { + this.currentTime = atTime; + for (let i = 0, len = this.children.length; i < len; i++) { + this.children[i].generate(this.currentTime, true); + } + } + /** + * Traverse the child buffer and use it with callback + * + * @param {(streamArguments: IStreamArguments) => void} callback + * @memberof Scene + */ + stream(callback) { + this.children.forEach(sceneChild => sceneChild.stream(callback)); + } + /* + |-------------------------------------------------------------------------- + | SceneChild + |-------------------------------------------------------------------------- + */ + /** + * Return a list of children + * + * @returns {Array} + * @memberof Scene + */ + getChildren() { + return this.children; + } + /** + * Add SceneChild to Scene, pass `order` as last parameter for drawing priorities + * + * @param {Array} items + * @param {number} [order] + * @memberof Scene + */ + add(...items /**, order: number */) { + const order = typeof items[items.length - 1] === 'number' ? items[items.length - 1] : undefined; + const len = items.length - (typeof order === 'undefined' ? 0 : 1); + for (let i = 0; i < len; i++) { + const item = items[i]; + item.order = + typeof order !== 'undefined' + ? order + i + : typeof item.order !== 'undefined' + ? item.order + : this.children.length > 0 + ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1 + : 0; + Scene.propagateToChilden(item, this); + this.children.push(item); + item.clearBuffer(true, false); + item.generate(0, true); + } + this.sortChildren(); + } + /** + * Sort children by order + * + * @memberof Scene + */ + sortChildren() { + this.children.sort((a, b) => a.order - b.order); + this.children = this.children.map((child, index) => { + child.order = index; + return child; + }); + } + /** + * Find sceneChild from id or name in the whole scene + * + * @param {string | number} idOrName + * @returns {(SceneChild | null)} + * @memberof Scene + */ + find(idOrName) { + const children = this.getChildren(); + for (let i = 0, len = children.length; i < len; i++) { + const result = children[i].find(idOrName); + if (result !== null) + return result; + } + return null; + } + /** + * Get shape by index + * + * @param {number} index + * @returns {(SceneChild | null)} + * @memberof Scene + */ + get(index) { + return index >= 0 && index < this.children.length ? this.children[index] : null; + } + /** + * Remove a shape by index + * + * @param {number} index + * @memberof Scene + */ + remove(index) { + index >= 0 && index < this.children.length && this.children.splice(index, 1); + } + /** + * Removes all children + * + * @memberof Scene + */ + removeChildren() { + this.children = []; + } + /** + * Remove sceneChild by id or name + * + * @param {number | number} idOrName + * @memberof Scene + */ + removeFromId(idOrName) { + for (let i = 0, len = this.children.length; i < len; i++) + if (this.children[i].id === idOrName || this.children[i].name === idOrName) { + this.children.splice(i, 1); + return; + } + } + /** + * Return true if sceneChild is direct children + * + * @param {SceneChild} sceneChild + * @returns {boolean} + * @memberof Scene + */ + isFirstLevelChild(sceneChild) { + for (let i = 0, len = this.children.length; i < len; i++) + if (this.children[i].id === sceneChild.id) + return true; + const parents = this.getParentsOfSceneChild(sceneChild); + return parents.length === 1 && parents[0] instanceof Group_1.Group; + } + /** + * Returns the list of sceneChild hierarchy starting from the scene + * + * @param {SceneChild} sceneChild + * @returns {Array} + * @memberof Scene + */ + getParentsOfSceneChild(sceneChild) { + const result = Scene.getParentsOfSceneChild(this, sceneChild); + if (result) { + result.splice(0, 1); + return result; + } + return []; + } + /** + * Returns the list of sceneChild hierarchy starting from the scene + * + * @static + * @param {(Scene | SceneChild)} current + * @param {SceneChild} sceneChild + * @param {(Array)} [parents=[]] + * @returns {(Array | null)} + * @memberof Scene + */ + static getParentsOfSceneChild(current, sceneChild, parents = []) { + let result; + if (current instanceof SceneChild_1.SceneChild) { + if (current.id == sceneChild.id) + return parents; + if (current instanceof Shape_1.Shape && current.shape) { + const tmpParents = parents.slice(); + tmpParents.push(current); + if ((result = Scene.getParentsOfSceneChild(current.shape, sceneChild, tmpParents))) + return result; + } + } + if (current instanceof Scene || current instanceof Group_1.Group) { + const children = current.getChildren(); + parents.push(current); + for (let i = 0, len = children.length; i < len; i++) { + const child = children[i]; + if ((result = Scene.getParentsOfSceneChild(child, sceneChild, parents))) + return result; + } + parents.pop(); + } + return null; + } + /** + * Walk through the scene + * + * @static + * @param {SceneChild} callbackk + * @param {(Scene | SceneChild)} current + * @memberof Scene + */ + static walk(callback, current) { + if (current instanceof SceneChild_1.SceneChild) { + if (callback(current) === false) + return false; + if (current instanceof Shape_1.Shape && current.shape) + if (Scene.walk(callback, current.shape) === false) + return false; + } + if (current instanceof Scene || current instanceof Group_1.Group) { + const children = current.getChildren(); + for (let i = 0, len = children.length; i < len; i++) { + const child = children[i]; + if (Scene.walk(callback, child) === false) + return false; + } + } + } + /** + * Propagate scene to sceneChild (and children) + * + * @static + * @param {SceneChild} sceneChild + * @param {Scene} scene + * @memberof Scene + */ + static propagateToChilden(sceneChild, scene) { + sceneChild.scene = scene; + if (sceneChild instanceof Group_1.Group) { + sceneChild.getChildren().forEach((item) => { + Scene.propagateToChilden(item, scene); + }); + } + else if (sceneChild instanceof Shape_1.Shape && sceneChild.shape) { + sceneChild.shape.scene = scene; + Scene.propagateToChilden(sceneChild.shape, scene); + } + } +} +exports.Scene = Scene; +//# sourceMappingURL=Scene.js.map /***/ }), -/* 14 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/* 5 */ +/***/ ((__unused_webpack_module, exports) => { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "EPSILON": () => (/* binding */ EPSILON), -/* harmony export */ "ARRAY_TYPE": () => (/* binding */ ARRAY_TYPE), -/* harmony export */ "RANDOM": () => (/* binding */ RANDOM), -/* harmony export */ "setMatrixArrayType": () => (/* binding */ setMatrixArrayType), -/* harmony export */ "toRadian": () => (/* binding */ toRadian), -/* harmony export */ "equals": () => (/* binding */ equals) -/* harmony export */ }); -/** - * Common utilities - * @module glMatrix - */ -// Configuration Constants -var EPSILON = 0.000001; -var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array; -var RANDOM = Math.random; -/** - * Sets the type of array used when creating new vectors and matrices - * - * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array - */ -function setMatrixArrayType(type) { - ARRAY_TYPE = type; -} -var degree = Math.PI / 180; -/** - * Convert Degree To Radian - * - * @param {Number} a Angle in Degrees +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SceneChild = void 0; +/** + * Autoincrement sceneChild default id + * + * @internal + * @ignore */ - -function toRadian(a) { - return a * degree; -} -/** - * Tests whether or not the arguments have approximately the same value, within an absolute - * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less - * than or equal to 1.0, and a relative tolerance is used for larger values) - * - * @param {Number} a The first number to test. - * @param {Number} b The second number to test. - * @returns {Boolean} True if the numbers are approximately equal, false otherwise. +let __id = 0; +/** + * The element to be added into a scene. + * Preserve props, drawing order, generate and return buffers. + * The only implementations of this class are Group and ShapeBase + * + * @abstract + * @category Core.Abstract + * @order 2 + * @class SceneChild */ - -function equals(a, b) { - return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b)); +class SceneChild { + /** + * Creates an instance of SceneChild. + * Base values will be assigned in case they are not passed + * + * @param {ISceneChildSettings} settings + */ + constructor(settings) { + var _a; + /** + * Shape generation id + * used for prevent buffer calculation + * + * @internal + * @ignore + */ + this.generateId = -1; + this.id = (_a = settings.id) !== null && _a !== void 0 ? _a : ++__id; + this.type = settings.type || 'SceneChild'; + this.name = settings.name || this.type + '_' + this.id; + this.data = settings.data || {}; + this.props = {}; + } + /** + * Find this or form or children. + * Overridden by classes that extend it + * + * @param {string | number} idOrName + * @returns {(SceneChild | null)} + */ + find(idOrName) { + if (this.id === idOrName || this.name === idOrName) + return this; + return null; + } + /** + * Return the sceneChild properties + * + * @returns {Props} + */ + getProps() { + return this.props; + } + /** + * Return a sceneChild prop or default value + * + * @param {keyof Props} key + * @param {PropArguments} [propArguments] + * @param {*} [defaultValue] + * @returns {*} + */ + getProp(key, propArguments, defaultValue) { + var _a; + return ((_a = this.props[key]) !== null && _a !== void 0 ? _a : defaultValue); + } + /** + * Check SceneChild has prop + * + * @param {keyof Props} key + * @returns + */ + hasProp(key) { + return typeof this.props[key] !== 'undefined'; + } + /** + * Set a single or multiple props + * + * @param {(keyof ISceneChildProps | ISceneChildProps)} key + * @param {*} [value] + */ + setPropUnsafe(key, value) { + if (typeof key == 'string') + this.props[key] = value; + else + Object.keys(key).forEach((k) => (this.props[k] = key[k])); + } } -if (!Math.hypot) Math.hypot = function () { - var y = 0, - i = arguments.length; - - while (i--) { - y += arguments[i] * arguments[i]; - } - - return Math.sqrt(y); -}; +exports.SceneChild = SceneChild; +//# sourceMappingURL=SceneChild.js.map /***/ }), -/* 15 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/* 6 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "transpose": () => (/* binding */ transpose), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "adjoint": () => (/* binding */ adjoint), -/* harmony export */ "determinant": () => (/* binding */ determinant), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "rotate": () => (/* binding */ rotate), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), -/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "frob": () => (/* binding */ frob), -/* harmony export */ "LDU": () => (/* binding */ LDU), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), -/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "sub": () => (/* binding */ sub) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); - -/** - * 2x2 Matrix - * @module mat2 - */ - -/** - * Creates a new identity mat2 - * - * @returns {mat2} a new 2x2 matrix - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[1] = 0; - out[2] = 0; - } - - out[0] = 1; - out[3] = 1; - return out; -} -/** - * Creates a new mat2 initialized with values from an existing matrix - * - * @param {ReadonlyMat2} a matrix to clone - * @returns {mat2} a new 2x2 matrix - */ -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - return out; -} -/** - * Copy the values from one mat2 to another - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the source matrix - * @returns {mat2} out +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Group = void 0; +const Scene_1 = __webpack_require__(4); +const SceneChild_1 = __webpack_require__(5); +const ShapeBase_1 = __webpack_require__(7); +const Adapt_1 = __webpack_require__(31); +/** + * A SceneChild container, propagates properties to children + * + * @order 3 + * @category Core.Scene + * @extends {SceneChild} + * @example + * ```javascript + * // Group example + * + * const rect = new Urpflanze.Rect({ + * distance: 100 // <- if a property is set the group will not overwrite it + * }) + * const group = new Urpflanze.Group({ + * repetitions: 3, + * distance: 200 + * }) + * + * group.add(rect) + * group.add(new Urpflanze.Triangle()) + * ``` + * @class Group */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - return out; -} -/** - * Set a mat2 to the identity matrix - * - * @param {mat2} out the receiving matrix - * @returns {mat2} out - */ - -function identity(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 1; - return out; -} -/** - * Create a new mat2 with the given values - * - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m10 Component in column 1, row 0 position (index 2) - * @param {Number} m11 Component in column 1, row 1 position (index 3) - * @returns {mat2} out A new 2x2 matrix - */ - -function fromValues(m00, m01, m10, m11) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - out[0] = m00; - out[1] = m01; - out[2] = m10; - out[3] = m11; - return out; -} -/** - * Set the components of a mat2 to the given values - * - * @param {mat2} out the receiving matrix - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m10 Component in column 1, row 0 position (index 2) - * @param {Number} m11 Component in column 1, row 1 position (index 3) - * @returns {mat2} out - */ - -function set(out, m00, m01, m10, m11) { - out[0] = m00; - out[1] = m01; - out[2] = m10; - out[3] = m11; - return out; -} -/** - * Transpose the values of a mat2 - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the source matrix - * @returns {mat2} out - */ - -function transpose(out, a) { - // If we are transposing ourselves we can skip a few steps but have to cache - // some values - if (out === a) { - var a1 = a[1]; - out[1] = a[2]; - out[2] = a1; - } else { - out[0] = a[0]; - out[1] = a[2]; - out[2] = a[1]; - out[3] = a[3]; - } - - return out; -} -/** - * Inverts a mat2 - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the source matrix - * @returns {mat2} out - */ - -function invert(out, a) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; // Calculate the determinant - - var det = a0 * a3 - a2 * a1; - - if (!det) { - return null; - } - - det = 1.0 / det; - out[0] = a3 * det; - out[1] = -a1 * det; - out[2] = -a2 * det; - out[3] = a0 * det; - return out; -} -/** - * Calculates the adjugate of a mat2 - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the source matrix - * @returns {mat2} out - */ - -function adjoint(out, a) { - // Caching this value is nessecary if out == a - var a0 = a[0]; - out[0] = a[3]; - out[1] = -a[1]; - out[2] = -a[2]; - out[3] = a0; - return out; -} -/** - * Calculates the determinant of a mat2 - * - * @param {ReadonlyMat2} a the source matrix - * @returns {Number} determinant of a - */ - -function determinant(a) { - return a[0] * a[3] - a[2] * a[1]; -} -/** - * Multiplies two mat2's - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the first operand - * @param {ReadonlyMat2} b the second operand - * @returns {mat2} out - */ - -function multiply(out, a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3]; - out[0] = a0 * b0 + a2 * b1; - out[1] = a1 * b0 + a3 * b1; - out[2] = a0 * b2 + a2 * b3; - out[3] = a1 * b2 + a3 * b3; - return out; -} -/** - * Rotates a mat2 by the given angle - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat2} out - */ - -function rotate(out, a, rad) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var s = Math.sin(rad); - var c = Math.cos(rad); - out[0] = a0 * c + a2 * s; - out[1] = a1 * c + a3 * s; - out[2] = a0 * -s + a2 * c; - out[3] = a1 * -s + a3 * c; - return out; -} -/** - * Scales the mat2 by the dimensions in the given vec2 - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the matrix to rotate - * @param {ReadonlyVec2} v the vec2 to scale the matrix by - * @returns {mat2} out - **/ - -function scale(out, a, v) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var v0 = v[0], - v1 = v[1]; - out[0] = a0 * v0; - out[1] = a1 * v0; - out[2] = a2 * v1; - out[3] = a3 * v1; - return out; -} -/** - * Creates a matrix from a given angle - * This is equivalent to (but much faster than): - * - * mat2.identity(dest); - * mat2.rotate(dest, dest, rad); - * - * @param {mat2} out mat2 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat2} out - */ - -function fromRotation(out, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); - out[0] = c; - out[1] = s; - out[2] = -s; - out[3] = c; - return out; -} -/** - * Creates a matrix from a vector scaling - * This is equivalent to (but much faster than): - * - * mat2.identity(dest); - * mat2.scale(dest, dest, vec); - * - * @param {mat2} out mat2 receiving operation result - * @param {ReadonlyVec2} v Scaling vector - * @returns {mat2} out - */ - -function fromScaling(out, v) { - out[0] = v[0]; - out[1] = 0; - out[2] = 0; - out[3] = v[1]; - return out; -} -/** - * Returns a string representation of a mat2 - * - * @param {ReadonlyMat2} a matrix to represent as a string - * @returns {String} string representation of the matrix - */ - -function str(a) { - return "mat2(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; -} -/** - * Returns Frobenius norm of a mat2 - * - * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of - * @returns {Number} Frobenius norm - */ - -function frob(a) { - return Math.hypot(a[0], a[1], a[2], a[3]); -} -/** - * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix - * @param {ReadonlyMat2} L the lower triangular matrix - * @param {ReadonlyMat2} D the diagonal matrix - * @param {ReadonlyMat2} U the upper triangular matrix - * @param {ReadonlyMat2} a the input matrix to factorize - */ - -function LDU(L, D, U, a) { - L[2] = a[2] / a[0]; - U[0] = a[0]; - U[1] = a[1]; - U[3] = a[3] - L[2] * U[1]; - return [L, D, U]; -} -/** - * Adds two mat2's - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the first operand - * @param {ReadonlyMat2} b the second operand - * @returns {mat2} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - return out; -} -/** - * Subtracts matrix b from matrix a - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the first operand - * @param {ReadonlyMat2} b the second operand - * @returns {mat2} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - out[3] = a[3] - b[3]; - return out; -} -/** - * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyMat2} a The first matrix. - * @param {ReadonlyMat2} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; -} -/** - * Returns whether or not the matrices have approximately the same elements in the same position. - * - * @param {ReadonlyMat2} a The first matrix. - * @param {ReadonlyMat2} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)); -} -/** - * Multiply each element of the matrix by a scalar. - * - * @param {mat2} out the receiving matrix - * @param {ReadonlyMat2} a the matrix to scale - * @param {Number} b amount to scale the matrix's elements by - * @returns {mat2} out - */ - -function multiplyScalar(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - return out; -} -/** - * Adds two mat2's after multiplying each element of the second operand by a scalar value. - * - * @param {mat2} out the receiving vector - * @param {ReadonlyMat2} a the first operand - * @param {ReadonlyMat2} b the second operand - * @param {Number} scale the amount to scale b's elements by before adding - * @returns {mat2} out - */ - -function multiplyScalarAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - out[3] = a[3] + b[3] * scale; - return out; -} -/** - * Alias for {@link mat2.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link mat2.subtract} - * @function - */ - -var sub = subtract; - -/***/ }), -/* 16 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "determinant": () => (/* binding */ determinant), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "rotate": () => (/* binding */ rotate), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "translate": () => (/* binding */ translate), -/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), -/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), -/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "frob": () => (/* binding */ frob), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), -/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "sub": () => (/* binding */ sub) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); - -/** - * 2x3 Matrix - * @module mat2d - * @description - * A mat2d contains six elements defined as: - *
- * [a, b,
- *  c, d,
- *  tx, ty]
- * 
- * This is a short form for the 3x3 matrix: - *
- * [a, b, 0,
- *  c, d, 0,
- *  tx, ty, 1]
- * 
- * The last column is ignored so the array is shorter and operations are faster. - */ - -/** - * Creates a new identity mat2d - * - * @returns {mat2d} a new 2x3 matrix - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[1] = 0; - out[2] = 0; - out[4] = 0; - out[5] = 0; - } - - out[0] = 1; - out[3] = 1; - return out; -} -/** - * Creates a new mat2d initialized with values from an existing matrix - * - * @param {ReadonlyMat2d} a matrix to clone - * @returns {mat2d} a new 2x3 matrix - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - return out; -} -/** - * Copy the values from one mat2d to another - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the source matrix - * @returns {mat2d} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - return out; -} -/** - * Set a mat2d to the identity matrix - * - * @param {mat2d} out the receiving matrix - * @returns {mat2d} out - */ - -function identity(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 1; - out[4] = 0; - out[5] = 0; - return out; -} -/** - * Create a new mat2d with the given values - * - * @param {Number} a Component A (index 0) - * @param {Number} b Component B (index 1) - * @param {Number} c Component C (index 2) - * @param {Number} d Component D (index 3) - * @param {Number} tx Component TX (index 4) - * @param {Number} ty Component TY (index 5) - * @returns {mat2d} A new mat2d - */ - -function fromValues(a, b, c, d, tx, ty) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); - out[0] = a; - out[1] = b; - out[2] = c; - out[3] = d; - out[4] = tx; - out[5] = ty; - return out; -} -/** - * Set the components of a mat2d to the given values - * - * @param {mat2d} out the receiving matrix - * @param {Number} a Component A (index 0) - * @param {Number} b Component B (index 1) - * @param {Number} c Component C (index 2) - * @param {Number} d Component D (index 3) - * @param {Number} tx Component TX (index 4) - * @param {Number} ty Component TY (index 5) - * @returns {mat2d} out - */ - -function set(out, a, b, c, d, tx, ty) { - out[0] = a; - out[1] = b; - out[2] = c; - out[3] = d; - out[4] = tx; - out[5] = ty; - return out; -} -/** - * Inverts a mat2d - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the source matrix - * @returns {mat2d} out - */ - -function invert(out, a) { - var aa = a[0], - ab = a[1], - ac = a[2], - ad = a[3]; - var atx = a[4], - aty = a[5]; - var det = aa * ad - ab * ac; - - if (!det) { - return null; - } - - det = 1.0 / det; - out[0] = ad * det; - out[1] = -ab * det; - out[2] = -ac * det; - out[3] = aa * det; - out[4] = (ac * aty - ad * atx) * det; - out[5] = (ab * atx - aa * aty) * det; - return out; -} -/** - * Calculates the determinant of a mat2d - * - * @param {ReadonlyMat2d} a the source matrix - * @returns {Number} determinant of a - */ - -function determinant(a) { - return a[0] * a[3] - a[1] * a[2]; -} -/** - * Multiplies two mat2d's - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the first operand - * @param {ReadonlyMat2d} b the second operand - * @returns {mat2d} out - */ - -function multiply(out, a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3], - b4 = b[4], - b5 = b[5]; - out[0] = a0 * b0 + a2 * b1; - out[1] = a1 * b0 + a3 * b1; - out[2] = a0 * b2 + a2 * b3; - out[3] = a1 * b2 + a3 * b3; - out[4] = a0 * b4 + a2 * b5 + a4; - out[5] = a1 * b4 + a3 * b5 + a5; - return out; -} -/** - * Rotates a mat2d by the given angle - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat2d} out - */ - -function rotate(out, a, rad) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5]; - var s = Math.sin(rad); - var c = Math.cos(rad); - out[0] = a0 * c + a2 * s; - out[1] = a1 * c + a3 * s; - out[2] = a0 * -s + a2 * c; - out[3] = a1 * -s + a3 * c; - out[4] = a4; - out[5] = a5; - return out; -} -/** - * Scales the mat2d by the dimensions in the given vec2 - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the matrix to translate - * @param {ReadonlyVec2} v the vec2 to scale the matrix by - * @returns {mat2d} out - **/ - -function scale(out, a, v) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5]; - var v0 = v[0], - v1 = v[1]; - out[0] = a0 * v0; - out[1] = a1 * v0; - out[2] = a2 * v1; - out[3] = a3 * v1; - out[4] = a4; - out[5] = a5; - return out; -} -/** - * Translates the mat2d by the dimensions in the given vec2 - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the matrix to translate - * @param {ReadonlyVec2} v the vec2 to translate the matrix by - * @returns {mat2d} out - **/ - -function translate(out, a, v) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5]; - var v0 = v[0], - v1 = v[1]; - out[0] = a0; - out[1] = a1; - out[2] = a2; - out[3] = a3; - out[4] = a0 * v0 + a2 * v1 + a4; - out[5] = a1 * v0 + a3 * v1 + a5; - return out; -} -/** - * Creates a matrix from a given angle - * This is equivalent to (but much faster than): - * - * mat2d.identity(dest); - * mat2d.rotate(dest, dest, rad); - * - * @param {mat2d} out mat2d receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat2d} out - */ - -function fromRotation(out, rad) { - var s = Math.sin(rad), - c = Math.cos(rad); - out[0] = c; - out[1] = s; - out[2] = -s; - out[3] = c; - out[4] = 0; - out[5] = 0; - return out; -} -/** - * Creates a matrix from a vector scaling - * This is equivalent to (but much faster than): - * - * mat2d.identity(dest); - * mat2d.scale(dest, dest, vec); - * - * @param {mat2d} out mat2d receiving operation result - * @param {ReadonlyVec2} v Scaling vector - * @returns {mat2d} out - */ - -function fromScaling(out, v) { - out[0] = v[0]; - out[1] = 0; - out[2] = 0; - out[3] = v[1]; - out[4] = 0; - out[5] = 0; - return out; -} -/** - * Creates a matrix from a vector translation - * This is equivalent to (but much faster than): - * - * mat2d.identity(dest); - * mat2d.translate(dest, dest, vec); - * - * @param {mat2d} out mat2d receiving operation result - * @param {ReadonlyVec2} v Translation vector - * @returns {mat2d} out - */ - -function fromTranslation(out, v) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 1; - out[4] = v[0]; - out[5] = v[1]; - return out; -} -/** - * Returns a string representation of a mat2d - * - * @param {ReadonlyMat2d} a matrix to represent as a string - * @returns {String} string representation of the matrix - */ - -function str(a) { - return "mat2d(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ")"; -} -/** - * Returns Frobenius norm of a mat2d - * - * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of - * @returns {Number} Frobenius norm - */ - -function frob(a) { - return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1); -} -/** - * Adds two mat2d's - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the first operand - * @param {ReadonlyMat2d} b the second operand - * @returns {mat2d} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - out[4] = a[4] + b[4]; - out[5] = a[5] + b[5]; - return out; -} -/** - * Subtracts matrix b from matrix a - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the first operand - * @param {ReadonlyMat2d} b the second operand - * @returns {mat2d} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - out[3] = a[3] - b[3]; - out[4] = a[4] - b[4]; - out[5] = a[5] - b[5]; - return out; -} -/** - * Multiply each element of the matrix by a scalar. - * - * @param {mat2d} out the receiving matrix - * @param {ReadonlyMat2d} a the matrix to scale - * @param {Number} b amount to scale the matrix's elements by - * @returns {mat2d} out - */ - -function multiplyScalar(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - out[4] = a[4] * b; - out[5] = a[5] * b; - return out; -} -/** - * Adds two mat2d's after multiplying each element of the second operand by a scalar value. - * - * @param {mat2d} out the receiving vector - * @param {ReadonlyMat2d} a the first operand - * @param {ReadonlyMat2d} b the second operand - * @param {Number} scale the amount to scale b's elements by before adding - * @returns {mat2d} out - */ - -function multiplyScalarAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - out[3] = a[3] + b[3] * scale; - out[4] = a[4] + b[4] * scale; - out[5] = a[5] + b[5] * scale; - return out; -} -/** - * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyMat2d} a The first matrix. - * @param {ReadonlyMat2d} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5]; -} -/** - * Returns whether or not the matrices have approximately the same elements in the same position. - * - * @param {ReadonlyMat2d} a The first matrix. - * @param {ReadonlyMat2d} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3], - b4 = b[4], - b5 = b[5]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)); -} -/** - * Alias for {@link mat2d.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link mat2d.subtract} - * @function - */ - -var sub = subtract; - -/***/ }), -/* 17 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "fromMat4": () => (/* binding */ fromMat4), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "transpose": () => (/* binding */ transpose), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "adjoint": () => (/* binding */ adjoint), -/* harmony export */ "determinant": () => (/* binding */ determinant), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "translate": () => (/* binding */ translate), -/* harmony export */ "rotate": () => (/* binding */ rotate), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), -/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), -/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), -/* harmony export */ "fromMat2d": () => (/* binding */ fromMat2d), -/* harmony export */ "fromQuat": () => (/* binding */ fromQuat), -/* harmony export */ "normalFromMat4": () => (/* binding */ normalFromMat4), -/* harmony export */ "projection": () => (/* binding */ projection), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "frob": () => (/* binding */ frob), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), -/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "sub": () => (/* binding */ sub) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); - -/** - * 3x3 Matrix - * @module mat3 - */ - -/** - * Creates a new identity mat3 - * - * @returns {mat3} a new 3x3 matrix - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[5] = 0; - out[6] = 0; - out[7] = 0; - } - - out[0] = 1; - out[4] = 1; - out[8] = 1; - return out; -} -/** - * Copies the upper-left 3x3 values into the given mat3. - * - * @param {mat3} out the receiving 3x3 matrix - * @param {ReadonlyMat4} a the source 4x4 matrix - * @returns {mat3} out - */ - -function fromMat4(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[4]; - out[4] = a[5]; - out[5] = a[6]; - out[6] = a[8]; - out[7] = a[9]; - out[8] = a[10]; - return out; -} -/** - * Creates a new mat3 initialized with values from an existing matrix - * - * @param {ReadonlyMat3} a matrix to clone - * @returns {mat3} a new 3x3 matrix - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - return out; -} -/** - * Copy the values from one mat3 to another - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the source matrix - * @returns {mat3} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - return out; -} -/** - * Create a new mat3 with the given values - * - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m02 Component in column 0, row 2 position (index 2) - * @param {Number} m10 Component in column 1, row 0 position (index 3) - * @param {Number} m11 Component in column 1, row 1 position (index 4) - * @param {Number} m12 Component in column 1, row 2 position (index 5) - * @param {Number} m20 Component in column 2, row 0 position (index 6) - * @param {Number} m21 Component in column 2, row 1 position (index 7) - * @param {Number} m22 Component in column 2, row 2 position (index 8) - * @returns {mat3} A new mat3 - */ - -function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); - out[0] = m00; - out[1] = m01; - out[2] = m02; - out[3] = m10; - out[4] = m11; - out[5] = m12; - out[6] = m20; - out[7] = m21; - out[8] = m22; - return out; -} -/** - * Set the components of a mat3 to the given values - * - * @param {mat3} out the receiving matrix - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m02 Component in column 0, row 2 position (index 2) - * @param {Number} m10 Component in column 1, row 0 position (index 3) - * @param {Number} m11 Component in column 1, row 1 position (index 4) - * @param {Number} m12 Component in column 1, row 2 position (index 5) - * @param {Number} m20 Component in column 2, row 0 position (index 6) - * @param {Number} m21 Component in column 2, row 1 position (index 7) - * @param {Number} m22 Component in column 2, row 2 position (index 8) - * @returns {mat3} out - */ - -function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) { - out[0] = m00; - out[1] = m01; - out[2] = m02; - out[3] = m10; - out[4] = m11; - out[5] = m12; - out[6] = m20; - out[7] = m21; - out[8] = m22; - return out; -} -/** - * Set a mat3 to the identity matrix - * - * @param {mat3} out the receiving matrix - * @returns {mat3} out - */ - -function identity(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 1; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 1; - return out; -} -/** - * Transpose the values of a mat3 - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the source matrix - * @returns {mat3} out - */ - -function transpose(out, a) { - // If we are transposing ourselves we can skip a few steps but have to cache some values - if (out === a) { - var a01 = a[1], - a02 = a[2], - a12 = a[5]; - out[1] = a[3]; - out[2] = a[6]; - out[3] = a01; - out[5] = a[7]; - out[6] = a02; - out[7] = a12; - } else { - out[0] = a[0]; - out[1] = a[3]; - out[2] = a[6]; - out[3] = a[1]; - out[4] = a[4]; - out[5] = a[7]; - out[6] = a[2]; - out[7] = a[5]; - out[8] = a[8]; - } - - return out; -} -/** - * Inverts a mat3 - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the source matrix - * @returns {mat3} out - */ - -function invert(out, a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2]; - var a10 = a[3], - a11 = a[4], - a12 = a[5]; - var a20 = a[6], - a21 = a[7], - a22 = a[8]; - var b01 = a22 * a11 - a12 * a21; - var b11 = -a22 * a10 + a12 * a20; - var b21 = a21 * a10 - a11 * a20; // Calculate the determinant - - var det = a00 * b01 + a01 * b11 + a02 * b21; - - if (!det) { - return null; - } - - det = 1.0 / det; - out[0] = b01 * det; - out[1] = (-a22 * a01 + a02 * a21) * det; - out[2] = (a12 * a01 - a02 * a11) * det; - out[3] = b11 * det; - out[4] = (a22 * a00 - a02 * a20) * det; - out[5] = (-a12 * a00 + a02 * a10) * det; - out[6] = b21 * det; - out[7] = (-a21 * a00 + a01 * a20) * det; - out[8] = (a11 * a00 - a01 * a10) * det; - return out; -} -/** - * Calculates the adjugate of a mat3 - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the source matrix - * @returns {mat3} out - */ - -function adjoint(out, a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2]; - var a10 = a[3], - a11 = a[4], - a12 = a[5]; - var a20 = a[6], - a21 = a[7], - a22 = a[8]; - out[0] = a11 * a22 - a12 * a21; - out[1] = a02 * a21 - a01 * a22; - out[2] = a01 * a12 - a02 * a11; - out[3] = a12 * a20 - a10 * a22; - out[4] = a00 * a22 - a02 * a20; - out[5] = a02 * a10 - a00 * a12; - out[6] = a10 * a21 - a11 * a20; - out[7] = a01 * a20 - a00 * a21; - out[8] = a00 * a11 - a01 * a10; - return out; -} -/** - * Calculates the determinant of a mat3 - * - * @param {ReadonlyMat3} a the source matrix - * @returns {Number} determinant of a - */ - -function determinant(a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2]; - var a10 = a[3], - a11 = a[4], - a12 = a[5]; - var a20 = a[6], - a21 = a[7], - a22 = a[8]; - return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); -} -/** - * Multiplies two mat3's - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the first operand - * @param {ReadonlyMat3} b the second operand - * @returns {mat3} out - */ - -function multiply(out, a, b) { - var a00 = a[0], - a01 = a[1], - a02 = a[2]; - var a10 = a[3], - a11 = a[4], - a12 = a[5]; - var a20 = a[6], - a21 = a[7], - a22 = a[8]; - var b00 = b[0], - b01 = b[1], - b02 = b[2]; - var b10 = b[3], - b11 = b[4], - b12 = b[5]; - var b20 = b[6], - b21 = b[7], - b22 = b[8]; - out[0] = b00 * a00 + b01 * a10 + b02 * a20; - out[1] = b00 * a01 + b01 * a11 + b02 * a21; - out[2] = b00 * a02 + b01 * a12 + b02 * a22; - out[3] = b10 * a00 + b11 * a10 + b12 * a20; - out[4] = b10 * a01 + b11 * a11 + b12 * a21; - out[5] = b10 * a02 + b11 * a12 + b12 * a22; - out[6] = b20 * a00 + b21 * a10 + b22 * a20; - out[7] = b20 * a01 + b21 * a11 + b22 * a21; - out[8] = b20 * a02 + b21 * a12 + b22 * a22; - return out; -} -/** - * Translate a mat3 by the given vector - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the matrix to translate - * @param {ReadonlyVec2} v vector to translate by - * @returns {mat3} out - */ - -function translate(out, a, v) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a10 = a[3], - a11 = a[4], - a12 = a[5], - a20 = a[6], - a21 = a[7], - a22 = a[8], - x = v[0], - y = v[1]; - out[0] = a00; - out[1] = a01; - out[2] = a02; - out[3] = a10; - out[4] = a11; - out[5] = a12; - out[6] = x * a00 + y * a10 + a20; - out[7] = x * a01 + y * a11 + a21; - out[8] = x * a02 + y * a12 + a22; - return out; -} -/** - * Rotates a mat3 by the given angle - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat3} out - */ - -function rotate(out, a, rad) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a10 = a[3], - a11 = a[4], - a12 = a[5], - a20 = a[6], - a21 = a[7], - a22 = a[8], - s = Math.sin(rad), - c = Math.cos(rad); - out[0] = c * a00 + s * a10; - out[1] = c * a01 + s * a11; - out[2] = c * a02 + s * a12; - out[3] = c * a10 - s * a00; - out[4] = c * a11 - s * a01; - out[5] = c * a12 - s * a02; - out[6] = a20; - out[7] = a21; - out[8] = a22; - return out; -} -/** - * Scales the mat3 by the dimensions in the given vec2 - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the matrix to rotate - * @param {ReadonlyVec2} v the vec2 to scale the matrix by - * @returns {mat3} out - **/ - -function scale(out, a, v) { - var x = v[0], - y = v[1]; - out[0] = x * a[0]; - out[1] = x * a[1]; - out[2] = x * a[2]; - out[3] = y * a[3]; - out[4] = y * a[4]; - out[5] = y * a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - return out; -} -/** - * Creates a matrix from a vector translation - * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.translate(dest, dest, vec); - * - * @param {mat3} out mat3 receiving operation result - * @param {ReadonlyVec2} v Translation vector - * @returns {mat3} out - */ - -function fromTranslation(out, v) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 1; - out[5] = 0; - out[6] = v[0]; - out[7] = v[1]; - out[8] = 1; - return out; -} -/** - * Creates a matrix from a given angle - * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.rotate(dest, dest, rad); - * - * @param {mat3} out mat3 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat3} out - */ - -function fromRotation(out, rad) { - var s = Math.sin(rad), - c = Math.cos(rad); - out[0] = c; - out[1] = s; - out[2] = 0; - out[3] = -s; - out[4] = c; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 1; - return out; -} -/** - * Creates a matrix from a vector scaling - * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.scale(dest, dest, vec); - * - * @param {mat3} out mat3 receiving operation result - * @param {ReadonlyVec2} v Scaling vector - * @returns {mat3} out - */ - -function fromScaling(out, v) { - out[0] = v[0]; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = v[1]; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 1; - return out; -} -/** - * Copies the values from a mat2d into a mat3 - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat2d} a the matrix to copy - * @returns {mat3} out - **/ - -function fromMat2d(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = 0; - out[3] = a[2]; - out[4] = a[3]; - out[5] = 0; - out[6] = a[4]; - out[7] = a[5]; - out[8] = 1; - return out; -} -/** - * Calculates a 3x3 matrix from the given quaternion - * - * @param {mat3} out mat3 receiving operation result - * @param {ReadonlyQuat} q Quaternion to create matrix from - * - * @returns {mat3} out - */ - -function fromQuat(out, q) { - var x = q[0], - y = q[1], - z = q[2], - w = q[3]; - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - var xx = x * x2; - var yx = y * x2; - var yy = y * y2; - var zx = z * x2; - var zy = z * y2; - var zz = z * z2; - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - out[0] = 1 - yy - zz; - out[3] = yx - wz; - out[6] = zx + wy; - out[1] = yx + wz; - out[4] = 1 - xx - zz; - out[7] = zy - wx; - out[2] = zx - wy; - out[5] = zy + wx; - out[8] = 1 - xx - yy; - return out; -} -/** - * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix - * - * @param {mat3} out mat3 receiving operation result - * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from - * - * @returns {mat3} out - */ - -function normalFromMat4(out, a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7]; - var a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; - var a30 = a[12], - a31 = a[13], - a32 = a[14], - a33 = a[15]; - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; // Calculate the determinant - - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) { - return null; - } - - det = 1.0 / det; - out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - return out; -} -/** - * Generates a 2D projection matrix with the given bounds - * - * @param {mat3} out mat3 frustum matrix will be written into - * @param {number} width Width of your gl context - * @param {number} height Height of gl context - * @returns {mat3} out - */ - -function projection(out, width, height) { - out[0] = 2 / width; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = -2 / height; - out[5] = 0; - out[6] = -1; - out[7] = 1; - out[8] = 1; - return out; -} -/** - * Returns a string representation of a mat3 - * - * @param {ReadonlyMat3} a matrix to represent as a string - * @returns {String} string representation of the matrix - */ - -function str(a) { - return "mat3(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ")"; -} -/** - * Returns Frobenius norm of a mat3 - * - * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of - * @returns {Number} Frobenius norm - */ - -function frob(a) { - return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]); -} -/** - * Adds two mat3's - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the first operand - * @param {ReadonlyMat3} b the second operand - * @returns {mat3} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - out[4] = a[4] + b[4]; - out[5] = a[5] + b[5]; - out[6] = a[6] + b[6]; - out[7] = a[7] + b[7]; - out[8] = a[8] + b[8]; - return out; -} -/** - * Subtracts matrix b from matrix a - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the first operand - * @param {ReadonlyMat3} b the second operand - * @returns {mat3} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - out[3] = a[3] - b[3]; - out[4] = a[4] - b[4]; - out[5] = a[5] - b[5]; - out[6] = a[6] - b[6]; - out[7] = a[7] - b[7]; - out[8] = a[8] - b[8]; - return out; -} -/** - * Multiply each element of the matrix by a scalar. - * - * @param {mat3} out the receiving matrix - * @param {ReadonlyMat3} a the matrix to scale - * @param {Number} b amount to scale the matrix's elements by - * @returns {mat3} out - */ - -function multiplyScalar(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - out[4] = a[4] * b; - out[5] = a[5] * b; - out[6] = a[6] * b; - out[7] = a[7] * b; - out[8] = a[8] * b; - return out; -} -/** - * Adds two mat3's after multiplying each element of the second operand by a scalar value. - * - * @param {mat3} out the receiving vector - * @param {ReadonlyMat3} a the first operand - * @param {ReadonlyMat3} b the second operand - * @param {Number} scale the amount to scale b's elements by before adding - * @returns {mat3} out - */ - -function multiplyScalarAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - out[3] = a[3] + b[3] * scale; - out[4] = a[4] + b[4] * scale; - out[5] = a[5] + b[5] * scale; - out[6] = a[6] + b[6] * scale; - out[7] = a[7] + b[7] * scale; - out[8] = a[8] + b[8] * scale; - return out; -} -/** - * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyMat3} a The first matrix. - * @param {ReadonlyMat3} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8]; -} -/** - * Returns whether or not the matrices have approximately the same elements in the same position. - * - * @param {ReadonlyMat3} a The first matrix. - * @param {ReadonlyMat3} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5], - a6 = a[6], - a7 = a[7], - a8 = a[8]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3], - b4 = b[4], - b5 = b[5], - b6 = b[6], - b7 = b[7], - b8 = b[8]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)); -} -/** - * Alias for {@link mat3.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link mat3.subtract} - * @function - */ - -var sub = subtract; - -/***/ }), -/* 18 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "transpose": () => (/* binding */ transpose), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "adjoint": () => (/* binding */ adjoint), -/* harmony export */ "determinant": () => (/* binding */ determinant), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "translate": () => (/* binding */ translate), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "rotate": () => (/* binding */ rotate), -/* harmony export */ "rotateX": () => (/* binding */ rotateX), -/* harmony export */ "rotateY": () => (/* binding */ rotateY), -/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), -/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), -/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), -/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), -/* harmony export */ "fromXRotation": () => (/* binding */ fromXRotation), -/* harmony export */ "fromYRotation": () => (/* binding */ fromYRotation), -/* harmony export */ "fromZRotation": () => (/* binding */ fromZRotation), -/* harmony export */ "fromRotationTranslation": () => (/* binding */ fromRotationTranslation), -/* harmony export */ "fromQuat2": () => (/* binding */ fromQuat2), -/* harmony export */ "getTranslation": () => (/* binding */ getTranslation), -/* harmony export */ "getScaling": () => (/* binding */ getScaling), -/* harmony export */ "getRotation": () => (/* binding */ getRotation), -/* harmony export */ "fromRotationTranslationScale": () => (/* binding */ fromRotationTranslationScale), -/* harmony export */ "fromRotationTranslationScaleOrigin": () => (/* binding */ fromRotationTranslationScaleOrigin), -/* harmony export */ "fromQuat": () => (/* binding */ fromQuat), -/* harmony export */ "frustum": () => (/* binding */ frustum), -/* harmony export */ "perspective": () => (/* binding */ perspective), -/* harmony export */ "perspectiveFromFieldOfView": () => (/* binding */ perspectiveFromFieldOfView), -/* harmony export */ "ortho": () => (/* binding */ ortho), -/* harmony export */ "lookAt": () => (/* binding */ lookAt), -/* harmony export */ "targetTo": () => (/* binding */ targetTo), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "frob": () => (/* binding */ frob), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), -/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "sub": () => (/* binding */ sub) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); - -/** - * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied. - * @module mat4 - */ - -/** - * Creates a new identity mat4 - * - * @returns {mat4} a new 4x4 matrix - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - } - - out[0] = 1; - out[5] = 1; - out[10] = 1; - out[15] = 1; - return out; -} -/** - * Creates a new mat4 initialized with values from an existing matrix - * - * @param {ReadonlyMat4} a matrix to clone - * @returns {mat4} a new 4x4 matrix - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - return out; -} -/** - * Copy the values from one mat4 to another - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the source matrix - * @returns {mat4} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - return out; -} -/** - * Create a new mat4 with the given values - * - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m02 Component in column 0, row 2 position (index 2) - * @param {Number} m03 Component in column 0, row 3 position (index 3) - * @param {Number} m10 Component in column 1, row 0 position (index 4) - * @param {Number} m11 Component in column 1, row 1 position (index 5) - * @param {Number} m12 Component in column 1, row 2 position (index 6) - * @param {Number} m13 Component in column 1, row 3 position (index 7) - * @param {Number} m20 Component in column 2, row 0 position (index 8) - * @param {Number} m21 Component in column 2, row 1 position (index 9) - * @param {Number} m22 Component in column 2, row 2 position (index 10) - * @param {Number} m23 Component in column 2, row 3 position (index 11) - * @param {Number} m30 Component in column 3, row 0 position (index 12) - * @param {Number} m31 Component in column 3, row 1 position (index 13) - * @param {Number} m32 Component in column 3, row 2 position (index 14) - * @param {Number} m33 Component in column 3, row 3 position (index 15) - * @returns {mat4} A new mat4 - */ - -function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); - out[0] = m00; - out[1] = m01; - out[2] = m02; - out[3] = m03; - out[4] = m10; - out[5] = m11; - out[6] = m12; - out[7] = m13; - out[8] = m20; - out[9] = m21; - out[10] = m22; - out[11] = m23; - out[12] = m30; - out[13] = m31; - out[14] = m32; - out[15] = m33; - return out; -} -/** - * Set the components of a mat4 to the given values - * - * @param {mat4} out the receiving matrix - * @param {Number} m00 Component in column 0, row 0 position (index 0) - * @param {Number} m01 Component in column 0, row 1 position (index 1) - * @param {Number} m02 Component in column 0, row 2 position (index 2) - * @param {Number} m03 Component in column 0, row 3 position (index 3) - * @param {Number} m10 Component in column 1, row 0 position (index 4) - * @param {Number} m11 Component in column 1, row 1 position (index 5) - * @param {Number} m12 Component in column 1, row 2 position (index 6) - * @param {Number} m13 Component in column 1, row 3 position (index 7) - * @param {Number} m20 Component in column 2, row 0 position (index 8) - * @param {Number} m21 Component in column 2, row 1 position (index 9) - * @param {Number} m22 Component in column 2, row 2 position (index 10) - * @param {Number} m23 Component in column 2, row 3 position (index 11) - * @param {Number} m30 Component in column 3, row 0 position (index 12) - * @param {Number} m31 Component in column 3, row 1 position (index 13) - * @param {Number} m32 Component in column 3, row 2 position (index 14) - * @param {Number} m33 Component in column 3, row 3 position (index 15) - * @returns {mat4} out - */ - -function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { - out[0] = m00; - out[1] = m01; - out[2] = m02; - out[3] = m03; - out[4] = m10; - out[5] = m11; - out[6] = m12; - out[7] = m13; - out[8] = m20; - out[9] = m21; - out[10] = m22; - out[11] = m23; - out[12] = m30; - out[13] = m31; - out[14] = m32; - out[15] = m33; - return out; -} -/** - * Set a mat4 to the identity matrix - * - * @param {mat4} out the receiving matrix - * @returns {mat4} out - */ - -function identity(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Transpose the values of a mat4 - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the source matrix - * @returns {mat4} out - */ - -function transpose(out, a) { - // If we are transposing ourselves we can skip a few steps but have to cache some values - if (out === a) { - var a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a12 = a[6], - a13 = a[7]; - var a23 = a[11]; - out[1] = a[4]; - out[2] = a[8]; - out[3] = a[12]; - out[4] = a01; - out[6] = a[9]; - out[7] = a[13]; - out[8] = a02; - out[9] = a12; - out[11] = a[14]; - out[12] = a03; - out[13] = a13; - out[14] = a23; - } else { - out[0] = a[0]; - out[1] = a[4]; - out[2] = a[8]; - out[3] = a[12]; - out[4] = a[1]; - out[5] = a[5]; - out[6] = a[9]; - out[7] = a[13]; - out[8] = a[2]; - out[9] = a[6]; - out[10] = a[10]; - out[11] = a[14]; - out[12] = a[3]; - out[13] = a[7]; - out[14] = a[11]; - out[15] = a[15]; - } - - return out; -} -/** - * Inverts a mat4 - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the source matrix - * @returns {mat4} out - */ - -function invert(out, a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7]; - var a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; - var a30 = a[12], - a31 = a[13], - a32 = a[14], - a33 = a[15]; - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; // Calculate the determinant - - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) { - return null; - } - - det = 1.0 / det; - out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; - out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; - out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; - out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; - out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; - out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; - out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; - return out; -} -/** - * Calculates the adjugate of a mat4 - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the source matrix - * @returns {mat4} out - */ - -function adjoint(out, a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7]; - var a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; - var a30 = a[12], - a31 = a[13], - a32 = a[14], - a33 = a[15]; - out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22); - out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); - out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12); - out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); - out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); - out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22); - out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); - out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12); - out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21); - out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); - out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11); - out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); - out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); - out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21); - out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); - out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11); - return out; -} -/** - * Calculates the determinant of a mat4 - * - * @param {ReadonlyMat4} a the source matrix - * @returns {Number} determinant of a - */ - -function determinant(a) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7]; - var a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; - var a30 = a[12], - a31 = a[13], - a32 = a[14], - a33 = a[15]; - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; // Calculate the determinant - - return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; -} -/** - * Multiplies two mat4s - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the first operand - * @param {ReadonlyMat4} b the second operand - * @returns {mat4} out - */ - -function multiply(out, a, b) { - var a00 = a[0], - a01 = a[1], - a02 = a[2], - a03 = a[3]; - var a10 = a[4], - a11 = a[5], - a12 = a[6], - a13 = a[7]; - var a20 = a[8], - a21 = a[9], - a22 = a[10], - a23 = a[11]; - var a30 = a[12], - a31 = a[13], - a32 = a[14], - a33 = a[15]; // Cache only the current line of the second matrix - - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3]; - out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - b0 = b[4]; - b1 = b[5]; - b2 = b[6]; - b3 = b[7]; - out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - b0 = b[8]; - b1 = b[9]; - b2 = b[10]; - b3 = b[11]; - out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - b0 = b[12]; - b1 = b[13]; - b2 = b[14]; - b3 = b[15]; - out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - return out; -} -/** - * Translate a mat4 by the given vector - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to translate - * @param {ReadonlyVec3} v vector to translate by - * @returns {mat4} out - */ - -function translate(out, a, v) { - var x = v[0], - y = v[1], - z = v[2]; - var a00, a01, a02, a03; - var a10, a11, a12, a13; - var a20, a21, a22, a23; - - if (a === out) { - out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - } else { - a00 = a[0]; - a01 = a[1]; - a02 = a[2]; - a03 = a[3]; - a10 = a[4]; - a11 = a[5]; - a12 = a[6]; - a13 = a[7]; - a20 = a[8]; - a21 = a[9]; - a22 = a[10]; - a23 = a[11]; - out[0] = a00; - out[1] = a01; - out[2] = a02; - out[3] = a03; - out[4] = a10; - out[5] = a11; - out[6] = a12; - out[7] = a13; - out[8] = a20; - out[9] = a21; - out[10] = a22; - out[11] = a23; - out[12] = a00 * x + a10 * y + a20 * z + a[12]; - out[13] = a01 * x + a11 * y + a21 * z + a[13]; - out[14] = a02 * x + a12 * y + a22 * z + a[14]; - out[15] = a03 * x + a13 * y + a23 * z + a[15]; - } - - return out; -} -/** - * Scales the mat4 by the dimensions in the given vec3 not using vectorization - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to scale - * @param {ReadonlyVec3} v the vec3 to scale the matrix by - * @returns {mat4} out - **/ - -function scale(out, a, v) { - var x = v[0], - y = v[1], - z = v[2]; - out[0] = a[0] * x; - out[1] = a[1] * x; - out[2] = a[2] * x; - out[3] = a[3] * x; - out[4] = a[4] * y; - out[5] = a[5] * y; - out[6] = a[6] * y; - out[7] = a[7] * y; - out[8] = a[8] * z; - out[9] = a[9] * z; - out[10] = a[10] * z; - out[11] = a[11] * z; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - return out; -} -/** - * Rotates a mat4 by the given angle around the given axis - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @param {ReadonlyVec3} axis the axis to rotate around - * @returns {mat4} out - */ - -function rotate(out, a, rad, axis) { - var x = axis[0], - y = axis[1], - z = axis[2]; - var len = Math.hypot(x, y, z); - var s, c, t; - var a00, a01, a02, a03; - var a10, a11, a12, a13; - var a20, a21, a22, a23; - var b00, b01, b02; - var b10, b11, b12; - var b20, b21, b22; - - if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - return null; - } - - len = 1 / len; - x *= len; - y *= len; - z *= len; - s = Math.sin(rad); - c = Math.cos(rad); - t = 1 - c; - a00 = a[0]; - a01 = a[1]; - a02 = a[2]; - a03 = a[3]; - a10 = a[4]; - a11 = a[5]; - a12 = a[6]; - a13 = a[7]; - a20 = a[8]; - a21 = a[9]; - a22 = a[10]; - a23 = a[11]; // Construct the elements of the rotation matrix - - b00 = x * x * t + c; - b01 = y * x * t + z * s; - b02 = z * x * t - y * s; - b10 = x * y * t - z * s; - b11 = y * y * t + c; - b12 = z * y * t + x * s; - b20 = x * z * t + y * s; - b21 = y * z * t - x * s; - b22 = z * z * t + c; // Perform rotation-specific matrix multiplication - - out[0] = a00 * b00 + a10 * b01 + a20 * b02; - out[1] = a01 * b00 + a11 * b01 + a21 * b02; - out[2] = a02 * b00 + a12 * b01 + a22 * b02; - out[3] = a03 * b00 + a13 * b01 + a23 * b02; - out[4] = a00 * b10 + a10 * b11 + a20 * b12; - out[5] = a01 * b10 + a11 * b11 + a21 * b12; - out[6] = a02 * b10 + a12 * b11 + a22 * b12; - out[7] = a03 * b10 + a13 * b11 + a23 * b12; - out[8] = a00 * b20 + a10 * b21 + a20 * b22; - out[9] = a01 * b20 + a11 * b21 + a21 * b22; - out[10] = a02 * b20 + a12 * b21 + a22 * b22; - out[11] = a03 * b20 + a13 * b21 + a23 * b22; - - if (a !== out) { - // If the source and destination differ, copy the unchanged last row - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - } - - return out; -} -/** - * Rotates a matrix by the given angle around the X axis - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function rotateX(out, a, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - if (a !== out) { - // If the source and destination differ, copy the unchanged rows - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - } // Perform axis-specific matrix multiplication - - - out[4] = a10 * c + a20 * s; - out[5] = a11 * c + a21 * s; - out[6] = a12 * c + a22 * s; - out[7] = a13 * c + a23 * s; - out[8] = a20 * c - a10 * s; - out[9] = a21 * c - a11 * s; - out[10] = a22 * c - a12 * s; - out[11] = a23 * c - a13 * s; - return out; -} -/** - * Rotates a matrix by the given angle around the Y axis - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function rotateY(out, a, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - if (a !== out) { - // If the source and destination differ, copy the unchanged rows - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - } // Perform axis-specific matrix multiplication - - - out[0] = a00 * c - a20 * s; - out[1] = a01 * c - a21 * s; - out[2] = a02 * c - a22 * s; - out[3] = a03 * c - a23 * s; - out[8] = a00 * s + a20 * c; - out[9] = a01 * s + a21 * c; - out[10] = a02 * s + a22 * c; - out[11] = a03 * s + a23 * c; - return out; -} -/** - * Rotates a matrix by the given angle around the Z axis - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to rotate - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function rotateZ(out, a, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - if (a !== out) { - // If the source and destination differ, copy the unchanged last row - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - } // Perform axis-specific matrix multiplication - - - out[0] = a00 * c + a10 * s; - out[1] = a01 * c + a11 * s; - out[2] = a02 * c + a12 * s; - out[3] = a03 * c + a13 * s; - out[4] = a10 * c - a00 * s; - out[5] = a11 * c - a01 * s; - out[6] = a12 * c - a02 * s; - out[7] = a13 * c - a03 * s; - return out; -} -/** - * Creates a matrix from a vector translation - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, dest, vec); - * - * @param {mat4} out mat4 receiving operation result - * @param {ReadonlyVec3} v Translation vector - * @returns {mat4} out - */ - -function fromTranslation(out, v) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = v[0]; - out[13] = v[1]; - out[14] = v[2]; - out[15] = 1; - return out; -} -/** - * Creates a matrix from a vector scaling - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.scale(dest, dest, vec); - * - * @param {mat4} out mat4 receiving operation result - * @param {ReadonlyVec3} v Scaling vector - * @returns {mat4} out - */ - -function fromScaling(out, v) { - out[0] = v[0]; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = v[1]; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = v[2]; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Creates a matrix from a given angle around a given axis - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotate(dest, dest, rad, axis); - * - * @param {mat4} out mat4 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @param {ReadonlyVec3} axis the axis to rotate around - * @returns {mat4} out - */ - -function fromRotation(out, rad, axis) { - var x = axis[0], - y = axis[1], - z = axis[2]; - var len = Math.hypot(x, y, z); - var s, c, t; - - if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - return null; - } - - len = 1 / len; - x *= len; - y *= len; - z *= len; - s = Math.sin(rad); - c = Math.cos(rad); - t = 1 - c; // Perform rotation-specific matrix multiplication - - out[0] = x * x * t + c; - out[1] = y * x * t + z * s; - out[2] = z * x * t - y * s; - out[3] = 0; - out[4] = x * y * t - z * s; - out[5] = y * y * t + c; - out[6] = z * y * t + x * s; - out[7] = 0; - out[8] = x * z * t + y * s; - out[9] = y * z * t - x * s; - out[10] = z * z * t + c; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Creates a matrix from the given angle around the X axis - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateX(dest, dest, rad); - * - * @param {mat4} out mat4 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function fromXRotation(out, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); // Perform axis-specific matrix multiplication - - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = c; - out[6] = s; - out[7] = 0; - out[8] = 0; - out[9] = -s; - out[10] = c; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Creates a matrix from the given angle around the Y axis - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateY(dest, dest, rad); - * - * @param {mat4} out mat4 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function fromYRotation(out, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); // Perform axis-specific matrix multiplication - - out[0] = c; - out[1] = 0; - out[2] = -s; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = s; - out[9] = 0; - out[10] = c; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Creates a matrix from the given angle around the Z axis - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateZ(dest, dest, rad); - * - * @param {mat4} out mat4 receiving operation result - * @param {Number} rad the angle to rotate the matrix by - * @returns {mat4} out - */ - -function fromZRotation(out, rad) { - var s = Math.sin(rad); - var c = Math.cos(rad); // Perform axis-specific matrix multiplication - - out[0] = c; - out[1] = s; - out[2] = 0; - out[3] = 0; - out[4] = -s; - out[5] = c; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Creates a matrix from a quaternion rotation and vector translation - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * - * @param {mat4} out mat4 receiving operation result - * @param {quat4} q Rotation quaternion - * @param {ReadonlyVec3} v Translation vector - * @returns {mat4} out - */ - -function fromRotationTranslation(out, q, v) { - // Quaternion math - var x = q[0], - y = q[1], - z = q[2], - w = q[3]; - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - out[0] = 1 - (yy + zz); - out[1] = xy + wz; - out[2] = xz - wy; - out[3] = 0; - out[4] = xy - wz; - out[5] = 1 - (xx + zz); - out[6] = yz + wx; - out[7] = 0; - out[8] = xz + wy; - out[9] = yz - wx; - out[10] = 1 - (xx + yy); - out[11] = 0; - out[12] = v[0]; - out[13] = v[1]; - out[14] = v[2]; - out[15] = 1; - return out; -} -/** - * Creates a new mat4 from a dual quat. - * - * @param {mat4} out Matrix - * @param {ReadonlyQuat2} a Dual Quaternion - * @returns {mat4} mat4 receiving operation result - */ - -function fromQuat2(out, a) { - var translation = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - var bx = -a[0], - by = -a[1], - bz = -a[2], - bw = a[3], - ax = a[4], - ay = a[5], - az = a[6], - aw = a[7]; - var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense - - if (magnitude > 0) { - translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude; - translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude; - translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude; - } else { - translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; - translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; - translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; - } - - fromRotationTranslation(out, a, translation); - return out; -} -/** - * Returns the translation vector component of a transformation - * matrix. If a matrix is built with fromRotationTranslation, - * the returned vector will be the same as the translation vector - * originally supplied. - * @param {vec3} out Vector to receive translation component - * @param {ReadonlyMat4} mat Matrix to be decomposed (input) - * @return {vec3} out - */ - -function getTranslation(out, mat) { - out[0] = mat[12]; - out[1] = mat[13]; - out[2] = mat[14]; - return out; -} -/** - * Returns the scaling factor component of a transformation - * matrix. If a matrix is built with fromRotationTranslationScale - * with a normalized Quaternion paramter, the returned vector will be - * the same as the scaling vector - * originally supplied. - * @param {vec3} out Vector to receive scaling factor component - * @param {ReadonlyMat4} mat Matrix to be decomposed (input) - * @return {vec3} out - */ - -function getScaling(out, mat) { - var m11 = mat[0]; - var m12 = mat[1]; - var m13 = mat[2]; - var m21 = mat[4]; - var m22 = mat[5]; - var m23 = mat[6]; - var m31 = mat[8]; - var m32 = mat[9]; - var m33 = mat[10]; - out[0] = Math.hypot(m11, m12, m13); - out[1] = Math.hypot(m21, m22, m23); - out[2] = Math.hypot(m31, m32, m33); - return out; -} -/** - * Returns a quaternion representing the rotational component - * of a transformation matrix. If a matrix is built with - * fromRotationTranslation, the returned quaternion will be the - * same as the quaternion originally supplied. - * @param {quat} out Quaternion to receive the rotation component - * @param {ReadonlyMat4} mat Matrix to be decomposed (input) - * @return {quat} out - */ - -function getRotation(out, mat) { - var scaling = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - getScaling(scaling, mat); - var is1 = 1 / scaling[0]; - var is2 = 1 / scaling[1]; - var is3 = 1 / scaling[2]; - var sm11 = mat[0] * is1; - var sm12 = mat[1] * is2; - var sm13 = mat[2] * is3; - var sm21 = mat[4] * is1; - var sm22 = mat[5] * is2; - var sm23 = mat[6] * is3; - var sm31 = mat[8] * is1; - var sm32 = mat[9] * is2; - var sm33 = mat[10] * is3; - var trace = sm11 + sm22 + sm33; - var S = 0; - - if (trace > 0) { - S = Math.sqrt(trace + 1.0) * 2; - out[3] = 0.25 * S; - out[0] = (sm23 - sm32) / S; - out[1] = (sm31 - sm13) / S; - out[2] = (sm12 - sm21) / S; - } else if (sm11 > sm22 && sm11 > sm33) { - S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2; - out[3] = (sm23 - sm32) / S; - out[0] = 0.25 * S; - out[1] = (sm12 + sm21) / S; - out[2] = (sm31 + sm13) / S; - } else if (sm22 > sm33) { - S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2; - out[3] = (sm31 - sm13) / S; - out[0] = (sm12 + sm21) / S; - out[1] = 0.25 * S; - out[2] = (sm23 + sm32) / S; - } else { - S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2; - out[3] = (sm12 - sm21) / S; - out[0] = (sm31 + sm13) / S; - out[1] = (sm23 + sm32) / S; - out[2] = 0.25 * S; - } - - return out; -} -/** - * Creates a matrix from a quaternion rotation, vector translation and vector scale - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale) - * - * @param {mat4} out mat4 receiving operation result - * @param {quat4} q Rotation quaternion - * @param {ReadonlyVec3} v Translation vector - * @param {ReadonlyVec3} s Scaling vector - * @returns {mat4} out - */ - -function fromRotationTranslationScale(out, q, v, s) { - // Quaternion math - var x = q[0], - y = q[1], - z = q[2], - w = q[3]; - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - var sx = s[0]; - var sy = s[1]; - var sz = s[2]; - out[0] = (1 - (yy + zz)) * sx; - out[1] = (xy + wz) * sx; - out[2] = (xz - wy) * sx; - out[3] = 0; - out[4] = (xy - wz) * sy; - out[5] = (1 - (xx + zz)) * sy; - out[6] = (yz + wx) * sy; - out[7] = 0; - out[8] = (xz + wy) * sz; - out[9] = (yz - wx) * sz; - out[10] = (1 - (xx + yy)) * sz; - out[11] = 0; - out[12] = v[0]; - out[13] = v[1]; - out[14] = v[2]; - out[15] = 1; - return out; -} -/** - * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * mat4.translate(dest, origin); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale) - * mat4.translate(dest, negativeOrigin); - * - * @param {mat4} out mat4 receiving operation result - * @param {quat4} q Rotation quaternion - * @param {ReadonlyVec3} v Translation vector - * @param {ReadonlyVec3} s Scaling vector - * @param {ReadonlyVec3} o The origin vector around which to scale and rotate - * @returns {mat4} out - */ - -function fromRotationTranslationScaleOrigin(out, q, v, s, o) { - // Quaternion math - var x = q[0], - y = q[1], - z = q[2], - w = q[3]; - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - var sx = s[0]; - var sy = s[1]; - var sz = s[2]; - var ox = o[0]; - var oy = o[1]; - var oz = o[2]; - var out0 = (1 - (yy + zz)) * sx; - var out1 = (xy + wz) * sx; - var out2 = (xz - wy) * sx; - var out4 = (xy - wz) * sy; - var out5 = (1 - (xx + zz)) * sy; - var out6 = (yz + wx) * sy; - var out8 = (xz + wy) * sz; - var out9 = (yz - wx) * sz; - var out10 = (1 - (xx + yy)) * sz; - out[0] = out0; - out[1] = out1; - out[2] = out2; - out[3] = 0; - out[4] = out4; - out[5] = out5; - out[6] = out6; - out[7] = 0; - out[8] = out8; - out[9] = out9; - out[10] = out10; - out[11] = 0; - out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz); - out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz); - out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz); - out[15] = 1; - return out; -} -/** - * Calculates a 4x4 matrix from the given quaternion - * - * @param {mat4} out mat4 receiving operation result - * @param {ReadonlyQuat} q Quaternion to create matrix from - * - * @returns {mat4} out - */ - -function fromQuat(out, q) { - var x = q[0], - y = q[1], - z = q[2], - w = q[3]; - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - var xx = x * x2; - var yx = y * x2; - var yy = y * y2; - var zx = z * x2; - var zy = z * y2; - var zz = z * z2; - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - out[0] = 1 - yy - zz; - out[1] = yx + wz; - out[2] = zx - wy; - out[3] = 0; - out[4] = yx - wz; - out[5] = 1 - xx - zz; - out[6] = zy + wx; - out[7] = 0; - out[8] = zx + wy; - out[9] = zy - wx; - out[10] = 1 - xx - yy; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - return out; -} -/** - * Generates a frustum matrix with the given bounds - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {Number} left Left bound of the frustum - * @param {Number} right Right bound of the frustum - * @param {Number} bottom Bottom bound of the frustum - * @param {Number} top Top bound of the frustum - * @param {Number} near Near bound of the frustum - * @param {Number} far Far bound of the frustum - * @returns {mat4} out - */ - -function frustum(out, left, right, bottom, top, near, far) { - var rl = 1 / (right - left); - var tb = 1 / (top - bottom); - var nf = 1 / (near - far); - out[0] = near * 2 * rl; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = near * 2 * tb; - out[6] = 0; - out[7] = 0; - out[8] = (right + left) * rl; - out[9] = (top + bottom) * tb; - out[10] = (far + near) * nf; - out[11] = -1; - out[12] = 0; - out[13] = 0; - out[14] = far * near * 2 * nf; - out[15] = 0; - return out; -} -/** - * Generates a perspective projection matrix with the given bounds. - * Passing null/undefined/no value for far will generate infinite projection matrix. - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {number} fovy Vertical field of view in radians - * @param {number} aspect Aspect ratio. typically viewport width/height - * @param {number} near Near bound of the frustum - * @param {number} far Far bound of the frustum, can be null or Infinity - * @returns {mat4} out - */ - -function perspective(out, fovy, aspect, near, far) { - var f = 1.0 / Math.tan(fovy / 2), - nf; - out[0] = f / aspect; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = f; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[11] = -1; - out[12] = 0; - out[13] = 0; - out[15] = 0; - - if (far != null && far !== Infinity) { - nf = 1 / (near - far); - out[10] = (far + near) * nf; - out[14] = 2 * far * near * nf; - } else { - out[10] = -1; - out[14] = -2 * near; - } - - return out; -} -/** - * Generates a perspective projection matrix with the given field of view. - * This is primarily useful for generating projection matrices to be used - * with the still experiemental WebVR API. - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees - * @param {number} near Near bound of the frustum - * @param {number} far Far bound of the frustum - * @returns {mat4} out - */ - -function perspectiveFromFieldOfView(out, fov, near, far) { - var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0); - var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0); - var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0); - var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0); - var xScale = 2.0 / (leftTan + rightTan); - var yScale = 2.0 / (upTan + downTan); - out[0] = xScale; - out[1] = 0.0; - out[2] = 0.0; - out[3] = 0.0; - out[4] = 0.0; - out[5] = yScale; - out[6] = 0.0; - out[7] = 0.0; - out[8] = -((leftTan - rightTan) * xScale * 0.5); - out[9] = (upTan - downTan) * yScale * 0.5; - out[10] = far / (near - far); - out[11] = -1.0; - out[12] = 0.0; - out[13] = 0.0; - out[14] = far * near / (near - far); - out[15] = 0.0; - return out; -} -/** - * Generates a orthogonal projection matrix with the given bounds - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {number} left Left bound of the frustum - * @param {number} right Right bound of the frustum - * @param {number} bottom Bottom bound of the frustum - * @param {number} top Top bound of the frustum - * @param {number} near Near bound of the frustum - * @param {number} far Far bound of the frustum - * @returns {mat4} out - */ - -function ortho(out, left, right, bottom, top, near, far) { - var lr = 1 / (left - right); - var bt = 1 / (bottom - top); - var nf = 1 / (near - far); - out[0] = -2 * lr; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = -2 * bt; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 2 * nf; - out[11] = 0; - out[12] = (left + right) * lr; - out[13] = (top + bottom) * bt; - out[14] = (far + near) * nf; - out[15] = 1; - return out; -} -/** - * Generates a look-at matrix with the given eye position, focal point, and up axis. - * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {ReadonlyVec3} eye Position of the viewer - * @param {ReadonlyVec3} center Point the viewer is looking at - * @param {ReadonlyVec3} up vec3 pointing up - * @returns {mat4} out - */ - -function lookAt(out, eye, center, up) { - var x0, x1, x2, y0, y1, y2, z0, z1, z2, len; - var eyex = eye[0]; - var eyey = eye[1]; - var eyez = eye[2]; - var upx = up[0]; - var upy = up[1]; - var upz = up[2]; - var centerx = center[0]; - var centery = center[1]; - var centerz = center[2]; - - if (Math.abs(eyex - centerx) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON && Math.abs(eyey - centery) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON && Math.abs(eyez - centerz) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - return identity(out); - } - - z0 = eyex - centerx; - z1 = eyey - centery; - z2 = eyez - centerz; - len = 1 / Math.hypot(z0, z1, z2); - z0 *= len; - z1 *= len; - z2 *= len; - x0 = upy * z2 - upz * z1; - x1 = upz * z0 - upx * z2; - x2 = upx * z1 - upy * z0; - len = Math.hypot(x0, x1, x2); - - if (!len) { - x0 = 0; - x1 = 0; - x2 = 0; - } else { - len = 1 / len; - x0 *= len; - x1 *= len; - x2 *= len; - } - - y0 = z1 * x2 - z2 * x1; - y1 = z2 * x0 - z0 * x2; - y2 = z0 * x1 - z1 * x0; - len = Math.hypot(y0, y1, y2); - - if (!len) { - y0 = 0; - y1 = 0; - y2 = 0; - } else { - len = 1 / len; - y0 *= len; - y1 *= len; - y2 *= len; - } - - out[0] = x0; - out[1] = y0; - out[2] = z0; - out[3] = 0; - out[4] = x1; - out[5] = y1; - out[6] = z1; - out[7] = 0; - out[8] = x2; - out[9] = y2; - out[10] = z2; - out[11] = 0; - out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); - out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); - out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); - out[15] = 1; - return out; -} -/** - * Generates a matrix that makes something look at something else. - * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {ReadonlyVec3} eye Position of the viewer - * @param {ReadonlyVec3} center Point the viewer is looking at - * @param {ReadonlyVec3} up vec3 pointing up - * @returns {mat4} out - */ - -function targetTo(out, eye, target, up) { - var eyex = eye[0], - eyey = eye[1], - eyez = eye[2], - upx = up[0], - upy = up[1], - upz = up[2]; - var z0 = eyex - target[0], - z1 = eyey - target[1], - z2 = eyez - target[2]; - var len = z0 * z0 + z1 * z1 + z2 * z2; - - if (len > 0) { - len = 1 / Math.sqrt(len); - z0 *= len; - z1 *= len; - z2 *= len; - } - - var x0 = upy * z2 - upz * z1, - x1 = upz * z0 - upx * z2, - x2 = upx * z1 - upy * z0; - len = x0 * x0 + x1 * x1 + x2 * x2; - - if (len > 0) { - len = 1 / Math.sqrt(len); - x0 *= len; - x1 *= len; - x2 *= len; - } - - out[0] = x0; - out[1] = x1; - out[2] = x2; - out[3] = 0; - out[4] = z1 * x2 - z2 * x1; - out[5] = z2 * x0 - z0 * x2; - out[6] = z0 * x1 - z1 * x0; - out[7] = 0; - out[8] = z0; - out[9] = z1; - out[10] = z2; - out[11] = 0; - out[12] = eyex; - out[13] = eyey; - out[14] = eyez; - out[15] = 1; - return out; -} -/** - * Returns a string representation of a mat4 - * - * @param {ReadonlyMat4} a matrix to represent as a string - * @returns {String} string representation of the matrix - */ - -function str(a) { - return "mat4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ", " + a[9] + ", " + a[10] + ", " + a[11] + ", " + a[12] + ", " + a[13] + ", " + a[14] + ", " + a[15] + ")"; -} -/** - * Returns Frobenius norm of a mat4 - * - * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of - * @returns {Number} Frobenius norm - */ - -function frob(a) { - return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); -} -/** - * Adds two mat4's - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the first operand - * @param {ReadonlyMat4} b the second operand - * @returns {mat4} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - out[4] = a[4] + b[4]; - out[5] = a[5] + b[5]; - out[6] = a[6] + b[6]; - out[7] = a[7] + b[7]; - out[8] = a[8] + b[8]; - out[9] = a[9] + b[9]; - out[10] = a[10] + b[10]; - out[11] = a[11] + b[11]; - out[12] = a[12] + b[12]; - out[13] = a[13] + b[13]; - out[14] = a[14] + b[14]; - out[15] = a[15] + b[15]; - return out; -} -/** - * Subtracts matrix b from matrix a - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the first operand - * @param {ReadonlyMat4} b the second operand - * @returns {mat4} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - out[3] = a[3] - b[3]; - out[4] = a[4] - b[4]; - out[5] = a[5] - b[5]; - out[6] = a[6] - b[6]; - out[7] = a[7] - b[7]; - out[8] = a[8] - b[8]; - out[9] = a[9] - b[9]; - out[10] = a[10] - b[10]; - out[11] = a[11] - b[11]; - out[12] = a[12] - b[12]; - out[13] = a[13] - b[13]; - out[14] = a[14] - b[14]; - out[15] = a[15] - b[15]; - return out; -} -/** - * Multiply each element of the matrix by a scalar. - * - * @param {mat4} out the receiving matrix - * @param {ReadonlyMat4} a the matrix to scale - * @param {Number} b amount to scale the matrix's elements by - * @returns {mat4} out - */ - -function multiplyScalar(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - out[4] = a[4] * b; - out[5] = a[5] * b; - out[6] = a[6] * b; - out[7] = a[7] * b; - out[8] = a[8] * b; - out[9] = a[9] * b; - out[10] = a[10] * b; - out[11] = a[11] * b; - out[12] = a[12] * b; - out[13] = a[13] * b; - out[14] = a[14] * b; - out[15] = a[15] * b; - return out; -} -/** - * Adds two mat4's after multiplying each element of the second operand by a scalar value. - * - * @param {mat4} out the receiving vector - * @param {ReadonlyMat4} a the first operand - * @param {ReadonlyMat4} b the second operand - * @param {Number} scale the amount to scale b's elements by before adding - * @returns {mat4} out - */ - -function multiplyScalarAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - out[3] = a[3] + b[3] * scale; - out[4] = a[4] + b[4] * scale; - out[5] = a[5] + b[5] * scale; - out[6] = a[6] + b[6] * scale; - out[7] = a[7] + b[7] * scale; - out[8] = a[8] + b[8] * scale; - out[9] = a[9] + b[9] * scale; - out[10] = a[10] + b[10] * scale; - out[11] = a[11] + b[11] * scale; - out[12] = a[12] + b[12] * scale; - out[13] = a[13] + b[13] * scale; - out[14] = a[14] + b[14] * scale; - out[15] = a[15] + b[15] * scale; - return out; -} -/** - * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyMat4} a The first matrix. - * @param {ReadonlyMat4} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15]; -} -/** - * Returns whether or not the matrices have approximately the same elements in the same position. - * - * @param {ReadonlyMat4} a The first matrix. - * @param {ReadonlyMat4} b The second matrix. - * @returns {Boolean} True if the matrices are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var a4 = a[4], - a5 = a[5], - a6 = a[6], - a7 = a[7]; - var a8 = a[8], - a9 = a[9], - a10 = a[10], - a11 = a[11]; - var a12 = a[12], - a13 = a[13], - a14 = a[14], - a15 = a[15]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3]; - var b4 = b[4], - b5 = b[5], - b6 = b[6], - b7 = b[7]; - var b8 = b[8], - b9 = b[9], - b10 = b[10], - b11 = b[11]; - var b12 = b[12], - b13 = b[13], - b14 = b[14], - b15 = b[15]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15)); -} -/** - * Alias for {@link mat4.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link mat4.subtract} - * @function - */ - -var sub = subtract; - -/***/ }), -/* 19 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "setAxisAngle": () => (/* binding */ setAxisAngle), -/* harmony export */ "getAxisAngle": () => (/* binding */ getAxisAngle), -/* harmony export */ "getAngle": () => (/* binding */ getAngle), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "rotateX": () => (/* binding */ rotateX), -/* harmony export */ "rotateY": () => (/* binding */ rotateY), -/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), -/* harmony export */ "calculateW": () => (/* binding */ calculateW), -/* harmony export */ "exp": () => (/* binding */ exp), -/* harmony export */ "ln": () => (/* binding */ ln), -/* harmony export */ "pow": () => (/* binding */ pow), -/* harmony export */ "slerp": () => (/* binding */ slerp), -/* harmony export */ "random": () => (/* binding */ random), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "conjugate": () => (/* binding */ conjugate), -/* harmony export */ "fromMat3": () => (/* binding */ fromMat3), -/* harmony export */ "fromEuler": () => (/* binding */ fromEuler), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "dot": () => (/* binding */ dot), -/* harmony export */ "lerp": () => (/* binding */ lerp), -/* harmony export */ "length": () => (/* binding */ length), -/* harmony export */ "len": () => (/* binding */ len), -/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), -/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), -/* harmony export */ "normalize": () => (/* binding */ normalize), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "rotationTo": () => (/* binding */ rotationTo), -/* harmony export */ "sqlerp": () => (/* binding */ sqlerp), -/* harmony export */ "setAxes": () => (/* binding */ setAxes) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); -/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17); -/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(21); -/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20); - - - - -/** - * Quaternion - * @module quat - */ - -/** - * Creates a new identity quat - * - * @returns {quat} a new quaternion - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - } - - out[3] = 1; - return out; -} -/** - * Set a quat to the identity quaternion - * - * @param {quat} out the receiving quaternion - * @returns {quat} out - */ - -function identity(out) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 1; - return out; -} -/** - * Sets a quat from the given angle and rotation axis, - * then returns it. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyVec3} axis the axis around which to rotate - * @param {Number} rad the angle in radians - * @returns {quat} out - **/ - -function setAxisAngle(out, axis, rad) { - rad = rad * 0.5; - var s = Math.sin(rad); - out[0] = s * axis[0]; - out[1] = s * axis[1]; - out[2] = s * axis[2]; - out[3] = Math.cos(rad); - return out; -} -/** - * Gets the rotation axis and angle for a given - * quaternion. If a quaternion is created with - * setAxisAngle, this method will return the same - * values as providied in the original parameter list - * OR functionally equivalent values. - * Example: The quaternion formed by axis [0, 0, 1] and - * angle -90 is the same as the quaternion formed by - * [0, 0, 1] and 270. This method favors the latter. - * @param {vec3} out_axis Vector receiving the axis of rotation - * @param {ReadonlyQuat} q Quaternion to be decomposed - * @return {Number} Angle, in radians, of the rotation - */ - -function getAxisAngle(out_axis, q) { - var rad = Math.acos(q[3]) * 2.0; - var s = Math.sin(rad / 2.0); - - if (s > _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - out_axis[0] = q[0] / s; - out_axis[1] = q[1] / s; - out_axis[2] = q[2] / s; - } else { - // If s is zero, return any axis (no rotation - axis does not matter) - out_axis[0] = 1; - out_axis[1] = 0; - out_axis[2] = 0; - } - - return rad; -} -/** - * Gets the angular distance between two unit quaternions - * - * @param {ReadonlyQuat} a Origin unit quaternion - * @param {ReadonlyQuat} b Destination unit quaternion - * @return {Number} Angle, in radians, between the two quaternions - */ - -function getAngle(a, b) { - var dotproduct = dot(a, b); - return Math.acos(2 * dotproduct * dotproduct - 1); -} -/** - * Multiplies two quat's - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @returns {quat} out - */ - -function multiply(out, a, b) { - var ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - var bx = b[0], - by = b[1], - bz = b[2], - bw = b[3]; - out[0] = ax * bw + aw * bx + ay * bz - az * by; - out[1] = ay * bw + aw * by + az * bx - ax * bz; - out[2] = az * bw + aw * bz + ax * by - ay * bx; - out[3] = aw * bw - ax * bx - ay * by - az * bz; - return out; -} -/** - * Rotates a quaternion by the given angle about the X axis - * - * @param {quat} out quat receiving operation result - * @param {ReadonlyQuat} a quat to rotate - * @param {number} rad angle (in radians) to rotate - * @returns {quat} out - */ - -function rotateX(out, a, rad) { - rad *= 0.5; - var ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - var bx = Math.sin(rad), - bw = Math.cos(rad); - out[0] = ax * bw + aw * bx; - out[1] = ay * bw + az * bx; - out[2] = az * bw - ay * bx; - out[3] = aw * bw - ax * bx; - return out; -} -/** - * Rotates a quaternion by the given angle about the Y axis - * - * @param {quat} out quat receiving operation result - * @param {ReadonlyQuat} a quat to rotate - * @param {number} rad angle (in radians) to rotate - * @returns {quat} out - */ - -function rotateY(out, a, rad) { - rad *= 0.5; - var ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - var by = Math.sin(rad), - bw = Math.cos(rad); - out[0] = ax * bw - az * by; - out[1] = ay * bw + aw * by; - out[2] = az * bw + ax * by; - out[3] = aw * bw - ay * by; - return out; -} -/** - * Rotates a quaternion by the given angle about the Z axis - * - * @param {quat} out quat receiving operation result - * @param {ReadonlyQuat} a quat to rotate - * @param {number} rad angle (in radians) to rotate - * @returns {quat} out - */ - -function rotateZ(out, a, rad) { - rad *= 0.5; - var ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - var bz = Math.sin(rad), - bw = Math.cos(rad); - out[0] = ax * bw + ay * bz; - out[1] = ay * bw - ax * bz; - out[2] = az * bw + aw * bz; - out[3] = aw * bw - az * bz; - return out; -} -/** - * Calculates the W component of a quat from the X, Y, and Z components. - * Assumes that quaternion is 1 unit in length. - * Any existing W component will be ignored. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate W component of - * @returns {quat} out - */ - -function calculateW(out, a) { - var x = a[0], - y = a[1], - z = a[2]; - out[0] = x; - out[1] = y; - out[2] = z; - out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z)); - return out; -} -/** - * Calculate the exponential of a unit quaternion. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate the exponential of - * @returns {quat} out - */ - -function exp(out, a) { - var x = a[0], - y = a[1], - z = a[2], - w = a[3]; - var r = Math.sqrt(x * x + y * y + z * z); - var et = Math.exp(w); - var s = r > 0 ? et * Math.sin(r) / r : 0; - out[0] = x * s; - out[1] = y * s; - out[2] = z * s; - out[3] = et * Math.cos(r); - return out; -} -/** - * Calculate the natural logarithm of a unit quaternion. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate the exponential of - * @returns {quat} out - */ - -function ln(out, a) { - var x = a[0], - y = a[1], - z = a[2], - w = a[3]; - var r = Math.sqrt(x * x + y * y + z * z); - var t = r > 0 ? Math.atan2(r, w) / r : 0; - out[0] = x * t; - out[1] = y * t; - out[2] = z * t; - out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w); - return out; -} -/** - * Calculate the scalar power of a unit quaternion. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate the exponential of - * @param {Number} b amount to scale the quaternion by - * @returns {quat} out - */ - -function pow(out, a, b) { - ln(out, a); - scale(out, out, b); - exp(out, out); - return out; -} -/** - * Performs a spherical linear interpolation between two quat - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {quat} out - */ - -function slerp(out, a, b, t) { - // benchmarks: - // http://jsperf.com/quaternion-slerp-implementations - var ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - var bx = b[0], - by = b[1], - bz = b[2], - bw = b[3]; - var omega, cosom, sinom, scale0, scale1; // calc cosine - - cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary) - - if (cosom < 0.0) { - cosom = -cosom; - bx = -bx; - by = -by; - bz = -bz; - bw = -bw; - } // calculate coefficients - - - if (1.0 - cosom > _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - // standard case (slerp) - omega = Math.acos(cosom); - sinom = Math.sin(omega); - scale0 = Math.sin((1.0 - t) * omega) / sinom; - scale1 = Math.sin(t * omega) / sinom; - } else { - // "from" and "to" quaternions are very close - // ... so we can do a linear interpolation - scale0 = 1.0 - t; - scale1 = t; - } // calculate final values - - - out[0] = scale0 * ax + scale1 * bx; - out[1] = scale0 * ay + scale1 * by; - out[2] = scale0 * az + scale1 * bz; - out[3] = scale0 * aw + scale1 * bw; - return out; -} -/** - * Generates a random unit quaternion - * - * @param {quat} out the receiving quaternion - * @returns {quat} out - */ - -function random(out) { - // Implementation of http://planning.cs.uiuc.edu/node198.html - // TODO: Calling random 3 times is probably not the fastest solution - var u1 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); - var u2 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); - var u3 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); - var sqrt1MinusU1 = Math.sqrt(1 - u1); - var sqrtU1 = Math.sqrt(u1); - out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2); - out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2); - out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3); - out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3); - return out; -} -/** - * Calculates the inverse of a quat - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate inverse of - * @returns {quat} out - */ - -function invert(out, a) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; - var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 - - out[0] = -a0 * invDot; - out[1] = -a1 * invDot; - out[2] = -a2 * invDot; - out[3] = a3 * invDot; - return out; -} -/** - * Calculates the conjugate of a quat - * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quat to calculate conjugate of - * @returns {quat} out - */ - -function conjugate(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - out[2] = -a[2]; - out[3] = a[3]; - return out; -} -/** - * Creates a quaternion from the given 3x3 rotation matrix. - * - * NOTE: The resultant quaternion is not normalized, so you should be sure - * to renormalize the quaternion yourself where necessary. - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyMat3} m rotation matrix - * @returns {quat} out - * @function - */ - -function fromMat3(out, m) { - // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes - // article "Quaternion Calculus and Fast Animation". - var fTrace = m[0] + m[4] + m[8]; - var fRoot; - - if (fTrace > 0.0) { - // |w| > 1/2, may as well choose w > 1/2 - fRoot = Math.sqrt(fTrace + 1.0); // 2w - - out[3] = 0.5 * fRoot; - fRoot = 0.5 / fRoot; // 1/(4w) - - out[0] = (m[5] - m[7]) * fRoot; - out[1] = (m[6] - m[2]) * fRoot; - out[2] = (m[1] - m[3]) * fRoot; - } else { - // |w| <= 1/2 - var i = 0; - if (m[4] > m[0]) i = 1; - if (m[8] > m[i * 3 + i]) i = 2; - var j = (i + 1) % 3; - var k = (i + 2) % 3; - fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0); - out[i] = 0.5 * fRoot; - fRoot = 0.5 / fRoot; - out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot; - out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; - out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; - } - - return out; -} -/** - * Creates a quaternion from the given euler angle x, y, z. - * - * @param {quat} out the receiving quaternion - * @param {x} Angle to rotate around X axis in degrees. - * @param {y} Angle to rotate around Y axis in degrees. - * @param {z} Angle to rotate around Z axis in degrees. - * @returns {quat} out - * @function - */ - -function fromEuler(out, x, y, z) { - var halfToRad = 0.5 * Math.PI / 180.0; - x *= halfToRad; - y *= halfToRad; - z *= halfToRad; - var sx = Math.sin(x); - var cx = Math.cos(x); - var sy = Math.sin(y); - var cy = Math.cos(y); - var sz = Math.sin(z); - var cz = Math.cos(z); - out[0] = sx * cy * cz - cx * sy * sz; - out[1] = cx * sy * cz + sx * cy * sz; - out[2] = cx * cy * sz - sx * sy * cz; - out[3] = cx * cy * cz + sx * sy * sz; - return out; -} -/** - * Returns a string representation of a quatenion - * - * @param {ReadonlyQuat} a vector to represent as a string - * @returns {String} string representation of the vector - */ - -function str(a) { - return "quat(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; -} -/** - * Creates a new quat initialized with values from an existing quaternion - * - * @param {ReadonlyQuat} a quaternion to clone - * @returns {quat} a new quaternion - * @function - */ - -var clone = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.clone; -/** - * Creates a new quat initialized with the given values - * - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @param {Number} w W component - * @returns {quat} a new quaternion - * @function - */ - -var fromValues = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.fromValues; -/** - * Copy the values from one quat to another - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the source quaternion - * @returns {quat} out - * @function - */ - -var copy = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.copy; -/** - * Set the components of a quat to the given values - * - * @param {quat} out the receiving quaternion - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @param {Number} w W component - * @returns {quat} out - * @function - */ - -var set = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.set; -/** - * Adds two quat's - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @returns {quat} out - * @function - */ - -var add = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.add; -/** - * Alias for {@link quat.multiply} - * @function - */ - -var mul = multiply; -/** - * Scales a quat by a scalar number - * - * @param {quat} out the receiving vector - * @param {ReadonlyQuat} a the vector to scale - * @param {Number} b amount to scale the vector by - * @returns {quat} out - * @function - */ - -var scale = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.scale; -/** - * Calculates the dot product of two quat's - * - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @returns {Number} dot product of a and b - * @function - */ - -var dot = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.dot; -/** - * Performs a linear interpolation between two quat's - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {quat} out - * @function - */ - -var lerp = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.lerp; -/** - * Calculates the length of a quat - * - * @param {ReadonlyQuat} a vector to calculate length of - * @returns {Number} length of a - */ - -var length = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.length; -/** - * Alias for {@link quat.length} - * @function - */ - -var len = length; -/** - * Calculates the squared length of a quat - * - * @param {ReadonlyQuat} a vector to calculate squared length of - * @returns {Number} squared length of a - * @function - */ - -var squaredLength = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.squaredLength; -/** - * Alias for {@link quat.squaredLength} - * @function - */ - -var sqrLen = squaredLength; -/** - * Normalize a quat - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a quaternion to normalize - * @returns {quat} out - * @function - */ - -var normalize = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.normalize; -/** - * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyQuat} a The first quaternion. - * @param {ReadonlyQuat} b The second quaternion. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -var exactEquals = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.exactEquals; -/** - * Returns whether or not the quaternions have approximately the same elements in the same position. - * - * @param {ReadonlyQuat} a The first vector. - * @param {ReadonlyQuat} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -var equals = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.equals; -/** - * Sets a quaternion to represent the shortest rotation from one - * vector to another. - * - * Both vectors are assumed to be unit length. - * - * @param {quat} out the receiving quaternion. - * @param {ReadonlyVec3} a the initial vector - * @param {ReadonlyVec3} b the destination vector - * @returns {quat} out - */ - -var rotationTo = function () { - var tmpvec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.create(); - var xUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.fromValues(1, 0, 0); - var yUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.fromValues(0, 1, 0); - return function (out, a, b) { - var dot = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.dot(a, b); - - if (dot < -0.999999) { - _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, xUnitVec3, a); - if (_vec3_js__WEBPACK_IMPORTED_MODULE_2__.len(tmpvec3) < 0.000001) _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, yUnitVec3, a); - _vec3_js__WEBPACK_IMPORTED_MODULE_2__.normalize(tmpvec3, tmpvec3); - setAxisAngle(out, tmpvec3, Math.PI); - return out; - } else if (dot > 0.999999) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 1; - return out; - } else { - _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, a, b); - out[0] = tmpvec3[0]; - out[1] = tmpvec3[1]; - out[2] = tmpvec3[2]; - out[3] = 1 + dot; - return normalize(out, out); - } - }; -}(); -/** - * Performs a spherical linear interpolation with two control points - * - * @param {quat} out the receiving quaternion - * @param {ReadonlyQuat} a the first operand - * @param {ReadonlyQuat} b the second operand - * @param {ReadonlyQuat} c the third operand - * @param {ReadonlyQuat} d the fourth operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {quat} out - */ - -var sqlerp = function () { - var temp1 = create(); - var temp2 = create(); - return function (out, a, b, c, d, t) { - slerp(temp1, a, d, t); - slerp(temp2, b, c, t); - slerp(out, temp1, temp2, 2 * t * (1 - t)); - return out; - }; -}(); -/** - * Sets the specified quaternion with values corresponding to the given - * axes. Each axis is a vec3 and is expected to be unit length and - * perpendicular to all other specified axes. - * - * @param {ReadonlyVec3} view the vector representing the viewing direction - * @param {ReadonlyVec3} right the vector representing the local "right" direction - * @param {ReadonlyVec3} up the vector representing the local "up" direction - * @returns {quat} out - */ - -var setAxes = function () { - var matr = _mat3_js__WEBPACK_IMPORTED_MODULE_3__.create(); - return function (out, view, right, up) { - matr[0] = right[0]; - matr[3] = right[1]; - matr[6] = right[2]; - matr[1] = up[0]; - matr[4] = up[1]; - matr[7] = up[2]; - matr[2] = -view[0]; - matr[5] = -view[1]; - matr[8] = -view[2]; - return normalize(out, fromMat3(out, matr)); - }; -}(); - -/***/ }), -/* 20 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "divide": () => (/* binding */ divide), -/* harmony export */ "ceil": () => (/* binding */ ceil), -/* harmony export */ "floor": () => (/* binding */ floor), -/* harmony export */ "min": () => (/* binding */ min), -/* harmony export */ "max": () => (/* binding */ max), -/* harmony export */ "round": () => (/* binding */ round), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), -/* harmony export */ "distance": () => (/* binding */ distance), -/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), -/* harmony export */ "length": () => (/* binding */ length), -/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), -/* harmony export */ "negate": () => (/* binding */ negate), -/* harmony export */ "inverse": () => (/* binding */ inverse), -/* harmony export */ "normalize": () => (/* binding */ normalize), -/* harmony export */ "dot": () => (/* binding */ dot), -/* harmony export */ "cross": () => (/* binding */ cross), -/* harmony export */ "lerp": () => (/* binding */ lerp), -/* harmony export */ "random": () => (/* binding */ random), -/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), -/* harmony export */ "transformQuat": () => (/* binding */ transformQuat), -/* harmony export */ "zero": () => (/* binding */ zero), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "sub": () => (/* binding */ sub), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "div": () => (/* binding */ div), -/* harmony export */ "dist": () => (/* binding */ dist), -/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), -/* harmony export */ "len": () => (/* binding */ len), -/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), -/* harmony export */ "forEach": () => (/* binding */ forEach) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); - -/** - * 4 Dimensional Vector - * @module vec4 - */ - -/** - * Creates a new, empty vec4 - * - * @returns {vec4} a new 4D vector - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 0; - } - - return out; -} -/** - * Creates a new vec4 initialized with values from an existing vector - * - * @param {ReadonlyVec4} a vector to clone - * @returns {vec4} a new 4D vector - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - return out; -} -/** - * Creates a new vec4 initialized with the given values - * - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @param {Number} w W component - * @returns {vec4} a new 4D vector - */ - -function fromValues(x, y, z, w) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); - out[0] = x; - out[1] = y; - out[2] = z; - out[3] = w; - return out; -} -/** - * Copy the values from one vec4 to another - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the source vector - * @returns {vec4} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - return out; -} -/** - * Set the components of a vec4 to the given values - * - * @param {vec4} out the receiving vector - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @param {Number} w W component - * @returns {vec4} out - */ - -function set(out, x, y, z, w) { - out[0] = x; - out[1] = y; - out[2] = z; - out[3] = w; - return out; -} -/** - * Adds two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - return out; -} -/** - * Subtracts vector b from vector a - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - out[3] = a[3] - b[3]; - return out; -} -/** - * Multiplies two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function multiply(out, a, b) { - out[0] = a[0] * b[0]; - out[1] = a[1] * b[1]; - out[2] = a[2] * b[2]; - out[3] = a[3] * b[3]; - return out; -} -/** - * Divides two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function divide(out, a, b) { - out[0] = a[0] / b[0]; - out[1] = a[1] / b[1]; - out[2] = a[2] / b[2]; - out[3] = a[3] / b[3]; - return out; -} -/** - * Math.ceil the components of a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to ceil - * @returns {vec4} out - */ - -function ceil(out, a) { - out[0] = Math.ceil(a[0]); - out[1] = Math.ceil(a[1]); - out[2] = Math.ceil(a[2]); - out[3] = Math.ceil(a[3]); - return out; -} -/** - * Math.floor the components of a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to floor - * @returns {vec4} out - */ - -function floor(out, a) { - out[0] = Math.floor(a[0]); - out[1] = Math.floor(a[1]); - out[2] = Math.floor(a[2]); - out[3] = Math.floor(a[3]); - return out; -} -/** - * Returns the minimum of two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function min(out, a, b) { - out[0] = Math.min(a[0], b[0]); - out[1] = Math.min(a[1], b[1]); - out[2] = Math.min(a[2], b[2]); - out[3] = Math.min(a[3], b[3]); - return out; -} -/** - * Returns the maximum of two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {vec4} out - */ - -function max(out, a, b) { - out[0] = Math.max(a[0], b[0]); - out[1] = Math.max(a[1], b[1]); - out[2] = Math.max(a[2], b[2]); - out[3] = Math.max(a[3], b[3]); - return out; -} -/** - * Math.round the components of a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to round - * @returns {vec4} out - */ - -function round(out, a) { - out[0] = Math.round(a[0]); - out[1] = Math.round(a[1]); - out[2] = Math.round(a[2]); - out[3] = Math.round(a[3]); - return out; -} -/** - * Scales a vec4 by a scalar number - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the vector to scale - * @param {Number} b amount to scale the vector by - * @returns {vec4} out - */ - -function scale(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - return out; -} -/** - * Adds two vec4's after scaling the second operand by a scalar value - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @param {Number} scale the amount to scale b by before adding - * @returns {vec4} out - */ - -function scaleAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - out[3] = a[3] + b[3] * scale; - return out; -} -/** - * Calculates the euclidian distance between two vec4's - * - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {Number} distance between a and b - */ - -function distance(a, b) { - var x = b[0] - a[0]; - var y = b[1] - a[1]; - var z = b[2] - a[2]; - var w = b[3] - a[3]; - return Math.hypot(x, y, z, w); -} -/** - * Calculates the squared euclidian distance between two vec4's - * - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {Number} squared distance between a and b - */ - -function squaredDistance(a, b) { - var x = b[0] - a[0]; - var y = b[1] - a[1]; - var z = b[2] - a[2]; - var w = b[3] - a[3]; - return x * x + y * y + z * z + w * w; -} -/** - * Calculates the length of a vec4 - * - * @param {ReadonlyVec4} a vector to calculate length of - * @returns {Number} length of a - */ - -function length(a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - var w = a[3]; - return Math.hypot(x, y, z, w); -} -/** - * Calculates the squared length of a vec4 - * - * @param {ReadonlyVec4} a vector to calculate squared length of - * @returns {Number} squared length of a - */ - -function squaredLength(a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - var w = a[3]; - return x * x + y * y + z * z + w * w; -} -/** - * Negates the components of a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to negate - * @returns {vec4} out - */ - -function negate(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - out[2] = -a[2]; - out[3] = -a[3]; - return out; -} -/** - * Returns the inverse of the components of a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to invert - * @returns {vec4} out - */ - -function inverse(out, a) { - out[0] = 1.0 / a[0]; - out[1] = 1.0 / a[1]; - out[2] = 1.0 / a[2]; - out[3] = 1.0 / a[3]; - return out; -} -/** - * Normalize a vec4 - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a vector to normalize - * @returns {vec4} out - */ - -function normalize(out, a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - var w = a[3]; - var len = x * x + y * y + z * z + w * w; - - if (len > 0) { - len = 1 / Math.sqrt(len); - } - - out[0] = x * len; - out[1] = y * len; - out[2] = z * len; - out[3] = w * len; - return out; -} -/** - * Calculates the dot product of two vec4's - * - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @returns {Number} dot product of a and b - */ - -function dot(a, b) { - return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; -} -/** - * Returns the cross-product of three vectors in a 4-dimensional space - * - * @param {ReadonlyVec4} result the receiving vector - * @param {ReadonlyVec4} U the first vector - * @param {ReadonlyVec4} V the second vector - * @param {ReadonlyVec4} W the third vector - * @returns {vec4} result - */ - -function cross(out, u, v, w) { - var A = v[0] * w[1] - v[1] * w[0], - B = v[0] * w[2] - v[2] * w[0], - C = v[0] * w[3] - v[3] * w[0], - D = v[1] * w[2] - v[2] * w[1], - E = v[1] * w[3] - v[3] * w[1], - F = v[2] * w[3] - v[3] * w[2]; - var G = u[0]; - var H = u[1]; - var I = u[2]; - var J = u[3]; - out[0] = H * F - I * E + J * D; - out[1] = -(G * F) + I * C - J * B; - out[2] = G * E - H * C + J * A; - out[3] = -(G * D) + H * B - I * A; - return out; -} -/** - * Performs a linear interpolation between two vec4's - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the first operand - * @param {ReadonlyVec4} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {vec4} out - */ - -function lerp(out, a, b, t) { - var ax = a[0]; - var ay = a[1]; - var az = a[2]; - var aw = a[3]; - out[0] = ax + t * (b[0] - ax); - out[1] = ay + t * (b[1] - ay); - out[2] = az + t * (b[2] - az); - out[3] = aw + t * (b[3] - aw); - return out; -} -/** - * Generates a random vector with the given scale - * - * @param {vec4} out the receiving vector - * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned - * @returns {vec4} out - */ - -function random(out, scale) { - scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a - // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646. - // http://projecteuclid.org/euclid.aoms/1177692644; - - var v1, v2, v3, v4; - var s1, s2; - - do { - v1 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; - v2 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; - s1 = v1 * v1 + v2 * v2; - } while (s1 >= 1); - - do { - v3 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; - v4 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; - s2 = v3 * v3 + v4 * v4; - } while (s2 >= 1); - - var d = Math.sqrt((1 - s1) / s2); - out[0] = scale * v1; - out[1] = scale * v2; - out[2] = scale * v3 * d; - out[3] = scale * v4 * d; - return out; -} -/** - * Transforms the vec4 with a mat4. - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the vector to transform - * @param {ReadonlyMat4} m matrix to transform with - * @returns {vec4} out - */ - -function transformMat4(out, a, m) { - var x = a[0], - y = a[1], - z = a[2], - w = a[3]; - out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; - out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; - out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; - out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; - return out; -} -/** - * Transforms the vec4 with a quat - * - * @param {vec4} out the receiving vector - * @param {ReadonlyVec4} a the vector to transform - * @param {ReadonlyQuat} q quaternion to transform with - * @returns {vec4} out - */ - -function transformQuat(out, a, q) { - var x = a[0], - y = a[1], - z = a[2]; - var qx = q[0], - qy = q[1], - qz = q[2], - qw = q[3]; // calculate quat * vec - - var ix = qw * x + qy * z - qz * y; - var iy = qw * y + qz * x - qx * z; - var iz = qw * z + qx * y - qy * x; - var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat - - out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy; - out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz; - out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx; - out[3] = a[3]; - return out; -} -/** - * Set the components of a vec4 to zero - * - * @param {vec4} out the receiving vector - * @returns {vec4} out - */ - -function zero(out) { - out[0] = 0.0; - out[1] = 0.0; - out[2] = 0.0; - out[3] = 0.0; - return out; -} -/** - * Returns a string representation of a vector - * - * @param {ReadonlyVec4} a vector to represent as a string - * @returns {String} string representation of the vector - */ - -function str(a) { - return "vec4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; -} -/** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyVec4} a The first vector. - * @param {ReadonlyVec4} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; -} -/** - * Returns whether or not the vectors have approximately the same elements in the same position. - * - * @param {ReadonlyVec4} a The first vector. - * @param {ReadonlyVec4} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)); -} -/** - * Alias for {@link vec4.subtract} - * @function - */ - -var sub = subtract; -/** - * Alias for {@link vec4.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link vec4.divide} - * @function - */ - -var div = divide; -/** - * Alias for {@link vec4.distance} - * @function - */ - -var dist = distance; -/** - * Alias for {@link vec4.squaredDistance} - * @function - */ - -var sqrDist = squaredDistance; -/** - * Alias for {@link vec4.length} - * @function - */ - -var len = length; -/** - * Alias for {@link vec4.squaredLength} - * @function - */ - -var sqrLen = squaredLength; -/** - * Perform some operation over an array of vec4s. - * - * @param {Array} a the array of vectors to iterate over - * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed - * @param {Number} offset Number of elements to skip at the beginning of the array - * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array - * @param {Function} fn Function to call for each vector in the array - * @param {Object} [arg] additional argument to pass to fn - * @returns {Array} a - * @function - */ - -var forEach = function () { - var vec = create(); - return function (a, stride, offset, count, fn, arg) { - var i, l; - - if (!stride) { - stride = 4; - } - - if (!offset) { - offset = 0; - } - - if (count) { - l = Math.min(count * stride + offset, a.length); - } else { - l = a.length; - } - - for (i = offset; i < l; i += stride) { - vec[0] = a[i]; - vec[1] = a[i + 1]; - vec[2] = a[i + 2]; - vec[3] = a[i + 3]; - fn(vec, vec, arg); - a[i] = vec[0]; - a[i + 1] = vec[1]; - a[i + 2] = vec[2]; - a[i + 3] = vec[3]; - } - - return a; - }; -}(); - -/***/ }), -/* 21 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "length": () => (/* binding */ length), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "divide": () => (/* binding */ divide), -/* harmony export */ "ceil": () => (/* binding */ ceil), -/* harmony export */ "floor": () => (/* binding */ floor), -/* harmony export */ "min": () => (/* binding */ min), -/* harmony export */ "max": () => (/* binding */ max), -/* harmony export */ "round": () => (/* binding */ round), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), -/* harmony export */ "distance": () => (/* binding */ distance), -/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), -/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), -/* harmony export */ "negate": () => (/* binding */ negate), -/* harmony export */ "inverse": () => (/* binding */ inverse), -/* harmony export */ "normalize": () => (/* binding */ normalize), -/* harmony export */ "dot": () => (/* binding */ dot), -/* harmony export */ "cross": () => (/* binding */ cross), -/* harmony export */ "lerp": () => (/* binding */ lerp), -/* harmony export */ "hermite": () => (/* binding */ hermite), -/* harmony export */ "bezier": () => (/* binding */ bezier), -/* harmony export */ "random": () => (/* binding */ random), -/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), -/* harmony export */ "transformMat3": () => (/* binding */ transformMat3), -/* harmony export */ "transformQuat": () => (/* binding */ transformQuat), -/* harmony export */ "rotateX": () => (/* binding */ rotateX), -/* harmony export */ "rotateY": () => (/* binding */ rotateY), -/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), -/* harmony export */ "angle": () => (/* binding */ angle), -/* harmony export */ "zero": () => (/* binding */ zero), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "sub": () => (/* binding */ sub), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "div": () => (/* binding */ div), -/* harmony export */ "dist": () => (/* binding */ dist), -/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), -/* harmony export */ "len": () => (/* binding */ len), -/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), -/* harmony export */ "forEach": () => (/* binding */ forEach) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); - -/** - * 3 Dimensional Vector - * @module vec3 - */ - -/** - * Creates a new, empty vec3 - * - * @returns {vec3} a new 3D vector - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - } - - return out; -} -/** - * Creates a new vec3 initialized with values from an existing vector - * - * @param {ReadonlyVec3} a vector to clone - * @returns {vec3} a new 3D vector - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - return out; -} -/** - * Calculates the length of a vec3 - * - * @param {ReadonlyVec3} a vector to calculate length of - * @returns {Number} length of a - */ - -function length(a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - return Math.hypot(x, y, z); -} -/** - * Creates a new vec3 initialized with the given values - * - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @returns {vec3} a new 3D vector - */ - -function fromValues(x, y, z) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - out[0] = x; - out[1] = y; - out[2] = z; - return out; -} -/** - * Copy the values from one vec3 to another - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the source vector - * @returns {vec3} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - return out; -} -/** - * Set the components of a vec3 to the given values - * - * @param {vec3} out the receiving vector - * @param {Number} x X component - * @param {Number} y Y component - * @param {Number} z Z component - * @returns {vec3} out - */ - -function set(out, x, y, z) { - out[0] = x; - out[1] = y; - out[2] = z; - return out; -} -/** - * Adds two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - return out; -} -/** - * Subtracts vector b from vector a - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - out[2] = a[2] - b[2]; - return out; -} -/** - * Multiplies two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function multiply(out, a, b) { - out[0] = a[0] * b[0]; - out[1] = a[1] * b[1]; - out[2] = a[2] * b[2]; - return out; -} -/** - * Divides two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function divide(out, a, b) { - out[0] = a[0] / b[0]; - out[1] = a[1] / b[1]; - out[2] = a[2] / b[2]; - return out; -} -/** - * Math.ceil the components of a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to ceil - * @returns {vec3} out - */ - -function ceil(out, a) { - out[0] = Math.ceil(a[0]); - out[1] = Math.ceil(a[1]); - out[2] = Math.ceil(a[2]); - return out; -} -/** - * Math.floor the components of a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to floor - * @returns {vec3} out - */ - -function floor(out, a) { - out[0] = Math.floor(a[0]); - out[1] = Math.floor(a[1]); - out[2] = Math.floor(a[2]); - return out; -} -/** - * Returns the minimum of two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function min(out, a, b) { - out[0] = Math.min(a[0], b[0]); - out[1] = Math.min(a[1], b[1]); - out[2] = Math.min(a[2], b[2]); - return out; -} -/** - * Returns the maximum of two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function max(out, a, b) { - out[0] = Math.max(a[0], b[0]); - out[1] = Math.max(a[1], b[1]); - out[2] = Math.max(a[2], b[2]); - return out; -} -/** - * Math.round the components of a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to round - * @returns {vec3} out - */ - -function round(out, a) { - out[0] = Math.round(a[0]); - out[1] = Math.round(a[1]); - out[2] = Math.round(a[2]); - return out; -} -/** - * Scales a vec3 by a scalar number - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the vector to scale - * @param {Number} b amount to scale the vector by - * @returns {vec3} out - */ - -function scale(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - return out; -} -/** - * Adds two vec3's after scaling the second operand by a scalar value - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @param {Number} scale the amount to scale b by before adding - * @returns {vec3} out - */ - -function scaleAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - out[2] = a[2] + b[2] * scale; - return out; -} -/** - * Calculates the euclidian distance between two vec3's - * - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {Number} distance between a and b - */ - -function distance(a, b) { - var x = b[0] - a[0]; - var y = b[1] - a[1]; - var z = b[2] - a[2]; - return Math.hypot(x, y, z); -} -/** - * Calculates the squared euclidian distance between two vec3's - * - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {Number} squared distance between a and b - */ - -function squaredDistance(a, b) { - var x = b[0] - a[0]; - var y = b[1] - a[1]; - var z = b[2] - a[2]; - return x * x + y * y + z * z; -} -/** - * Calculates the squared length of a vec3 - * - * @param {ReadonlyVec3} a vector to calculate squared length of - * @returns {Number} squared length of a - */ - -function squaredLength(a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - return x * x + y * y + z * z; -} -/** - * Negates the components of a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to negate - * @returns {vec3} out - */ - -function negate(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - out[2] = -a[2]; - return out; -} -/** - * Returns the inverse of the components of a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to invert - * @returns {vec3} out - */ - -function inverse(out, a) { - out[0] = 1.0 / a[0]; - out[1] = 1.0 / a[1]; - out[2] = 1.0 / a[2]; - return out; -} -/** - * Normalize a vec3 - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a vector to normalize - * @returns {vec3} out - */ - -function normalize(out, a) { - var x = a[0]; - var y = a[1]; - var z = a[2]; - var len = x * x + y * y + z * z; - - if (len > 0) { - //TODO: evaluate use of glm_invsqrt here? - len = 1 / Math.sqrt(len); - } - - out[0] = a[0] * len; - out[1] = a[1] * len; - out[2] = a[2] * len; - return out; -} -/** - * Calculates the dot product of two vec3's - * - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {Number} dot product of a and b - */ - -function dot(a, b) { - return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; -} -/** - * Computes the cross product of two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @returns {vec3} out - */ - -function cross(out, a, b) { - var ax = a[0], - ay = a[1], - az = a[2]; - var bx = b[0], - by = b[1], - bz = b[2]; - out[0] = ay * bz - az * by; - out[1] = az * bx - ax * bz; - out[2] = ax * by - ay * bx; - return out; -} -/** - * Performs a linear interpolation between two vec3's - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {vec3} out - */ - -function lerp(out, a, b, t) { - var ax = a[0]; - var ay = a[1]; - var az = a[2]; - out[0] = ax + t * (b[0] - ax); - out[1] = ay + t * (b[1] - ay); - out[2] = az + t * (b[2] - az); - return out; -} -/** - * Performs a hermite interpolation with two control points - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @param {ReadonlyVec3} c the third operand - * @param {ReadonlyVec3} d the fourth operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {vec3} out - */ - -function hermite(out, a, b, c, d, t) { - var factorTimes2 = t * t; - var factor1 = factorTimes2 * (2 * t - 3) + 1; - var factor2 = factorTimes2 * (t - 2) + t; - var factor3 = factorTimes2 * (t - 1); - var factor4 = factorTimes2 * (3 - 2 * t); - out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; - out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; - out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; - return out; -} -/** - * Performs a bezier interpolation with two control points - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the first operand - * @param {ReadonlyVec3} b the second operand - * @param {ReadonlyVec3} c the third operand - * @param {ReadonlyVec3} d the fourth operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {vec3} out - */ - -function bezier(out, a, b, c, d, t) { - var inverseFactor = 1 - t; - var inverseFactorTimesTwo = inverseFactor * inverseFactor; - var factorTimes2 = t * t; - var factor1 = inverseFactorTimesTwo * inverseFactor; - var factor2 = 3 * t * inverseFactorTimesTwo; - var factor3 = 3 * factorTimes2 * inverseFactor; - var factor4 = factorTimes2 * t; - out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; - out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; - out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; - return out; -} -/** - * Generates a random vector with the given scale - * - * @param {vec3} out the receiving vector - * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned - * @returns {vec3} out - */ - -function random(out, scale) { - scale = scale || 1.0; - var r = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 * Math.PI; - var z = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 - 1.0; - var zScale = Math.sqrt(1.0 - z * z) * scale; - out[0] = Math.cos(r) * zScale; - out[1] = Math.sin(r) * zScale; - out[2] = z * scale; - return out; -} -/** - * Transforms the vec3 with a mat4. - * 4th vector component is implicitly '1' - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the vector to transform - * @param {ReadonlyMat4} m matrix to transform with - * @returns {vec3} out - */ - -function transformMat4(out, a, m) { - var x = a[0], - y = a[1], - z = a[2]; - var w = m[3] * x + m[7] * y + m[11] * z + m[15]; - w = w || 1.0; - out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w; - out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w; - out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w; - return out; -} -/** - * Transforms the vec3 with a mat3. - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the vector to transform - * @param {ReadonlyMat3} m the 3x3 matrix to transform with - * @returns {vec3} out - */ - -function transformMat3(out, a, m) { - var x = a[0], - y = a[1], - z = a[2]; - out[0] = x * m[0] + y * m[3] + z * m[6]; - out[1] = x * m[1] + y * m[4] + z * m[7]; - out[2] = x * m[2] + y * m[5] + z * m[8]; - return out; -} -/** - * Transforms the vec3 with a quat - * Can also be used for dual quaternions. (Multiply it with the real part) - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec3} a the vector to transform - * @param {ReadonlyQuat} q quaternion to transform with - * @returns {vec3} out - */ - -function transformQuat(out, a, q) { - // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed - var qx = q[0], - qy = q[1], - qz = q[2], - qw = q[3]; - var x = a[0], - y = a[1], - z = a[2]; // var qvec = [qx, qy, qz]; - // var uv = vec3.cross([], qvec, a); - - var uvx = qy * z - qz * y, - uvy = qz * x - qx * z, - uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv); - - var uuvx = qy * uvz - qz * uvy, - uuvy = qz * uvx - qx * uvz, - uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w); - - var w2 = qw * 2; - uvx *= w2; - uvy *= w2; - uvz *= w2; // vec3.scale(uuv, uuv, 2); - - uuvx *= 2; - uuvy *= 2; - uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv)); - - out[0] = x + uvx + uuvx; - out[1] = y + uvy + uuvy; - out[2] = z + uvz + uuvz; - return out; -} -/** - * Rotate a 3D vector around the x-axis - * @param {vec3} out The receiving vec3 - * @param {ReadonlyVec3} a The vec3 point to rotate - * @param {ReadonlyVec3} b The origin of the rotation - * @param {Number} rad The angle of rotation in radians - * @returns {vec3} out - */ - -function rotateX(out, a, b, rad) { - var p = [], - r = []; //Translate point to the origin - - p[0] = a[0] - b[0]; - p[1] = a[1] - b[1]; - p[2] = a[2] - b[2]; //perform rotation - - r[0] = p[0]; - r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad); - r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position - - out[0] = r[0] + b[0]; - out[1] = r[1] + b[1]; - out[2] = r[2] + b[2]; - return out; -} -/** - * Rotate a 3D vector around the y-axis - * @param {vec3} out The receiving vec3 - * @param {ReadonlyVec3} a The vec3 point to rotate - * @param {ReadonlyVec3} b The origin of the rotation - * @param {Number} rad The angle of rotation in radians - * @returns {vec3} out - */ - -function rotateY(out, a, b, rad) { - var p = [], - r = []; //Translate point to the origin - - p[0] = a[0] - b[0]; - p[1] = a[1] - b[1]; - p[2] = a[2] - b[2]; //perform rotation - - r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad); - r[1] = p[1]; - r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position - - out[0] = r[0] + b[0]; - out[1] = r[1] + b[1]; - out[2] = r[2] + b[2]; - return out; -} -/** - * Rotate a 3D vector around the z-axis - * @param {vec3} out The receiving vec3 - * @param {ReadonlyVec3} a The vec3 point to rotate - * @param {ReadonlyVec3} b The origin of the rotation - * @param {Number} rad The angle of rotation in radians - * @returns {vec3} out - */ - -function rotateZ(out, a, b, rad) { - var p = [], - r = []; //Translate point to the origin - - p[0] = a[0] - b[0]; - p[1] = a[1] - b[1]; - p[2] = a[2] - b[2]; //perform rotation - - r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad); - r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad); - r[2] = p[2]; //translate to correct position - - out[0] = r[0] + b[0]; - out[1] = r[1] + b[1]; - out[2] = r[2] + b[2]; - return out; -} -/** - * Get the angle between two 3D vectors - * @param {ReadonlyVec3} a The first operand - * @param {ReadonlyVec3} b The second operand - * @returns {Number} The angle in radians - */ - -function angle(a, b) { - var ax = a[0], - ay = a[1], - az = a[2], - bx = b[0], - by = b[1], - bz = b[2], - mag1 = Math.sqrt(ax * ax + ay * ay + az * az), - mag2 = Math.sqrt(bx * bx + by * by + bz * bz), - mag = mag1 * mag2, - cosine = mag && dot(a, b) / mag; - return Math.acos(Math.min(Math.max(cosine, -1), 1)); -} -/** - * Set the components of a vec3 to zero - * - * @param {vec3} out the receiving vector - * @returns {vec3} out - */ - -function zero(out) { - out[0] = 0.0; - out[1] = 0.0; - out[2] = 0.0; - return out; -} -/** - * Returns a string representation of a vector - * - * @param {ReadonlyVec3} a vector to represent as a string - * @returns {String} string representation of the vector - */ - -function str(a) { - return "vec3(" + a[0] + ", " + a[1] + ", " + a[2] + ")"; -} -/** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyVec3} a The first vector. - * @param {ReadonlyVec3} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; -} -/** - * Returns whether or not the vectors have approximately the same elements in the same position. - * - * @param {ReadonlyVec3} a The first vector. - * @param {ReadonlyVec3} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2]; - var b0 = b[0], - b1 = b[1], - b2 = b[2]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)); -} -/** - * Alias for {@link vec3.subtract} - * @function - */ - -var sub = subtract; -/** - * Alias for {@link vec3.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link vec3.divide} - * @function - */ - -var div = divide; -/** - * Alias for {@link vec3.distance} - * @function - */ - -var dist = distance; -/** - * Alias for {@link vec3.squaredDistance} - * @function - */ - -var sqrDist = squaredDistance; -/** - * Alias for {@link vec3.length} - * @function - */ - -var len = length; -/** - * Alias for {@link vec3.squaredLength} - * @function - */ - -var sqrLen = squaredLength; -/** - * Perform some operation over an array of vec3s. - * - * @param {Array} a the array of vectors to iterate over - * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed - * @param {Number} offset Number of elements to skip at the beginning of the array - * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array - * @param {Function} fn Function to call for each vector in the array - * @param {Object} [arg] additional argument to pass to fn - * @returns {Array} a - * @function - */ - -var forEach = function () { - var vec = create(); - return function (a, stride, offset, count, fn, arg) { - var i, l; - - if (!stride) { - stride = 3; - } - - if (!offset) { - offset = 0; - } - - if (count) { - l = Math.min(count * stride + offset, a.length); - } else { - l = a.length; - } - - for (i = offset; i < l; i += stride) { - vec[0] = a[i]; - vec[1] = a[i + 1]; - vec[2] = a[i + 2]; - fn(vec, vec, arg); - a[i] = vec[0]; - a[i + 1] = vec[1]; - a[i + 2] = vec[2]; - } - - return a; - }; -}(); - -/***/ }), -/* 22 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "fromRotationTranslationValues": () => (/* binding */ fromRotationTranslationValues), -/* harmony export */ "fromRotationTranslation": () => (/* binding */ fromRotationTranslation), -/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), -/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), -/* harmony export */ "fromMat4": () => (/* binding */ fromMat4), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "getReal": () => (/* binding */ getReal), -/* harmony export */ "getDual": () => (/* binding */ getDual), -/* harmony export */ "setReal": () => (/* binding */ setReal), -/* harmony export */ "setDual": () => (/* binding */ setDual), -/* harmony export */ "getTranslation": () => (/* binding */ getTranslation), -/* harmony export */ "translate": () => (/* binding */ translate), -/* harmony export */ "rotateX": () => (/* binding */ rotateX), -/* harmony export */ "rotateY": () => (/* binding */ rotateY), -/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), -/* harmony export */ "rotateByQuatAppend": () => (/* binding */ rotateByQuatAppend), -/* harmony export */ "rotateByQuatPrepend": () => (/* binding */ rotateByQuatPrepend), -/* harmony export */ "rotateAroundAxis": () => (/* binding */ rotateAroundAxis), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "dot": () => (/* binding */ dot), -/* harmony export */ "lerp": () => (/* binding */ lerp), -/* harmony export */ "invert": () => (/* binding */ invert), -/* harmony export */ "conjugate": () => (/* binding */ conjugate), -/* harmony export */ "length": () => (/* binding */ length), -/* harmony export */ "len": () => (/* binding */ len), -/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), -/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), -/* harmony export */ "normalize": () => (/* binding */ normalize), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); -/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19); -/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18); - - - -/** - * Dual Quaternion
- * Format: [real, dual]
- * Quaternion format: XYZW
- * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
- * @module quat2 - */ - -/** - * Creates a new identity dual quat - * - * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation] - */ - -function create() { - var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - dq[0] = 0; - dq[1] = 0; - dq[2] = 0; - dq[4] = 0; - dq[5] = 0; - dq[6] = 0; - dq[7] = 0; - } - - dq[3] = 1; - return dq; -} -/** - * Creates a new quat initialized with values from an existing quaternion - * - * @param {ReadonlyQuat2} a dual quaternion to clone - * @returns {quat2} new dual quaternion - * @function - */ - -function clone(a) { - var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); - dq[0] = a[0]; - dq[1] = a[1]; - dq[2] = a[2]; - dq[3] = a[3]; - dq[4] = a[4]; - dq[5] = a[5]; - dq[6] = a[6]; - dq[7] = a[7]; - return dq; -} -/** - * Creates a new dual quat initialized with the given values - * - * @param {Number} x1 X component - * @param {Number} y1 Y component - * @param {Number} z1 Z component - * @param {Number} w1 W component - * @param {Number} x2 X component - * @param {Number} y2 Y component - * @param {Number} z2 Z component - * @param {Number} w2 W component - * @returns {quat2} new dual quaternion - * @function - */ - -function fromValues(x1, y1, z1, w1, x2, y2, z2, w2) { - var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); - dq[0] = x1; - dq[1] = y1; - dq[2] = z1; - dq[3] = w1; - dq[4] = x2; - dq[5] = y2; - dq[6] = z2; - dq[7] = w2; - return dq; -} -/** - * Creates a new dual quat from the given values (quat and translation) - * - * @param {Number} x1 X component - * @param {Number} y1 Y component - * @param {Number} z1 Z component - * @param {Number} w1 W component - * @param {Number} x2 X component (translation) - * @param {Number} y2 Y component (translation) - * @param {Number} z2 Z component (translation) - * @returns {quat2} new dual quaternion - * @function - */ - -function fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) { - var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); - dq[0] = x1; - dq[1] = y1; - dq[2] = z1; - dq[3] = w1; - var ax = x2 * 0.5, - ay = y2 * 0.5, - az = z2 * 0.5; - dq[4] = ax * w1 + ay * z1 - az * y1; - dq[5] = ay * w1 + az * x1 - ax * z1; - dq[6] = az * w1 + ax * y1 - ay * x1; - dq[7] = -ax * x1 - ay * y1 - az * z1; - return dq; -} -/** - * Creates a dual quat from a quaternion and a translation - * - * @param {ReadonlyQuat2} dual quaternion receiving operation result - * @param {ReadonlyQuat} q a normalized quaternion - * @param {ReadonlyVec3} t tranlation vector - * @returns {quat2} dual quaternion receiving operation result - * @function - */ - -function fromRotationTranslation(out, q, t) { - var ax = t[0] * 0.5, - ay = t[1] * 0.5, - az = t[2] * 0.5, - bx = q[0], - by = q[1], - bz = q[2], - bw = q[3]; - out[0] = bx; - out[1] = by; - out[2] = bz; - out[3] = bw; - out[4] = ax * bw + ay * bz - az * by; - out[5] = ay * bw + az * bx - ax * bz; - out[6] = az * bw + ax * by - ay * bx; - out[7] = -ax * bx - ay * by - az * bz; - return out; -} -/** - * Creates a dual quat from a translation - * - * @param {ReadonlyQuat2} dual quaternion receiving operation result - * @param {ReadonlyVec3} t translation vector - * @returns {quat2} dual quaternion receiving operation result - * @function - */ - -function fromTranslation(out, t) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 1; - out[4] = t[0] * 0.5; - out[5] = t[1] * 0.5; - out[6] = t[2] * 0.5; - out[7] = 0; - return out; -} -/** - * Creates a dual quat from a quaternion - * - * @param {ReadonlyQuat2} dual quaternion receiving operation result - * @param {ReadonlyQuat} q the quaternion - * @returns {quat2} dual quaternion receiving operation result - * @function - */ - -function fromRotation(out, q) { - out[0] = q[0]; - out[1] = q[1]; - out[2] = q[2]; - out[3] = q[3]; - out[4] = 0; - out[5] = 0; - out[6] = 0; - out[7] = 0; - return out; -} -/** - * Creates a new dual quat from a matrix (4x4) - * - * @param {quat2} out the dual quaternion - * @param {ReadonlyMat4} a the matrix - * @returns {quat2} dual quat receiving operation result - * @function - */ - -function fromMat4(out, a) { - //TODO Optimize this - var outer = _quat_js__WEBPACK_IMPORTED_MODULE_1__.create(); - _mat4_js__WEBPACK_IMPORTED_MODULE_2__.getRotation(outer, a); - var t = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); - _mat4_js__WEBPACK_IMPORTED_MODULE_2__.getTranslation(t, a); - fromRotationTranslation(out, outer, t); - return out; -} -/** - * Copy the values from one dual quat to another - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the source dual quaternion - * @returns {quat2} out - * @function - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - return out; -} -/** - * Set a dual quat to the identity dual quaternion - * - * @param {quat2} out the receiving quaternion - * @returns {quat2} out - */ - -function identity(out) { - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 1; - out[4] = 0; - out[5] = 0; - out[6] = 0; - out[7] = 0; - return out; -} -/** - * Set the components of a dual quat to the given values - * - * @param {quat2} out the receiving quaternion - * @param {Number} x1 X component - * @param {Number} y1 Y component - * @param {Number} z1 Z component - * @param {Number} w1 W component - * @param {Number} x2 X component - * @param {Number} y2 Y component - * @param {Number} z2 Z component - * @param {Number} w2 W component - * @returns {quat2} out - * @function - */ - -function set(out, x1, y1, z1, w1, x2, y2, z2, w2) { - out[0] = x1; - out[1] = y1; - out[2] = z1; - out[3] = w1; - out[4] = x2; - out[5] = y2; - out[6] = z2; - out[7] = w2; - return out; -} -/** - * Gets the real part of a dual quat - * @param {quat} out real part - * @param {ReadonlyQuat2} a Dual Quaternion - * @return {quat} real part - */ - -var getReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__.copy; -/** - * Gets the dual part of a dual quat - * @param {quat} out dual part - * @param {ReadonlyQuat2} a Dual Quaternion - * @return {quat} dual part - */ - -function getDual(out, a) { - out[0] = a[4]; - out[1] = a[5]; - out[2] = a[6]; - out[3] = a[7]; - return out; -} -/** - * Set the real component of a dual quat to the given quaternion - * - * @param {quat2} out the receiving quaternion - * @param {ReadonlyQuat} q a quaternion representing the real part - * @returns {quat2} out - * @function - */ - -var setReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__.copy; -/** - * Set the dual component of a dual quat to the given quaternion - * - * @param {quat2} out the receiving quaternion - * @param {ReadonlyQuat} q a quaternion representing the dual part - * @returns {quat2} out - * @function - */ - -function setDual(out, q) { - out[4] = q[0]; - out[5] = q[1]; - out[6] = q[2]; - out[7] = q[3]; - return out; -} -/** - * Gets the translation of a normalized dual quat - * @param {vec3} out translation - * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed - * @return {vec3} translation - */ - -function getTranslation(out, a) { - var ax = a[4], - ay = a[5], - az = a[6], - aw = a[7], - bx = -a[0], - by = -a[1], - bz = -a[2], - bw = a[3]; - out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; - out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; - out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; - return out; -} -/** - * Translates a dual quat by the given vector - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to translate - * @param {ReadonlyVec3} v vector to translate by - * @returns {quat2} out - */ - -function translate(out, a, v) { - var ax1 = a[0], - ay1 = a[1], - az1 = a[2], - aw1 = a[3], - bx1 = v[0] * 0.5, - by1 = v[1] * 0.5, - bz1 = v[2] * 0.5, - ax2 = a[4], - ay2 = a[5], - az2 = a[6], - aw2 = a[7]; - out[0] = ax1; - out[1] = ay1; - out[2] = az1; - out[3] = aw1; - out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2; - out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2; - out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2; - out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2; - return out; -} -/** - * Rotates a dual quat around the X axis - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @param {number} rad how far should the rotation be - * @returns {quat2} out - */ - -function rotateX(out, a, rad) { - var bx = -a[0], - by = -a[1], - bz = -a[2], - bw = a[3], - ax = a[4], - ay = a[5], - az = a[6], - aw = a[7], - ax1 = ax * bw + aw * bx + ay * bz - az * by, - ay1 = ay * bw + aw * by + az * bx - ax * bz, - az1 = az * bw + aw * bz + ax * by - ay * bx, - aw1 = aw * bw - ax * bx - ay * by - az * bz; - _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateX(out, a, rad); - bx = out[0]; - by = out[1]; - bz = out[2]; - bw = out[3]; - out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; - out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; - out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; - out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; - return out; -} -/** - * Rotates a dual quat around the Y axis - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @param {number} rad how far should the rotation be - * @returns {quat2} out - */ - -function rotateY(out, a, rad) { - var bx = -a[0], - by = -a[1], - bz = -a[2], - bw = a[3], - ax = a[4], - ay = a[5], - az = a[6], - aw = a[7], - ax1 = ax * bw + aw * bx + ay * bz - az * by, - ay1 = ay * bw + aw * by + az * bx - ax * bz, - az1 = az * bw + aw * bz + ax * by - ay * bx, - aw1 = aw * bw - ax * bx - ay * by - az * bz; - _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateY(out, a, rad); - bx = out[0]; - by = out[1]; - bz = out[2]; - bw = out[3]; - out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; - out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; - out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; - out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; - return out; -} -/** - * Rotates a dual quat around the Z axis - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @param {number} rad how far should the rotation be - * @returns {quat2} out - */ - -function rotateZ(out, a, rad) { - var bx = -a[0], - by = -a[1], - bz = -a[2], - bw = a[3], - ax = a[4], - ay = a[5], - az = a[6], - aw = a[7], - ax1 = ax * bw + aw * bx + ay * bz - az * by, - ay1 = ay * bw + aw * by + az * bx - ax * bz, - az1 = az * bw + aw * bz + ax * by - ay * bx, - aw1 = aw * bw - ax * bx - ay * by - az * bz; - _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateZ(out, a, rad); - bx = out[0]; - by = out[1]; - bz = out[2]; - bw = out[3]; - out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; - out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; - out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; - out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; - return out; -} -/** - * Rotates a dual quat by a given quaternion (a * q) - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @param {ReadonlyQuat} q quaternion to rotate by - * @returns {quat2} out - */ - -function rotateByQuatAppend(out, a, q) { - var qx = q[0], - qy = q[1], - qz = q[2], - qw = q[3], - ax = a[0], - ay = a[1], - az = a[2], - aw = a[3]; - out[0] = ax * qw + aw * qx + ay * qz - az * qy; - out[1] = ay * qw + aw * qy + az * qx - ax * qz; - out[2] = az * qw + aw * qz + ax * qy - ay * qx; - out[3] = aw * qw - ax * qx - ay * qy - az * qz; - ax = a[4]; - ay = a[5]; - az = a[6]; - aw = a[7]; - out[4] = ax * qw + aw * qx + ay * qz - az * qy; - out[5] = ay * qw + aw * qy + az * qx - ax * qz; - out[6] = az * qw + aw * qz + ax * qy - ay * qx; - out[7] = aw * qw - ax * qx - ay * qy - az * qz; - return out; -} -/** - * Rotates a dual quat by a given quaternion (q * a) - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat} q quaternion to rotate by - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @returns {quat2} out - */ - -function rotateByQuatPrepend(out, q, a) { - var qx = q[0], - qy = q[1], - qz = q[2], - qw = q[3], - bx = a[0], - by = a[1], - bz = a[2], - bw = a[3]; - out[0] = qx * bw + qw * bx + qy * bz - qz * by; - out[1] = qy * bw + qw * by + qz * bx - qx * bz; - out[2] = qz * bw + qw * bz + qx * by - qy * bx; - out[3] = qw * bw - qx * bx - qy * by - qz * bz; - bx = a[4]; - by = a[5]; - bz = a[6]; - bw = a[7]; - out[4] = qx * bw + qw * bx + qy * bz - qz * by; - out[5] = qy * bw + qw * by + qz * bx - qx * bz; - out[6] = qz * bw + qw * bz + qx * by - qy * bx; - out[7] = qw * bw - qx * bx - qy * by - qz * bz; - return out; -} -/** - * Rotates a dual quat around a given axis. Does the normalisation automatically - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the dual quaternion to rotate - * @param {ReadonlyVec3} axis the axis to rotate around - * @param {Number} rad how far the rotation should be - * @returns {quat2} out - */ - -function rotateAroundAxis(out, a, axis, rad) { - //Special case for rad = 0 - if (Math.abs(rad) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { - return copy(out, a); - } - - var axisLength = Math.hypot(axis[0], axis[1], axis[2]); - rad = rad * 0.5; - var s = Math.sin(rad); - var bx = s * axis[0] / axisLength; - var by = s * axis[1] / axisLength; - var bz = s * axis[2] / axisLength; - var bw = Math.cos(rad); - var ax1 = a[0], - ay1 = a[1], - az1 = a[2], - aw1 = a[3]; - out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; - out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; - out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; - out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; - var ax = a[4], - ay = a[5], - az = a[6], - aw = a[7]; - out[4] = ax * bw + aw * bx + ay * bz - az * by; - out[5] = ay * bw + aw * by + az * bx - ax * bz; - out[6] = az * bw + aw * bz + ax * by - ay * bx; - out[7] = aw * bw - ax * bx - ay * by - az * bz; - return out; -} -/** - * Adds two dual quat's - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the first operand - * @param {ReadonlyQuat2} b the second operand - * @returns {quat2} out - * @function - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - out[2] = a[2] + b[2]; - out[3] = a[3] + b[3]; - out[4] = a[4] + b[4]; - out[5] = a[5] + b[5]; - out[6] = a[6] + b[6]; - out[7] = a[7] + b[7]; - return out; -} -/** - * Multiplies two dual quat's - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a the first operand - * @param {ReadonlyQuat2} b the second operand - * @returns {quat2} out - */ - -function multiply(out, a, b) { - var ax0 = a[0], - ay0 = a[1], - az0 = a[2], - aw0 = a[3], - bx1 = b[4], - by1 = b[5], - bz1 = b[6], - bw1 = b[7], - ax1 = a[4], - ay1 = a[5], - az1 = a[6], - aw1 = a[7], - bx0 = b[0], - by0 = b[1], - bz0 = b[2], - bw0 = b[3]; - out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0; - out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0; - out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0; - out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0; - out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0; - out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0; - out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0; - out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0; - return out; -} -/** - * Alias for {@link quat2.multiply} - * @function - */ - -var mul = multiply; -/** - * Scales a dual quat by a scalar number - * - * @param {quat2} out the receiving dual quat - * @param {ReadonlyQuat2} a the dual quat to scale - * @param {Number} b amount to scale the dual quat by - * @returns {quat2} out - * @function - */ - -function scale(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - out[2] = a[2] * b; - out[3] = a[3] * b; - out[4] = a[4] * b; - out[5] = a[5] * b; - out[6] = a[6] * b; - out[7] = a[7] * b; - return out; -} -/** - * Calculates the dot product of two dual quat's (The dot product of the real parts) - * - * @param {ReadonlyQuat2} a the first operand - * @param {ReadonlyQuat2} b the second operand - * @returns {Number} dot product of a and b - * @function - */ - -var dot = _quat_js__WEBPACK_IMPORTED_MODULE_1__.dot; -/** - * Performs a linear interpolation between two dual quats's - * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5) - * - * @param {quat2} out the receiving dual quat - * @param {ReadonlyQuat2} a the first operand - * @param {ReadonlyQuat2} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {quat2} out - */ - -function lerp(out, a, b, t) { - var mt = 1 - t; - if (dot(a, b) < 0) t = -t; - out[0] = a[0] * mt + b[0] * t; - out[1] = a[1] * mt + b[1] * t; - out[2] = a[2] * mt + b[2] * t; - out[3] = a[3] * mt + b[3] * t; - out[4] = a[4] * mt + b[4] * t; - out[5] = a[5] * mt + b[5] * t; - out[6] = a[6] * mt + b[6] * t; - out[7] = a[7] * mt + b[7] * t; - return out; -} -/** - * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a dual quat to calculate inverse of - * @returns {quat2} out - */ - -function invert(out, a) { - var sqlen = squaredLength(a); - out[0] = -a[0] / sqlen; - out[1] = -a[1] / sqlen; - out[2] = -a[2] / sqlen; - out[3] = a[3] / sqlen; - out[4] = -a[4] / sqlen; - out[5] = -a[5] / sqlen; - out[6] = -a[6] / sqlen; - out[7] = a[7] / sqlen; - return out; -} -/** - * Calculates the conjugate of a dual quat - * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result. - * - * @param {quat2} out the receiving quaternion - * @param {ReadonlyQuat2} a quat to calculate conjugate of - * @returns {quat2} out - */ - -function conjugate(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - out[2] = -a[2]; - out[3] = a[3]; - out[4] = -a[4]; - out[5] = -a[5]; - out[6] = -a[6]; - out[7] = a[7]; - return out; -} -/** - * Calculates the length of a dual quat - * - * @param {ReadonlyQuat2} a dual quat to calculate length of - * @returns {Number} length of a - * @function - */ - -var length = _quat_js__WEBPACK_IMPORTED_MODULE_1__.length; -/** - * Alias for {@link quat2.length} - * @function - */ - -var len = length; -/** - * Calculates the squared length of a dual quat - * - * @param {ReadonlyQuat2} a dual quat to calculate squared length of - * @returns {Number} squared length of a - * @function - */ - -var squaredLength = _quat_js__WEBPACK_IMPORTED_MODULE_1__.squaredLength; -/** - * Alias for {@link quat2.squaredLength} - * @function - */ - -var sqrLen = squaredLength; -/** - * Normalize a dual quat - * - * @param {quat2} out the receiving dual quaternion - * @param {ReadonlyQuat2} a dual quaternion to normalize - * @returns {quat2} out - * @function - */ - -function normalize(out, a) { - var magnitude = squaredLength(a); - - if (magnitude > 0) { - magnitude = Math.sqrt(magnitude); - var a0 = a[0] / magnitude; - var a1 = a[1] / magnitude; - var a2 = a[2] / magnitude; - var a3 = a[3] / magnitude; - var b0 = a[4]; - var b1 = a[5]; - var b2 = a[6]; - var b3 = a[7]; - var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3; - out[0] = a0; - out[1] = a1; - out[2] = a2; - out[3] = a3; - out[4] = (b0 - a0 * a_dot_b) / magnitude; - out[5] = (b1 - a1 * a_dot_b) / magnitude; - out[6] = (b2 - a2 * a_dot_b) / magnitude; - out[7] = (b3 - a3 * a_dot_b) / magnitude; - } - - return out; -} -/** - * Returns a string representation of a dual quatenion - * - * @param {ReadonlyQuat2} a dual quaternion to represent as a string - * @returns {String} string representation of the dual quat - */ - -function str(a) { - return "quat2(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ")"; -} -/** - * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===) - * - * @param {ReadonlyQuat2} a the first dual quaternion. - * @param {ReadonlyQuat2} b the second dual quaternion. - * @returns {Boolean} true if the dual quaternions are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7]; -} -/** - * Returns whether or not the dual quaternions have approximately the same elements in the same position. - * - * @param {ReadonlyQuat2} a the first dual quat. - * @param {ReadonlyQuat2} b the second dual quat. - * @returns {Boolean} true if the dual quats are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1], - a2 = a[2], - a3 = a[3], - a4 = a[4], - a5 = a[5], - a6 = a[6], - a7 = a[7]; - var b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3], - b4 = b[4], - b5 = b[5], - b6 = b[6], - b7 = b[7]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)); -} - -/***/ }), -/* 23 */ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "create": () => (/* binding */ create), -/* harmony export */ "clone": () => (/* binding */ clone), -/* harmony export */ "fromValues": () => (/* binding */ fromValues), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "set": () => (/* binding */ set), -/* harmony export */ "add": () => (/* binding */ add), -/* harmony export */ "subtract": () => (/* binding */ subtract), -/* harmony export */ "multiply": () => (/* binding */ multiply), -/* harmony export */ "divide": () => (/* binding */ divide), -/* harmony export */ "ceil": () => (/* binding */ ceil), -/* harmony export */ "floor": () => (/* binding */ floor), -/* harmony export */ "min": () => (/* binding */ min), -/* harmony export */ "max": () => (/* binding */ max), -/* harmony export */ "round": () => (/* binding */ round), -/* harmony export */ "scale": () => (/* binding */ scale), -/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), -/* harmony export */ "distance": () => (/* binding */ distance), -/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), -/* harmony export */ "length": () => (/* binding */ length), -/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), -/* harmony export */ "negate": () => (/* binding */ negate), -/* harmony export */ "inverse": () => (/* binding */ inverse), -/* harmony export */ "normalize": () => (/* binding */ normalize), -/* harmony export */ "dot": () => (/* binding */ dot), -/* harmony export */ "cross": () => (/* binding */ cross), -/* harmony export */ "lerp": () => (/* binding */ lerp), -/* harmony export */ "random": () => (/* binding */ random), -/* harmony export */ "transformMat2": () => (/* binding */ transformMat2), -/* harmony export */ "transformMat2d": () => (/* binding */ transformMat2d), -/* harmony export */ "transformMat3": () => (/* binding */ transformMat3), -/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), -/* harmony export */ "rotate": () => (/* binding */ rotate), -/* harmony export */ "angle": () => (/* binding */ angle), -/* harmony export */ "zero": () => (/* binding */ zero), -/* harmony export */ "str": () => (/* binding */ str), -/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "len": () => (/* binding */ len), -/* harmony export */ "sub": () => (/* binding */ sub), -/* harmony export */ "mul": () => (/* binding */ mul), -/* harmony export */ "div": () => (/* binding */ div), -/* harmony export */ "dist": () => (/* binding */ dist), -/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), -/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), -/* harmony export */ "forEach": () => (/* binding */ forEach) -/* harmony export */ }); -/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); - -/** - * 2 Dimensional Vector - * @module vec2 - */ - -/** - * Creates a new, empty vec2 - * - * @returns {vec2} a new 2D vector - */ - -function create() { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); - - if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { - out[0] = 0; - out[1] = 0; - } - - return out; -} -/** - * Creates a new vec2 initialized with values from an existing vector - * - * @param {ReadonlyVec2} a vector to clone - * @returns {vec2} a new 2D vector - */ - -function clone(a) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); - out[0] = a[0]; - out[1] = a[1]; - return out; -} -/** - * Creates a new vec2 initialized with the given values - * - * @param {Number} x X component - * @param {Number} y Y component - * @returns {vec2} a new 2D vector - */ - -function fromValues(x, y) { - var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); - out[0] = x; - out[1] = y; - return out; -} -/** - * Copy the values from one vec2 to another - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the source vector - * @returns {vec2} out - */ - -function copy(out, a) { - out[0] = a[0]; - out[1] = a[1]; - return out; -} -/** - * Set the components of a vec2 to the given values - * - * @param {vec2} out the receiving vector - * @param {Number} x X component - * @param {Number} y Y component - * @returns {vec2} out - */ - -function set(out, x, y) { - out[0] = x; - out[1] = y; - return out; -} -/** - * Adds two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function add(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - return out; -} -/** - * Subtracts vector b from vector a - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function subtract(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - return out; -} -/** - * Multiplies two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function multiply(out, a, b) { - out[0] = a[0] * b[0]; - out[1] = a[1] * b[1]; - return out; -} -/** - * Divides two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function divide(out, a, b) { - out[0] = a[0] / b[0]; - out[1] = a[1] / b[1]; - return out; -} -/** - * Math.ceil the components of a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to ceil - * @returns {vec2} out - */ - -function ceil(out, a) { - out[0] = Math.ceil(a[0]); - out[1] = Math.ceil(a[1]); - return out; -} -/** - * Math.floor the components of a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to floor - * @returns {vec2} out - */ - -function floor(out, a) { - out[0] = Math.floor(a[0]); - out[1] = Math.floor(a[1]); - return out; -} -/** - * Returns the minimum of two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function min(out, a, b) { - out[0] = Math.min(a[0], b[0]); - out[1] = Math.min(a[1], b[1]); - return out; -} -/** - * Returns the maximum of two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec2} out - */ - -function max(out, a, b) { - out[0] = Math.max(a[0], b[0]); - out[1] = Math.max(a[1], b[1]); - return out; -} -/** - * Math.round the components of a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to round - * @returns {vec2} out - */ - -function round(out, a) { - out[0] = Math.round(a[0]); - out[1] = Math.round(a[1]); - return out; -} -/** - * Scales a vec2 by a scalar number - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the vector to scale - * @param {Number} b amount to scale the vector by - * @returns {vec2} out - */ - -function scale(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - return out; -} -/** - * Adds two vec2's after scaling the second operand by a scalar value - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @param {Number} scale the amount to scale b by before adding - * @returns {vec2} out - */ - -function scaleAndAdd(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - return out; -} -/** - * Calculates the euclidian distance between two vec2's - * - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {Number} distance between a and b - */ - -function distance(a, b) { - var x = b[0] - a[0], - y = b[1] - a[1]; - return Math.hypot(x, y); -} -/** - * Calculates the squared euclidian distance between two vec2's - * - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {Number} squared distance between a and b - */ - -function squaredDistance(a, b) { - var x = b[0] - a[0], - y = b[1] - a[1]; - return x * x + y * y; -} -/** - * Calculates the length of a vec2 - * - * @param {ReadonlyVec2} a vector to calculate length of - * @returns {Number} length of a - */ - -function length(a) { - var x = a[0], - y = a[1]; - return Math.hypot(x, y); -} -/** - * Calculates the squared length of a vec2 - * - * @param {ReadonlyVec2} a vector to calculate squared length of - * @returns {Number} squared length of a - */ - -function squaredLength(a) { - var x = a[0], - y = a[1]; - return x * x + y * y; -} -/** - * Negates the components of a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to negate - * @returns {vec2} out - */ - -function negate(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - return out; -} -/** - * Returns the inverse of the components of a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to invert - * @returns {vec2} out - */ - -function inverse(out, a) { - out[0] = 1.0 / a[0]; - out[1] = 1.0 / a[1]; - return out; -} -/** - * Normalize a vec2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a vector to normalize - * @returns {vec2} out - */ - -function normalize(out, a) { - var x = a[0], - y = a[1]; - var len = x * x + y * y; - - if (len > 0) { - //TODO: evaluate use of glm_invsqrt here? - len = 1 / Math.sqrt(len); - } - - out[0] = a[0] * len; - out[1] = a[1] * len; - return out; -} -/** - * Calculates the dot product of two vec2's - * - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {Number} dot product of a and b - */ - -function dot(a, b) { - return a[0] * b[0] + a[1] * b[1]; -} -/** - * Computes the cross product of two vec2's - * Note that the cross product must by definition produce a 3D vector - * - * @param {vec3} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @returns {vec3} out - */ - -function cross(out, a, b) { - var z = a[0] * b[1] - a[1] * b[0]; - out[0] = out[1] = 0; - out[2] = z; - return out; -} -/** - * Performs a linear interpolation between two vec2's - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the first operand - * @param {ReadonlyVec2} b the second operand - * @param {Number} t interpolation amount, in the range [0-1], between the two inputs - * @returns {vec2} out - */ - -function lerp(out, a, b, t) { - var ax = a[0], - ay = a[1]; - out[0] = ax + t * (b[0] - ax); - out[1] = ay + t * (b[1] - ay); - return out; -} -/** - * Generates a random vector with the given scale - * - * @param {vec2} out the receiving vector - * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned - * @returns {vec2} out - */ - -function random(out, scale) { - scale = scale || 1.0; - var r = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 * Math.PI; - out[0] = Math.cos(r) * scale; - out[1] = Math.sin(r) * scale; - return out; -} -/** - * Transforms the vec2 with a mat2 - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the vector to transform - * @param {ReadonlyMat2} m matrix to transform with - * @returns {vec2} out - */ - -function transformMat2(out, a, m) { - var x = a[0], - y = a[1]; - out[0] = m[0] * x + m[2] * y; - out[1] = m[1] * x + m[3] * y; - return out; -} -/** - * Transforms the vec2 with a mat2d - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the vector to transform - * @param {ReadonlyMat2d} m matrix to transform with - * @returns {vec2} out - */ - -function transformMat2d(out, a, m) { - var x = a[0], - y = a[1]; - out[0] = m[0] * x + m[2] * y + m[4]; - out[1] = m[1] * x + m[3] * y + m[5]; - return out; -} -/** - * Transforms the vec2 with a mat3 - * 3rd vector component is implicitly '1' - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the vector to transform - * @param {ReadonlyMat3} m matrix to transform with - * @returns {vec2} out - */ - -function transformMat3(out, a, m) { - var x = a[0], - y = a[1]; - out[0] = m[0] * x + m[3] * y + m[6]; - out[1] = m[1] * x + m[4] * y + m[7]; - return out; -} -/** - * Transforms the vec2 with a mat4 - * 3rd vector component is implicitly '0' - * 4th vector component is implicitly '1' - * - * @param {vec2} out the receiving vector - * @param {ReadonlyVec2} a the vector to transform - * @param {ReadonlyMat4} m matrix to transform with - * @returns {vec2} out - */ - -function transformMat4(out, a, m) { - var x = a[0]; - var y = a[1]; - out[0] = m[0] * x + m[4] * y + m[12]; - out[1] = m[1] * x + m[5] * y + m[13]; - return out; -} -/** - * Rotate a 2D vector - * @param {vec2} out The receiving vec2 - * @param {ReadonlyVec2} a The vec2 point to rotate - * @param {ReadonlyVec2} b The origin of the rotation - * @param {Number} rad The angle of rotation in radians - * @returns {vec2} out - */ - -function rotate(out, a, b, rad) { - //Translate point to the origin - var p0 = a[0] - b[0], - p1 = a[1] - b[1], - sinC = Math.sin(rad), - cosC = Math.cos(rad); //perform rotation and translate to correct position - - out[0] = p0 * cosC - p1 * sinC + b[0]; - out[1] = p0 * sinC + p1 * cosC + b[1]; - return out; -} -/** - * Get the angle between two 2D vectors - * @param {ReadonlyVec2} a The first operand - * @param {ReadonlyVec2} b The second operand - * @returns {Number} The angle in radians - */ - -function angle(a, b) { - var x1 = a[0], - y1 = a[1], - x2 = b[0], - y2 = b[1], - // mag is the product of the magnitudes of a and b - mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2), - // mag &&.. short circuits if mag == 0 - cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1 - - return Math.acos(Math.min(Math.max(cosine, -1), 1)); -} -/** - * Set the components of a vec2 to zero - * - * @param {vec2} out the receiving vector - * @returns {vec2} out - */ - -function zero(out) { - out[0] = 0.0; - out[1] = 0.0; - return out; -} -/** - * Returns a string representation of a vector - * - * @param {ReadonlyVec2} a vector to represent as a string - * @returns {String} string representation of the vector - */ - -function str(a) { - return "vec2(" + a[0] + ", " + a[1] + ")"; -} -/** - * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===) - * - * @param {ReadonlyVec2} a The first vector. - * @param {ReadonlyVec2} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function exactEquals(a, b) { - return a[0] === b[0] && a[1] === b[1]; -} -/** - * Returns whether or not the vectors have approximately the same elements in the same position. - * - * @param {ReadonlyVec2} a The first vector. - * @param {ReadonlyVec2} b The second vector. - * @returns {Boolean} True if the vectors are equal, false otherwise. - */ - -function equals(a, b) { - var a0 = a[0], - a1 = a[1]; - var b0 = b[0], - b1 = b[1]; - return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)); -} -/** - * Alias for {@link vec2.length} - * @function - */ - -var len = length; -/** - * Alias for {@link vec2.subtract} - * @function - */ - -var sub = subtract; -/** - * Alias for {@link vec2.multiply} - * @function - */ - -var mul = multiply; -/** - * Alias for {@link vec2.divide} - * @function - */ - -var div = divide; -/** - * Alias for {@link vec2.distance} - * @function - */ - -var dist = distance; -/** - * Alias for {@link vec2.squaredDistance} - * @function - */ - -var sqrDist = squaredDistance; -/** - * Alias for {@link vec2.squaredLength} - * @function - */ - -var sqrLen = squaredLength; -/** - * Perform some operation over an array of vec2s. - * - * @param {Array} a the array of vectors to iterate over - * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed - * @param {Number} offset Number of elements to skip at the beginning of the array - * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array - * @param {Function} fn Function to call for each vector in the array - * @param {Object} [arg] additional argument to pass to fn - * @returns {Array} a - * @function - */ - -var forEach = function () { - var vec = create(); - return function (a, stride, offset, count, fn, arg) { - var i, l; - - if (!stride) { - stride = 2; - } - - if (!offset) { - offset = 0; - } - - if (count) { - l = Math.min(count * stride + offset, a.length); - } else { - l = a.length; - } - - for (i = offset; i < l; i += stride) { - vec[0] = a[i]; - vec[1] = a[i + 1]; - fn(vec, vec, arg); - a[i] = vec[0]; - a[i + 1] = vec[1]; - } - - return a; - }; -}(); - -/***/ }), -/* 24 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Scene = void 0; -const SceneChild_1 = __webpack_require__(25); -const Group_1 = __webpack_require__(26); -const Shape_1 = __webpack_require__(35); -const Utilities_1 = __webpack_require__(33); -/** - * Container for all SceneChild. - * The main purpose is to manage the drawing order and update the child buffers - * - * @order 1 - * @category Core.Scene - * @class Scene - */ -class Scene { +class Group extends SceneChild_1.SceneChild { /** - * Creates an instance of Scene. - * You can see the default values in the property definitions + * Creates an instance of Group + * + * @param {ISceneChildSettings} [settings={}] + * @memberof Group */ constructor(settings = {}) { - /** - * Logical number, the drawer will take care of defining the unit of measure - */ - this.width = 400; - /** - * Logical number, the drawer will take care of defining the unit of measure - */ - this.height = 400; - /** - * Default background color (black) - */ - this.background = 'hsla(0, 0%, 0%, 1)'; - /** - * Default ScenePrimitive stroke color (white) - */ - this.color = 'hsla(0, 0%, 100%, 1)'; - /** - * Current time - */ - this.currentTime = 0; - if (typeof settings.width !== 'undefined') - this.width = settings.width; - if (typeof settings.height !== 'undefined') - this.height = settings.height; - if (typeof settings.background !== 'undefined') - this.background = settings.background; - if (typeof settings.color !== 'undefined') - this.color = settings.color; + settings.type = 'Group'; + super(settings); this.children = []; - this.center = [this.width / 2, this.height / 2]; - this.anchor = - settings.anchor && Array.isArray(settings.anchor) - ? [ - typeof settings.anchor[0] === 'number' - ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[0]) * 0.5) * this.width - : settings.anchor[0] === 'left' - ? 0 - : settings.anchor[0] === 'right' - ? this.width - : this.center[0], - typeof settings.anchor[1] === 'number' - ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[1]) * 0.5) * this.height - : settings.anchor[1] === 'top' - ? 0 - : settings.anchor[1] === 'bottom' - ? this.height - : this.center[1], - ] - : [this.center[0], this.center[1]]; - } - /** - * Return width percentage - * - * @param {number} [percentage=100] - * @returns {number} - */ - getWidth(percentage = 100) { - return (this.width * percentage) / 100; - } - /** - * Return height percentage - * - * @param {number} [percentage=100] - * @returns {number} - */ - getHeight(percentage = 100) { - return (this.height * percentage) / 100; - } - /** - * Resize the scene size - * - * @param {number} width - * @param {number} [height=width] - * @memberof Scene - */ - resize(width, height = width) { - this.width = width; - this.height = height; - this.center = [this.width / 2, this.height / 2]; - const anchor = [this.width / this.anchor[0], this.height / this.anchor[1]]; - this.anchor = [this.width / anchor[0], this.height / anchor[1]]; - this.children.forEach(sceneChild => sceneChild.clearBuffer(true, false)); - } - /** - * Update all children, generate a streamable buffer for drawing - * - * @param {number} [atTime] time in ms - * @memberof Scene - */ - update(atTime = 0) { - this.currentTime = atTime; - for (let i = 0, len = this.children.length; i < len; i++) { - this.children[i].generate(this.currentTime, true); - } + ['id', 'name', 'data', 'order', 'type'].forEach((prop) => { + if (prop in settings) + delete settings[prop]; + }); + this.props = settings; } /** - * Traverse the child buffer and use it with callback + * Check group has static children * - * @param {(streamArguments: IStreamArguments) => void} callback - * @memberof Scene + * @returns {boolean} + * @memberof Group */ - stream(callback) { - this.children.forEach(sceneChild => sceneChild.stream(callback)); + isStatic() { + const children = this.children; + for (let i = 0, len = children.length; i < len; i++) + if (!children[i].isStatic()) + return false; + return true; } - /* - |-------------------------------------------------------------------------- - | SceneChild - |-------------------------------------------------------------------------- - */ /** - * Return a list of children + * Check group has static children indexed * - * @returns {Array} - * @memberof Scene + * @returns {boolean} + * @memberof Group */ - getChildren() { - return this.children; + isStaticIndexed() { + const children = this.children; + for (let i = 0, len = children.length; i < len; i++) + if (!children[i].isStaticIndexed()) + return false; + return true; } /** - * Add SceneChild to Scene, pass `order` as last parameter for drawing priorities + * Add item to Group * * @param {Array} items - * @param {number} [order] - * @memberof Scene + * @memberof Group */ - add(...items /**, order: number */) { - const order = typeof items[items.length - 1] === 'number' ? items[items.length - 1] : undefined; - const len = items.length - (typeof order === 'undefined' ? 0 : 1); - for (let i = 0; i < len; i++) { + add(...items) { + for (let i = 0, len = items.length; i < len; i++) { const item = items[i]; + const rawItemProps = item.getProps(); + Object.keys(this.props).forEach((propKey) => { + if (typeof rawItemProps[propKey] === 'undefined') + item.setProp(propKey, this.props[propKey]); + }); item.order = - typeof order !== 'undefined' - ? order + i - : typeof item.order !== 'undefined' - ? item.order - : this.children.length > 0 - ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1 - : 0; - Scene.propagateToChilden(item, this); + typeof item.order !== 'undefined' + ? item.order + : this.children.length > 0 + ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1 + : 0; + this.scene && Scene_1.Scene.propagateToChilden(item, this.scene); this.children.push(item); - item.clearBuffer(true, false); - item.generate(0, true); } this.sortChildren(); } /** - * Sort children by order + * Sort children * - * @memberof Scene + * @memberof Group */ sortChildren() { this.children.sort((a, b) => a.order - b.order); @@ -8142,15 +727,27 @@ class Scene { child.order = index; return child; }); + this.clearBuffer(true); } /** - * Find sceneChild from id or name in the whole scene + * Return shape children * - * @param {string | number} idOrName + * @returns {Array} + * @memberof Group + */ + getChildren() { + return this.children; + } + /** + * Find scene child from id or name + * + * @param {number | string} idOrName * @returns {(SceneChild | null)} - * @memberof Scene + * @memberof Group */ find(idOrName) { + if (this.id === idOrName || this.name === idOrName) + return this; const children = this.getChildren(); for (let i = 0, len = children.length; i < len; i++) { const result = children[i].find(idOrName); @@ -8160,1108 +757,8516 @@ class Scene { return null; } /** - * Get shape by index + * Get item from group * * @param {number} index * @returns {(SceneChild | null)} - * @memberof Scene + * @memberof Group */ get(index) { return index >= 0 && index < this.children.length ? this.children[index] : null; } /** - * Remove a shape by index + * Remove item from group * * @param {number} index - * @memberof Scene + * @returns {(false | Array)} + * @memberof Group */ remove(index) { - index >= 0 && index < this.children.length && this.children.splice(index, 1); - } - /** - * Removes all children - * - * @memberof Scene - */ - removeChildren() { - this.children = []; - } - /** - * Remove sceneChild by id or name - * - * @param {number | number} idOrName - * @memberof Scene - */ - removeFromId(idOrName) { - for (let i = 0, len = this.children.length; i < len; i++) - if (this.children[i].id === idOrName || this.children[i].name === idOrName) { - this.children.splice(i, 1); - return; - } - } - /** - * Return true if sceneChild is direct children - * - * @param {SceneChild} sceneChild - * @returns {boolean} - * @memberof Scene - */ - isFirstLevelChild(sceneChild) { - for (let i = 0, len = this.children.length; i < len; i++) - if (this.children[i].id === sceneChild.id) - return true; - const parents = this.getParentsOfSceneChild(sceneChild); - return parents.length === 1 && parents[0] instanceof Group_1.Group; + if (index >= 0 && index < this.children.length) { + const removed = this.children.splice(index, 1); + this.clearBuffer(true); + return removed; + } + return false; } /** - * Returns the list of sceneChild hierarchy starting from the scene + * Remove from id * - * @param {SceneChild} sceneChild - * @returns {Array} + * @param {number} id * @memberof Scene */ - getParentsOfSceneChild(sceneChild) { - const result = Scene.getParentsOfSceneChild(this, sceneChild); - if (result) { - result.splice(0, 1); - return result; + removeFromId(id) { + for (let i = 0, len = this.children.length; i < len; i++) { + if (this.children[i].id == id) { + this.children.splice(i, 1); + return this.clearBuffer(true); + } } - return []; } /** - * Returns the list of sceneChild hierarchy starting from the scene + * Generate children buffers * - * @static - * @param {(Scene | SceneChild)} current - * @param {SceneChild} sceneChild - * @param {(Array)} [parents=[]] - * @returns {(Array | null)} - * @memberof Scene + * @param {number} generateId + * @param {boolean} [bDirectSceneChild=false] + * @param {IPropArguments} [parentPropArguments] + * @memberof Group */ - static getParentsOfSceneChild(current, sceneChild, parents = []) { - let result; - if (current instanceof SceneChild_1.SceneChild) { - if (current.id == sceneChild.id) - return parents; - if (current instanceof Shape_1.Shape && current.shape) { - const tmpParents = parents.slice(); - tmpParents.push(current); - if ((result = Scene.getParentsOfSceneChild(current.shape, sceneChild, tmpParents))) - return result; - } - } - if (current instanceof Scene || current instanceof Group_1.Group) { - const children = current.getChildren(); - parents.push(current); - for (let i = 0, len = children.length; i < len; i++) { - const child = children[i]; - if ((result = Scene.getParentsOfSceneChild(child, sceneChild, parents))) - return result; - } - parents.pop(); - } - return null; + generate(generateId, bDirectSceneChild = false, parentPropArguments) { + this.generateId = generateId; + this.children.forEach(item => item.generate(generateId, bDirectSceneChild, parentPropArguments)); } /** - * Walk through the scene + * Sum the children bounding * - * @static - * @param {SceneChild} callbackk - * @param {(Scene | SceneChild)} current - * @memberof Scene + * @return {IShapeBounding} */ - static walk(callback, current) { - if (current instanceof SceneChild_1.SceneChild) { - if (callback(current) === false) - return false; - if (current instanceof Shape_1.Shape && current.shape) - if (Scene.walk(callback, current.shape) === false) - return false; - } - if (current instanceof Scene || current instanceof Group_1.Group) { - const children = current.getChildren(); - for (let i = 0, len = children.length; i < len; i++) { - const child = children[i]; - if (Scene.walk(callback, child) === false) - return false; + getBounding() { + const boundings = []; + const bounding = Adapt_1.Bounding.empty(); + if (this.children.length > 0) { + this.children.forEach(item => boundings.push(item.getBounding())); + for (let i = 0, len = this.children.length; i < len; i++) { + bounding.x = bounding.x > boundings[i].x ? boundings[i].x : bounding.x; + bounding.y = bounding.y > boundings[i].y ? boundings[i].y : bounding.y; + bounding.width = bounding.width < boundings[i].width ? boundings[i].width : bounding.width; + bounding.height = bounding.height < boundings[i].height ? boundings[i].height : bounding.height; } + bounding.cx = bounding.x + bounding.width / 2; + bounding.cy = bounding.y + bounding.height / 2; } + return bounding; } /** - * Propagate scene to sceneChild (and children) + * Chear children buffer * - * @static - * @param {SceneChild} sceneChild - * @param {Scene} scene - * @memberof Scene + * @param {boolean} [bClearIndexed=false] + * @param {boolean} [bPropagateToParents=false] + * @memberof Group */ - static propagateToChilden(sceneChild, scene) { - sceneChild.scene = scene; - if (sceneChild instanceof Group_1.Group) { - sceneChild.getChildren().forEach((item) => { - Scene.propagateToChilden(item, scene); - }); - } - else if (sceneChild instanceof Shape_1.Shape && sceneChild.shape) { - sceneChild.shape.scene = scene; - Scene.propagateToChilden(sceneChild.shape, scene); + clearBuffer(bClearIndexed = false, bPropagateToParents = true) { + this.children.forEach(item => item.clearBuffer(bClearIndexed, false)); + if (this.scene && bPropagateToParents) { + const parents = this.scene.getParentsOfSceneChild(this); + parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */); } + // if (bPropagateToParents && this.scene) + // { + // const parents = this.scene.getParentsOfSceneChild(this) + // parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, true, false) + // } + // if (bPropagateToChildren) + // { + // this.children.forEach(sceneChild => sceneChild.clearBuffer(bClearIndexed, false, true)) + // } } -} -exports.Scene = Scene; -//# sourceMappingURL=Scene.js.map - -/***/ }), -/* 25 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SceneChild = void 0; -/** - * Autoincrement sceneChild default id - * - * @internal - * @ignore - */ -let __id = 0; -/** - * The element to be added into a scene. - * Preserve props, drawing order, generate and return buffers. - * The only implementations of this class are Group and ShapeBase - * - * @abstract - * @category Core.Abstract - * @order 2 - * @class SceneChild - */ -class SceneChild { /** - * Creates an instance of SceneChild. - * Base values will be assigned in case they are not passed + * Set a single or multiple props * - * @param {ISceneChildSettings} settings + * @abstract + * @param {(keyof ISceneChildProps | ISceneChildProps)} key + * @param {*} [value] + * @memberof SceneChild */ - constructor(settings) { - var _a; - /** - * Shape generation id - * used for prevent buffer calculation - * - * @internal - * @ignore - */ - this.generateId = -1; - this.id = (_a = settings.id) !== null && _a !== void 0 ? _a : ++__id; - this.type = settings.type || 'SceneChild'; - this.name = settings.name || this.type + '_' + this.id; - this.data = settings.data || {}; - this.props = {}; + setProp(key, value) { + if (typeof key === 'object') + Object.keys(key).forEach((k) => (this.props[k] = key[k])); + else + this.props[key] = value; + this.children.forEach(item => item.setProp(key, value)); } /** - * Find this or form or children. - * Overridden by classes that extend it + * Set a single or multiple props * - * @param {string | number} idOrName - * @returns {(SceneChild | null)} + * @param {(keyof ISceneChildProps | ISceneChildProps)} key + * @param {*} [value] + * @memberof ShapeBase */ - find(idOrName) { - if (this.id === idOrName || this.name === idOrName) - return this; - return null; + setPropUnsafe(key, value) { + super.setPropUnsafe(key, value); + this.children.forEach(item => item.setPropUnsafe(key, value)); } /** - * Return the sceneChild properties + * Return length of buffer * - * @returns {Props} + * @param {IPropArguments} propArguments + * @returns {number} + * @memberof Group */ - getProps() { - return this.props; + getBufferLength(propArguments) { + return this.children.map(sceneChild => sceneChild.getBufferLength(propArguments)).reduce((p, c) => p + c, 0); } /** - * Return a sceneChild prop or default value + * return a single buffer binded from children * - * @param {keyof Props} key - * @param {PropArguments} [propArguments] - * @param {*} [defaultValue] - * @returns {*} + * @returns {Float32Array} + * @memberof Group */ - getProp(key, propArguments, defaultValue) { - var _a; - return ((_a = this.props[key]) !== null && _a !== void 0 ? _a : defaultValue); + getBuffer() { + const buffers = this.children + .map(item => item.getBuffer()) + .filter(b => b !== undefined); + const size = buffers.reduce((currLength, buffer) => currLength + buffer.length, 0); + if (size > 0) { + const result = new Float32Array(size); + result.set(buffers[0], 0); + for (let i = 1, offset = 0, len = buffers.length; i < len; i++) { + offset += buffers[i - 1].length; + result.set(buffers[i], offset); + } + return result; + } + return ShapeBase_1.ShapeBase.EMPTY_BUFFER; } /** - * Check SceneChild has prop + * return a single buffer binded from children * - * @param {keyof Props} key - * @returns + * @returns {(Array | undefined)} + * @memberof Group */ - hasProp(key) { - return typeof this.props[key] !== 'undefined'; + getIndexedBuffer() { + const indexed = this.children.map(item => item.getIndexedBuffer()).filter(b => b !== undefined); + return [].concat.apply([], indexed); } /** - * Set a single or multiple props + * Call strem on children * - * @param {(keyof ISceneChildProps | ISceneChildProps)} key - * @param {*} [value] + * @param {(streamArguments: IStreamArguments) => void} callback + * @memberof Group */ - setPropUnsafe(key, value) { - if (typeof key == 'string') - this.props[key] = value; - else - Object.keys(key).forEach((k) => (this.props[k] = key[k])); + stream(callback) { + this.children.forEach(item => item.stream(callback)); } } -exports.SceneChild = SceneChild; -//# sourceMappingURL=SceneChild.js.map +exports.Group = Group; +//# sourceMappingURL=Group.js.map /***/ }), -/* 26 */ +/* 7 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Group = void 0; -const Scene_1 = __webpack_require__(24); -const SceneChild_1 = __webpack_require__(25); -const ShapeBase_1 = __webpack_require__(27); +exports.ShapeBase = void 0; +const gl_matrix_1 = __webpack_require__(8); +const types_1 = __webpack_require__(19); +const glme = __webpack_require__(28); +const Vec2_1 = __webpack_require__(29); +const math_1 = __webpack_require__(30); const Adapt_1 = __webpack_require__(31); +const Utilities_1 = __webpack_require__(33); +const SceneChild_1 = __webpack_require__(5); +const tmpMatrix = gl_matrix_1.mat4.create(); +const transformMatrix = gl_matrix_1.mat4.create(); +const perspectiveMatrix = gl_matrix_1.mat4.create(); +const repetitionMatrix = gl_matrix_1.mat4.create(); /** - * A SceneChild container, propagates properties to children + * Main class for shape generation * - * @order 3 - * @category Core.Scene + * @category Core.Abstract + * @abstract + * @class ShapeBase + * @order 4 * @extends {SceneChild} - * @example - * ```javascript - * // Group example - * - * const rect = new Urpflanze.Rect({ - * distance: 100 // <- if a property is set the group will not overwrite it - * }) - * const group = new Urpflanze.Group({ - * repetitions: 3, - * distance: 200 - * }) - * - * group.add(rect) - * group.add(new Urpflanze.Triangle()) - * ``` - * @class Group */ -class Group extends SceneChild_1.SceneChild { +class ShapeBase extends SceneChild_1.SceneChild { /** - * Creates an instance of Group + * Creates an instance of ShapeBase * * @param {ISceneChildSettings} [settings={}] - * @memberof Group */ constructor(settings = {}) { - settings.type = 'Group'; super(settings); - this.children = []; - ['id', 'name', 'data', 'order', 'type'].forEach((prop) => { - if (prop in settings) - delete settings[prop]; - }); - this.props = settings; + /** + * Flag used to determine if indexedBuffer has been generated + * + * @internal + * @ignore + */ + this.bIndexed = false; + /** + * Array used for index a vertex buffer + * only for first level scene children + * + * @internal + * @ignore + */ + this.indexedBuffer = []; + /** + * The bounding inside the scene + * + * @type {IShapeBounding} + */ + this.bounding = { + cx: 0, + cy: 0, + x: -1, + y: -1, + width: 2, + height: 2, + }; + this.props = { + distance: settings.distance, + repetitions: settings.repetitions, + rotateX: settings.rotateX, + rotateY: settings.rotateY, + rotateZ: settings.rotateZ, + skewX: settings.skewX, + skewY: settings.skewY, + squeezeX: settings.squeezeX, + squeezeY: settings.squeezeY, + displace: settings.displace, + translate: settings.translate, + scale: settings.scale, + transformOrigin: settings.transformOrigin, + perspective: settings.perspective, + perspectiveOrigin: settings.perspectiveOrigin, + }; + this.anchor = + settings.anchor && Array.isArray(settings.anchor) + ? [ + typeof settings.anchor[0] === 'number' + ? Utilities_1.clamp(-1, 1, settings.anchor[0]) * -1 + : settings.anchor[0] === 'left' + ? 1 + : settings.anchor[0] === 'right' + ? -1 + : 0, + typeof settings.anchor[1] === 'number' + ? Utilities_1.clamp(-1, 1, settings.anchor[1]) * -1 + : settings.anchor[1] === 'top' + ? 1 + : settings.anchor[1] === 'bottom' + ? -1 + : 0, + ] + : [0, 0]; + this.boundingType = + typeof settings.boundingType === 'string' + ? settings.boundingType === 'relative' + ? types_1.EBoundingType.Relative + : types_1.EBoundingType.Fixed + : settings.boundingType || types_1.EBoundingType.Fixed; + this.vertexCallback = settings.vertexCallback; } /** - * Check group has static children + * Check if the shape should be generated every time * * @returns {boolean} - * @memberof Group */ isStatic() { - const children = this.children; - for (let i = 0, len = children.length; i < len; i++) - if (!children[i].isStatic()) - return false; - return true; + const props = this.props; + return (typeof props.repetitions !== 'function' && + typeof props.distance !== 'function' && + typeof props.displace !== 'function' && + typeof props.scale !== 'function' && + typeof props.translate !== 'function' && + typeof props.skewX !== 'function' && + typeof props.skewY !== 'function' && + typeof props.squeezeX !== 'function' && + typeof props.squeezeY !== 'function' && + typeof props.rotateX !== 'function' && + typeof props.rotateY !== 'function' && + typeof props.rotateZ !== 'function' && + typeof props.transformOrigin !== 'function' && + typeof props.perspective !== 'function' && + typeof props.perspectiveOrigin !== 'function'); } /** - * Check group has static children indexed + * Check if the indexedBuffer array needs to be recreated every time, + * this can happen when a shape generates an array of vertices different in length at each repetition * * @returns {boolean} - * @memberof Group */ isStaticIndexed() { - const children = this.children; - for (let i = 0, len = children.length; i < len; i++) - if (!children[i].isStaticIndexed()) - return false; - return true; + return typeof this.props.repetitions !== 'function'; } /** - * Add item to Group + * Return a prop value * - * @param {Array} items - * @memberof Group + * @param {keyof ISceneChildProps} key + * @param {PropArguments} [propArguments] + * @param {*} [defaultValue] + * @returns {*} */ - add(...items) { - for (let i = 0, len = items.length; i < len; i++) { - const item = items[i]; - const rawItemProps = item.getProps(); - Object.keys(this.props).forEach((propKey) => { - if (typeof rawItemProps[propKey] === 'undefined') - item.setProp(propKey, this.props[propKey]); - }); - item.order = - typeof item.order !== 'undefined' - ? item.order - : this.children.length > 0 - ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1 - : 0; - this.scene && Scene_1.Scene.propagateToChilden(item, this.scene); - this.children.push(item); + getProp(key, propArguments, defaultValue) { + let attribute = this.props[key]; + if (typeof attribute === 'function') { + attribute = attribute(propArguments); } - this.sortChildren(); - } - /** - * Sort children - * - * @memberof Group - */ - sortChildren() { - this.children.sort((a, b) => a.order - b.order); - this.children = this.children.map((child, index) => { - child.order = index; - return child; - }); - this.clearBuffer(true); - } - /** - * Return shape children - * - * @returns {Array} - * @memberof Group - */ - getChildren() { - return this.children; + return typeof attribute === 'undefined' || Number.isNaN(attribute) ? defaultValue : attribute; } /** - * Find scene child from id or name + * Set a single or multiple props * - * @param {number | string} idOrName - * @returns {(SceneChild | null)} - * @memberof Group + * @param {(keyof ISceneChildProps | ISceneChildProps)} key + * @param {*} [value] + * @param {boolean} [bClearIndexed=false] */ - find(idOrName) { - if (this.id === idOrName || this.name === idOrName) - return this; - const children = this.getChildren(); - for (let i = 0, len = children.length; i < len; i++) { - const result = children[i].find(idOrName); - if (result !== null) - return result; + setProp(key, value, bClearIndexed = false) { + if (typeof key === 'string') { + bClearIndexed = bClearIndexed || key == 'repetitions'; + this.props[key] = value; } - return null; - } - /** - * Get item from group - * - * @param {number} index - * @returns {(SceneChild | null)} - * @memberof Group - */ - get(index) { - return index >= 0 && index < this.children.length ? this.children[index] : null; - } - /** - * Remove item from group - * - * @param {number} index - * @returns {(false | Array)} - * @memberof Group - */ - remove(index) { - if (index >= 0 && index < this.children.length) { - const removed = this.children.splice(index, 1); - this.clearBuffer(true); - return removed; + else { + bClearIndexed = bClearIndexed || 'repetitions' in key; + Object.keys(key).forEach((k) => (this.props[k] = key[k])); } - return false; + this.clearBuffer(bClearIndexed, true); } /** - * Remove from id + * Unset buffer * - * @param {number} id - * @memberof Scene + * @param {boolean} [bClearIndexed=false] + * @param {boolean} [bPropagateToParents=false] + * @param {boolean} [bPropagateToChildren=false] */ - removeFromId(id) { - for (let i = 0, len = this.children.length; i < len; i++) { - if (this.children[i].id == id) { - this.children.splice(i, 1); - return this.clearBuffer(true); - } + clearBuffer(bClearIndexed = false, bPropagateToParents = true) { + this.buffer = undefined; + if (bClearIndexed) { + this.bIndexed = false; + this.indexedBuffer = []; + } + this.bStatic = this.isStatic(); + this.bStaticIndexed = this.isStaticIndexed(); + if (bPropagateToParents && this.scene && !this.scene.isFirstLevelChild(this)) { + const parents = this.scene.getParentsOfSceneChild(this); + parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */); } } /** - * Generate children buffers + * Update the vertex array if the shape is not static and update the indexedBuffer if it is also not static * - * @param {number} generateId - * @param {boolean} [bDirectSceneChild=false] - * @param {IPropArguments} [parentPropArguments] - * @memberof Group + * @param {number} generateId generation id + * @param {boolean} [bDirectSceneChild=false] adjust shape of center of scene + * @param {PropArguments} [parentPropArguments] */ - generate(generateId, bDirectSceneChild = false, parentPropArguments) { + generate(generateId = 0, bDirectSceneChild = false, parentPropArguments) { + var _a, _b; + if (this.buffer && this.bStatic) { + return; + } this.generateId = generateId; - this.children.forEach(item => item.generate(generateId, bDirectSceneChild, parentPropArguments)); + if (!this.bStaticIndexed || !this.bIndexed) + this.indexedBuffer = []; + const propArguments = ShapeBase.getEmptyPropArguments(this, parentPropArguments); + const repetition = propArguments.repetition; + const repetitions = this.getProp('repetitions', propArguments, 1); + const repetitionType = Array.isArray(repetitions) ? types_1.ERepetitionType.Matrix : types_1.ERepetitionType.Ring; + const repetitionCount = Array.isArray(repetitions) + ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) + : repetitions; + const repetitionRowCount = Array.isArray(repetitions) ? repetitions[0] : repetitionCount; + const repetitionColCount = Array.isArray(repetitions) ? (_b = repetitions[1]) !== null && _b !== void 0 ? _b : repetitions[0] : 1; + const rowRepetition = repetition.row; + rowRepetition.count = repetitionRowCount; + const colRepetition = repetition.col; + colRepetition.count = repetitionColCount; + repetition.count = repetitionCount; + repetition.col.count = repetitionColCount; + repetition.row.count = repetitionRowCount; + repetition.type = repetitionType; + let totalBufferLength = 0; + const buffers = []; + let currentIndex = 0; + const centerMatrix = gl_matrix_1.vec2.fromValues((repetitionColCount - 1) / 2, (repetitionRowCount - 1) / 2); + const sceneAnchor = this.scene ? [this.scene.anchor[0], this.scene.anchor[1], 0] : [0, 0, 0]; + const tmpTotalShapeBounding = [undefined, undefined, undefined, undefined]; + const tmpSingleRepetitionBounding = [undefined, undefined, undefined, undefined]; + for (let currentRowRepetition = 0; currentRowRepetition < repetitionRowCount; currentRowRepetition++) { + for (let currentColRepetition = 0; currentColRepetition < repetitionColCount; currentColRepetition++, currentIndex++) { + repetition.index = currentIndex + 1; + repetition.offset = repetitionCount > 1 ? currentIndex / (repetitionCount - 1) : 1; + repetition.angle = repetitionType === types_1.ERepetitionType.Ring ? (math_1.PI2 / repetitionCount) * currentIndex : 0; + colRepetition.index = currentColRepetition + 1; + colRepetition.offset = repetitionColCount > 1 ? currentColRepetition / (repetitionColCount - 1) : 1; + rowRepetition.index = currentRowRepetition + 1; + rowRepetition.offset = repetitionRowCount > 1 ? currentRowRepetition / (repetitionRowCount - 1) : 1; + // Generate primitives buffer recursively + const buffer = this.generateBuffer(generateId, propArguments); + const bufferLength = buffer.length; + const bounding = this.getShapeBounding(); + buffers[currentIndex] = new Float32Array(bufferLength); + totalBufferLength += bufferLength; + { + const distance = glme.toVec2(this.getProp('distance', propArguments, glme.VEC2_ZERO)); + const displace = this.getProp('displace', propArguments, 0); + const scale = glme.toVec3(this.getProp('scale', propArguments, glme.VEC2_ONE), 1); + const translate = glme.toVec3(this.getProp('translate', propArguments, glme.VEC2_ZERO), 0); + const skewX = this.getProp('skewX', propArguments, 0); + const skewY = this.getProp('skewY', propArguments, 0); + const squeezeX = this.getProp('squeezeX', propArguments, 0); + const squeezeY = this.getProp('squeezeY', propArguments, 0); + const rotateX = this.getProp('rotateX', propArguments, 0); + const rotateY = this.getProp('rotateY', propArguments, 0); + const rotateZ = this.getProp('rotateZ', propArguments, 0); + const perspective = Utilities_1.clamp(0, 1, this.getProp('perspective', propArguments, 0)); + const perspectiveOrigin = glme.toVec3(this.getProp('perspectiveOrigin', propArguments, glme.VEC2_ZERO), 0); + const transformOrigin = glme.toVec3(this.getProp('transformOrigin', propArguments, glme.VEC2_ZERO), 0); + let offset; + switch (repetitionType) { + case types_1.ERepetitionType.Ring: + offset = gl_matrix_1.vec3.fromValues(distance[0], 0, 0); + gl_matrix_1.vec3.rotateZ(offset, offset, glme.VEC3_ZERO, repetition.angle + displace); + break; + case types_1.ERepetitionType.Matrix: + offset = gl_matrix_1.vec3.fromValues(distance[1] * (currentColRepetition - centerMatrix[0]), distance[0] * (currentRowRepetition - centerMatrix[1]), 0); + break; + } + const perspectiveSize = perspective > 0 ? Math.max(bounding.width, bounding.height) / 2 : 1; + const perspectiveValue = perspective > 0 ? perspectiveSize + (1 - perspective) * (perspectiveSize * 10) : 0; + const bTransformOrigin = (this.boundingType === types_1.EBoundingType.Relative ? bounding.cx !== 0 || bounding.cy !== 0 : true) || + perspective !== 0 || + transformOrigin[0] !== 0 || + transformOrigin[1] !== 0; + const bPerspectiveOrigin = perspectiveOrigin[0] !== 0 || perspectiveOrigin[1] !== 0; + if (bTransformOrigin) { + if (this.boundingType === types_1.EBoundingType.Relative) { + transformOrigin[0] = transformOrigin[0] * (bounding.width / 2) + bounding.cx; + transformOrigin[1] = transformOrigin[1] * (bounding.height / 2) + bounding.cy; + } + else { + transformOrigin[0] *= bounding.width / 2; + transformOrigin[1] *= bounding.height / 2; + } + transformOrigin[2] = perspectiveValue; + } + /** + * Create Matrices + */ + { + /** + * Create Transformation matrix + */ + gl_matrix_1.mat4.identity(transformMatrix); + bTransformOrigin && gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, transformOrigin); + if (translate[0] !== 0 || translate[1] !== 0) + gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, translate); + if (skewX !== 0 || skewY !== 0) { + glme.fromSkew(tmpMatrix, [skewX, skewY]); + gl_matrix_1.mat4.multiply(transformMatrix, transformMatrix, tmpMatrix); + } + rotateX !== 0 && gl_matrix_1.mat4.rotateX(transformMatrix, transformMatrix, rotateX); + rotateY !== 0 && gl_matrix_1.mat4.rotateY(transformMatrix, transformMatrix, rotateY); + rotateZ !== 0 && gl_matrix_1.mat4.rotateZ(transformMatrix, transformMatrix, rotateZ); + if (scale[0] !== 1 || scale[1] !== 1) + gl_matrix_1.mat4.scale(transformMatrix, transformMatrix, scale); + bTransformOrigin && + gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, gl_matrix_1.vec3.scale(transformOrigin, transformOrigin, -1)); + /** + * Create Perspective matrix + */ + if (perspectiveValue > 0) { + if (bPerspectiveOrigin) { + if (this.boundingType === types_1.EBoundingType.Relative) { + perspectiveOrigin[0] = perspectiveOrigin[0] * (bounding.width / 2) + bounding.cx; + perspectiveOrigin[1] = perspectiveOrigin[1] * (bounding.height / 2) + bounding.cy; + } + else { + perspectiveOrigin[0] *= bounding.width / 2; + perspectiveOrigin[1] *= bounding.height / 2; + } + perspectiveOrigin[2] = 0; + } + gl_matrix_1.mat4.perspective(perspectiveMatrix, -Math.PI / 2, 1, 0, Infinity); + } + /** + * Create Repetition matrix + */ + gl_matrix_1.mat4.identity(repetitionMatrix); + gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, offset); + if (bDirectSceneChild) { + gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, sceneAnchor); + } + /** + * Apply anchor + */ + const shapeAnchor = [this.anchor[0] * (bounding.width / 2), this.anchor[1] * (bounding.height / 2), 0]; + gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, shapeAnchor); + if (repetitionType === types_1.ERepetitionType.Ring) + gl_matrix_1.mat4.rotateZ(repetitionMatrix, repetitionMatrix, repetition.angle + displace); + } + Adapt_1.Bounding.clear(tmpSingleRepetitionBounding); + // Apply matrices on vertex + for (let bufferIndex = 0; bufferIndex < bufferLength; bufferIndex += 2) { + const vertex = [buffer[bufferIndex], buffer[bufferIndex + 1], perspectiveValue]; + { + // Apply squeeze, can be insert into transformMatrix? + squeezeX !== 0 && Vec2_1.default.squeezeX(vertex, squeezeX); + squeezeY !== 0 && Vec2_1.default.squeezeY(vertex, squeezeY); + // Apply transforms + gl_matrix_1.vec3.transformMat4(vertex, vertex, transformMatrix); + // Apply perspective + if (perspectiveValue > 0) { + bPerspectiveOrigin && gl_matrix_1.vec3.add(vertex, vertex, perspectiveOrigin); + gl_matrix_1.vec3.transformMat4(vertex, vertex, perspectiveMatrix); + gl_matrix_1.vec3.scale(vertex, vertex, perspectiveValue); + bPerspectiveOrigin && gl_matrix_1.vec3.sub(vertex, vertex, perspectiveOrigin); + } + // apply repetition matrix + gl_matrix_1.vec3.transformMat4(vertex, vertex, repetitionMatrix); + // custom vertex manipulation + if (typeof this.vertexCallback !== 'undefined') { + const index = bufferIndex / 2; + const count = bufferLength / 2; + const vertexRepetition = { + index: index + 1, + count, + offset: count > 1 ? index / (count - 1) : 1, + }; + this.vertexCallback(vertex, vertexRepetition, propArguments); + } + } + buffers[currentIndex][bufferIndex] = vertex[0]; + buffers[currentIndex][bufferIndex + 1] = vertex[1]; + Adapt_1.Bounding.add(tmpSingleRepetitionBounding, vertex[0], vertex[1]); + Adapt_1.Bounding.add(tmpTotalShapeBounding, vertex[0], vertex[1]); + } + } + // Bounding.sum(tmpTotalShapeBounding, tmpSingleRepetitionBounding) + // After buffer creation, add a frame into indexedBuffer if not static or update bounding + const singleRepetitionBounding = { cx: 0, cy: 0, x: -1, y: -1, width: 2, height: 2 }; + Adapt_1.Bounding.bind(singleRepetitionBounding, tmpSingleRepetitionBounding); + if (!this.bStaticIndexed || !this.bIndexed) { + this.addIndex(bufferLength, repetition, singleRepetitionBounding); + } + } + } + Adapt_1.Bounding.bind(this.bounding, tmpTotalShapeBounding); + this.buffer = new Float32Array(totalBufferLength); + for (let i = 0, offset = 0, len = buffers.length; i < len; offset += buffers[i].length, i++) + this.buffer.set(buffers[i], offset); + this.bIndexed = true; } /** - * Sum the children bounding + * Return current shape (whit repetions) bounding * - * @return {IShapeBounding} + * @return {*} {IShapeBounding} */ getBounding() { - const boundings = []; - const bounding = Adapt_1.Bounding.empty(); - if (this.children.length > 0) { - this.children.forEach(item => boundings.push(item.getBounding())); - for (let i = 0, len = this.children.length; i < len; i++) { - bounding.x = bounding.x > boundings[i].x ? boundings[i].x : bounding.x; - bounding.y = bounding.y > boundings[i].y ? boundings[i].y : bounding.y; - bounding.width = bounding.width < boundings[i].width ? boundings[i].width : bounding.width; - bounding.height = bounding.height < boundings[i].height ? boundings[i].height : bounding.height; - } - bounding.cx = bounding.x + bounding.width / 2; - bounding.cy = bounding.y + bounding.height / 2; - } - return bounding; + return this.bounding; } /** - * Chear children buffer - * - * @param {boolean} [bClearIndexed=false] - * @param {boolean} [bPropagateToParents=false] - * @memberof Group + * Get number of repetitions + * + * @returns {number} */ - clearBuffer(bClearIndexed = false, bPropagateToParents = true) { - this.children.forEach(item => item.clearBuffer(bClearIndexed, false)); - if (this.scene && bPropagateToParents) { - const parents = this.scene.getParentsOfSceneChild(this); - parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */); - } - // if (bPropagateToParents && this.scene) - // { - // const parents = this.scene.getParentsOfSceneChild(this) - // parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, true, false) - // } - // if (bPropagateToChildren) - // { - // this.children.forEach(sceneChild => sceneChild.clearBuffer(bClearIndexed, false, true)) - // } + getRepetitionCount() { + var _a; + const repetitions = this.getProp('repetitions', undefined, 1); + return Array.isArray(repetitions) ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) : repetitions; } /** - * Set a single or multiple props + * Return buffer * - * @abstract - * @param {(keyof ISceneChildProps | ISceneChildProps)} key - * @param {*} [value] - * @memberof SceneChild + * @returns {(Float32Array | undefined)} */ - setProp(key, value) { - if (typeof key === 'object') - Object.keys(key).forEach((k) => (this.props[k] = key[k])); - else - this.props[key] = value; - this.children.forEach(item => item.setProp(key, value)); + getBuffer() { + return this.buffer; } /** - * Set a single or multiple props + * Return indexed buffer * - * @param {(keyof ISceneChildProps | ISceneChildProps)} key - * @param {*} [value] - * @memberof ShapeBase + * @returns {(Array> | undefined)} */ - setPropUnsafe(key, value) { - super.setPropUnsafe(key, value); - this.children.forEach(item => item.setPropUnsafe(key, value)); + getIndexedBuffer() { + return this.indexedBuffer; } /** - * Return length of buffer + * Return number of encapsulation * - * @param {IPropArguments} propArguments + * @param {IBufferIndex} index * @returns {number} - * @memberof Group */ - getBufferLength(propArguments) { - return this.children.map(sceneChild => sceneChild.getBufferLength(propArguments)).reduce((p, c) => p + c, 0); + static getIndexParentLevel(index) { + if (typeof index.parent === 'undefined') + return 0; + let currentParent = index.parent; + let currentParentLevel = 1; + while (typeof currentParent.parent !== 'undefined') { + currentParentLevel++; + currentParent = currentParent.parent; + } + return currentParentLevel; } /** - * return a single buffer binded from children + * Stream buffer * - * @returns {Float32Array} - * @memberof Group + * @param {(TStreamCallback} callback */ - getBuffer() { - const buffers = this.children - .map(item => item.getBuffer()) - .filter(b => b !== undefined); - const size = buffers.reduce((currLength, buffer) => currLength + buffer.length, 0); - if (size > 0) { - const result = new Float32Array(size); - result.set(buffers[0], 0); - for (let i = 1, offset = 0, len = buffers.length; i < len; i++) { - offset += buffers[i - 1].length; - result.set(buffers[i], offset); + stream(callback) { + if (this.buffer && this.indexedBuffer) { + for (let i = 0, j = 0, len = this.indexedBuffer.length; i < len; i++) { + const currentIndexing = this.indexedBuffer[i]; + callback({ + buffer: this.buffer, + frameLength: currentIndexing.frameLength, + frameBufferIndex: j, + currentIndexing: currentIndexing, + currentShapeIndex: i, + totalShapes: len, + }); + j += currentIndexing.frameLength; } - return result; } - return ShapeBase_1.ShapeBase.EMPTY_BUFFER; } - /** - * return a single buffer binded from children - * - * @returns {(Array | undefined)} - * @memberof Group - */ - getIndexedBuffer() { - const indexed = this.children.map(item => item.getIndexedBuffer()).filter(b => b !== undefined); - return [].concat.apply([], indexed); + /** + * Return empty propArguments + * + * @static + * @param {ShapeBase} shape + * @return {*} {PropArguments} + */ + static getEmptyPropArguments(shape, parentPropArguments) { + const repetition = { + type: types_1.ERepetitionType.Ring, + angle: 0, + index: 1, + offset: 1, + count: 1, + row: { index: 1, offset: 1, count: 1 }, + col: { index: 1, offset: 1, count: 1 }, + }; + return { + repetition, + shape, + parent: parentPropArguments, + }; + } +} +exports.ShapeBase = ShapeBase; +/** + * Empty buffer + * + * @internal + * @ignore + */ +ShapeBase.EMPTY_BUFFER = new Float32Array(0); +/** + * Empty BaseRepetition + * + * @internal + * @ignore + */ +ShapeBase.getEmptySimpleRepetition = () => ({ + index: 1, + offset: 1, + count: 1, +}); +/** + * Empty Repetition + * + * @internal + * @ignore + */ +ShapeBase.getEmptyRepetition = () => ({ + type: types_1.ERepetitionType.Ring, + angle: 0, + ...ShapeBase.getEmptySimpleRepetition(), + row: ShapeBase.getEmptySimpleRepetition(), + col: ShapeBase.getEmptySimpleRepetition(), +}); +//# sourceMappingURL=ShapeBase.js.map + +/***/ }), +/* 8 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "glMatrix": () => (/* reexport module object */ _common_js__WEBPACK_IMPORTED_MODULE_0__), +/* harmony export */ "mat2": () => (/* reexport module object */ _mat2_js__WEBPACK_IMPORTED_MODULE_1__), +/* harmony export */ "mat2d": () => (/* reexport module object */ _mat2d_js__WEBPACK_IMPORTED_MODULE_2__), +/* harmony export */ "mat3": () => (/* reexport module object */ _mat3_js__WEBPACK_IMPORTED_MODULE_3__), +/* harmony export */ "mat4": () => (/* reexport module object */ _mat4_js__WEBPACK_IMPORTED_MODULE_4__), +/* harmony export */ "quat": () => (/* reexport module object */ _quat_js__WEBPACK_IMPORTED_MODULE_5__), +/* harmony export */ "quat2": () => (/* reexport module object */ _quat2_js__WEBPACK_IMPORTED_MODULE_6__), +/* harmony export */ "vec2": () => (/* reexport module object */ _vec2_js__WEBPACK_IMPORTED_MODULE_7__), +/* harmony export */ "vec3": () => (/* reexport module object */ _vec3_js__WEBPACK_IMPORTED_MODULE_8__), +/* harmony export */ "vec4": () => (/* reexport module object */ _vec4_js__WEBPACK_IMPORTED_MODULE_9__) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); +/* harmony import */ var _mat2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10); +/* harmony import */ var _mat2d_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(11); +/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12); +/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13); +/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(14); +/* harmony import */ var _quat2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(17); +/* harmony import */ var _vec2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(18); +/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(16); +/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(15); + + + + + + + + + + + + +/***/ }), +/* 9 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "EPSILON": () => (/* binding */ EPSILON), +/* harmony export */ "ARRAY_TYPE": () => (/* binding */ ARRAY_TYPE), +/* harmony export */ "RANDOM": () => (/* binding */ RANDOM), +/* harmony export */ "setMatrixArrayType": () => (/* binding */ setMatrixArrayType), +/* harmony export */ "toRadian": () => (/* binding */ toRadian), +/* harmony export */ "equals": () => (/* binding */ equals) +/* harmony export */ }); +/** + * Common utilities + * @module glMatrix + */ +// Configuration Constants +var EPSILON = 0.000001; +var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array; +var RANDOM = Math.random; +/** + * Sets the type of array used when creating new vectors and matrices + * + * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array + */ + +function setMatrixArrayType(type) { + ARRAY_TYPE = type; +} +var degree = Math.PI / 180; +/** + * Convert Degree To Radian + * + * @param {Number} a Angle in Degrees + */ + +function toRadian(a) { + return a * degree; +} +/** + * Tests whether or not the arguments have approximately the same value, within an absolute + * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less + * than or equal to 1.0, and a relative tolerance is used for larger values) + * + * @param {Number} a The first number to test. + * @param {Number} b The second number to test. + * @returns {Boolean} True if the numbers are approximately equal, false otherwise. + */ + +function equals(a, b) { + return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b)); +} +if (!Math.hypot) Math.hypot = function () { + var y = 0, + i = arguments.length; + + while (i--) { + y += arguments[i] * arguments[i]; + } + + return Math.sqrt(y); +}; + +/***/ }), +/* 10 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "transpose": () => (/* binding */ transpose), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "adjoint": () => (/* binding */ adjoint), +/* harmony export */ "determinant": () => (/* binding */ determinant), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "rotate": () => (/* binding */ rotate), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), +/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "frob": () => (/* binding */ frob), +/* harmony export */ "LDU": () => (/* binding */ LDU), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), +/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "sub": () => (/* binding */ sub) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); + +/** + * 2x2 Matrix + * @module mat2 + */ + +/** + * Creates a new identity mat2 + * + * @returns {mat2} a new 2x2 matrix + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[1] = 0; + out[2] = 0; + } + + out[0] = 1; + out[3] = 1; + return out; +} +/** + * Creates a new mat2 initialized with values from an existing matrix + * + * @param {ReadonlyMat2} a matrix to clone + * @returns {mat2} a new 2x2 matrix + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; +} +/** + * Copy the values from one mat2 to another + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the source matrix + * @returns {mat2} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; +} +/** + * Set a mat2 to the identity matrix + * + * @param {mat2} out the receiving matrix + * @returns {mat2} out + */ + +function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; +} +/** + * Create a new mat2 with the given values + * + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m10 Component in column 1, row 0 position (index 2) + * @param {Number} m11 Component in column 1, row 1 position (index 3) + * @returns {mat2} out A new 2x2 matrix + */ + +function fromValues(m00, m01, m10, m11) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + out[0] = m00; + out[1] = m01; + out[2] = m10; + out[3] = m11; + return out; +} +/** + * Set the components of a mat2 to the given values + * + * @param {mat2} out the receiving matrix + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m10 Component in column 1, row 0 position (index 2) + * @param {Number} m11 Component in column 1, row 1 position (index 3) + * @returns {mat2} out + */ + +function set(out, m00, m01, m10, m11) { + out[0] = m00; + out[1] = m01; + out[2] = m10; + out[3] = m11; + return out; +} +/** + * Transpose the values of a mat2 + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the source matrix + * @returns {mat2} out + */ + +function transpose(out, a) { + // If we are transposing ourselves we can skip a few steps but have to cache + // some values + if (out === a) { + var a1 = a[1]; + out[1] = a[2]; + out[2] = a1; + } else { + out[0] = a[0]; + out[1] = a[2]; + out[2] = a[1]; + out[3] = a[3]; + } + + return out; +} +/** + * Inverts a mat2 + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the source matrix + * @returns {mat2} out + */ + +function invert(out, a) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; // Calculate the determinant + + var det = a0 * a3 - a2 * a1; + + if (!det) { + return null; + } + + det = 1.0 / det; + out[0] = a3 * det; + out[1] = -a1 * det; + out[2] = -a2 * det; + out[3] = a0 * det; + return out; +} +/** + * Calculates the adjugate of a mat2 + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the source matrix + * @returns {mat2} out + */ + +function adjoint(out, a) { + // Caching this value is nessecary if out == a + var a0 = a[0]; + out[0] = a[3]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a0; + return out; +} +/** + * Calculates the determinant of a mat2 + * + * @param {ReadonlyMat2} a the source matrix + * @returns {Number} determinant of a + */ + +function determinant(a) { + return a[0] * a[3] - a[2] * a[1]; +} +/** + * Multiplies two mat2's + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the first operand + * @param {ReadonlyMat2} b the second operand + * @returns {mat2} out + */ + +function multiply(out, a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + return out; +} +/** + * Rotates a mat2 by the given angle + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat2} out + */ + +function rotate(out, a, rad) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + return out; +} +/** + * Scales the mat2 by the dimensions in the given vec2 + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the matrix to rotate + * @param {ReadonlyVec2} v the vec2 to scale the matrix by + * @returns {mat2} out + **/ + +function scale(out, a, v) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var v0 = v[0], + v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + return out; +} +/** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * mat2.identity(dest); + * mat2.rotate(dest, dest, rad); + * + * @param {mat2} out mat2 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat2} out + */ + +function fromRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + return out; +} +/** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat2.identity(dest); + * mat2.scale(dest, dest, vec); + * + * @param {mat2} out mat2 receiving operation result + * @param {ReadonlyVec2} v Scaling vector + * @returns {mat2} out + */ + +function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + return out; +} +/** + * Returns a string representation of a mat2 + * + * @param {ReadonlyMat2} a matrix to represent as a string + * @returns {String} string representation of the matrix + */ + +function str(a) { + return "mat2(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; +} +/** + * Returns Frobenius norm of a mat2 + * + * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of + * @returns {Number} Frobenius norm + */ + +function frob(a) { + return Math.hypot(a[0], a[1], a[2], a[3]); +} +/** + * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix + * @param {ReadonlyMat2} L the lower triangular matrix + * @param {ReadonlyMat2} D the diagonal matrix + * @param {ReadonlyMat2} U the upper triangular matrix + * @param {ReadonlyMat2} a the input matrix to factorize + */ + +function LDU(L, D, U, a) { + L[2] = a[2] / a[0]; + U[0] = a[0]; + U[1] = a[1]; + U[3] = a[3] - L[2] * U[1]; + return [L, D, U]; +} +/** + * Adds two mat2's + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the first operand + * @param {ReadonlyMat2} b the second operand + * @returns {mat2} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; +} +/** + * Subtracts matrix b from matrix a + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the first operand + * @param {ReadonlyMat2} b the second operand + * @returns {mat2} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; +} +/** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyMat2} a The first matrix. + * @param {ReadonlyMat2} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; +} +/** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {ReadonlyMat2} a The first matrix. + * @param {ReadonlyMat2} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)); +} +/** + * Multiply each element of the matrix by a scalar. + * + * @param {mat2} out the receiving matrix + * @param {ReadonlyMat2} a the matrix to scale + * @param {Number} b amount to scale the matrix's elements by + * @returns {mat2} out + */ + +function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + return out; +} +/** + * Adds two mat2's after multiplying each element of the second operand by a scalar value. + * + * @param {mat2} out the receiving vector + * @param {ReadonlyMat2} a the first operand + * @param {ReadonlyMat2} b the second operand + * @param {Number} scale the amount to scale b's elements by before adding + * @returns {mat2} out + */ + +function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; +} +/** + * Alias for {@link mat2.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link mat2.subtract} + * @function + */ + +var sub = subtract; + +/***/ }), +/* 11 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "determinant": () => (/* binding */ determinant), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "rotate": () => (/* binding */ rotate), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "translate": () => (/* binding */ translate), +/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), +/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), +/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "frob": () => (/* binding */ frob), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), +/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "sub": () => (/* binding */ sub) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); + +/** + * 2x3 Matrix + * @module mat2d + * @description + * A mat2d contains six elements defined as: + *
+ * [a, b,
+ *  c, d,
+ *  tx, ty]
+ * 
+ * This is a short form for the 3x3 matrix: + *
+ * [a, b, 0,
+ *  c, d, 0,
+ *  tx, ty, 1]
+ * 
+ * The last column is ignored so the array is shorter and operations are faster. + */ + +/** + * Creates a new identity mat2d + * + * @returns {mat2d} a new 2x3 matrix + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[1] = 0; + out[2] = 0; + out[4] = 0; + out[5] = 0; + } + + out[0] = 1; + out[3] = 1; + return out; +} +/** + * Creates a new mat2d initialized with values from an existing matrix + * + * @param {ReadonlyMat2d} a matrix to clone + * @returns {mat2d} a new 2x3 matrix + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + return out; +} +/** + * Copy the values from one mat2d to another + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the source matrix + * @returns {mat2d} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + return out; +} +/** + * Set a mat2d to the identity matrix + * + * @param {mat2d} out the receiving matrix + * @returns {mat2d} out + */ + +function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; +} +/** + * Create a new mat2d with the given values + * + * @param {Number} a Component A (index 0) + * @param {Number} b Component B (index 1) + * @param {Number} c Component C (index 2) + * @param {Number} d Component D (index 3) + * @param {Number} tx Component TX (index 4) + * @param {Number} ty Component TY (index 5) + * @returns {mat2d} A new mat2d + */ + +function fromValues(a, b, c, d, tx, ty) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(6); + out[0] = a; + out[1] = b; + out[2] = c; + out[3] = d; + out[4] = tx; + out[5] = ty; + return out; +} +/** + * Set the components of a mat2d to the given values + * + * @param {mat2d} out the receiving matrix + * @param {Number} a Component A (index 0) + * @param {Number} b Component B (index 1) + * @param {Number} c Component C (index 2) + * @param {Number} d Component D (index 3) + * @param {Number} tx Component TX (index 4) + * @param {Number} ty Component TY (index 5) + * @returns {mat2d} out + */ + +function set(out, a, b, c, d, tx, ty) { + out[0] = a; + out[1] = b; + out[2] = c; + out[3] = d; + out[4] = tx; + out[5] = ty; + return out; +} +/** + * Inverts a mat2d + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the source matrix + * @returns {mat2d} out + */ + +function invert(out, a) { + var aa = a[0], + ab = a[1], + ac = a[2], + ad = a[3]; + var atx = a[4], + aty = a[5]; + var det = aa * ad - ab * ac; + + if (!det) { + return null; + } + + det = 1.0 / det; + out[0] = ad * det; + out[1] = -ab * det; + out[2] = -ac * det; + out[3] = aa * det; + out[4] = (ac * aty - ad * atx) * det; + out[5] = (ab * atx - aa * aty) * det; + return out; +} +/** + * Calculates the determinant of a mat2d + * + * @param {ReadonlyMat2d} a the source matrix + * @returns {Number} determinant of a + */ + +function determinant(a) { + return a[0] * a[3] - a[1] * a[2]; +} +/** + * Multiplies two mat2d's + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the first operand + * @param {ReadonlyMat2d} b the second operand + * @returns {mat2d} out + */ + +function multiply(out, a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3], + b4 = b[4], + b5 = b[5]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + out[4] = a0 * b4 + a2 * b5 + a4; + out[5] = a1 * b4 + a3 * b5 + a5; + return out; +} +/** + * Rotates a mat2d by the given angle + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat2d} out + */ + +function rotate(out, a, rad) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5]; + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + out[4] = a4; + out[5] = a5; + return out; +} +/** + * Scales the mat2d by the dimensions in the given vec2 + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the matrix to translate + * @param {ReadonlyVec2} v the vec2 to scale the matrix by + * @returns {mat2d} out + **/ + +function scale(out, a, v) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5]; + var v0 = v[0], + v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + out[4] = a4; + out[5] = a5; + return out; +} +/** + * Translates the mat2d by the dimensions in the given vec2 + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the matrix to translate + * @param {ReadonlyVec2} v the vec2 to translate the matrix by + * @returns {mat2d} out + **/ + +function translate(out, a, v) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5]; + var v0 = v[0], + v1 = v[1]; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = a0 * v0 + a2 * v1 + a4; + out[5] = a1 * v0 + a3 * v1 + a5; + return out; +} +/** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * mat2d.identity(dest); + * mat2d.rotate(dest, dest, rad); + * + * @param {mat2d} out mat2d receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat2d} out + */ + +function fromRotation(out, rad) { + var s = Math.sin(rad), + c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + out[4] = 0; + out[5] = 0; + return out; +} +/** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat2d.identity(dest); + * mat2d.scale(dest, dest, vec); + * + * @param {mat2d} out mat2d receiving operation result + * @param {ReadonlyVec2} v Scaling vector + * @returns {mat2d} out + */ + +function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + out[4] = 0; + out[5] = 0; + return out; +} +/** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * mat2d.identity(dest); + * mat2d.translate(dest, dest, vec); + * + * @param {mat2d} out mat2d receiving operation result + * @param {ReadonlyVec2} v Translation vector + * @returns {mat2d} out + */ + +function fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = v[0]; + out[5] = v[1]; + return out; +} +/** + * Returns a string representation of a mat2d + * + * @param {ReadonlyMat2d} a matrix to represent as a string + * @returns {String} string representation of the matrix + */ + +function str(a) { + return "mat2d(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ")"; +} +/** + * Returns Frobenius norm of a mat2d + * + * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of + * @returns {Number} Frobenius norm + */ + +function frob(a) { + return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1); +} +/** + * Adds two mat2d's + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the first operand + * @param {ReadonlyMat2d} b the second operand + * @returns {mat2d} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + return out; +} +/** + * Subtracts matrix b from matrix a + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the first operand + * @param {ReadonlyMat2d} b the second operand + * @returns {mat2d} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + return out; +} +/** + * Multiply each element of the matrix by a scalar. + * + * @param {mat2d} out the receiving matrix + * @param {ReadonlyMat2d} a the matrix to scale + * @param {Number} b amount to scale the matrix's elements by + * @returns {mat2d} out + */ + +function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + return out; +} +/** + * Adds two mat2d's after multiplying each element of the second operand by a scalar value. + * + * @param {mat2d} out the receiving vector + * @param {ReadonlyMat2d} a the first operand + * @param {ReadonlyMat2d} b the second operand + * @param {Number} scale the amount to scale b's elements by before adding + * @returns {mat2d} out + */ + +function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + return out; +} +/** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyMat2d} a The first matrix. + * @param {ReadonlyMat2d} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5]; +} +/** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {ReadonlyMat2d} a The first matrix. + * @param {ReadonlyMat2d} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3], + b4 = b[4], + b5 = b[5]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)); +} +/** + * Alias for {@link mat2d.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link mat2d.subtract} + * @function + */ + +var sub = subtract; + +/***/ }), +/* 12 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "fromMat4": () => (/* binding */ fromMat4), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "transpose": () => (/* binding */ transpose), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "adjoint": () => (/* binding */ adjoint), +/* harmony export */ "determinant": () => (/* binding */ determinant), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "translate": () => (/* binding */ translate), +/* harmony export */ "rotate": () => (/* binding */ rotate), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), +/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), +/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), +/* harmony export */ "fromMat2d": () => (/* binding */ fromMat2d), +/* harmony export */ "fromQuat": () => (/* binding */ fromQuat), +/* harmony export */ "normalFromMat4": () => (/* binding */ normalFromMat4), +/* harmony export */ "projection": () => (/* binding */ projection), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "frob": () => (/* binding */ frob), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), +/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "sub": () => (/* binding */ sub) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); + +/** + * 3x3 Matrix + * @module mat3 + */ + +/** + * Creates a new identity mat3 + * + * @returns {mat3} a new 3x3 matrix + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + } + + out[0] = 1; + out[4] = 1; + out[8] = 1; + return out; +} +/** + * Copies the upper-left 3x3 values into the given mat3. + * + * @param {mat3} out the receiving 3x3 matrix + * @param {ReadonlyMat4} a the source 4x4 matrix + * @returns {mat3} out + */ + +function fromMat4(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[4]; + out[4] = a[5]; + out[5] = a[6]; + out[6] = a[8]; + out[7] = a[9]; + out[8] = a[10]; + return out; +} +/** + * Creates a new mat3 initialized with values from an existing matrix + * + * @param {ReadonlyMat3} a matrix to clone + * @returns {mat3} a new 3x3 matrix + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; +} +/** + * Copy the values from one mat3 to another + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the source matrix + * @returns {mat3} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; +} +/** + * Create a new mat3 with the given values + * + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m02 Component in column 0, row 2 position (index 2) + * @param {Number} m10 Component in column 1, row 0 position (index 3) + * @param {Number} m11 Component in column 1, row 1 position (index 4) + * @param {Number} m12 Component in column 1, row 2 position (index 5) + * @param {Number} m20 Component in column 2, row 0 position (index 6) + * @param {Number} m21 Component in column 2, row 1 position (index 7) + * @param {Number} m22 Component in column 2, row 2 position (index 8) + * @returns {mat3} A new mat3 + */ + +function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m10; + out[4] = m11; + out[5] = m12; + out[6] = m20; + out[7] = m21; + out[8] = m22; + return out; +} +/** + * Set the components of a mat3 to the given values + * + * @param {mat3} out the receiving matrix + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m02 Component in column 0, row 2 position (index 2) + * @param {Number} m10 Component in column 1, row 0 position (index 3) + * @param {Number} m11 Component in column 1, row 1 position (index 4) + * @param {Number} m12 Component in column 1, row 2 position (index 5) + * @param {Number} m20 Component in column 2, row 0 position (index 6) + * @param {Number} m21 Component in column 2, row 1 position (index 7) + * @param {Number} m22 Component in column 2, row 2 position (index 8) + * @returns {mat3} out + */ + +function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) { + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m10; + out[4] = m11; + out[5] = m12; + out[6] = m20; + out[7] = m21; + out[8] = m22; + return out; +} +/** + * Set a mat3 to the identity matrix + * + * @param {mat3} out the receiving matrix + * @returns {mat3} out + */ + +function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; +} +/** + * Transpose the values of a mat3 + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the source matrix + * @returns {mat3} out + */ + +function transpose(out, a) { + // If we are transposing ourselves we can skip a few steps but have to cache some values + if (out === a) { + var a01 = a[1], + a02 = a[2], + a12 = a[5]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a01; + out[5] = a[7]; + out[6] = a02; + out[7] = a12; + } else { + out[0] = a[0]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a[1]; + out[4] = a[4]; + out[5] = a[7]; + out[6] = a[2]; + out[7] = a[5]; + out[8] = a[8]; + } + + return out; +} +/** + * Inverts a mat3 + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the source matrix + * @returns {mat3} out + */ + +function invert(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2]; + var a10 = a[3], + a11 = a[4], + a12 = a[5]; + var a20 = a[6], + a21 = a[7], + a22 = a[8]; + var b01 = a22 * a11 - a12 * a21; + var b11 = -a22 * a10 + a12 * a20; + var b21 = a21 * a10 - a11 * a20; // Calculate the determinant + + var det = a00 * b01 + a01 * b11 + a02 * b21; + + if (!det) { + return null; + } + + det = 1.0 / det; + out[0] = b01 * det; + out[1] = (-a22 * a01 + a02 * a21) * det; + out[2] = (a12 * a01 - a02 * a11) * det; + out[3] = b11 * det; + out[4] = (a22 * a00 - a02 * a20) * det; + out[5] = (-a12 * a00 + a02 * a10) * det; + out[6] = b21 * det; + out[7] = (-a21 * a00 + a01 * a20) * det; + out[8] = (a11 * a00 - a01 * a10) * det; + return out; +} +/** + * Calculates the adjugate of a mat3 + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the source matrix + * @returns {mat3} out + */ + +function adjoint(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2]; + var a10 = a[3], + a11 = a[4], + a12 = a[5]; + var a20 = a[6], + a21 = a[7], + a22 = a[8]; + out[0] = a11 * a22 - a12 * a21; + out[1] = a02 * a21 - a01 * a22; + out[2] = a01 * a12 - a02 * a11; + out[3] = a12 * a20 - a10 * a22; + out[4] = a00 * a22 - a02 * a20; + out[5] = a02 * a10 - a00 * a12; + out[6] = a10 * a21 - a11 * a20; + out[7] = a01 * a20 - a00 * a21; + out[8] = a00 * a11 - a01 * a10; + return out; +} +/** + * Calculates the determinant of a mat3 + * + * @param {ReadonlyMat3} a the source matrix + * @returns {Number} determinant of a + */ + +function determinant(a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2]; + var a10 = a[3], + a11 = a[4], + a12 = a[5]; + var a20 = a[6], + a21 = a[7], + a22 = a[8]; + return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); +} +/** + * Multiplies two mat3's + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the first operand + * @param {ReadonlyMat3} b the second operand + * @returns {mat3} out + */ + +function multiply(out, a, b) { + var a00 = a[0], + a01 = a[1], + a02 = a[2]; + var a10 = a[3], + a11 = a[4], + a12 = a[5]; + var a20 = a[6], + a21 = a[7], + a22 = a[8]; + var b00 = b[0], + b01 = b[1], + b02 = b[2]; + var b10 = b[3], + b11 = b[4], + b12 = b[5]; + var b20 = b[6], + b21 = b[7], + b22 = b[8]; + out[0] = b00 * a00 + b01 * a10 + b02 * a20; + out[1] = b00 * a01 + b01 * a11 + b02 * a21; + out[2] = b00 * a02 + b01 * a12 + b02 * a22; + out[3] = b10 * a00 + b11 * a10 + b12 * a20; + out[4] = b10 * a01 + b11 * a11 + b12 * a21; + out[5] = b10 * a02 + b11 * a12 + b12 * a22; + out[6] = b20 * a00 + b21 * a10 + b22 * a20; + out[7] = b20 * a01 + b21 * a11 + b22 * a21; + out[8] = b20 * a02 + b21 * a12 + b22 * a22; + return out; +} +/** + * Translate a mat3 by the given vector + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the matrix to translate + * @param {ReadonlyVec2} v vector to translate by + * @returns {mat3} out + */ + +function translate(out, a, v) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a10 = a[3], + a11 = a[4], + a12 = a[5], + a20 = a[6], + a21 = a[7], + a22 = a[8], + x = v[0], + y = v[1]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a10; + out[4] = a11; + out[5] = a12; + out[6] = x * a00 + y * a10 + a20; + out[7] = x * a01 + y * a11 + a21; + out[8] = x * a02 + y * a12 + a22; + return out; +} +/** + * Rotates a mat3 by the given angle + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat3} out + */ + +function rotate(out, a, rad) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a10 = a[3], + a11 = a[4], + a12 = a[5], + a20 = a[6], + a21 = a[7], + a22 = a[8], + s = Math.sin(rad), + c = Math.cos(rad); + out[0] = c * a00 + s * a10; + out[1] = c * a01 + s * a11; + out[2] = c * a02 + s * a12; + out[3] = c * a10 - s * a00; + out[4] = c * a11 - s * a01; + out[5] = c * a12 - s * a02; + out[6] = a20; + out[7] = a21; + out[8] = a22; + return out; +} +/** + * Scales the mat3 by the dimensions in the given vec2 + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the matrix to rotate + * @param {ReadonlyVec2} v the vec2 to scale the matrix by + * @returns {mat3} out + **/ + +function scale(out, a, v) { + var x = v[0], + y = v[1]; + out[0] = x * a[0]; + out[1] = x * a[1]; + out[2] = x * a[2]; + out[3] = y * a[3]; + out[4] = y * a[4]; + out[5] = y * a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; +} +/** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyVec2} v Translation vector + * @returns {mat3} out + */ + +function fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = v[0]; + out[7] = v[1]; + out[8] = 1; + return out; +} +/** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.rotate(dest, dest, rad); + * + * @param {mat3} out mat3 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat3} out + */ + +function fromRotation(out, rad) { + var s = Math.sin(rad), + c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = -s; + out[4] = c; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; +} +/** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyVec2} v Scaling vector + * @returns {mat3} out + */ + +function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = v[1]; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; +} +/** + * Copies the values from a mat2d into a mat3 + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat2d} a the matrix to copy + * @returns {mat3} out + **/ + +function fromMat2d(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = 0; + out[3] = a[2]; + out[4] = a[3]; + out[5] = 0; + out[6] = a[4]; + out[7] = a[5]; + out[8] = 1; + return out; +} +/** + * Calculates a 3x3 matrix from the given quaternion + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyQuat} q Quaternion to create matrix from + * + * @returns {mat3} out + */ + +function fromQuat(out, q) { + var x = q[0], + y = q[1], + z = q[2], + w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var yx = y * x2; + var yy = y * y2; + var zx = z * x2; + var zy = z * y2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + out[0] = 1 - yy - zz; + out[3] = yx - wz; + out[6] = zx + wy; + out[1] = yx + wz; + out[4] = 1 - xx - zz; + out[7] = zy - wx; + out[2] = zx - wy; + out[5] = zy + wx; + out[8] = 1 - xx - yy; + return out; +} +/** + * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from + * + * @returns {mat3} out + */ + +function normalFromMat4(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; // Calculate the determinant + + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) { + return null; + } + + det = 1.0 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + return out; +} +/** + * Generates a 2D projection matrix with the given bounds + * + * @param {mat3} out mat3 frustum matrix will be written into + * @param {number} width Width of your gl context + * @param {number} height Height of gl context + * @returns {mat3} out + */ + +function projection(out, width, height) { + out[0] = 2 / width; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = -2 / height; + out[5] = 0; + out[6] = -1; + out[7] = 1; + out[8] = 1; + return out; +} +/** + * Returns a string representation of a mat3 + * + * @param {ReadonlyMat3} a matrix to represent as a string + * @returns {String} string representation of the matrix + */ + +function str(a) { + return "mat3(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ")"; +} +/** + * Returns Frobenius norm of a mat3 + * + * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of + * @returns {Number} Frobenius norm + */ + +function frob(a) { + return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]); +} +/** + * Adds two mat3's + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the first operand + * @param {ReadonlyMat3} b the second operand + * @returns {mat3} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + return out; +} +/** + * Subtracts matrix b from matrix a + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the first operand + * @param {ReadonlyMat3} b the second operand + * @returns {mat3} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + return out; +} +/** + * Multiply each element of the matrix by a scalar. + * + * @param {mat3} out the receiving matrix + * @param {ReadonlyMat3} a the matrix to scale + * @param {Number} b amount to scale the matrix's elements by + * @returns {mat3} out + */ + +function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + return out; +} +/** + * Adds two mat3's after multiplying each element of the second operand by a scalar value. + * + * @param {mat3} out the receiving vector + * @param {ReadonlyMat3} a the first operand + * @param {ReadonlyMat3} b the second operand + * @param {Number} scale the amount to scale b's elements by before adding + * @returns {mat3} out + */ + +function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + return out; +} +/** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyMat3} a The first matrix. + * @param {ReadonlyMat3} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8]; +} +/** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {ReadonlyMat3} a The first matrix. + * @param {ReadonlyMat3} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5], + a6 = a[6], + a7 = a[7], + a8 = a[8]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3], + b4 = b[4], + b5 = b[5], + b6 = b[6], + b7 = b[7], + b8 = b[8]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)); +} +/** + * Alias for {@link mat3.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link mat3.subtract} + * @function + */ + +var sub = subtract; + +/***/ }), +/* 13 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "transpose": () => (/* binding */ transpose), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "adjoint": () => (/* binding */ adjoint), +/* harmony export */ "determinant": () => (/* binding */ determinant), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "translate": () => (/* binding */ translate), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "rotate": () => (/* binding */ rotate), +/* harmony export */ "rotateX": () => (/* binding */ rotateX), +/* harmony export */ "rotateY": () => (/* binding */ rotateY), +/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), +/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), +/* harmony export */ "fromScaling": () => (/* binding */ fromScaling), +/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), +/* harmony export */ "fromXRotation": () => (/* binding */ fromXRotation), +/* harmony export */ "fromYRotation": () => (/* binding */ fromYRotation), +/* harmony export */ "fromZRotation": () => (/* binding */ fromZRotation), +/* harmony export */ "fromRotationTranslation": () => (/* binding */ fromRotationTranslation), +/* harmony export */ "fromQuat2": () => (/* binding */ fromQuat2), +/* harmony export */ "getTranslation": () => (/* binding */ getTranslation), +/* harmony export */ "getScaling": () => (/* binding */ getScaling), +/* harmony export */ "getRotation": () => (/* binding */ getRotation), +/* harmony export */ "fromRotationTranslationScale": () => (/* binding */ fromRotationTranslationScale), +/* harmony export */ "fromRotationTranslationScaleOrigin": () => (/* binding */ fromRotationTranslationScaleOrigin), +/* harmony export */ "fromQuat": () => (/* binding */ fromQuat), +/* harmony export */ "frustum": () => (/* binding */ frustum), +/* harmony export */ "perspective": () => (/* binding */ perspective), +/* harmony export */ "perspectiveFromFieldOfView": () => (/* binding */ perspectiveFromFieldOfView), +/* harmony export */ "ortho": () => (/* binding */ ortho), +/* harmony export */ "lookAt": () => (/* binding */ lookAt), +/* harmony export */ "targetTo": () => (/* binding */ targetTo), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "frob": () => (/* binding */ frob), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiplyScalar": () => (/* binding */ multiplyScalar), +/* harmony export */ "multiplyScalarAndAdd": () => (/* binding */ multiplyScalarAndAdd), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "sub": () => (/* binding */ sub) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); + +/** + * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied. + * @module mat4 + */ + +/** + * Creates a new identity mat4 + * + * @returns {mat4} a new 4x4 matrix + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + } + + out[0] = 1; + out[5] = 1; + out[10] = 1; + out[15] = 1; + return out; +} +/** + * Creates a new mat4 initialized with values from an existing matrix + * + * @param {ReadonlyMat4} a matrix to clone + * @returns {mat4} a new 4x4 matrix + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; +} +/** + * Copy the values from one mat4 to another + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the source matrix + * @returns {mat4} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; +} +/** + * Create a new mat4 with the given values + * + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m02 Component in column 0, row 2 position (index 2) + * @param {Number} m03 Component in column 0, row 3 position (index 3) + * @param {Number} m10 Component in column 1, row 0 position (index 4) + * @param {Number} m11 Component in column 1, row 1 position (index 5) + * @param {Number} m12 Component in column 1, row 2 position (index 6) + * @param {Number} m13 Component in column 1, row 3 position (index 7) + * @param {Number} m20 Component in column 2, row 0 position (index 8) + * @param {Number} m21 Component in column 2, row 1 position (index 9) + * @param {Number} m22 Component in column 2, row 2 position (index 10) + * @param {Number} m23 Component in column 2, row 3 position (index 11) + * @param {Number} m30 Component in column 3, row 0 position (index 12) + * @param {Number} m31 Component in column 3, row 1 position (index 13) + * @param {Number} m32 Component in column 3, row 2 position (index 14) + * @param {Number} m33 Component in column 3, row 3 position (index 15) + * @returns {mat4} A new mat4 + */ + +function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m03; + out[4] = m10; + out[5] = m11; + out[6] = m12; + out[7] = m13; + out[8] = m20; + out[9] = m21; + out[10] = m22; + out[11] = m23; + out[12] = m30; + out[13] = m31; + out[14] = m32; + out[15] = m33; + return out; +} +/** + * Set the components of a mat4 to the given values + * + * @param {mat4} out the receiving matrix + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m02 Component in column 0, row 2 position (index 2) + * @param {Number} m03 Component in column 0, row 3 position (index 3) + * @param {Number} m10 Component in column 1, row 0 position (index 4) + * @param {Number} m11 Component in column 1, row 1 position (index 5) + * @param {Number} m12 Component in column 1, row 2 position (index 6) + * @param {Number} m13 Component in column 1, row 3 position (index 7) + * @param {Number} m20 Component in column 2, row 0 position (index 8) + * @param {Number} m21 Component in column 2, row 1 position (index 9) + * @param {Number} m22 Component in column 2, row 2 position (index 10) + * @param {Number} m23 Component in column 2, row 3 position (index 11) + * @param {Number} m30 Component in column 3, row 0 position (index 12) + * @param {Number} m31 Component in column 3, row 1 position (index 13) + * @param {Number} m32 Component in column 3, row 2 position (index 14) + * @param {Number} m33 Component in column 3, row 3 position (index 15) + * @returns {mat4} out + */ + +function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m03; + out[4] = m10; + out[5] = m11; + out[6] = m12; + out[7] = m13; + out[8] = m20; + out[9] = m21; + out[10] = m22; + out[11] = m23; + out[12] = m30; + out[13] = m31; + out[14] = m32; + out[15] = m33; + return out; +} +/** + * Set a mat4 to the identity matrix + * + * @param {mat4} out the receiving matrix + * @returns {mat4} out + */ + +function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Transpose the values of a mat4 + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the source matrix + * @returns {mat4} out + */ + +function transpose(out, a) { + // If we are transposing ourselves we can skip a few steps but have to cache some values + if (out === a) { + var a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a12 = a[6], + a13 = a[7]; + var a23 = a[11]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a01; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a02; + out[9] = a12; + out[11] = a[14]; + out[12] = a03; + out[13] = a13; + out[14] = a23; + } else { + out[0] = a[0]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a[1]; + out[5] = a[5]; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a[2]; + out[9] = a[6]; + out[10] = a[10]; + out[11] = a[14]; + out[12] = a[3]; + out[13] = a[7]; + out[14] = a[11]; + out[15] = a[15]; + } + + return out; +} +/** + * Inverts a mat4 + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the source matrix + * @returns {mat4} out + */ + +function invert(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; // Calculate the determinant + + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) { + return null; + } + + det = 1.0 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + return out; +} +/** + * Calculates the adjugate of a mat4 + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the source matrix + * @returns {mat4} out + */ + +function adjoint(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22); + out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); + out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12); + out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); + out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); + out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22); + out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); + out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12); + out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21); + out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); + out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11); + out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); + out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); + out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21); + out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); + out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11); + return out; +} +/** + * Calculates the determinant of a mat4 + * + * @param {ReadonlyMat4} a the source matrix + * @returns {Number} determinant of a + */ + +function determinant(a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; // Calculate the determinant + + return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; +} +/** + * Multiplies two mat4s + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the first operand + * @param {ReadonlyMat4} b the second operand + * @returns {mat4} out + */ + +function multiply(out, a, b) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; // Cache only the current line of the second matrix + + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + return out; +} +/** + * Translate a mat4 by the given vector + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to translate + * @param {ReadonlyVec3} v vector to translate by + * @returns {mat4} out + */ + +function translate(out, a, v) { + var x = v[0], + y = v[1], + z = v[2]; + var a00, a01, a02, a03; + var a10, a11, a12, a13; + var a20, a21, a22, a23; + + if (a === out) { + out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + } else { + a00 = a[0]; + a01 = a[1]; + a02 = a[2]; + a03 = a[3]; + a10 = a[4]; + a11 = a[5]; + a12 = a[6]; + a13 = a[7]; + a20 = a[8]; + a21 = a[9]; + a22 = a[10]; + a23 = a[11]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a03; + out[4] = a10; + out[5] = a11; + out[6] = a12; + out[7] = a13; + out[8] = a20; + out[9] = a21; + out[10] = a22; + out[11] = a23; + out[12] = a00 * x + a10 * y + a20 * z + a[12]; + out[13] = a01 * x + a11 * y + a21 * z + a[13]; + out[14] = a02 * x + a12 * y + a22 * z + a[14]; + out[15] = a03 * x + a13 * y + a23 * z + a[15]; + } + + return out; +} +/** + * Scales the mat4 by the dimensions in the given vec3 not using vectorization + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to scale + * @param {ReadonlyVec3} v the vec3 to scale the matrix by + * @returns {mat4} out + **/ + +function scale(out, a, v) { + var x = v[0], + y = v[1], + z = v[2]; + out[0] = a[0] * x; + out[1] = a[1] * x; + out[2] = a[2] * x; + out[3] = a[3] * x; + out[4] = a[4] * y; + out[5] = a[5] * y; + out[6] = a[6] * y; + out[7] = a[7] * y; + out[8] = a[8] * z; + out[9] = a[9] * z; + out[10] = a[10] * z; + out[11] = a[11] * z; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; +} +/** + * Rotates a mat4 by the given angle around the given axis + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @param {ReadonlyVec3} axis the axis to rotate around + * @returns {mat4} out + */ + +function rotate(out, a, rad, axis) { + var x = axis[0], + y = axis[1], + z = axis[2]; + var len = Math.hypot(x, y, z); + var s, c, t; + var a00, a01, a02, a03; + var a10, a11, a12, a13; + var a20, a21, a22, a23; + var b00, b01, b02; + var b10, b11, b12; + var b20, b21, b22; + + if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + return null; + } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + s = Math.sin(rad); + c = Math.cos(rad); + t = 1 - c; + a00 = a[0]; + a01 = a[1]; + a02 = a[2]; + a03 = a[3]; + a10 = a[4]; + a11 = a[5]; + a12 = a[6]; + a13 = a[7]; + a20 = a[8]; + a21 = a[9]; + a22 = a[10]; + a23 = a[11]; // Construct the elements of the rotation matrix + + b00 = x * x * t + c; + b01 = y * x * t + z * s; + b02 = z * x * t - y * s; + b10 = x * y * t - z * s; + b11 = y * y * t + c; + b12 = z * y * t + x * s; + b20 = x * z * t + y * s; + b21 = y * z * t - x * s; + b22 = z * z * t + c; // Perform rotation-specific matrix multiplication + + out[0] = a00 * b00 + a10 * b01 + a20 * b02; + out[1] = a01 * b00 + a11 * b01 + a21 * b02; + out[2] = a02 * b00 + a12 * b01 + a22 * b02; + out[3] = a03 * b00 + a13 * b01 + a23 * b02; + out[4] = a00 * b10 + a10 * b11 + a20 * b12; + out[5] = a01 * b10 + a11 * b11 + a21 * b12; + out[6] = a02 * b10 + a12 * b11 + a22 * b12; + out[7] = a03 * b10 + a13 * b11 + a23 * b12; + out[8] = a00 * b20 + a10 * b21 + a20 * b22; + out[9] = a01 * b20 + a11 * b21 + a21 * b22; + out[10] = a02 * b20 + a12 * b21 + a22 * b22; + out[11] = a03 * b20 + a13 * b21 + a23 * b22; + + if (a !== out) { + // If the source and destination differ, copy the unchanged last row + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + + return out; +} +/** + * Rotates a matrix by the given angle around the X axis + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function rotateX(out, a, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + if (a !== out) { + // If the source and destination differ, copy the unchanged rows + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } // Perform axis-specific matrix multiplication + + + out[4] = a10 * c + a20 * s; + out[5] = a11 * c + a21 * s; + out[6] = a12 * c + a22 * s; + out[7] = a13 * c + a23 * s; + out[8] = a20 * c - a10 * s; + out[9] = a21 * c - a11 * s; + out[10] = a22 * c - a12 * s; + out[11] = a23 * c - a13 * s; + return out; +} +/** + * Rotates a matrix by the given angle around the Y axis + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function rotateY(out, a, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + if (a !== out) { + // If the source and destination differ, copy the unchanged rows + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } // Perform axis-specific matrix multiplication + + + out[0] = a00 * c - a20 * s; + out[1] = a01 * c - a21 * s; + out[2] = a02 * c - a22 * s; + out[3] = a03 * c - a23 * s; + out[8] = a00 * s + a20 * c; + out[9] = a01 * s + a21 * c; + out[10] = a02 * s + a22 * c; + out[11] = a03 * s + a23 * c; + return out; +} +/** + * Rotates a matrix by the given angle around the Z axis + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function rotateZ(out, a, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + if (a !== out) { + // If the source and destination differ, copy the unchanged last row + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } // Perform axis-specific matrix multiplication + + + out[0] = a00 * c + a10 * s; + out[1] = a01 * c + a11 * s; + out[2] = a02 * c + a12 * s; + out[3] = a03 * c + a13 * s; + out[4] = a10 * c - a00 * s; + out[5] = a11 * c - a01 * s; + out[6] = a12 * c - a02 * s; + out[7] = a13 * c - a03 * s; + return out; +} +/** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * + * @param {mat4} out mat4 receiving operation result + * @param {ReadonlyVec3} v Translation vector + * @returns {mat4} out + */ + +function fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; +} +/** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * + * @param {mat4} out mat4 receiving operation result + * @param {ReadonlyVec3} v Scaling vector + * @returns {mat4} out + */ + +function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = v[1]; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = v[2]; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Creates a matrix from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @param {ReadonlyVec3} axis the axis to rotate around + * @returns {mat4} out + */ + +function fromRotation(out, rad, axis) { + var x = axis[0], + y = axis[1], + z = axis[2]; + var len = Math.hypot(x, y, z); + var s, c, t; + + if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + return null; + } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + s = Math.sin(rad); + c = Math.cos(rad); + t = 1 - c; // Perform rotation-specific matrix multiplication + + out[0] = x * x * t + c; + out[1] = y * x * t + z * s; + out[2] = z * x * t - y * s; + out[3] = 0; + out[4] = x * y * t - z * s; + out[5] = y * y * t + c; + out[6] = z * y * t + x * s; + out[7] = 0; + out[8] = x * z * t + y * s; + out[9] = y * z * t - x * s; + out[10] = z * z * t + c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function fromXRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); // Perform axis-specific matrix multiplication + + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = c; + out[6] = s; + out[7] = 0; + out[8] = 0; + out[9] = -s; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function fromYRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); // Perform axis-specific matrix multiplication + + out[0] = c; + out[1] = 0; + out[2] = -s; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = s; + out[9] = 0; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + +function fromZRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); // Perform axis-specific matrix multiplication + + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = 0; + out[4] = -s; + out[5] = c; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Creates a matrix from a quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * + * @param {mat4} out mat4 receiving operation result + * @param {quat4} q Rotation quaternion + * @param {ReadonlyVec3} v Translation vector + * @returns {mat4} out + */ + +function fromRotationTranslation(out, q, v) { + // Quaternion math + var x = q[0], + y = q[1], + z = q[2], + w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; +} +/** + * Creates a new mat4 from a dual quat. + * + * @param {mat4} out Matrix + * @param {ReadonlyQuat2} a Dual Quaternion + * @returns {mat4} mat4 receiving operation result + */ + +function fromQuat2(out, a) { + var translation = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + var bx = -a[0], + by = -a[1], + bz = -a[2], + bw = a[3], + ax = a[4], + ay = a[5], + az = a[6], + aw = a[7]; + var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense + + if (magnitude > 0) { + translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude; + translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude; + translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude; + } else { + translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + } + + fromRotationTranslation(out, a, translation); + return out; +} +/** + * Returns the translation vector component of a transformation + * matrix. If a matrix is built with fromRotationTranslation, + * the returned vector will be the same as the translation vector + * originally supplied. + * @param {vec3} out Vector to receive translation component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + +function getTranslation(out, mat) { + out[0] = mat[12]; + out[1] = mat[13]; + out[2] = mat[14]; + return out; +} +/** + * Returns the scaling factor component of a transformation + * matrix. If a matrix is built with fromRotationTranslationScale + * with a normalized Quaternion paramter, the returned vector will be + * the same as the scaling vector + * originally supplied. + * @param {vec3} out Vector to receive scaling factor component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + +function getScaling(out, mat) { + var m11 = mat[0]; + var m12 = mat[1]; + var m13 = mat[2]; + var m21 = mat[4]; + var m22 = mat[5]; + var m23 = mat[6]; + var m31 = mat[8]; + var m32 = mat[9]; + var m33 = mat[10]; + out[0] = Math.hypot(m11, m12, m13); + out[1] = Math.hypot(m21, m22, m23); + out[2] = Math.hypot(m31, m32, m33); + return out; +} +/** + * Returns a quaternion representing the rotational component + * of a transformation matrix. If a matrix is built with + * fromRotationTranslation, the returned quaternion will be the + * same as the quaternion originally supplied. + * @param {quat} out Quaternion to receive the rotation component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {quat} out + */ + +function getRotation(out, mat) { + var scaling = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + getScaling(scaling, mat); + var is1 = 1 / scaling[0]; + var is2 = 1 / scaling[1]; + var is3 = 1 / scaling[2]; + var sm11 = mat[0] * is1; + var sm12 = mat[1] * is2; + var sm13 = mat[2] * is3; + var sm21 = mat[4] * is1; + var sm22 = mat[5] * is2; + var sm23 = mat[6] * is3; + var sm31 = mat[8] * is1; + var sm32 = mat[9] * is2; + var sm33 = mat[10] * is3; + var trace = sm11 + sm22 + sm33; + var S = 0; + + if (trace > 0) { + S = Math.sqrt(trace + 1.0) * 2; + out[3] = 0.25 * S; + out[0] = (sm23 - sm32) / S; + out[1] = (sm31 - sm13) / S; + out[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2; + out[3] = (sm23 - sm32) / S; + out[0] = 0.25 * S; + out[1] = (sm12 + sm21) / S; + out[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2; + out[3] = (sm31 - sm13) / S; + out[0] = (sm12 + sm21) / S; + out[1] = 0.25 * S; + out[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2; + out[3] = (sm12 - sm21) / S; + out[0] = (sm31 + sm13) / S; + out[1] = (sm23 + sm32) / S; + out[2] = 0.25 * S; + } + + return out; +} +/** + * Creates a matrix from a quaternion rotation, vector translation and vector scale + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * + * @param {mat4} out mat4 receiving operation result + * @param {quat4} q Rotation quaternion + * @param {ReadonlyVec3} v Translation vector + * @param {ReadonlyVec3} s Scaling vector + * @returns {mat4} out + */ + +function fromRotationTranslationScale(out, q, v, s) { + // Quaternion math + var x = q[0], + y = q[1], + z = q[2], + w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + var sx = s[0]; + var sy = s[1]; + var sz = s[2]; + out[0] = (1 - (yy + zz)) * sx; + out[1] = (xy + wz) * sx; + out[2] = (xz - wy) * sx; + out[3] = 0; + out[4] = (xy - wz) * sy; + out[5] = (1 - (xx + zz)) * sy; + out[6] = (yz + wx) * sy; + out[7] = 0; + out[8] = (xz + wy) * sz; + out[9] = (yz - wx) * sz; + out[10] = (1 - (xx + yy)) * sz; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; +} +/** + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * + * @param {mat4} out mat4 receiving operation result + * @param {quat4} q Rotation quaternion + * @param {ReadonlyVec3} v Translation vector + * @param {ReadonlyVec3} s Scaling vector + * @param {ReadonlyVec3} o The origin vector around which to scale and rotate + * @returns {mat4} out + */ + +function fromRotationTranslationScaleOrigin(out, q, v, s, o) { + // Quaternion math + var x = q[0], + y = q[1], + z = q[2], + w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + var sx = s[0]; + var sy = s[1]; + var sz = s[2]; + var ox = o[0]; + var oy = o[1]; + var oz = o[2]; + var out0 = (1 - (yy + zz)) * sx; + var out1 = (xy + wz) * sx; + var out2 = (xz - wy) * sx; + var out4 = (xy - wz) * sy; + var out5 = (1 - (xx + zz)) * sy; + var out6 = (yz + wx) * sy; + var out8 = (xz + wy) * sz; + var out9 = (yz - wx) * sz; + var out10 = (1 - (xx + yy)) * sz; + out[0] = out0; + out[1] = out1; + out[2] = out2; + out[3] = 0; + out[4] = out4; + out[5] = out5; + out[6] = out6; + out[7] = 0; + out[8] = out8; + out[9] = out9; + out[10] = out10; + out[11] = 0; + out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz); + out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz); + out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz); + out[15] = 1; + return out; +} +/** + * Calculates a 4x4 matrix from the given quaternion + * + * @param {mat4} out mat4 receiving operation result + * @param {ReadonlyQuat} q Quaternion to create matrix from + * + * @returns {mat4} out + */ + +function fromQuat(out, q) { + var x = q[0], + y = q[1], + z = q[2], + w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var yx = y * x2; + var yy = y * y2; + var zx = z * x2; + var zy = z * y2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + out[0] = 1 - yy - zz; + out[1] = yx + wz; + out[2] = zx - wy; + out[3] = 0; + out[4] = yx - wz; + out[5] = 1 - xx - zz; + out[6] = zy + wx; + out[7] = 0; + out[8] = zx + wy; + out[9] = zy - wx; + out[10] = 1 - xx - yy; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} +/** + * Generates a frustum matrix with the given bounds + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {Number} left Left bound of the frustum + * @param {Number} right Right bound of the frustum + * @param {Number} bottom Bottom bound of the frustum + * @param {Number} top Top bound of the frustum + * @param {Number} near Near bound of the frustum + * @param {Number} far Far bound of the frustum + * @returns {mat4} out + */ + +function frustum(out, left, right, bottom, top, near, far) { + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + var nf = 1 / (near - far); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[10] = (far + near) * nf; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[14] = far * near * 2 * nf; + out[15] = 0; + return out; +} +/** + * Generates a perspective projection matrix with the given bounds. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {number} fovy Vertical field of view in radians + * @param {number} aspect Aspect ratio. typically viewport width/height + * @param {number} near Near bound of the frustum + * @param {number} far Far bound of the frustum, can be null or Infinity + * @returns {mat4} out + */ + +function perspective(out, fovy, aspect, near, far) { + var f = 1.0 / Math.tan(fovy / 2), + nf; + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + + if (far != null && far !== Infinity) { + nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + + return out; +} +/** + * Generates a perspective projection matrix with the given field of view. + * This is primarily useful for generating projection matrices to be used + * with the still experiemental WebVR API. + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param {number} near Near bound of the frustum + * @param {number} far Far bound of the frustum + * @returns {mat4} out + */ + +function perspectiveFromFieldOfView(out, fov, near, far) { + var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0); + var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0); + var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0); + var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0); + var xScale = 2.0 / (leftTan + rightTan); + var yScale = 2.0 / (upTan + downTan); + out[0] = xScale; + out[1] = 0.0; + out[2] = 0.0; + out[3] = 0.0; + out[4] = 0.0; + out[5] = yScale; + out[6] = 0.0; + out[7] = 0.0; + out[8] = -((leftTan - rightTan) * xScale * 0.5); + out[9] = (upTan - downTan) * yScale * 0.5; + out[10] = far / (near - far); + out[11] = -1.0; + out[12] = 0.0; + out[13] = 0.0; + out[14] = far * near / (near - far); + out[15] = 0.0; + return out; +} +/** + * Generates a orthogonal projection matrix with the given bounds + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {number} left Left bound of the frustum + * @param {number} right Right bound of the frustum + * @param {number} bottom Bottom bound of the frustum + * @param {number} top Top bound of the frustum + * @param {number} near Near bound of the frustum + * @param {number} far Far bound of the frustum + * @returns {mat4} out + */ + +function ortho(out, left, right, bottom, top, near, far) { + var lr = 1 / (left - right); + var bt = 1 / (bottom - top); + var nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 2 * nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = (far + near) * nf; + out[15] = 1; + return out; +} +/** + * Generates a look-at matrix with the given eye position, focal point, and up axis. + * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {ReadonlyVec3} eye Position of the viewer + * @param {ReadonlyVec3} center Point the viewer is looking at + * @param {ReadonlyVec3} up vec3 pointing up + * @returns {mat4} out + */ + +function lookAt(out, eye, center, up) { + var x0, x1, x2, y0, y1, y2, z0, z1, z2, len; + var eyex = eye[0]; + var eyey = eye[1]; + var eyez = eye[2]; + var upx = up[0]; + var upy = up[1]; + var upz = up[2]; + var centerx = center[0]; + var centery = center[1]; + var centerz = center[2]; + + if (Math.abs(eyex - centerx) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON && Math.abs(eyey - centery) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON && Math.abs(eyez - centerz) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + return identity(out); + } + + z0 = eyex - centerx; + z1 = eyey - centery; + z2 = eyez - centerz; + len = 1 / Math.hypot(z0, z1, z2); + z0 *= len; + z1 *= len; + z2 *= len; + x0 = upy * z2 - upz * z1; + x1 = upz * z0 - upx * z2; + x2 = upx * z1 - upy * z0; + len = Math.hypot(x0, x1, x2); + + if (!len) { + x0 = 0; + x1 = 0; + x2 = 0; + } else { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + + y0 = z1 * x2 - z2 * x1; + y1 = z2 * x0 - z0 * x2; + y2 = z0 * x1 - z1 * x0; + len = Math.hypot(y0, y1, y2); + + if (!len) { + y0 = 0; + y1 = 0; + y2 = 0; + } else { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + + out[0] = x0; + out[1] = y0; + out[2] = z0; + out[3] = 0; + out[4] = x1; + out[5] = y1; + out[6] = z1; + out[7] = 0; + out[8] = x2; + out[9] = y2; + out[10] = z2; + out[11] = 0; + out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); + out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); + out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); + out[15] = 1; + return out; +} +/** + * Generates a matrix that makes something look at something else. + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {ReadonlyVec3} eye Position of the viewer + * @param {ReadonlyVec3} center Point the viewer is looking at + * @param {ReadonlyVec3} up vec3 pointing up + * @returns {mat4} out + */ + +function targetTo(out, eye, target, up) { + var eyex = eye[0], + eyey = eye[1], + eyez = eye[2], + upx = up[0], + upy = up[1], + upz = up[2]; + var z0 = eyex - target[0], + z1 = eyey - target[1], + z2 = eyez - target[2]; + var len = z0 * z0 + z1 * z1 + z2 * z2; + + if (len > 0) { + len = 1 / Math.sqrt(len); + z0 *= len; + z1 *= len; + z2 *= len; + } + + var x0 = upy * z2 - upz * z1, + x1 = upz * z0 - upx * z2, + x2 = upx * z1 - upy * z0; + len = x0 * x0 + x1 * x1 + x2 * x2; + + if (len > 0) { + len = 1 / Math.sqrt(len); + x0 *= len; + x1 *= len; + x2 *= len; + } + + out[0] = x0; + out[1] = x1; + out[2] = x2; + out[3] = 0; + out[4] = z1 * x2 - z2 * x1; + out[5] = z2 * x0 - z0 * x2; + out[6] = z0 * x1 - z1 * x0; + out[7] = 0; + out[8] = z0; + out[9] = z1; + out[10] = z2; + out[11] = 0; + out[12] = eyex; + out[13] = eyey; + out[14] = eyez; + out[15] = 1; + return out; +} +/** + * Returns a string representation of a mat4 + * + * @param {ReadonlyMat4} a matrix to represent as a string + * @returns {String} string representation of the matrix + */ + +function str(a) { + return "mat4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ", " + a[9] + ", " + a[10] + ", " + a[11] + ", " + a[12] + ", " + a[13] + ", " + a[14] + ", " + a[15] + ")"; +} +/** + * Returns Frobenius norm of a mat4 + * + * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of + * @returns {Number} Frobenius norm + */ + +function frob(a) { + return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); +} +/** + * Adds two mat4's + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the first operand + * @param {ReadonlyMat4} b the second operand + * @returns {mat4} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + out[9] = a[9] + b[9]; + out[10] = a[10] + b[10]; + out[11] = a[11] + b[11]; + out[12] = a[12] + b[12]; + out[13] = a[13] + b[13]; + out[14] = a[14] + b[14]; + out[15] = a[15] + b[15]; + return out; +} +/** + * Subtracts matrix b from matrix a + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the first operand + * @param {ReadonlyMat4} b the second operand + * @returns {mat4} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + out[9] = a[9] - b[9]; + out[10] = a[10] - b[10]; + out[11] = a[11] - b[11]; + out[12] = a[12] - b[12]; + out[13] = a[13] - b[13]; + out[14] = a[14] - b[14]; + out[15] = a[15] - b[15]; + return out; +} +/** + * Multiply each element of the matrix by a scalar. + * + * @param {mat4} out the receiving matrix + * @param {ReadonlyMat4} a the matrix to scale + * @param {Number} b amount to scale the matrix's elements by + * @returns {mat4} out + */ + +function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + out[9] = a[9] * b; + out[10] = a[10] * b; + out[11] = a[11] * b; + out[12] = a[12] * b; + out[13] = a[13] * b; + out[14] = a[14] * b; + out[15] = a[15] * b; + return out; +} +/** + * Adds two mat4's after multiplying each element of the second operand by a scalar value. + * + * @param {mat4} out the receiving vector + * @param {ReadonlyMat4} a the first operand + * @param {ReadonlyMat4} b the second operand + * @param {Number} scale the amount to scale b's elements by before adding + * @returns {mat4} out + */ + +function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + out[9] = a[9] + b[9] * scale; + out[10] = a[10] + b[10] * scale; + out[11] = a[11] + b[11] * scale; + out[12] = a[12] + b[12] * scale; + out[13] = a[13] + b[13] * scale; + out[14] = a[14] + b[14] * scale; + out[15] = a[15] + b[15] * scale; + return out; +} +/** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyMat4} a The first matrix. + * @param {ReadonlyMat4} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15]; +} +/** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {ReadonlyMat4} a The first matrix. + * @param {ReadonlyMat4} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var a4 = a[4], + a5 = a[5], + a6 = a[6], + a7 = a[7]; + var a8 = a[8], + a9 = a[9], + a10 = a[10], + a11 = a[11]; + var a12 = a[12], + a13 = a[13], + a14 = a[14], + a15 = a[15]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + var b4 = b[4], + b5 = b[5], + b6 = b[6], + b7 = b[7]; + var b8 = b[8], + b9 = b[9], + b10 = b[10], + b11 = b[11]; + var b12 = b[12], + b13 = b[13], + b14 = b[14], + b15 = b[15]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15)); +} +/** + * Alias for {@link mat4.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link mat4.subtract} + * @function + */ + +var sub = subtract; + +/***/ }), +/* 14 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "setAxisAngle": () => (/* binding */ setAxisAngle), +/* harmony export */ "getAxisAngle": () => (/* binding */ getAxisAngle), +/* harmony export */ "getAngle": () => (/* binding */ getAngle), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "rotateX": () => (/* binding */ rotateX), +/* harmony export */ "rotateY": () => (/* binding */ rotateY), +/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), +/* harmony export */ "calculateW": () => (/* binding */ calculateW), +/* harmony export */ "exp": () => (/* binding */ exp), +/* harmony export */ "ln": () => (/* binding */ ln), +/* harmony export */ "pow": () => (/* binding */ pow), +/* harmony export */ "slerp": () => (/* binding */ slerp), +/* harmony export */ "random": () => (/* binding */ random), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "conjugate": () => (/* binding */ conjugate), +/* harmony export */ "fromMat3": () => (/* binding */ fromMat3), +/* harmony export */ "fromEuler": () => (/* binding */ fromEuler), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "dot": () => (/* binding */ dot), +/* harmony export */ "lerp": () => (/* binding */ lerp), +/* harmony export */ "length": () => (/* binding */ length), +/* harmony export */ "len": () => (/* binding */ len), +/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), +/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), +/* harmony export */ "normalize": () => (/* binding */ normalize), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "rotationTo": () => (/* binding */ rotationTo), +/* harmony export */ "sqlerp": () => (/* binding */ sqlerp), +/* harmony export */ "setAxes": () => (/* binding */ setAxes) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); +/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12); +/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16); +/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15); + + + + +/** + * Quaternion + * @module quat + */ + +/** + * Creates a new identity quat + * + * @returns {quat} a new quaternion + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + } + + out[3] = 1; + return out; +} +/** + * Set a quat to the identity quaternion + * + * @param {quat} out the receiving quaternion + * @returns {quat} out + */ + +function identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; +} +/** + * Sets a quat from the given angle and rotation axis, + * then returns it. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyVec3} axis the axis around which to rotate + * @param {Number} rad the angle in radians + * @returns {quat} out + **/ + +function setAxisAngle(out, axis, rad) { + rad = rad * 0.5; + var s = Math.sin(rad); + out[0] = s * axis[0]; + out[1] = s * axis[1]; + out[2] = s * axis[2]; + out[3] = Math.cos(rad); + return out; +} +/** + * Gets the rotation axis and angle for a given + * quaternion. If a quaternion is created with + * setAxisAngle, this method will return the same + * values as providied in the original parameter list + * OR functionally equivalent values. + * Example: The quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @param {vec3} out_axis Vector receiving the axis of rotation + * @param {ReadonlyQuat} q Quaternion to be decomposed + * @return {Number} Angle, in radians, of the rotation + */ + +function getAxisAngle(out_axis, q) { + var rad = Math.acos(q[3]) * 2.0; + var s = Math.sin(rad / 2.0); + + if (s > _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + out_axis[0] = q[0] / s; + out_axis[1] = q[1] / s; + out_axis[2] = q[2] / s; + } else { + // If s is zero, return any axis (no rotation - axis does not matter) + out_axis[0] = 1; + out_axis[1] = 0; + out_axis[2] = 0; + } + + return rad; +} +/** + * Gets the angular distance between two unit quaternions + * + * @param {ReadonlyQuat} a Origin unit quaternion + * @param {ReadonlyQuat} b Destination unit quaternion + * @return {Number} Angle, in radians, between the two quaternions + */ + +function getAngle(a, b) { + var dotproduct = dot(a, b); + return Math.acos(2 * dotproduct * dotproduct - 1); +} +/** + * Multiplies two quat's + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @returns {quat} out + */ + +function multiply(out, a, b) { + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var bx = b[0], + by = b[1], + bz = b[2], + bw = b[3]; + out[0] = ax * bw + aw * bx + ay * bz - az * by; + out[1] = ay * bw + aw * by + az * bx - ax * bz; + out[2] = az * bw + aw * bz + ax * by - ay * bx; + out[3] = aw * bw - ax * bx - ay * by - az * bz; + return out; +} +/** + * Rotates a quaternion by the given angle about the X axis + * + * @param {quat} out quat receiving operation result + * @param {ReadonlyQuat} a quat to rotate + * @param {number} rad angle (in radians) to rotate + * @returns {quat} out + */ + +function rotateX(out, a, rad) { + rad *= 0.5; + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var bx = Math.sin(rad), + bw = Math.cos(rad); + out[0] = ax * bw + aw * bx; + out[1] = ay * bw + az * bx; + out[2] = az * bw - ay * bx; + out[3] = aw * bw - ax * bx; + return out; +} +/** + * Rotates a quaternion by the given angle about the Y axis + * + * @param {quat} out quat receiving operation result + * @param {ReadonlyQuat} a quat to rotate + * @param {number} rad angle (in radians) to rotate + * @returns {quat} out + */ + +function rotateY(out, a, rad) { + rad *= 0.5; + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var by = Math.sin(rad), + bw = Math.cos(rad); + out[0] = ax * bw - az * by; + out[1] = ay * bw + aw * by; + out[2] = az * bw + ax * by; + out[3] = aw * bw - ay * by; + return out; +} +/** + * Rotates a quaternion by the given angle about the Z axis + * + * @param {quat} out quat receiving operation result + * @param {ReadonlyQuat} a quat to rotate + * @param {number} rad angle (in radians) to rotate + * @returns {quat} out + */ + +function rotateZ(out, a, rad) { + rad *= 0.5; + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var bz = Math.sin(rad), + bw = Math.cos(rad); + out[0] = ax * bw + ay * bz; + out[1] = ay * bw - ax * bz; + out[2] = az * bw + aw * bz; + out[3] = aw * bw - az * bz; + return out; +} +/** + * Calculates the W component of a quat from the X, Y, and Z components. + * Assumes that quaternion is 1 unit in length. + * Any existing W component will be ignored. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate W component of + * @returns {quat} out + */ + +function calculateW(out, a) { + var x = a[0], + y = a[1], + z = a[2]; + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z)); + return out; +} +/** + * Calculate the exponential of a unit quaternion. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate the exponential of + * @returns {quat} out + */ + +function exp(out, a) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3]; + var r = Math.sqrt(x * x + y * y + z * z); + var et = Math.exp(w); + var s = r > 0 ? et * Math.sin(r) / r : 0; + out[0] = x * s; + out[1] = y * s; + out[2] = z * s; + out[3] = et * Math.cos(r); + return out; +} +/** + * Calculate the natural logarithm of a unit quaternion. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate the exponential of + * @returns {quat} out + */ + +function ln(out, a) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3]; + var r = Math.sqrt(x * x + y * y + z * z); + var t = r > 0 ? Math.atan2(r, w) / r : 0; + out[0] = x * t; + out[1] = y * t; + out[2] = z * t; + out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w); + return out; +} +/** + * Calculate the scalar power of a unit quaternion. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate the exponential of + * @param {Number} b amount to scale the quaternion by + * @returns {quat} out + */ + +function pow(out, a, b) { + ln(out, a); + scale(out, out, b); + exp(out, out); + return out; +} +/** + * Performs a spherical linear interpolation between two quat + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {quat} out + */ + +function slerp(out, a, b, t) { + // benchmarks: + // http://jsperf.com/quaternion-slerp-implementations + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var bx = b[0], + by = b[1], + bz = b[2], + bw = b[3]; + var omega, cosom, sinom, scale0, scale1; // calc cosine + + cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary) + + if (cosom < 0.0) { + cosom = -cosom; + bx = -bx; + by = -by; + bz = -bz; + bw = -bw; + } // calculate coefficients + + + if (1.0 - cosom > _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + // standard case (slerp) + omega = Math.acos(cosom); + sinom = Math.sin(omega); + scale0 = Math.sin((1.0 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } else { + // "from" and "to" quaternions are very close + // ... so we can do a linear interpolation + scale0 = 1.0 - t; + scale1 = t; + } // calculate final values + + + out[0] = scale0 * ax + scale1 * bx; + out[1] = scale0 * ay + scale1 * by; + out[2] = scale0 * az + scale1 * bz; + out[3] = scale0 * aw + scale1 * bw; + return out; +} +/** + * Generates a random unit quaternion + * + * @param {quat} out the receiving quaternion + * @returns {quat} out + */ + +function random(out) { + // Implementation of http://planning.cs.uiuc.edu/node198.html + // TODO: Calling random 3 times is probably not the fastest solution + var u1 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); + var u2 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); + var u3 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); + var sqrt1MinusU1 = Math.sqrt(1 - u1); + var sqrtU1 = Math.sqrt(u1); + out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2); + out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2); + out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3); + out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3); + return out; +} +/** + * Calculates the inverse of a quat + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate inverse of + * @returns {quat} out + */ + +function invert(out, a) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; + var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 + + out[0] = -a0 * invDot; + out[1] = -a1 * invDot; + out[2] = -a2 * invDot; + out[3] = a3 * invDot; + return out; +} +/** + * Calculates the conjugate of a quat + * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quat to calculate conjugate of + * @returns {quat} out + */ + +function conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + return out; +} +/** + * Creates a quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant quaternion is not normalized, so you should be sure + * to renormalize the quaternion yourself where necessary. + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyMat3} m rotation matrix + * @returns {quat} out + * @function + */ + +function fromMat3(out, m) { + // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes + // article "Quaternion Calculus and Fast Animation". + var fTrace = m[0] + m[4] + m[8]; + var fRoot; + + if (fTrace > 0.0) { + // |w| > 1/2, may as well choose w > 1/2 + fRoot = Math.sqrt(fTrace + 1.0); // 2w + + out[3] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; // 1/(4w) + + out[0] = (m[5] - m[7]) * fRoot; + out[1] = (m[6] - m[2]) * fRoot; + out[2] = (m[1] - m[3]) * fRoot; + } else { + // |w| <= 1/2 + var i = 0; + if (m[4] > m[0]) i = 1; + if (m[8] > m[i * 3 + i]) i = 2; + var j = (i + 1) % 3; + var k = (i + 2) % 3; + fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0); + out[i] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot; + out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; + out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; + } + + return out; +} +/** + * Creates a quaternion from the given euler angle x, y, z. + * + * @param {quat} out the receiving quaternion + * @param {x} Angle to rotate around X axis in degrees. + * @param {y} Angle to rotate around Y axis in degrees. + * @param {z} Angle to rotate around Z axis in degrees. + * @returns {quat} out + * @function + */ + +function fromEuler(out, x, y, z) { + var halfToRad = 0.5 * Math.PI / 180.0; + x *= halfToRad; + y *= halfToRad; + z *= halfToRad; + var sx = Math.sin(x); + var cx = Math.cos(x); + var sy = Math.sin(y); + var cy = Math.cos(y); + var sz = Math.sin(z); + var cz = Math.cos(z); + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + return out; +} +/** + * Returns a string representation of a quatenion + * + * @param {ReadonlyQuat} a vector to represent as a string + * @returns {String} string representation of the vector + */ + +function str(a) { + return "quat(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; +} +/** + * Creates a new quat initialized with values from an existing quaternion + * + * @param {ReadonlyQuat} a quaternion to clone + * @returns {quat} a new quaternion + * @function + */ + +var clone = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.clone; +/** + * Creates a new quat initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {quat} a new quaternion + * @function + */ + +var fromValues = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.fromValues; +/** + * Copy the values from one quat to another + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the source quaternion + * @returns {quat} out + * @function + */ + +var copy = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.copy; +/** + * Set the components of a quat to the given values + * + * @param {quat} out the receiving quaternion + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {quat} out + * @function + */ + +var set = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.set; +/** + * Adds two quat's + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @returns {quat} out + * @function + */ + +var add = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.add; +/** + * Alias for {@link quat.multiply} + * @function + */ + +var mul = multiply; +/** + * Scales a quat by a scalar number + * + * @param {quat} out the receiving vector + * @param {ReadonlyQuat} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {quat} out + * @function + */ + +var scale = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.scale; +/** + * Calculates the dot product of two quat's + * + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @returns {Number} dot product of a and b + * @function + */ + +var dot = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.dot; +/** + * Performs a linear interpolation between two quat's + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {quat} out + * @function + */ + +var lerp = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.lerp; +/** + * Calculates the length of a quat + * + * @param {ReadonlyQuat} a vector to calculate length of + * @returns {Number} length of a + */ + +var length = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.length; +/** + * Alias for {@link quat.length} + * @function + */ + +var len = length; +/** + * Calculates the squared length of a quat + * + * @param {ReadonlyQuat} a vector to calculate squared length of + * @returns {Number} squared length of a + * @function + */ + +var squaredLength = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.squaredLength; +/** + * Alias for {@link quat.squaredLength} + * @function + */ + +var sqrLen = squaredLength; +/** + * Normalize a quat + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a quaternion to normalize + * @returns {quat} out + * @function + */ + +var normalize = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.normalize; +/** + * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyQuat} a The first quaternion. + * @param {ReadonlyQuat} b The second quaternion. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +var exactEquals = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.exactEquals; +/** + * Returns whether or not the quaternions have approximately the same elements in the same position. + * + * @param {ReadonlyQuat} a The first vector. + * @param {ReadonlyQuat} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +var equals = _vec4_js__WEBPACK_IMPORTED_MODULE_1__.equals; +/** + * Sets a quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * + * @param {quat} out the receiving quaternion. + * @param {ReadonlyVec3} a the initial vector + * @param {ReadonlyVec3} b the destination vector + * @returns {quat} out + */ + +var rotationTo = function () { + var tmpvec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.create(); + var xUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.fromValues(1, 0, 0); + var yUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.fromValues(0, 1, 0); + return function (out, a, b) { + var dot = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.dot(a, b); + + if (dot < -0.999999) { + _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, xUnitVec3, a); + if (_vec3_js__WEBPACK_IMPORTED_MODULE_2__.len(tmpvec3) < 0.000001) _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, yUnitVec3, a); + _vec3_js__WEBPACK_IMPORTED_MODULE_2__.normalize(tmpvec3, tmpvec3); + setAxisAngle(out, tmpvec3, Math.PI); + return out; + } else if (dot > 0.999999) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } else { + _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, a, b); + out[0] = tmpvec3[0]; + out[1] = tmpvec3[1]; + out[2] = tmpvec3[2]; + out[3] = 1 + dot; + return normalize(out, out); + } + }; +}(); +/** + * Performs a spherical linear interpolation with two control points + * + * @param {quat} out the receiving quaternion + * @param {ReadonlyQuat} a the first operand + * @param {ReadonlyQuat} b the second operand + * @param {ReadonlyQuat} c the third operand + * @param {ReadonlyQuat} d the fourth operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {quat} out + */ + +var sqlerp = function () { + var temp1 = create(); + var temp2 = create(); + return function (out, a, b, c, d, t) { + slerp(temp1, a, d, t); + slerp(temp2, b, c, t); + slerp(out, temp1, temp2, 2 * t * (1 - t)); + return out; + }; +}(); +/** + * Sets the specified quaternion with values corresponding to the given + * axes. Each axis is a vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * + * @param {ReadonlyVec3} view the vector representing the viewing direction + * @param {ReadonlyVec3} right the vector representing the local "right" direction + * @param {ReadonlyVec3} up the vector representing the local "up" direction + * @returns {quat} out + */ + +var setAxes = function () { + var matr = _mat3_js__WEBPACK_IMPORTED_MODULE_3__.create(); + return function (out, view, right, up) { + matr[0] = right[0]; + matr[3] = right[1]; + matr[6] = right[2]; + matr[1] = up[0]; + matr[4] = up[1]; + matr[7] = up[2]; + matr[2] = -view[0]; + matr[5] = -view[1]; + matr[8] = -view[2]; + return normalize(out, fromMat3(out, matr)); + }; +}(); + +/***/ }), +/* 15 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "divide": () => (/* binding */ divide), +/* harmony export */ "ceil": () => (/* binding */ ceil), +/* harmony export */ "floor": () => (/* binding */ floor), +/* harmony export */ "min": () => (/* binding */ min), +/* harmony export */ "max": () => (/* binding */ max), +/* harmony export */ "round": () => (/* binding */ round), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), +/* harmony export */ "distance": () => (/* binding */ distance), +/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), +/* harmony export */ "length": () => (/* binding */ length), +/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), +/* harmony export */ "negate": () => (/* binding */ negate), +/* harmony export */ "inverse": () => (/* binding */ inverse), +/* harmony export */ "normalize": () => (/* binding */ normalize), +/* harmony export */ "dot": () => (/* binding */ dot), +/* harmony export */ "cross": () => (/* binding */ cross), +/* harmony export */ "lerp": () => (/* binding */ lerp), +/* harmony export */ "random": () => (/* binding */ random), +/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), +/* harmony export */ "transformQuat": () => (/* binding */ transformQuat), +/* harmony export */ "zero": () => (/* binding */ zero), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "sub": () => (/* binding */ sub), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "div": () => (/* binding */ div), +/* harmony export */ "dist": () => (/* binding */ dist), +/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), +/* harmony export */ "len": () => (/* binding */ len), +/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), +/* harmony export */ "forEach": () => (/* binding */ forEach) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); + +/** + * 4 Dimensional Vector + * @module vec4 + */ + +/** + * Creates a new, empty vec4 + * + * @returns {vec4} a new 4D vector + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 0; + } + + return out; +} +/** + * Creates a new vec4 initialized with values from an existing vector + * + * @param {ReadonlyVec4} a vector to clone + * @returns {vec4} a new 4D vector + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; +} +/** + * Creates a new vec4 initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {vec4} a new 4D vector + */ + +function fromValues(x, y, z, w) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = w; + return out; +} +/** + * Copy the values from one vec4 to another + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the source vector + * @returns {vec4} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; +} +/** + * Set the components of a vec4 to the given values + * + * @param {vec4} out the receiving vector + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {vec4} out + */ + +function set(out, x, y, z, w) { + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = w; + return out; +} +/** + * Adds two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; +} +/** + * Subtracts vector b from vector a + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; +} +/** + * Multiplies two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + out[3] = a[3] * b[3]; + return out; +} +/** + * Divides two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + out[3] = a[3] / b[3]; + return out; +} +/** + * Math.ceil the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to ceil + * @returns {vec4} out + */ + +function ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + out[3] = Math.ceil(a[3]); + return out; +} +/** + * Math.floor the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to floor + * @returns {vec4} out + */ + +function floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + out[3] = Math.floor(a[3]); + return out; +} +/** + * Returns the minimum of two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + out[3] = Math.min(a[3], b[3]); + return out; +} +/** + * Returns the maximum of two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {vec4} out + */ + +function max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + out[3] = Math.max(a[3], b[3]); + return out; +} +/** + * Math.round the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to round + * @returns {vec4} out + */ + +function round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + out[2] = Math.round(a[2]); + out[3] = Math.round(a[3]); + return out; +} +/** + * Scales a vec4 by a scalar number + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {vec4} out + */ + +function scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + return out; +} +/** + * Adds two vec4's after scaling the second operand by a scalar value + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @param {Number} scale the amount to scale b by before adding + * @returns {vec4} out + */ + +function scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; +} +/** + * Calculates the euclidian distance between two vec4's + * + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {Number} distance between a and b + */ + +function distance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + var w = b[3] - a[3]; + return Math.hypot(x, y, z, w); +} +/** + * Calculates the squared euclidian distance between two vec4's + * + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {Number} squared distance between a and b + */ + +function squaredDistance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + var w = b[3] - a[3]; + return x * x + y * y + z * z + w * w; +} +/** + * Calculates the length of a vec4 + * + * @param {ReadonlyVec4} a vector to calculate length of + * @returns {Number} length of a + */ + +function length(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var w = a[3]; + return Math.hypot(x, y, z, w); +} +/** + * Calculates the squared length of a vec4 + * + * @param {ReadonlyVec4} a vector to calculate squared length of + * @returns {Number} squared length of a + */ + +function squaredLength(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var w = a[3]; + return x * x + y * y + z * z + w * w; +} +/** + * Negates the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to negate + * @returns {vec4} out + */ + +function negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = -a[3]; + return out; +} +/** + * Returns the inverse of the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to invert + * @returns {vec4} out + */ + +function inverse(out, a) { + out[0] = 1.0 / a[0]; + out[1] = 1.0 / a[1]; + out[2] = 1.0 / a[2]; + out[3] = 1.0 / a[3]; + return out; +} +/** + * Normalize a vec4 + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a vector to normalize + * @returns {vec4} out + */ + +function normalize(out, a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var w = a[3]; + var len = x * x + y * y + z * z + w * w; + + if (len > 0) { + len = 1 / Math.sqrt(len); + } + + out[0] = x * len; + out[1] = y * len; + out[2] = z * len; + out[3] = w * len; + return out; +} +/** + * Calculates the dot product of two vec4's + * + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @returns {Number} dot product of a and b + */ + +function dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; +} +/** + * Returns the cross-product of three vectors in a 4-dimensional space + * + * @param {ReadonlyVec4} result the receiving vector + * @param {ReadonlyVec4} U the first vector + * @param {ReadonlyVec4} V the second vector + * @param {ReadonlyVec4} W the third vector + * @returns {vec4} result + */ + +function cross(out, u, v, w) { + var A = v[0] * w[1] - v[1] * w[0], + B = v[0] * w[2] - v[2] * w[0], + C = v[0] * w[3] - v[3] * w[0], + D = v[1] * w[2] - v[2] * w[1], + E = v[1] * w[3] - v[3] * w[1], + F = v[2] * w[3] - v[3] * w[2]; + var G = u[0]; + var H = u[1]; + var I = u[2]; + var J = u[3]; + out[0] = H * F - I * E + J * D; + out[1] = -(G * F) + I * C - J * B; + out[2] = G * E - H * C + J * A; + out[3] = -(G * D) + H * B - I * A; + return out; +} +/** + * Performs a linear interpolation between two vec4's + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the first operand + * @param {ReadonlyVec4} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {vec4} out + */ + +function lerp(out, a, b, t) { + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var aw = a[3]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + out[3] = aw + t * (b[3] - aw); + return out; +} +/** + * Generates a random vector with the given scale + * + * @param {vec4} out the receiving vector + * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns {vec4} out + */ + +function random(out, scale) { + scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a + // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646. + // http://projecteuclid.org/euclid.aoms/1177692644; + + var v1, v2, v3, v4; + var s1, s2; + + do { + v1 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; + v2 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; + s1 = v1 * v1 + v2 * v2; + } while (s1 >= 1); + + do { + v3 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; + v4 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; + s2 = v3 * v3 + v4 * v4; + } while (s2 >= 1); + + var d = Math.sqrt((1 - s1) / s2); + out[0] = scale * v1; + out[1] = scale * v2; + out[2] = scale * v3 * d; + out[3] = scale * v4 * d; + return out; +} +/** + * Transforms the vec4 with a mat4. + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the vector to transform + * @param {ReadonlyMat4} m matrix to transform with + * @returns {vec4} out + */ + +function transformMat4(out, a, m) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3]; + out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + return out; +} +/** + * Transforms the vec4 with a quat + * + * @param {vec4} out the receiving vector + * @param {ReadonlyVec4} a the vector to transform + * @param {ReadonlyQuat} q quaternion to transform with + * @returns {vec4} out + */ + +function transformQuat(out, a, q) { + var x = a[0], + y = a[1], + z = a[2]; + var qx = q[0], + qy = q[1], + qz = q[2], + qw = q[3]; // calculate quat * vec + + var ix = qw * x + qy * z - qz * y; + var iy = qw * y + qz * x - qx * z; + var iz = qw * z + qx * y - qy * x; + var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat + + out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy; + out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz; + out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx; + out[3] = a[3]; + return out; +} +/** + * Set the components of a vec4 to zero + * + * @param {vec4} out the receiving vector + * @returns {vec4} out + */ + +function zero(out) { + out[0] = 0.0; + out[1] = 0.0; + out[2] = 0.0; + out[3] = 0.0; + return out; +} +/** + * Returns a string representation of a vector + * + * @param {ReadonlyVec4} a vector to represent as a string + * @returns {String} string representation of the vector + */ + +function str(a) { + return "vec4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; +} +/** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyVec4} a The first vector. + * @param {ReadonlyVec4} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; +} +/** + * Returns whether or not the vectors have approximately the same elements in the same position. + * + * @param {ReadonlyVec4} a The first vector. + * @param {ReadonlyVec4} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)); +} +/** + * Alias for {@link vec4.subtract} + * @function + */ + +var sub = subtract; +/** + * Alias for {@link vec4.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link vec4.divide} + * @function + */ + +var div = divide; +/** + * Alias for {@link vec4.distance} + * @function + */ + +var dist = distance; +/** + * Alias for {@link vec4.squaredDistance} + * @function + */ + +var sqrDist = squaredDistance; +/** + * Alias for {@link vec4.length} + * @function + */ + +var len = length; +/** + * Alias for {@link vec4.squaredLength} + * @function + */ + +var sqrLen = squaredLength; +/** + * Perform some operation over an array of vec4s. + * + * @param {Array} a the array of vectors to iterate over + * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed + * @param {Number} offset Number of elements to skip at the beginning of the array + * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array + * @param {Function} fn Function to call for each vector in the array + * @param {Object} [arg] additional argument to pass to fn + * @returns {Array} a + * @function + */ + +var forEach = function () { + var vec = create(); + return function (a, stride, offset, count, fn, arg) { + var i, l; + + if (!stride) { + stride = 4; } - /** - * Call strem on children - * - * @param {(streamArguments: IStreamArguments) => void} callback - * @memberof Group - */ - stream(callback) { - this.children.forEach(item => item.stream(callback)); + + if (!offset) { + offset = 0; + } + + if (count) { + l = Math.min(count * stride + offset, a.length); + } else { + l = a.length; + } + + for (i = offset; i < l; i += stride) { + vec[0] = a[i]; + vec[1] = a[i + 1]; + vec[2] = a[i + 2]; + vec[3] = a[i + 3]; + fn(vec, vec, arg); + a[i] = vec[0]; + a[i + 1] = vec[1]; + a[i + 2] = vec[2]; + a[i + 3] = vec[3]; } + + return a; + }; +}(); + +/***/ }), +/* 16 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "length": () => (/* binding */ length), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "divide": () => (/* binding */ divide), +/* harmony export */ "ceil": () => (/* binding */ ceil), +/* harmony export */ "floor": () => (/* binding */ floor), +/* harmony export */ "min": () => (/* binding */ min), +/* harmony export */ "max": () => (/* binding */ max), +/* harmony export */ "round": () => (/* binding */ round), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), +/* harmony export */ "distance": () => (/* binding */ distance), +/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), +/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), +/* harmony export */ "negate": () => (/* binding */ negate), +/* harmony export */ "inverse": () => (/* binding */ inverse), +/* harmony export */ "normalize": () => (/* binding */ normalize), +/* harmony export */ "dot": () => (/* binding */ dot), +/* harmony export */ "cross": () => (/* binding */ cross), +/* harmony export */ "lerp": () => (/* binding */ lerp), +/* harmony export */ "hermite": () => (/* binding */ hermite), +/* harmony export */ "bezier": () => (/* binding */ bezier), +/* harmony export */ "random": () => (/* binding */ random), +/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), +/* harmony export */ "transformMat3": () => (/* binding */ transformMat3), +/* harmony export */ "transformQuat": () => (/* binding */ transformQuat), +/* harmony export */ "rotateX": () => (/* binding */ rotateX), +/* harmony export */ "rotateY": () => (/* binding */ rotateY), +/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), +/* harmony export */ "angle": () => (/* binding */ angle), +/* harmony export */ "zero": () => (/* binding */ zero), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "sub": () => (/* binding */ sub), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "div": () => (/* binding */ div), +/* harmony export */ "dist": () => (/* binding */ dist), +/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), +/* harmony export */ "len": () => (/* binding */ len), +/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), +/* harmony export */ "forEach": () => (/* binding */ forEach) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); + +/** + * 3 Dimensional Vector + * @module vec3 + */ + +/** + * Creates a new, empty vec3 + * + * @returns {vec3} a new 3D vector + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + } + + return out; +} +/** + * Creates a new vec3 initialized with values from an existing vector + * + * @param {ReadonlyVec3} a vector to clone + * @returns {vec3} a new 3D vector + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + return out; +} +/** + * Calculates the length of a vec3 + * + * @param {ReadonlyVec3} a vector to calculate length of + * @returns {Number} length of a + */ + +function length(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + return Math.hypot(x, y, z); +} +/** + * Creates a new vec3 initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @returns {vec3} a new 3D vector + */ + +function fromValues(x, y, z) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + out[0] = x; + out[1] = y; + out[2] = z; + return out; +} +/** + * Copy the values from one vec3 to another + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the source vector + * @returns {vec3} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + return out; +} +/** + * Set the components of a vec3 to the given values + * + * @param {vec3} out the receiving vector + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @returns {vec3} out + */ + +function set(out, x, y, z) { + out[0] = x; + out[1] = y; + out[2] = z; + return out; +} +/** + * Adds two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + return out; +} +/** + * Subtracts vector b from vector a + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + return out; +} +/** + * Multiplies two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + return out; +} +/** + * Divides two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + return out; +} +/** + * Math.ceil the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to ceil + * @returns {vec3} out + */ + +function ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + return out; +} +/** + * Math.floor the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to floor + * @returns {vec3} out + */ + +function floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + return out; +} +/** + * Returns the minimum of two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + return out; +} +/** + * Returns the maximum of two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + return out; +} +/** + * Math.round the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to round + * @returns {vec3} out + */ + +function round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + out[2] = Math.round(a[2]); + return out; +} +/** + * Scales a vec3 by a scalar number + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {vec3} out + */ + +function scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + return out; +} +/** + * Adds two vec3's after scaling the second operand by a scalar value + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @param {Number} scale the amount to scale b by before adding + * @returns {vec3} out + */ + +function scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + return out; +} +/** + * Calculates the euclidian distance between two vec3's + * + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {Number} distance between a and b + */ + +function distance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + return Math.hypot(x, y, z); +} +/** + * Calculates the squared euclidian distance between two vec3's + * + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {Number} squared distance between a and b + */ + +function squaredDistance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + return x * x + y * y + z * z; +} +/** + * Calculates the squared length of a vec3 + * + * @param {ReadonlyVec3} a vector to calculate squared length of + * @returns {Number} squared length of a + */ + +function squaredLength(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + return x * x + y * y + z * z; +} +/** + * Negates the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to negate + * @returns {vec3} out + */ + +function negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + return out; +} +/** + * Returns the inverse of the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to invert + * @returns {vec3} out + */ + +function inverse(out, a) { + out[0] = 1.0 / a[0]; + out[1] = 1.0 / a[1]; + out[2] = 1.0 / a[2]; + return out; +} +/** + * Normalize a vec3 + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a vector to normalize + * @returns {vec3} out + */ + +function normalize(out, a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var len = x * x + y * y + z * z; + + if (len > 0) { + //TODO: evaluate use of glm_invsqrt here? + len = 1 / Math.sqrt(len); + } + + out[0] = a[0] * len; + out[1] = a[1] * len; + out[2] = a[2] * len; + return out; +} +/** + * Calculates the dot product of two vec3's + * + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {Number} dot product of a and b + */ + +function dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; +} +/** + * Computes the cross product of two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @returns {vec3} out + */ + +function cross(out, a, b) { + var ax = a[0], + ay = a[1], + az = a[2]; + var bx = b[0], + by = b[1], + bz = b[2]; + out[0] = ay * bz - az * by; + out[1] = az * bx - ax * bz; + out[2] = ax * by - ay * bx; + return out; +} +/** + * Performs a linear interpolation between two vec3's + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {vec3} out + */ + +function lerp(out, a, b, t) { + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + return out; +} +/** + * Performs a hermite interpolation with two control points + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @param {ReadonlyVec3} c the third operand + * @param {ReadonlyVec3} d the fourth operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {vec3} out + */ + +function hermite(out, a, b, c, d, t) { + var factorTimes2 = t * t; + var factor1 = factorTimes2 * (2 * t - 3) + 1; + var factor2 = factorTimes2 * (t - 2) + t; + var factor3 = factorTimes2 * (t - 1); + var factor4 = factorTimes2 * (3 - 2 * t); + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; +} +/** + * Performs a bezier interpolation with two control points + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the first operand + * @param {ReadonlyVec3} b the second operand + * @param {ReadonlyVec3} c the third operand + * @param {ReadonlyVec3} d the fourth operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {vec3} out + */ + +function bezier(out, a, b, c, d, t) { + var inverseFactor = 1 - t; + var inverseFactorTimesTwo = inverseFactor * inverseFactor; + var factorTimes2 = t * t; + var factor1 = inverseFactorTimesTwo * inverseFactor; + var factor2 = 3 * t * inverseFactorTimesTwo; + var factor3 = 3 * factorTimes2 * inverseFactor; + var factor4 = factorTimes2 * t; + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; +} +/** + * Generates a random vector with the given scale + * + * @param {vec3} out the receiving vector + * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns {vec3} out + */ + +function random(out, scale) { + scale = scale || 1.0; + var r = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 * Math.PI; + var z = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 - 1.0; + var zScale = Math.sqrt(1.0 - z * z) * scale; + out[0] = Math.cos(r) * zScale; + out[1] = Math.sin(r) * zScale; + out[2] = z * scale; + return out; +} +/** + * Transforms the vec3 with a mat4. + * 4th vector component is implicitly '1' + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the vector to transform + * @param {ReadonlyMat4} m matrix to transform with + * @returns {vec3} out + */ + +function transformMat4(out, a, m) { + var x = a[0], + y = a[1], + z = a[2]; + var w = m[3] * x + m[7] * y + m[11] * z + m[15]; + w = w || 1.0; + out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w; + out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w; + out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w; + return out; +} +/** + * Transforms the vec3 with a mat3. + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the vector to transform + * @param {ReadonlyMat3} m the 3x3 matrix to transform with + * @returns {vec3} out + */ + +function transformMat3(out, a, m) { + var x = a[0], + y = a[1], + z = a[2]; + out[0] = x * m[0] + y * m[3] + z * m[6]; + out[1] = x * m[1] + y * m[4] + z * m[7]; + out[2] = x * m[2] + y * m[5] + z * m[8]; + return out; +} +/** + * Transforms the vec3 with a quat + * Can also be used for dual quaternions. (Multiply it with the real part) + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec3} a the vector to transform + * @param {ReadonlyQuat} q quaternion to transform with + * @returns {vec3} out + */ + +function transformQuat(out, a, q) { + // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed + var qx = q[0], + qy = q[1], + qz = q[2], + qw = q[3]; + var x = a[0], + y = a[1], + z = a[2]; // var qvec = [qx, qy, qz]; + // var uv = vec3.cross([], qvec, a); + + var uvx = qy * z - qz * y, + uvy = qz * x - qx * z, + uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv); + + var uuvx = qy * uvz - qz * uvy, + uuvy = qz * uvx - qx * uvz, + uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w); + + var w2 = qw * 2; + uvx *= w2; + uvy *= w2; + uvz *= w2; // vec3.scale(uuv, uuv, 2); + + uuvx *= 2; + uuvy *= 2; + uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv)); + + out[0] = x + uvx + uuvx; + out[1] = y + uvy + uuvy; + out[2] = z + uvz + uuvz; + return out; +} +/** + * Rotate a 3D vector around the x-axis + * @param {vec3} out The receiving vec3 + * @param {ReadonlyVec3} a The vec3 point to rotate + * @param {ReadonlyVec3} b The origin of the rotation + * @param {Number} rad The angle of rotation in radians + * @returns {vec3} out + */ + +function rotateX(out, a, b, rad) { + var p = [], + r = []; //Translate point to the origin + + p[0] = a[0] - b[0]; + p[1] = a[1] - b[1]; + p[2] = a[2] - b[2]; //perform rotation + + r[0] = p[0]; + r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad); + r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position + + out[0] = r[0] + b[0]; + out[1] = r[1] + b[1]; + out[2] = r[2] + b[2]; + return out; +} +/** + * Rotate a 3D vector around the y-axis + * @param {vec3} out The receiving vec3 + * @param {ReadonlyVec3} a The vec3 point to rotate + * @param {ReadonlyVec3} b The origin of the rotation + * @param {Number} rad The angle of rotation in radians + * @returns {vec3} out + */ + +function rotateY(out, a, b, rad) { + var p = [], + r = []; //Translate point to the origin + + p[0] = a[0] - b[0]; + p[1] = a[1] - b[1]; + p[2] = a[2] - b[2]; //perform rotation + + r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad); + r[1] = p[1]; + r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position + + out[0] = r[0] + b[0]; + out[1] = r[1] + b[1]; + out[2] = r[2] + b[2]; + return out; +} +/** + * Rotate a 3D vector around the z-axis + * @param {vec3} out The receiving vec3 + * @param {ReadonlyVec3} a The vec3 point to rotate + * @param {ReadonlyVec3} b The origin of the rotation + * @param {Number} rad The angle of rotation in radians + * @returns {vec3} out + */ + +function rotateZ(out, a, b, rad) { + var p = [], + r = []; //Translate point to the origin + + p[0] = a[0] - b[0]; + p[1] = a[1] - b[1]; + p[2] = a[2] - b[2]; //perform rotation + + r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad); + r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad); + r[2] = p[2]; //translate to correct position + + out[0] = r[0] + b[0]; + out[1] = r[1] + b[1]; + out[2] = r[2] + b[2]; + return out; +} +/** + * Get the angle between two 3D vectors + * @param {ReadonlyVec3} a The first operand + * @param {ReadonlyVec3} b The second operand + * @returns {Number} The angle in radians + */ + +function angle(a, b) { + var ax = a[0], + ay = a[1], + az = a[2], + bx = b[0], + by = b[1], + bz = b[2], + mag1 = Math.sqrt(ax * ax + ay * ay + az * az), + mag2 = Math.sqrt(bx * bx + by * by + bz * bz), + mag = mag1 * mag2, + cosine = mag && dot(a, b) / mag; + return Math.acos(Math.min(Math.max(cosine, -1), 1)); +} +/** + * Set the components of a vec3 to zero + * + * @param {vec3} out the receiving vector + * @returns {vec3} out + */ + +function zero(out) { + out[0] = 0.0; + out[1] = 0.0; + out[2] = 0.0; + return out; +} +/** + * Returns a string representation of a vector + * + * @param {ReadonlyVec3} a vector to represent as a string + * @returns {String} string representation of the vector + */ + +function str(a) { + return "vec3(" + a[0] + ", " + a[1] + ", " + a[2] + ")"; +} +/** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyVec3} a The first vector. + * @param {ReadonlyVec3} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; } -exports.Group = Group; -//# sourceMappingURL=Group.js.map +/** + * Returns whether or not the vectors have approximately the same elements in the same position. + * + * @param {ReadonlyVec3} a The first vector. + * @param {ReadonlyVec3} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ -/***/ }), -/* 27 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2]; + var b0 = b[0], + b1 = b[1], + b2 = b[2]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)); +} +/** + * Alias for {@link vec3.subtract} + * @function + */ -"use strict"; +var sub = subtract; +/** + * Alias for {@link vec3.multiply} + * @function + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ShapeBase = void 0; -const gl_matrix_1 = __webpack_require__(13); -const types_1 = __webpack_require__(4); -const glme = __webpack_require__(28); -const Vec2_1 = __webpack_require__(29); -const math_1 = __webpack_require__(30); -const Adapt_1 = __webpack_require__(31); -const Utilities_1 = __webpack_require__(33); -const SceneChild_1 = __webpack_require__(25); -const tmpMatrix = gl_matrix_1.mat4.create(); -const transformMatrix = gl_matrix_1.mat4.create(); -const perspectiveMatrix = gl_matrix_1.mat4.create(); -const repetitionMatrix = gl_matrix_1.mat4.create(); -/** - * Main class for shape generation - * - * @category Core.Abstract - * @abstract - * @class ShapeBase - * @order 4 - * @extends {SceneChild} +var mul = multiply; +/** + * Alias for {@link vec3.divide} + * @function */ -class ShapeBase extends SceneChild_1.SceneChild { - /** - * Creates an instance of ShapeBase - * - * @param {ISceneChildSettings} [settings={}] - */ - constructor(settings = {}) { - super(settings); - /** - * Flag used to determine if indexedBuffer has been generated - * - * @internal - * @ignore - */ - this.bIndexed = false; - /** - * Array used for index a vertex buffer - * only for first level scene children - * - * @internal - * @ignore - */ - this.indexedBuffer = []; - /** - * The bounding inside the scene - * - * @type {IShapeBounding} - */ - this.bounding = { - cx: 0, - cy: 0, - x: -1, - y: -1, - width: 2, - height: 2, - }; - this.props = { - distance: settings.distance, - repetitions: settings.repetitions, - rotateX: settings.rotateX, - rotateY: settings.rotateY, - rotateZ: settings.rotateZ, - skewX: settings.skewX, - skewY: settings.skewY, - squeezeX: settings.squeezeX, - squeezeY: settings.squeezeY, - displace: settings.displace, - translate: settings.translate, - scale: settings.scale, - transformOrigin: settings.transformOrigin, - perspective: settings.perspective, - perspectiveOrigin: settings.perspectiveOrigin, - }; - this.anchor = - settings.anchor && Array.isArray(settings.anchor) - ? [ - typeof settings.anchor[0] === 'number' - ? Utilities_1.clamp(-1, 1, settings.anchor[0]) * -1 - : settings.anchor[0] === 'left' - ? 1 - : settings.anchor[0] === 'right' - ? -1 - : 0, - typeof settings.anchor[1] === 'number' - ? Utilities_1.clamp(-1, 1, settings.anchor[1]) * -1 - : settings.anchor[1] === 'top' - ? 1 - : settings.anchor[1] === 'bottom' - ? -1 - : 0, - ] - : [0, 0]; - this.boundingType = - typeof settings.boundingType === 'string' - ? settings.boundingType === 'relative' - ? types_1.EBoundingType.Relative - : types_1.EBoundingType.Fixed - : settings.boundingType || types_1.EBoundingType.Fixed; - this.vertexCallback = settings.vertexCallback; - } - /** - * Check if the shape should be generated every time - * - * @returns {boolean} - */ - isStatic() { - const props = this.props; - return (typeof props.repetitions !== 'function' && - typeof props.distance !== 'function' && - typeof props.displace !== 'function' && - typeof props.scale !== 'function' && - typeof props.translate !== 'function' && - typeof props.skewX !== 'function' && - typeof props.skewY !== 'function' && - typeof props.squeezeX !== 'function' && - typeof props.squeezeY !== 'function' && - typeof props.rotateX !== 'function' && - typeof props.rotateY !== 'function' && - typeof props.rotateZ !== 'function' && - typeof props.transformOrigin !== 'function' && - typeof props.perspective !== 'function' && - typeof props.perspectiveOrigin !== 'function'); - } - /** - * Check if the indexedBuffer array needs to be recreated every time, - * this can happen when a shape generates an array of vertices different in length at each repetition - * - * @returns {boolean} - */ - isStaticIndexed() { - return typeof this.props.repetitions !== 'function'; - } - /** - * Return a prop value - * - * @param {keyof ISceneChildProps} key - * @param {PropArguments} [propArguments] - * @param {*} [defaultValue] - * @returns {*} - */ - getProp(key, propArguments, defaultValue) { - let attribute = this.props[key]; - if (typeof attribute === 'function') { - attribute = attribute(propArguments); - } - return typeof attribute === 'undefined' || Number.isNaN(attribute) ? defaultValue : attribute; - } - /** - * Set a single or multiple props - * - * @param {(keyof ISceneChildProps | ISceneChildProps)} key - * @param {*} [value] - * @param {boolean} [bClearIndexed=false] - */ - setProp(key, value, bClearIndexed = false) { - if (typeof key === 'string') { - bClearIndexed = bClearIndexed || key == 'repetitions'; - this.props[key] = value; - } - else { - bClearIndexed = bClearIndexed || 'repetitions' in key; - Object.keys(key).forEach((k) => (this.props[k] = key[k])); - } - this.clearBuffer(bClearIndexed, true); - } - /** - * Unset buffer - * - * @param {boolean} [bClearIndexed=false] - * @param {boolean} [bPropagateToParents=false] - * @param {boolean} [bPropagateToChildren=false] - */ - clearBuffer(bClearIndexed = false, bPropagateToParents = true) { - this.buffer = undefined; - if (bClearIndexed) { - this.bIndexed = false; - this.indexedBuffer = []; - } - this.bStatic = this.isStatic(); - this.bStaticIndexed = this.isStaticIndexed(); - if (bPropagateToParents && this.scene && !this.scene.isFirstLevelChild(this)) { - const parents = this.scene.getParentsOfSceneChild(this); - parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */); - } + +var div = divide; +/** + * Alias for {@link vec3.distance} + * @function + */ + +var dist = distance; +/** + * Alias for {@link vec3.squaredDistance} + * @function + */ + +var sqrDist = squaredDistance; +/** + * Alias for {@link vec3.length} + * @function + */ + +var len = length; +/** + * Alias for {@link vec3.squaredLength} + * @function + */ + +var sqrLen = squaredLength; +/** + * Perform some operation over an array of vec3s. + * + * @param {Array} a the array of vectors to iterate over + * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed + * @param {Number} offset Number of elements to skip at the beginning of the array + * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array + * @param {Function} fn Function to call for each vector in the array + * @param {Object} [arg] additional argument to pass to fn + * @returns {Array} a + * @function + */ + +var forEach = function () { + var vec = create(); + return function (a, stride, offset, count, fn, arg) { + var i, l; + + if (!stride) { + stride = 3; } - /** - * Update the vertex array if the shape is not static and update the indexedBuffer if it is also not static - * - * @param {number} generateId generation id - * @param {boolean} [bDirectSceneChild=false] adjust shape of center of scene - * @param {PropArguments} [parentPropArguments] - */ - generate(generateId = 0, bDirectSceneChild = false, parentPropArguments) { - var _a, _b; - if (this.buffer && this.bStatic) { - return; - } - this.generateId = generateId; - if (!this.bStaticIndexed || !this.bIndexed) - this.indexedBuffer = []; - const propArguments = ShapeBase.getEmptyPropArguments(this, parentPropArguments); - const repetition = propArguments.repetition; - const repetitions = this.getProp('repetitions', propArguments, 1); - const repetitionType = Array.isArray(repetitions) ? types_1.ERepetitionType.Matrix : types_1.ERepetitionType.Ring; - const repetitionCount = Array.isArray(repetitions) - ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) - : repetitions; - const repetitionRowCount = Array.isArray(repetitions) ? repetitions[0] : repetitionCount; - const repetitionColCount = Array.isArray(repetitions) ? (_b = repetitions[1]) !== null && _b !== void 0 ? _b : repetitions[0] : 1; - const rowRepetition = repetition.row; - rowRepetition.count = repetitionRowCount; - const colRepetition = repetition.col; - colRepetition.count = repetitionColCount; - repetition.count = repetitionCount; - repetition.col.count = repetitionColCount; - repetition.row.count = repetitionRowCount; - repetition.type = repetitionType; - let totalBufferLength = 0; - const buffers = []; - let currentIndex = 0; - const centerMatrix = gl_matrix_1.vec2.fromValues((repetitionColCount - 1) / 2, (repetitionRowCount - 1) / 2); - const sceneAnchor = this.scene ? [this.scene.anchor[0], this.scene.anchor[1], 0] : [0, 0, 0]; - const tmpTotalShapeBounding = [undefined, undefined, undefined, undefined]; - const tmpSingleRepetitionBounding = [undefined, undefined, undefined, undefined]; - for (let currentRowRepetition = 0; currentRowRepetition < repetitionRowCount; currentRowRepetition++) { - for (let currentColRepetition = 0; currentColRepetition < repetitionColCount; currentColRepetition++, currentIndex++) { - repetition.index = currentIndex + 1; - repetition.offset = repetitionCount > 1 ? currentIndex / (repetitionCount - 1) : 1; - repetition.angle = repetitionType === types_1.ERepetitionType.Ring ? (math_1.PI2 / repetitionCount) * currentIndex : 0; - colRepetition.index = currentColRepetition + 1; - colRepetition.offset = repetitionColCount > 1 ? currentColRepetition / (repetitionColCount - 1) : 1; - rowRepetition.index = currentRowRepetition + 1; - rowRepetition.offset = repetitionRowCount > 1 ? currentRowRepetition / (repetitionRowCount - 1) : 1; - // Generate primitives buffer recursively - const buffer = this.generateBuffer(generateId, propArguments); - const bufferLength = buffer.length; - const bounding = this.getShapeBounding(); - buffers[currentIndex] = new Float32Array(bufferLength); - totalBufferLength += bufferLength; - { - const distance = glme.toVec2(this.getProp('distance', propArguments, glme.VEC2_ZERO)); - const displace = this.getProp('displace', propArguments, 0); - const scale = glme.toVec3(this.getProp('scale', propArguments, glme.VEC2_ONE), 1); - const translate = glme.toVec3(this.getProp('translate', propArguments, glme.VEC2_ZERO), 0); - const skewX = this.getProp('skewX', propArguments, 0); - const skewY = this.getProp('skewY', propArguments, 0); - const squeezeX = this.getProp('squeezeX', propArguments, 0); - const squeezeY = this.getProp('squeezeY', propArguments, 0); - const rotateX = this.getProp('rotateX', propArguments, 0); - const rotateY = this.getProp('rotateY', propArguments, 0); - const rotateZ = this.getProp('rotateZ', propArguments, 0); - const perspective = Utilities_1.clamp(0, 1, this.getProp('perspective', propArguments, 0)); - const perspectiveOrigin = glme.toVec3(this.getProp('perspectiveOrigin', propArguments, glme.VEC2_ZERO), 0); - const transformOrigin = glme.toVec3(this.getProp('transformOrigin', propArguments, glme.VEC2_ZERO), 0); - let offset; - switch (repetitionType) { - case types_1.ERepetitionType.Ring: - offset = gl_matrix_1.vec3.fromValues(distance[0], 0, 0); - gl_matrix_1.vec3.rotateZ(offset, offset, glme.VEC3_ZERO, repetition.angle + displace); - break; - case types_1.ERepetitionType.Matrix: - offset = gl_matrix_1.vec3.fromValues(distance[1] * (currentColRepetition - centerMatrix[0]), distance[0] * (currentRowRepetition - centerMatrix[1]), 0); - break; - } - const perspectiveSize = perspective > 0 ? Math.max(bounding.width, bounding.height) / 2 : 1; - const perspectiveValue = perspective > 0 ? perspectiveSize + (1 - perspective) * (perspectiveSize * 10) : 0; - const bTransformOrigin = (this.boundingType === types_1.EBoundingType.Relative ? bounding.cx !== 0 || bounding.cy !== 0 : true) || - perspective !== 0 || - transformOrigin[0] !== 0 || - transformOrigin[1] !== 0; - const bPerspectiveOrigin = perspectiveOrigin[0] !== 0 || perspectiveOrigin[1] !== 0; - if (bTransformOrigin) { - if (this.boundingType === types_1.EBoundingType.Relative) { - transformOrigin[0] = transformOrigin[0] * (bounding.width / 2) + bounding.cx; - transformOrigin[1] = transformOrigin[1] * (bounding.height / 2) + bounding.cy; - } - else { - transformOrigin[0] *= bounding.width / 2; - transformOrigin[1] *= bounding.height / 2; - } - transformOrigin[2] = perspectiveValue; - } - /** - * Create Matrices - */ - { - /** - * Create Transformation matrix - */ - gl_matrix_1.mat4.identity(transformMatrix); - bTransformOrigin && gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, transformOrigin); - if (translate[0] !== 0 || translate[1] !== 0) - gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, translate); - if (skewX !== 0 || skewY !== 0) { - glme.fromSkew(tmpMatrix, [skewX, skewY]); - gl_matrix_1.mat4.multiply(transformMatrix, transformMatrix, tmpMatrix); - } - rotateX !== 0 && gl_matrix_1.mat4.rotateX(transformMatrix, transformMatrix, rotateX); - rotateY !== 0 && gl_matrix_1.mat4.rotateY(transformMatrix, transformMatrix, rotateY); - rotateZ !== 0 && gl_matrix_1.mat4.rotateZ(transformMatrix, transformMatrix, rotateZ); - if (scale[0] !== 1 || scale[1] !== 1) - gl_matrix_1.mat4.scale(transformMatrix, transformMatrix, scale); - bTransformOrigin && - gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, gl_matrix_1.vec3.scale(transformOrigin, transformOrigin, -1)); - /** - * Create Perspective matrix - */ - if (perspectiveValue > 0) { - if (bPerspectiveOrigin) { - if (this.boundingType === types_1.EBoundingType.Relative) { - perspectiveOrigin[0] = perspectiveOrigin[0] * (bounding.width / 2) + bounding.cx; - perspectiveOrigin[1] = perspectiveOrigin[1] * (bounding.height / 2) + bounding.cy; - } - else { - perspectiveOrigin[0] *= bounding.width / 2; - perspectiveOrigin[1] *= bounding.height / 2; - } - perspectiveOrigin[2] = 0; - } - gl_matrix_1.mat4.perspective(perspectiveMatrix, -Math.PI / 2, 1, 0, Infinity); - } - /** - * Create Repetition matrix - */ - gl_matrix_1.mat4.identity(repetitionMatrix); - gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, offset); - if (bDirectSceneChild) { - gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, sceneAnchor); - } - /** - * Apply anchor - */ - const shapeAnchor = [this.anchor[0] * (bounding.width / 2), this.anchor[1] * (bounding.height / 2), 0]; - gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, shapeAnchor); - if (repetitionType === types_1.ERepetitionType.Ring) - gl_matrix_1.mat4.rotateZ(repetitionMatrix, repetitionMatrix, repetition.angle + displace); - } - Adapt_1.Bounding.clear(tmpSingleRepetitionBounding); - // Apply matrices on vertex - for (let bufferIndex = 0; bufferIndex < bufferLength; bufferIndex += 2) { - const vertex = [buffer[bufferIndex], buffer[bufferIndex + 1], perspectiveValue]; - { - // Apply squeeze, can be insert into transformMatrix? - squeezeX !== 0 && Vec2_1.default.squeezeX(vertex, squeezeX); - squeezeY !== 0 && Vec2_1.default.squeezeY(vertex, squeezeY); - // Apply transforms - gl_matrix_1.vec3.transformMat4(vertex, vertex, transformMatrix); - // Apply perspective - if (perspectiveValue > 0) { - bPerspectiveOrigin && gl_matrix_1.vec3.add(vertex, vertex, perspectiveOrigin); - gl_matrix_1.vec3.transformMat4(vertex, vertex, perspectiveMatrix); - gl_matrix_1.vec3.scale(vertex, vertex, perspectiveValue); - bPerspectiveOrigin && gl_matrix_1.vec3.sub(vertex, vertex, perspectiveOrigin); - } - // apply repetition matrix - gl_matrix_1.vec3.transformMat4(vertex, vertex, repetitionMatrix); - // custom vertex manipulation - if (typeof this.vertexCallback !== 'undefined') { - const index = bufferIndex / 2; - const count = bufferLength / 2; - const vertexRepetition = { - index: index + 1, - count, - offset: count > 1 ? index / (count - 1) : 1, - }; - this.vertexCallback(vertex, vertexRepetition, propArguments); - } - } - buffers[currentIndex][bufferIndex] = vertex[0]; - buffers[currentIndex][bufferIndex + 1] = vertex[1]; - Adapt_1.Bounding.add(tmpSingleRepetitionBounding, vertex[0], vertex[1]); - Adapt_1.Bounding.add(tmpTotalShapeBounding, vertex[0], vertex[1]); - } - } - // Bounding.sum(tmpTotalShapeBounding, tmpSingleRepetitionBounding) - // After buffer creation, add a frame into indexedBuffer if not static or update bounding - const singleRepetitionBounding = { cx: 0, cy: 0, x: -1, y: -1, width: 2, height: 2 }; - Adapt_1.Bounding.bind(singleRepetitionBounding, tmpSingleRepetitionBounding); - if (!this.bStaticIndexed || !this.bIndexed) { - this.addIndex(bufferLength, repetition, singleRepetitionBounding); - } - } - } - Adapt_1.Bounding.bind(this.bounding, tmpTotalShapeBounding); - this.buffer = new Float32Array(totalBufferLength); - for (let i = 0, offset = 0, len = buffers.length; i < len; offset += buffers[i].length, i++) - this.buffer.set(buffers[i], offset); - this.bIndexed = true; + + if (!offset) { + offset = 0; } - /** - * Return current shape (whit repetions) bounding - * - * @return {*} {IShapeBounding} - */ - getBounding() { - return this.bounding; + + if (count) { + l = Math.min(count * stride + offset, a.length); + } else { + l = a.length; } - /** - * Get number of repetitions - * - * @returns {number} - */ - getRepetitionCount() { - var _a; - const repetitions = this.getProp('repetitions', undefined, 1); - return Array.isArray(repetitions) ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) : repetitions; + + for (i = offset; i < l; i += stride) { + vec[0] = a[i]; + vec[1] = a[i + 1]; + vec[2] = a[i + 2]; + fn(vec, vec, arg); + a[i] = vec[0]; + a[i + 1] = vec[1]; + a[i + 2] = vec[2]; + } + + return a; + }; +}(); + +/***/ }), +/* 17 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "fromRotationTranslationValues": () => (/* binding */ fromRotationTranslationValues), +/* harmony export */ "fromRotationTranslation": () => (/* binding */ fromRotationTranslation), +/* harmony export */ "fromTranslation": () => (/* binding */ fromTranslation), +/* harmony export */ "fromRotation": () => (/* binding */ fromRotation), +/* harmony export */ "fromMat4": () => (/* binding */ fromMat4), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "identity": () => (/* binding */ identity), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "getReal": () => (/* binding */ getReal), +/* harmony export */ "getDual": () => (/* binding */ getDual), +/* harmony export */ "setReal": () => (/* binding */ setReal), +/* harmony export */ "setDual": () => (/* binding */ setDual), +/* harmony export */ "getTranslation": () => (/* binding */ getTranslation), +/* harmony export */ "translate": () => (/* binding */ translate), +/* harmony export */ "rotateX": () => (/* binding */ rotateX), +/* harmony export */ "rotateY": () => (/* binding */ rotateY), +/* harmony export */ "rotateZ": () => (/* binding */ rotateZ), +/* harmony export */ "rotateByQuatAppend": () => (/* binding */ rotateByQuatAppend), +/* harmony export */ "rotateByQuatPrepend": () => (/* binding */ rotateByQuatPrepend), +/* harmony export */ "rotateAroundAxis": () => (/* binding */ rotateAroundAxis), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "dot": () => (/* binding */ dot), +/* harmony export */ "lerp": () => (/* binding */ lerp), +/* harmony export */ "invert": () => (/* binding */ invert), +/* harmony export */ "conjugate": () => (/* binding */ conjugate), +/* harmony export */ "length": () => (/* binding */ length), +/* harmony export */ "len": () => (/* binding */ len), +/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), +/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), +/* harmony export */ "normalize": () => (/* binding */ normalize), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); +/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14); +/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13); + + + +/** + * Dual Quaternion
+ * Format: [real, dual]
+ * Quaternion format: XYZW
+ * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
+ * @module quat2 + */ + +/** + * Creates a new identity dual quat + * + * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation] + */ + +function create() { + var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + dq[0] = 0; + dq[1] = 0; + dq[2] = 0; + dq[4] = 0; + dq[5] = 0; + dq[6] = 0; + dq[7] = 0; + } + + dq[3] = 1; + return dq; +} +/** + * Creates a new quat initialized with values from an existing quaternion + * + * @param {ReadonlyQuat2} a dual quaternion to clone + * @returns {quat2} new dual quaternion + * @function + */ + +function clone(a) { + var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); + dq[0] = a[0]; + dq[1] = a[1]; + dq[2] = a[2]; + dq[3] = a[3]; + dq[4] = a[4]; + dq[5] = a[5]; + dq[6] = a[6]; + dq[7] = a[7]; + return dq; +} +/** + * Creates a new dual quat initialized with the given values + * + * @param {Number} x1 X component + * @param {Number} y1 Y component + * @param {Number} z1 Z component + * @param {Number} w1 W component + * @param {Number} x2 X component + * @param {Number} y2 Y component + * @param {Number} z2 Z component + * @param {Number} w2 W component + * @returns {quat2} new dual quaternion + * @function + */ + +function fromValues(x1, y1, z1, w1, x2, y2, z2, w2) { + var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); + dq[0] = x1; + dq[1] = y1; + dq[2] = z1; + dq[3] = w1; + dq[4] = x2; + dq[5] = y2; + dq[6] = z2; + dq[7] = w2; + return dq; +} +/** + * Creates a new dual quat from the given values (quat and translation) + * + * @param {Number} x1 X component + * @param {Number} y1 Y component + * @param {Number} z1 Z component + * @param {Number} w1 W component + * @param {Number} x2 X component (translation) + * @param {Number} y2 Y component (translation) + * @param {Number} z2 Z component (translation) + * @returns {quat2} new dual quaternion + * @function + */ + +function fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) { + var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(8); + dq[0] = x1; + dq[1] = y1; + dq[2] = z1; + dq[3] = w1; + var ax = x2 * 0.5, + ay = y2 * 0.5, + az = z2 * 0.5; + dq[4] = ax * w1 + ay * z1 - az * y1; + dq[5] = ay * w1 + az * x1 - ax * z1; + dq[6] = az * w1 + ax * y1 - ay * x1; + dq[7] = -ax * x1 - ay * y1 - az * z1; + return dq; +} +/** + * Creates a dual quat from a quaternion and a translation + * + * @param {ReadonlyQuat2} dual quaternion receiving operation result + * @param {ReadonlyQuat} q a normalized quaternion + * @param {ReadonlyVec3} t tranlation vector + * @returns {quat2} dual quaternion receiving operation result + * @function + */ + +function fromRotationTranslation(out, q, t) { + var ax = t[0] * 0.5, + ay = t[1] * 0.5, + az = t[2] * 0.5, + bx = q[0], + by = q[1], + bz = q[2], + bw = q[3]; + out[0] = bx; + out[1] = by; + out[2] = bz; + out[3] = bw; + out[4] = ax * bw + ay * bz - az * by; + out[5] = ay * bw + az * bx - ax * bz; + out[6] = az * bw + ax * by - ay * bx; + out[7] = -ax * bx - ay * by - az * bz; + return out; +} +/** + * Creates a dual quat from a translation + * + * @param {ReadonlyQuat2} dual quaternion receiving operation result + * @param {ReadonlyVec3} t translation vector + * @returns {quat2} dual quaternion receiving operation result + * @function + */ + +function fromTranslation(out, t) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = t[0] * 0.5; + out[5] = t[1] * 0.5; + out[6] = t[2] * 0.5; + out[7] = 0; + return out; +} +/** + * Creates a dual quat from a quaternion + * + * @param {ReadonlyQuat2} dual quaternion receiving operation result + * @param {ReadonlyQuat} q the quaternion + * @returns {quat2} dual quaternion receiving operation result + * @function + */ + +function fromRotation(out, q) { + out[0] = q[0]; + out[1] = q[1]; + out[2] = q[2]; + out[3] = q[3]; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; +} +/** + * Creates a new dual quat from a matrix (4x4) + * + * @param {quat2} out the dual quaternion + * @param {ReadonlyMat4} a the matrix + * @returns {quat2} dual quat receiving operation result + * @function + */ + +function fromMat4(out, a) { + //TODO Optimize this + var outer = _quat_js__WEBPACK_IMPORTED_MODULE_1__.create(); + _mat4_js__WEBPACK_IMPORTED_MODULE_2__.getRotation(outer, a); + var t = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); + _mat4_js__WEBPACK_IMPORTED_MODULE_2__.getTranslation(t, a); + fromRotationTranslation(out, outer, t); + return out; +} +/** + * Copy the values from one dual quat to another + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the source dual quaternion + * @returns {quat2} out + * @function + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + return out; +} +/** + * Set a dual quat to the identity dual quaternion + * + * @param {quat2} out the receiving quaternion + * @returns {quat2} out + */ + +function identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; +} +/** + * Set the components of a dual quat to the given values + * + * @param {quat2} out the receiving quaternion + * @param {Number} x1 X component + * @param {Number} y1 Y component + * @param {Number} z1 Z component + * @param {Number} w1 W component + * @param {Number} x2 X component + * @param {Number} y2 Y component + * @param {Number} z2 Z component + * @param {Number} w2 W component + * @returns {quat2} out + * @function + */ + +function set(out, x1, y1, z1, w1, x2, y2, z2, w2) { + out[0] = x1; + out[1] = y1; + out[2] = z1; + out[3] = w1; + out[4] = x2; + out[5] = y2; + out[6] = z2; + out[7] = w2; + return out; +} +/** + * Gets the real part of a dual quat + * @param {quat} out real part + * @param {ReadonlyQuat2} a Dual Quaternion + * @return {quat} real part + */ + +var getReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__.copy; +/** + * Gets the dual part of a dual quat + * @param {quat} out dual part + * @param {ReadonlyQuat2} a Dual Quaternion + * @return {quat} dual part + */ + +function getDual(out, a) { + out[0] = a[4]; + out[1] = a[5]; + out[2] = a[6]; + out[3] = a[7]; + return out; +} +/** + * Set the real component of a dual quat to the given quaternion + * + * @param {quat2} out the receiving quaternion + * @param {ReadonlyQuat} q a quaternion representing the real part + * @returns {quat2} out + * @function + */ + +var setReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__.copy; +/** + * Set the dual component of a dual quat to the given quaternion + * + * @param {quat2} out the receiving quaternion + * @param {ReadonlyQuat} q a quaternion representing the dual part + * @returns {quat2} out + * @function + */ + +function setDual(out, q) { + out[4] = q[0]; + out[5] = q[1]; + out[6] = q[2]; + out[7] = q[3]; + return out; +} +/** + * Gets the translation of a normalized dual quat + * @param {vec3} out translation + * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed + * @return {vec3} translation + */ + +function getTranslation(out, a) { + var ax = a[4], + ay = a[5], + az = a[6], + aw = a[7], + bx = -a[0], + by = -a[1], + bz = -a[2], + bw = a[3]; + out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + return out; +} +/** + * Translates a dual quat by the given vector + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to translate + * @param {ReadonlyVec3} v vector to translate by + * @returns {quat2} out + */ + +function translate(out, a, v) { + var ax1 = a[0], + ay1 = a[1], + az1 = a[2], + aw1 = a[3], + bx1 = v[0] * 0.5, + by1 = v[1] * 0.5, + bz1 = v[2] * 0.5, + ax2 = a[4], + ay2 = a[5], + az2 = a[6], + aw2 = a[7]; + out[0] = ax1; + out[1] = ay1; + out[2] = az1; + out[3] = aw1; + out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2; + out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2; + out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2; + out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2; + return out; +} +/** + * Rotates a dual quat around the X axis + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @param {number} rad how far should the rotation be + * @returns {quat2} out + */ + +function rotateX(out, a, rad) { + var bx = -a[0], + by = -a[1], + bz = -a[2], + bw = a[3], + ax = a[4], + ay = a[5], + az = a[6], + aw = a[7], + ax1 = ax * bw + aw * bx + ay * bz - az * by, + ay1 = ay * bw + aw * by + az * bx - ax * bz, + az1 = az * bw + aw * bz + ax * by - ay * bx, + aw1 = aw * bw - ax * bx - ay * by - az * bz; + _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateX(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; +} +/** + * Rotates a dual quat around the Y axis + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @param {number} rad how far should the rotation be + * @returns {quat2} out + */ + +function rotateY(out, a, rad) { + var bx = -a[0], + by = -a[1], + bz = -a[2], + bw = a[3], + ax = a[4], + ay = a[5], + az = a[6], + aw = a[7], + ax1 = ax * bw + aw * bx + ay * bz - az * by, + ay1 = ay * bw + aw * by + az * bx - ax * bz, + az1 = az * bw + aw * bz + ax * by - ay * bx, + aw1 = aw * bw - ax * bx - ay * by - az * bz; + _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateY(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; +} +/** + * Rotates a dual quat around the Z axis + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @param {number} rad how far should the rotation be + * @returns {quat2} out + */ + +function rotateZ(out, a, rad) { + var bx = -a[0], + by = -a[1], + bz = -a[2], + bw = a[3], + ax = a[4], + ay = a[5], + az = a[6], + aw = a[7], + ax1 = ax * bw + aw * bx + ay * bz - az * by, + ay1 = ay * bw + aw * by + az * bx - ax * bz, + az1 = az * bw + aw * bz + ax * by - ay * bx, + aw1 = aw * bw - ax * bx - ay * by - az * bz; + _quat_js__WEBPACK_IMPORTED_MODULE_1__.rotateZ(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; +} +/** + * Rotates a dual quat by a given quaternion (a * q) + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @param {ReadonlyQuat} q quaternion to rotate by + * @returns {quat2} out + */ + +function rotateByQuatAppend(out, a, q) { + var qx = q[0], + qy = q[1], + qz = q[2], + qw = q[3], + ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + out[0] = ax * qw + aw * qx + ay * qz - az * qy; + out[1] = ay * qw + aw * qy + az * qx - ax * qz; + out[2] = az * qw + aw * qz + ax * qy - ay * qx; + out[3] = aw * qw - ax * qx - ay * qy - az * qz; + ax = a[4]; + ay = a[5]; + az = a[6]; + aw = a[7]; + out[4] = ax * qw + aw * qx + ay * qz - az * qy; + out[5] = ay * qw + aw * qy + az * qx - ax * qz; + out[6] = az * qw + aw * qz + ax * qy - ay * qx; + out[7] = aw * qw - ax * qx - ay * qy - az * qz; + return out; +} +/** + * Rotates a dual quat by a given quaternion (q * a) + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat} q quaternion to rotate by + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @returns {quat2} out + */ + +function rotateByQuatPrepend(out, q, a) { + var qx = q[0], + qy = q[1], + qz = q[2], + qw = q[3], + bx = a[0], + by = a[1], + bz = a[2], + bw = a[3]; + out[0] = qx * bw + qw * bx + qy * bz - qz * by; + out[1] = qy * bw + qw * by + qz * bx - qx * bz; + out[2] = qz * bw + qw * bz + qx * by - qy * bx; + out[3] = qw * bw - qx * bx - qy * by - qz * bz; + bx = a[4]; + by = a[5]; + bz = a[6]; + bw = a[7]; + out[4] = qx * bw + qw * bx + qy * bz - qz * by; + out[5] = qy * bw + qw * by + qz * bx - qx * bz; + out[6] = qz * bw + qw * bz + qx * by - qy * bx; + out[7] = qw * bw - qx * bx - qy * by - qz * bz; + return out; +} +/** + * Rotates a dual quat around a given axis. Does the normalisation automatically + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the dual quaternion to rotate + * @param {ReadonlyVec3} axis the axis to rotate around + * @param {Number} rad how far the rotation should be + * @returns {quat2} out + */ + +function rotateAroundAxis(out, a, axis, rad) { + //Special case for rad = 0 + if (Math.abs(rad) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { + return copy(out, a); + } + + var axisLength = Math.hypot(axis[0], axis[1], axis[2]); + rad = rad * 0.5; + var s = Math.sin(rad); + var bx = s * axis[0] / axisLength; + var by = s * axis[1] / axisLength; + var bz = s * axis[2] / axisLength; + var bw = Math.cos(rad); + var ax1 = a[0], + ay1 = a[1], + az1 = a[2], + aw1 = a[3]; + out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + var ax = a[4], + ay = a[5], + az = a[6], + aw = a[7]; + out[4] = ax * bw + aw * bx + ay * bz - az * by; + out[5] = ay * bw + aw * by + az * bx - ax * bz; + out[6] = az * bw + aw * bz + ax * by - ay * bx; + out[7] = aw * bw - ax * bx - ay * by - az * bz; + return out; +} +/** + * Adds two dual quat's + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the first operand + * @param {ReadonlyQuat2} b the second operand + * @returns {quat2} out + * @function + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + return out; +} +/** + * Multiplies two dual quat's + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a the first operand + * @param {ReadonlyQuat2} b the second operand + * @returns {quat2} out + */ + +function multiply(out, a, b) { + var ax0 = a[0], + ay0 = a[1], + az0 = a[2], + aw0 = a[3], + bx1 = b[4], + by1 = b[5], + bz1 = b[6], + bw1 = b[7], + ax1 = a[4], + ay1 = a[5], + az1 = a[6], + aw1 = a[7], + bx0 = b[0], + by0 = b[1], + bz0 = b[2], + bw0 = b[3]; + out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0; + out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0; + out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0; + out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0; + out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0; + out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0; + out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0; + out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0; + return out; +} +/** + * Alias for {@link quat2.multiply} + * @function + */ + +var mul = multiply; +/** + * Scales a dual quat by a scalar number + * + * @param {quat2} out the receiving dual quat + * @param {ReadonlyQuat2} a the dual quat to scale + * @param {Number} b amount to scale the dual quat by + * @returns {quat2} out + * @function + */ + +function scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + return out; +} +/** + * Calculates the dot product of two dual quat's (The dot product of the real parts) + * + * @param {ReadonlyQuat2} a the first operand + * @param {ReadonlyQuat2} b the second operand + * @returns {Number} dot product of a and b + * @function + */ + +var dot = _quat_js__WEBPACK_IMPORTED_MODULE_1__.dot; +/** + * Performs a linear interpolation between two dual quats's + * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5) + * + * @param {quat2} out the receiving dual quat + * @param {ReadonlyQuat2} a the first operand + * @param {ReadonlyQuat2} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {quat2} out + */ + +function lerp(out, a, b, t) { + var mt = 1 - t; + if (dot(a, b) < 0) t = -t; + out[0] = a[0] * mt + b[0] * t; + out[1] = a[1] * mt + b[1] * t; + out[2] = a[2] * mt + b[2] * t; + out[3] = a[3] * mt + b[3] * t; + out[4] = a[4] * mt + b[4] * t; + out[5] = a[5] * mt + b[5] * t; + out[6] = a[6] * mt + b[6] * t; + out[7] = a[7] * mt + b[7] * t; + return out; +} +/** + * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a dual quat to calculate inverse of + * @returns {quat2} out + */ + +function invert(out, a) { + var sqlen = squaredLength(a); + out[0] = -a[0] / sqlen; + out[1] = -a[1] / sqlen; + out[2] = -a[2] / sqlen; + out[3] = a[3] / sqlen; + out[4] = -a[4] / sqlen; + out[5] = -a[5] / sqlen; + out[6] = -a[6] / sqlen; + out[7] = a[7] / sqlen; + return out; +} +/** + * Calculates the conjugate of a dual quat + * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result. + * + * @param {quat2} out the receiving quaternion + * @param {ReadonlyQuat2} a quat to calculate conjugate of + * @returns {quat2} out + */ + +function conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + out[4] = -a[4]; + out[5] = -a[5]; + out[6] = -a[6]; + out[7] = a[7]; + return out; +} +/** + * Calculates the length of a dual quat + * + * @param {ReadonlyQuat2} a dual quat to calculate length of + * @returns {Number} length of a + * @function + */ + +var length = _quat_js__WEBPACK_IMPORTED_MODULE_1__.length; +/** + * Alias for {@link quat2.length} + * @function + */ + +var len = length; +/** + * Calculates the squared length of a dual quat + * + * @param {ReadonlyQuat2} a dual quat to calculate squared length of + * @returns {Number} squared length of a + * @function + */ + +var squaredLength = _quat_js__WEBPACK_IMPORTED_MODULE_1__.squaredLength; +/** + * Alias for {@link quat2.squaredLength} + * @function + */ + +var sqrLen = squaredLength; +/** + * Normalize a dual quat + * + * @param {quat2} out the receiving dual quaternion + * @param {ReadonlyQuat2} a dual quaternion to normalize + * @returns {quat2} out + * @function + */ + +function normalize(out, a) { + var magnitude = squaredLength(a); + + if (magnitude > 0) { + magnitude = Math.sqrt(magnitude); + var a0 = a[0] / magnitude; + var a1 = a[1] / magnitude; + var a2 = a[2] / magnitude; + var a3 = a[3] / magnitude; + var b0 = a[4]; + var b1 = a[5]; + var b2 = a[6]; + var b3 = a[7]; + var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = (b0 - a0 * a_dot_b) / magnitude; + out[5] = (b1 - a1 * a_dot_b) / magnitude; + out[6] = (b2 - a2 * a_dot_b) / magnitude; + out[7] = (b3 - a3 * a_dot_b) / magnitude; + } + + return out; +} +/** + * Returns a string representation of a dual quatenion + * + * @param {ReadonlyQuat2} a dual quaternion to represent as a string + * @returns {String} string representation of the dual quat + */ + +function str(a) { + return "quat2(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ")"; +} +/** + * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===) + * + * @param {ReadonlyQuat2} a the first dual quaternion. + * @param {ReadonlyQuat2} b the second dual quaternion. + * @returns {Boolean} true if the dual quaternions are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7]; +} +/** + * Returns whether or not the dual quaternions have approximately the same elements in the same position. + * + * @param {ReadonlyQuat2} a the first dual quat. + * @param {ReadonlyQuat2} b the second dual quat. + * @returns {Boolean} true if the dual quats are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3], + a4 = a[4], + a5 = a[5], + a6 = a[6], + a7 = a[7]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3], + b4 = b[4], + b5 = b[5], + b6 = b[6], + b7 = b[7]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)); +} + +/***/ }), +/* 18 */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "create": () => (/* binding */ create), +/* harmony export */ "clone": () => (/* binding */ clone), +/* harmony export */ "fromValues": () => (/* binding */ fromValues), +/* harmony export */ "copy": () => (/* binding */ copy), +/* harmony export */ "set": () => (/* binding */ set), +/* harmony export */ "add": () => (/* binding */ add), +/* harmony export */ "subtract": () => (/* binding */ subtract), +/* harmony export */ "multiply": () => (/* binding */ multiply), +/* harmony export */ "divide": () => (/* binding */ divide), +/* harmony export */ "ceil": () => (/* binding */ ceil), +/* harmony export */ "floor": () => (/* binding */ floor), +/* harmony export */ "min": () => (/* binding */ min), +/* harmony export */ "max": () => (/* binding */ max), +/* harmony export */ "round": () => (/* binding */ round), +/* harmony export */ "scale": () => (/* binding */ scale), +/* harmony export */ "scaleAndAdd": () => (/* binding */ scaleAndAdd), +/* harmony export */ "distance": () => (/* binding */ distance), +/* harmony export */ "squaredDistance": () => (/* binding */ squaredDistance), +/* harmony export */ "length": () => (/* binding */ length), +/* harmony export */ "squaredLength": () => (/* binding */ squaredLength), +/* harmony export */ "negate": () => (/* binding */ negate), +/* harmony export */ "inverse": () => (/* binding */ inverse), +/* harmony export */ "normalize": () => (/* binding */ normalize), +/* harmony export */ "dot": () => (/* binding */ dot), +/* harmony export */ "cross": () => (/* binding */ cross), +/* harmony export */ "lerp": () => (/* binding */ lerp), +/* harmony export */ "random": () => (/* binding */ random), +/* harmony export */ "transformMat2": () => (/* binding */ transformMat2), +/* harmony export */ "transformMat2d": () => (/* binding */ transformMat2d), +/* harmony export */ "transformMat3": () => (/* binding */ transformMat3), +/* harmony export */ "transformMat4": () => (/* binding */ transformMat4), +/* harmony export */ "rotate": () => (/* binding */ rotate), +/* harmony export */ "angle": () => (/* binding */ angle), +/* harmony export */ "zero": () => (/* binding */ zero), +/* harmony export */ "str": () => (/* binding */ str), +/* harmony export */ "exactEquals": () => (/* binding */ exactEquals), +/* harmony export */ "equals": () => (/* binding */ equals), +/* harmony export */ "len": () => (/* binding */ len), +/* harmony export */ "sub": () => (/* binding */ sub), +/* harmony export */ "mul": () => (/* binding */ mul), +/* harmony export */ "div": () => (/* binding */ div), +/* harmony export */ "dist": () => (/* binding */ dist), +/* harmony export */ "sqrDist": () => (/* binding */ sqrDist), +/* harmony export */ "sqrLen": () => (/* binding */ sqrLen), +/* harmony export */ "forEach": () => (/* binding */ forEach) +/* harmony export */ }); +/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); + +/** + * 2 Dimensional Vector + * @module vec2 + */ + +/** + * Creates a new, empty vec2 + * + * @returns {vec2} a new 2D vector + */ + +function create() { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); + + if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { + out[0] = 0; + out[1] = 0; + } + + return out; +} +/** + * Creates a new vec2 initialized with values from an existing vector + * + * @param {ReadonlyVec2} a vector to clone + * @returns {vec2} a new 2D vector + */ + +function clone(a) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); + out[0] = a[0]; + out[1] = a[1]; + return out; +} +/** + * Creates a new vec2 initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @returns {vec2} a new 2D vector + */ + +function fromValues(x, y) { + var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); + out[0] = x; + out[1] = y; + return out; +} +/** + * Copy the values from one vec2 to another + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the source vector + * @returns {vec2} out + */ + +function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + return out; +} +/** + * Set the components of a vec2 to the given values + * + * @param {vec2} out the receiving vector + * @param {Number} x X component + * @param {Number} y Y component + * @returns {vec2} out + */ + +function set(out, x, y) { + out[0] = x; + out[1] = y; + return out; +} +/** + * Adds two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + return out; +} +/** + * Subtracts vector b from vector a + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + return out; +} +/** + * Multiplies two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + return out; +} +/** + * Divides two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + return out; +} +/** + * Math.ceil the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to ceil + * @returns {vec2} out + */ + +function ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + return out; +} +/** + * Math.floor the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to floor + * @returns {vec2} out + */ + +function floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + return out; +} +/** + * Returns the minimum of two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + return out; +} +/** + * Returns the maximum of two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec2} out + */ + +function max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + return out; +} +/** + * Math.round the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to round + * @returns {vec2} out + */ + +function round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + return out; +} +/** + * Scales a vec2 by a scalar number + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {vec2} out + */ + +function scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + return out; +} +/** + * Adds two vec2's after scaling the second operand by a scalar value + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @param {Number} scale the amount to scale b by before adding + * @returns {vec2} out + */ + +function scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + return out; +} +/** + * Calculates the euclidian distance between two vec2's + * + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {Number} distance between a and b + */ + +function distance(a, b) { + var x = b[0] - a[0], + y = b[1] - a[1]; + return Math.hypot(x, y); +} +/** + * Calculates the squared euclidian distance between two vec2's + * + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {Number} squared distance between a and b + */ + +function squaredDistance(a, b) { + var x = b[0] - a[0], + y = b[1] - a[1]; + return x * x + y * y; +} +/** + * Calculates the length of a vec2 + * + * @param {ReadonlyVec2} a vector to calculate length of + * @returns {Number} length of a + */ + +function length(a) { + var x = a[0], + y = a[1]; + return Math.hypot(x, y); +} +/** + * Calculates the squared length of a vec2 + * + * @param {ReadonlyVec2} a vector to calculate squared length of + * @returns {Number} squared length of a + */ + +function squaredLength(a) { + var x = a[0], + y = a[1]; + return x * x + y * y; +} +/** + * Negates the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to negate + * @returns {vec2} out + */ + +function negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + return out; +} +/** + * Returns the inverse of the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to invert + * @returns {vec2} out + */ + +function inverse(out, a) { + out[0] = 1.0 / a[0]; + out[1] = 1.0 / a[1]; + return out; +} +/** + * Normalize a vec2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a vector to normalize + * @returns {vec2} out + */ + +function normalize(out, a) { + var x = a[0], + y = a[1]; + var len = x * x + y * y; + + if (len > 0) { + //TODO: evaluate use of glm_invsqrt here? + len = 1 / Math.sqrt(len); + } + + out[0] = a[0] * len; + out[1] = a[1] * len; + return out; +} +/** + * Calculates the dot product of two vec2's + * + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {Number} dot product of a and b + */ + +function dot(a, b) { + return a[0] * b[0] + a[1] * b[1]; +} +/** + * Computes the cross product of two vec2's + * Note that the cross product must by definition produce a 3D vector + * + * @param {vec3} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @returns {vec3} out + */ + +function cross(out, a, b) { + var z = a[0] * b[1] - a[1] * b[0]; + out[0] = out[1] = 0; + out[2] = z; + return out; +} +/** + * Performs a linear interpolation between two vec2's + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the first operand + * @param {ReadonlyVec2} b the second operand + * @param {Number} t interpolation amount, in the range [0-1], between the two inputs + * @returns {vec2} out + */ + +function lerp(out, a, b, t) { + var ax = a[0], + ay = a[1]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + return out; +} +/** + * Generates a random vector with the given scale + * + * @param {vec2} out the receiving vector + * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns {vec2} out + */ + +function random(out, scale) { + scale = scale || 1.0; + var r = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 * Math.PI; + out[0] = Math.cos(r) * scale; + out[1] = Math.sin(r) * scale; + return out; +} +/** + * Transforms the vec2 with a mat2 + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the vector to transform + * @param {ReadonlyMat2} m matrix to transform with + * @returns {vec2} out + */ + +function transformMat2(out, a, m) { + var x = a[0], + y = a[1]; + out[0] = m[0] * x + m[2] * y; + out[1] = m[1] * x + m[3] * y; + return out; +} +/** + * Transforms the vec2 with a mat2d + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the vector to transform + * @param {ReadonlyMat2d} m matrix to transform with + * @returns {vec2} out + */ + +function transformMat2d(out, a, m) { + var x = a[0], + y = a[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; +} +/** + * Transforms the vec2 with a mat3 + * 3rd vector component is implicitly '1' + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the vector to transform + * @param {ReadonlyMat3} m matrix to transform with + * @returns {vec2} out + */ + +function transformMat3(out, a, m) { + var x = a[0], + y = a[1]; + out[0] = m[0] * x + m[3] * y + m[6]; + out[1] = m[1] * x + m[4] * y + m[7]; + return out; +} +/** + * Transforms the vec2 with a mat4 + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param {vec2} out the receiving vector + * @param {ReadonlyVec2} a the vector to transform + * @param {ReadonlyMat4} m matrix to transform with + * @returns {vec2} out + */ + +function transformMat4(out, a, m) { + var x = a[0]; + var y = a[1]; + out[0] = m[0] * x + m[4] * y + m[12]; + out[1] = m[1] * x + m[5] * y + m[13]; + return out; +} +/** + * Rotate a 2D vector + * @param {vec2} out The receiving vec2 + * @param {ReadonlyVec2} a The vec2 point to rotate + * @param {ReadonlyVec2} b The origin of the rotation + * @param {Number} rad The angle of rotation in radians + * @returns {vec2} out + */ + +function rotate(out, a, b, rad) { + //Translate point to the origin + var p0 = a[0] - b[0], + p1 = a[1] - b[1], + sinC = Math.sin(rad), + cosC = Math.cos(rad); //perform rotation and translate to correct position + + out[0] = p0 * cosC - p1 * sinC + b[0]; + out[1] = p0 * sinC + p1 * cosC + b[1]; + return out; +} +/** + * Get the angle between two 2D vectors + * @param {ReadonlyVec2} a The first operand + * @param {ReadonlyVec2} b The second operand + * @returns {Number} The angle in radians + */ + +function angle(a, b) { + var x1 = a[0], + y1 = a[1], + x2 = b[0], + y2 = b[1], + // mag is the product of the magnitudes of a and b + mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2), + // mag &&.. short circuits if mag == 0 + cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1 + + return Math.acos(Math.min(Math.max(cosine, -1), 1)); +} +/** + * Set the components of a vec2 to zero + * + * @param {vec2} out the receiving vector + * @returns {vec2} out + */ + +function zero(out) { + out[0] = 0.0; + out[1] = 0.0; + return out; +} +/** + * Returns a string representation of a vector + * + * @param {ReadonlyVec2} a vector to represent as a string + * @returns {String} string representation of the vector + */ + +function str(a) { + return "vec2(" + a[0] + ", " + a[1] + ")"; +} +/** + * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===) + * + * @param {ReadonlyVec2} a The first vector. + * @param {ReadonlyVec2} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1]; +} +/** + * Returns whether or not the vectors have approximately the same elements in the same position. + * + * @param {ReadonlyVec2} a The first vector. + * @param {ReadonlyVec2} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ + +function equals(a, b) { + var a0 = a[0], + a1 = a[1]; + var b0 = b[0], + b1 = b[1]; + return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)); +} +/** + * Alias for {@link vec2.length} + * @function + */ + +var len = length; +/** + * Alias for {@link vec2.subtract} + * @function + */ + +var sub = subtract; +/** + * Alias for {@link vec2.multiply} + * @function + */ + +var mul = multiply; +/** + * Alias for {@link vec2.divide} + * @function + */ + +var div = divide; +/** + * Alias for {@link vec2.distance} + * @function + */ + +var dist = distance; +/** + * Alias for {@link vec2.squaredDistance} + * @function + */ + +var sqrDist = squaredDistance; +/** + * Alias for {@link vec2.squaredLength} + * @function + */ + +var sqrLen = squaredLength; +/** + * Perform some operation over an array of vec2s. + * + * @param {Array} a the array of vectors to iterate over + * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed + * @param {Number} offset Number of elements to skip at the beginning of the array + * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array + * @param {Function} fn Function to call for each vector in the array + * @param {Object} [arg] additional argument to pass to fn + * @returns {Array} a + * @function + */ + +var forEach = function () { + var vec = create(); + return function (a, stride, offset, count, fn, arg) { + var i, l; + + if (!stride) { + stride = 2; } - /** - * Return buffer - * - * @returns {(Float32Array | undefined)} - */ - getBuffer() { - return this.buffer; + + if (!offset) { + offset = 0; + } + + if (count) { + l = Math.min(count * stride + offset, a.length); + } else { + l = a.length; } + + for (i = offset; i < l; i += stride) { + vec[0] = a[i]; + vec[1] = a[i + 1]; + fn(vec, vec, arg); + a[i] = vec[0]; + a[i + 1] = vec[1]; + } + + return a; + }; +}(); + +/***/ }), +/* 19 */ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__webpack_require__(20), exports); +__exportStar(__webpack_require__(21), exports); +__exportStar(__webpack_require__(22), exports); +__exportStar(__webpack_require__(23), exports); +__exportStar(__webpack_require__(24), exports); +__exportStar(__webpack_require__(25), exports); +__exportStar(__webpack_require__(26), exports); +__exportStar(__webpack_require__(27), exports); +//# sourceMappingURL=index.js.map + +/***/ }), +/* 20 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=indexedBuffer.js.map + +/***/ }), +/* 21 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=propArguments.js.map + +/***/ }), +/* 22 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ERepetitionType = void 0; +/** + * Repetition type enumerator. + * + * @category Core.Repetition + * @internal + */ +var ERepetitionType; +(function (ERepetitionType) { /** - * Return indexed buffer - * - * @returns {(Array> | undefined)} + * Defines the type of repetition of the shape, + * in a circular way starting from the center of the scene + * @order 1 */ - getIndexedBuffer() { - return this.indexedBuffer; - } + ERepetitionType[ERepetitionType["Ring"] = 1] = "Ring"; /** - * Return number of encapsulation - * - * @param {IBufferIndex} index - * @returns {number} + * Defines the type of repetition of the shape, + * on a nxm grid starting from the center of the scene + * @order 2 */ - static getIndexParentLevel(index) { - if (typeof index.parent === 'undefined') - return 0; - let currentParent = index.parent; - let currentParentLevel = 1; - while (typeof currentParent.parent !== 'undefined') { - currentParentLevel++; - currentParent = currentParent.parent; - } - return currentParentLevel; - } + ERepetitionType[ERepetitionType["Matrix"] = 2] = "Matrix"; +})(ERepetitionType = exports.ERepetitionType || (exports.ERepetitionType = {})); +//# sourceMappingURL=repetitions.js.map + +/***/ }), +/* 23 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=scene-child.js.map + +/***/ }), +/* 24 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=scene.js.map + +/***/ }), +/* 25 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.EBoundingType = void 0; +var EBoundingType; +(function (EBoundingType) { /** - * Stream buffer - * - * @param {(TStreamCallback} callback + * Relative to the real bounding of the shape + * @order 2 */ - stream(callback) { - if (this.buffer && this.indexedBuffer) { - for (let i = 0, j = 0, len = this.indexedBuffer.length; i < len; i++) { - const currentIndexing = this.indexedBuffer[i]; - callback({ - buffer: this.buffer, - frameLength: currentIndexing.frameLength, - frameBufferIndex: j, - currentIndexing: currentIndexing, - currentShapeIndex: i, - totalShapes: len, - }); - j += currentIndexing.frameLength; - } - } - } + EBoundingType[EBoundingType["Relative"] = 1] = "Relative"; /** - * Return empty propArguments - * - * @static - * @param {ShapeBase} shape - * @return {*} {PropArguments} + * Fixed to te width and height of the shape + * @order 3 */ - static getEmptyPropArguments(shape, parentPropArguments) { - const repetition = { - type: types_1.ERepetitionType.Ring, - angle: 0, - index: 1, - offset: 1, - count: 1, - row: { index: 1, offset: 1, count: 1 }, - col: { index: 1, offset: 1, count: 1 }, - }; - return { - repetition, - shape, - parent: parentPropArguments, - }; - } -} -exports.ShapeBase = ShapeBase; -/** - * Empty buffer - * - * @internal - * @ignore - */ -ShapeBase.EMPTY_BUFFER = new Float32Array(0); -/** - * Empty BaseRepetition - * - * @internal - * @ignore - */ -ShapeBase.getEmptySimpleRepetition = () => ({ - index: 1, - offset: 1, - count: 1, -}); -/** - * Empty Repetition - * - * @internal - * @ignore - */ -ShapeBase.getEmptyRepetition = () => ({ - type: types_1.ERepetitionType.Ring, - angle: 0, - ...ShapeBase.getEmptySimpleRepetition(), - row: ShapeBase.getEmptySimpleRepetition(), - col: ShapeBase.getEmptySimpleRepetition(), -}); -//# sourceMappingURL=ShapeBase.js.map + EBoundingType[EBoundingType["Fixed"] = 2] = "Fixed"; +})(EBoundingType = exports.EBoundingType || (exports.EBoundingType = {})); +//# sourceMappingURL=shape-base.js.map + +/***/ }), +/* 26 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +////// +//# sourceMappingURL=shape-primitives.js.map + +/***/ }), +/* 27 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +// Shape +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=shapes.js.map /***/ }), /* 28 */ @@ -9271,7 +9276,7 @@ ShapeBase.getEmptyRepetition = () => ({ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.toVec3 = exports.toVec2 = exports.fromSkew = exports.VEC2_ONE = exports.VEC2_ZERO = exports.VEC3_ONE = exports.VEC3_ZERO = void 0; -const gl_matrix_1 = __webpack_require__(13); +const gl_matrix_1 = __webpack_require__(8); exports.VEC3_ZERO = [0, 0, 0]; exports.VEC3_ONE = [1, 1, 1]; exports.VEC2_ZERO = [0, 0]; @@ -9784,7 +9789,7 @@ exports.Modifier = Modifier; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.distributePointsInBuffer = exports.interpolate = exports.prepareBufferForInterpolation = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.relativeClamp = exports.clamp = exports.lerp = exports.toRadians = exports.toDegrees = exports.now = void 0; const SimplexNoise = __webpack_require__(34); -const repetitions_1 = __webpack_require__(7); +const repetitions_1 = __webpack_require__(22); const Vec2_1 = __webpack_require__(29); // isDef: (object: any): boolean => typeof object !== 'undefined' && object !== null, const measurement = typeof performance !== 'undefined' ? performance : Date; @@ -10630,9 +10635,9 @@ Better rank ordering method by Stefan Gustavson in 2012. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Shape = void 0; -const Scene_1 = __webpack_require__(24); -const SceneChild_1 = __webpack_require__(25); -const ShapeBase_1 = __webpack_require__(27); +const Scene_1 = __webpack_require__(4); +const SceneChild_1 = __webpack_require__(5); +const ShapeBase_1 = __webpack_require__(7); /** * Container of ShapeBase or Group, it applies transformations on each repetition * @@ -10817,7 +10822,7 @@ exports.Shape = Shape; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ShapePrimitive = void 0; const glme = __webpack_require__(28); -const ShapeBase_1 = __webpack_require__(27); +const ShapeBase_1 = __webpack_require__(7); const Modifier_1 = __webpack_require__(32); const Adapt_1 = __webpack_require__(31); /** @@ -10971,7 +10976,7 @@ exports.ShapeLoop = void 0; const math_1 = __webpack_require__(30); const Adapt_1 = __webpack_require__(31); const ShapePrimitive_1 = __webpack_require__(36); -const ShapeBase_1 = __webpack_require__(27); +const ShapeBase_1 = __webpack_require__(7); /** * Shape Loop * @@ -18020,20 +18025,12 @@ exports.parseColor = parseColor; /******/ })(); /******/ /************************************************************************/ -var __webpack_exports__ = {}; -// This entry need to be wrapped in an IIFE because it need to be in strict mode. -(() => { -"use strict"; -var exports = __webpack_exports__; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Urpflanze = void 0; -const Urpflanze = __webpack_require__(1); -exports.Urpflanze = Urpflanze; -exports.default = Urpflanze; -//# sourceMappingURL=index.js.map -})(); - +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module is referenced by other modules so it can't be inlined +/******/ var __webpack_exports__ = __webpack_require__(0); +/******/ /******/ return __webpack_exports__; /******/ })() ; diff --git a/build/umd/urpflanze.js.map b/build/umd/urpflanze.js.map index e78e7b3..3ddca07 100644 --- a/build/umd/urpflanze.js.map +++ b/build/umd/urpflanze.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://Urpflanze/webpack/universalModuleDefinition","webpack://Urpflanze/./dist/cjs/modules.js","webpack://Urpflanze/./dist/cjs/modules-light.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/index.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/index.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/indexedBuffer.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/propArguments.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/repetitions.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/scene-child.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/scene.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/shape-base.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/shape-primitives.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/shapes.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/index.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/common.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/mat2.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/mat2d.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/mat3.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/mat4.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/quat.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/vec4.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/vec3.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/quat2.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/vec2.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/Scene.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/SceneChild.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/Group.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeBase.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/math/gl-matrix-extensions.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/math/Vec2.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/math/index.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Adapt.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Modifier.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/Utilities.js","webpack://Urpflanze/./node_modules/simplex-noise/simplex-noise.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/Shape.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapePrimitive.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeLoop.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeBuffer.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeRecursive.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeFollow.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Line.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Triangle.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Rect.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Polygon.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Circle.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Star.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Rose.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Spiral.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Lissajous.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/SuperShape.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/index.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Mirror.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Smooth.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Close.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Solidify.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Subdivide.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Offset.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/index.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/types.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/utilities.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/createAnimation.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/createInterpolator.js","webpack://Urpflanze/./node_modules/@urpflanze/color/dist/cjs/index.js","webpack://Urpflanze/./node_modules/@urpflanze/color/dist/cjs/types.js","webpack://Urpflanze/./node_modules/@urpflanze/color/dist/cjs/conversions.js","webpack://Urpflanze/./node_modules/@urpflanze/color/dist/cjs/parsing.js","webpack://Urpflanze/./node_modules/@urpflanze/color/dist/cjs/htmlcolors.js","webpack://Urpflanze/./node_modules/bezier-easing/src/index.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/Easings.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/Animation.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/composeAnimations.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/browser/BrowserDrawerCanvas.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/DrawerCanvas.js","webpack://Urpflanze/./node_modules/canvas/browser.js","webpack://Urpflanze/./node_modules/canvas/lib/parse-font.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/Emitter.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/Timeline.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/utils.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/index.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/Renderer.js","webpack://Urpflanze/./node_modules/@ffmpeg/ffmpeg/src/index.js","webpack://Urpflanze/./node_modules/regenerator-runtime/runtime.js","webpack://Urpflanze/./node_modules/@ffmpeg/ffmpeg/src/createFFmpeg.js","webpack://Urpflanze/./node_modules/@ffmpeg/ffmpeg/src/config.js","webpack://Urpflanze/./node_modules/@ffmpeg/ffmpeg/src/utils/log.js","webpack://Urpflanze/./node_modules/@ffmpeg/ffmpeg/src/utils/parseProgress.js","webpack://Urpflanze/./node_modules/@ffmpeg/ffmpeg/src/utils/parseArgs.js","webpack://Urpflanze/./node_modules/@ffmpeg/ffmpeg/src/browser/index.js","webpack://Urpflanze/./node_modules/@ffmpeg/ffmpeg/src/browser/defaultOptions.js","webpack://Urpflanze/./node_modules/resolve-url/resolve-url.js","webpack://Urpflanze/./node_modules/@ffmpeg/ffmpeg/src/browser/getCreateFFmpegCore.js","webpack://Urpflanze/./node_modules/@ffmpeg/ffmpeg/src/browser/fetchFile.js","webpack://Urpflanze/./node_modules/jszip/dist/jszip.min.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/browser/index.js","webpack://Urpflanze/./node_modules/@urpflanze/gcode-exporter/dist/cjs/index.js","webpack://Urpflanze/./node_modules/@urpflanze/gcode-exporter/dist/cjs/types.js","webpack://Urpflanze/./node_modules/@urpflanze/gcode-exporter/dist/cjs/GCODEExporter.js","webpack://Urpflanze/./node_modules/@urpflanze/core/build/umd/urpflanze.min.js","webpack://Urpflanze/./node_modules/simplify-js/simplify.js","webpack://Urpflanze/./node_modules/@urpflanze/gcode-exporter/dist/cjs/utilities.js","webpack://Urpflanze/./node_modules/@urpflanze/svg-exporter/dist/cjs/index.js","webpack://Urpflanze/./node_modules/@urpflanze/svg-exporter/dist/cjs/types.js","webpack://Urpflanze/./node_modules/@urpflanze/svg-exporter/dist/cjs/SVGExporter.js","webpack://Urpflanze/./node_modules/@urpflanze/svg-exporter/node_modules/@urpflanze/color/dist/index.js","webpack://Urpflanze/./node_modules/@urpflanze/svg-exporter/node_modules/@urpflanze/color/dist/types.js","webpack://Urpflanze/./node_modules/@urpflanze/svg-exporter/node_modules/@urpflanze/color/dist/conversions.js","webpack://Urpflanze/./node_modules/@urpflanze/svg-exporter/node_modules/@urpflanze/color/dist/parsing.js","webpack://Urpflanze/./node_modules/@urpflanze/svg-importer/build/umd/urpflanze-svg-importer.min.js","webpack://Urpflanze/webpack/bootstrap","webpack://Urpflanze/webpack/runtime/define property getters","webpack://Urpflanze/webpack/runtime/global","webpack://Urpflanze/webpack/runtime/hasOwnProperty shorthand","webpack://Urpflanze/webpack/runtime/make namespace object","webpack://Urpflanze/./dist/cjs/index.js"],"names":[],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;ACVa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB,GAAG,mBAAmB,GAAG,qBAAqB,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,aAAa;AACvH,aAAa,mBAAO,CAAC,CAAiB;AACtC,aAAa,mBAAO,CAAC,CAAiB;AACtC,uCAAoD;AACpD,YAAY,mBAAO,CAAC,EAAmC;AACvD,4CAA2C,CAAC,qCAAqC,uBAAuB,EAAE,EAAE,EAAC;AAC7G,4CAA2C,CAAC,qCAAqC,uBAAuB,EAAE,EAAE,EAAC;AAC7G,YAAY,mBAAO,CAAC,EAAoC;AACxD,iDAAgD,CAAC,qCAAqC,4BAA4B,EAAE,EAAE,EAAC;AACvH,YAAY,mBAAO,CAAC,GAAkC;AACtD,+CAA8C,CAAC,qCAAqC,0BAA0B,EAAE,EAAE,EAAC;AACnH,qBAAqB,mBAAO,CAAC,GAAyB;AACtD,+CAA8C,CAAC,qCAAqC,mCAAmC,EAAE,EAAE,EAAC;AAC5H,mC;;;;;;;ACzBa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,oBAAoB,GAAG,iBAAiB;AACxC,aAAa,mBAAO,CAAC,CAA0B;AAC/C,2CAA4D;AAC5D,4BAA4B,mBAAO,CAAC,EAA+D;AACnG,gDAA+C,CAAC,qCAAqC,kDAAkD,EAAE,EAAE,EAAC;AAC5I,yC;;;;;;;ACjBa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,YAAY,GAAG,gCAAgC,GAAG,qCAAqC,GAAG,mBAAmB,GAAG,8BAA8B,GAAG,4BAA4B,GAAG,2BAA2B,GAAG,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,qBAAqB,GAAG,aAAa,GAAG,YAAY;AACjZ;AACA;AACA;AACA,aAAa,mBAAO,CAAC,CAAS;AAC9B;AACA,oBAAoB,mBAAO,CAAC,EAAW;AACvC;AACA;AACA;AACA;AACA,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAc;AACnC,aAAa,mBAAO,CAAC,EAAS;AAC9B;AACA,aAAa,mBAAO,CAAC,EAAoB;AACzC,aAAa,mBAAO,CAAC,EAAyB;AAC9C,aAAa,mBAAO,CAAC,EAAoB;AACzC,aAAa,mBAAO,CAAC,EAAsB;AAC3C,aAAa,mBAAO,CAAC,EAAgB;AACrC,aAAa,mBAAO,CAAC,EAAyB;AAC9C,aAAa,mBAAO,CAAC,EAAsB;AAC3C,aAAa,mBAAO,CAAC,EAA0B;AAC/C,aAAa,mBAAO,CAAC,EAA8B;AACnD,aAAa,mBAAO,CAAC,EAA0B;AAC/C,aAAa,mBAAO,CAAC,EAA6B;AAClD,aAAa,mBAAO,CAAC,EAA4B;AACjD,aAAa,mBAAO,CAAC,EAA0B;AAC/C,aAAa,mBAAO,CAAC,EAA0B;AAC/C,aAAa,mBAAO,CAAC,EAA4B;AACjD,aAAa,mBAAO,CAAC,EAA+B;AACpD,aAAa,mBAAO,CAAC,EAAgC;AACrD;AACA,aAAa,mBAAO,CAAC,EAAsB;AAC3C,aAAa,mBAAO,CAAC,EAAa;AAClC;AACA,kBAAkB,mBAAO,CAAC,EAAa;AACvC,wCAAuC,CAAC,qCAAqC,yBAAyB,EAAE,EAAE,EAAC;AAC3G,yCAAwC,CAAC,qCAAqC,0BAA0B,EAAE,EAAE,EAAC;AAC7G,iDAAgD,CAAC,qCAAqC,kCAAkC,EAAE,EAAE,EAAC;AAC7H,6CAA4C,CAAC,qCAAqC,8BAA8B,EAAE,EAAE,EAAC;AACrH,6CAA4C,CAAC,qCAAqC,8BAA8B,EAAE,EAAE,EAAC;AACrH,uCAAsC,CAAC,qCAAqC,wBAAwB,EAAE,EAAE,EAAC;AACzG,yCAAwC,CAAC,qCAAqC,0BAA0B,EAAE,EAAE,EAAC;AAC7G,0CAAyC,CAAC,qCAAqC,2BAA2B,EAAE,EAAE,EAAC;AAC/G,uDAAsD,CAAC,qCAAqC,wCAAwC,EAAE,EAAE,EAAC;AACzI,wDAAuD,CAAC,qCAAqC,yCAAyC,EAAE,EAAE,EAAC;AAC3I,0DAAyD,CAAC,qCAAqC,2CAA2C,EAAE,EAAE,EAAC;AAC/I,+CAA8C,CAAC,qCAAqC,gCAAgC,EAAE,EAAE,EAAC;AACzH,iEAAgE,CAAC,qCAAqC,kDAAkD,EAAE,EAAE,EAAC;AAC7J,4DAA2D,CAAC,qCAAqC,6CAA6C,EAAE,EAAE,EAAC;AACnJ,aAAa,mBAAO,CAAC,EAAa;AAClC,wCAAuC,CAAC,qCAAqC,uBAAuB,EAAE,EAAE,EAAC;AACzG,aAAa,mBAAO,CAAC,EAAQ;AAC7B,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,iC;;;;;;;ACtEa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,CAAiB;AACtC,aAAa,mBAAO,CAAC,CAAiB;AACtC,aAAa,mBAAO,CAAC,CAAe;AACpC,aAAa,mBAAO,CAAC,CAAe;AACpC,aAAa,mBAAO,CAAC,CAAS;AAC9B,aAAa,mBAAO,CAAC,EAAc;AACnC,aAAa,mBAAO,CAAC,EAAoB;AACzC,aAAa,mBAAO,CAAC,EAAU;AAC/B,iC;;;;;;;ACpBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD,uBAAuB,KAAK;AAC7E,uC;;;;;;;ACxBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C,qBAAqB,KAAK;AACvE,sC;;;;;;;AChBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA,4C;;;;;;;ACHa;AACb;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACHwC;AACN;AACE;AACF;AACA;AACA;AACE;AACF;AACA;AACA;;;;;;;;;;;;;;;;;ACTlC;AACA;AACA;AACA;AACA;AACO;AACA;AACA;AACP;AACA;AACA;AACA,WAAW,2CAA2C;AACtD;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjDwC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA,gBAAgB;;AAEhB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AAC7S;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC/aiC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACvd;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACreiC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACttB;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzwBiC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY,+CAAgB;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA,YAAY,+CAAgB;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP,wBAAwB,kDAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;;AAExD;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,YAAY,KAAK;AACjB;;AAEO;AACP,oBAAoB,kDAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,+CAAgB,+BAA+B,+CAAgB,+BAA+B,+CAAgB;AAC/I;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,uEAAuE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB;AAC/zC;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrxDiC;AACN;AACA;AACA;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,OAAO;AACnB;;AAEO;AACP;AACA;;AAEA,UAAU,+CAAgB;AAC1B;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,aAAa;AACzB,YAAY,aAAa;AACzB,YAAY,OAAO;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;;AAE1C,gDAAgD;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH,oBAAoB,+CAAgB;AACpC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA,WAAW,8CAAe;AAC1B,WAAW,8CAAe;AAC1B,WAAW,8CAAe;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,mCAAmC;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAoC;;AAEpC;AACA,wBAAwB;;AAExB;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,EAAE;AACb,WAAW,EAAE;AACb,WAAW,EAAE;AACb,aAAa,KAAK;AAClB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,YAAY,2CAAU;AAC7B;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,iBAAiB,gDAAe;AACvC;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,WAAW,0CAAS;AAC3B;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,YAAY,2CAAU;AAC7B;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,WAAW,0CAAS;AAC3B;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO,aAAa,4CAAW;AAC/B;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;AACA;;AAEO,oBAAoB,mDAAkB;AAC7C;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,gBAAgB,+CAAc;AACrC;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO,kBAAkB,iDAAgB;AACzC;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO,aAAa,4CAAW;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,4CAAW;AAC3B,kBAAkB,gDAAe;AACjC,kBAAkB,gDAAe;AACjC;AACA,cAAc,yCAAQ;;AAEtB;AACA,MAAM,2CAAU;AAChB,UAAU,yCAAQ,sBAAsB,2CAAU;AAClD,MAAM,+CAAc;AACpB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,MAAM,2CAAU;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,aAAa,4CAAW;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrsBuC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,uBAAuB;AACvB;AACA;;AAEA;AACA;;AAEA;AACA,SAAS,8CAAe;AACxB,SAAS,8CAAe;AACxB;AACA,GAAG;;AAEH;AACA,SAAS,8CAAe;AACxB,SAAS,8CAAe;AACxB;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;;AAEhB;AACA;AACA;AACA,qCAAqC;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AAC7S;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtpBuC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,UAAU,8CAAe;AACzB,UAAU,8CAAe;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;;AAEA;AACA;AACA,4BAA4B;;AAE5B;AACA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA,YAAY;;AAEZ;AACA;AACA,YAAY;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACxN;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClxBuC;AACN;AACA;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;;AAEO;AACP,eAAe,kDAAmB;;AAElC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA,cAAc,4CAAW;AACzB,EAAE,iDAAgB;AAClB,cAAc,kDAAmB;AACjC,EAAE,oDAAmB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO,cAAc,0CAAS;AAC9B;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO,cAAc,0CAAS;AAC9B;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA,sBAAsB,+CAAgB;AACtC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,aAAa,4CAAW;AAC/B;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,oBAAoB,mDAAkB;AAC7C;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACjoB,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACl0BwC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,UAAU,8CAAe;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA,2BAA2B;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;;AAE5C;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB;AACnI;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;AC/mBY;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,qBAAqB,mBAAO,CAAC,EAAc;AAC3C,gBAAgB,mBAAO,CAAC,EAAS;AACjC,gBAAgB,mBAAO,CAAC,EAAgB;AACxC,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB;AACpC,eAAe,WAAW;AAC1B,eAAe,4BAA4B;AAC3C,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,qBAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACxVa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,eAAe,cAAc;AAC7B,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0EAA0E;AACzF,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sC;;;;;;;AClGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,gBAAgB,mBAAO,CAAC,EAAS;AACjC,qBAAqB,mBAAO,CAAC,EAAc;AAC3C,oBAAoB,mBAAO,CAAC,EAAoB;AAChD,gBAAgB,mBAAO,CAAC,EAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,SAAS;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACxTa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,oBAAoB,mBAAO,CAAC,EAAW;AACvC,gBAAgB,mBAAO,CAAC,CAAU;AAClC,aAAa,mBAAO,CAAC,EAA8B;AACnD,eAAe,mBAAO,CAAC,EAAc;AACrC,eAAe,mBAAO,CAAC,EAAS;AAChC,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,oBAAoB,mBAAO,CAAC,EAAc;AAC1C,qBAAqB,mBAAO,CAAC,EAAe;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,cAAc;AAC7B,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0EAA0E;AACzF,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,2CAA2C;AACrF,8CAA8C,2CAA2C;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,4BAA4B;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,SAAS;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;AACA,mEAAmE,SAAS;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,gCAAgC;AAClD,kBAAkB,gCAAgC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qC;;;;;;;ACzgBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc,GAAG,cAAc,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,iBAAiB;AAChI,oBAAoB,mBAAO,CAAC,EAAW;AACvC,iBAAiB;AACjB,gBAAgB;AAChB,iBAAiB;AACjB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,gD;;;;;;;AC5Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,gBAAgB;AAChB;AACA,6BAA6B,OAAO,OAAO,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,gC;;;;;;;ACpNa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,iC;;;;;;;AClCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,GAAG,gBAAgB,GAAG,kBAAkB;AACrD,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC,kBAAkB,KAAK;AAC9D;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6BAA6B;AAC5C,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,iC;;;;;;;ACrKa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB;AACA;AACA,gBAAgB;AAChB,oC;;;;;;;ACNa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gCAAgC,GAAG,mBAAmB,GAAG,qCAAqC,GAAG,8BAA8B,GAAG,4BAA4B,GAAG,2BAA2B,GAAG,cAAc,GAAG,aAAa,GAAG,qBAAqB,GAAG,aAAa,GAAG,YAAY,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,WAAW;AAC1U,qBAAqB,mBAAO,CAAC,EAAe;AAC5C,sBAAsB,mBAAO,CAAC,CAAqB;AACnD,eAAe,mBAAO,CAAC,EAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,mBAAmB,iBAAiB;AACpC,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,gBAAgB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA,4BAA4B,qBAAqB;AACjD;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,eAAe;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yBAAyB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC,qC;;;;;;ACxWA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA,qBAAqB;AACrB;AACA,wBAAwB;AACxB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,4BAA4B;AAC5B;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,kCAAkC;AAClC;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA,6BAA6B;AAC7B;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA,mCAAmC;AACnC,qBAAqB;AACrB;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,yBAAyB;AACzB,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,iBAAiB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,gDAAgD;AAChD;AACA;;AAEA;AACA,MAAM,IAA2C,EAAE,mCAAO,YAAY,qBAAqB;AAAA,kGAAC;AAC5F;AACA,MAAM,IAA8B,EAAE,oBAAoB;AAC1D;AACA,OAAO,EAAsE;AAC7E;AACA,MAAM,IAA6B;AACnC;AACA;;AAEA,CAAC;;;;;;;;ACxdY;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,gBAAgB,mBAAO,CAAC,EAAU;AAClC,qBAAqB,mBAAO,CAAC,EAAe;AAC5C,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc,aAAa;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA,4DAA4D,SAAS;AACrE,wCAAwC;AACxC;AACA;AACA;AACA,yCAAyC,4BAA4B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,aAAa;AAC5B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACnLa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,sBAAsB;AACtB,aAAa,mBAAO,CAAC,EAA8B;AACnD,oBAAoB,mBAAO,CAAC,EAAa;AACzC,mBAAmB,mBAAO,CAAC,EAAuB;AAClD,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB,aAAa;AACpD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,0C;;;;;;;ACjJa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,eAAe,mBAAO,CAAC,EAAS;AAChC,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,yBAAyB,mBAAO,CAAC,EAA0B;AAC3D,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB,aAAa;AAC/C,eAAe,QAAQ;AACvB;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB;AACA;AACA;AACA,iDAAiD,eAAe;AAChE,sDAAsD,QAAQ;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA,eAAe,6BAA6B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,kBAAkB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,eAAe,sBAAsB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,8CAA8C;AAC9E;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,qC;;;;;;;AChOa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB;AACnB,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,yBAAyB,mBAAO,CAAC,EAA0B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB,aAAa;AACjD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,gCAAgC,8CAA8C;AAC9E;AACA;AACA;AACA;AACA,mBAAmB;AACnB,uC;;;;;;;ACnIa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,sBAAsB;AACtB,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB,aAAa;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,qDAAqD;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,6BAA6B;AACpD;AACA;AACA;AACA;AACA,sCAAsC,+BAA+B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iIAAiI,6DAA6D;AAC9L;AACA;AACA;AACA;AACA,4BAA4B,uEAAuE;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,SAAS;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,4BAA4B,8DAA8D;AAC1F,iBAAiB;AACjB;AACA;AACA,mFAAmF,gCAAgC;AACnH,wCAAwC;AACxC;AACA;AACA;AACA;AACA,4BAA4B,8DAA8D;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,oEAAoE,4BAA4B,iBAAiB,EAAE;AACnH;AACA;AACA;AACA,+BAA+B,gBAAgB;AAC/C;AACA,2DAA2D,SAAS;AACpE;AACA,+FAA+F,gCAAgC;AAC/H,oDAAoD;AACpD;AACA;AACA;AACA;AACA,wCAAwC,wDAAwD;AAChG;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;AACA,qDAAqD,4BAA4B;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA,sBAAsB;AACtB,0C;;;;;;;AChUa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB;AACnB,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB,aAAa;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,uDAAuD;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,SAAS;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,mFAAmF,gCAAgC;AACnH,uEAAuE,iCAAiC,4BAA4B,iBAAiB,EAAE;AACvJ,kDAAkD,SAAS;AAC3D;AACA,2FAA2F,gCAAgC;AAC3H,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA,iDAAiD,4BAA4B;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA,mBAAmB;AACnB,uC;;;;;;;AC3Na;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,YAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,SAAS;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,gC;;;;;;;AC5Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA,oC;;;;;;;AC1Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,gC;;;;;;;AC3Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,mC;;;;;;;ACxCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACpCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ,gC;;;;;;;AClDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc,aAAa;AAC1C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ,gC;;;;;;;ACtEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe,aAAa;AAC3C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kC;;;;;;;AC5Fa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB,aAAa;AAC/C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,qC;;;;;;;ACtDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB;AAClB,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sC;;;;;;;AC9Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,gBAAgB,mBAAO,CAAC,EAAS;AACjC,iBAAiB,mBAAO,CAAC,EAAU;AACnC,iBAAiB,mBAAO,CAAC,EAAU;AACnC,mBAAmB,mBAAO,CAAC,EAAY;AACvC,oBAAoB,mBAAO,CAAC,EAAa;AACzC,gBAAgB,mBAAO,CAAC,EAAS;AACjC,iBAAiB,mBAAO,CAAC,EAAU;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,iC;;;;;;;ACpBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACtDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,oBAAoB,mBAAO,CAAC,EAAc;AAC1C,gBAAgB,mBAAO,CAAC,EAAS;AACjC,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,SAAS;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACvEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;AC3Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,oC;;;;;;;ACvHa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,WAAW;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,qC;;;;;;;ACxDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,wBAAwB,yBAAyB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACfa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAa;AAClC,aAAa,mBAAO,CAAC,EAAmB;AACxC,aAAa,mBAAO,CAAC,EAAsB;AAC3C,aAAa,mBAAO,CAAC,EAAW;AAChC,aAAa,mBAAO,CAAC,EAAa;AAClC,iC;;;;;;;AClBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,2BAA2B,GAAG,2BAA2B,GAAG,YAAY,GAAG,YAAY,GAAG,mBAAmB,GAAG,aAAa;AAC7H;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,mBAAmB;AAC9B,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,EAAE,GAAG,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,mBAAmB;AAC9B,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,mBAAmB,cAAc,GAAG,cAAc,GAAG,cAAc,GAAG,MAAM;AAC5E;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA,mBAAmB,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,MAAM;AAC1C;AACA,2BAA2B;AAC3B,qC;;;;;;;AC9Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uBAAuB;AACvB,6BAA6B,mBAAO,CAAC,EAAsB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8DAA8D;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2C;;;;;;;ACpGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,0BAA0B,GAAG,mCAAmC;AAChE,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,wBAAwB,mBAAO,CAAC,EAAe;AAC/C,kBAAkB,mBAAO,CAAC,EAAW;AACrC,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,8C;;;;;;;ACxGa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAe;AACpC,aAAa,mBAAO,CAAC,EAAW;AAChC,iC;;;;;;;ACfa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6DAA6D;AAC5E;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,uC;;;;;;;ACzFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB,GAAG,4BAA4B;AACjD,qBAAqB,mBAAO,CAAC,EAAc;AAC3C,sBAAsB,mBAAO,CAAC,EAAe;AAC7C;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,6BAA6B,IAAI;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,mC;;;;;;;AC1Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,sC;;;;;;AClJA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,uBAAuB,oCAAoC;AAC3D,uBAAuB,8BAA8B;AACrD,uBAAuB,kBAAkB;;AAEzC;AACA,oCAAoC,8DAA8D;;AAElG;AACA,kCAAkC,sEAAsE;;AAExG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;;AAEA;AACA;AACA;AACA;;AAEA,UAAU,mEAAmE;AAC7E;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe;AACf,mC;;;;;;;AChca;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,wBAAwB,GAAG,cAAc,GAAG,YAAY,GAAG,eAAe,GAAG,cAAc,GAAG,8BAA8B;AAC5H,4BAA4B,mBAAO,CAAC,EAAqB;AACzD,0BAA0B,mBAAO,CAAC,EAAmB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB,qC;;;;;;;ACpEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yBAAyB;AACzB,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,0BAA0B,mBAAO,CAAC,EAAmB;AACrD,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA,WAAW,wBAAwB;AACnC,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6C;;;;;;;ACxDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,2BAA2B;AAC3B,uBAAuB,mBAAO,CAAC,EAAiB;AAChD,gBAAgB,mBAAO,CAAC,EAAU;AAClC;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,+C;;;;;;;AChGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,oBAAoB;AACpB,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,oBAAoB,mBAAO,CAAC,EAAoC;AAChE,eAAe,mBAAO,CAAC,EAA+B;AACtD,eAAe,mBAAO,CAAC,EAAoC;AAC3D,iBAAiB,mBAAO,CAAC,EAAQ;AACjC,kBAAkB,mBAAO,CAAC,EAAW;AACrC,mBAAmB,mBAAO,CAAC,EAAY;AACvC,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6BAA6B;AAC5C,eAAe,wBAAwB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,2BAA2B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,0BAA0B;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qGAAqG,uCAAuC;AAC5I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,KAAK;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oGAAoG,OAAO;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,eAAe,QAAQ;AACvB,eAAe,qBAAqB;AACpC,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB,eAAe,OAAO;AACtB,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW;AAC7E,8BAA8B,SAAS,GAAG,SAAS,IAAI,SAAS,IAAI,WAAW;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,wC;;;;;;ACvXA;;AAEA,kBAAkB,mBAAO,CAAC,EAAkB;;AAE5C,iBAAiB;;AAEjB,oBAAoB;AACpB,0DAA0D,+BAA+B;AACzF;;AAEA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA;AACA;;AAEA,gCAAgC,WAAW;AAC3C,iCAAiC,WAAW;;AAE5C;AACA,GAAG;AACH;;;;;;;;AClCY;;AAEZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACrGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,6CAA6C;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,8CAA8C;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,6BAA6B;AAC5C;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,mC;;;;;;;AC3Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,oBAAoB,mBAAO,CAAC,EAAoC;AAChE,eAAe,mBAAO,CAAC,EAA+B;AACtD,kBAAkB,mBAAO,CAAC,EAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,2BAA2B,aAAa;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oC;;;;;;;ACxRa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,eAAe,GAAG,gBAAgB,GAAG,aAAa;AAChE,aAAa;AACb;AACA;AACA,gBAAgB;AAChB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,+BAA+B;AAC1C,YAAY,EAAE,IAAI,WAAW,WAAW,eAAe,gBAAgB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,iC;;;;;;;AClDa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAY;AACjC,aAAa,mBAAO,CAAC,EAAgB;AACrC,aAAa,mBAAO,CAAC,EAA+B;AACpD,aAAa,mBAAO,CAAC,EAAY;AACjC,iC;;;;;;;AChBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,iBAAiB,mBAAO,CAAC,EAAgB;AACzC,oBAAoB,mBAAO,CAAC,EAAoC;AAChE,cAAc,mBAAO,CAAC,EAAO;AAC7B,kBAAkB,mBAAO,CAAC,EAAW;AACrC,kBAAkB,mBAAO,CAAC,EAAW;AACrC,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,sCAAsC;AACnF;AACA;AACA;AACA,yCAAyC,gBAAgB;AACzD,oCAAoC,6BAA6B;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,mDAAmD,qBAAqB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,yCAAyC;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,yCAAyC;AACxF,2BAA2B,qBAAqB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,mFAAmF;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,gBAAgB;AAChB,oC;;;;;;ACnRA,mBAAO,CAAC,EAA6B;AACrC,qBAAqB,mBAAO,CAAC,EAAgB;AAC7C,OAAO,YAAY,GAAG,mBAAO,CAAC,EAAQ;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,wBAAwB;AACxB;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,KAAK;AACL,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;;AAEA;AACA;AACA,wCAAwC,WAAW;AACnD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA,2BAA2B;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,SAAS;AACT;AACA;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC,cAAc;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,kBAAkB;AACnD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA,iBAAiB;;AAEjB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,8CAA8C,QAAQ;AACtD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA,WAAW;AACX;AACA;AACA;;AAEA,WAAW;AACX;AACA;AACA;;AAEA,WAAW;AACX;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,8CAA8C,QAAQ;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA,KAAK;;AAEL;AACA,8CAA8C,QAAQ;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,8CAA8C,QAAQ;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,CAAC;AACD;AACA;AACA;AACA;AACA,EAAE,KAA0B,oBAAoB,CAAE;AAClD;;AAEA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;;;;;;ACjvBA,OAAO,2BAA2B,GAAG,mBAAO,CAAC,EAAU;AACvD,OAAO,mCAAmC,GAAG,mBAAO,CAAC,EAAa;AAClE,sBAAsB,mBAAO,CAAC,EAAuB;AACrD,kBAAkB,mBAAO,CAAC,EAAmB;AAC7C,OAAO,sCAAsC,GAAG,mBAAO,CAAC,EAAQ;AAChE,OAAO,UAAU,GAAG,mBAAO,CAAC,EAAiB;;AAE7C;;AAEA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,gBAAgB;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,yBAAyB;AACtE,0CAA0C,yBAAyB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,gBAAgB;AACvD;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,OAAO,GAAG,uDAAuD,WAAW,iCAAiC;AACvI;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA,+CAA+C,QAAQ;AACvD,SAAS;AACT,gDAAgD,QAAQ;AACxD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,kCAAkC,QAAQ;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AClNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,gBAAgB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;ACjDA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,gBAAgB,gBAAgB;AAChC;AACA,oBAAoB,KAAK,IAAI,QAAQ;AACrC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACvBA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB,qBAAqB;AACrC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,gBAAgB,iBAAiB;AACjC,KAAK;AACL,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;;;;;ACRA,uBAAuB,mBAAO,CAAC,EAAkB;AACjD,4BAA4B,mBAAO,CAAC,EAAuB;AAC3D,kBAAkB,mBAAO,CAAC,EAAa;;AAEvC;AACA;AACA;AACA;AACA;;;;;;;ACRA,mBAAmB,mBAAO,CAAC,EAAa;AACxC,OAAO,kBAAkB,GAAG,mBAAO,CAAC,EAAoB;;AAExD;AACA;AACA;AACA;AACA,YAAY,KAAsC;AAClD;AACA,MAAM,CAAoG;AAC1G;;;;;;;ACVA;AACA;;AAEA;AACA,MAAM,IAA0C;AAChD,IAAI,oCAAO,OAAO;AAAA;AAAA;AAAA;AAAA,kGAAC;AACnB,GAAG,MAAM,EAIN;AACH,CAAC;;AAED;AACA;;AAEA;AACA,iEAAiE;AACjE;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,CAAC;;;;;;;;;;;;;;AC9CD;AACA,mBAAmB,mBAAO,CAAC,EAAa;AACxC,OAAO,MAAM,GAAG,mBAAO,CAAC,EAAc;;AAEtC;AACA;AACA;AACA;AACA;AACA,uBAAuB,IAAI;AAC3B;AACA,iBAAiB,IAAI,eAAe,eAAe;AACnD,gCAAgC,iBAAiB;AACjD;AACA,iBAAiB,IAAI,cAAc,QAAQ;AAC3C;AACA;;AAEA,yBAAyB,sBAAsB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;AC7DA,mBAAmB,mBAAO,CAAC,EAAa;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,UAAU,SAAS,OAAO,EAAE,EAAE;AACzD,mDAAmD,KAAK;AACxD;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;;;;;;ACtCA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,aAAa,GAAG,IAAoD,oBAAoB,KAAK,EAA8K,CAAC,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,MAAM,SAAmC,CAAC,gBAAgB,OAAC,OAAO,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,iBAAiB,eAAe,sBAAsB,oBAAoB,UAAU,SAAmC,KAAK,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,0GAA0G,qBAAqB,0EAA0E,WAAW,+OAA+O,kBAAkB,sBAAsB,wBAAwB,2GAA2G,2DAA2D,yJAAyJ,sDAAsD,WAAW,kMAAkM,UAAU,EAAE,4BAA4B,qBAAqB,aAAa,4GAA4G,sBAAsB,uGAAuG,aAAa,4BAA4B,mIAAmI,6BAA6B,6GAA6G,IAAI,gCAAgC,yPAAyP,oCAAoC,6IAA6I,aAAa,EAAE,+FAA+F,qBAAqB,aAAa,kCAAkC,SAAS,wCAAwC,kCAAkC,6BAA6B,qCAAqC,wBAAwB,EAAE,wCAAwC,qBAAqB,aAAa,gCAAgC,mBAAmB,MAAM,KAAK,IAAI,YAAY,IAAI,iCAAiC,OAAO,SAAS,GAAG,wBAAwB,sEAAsE,cAAc,MAAM,YAAY,IAAI,4BAA4B,WAAW,iCAAiC,cAAc,MAAM,YAAY,IAAI,uCAAuC,WAAW,oBAAoB,EAAE,aAAa,qBAAqB,aAAa,yKAAyK,GAAG,qBAAqB,aAAa,MAAM,0DAA0D,WAAW,EAAE,OAAO,qBAAqB,aAAa,yLAAyL,gBAAgB,kGAAkG,oEAAoE,mGAAmG,8BAA8B,0FAA0F,gCAAgC,+CAA+C,oCAAoC,oCAAoC,yCAAyC,EAAE,WAAW,8BAA8B,QAAQ,mBAAmB,GAAG,8BAA8B,0BAA0B,+BAA+B,yBAAyB,GAAG,EAAE,iDAAiD,qBAAqB,aAAa,gBAAgB,WAAW,QAAQ,IAAI,yCAAyC,SAAS,wBAAwB,gTAAgT,6CAA6C,iGAAiG,QAAQ,+BAA+B,cAAc,wXAAwX,SAAS,iKAAiK,4HAA4H,sGAAsG,oBAAoB,iRAAiR,6CAA6C,mEAAmE,yGAAyG,kBAAkB,8DAA8D,GAAG,sCAAsC,wEAAwE,oCAAoC,MAAM,8EAA8E,WAAW,wBAAwB,WAAW,EAAE,wBAAwB,sCAAsC,mBAAmB,gHAAgH,kDAAkD,8FAA8F,aAAa,EAAE,oBAAoB,wBAAwB,WAAW,EAAE,0BAA0B,uCAAuC,sBAAsB,8BAA8B,gCAAgC,yBAAyB,eAAe,8BAA8B,aAAa,EAAE,iOAAiO,WAAW,aAAa,aAAa,EAAE,0CAA0C,2IAA2I,0CAA0C,sBAAsB,WAAW,+BAA+B,kBAAkB,wBAAwB,sFAAsF,2BAA2B,WAAW,OAAO,+BAA+B,4LAA4L,+BAA+B,oBAAoB,4CAA4C,YAAY,WAAW,QAAQ,cAAc,UAAU,SAAS,6BAA6B,4BAA4B,4BAA4B,WAAW,gBAAgB,aAAa,EAAE,uFAAuF,qBAAqB,aAAa,kDAAkD,iCAAiC,6DAA6D,IAAI,wBAAwB,IAAI,oBAAoB,kBAAkB,gEAAgE,SAAS,8FAA8F,kBAAkB,8CAA8C,4GAA4G,UAAU,mBAAmB,SAAS,WAAW,UAAU,EAAE,wCAAwC,sBAAsB,aAAa,aAAa,qCAAqC,sIAAsI,aAAa,sDAAsD,YAAY,6DAA6D,UAAU,kJAAkJ,6BAA6B,wCAAwC,EAAE,uEAAuE,sBAAsB,aAAa,uHAAuH,cAAc,mCAAmC,oDAAoD,yBAAyB,KAAK,sBAAsB,6FAA6F,WAAW,EAAE,wBAAwB,WAAW,uBAAuB,EAAE,8FAA8F,6MAA6M,eAAe,mBAAmB,mBAAmB,uCAAuC,4BAA4B,WAAW,oBAAoB,wBAAwB,mBAAmB,kCAAkC,WAAW,KAAK,WAAW,qCAAqC,+MAA+M,EAAE,uDAAuD,GAAG,EAAE,sGAAsG,sBAAsB,aAAa,mDAAmD,gBAAgB,6FAA6F,oDAAoD,WAAW,iDAAiD,QAAQ,aAAa,WAAW,EAAE,yBAAyB,4CAA4C,sBAAsB,uCAAuC,EAAE,8BAA8B,gEAAgE,+BAA+B,iGAAiG,aAAa,EAAE,2CAA2C,sBAAsB,aAAa,oCAAoC,kBAAkB,8BAA8B,WAAW,0BAA0B,qCAAqC,yBAAyB,kBAAkB,sBAAsB,aAAa,EAAE,yDAAyD,sBAAsB,aAAa,EAAE,mCAAmC,sBAAsB,aAAa,WAAW,8DAA8D,sEAAsE,kFAAkF,uBAAuB,yBAAyB,uCAAuC,oBAAoB,mBAAmB,sBAAsB,0BAA0B,sBAAsB,6FAA6F,GAAG,sBAAsB,aAAa,kBAAkB,uCAAuC,IAAI,yUAAyU,iDAAiD,yBAAyB,+BAA+B,wBAAwB,mDAAmD,6SAA6S,mBAAmB,gBAAgB,cAAc,oCAAoC,2PAA2P,gFAAgF,uBAAuB,iBAAiB,cAAc,4DAA4D,OAAO,gBAAgB,8FAA8F,qBAAqB,UAAU,4JAA4J,oBAAoB,SAAS,kCAAkC,kBAAkB,IAAI,sBAAsB,qEAAqE,SAAS,QAAQ,iCAAiC,wBAAwB,EAAE,8BAA8B,wBAAwB,oBAAoB,kBAAkB,yCAAyC,wBAAwB,EAAE,kDAAkD,uBAAuB,oBAAoB,cAAc,oBAAoB,mFAAmF,yCAAyC,oCAAoC,MAAM,WAAW,iCAAiC,YAAY,sBAAsB,8FAA8F,oCAAoC,WAAW,IAAI,oBAAoB,EAAE,sJAAsJ,uKAAuK,+KAA+K,kCAAkC,6BAA6B,SAAS,4BAA4B,4CAA4C,6BAA6B,oDAAoD,kCAAkC,cAAc,iFAAiF,YAAY,EAAE,gNAAgN,sBAAsB,sBAAsB,EAAE,cAAc,sBAAsB,aAAa,wBAAwB,cAAc,eAAe,YAAY,mBAAmB,kBAAkB,2DAA2D,8BAA8B,8CAA8C,gGAAgG,KAAK,uGAAuG,SAAS,+CAA+C,+FAA+F,8CAA8C,kCAAkC,sCAAsC,mEAAmE,uBAAuB,aAAa,EAAE,gCAAgC,sBAAsB,aAAa,oBAAoB,cAAc,0DAA0D,aAAa,wBAAwB,8BAA8B,wBAAwB,6IAA6I,sBAAsB,gCAAgC,kBAAkB,4BAA4B,qBAAqB,qBAAqB,UAAU,yCAAyC,cAAc,4BAA4B,uBAAuB,wBAAwB,gDAAgD,uBAAuB,mCAAmC,oCAAoC,qBAAqB,sBAAsB,8FAA8F,aAAa,EAAE,cAAc,sBAAsB,aAAa,8BAA8B,cAAc,eAAe,6DAA6D,oBAAoB,mEAAmE,uBAAuB,aAAa,EAAE,sCAAsC,sBAAsB,aAAa,wBAAwB,cAAc,eAAe,2DAA2D,yCAAyC,8CAA8C,0CAA0C,+CAA+C,4BAA4B,kCAAkC,oBAAoB,mEAAmE,uBAAuB,aAAa,EAAE,gCAAgC,sBAAsB,aAAa,yBAAyB,cAAc,eAAe,6DAA6D,sDAAsD,sEAAsE,uBAAuB,aAAa,EAAE,iCAAiC,sBAAsB,aAAa,qIAAqI,sBAAsB,qBAAqB,0KAA0K,EAAE,qHAAqH,sBAAsB,aAAa,+LAA+L,GAAG,sBAAsB,aAAa,2CAA2C,cAAc,mDAAmD,qDAAqD,WAAW,qDAAqD,EAAE,aAAa,EAAE,mCAAmC,sBAAsB,aAAa,2CAA2C,aAAa,yDAAyD,iEAAiE,sEAAsE,aAAa,EAAE,gDAAgD,sBAAsB,aAAa,2CAA2C,cAAc,+EAA+E,qDAAqD,MAAM,wCAAwC,+CAA+C,sCAAsC,aAAa,EAAE,mCAAmC,sBAAsB,aAAa,2CAA2C,cAAc,0BAA0B,WAAW,kHAAkH,oGAAoG,aAAa,WAAW,EAAE,+CAA+C,8CAA8C,+BAA+B,kJAAkJ,uCAAuC,qJAAqJ,8BAA8B,2CAA2C,iDAAiD,0CAA0C,kBAAkB,iDAAiD,MAAM,oDAAoD,MAAM,6DAA6D,+BAA+B,aAAa,4CAA4C,EAAE,aAAa,EAAE,mCAAmC,sBAAsB,aAAa,cAAc,yCAAyC,iDAAiD,uEAAuE,wBAAwB,oBAAoB,aAAa,iBAAiB,oBAAoB,gBAAgB,4BAA4B,aAAa,IAAI,mDAAmD,SAAS,qBAAqB,SAAS,mBAAmB,gKAAgK,kBAAkB,uCAAuC,oBAAoB,iFAAiF,oBAAoB,kCAAkC,4BAA4B,uCAAuC,kBAAkB,gCAAgC,8BAA8B,iFAAiF,oEAAoE,WAAW,+BAA+B,kBAAkB,wBAAwB,QAAQ,2BAA2B,WAAW,OAAO,kBAAkB,mGAAmG,mBAAmB,4CAA4C,uBAAuB,4GAA4G,mBAAmB,0BAA0B,aAAa,8BAA8B,6DAA6D,4BAA4B,uHAAuH,iBAAiB,iFAAiF,qDAAqD,qBAAqB,0BAA0B,+CAA+C,aAAa,GAAG,sBAAsB,aAAa,+HAA+H,oBAAoB,2CAA2C,UAAU,kBAAkB,QAAQ,UAAU,4CAA4C,MAAM,wBAAwB,IAAI,kHAAkH,SAAS,mDAAmD,aAAa,uBAAuB,8CAA8C,yDAAyD,0BAA0B,kBAAkB,yBAAyB,UAAU,sBAAsB,IAAI,sBAAsB,UAAU,8DAA8D,gCAAgC,mCAAmC,iBAAiB,qBAAqB,QAAQ,WAAW,mBAAmB,UAAU,+BAA+B,sDAAsD,6CAA6C,WAAW,iCAAiC,SAAS,yCAAyC,8DAA8D,SAAS,KAAK,SAAS,KAAK,KAAK,WAAW,EAAE,QAAQ,kBAAkB,WAAW,+CAA+C,wBAAwB,+BAA+B,uBAAuB,OAAO,mBAAmB,yDAAyD,kBAAkB,iCAAiC,4BAA4B,qIAAqI,mBAAmB,2CAA2C,KAAK,aAAa,EAAE,+IAA+I,sBAAsB,aAAa,kPAAkP,KAAK,yBAAyB,IAAI,yBAAyB,uBAAuB,OAAO,SAAS,IAAI,6FAA6F,yDAAyD,SAAS,YAAY,IAAI,6CAA6C,SAAS,iBAAiB,EAAE,qBAAqB,sBAAsB,aAAa,gHAAgH,MAAM,wDAAwD,aAAa,+CAA+C,aAAa,4BAA4B,yCAAyC,2DAA2D,6BAA6B,QAAQ,IAAI,2JAA2J,wDAAwD,IAAI,6QAA6Q,SAAS,IAAI,0BAA0B,gFAAgF,wCAAwC,UAAU,IAAI,4BAA4B,uCAAuC,KAAK,2BAA2B,SAAS,sBAAsB,yFAAyF,sFAAsF,uDAAuD,sDAAsD,8DAA8D,wCAAwC,iBAAiB,QAAQ,qGAAqG,+BAA+B,mBAAmB,oBAAoB,MAAM,iDAAiD,sBAAsB,KAAK,qCAAqC,QAAQ,oJAAoJ,iCAAiC,EAAE,8BAA8B,iDAAiD,yCAAyC,sBAAsB,2EAA2E,WAAW,sCAAsC,EAAE,sBAAsB,EAAE,2EAA2E,sBAAsB,aAAa,sGAAsG,cAAc,SAAS,gBAAgB,YAAY,WAAW,6BAA6B,SAAS,wBAAwB,uBAAuB,IAAI,qBAAqB,OAAO,EAAE,SAAS,IAAI,6FAA6F,gCAAgC,SAAS,sDAAsD,OAAO,iCAAiC,wBAAwB,iDAAiD,KAAK,IAAI,6KAA6K,kBAAkB,6BAA6B,iBAAiB,WAAW,iCAAiC,SAAS,iBAAiB,sBAAsB,IAAI,kFAAkF,SAAS,UAAU,yBAAyB,IAAI,iFAAiF,SAAS,UAAU,KAAK,cAAc,kCAAkC,2GAA2G,IAAI,KAAK,iCAAiC,SAAS,kBAAkB,4BAA4B,gBAAgB,YAAY,WAAW,cAAc,SAAS,sBAAsB,SAAS,UAAU,2BAA2B,gCAAgC,yBAAyB,qCAAqC,wBAAwB,qCAAqC,wBAAwB,qCAAqC,UAAU,yCAAyC,gCAAgC,wBAAwB,yBAAyB,wBAAwB,2BAA2B,gBAAgB,mBAAmB,4BAA4B,mBAAmB,oDAAoD,sCAAsC,yBAAyB,wBAAwB,2CAA2C,eAAe,2BAA2B,gCAAgC,yBAAyB,gBAAgB,qCAAqC,2BAA2B,eAAe,2BAA2B,gCAAgC,yBAAyB,yCAAyC,wBAAwB,qCAAqC,cAAc,6BAA6B,uBAAuB,kBAAkB,qBAAqB,kBAAkB,yBAAyB,wPAAwP,4BAA4B,+EAA+E,qEAAqE,aAAa,QAAQ,iBAAiB,0EAA0E,SAAS,yBAAyB,aAAa,uBAAuB,EAAE,0BAA0B,cAAc,0CAA0C,qBAAqB,aAAa,QAAQ,mBAAmB,gGAAgG,SAAS,sCAAsC,6CAA6C,kLAAkL,qBAAqB,qBAAqB,mBAAmB,uBAAuB,kBAAkB,wBAAwB,IAAI,mBAAmB,uBAAuB,sTAAsT,GAAG,EAAE,sFAAsF,sBAAsB,aAAa,iHAAiH,cAAc,iCAAiC,aAAa,2BAA2B,0CAA0C,qBAAqB,gCAAgC,2GAA2G,2BAA2B,wBAAwB,wBAAwB,oCAAoC,iCAAiC,kCAAkC,sUAAsU,2GAA2G,mDAAmD,uCAAuC,2XAA2X,8CAA8C,IAAI,0GAA0G,uBAAuB,8CAA8C,2OAA2O,2BAA2B,QAAQ,QAAQ,oBAAoB,yKAAyK,2BAA2B,MAAM,gDAAgD,yDAAyD,WAAW,iBAAiB,oEAAoE,6NAA6N,6BAA6B,gEAAgE,0QAA0Q,wBAAwB,QAAQ,gWAAgW,mLAAmL,ybAAyb,mJAAmJ,gDAAgD,qDAAqD,UAAU,uEAAuE,6EAA6E,2BAA2B,iBAAiB,kBAAkB,2FAA2F,aAAa,EAAE,iGAAiG,sBAAsB,aAAa,2IAA2I,gBAAgB,kCAAkC,aAAa,uBAAuB,2BAA2B,oBAAoB,iCAAiC,2BAA2B,QAAQ,iUAAiU,yBAAyB,kEAAkE,YAAY,+KAA+K,gHAAgH,6BAA6B,8NAA8N,mBAAmB,ySAAyS,mHAAmH,8BAA8B,mDAAmD,4BAA4B,oOAAoO,kCAAkC,wBAAwB,mCAAmC,iUAAiU,6BAA6B,2CAA2C,0CAA0C,EAAE,YAAY,oEAAoE,uBAAuB,cAAc,uBAAuB,wCAAwC,kHAAkH,KAAK,uCAAuC,+BAA+B,KAAK,qCAAqC,oDAAoD,0CAA0C,kCAAkC,KAAK,wCAAwC,yDAAyD,sCAAsC,8BAA8B,MAAM,iBAAiB,uGAAuG,YAAY,yCAAyC,8BAA8B,MAAM,iBAAiB,0GAA0G,aAAa,aAAa,EAAE,sHAAsH,sBAAsB,aAAa,kBAAkB,oMAAoM,mEAAmE,kIAAkI,aAAa,2BAA2B,sBAAsB,IAAI,mDAAmD,iDAAiD,wEAAwE,wBAAwB,oFAAoF,SAAS,4BAA4B,qBAAqB,qBAAqB,4CAA4C,0BAA0B,8DAA8D,+BAA+B,2GAA2G,+BAA+B,sFAAsF,8BAA8B,oHAAoH,2FAA2F,8FAA8F,KAAK,WAAW,wBAAwB,YAAY,EAAE,mHAAmH,sBAAsB,aAAa,aAAa,uDAAuD,MAAM,mDAAmD,aAAa,iBAAiB,eAAe,gBAAgB,yIAAyI,yCAAyC,gCAAgC,iEAAiE,2CAA2C,YAAY,iBAAiB,KAAK,2BAA2B,iCAAiC,wBAAwB,SAAS,aAAa,QAAQ,KAAK,mBAAmB,EAAE,EAAE,kBAAkB,MAAM,QAAQ,WAAW,KAAK,sBAAsB,uBAAuB,2FAA2F,EAAE,GAAG,sBAAsB,aAAa,qBAAqB,cAAc,QAAQ,8CAA8C,cAAc,2EAA2E,gEAAgE,kBAAkB,wLAAwL,kBAAkB,aAAa,MAAM,IAAI,OAAO,SAAS,qBAAqB,qFAAqF,EAAE,cAAc,gBAAgB,yFAAyF,sBAAsB,gBAAgB,SAAS,cAAc,wBAAwB,cAAc,yBAAyB,mBAAmB,OAAO,EAAE,+BAA+B,gBAAgB,SAAS,IAAI,gCAAgC,SAAS,2BAA2B,SAAS,4CAA4C,oCAAoC,uBAAuB,6BAA6B,sCAAsC,SAAS,EAAE,aAAa,sCAAsC,QAAQ,EAAE,EAAE,+BAA+B,yBAAyB,gCAAgC,0FAA0F,8BAA8B,2FAA2F,uCAAuC,0BAA0B,4CAA4C,mCAAmC,sCAAsC,yBAAyB,2CAA2C,kCAAkC,yBAAyB,aAAa,iDAAiD,cAAc,YAAY,KAAK,sBAAsB,8BAA8B,MAAM,6BAA6B,SAAS,wBAAwB,sBAAsB,8BAA8B,MAAM,4BAA4B,SAAS,uBAAuB,oDAAoD,sBAAsB,kBAAkB,qBAAqB,mBAAmB,WAAW,8GAA8G,oBAAoB,8BAA8B,8CAA8C,MAAM,WAAW,SAAS,gBAAgB,8BAA8B,yCAAyC,aAAa,wBAAwB,GAAG,oBAAoB,8GAA8G,oBAAoB,8BAA8B,6BAA6B,MAAM,yCAAyC,yBAAyB,aAAa,wBAAwB,EAAE,UAAU,EAAE,aAAa,sBAAsB,aAAa,SAAS,kHAAkH,EAAE,wFAAwF,sBAAsB,aAAa,iKAAiK,cAAc,wCAAwC,uBAAuB,2EAA2E,MAAM,EAAE,mBAAmB,uMAAuM,oFAAoF,+BAA+B,kEAAkE,MAAM,wNAAwN,mBAAmB,gBAAgB,eAAe,4CAA4C,gBAAgB,+BAA+B,6CAA6C,uBAAuB,+KAA+K,GAAG,4IAA4I,2LAA2L,8CAA8C,mHAAmH,gCAAgC,oBAAoB,+BAA+B,+JAA+J,oDAAoD,cAAc,gBAAgB,sBAAsB,cAAc,kBAAkB,EAAE,sGAAsG,sBAAsB,aAAa,+LAA+L,cAAc,wCAAwC,uBAAuB,mCAAmC,MAAM,EAAE,mBAAmB,yVAAyV,6CAA6C,oCAAoC,4DAA4D,gBAAgB,eAAe,4CAA4C,gBAAgB,+BAA+B,oFAAoF,uBAAuB,sMAAsM,GAAG,8WAA8W,+XAA+X,2DAA2D,sLAAsL,gCAAgC,oBAAoB,+BAA+B,oKAAoK,oDAAoD,cAAc,gBAAgB,YAAY,EAAE,iJAAiJ,sBAAsB,aAAa,sGAAsG,qBAAqB,kDAAkD,SAAS,EAAE,gBAAgB,MAAM,kEAAkE,iDAAiD,SAAS,2BAA2B,iEAAiE,OAAO,6BAA6B,qDAAqD,iBAAiB,IAAI,kBAAkB,2BAA2B,gBAAgB,qBAAqB,IAAI,mBAAmB,yCAAyC,IAAI,kCAAkC,UAAU,IAAI,6BAA6B,YAAY,IAAI,kBAAkB,2BAA2B,8BAA8B,uBAAuB,oIAAoI,eAAe,GAAG,sBAAsB,aAAa,8BAA8B,IAAI,oCAAoC,SAAS,KAAK,IAAI,kDAAkD,SAAS,KAAK,8BAA8B,MAAM,wDAAwD,gBAAgB,oGAAoG,iBAAiB,IAAI,iCAAiC,SAAS,yCAAyC,6BAA6B,QAAQ,IAAI,2JAA2J,0BAA0B,IAAI,6QAA6Q,SAAS,6BAA6B,qBAAqB,6BAA6B,8CAA8C,IAAI,yBAAyB,SAAS,4BAA4B,2CAA2C,UAAU,IAAI,4BAA4B,uCAAuC,KAAK,2BAA2B,SAAS,sBAAsB,yFAAyF,cAAc,4BAA4B,MAAM,iDAAiD,sBAAsB,KAAK,sCAAsC,EAAE,cAAc,sBAAsB,aAAa,4BAA4B,yCAAyC,MAAM,EAAE,qBAAqB,yBAAyB,EAAE,kBAAkB,kBAAkB,GAAG,sBAAsB,aAAa,WAAW,+XAA+X,GAAG,sBAAsB,aAAa,iBAAiB,mBAAmB,MAAM,KAAK,IAAI,YAAY,IAAI,iCAAiC,OAAO,SAAS,GAAG,4BAA4B,cAAc,MAAM,YAAY,IAAI,4BAA4B,YAAY,GAAG,sBAAsB,aAAa,6KAA6K,gBAAgB,oBAAoB,cAAc,uBAAuB,cAAc,mBAAmB,OAAO,QAAQ,cAAc,0BAA0B,iNAAiN,gBAAgB,qHAAqH,gBAAgB,6BAA6B,gBAAgB,sEAAsE,gBAAgB,6LAA6L,oEAAoE,GAAG,+DAA+D,SAAS,IAAI,mJAAmJ,wBAAwB,kCAAkC,sBAAsB,4BAA4B,oCAAoC,cAAc,mCAAmC,GAAG,+DAA+D,wGAAwG,uCAAuC,EAAE,UAAU,uCAAuC,EAAE,KAAK,6BAA6B,sZAAsZ,sKAAsK,GAAG,0CAA0C,gBAAgB,aAAa,EAAE,kBAAkB,sCAAsC,yBAAyB,8XAA8X,qBAAqB,+KAA+K,EAAE,aAAa,iJAAiJ,wEAAwE,8CAA8C,sIAAsI,gBAAgB,eAAe,EAAE,kBAAkB,sCAAsC,yBAAyB,yeAAye,wIAAwI,oLAAoL,EAAE,kGAAkG,2BAA2B,iHAAiH,oDAAoD,yNAAyN,sBAAsB,mFAAmF,aAAa,8nCAA8nC,cAAc,MAAM,6MAA6M,cAAc,aAAa,yUAAyU,wBAAwB,eAAe,QAAQ,+GAA+G,aAAa,YAAY,ueAAue,+BAA+B,YAAY,sDAAsD,EAAE,mBAAmB,wCAAwC,yBAAyB,sCAAsC,sBAAsB,kHAAkH,iFAAiF,oHAAoH,0NAA0N,uBAAuB,yFAAyF,4DAA4D,yBAAyB,YAAY,4CAA4C,yGAAyG,mrBAAmrB,KAAK,2BAA2B,qLAAqL,oCAAoC,gBAAgB,0MAA0M,gDAAgD,0IAA0I,iBAAiB,mCAAmC,YAAY,GAAG,mKAAmK,IAAI,MAAM,oFAAoF,aAAa,8GAA8G,iBAAiB,sCAAsC,YAAY,GAAG,mKAAmK,IAAI,MAAM,0FAA0F,aAAa,mGAAmG,kBAAkB,iMAAiM,iDAAiD,yDAAyD,iDAAiD,2DAA2D,mCAAmC,WAAW,EAAE,4CAA4C,kBAAkB,MAAM,kIAAkI,0GAA0G,mCAAmC,4BAA4B,EAAE,mBAAmB,uCAAuC,yBAAyB,0GAA0G,eAAe,IAAI,2GAA2G,gFAAgF,mPAAmP,0GAA0G,2BAA2B,yFAAyF,mMAAmM,6SAA6S,0BAA0B,MAAM,kIAAkI,sCAAsC,+BAA+B,yBAAyB,uEAAuE,gRAAgR,eAAe,EAAE,qCAAqC,yHAAyH,EAAE,kCAAkC,8LAA8L,oDAAoD,EAAE,8EAA8E,sBAAsB,aAAa,qBAAqB,wIAAwI,GAAG,sBAAsB,aAAa,wBAAwB,sDAAsD,yPAAyP,KAAK,qDAAqD,QAAQ,EAAE,uDAAuD,KAAK,YAAY,cAAc,4BAA4B,WAAW,SAAS,UAAU,QAAQ,8CAA8C,QAAQ,6HAA6H,QAAQ,EAAE,4CAA4C,cAAc,4BAA4B,WAAW,wCAAwC,QAAQ,wFAAwF,gDAAgD,QAAQ,0BAA0B,sBAAsB,gDAAgD,QAAQ,kBAAkB,eAAe,SAAS,kBAAkB,EAAE,WAAW,aAAa,sBAAsB,SAAS,kBAAkB,EAAE,YAAY,WAAW,kBAAkB,EAAE,YAAY,oBAAoB,SAAS,kBAAkB,EAAE,UAAU,KAAK,IAAI,gDAAgD,wCAAwC,KAAK,UAAU,mDAAmD,EAAE,wCAAwC,OAAO,OAAO,gBAAgB,yIAAyI,GAAG,sBAAsB,aAAa,+HAA+H,cAAc,8DAA8D,aAAa,+fAA+f,cAAc,MAAM,0QAA0Q,cAAc,MAAM,mEAAmE,gBAAgB,QAAQ,mKAAmK,gBAAgB,QAAQ,8EAA8E,aAAa,cAAc,MAAM,MAAM,6CAA6C,MAAM,eAAe,KAAK,MAAM,eAAe,KAAK,MAAM,eAAe,KAAK,MAAM,eAAe,iCAAiC,OAAO,MAAM,KAAK,eAAe,4BAA4B,OAAO,OAAO,kDAAkD,oBAAoB,gBAAgB,kYAAkY,kFAAkF,eAAe,0CAA0C,2HAA2H,8DAA8D,0IAA0I,QAAQ,gBAAgB,sBAAsB,UAAU,MAAM,KAAK,KAAK,EAAE,iBAAiB,sBAAsB,wBAAwB,0EAA0E,MAAM,6EAA6E,yCAAyC,MAAM,cAAc,6CAA6C,MAAM,gDAAgD,mBAAmB,sCAAsC,MAAM,uDAAuD,MAAM,YAAY,KAAK,EAAE,iBAAiB,sBAAsB,+BAA+B,6CAA6C,MAAM,kBAAkB,2CAA2C,MAAM,8GAA8G,YAAY,KAAK,EAAE,iBAAiB,sBAAsB,yIAAyI,YAAY,KAAK,EAAE,iBAAiB,sBAAsB,8HAA8H,wBAAwB,KAAK,KAAK,EAAE,iBAAiB,sBAAsB,gHAAgH,iCAAiC,SAAS,oQAAoQ,oBAAoB,wBAAwB,iBAAiB,QAAQ,mFAAmF,EAAE,+DAA+D,gCAAgC,oBAAoB,wBAAwB,iBAAiB,QAAQ,sFAAsF,EAAE,+DAA+D,mCAAmC,SAAS,uBAAuB,KAAK,KAAK,EAAE,iBAAiB,sBAAsB,wBAAwB,sCAAsC,MAAM,MAAM,8EAA8E,MAAM,aAAa,KAAK,EAAE,iBAAiB,sBAAsB,qCAAqC,yGAAyG,4BAA4B,gCAAgC,mBAAmB,0BAA0B,MAAM,KAAK,IAAI,EAAE,iBAAiB,sBAAsB,mCAAmC,iBAAiB,MAAM,qCAAqC,YAAY,QAAQ,iBAAiB,MAAM,4CAA4C,YAAY,MAAM,4BAA4B,KAAK,EAAE,iBAAiB,sBAAsB,8BAA8B,+CAA+C,MAAM,kDAAkD,kBAAkB,uBAAuB,uCAAuC,sDAAsD,MAAM,UAAU,MAAM,aAAa,KAAK,EAAE,iBAAiB,sBAAsB,mHAAmH,sDAAsD,MAAM,mBAAmB,aAAa,eAAe,EAAE,KAAK,IAAI,EAAE,iBAAiB,sBAAsB,oCAAoC,KAAK,UAAU,uBAAuB,qCAAqC,eAAe,6DAA6D,2CAA2C,MAAM,mBAAmB,aAAa,sBAAsB,EAAE,KAAK,wEAAwE,EAAE,iBAAiB,sBAAsB,uCAAuC,KAAK,WAAW,UAAU,IAAI,EAAE,iBAAiB,sBAAsB,2BAA2B,4CAA4C,MAAM,yCAAyC,gBAAgB,UAAU,IAAI,EAAE,iBAAiB,sBAAsB,sCAAsC,KAAK,UAAU,IAAI,EAAE,iBAAiB,sBAAsB,yCAAyC,4BAA4B,4CAA4C,MAAM,KAAK,IAAI,qBAAqB,qBAAqB,oBAAoB,uDAAuD,MAAM,kBAAkB,eAAe,iEAAiE,8CAA8C,MAAM,wCAAwC,gBAAgB,yEAAyE,wCAAwC,MAAM,2BAA2B,kBAAkB,yBAAyB,iMAAiM,MAAM,aAAa,wEAAwE,EAAE,iBAAiB,sBAAsB,kBAAkB,gBAAgB,6EAA6E,EAAE,iBAAiB,sBAAsB,sBAAsB,2CAA2C,UAAU,MAAM,SAAS,oBAAoB,MAAM,SAAS,8CAA8C,MAAM,uBAAuB,oBAAoB,cAAc,IAAI,EAAE,iBAAiB,sBAAsB,mEAAmE,yBAAyB,aAAa,0EAA0E,EAAE,iBAAiB,sBAAsB,eAAe,gBAAgB,8EAA8E,EAAE,iBAAiB,sBAAsB,sBAAsB,+BAA+B,wCAAwC,MAAM,kCAAkC,oBAAoB,cAAc,IAAI,EAAE,iBAAiB,sBAAsB,mEAAmE,oBAAoB,gDAAgD,MAAM,UAAU,yBAAyB,qBAAqB,mCAAmC,gDAAgD,MAAM,iFAAiF,iCAAiC,gCAAgC,kBAAkB,EAAE,0BAA0B,MAAM,yBAAyB,8BAA8B,MAAM,mBAAmB,KAAK,KAAK,EAAE,iBAAiB,sBAAsB,qIAAqI,uCAAuC,MAAM,MAAM,UAAU,4BAA4B,KAAK,KAAK,EAAE,iBAAiB,sBAAsB,6BAA6B,yCAAyC,MAAM,MAAM,UAAU,YAAY,QAAQ,aAAa,QAAQ,iBAAiB,yBAAyB,8dAA8d,0BAA0B,yBAAyB,cAAc,gDAAgD,kCAAkC,MAAM,qEAAqE,sCAAsC,iBAAiB,wIAAwI,oDAAoD,EAAE,gFAAgF,sBAAsB,aAAa,sbAAsb,oCAAoC,iIAAiI,QAAQ,MAAM,WAAW,QAAQ,IAAI,gBAAgB,aAAa,eAAe,KAAK,sEAAsE,QAAQ,cAAc,KAAK,qBAAqB,MAAM,kCAAkC,gCAAgC,eAAe,KAAK,qBAAqB,QAAQ,IAAI,mCAAmC,+IAA+I,MAAM,EAAE,wFAAwF,yCAAyC,EAAE,aAAa,IAAI,OAAO,0CAA0C,eAAe,YAAY,mBAAmB,mCAAmC,yBAAyB,WAAW,+CAA+C,4BAA4B,oDAAoD,EAAE,qBAAqB,sBAAsB,aAAa,WAAW,4KAA4K,GAAG,sBAAsB,aAAa,2BAA2B,cAAc,mBAAmB,OAAO,QAAQ,kQAAkQ,KAAK,oBAAoB,KAAK,qBAAqB,KAAK,qBAAqB,KAAK,oBAAoB,KAAK,0BAA0B,sBAAsB,iHAAiH,gBAAgB,iDAAiD,cAAc,iCAAiC,gBAAgB,sEAAsE,kBAAkB,oJAAoJ,kBAAkB,qBAAqB,gBAAgB,YAAY,0BAA0B,EAAE,aAAa,kBAAkB,6BAA6B,QAAQ,KAAK,uBAAuB,QAAQ,KAAK,KAAK,eAAe,6BAA6B,cAAc,MAAM,QAAQ,MAAM,uBAAuB,QAAQ,KAAK,uBAAuB,QAAQ,KAAK,qBAAqB,mEAAmE,cAAc,uGAAuG,oBAAoB,gBAAgB,0CAA0C,kBAAkB,2BAA2B,iGAAiG,+BAA+B,YAAY,kBAAkB,gBAAgB,uBAAuB,0NAA0N,EAAE,WAAW,gBAAgB,kGAAkG,oCAAoC,IAAI,kEAAkE,KAAK,aAAa,gGAAgG,iCAAiC,KAAK,aAAa,QAAQ,wPAAwP,EAAE,6CAA6C,2KAA2K,QAAQ,KAAK,oBAAoB,+CAA+C,MAAM,wKAAwK,UAAU,GAAG,UAAU,kBAAkB,KAAK,wDAAwD,WAAW,QAAQ,MAAM,wBAAwB,MAAM,qFAAqF,wBAAwB,kBAAkB,gCAAgC,8CAA8C,KAAK,mMAAmM,kBAAkB,gCAAgC,2BAA2B,KAAK,2CAA2C,YAAY,wBAAwB,EAAE,6IAA6I,iDAAiD,KAAK,SAAS,oBAAoB,UAAU,6GAA6G,uBAAuB,eAAe,+BAA+B,UAAU,KAAK,mBAAmB,UAAU,aAAa,mBAAmB,KAAK,mBAAmB,UAAU,aAAa,UAAU,KAAK,sBAAsB,YAAY,iBAAiB,QAAQ,KAAK,WAAW,QAAQ,OAAO,uBAAuB,KAAK,OAAO,uBAAuB,KAAK,OAAO,uBAAuB,KAAK,OAAO,uBAAuB,mBAAmB,KAAK,6BAA6B,0EAA0E,+HAA+H,0DAA0D,YAAY,+DAA+D,mBAAmB,QAAQ,MAAM,iDAAiD,0EAA0E,SAAS,MAAM,qCAAqC,SAAS,+CAA+C,MAAM,8FAA8F,8BAA8B,KAAK,kCAAkC,oLAAoL,MAAM,2CAA2C,IAAI,+BAA+B,0CAA0C,2FAA2F,6BAA6B,kRAAkR,yBAAyB,MAAM,qKAAqK,EAAE,qBAAqB,sBAAsB,aAAa,qBAAqB,6LAA6L,GAAG,sBAAsB,aAAa,kEAAkE,gCAAgC,0CAA0C,GAAG,EAAE,GAAG,WAAW,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,gCAAgC,qBAAM,CAAC,qBAAM,mEAAmE,EAAE,GAAG,EAAE,GAAG,SAAS,E;;;;;;;ACZt1xG;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAa;AAClC,aAAa,mBAAO,CAAC,EAAiB;AACtC,aAAa,mBAAO,CAAC,EAAa;AAClC,aAAa,mBAAO,CAAC,EAAuB;AAC5C,8BAA8B,mBAAO,CAAC,EAAuB;AAC7D,eAAe;AACf,iC;;;;;;;AClBa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,qBAAqB;AACrB,aAAa,mBAAO,CAAC,EAAS;AAC9B,wBAAwB,mBAAO,CAAC,EAAiB;AACjD,iDAAgD,CAAC,qCAAqC,sCAAsC,EAAE,EAAE,EAAC;AACjI;AACA;AACA;AACA,iC;;;;;;;ACnBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,qBAAqB;AACrB,eAAe,mBAAO,CAAC,EAAiB;AACxC,sBAAsB,mBAAO,CAAC,GAAa;AAC3C,oBAAoB,mBAAO,CAAC,GAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,IAAI;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,+BAA+B,IAAI,+BAA+B;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,+BAA+B,IAAI,+BAA+B;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,+BAA+B,IAAI,+BAA+B,IAAI,SAAS;AACpG,qBAAqB,+BAA+B,IAAI,+BAA+B;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA,6EAA6E,0BAA0B;AACvG;AACA;AACA;AACA;AACA;AACA,8DAA8D,SAAS;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD,yBAAyB,iCAAiC;AAC1D;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yC;;;;;;ACrMA;AACA,eAAe,KAAiD,oBAAoB,CAAiH,CAAC,oBAAoB,YAAY,OAAO,cAAc,aAAa,sCAAsC,SAAS,iBAAiB,yCAAyC,6BAA6B,gBAAgB,EAAE,0FAA0F,oBAAoB,gBAAgB,WAAW,sBAAsB,uBAAuB,IAAI,iCAAiC,SAAS,kBAAkB,sBAAsB,uBAAuB,IAAI,wCAAwC,SAAS,UAAU,uBAAuB,IAAI,KAAK,4BAA4B,qCAAqC,0CAA0C,kMAAkM,oBAAoB,eAAe,0HAA0H,cAAc,qBAAqB,QAAQ,0CAA0C,2BAA2B,uBAAuB,IAAI,KAAK,qBAAqB,qBAAqB,YAAY,OAAO,0DAA0D,UAAU,iCAAiC,kCAAkC,8BAA8B,SAAS,gBAAgB,mCAAmC,IAAI,oFAAoF,mBAAmB,gEAAgE,cAAc,gCAAgC,2BAA2B,oDAAoD,mCAAmC,IAAI,yJAAyJ,uCAAuC,SAAS,uBAAuB,kEAAkE,gDAAgD,4CAA4C,aAAa,8HAA8H,mBAAmB,0EAA0E,mBAAmB,2EAA2E,YAAY,wGAAwG,QAAQ,4BAA4B,cAAc,2BAA2B,IAAI,mCAAmC,SAAS,gCAAgC,mBAAmB,6EAA6E,4BAA4B,UAAU,yCAAyC,UAAU,eAAe,aAAa,sCAAsC,SAAS,iBAAiB,yCAAyC,QAAQ,gBAAgB,EAAE,qtBAAqtB,gBAAgB,wBAAwB,iBAAiB,yBAAyB,cAAc,oEAAoE,+DAA+D,gGAAgG,YAAY,mBAAmB,mCAAmC,IAAI,mDAAmD,UAAU,wCAAwC,cAAc,qBAAqB,UAAU,wFAAwF,YAAY,IAAI,KAAK,aAAa,4NAA4N,oBAAoB,eAAe,qGAAqG,QAAQ,2BAA2B,uBAAuB,IAAI,KAAK,qBAAqB,qBAAqB,YAAY,OAAO,0DAA0D,UAAU,wDAAwD,iBAAiB,iBAAiB,gBAAgB,mCAAmC,IAAI,gGAAgG,qBAAqB,mCAAmC,IAAI,2CAA2C,uCAAuC,4CAA4C,0BAA0B,yCAAyC,8BAA8B,wCAAwC,MAAM,8BAA8B,uBAAuB,kCAAkC,kBAAkB,+DAA+D,yCAAyC,wBAAwB,UAAU,uBAAuB,IAAI,KAAK,aAAa,8CAA8C,QAAQ,YAAY,iBAAiB,8BAA8B,sBAAsB,kEAAkE,yCAAyC,wBAAwB,uBAAuB,IAAI,KAAK,aAAa,+BAA+B,+BAA+B,4DAA4D,0BAA0B,qFAAqF,UAAU,YAAY,aAAa,sCAAsC,SAAS,sBAAsB,QAAQ,mBAAmB,eAAe,MAAM,wJAAwJ,eAAe,QAAQ,4CAA4C,WAAW,kBAAkB,eAAe,MAAM,gDAAgD,WAAW,8BAA8B,mBAAmB,qFAAqF,eAAe,aAAa,sCAAsC,SAAS,sOAAsO,mFAAmF,kBAAkB,uBAAuB,iBAAiB,eAAe,yBAAyB,qBAAqB,yBAAyB,qBAAqB,wBAAwB,kBAAkB,+CAA+C,mCAAmC,SAAS,2BAA2B,yCAAyC,2DAA2D,WAAW,gBAAgB,4BAA4B,qBAAqB,6DAA6D,uBAAuB,gBAAgB,uCAAuC,QAAQ,8BAA8B,oBAAoB,8CAA8C,oBAAoB,IAAI,eAAe,wCAAwC,gBAAgB,qDAAqD,YAAY,IAAI,UAAU,gBAAgB,sCAAsC,OAAO,qCAAqC,4BAA4B,YAAY,IAAI,mCAAmC,SAAS,+BAA+B,aAAa,kBAAkB,oBAAoB,8BAA8B,KAAK,WAAW,6DAA6D,kBAAkB,0FAA0F,IAAI,yCAAyC,0BAA0B,sGAAsG,EAAE,YAAY,uBAAuB,8CAA8C,2CAA2C,sCAAsC,8CAA8C,gCAAgC,gDAAgD,8BAA8B,0BAA0B,4CAA4C,sCAAsC,8CAA8C,gCAAgC,gDAAgD,+BAA+B,uBAAuB,8CAA8C,sCAAsC,gBAAgB,gCAAgC,oCAAoC,+BAA+B,SAAS,oEAAoE,iFAAiF,iBAAiB,iBAAiB,YAAY,IAAI,gBAAgB,4BAA4B,gBAAgB,IAAI,yEAAyE,SAAS,8BAA8B,qBAAqB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,gkBAAgkB,aAAa,gCAAgC,6BAA6B,eAAe,mCAAmC,6BAA6B,gBAAgB,2CAA2C,6BAA6B,wBAAwB,uCAAuC,6BAA6B,oBAAoB,uCAAuC,6BAA6B,oBAAoB,iCAAiC,6BAA6B,cAAc,mCAAmC,6BAA6B,gBAAgB,oCAAoC,6BAA6B,iBAAiB,iDAAiD,6BAA6B,8BAA8B,kDAAkD,6BAA6B,+BAA+B,oDAAoD,6BAA6B,iCAAiC,yCAAyC,6BAA6B,sBAAsB,2DAA2D,6BAA6B,wCAAwC,sDAAsD,6BAA6B,mCAAmC,EAAE,aAAa,gCAAgC,6BAA6B,kBAAkB,EAAE,aAAa,+BAA+B,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,EAAE,aAAa,aAAa,sCAAsC,SAAS,EAAE,wBAAwB,eAAe,qBAAqB,2EAA2E,eAAe,oBAAoB,mCAAmC,qMAAqM,uBAAuB,eAAe,uBAAuB,kBAAkB,qBAAqB,kBAAkB,oBAAoB,kBAAkB,8BAA8B,gDAAgD,mBAAmB,sDAAsD,mBAAmB,sDAAsD,mBAAmB,qFAAqF,mBAAmB,sBAAsB,eAAe,sBAAsB,gBAAgB,sBAAsB,mBAAmB,KAAK,OAAO,KAAK,gDAAgD,YAAY,eAAe,aAAa,sCAAsC,SAAS,oFAAoF,eAAe,wIAAwI,yJAAyJ,sBAAsB,0CAA0C,0BAA0B,+CAA+C,aAAa,aAAa,sCAAsC,SAAS,6HAA6H,YAAY,kBAAkB,eAAe,aAAa,sCAAsC,SAAS,yCAAyC,eAAe,MAAM,aAAa,kFAAkF,iCAAiC,eAAe,YAAY,qCAAqC,YAAY,gDAAgD,eAAe,wIAAwI,aAAa,uTAAuT,cAAc,uNAAuN,2BAA2B,eAAe,kDAAkD,WAAW,sCAAsC,oBAAoB,0CAA0C,mCAAmC,wBAAwB,6IAA6I,uBAAuB,IAAI,yCAAyC,SAAS,wBAAwB,mCAAmC,sCAAsC,uBAAuB,IAAI,mCAAmC,+BAA+B,oBAAoB,eAAe,aAAa,sCAAsC,SAAS,iBAAiB,eAAe,2BAA2B,cAAc,QAAQ,aAAa,iBAAiB,eAAe,iBAAiB,0BAA0B,8BAA8B,0CAA0C,mBAAmB,iBAAiB,qCAAqC,UAAU,eAAe,aAAa,sCAAsC,SAAS,kBAAkB,eAAe,2BAA2B,eAAe,UAAU,EAAE,wCAAwC,WAAW,iEAAiE,mBAAmB,kBAAkB,YAAY,IAAI,6JAA6J,2BAA2B,IAAI,wEAAwE,KAAK,oBAAoB,YAAY,IAAI,wEAAwE,UAAU,WAAW,aAAa,aAAa,sCAAsC,SAAS,uCAAuC,cAAc,aAAa,sCAAsC,SAAS,kBAAkB,eAAe,2BAA2B,eAAe,iBAAiB,EAAE,sCAAsC,WAAW,gFAAgF,WAAW,eAAe,aAAa,sCAAsC,SAAS,kBAAkB,iCAAiC,2BAA2B,gBAAgB,EAAE,8BAA8B,uDAAuD,8IAA8I,WAAW,4BAA4B,yCAAyC,qCAAqC,QAAQ,yBAAyB,IAAI,iDAAiD,SAAS,2BAA2B,0DAA0D,yBAAyB,uBAAuB,YAAY,kBAAkB,IAAI,wGAAwG,gEAAgE,WAAW,eAAe,aAAa,sCAAsC,SAAS,oBAAoB,eAAe,2BAA2B,gBAAgB,EAAE,oFAAoF,WAAW,2DAA2D,4BAA4B,iDAAiD,wCAAwC,6BAA6B,IAAI,UAAU,kBAAkB,SAAS,6BAA6B,IAAI,iCAAiC,+QAA+Q,OAAO,2CAA2C,qCAAqC,2CAA2C,+BAA+B,mJAAmJ,MAAM,gHAAgH,gEAAgE,4BAA4B,6BAA6B,6CAA6C,iBAAiB,uCAAuC,0DAA0D,0BAA0B,8CAA8C,iBAAiB,aAAa,eAAe,aAAa,sCAAsC,SAAS,qBAAqB,eAAe,2BAA2B,gBAAgB,EAAE,mEAAmE,WAAW,mBAAmB,QAAQ,6BAA6B,IAAI,uBAAuB,SAAS,yBAAyB,iDAAiD,YAAY,IAAI,kCAAkC,KAAK,4DAA4D,gDAAgD,uEAAuE,cAAc,eAAe,aAAa,sCAAsC,SAAS,qBAAqB,uEAAuE,uHAAuH,cAAc,eAAe,aAAa,sCAAsC,SAAS,iBAAiB,gCAAgC,4BAA4B,eAAe,qTAAqT,WAAW,8DAA8D,kBAAkB,4EAA4E,QAAQ,0EAA0E,mBAAmB,iJAAiJ,oBAAoB,6LAA6L,mBAAmB,yDAAyD,gBAAgB,eAAe,6CAA6C,gEAAgE,2EAA2E,wDAAwD,MAAM,2DAA2D,uBAAuB,IAAI,KAAK,SAAS,QAAQ,6CAA6C,yBAAyB,cAAc,IAAI,6BAA6B,SAAS,MAAM,4DAA4D,YAAY,0JAA0J,UAAU,eAAe,aAAa,sCAAsC,SAAS,qBAAqB,oJAAoJ,6BAA6B,gBAAgB,EAAE,+DAA+D,qCAAqC,aAAa,kUAAkU,udAAud,WAAW,mBAAmB,ieAAie,kBAAkB,gDAAgD,eAAe,oBAAoB,qEAAqE,kBAAkB,2JAA2J,uBAAuB,8LAA8L,gDAAgD,4CAA4C,qBAAqB,QAAQ,oCAAoC,8EAA8E,qTAAqT,UAAU,cAAc,yDAAyD,QAAQ,WAAW,QAAQ,8KAA8K,YAAY,IAAI,gBAAgB,IAAI,SAAS,wJAAwJ,sEAAsE,+BAA+B,wjBAAwjB,MAAM,UAAU,oGAAoG,MAAM,iFAAiF,mLAAmL,sJAAsJ,6kBAA6kB,mEAAmE,kFAAkF,oBAAoB,YAAY,IAAI,MAAM,wBAAwB,wPAAwP,qBAAqB,wCAAwC,2BAA2B,qFAAqF,SAAS,sCAAsC,8EAA8E,iEAAiE,2BAA2B,IAAI,2CAA2C,iBAAiB,cAAc,qBAAqB,qBAAqB,MAAM,6CAA6C,oEAAoE,YAAY,mBAAmB,mBAAmB,0BAA0B,8BAA8B,8BAA8B,mBAAmB,KAAK,kBAAkB,gBAAgB,SAAS,UAAU,+EAA+E,IAAI,KAAK,8BAA8B,GAAG,oHAAoH,oBAAoB,kCAAkC,OAAO,YAAY,kEAAkE,yBAAyB,MAAM,0BAA0B,oBAAoB,kFAAkF,yBAAyB,6BAA6B,sIAAsI,EAAE,eAAe,aAAa,sCAAsC,SAAS,uBAAuB,wBAAwB,iCAAiC,gBAAgB,EAAE,QAAQ,2dAA2d,WAAW,sDAAsD,kBAAkB,6DAA6D,uBAAuB,+CAA+C,cAAc,2KAA2K,uBAAuB,IAAI,qEAAqE,8EAA8E,kBAAkB,wGAAwG,oBAAoB,+IAA+I,YAAY,gEAAgE,eAAe,sBAAsB,qBAAqB,EAAE,kBAAkB,gCAAgC,EAAE,qDAAqD,gBAAgB,eAAe,aAAa,sCAAsC,SAAS,uBAAuB,eAAe,wBAAwB,eAAe,mLAAmL,uBAAuB,0DAA0D,WAAW,+DAA+D,kBAAkB,6EAA6E,oBAAoB,iNAAiN,gBAAgB,oBAAoB,mBAAmB,yBAAyB,aAAa,0BAA0B,cAAc,mBAAmB,oBAAoB,iEAAiE,YAAY,IAAI,KAAK,SAAS,wCAAwC,qEAAqE,kCAAkC,uBAAuB,IAAI,qCAAqC,yBAAyB,gBAAgB,eAAe,SAAS,gEAAgE,2EAA2E,wDAAwD,MAAM,yDAAyD,SAAS,0BAA0B,qCAAqC,uBAAuB,IAAI,mDAAmD,IAAI,KAAK,sBAAsB,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,aAAa,4BAA4B,mDAAmD,yBAAyB,cAAc,KAAK,uBAAuB,kBAAkB,QAAQ,YAAY,IAAI,YAAY,SAAS,2BAA2B,OAAO,gCAAgC,4BAA4B,gBAAgB,eAAe,aAAa,sCAAsC,SAAS,qBAAqB,0CAA0C,iCAAiC,gBAAgB,OAAO,8IAA8I,gDAAgD,+GAA+G,eAAe,4DAA4D,2CAA2C,IAAI,wEAAwE,SAAS,WAAW,0CAA0C,kBAAkB,qLAAqL,uBAAuB,uGAAuG,aAAa,SAAS,4BAA4B,MAAM,GAAG,yCAAyC,KAAK,qCAAqC,KAAK,MAAM,qBAAqB,6BAA6B,4BAA4B,mBAAmB,gEAAgE,oIAAoI,MAAM,QAAQ,0DAA0D,qCAAqC,oBAAoB,mOAAmO,sBAAsB,MAAM,sBAAsB,wIAAwI,mCAAmC,mCAAmC,gBAAgB,IAAI,UAAU,0CAA0C,mCAAmC,eAAe,sBAAsB,iEAAiE,uBAAuB,IAAI,qEAAqE,oEAAoE,WAAW,gBAAgB,+RAA+R,0FAA0F,2BAA2B,OAAO,oCAAoC,YAAY,uBAAuB,oBAAoB,kBAAkB,gCAAgC,EAAE,qDAAqD,+BAA+B,eAAe,aAAa,sCAAsC,SAAS,0BAA0B,0CAA0C,4BAA4B,gBAAgB,EAAE,MAAM,mNAAmN,6EAA6E,WAAW,iEAAiE,2BAA2B,sQAAsQ,oBAAoB,oCAAoC,QAAQ,sEAAsE,uBAAuB,IAAI,0EAA0E,SAAS,mBAAmB,+CAA+C,gBAAgB,SAAS,gEAAgE,2EAA2E,wDAAwD,MAAM,2DAA2D,2BAA2B,WAAW,oBAAoB,aAAa,gBAAgB,mBAAmB,eAAe,aAAa,sCAAsC,SAAS,0BAA0B,eAAe,wBAAwB,eAAe,kSAAkS,uBAAuB,6DAA6D,WAAW,8JAA8J,kBAAkB,uHAAuH,oBAAoB,8KAA8K,gBAAgB,uJAAuJ,OAAO,gCAAgC,iCAAiC,SAAS,kBAAkB,mBAAmB,sBAAsB,iDAAiD,QAAQ,YAAY,YAAY,gHAAgH,YAAY,IAAI,6BAA6B,YAAY,IAAI,KAAK,gFAAgF,mBAAmB,IAAI,SAAS,GAAG,8CAA8C,2BAA2B,aAAa,sFAAsF,2DAA2D,gBAAgB,IAAI,MAAM,0BAA0B,wBAAwB,gBAAgB,4BAA4B,gBAAgB,eAAe,SAAS,wBAAwB,mGAAmG,gEAAgE,2EAA2E,wDAAwD,MAAM,yDAAyD,YAAY,gCAAgC,iCAAiC,qCAAqC,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,gCAAgC,gCAAgC,IAAI,iBAAiB,mDAAmD,yBAAyB,cAAc,EAAE,QAAQ,oCAAoC,aAAa,MAAM,+EAA+E,YAAY,YAAY,IAAI,KAAK,sBAAsB,mBAAmB,IAAI,SAAS,sBAAsB,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,kCAAkC,2BAA2B,gBAAgB,IAAI,iBAAiB,mDAAmD,yBAAyB,cAAc,mCAAmC,uBAAuB,kBAAkB,QAAQ,YAAY,IAAI,YAAY,SAAS,2BAA2B,OAAO,gCAAgC,4BAA4B,mBAAmB,eAAe,aAAa,sCAAsC,SAAS,kBAAkB,wBAAwB,4BAA4B,gBAAgB,EAAE,uCAAuC,0BAA0B,wCAAwC,kDAAkD,qDAAqD,+GAA+G,WAAW,eAAe,aAAa,sCAAsC,SAAS,gBAAgB,wBAAwB,8BAA8B,gBAAgB,EAAE,mFAAmF,sBAAsB,WAAW,sBAAsB,uBAAuB,eAAe,YAAY,IAAI,WAAW,sBAAsB,6CAA6C,iBAAiB,oBAAoB,0DAA0D,6BAA6B,8CAA8C,gBAAgB,wCAAwC,yBAAyB,IAAI,MAAM,kBAAkB,sJAAsJ,OAAO,yBAAyB,qCAAqC,yBAAyB,+BAA+B,mJAAmJ,6BAA6B,6BAA6B,eAAe,aAAa,sCAAsC,SAAS,qBAAqB,wBAAwB,4BAA4B,gBAAgB,EAAE,iLAAiL,0BAA0B,sIAAsI,mCAAmC,iJAAiJ,8GAA8G,sBAAsB,iIAAiI,cAAc,eAAe,aAAa,sCAAsC,SAAS,mBAAmB,wBAAwB,4BAA4B,gBAAgB,EAAE,sJAAsJ,kHAAkH,+GAA+G,YAAY,eAAe,aAAa,sCAAsC,SAAS,gBAAgB,wBAAwB,8BAA8B,gBAAgB,EAAE,uEAAuE,wCAAwC,eAAe,aAAa,sCAAsC,SAAS,gBAAgB,wBAAwB,4BAA4B,gBAAgB,EAAE,QAAQ,2LAA2L,qFAAqF,4HAA4H,mBAAmB,YAAY,mCAAmC,qDAAqD,8GAA8G,sBAAsB,kFAAkF,+BAA+B,qBAAqB,kBAAkB,sEAAsE,SAAS,cAAc,aAAa,sCAAsC,SAAS,kBAAkB,wBAAwB,4BAA4B,gBAAgB,EAAE,UAAU,sUAAsU,2HAA2H,6EAA6E,sCAAsC,YAAY,0BAA0B,qDAAqD,8GAA8G,sBAAsB,kHAAkH,8BAA8B,UAAU,sCAAsC,wCAAwC,sCAAsC,qCAAqC,qDAAqD,aAAa,oBAAoB,yGAAyG,eAAe,aAAa,sCAAsC,SAAS,gBAAgB,wBAAwB,4BAA4B,gBAAgB,EAAE,6LAA6L,6CAA6C,sEAAsE,qCAAqC,8GAA8G,sBAAsB,0JAA0J,SAAS,eAAe,aAAa,sCAAsC,SAAS,sBAAsB,wBAAwB,4BAA4B,gBAAgB,EAAE,gBAAgB,0YAA0Y,0BAA0B,wCAAwC,sCAAsC,YAAY,0IAA0I,qCAAqC,8GAA8G,sBAAsB,4MAA4M,eAAe,eAAe,aAAa,sCAAsC,SAAS,oBAAoB,wBAAwB,8BAA8B,gBAAgB,EAAE,2EAA2E,uCAAuC,oBAAoB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,kGAAkG,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,MAAM,sCAAsC,SAAS,sEAAsE,2CAA2C,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,MAAM,sCAAsC,SAAS,gEAAgE,iDAAiD,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,sCAAsC,SAAS,EAAE,eAAe,aAAa,cAAc,oHAAoH,EAAE,SAAS,cAAc,iGAAiG,EAAE,SAAS,cAAc,mXAAmX,EAAE,SAAS,cAAc,kYAAkY,EAAE,SAAS,cAAc,mgBAAmgB,EAAE,SAAS,cAAc,80BAA80B,EAAE,SAAS,cAAc,qrBAAqrB,EAAE,SAAS,cAAc,ykBAAykB,EAAE,SAAS,cAAc,wjBAAwjB,EAAE,SAAS,cAAc,kpBAAkpB,EAAE,SAAS,cAAc,+oBAA+oB,EAAE,+EAA+E,cAAc,IAAI,kBAAkB,cAAc,WAAW,gBAAgB,4DAA4D,aAAa,eAAe,wDAAwD,cAAc,eAAe,iDAAiD,gBAAgB,iDAAiD,cAAc,qCAAqC,oBAAoB,eAAe,qCAAqC,sBAAsB,qCAAqC,gBAAgB,UAAU,WAAW,iBAAiB,6CAA6C,SAAS,gBAAgB,0CAA0C,8DAA8D,gBAAgB,WAAW,gDAAgD,cAAc,2BAA2B,kBAAkB,4DAA4D,6DAA6D,kBAAkB,4DAA4D,+DAA+D,kBAAkB,8CAA8C,6CAA6C,gBAAgB,gCAAgC,sCAAsC,gBAAgB,2CAA2C,cAAc,qDAAqD,cAAc,uCAAuC,oBAAoB,sEAAsE,kBAAkB,qEAAqE,kBAAkB,qEAAqE,gBAAgB,0DAA0D,gBAAgB,4DAA4D,8NAA8N,kBAAkB,yDAAyD,oBAAoB,6EAA6E,mCAAmC,+BAA+B,IAAI,8BAA8B,oBAAoB,EAAE,YAAY,aAAa,eAAe,sEAAsE,cAAc,eAAe,qEAAqE,gBAAgB,qEAAqE,cAAc,mDAAmD,wBAAwB,eAAe,mDAAmD,0BAA0B,mDAAmD,gBAAgB,wDAAwD,gGAAgG,cAAc,2BAA2B,mBAAmB,wFAAwF,2FAA2F,mBAAmB,0EAA0E,6EAA6E,mBAAmB,4DAA4D,2DAA2D,mBAAmB,4DAA4D,mEAAmE,iBAAiB,gCAAgC,oDAAoD,iBAAiB,yDAAyD,iBAAiB,yDAAyD,eAAe,0EAA0E,eAAe,mDAAmD,mBAAmB,mGAAmG,mBAAmB,mGAAmG,mBAAmB,iFAAiF,qBAAqB,+GAA+G,iBAAiB,oFAAoF,iBAAiB,wFAAwF,0UAA0U,gBAAgB,cAAc,eAAe,2FAA2F,iBAAiB,oGAAoG,eAAe,eAAe,mGAAmG,iBAAiB,mGAAmG,+BAA+B,eAAe,wEAAwE,iCAAiC,wEAAwE,eAAe,wEAAwE,iBAAiB,UAAU,yBAAyB,mDAAmD,+FAA+F,SAAS,iBAAiB,gHAAgH,4JAA4J,iBAAiB,mEAAmE,8HAA8H,eAAe,mEAAmE,4CAA4C,mBAAmB,kIAAkI,kKAAkK,mBAAmB,iFAAiF,gGAAgG,mBAAmB,+FAA+F,4GAA4G,mBAAmB,kBAAkB,+GAA+G,iBAAiB,8EAA8E,iBAAiB,gCAAgC,yEAAyE,iBAAiB,8EAA8E,iBAAiB,0FAA0F,iBAAiB,wGAAwG,gGAAgG,iBAAiB,4QAA4Q,qNAAqN,mBAAmB,8EAA8E,eAAe,uGAAuG,eAAe,gEAAgE,mBAAmB,gJAAgJ,mBAAmB,gJAAgJ,mBAAmB,qHAAqH,qBAAqB,kKAAkK,iBAAiB,2HAA2H,iBAAiB,kIAAkI,4eAA4e,gBAAgB,cAAc,gBAAgB,kJAAkJ,eAAe,gBAAgB,qLAAqL,iBAAiB,qLAAqL,6CAA6C,gBAAgB,+HAA+H,+CAA+C,+HAA+H,eAAe,+HAA+H,iBAAiB,UAAU,+CAA+C,6GAA6G,iLAAiL,SAAS,iBAAiB,4QAA4Q,8WAA8W,iBAAiB,0HAA0H,urBAAurB,eAAe,0HAA0H,8HAA8H,mBAAmB,sJAAsJ,ybAAyb,mBAAmB,iDAAiD,qaAAqa,mBAAmB,yBAAyB,6MAA6M,qBAAqB,6FAA6F,4gBAA4gB,mBAAmB,0FAA0F,oNAAoN,mBAAmB,0FAA0F,oNAAoN,mBAAmB,wFAAwF,sNAAsN,iBAAiB,wIAAwI,iBAAiB,wIAAwI,mBAAmB,mDAAmD,iQAAiQ,iBAAiB,gCAAgC,gIAAgI,iBAAiB,gCAAgC,gIAAgI,iBAAiB,gCAAgC,gIAAgI,mBAAmB,wGAAwG,sKAAsK,iBAAiB,4FAA4F,uLAAuL,iBAAiB,0CAA0C,iBAAiB,oEAAoE,8EAA8E,iBAAiB,eAAe,QAAQ,6HAA6H,kUAAkU,qBAAqB,6HAA6H,0MAA0M,uBAAuB,wPAAwP,wLAAwL,iBAAiB,wGAAwG,uJAAuJ,2BAA2B,kCAAkC,gKAAgK,uBAAuB,wBAAwB,iMAAiM,qBAAqB,+KAA+K,iKAAiK,2BAA2B,kCAAkC,yJAAyJ,qBAAqB,uFAAuF,mcAAmc,qBAAqB,uFAAuF,qCAAqC,kCAAkC,mMAAmM,eAAe,mLAAmL,eAAe,yGAAyG,mBAAmB,2QAA2Q,mBAAmB,2QAA2Q,mBAAmB,qNAAqN,qBAAqB,2SAA2S,iBAAiB,kOAAkO,iBAAiB,gPAAgP,s2BAAs2B,gBAAgB,cAAc,eAAe,iDAAiD,eAAe,eAAe,uCAAuC,eAAe,yBAAyB,yBAAyB,mBAAmB,eAAe,8BAA8B,iBAAiB,uCAAuC,qBAAqB,8BAA8B,mBAAmB,sDAAsD,mBAAmB,sDAAsD,mBAAmB,sDAAsD,mBAAmB,sDAAsD,iBAAiB,wEAAwE,iBAAiB,2EAA2E,mBAAmB,oFAAoF,mBAAmB,oFAAoF,iBAAiB,2EAA2E,mBAAmB,6CAA6C,qBAAqB,4DAA4D,iBAAiB,wCAAwC,yBAAyB,iBAAiB,wCAAwC,mBAAmB,eAAe,yBAAyB,mBAAmB,iBAAiB,0CAA0C,iBAAiB,6CAA6C,iBAAiB,uCAAuC,qEAAqE,iBAAiB,qCAAqC,mBAAmB,8CAA8C,gDAAgD,qBAAqB,yBAAyB,+DAA+D,yBAAyB,0DAA0D,4GAA4G,yBAAyB,kDAAkD,4GAA4G,iBAAiB,OAAO,mDAAmD,wDAAwD,mBAAmB,uDAAuD,6HAA6H,mBAAmB,yBAAyB,uFAAuF,mBAAmB,uHAAuH,wEAAwE,qBAAqB,cAAc,2LAA2L,qBAAqB,cAAc,2LAA2L,qBAAqB,cAAc,2LAA2L,iBAAiB,6GAA6G,6CAA6C,eAAe,8BAA8B,eAAe,2CAA2C,iBAAiB,6CAA6C,iBAAiB,8CAA8C,wKAAwK,mFAAmF,QAAQ,gEAAgE,IAAI,0FAA0F,SAAS,EAAE,cAAc,eAAe,wDAAwD,eAAe,eAAe,iDAAiD,qBAAqB,eAAe,qCAAqC,iBAAiB,iDAAiD,uBAAuB,qCAAqC,mBAAmB,qEAAqE,mBAAmB,qEAAqE,mBAAmB,qEAAqE,mBAAmB,qEAAqE,iBAAiB,6FAA6F,iBAAiB,iGAAiG,mBAAmB,6GAA6G,mBAAmB,6GAA6G,iBAAiB,iGAAiG,mBAAmB,yDAAyD,qBAAqB,6EAA6E,iBAAiB,oDAAoD,2BAA2B,iBAAiB,oDAAoD,uBAAuB,eAAe,gCAAgC,2BAA2B,eAAe,gCAAgC,uBAAuB,iBAAiB,qDAAqD,iBAAiB,yDAAyD,iBAAiB,kDAAkD,qEAAqE,iBAAiB,+CAA+C,qBAAqB,oKAAoK,+EAA+E,qBAAqB,gCAAgC,iFAAiF,iBAAiB,gBAAgB,OAAO,GAAG,8BAA8B,YAAY,GAAG,8BAA8B,YAAY,yBAAyB,iDAAiD,mBAAmB,gCAAgC,mJAAmJ,mBAAmB,8GAA8G,2FAA2F,eAAe,qCAAqC,eAAe,qDAAqD,iBAAiB,0DAA0D,iBAAiB,4DAA4D,8NAA8N,4DAA4D,WAAW,6BAA6B,QAAQ,gEAAgE,IAAI,0GAA0G,UAAU,GAAG,cAAc,eAAe,wDAAwD,eAAe,qCAAqC,mBAAmB,MAAM,kBAAkB,8DAA8D,iBAAiB,wCAAwC,0EAA0E,iBAAiB,cAAc,0BAA0B,mBAAmB,4DAA4D,6FAA6F,mBAAmB,MAAM,4DAA4D,6DAA6D,mBAAmB,MAAM,4DAA4D,6DAA6D,mBAAmB,MAAM,4DAA4D,6DAA6D,iBAAiB,yBAAyB,sEAAsE,iBAAiB,+FAA+F,uDAAuD,iBAAiB,mFAAmF,sEAAsE,mBAAmB,mCAAmC,qBAAqB,sEAAsE,uMAAuM,eAAe,sDAAsD,6HAA6H,iBAAiB,4DAA4D,gDAAgD,iBAAiB,oDAAoD,iBAAiB,uBAAuB,kGAAkG,KAAK,QAAQ,sCAAsC,wBAAwB,4IAA4I,SAAS,qBAAqB,qBAAqB,eAAe,wFAAwF,6EAA6E,eAAe,qDAAqD,4KAA4K,cAAc,+LAA+L,4CAA4C,yDAAyD,gCAAgC,4HAA4H,EAAE,cAAc,eAAe,oFAAoF,eAAe,eAAe,yFAAyF,6BAA6B,eAAe,iEAAiE,2BAA2B,eAAe,4BAA4B,yBAAyB,8EAA8E,mBAAmB,8DAA8D,0GAA0G,iBAAiB,mFAAmF,iBAAiB,6EAA6E,iBAAiB,WAAW,QAAQ,eAAe,2BAA2B,iBAAiB,yFAAyF,eAAe,iEAAiE,+BAA+B,iEAAiE,UAAU,iBAAiB,iDAAiD,UAAU,iBAAiB,iDAAiD,iBAAiB,+DAA+D,oFAAoF,mBAAmB,0FAA0F,kHAAkH,mBAAmB,uIAAuI,mIAAmI,mBAAmB,uIAAuI,mIAAmI,mBAAmB,uIAAuI,mIAAmI,mBAAmB,4DAA4D,6MAA6M,mBAAmB,4DAA4D,6MAA6M,qBAAqB,gCAAgC,iCAAiC,MAAM,6FAA6F,oFAAoF,gCAAgC,6FAA6F,mBAAmB,iIAAiI,mBAAmB,oHAAoH,iPAAiP,UAAU,mBAAmB,yGAAyG,UAAU,qBAAqB,UAAU,mLAAmL,iBAAiB,YAAY,+GAA+G,iBAAiB,+FAA+F,4BAA4B,iBAAiB,YAAY,QAAQ,eAAe,sFAAsF,wFAAwF,SAAS,eAAe,8FAA8F,iBAAiB,8GAA8G,iBAAiB,oHAAoH,sbAAsb,cAAc,eAAe,0CAA0C,eAAe,eAAe,6BAA6B,iBAAiB,eAAe,uBAAuB,iBAAiB,6BAA6B,mBAAmB,uBAAuB,mBAAmB,uCAAuC,mBAAmB,uCAAuC,mBAAmB,uCAAuC,mBAAmB,uCAAuC,iBAAiB,mDAAmD,iBAAiB,qDAAqD,mBAAmB,2DAA2D,mBAAmB,2DAA2D,iBAAiB,qDAAqD,mBAAmB,iCAAiC,qBAAqB,2CAA2C,iBAAiB,4BAA4B,uBAAuB,iBAAiB,4BAA4B,eAAe,eAAe,kBAAkB,uBAAuB,eAAe,kBAAkB,eAAe,iBAAiB,+BAA+B,iBAAiB,iCAAiC,iBAAiB,4BAA4B,yDAAyD,iBAAiB,2BAA2B,mBAAmB,0BAA0B,4BAA4B,qBAAqB,kBAAkB,6CAA6C,iBAAiB,OAAO,oBAAoB,+CAA+C,mBAAmB,kBAAkB,+CAA+C,mBAAmB,kBAAkB,yDAAyD,mBAAmB,kBAAkB,yDAAyD,mBAAmB,kBAAkB,2DAA2D,qBAAqB,wDAAwD,6CAA6C,iBAAiB,yFAAyF,6CAA6C,eAAe,uBAAuB,eAAe,iCAAiC,iBAAiB,gCAAgC,iBAAiB,gCAAgC,kHAAkH,4DAA4D,WAAW,6BAA6B,QAAQ,gEAAgE,IAAI,0DAA0D,UAAU,GAAG,cAAc,MAAM,YAAY,aAAa,gGAAgG,cAAc,MAAM,sCAAsC,0BAA0B,2BAA2B,YAAY,mBAAmB,iGAAiG,yBAAyB,yCAAyC,4BAA4B,6FAA6F,YAAY,MAAM,iEAAiE,cAAc,4BAA4B,QAAQ,MAAM,WAAW,QAAQ,MAAM,KAAK,+BAA+B,iBAAiB,SAAS,aAAa,iBAAiB,mBAAmB,eAAe,YAAY,WAAW,KAAK,8CAA8C,6CAA6C,uCAAuC,aAAa,8cAA8c,0IAA0I,wBAAwB,qEAAqE,SAAS,kBAAkB,6BAA6B,iBAAiB,SAAS,sBAAsB,6BAA6B,iBAAiB,SAAS,sBAAsB,6BAA6B,kBAAkB,yBAAyB,8LAA8L,mLAAmL,8HAA8H,WAAW,KAAK,uBAAuB,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,oBAAoB,2BAA2B,2NAA2N,wEAAwE,2VAA2V,YAAY,KAAK,oCAAoC,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,4BAA4B,YAAY,KAAK,4CAA4C,uDAAuD,uBAAuB,mDAAmD,SAAS,4DAA4D,IAAI,MAAM,cAAc,WAAW,+BAA+B,YAAY,YAAY,oDAAoD,mBAAmB,+DAA+D,uBAAuB,EAAE,8DAA8D,4FAA4F,eAAe,wCAAwC,SAAS,EAAE,QAAQ,IAAI,G;;;;;;ACDr91G;AACA;AACA;AACA;AACA;;AAEA,cAAc;;AAEd;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,wCAAwC,SAAS;AACjD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,2BAA2B,UAAU;AACrC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,IAAI,IAA0C,EAAE,mCAAO,YAAY,iBAAiB,EAAE;AAAA,kGAAC;AACvF,KAAK,EAI2B;;AAEhC,CAAC;;;;;;;;AC1HY;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc,GAAG,aAAa;AAC9B;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,qC;;;;;;;ACZa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,GAAS;AAC9B,aAAa,mBAAO,CAAC,GAAe;AACpC,iC;;;;;;;ACda;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB;AACnB,gBAAgB,mBAAO,CAAC,GAAkB;AAC1C;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,KAAK;AACvC;AACA;AACA;AACA;AACA;AACA,qCAAqC,KAAK,YAAY,aAAa;AACnE;AACA,sCAAsC,KAAK,IAAI,+CAA+C;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,cAAc,IAAI;AAC9E,yCAAyC,YAAY,YAAY,aAAa,IAAI,oDAAoD;AACtI;AACA,qCAAqC,YAAY,GAAG,aAAa;AACjE;AACA,iCAAiC,WAAW;AAC5C,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA,6EAA6E,0BAA0B;AACvG;AACA;AACA;AACA,8EAA8E,wBAAwB;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,eAAe;AACpE;AACA,+DAA+D,cAAc,IAAI;AACjF;AACA,8BAA8B,kBAAkB,GAAG,4CAA4C;AAC/F,yCAAyC,EAAE,IAAI,oDAAoD;AACnG;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA,uC;;;;;;;ACnIa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,GAAS;AAC9B,aAAa,mBAAO,CAAC,GAAe;AACpC,aAAa,mBAAO,CAAC,GAAW;AAChC,iC;;;;;;;ACfa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6DAA6D;AAC5E;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,uC;;;;;;;ACzFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB,GAAG,4BAA4B;AACjD,sBAAsB,mBAAO,CAAC,GAAe;AAC7C;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,6BAA6B,IAAI;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,mC;;;;;;ACvGA;AACA,eAAe,KAAiD,oBAAoB,CAAqH,CAAC,oBAAoB,YAAY,OAAO,cAAc,aAAa,sCAAsC,SAAS,uBAAuB,8EAA8E,QAAQ,gBAAgB,uDAAuD,2BAA2B,wBAAwB,4BAA4B,mBAAmB,sBAAsB,8GAA8G,uDAAuD,kCAAkC,wBAAwB,gGAAgG,4BAA4B,mCAAmC,0BAA0B,WAAW,8BAA8B,2BAA2B,8DAA8D,EAAE,aAAa,4BAA4B,oBAAoB,6CAA6C,QAAQ,EAAE,6BAA6B,8CAA8C,gGAAgG,wBAAwB,6EAA6E,wQAAwQ,sEAAsE,mKAAmK,iJAAiJ,YAAY,WAAW,KAAK,0CAA0C,MAAM,yEAAyE,gIAAgI,QAAQ,iDAAiD,8CAA8C,EAAE,mCAAmC,qBAAqB,2BAA2B,0BAA0B,qBAAqB,MAAM,eAAe,KAAK,2CAA2C,yDAAyD,uBAAuB,2CAA2C,iDAAiD,gCAAgC,gBAAgB,sBAAsB,EAAE,8CAA8C,wBAAwB,wBAAwB,yDAAyD,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE,WAAW,IAAI,IAAI,IAAI,KAAK,IAAI,KAAK,EAAE,MAAM,qBAAqB,kCAAkC,iDAAiD,2DAA2D,gDAAgD,kBAAkB,4IAA4I,YAAY,uBAAuB,IAAI,KAAK,+BAA+B,MAAM,yCAAyC,4EAA4E,gBAAgB,uBAAuB,MAAM,kGAAkG,8BAA8B,WAAW,uBAAuB,IAAI,aAAa,gBAAgB,EAAE,yDAAyD,0BAA0B,wBAAwB,KAAK,yBAAyB,sDAAsD,2CAA2C,sHAAsH,sBAAsB,qEAAqE,QAAQ,YAAY,IAAI,MAAM,MAAM,QAAQ,cAAc,qCAAqC,uBAAuB,oDAAoD,oCAAoC,kBAAkB,8EAA8E,2BAA2B,kCAAkC,kBAAkB,kFAAkF,aAAa,SAAS,8BAA8B,GAAG,sDAAsD,0BAA0B,uCAAuC,8CAA8C,GAAG,GAAG,wBAAwB,kCAAkC,SAAS,uSAAuS,WAAW,sBAAsB,+DAA+D,8XAA8X,IAAI,2CAA2C,EAAE,aAAa,EAAE,+LAA+L,qBAAqB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,uBAAuB,eAAe,uCAAuC,6BAA6B,sBAAsB,8EAA8E,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,sCAAsC,SAAS,2HAA2H,SAAS,SAAS,2KAA2K,kEAAkE,+MAA+M,iBAAiB,WAAW,IAAI,GAAG,EAAE,wBAAwB,EAAE,GAAG,EAAE,SAAS,IAAI,GAAG,IAAI,4BAA4B,EAAE,GAAG,EAAE,SAAS,MAAM,GAAG,IAAI,UAAU,IAAI,YAAY,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,MAAM,UAAU,IAAI,YAAY,EAAE,GAAG,EAAE,SAAS,IAAI,GAAG,EAAE,qBAAqB,aAAa,YAAY,gTAAgT,WAAW,IAAI,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,IAAI,MAAM,EAAE,GAAG,EAAE,SAAS,IAAI,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,IAAI,GAAG,EAAE,iBAAiB,oCAAoC,0BAA0B,GAAG,0BAA0B,IAAI,0BAA0B,GAAG,0BAA0B,yBAAyB,WAAW,KAAK,WAAW,uBAAuB,SAAS,4JAA4J,cAAc,EAAE,EAAE,GAAG,EAAE,4EAA4E,eAAe,eAAe,aAAa,cAAc,swCAAswC,EAAE,UAAU,MAAM,gBAAgB,4CAA4C,uFAAuF,IAAI,gCAAgC,cAAc,gBAAgB,cAAc,aAAa,gBAAgB,MAAM,sBAAsB,QAAQ,IAAI,oBAAoB,SAAS,gBAAgB,MAAM,sBAAsB,QAAQ,IAAI,0BAA0B,SAAS,cAAc,yBAAyB,cAAc,sDAAsD,uBAAuB,GAAG,cAAc,2CAA2C,0BAA0B,GAAG,cAAc,4CAA4C,oBAAoB,uGAAuG,kBAAkB,gBAAgB,iBAAiB,8GAA8G,uEAAuE,gDAAgD,SAAS,MAAM,yBAAyB,UAAU,oHAAoH,YAAY,OAAO,4DAA4D,yBAAyB,wEAAwE,oKAAoK,OAAO,qDAAqD,SAAS,mGAAmG,0BAA0B,wBAAwB,WAAW,aAAa,wCAAwC,aAAa,wCAAwC,gBAAgB,wCAAwC,aAAa,gBAAgB,SAAS,UAAU,yBAAyB,kBAAkB,uCAAuC,mBAAmB,2BAA2B,kCAAkC,2BAA2B,+EAA+E,mDAAmD,qEAAqE,gBAAgB,yCAAyC,cAAc,kBAAkB,6CAA6C,8DAA8D,2BAA2B,0FAA0F,QAAQ,gBAAgB,IAAI,4BAA4B,uEAAuE,cAAc,YAAY,UAAU,cAAc,uBAAuB,cAAc,8BAA8B,KAAK,qBAAqB,qCAAqC,gBAAgB,QAAQ,0CAA0C,KAAK,sCAAsC,cAAc,sBAAsB,sBAAsB,0GAA0G,SAAS,oBAAoB,gCAAgC,qBAAqB,iCAAiC,iBAAiB,0CAA0C,iBAAiB,0CAA0C,oBAAoB,wBAAwB,iDAAiD,qBAAqB,wBAAwB,qDAAqD,kBAAkB,6CAA6C,iBAAiB,+CAA+C,oBAAoB,kBAAkB,wBAAwB,mCAAmC,mBAAmB,kBAAkB,wBAAwB,qCAAqC,0BAA0B,iCAAiC,yBAAyB,iCAAiC,EAAE,4EAA4E,EAAE,UAAU,EAAE,UAAU,EAAE,kGAAkG,EAAE,aAAa,EAAE,oJAAoJ,QAAQ,iKAAiK,eAAe,iEAAiE,4BAA4B,iBAAiB,mBAAmB,IAAI,2BAA2B,SAAS,mBAAmB,kFAAkF,SAAS,mBAAmB,2BAA2B,qCAAqC,sBAAsB,qCAAqC,sBAAsB,sBAAsB,uBAAuB,yCAAyC,YAAY,yBAAyB,8EAA8E,aAAa,mBAAmB,yBAAyB,8DAA8D,WAAW,kBAAkB,WAAW,kEAAkE,0BAA0B,iBAAiB,wBAAwB,2BAA2B,aAAa,KAAK,uBAAuB,qBAAqB,kBAAkB,aAAa,wBAAwB,SAAS,mDAAmD,+FAA+F,mFAAmF,iBAAiB,8BAA8B,iBAAiB,kCAAkC,oBAAoB,oCAAoC,WAAW,qBAAqB,sHAAsH,uBAAuB,WAAW,mCAAmC,SAAS,mDAAmD,+BAA+B,wCAAwC,SAAS,4BAA4B,2GAA2G,aAAa,WAAW,uBAAuB,wEAAwE,KAAK,gDAAgD,mBAAmB,YAAY,mBAAmB,wCAAwC,kCAAkC,KAAK,uCAAuC,YAAY,mBAAmB,sCAAsC,EAAE,SAAS,kBAAkB,gBAAgB,kBAAkB,yDAAyD,gBAAgB,2EAA2E,+BAA+B,MAAM,4BAA4B,MAAM,kBAAkB,wCAAwC,2BAA2B,eAAe,2GAA2G,qBAAqB,iBAAiB,sCAAsC,2BAA2B,eAAe,wCAAwC,2BAA2B,cAAc,oCAAoC,qBAAqB,cAAc,4CAA4C,2BAA2B,eAAe,gBAAgB,qBAAqB,iDAAiD,eAAe,iDAAiD,OAAO,MAAM,eAAe,oEAAoE,+FAA+F,MAAM,MAAM,eAAe,wGAAwG,4IAA4I,8BAA8B,0EAA0E,4FAA4F,4BAA4B,EAAE,sGAAsG,mCAAmC,EAAE,6BAA6B,sBAAsB,qBAAqB,sCAAsC,cAAc,sCAAsC,cAAc,sCAAsC,cAAc,sCAAsC,cAAc,sCAAsC,eAAe,yCAAyC,EAAE,4BAA4B,4BAA4B,MAAM,sBAAsB,yCAAyC,2EAA2E,oBAAoB,gCAAgC,EAAE,KAAK,+EAA+E,sDAAsD,2IAA2I,YAAY,oBAAoB,gCAAgC,GAAG,MAAM,oBAAoB,4BAA4B,YAAY,qBAAqB,YAAY,qBAAqB,YAAY,qBAAqB,YAAY,qBAAqB,YAAY,sBAAsB,gBAAgB,IAAI,sBAAsB,MAAM,MAAM,YAAY,YAAY,kDAAkD,MAAM,MAAM,YAAY,mCAAmC,kCAAkC,gDAAgD,MAAM,kCAAkC,iDAAiD,IAAI,YAAY,MAAM,2CAA2C,IAAI,YAAY,MAAM,uBAAuB,MAAM,QAAQ,oBAAoB,oCAAoC,kEAAkE,yFAAyF,4NAA4N,iCAAiC,uBAAuB,IAAI,YAAY,MAAM,0DAA0D,6FAA6F,qBAAqB,wBAAwB,MAAM,gBAAgB,sGAAsG,qBAAqB,YAAY,MAAM,UAAU,MAAM,4BAA4B,MAAM,kBAAkB,QAAQ,qCAAqC,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,QAAQ,6BAA6B,aAAa,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,WAAW,oBAAoB,MAAM,MAAM,eAAe,kaAAka,2BAA2B,WAAW,MAAM,eAAe,aAAa,oBAAoB,MAAM,0CAA0C,SAAS,kBAAkB,gBAAgB,QAAQ,oBAAoB,UAAU,0BAA0B,cAAc,qBAAqB,YAAY,EAAE,SAAS,0DAA0D,UAAU,sBAAsB,aAAa,kCAAkC,cAAc,kCAAkC,MAAM,QAAQ,MAAM,2DAA2D,mBAAmB,+BAA+B,SAAS,kBAAkB,gBAAgB,2BAA2B,0xBAA0xB,OAAO,+FAA+F,oBAAoB,OAAO,2CAA2C,uBAAuB,wEAAwE,6BAA6B,0HAA0H,6CAA6C,cAAc,mCAAmC,eAAe,oBAAoB,4DAA4D,QAAQ,oBAAoB,mBAAmB,mNAAmN,OAAO,oLAAoL,UAAU,qBAAqB,kBAAkB,sGAAsG,UAAU,+BAA+B,WAAW,4FAA4F,QAAQ,oCAAoC,gbAAgb,UAAU,+BAA+B,WAAW,sEAAsE,6CAA6C,0DAA0D,kEAAkE,aAAa,kCAAkC,cAAc,oCAAoC,sCAAsC,YAAY,iCAAiC,aAAa,oCAAoC,sCAAsC,cAAc,mCAAmC,mBAAmB,OAAO,mCAAmC,wBAAwB,MAAM,0HAA0H,eAAe,yCAAyC,sBAAsB,oCAAoC,MAAM,wBAAwB,MAAM,0FAA0F,aAAa,kCAAkC,kBAAkB,MAAM,wBAAwB,MAAM,uDAAuD,cAAc,wCAAwC,qBAAqB,kDAAkD,mCAAmC,sBAAsB,MAAM,kGAAkG,aAAa,0BAA0B,aAAa,0BAA0B,UAAU,kDAAkD,WAAW,kFAAkF,aAAa,uDAAuD,gCAAgC,QAAQ,yMAAyM,mCAAmC,yFAAyF,kBAAkB,iCAAiC,eAAe,oCAAoC,gBAAgB,sCAAsC,UAAU,OAAO,wDAAwD,cAAc,cAAc,sBAAsB,8GAA8G,4DAA4D,sBAAsB,UAAU,cAAc,kCAAkC,oDAAoD,sBAAsB,gBAAgB,eAAe,qCAAqC,eAAe,SAAS,kBAAkB,gBAAgB,YAAY,8EAA8E,QAAQ,2YAA2Y,WAAW,gBAAgB,SAAS,8IAA8I,uBAAuB,UAAU,6CAA6C,WAAW,wDAAwD,aAAa,+BAA+B,8BAA8B,yHAAyH,yFAAyF,wBAAwB,mBAAmB,MAAM,IAAI,kGAAkG,KAAK,aAAa,gBAAgB,sBAAsB,+EAA+E,SAAS,OAAO,MAAM,SAAS,GAAG,SAAS,iBAAiB,iFAAiF,WAAW,IAAI,iBAAiB,+BAA+B,0PAA0P,gEAAgE,oBAAoB,UAAU,0EAA0E,oCAAoC,iBAAiB,GAAG,yBAAyB,cAAc,uBAAuB,uBAAuB,gDAAgD,+BAA+B,QAAQ,aAAa,0FAA0F,WAAW,8CAA8C,EAAE,0CAA0C,iBAAiB,iEAAiE,YAAY,IAAI,sBAAsB,qEAAqE,yBAAyB,QAAQ,aAAa,SAAS,YAAY,eAAe,yBAAyB,kDAAkD,WAAW,eAAe,0BAA0B,eAAe,yBAAyB,2CAA2C,EAAE,uBAAuB,4CAA4C,sGAAsG,+CAA+C,aAAa,oBAAoB,6DAA6D,GAAG,qBAAqB,6BAA6B,8GAA8G,gDAAgD,QAAQ,iGAAiG,cAAc,kBAAkB,yCAAyC,gBAAgB,gEAAgE,WAAW,SAAS,oCAAoC,aAAa,KAAK,mBAAmB,OAAO,GAAG,qBAAqB,cAAc,mEAAmE,4BAA4B,wBAAwB,mBAAmB,oBAAoB,gBAAgB,sBAAsB,iBAAiB,qCAAqC,eAAe,kBAAkB,gDAAgD,0BAA0B,YAAY,iCAAiC,iBAAiB,YAAY,iBAAiB,YAAY,SAAS,yBAAyB,YAAY,6BAA6B,wBAAwB,eAAe,oBAAoB,UAAU,8BAA8B,KAAK,0QAA0Q,QAAQ,6CAA6C,uBAAuB,kBAAkB,4BAA4B,QAAQ,kCAAkC,QAAQ,2EAA2E,YAAY,+DAA+D,UAAU,6CAA6C,QAAQ,qBAAqB,WAAW,sBAAsB,UAAU,WAAW,0BAA0B,SAAS,kBAAkB,gBAAgB,WAAW,4BAA4B,UAAU,oDAAoD,UAAU,yWAAyW,SAAS,oDAAoD,QAAQ,oDAAoD,SAAS,oDAAoD,UAAU,6BAA6B,SAAS,uBAAuB,WAAW,mGAAmG,UAAU,mBAAmB,YAAY,oBAAoB,iBAAiB,gEAAgE,SAAS,kOAAkO,WAAW,wBAAwB,WAAW,gDAAgD,YAAY,IAAI,QAAQ,KAAK,0BAA0B,4CAA4C,YAAY,YAAY,6EAA6E,UAAU,wBAAwB,QAAQ,mBAAmB,IAAI,0CAA0C,YAAY,aAAa,gCAAgC,QAAQ,+BAA+B,OAAO,kCAAkC,iBAAiB,iBAAiB,iBAAiB,iBAAiB,OAAO,wBAAwB,UAAU,uBAAuB,MAAM,+EAA+E,SAAS,0DAA0D,OAAO,8BAA8B,WAAW,+IAA+I,sBAAsB,UAAU,WAAW,kCAAkC,sCAAsC,GAAG,2DAA2D,8BAA8B,SAAS,SAAS,8BAA8B,WAAW,wBAAwB,SAAS,6DAA6D,iBAAiB,0CAA0C,WAAW,0FAA0F,kBAAkB,6BAA6B,oEAAoE,yBAAyB,SAAS,uBAAuB,WAAW,iBAAiB,SAAS,oCAAoC,QAAQ,sBAAsB,2BAA2B,sBAAsB,4BAA4B,iBAAiB,6BAA6B,sBAAsB,QAAQ,WAAW,wEAAwE,mCAAmC,WAAW,YAAY,gCAAgC,aAAa,0BAA0B,mBAAmB,0BAA0B,kDAAkD,MAAM,2CAA2C,aAAa,6DAA6D,cAAc,4BAA4B,IAAI,oCAAoC,sBAAsB,yCAAyC,MAAM,qBAAqB,YAAY,IAAI,wBAAwB,wFAAwF,SAAS,uEAAuE,EAAE,2EAA2E,8CAA8C,KAAK,uFAAuF,0UAA0U,YAAY,kBAAkB,uBAAuB,qBAAqB,sCAAsC,cAAc,oBAAoB,iBAAiB,sBAAsB,gHAAgH,EAAE,YAAY,wBAAwB,MAAM,gEAAgE,MAAM,kEAAkE,OAAO,oBAAoB,mBAAmB,WAAW,wBAAwB,QAAQ,wCAAwC,QAAQ,wCAAwC,iBAAiB,YAAY,UAAU,6BAA6B,UAAU,sBAAsB,uBAAuB,OAAO,eAAe,WAAW,KAAK,oGAAoG,EAAE,SAAS,aAAa,iCAAiC,wBAAwB,sBAAsB,OAAO,0BAA0B,mBAAmB,WAAW,uBAAuB,UAAU,oBAAoB,4DAA4D,SAAS,4BAA4B,iBAAiB,kKAAkK,KAAK,wBAAwB,KAAK,yBAAyB,MAAM,gBAAgB,sCAAsC,IAAI,4DAA4D,oBAAoB,SAAS,4CAA4C,gBAAgB,qBAAqB,aAAa,IAAI,GAAG,iBAAiB,kBAAkB,oDAAoD,4CAA4C,gBAAgB,oBAAoB,eAAe,6DAA6D,sBAAsB,oBAAoB,mDAAmD,qBAAqB,yDAAyD,gBAAgB,kCAAkC,sBAAsB,mDAAmD,+CAA+C,4BAA4B,yCAAyC,kBAAkB,UAAU,mJAAmJ,8BAA8B,uCAAuC,WAAW,MAAM,iBAAiB,kCAAkC,oFAAoF,0BAA0B,KAAK,oEAAoE,YAAY,2BAA2B,2BAA2B,6BAA6B,uEAAuE,wBAAwB,uBAAuB,mBAAmB,KAAK,wBAAwB,kEAAkE,iBAAiB,qBAAqB,qBAAqB,KAAK,uBAAuB,uBAAuB,kBAAkB,KAAK,yBAAyB,kEAAkE,kBAAkB,qBAAqB,sBAAsB,KAAK,yBAAyB,uBAAuB,gBAAgB,KAAK,wBAAwB,uBAAuB,eAAe,KAAK,oCAAoC,mEAAmE,gBAAgB,KAAK,qBAAqB,+BAA+B,cAAc,uBAAuB,+FAA+F,YAAY,kBAAkB,kCAAkC,qBAAqB,8CAA8C,0BAA0B,mBAAmB,uBAAuB,6BAA6B,YAAY,qMAAqM,2MAA2M,wBAAwB,8CAA8C,GAAG,IAAI,gBAAgB,uBAAuB,mCAAmC,sBAAsB,yEAAyE,4BAA4B,4CAA4C,qBAAqB,IAAI,mCAAmC,4EAA4E,UAAU,wBAAwB,wBAAwB,mDAAmD,mEAAmE,oBAAoB,oCAAoC,yBAAyB,gCAAgC,iCAAiC,sBAAsB,wBAAwB,sBAAsB,EAAE,+CAA+C,iCAAiC,EAAE,oBAAoB,kBAAkB,6BAA6B,sDAAsD,QAAQ,yCAAyC,+DAA+D,qCAAqC,kBAAkB,kBAAkB,oBAAoB,mBAAmB,qBAAqB,UAAU,YAAY,UAAU,aAAa,aAAa,qBAAqB,eAAe,yBAAyB,eAAe,yBAAyB,eAAe,wDAAwD,eAAe,wDAAwD,eAAe,yBAAyB,eAAe,yBAAyB,eAAe,wDAAwD,eAAe,wDAAwD,cAAc,QAAQ,qEAAqE,oBAAoB,mBAAmB,wBAAwB,UAAU,oBAAoB,0EAA0E,wBAAwB,6BAA6B,4CAA4C,GAAG,kBAAkB,oBAAoB,mDAAmD,SAAS,WAAW,wEAAwE,+BAA+B,kDAAkD,0BAA0B,iBAAiB,+DAA+D,0BAA0B,aAAa,0BAA0B,EAAE,iBAAiB,+DAA+D,0BAA0B,aAAa,0BAA0B,EAAE,iBAAiB,WAAW,8BAA8B,oBAAoB,iBAAiB,mDAAmD,YAAY,iEAAiE,OAAO,cAAc,UAAU,yCAAyC,WAAW,kBAAkB,UAAU,iEAAiE,MAAM,+BAA+B,YAAY,WAAW,eAAe,mCAAmC,OAAO,0BAA0B,qCAAqC,IAAI,mBAAmB,oBAAoB,mBAAmB,wBAAwB,YAAY,gEAAgE,OAAO,cAAc,UAAU,yCAAyC,WAAW,kBAAkB,UAAU,iEAAiE,MAAM,+BAA+B,GAAG,WAAW,cAAc,kCAAkC,OAAO,2BAA2B,wCAAwC,uDAAuD,EAAE,IAAI,kBAAkB,oBAAoB,mBAAmB,sBAAsB,UAAU,kBAAkB,2BAA2B,gCAAgC,wBAAwB,yLAAyL,sCAAsC,MAAM,gCAAgC,mBAAmB,8HAA8H,SAAS,MAAM,gBAAgB,WAAW,uBAAuB,4CAA4C,IAAI,gBAAgB,oBAAoB,OAAO,8BAA8B,iCAAiC,4EAA4E,uBAAuB,UAAU,oBAAoB,8DAA8D,KAAK,wCAAwC,YAAY,eAAe,WAAW,kHAAkH,uBAAuB,IAAI,2BAA2B,SAAS,UAAU,MAAM,oBAAoB,oBAAoB,KAAK,gHAAgH,YAAY,SAAS,OAAO,yDAAyD,WAAW,WAAW,0BAA0B,IAAI,8BAA8B,mBAAmB,aAAa,kCAAkC,cAAc,kCAAkC,sBAAsB,IAAI,EAAE,mBAAmB,sDAAsD,aAAa,QAAQ,2CAA2C,wDAAwD,eAAe,wDAAwD,mBAAmB,oBAAoB,6CAA6C,oBAAoB,oBAAoB,+CAA+C,oBAAoB,mBAAmB,qBAAqB,QAAQ,qFAAqF,UAAU,kDAAkD,cAAc,2CAA2C,oBAAoB,kCAAkC,UAAU,oBAAoB,gEAAgE,YAAY,WAAW,uBAAuB,wEAAwE,IAAI,eAAe,oBAAoB,mBAAmB,uBAAuB,UAAU,mCAAmC,UAAU,6BAA6B,SAAS,0CAA0C,WAAW,4BAA4B,UAAU,iEAAiE,SAAS,mCAAmC,iBAAiB,mBAAmB,yDAAyD,GAAG,WAAW,aAAa,iCAAiC,OAAO,0BAA0B,gGAAgG,GAAG,SAAS,gBAAgB,iBAAiB,6HAA6H,iBAAiB,UAAU,gBAAgB,SAAS,kBAAkB,gCAAgC,iBAAiB,6BAA6B,iBAAiB,+BAA+B,0BAA0B,mBAAmB,uIAAuI,2BAA2B,4BAA4B,QAAQ,gDAAgD,sBAAsB,iBAAiB,sFAAsF,SAAS,OAAO,UAAU,oBAAoB,uBAAuB,2BAA2B,YAAY,uDAAuD,oBAAoB,eAAe,uBAAuB,QAAQ,cAAc,cAAc,8BAA8B,cAAc,6HAA6H,wBAAwB,oBAAoB,uBAAuB,sCAAsC,cAAc,+BAA+B,mCAAmC,kBAAkB,qBAAqB,+DAA+D,0EAA0E,MAAM,0DAA0D,EAAE,oBAAoB,kCAAkC,sCAAsC,cAAc,+BAA+B,mCAAmC,kBAAkB,YAAY,0BAA0B,0CAA0C,qIAAqI,MAAM,mDAAmD,EAAE,UAAU,wCAAwC,KAAK,kBAAkB,+CAA+C,iBAAiB,yCAAyC,iBAAiB,2BAA2B,iBAAiB,2BAA2B,iBAAiB,6DAA6D,iBAAiB,mDAAmD,iBAAiB,mDAAmD,iBAAiB,yCAAyC,mBAAmB,6BAA6B,iBAAiB,mEAAmE,2BAA2B,wBAAwB,IAAI,0BAA0B,uBAAuB,yBAAyB,8BAA8B,4CAA4C,4BAA4B,IAAI,4BAA4B,qBAAqB,sBAAsB,eAAe,6EAA6E,iBAAiB,qBAAqB,mBAAmB,mBAAmB,KAAK,gDAAgD,gCAAgC,mDAAmD,iBAAiB,+CAA+C,qHAAqH,eAAe,kDAAkD,qBAAqB,0CAA0C,gCAAgC,eAAe,8BAA8B,4DAA4D,yBAAyB,eAAe,sCAAsC,oBAAoB,OAAO,mFAAmF,UAAU,oBAAoB,gEAAgE,KAAK,uRAAuR,YAAY,gBAAgB,4FAA4F,aAAa,SAAS,kIAAkI,KAAK,8BAA8B,oHAAoH,eAAe,uBAAuB,KAAK,0CAA0C,MAAM,KAAK,kCAAkC,KAAK,uBAAuB,aAAa,SAAS,0BAA0B,0BAA0B,KAAK,0BAA0B,kCAAkC,SAAS,0BAA0B,KAAK,+BAA+B,aAAa,SAAS,yCAAyC,iEAAiE,IAAI,UAAU,oBAAoB,QAAQ,mFAAmF,KAAK,8qBAA8qB,YAAY,WAAW,mBAAmB,SAAS,uBAAuB,IAAI,2NAA2N,aAAa,QAAQ,aAAa,iBAAiB,mLAAmL,SAAS,eAAe,kHAAkH,MAAM,aAAa,8DAA8D,8DAA8D,IAAI,OAAO,mEAAmE,YAAY,MAAM,QAAQ,yDAAyD,WAAW,oDAAoD,MAAM,qDAAqD,QAAQ,8CAA8C,QAAQ,6BAA6B,wBAAwB,+TAA+T,mBAAmB,MAAM,SAAS,kBAAkB,gBAAgB,QAAQ,mDAAmD,UAAU,mBAAmB,UAAU,mBAAmB,SAAS,kBAAkB,gBAAgB,QAAQ,6BAA6B,yGAAyG,yCAAyC,UAAU,aAAa,0FAA0F,aAAa,kFAAkF,2CAA2C,SAAS,kBAAkB,gBAAgB,SAAS,iCAAiC,IAAI,4BAA4B,kEAAkE,+BAA+B,YAAY,QAAQ,sEAAsE,QAAQ,WAAW,kBAAkB,yCAAyC,4BAA4B,qEAAqE,UAAU,mBAAmB,UAAU,UAAU,eAAe,KAAK,SAAS,EAAE,0DAA0D,wBAAwB,UAAU,oBAAoB,kBAAkB,yBAAyB,cAAc,MAAM,MAAM,iEAAiE,cAAc,0BAA0B,EAAE,oBAAoB,mBAAmB,qBAAqB,QAAQ,yDAAyD,QAAQ,+BAA+B,UAAU,iEAAiE,UAAU,6CAA6C,QAAQ,8FAA8F,UAAU,oBAAoB,0DAA0D,SAAS,iEAAiE,KAAK,wDAAwD,KAAK,yDAAyD,8BAA8B,WAAW,oBAAoB,wCAAwC,IAAI,eAAe,QAAQ,gCAAgC,8DAA8D,kBAAkB,+BAA+B,oBAAoB,kDAAkD,kBAAkB,mGAAmG,oBAAoB,oBAAoB,iEAAiE,oBAAoB,mBAAmB,yBAAyB,GAAG,WAAW,uBAAuB,wCAAwC,IAAI,oCAAoC,oBAAoB,mBAAmB,0BAA0B,GAAG,WAAW,wBAAwB,wCAAwC,IAAI,qCAAqC,oBAAoB,mBAAmB,sBAAsB,MAAM,YAAY,KAAK,WAAW,sBAAsB,kCAAkC,IAAI,eAAe,SAAS,cAAc,iCAAiC,QAAQ,sCAAsC,OAAO,oCAAoC,QAAQ,2BAA2B,6BAA6B,oGAAoG,UAAU,4JAA4J,QAAQ,oBAAoB,wHAAwH,UAAU,mIAAmI,wBAAwB,MAAM,EAAE,oFAAoF,cAAc,OAAO,+CAA+C,aAAa,EAAE,oFAAoF,cAAc,8BAA8B,oFAAoF,gBAAgB,6BAA6B,iBAAiB,+BAA+B,oBAAoB,iCAAiC,UAAU,WAAW,2BAA2B,KAAK,uEAAuE,EAAE,WAAW,yBAAyB,KAAK,6BAA6B,UAAU,WAAW,KAAK,wBAAwB,KAAK,kGAAkG,gBAAgB,sCAAsC,OAAO,4CAA4C,eAAe,iBAAiB,qCAAqC,oBAAoB,kBAAkB,wTAAwT,SAAS,wBAAwB,SAAS,6DAA6D,aAAa,2DAA2D,+BAA+B,uBAAuB,4DAA4D,wBAAwB,oBAAoB,kDAAkD,qBAAqB,uDAAuD,QAAQ,wCAAwC,WAAW,oDAAoD,OAAO,qDAAqD,WAAW,qBAAqB,iCAAiC,oBAAoB,0BAA0B,gBAAgB,wCAAwC,QAAQ,0BAA0B,+CAA+C,4CAA4C,+BAA+B,wBAAwB,qCAAqC,qBAAqB,KAAK,8EAA8E,iCAAiC,wBAAwB,gCAAgC,uBAAuB,qDAAqD,yLAAyL,QAAQ,+BAA+B,UAAU,0DAA0D,SAAS,gDAAgD,OAAO,iCAAiC,QAAQ,4DAA4D,cAAc,sCAAsC,0FAA0F,aAAa,qEAAqE,gBAAgB,gJAAgJ,cAAc,2BAA2B,6BAA6B,SAAS,sDAAsD,0IAA0I,+BAA+B,IAAI,EAAE,oCAAoC,iCAAiC,SAAS,mCAAmC,IAAI,KAAK,oCAAoC,QAAQ,2BAA2B,yJAAyJ,4JAA4J,GAAG,SAAS,qBAAqB,gGAAgG,EAAE,oBAAoB,eAAe,yRAAyR,0QAA0Q,uBAAuB,iBAAiB,kLAAkL,kDAAkD,UAAU,kDAAkD,kBAAkB,0CAA0C,SAAS,6BAA6B,eAAe,gDAAgD,6HAA6H,iBAAiB,mCAAmC,2BAA2B,8HAA8H,SAAS,yBAAyB,WAAW,0DAA0D,UAAU,0BAA0B,QAAQ,oCAAoC,WAAW,uEAAuE,SAAS,sBAAsB,YAAY,uJAAuJ,SAAS,kCAAkC,YAAY,mEAAmE,iCAAiC,+CAA+C,oBAAoB,WAAW,oDAAoD,YAAY,6FAA6F,MAAM,YAAY,oBAAoB,sFAAsF,iCAAiC,aAAa,mEAAmE,6CAA6C,6CAA6C,YAAY,mFAAmF,eAAe,yBAAyB,mFAAmF,oDAAoD,QAAQ,2DAA2D,WAAW,mDAAmD,gBAAgB,8GAA8G,iCAAiC,QAAQ,6BAA6B,6BAA6B,gEAAgE,qBAAqB,4FAA4F,qDAAqD,4BAA4B,iDAAiD,SAAS,kKAAkK,QAAQ,6BAA6B,qBAAqB,yBAAyB,YAAY,yDAAyD,aAAa,wBAAwB,kCAAkC,eAAe,2DAA2D,IAAI,KAAK,gEAAgE,iEAAiE,sBAAsB,qBAAqB,mDAAmD,sBAAsB,wBAAwB,aAAa,QAAQ,SAAS,iCAAiC,IAAI,KAAK,+CAA+C,8CAA8C,SAAS,oBAAoB,qBAAqB,yCAAyC,qDAAqD,kCAAkC,oJAAoJ,wBAAwB,sBAAsB,UAAU,QAAQ,SAAS,gCAAgC,wCAAwC,6BAA6B,WAAW,aAAa,6DAA6D,EAAE,mDAAmD,cAAc,sEAAsE,qHAAqH,SAAS,cAAc,4BAA4B,OAAO,mCAAmC,eAAe,kDAAkD,eAAe,iCAAiC,8GAA8G,UAAU,8BAA8B,gEAAgE,WAAW,2CAA2C,SAAS,uBAAuB,QAAQ,WAAW,YAAY,sBAAsB,KAAK,wBAAwB,oIAAoI,KAAK,kBAAkB,uBAAuB,2BAA2B,YAAY,UAAU,8BAA8B,2DAA2D,GAAG,SAAS,eAAe,6CAA6C,4FAA4F,YAAY,2BAA2B,iCAAiC,8CAA8C,sBAAsB,6FAA6F,eAAe,+GAA+G,kBAAkB,wFAAwF,QAAQ,UAAU,kCAAkC,UAAU,iCAAiC,kBAAkB,+CAA+C,MAAM,EAAE,QAAQ,sCAAsC,mDAAmD,8BAA8B,+BAA+B,eAAe,qDAAqD,eAAe,6DAA6D,MAAM,aAAa,0DAA0D,6BAA6B,iCAAiC,mCAAmC,mCAAmC,WAAW,6CAA6C,0CAA0C,8BAA8B,gCAAgC,eAAe,+CAA+C,iBAAiB,YAAY,wCAAwC,kBAAkB,yFAAyF,2BAA2B,uCAAuC,4CAA4C,cAAc,8BAA8B,gHAAgH,eAAe,yBAAyB,MAAM,QAAQ,gDAAgD,cAAc,kBAAkB,+BAA+B,MAAM,sCAAsC,0GAA0G,cAAc,sFAAsF,gBAAgB,+EAA+E,eAAe,iFAAiF,eAAe,qEAAqE,QAAQ,gCAAgC,MAAM,gCAAgC,SAAS,qCAAqC,SAAS,qCAAqC,YAAY,wBAAwB,wBAAwB,kDAAkD,oCAAoC,WAAW,8BAA8B,0CAA0C,eAAe,2CAA2C,eAAe,kBAAkB,mCAAmC,mBAAmB,sCAAsC,oCAAoC,8BAA8B,4BAA4B,eAAe,2CAA2C,mCAAmC,mBAAmB,sCAAsC,OAAO,iCAAiC,OAAO,iCAAiC,WAAW,sBAAsB,aAAa,wBAAwB,WAAW,MAAM,kHAAkH,UAAU,oCAAoC,WAAW,qCAAqC,eAAe,oDAAoD,2CAA2C,mEAAmE,8BAA8B,8BAA8B,eAAe,4CAA4C,wCAAwC,YAAY,sCAAsC,kBAAkB,oDAAoD,WAAW,sCAAsC,4DAA4D,2JAA2J,QAAQ,0BAA0B,iBAAiB,oBAAoB,mBAAmB,qCAAqC,OAAO,6FAA6F,SAAS,0IAA0I,YAAY,gCAAgC,sBAAsB,0EAA0E,kBAAkB,kBAAkB,wBAAwB,wDAAwD,OAAO,wCAAwC,GAAG,WAAW,qBAAqB,wBAAwB,IAAI,iBAAiB,oBAAoB,mBAAmB,wBAAwB,GAAG,WAAW,qBAAqB,wBAAwB,IAAI,iBAAiB,QAAQ,iCAAiC,8FAA8F,mBAAmB,yCAAyC,6BAA6B,uDAAuD,6BAA6B,uDAAuD,kCAAkC,0BAA0B,8BAA8B,yDAAyD,8BAA8B,yDAAyD,oCAAoC,4BAA4B,gBAAgB,wBAAwB,gBAAgB,wBAAwB,qBAAqB,wBAAwB,mBAAmB,8BAA8B,oBAAoB,mBAAmB,kFAAkF,WAAW,4EAA4E,WAAW,yDAAyD,aAAa,QAAQ,yBAAyB,uBAAuB,yFAAyF,sGAAsG,wBAAwB,YAAY,WAAW,+DAA+D,QAAQ,eAAe,6BAA6B,QAAQ,KAAK,uBAAuB,IAAI,iIAAiI,SAAS,iEAAiE,iDAAiD,IAAI,uBAAuB,iCAAiC,YAAY,WAAW,uBAAuB,gCAAgC,2BAA2B,iCAAiC,IAAI,eAAe,oBAAoB,mBAAmB,qCAAqC,MAAM,yBAAyB,MAAM,yBAAyB,UAAU,qBAAqB,sBAAsB,kCAAkC,qHAAqH,sCAAsC,QAAQ,sKAAsK,YAAY,OAAO,wBAAwB,eAAe,qDAAqD,GAAG,OAAO,uBAAuB,iCAAiC,gBAAgB,oBAAoB,mBAAmB,uBAAuB,UAAU,wBAAwB,MAAM,wBAAwB,MAAM,kBAAkB,QAAQ,yCAAyC,MAAM,yCAAyC,KAAK,WAAW,wBAAwB,0CAA0C,IAAI,iBAAiB,oBAAoB,mBAAmB,yBAAyB,SAAS,2CAA2C,WAAW,kBAAkB,UAAU,+CAA+C,GAAG,WAAW,mBAAmB,+BAA+B,GAAG,UAAU,UAAU,mCAAmC,aAAa,sDAAsD,mDAAmD,UAAU,qCAAqC,mBAAmB,oBAAoB,mBAAmB,+BAA+B,GAAG,WAAW,+BAA+B,kCAAkC,IAAI,wBAAwB,QAAQ,mCAAmC,wCAAwC,MAAM,IAAI,WAAW,SAAS,OAAO,2FAA2F,gBAAgB,QAAQ,gBAAgB,uBAAuB,gBAAgB,uBAAuB,kCAAkC,+CAA+C,sCAAsC,sBAAsB,uBAAuB,kCAAkC,4DAA4D,wCAAwC,iDAAiD,qBAAqB,QAAQ,iCAAiC,+CAA+C,6BAA6B,sCAAsC,6BAA6B,wCAAwC,oBAAoB,mBAAmB,mBAAmB,YAAY,WAAW,oBAAoB,wBAAwB,IAAI,YAAY,oBAAoB,mBAAmB,kBAAkB,UAAU,6BAA6B,MAAM,8BAA8B,YAAY,WAAW,oBAAoB,8BAA8B,GAAG,UAAU,SAAS,sBAAsB,kBAAkB,mBAAmB,2BAA2B,mBAAmB,qCAAqC,WAAW,oBAAoB,gFAAgF,UAAU,sBAAsB,uDAAuD,YAAY,oBAAoB,mBAAmB,qBAAqB,SAAS,2CAA2C,WAAW,kBAAkB,UAAU,0CAA0C,GAAG,WAAW,mBAAmB,+BAA+B,GAAG,UAAU,SAAS,8BAA8B,aAAa,sDAAsD,8CAA8C,UAAU,gCAAgC,eAAe,oBAAoB,mBAAmB,qBAAqB,UAAU,iDAAiD,4DAA4D,iKAAiK,GAAG,UAAU,qBAAqB,wCAAwC,eAAe,oBAAoB,mBAAmB,sBAAsB,cAAc,qCAAqC,aAAa,EAAE,+BAA+B,wBAAwB,EAAE,UAAU,kCAAkC,eAAe,eAAe,UAAU,EAAE,oCAAoC,EAAE,YAAY,IAAI,QAAQ,SAAS,WAAW,kCAAkC,iBAAiB,qCAAqC,gBAAgB,oBAAoB,mBAAmB,yBAAyB,QAAQ,qBAAqB,wBAAwB,QAAQ,qBAAqB,WAAW,uCAAuC,QAAQ,+BAA+B,GAAG,WAAW,0BAA0B,mDAAmD,GAAG,OAAO,yBAAyB,eAAe,MAAM,0EAA0E,uBAAuB,uBAAuB,mBAAmB,cAAc,iCAAiC,OAAO,oBAAoB,+EAA+E,aAAa,kFAAkF,8CAA8C,oBAAoB,mBAAmB,oBAAoB,SAAS,0CAA0C,GAAG,WAAW,qBAAqB,iCAAiC,IAAI,cAAc,WAAW,sWAAsW,aAAa,aAAa,sCAAsC,SAAS,qEAAqE,UAAU,iDAAiD,EAAE,4BAA4B,UAAU,qCAAqC,KAAK,qHAAqH,yCAAyC,4CAA4C,4BAA4B,qBAAqB,oDAAoD,QAAQ,eAAe,KAAK,YAAY,mCAAmC,2BAA2B,MAAM,mBAAmB,MAAM,mBAAmB,KAAK,6CAA6C,aAAa,aAAa,sCAAsC,SAAS,aAAa,0vFAA0vF,qBAAqB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,sCAAsC,eAAe,aAAa,sCAAsC,SAAS,6CAA6C,wBAAwB,cAAc,yCAAyC,gEAAgE,EAAE,mDAAmD,qDAAqD,mBAAmB,IAAI,aAAa,MAAM,aAAa,qBAAqB,8FAA8F,EAAE,0IAA0I,mEAAmE,qBAAqB,OAAO,qCAAqC,mCAAmC,aAAa,MAAM,mBAAmB,qCAAqC,OAAO,8CAA8C,qCAAqC,OAAO,+CAA+C,gBAAgB,aAAa,aAAa,sCAAsC,SAAS,EAAE,SAAS,MAAM,oBAAoB,YAAY,uBAAuB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,0iBAA0iB,YAAY,gCAAgC,6BAA6B,eAAe,mCAAmC,6BAA6B,gBAAgB,2CAA2C,6BAA6B,wBAAwB,uCAAuC,6BAA6B,oBAAoB,uCAAuC,6BAA6B,oBAAoB,iCAAiC,6BAA6B,cAAc,mCAAmC,6BAA6B,gBAAgB,oCAAoC,6BAA6B,iBAAiB,iDAAiD,6BAA6B,8BAA8B,kDAAkD,6BAA6B,+BAA+B,oDAAoD,6BAA6B,iCAAiC,yCAAyC,6BAA6B,sBAAsB,2DAA2D,6BAA6B,wCAAwC,sDAAsD,6BAA6B,mCAAmC,EAAE,YAAY,gCAAgC,6BAA6B,kBAAkB,EAAE,YAAY,+BAA+B,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,EAAE,iBAAiB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,kFAAkF,SAAS,aAAa,sCAAsC,SAAS,EAAE,SAAS,aAAa,sCAAsC,SAAS,EAAE,SAAS,aAAa,MAAM,sCAAsC,SAAS,sEAAsE,2CAA2C,SAAS,aAAa,sCAAsC,SAAS,EAAE,SAAS,aAAa,sCAAsC,SAAS,EAAE,SAAS,aAAa,MAAM,sCAAsC,SAAS,gEAAgE,iDAAiD,SAAS,aAAa,sCAAsC,SAAS,EAAE,SAAS,aAAa,sCAAsC,SAAS,EAAE,WAAW,aAAa,cAAc,oHAAoH,EAAE,oFAAoF,WAAW,aAAa,cAAc,iGAAiG,EAAE,+EAA+E,cAAc,IAAI,kBAAkB,cAAc,WAAW,gBAAgB,4DAA4D,mCAAmC,+BAA+B,IAAI,8BAA8B,oBAAoB,EAAE,WAAW,aAAa,cAAc,mXAAmX,EAAE,YAAY,aAAa,0BAA0B,mEAAmE,cAAc,0BAA0B,iDAAiD,gBAAgB,iDAAiD,cAAc,qCAAqC,oBAAoB,0BAA0B,qCAAqC,sBAAsB,qCAAqC,gBAAgB,UAAU,WAAW,iBAAiB,6CAA6C,SAAS,gBAAgB,0CAA0C,8DAA8D,gBAAgB,WAAW,gDAAgD,cAAc,2BAA2B,kBAAkB,4DAA4D,6DAA6D,kBAAkB,4DAA4D,+DAA+D,kBAAkB,8CAA8C,6CAA6C,gBAAgB,gCAAgC,sCAAsC,gBAAgB,2CAA2C,cAAc,qDAAqD,cAAc,uCAAuC,oBAAoB,sEAAsE,kBAAkB,qEAAqE,kBAAkB,qEAAqE,gBAAgB,0DAA0D,gBAAgB,4DAA4D,8PAA8P,kBAAkB,yDAAyD,oBAAoB,6EAA6E,YAAY,WAAW,aAAa,cAAc,iXAAiX,EAAE,YAAY,aAAa,0BAA0B,iFAAiF,cAAc,0BAA0B,qEAAqE,gBAAgB,qEAAqE,cAAc,mDAAmD,wBAAwB,0BAA0B,mDAAmD,0BAA0B,mDAAmD,gBAAgB,wDAAwD,gGAAgG,cAAc,2BAA2B,kBAAkB,wFAAwF,2FAA2F,kBAAkB,0EAA0E,6EAA6E,kBAAkB,4DAA4D,2DAA2D,kBAAkB,4DAA4D,mEAAmE,gBAAgB,gCAAgC,oDAAoD,gBAAgB,yDAAyD,gBAAgB,yDAAyD,cAAc,0EAA0E,cAAc,mDAAmD,kBAAkB,mGAAmG,kBAAkB,mGAAmG,kBAAkB,iFAAiF,oBAAoB,+GAA+G,gBAAgB,oFAAoF,gBAAgB,wFAAwF,0XAA0X,YAAY,WAAW,aAAa,cAAc,meAAme,EAAE,YAAY,aAAa,0BAA0B,sGAAsG,gBAAgB,oGAAoG,cAAc,0BAA0B,mGAAmG,gBAAgB,mGAAmG,8BAA8B,0BAA0B,wEAAwE,gCAAgC,wEAAwE,cAAc,wEAAwE,gBAAgB,UAAU,yBAAyB,mDAAmD,+FAA+F,SAAS,gBAAgB,gHAAgH,4JAA4J,gBAAgB,mEAAmE,8HAA8H,cAAc,mEAAmE,4CAA4C,kBAAkB,kIAAkI,kKAAkK,kBAAkB,iFAAiF,gGAAgG,kBAAkB,+FAA+F,4GAA4G,kBAAkB,kBAAkB,+GAA+G,gBAAgB,8EAA8E,gBAAgB,gCAAgC,yEAAyE,gBAAgB,8EAA8E,gBAAgB,0FAA0F,gBAAgB,wGAAwG,gGAAgG,gBAAgB,4QAA4Q,qNAAqN,kBAAkB,8EAA8E,cAAc,uGAAuG,cAAc,gEAAgE,kBAAkB,gJAAgJ,kBAAkB,gJAAgJ,kBAAkB,qHAAqH,oBAAoB,kKAAkK,gBAAgB,2HAA2H,gBAAgB,kIAAkI,ojBAAojB,YAAY,WAAW,aAAa,cAAc,+xBAA+xB,EAAE,YAAY,aAAa,2BAA2B,6JAA6J,cAAc,2BAA2B,qLAAqL,gBAAgB,qLAAqL,4CAA4C,2BAA2B,+HAA+H,8CAA8C,+HAA+H,cAAc,+HAA+H,gBAAgB,UAAU,+CAA+C,6GAA6G,iLAAiL,SAAS,gBAAgB,4QAA4Q,8WAA8W,gBAAgB,0HAA0H,urBAAurB,cAAc,0HAA0H,8HAA8H,kBAAkB,sJAAsJ,ybAAyb,kBAAkB,iDAAiD,qaAAqa,kBAAkB,yBAAyB,6MAA6M,oBAAoB,6FAA6F,ohBAAohB,kBAAkB,0FAA0F,oNAAoN,kBAAkB,0FAA0F,oNAAoN,kBAAkB,wFAAwF,sNAAsN,gBAAgB,wIAAwI,gBAAgB,wIAAwI,kBAAkB,mDAAmD,yQAAyQ,gBAAgB,gCAAgC,gIAAgI,gBAAgB,gCAAgC,gIAAgI,gBAAgB,gCAAgC,gIAAgI,kBAAkB,wGAAwG,sKAAsK,gBAAgB,uGAAuG,sLAAsL,gBAAgB,0CAA0C,gBAAgB,oEAAoE,8EAA8E,gBAAgB,0BAA0B,OAAO,6HAA6H,kUAAkU,oBAAoB,6HAA6H,0MAA0M,sBAAsB,wPAAwP,wLAAwL,gBAAgB,wGAAwG,uJAAuJ,0BAA0B,kCAAkC,gKAAgK,sBAAsB,wBAAwB,iMAAiM,oBAAoB,+KAA+K,iKAAiK,0BAA0B,kCAAkC,yJAAyJ,oBAAoB,uFAAuF,0dAA0d,oBAAoB,uFAAuF,qCAAqC,kCAAkC,mMAAmM,cAAc,mLAAmL,cAAc,yGAAyG,kBAAkB,2QAA2Q,kBAAkB,2QAA2Q,kBAAkB,qNAAqN,oBAAoB,2SAA2S,gBAAgB,kOAAkO,gBAAgB,gPAAgP,s+BAAs+B,YAAY,WAAW,aAAa,cAAc,ihBAAihB,EAAE,oCAAoC,aAAa,0BAA0B,mEAAmE,cAAc,qCAAqC,kBAAkB,MAAM,kBAAkB,8DAA8D,gBAAgB,wCAAwC,kFAAkF,gBAAgB,aAAa,0BAA0B,kBAAkB,4DAA4D,6FAA6F,kBAAkB,MAAM,4DAA4D,6DAA6D,kBAAkB,MAAM,4DAA4D,6DAA6D,kBAAkB,MAAM,4DAA4D,6DAA6D,gBAAgB,yBAAyB,sEAAsE,gBAAgB,+FAA+F,uDAAuD,gBAAgB,mFAAmF,sEAAsE,kBAAkB,gCAAgC,oBAAoB,sEAAsE,+MAA+M,cAAc,2EAA2E,6HAA6H,gBAAgB,4DAA4D,gDAAgD,gBAAgB,oDAAoD,gBAAgB,uBAAuB,kGAAkG,KAAK,QAAQ,sCAAsC,wBAAwB,4IAA4I,SAAS,oBAAoB,qBAAqB,eAAe,wFAAwF,6EAA6E,cAAc,qDAAqD,2PAA2P,iBAAiB,4MAA4M,uCAAuC,kDAAkD,oCAAoC,gHAAgH,EAAE,WAAW,aAAa,cAAc,giBAAgiB,EAAE,YAAY,aAAa,0BAA0B,mEAAmE,cAAc,0BAA0B,iDAAiD,oBAAoB,0BAA0B,qCAAqC,gBAAgB,iDAAiD,sBAAsB,qCAAqC,kBAAkB,qEAAqE,kBAAkB,qEAAqE,kBAAkB,qEAAqE,kBAAkB,qEAAqE,gBAAgB,6FAA6F,gBAAgB,iGAAiG,kBAAkB,6GAA6G,kBAAkB,6GAA6G,gBAAgB,iGAAiG,kBAAkB,yDAAyD,oBAAoB,6EAA6E,gBAAgB,oDAAoD,2BAA2B,gBAAgB,oDAAoD,uBAAuB,cAAc,gCAAgC,2BAA2B,cAAc,gCAAgC,uBAAuB,gBAAgB,qDAAqD,gBAAgB,yDAAyD,gBAAgB,kDAAkD,qEAAqE,gBAAgB,+CAA+C,oBAAoB,oKAAoK,+EAA+E,oBAAoB,gCAAgC,iFAAiF,gBAAgB,gBAAgB,OAAO,GAAG,4CAA4C,YAAY,GAAG,4CAA4C,YAAY,yBAAyB,iDAAiD,kBAAkB,gCAAgC,mJAAmJ,kBAAkB,8GAA8G,2FAA2F,cAAc,qCAAqC,cAAc,qDAAqD,gBAAgB,0DAA0D,gBAAgB,4DAA4D,8PAA8P,iEAAiE,QAAQ,gEAAgE,IAAI,0GAA0G,SAAS,EAAE,WAAW,aAAa,cAAc,qoBAAqoB,EAAE,YAAY,aAAa,0BAA0B,4DAA4D,cAAc,0BAA0B,uCAAuC,cAAc,yBAAyB,yBAAyB,kBAAkB,0BAA0B,8BAA8B,gBAAgB,uCAAuC,oBAAoB,8BAA8B,kBAAkB,sDAAsD,kBAAkB,sDAAsD,kBAAkB,sDAAsD,kBAAkB,sDAAsD,gBAAgB,wEAAwE,gBAAgB,2EAA2E,kBAAkB,oFAAoF,kBAAkB,oFAAoF,gBAAgB,2EAA2E,kBAAkB,6CAA6C,oBAAoB,4DAA4D,gBAAgB,wCAAwC,yBAAyB,gBAAgB,wCAAwC,mBAAmB,cAAc,yBAAyB,mBAAmB,gBAAgB,0CAA0C,gBAAgB,6CAA6C,gBAAgB,uCAAuC,qEAAqE,gBAAgB,qCAAqC,kBAAkB,8CAA8C,gDAAgD,oBAAoB,yBAAyB,+DAA+D,wBAAwB,0DAA0D,4GAA4G,wBAAwB,kDAAkD,4GAA4G,gBAAgB,OAAO,iEAAiE,wDAAwD,kBAAkB,uDAAuD,6HAA6H,kBAAkB,yBAAyB,uFAAuF,kBAAkB,uHAAuH,wEAAwE,oBAAoB,cAAc,2LAA2L,oBAAoB,cAAc,2LAA2L,oBAAoB,cAAc,2LAA2L,gBAAgB,4GAA4G,6CAA6C,cAAc,8BAA8B,cAAc,2CAA2C,gBAAgB,6CAA6C,gBAAgB,8CAA8C,gMAAgM,iEAAiE,QAAQ,gEAAgE,IAAI,kFAAkF,SAAS,EAAE,WAAW,aAAa,cAAc,2mBAA2mB,EAAE,4BAA4B,aAAa,0BAA0B,+FAA+F,cAAc,0BAA0B,yFAAyF,4BAA4B,0BAA0B,iEAAiE,0BAA0B,0BAA0B,4BAA4B,yBAAyB,8EAA8E,kBAAkB,8DAA8D,0GAA0G,gBAAgB,mFAAmF,gBAAgB,6EAA6E,gBAAgB,iBAAiB,mBAAmB,0BAA0B,wCAAwC,gBAAgB,yFAAyF,cAAc,iEAAiE,8BAA8B,iEAAiE,aAAa,gBAAgB,iDAAiD,aAAa,gBAAgB,iDAAiD,gBAAgB,+DAA+D,oFAAoF,kBAAkB,0FAA0F,kHAAkH,kBAAkB,uIAAuI,0IAA0I,kBAAkB,uIAAuI,0IAA0I,kBAAkB,uIAAuI,0IAA0I,kBAAkB,4DAA4D,6MAA6M,kBAAkB,4DAA4D,6MAA6M,oBAAoB,uCAAuC,iCAAiC,MAAM,6FAA6F,oFAAoF,gCAAgC,6FAA6F,kBAAkB,iIAAiI,kBAAkB,oHAAoH,iPAAiP,QAAQ,kBAAkB,yGAAyG,YAAY,oBAAoB,UAAU,kLAAkL,gBAAgB,WAAW,+GAA+G,gBAAgB,+FAA+F,yCAAyC,gBAAgB,WAAW,QAAQ,eAAe,sFAAsF,wFAAwF,SAAS,cAAc,8FAA8F,gBAAgB,8GAA8G,gBAAgB,oHAAoH,ufAAuf,WAAW,aAAa,cAAc,kmBAAkmB,EAAE,YAAY,aAAa,0BAA0B,qDAAqD,cAAc,0BAA0B,6BAA6B,gBAAgB,0BAA0B,uBAAuB,gBAAgB,6BAA6B,kBAAkB,uBAAuB,kBAAkB,uCAAuC,kBAAkB,uCAAuC,kBAAkB,uCAAuC,kBAAkB,uCAAuC,gBAAgB,mDAAmD,gBAAgB,qDAAqD,kBAAkB,2DAA2D,kBAAkB,2DAA2D,gBAAgB,qDAAqD,kBAAkB,iCAAiC,oBAAoB,2CAA2C,gBAAgB,4BAA4B,uBAAuB,gBAAgB,4BAA4B,eAAe,cAAc,kBAAkB,uBAAuB,cAAc,kBAAkB,eAAe,gBAAgB,+BAA+B,gBAAgB,iCAAiC,gBAAgB,4BAA4B,yDAAyD,gBAAgB,2BAA2B,kBAAkB,0BAA0B,4BAA4B,oBAAoB,kBAAkB,6CAA6C,gBAAgB,OAAO,2BAA2B,+CAA+C,kBAAkB,kBAAkB,+CAA+C,kBAAkB,kBAAkB,yDAAyD,kBAAkB,kBAAkB,yDAAyD,kBAAkB,kBAAkB,2DAA2D,oBAAoB,wDAAwD,6CAA6C,gBAAgB,yFAAyF,6CAA6C,cAAc,uBAAuB,cAAc,iCAAiC,gBAAgB,gCAAgC,gBAAgB,gCAAgC,kIAAkI,iEAAiE,QAAQ,gEAAgE,IAAI,0DAA0D,SAAS,EAAE,WAAW,aAAa,sCAAsC,SAAS,iBAAiB,sCAAsC,QAAQ,gBAAgB,EAAE,qtBAAqtB,gBAAgB,wBAAwB,iBAAiB,yBAAyB,cAAc,oEAAoE,+DAA+D,gGAAgG,YAAY,mBAAmB,mCAAmC,IAAI,mDAAmD,UAAU,wCAAwC,cAAc,qBAAqB,UAAU,wFAAwF,YAAY,IAAI,KAAK,aAAa,4NAA4N,oBAAoB,eAAe,qGAAqG,QAAQ,2BAA2B,uBAAuB,IAAI,KAAK,qBAAqB,qBAAqB,YAAY,OAAO,0DAA0D,UAAU,wDAAwD,iBAAiB,iBAAiB,gBAAgB,mCAAmC,IAAI,gGAAgG,qBAAqB,mCAAmC,IAAI,2CAA2C,uCAAuC,4CAA4C,0BAA0B,yCAAyC,8BAA8B,wCAAwC,MAAM,8BAA8B,uBAAuB,kCAAkC,kBAAkB,+DAA+D,yCAAyC,wBAAwB,UAAU,uBAAuB,IAAI,KAAK,aAAa,8CAA8C,QAAQ,YAAY,iBAAiB,8BAA8B,sBAAsB,kEAAkE,yCAAyC,wBAAwB,uBAAuB,IAAI,KAAK,aAAa,+BAA+B,+BAA+B,4DAA4D,0BAA0B,qFAAqF,UAAU,SAAS,aAAa,sCAAsC,SAAS,sBAAsB,QAAQ,mBAAmB,eAAe,MAAM,wJAAwJ,eAAe,QAAQ,4CAA4C,WAAW,kBAAkB,eAAe,MAAM,gDAAgD,WAAW,8BAA8B,mBAAmB,qFAAqF,WAAW,aAAa,sCAAsC,SAAS,iBAAiB,sCAAsC,6BAA6B,gBAAgB,EAAE,0FAA0F,oBAAoB,gBAAgB,WAAW,sBAAsB,uBAAuB,IAAI,iCAAiC,SAAS,kBAAkB,sBAAsB,uBAAuB,IAAI,wCAAwC,SAAS,UAAU,uBAAuB,IAAI,KAAK,4BAA4B,qCAAqC,0CAA0C,kMAAkM,oBAAoB,eAAe,0HAA0H,cAAc,qBAAqB,QAAQ,0CAA0C,2BAA2B,uBAAuB,IAAI,KAAK,qBAAqB,qBAAqB,YAAY,OAAO,0DAA0D,UAAU,iCAAiC,kCAAkC,8BAA8B,SAAS,gBAAgB,mCAAmC,IAAI,oFAAoF,mBAAmB,gEAAgE,cAAc,gCAAgC,2BAA2B,oDAAoD,mCAAmC,IAAI,yJAAyJ,uCAAuC,SAAS,uBAAuB,kEAAkE,gDAAgD,4CAA4C,aAAa,8HAA8H,mBAAmB,0EAA0E,mBAAmB,2EAA2E,YAAY,wGAAwG,QAAQ,4BAA4B,cAAc,2BAA2B,IAAI,mCAAmC,SAAS,gCAAgC,mBAAmB,6EAA6E,4BAA4B,UAAU,yCAAyC,UAAU,WAAW,aAAa,sCAAsC,SAAS,qBAAqB,6IAA6I,6BAA6B,gBAAgB,EAAE,+DAA+D,qCAAqC,aAAa,kUAAkU,udAAud,WAAW,mBAAmB,ieAAie,kBAAkB,gDAAgD,eAAe,oBAAoB,qEAAqE,kBAAkB,2JAA2J,uBAAuB,8LAA8L,gDAAgD,4CAA4C,qBAAqB,QAAQ,oCAAoC,8EAA8E,qTAAqT,UAAU,cAAc,yDAAyD,QAAQ,WAAW,QAAQ,8KAA8K,YAAY,IAAI,gBAAgB,IAAI,SAAS,wJAAwJ,sEAAsE,+BAA+B,wjBAAwjB,MAAM,UAAU,oGAAoG,MAAM,iFAAiF,mLAAmL,sJAAsJ,6kBAA6kB,mEAAmE,kFAAkF,oBAAoB,YAAY,IAAI,MAAM,wBAAwB,wPAAwP,qBAAqB,wCAAwC,2BAA2B,qFAAqF,SAAS,sCAAsC,8EAA8E,iEAAiE,2BAA2B,IAAI,2CAA2C,iBAAiB,cAAc,qBAAqB,qBAAqB,MAAM,6CAA6C,oEAAoE,YAAY,mBAAmB,mBAAmB,0BAA0B,8BAA8B,8BAA8B,mBAAmB,KAAK,kBAAkB,gBAAgB,SAAS,UAAU,+EAA+E,IAAI,KAAK,8BAA8B,GAAG,oHAAoH,oBAAoB,kCAAkC,OAAO,YAAY,kEAAkE,yBAAyB,MAAM,0BAA0B,oBAAoB,kFAAkF,yBAAyB,6BAA6B,sIAAsI,EAAE,WAAW,aAAa,sCAAsC,SAAS,oFAAoF,cAAc,wIAAwI,yJAAyJ,sBAAsB,0CAA0C,0BAA0B,+CAA+C,SAAS,aAAa,sCAAsC,SAAS,EAAE,wBAAwB,eAAe,qBAAqB,2EAA2E,eAAe,oBAAoB,mCAAmC,qMAAqM,uBAAuB,eAAe,uBAAuB,kBAAkB,qBAAqB,kBAAkB,oBAAoB,kBAAkB,8BAA8B,gDAAgD,mBAAmB,sDAAsD,mBAAmB,sDAAsD,mBAAmB,qFAAqF,mBAAmB,sBAAsB,eAAe,sBAAsB,gBAAgB,sBAAsB,mBAAmB,KAAK,OAAO,KAAK,gDAAgD,YAAY,SAAS,aAAa,sCAAsC,SAAS,6HAA6H,YAAY,kBAAkB,WAAW,aAAa,sCAAsC,SAAS,yCAAyC,cAAc,MAAM,aAAa,kFAAkF,iCAAiC,eAAe,YAAY,qCAAqC,YAAY,gDAAgD,eAAe,wIAAwI,aAAa,uTAAuT,cAAc,uNAAuN,2BAA2B,eAAe,kDAAkD,WAAW,sCAAsC,oBAAoB,0CAA0C,mCAAmC,wBAAwB,6IAA6I,uBAAuB,IAAI,yCAAyC,SAAS,wBAAwB,mCAAmC,sCAAsC,uBAAuB,IAAI,mCAAmC,+BAA+B,oBAAoB,SAAS,aAAa,sCAAsC,SAAS,uCAAuC,WAAW,aAAa,sCAAsC,SAAS,sOAAsO,gFAAgF,kBAAkB,uBAAuB,iBAAiB,eAAe,yBAAyB,qBAAqB,yBAAyB,qBAAqB,wBAAwB,kBAAkB,+CAA+C,mCAAmC,SAAS,2BAA2B,yCAAyC,2DAA2D,WAAW,gBAAgB,4BAA4B,qBAAqB,6DAA6D,uBAAuB,gBAAgB,uCAAuC,QAAQ,8BAA8B,oBAAoB,8CAA8C,oBAAoB,IAAI,eAAe,wCAAwC,gBAAgB,qDAAqD,YAAY,IAAI,UAAU,gBAAgB,sCAAsC,OAAO,qCAAqC,4BAA4B,YAAY,IAAI,mCAAmC,SAAS,+BAA+B,aAAa,kBAAkB,oBAAoB,8BAA8B,KAAK,WAAW,6DAA6D,kBAAkB,0FAA0F,IAAI,yCAAyC,0BAA0B,sGAAsG,EAAE,YAAY,uBAAuB,8CAA8C,2CAA2C,sCAAsC,8CAA8C,gCAAgC,gDAAgD,8BAA8B,0BAA0B,4CAA4C,sCAAsC,8CAA8C,gCAAgC,gDAAgD,+BAA+B,uBAAuB,8CAA8C,sCAAsC,gBAAgB,gCAAgC,oCAAoC,+BAA+B,SAAS,oEAAoE,iFAAiF,iBAAiB,iBAAiB,YAAY,IAAI,gBAAgB,4BAA4B,gBAAgB,IAAI,yEAAyE,SAAS,8BAA8B,WAAW,MAAM,YAAY,aAAa,gGAAgG,cAAc,MAAM,sCAAsC,0BAA0B,2BAA2B,YAAY,mBAAmB,iGAAiG,yBAAyB,yCAAyC,4BAA4B,6FAA6F,YAAY,MAAM,iEAAiE,cAAc,4BAA4B,QAAQ,MAAM,WAAW,QAAQ,MAAM,KAAK,+BAA+B,iBAAiB,SAAS,aAAa,iBAAiB,mBAAmB,eAAe,YAAY,WAAW,KAAK,8CAA8C,6CAA6C,uCAAuC,aAAa,8cAA8c,0IAA0I,wBAAwB,qEAAqE,SAAS,kBAAkB,6BAA6B,iBAAiB,SAAS,sBAAsB,6BAA6B,iBAAiB,SAAS,sBAAsB,6BAA6B,kBAAkB,yBAAyB,8LAA8L,mLAAmL,8HAA8H,WAAW,KAAK,uBAAuB,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,oBAAoB,2BAA2B,2NAA2N,wEAAwE,2VAA2V,YAAY,KAAK,oCAAoC,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,4BAA4B,YAAY,KAAK,4CAA4C,uDAAuD,uBAAuB,mDAAmD,SAAS,4DAA4D,GAAG,WAAW,aAAa,sCAAsC,SAAS,iBAAiB,8BAA8B,4BAA4B,eAAe,qTAAqT,WAAW,8DAA8D,kBAAkB,4EAA4E,QAAQ,0EAA0E,mBAAmB,iJAAiJ,oBAAoB,6LAA6L,mBAAmB,yDAAyD,gBAAgB,eAAe,6CAA6C,gEAAgE,2EAA2E,wDAAwD,MAAM,2DAA2D,uBAAuB,IAAI,KAAK,SAAS,QAAQ,6CAA6C,yBAAyB,cAAc,IAAI,6BAA6B,SAAS,MAAM,4DAA4D,YAAY,0JAA0J,UAAU,WAAW,aAAa,sCAAsC,SAAS,0BAA0B,sCAAsC,4BAA4B,gBAAgB,EAAE,MAAM,mNAAmN,6EAA6E,WAAW,iEAAiE,2BAA2B,sQAAsQ,oBAAoB,oCAAoC,QAAQ,sEAAsE,uBAAuB,IAAI,0EAA0E,SAAS,mBAAmB,+CAA+C,gBAAgB,SAAS,gEAAgE,2EAA2E,wDAAwD,MAAM,2DAA2D,2BAA2B,WAAW,oBAAoB,aAAa,gBAAgB,mBAAmB,WAAW,aAAa,sCAAsC,SAAS,qBAAqB,sCAAsC,iCAAiC,gBAAgB,OAAO,8IAA8I,gDAAgD,+GAA+G,eAAe,4DAA4D,2CAA2C,IAAI,wEAAwE,SAAS,WAAW,0CAA0C,kBAAkB,qLAAqL,uBAAuB,uGAAuG,aAAa,SAAS,4BAA4B,MAAM,GAAG,yCAAyC,KAAK,qCAAqC,KAAK,MAAM,qBAAqB,6BAA6B,4BAA4B,mBAAmB,gEAAgE,oIAAoI,MAAM,QAAQ,0DAA0D,qCAAqC,oBAAoB,mOAAmO,sBAAsB,MAAM,sBAAsB,wIAAwI,mCAAmC,mCAAmC,gBAAgB,IAAI,UAAU,0CAA0C,mCAAmC,eAAe,sBAAsB,iEAAiE,uBAAuB,IAAI,qEAAqE,oEAAoE,WAAW,gBAAgB,+RAA+R,0FAA0F,2BAA2B,OAAO,oCAAoC,YAAY,uBAAuB,oBAAoB,kBAAkB,gCAAgC,EAAE,qDAAqD,+BAA+B,WAAW,aAAa,sCAAsC,SAAS,uBAAuB,sBAAsB,iCAAiC,gBAAgB,EAAE,QAAQ,2dAA2d,WAAW,sDAAsD,kBAAkB,6DAA6D,uBAAuB,+CAA+C,cAAc,2KAA2K,uBAAuB,IAAI,qEAAqE,8EAA8E,kBAAkB,wGAAwG,oBAAoB,+IAA+I,YAAY,gEAAgE,eAAe,sBAAsB,qBAAqB,EAAE,kBAAkB,gCAAgC,EAAE,qDAAqD,gBAAgB,WAAW,aAAa,sCAAsC,SAAS,0BAA0B,cAAc,wBAAwB,eAAe,kSAAkS,uBAAuB,6DAA6D,WAAW,8JAA8J,kBAAkB,uHAAuH,oBAAoB,8KAA8K,gBAAgB,uJAAuJ,OAAO,gCAAgC,iCAAiC,SAAS,kBAAkB,mBAAmB,sBAAsB,iDAAiD,QAAQ,YAAY,YAAY,gHAAgH,YAAY,IAAI,6BAA6B,YAAY,IAAI,KAAK,gFAAgF,mBAAmB,IAAI,SAAS,GAAG,8CAA8C,2BAA2B,aAAa,sFAAsF,2DAA2D,gBAAgB,IAAI,MAAM,0BAA0B,wBAAwB,gBAAgB,4BAA4B,gBAAgB,eAAe,SAAS,wBAAwB,mGAAmG,gEAAgE,2EAA2E,wDAAwD,MAAM,yDAAyD,YAAY,gCAAgC,iCAAiC,qCAAqC,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,gCAAgC,gCAAgC,IAAI,iBAAiB,mDAAmD,yBAAyB,cAAc,EAAE,QAAQ,oCAAoC,aAAa,MAAM,+EAA+E,YAAY,YAAY,IAAI,KAAK,sBAAsB,mBAAmB,IAAI,SAAS,sBAAsB,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,kCAAkC,2BAA2B,gBAAgB,IAAI,iBAAiB,mDAAmD,yBAAyB,cAAc,mCAAmC,uBAAuB,kBAAkB,QAAQ,YAAY,IAAI,YAAY,SAAS,2BAA2B,OAAO,gCAAgC,4BAA4B,mBAAmB,WAAW,aAAa,sCAAsC,SAAS,uBAAuB,cAAc,wBAAwB,eAAe,mLAAmL,uBAAuB,0DAA0D,WAAW,+DAA+D,kBAAkB,6EAA6E,oBAAoB,iNAAiN,gBAAgB,oBAAoB,mBAAmB,yBAAyB,aAAa,0BAA0B,cAAc,mBAAmB,oBAAoB,iEAAiE,YAAY,IAAI,KAAK,SAAS,wCAAwC,qEAAqE,kCAAkC,uBAAuB,IAAI,qCAAqC,yBAAyB,gBAAgB,eAAe,SAAS,gEAAgE,2EAA2E,wDAAwD,MAAM,yDAAyD,SAAS,0BAA0B,qCAAqC,uBAAuB,IAAI,mDAAmD,IAAI,KAAK,sBAAsB,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,aAAa,4BAA4B,mDAAmD,yBAAyB,cAAc,KAAK,uBAAuB,kBAAkB,QAAQ,YAAY,IAAI,YAAY,SAAS,2BAA2B,OAAO,gCAAgC,4BAA4B,gBAAgB,WAAW,aAAa,sCAAsC,SAAS,gBAAgB,sBAAsB,8BAA8B,gBAAgB,EAAE,mFAAmF,sBAAsB,WAAW,sBAAsB,uBAAuB,eAAe,YAAY,IAAI,WAAW,sBAAsB,6CAA6C,iBAAiB,oBAAoB,0DAA0D,6BAA6B,8CAA8C,gBAAgB,wCAAwC,yBAAyB,IAAI,MAAM,kBAAkB,sJAAsJ,OAAO,yBAAyB,qCAAqC,yBAAyB,+BAA+B,mJAAmJ,6BAA6B,6BAA6B,WAAW,aAAa,sCAAsC,SAAS,oBAAoB,sBAAsB,8BAA8B,gBAAgB,EAAE,2EAA2E,uCAAuC,WAAW,aAAa,sCAAsC,SAAS,gBAAgB,sBAAsB,8BAA8B,gBAAgB,EAAE,uEAAuE,wCAAwC,WAAW,aAAa,sCAAsC,SAAS,mBAAmB,sBAAsB,4BAA4B,gBAAgB,EAAE,sJAAsJ,kHAAkH,+GAA+G,YAAY,WAAW,aAAa,sCAAsC,SAAS,kBAAkB,sBAAsB,4BAA4B,gBAAgB,EAAE,uCAAuC,0BAA0B,wCAAwC,kDAAkD,qDAAqD,+GAA+G,WAAW,WAAW,aAAa,sCAAsC,SAAS,gBAAgB,sBAAsB,4BAA4B,gBAAgB,EAAE,6LAA6L,6CAA6C,sEAAsE,qCAAqC,8GAA8G,sBAAsB,0JAA0J,SAAS,WAAW,aAAa,sCAAsC,SAAS,gBAAgB,sBAAsB,4BAA4B,gBAAgB,EAAE,QAAQ,2LAA2L,qFAAqF,4HAA4H,mBAAmB,YAAY,mCAAmC,qDAAqD,8GAA8G,sBAAsB,kFAAkF,+BAA+B,qBAAqB,kBAAkB,sEAAsE,SAAS,WAAW,aAAa,sCAAsC,SAAS,kBAAkB,sBAAsB,4BAA4B,gBAAgB,EAAE,UAAU,sUAAsU,2HAA2H,6EAA6E,sCAAsC,YAAY,0BAA0B,qDAAqD,8GAA8G,sBAAsB,kHAAkH,8BAA8B,UAAU,sCAAsC,wCAAwC,sCAAsC,qCAAqC,qDAAqD,aAAa,oBAAoB,yGAAyG,WAAW,aAAa,sCAAsC,SAAS,qBAAqB,sBAAsB,4BAA4B,gBAAgB,EAAE,iLAAiL,0BAA0B,sIAAsI,mCAAmC,iJAAiJ,8GAA8G,sBAAsB,iIAAiI,cAAc,WAAW,aAAa,sCAAsC,SAAS,sBAAsB,sBAAsB,4BAA4B,gBAAgB,EAAE,gBAAgB,0YAA0Y,0BAA0B,wCAAwC,sCAAsC,YAAY,0IAA0I,qCAAqC,8GAA8G,sBAAsB,4MAA4M,eAAe,WAAW,aAAa,sCAAsC,SAAS,qBAAqB,iEAAiE,uHAAuH,cAAc,WAAW,aAAa,sCAAsC,SAAS,kBAAkB,cAAc,2BAA2B,eAAe,UAAU,EAAE,wCAAwC,WAAW,iEAAiE,mBAAmB,kBAAkB,YAAY,IAAI,6JAA6J,2BAA2B,IAAI,wEAAwE,KAAK,oBAAoB,YAAY,IAAI,wEAAwE,UAAU,WAAW,WAAW,aAAa,sCAAsC,SAAS,kBAAkB,8BAA8B,2BAA2B,gBAAgB,EAAE,8BAA8B,uDAAuD,8IAA8I,WAAW,4BAA4B,yCAAyC,qCAAqC,QAAQ,yBAAyB,IAAI,iDAAiD,SAAS,2BAA2B,0DAA0D,yBAAyB,uBAAuB,YAAY,kBAAkB,IAAI,wGAAwG,gEAAgE,WAAW,WAAW,aAAa,sCAAsC,SAAS,iBAAiB,cAAc,2BAA2B,cAAc,QAAQ,aAAa,iBAAiB,eAAe,iBAAiB,0BAA0B,8BAA8B,0CAA0C,mBAAmB,iBAAiB,qCAAqC,UAAU,WAAW,aAAa,sCAAsC,SAAS,oBAAoB,cAAc,2BAA2B,gBAAgB,EAAE,oFAAoF,WAAW,2DAA2D,4BAA4B,iDAAiD,wCAAwC,6BAA6B,IAAI,UAAU,kBAAkB,SAAS,6BAA6B,IAAI,iCAAiC,+QAA+Q,OAAO,2CAA2C,qCAAqC,2CAA2C,+BAA+B,mJAAmJ,MAAM,gHAAgH,gEAAgE,4BAA4B,6BAA6B,6CAA6C,iBAAiB,uCAAuC,0DAA0D,0BAA0B,8CAA8C,iBAAiB,aAAa,WAAW,aAAa,sCAAsC,SAAS,qBAAqB,cAAc,2BAA2B,gBAAgB,EAAE,mEAAmE,WAAW,mBAAmB,QAAQ,6BAA6B,IAAI,uBAAuB,SAAS,yBAAyB,iDAAiD,YAAY,IAAI,kCAAkC,KAAK,4DAA4D,gDAAgD,uEAAuE,cAAc,WAAW,aAAa,sCAAsC,SAAS,kBAAkB,cAAc,2BAA2B,eAAe,iBAAiB,EAAE,sCAAsC,WAAW,gFAAgF,WAAW,OAAO,cAAc,WAAW,+BAA+B,YAAY,YAAY,oDAAoD,mBAAmB,+DAA+D,uBAAuB,EAAE,8DAA8D,4FAA4F,eAAe,wCAAwC,SAAS,EAAE,MAAM,IAAI,eAAe,eAAe,MAAM,YAAY,aAAa,kBAAkB,gCAAgC,iBAAiB,sCAAsC,uCAAuC,8BAA8B,sBAAsB,oBAAoB,IAAI,KAAK,wBAAwB,eAAe,4DAA4D,gBAAgB,0BAA0B,mCAAmC,kBAAkB,wBAAwB,uBAAuB,6BAA6B,8CAA8C,IAAI,8EAA8E,0BAA0B,SAAS,uBAAuB,SAAS,+BAA+B,GAAG,eAAe,aAAa,iBAAiB,SAAS,aAAa,gBAAgB,oBAAoB,cAAc,6DAA6D,gBAAgB,oFAAoF,wCAAwC,sCAAsC,yFAAyF,yBAAyB,yBAAyB,4BAA4B,0BAA0B,uCAAuC,oCAAoC,uFAAuF,sBAAsB,6JAA6J,uDAAuD,oFAAoF,KAAK,YAAY,IAAI,wBAAwB,0BAA0B,YAAY,WAAW,MAAM,oDAAoD,4BAA4B,SAAS,IAAI,SAAS,aAAa,0BAA0B,kBAAkB,4CAA4C,8BAA8B,kCAAkC,kTAAkT,4DAA4D,yDAAyD,sOAAsO,qCAAqC,4CAA4C,aAAa,SAAS,aAAa,aAAa,qCAAqC,8BAA8B,+BAA+B,6GAA6G,qCAAqC,2EAA2E,iCAAiC,2EAA2E,oCAAoC,UAAU,2JAA2J,+BAA+B,0FAA0F,+BAA+B,0FAA0F,gCAAgC,gCAAgC,iEAAiE,oEAAoE,YAAY,oBAAoB,kLAAkL,QAAQ,kBAAkB,kCAAkC,MAAM,0IAA0I,aAAa,SAAS,aAAa,OAAO,4CAA4C,4FAA4F,cAAc,oBAAoB,cAAc,oHAAoH,cAAc,KAAK,mJAAmJ,WAAW,MAAM,cAAc,iCAAiC,mJAAmJ,cAAc,gDAAgD,qDAAqD,8FAA8F,WAAW,0JAA0J,KAAK,6BAA6B,UAAU,6BAA6B,WAAW,aAAa,wBAAwB,UAAU,6BAA6B,oBAAoB,iFAAiF,0JAA0J,KAAK,6BAA6B,KAAK,kDAAkD,yEAAyE,cAAc,QAAQ,2CAA2C,aAAa,iIAAiI,UAAU,mEAAmE,GAAG,cAAc,wBAAwB,gFAAgF,aAAa,0GAA0G,SAAS,sEAAsE,UAAU,EAAE,QAAQ,IAAI,KAAK,kDAAkD,iGAAiG,OAAO,wBAAwB,+EAA+E,KAAK,UAAU,2EAA2E,sBAAsB,uBAAuB,SAAS,yBAAyB,MAAM,yKAAyK,8BAA8B,eAAe,aAAa,gDAAgD,cAAc,wCAAwC,WAAW,wDAAwD,mBAAmB,sCAAsC,mBAAmB,gBAAgB,0DAA0D,iBAAiB,wCAAwC,+BAA+B,KAAK,uDAAuD,kCAAkC,aAAa,gDAAgD,YAAY,aAAa,kEAAkE,MAAM,kFAAkF,MAAM,kEAAkE,MAAM,kFAAkF,MAAM,mEAAmE,6IAA6I,iCAAiC,MAAM,4FAA4F,MAAM,sDAAsD,MAAM,iDAAiD,WAAW,+CAA+C,gBAAgB,MAAM,wCAAwC,QAAQ,wBAAwB,uFAAuF,gCAAgC,OAAO,qCAAqC,kCAAkC,iCAAiC,aAAa,uBAAuB,YAAY,uBAAuB,sIAAsI,kGAAkG,qCAAqC,qDAAqD,iCAAiC,yDAAyD,oCAAoC,uDAAuD,+BAA+B,4CAA4C,+BAA+B,4CAA4C,gCAAgC,6CAA6C,mCAAmC,oDAAoD,+BAA+B,sBAAsB,wEAAwE,gCAAgC,aAAa,uFAAuF,uFAAuF,qCAAqC,oJAAoJ,gNAAgN,uIAAuI,2BAA2B,IAAI,QAAQ,mCAAmC,8BAA8B,sBAAsB,sDAAsD,iBAAiB,gCAAgC,gCAAgC,aAAa,mEAAmE,4CAA4C,4CAA4C,qCAAqC,yDAAyD,kBAAkB,aAAa,WAAW,6BAA6B,cAAc,oBAAoB,kBAAkB,4BAA4B,4BAA4B,uCAAuC,+BAA+B,0BAA0B,6BAA6B,qCAAqC,gBAAgB,WAAW,mBAAmB,WAAW,4BAA4B,uCAAuC,+BAA+B,4CAA4C,6BAA6B,qCAAqC,gBAAgB,WAAW,mBAAmB,WAAW,8BAA8B,uCAAuC,sBAAsB,qLAAqL,4CAA4C,OAAO,QAAQ,gCAAgC,8BAA8B,uCAAuC,+BAA+B,sVAAsV,QAAQ,aAAa,cAAc,aAAa,gBAAgB,4DAA4D,uFAAuF,sBAAsB,gBAAgB,uCAAuC,kEAAkE,YAAY,MAAM,oDAAoD,0FAA0F,iGAAiG,mGAAmG,qDAAqD,qDAAqD,SAAS,MAAM,eAAe,aAAa,gBAAgB,uEAAuE,6CAA6C,gBAAgB,0BAA0B,cAAc,OAAO,6GAA6G,cAAc,uXAAuX,EAAE,+IAA+I,cAAc,mBAAmB,4CAA4C,EAAE,oBAAoB,OAAO,mHAAmH,aAAa,OAAO,yBAAyB,cAAc,MAAM,wBAAwB,aAAa,OAAO,wDAAwD,cAAc,kBAAkB,cAAc,+DAA+D,cAAc,+JAA+J,MAAM,kBAAkB,OAAO,yBAAyB,iBAAiB,iBAAiB,oHAAoH,EAAE,8CAA8C,+CAA+C,mBAAmB,2BAA2B,SAAS,kBAAkB,wBAAwB,iBAAiB,eAAe,MAAM,iBAAiB,MAAM,kBAAkB,uBAAuB,0BAA0B,2CAA2C,kBAAkB,sBAAsB,oBAAoB,YAAY,SAAS,yBAAyB,2CAA2C,gBAAgB,OAAO,yBAAyB,MAAM,MAAM,MAAM,gBAAgB,OAAO,+BAA+B,gBAAgB,sCAAsC,cAAc,YAAY,cAAc,YAAY,cAAc,gBAAgB,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,qBAAqB,OAAO,qIAAqI,gBAAgB,8WAA8W,aAAa,gCAAgC,IAAI,8BAA8B,KAAK,cAAc,sCAAsC,cAAc,eAAe,iFAAiF,2CAA2C,0EAA0E,oCAAoC,sEAAsE,oCAAoC,0EAA0E,yDAAyD,yEAAyE,oBAAoB,yEAAyE,oBAAoB,qFAAqF,sBAAsB,oDAAoD,oBAAoB,gKAAgK,gBAAgB,kBAAkB,UAAU,IAAI,gBAAgB,+QAA+Q,8CAA8C,0GAA0G,gBAAgB,WAAW,oBAAoB,4FAA4F,iBAAiB,gBAAgB,OAAO,oCAAoC,kBAAkB,OAAO,8CAA8C,cAAc,aAAa,cAAc,UAAU,MAAM,KAAK,OAAO,oCAAoC,IAAI,2DAA2D,gBAAgB,2DAA2D,gBAAgB,SAAS,2BAA2B,WAAW,SAAS,sCAAsC,WAAW,cAAc,qCAAqC,GAAG,cAAc,oBAAoB,+DAA+D,aAAa,YAAY,kBAAkB,MAAM,kBAAkB,sCAAsC,MAAM,kBAAkB,SAAS,aAAa,cAAc,oBAAoB,yBAAyB,MAAM,iBAAiB,SAAS,iDAAiD,aAAa,wBAAwB,aAAa,MAAM,oBAAoB,4CAA4C,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,kJAAkJ,gBAAgB,MAAM,kBAAkB,kDAAkD,oCAAoC,YAAY,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,SAAS,uBAAuB,wCAAwC,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,gBAAgB,sCAAsC,MAAM,kBAAkB,kDAAkD,sBAAsB,kCAAkC,aAAa,aAAa,aAAa,SAAS,uBAAuB,wCAAwC,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,gBAAgB,sCAAsC,MAAM,kBAAkB,kDAAkD,kBAAkB,kCAAkC,aAAa,aAAa,aAAa,SAAS,uBAAuB,wCAAwC,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,gBAAgB,kBAAkB,UAAU,0EAA0E,8BAA8B,MAAM,kBAAkB,kDAAkD,sBAAsB,+CAA+C,aAAa,aAAa,aAAa,SAAS,uBAAuB,kCAAkC,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,gBAAgB,gBAAgB,MAAM,kBAAkB,kDAAkD,qBAAqB,YAAY,aAAa,aAAa,aAAa,SAAS,uBAAuB,kCAAkC,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,gBAAgB,gBAAgB,MAAM,kBAAkB,kDAAkD,qBAAqB,YAAY,aAAa,aAAa,aAAa,SAAS,MAAM,aAAa,YAAY,mDAAmD,UAAU,yBAAyB,kBAAkB,+RAA+R,qIAAqI,sHAAsH,MAAM,wCAAwC,mEAAmE,aAAa,QAAQ,gDAAgD,aAAa,cAAc,8BAA8B,MAAM,kBAAkB,SAAS,UAAU,sCAAsC,MAAM,kBAAkB,YAAY,aAAa,6BAA6B,gBAAgB,MAAM,kBAAkB,UAAU,aAAa,SAAS,aAAa,QAAQ,8DAA8D,aAAa,cAAc,sKAAsK,aAAa,QAAQ,qEAAqE,cAAc,QAAQ,0BAA0B,MAAM,kBAAkB,SAAS,SAAS,cAAc,QAAQ,qEAAqE,cAAc,QAAQ,qEAAqE,WAAW,kBAAkB,qCAAqC,4BAA4B,WAAW,iCAAiC,0CAA0C,oEAAoE,cAAc,YAAY,eAAe,aAAa,mBAAmB,0CAA0C,yCAAyC,OAAO,oBAAoB,wBAAwB,mBAAmB,+BAA+B,iDAAiD,GAAG,oCAAoC,gBAAgB,sBAAsB,gBAAgB,qBAAqB,mBAAmB,qBAAqB,iBAAiB,6BAA6B,cAAc,kDAAkD,cAAc,2KAA2K,kBAAkB,gDAAgD,iBAAiB,GAAG,cAAc,qNAAqN,kBAAkB,gDAAgD,iBAAiB,GAAG,cAAc,oBAAoB,8BAA8B,mBAAmB,wBAAwB,YAAY,WAAW,mCAAmC,WAAW,iBAAiB,mBAAmB,+BAA+B,+DAA+D,wBAAwB,qCAAqC,gBAAgB,MAAM,cAAc,WAAW,+BAA+B,YAAY,YAAY,oDAAoD,mBAAmB,+DAA+D,uBAAuB,EAAE,8DAA8D,4FAA4F,eAAe,wCAAwC,SAAS,EAAE,QAAQ,IAAI,G;;;;;UCDz49N;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,wCAAwC,yCAAyC;WACjF;WACA;WACA,E;;;;;WCPA;WACA;WACA;WACA;WACA,EAAE;WACF;WACA;WACA,CAAC,I;;;;;WCPD,wF;;;;;WCAA;WACA;WACA;WACA,sDAAsD,kBAAkB;WACxE;WACA,+CAA+C,cAAc;WAC7D,E;;;;;;;;;ACNa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,kBAAkB,mBAAO,CAAC,CAAW;AACrC,iBAAiB;AACjB,eAAe;AACf,iC","file":"urpflanze.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Urpflanze\"] = factory();\n\telse\n\t\troot[\"Urpflanze\"] = factory();\n})(window, function() {\nreturn ","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SVGImporter = exports.SVGExporter = exports.GCODEExporter = exports.Timeline = exports.Renderer = exports.Color = void 0;\n__exportStar(require(\"./modules-light\"), exports);\n__exportStar(require(\"./modules-light\"), exports);\nexports.Color = require(\"@urpflanze/color/dist/cjs\");\nvar cjs_1 = require(\"@urpflanze/drawer-canvas/dist/cjs\");\nObject.defineProperty(exports, \"Renderer\", { enumerable: true, get: function () { return cjs_1.Renderer; } });\nObject.defineProperty(exports, \"Timeline\", { enumerable: true, get: function () { return cjs_1.Timeline; } });\nvar cjs_2 = require(\"@urpflanze/gcode-exporter/dist/cjs\");\nObject.defineProperty(exports, \"GCODEExporter\", { enumerable: true, get: function () { return cjs_2.GCODEExporter; } });\nvar cjs_3 = require(\"@urpflanze/svg-exporter/dist/cjs\");\nObject.defineProperty(exports, \"SVGExporter\", { enumerable: true, get: function () { return cjs_3.SVGExporter; } });\nvar svg_importer_1 = require(\"@urpflanze/svg-importer\");\nObject.defineProperty(exports, \"SVGImporter\", { enumerable: true, get: function () { return svg_importer_1.SVGImporter; } });\n//# sourceMappingURL=modules.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DrawerCanvas = exports.Animation = void 0;\n__exportStar(require(\"@urpflanze/core/dist/cjs\"), exports);\nexports.Animation = require(\"@urpflanze/animation/dist/cjs\");\nvar BrowserDrawerCanvas_1 = require(\"@urpflanze/drawer-canvas/dist/cjs/browser/BrowserDrawerCanvas\");\nObject.defineProperty(exports, \"DrawerCanvas\", { enumerable: true, get: function () { return BrowserDrawerCanvas_1.BrowserDrawerCanvas; } });\n//# sourceMappingURL=modules-light.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mod = exports.log = exports.PI2 = exports.PHI = exports.Vec2 = exports.distributePointsInBuffer = exports.prepareBufferForInterpolation = exports.interpolate = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.now = exports.toRadians = exports.toDegrees = exports.relativeClamp = exports.clamp = exports.lerp = void 0;\n/**\n * Types & Interface\n */\n__exportStar(require(\"./types\"), exports);\n// Set glMatrixArrayType\nconst gl_matrix_1 = require(\"gl-matrix\");\ngl_matrix_1.glMatrix.setMatrixArrayType(Array);\n/**\n * Core\n */\n__exportStar(require(\"./Scene\"), exports);\n__exportStar(require(\"./SceneChild\"), exports);\n__exportStar(require(\"./Group\"), exports);\n// Shapes\n__exportStar(require(\"./shapes/ShapeBase\"), exports);\n__exportStar(require(\"./shapes/ShapePrimitive\"), exports);\n__exportStar(require(\"./shapes/ShapeLoop\"), exports);\n__exportStar(require(\"./shapes/ShapeBuffer\"), exports);\n__exportStar(require(\"./shapes/Shape\"), exports);\n__exportStar(require(\"./shapes/ShapeRecursive\"), exports);\n__exportStar(require(\"./shapes/ShapeFollow\"), exports);\n__exportStar(require(\"./shapes/primitives/Line\"), exports);\n__exportStar(require(\"./shapes/primitives/Triangle\"), exports);\n__exportStar(require(\"./shapes/primitives/Rect\"), exports);\n__exportStar(require(\"./shapes/primitives/Polygon\"), exports);\n__exportStar(require(\"./shapes/primitives/Circle\"), exports);\n__exportStar(require(\"./shapes/primitives/Star\"), exports);\n__exportStar(require(\"./shapes/primitives/Rose\"), exports);\n__exportStar(require(\"./shapes/primitives/Spiral\"), exports);\n__exportStar(require(\"./shapes/primitives/Lissajous\"), exports);\n__exportStar(require(\"./shapes/primitives/SuperShape\"), exports);\n// Modifiers\n__exportStar(require(\"./modifiers/Modifier\"), exports);\n__exportStar(require(\"./modifiers\"), exports);\n// Utilities\nvar Utilities_1 = require(\"./Utilities\");\nObject.defineProperty(exports, \"lerp\", { enumerable: true, get: function () { return Utilities_1.lerp; } });\nObject.defineProperty(exports, \"clamp\", { enumerable: true, get: function () { return Utilities_1.clamp; } });\nObject.defineProperty(exports, \"relativeClamp\", { enumerable: true, get: function () { return Utilities_1.relativeClamp; } });\nObject.defineProperty(exports, \"toDegrees\", { enumerable: true, get: function () { return Utilities_1.toDegrees; } });\nObject.defineProperty(exports, \"toRadians\", { enumerable: true, get: function () { return Utilities_1.toRadians; } });\nObject.defineProperty(exports, \"now\", { enumerable: true, get: function () { return Utilities_1.now; } });\nObject.defineProperty(exports, \"noise\", { enumerable: true, get: function () { return Utilities_1.noise; } });\nObject.defineProperty(exports, \"random\", { enumerable: true, get: function () { return Utilities_1.random; } });\nObject.defineProperty(exports, \"angleFromRepetition\", { enumerable: true, get: function () { return Utilities_1.angleFromRepetition; } });\nObject.defineProperty(exports, \"angle2FromRepetition\", { enumerable: true, get: function () { return Utilities_1.angle2FromRepetition; } });\nObject.defineProperty(exports, \"distanceFromRepetition\", { enumerable: true, get: function () { return Utilities_1.distanceFromRepetition; } });\nObject.defineProperty(exports, \"interpolate\", { enumerable: true, get: function () { return Utilities_1.interpolate; } });\nObject.defineProperty(exports, \"prepareBufferForInterpolation\", { enumerable: true, get: function () { return Utilities_1.prepareBufferForInterpolation; } });\nObject.defineProperty(exports, \"distributePointsInBuffer\", { enumerable: true, get: function () { return Utilities_1.distributePointsInBuffer; } });\nvar Vec2_1 = require(\"./math/Vec2\");\nObject.defineProperty(exports, \"Vec2\", { enumerable: true, get: function () { return Vec2_1.default; } });\nvar math_1 = require(\"./math\");\nObject.defineProperty(exports, \"PHI\", { enumerable: true, get: function () { return math_1.PHI; } });\nObject.defineProperty(exports, \"PI2\", { enumerable: true, get: function () { return math_1.PI2; } });\nObject.defineProperty(exports, \"log\", { enumerable: true, get: function () { return math_1.log; } });\nObject.defineProperty(exports, \"mod\", { enumerable: true, get: function () { return math_1.mod; } });\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./indexedBuffer\"), exports);\n__exportStar(require(\"./propArguments\"), exports);\n__exportStar(require(\"./repetitions\"), exports);\n__exportStar(require(\"./scene-child\"), exports);\n__exportStar(require(\"./scene\"), exports);\n__exportStar(require(\"./shape-base\"), exports);\n__exportStar(require(\"./shape-primitives\"), exports);\n__exportStar(require(\"./shapes\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=indexedBuffer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=propArguments.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ERepetitionType = void 0;\n/**\n * Repetition type enumerator.\n *\n * @category Core.Repetition\n * @internal\n */\nvar ERepetitionType;\n(function (ERepetitionType) {\n /**\n * Defines the type of repetition of the shape,\n * in a circular way starting from the center of the scene\n * @order 1\n */\n ERepetitionType[ERepetitionType[\"Ring\"] = 1] = \"Ring\";\n /**\n * Defines the type of repetition of the shape,\n * on a nxm grid starting from the center of the scene\n * @order 2\n */\n ERepetitionType[ERepetitionType[\"Matrix\"] = 2] = \"Matrix\";\n})(ERepetitionType = exports.ERepetitionType || (exports.ERepetitionType = {}));\n//# sourceMappingURL=repetitions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=scene-child.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=scene.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EBoundingType = void 0;\nvar EBoundingType;\n(function (EBoundingType) {\n /**\n * Relative to the real bounding of the shape\n * @order 2\n */\n EBoundingType[EBoundingType[\"Relative\"] = 1] = \"Relative\";\n /**\n * Fixed to te width and height of the shape\n * @order 3\n */\n EBoundingType[EBoundingType[\"Fixed\"] = 2] = \"Fixed\";\n})(EBoundingType = exports.EBoundingType || (exports.EBoundingType = {}));\n//# sourceMappingURL=shape-base.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//////\n//# sourceMappingURL=shape-primitives.js.map","\"use strict\";\n// Shape\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=shapes.js.map","import * as glMatrix from \"./common.js\";\nimport * as mat2 from \"./mat2.js\";\nimport * as mat2d from \"./mat2d.js\";\nimport * as mat3 from \"./mat3.js\";\nimport * as mat4 from \"./mat4.js\";\nimport * as quat from \"./quat.js\";\nimport * as quat2 from \"./quat2.js\";\nimport * as vec2 from \"./vec2.js\";\nimport * as vec3 from \"./vec3.js\";\nimport * as vec4 from \"./vec4.js\";\nexport { glMatrix, mat2, mat2d, mat3, mat4, quat, quat2, vec2, vec3, vec4 };","/**\r\n * Common utilities\r\n * @module glMatrix\r\n */\n// Configuration Constants\nexport var EPSILON = 0.000001;\nexport var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexport var RANDOM = Math.random;\n/**\r\n * Sets the type of array used when creating new vectors and matrices\r\n *\r\n * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array\r\n */\n\nexport function setMatrixArrayType(type) {\n ARRAY_TYPE = type;\n}\nvar degree = Math.PI / 180;\n/**\r\n * Convert Degree To Radian\r\n *\r\n * @param {Number} a Angle in Degrees\r\n */\n\nexport function toRadian(a) {\n return a * degree;\n}\n/**\r\n * Tests whether or not the arguments have approximately the same value, within an absolute\r\n * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less\r\n * than or equal to 1.0, and a relative tolerance is used for larger values)\r\n *\r\n * @param {Number} a The first number to test.\r\n * @param {Number} b The second number to test.\r\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n}\nif (!Math.hypot) Math.hypot = function () {\n var y = 0,\n i = arguments.length;\n\n while (i--) {\n y += arguments[i] * arguments[i];\n }\n\n return Math.sqrt(y);\n};","import * as glMatrix from \"./common.js\";\n/**\r\n * 2x2 Matrix\r\n * @module mat2\r\n */\n\n/**\r\n * Creates a new identity mat2\r\n *\r\n * @returns {mat2} a new 2x2 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\r\n * Creates a new mat2 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat2} a matrix to clone\r\n * @returns {mat2} a new 2x2 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Copy the values from one mat2 to another\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set a mat2 to the identity matrix\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @returns {mat2} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\r\n * Create a new mat2 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\r\n * @returns {mat2} out A new 2x2 matrix\r\n */\n\nexport function fromValues(m00, m01, m10, m11) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\r\n * Set the components of a mat2 to the given values\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\r\n * @returns {mat2} out\r\n */\n\nexport function set(out, m00, m01, m10, m11) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\r\n * Transpose the values of a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache\n // some values\n if (out === a) {\n var a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3]; // Calculate the determinant\n\n var det = a0 * a3 - a2 * a1;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function adjoint(out, a) {\n // Caching this value is nessecary if out == a\n var a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat2\r\n *\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n}\n/**\r\n * Multiplies two mat2's\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n}\n/**\r\n * Rotates a mat2 by the given angle\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n}\n/**\r\n * Scales the mat2 by the dimensions in the given vec2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to rotate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat2} out\r\n **/\n\nexport function scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n *\r\n * @param {mat2} out mat2 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n *\r\n * @param {mat2} out mat2 receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat2} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n}\n/**\r\n * Returns a string representation of a mat2\r\n *\r\n * @param {ReadonlyMat2} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat2\r\n *\r\n * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3]);\n}\n/**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @param {ReadonlyMat2} L the lower triangular matrix\r\n * @param {ReadonlyMat2} D the diagonal matrix\r\n * @param {ReadonlyMat2} U the upper triangular matrix\r\n * @param {ReadonlyMat2} a the input matrix to factorize\r\n */\n\nexport function LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n}\n/**\r\n * Adds two mat2's\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat2} a The first matrix.\r\n * @param {ReadonlyMat2} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat2} a The first matrix.\r\n * @param {ReadonlyMat2} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat2} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\r\n * Adds two mat2's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat2} out the receiving vector\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat2} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\r\n * Alias for {@link mat2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat2.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 2x3 Matrix\r\n * @module mat2d\r\n * @description\r\n * A mat2d contains six elements defined as:\r\n *
\r\n * [a, b,\r\n *  c, d,\r\n *  tx, ty]\r\n * 
\r\n * This is a short form for the 3x3 matrix:\r\n *
\r\n * [a, b, 0,\r\n *  c, d, 0,\r\n *  tx, ty, 1]\r\n * 
\r\n * The last column is ignored so the array is shorter and operations are faster.\r\n */\n\n/**\r\n * Creates a new identity mat2d\r\n *\r\n * @returns {mat2d} a new 2x3 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(6);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[4] = 0;\n out[5] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\r\n * Creates a new mat2d initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat2d} a matrix to clone\r\n * @returns {mat2d} a new 2x3 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\r\n * Copy the values from one mat2d to another\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\r\n * Set a mat2d to the identity matrix\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Create a new mat2d with the given values\r\n *\r\n * @param {Number} a Component A (index 0)\r\n * @param {Number} b Component B (index 1)\r\n * @param {Number} c Component C (index 2)\r\n * @param {Number} d Component D (index 3)\r\n * @param {Number} tx Component TX (index 4)\r\n * @param {Number} ty Component TY (index 5)\r\n * @returns {mat2d} A new mat2d\r\n */\n\nexport function fromValues(a, b, c, d, tx, ty) {\n var out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\r\n * Set the components of a mat2d to the given values\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {Number} a Component A (index 0)\r\n * @param {Number} b Component B (index 1)\r\n * @param {Number} c Component C (index 2)\r\n * @param {Number} d Component D (index 3)\r\n * @param {Number} tx Component TX (index 4)\r\n * @param {Number} ty Component TY (index 5)\r\n * @returns {mat2d} out\r\n */\n\nexport function set(out, a, b, c, d, tx, ty) {\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\r\n * Inverts a mat2d\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function invert(out, a) {\n var aa = a[0],\n ab = a[1],\n ac = a[2],\n ad = a[3];\n var atx = a[4],\n aty = a[5];\n var det = aa * ad - ab * ac;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n}\n/**\r\n * Multiplies two mat2d's\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n}\n/**\r\n * Rotates a mat2d by the given angle\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2d} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\r\n * Scales the mat2d by the dimensions in the given vec2\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to translate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat2d} out\r\n **/\n\nexport function scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\r\n * Translates the mat2d by the dimensions in the given vec2\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to translate\r\n * @param {ReadonlyVec2} v the vec2 to translate the matrix by\r\n * @returns {mat2d} out\r\n **/\n\nexport function translate(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.rotate(dest, dest, rad);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2d} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.scale(dest, dest, vec);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat2d} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.translate(dest, dest, vec);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {ReadonlyVec2} v Translation vector\r\n * @returns {mat2d} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n}\n/**\r\n * Returns a string representation of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat2d(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1);\n}\n/**\r\n * Adds two mat2d's\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat2d} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n}\n/**\r\n * Adds two mat2d's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat2d} out the receiving vector\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat2d} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat2d} a The first matrix.\r\n * @param {ReadonlyMat2d} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat2d} a The first matrix.\r\n * @param {ReadonlyMat2d} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5));\n}\n/**\r\n * Alias for {@link mat2d.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat2d.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 3x3 Matrix\r\n * @module mat3\r\n */\n\n/**\r\n * Creates a new identity mat3\r\n *\r\n * @returns {mat3} a new 3x3 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(9);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n }\n\n out[0] = 1;\n out[4] = 1;\n out[8] = 1;\n return out;\n}\n/**\r\n * Copies the upper-left 3x3 values into the given mat3.\r\n *\r\n * @param {mat3} out the receiving 3x3 matrix\r\n * @param {ReadonlyMat4} a the source 4x4 matrix\r\n * @returns {mat3} out\r\n */\n\nexport function fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n}\n/**\r\n * Creates a new mat3 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat3} a matrix to clone\r\n * @returns {mat3} a new 3x3 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Copy the values from one mat3 to another\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Create a new mat3 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\r\n * @returns {mat3} A new mat3\r\n */\n\nexport function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\r\n * Set the components of a mat3 to the given values\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\r\n * @returns {mat3} out\r\n */\n\nexport function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\r\n * Set a mat3 to the identity matrix\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @returns {mat3} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Transpose the values of a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b01 = a22 * a11 - a12 * a21;\n var b11 = -a22 * a10 + a12 * a20;\n var b21 = a21 * a10 - a11 * a20; // Calculate the determinant\n\n var det = a00 * b01 + a01 * b11 + a02 * b21;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat3\r\n *\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n}\n/**\r\n * Multiplies two mat3's\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b00 = b[0],\n b01 = b[1],\n b02 = b[2];\n var b10 = b[3],\n b11 = b[4],\n b12 = b[5];\n var b20 = b[6],\n b21 = b[7],\n b22 = b[8];\n out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n return out;\n}\n/**\r\n * Translate a mat3 by the given vector\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to translate\r\n * @param {ReadonlyVec2} v vector to translate by\r\n * @returns {mat3} out\r\n */\n\nexport function translate(out, a, v) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n x = v[0],\n y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n}\n/**\r\n * Rotates a mat3 by the given angle\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat3} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n}\n/**\r\n * Scales the mat3 by the dimensions in the given vec2\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to rotate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat3} out\r\n **/\n\nexport function scale(out, a, v) {\n var x = v[0],\n y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyVec2} v Translation vector\r\n * @returns {mat3} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat3} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat3} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Copies the values from a mat2d into a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to copy\r\n * @returns {mat3} out\r\n **/\n\nexport function fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n}\n/**\r\n * Calculates a 3x3 matrix from the given quaternion\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyQuat} q Quaternion to create matrix from\r\n *\r\n * @returns {mat3} out\r\n */\n\nexport function fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n}\n/**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n *\r\n * @returns {mat3} out\r\n */\n\nexport function normalFromMat4(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n}\n/**\r\n * Generates a 2D projection matrix with the given bounds\r\n *\r\n * @param {mat3} out mat3 frustum matrix will be written into\r\n * @param {number} width Width of your gl context\r\n * @param {number} height Height of gl context\r\n * @returns {mat3} out\r\n */\n\nexport function projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n}\n/**\r\n * Returns a string representation of a mat3\r\n *\r\n * @param {ReadonlyMat3} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat3\r\n *\r\n * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);\n}\n/**\r\n * Adds two mat3's\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat3} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n}\n/**\r\n * Adds two mat3's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat3} out the receiving vector\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat3} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat3} a The first matrix.\r\n * @param {ReadonlyMat3} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat3} a The first matrix.\r\n * @param {ReadonlyMat3} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7],\n a8 = a[8];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7],\n b8 = b[8];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8));\n}\n/**\r\n * Alias for {@link mat3.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat3.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied.\r\n * @module mat4\r\n */\n\n/**\r\n * Creates a new identity mat4\r\n *\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(16);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n }\n\n out[0] = 1;\n out[5] = 1;\n out[10] = 1;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a new mat4 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat4} a matrix to clone\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Copy the values from one mat4 to another\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Create a new mat4 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} A new mat4\r\n */\n\nexport function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\r\n * Set the components of a mat4 to the given values\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} out\r\n */\n\nexport function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\r\n * Set a mat4 to the identity matrix\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @returns {mat4} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Transpose the values of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a12 = a[6],\n a13 = a[7];\n var a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22);\n out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\n out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12);\n out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\n out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\n out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22);\n out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\n out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12);\n out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21);\n out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\n out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11);\n out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\n out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\n out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21);\n out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\n out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11);\n return out;\n}\n/**\r\n * Calculates the determinant of a mat4\r\n *\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n}\n/**\r\n * Multiplies two mat4s\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15]; // Cache only the current line of the second matrix\n\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n/**\r\n * Translate a mat4 by the given vector\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to translate\r\n * @param {ReadonlyVec3} v vector to translate by\r\n * @returns {mat4} out\r\n */\n\nexport function translate(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n\n return out;\n}\n/**\r\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to scale\r\n * @param {ReadonlyVec3} v the vec3 to scale the matrix by\r\n * @returns {mat4} out\r\n **/\n\nexport function scale(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Rotates a mat4 by the given angle around the given axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nexport function rotate(out, a, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n var b00, b01, b02;\n var b10, b11, b12;\n var b20, b21, b22;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11]; // Construct the elements of the rotation matrix\n\n b00 = x * x * t + c;\n b01 = y * x * t + z * s;\n b02 = z * x * t - y * s;\n b10 = x * y * t - z * s;\n b11 = y * y * t + c;\n b12 = z * y * t + x * s;\n b20 = x * z * t + y * s;\n b21 = y * z * t - x * s;\n b22 = z * z * t + c; // Perform rotation-specific matrix multiplication\n\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the X axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateX(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Y axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateY(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Z axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyVec3} v Scaling vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotation(out, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c; // Perform rotation-specific matrix multiplication\n\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromXRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromYRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromZRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslation(out, q, v) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a new mat4 from a dual quat.\r\n *\r\n * @param {mat4} out Matrix\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @returns {mat4} mat4 receiving operation result\r\n */\n\nexport function fromQuat2(out, a) {\n var translation = new glMatrix.ARRAY_TYPE(3);\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense\n\n if (magnitude > 0) {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n\n fromRotationTranslation(out, a, translation);\n return out;\n}\n/**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nexport function getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n}\n/**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion paramter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nexport function getScaling(out, mat) {\n var m11 = mat[0];\n var m12 = mat[1];\n var m13 = mat[2];\n var m21 = mat[4];\n var m22 = mat[5];\n var m23 = mat[6];\n var m31 = mat[8];\n var m32 = mat[9];\n var m33 = mat[10];\n out[0] = Math.hypot(m11, m12, m13);\n out[1] = Math.hypot(m21, m22, m23);\n out[2] = Math.hypot(m31, m32, m33);\n return out;\n}\n/**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @param {quat} out Quaternion to receive the rotation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {quat} out\r\n */\n\nexport function getRotation(out, mat) {\n var scaling = new glMatrix.ARRAY_TYPE(3);\n getScaling(scaling, mat);\n var is1 = 1 / scaling[0];\n var is2 = 1 / scaling[1];\n var is3 = 1 / scaling[2];\n var sm11 = mat[0] * is1;\n var sm12 = mat[1] * is2;\n var sm13 = mat[2] * is3;\n var sm21 = mat[4] * is1;\n var sm22 = mat[5] * is2;\n var sm23 = mat[6] * is3;\n var sm31 = mat[8] * is1;\n var sm32 = mat[9] * is2;\n var sm33 = mat[10] * is3;\n var trace = sm11 + sm22 + sm33;\n var S = 0;\n\n if (trace > 0) {\n S = Math.sqrt(trace + 1.0) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @param {ReadonlyVec3} s Scaling vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslationScale(out, q, v, s) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @param {ReadonlyVec3} s Scaling vector\r\n * @param {ReadonlyVec3} o The origin vector around which to scale and rotate\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n var ox = o[0];\n var oy = o[1];\n var oz = o[2];\n var out0 = (1 - (yy + zz)) * sx;\n var out1 = (xy + wz) * sx;\n var out2 = (xz - wy) * sx;\n var out4 = (xy - wz) * sy;\n var out5 = (1 - (xx + zz)) * sy;\n var out6 = (yz + wx) * sy;\n var out8 = (xz + wy) * sz;\n var out9 = (yz - wx) * sz;\n var out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n}\n/**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyQuat} q Quaternion to create matrix from\r\n *\r\n * @returns {mat4} out\r\n */\n\nexport function fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a frustum matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Number} left Left bound of the frustum\r\n * @param {Number} right Right bound of the frustum\r\n * @param {Number} bottom Bottom bound of the frustum\r\n * @param {Number} top Top bound of the frustum\r\n * @param {Number} near Near bound of the frustum\r\n * @param {Number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function frustum(out, left, right, bottom, top, near, far) {\n var rl = 1 / (right - left);\n var tb = 1 / (top - bottom);\n var nf = 1 / (near - far);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near * 2 * nf;\n out[15] = 0;\n return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} fovy Vertical field of view in radians\r\n * @param {number} aspect Aspect ratio. typically viewport width/height\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum, can be null or Infinity\r\n * @returns {mat4} out\r\n */\n\nexport function perspective(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n\n return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function perspectiveFromFieldOfView(out, fov, near, far) {\n var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);\n var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);\n var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);\n var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);\n var xScale = 2.0 / (leftTan + rightTan);\n var yScale = 2.0 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n out[4] = 0.0;\n out[5] = yScale;\n out[6] = 0.0;\n out[7] = 0.0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1.0;\n out[12] = 0.0;\n out[13] = 0.0;\n out[14] = far * near / (near - far);\n out[15] = 0.0;\n return out;\n}\n/**\r\n * Generates a orthogonal projection matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} left Left bound of the frustum\r\n * @param {number} right Right bound of the frustum\r\n * @param {number} bottom Bottom bound of the frustum\r\n * @param {number} top Top bound of the frustum\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function ortho(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {ReadonlyVec3} eye Position of the viewer\r\n * @param {ReadonlyVec3} center Point the viewer is looking at\r\n * @param {ReadonlyVec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nexport function lookAt(out, eye, center, up) {\n var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;\n var eyex = eye[0];\n var eyey = eye[1];\n var eyez = eye[2];\n var upx = up[0];\n var upy = up[1];\n var upz = up[2];\n var centerx = center[0];\n var centery = center[1];\n var centerz = center[2];\n\n if (Math.abs(eyex - centerx) < glMatrix.EPSILON && Math.abs(eyey - centery) < glMatrix.EPSILON && Math.abs(eyez - centerz) < glMatrix.EPSILON) {\n return identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n len = 1 / Math.hypot(z0, z1, z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.hypot(x0, x1, x2);\n\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n len = Math.hypot(y0, y1, y2);\n\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a matrix that makes something look at something else.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {ReadonlyVec3} eye Position of the viewer\r\n * @param {ReadonlyVec3} center Point the viewer is looking at\r\n * @param {ReadonlyVec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nexport function targetTo(out, eye, target, up) {\n var eyex = eye[0],\n eyey = eye[1],\n eyez = eye[2],\n upx = up[0],\n upy = up[1],\n upz = up[2];\n var z0 = eyex - target[0],\n z1 = eyey - target[1],\n z2 = eyez - target[2];\n var len = z0 * z0 + z1 * z1 + z2 * z2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n\n var x0 = upy * z2 - upz * z1,\n x1 = upz * z0 - upx * z2,\n x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n}\n/**\r\n * Returns a string representation of a mat4\r\n *\r\n * @param {ReadonlyMat4} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \", \" + a[9] + \", \" + a[10] + \", \" + a[11] + \", \" + a[12] + \", \" + a[13] + \", \" + a[14] + \", \" + a[15] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat4\r\n *\r\n * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);\n}\n/**\r\n * Adds two mat4's\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat4} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n}\n/**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat4} out the receiving vector\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat4} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat4} a The first matrix.\r\n * @param {ReadonlyMat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat4} a The first matrix.\r\n * @param {ReadonlyMat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var a8 = a[8],\n a9 = a[9],\n a10 = a[10],\n a11 = a[11];\n var a12 = a[12],\n a13 = a[13],\n a14 = a[14],\n a15 = a[15];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n var b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n var b8 = b[8],\n b9 = b[9],\n b10 = b[10],\n b11 = b[11];\n var b12 = b[12],\n b13 = b[13],\n b14 = b[14],\n b15 = b[15];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15));\n}\n/**\r\n * Alias for {@link mat4.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat4.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\nimport * as mat3 from \"./mat3.js\";\nimport * as vec3 from \"./vec3.js\";\nimport * as vec4 from \"./vec4.js\";\n/**\r\n * Quaternion\r\n * @module quat\r\n */\n\n/**\r\n * Creates a new identity quat\r\n *\r\n * @returns {quat} a new quaternion\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n out[3] = 1;\n return out;\n}\n/**\r\n * Set a quat to the identity quaternion\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @returns {quat} out\r\n */\n\nexport function identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyVec3} axis the axis around which to rotate\r\n * @param {Number} rad the angle in radians\r\n * @returns {quat} out\r\n **/\n\nexport function setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n var s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n}\n/**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @param {vec3} out_axis Vector receiving the axis of rotation\r\n * @param {ReadonlyQuat} q Quaternion to be decomposed\r\n * @return {Number} Angle, in radians, of the rotation\r\n */\n\nexport function getAxisAngle(out_axis, q) {\n var rad = Math.acos(q[3]) * 2.0;\n var s = Math.sin(rad / 2.0);\n\n if (s > glMatrix.EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n // If s is zero, return any axis (no rotation - axis does not matter)\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n\n return rad;\n}\n/**\r\n * Gets the angular distance between two unit quaternions\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\n\nexport function getAngle(a, b) {\n var dotproduct = dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n}\n/**\r\n * Multiplies two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {quat} out\r\n */\n\nexport function multiply(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the X axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateX(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateY(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var by = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bz = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n}\n/**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate W component of\r\n * @returns {quat} out\r\n */\n\nexport function calculateW(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\n return out;\n}\n/**\r\n * Calculate the exponential of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @returns {quat} out\r\n */\n\nexport function exp(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var et = Math.exp(w);\n var s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n}\n/**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @returns {quat} out\r\n */\n\nexport function ln(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n}\n/**\r\n * Calculate the scalar power of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @param {Number} b amount to scale the quaternion by\r\n * @returns {quat} out\r\n */\n\nexport function pow(out, a, b) {\n ln(out, a);\n scale(out, out, b);\n exp(out, out);\n return out;\n}\n/**\r\n * Performs a spherical linear interpolation between two quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n */\n\nexport function slerp(out, a, b, t) {\n // benchmarks:\n // http://jsperf.com/quaternion-slerp-implementations\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n var omega, cosom, sinom, scale0, scale1; // calc cosine\n\n cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary)\n\n if (cosom < 0.0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n } // calculate coefficients\n\n\n if (1.0 - cosom > glMatrix.EPSILON) {\n // standard case (slerp)\n omega = Math.acos(cosom);\n sinom = Math.sin(omega);\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n // \"from\" and \"to\" quaternions are very close\n // ... so we can do a linear interpolation\n scale0 = 1.0 - t;\n scale1 = t;\n } // calculate final values\n\n\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n}\n/**\r\n * Generates a random unit quaternion\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @returns {quat} out\r\n */\n\nexport function random(out) {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n var u1 = glMatrix.RANDOM();\n var u2 = glMatrix.RANDOM();\n var u3 = glMatrix.RANDOM();\n var sqrt1MinusU1 = Math.sqrt(1 - u1);\n var sqrtU1 = Math.sqrt(u1);\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n}\n/**\r\n * Calculates the inverse of a quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate inverse of\r\n * @returns {quat} out\r\n */\n\nexport function invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\n\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n}\n/**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate conjugate of\r\n * @returns {quat} out\r\n */\n\nexport function conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyMat3} m rotation matrix\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport function fromMat3(out, m) {\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n var fTrace = m[0] + m[4] + m[8];\n var fRoot;\n\n if (fTrace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\n\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot; // 1/(4w)\n\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n // |w| <= 1/2\n var i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n var j = (i + 1) % 3;\n var k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n\n return out;\n}\n/**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {x} Angle to rotate around X axis in degrees.\r\n * @param {y} Angle to rotate around Y axis in degrees.\r\n * @param {z} Angle to rotate around Z axis in degrees.\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport function fromEuler(out, x, y, z) {\n var halfToRad = 0.5 * Math.PI / 180.0;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n var sx = Math.sin(x);\n var cx = Math.cos(x);\n var sy = Math.sin(y);\n var cy = Math.cos(y);\n var sz = Math.sin(z);\n var cz = Math.cos(z);\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n return out;\n}\n/**\r\n * Returns a string representation of a quatenion\r\n *\r\n * @param {ReadonlyQuat} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"quat(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n *\r\n * @param {ReadonlyQuat} a quaternion to clone\r\n * @returns {quat} a new quaternion\r\n * @function\r\n */\n\nexport var clone = vec4.clone;\n/**\r\n * Creates a new quat initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {quat} a new quaternion\r\n * @function\r\n */\n\nexport var fromValues = vec4.fromValues;\n/**\r\n * Copy the values from one quat to another\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the source quaternion\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var copy = vec4.copy;\n/**\r\n * Set the components of a quat to the given values\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var set = vec4.set;\n/**\r\n * Adds two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var add = vec4.add;\n/**\r\n * Alias for {@link quat.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Scales a quat by a scalar number\r\n *\r\n * @param {quat} out the receiving vector\r\n * @param {ReadonlyQuat} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var scale = vec4.scale;\n/**\r\n * Calculates the dot product of two quat's\r\n *\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {Number} dot product of a and b\r\n * @function\r\n */\n\nexport var dot = vec4.dot;\n/**\r\n * Performs a linear interpolation between two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var lerp = vec4.lerp;\n/**\r\n * Calculates the length of a quat\r\n *\r\n * @param {ReadonlyQuat} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport var length = vec4.length;\n/**\r\n * Alias for {@link quat.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Calculates the squared length of a quat\r\n *\r\n * @param {ReadonlyQuat} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n * @function\r\n */\n\nexport var squaredLength = vec4.squaredLength;\n/**\r\n * Alias for {@link quat.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Normalize a quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quaternion to normalize\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var normalize = vec4.normalize;\n/**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyQuat} a The first quaternion.\r\n * @param {ReadonlyQuat} b The second quaternion.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport var exactEquals = vec4.exactEquals;\n/**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyQuat} a The first vector.\r\n * @param {ReadonlyQuat} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport var equals = vec4.equals;\n/**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n *\r\n * @param {quat} out the receiving quaternion.\r\n * @param {ReadonlyVec3} a the initial vector\r\n * @param {ReadonlyVec3} b the destination vector\r\n * @returns {quat} out\r\n */\n\nexport var rotationTo = function () {\n var tmpvec3 = vec3.create();\n var xUnitVec3 = vec3.fromValues(1, 0, 0);\n var yUnitVec3 = vec3.fromValues(0, 1, 0);\n return function (out, a, b) {\n var dot = vec3.dot(a, b);\n\n if (dot < -0.999999) {\n vec3.cross(tmpvec3, xUnitVec3, a);\n if (vec3.len(tmpvec3) < 0.000001) vec3.cross(tmpvec3, yUnitVec3, a);\n vec3.normalize(tmpvec3, tmpvec3);\n setAxisAngle(out, tmpvec3, Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n vec3.cross(tmpvec3, a, b);\n out[0] = tmpvec3[0];\n out[1] = tmpvec3[1];\n out[2] = tmpvec3[2];\n out[3] = 1 + dot;\n return normalize(out, out);\n }\n };\n}();\n/**\r\n * Performs a spherical linear interpolation with two control points\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {ReadonlyQuat} c the third operand\r\n * @param {ReadonlyQuat} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n */\n\nexport var sqlerp = function () {\n var temp1 = create();\n var temp2 = create();\n return function (out, a, b, c, d, t) {\n slerp(temp1, a, d, t);\n slerp(temp2, b, c, t);\n slerp(out, temp1, temp2, 2 * t * (1 - t));\n return out;\n };\n}();\n/**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n *\r\n * @param {ReadonlyVec3} view the vector representing the viewing direction\r\n * @param {ReadonlyVec3} right the vector representing the local \"right\" direction\r\n * @param {ReadonlyVec3} up the vector representing the local \"up\" direction\r\n * @returns {quat} out\r\n */\n\nexport var setAxes = function () {\n var matr = mat3.create();\n return function (out, view, right, up) {\n matr[0] = right[0];\n matr[3] = right[1];\n matr[6] = right[2];\n matr[1] = up[0];\n matr[4] = up[1];\n matr[7] = up[2];\n matr[2] = -view[0];\n matr[5] = -view[1];\n matr[8] = -view[2];\n return normalize(out, fromMat3(out, matr));\n };\n}();","import * as glMatrix from \"./common.js\";\n/**\r\n * 4 Dimensional Vector\r\n * @module vec4\r\n */\n\n/**\r\n * Creates a new, empty vec4\r\n *\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec4 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec4} a vector to clone\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Creates a new vec4 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function fromValues(x, y, z, w) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\r\n * Copy the values from one vec4 to another\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the source vector\r\n * @returns {vec4} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set the components of a vec4 to the given values\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} out\r\n */\n\nexport function set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\r\n * Adds two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\r\n * Multiplies two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n}\n/**\r\n * Divides two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to ceil\r\n * @returns {vec4} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to floor\r\n * @returns {vec4} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n}\n/**\r\n * Math.round the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to round\r\n * @returns {vec4} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n}\n/**\r\n * Scales a vec4 by a scalar number\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec4} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\r\n * Adds two vec4's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec4} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Calculates the length of a vec4\r\n *\r\n * @param {ReadonlyVec4} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\r\n * Calculates the squared length of a vec4\r\n *\r\n * @param {ReadonlyVec4} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Negates the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to negate\r\n * @returns {vec4} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to invert\r\n * @returns {vec4} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n out[3] = 1.0 / a[3];\n return out;\n}\n/**\r\n * Normalize a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to normalize\r\n * @returns {vec4} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n var len = x * x + y * y + z * z + w * w;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n}\n/**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n *\r\n * @param {ReadonlyVec4} result the receiving vector\r\n * @param {ReadonlyVec4} U the first vector\r\n * @param {ReadonlyVec4} V the second vector\r\n * @param {ReadonlyVec4} W the third vector\r\n * @returns {vec4} result\r\n */\n\nexport function cross(out, u, v, w) {\n var A = v[0] * w[1] - v[1] * w[0],\n B = v[0] * w[2] - v[2] * w[0],\n C = v[0] * w[3] - v[3] * w[0],\n D = v[1] * w[2] - v[2] * w[1],\n E = v[1] * w[3] - v[3] * w[1],\n F = v[2] * w[3] - v[3] * w[2];\n var G = u[0];\n var H = u[1];\n var I = u[2];\n var J = u[3];\n out[0] = H * F - I * E + J * D;\n out[1] = -(G * F) + I * C - J * B;\n out[2] = G * E - H * C + J * A;\n out[3] = -(G * D) + H * B - I * A;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec4} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n var aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec4} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n\n var v1, v2, v3, v4;\n var s1, s2;\n\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n\n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n}\n/**\r\n * Transforms the vec4 with a mat4.\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec4} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n}\n/**\r\n * Transforms the vec4 with a quat\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to transform\r\n * @param {ReadonlyQuat} q quaternion to transform with\r\n * @returns {vec4} out\r\n */\n\nexport function transformQuat(out, a, q) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3]; // calculate quat * vec\n\n var ix = qw * x + qy * z - qz * y;\n var iy = qw * y + qz * x - qx * z;\n var iz = qw * z + qx * y - qy * x;\n var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set the components of a vec4 to zero\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @returns {vec4} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec4} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec4} a The first vector.\r\n * @param {ReadonlyVec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec4} a The first vector.\r\n * @param {ReadonlyVec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\r\n * Alias for {@link vec4.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec4.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec4.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec4.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec4.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec4.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec4.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec4s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 4;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n vec[3] = a[i + 3];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n a[i + 3] = vec[3];\n }\n\n return a;\n };\n}();","import * as glMatrix from \"./common.js\";\n/**\r\n * 3 Dimensional Vector\r\n * @module vec3\r\n */\n\n/**\r\n * Creates a new, empty vec3\r\n *\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(3);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec3} a vector to clone\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\r\n * Calculates the length of a vec3\r\n *\r\n * @param {ReadonlyVec3} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return Math.hypot(x, y, z);\n}\n/**\r\n * Creates a new vec3 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function fromValues(x, y, z) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\r\n * Copy the values from one vec3 to another\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the source vector\r\n * @returns {vec3} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\r\n * Set the components of a vec3 to the given values\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} out\r\n */\n\nexport function set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\r\n * Adds two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n}\n/**\r\n * Multiplies two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n}\n/**\r\n * Divides two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to ceil\r\n * @returns {vec3} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to floor\r\n * @returns {vec3} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n}\n/**\r\n * Math.round the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to round\r\n * @returns {vec3} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n return out;\n}\n/**\r\n * Scales a vec3 by a scalar number\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec3} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n return out;\n}\n/**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec3} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return Math.hypot(x, y, z);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return x * x + y * y + z * z;\n}\n/**\r\n * Calculates the squared length of a vec3\r\n *\r\n * @param {ReadonlyVec3} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return x * x + y * y + z * z;\n}\n/**\r\n * Negates the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to negate\r\n * @returns {vec3} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to invert\r\n * @returns {vec3} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n return out;\n}\n/**\r\n * Normalize a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to normalize\r\n * @returns {vec3} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var len = x * x + y * y + z * z;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n/**\r\n * Computes the cross product of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function cross(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2];\n var bx = b[0],\n by = b[1],\n bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n}\n/**\r\n * Performs a hermite interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {ReadonlyVec3} c the third operand\r\n * @param {ReadonlyVec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function hermite(out, a, b, c, d, t) {\n var factorTimes2 = t * t;\n var factor1 = factorTimes2 * (2 * t - 3) + 1;\n var factor2 = factorTimes2 * (t - 2) + t;\n var factor3 = factorTimes2 * (t - 1);\n var factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\r\n * Performs a bezier interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {ReadonlyVec3} c the third operand\r\n * @param {ReadonlyVec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function bezier(out, a, b, c, d, t) {\n var inverseFactor = 1 - t;\n var inverseFactorTimesTwo = inverseFactor * inverseFactor;\n var factorTimes2 = t * t;\n var factor1 = inverseFactorTimesTwo * inverseFactor;\n var factor2 = 3 * t * inverseFactorTimesTwo;\n var factor3 = 3 * factorTimes2 * inverseFactor;\n var factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec3} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n var z = glMatrix.RANDOM() * 2.0 - 1.0;\n var zScale = Math.sqrt(1.0 - z * z) * scale;\n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n}\n/**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n/**\r\n * Transforms the vec3 with a mat3.\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyMat3} m the 3x3 matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformMat3(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n}\n/**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyQuat} q quaternion to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformQuat(out, a, q) {\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3];\n var x = a[0],\n y = a[1],\n z = a[2]; // var qvec = [qx, qy, qz];\n // var uv = vec3.cross([], qvec, a);\n\n var uvx = qy * z - qz * y,\n uvy = qz * x - qx * z,\n uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv);\n\n var uuvx = qy * uvz - qz * uvy,\n uuvy = qz * uvx - qx * uvz,\n uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w);\n\n var w2 = qw * 2;\n uvx *= w2;\n uvy *= w2;\n uvz *= w2; // vec3.scale(uuv, uuv, 2);\n\n uuvx *= 2;\n uuvy *= 2;\n uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv));\n\n out[0] = x + uvx + uuvx;\n out[1] = y + uvy + uuvy;\n out[2] = z + uvz + uuvz;\n return out;\n}\n/**\r\n * Rotate a 3D vector around the x-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateX(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Rotate a 3D vector around the y-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateY(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Rotate a 3D vector around the z-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateZ(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2]; //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Get the angle between two 3D vectors\r\n * @param {ReadonlyVec3} a The first operand\r\n * @param {ReadonlyVec3} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nexport function angle(a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n bx = b[0],\n by = b[1],\n bz = b[2],\n mag1 = Math.sqrt(ax * ax + ay * ay + az * az),\n mag2 = Math.sqrt(bx * bx + by * by + bz * bz),\n mag = mag1 * mag2,\n cosine = mag && dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\r\n * Set the components of a vec3 to zero\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @returns {vec3} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec3} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \")\";\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec3} a The first vector.\r\n * @param {ReadonlyVec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec3} a The first vector.\r\n * @param {ReadonlyVec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2));\n}\n/**\r\n * Alias for {@link vec3.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec3.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec3.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec3.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec3.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec3.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec3.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec3s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 3;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n }\n\n return a;\n };\n}();","import * as glMatrix from \"./common.js\";\nimport * as quat from \"./quat.js\";\nimport * as mat4 from \"./mat4.js\";\n/**\r\n * Dual Quaternion
\r\n * Format: [real, dual]
\r\n * Quaternion format: XYZW
\r\n * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
\r\n * @module quat2\r\n */\n\n/**\r\n * Creates a new identity dual quat\r\n *\r\n * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation]\r\n */\n\nexport function create() {\n var dq = new glMatrix.ARRAY_TYPE(8);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n dq[0] = 0;\n dq[1] = 0;\n dq[2] = 0;\n dq[4] = 0;\n dq[5] = 0;\n dq[6] = 0;\n dq[7] = 0;\n }\n\n dq[3] = 1;\n return dq;\n}\n/**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n *\r\n * @param {ReadonlyQuat2} a dual quaternion to clone\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function clone(a) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = a[0];\n dq[1] = a[1];\n dq[2] = a[2];\n dq[3] = a[3];\n dq[4] = a[4];\n dq[5] = a[5];\n dq[6] = a[6];\n dq[7] = a[7];\n return dq;\n}\n/**\r\n * Creates a new dual quat initialized with the given values\r\n *\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component\r\n * @param {Number} y2 Y component\r\n * @param {Number} z2 Z component\r\n * @param {Number} w2 W component\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n dq[4] = x2;\n dq[5] = y2;\n dq[6] = z2;\n dq[7] = w2;\n return dq;\n}\n/**\r\n * Creates a new dual quat from the given values (quat and translation)\r\n *\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component (translation)\r\n * @param {Number} y2 Y component (translation)\r\n * @param {Number} z2 Z component (translation)\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n var ax = x2 * 0.5,\n ay = y2 * 0.5,\n az = z2 * 0.5;\n dq[4] = ax * w1 + ay * z1 - az * y1;\n dq[5] = ay * w1 + az * x1 - ax * z1;\n dq[6] = az * w1 + ax * y1 - ay * x1;\n dq[7] = -ax * x1 - ay * y1 - az * z1;\n return dq;\n}\n/**\r\n * Creates a dual quat from a quaternion and a translation\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyQuat} q a normalized quaternion\r\n * @param {ReadonlyVec3} t tranlation vector\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromRotationTranslation(out, q, t) {\n var ax = t[0] * 0.5,\n ay = t[1] * 0.5,\n az = t[2] * 0.5,\n bx = q[0],\n by = q[1],\n bz = q[2],\n bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Creates a dual quat from a translation\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyVec3} t translation vector\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n}\n/**\r\n * Creates a dual quat from a quaternion\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyQuat} q the quaternion\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\r\n * Creates a new dual quat from a matrix (4x4)\r\n *\r\n * @param {quat2} out the dual quaternion\r\n * @param {ReadonlyMat4} a the matrix\r\n * @returns {quat2} dual quat receiving operation result\r\n * @function\r\n */\n\nexport function fromMat4(out, a) {\n //TODO Optimize this\n var outer = quat.create();\n mat4.getRotation(outer, a);\n var t = new glMatrix.ARRAY_TYPE(3);\n mat4.getTranslation(t, a);\n fromRotationTranslation(out, outer, t);\n return out;\n}\n/**\r\n * Copy the values from one dual quat to another\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the source dual quaternion\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n}\n/**\r\n * Set a dual quat to the identity dual quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @returns {quat2} out\r\n */\n\nexport function identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\r\n * Set the components of a dual quat to the given values\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component\r\n * @param {Number} y2 Y component\r\n * @param {Number} z2 Z component\r\n * @param {Number} w2 W component\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n}\n/**\r\n * Gets the real part of a dual quat\r\n * @param {quat} out real part\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @return {quat} real part\r\n */\n\nexport var getReal = quat.copy;\n/**\r\n * Gets the dual part of a dual quat\r\n * @param {quat} out dual part\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @return {quat} dual part\r\n */\n\nexport function getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n}\n/**\r\n * Set the real component of a dual quat to the given quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat} q a quaternion representing the real part\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport var setReal = quat.copy;\n/**\r\n * Set the dual component of a dual quat to the given quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat} q a quaternion representing the dual part\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function setDual(out, q) {\n out[4] = q[0];\n out[5] = q[1];\n out[6] = q[2];\n out[7] = q[3];\n return out;\n}\n/**\r\n * Gets the translation of a normalized dual quat\r\n * @param {vec3} out translation\r\n * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed\r\n * @return {vec3} translation\r\n */\n\nexport function getTranslation(out, a) {\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n}\n/**\r\n * Translates a dual quat by the given vector\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to translate\r\n * @param {ReadonlyVec3} v vector to translate by\r\n * @returns {quat2} out\r\n */\n\nexport function translate(out, a, v) {\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3],\n bx1 = v[0] * 0.5,\n by1 = v[1] * 0.5,\n bz1 = v[2] * 0.5,\n ax2 = a[4],\n ay2 = a[5],\n az2 = a[6],\n aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n}\n/**\r\n * Rotates a dual quat around the X axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateX(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around the Y axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateY(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around the Z axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat by a given quaternion (a * q)\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {ReadonlyQuat} q quaternion to rotate by\r\n * @returns {quat2} out\r\n */\n\nexport function rotateByQuatAppend(out, a, q) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n}\n/**\r\n * Rotates a dual quat by a given quaternion (q * a)\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat} q quaternion to rotate by\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @returns {quat2} out\r\n */\n\nexport function rotateByQuatPrepend(out, q, a) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n bx = a[0],\n by = a[1],\n bz = a[2],\n bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around a given axis. Does the normalisation automatically\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @param {Number} rad how far the rotation should be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateAroundAxis(out, a, axis, rad) {\n //Special case for rad = 0\n if (Math.abs(rad) < glMatrix.EPSILON) {\n return copy(out, a);\n }\n\n var axisLength = Math.hypot(axis[0], axis[1], axis[2]);\n rad = rad * 0.5;\n var s = Math.sin(rad);\n var bx = s * axis[0] / axisLength;\n var by = s * axis[1] / axisLength;\n var bz = s * axis[2] / axisLength;\n var bw = Math.cos(rad);\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Adds two dual quat's\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n}\n/**\r\n * Multiplies two dual quat's\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {quat2} out\r\n */\n\nexport function multiply(out, a, b) {\n var ax0 = a[0],\n ay0 = a[1],\n az0 = a[2],\n aw0 = a[3],\n bx1 = b[4],\n by1 = b[5],\n bz1 = b[6],\n bw1 = b[7],\n ax1 = a[4],\n ay1 = a[5],\n az1 = a[6],\n aw1 = a[7],\n bx0 = b[0],\n by0 = b[1],\n bz0 = b[2],\n bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n}\n/**\r\n * Alias for {@link quat2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Scales a dual quat by a scalar number\r\n *\r\n * @param {quat2} out the receiving dual quat\r\n * @param {ReadonlyQuat2} a the dual quat to scale\r\n * @param {Number} b amount to scale the dual quat by\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n}\n/**\r\n * Calculates the dot product of two dual quat's (The dot product of the real parts)\r\n *\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {Number} dot product of a and b\r\n * @function\r\n */\n\nexport var dot = quat.dot;\n/**\r\n * Performs a linear interpolation between two dual quats's\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5)\r\n *\r\n * @param {quat2} out the receiving dual quat\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat2} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var mt = 1 - t;\n if (dot(a, b) < 0) t = -t;\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n}\n/**\r\n * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a dual quat to calculate inverse of\r\n * @returns {quat2} out\r\n */\n\nexport function invert(out, a) {\n var sqlen = squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n}\n/**\r\n * Calculates the conjugate of a dual quat\r\n * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result.\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat2} a quat to calculate conjugate of\r\n * @returns {quat2} out\r\n */\n\nexport function conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n}\n/**\r\n * Calculates the length of a dual quat\r\n *\r\n * @param {ReadonlyQuat2} a dual quat to calculate length of\r\n * @returns {Number} length of a\r\n * @function\r\n */\n\nexport var length = quat.length;\n/**\r\n * Alias for {@link quat2.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Calculates the squared length of a dual quat\r\n *\r\n * @param {ReadonlyQuat2} a dual quat to calculate squared length of\r\n * @returns {Number} squared length of a\r\n * @function\r\n */\n\nexport var squaredLength = quat.squaredLength;\n/**\r\n * Alias for {@link quat2.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Normalize a dual quat\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a dual quaternion to normalize\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function normalize(out, a) {\n var magnitude = squaredLength(a);\n\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n var a0 = a[0] / magnitude;\n var a1 = a[1] / magnitude;\n var a2 = a[2] / magnitude;\n var a3 = a[3] / magnitude;\n var b0 = a[4];\n var b1 = a[5];\n var b2 = a[6];\n var b3 = a[7];\n var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n\n return out;\n}\n/**\r\n * Returns a string representation of a dual quatenion\r\n *\r\n * @param {ReadonlyQuat2} a dual quaternion to represent as a string\r\n * @returns {String} string representation of the dual quat\r\n */\n\nexport function str(a) {\n return \"quat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \")\";\n}\n/**\r\n * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyQuat2} a the first dual quaternion.\r\n * @param {ReadonlyQuat2} b the second dual quaternion.\r\n * @returns {Boolean} true if the dual quaternions are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7];\n}\n/**\r\n * Returns whether or not the dual quaternions have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyQuat2} a the first dual quat.\r\n * @param {ReadonlyQuat2} b the second dual quat.\r\n * @returns {Boolean} true if the dual quats are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7));\n}","import * as glMatrix from \"./common.js\";\n/**\r\n * 2 Dimensional Vector\r\n * @module vec2\r\n */\n\n/**\r\n * Creates a new, empty vec2\r\n *\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(2);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec2 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec2} a vector to clone\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\r\n * Creates a new vec2 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function fromValues(x, y) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\r\n * Copy the values from one vec2 to another\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the source vector\r\n * @returns {vec2} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\r\n * Set the components of a vec2 to the given values\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} out\r\n */\n\nexport function set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\r\n * Adds two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n}\n/**\r\n * Multiplies two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n}\n/**\r\n * Divides two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to ceil\r\n * @returns {vec2} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to floor\r\n * @returns {vec2} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n}\n/**\r\n * Math.round the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to round\r\n * @returns {vec2} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n}\n/**\r\n * Scales a vec2 by a scalar number\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec2} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n}\n/**\r\n * Adds two vec2's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec2} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return Math.hypot(x, y);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return x * x + y * y;\n}\n/**\r\n * Calculates the length of a vec2\r\n *\r\n * @param {ReadonlyVec2} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0],\n y = a[1];\n return Math.hypot(x, y);\n}\n/**\r\n * Calculates the squared length of a vec2\r\n *\r\n * @param {ReadonlyVec2} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0],\n y = a[1];\n return x * x + y * y;\n}\n/**\r\n * Negates the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to negate\r\n * @returns {vec2} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to invert\r\n * @returns {vec2} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n return out;\n}\n/**\r\n * Normalize a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to normalize\r\n * @returns {vec2} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0],\n y = a[1];\n var len = x * x + y * y;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n}\n/**\r\n * Computes the cross product of two vec2's\r\n * Note that the cross product must by definition produce a 3D vector\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function cross(out, a, b) {\n var z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec2} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0],\n ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec2} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n out[0] = Math.cos(r) * scale;\n out[1] = Math.sin(r) * scale;\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat2} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat2(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat2d\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat2d} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat2d(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat3\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat3} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat3(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat4\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0];\n var y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n}\n/**\r\n * Rotate a 2D vector\r\n * @param {vec2} out The receiving vec2\r\n * @param {ReadonlyVec2} a The vec2 point to rotate\r\n * @param {ReadonlyVec2} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec2} out\r\n */\n\nexport function rotate(out, a, b, rad) {\n //Translate point to the origin\n var p0 = a[0] - b[0],\n p1 = a[1] - b[1],\n sinC = Math.sin(rad),\n cosC = Math.cos(rad); //perform rotation and translate to correct position\n\n out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n}\n/**\r\n * Get the angle between two 2D vectors\r\n * @param {ReadonlyVec2} a The first operand\r\n * @param {ReadonlyVec2} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nexport function angle(a, b) {\n var x1 = a[0],\n y1 = a[1],\n x2 = b[0],\n y2 = b[1],\n // mag is the product of the magnitudes of a and b\n mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2),\n // mag &&.. short circuits if mag == 0\n cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\n\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\r\n * Set the components of a vec2 to zero\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @returns {vec2} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec2} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec2(\" + a[0] + \", \" + a[1] + \")\";\n}\n/**\r\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec2} a The first vector.\r\n * @param {ReadonlyVec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec2} a The first vector.\r\n * @param {ReadonlyVec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1];\n var b0 = b[0],\n b1 = b[1];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1));\n}\n/**\r\n * Alias for {@link vec2.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec2.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec2.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec2.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec2.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec2.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec2s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 2;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n }\n\n return a;\n };\n}();","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Scene = void 0;\nconst SceneChild_1 = require(\"./SceneChild\");\nconst Group_1 = require(\"./Group\");\nconst Shape_1 = require(\"./shapes/Shape\");\nconst Utilities_1 = require(\"./Utilities\");\n/**\n * Container for all SceneChild.\n * The main purpose is to manage the drawing order and update the child buffers\n *\n * @order 1\n * @category Core.Scene\n * @class Scene\n */\nclass Scene {\n /**\n * Creates an instance of Scene.\n * You can see the default values in the property definitions\n */\n constructor(settings = {}) {\n /**\n * Logical number, the drawer will take care of defining the unit of measure\n */\n this.width = 400;\n /**\n * Logical number, the drawer will take care of defining the unit of measure\n */\n this.height = 400;\n /**\n * Default background color (black)\n */\n this.background = 'hsla(0, 0%, 0%, 1)';\n /**\n * Default ScenePrimitive stroke color (white)\n */\n this.color = 'hsla(0, 0%, 100%, 1)';\n /**\n * Current time\n */\n this.currentTime = 0;\n if (typeof settings.width !== 'undefined')\n this.width = settings.width;\n if (typeof settings.height !== 'undefined')\n this.height = settings.height;\n if (typeof settings.background !== 'undefined')\n this.background = settings.background;\n if (typeof settings.color !== 'undefined')\n this.color = settings.color;\n this.children = [];\n this.center = [this.width / 2, this.height / 2];\n this.anchor =\n settings.anchor && Array.isArray(settings.anchor)\n ? [\n typeof settings.anchor[0] === 'number'\n ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[0]) * 0.5) * this.width\n : settings.anchor[0] === 'left'\n ? 0\n : settings.anchor[0] === 'right'\n ? this.width\n : this.center[0],\n typeof settings.anchor[1] === 'number'\n ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[1]) * 0.5) * this.height\n : settings.anchor[1] === 'top'\n ? 0\n : settings.anchor[1] === 'bottom'\n ? this.height\n : this.center[1],\n ]\n : [this.center[0], this.center[1]];\n }\n /**\n * Return width percentage\n *\n * @param {number} [percentage=100]\n * @returns {number}\n */\n getWidth(percentage = 100) {\n return (this.width * percentage) / 100;\n }\n /**\n * Return height percentage\n *\n * @param {number} [percentage=100]\n * @returns {number}\n */\n getHeight(percentage = 100) {\n return (this.height * percentage) / 100;\n }\n /**\n * Resize the scene size\n *\n * @param {number} width\n * @param {number} [height=width]\n * @memberof Scene\n */\n resize(width, height = width) {\n this.width = width;\n this.height = height;\n this.center = [this.width / 2, this.height / 2];\n const anchor = [this.width / this.anchor[0], this.height / this.anchor[1]];\n this.anchor = [this.width / anchor[0], this.height / anchor[1]];\n this.children.forEach(sceneChild => sceneChild.clearBuffer(true, false));\n }\n /**\n * Update all children, generate a streamable buffer for drawing\n *\n * @param {number} [atTime] time in ms\n * @memberof Scene\n */\n update(atTime = 0) {\n this.currentTime = atTime;\n for (let i = 0, len = this.children.length; i < len; i++) {\n this.children[i].generate(this.currentTime, true);\n }\n }\n /**\n * Traverse the child buffer and use it with callback\n *\n * @param {(streamArguments: IStreamArguments) => void} callback\n * @memberof Scene\n */\n stream(callback) {\n this.children.forEach(sceneChild => sceneChild.stream(callback));\n }\n /*\n |--------------------------------------------------------------------------\n | SceneChild\n |--------------------------------------------------------------------------\n */\n /**\n * Return a list of children\n *\n * @returns {Array}\n * @memberof Scene\n */\n getChildren() {\n return this.children;\n }\n /**\n * Add SceneChild to Scene, pass `order` as last parameter for drawing priorities\n *\n * @param {Array} items\n * @param {number} [order]\n * @memberof Scene\n */\n add(...items /**, order: number */) {\n const order = typeof items[items.length - 1] === 'number' ? items[items.length - 1] : undefined;\n const len = items.length - (typeof order === 'undefined' ? 0 : 1);\n for (let i = 0; i < len; i++) {\n const item = items[i];\n item.order =\n typeof order !== 'undefined'\n ? order + i\n : typeof item.order !== 'undefined'\n ? item.order\n : this.children.length > 0\n ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1\n : 0;\n Scene.propagateToChilden(item, this);\n this.children.push(item);\n item.clearBuffer(true, false);\n item.generate(0, true);\n }\n this.sortChildren();\n }\n /**\n * Sort children by order\n *\n * @memberof Scene\n */\n sortChildren() {\n this.children.sort((a, b) => a.order - b.order);\n this.children = this.children.map((child, index) => {\n child.order = index;\n return child;\n });\n }\n /**\n * Find sceneChild from id or name in the whole scene\n *\n * @param {string | number} idOrName\n * @returns {(SceneChild | null)}\n * @memberof Scene\n */\n find(idOrName) {\n const children = this.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const result = children[i].find(idOrName);\n if (result !== null)\n return result;\n }\n return null;\n }\n /**\n * Get shape by index\n *\n * @param {number} index\n * @returns {(SceneChild | null)}\n * @memberof Scene\n */\n get(index) {\n return index >= 0 && index < this.children.length ? this.children[index] : null;\n }\n /**\n * Remove a shape by index\n *\n * @param {number} index\n * @memberof Scene\n */\n remove(index) {\n index >= 0 && index < this.children.length && this.children.splice(index, 1);\n }\n /**\n * Removes all children\n *\n * @memberof Scene\n */\n removeChildren() {\n this.children = [];\n }\n /**\n * Remove sceneChild by id or name\n *\n * @param {number | number} idOrName\n * @memberof Scene\n */\n removeFromId(idOrName) {\n for (let i = 0, len = this.children.length; i < len; i++)\n if (this.children[i].id === idOrName || this.children[i].name === idOrName) {\n this.children.splice(i, 1);\n return;\n }\n }\n /**\n * Return true if sceneChild is direct children\n *\n * @param {SceneChild} sceneChild\n * @returns {boolean}\n * @memberof Scene\n */\n isFirstLevelChild(sceneChild) {\n for (let i = 0, len = this.children.length; i < len; i++)\n if (this.children[i].id === sceneChild.id)\n return true;\n const parents = this.getParentsOfSceneChild(sceneChild);\n return parents.length === 1 && parents[0] instanceof Group_1.Group;\n }\n /**\n * Returns the list of sceneChild hierarchy starting from the scene\n *\n * @param {SceneChild} sceneChild\n * @returns {Array}\n * @memberof Scene\n */\n getParentsOfSceneChild(sceneChild) {\n const result = Scene.getParentsOfSceneChild(this, sceneChild);\n if (result) {\n result.splice(0, 1);\n return result;\n }\n return [];\n }\n /**\n * Returns the list of sceneChild hierarchy starting from the scene\n *\n * @static\n * @param {(Scene | SceneChild)} current\n * @param {SceneChild} sceneChild\n * @param {(Array)} [parents=[]]\n * @returns {(Array | null)}\n * @memberof Scene\n */\n static getParentsOfSceneChild(current, sceneChild, parents = []) {\n let result;\n if (current instanceof SceneChild_1.SceneChild) {\n if (current.id == sceneChild.id)\n return parents;\n if (current instanceof Shape_1.Shape && current.shape) {\n const tmpParents = parents.slice();\n tmpParents.push(current);\n if ((result = Scene.getParentsOfSceneChild(current.shape, sceneChild, tmpParents)))\n return result;\n }\n }\n if (current instanceof Scene || current instanceof Group_1.Group) {\n const children = current.getChildren();\n parents.push(current);\n for (let i = 0, len = children.length; i < len; i++) {\n const child = children[i];\n if ((result = Scene.getParentsOfSceneChild(child, sceneChild, parents)))\n return result;\n }\n parents.pop();\n }\n return null;\n }\n /**\n * Walk through the scene\n *\n * @static\n * @param {SceneChild} callbackk\n * @param {(Scene | SceneChild)} current\n * @memberof Scene\n */\n static walk(callback, current) {\n if (current instanceof SceneChild_1.SceneChild) {\n if (callback(current) === false)\n return false;\n if (current instanceof Shape_1.Shape && current.shape)\n if (Scene.walk(callback, current.shape) === false)\n return false;\n }\n if (current instanceof Scene || current instanceof Group_1.Group) {\n const children = current.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const child = children[i];\n if (Scene.walk(callback, child) === false)\n return false;\n }\n }\n }\n /**\n * Propagate scene to sceneChild (and children)\n *\n * @static\n * @param {SceneChild} sceneChild\n * @param {Scene} scene\n * @memberof Scene\n */\n static propagateToChilden(sceneChild, scene) {\n sceneChild.scene = scene;\n if (sceneChild instanceof Group_1.Group) {\n sceneChild.getChildren().forEach((item) => {\n Scene.propagateToChilden(item, scene);\n });\n }\n else if (sceneChild instanceof Shape_1.Shape && sceneChild.shape) {\n sceneChild.shape.scene = scene;\n Scene.propagateToChilden(sceneChild.shape, scene);\n }\n }\n}\nexports.Scene = Scene;\n//# sourceMappingURL=Scene.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SceneChild = void 0;\n/**\n * Autoincrement sceneChild default id\n *\n * @internal\n * @ignore\n */\nlet __id = 0;\n/**\n * The element to be added into a scene.\n * Preserve props, drawing order, generate and return buffers.\n * The only implementations of this class are Group and ShapeBase\n *\n * @abstract\n * @category Core.Abstract\n * @order 2\n * @class SceneChild\n */\nclass SceneChild {\n /**\n * Creates an instance of SceneChild.\n * Base values will be assigned in case they are not passed\n *\n * @param {ISceneChildSettings} settings\n */\n constructor(settings) {\n var _a;\n /**\n * Shape generation id\n * used for prevent buffer calculation\n *\n * @internal\n * @ignore\n */\n this.generateId = -1;\n this.id = (_a = settings.id) !== null && _a !== void 0 ? _a : ++__id;\n this.type = settings.type || 'SceneChild';\n this.name = settings.name || this.type + '_' + this.id;\n this.data = settings.data || {};\n this.props = {};\n }\n /**\n * Find this or form or children.\n * Overridden by classes that extend it\n *\n * @param {string | number} idOrName\n * @returns {(SceneChild | null)}\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n return null;\n }\n /**\n * Return the sceneChild properties\n *\n * @returns {Props}\n */\n getProps() {\n return this.props;\n }\n /**\n * Return a sceneChild prop or default value\n *\n * @param {keyof Props} key\n * @param {PropArguments} [propArguments]\n * @param {*} [defaultValue]\n * @returns {*}\n */\n getProp(key, propArguments, defaultValue) {\n var _a;\n return ((_a = this.props[key]) !== null && _a !== void 0 ? _a : defaultValue);\n }\n /**\n * Check SceneChild has prop\n *\n * @param {keyof Props} key\n * @returns\n */\n hasProp(key) {\n return typeof this.props[key] !== 'undefined';\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n */\n setPropUnsafe(key, value) {\n if (typeof key == 'string')\n this.props[key] = value;\n else\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n }\n}\nexports.SceneChild = SceneChild;\n//# sourceMappingURL=SceneChild.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Group = void 0;\nconst Scene_1 = require(\"./Scene\");\nconst SceneChild_1 = require(\"./SceneChild\");\nconst ShapeBase_1 = require(\"./shapes/ShapeBase\");\nconst Adapt_1 = require(\"./modifiers/Adapt\");\n/**\n * A SceneChild container, propagates properties to children\n *\n * @order 3\n * @category Core.Scene\n * @extends {SceneChild}\n * @example\n * ```javascript\n * // Group example\n *\n * const rect = new Urpflanze.Rect({\n * \tdistance: 100 // <- if a property is set the group will not overwrite it\n * })\n * const group = new Urpflanze.Group({\n * \trepetitions: 3,\n * \tdistance: 200\n * })\n *\n * group.add(rect)\n * group.add(new Urpflanze.Triangle())\n * ```\n * @class Group\n */\nclass Group extends SceneChild_1.SceneChild {\n /**\n * Creates an instance of Group\n *\n * @param {ISceneChildSettings} [settings={}]\n * @memberof Group\n */\n constructor(settings = {}) {\n settings.type = 'Group';\n super(settings);\n this.children = [];\n ['id', 'name', 'data', 'order', 'type'].forEach((prop) => {\n if (prop in settings)\n delete settings[prop];\n });\n this.props = settings;\n }\n /**\n * Check group has static children\n *\n * @returns {boolean}\n * @memberof Group\n */\n isStatic() {\n const children = this.children;\n for (let i = 0, len = children.length; i < len; i++)\n if (!children[i].isStatic())\n return false;\n return true;\n }\n /**\n * Check group has static children indexed\n *\n * @returns {boolean}\n * @memberof Group\n */\n isStaticIndexed() {\n const children = this.children;\n for (let i = 0, len = children.length; i < len; i++)\n if (!children[i].isStaticIndexed())\n return false;\n return true;\n }\n /**\n * Add item to Group\n *\n * @param {Array} items\n * @memberof Group\n */\n add(...items) {\n for (let i = 0, len = items.length; i < len; i++) {\n const item = items[i];\n const rawItemProps = item.getProps();\n Object.keys(this.props).forEach((propKey) => {\n if (typeof rawItemProps[propKey] === 'undefined')\n item.setProp(propKey, this.props[propKey]);\n });\n item.order =\n typeof item.order !== 'undefined'\n ? item.order\n : this.children.length > 0\n ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1\n : 0;\n this.scene && Scene_1.Scene.propagateToChilden(item, this.scene);\n this.children.push(item);\n }\n this.sortChildren();\n }\n /**\n * Sort children\n *\n * @memberof Group\n */\n sortChildren() {\n this.children.sort((a, b) => a.order - b.order);\n this.children = this.children.map((child, index) => {\n child.order = index;\n return child;\n });\n this.clearBuffer(true);\n }\n /**\n * Return shape children\n *\n * @returns {Array}\n * @memberof Group\n */\n getChildren() {\n return this.children;\n }\n /**\n * Find scene child from id or name\n *\n * @param {number | string} idOrName\n * @returns {(SceneChild | null)}\n * @memberof Group\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n const children = this.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const result = children[i].find(idOrName);\n if (result !== null)\n return result;\n }\n return null;\n }\n /**\n * Get item from group\n *\n * @param {number} index\n * @returns {(SceneChild | null)}\n * @memberof Group\n */\n get(index) {\n return index >= 0 && index < this.children.length ? this.children[index] : null;\n }\n /**\n * Remove item from group\n *\n * @param {number} index\n * @returns {(false | Array)}\n * @memberof Group\n */\n remove(index) {\n if (index >= 0 && index < this.children.length) {\n const removed = this.children.splice(index, 1);\n this.clearBuffer(true);\n return removed;\n }\n return false;\n }\n /**\n * Remove from id\n *\n * @param {number} id\n * @memberof Scene\n */\n removeFromId(id) {\n for (let i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i].id == id) {\n this.children.splice(i, 1);\n return this.clearBuffer(true);\n }\n }\n }\n /**\n * Generate children buffers\n *\n * @param {number} generateId\n * @param {boolean} [bDirectSceneChild=false]\n * @param {IPropArguments} [parentPropArguments]\n * @memberof Group\n */\n generate(generateId, bDirectSceneChild = false, parentPropArguments) {\n this.generateId = generateId;\n this.children.forEach(item => item.generate(generateId, bDirectSceneChild, parentPropArguments));\n }\n /**\n * Sum the children bounding\n *\n * @return {IShapeBounding}\n */\n getBounding() {\n const boundings = [];\n const bounding = Adapt_1.Bounding.empty();\n if (this.children.length > 0) {\n this.children.forEach(item => boundings.push(item.getBounding()));\n for (let i = 0, len = this.children.length; i < len; i++) {\n bounding.x = bounding.x > boundings[i].x ? boundings[i].x : bounding.x;\n bounding.y = bounding.y > boundings[i].y ? boundings[i].y : bounding.y;\n bounding.width = bounding.width < boundings[i].width ? boundings[i].width : bounding.width;\n bounding.height = bounding.height < boundings[i].height ? boundings[i].height : bounding.height;\n }\n bounding.cx = bounding.x + bounding.width / 2;\n bounding.cy = bounding.y + bounding.height / 2;\n }\n return bounding;\n }\n /**\n * Chear children buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @memberof Group\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.children.forEach(item => item.clearBuffer(bClearIndexed, false));\n if (this.scene && bPropagateToParents) {\n const parents = this.scene.getParentsOfSceneChild(this);\n parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */);\n }\n // if (bPropagateToParents && this.scene)\n // {\n // const parents = this.scene.getParentsOfSceneChild(this)\n // parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, true, false)\n // }\n // if (bPropagateToChildren)\n // {\n // this.children.forEach(sceneChild => sceneChild.clearBuffer(bClearIndexed, false, true))\n // }\n }\n /**\n * Set a single or multiple props\n *\n * @abstract\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @memberof SceneChild\n */\n setProp(key, value) {\n if (typeof key === 'object')\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n else\n this.props[key] = value;\n this.children.forEach(item => item.setProp(key, value));\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @memberof ShapeBase\n */\n setPropUnsafe(key, value) {\n super.setPropUnsafe(key, value);\n this.children.forEach(item => item.setPropUnsafe(key, value));\n }\n /**\n * Return length of buffer\n *\n * @param {IPropArguments} propArguments\n * @returns {number}\n * @memberof Group\n */\n getBufferLength(propArguments) {\n return this.children.map(sceneChild => sceneChild.getBufferLength(propArguments)).reduce((p, c) => p + c, 0);\n }\n /**\n * return a single buffer binded from children\n *\n * @returns {Float32Array}\n * @memberof Group\n */\n getBuffer() {\n const buffers = this.children\n .map(item => item.getBuffer())\n .filter(b => b !== undefined);\n const size = buffers.reduce((currLength, buffer) => currLength + buffer.length, 0);\n if (size > 0) {\n const result = new Float32Array(size);\n result.set(buffers[0], 0);\n for (let i = 1, offset = 0, len = buffers.length; i < len; i++) {\n offset += buffers[i - 1].length;\n result.set(buffers[i], offset);\n }\n return result;\n }\n return ShapeBase_1.ShapeBase.EMPTY_BUFFER;\n }\n /**\n * return a single buffer binded from children\n *\n * @returns {(Array | undefined)}\n * @memberof Group\n */\n getIndexedBuffer() {\n const indexed = this.children.map(item => item.getIndexedBuffer()).filter(b => b !== undefined);\n return [].concat.apply([], indexed);\n }\n /**\n * Call strem on children\n *\n * @param {(streamArguments: IStreamArguments) => void} callback\n * @memberof Group\n */\n stream(callback) {\n this.children.forEach(item => item.stream(callback));\n }\n}\nexports.Group = Group;\n//# sourceMappingURL=Group.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeBase = void 0;\nconst gl_matrix_1 = require(\"gl-matrix\");\nconst types_1 = require(\"../types\");\nconst glme = require(\"../math/gl-matrix-extensions\");\nconst Vec2_1 = require(\"../math/Vec2\");\nconst math_1 = require(\"../math\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst Utilities_1 = require(\"../Utilities\");\nconst SceneChild_1 = require(\"../SceneChild\");\nconst tmpMatrix = gl_matrix_1.mat4.create();\nconst transformMatrix = gl_matrix_1.mat4.create();\nconst perspectiveMatrix = gl_matrix_1.mat4.create();\nconst repetitionMatrix = gl_matrix_1.mat4.create();\n/**\n * Main class for shape generation\n *\n * @category Core.Abstract\n * @abstract\n * @class ShapeBase\n * @order 4\n * @extends {SceneChild}\n */\nclass ShapeBase extends SceneChild_1.SceneChild {\n /**\n * Creates an instance of ShapeBase\n *\n * @param {ISceneChildSettings} [settings={}]\n */\n constructor(settings = {}) {\n super(settings);\n /**\n * Flag used to determine if indexedBuffer has been generated\n *\n * @internal\n * @ignore\n */\n this.bIndexed = false;\n /**\n * Array used for index a vertex buffer\n * only for first level scene children\n *\n * @internal\n * @ignore\n */\n this.indexedBuffer = [];\n /**\n * The bounding inside the scene\n *\n * @type {IShapeBounding}\n */\n this.bounding = {\n cx: 0,\n cy: 0,\n x: -1,\n y: -1,\n width: 2,\n height: 2,\n };\n this.props = {\n distance: settings.distance,\n repetitions: settings.repetitions,\n rotateX: settings.rotateX,\n rotateY: settings.rotateY,\n rotateZ: settings.rotateZ,\n skewX: settings.skewX,\n skewY: settings.skewY,\n squeezeX: settings.squeezeX,\n squeezeY: settings.squeezeY,\n displace: settings.displace,\n translate: settings.translate,\n scale: settings.scale,\n transformOrigin: settings.transformOrigin,\n perspective: settings.perspective,\n perspectiveOrigin: settings.perspectiveOrigin,\n };\n this.anchor =\n settings.anchor && Array.isArray(settings.anchor)\n ? [\n typeof settings.anchor[0] === 'number'\n ? Utilities_1.clamp(-1, 1, settings.anchor[0]) * -1\n : settings.anchor[0] === 'left'\n ? 1\n : settings.anchor[0] === 'right'\n ? -1\n : 0,\n typeof settings.anchor[1] === 'number'\n ? Utilities_1.clamp(-1, 1, settings.anchor[1]) * -1\n : settings.anchor[1] === 'top'\n ? 1\n : settings.anchor[1] === 'bottom'\n ? -1\n : 0,\n ]\n : [0, 0];\n this.boundingType =\n typeof settings.boundingType === 'string'\n ? settings.boundingType === 'relative'\n ? types_1.EBoundingType.Relative\n : types_1.EBoundingType.Fixed\n : settings.boundingType || types_1.EBoundingType.Fixed;\n this.vertexCallback = settings.vertexCallback;\n }\n /**\n * Check if the shape should be generated every time\n *\n * @returns {boolean}\n */\n isStatic() {\n const props = this.props;\n return (typeof props.repetitions !== 'function' &&\n typeof props.distance !== 'function' &&\n typeof props.displace !== 'function' &&\n typeof props.scale !== 'function' &&\n typeof props.translate !== 'function' &&\n typeof props.skewX !== 'function' &&\n typeof props.skewY !== 'function' &&\n typeof props.squeezeX !== 'function' &&\n typeof props.squeezeY !== 'function' &&\n typeof props.rotateX !== 'function' &&\n typeof props.rotateY !== 'function' &&\n typeof props.rotateZ !== 'function' &&\n typeof props.transformOrigin !== 'function' &&\n typeof props.perspective !== 'function' &&\n typeof props.perspectiveOrigin !== 'function');\n }\n /**\n * Check if the indexedBuffer array needs to be recreated every time,\n * this can happen when a shape generates an array of vertices different in length at each repetition\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return typeof this.props.repetitions !== 'function';\n }\n /**\n * Return a prop value\n *\n * @param {keyof ISceneChildProps} key\n * @param {PropArguments} [propArguments]\n * @param {*} [defaultValue]\n * @returns {*}\n */\n getProp(key, propArguments, defaultValue) {\n let attribute = this.props[key];\n if (typeof attribute === 'function') {\n attribute = attribute(propArguments);\n }\n return typeof attribute === 'undefined' || Number.isNaN(attribute) ? defaultValue : attribute;\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @param {boolean} [bClearIndexed=false]\n */\n setProp(key, value, bClearIndexed = false) {\n if (typeof key === 'string') {\n bClearIndexed = bClearIndexed || key == 'repetitions';\n this.props[key] = value;\n }\n else {\n bClearIndexed = bClearIndexed || 'repetitions' in key;\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n }\n this.clearBuffer(bClearIndexed, true);\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.buffer = undefined;\n if (bClearIndexed) {\n this.bIndexed = false;\n this.indexedBuffer = [];\n }\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n if (bPropagateToParents && this.scene && !this.scene.isFirstLevelChild(this)) {\n const parents = this.scene.getParentsOfSceneChild(this);\n parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */);\n }\n }\n /**\n * Update the vertex array if the shape is not static and update the indexedBuffer if it is also not static\n *\n * @param {number} generateId generation id\n * @param {boolean} [bDirectSceneChild=false] adjust shape of center of scene\n * @param {PropArguments} [parentPropArguments]\n */\n generate(generateId = 0, bDirectSceneChild = false, parentPropArguments) {\n var _a, _b;\n if (this.buffer && this.bStatic) {\n return;\n }\n this.generateId = generateId;\n if (!this.bStaticIndexed || !this.bIndexed)\n this.indexedBuffer = [];\n const propArguments = ShapeBase.getEmptyPropArguments(this, parentPropArguments);\n const repetition = propArguments.repetition;\n const repetitions = this.getProp('repetitions', propArguments, 1);\n const repetitionType = Array.isArray(repetitions) ? types_1.ERepetitionType.Matrix : types_1.ERepetitionType.Ring;\n const repetitionCount = Array.isArray(repetitions)\n ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0])\n : repetitions;\n const repetitionRowCount = Array.isArray(repetitions) ? repetitions[0] : repetitionCount;\n const repetitionColCount = Array.isArray(repetitions) ? (_b = repetitions[1]) !== null && _b !== void 0 ? _b : repetitions[0] : 1;\n const rowRepetition = repetition.row;\n rowRepetition.count = repetitionRowCount;\n const colRepetition = repetition.col;\n colRepetition.count = repetitionColCount;\n repetition.count = repetitionCount;\n repetition.col.count = repetitionColCount;\n repetition.row.count = repetitionRowCount;\n repetition.type = repetitionType;\n let totalBufferLength = 0;\n const buffers = [];\n let currentIndex = 0;\n const centerMatrix = gl_matrix_1.vec2.fromValues((repetitionColCount - 1) / 2, (repetitionRowCount - 1) / 2);\n const sceneAnchor = this.scene ? [this.scene.anchor[0], this.scene.anchor[1], 0] : [0, 0, 0];\n const tmpTotalShapeBounding = [undefined, undefined, undefined, undefined];\n const tmpSingleRepetitionBounding = [undefined, undefined, undefined, undefined];\n for (let currentRowRepetition = 0; currentRowRepetition < repetitionRowCount; currentRowRepetition++) {\n for (let currentColRepetition = 0; currentColRepetition < repetitionColCount; currentColRepetition++, currentIndex++) {\n repetition.index = currentIndex + 1;\n repetition.offset = repetitionCount > 1 ? currentIndex / (repetitionCount - 1) : 1;\n repetition.angle = repetitionType === types_1.ERepetitionType.Ring ? (math_1.PI2 / repetitionCount) * currentIndex : 0;\n colRepetition.index = currentColRepetition + 1;\n colRepetition.offset = repetitionColCount > 1 ? currentColRepetition / (repetitionColCount - 1) : 1;\n rowRepetition.index = currentRowRepetition + 1;\n rowRepetition.offset = repetitionRowCount > 1 ? currentRowRepetition / (repetitionRowCount - 1) : 1;\n // Generate primitives buffer recursively\n const buffer = this.generateBuffer(generateId, propArguments);\n const bufferLength = buffer.length;\n const bounding = this.getShapeBounding();\n buffers[currentIndex] = new Float32Array(bufferLength);\n totalBufferLength += bufferLength;\n {\n const distance = glme.toVec2(this.getProp('distance', propArguments, glme.VEC2_ZERO));\n const displace = this.getProp('displace', propArguments, 0);\n const scale = glme.toVec3(this.getProp('scale', propArguments, glme.VEC2_ONE), 1);\n const translate = glme.toVec3(this.getProp('translate', propArguments, glme.VEC2_ZERO), 0);\n const skewX = this.getProp('skewX', propArguments, 0);\n const skewY = this.getProp('skewY', propArguments, 0);\n const squeezeX = this.getProp('squeezeX', propArguments, 0);\n const squeezeY = this.getProp('squeezeY', propArguments, 0);\n const rotateX = this.getProp('rotateX', propArguments, 0);\n const rotateY = this.getProp('rotateY', propArguments, 0);\n const rotateZ = this.getProp('rotateZ', propArguments, 0);\n const perspective = Utilities_1.clamp(0, 1, this.getProp('perspective', propArguments, 0));\n const perspectiveOrigin = glme.toVec3(this.getProp('perspectiveOrigin', propArguments, glme.VEC2_ZERO), 0);\n const transformOrigin = glme.toVec3(this.getProp('transformOrigin', propArguments, glme.VEC2_ZERO), 0);\n let offset;\n switch (repetitionType) {\n case types_1.ERepetitionType.Ring:\n offset = gl_matrix_1.vec3.fromValues(distance[0], 0, 0);\n gl_matrix_1.vec3.rotateZ(offset, offset, glme.VEC3_ZERO, repetition.angle + displace);\n break;\n case types_1.ERepetitionType.Matrix:\n offset = gl_matrix_1.vec3.fromValues(distance[1] * (currentColRepetition - centerMatrix[0]), distance[0] * (currentRowRepetition - centerMatrix[1]), 0);\n break;\n }\n const perspectiveSize = perspective > 0 ? Math.max(bounding.width, bounding.height) / 2 : 1;\n const perspectiveValue = perspective > 0 ? perspectiveSize + (1 - perspective) * (perspectiveSize * 10) : 0;\n const bTransformOrigin = (this.boundingType === types_1.EBoundingType.Relative ? bounding.cx !== 0 || bounding.cy !== 0 : true) ||\n perspective !== 0 ||\n transformOrigin[0] !== 0 ||\n transformOrigin[1] !== 0;\n const bPerspectiveOrigin = perspectiveOrigin[0] !== 0 || perspectiveOrigin[1] !== 0;\n if (bTransformOrigin) {\n if (this.boundingType === types_1.EBoundingType.Relative) {\n transformOrigin[0] = transformOrigin[0] * (bounding.width / 2) + bounding.cx;\n transformOrigin[1] = transformOrigin[1] * (bounding.height / 2) + bounding.cy;\n }\n else {\n transformOrigin[0] *= bounding.width / 2;\n transformOrigin[1] *= bounding.height / 2;\n }\n transformOrigin[2] = perspectiveValue;\n }\n /**\n * Create Matrices\n */\n {\n /**\n * Create Transformation matrix\n */\n gl_matrix_1.mat4.identity(transformMatrix);\n bTransformOrigin && gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, transformOrigin);\n if (translate[0] !== 0 || translate[1] !== 0)\n gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, translate);\n if (skewX !== 0 || skewY !== 0) {\n glme.fromSkew(tmpMatrix, [skewX, skewY]);\n gl_matrix_1.mat4.multiply(transformMatrix, transformMatrix, tmpMatrix);\n }\n rotateX !== 0 && gl_matrix_1.mat4.rotateX(transformMatrix, transformMatrix, rotateX);\n rotateY !== 0 && gl_matrix_1.mat4.rotateY(transformMatrix, transformMatrix, rotateY);\n rotateZ !== 0 && gl_matrix_1.mat4.rotateZ(transformMatrix, transformMatrix, rotateZ);\n if (scale[0] !== 1 || scale[1] !== 1)\n gl_matrix_1.mat4.scale(transformMatrix, transformMatrix, scale);\n bTransformOrigin &&\n gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, gl_matrix_1.vec3.scale(transformOrigin, transformOrigin, -1));\n /**\n * Create Perspective matrix\n */\n if (perspectiveValue > 0) {\n if (bPerspectiveOrigin) {\n if (this.boundingType === types_1.EBoundingType.Relative) {\n perspectiveOrigin[0] = perspectiveOrigin[0] * (bounding.width / 2) + bounding.cx;\n perspectiveOrigin[1] = perspectiveOrigin[1] * (bounding.height / 2) + bounding.cy;\n }\n else {\n perspectiveOrigin[0] *= bounding.width / 2;\n perspectiveOrigin[1] *= bounding.height / 2;\n }\n perspectiveOrigin[2] = 0;\n }\n gl_matrix_1.mat4.perspective(perspectiveMatrix, -Math.PI / 2, 1, 0, Infinity);\n }\n /**\n * Create Repetition matrix\n */\n gl_matrix_1.mat4.identity(repetitionMatrix);\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, offset);\n if (bDirectSceneChild) {\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, sceneAnchor);\n }\n /**\n * Apply anchor\n */\n const shapeAnchor = [this.anchor[0] * (bounding.width / 2), this.anchor[1] * (bounding.height / 2), 0];\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, shapeAnchor);\n if (repetitionType === types_1.ERepetitionType.Ring)\n gl_matrix_1.mat4.rotateZ(repetitionMatrix, repetitionMatrix, repetition.angle + displace);\n }\n Adapt_1.Bounding.clear(tmpSingleRepetitionBounding);\n // Apply matrices on vertex\n for (let bufferIndex = 0; bufferIndex < bufferLength; bufferIndex += 2) {\n const vertex = [buffer[bufferIndex], buffer[bufferIndex + 1], perspectiveValue];\n {\n // Apply squeeze, can be insert into transformMatrix?\n squeezeX !== 0 && Vec2_1.default.squeezeX(vertex, squeezeX);\n squeezeY !== 0 && Vec2_1.default.squeezeY(vertex, squeezeY);\n // Apply transforms\n gl_matrix_1.vec3.transformMat4(vertex, vertex, transformMatrix);\n // Apply perspective\n if (perspectiveValue > 0) {\n bPerspectiveOrigin && gl_matrix_1.vec3.add(vertex, vertex, perspectiveOrigin);\n gl_matrix_1.vec3.transformMat4(vertex, vertex, perspectiveMatrix);\n gl_matrix_1.vec3.scale(vertex, vertex, perspectiveValue);\n bPerspectiveOrigin && gl_matrix_1.vec3.sub(vertex, vertex, perspectiveOrigin);\n }\n // apply repetition matrix\n gl_matrix_1.vec3.transformMat4(vertex, vertex, repetitionMatrix);\n // custom vertex manipulation\n if (typeof this.vertexCallback !== 'undefined') {\n const index = bufferIndex / 2;\n const count = bufferLength / 2;\n const vertexRepetition = {\n index: index + 1,\n count,\n offset: count > 1 ? index / (count - 1) : 1,\n };\n this.vertexCallback(vertex, vertexRepetition, propArguments);\n }\n }\n buffers[currentIndex][bufferIndex] = vertex[0];\n buffers[currentIndex][bufferIndex + 1] = vertex[1];\n Adapt_1.Bounding.add(tmpSingleRepetitionBounding, vertex[0], vertex[1]);\n Adapt_1.Bounding.add(tmpTotalShapeBounding, vertex[0], vertex[1]);\n }\n }\n // Bounding.sum(tmpTotalShapeBounding, tmpSingleRepetitionBounding)\n // After buffer creation, add a frame into indexedBuffer if not static or update bounding\n const singleRepetitionBounding = { cx: 0, cy: 0, x: -1, y: -1, width: 2, height: 2 };\n Adapt_1.Bounding.bind(singleRepetitionBounding, tmpSingleRepetitionBounding);\n if (!this.bStaticIndexed || !this.bIndexed) {\n this.addIndex(bufferLength, repetition, singleRepetitionBounding);\n }\n }\n }\n Adapt_1.Bounding.bind(this.bounding, tmpTotalShapeBounding);\n this.buffer = new Float32Array(totalBufferLength);\n for (let i = 0, offset = 0, len = buffers.length; i < len; offset += buffers[i].length, i++)\n this.buffer.set(buffers[i], offset);\n this.bIndexed = true;\n }\n /**\n * Return current shape (whit repetions) bounding\n *\n * @return {*} {IShapeBounding}\n */\n getBounding() {\n return this.bounding;\n }\n /**\n * Get number of repetitions\n *\n * @returns {number}\n */\n getRepetitionCount() {\n var _a;\n const repetitions = this.getProp('repetitions', undefined, 1);\n return Array.isArray(repetitions) ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) : repetitions;\n }\n /**\n * Return buffer\n *\n * @returns {(Float32Array | undefined)}\n */\n getBuffer() {\n return this.buffer;\n }\n /**\n * Return indexed buffer\n *\n * @returns {(Array> | undefined)}\n */\n getIndexedBuffer() {\n return this.indexedBuffer;\n }\n /**\n * Return number of encapsulation\n *\n * @param {IBufferIndex} index\n * @returns {number}\n */\n static getIndexParentLevel(index) {\n if (typeof index.parent === 'undefined')\n return 0;\n let currentParent = index.parent;\n let currentParentLevel = 1;\n while (typeof currentParent.parent !== 'undefined') {\n currentParentLevel++;\n currentParent = currentParent.parent;\n }\n return currentParentLevel;\n }\n /**\n * Stream buffer\n *\n * @param {(TStreamCallback} callback\n */\n stream(callback) {\n if (this.buffer && this.indexedBuffer) {\n for (let i = 0, j = 0, len = this.indexedBuffer.length; i < len; i++) {\n const currentIndexing = this.indexedBuffer[i];\n callback({\n buffer: this.buffer,\n frameLength: currentIndexing.frameLength,\n frameBufferIndex: j,\n currentIndexing: currentIndexing,\n currentShapeIndex: i,\n totalShapes: len,\n });\n j += currentIndexing.frameLength;\n }\n }\n }\n /**\n * Return empty propArguments\n *\n * @static\n * @param {ShapeBase} shape\n * @return {*} {PropArguments}\n */\n static getEmptyPropArguments(shape, parentPropArguments) {\n const repetition = {\n type: types_1.ERepetitionType.Ring,\n angle: 0,\n index: 1,\n offset: 1,\n count: 1,\n row: { index: 1, offset: 1, count: 1 },\n col: { index: 1, offset: 1, count: 1 },\n };\n return {\n repetition,\n shape,\n parent: parentPropArguments,\n };\n }\n}\nexports.ShapeBase = ShapeBase;\n/**\n * Empty buffer\n *\n * @internal\n * @ignore\n */\nShapeBase.EMPTY_BUFFER = new Float32Array(0);\n/**\n * Empty BaseRepetition\n *\n * @internal\n * @ignore\n */\nShapeBase.getEmptySimpleRepetition = () => ({\n index: 1,\n offset: 1,\n count: 1,\n});\n/**\n * Empty Repetition\n *\n * @internal\n * @ignore\n */\nShapeBase.getEmptyRepetition = () => ({\n type: types_1.ERepetitionType.Ring,\n angle: 0,\n ...ShapeBase.getEmptySimpleRepetition(),\n row: ShapeBase.getEmptySimpleRepetition(),\n col: ShapeBase.getEmptySimpleRepetition(),\n});\n//# sourceMappingURL=ShapeBase.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toVec3 = exports.toVec2 = exports.fromSkew = exports.VEC2_ONE = exports.VEC2_ZERO = exports.VEC3_ONE = exports.VEC3_ZERO = void 0;\nconst gl_matrix_1 = require(\"gl-matrix\");\nexports.VEC3_ZERO = [0, 0, 0];\nexports.VEC3_ONE = [1, 1, 1];\nexports.VEC2_ZERO = [0, 0];\nexports.VEC2_ONE = [1, 1];\ngl_matrix_1.glMatrix.setMatrixArrayType(Array);\n/**\n * Skew matrix\n *\n * @internal\n * @ignore\n */\nfunction fromSkew(out, skew) {\n out[0] = 1;\n out[1] = Math.tan(skew[1]);\n out[2] = 0;\n out[3] = 0;\n out[4] = Math.tan(skew[0]);\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\nexports.fromSkew = fromSkew;\n/**\n * number to vec 2\n *\n * @internal\n * @ignore\n */\nfunction toVec2(x) {\n if (Array.isArray(x))\n return [x[0], x[1]];\n return [x, x];\n}\nexports.toVec2 = toVec2;\n/**\n * number to vec 3\n *\n * @internal\n * @ignore\n */\nfunction toVec3(x, defaultZValue = 0) {\n if (Array.isArray(x)) {\n return [x[0], x[1], defaultZValue];\n }\n return [x, x, defaultZValue];\n}\nexports.toVec3 = toVec3;\n//# sourceMappingURL=gl-matrix-extensions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Temporany matrix\n *\n * @internal\n * @ignore\n */\nconst MATRIX = new Array(4);\n/**\n * Vec2 operation\n *\n * @category Core.Utilities\n */\nconst Vec2 = {\n /**\n * from new vertex\n *\n * @param {Array | number} [x=0]\n * @param {number} [y]\n * @returns {Array}\n */\n from: (x = 0, y) => {\n const out = new Array(2);\n if (typeof x === 'number') {\n out[0] = x;\n out[1] = y !== null && y !== void 0 ? y : x;\n }\n else {\n out[0] = x[0];\n out[1] = x[1];\n }\n return out;\n },\n normalize: (v) => {\n const len = Vec2.length(v);\n return len !== 0 ? [v[0] / len, v[1] / len] : [0, 0];\n },\n /**\n * Distance between two points\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n distance: (a, b) => Math.hypot(a[0] - b[0], a[1] - b[1]),\n /**\n * dot product\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n dot: (a, b) => a[0] * b[0] + a[1] * b[1],\n /**\n * length of point\n *\n * @param {Array} vec\n * @returns {number}\n */\n length: (vec) => Math.hypot(vec[0], vec[1]),\n /**\n * angle between two point\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n angle: (a, b) => {\n a = Vec2.normalize(a);\n b = Vec2.normalize(b);\n return Math.acos(Vec2.dot(a, b));\n },\n /**\n * skewX point\n *\n * @param {Array} vec\n * @param {number} m\n */\n skewX: (vec, m) => {\n vec[0] += Math.tan(m) * vec[1];\n },\n /**\n * skewY point\n *\n * @param {Array} vec\n * @param {number} m\n */\n skewY: (vec, m) => {\n vec[1] += Math.tan(m) * vec[0];\n },\n /**\n * squeezeX point\n *\n * @param {Array} vec\n * @param {number} m\n */\n squeezeX: (vec, m) => {\n vec[1] += vec[1] * (vec[0] * -m);\n },\n /**\n * squeezeY point\n *\n * @param {Array} vec\n * @param {number} m\n */\n squeezeY: (vec, m) => {\n vec[0] += vec[0] * (vec[1] * m);\n },\n /**\n * Rotate point\n *\n * @param {Array} vec\n * @param {Array} MATRIX\n * @param {Array} fromPoint\n * @internal\n */\n rotate: (vec, MATRIX, fromPoint) => {\n const p0 = vec[0] - fromPoint[0];\n const p1 = vec[1] - fromPoint[1];\n vec[0] = p0 * MATRIX[0] + p1 * MATRIX[1] + fromPoint[0];\n vec[1] = p0 * MATRIX[2] + p1 * MATRIX[3] + fromPoint[1];\n },\n /**\n * RotateX point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateX: (vec, fromPoint, rad) => {\n MATRIX[0] = 1;\n MATRIX[1] = 0;\n MATRIX[2] = 0;\n MATRIX[3] = Math.cos(rad);\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * RotateY point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateY: (vec, fromPoint, rad) => {\n MATRIX[0] = Math.cos(rad);\n MATRIX[1] = 0;\n MATRIX[2] = 0;\n MATRIX[3] = 1;\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * RotateZ point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateZ: (vec, fromPoint, rad) => {\n MATRIX[0] = Math.cos(rad);\n MATRIX[1] = -Math.sin(rad);\n MATRIX[2] = Math.sin(rad);\n MATRIX[3] = Math.cos(rad);\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * Translate vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n translate: (vec, to) => {\n vec[0] += to[0];\n vec[1] += to[1];\n },\n /**\n * Scale vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n scale: (vec, to) => {\n vec[0] *= to[0];\n vec[1] *= to[1];\n },\n /**\n * Scale vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n divide: (vec, to) => {\n vec[0] /= to[0];\n vec[1] /= to[1];\n },\n /**\n * Vec to string\n *\n * @param {Array} vec\n * @return {string}\n */\n toString: (vec) => `x: ${vec[0]}, y: ${vec[1]}`,\n /**\n * Vertex [0, 0]\n */\n ZERO: Array.from([0, 0]),\n /**\n * Vertex [1, 1]\n */\n ONE: Array.from([1, 1]),\n};\nexports.default = Vec2;\n//# sourceMappingURL=Vec2.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mod = exports.PHI = exports.PI2 = exports.log = void 0;\n/**\n * Return logarith value and base\n *\n * @category Core.Utilities\n *\n * @param n number\n * @param base number\n */\nconst log = (n, base) => Math.log(n) / Math.log(base);\nexports.log = log;\n/**\n * @category Core.Utilities\n */\nexports.PI2 = Math.PI * 2;\n/**\n * @category Core.Utilities\n */\nexports.PHI = (1 + Math.sqrt(5)) / 2;\n/**\n * Return a positive module of positive or negative value\n *\n * @category Core.Utilities\n *\n * @param value number\n * @param base number\n */\nconst mod = (value, base) => {\n const result = value % base;\n return result < 0 ? result + base : result;\n};\nexports.mod = mod;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Adapt = exports.Bounding = exports.EAdaptMode = void 0;\nconst Modifier_1 = require(\"./Modifier\");\n/**\n *\n *\n * @category Core.Enums\n */\nvar EAdaptMode;\n(function (EAdaptMode) {\n /**\n * The buffer is not changed\n * @order 1\n */\n EAdaptMode[EAdaptMode[\"None\"] = 0] = \"None\";\n /**\n * The buffer is scaled in a range between [-1, -1] and [1,1]\n * @order 2\n */\n EAdaptMode[EAdaptMode[\"Scale\"] = 2] = \"Scale\";\n /**\n * The buffer is scaled in a range between [-1, -1] and [1,1] and is centered\n * @order 3\n */\n EAdaptMode[EAdaptMode[\"Center\"] = 4] = \"Center\";\n /**\n * The buffer is adapted centrally and expanded in a range between [-1, -1] and [1,1]\n * @order 4\n */\n EAdaptMode[EAdaptMode[\"Fill\"] = 8] = \"Fill\";\n})(EAdaptMode = exports.EAdaptMode || (exports.EAdaptMode = {}));\n/**\n * @internal\n * @ignore\n */\nexports.Bounding = {\n empty: () => ({\n cx: 0,\n cy: 0,\n x: -1,\n y: -1,\n width: 2,\n height: 2,\n }),\n clear: (tmpBounding) => {\n tmpBounding[0] = undefined;\n tmpBounding[1] = undefined;\n tmpBounding[2] = undefined;\n tmpBounding[3] = undefined;\n },\n add: (tmpBounding, x, y) => {\n if (typeof tmpBounding[0] === 'undefined' || x < tmpBounding[0])\n tmpBounding[0] = x;\n if (typeof tmpBounding[2] === 'undefined' || x > tmpBounding[2])\n tmpBounding[2] = x;\n if (typeof tmpBounding[1] === 'undefined' || y < tmpBounding[1])\n tmpBounding[1] = y;\n if (typeof tmpBounding[3] === 'undefined' || y > tmpBounding[3])\n tmpBounding[3] = y;\n },\n sum: (dest, bounding) => {\n if (typeof bounding[0] !== 'undefined' &&\n typeof bounding[1] !== 'undefined' &&\n typeof bounding[2] !== 'undefined' &&\n typeof bounding[3] !== 'undefined') {\n if (typeof dest[0] === 'undefined' ||\n typeof dest[1] === 'undefined' ||\n typeof dest[2] === 'undefined' ||\n typeof dest[3] === 'undefined') {\n dest[0] = bounding[0];\n dest[1] = bounding[1];\n dest[2] = bounding[2];\n dest[3] = bounding[3];\n }\n else {\n if (dest[0] < bounding[0])\n dest[0] = bounding[0];\n if (dest[2] > bounding[2])\n dest[2] = bounding[2];\n if (dest[1] < bounding[1])\n dest[1] = bounding[1];\n if (dest[3] > bounding[3])\n dest[3] = bounding[3];\n }\n }\n else {\n console.warn('[Urplfanze:Bounding] cannot sum bounding');\n }\n },\n bind: (bounding, tmpBounding) => {\n if (typeof tmpBounding[0] !== 'undefined' &&\n typeof tmpBounding[1] !== 'undefined' &&\n typeof tmpBounding[2] !== 'undefined' &&\n typeof tmpBounding[3] !== 'undefined') {\n bounding.x = tmpBounding[0];\n bounding.y = tmpBounding[1];\n bounding.width = tmpBounding[2] - tmpBounding[0];\n bounding.height = tmpBounding[3] - tmpBounding[1];\n bounding.cx = bounding.x + bounding.width / 2;\n bounding.cy = bounding.y + bounding.height / 2;\n }\n else {\n console.warn('[Urplfanze:Bounding] cannot bind bounding');\n }\n },\n};\nclass Adapt extends Modifier_1.Modifier {\n constructor(args) {\n super();\n this.mode = args.mode || EAdaptMode.Fill;\n this.rect = args.rect;\n }\n apply(buffer, bClosed) {\n return Adapt.adapt(buffer, this.mode, this.rect);\n }\n /**\n * Return adapted buffer between [-1,-1] and [1,1]\n *\n * @public\n * @static\n * @param {Float32Array} input\n * @param {EAdaptMode} mode\n * @returns {Float32Array}\n * @memberof ShapeBuffer\n */\n static adapt(input, mode, rect) {\n if (mode === EAdaptMode.None)\n return Float32Array.from(input);\n const output = new Float32Array(input.length);\n if (!rect) {\n rect = Adapt.getBounding(input);\n }\n const scale = rect.width >= 2 || rect.height >= 2 || (mode >= EAdaptMode.Fill && (rect.width < 2 || rect.height < 2))\n ? 2 / Math.max(rect.width, rect.height)\n : 1;\n const translateX = mode >= EAdaptMode.Center ? rect.cx : 0;\n const translateY = mode >= EAdaptMode.Center ? rect.cy : 0;\n for (let i = 0, len = input.length; i < len; i += 2) {\n output[i] = (input[i] - translateX) * scale;\n output[i + 1] = (input[i + 1] - translateY) * scale;\n }\n return output;\n }\n /**\n * Get buffer bounding\n *\n * @static\n * @param {Float32Array | Array} buffer\n * @returns {IShapeBounding}\n * @memberof ShapePrimitive\n */\n static getBounding(buffer, bounding) {\n if (typeof bounding === 'undefined')\n bounding = exports.Bounding.empty();\n const tmp_bounding = [undefined, undefined, undefined, undefined];\n for (let i = 0, len = buffer.length; i < len; i += 2) {\n exports.Bounding.add(tmp_bounding, buffer[i], buffer[i + 1]);\n }\n exports.Bounding.bind(bounding, tmp_bounding);\n return bounding;\n }\n}\nexports.Adapt = Adapt;\nAdapt.MODES = EAdaptMode;\n//# sourceMappingURL=Adapt.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Modifier = void 0;\nclass Modifier {\n}\nexports.Modifier = Modifier;\n//# sourceMappingURL=Modifier.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.distributePointsInBuffer = exports.interpolate = exports.prepareBufferForInterpolation = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.relativeClamp = exports.clamp = exports.lerp = exports.toRadians = exports.toDegrees = exports.now = void 0;\nconst SimplexNoise = require(\"simplex-noise\");\nconst repetitions_1 = require(\"./types/repetitions\");\nconst Vec2_1 = require(\"./math/Vec2\");\n// isDef: (object: any): boolean => typeof object !== 'undefined' && object !== null,\nconst measurement = typeof performance !== 'undefined' ? performance : Date;\n/**\n * Get current timestamp in milliseconds\n *\n * @category Utilities\n * @returns {number}\n */\nfunction now() {\n return measurement.now();\n}\nexports.now = now;\n// aOr: (...args: Array): any => {\n// \tfor (let i = 0; i < args.length; i++) if (Utilities.isDef(args[i])) return args[i]\n// },\n/**\n * Convert number from radians to degrees\n *\n * @category Utilities\n *\n * @example\n * ```javascript\n * Urpflanze.toDegrees(Math.PI) // 180\n * ```\n *\n * @param {number} radians\n * @returns {number}\n */\nfunction toDegrees(radians) {\n return (radians * 180) / Math.PI;\n}\nexports.toDegrees = toDegrees;\n/**\n * Convert angle from degrees to radians\n * @example\n * ```javascript\n * Urpflanze.toRadians(180) // 3.141592653589793\n * ```\n *\n * @category Utilities\n * @param {number} degrees\n * @returns {number}\n */\nfunction toRadians(degrees) {\n return (degrees * Math.PI) / 180;\n}\nexports.toRadians = toRadians;\n// perf: (name: string, callback: any, log: boolean = false): number => {\n// \tconst t1 = now()\n// \tcallback()\n// \tconst t2 = now()\n// \tlog && console.log('perf ' + name + ': ' + (t2 - t1))\n// \treturn t2 - t1\n// }\n/**\n * Linear interpolation from `a` when `i` as 0 an `b` when `i' as 1\n *\n * @category Utilities\n * @param {number} a\n * @param {number} b\n * @param {number} i\n * @returns {number}\n */\nfunction lerp(a, b, i) {\n return (1 - i) * a + i * b;\n}\nexports.lerp = lerp;\n/**\n * Return number between min and max\n *\n * @category Utilities\n * @example\n * ```javascript\n * Urpflanze.clamp(0, 1, 1.2) // 1\n * Urpflanze.clamp(0, 1, -2) // 0\n * ```\n * @param {number} min\n * @param {number} max\n * @param {number} value\n * @returns {number}\n */\nfunction clamp(min, max, value) {\n return value <= min ? min : value >= max ? max : value;\n}\nexports.clamp = clamp;\n/**\n * Map number between refMin e refMax from min and max\n *\n * @category Utilities\n *\n * @example\n * ```javascript\n * Urpflanze.relativeClamp(0, 1, 0.5, 100, 200) // 150\n * ```\n *\n * @param {number} refMin\n * @param {number} refMax\n * @param {number} value\n * @param {number} toMin\n * @param {number} toMax\n * @returns {number}\n */\nfunction relativeClamp(refMin, refMax, value, toMin, toMax) {\n return clamp(toMin, toMax, ((value - refMin) / (refMax - refMin)) * (toMax - toMin) + toMin);\n}\nexports.relativeClamp = relativeClamp;\n/**\n * @internal\n * @ignore\n */\nconst noises = {\n random: new SimplexNoise(Math.random),\n};\n/**\n * SimplexNoise\n * Use 'random' as seed property for random seed.\n * Return value between -1 and 1\n *\n * @category Utilities\n *\n * @param {string} [seed='random']\n * @param {number} [x=0]\n * @param {number} [y=0]\n * @param {number} [z=0]\n * @returns {number} between -1 and 1\n */\nfunction noise(seed = 'random', x = 0, y = 0, z = 0) {\n if (typeof noises[seed] === 'undefined') {\n noises[seed] = new SimplexNoise(seed);\n }\n return noises[seed].noise3D(x, y, z);\n}\nexports.noise = noise;\n/**\n * Random number generator\n */\nconst randoms = {};\n/**\n * random number generator\n * @param seed\n * @returns\n */\nfunction random(seed, min = 0, max = 1, decimals) {\n const key = seed + '';\n if (typeof randoms[key] === 'undefined') {\n const seed = xmur3(key);\n randoms[key] = sfc32(seed(), seed(), seed(), seed());\n }\n const value = min + randoms[key]() * (max - min);\n return typeof decimals !== 'undefined' ? Math.round(value * 10 ** decimals) / 10 ** decimals : value;\n}\nexports.random = random;\n/**\n *\n * @internal\n * @param str\n * @returns\n */\nfunction xmur3(str) {\n let i = 0, h = 1779033703 ^ str.length;\n for (; i < str.length; i++)\n (h = Math.imul(h ^ str.charCodeAt(i), 3432918353)), (h = (h << 13) | (h >>> 19));\n return function () {\n h = Math.imul(h ^ (h >>> 16), 2246822507);\n h = Math.imul(h ^ (h >>> 13), 3266489909);\n return (h ^= h >>> 16) >>> 0;\n };\n}\n/**\n * @internal\n * @param a\n * @param b\n * @param c\n * @param d\n * @returns\n */\nfunction sfc32(a, b, c, d) {\n return function () {\n a >>>= 0;\n b >>>= 0;\n c >>>= 0;\n d >>>= 0;\n let t = (a + b) | 0;\n a = b ^ (b >>> 9);\n b = (c + (c << 3)) | 0;\n c = (c << 21) | (c >>> 11);\n d = (d + 1) | 0;\n t = (t + d) | 0;\n c = (c + t) | 0;\n return (t >>> 0) / 4294967296;\n };\n}\n/**\n * Return angle (atan) from offset (or center) for matrix repetition.\n * Offset is array between [-1, -1] and [1, 1].\n * The return value is between -Math.PI / 2 and Math.PI / 2\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter\n * @returns {number} between -Math.PI / 2 and Math.PI / 2\n */\nfunction angleFromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [(repetition.col.count - 1) / 2, (repetition.row.count - 1) / 2];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const x = repetition.col.index - 1 - centerMatrix[0];\n const y = repetition.row.index - 1 - centerMatrix[1];\n return x === 0 ? 0 : Math.atan(y / x);\n }\n return (repetition.angle - Math.PI) / 2;\n}\nexports.angleFromRepetition = angleFromRepetition;\n/**\n * Return angle (atan2, 4 quadrants) from offset (or center) for matrix repetition.\n * Offset is array between [-1, -1] and [1, 1].\n * The return value is between -Math.PI an Math.PI\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter\n * @returns {number} between -Math.PI an Math.PI\n */\nfunction angle2FromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [(repetition.col.count - 1) / 2, (repetition.row.count - 1) / 2];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const x = repetition.col.index - 1 - centerMatrix[0];\n const y = repetition.row.index - 1 - centerMatrix[1];\n return x === 0 ? 0 : Math.atan2(y, x);\n }\n return repetition.angle - Math.PI;\n}\nexports.angle2FromRepetition = angle2FromRepetition;\n/**\n * Return distance from offset (or center) for matrix repetition.\n * The return value is between 0 and 1\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter offset relative to distance prop\n * @returns {number} between 0 and 1\n */\nfunction distanceFromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [0.5, 0.5];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const current = [repetition.col.offset, repetition.row.offset];\n return Vec2_1.default.distance(current, centerMatrix);\n }\n return 1;\n}\nexports.distanceFromRepetition = distanceFromRepetition;\n/// Interpolation\n/**\n *\n * @param from\n * @param to\n * @returns\n */\nfunction prepareBufferForInterpolation(from, to) {\n const fromBufferLength = from.length;\n const toBufferLength = to.length;\n if (fromBufferLength === toBufferLength) {\n return [from, to];\n }\n const maxBufferLength = fromBufferLength > toBufferLength ? fromBufferLength : toBufferLength;\n const difference = Math.abs(fromBufferLength - toBufferLength);\n const minBufferLength = maxBufferLength - difference;\n /////\n const b = fromBufferLength < toBufferLength ? to : from;\n const t = fromBufferLength < toBufferLength ? from : to;\n const a = distributePointsInBuffer(t, Math.floor(difference / 2));\n // a[maxBufferLength - 2] = t[minBufferLength - 2]\n // a[maxBufferLength - 1] = t[minBufferLength - 1]\n return fromBufferLength > toBufferLength ? [b, a] : [a, b];\n}\nexports.prepareBufferForInterpolation = prepareBufferForInterpolation;\n/**\n *\n * @param from\n * @param to\n * @param offset\n * @returns\n */\nfunction interpolate(from, to, initialOffset = 0.5) {\n const [a, b] = prepareBufferForInterpolation(from, to);\n const maxBufferLength = Math.max(a.length, b.length);\n const offset = typeof initialOffset === 'number' ? [initialOffset] : initialOffset;\n const maxPoints = maxBufferLength / 2;\n if (offset.length !== maxPoints) {\n const tl = offset.length;\n for (let i = 0; i < maxPoints; i++) {\n offset[i] = offset[i % tl];\n }\n }\n ////\n const result = new Float32Array(maxBufferLength);\n for (let i = 0, off = 0; i < maxBufferLength; i += 2, off++) {\n result[i] = (1 - offset[off]) * a[i] + offset[off] * b[i];\n result[i + 1] = (1 - offset[off]) * a[i + 1] + offset[off] * b[i + 1];\n }\n return result;\n}\nexports.interpolate = interpolate;\nfunction distributePointsInBuffer(buffer, count) {\n const bufferLen = buffer.length;\n const pointsLen = bufferLen / 2;\n const finalBufferLength = (pointsLen + count) * 2;\n const edges = pointsLen - 1;\n if (edges > 1) {\n const lastPoint = bufferLen - 2;\n const newPointsOnEdge = Math.floor(count / edges);\n const bufferWithPointsEveryEdge = bufferLen + newPointsOnEdge * lastPoint;\n let remainingPoints = (finalBufferLength - bufferWithPointsEveryEdge) / 2;\n const edgeRemainingIndex = Math.round(edges / remainingPoints);\n const result = new Float32Array(finalBufferLength);\n for (let i = 0, edgeIndex = 0, r = 0; i < lastPoint; i += 2, edgeIndex++, r += 2) {\n const ax = buffer[i];\n const ay = buffer[i + 1];\n const bx = buffer[i + 2];\n const by = buffer[i + 3];\n result[r] = ax;\n result[r + 1] = ay;\n const addReminingPoints = remainingPoints > 0 && (edgeIndex % edgeRemainingIndex === 0 || i === lastPoint - 2);\n const currentPointsOnEdge = newPointsOnEdge + (addReminingPoints ? 1 : 0);\n const newPointOffset = 1 / (currentPointsOnEdge + 1);\n for (let h = 0; h < currentPointsOnEdge; h++, r += 2) {\n const o = newPointOffset * (h + 1);\n result[r + 2] = (1 - o) * ax + o * bx;\n result[r + 3] = (1 - o) * ay + o * by;\n }\n if (addReminingPoints) {\n remainingPoints--;\n }\n }\n result[finalBufferLength - 2] = buffer[bufferLen - 2];\n result[finalBufferLength - 1] = buffer[bufferLen - 1];\n return result;\n }\n const result = new Float32Array(finalBufferLength);\n for (let i = 0; i < finalBufferLength; i += 2) {\n result[i] = buffer[i % bufferLen];\n result[i + 1] = buffer[(i + 1) % bufferLen];\n }\n return result;\n}\nexports.distributePointsInBuffer = distributePointsInBuffer;\n//# sourceMappingURL=Utilities.js.map","/*\n * A fast javascript implementation of simplex noise by Jonas Wagner\n\nBased on a speed-improved simplex noise algorithm for 2D, 3D and 4D in Java.\nWhich is based on example code by Stefan Gustavson (stegu@itn.liu.se).\nWith Optimisations by Peter Eastman (peastman@drizzle.stanford.edu).\nBetter rank ordering method by Stefan Gustavson in 2012.\n\n\n Copyright (c) 2018 Jonas Wagner\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n(function() {\n 'use strict';\n\n var F2 = 0.5 * (Math.sqrt(3.0) - 1.0);\n var G2 = (3.0 - Math.sqrt(3.0)) / 6.0;\n var F3 = 1.0 / 3.0;\n var G3 = 1.0 / 6.0;\n var F4 = (Math.sqrt(5.0) - 1.0) / 4.0;\n var G4 = (5.0 - Math.sqrt(5.0)) / 20.0;\n\n function SimplexNoise(randomOrSeed) {\n var random;\n if (typeof randomOrSeed == 'function') {\n random = randomOrSeed;\n }\n else if (randomOrSeed) {\n random = alea(randomOrSeed);\n } else {\n random = Math.random;\n }\n this.p = buildPermutationTable(random);\n this.perm = new Uint8Array(512);\n this.permMod12 = new Uint8Array(512);\n for (var i = 0; i < 512; i++) {\n this.perm[i] = this.p[i & 255];\n this.permMod12[i] = this.perm[i] % 12;\n }\n\n }\n SimplexNoise.prototype = {\n grad3: new Float32Array([1, 1, 0,\n -1, 1, 0,\n 1, -1, 0,\n\n -1, -1, 0,\n 1, 0, 1,\n -1, 0, 1,\n\n 1, 0, -1,\n -1, 0, -1,\n 0, 1, 1,\n\n 0, -1, 1,\n 0, 1, -1,\n 0, -1, -1]),\n grad4: new Float32Array([0, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1,\n 0, -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1,\n 1, 0, 1, 1, 1, 0, 1, -1, 1, 0, -1, 1, 1, 0, -1, -1,\n -1, 0, 1, 1, -1, 0, 1, -1, -1, 0, -1, 1, -1, 0, -1, -1,\n 1, 1, 0, 1, 1, 1, 0, -1, 1, -1, 0, 1, 1, -1, 0, -1,\n -1, 1, 0, 1, -1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, -1,\n 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0,\n -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1, 0]),\n noise2D: function(xin, yin) {\n var permMod12 = this.permMod12;\n var perm = this.perm;\n var grad3 = this.grad3;\n var n0 = 0; // Noise contributions from the three corners\n var n1 = 0;\n var n2 = 0;\n // Skew the input space to determine which simplex cell we're in\n var s = (xin + yin) * F2; // Hairy factor for 2D\n var i = Math.floor(xin + s);\n var j = Math.floor(yin + s);\n var t = (i + j) * G2;\n var X0 = i - t; // Unskew the cell origin back to (x,y) space\n var Y0 = j - t;\n var x0 = xin - X0; // The x,y distances from the cell origin\n var y0 = yin - Y0;\n // For the 2D case, the simplex shape is an equilateral triangle.\n // Determine which simplex we are in.\n var i1, j1; // Offsets for second (middle) corner of simplex in (i,j) coords\n if (x0 > y0) {\n i1 = 1;\n j1 = 0;\n } // lower triangle, XY order: (0,0)->(1,0)->(1,1)\n else {\n i1 = 0;\n j1 = 1;\n } // upper triangle, YX order: (0,0)->(0,1)->(1,1)\n // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and\n // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where\n // c = (3-sqrt(3))/6\n var x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords\n var y1 = y0 - j1 + G2;\n var x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords\n var y2 = y0 - 1.0 + 2.0 * G2;\n // Work out the hashed gradient indices of the three simplex corners\n var ii = i & 255;\n var jj = j & 255;\n // Calculate the contribution from the three corners\n var t0 = 0.5 - x0 * x0 - y0 * y0;\n if (t0 >= 0) {\n var gi0 = permMod12[ii + perm[jj]] * 3;\n t0 *= t0;\n n0 = t0 * t0 * (grad3[gi0] * x0 + grad3[gi0 + 1] * y0); // (x,y) of grad3 used for 2D gradient\n }\n var t1 = 0.5 - x1 * x1 - y1 * y1;\n if (t1 >= 0) {\n var gi1 = permMod12[ii + i1 + perm[jj + j1]] * 3;\n t1 *= t1;\n n1 = t1 * t1 * (grad3[gi1] * x1 + grad3[gi1 + 1] * y1);\n }\n var t2 = 0.5 - x2 * x2 - y2 * y2;\n if (t2 >= 0) {\n var gi2 = permMod12[ii + 1 + perm[jj + 1]] * 3;\n t2 *= t2;\n n2 = t2 * t2 * (grad3[gi2] * x2 + grad3[gi2 + 1] * y2);\n }\n // Add contributions from each corner to get the final noise value.\n // The result is scaled to return values in the interval [-1,1].\n return 70.0 * (n0 + n1 + n2);\n },\n // 3D simplex noise\n noise3D: function(xin, yin, zin) {\n var permMod12 = this.permMod12;\n var perm = this.perm;\n var grad3 = this.grad3;\n var n0, n1, n2, n3; // Noise contributions from the four corners\n // Skew the input space to determine which simplex cell we're in\n var s = (xin + yin + zin) * F3; // Very nice and simple skew factor for 3D\n var i = Math.floor(xin + s);\n var j = Math.floor(yin + s);\n var k = Math.floor(zin + s);\n var t = (i + j + k) * G3;\n var X0 = i - t; // Unskew the cell origin back to (x,y,z) space\n var Y0 = j - t;\n var Z0 = k - t;\n var x0 = xin - X0; // The x,y,z distances from the cell origin\n var y0 = yin - Y0;\n var z0 = zin - Z0;\n // For the 3D case, the simplex shape is a slightly irregular tetrahedron.\n // Determine which simplex we are in.\n var i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords\n var i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords\n if (x0 >= y0) {\n if (y0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 1;\n k2 = 0;\n } // X Y Z order\n else if (x0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n } // X Z Y order\n else {\n i1 = 0;\n j1 = 0;\n k1 = 1;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n } // Z X Y order\n }\n else { // x0 y0) rankx++;\n else ranky++;\n if (x0 > z0) rankx++;\n else rankz++;\n if (x0 > w0) rankx++;\n else rankw++;\n if (y0 > z0) ranky++;\n else rankz++;\n if (y0 > w0) ranky++;\n else rankw++;\n if (z0 > w0) rankz++;\n else rankw++;\n var i1, j1, k1, l1; // The integer offsets for the second simplex corner\n var i2, j2, k2, l2; // The integer offsets for the third simplex corner\n var i3, j3, k3, l3; // The integer offsets for the fourth simplex corner\n // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order.\n // Many values of c will never occur, since e.g. x>y>z>w makes x= 3 ? 1 : 0;\n j1 = ranky >= 3 ? 1 : 0;\n k1 = rankz >= 3 ? 1 : 0;\n l1 = rankw >= 3 ? 1 : 0;\n // Rank 2 denotes the second largest coordinate.\n i2 = rankx >= 2 ? 1 : 0;\n j2 = ranky >= 2 ? 1 : 0;\n k2 = rankz >= 2 ? 1 : 0;\n l2 = rankw >= 2 ? 1 : 0;\n // Rank 1 denotes the second smallest coordinate.\n i3 = rankx >= 1 ? 1 : 0;\n j3 = ranky >= 1 ? 1 : 0;\n k3 = rankz >= 1 ? 1 : 0;\n l3 = rankw >= 1 ? 1 : 0;\n // The fifth corner has all coordinate offsets = 1, so no need to compute that.\n var x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords\n var y1 = y0 - j1 + G4;\n var z1 = z0 - k1 + G4;\n var w1 = w0 - l1 + G4;\n var x2 = x0 - i2 + 2.0 * G4; // Offsets for third corner in (x,y,z,w) coords\n var y2 = y0 - j2 + 2.0 * G4;\n var z2 = z0 - k2 + 2.0 * G4;\n var w2 = w0 - l2 + 2.0 * G4;\n var x3 = x0 - i3 + 3.0 * G4; // Offsets for fourth corner in (x,y,z,w) coords\n var y3 = y0 - j3 + 3.0 * G4;\n var z3 = z0 - k3 + 3.0 * G4;\n var w3 = w0 - l3 + 3.0 * G4;\n var x4 = x0 - 1.0 + 4.0 * G4; // Offsets for last corner in (x,y,z,w) coords\n var y4 = y0 - 1.0 + 4.0 * G4;\n var z4 = z0 - 1.0 + 4.0 * G4;\n var w4 = w0 - 1.0 + 4.0 * G4;\n // Work out the hashed gradient indices of the five simplex corners\n var ii = i & 255;\n var jj = j & 255;\n var kk = k & 255;\n var ll = l & 255;\n // Calculate the contribution from the five corners\n var t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0;\n if (t0 < 0) n0 = 0.0;\n else {\n var gi0 = (perm[ii + perm[jj + perm[kk + perm[ll]]]] % 32) * 4;\n t0 *= t0;\n n0 = t0 * t0 * (grad4[gi0] * x0 + grad4[gi0 + 1] * y0 + grad4[gi0 + 2] * z0 + grad4[gi0 + 3] * w0);\n }\n var t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1;\n if (t1 < 0) n1 = 0.0;\n else {\n var gi1 = (perm[ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]]] % 32) * 4;\n t1 *= t1;\n n1 = t1 * t1 * (grad4[gi1] * x1 + grad4[gi1 + 1] * y1 + grad4[gi1 + 2] * z1 + grad4[gi1 + 3] * w1);\n }\n var t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2;\n if (t2 < 0) n2 = 0.0;\n else {\n var gi2 = (perm[ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]]] % 32) * 4;\n t2 *= t2;\n n2 = t2 * t2 * (grad4[gi2] * x2 + grad4[gi2 + 1] * y2 + grad4[gi2 + 2] * z2 + grad4[gi2 + 3] * w2);\n }\n var t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3;\n if (t3 < 0) n3 = 0.0;\n else {\n var gi3 = (perm[ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]]] % 32) * 4;\n t3 *= t3;\n n3 = t3 * t3 * (grad4[gi3] * x3 + grad4[gi3 + 1] * y3 + grad4[gi3 + 2] * z3 + grad4[gi3 + 3] * w3);\n }\n var t4 = 0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4;\n if (t4 < 0) n4 = 0.0;\n else {\n var gi4 = (perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32) * 4;\n t4 *= t4;\n n4 = t4 * t4 * (grad4[gi4] * x4 + grad4[gi4 + 1] * y4 + grad4[gi4 + 2] * z4 + grad4[gi4 + 3] * w4);\n }\n // Sum up and scale the result to cover the range [-1,1]\n return 27.0 * (n0 + n1 + n2 + n3 + n4);\n }\n };\n\n function buildPermutationTable(random) {\n var i;\n var p = new Uint8Array(256);\n for (i = 0; i < 256; i++) {\n p[i] = i;\n }\n for (i = 0; i < 255; i++) {\n var r = i + ~~(random() * (256 - i));\n var aux = p[i];\n p[i] = p[r];\n p[r] = aux;\n }\n return p;\n }\n SimplexNoise._buildPermutationTable = buildPermutationTable;\n\n function alea() {\n // Johannes Baagøe , 2010\n var s0 = 0;\n var s1 = 0;\n var s2 = 0;\n var c = 1;\n\n var mash = masher();\n s0 = mash(' ');\n s1 = mash(' ');\n s2 = mash(' ');\n\n for (var i = 0; i < arguments.length; i++) {\n s0 -= mash(arguments[i]);\n if (s0 < 0) {\n s0 += 1;\n }\n s1 -= mash(arguments[i]);\n if (s1 < 0) {\n s1 += 1;\n }\n s2 -= mash(arguments[i]);\n if (s2 < 0) {\n s2 += 1;\n }\n }\n mash = null;\n return function() {\n var t = 2091639 * s0 + c * 2.3283064365386963e-10; // 2^-32\n s0 = s1;\n s1 = s2;\n return s2 = t - (c = t | 0);\n };\n }\n function masher() {\n var n = 0xefc8249d;\n return function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n }\n\n // amd\n if (typeof define !== 'undefined' && define.amd) define(function() {return SimplexNoise;});\n // common js\n if (typeof exports !== 'undefined') exports.SimplexNoise = SimplexNoise;\n // browser\n else if (typeof window !== 'undefined') window.SimplexNoise = SimplexNoise;\n // nodejs\n if (typeof module !== 'undefined') {\n module.exports = SimplexNoise;\n }\n\n})();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Shape = void 0;\nconst Scene_1 = require(\"../Scene\");\nconst SceneChild_1 = require(\"../SceneChild\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\n/**\n * Container of ShapeBase or Group, it applies transformations on each repetition\n *\n * @category Core.Shapes\n */\nclass Shape extends ShapeBase_1.ShapeBase {\n /**\n * Creates an instance of Shape.\n *\n * @param {ShapeSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'Shape';\n super(settings);\n if (settings.shape instanceof SceneChild_1.SceneChild) {\n this.shape = settings.shape;\n }\n else {\n console.warn(\"[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\\nYou passed:\", settings.shape);\n }\n this.shapeUseParent = !!settings.shapeUseParent;\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n */\n isStatic() {\n // return super.isStatic() && !this.shapeUseParent\n return super.isStatic() && (this.shape ? this.shape.isStatic() : true);\n }\n /**\n * Check if shape has static index\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return super.isStaticIndexed() && (this.shape ? this.shape.isStaticIndexed() : true);\n }\n /**\n * Find shape by id or name\n *\n * @param {number | string} idOrName\n * @returns {(SceneChild | null)}\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n if (this.shape)\n return this.shape.find(idOrName);\n return null;\n }\n /**\n * Return length of buffer\n *\n * @param {PropArguments} propArguments\n * @returns {number}\n */\n getBufferLength(propArguments) {\n if (this.bStatic && this.buffer && this.buffer.length > 0)\n return this.buffer.length;\n const childBufferLength = this.shape ? this.shape.getBufferLength(propArguments) : 0;\n return childBufferLength * this.getRepetitionCount();\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape) {\n if (this.shapeUseParent || this.shape.generateId !== generateId) {\n if (this.shapeUseParent) {\n this.shape.clearBuffer(true, false);\n }\n this.shape.generate(generateId, false, propArguments);\n }\n return this.shape.getBuffer();\n }\n return Shape.EMPTY_BUFFER;\n }\n /**\n * Return bounding\n *\n * @param {boolean} bDirectSceneChild\n * @returns {IShapeBounding}\n */\n getShapeBounding() {\n if (this.shape) {\n return this.shape.getBounding();\n }\n return this.bounding; // empty bounding defined in ShapeBase\n }\n /**\n * Add to indexed buffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n const parentBufferIndex = {\n shape: this,\n frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n };\n for (let i = 0, len = childIndexedBuffer.length; i < len; i++) {\n const currentIndexed = { ...childIndexedBuffer[i] };\n const parent = currentIndexed.parent\n ? Shape.setIndexedParent(currentIndexed.parent, parentBufferIndex)\n : parentBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n }\n }\n }\n /**\n * Set parent of indexed\n *\n * @static\n * @param {(IBufferIndex )} current\n * @param {IBufferIndex} parent\n * @returns {(IBufferIndex )}\n */\n static setIndexedParent(current, parent) {\n const index = {\n ...current,\n };\n index.parent = current.parent ? Shape.setIndexedParent(current.parent, parent) : parent;\n return index;\n }\n /**\n * Set shape\n *\n * @param {(SceneChild | undefined)} [shape]\n */\n setShape(shape) {\n if (typeof shape === 'undefined') {\n this.shape = undefined;\n this.clearBuffer(true, true);\n }\n else {\n this.scene && Scene_1.Scene.propagateToChilden(shape, this.scene);\n this.shape = shape;\n this.shape.clearBuffer(true, true);\n }\n }\n}\nexports.Shape = Shape;\n//# sourceMappingURL=Shape.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapePrimitive = void 0;\nconst glme = require(\"../math/gl-matrix-extensions\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\nconst Modifier_1 = require(\"../modifiers/Modifier\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\n/**\n * @category Core.Abstract\n */\nclass ShapePrimitive extends ShapeBase_1.ShapeBase {\n /**\n * Creates an instance of ShapePrimitive.\n *\n * @param {IShapePrimitiveSettings} [settings={}]\n */\n constructor(settings = {}) {\n var _a;\n super(settings);\n /**\n * Contain the bounding of the last generated buffer\n *\n * @type {IShapeBounding}\n */\n this.currentGenerationPrimitiveBounding = Adapt_1.Bounding.empty();\n this.props.sideLength =\n typeof settings.sideLength === 'undefined'\n ? undefined\n : typeof settings.sideLength === 'function'\n ? settings.sideLength\n : glme.toVec2(settings.sideLength);\n this.drawer = settings.drawer || {};\n this.modifiers = settings.modifiers;\n this.bClosed = (_a = settings.bClosed) !== null && _a !== void 0 ? _a : true;\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n * @memberof ShapePrimitive\n */\n isStatic() {\n return typeof this.props.sideLength !== 'function' && super.isStatic();\n }\n /**\n * Return sideLength for current repetition\n *\n * @param propArguments\n * @returns\n */\n getRepetitionSideLength(propArguments) {\n if (this.bStatic) {\n // not set default value into constructor because it can be overridden by group\n if (typeof this.props.sideLength === 'undefined') {\n this.props.sideLength = [50, 50];\n }\n else if (typeof this.props.sideLength === 'number') {\n this.props.sideLength = [this.props.sideLength, this.props.sideLength];\n }\n return this.props.sideLength;\n }\n return glme.toVec2(this.getProp('sideLength', propArguments, [50, 50]));\n }\n /**\n * Apply modifiers on single repetition buffer\n *\n * @param buffer\n * @returns\n */\n applyModifiers(buffer, propArguments) {\n if (typeof this.modifiers === 'undefined')\n return buffer;\n let modified = buffer;\n const modifiers = Array.isArray(this.modifiers) ? this.modifiers : [this.modifiers];\n for (let i = 0, len = modifiers.length; i < len; i++) {\n const modifier = modifiers[i] instanceof Modifier_1.Modifier\n ? modifiers[i]\n : modifiers[i](propArguments);\n //@ts-ignore\n modified = modifier.apply(modified, this.bClosed, this);\n }\n return modified;\n }\n /**\n * Return a bounding of generated buffer if is direct scene child\n *\n * @returns {IShapeBounding}\n * @memberof ShapePrimitive\n */\n getShapeBounding() {\n return this.currentGenerationPrimitiveBounding;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n const index = {\n shape: this,\n frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n };\n this.indexedBuffer.push(index);\n }\n /**\n * Return bClosed\n *\n * @returns {boolean}\n * @memberof ShapePrimitive\n */\n isClosed() {\n return this.bClosed;\n }\n /**\n * Set bClosed\n *\n * @param {boolean} bClosed\n * @memberof ShapePrimitive\n */\n setClosed(bClosed) {\n this.bClosed = bClosed;\n }\n}\nexports.ShapePrimitive = ShapePrimitive;\n//# sourceMappingURL=ShapePrimitive.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeLoop = void 0;\nconst math_1 = require(\"../math\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst ShapePrimitive_1 = require(\"../shapes/ShapePrimitive\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\n/**\n * Shape Loop\n *\n * @category Core.Shapes\n * @public\n * @class ShapeLoop\n * @extends {ShapePrimitive}\n */\nclass ShapeLoop extends ShapePrimitive_1.ShapePrimitive {\n /**\n * Creates an instance of ShapeLoop.\n *\n * @param {IShapeLoopSettings} [settings={}]\n * @param {boolean} [bPreventGeneration=false]\n */\n constructor(settings = {}, bPreventGeneration = false) {\n settings.type = settings.type || 'ShapeLoop';\n super(settings);\n this.loopDependencies = (settings.loopDependencies || []).concat('sideLength');\n this.props.loop = settings.loop;\n if (!bPreventGeneration) {\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: math_1.PI2 / 10,\n vertex: () => [0, 0],\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n }\n /**\n * Check if currentOrSingleLoopBuffer is static\n *\n * @returns {boolean}\n */\n isStaticLoop() {\n if (this.loopDependencies.includes('propArguments'))\n return false;\n for (let i = 0, len = this.loopDependencies.length; i < len; i++)\n if (typeof this.props[this.loopDependencies[i]] === 'function')\n return false;\n return true;\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n */\n isStatic() {\n return this.bStaticLoop && super.isStatic();\n }\n /**\n * Check if shape has static indexed\n * The number of vertices is defined by number of loop iteration\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n // return this.bStaticLoop && super.isStaticIndexed()\n return (super.isStaticIndexed() &&\n (typeof this.props.loop !== 'undefined'\n ? typeof this.props.loop.start !== 'function' &&\n typeof this.props.loop.end !== 'function' &&\n typeof this.props.loop.inc !== 'function'\n : true));\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.bStaticLoop = this.isStaticLoop();\n if (bClearIndexed) {\n this.currentOrSingleLoopBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n * Set single or multiple props\n *\n * @param {(Props)} key\n * @param {*} [value]\n * @param {boolean} [bClearIndexed=false]\n */\n setProp(key, value) {\n let bClearIndexed = false;\n const keys = (typeof key === 'string' ? { [key]: value } : key);\n for (let i = this.loopDependencies.length - 1; i >= 0; i--) {\n if (this.loopDependencies[i] in keys) {\n // this.props.loop = undefined\n bClearIndexed = true;\n break;\n }\n }\n if ('loop' in keys) {\n keys.loop = { ...this.props.loop, ...keys.loop };\n bClearIndexed = true;\n }\n super.setProp(keys, value, bClearIndexed);\n }\n /**\n * Return length of buffer\n *\n * @param {PropArguments} [propArguments]\n * @returns {number}\n */\n getBufferLength(propArguments) {\n if (this.bStatic && typeof this.buffer !== 'undefined')\n return this.buffer.length;\n if (this.bStaticLoop && typeof this.currentOrSingleLoopBuffer !== 'undefined')\n return this.currentOrSingleLoopBuffer.length * this.getRepetitionCount();\n const { count } = this.getLoop(propArguments || ShapeBase_1.ShapeBase.getEmptyPropArguments(this));\n return this.getRepetitionCount() * count * 2;\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (!this.bStaticLoop)\n return this.generateLoopBuffer(propArguments);\n if (typeof this.props.sideLength === 'function' || typeof this.currentOrSingleLoopBuffer === 'undefined')\n this.currentOrSingleLoopBuffer = this.generateLoopBuffer(propArguments);\n return this.currentOrSingleLoopBuffer;\n }\n /**\n * Generate loop buffer\n *\n * @protected\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateLoopBuffer(propArguments) {\n const { start, inc, /*end,*/ count } = this.getLoop(propArguments);\n const sideLength = this.getRepetitionSideLength(propArguments);\n const getVertex = (this.props.loop && this.props.loop.vertex ? this.props.loop.vertex : this.loop.vertex);\n const shapeLoop = {\n index: 0,\n offset: 0,\n current: 0,\n count: count,\n };\n const vertexLength = shapeLoop.count;\n const bufferLength = vertexLength * 2;\n const currentOrSingleLoopBuffer = new Float32Array(bufferLength);\n for (let i = 0, j = 0; i < vertexLength; i++, j += 2) {\n const current = start + inc * i;\n const offset = shapeLoop.count > 1 ? i / (shapeLoop.count - 1) : 1;\n // const angle = (end - start) * offset + start\n shapeLoop.current = current;\n shapeLoop.index = i + 1;\n shapeLoop.offset = offset;\n const vertex = getVertex(shapeLoop, propArguments);\n currentOrSingleLoopBuffer[j] = vertex[0];\n currentOrSingleLoopBuffer[j + 1] = vertex[1];\n // currentOrSingleLoopBuffer[j] *= sideLength[0]\n // currentOrSingleLoopBuffer[j + 1] *= sideLength[1]\n // Bounding.add(tmpBounding, currentOrSingleLoopBuffer[j], currentOrSingleLoopBuffer[j + 1])\n }\n const tmpBounding = [undefined, undefined, undefined, undefined];\n const buffer = this.applyModifiers(currentOrSingleLoopBuffer, propArguments);\n for (let i = 0, len = buffer.length; i < len; i += 2) {\n buffer[i] = buffer[i] * sideLength[0];\n buffer[i + 1] = buffer[i + 1] * sideLength[1];\n Adapt_1.Bounding.add(tmpBounding, buffer[i], buffer[i + 1]);\n }\n Adapt_1.Bounding.bind(this.currentGenerationPrimitiveBounding, tmpBounding);\n return buffer;\n }\n /**\n * Return information about a client loop gnerator\n *\n * @public\n * @param {PropArguments} propArguments\n * @returns {ShapeLoopInformation}\n */\n getLoop(propArguments) {\n var _a, _b, _c, _d, _e, _f;\n let start = (_b = (_a = this.props.loop) === null || _a === void 0 ? void 0 : _a.start) !== null && _b !== void 0 ? _b : this.loop.start;\n let end = (_d = (_c = this.props.loop) === null || _c === void 0 ? void 0 : _c.end) !== null && _d !== void 0 ? _d : this.loop.end;\n let inc = (_f = (_e = this.props.loop) === null || _e === void 0 ? void 0 : _e.inc) !== null && _f !== void 0 ? _f : this.loop.inc;\n start = (typeof start === 'function' ? start(propArguments) : start);\n end = (typeof end === 'function' ? end(propArguments) : end);\n inc = (typeof inc === 'function' ? inc(propArguments) : inc);\n const count = Math.ceil((end - start) / inc);\n return { start, end, inc, count: count <= 0 ? 0 : count };\n }\n /**\n * Set shape from loop generator\n *\n * @param {(IShapeLoopGenerator)} [shape]\n */\n setShape(loop) {\n this.setProp('loop', loop);\n }\n /**\n * Get static buffer\n *\n * @param sideLength\n * @returns\n */\n static getBuffer(props) {\n const shape = new this({ ...props, sideLength: props.sideLength || 1 });\n shape.generate();\n return shape.getBuffer() || new Float32Array();\n }\n}\nexports.ShapeLoop = ShapeLoop;\nShapeLoop.PId2 = Math.PI / 2;\n//# sourceMappingURL=ShapeLoop.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeBuffer = void 0;\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst ShapePrimitive_1 = require(\"../shapes/ShapePrimitive\");\n/**\n * @category Core.Shapes\n */\nclass ShapeBuffer extends ShapePrimitive_1.ShapePrimitive {\n /**\n * Creates an instance of ShapeBuffer.\n *\n * @param {IShapeBufferSettings} [settings={}]\n */\n constructor(settings = {}) {\n var _a, _b;\n settings.type = settings.type || 'ShapeBuffer';\n settings.adaptMode = (_a = settings.adaptMode) !== null && _a !== void 0 ? _a : Adapt_1.EAdaptMode.Scale;\n super(settings);\n this.adaptMode = (_b = settings.adaptMode) !== null && _b !== void 0 ? _b : Adapt_1.EAdaptMode.Fill;\n if (typeof settings.shape === 'undefined') {\n console.warn('[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property');\n this.shape = ShapeBuffer.EMPTY_BUFFER;\n }\n else {\n this.shape = typeof settings.shape !== 'function' ? Adapt_1.Adapt.adapt(settings.shape, this.adaptMode) : settings.shape;\n }\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n /**\n * Check shape is static\n *\n * @returns boolean\n */\n isStatic() {\n return typeof this.shape !== 'function' && super.isStatic();\n }\n /**\n * Check shape is static indexed\n *\n * @returns boolean\n */\n isStaticIndexed() {\n return typeof this.shape !== 'function' && super.isStaticIndexed();\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n this.shapeBuffer = undefined;\n }\n /**\n * Apply sideLength on .shape buffer and calculate bounding\n *\n * @protected\n */\n bindBuffer(propArguments) {\n const sideLength = this.getRepetitionSideLength(propArguments);\n const shapeBuffer = this.applyModifiers(Float32Array.from(typeof this.shape === 'function' ? this.shape(propArguments) : this.shape), propArguments);\n const tmpBounding = [undefined, undefined, undefined, undefined];\n for (let i = 0, len = shapeBuffer.length; i < len; i += 2) {\n shapeBuffer[i] = shapeBuffer[i] * sideLength[0];\n shapeBuffer[i + 1] = shapeBuffer[i + 1] * sideLength[1];\n Adapt_1.Bounding.add(tmpBounding, shapeBuffer[i], shapeBuffer[i + 1]);\n }\n Adapt_1.Bounding.bind(this.currentGenerationPrimitiveBounding, tmpBounding);\n this.shapeBuffer = shapeBuffer;\n }\n /**\n * Return length of buffer\n *\n * @param {IPropArguments} propArguments\n * @returns {number}\n */\n getBufferLength( /*propArguments?: IPropArguments*/) {\n if (this.buffer && this.buffer.length > 0)\n return this.buffer.length;\n return this.shape.length * this.getRepetitionCount();\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (typeof this.shapeBuffer === 'undefined' ||\n typeof this.props.sideLength === 'function' ||\n typeof this.shape === 'function') {\n this.bindBuffer(propArguments);\n }\n return this.shapeBuffer;\n }\n /**\n * Set shape\n *\n * @param {(Float32Array)} [shape]\n */\n setShape(shape) {\n this.shape = Adapt_1.Adapt.adapt(shape, this.adaptMode);\n this.clearBuffer(true);\n }\n /**\n * Return adaptMode\n *\n * @returns {EAdaptMode}\n * @memberof ShapeBase\n */\n getAdaptMode() {\n return this.adaptMode;\n }\n /**\n * Get static buffer\n *\n * @param sideLength\n * @returns\n */\n static getBuffer(props = {}) {\n const shape = new this({ ...props, sideLength: props.sideLength || 1 });\n shape.generate();\n return shape.getBuffer() || new Float32Array();\n }\n}\nexports.ShapeBuffer = ShapeBuffer;\n//# sourceMappingURL=ShapeBuffer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeRecursive = void 0;\nconst Shape_1 = require(\"./Shape\");\n/**\n * @category Core.Shapes\n */\nclass ShapeRecursive extends Shape_1.Shape {\n /**\n * Creates an instance of ShapeRecursive.\n *\n * @param {IShapeRecursiveSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'ShapeRecursive';\n super(settings);\n this.props.recursions = settings.recursions || 1;\n this.props.recursionScale = settings.recursionScale || 2;\n this.props.recursionVertex = settings.recursionVertex || 0;\n // this.bInner = settings.bInner ?? false\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n this.shapeUseRecursion = !!settings.shapeUseRecursion;\n // this.currentGenerationRecursiveBounding = Bounding.empty()\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n if (bClearIndexed) {\n this.shapeRecursiveBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n * Set type of recursion\n *\n * @param {boolean} inner\n */\n // public setRecursionnInner(inner: boolean): void {\n // \tthis.bInner = inner\n // \tthis.clearBuffer(true)\n // }\n /**\n *\n * @returns {boolean}\n */\n isStatic() {\n return (typeof this.props.recursions !== 'function' &&\n typeof this.props.recursionScale !== 'function' &&\n typeof this.props.recursionVertex !== 'function' &&\n super.isStatic());\n }\n /**\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return (typeof this.props.recursions !== 'function' &&\n typeof this.props.recursionVertex !== 'function' &&\n super.isStaticIndexed());\n }\n /**\n * Return a buffer of children shape with recursion\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape) {\n if (typeof this.shapeRecursiveBuffer === 'undefined' ||\n this.shapeUseParent ||\n this.shape.generateId !== generateId) {\n this.bindBuffer(generateId, propArguments);\n }\n return this.shapeRecursiveBuffer;\n }\n return Shape_1.Shape.EMPTY_BUFFER;\n }\n /**\n * Generate Recoursive shape buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n */\n bindBuffer(generateId, propArguments) {\n const recursions = Math.floor(this.getProp('recursions', propArguments, 1));\n const recursionVertex = Math.floor(this.getProp('recursionVertex', propArguments, 0));\n const recursionScale = this.getProp('recursionScale', propArguments, 2);\n const childShape = this.shape;\n let currentRecursionRepetition = {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: 1 },\n };\n const recursionPropArguments = {\n ...propArguments,\n recursion: currentRecursionRepetition,\n };\n childShape.generate(generateId, false, recursionPropArguments);\n const firstGenerationChildBuffer = childShape.getBuffer();\n if (recursions <= 1) {\n // this.currentGenerationRecursiveBounding = this.shape.getBounding()\n this.shapeRecursiveBuffer = firstGenerationChildBuffer;\n return;\n }\n let shapeBuffer = firstGenerationChildBuffer;\n const storedRecursion = [currentRecursionRepetition];\n let paretRecursionIndex = 0, added = 1;\n // const tmpBounding = [undefined, undefined, undefined, undefined]\n const singleShapeBufferLength = shapeBuffer.length;\n const realVertexCount = singleShapeBufferLength / 2;\n const singleShapeVertexCount = recursionVertex <= 0 ? realVertexCount : Math.min(recursionVertex, realVertexCount);\n const recursionOffsetMultiplier = recursionVertex === 0 ? 1 : realVertexCount / Math.min(recursionVertex, realVertexCount);\n const recusiveShapeBuffer = new Float32Array(ShapeRecursive.summmation(recursions, singleShapeVertexCount) * singleShapeBufferLength);\n for (let i = 0; i < singleShapeBufferLength; i += 2) {\n recusiveShapeBuffer[i] = shapeBuffer[i];\n recusiveShapeBuffer[i + 1] = shapeBuffer[i + 1];\n // Bounding.add(tmpBounding, recusiveShapeBuffer[i], recusiveShapeBuffer[i + 1])\n }\n for (let currentRecursion = 1; currentRecursion < recursions; currentRecursion++) {\n const level_offset = recursions > 1 ? currentRecursion / (recursions - 1) : 1;\n const currentRecursionVertexCount = ShapeRecursive.summmation(currentRecursion, singleShapeVertexCount);\n const recursionBufferStartIndex = currentRecursionVertexCount * singleShapeBufferLength;\n const parentRecursion = currentRecursion - 1;\n const parentRecursionBufferStartIndex = parentRecursion === 0\n ? 0\n : ShapeRecursive.summmation(parentRecursion, singleShapeVertexCount) * singleShapeBufferLength;\n for (let currentShapeRecursionRepetition = 0, totalRecursionRepetitions = singleShapeVertexCount ** currentRecursion; currentShapeRecursionRepetition < totalRecursionRepetitions; currentShapeRecursionRepetition++, added++) {\n currentRecursionRepetition = {\n index: currentShapeRecursionRepetition + 1,\n offset: totalRecursionRepetitions > 1 ? currentShapeRecursionRepetition / (totalRecursionRepetitions - 1) : 1,\n count: totalRecursionRepetitions,\n level: { index: currentRecursion + 1, offset: level_offset, count: recursions },\n parent: storedRecursion[paretRecursionIndex],\n };\n storedRecursion.push(currentRecursionRepetition);\n if (this.shapeUseRecursion) {\n recursionPropArguments.recursion = currentRecursionRepetition;\n childShape.generate(generateId, false, recursionPropArguments);\n shapeBuffer = childShape.getBuffer();\n }\n const shapeVertexBufferIndex = recursionBufferStartIndex + currentShapeRecursionRepetition * singleShapeBufferLength;\n // const centerVertexIndex = parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2\n const centerVertexIndex = Math.floor(parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2 * recursionOffsetMultiplier);\n const centerX = recusiveShapeBuffer[centerVertexIndex];\n const centerY = recusiveShapeBuffer[centerVertexIndex + 1];\n const currentRecursionScale = recursionScale ** currentRecursion;\n for (let i = 0, len = singleShapeBufferLength; i < len; i += 2) {\n // if (this.bInner) {\n // \tconst parentCurrentVertex =\n // \t\tparentRecursionBufferStartIndex +\n // \t\tMath.floor(currentShapeRecursionRepetition / singleShapeVertexCount) *\n // \t\t\tsingleShapeVertexCount *\n // \t\t\trecursionOffsetMultiplier *\n // \t\t\t2\n // \tconst parentX = recusiveShapeBuffer[parentCurrentVertex + i]\n // \tconst parentY = recusiveShapeBuffer[parentCurrentVertex + i + 1]\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i] = (centerX - parentX) / recursionScale + parentX\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = (centerY - parentY) / recursionScale + parentY\n // const parentX = shapeBuffer[i] / recursionScale ** currentRecursion\n // const parentY = shapeBuffer[i + 1] / recursionScale ** currentRecursion\n // recusiveShapeBuffer[shapeVertexBufferIndex + i] = (centerX - parentX) / recursionScale + parentX\n // recusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = (centerY - parentY) / recursionScale + parentY\n // } else {\n const parentXScaled = shapeBuffer[i] / currentRecursionScale;\n const parentYScaled = shapeBuffer[i + 1] / currentRecursionScale;\n recusiveShapeBuffer[shapeVertexBufferIndex + i] = centerX + parentXScaled;\n recusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = centerY + parentYScaled;\n // }\n // Bounding.add(\n // \ttmpBounding,\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i],\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i + 1]\n // )\n }\n if (added % singleShapeVertexCount === 0) {\n paretRecursionIndex += 1;\n }\n }\n }\n // Bounding.bind(this.currentGenerationRecursiveBounding, tmpBounding)\n this.shapeRecursiveBuffer = recusiveShapeBuffer;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const propArguments = { repetition, shape: this };\n const recursions = Math.floor(this.getProp('recursions', propArguments, 1));\n const recursionVertex = Math.floor(this.getProp('recursionVertex', propArguments, 0));\n // const realFrameLength = ShapeRecursive.summmation(recursions, this.shape.getBufferLength() / 2)\n const bufferIndex = {\n shape: this,\n frameLength: frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n recursion: {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: recursions },\n },\n };\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentRecursionRepetition = {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: recursions },\n };\n const recursionBufferIndex = {\n ...bufferIndex,\n recursion: currentRecursionRepetition,\n };\n const parent = (currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, recursionBufferIndex)\n : recursionBufferIndex);\n this.indexedBuffer.push({\n ...currentIndexed,\n parent,\n });\n }\n if (recursions > 1) {\n const realVertexCount = this.shape.getBufferLength({ ...propArguments, parent: { ...bufferIndex } }) / 2;\n const vertexCount = recursionVertex <= 0 ? realVertexCount : Math.min(recursionVertex, realVertexCount);\n const storedRecursion = this.indexedBuffer.map(indexed => [indexed.parent.recursion]);\n let paretRecursionIndex = 0, added = 1;\n for (let i = 1; i < recursions; i++) {\n const level_offset = recursions > 1 ? i / (recursions - 1) : 1;\n for (let j = 0, len = vertexCount ** i; j < len; j++, added++) {\n const recursionOffset = len > 1 ? j / (len - 1) : 1;\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentRecursionRepetition = {\n index: j + 1,\n offset: recursionOffset,\n count: len,\n level: { index: i + 1, offset: level_offset, count: recursions },\n parent: storedRecursion[childIndexed][paretRecursionIndex],\n };\n const recursionBufferIndex = { ...bufferIndex, recursion: currentRecursionRepetition };\n const parent = currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, recursionBufferIndex)\n : recursionBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n storedRecursion[childIndexed].push(currentRecursionRepetition);\n if (added % vertexCount === 0) {\n paretRecursionIndex += 1;\n }\n }\n }\n }\n }\n }\n }\n /**\n * Retturn summation value\n *\n * @static\n * @param {number} recursion\n * @param {number} vertexCount\n * @returns {number}\n */\n static summmation(recursion, vertexCount) {\n if (recursion === 1)\n return 1;\n let result = 1;\n for (let i = 1; i < recursion; i++)\n result += vertexCount ** i;\n return result;\n }\n /**\n * Empty recursion repetition\n *\n * @static\n * @return {*} {IRecursionRepetition}\n */\n static getEmptyRecursion() {\n return {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: 1, count: 1 },\n };\n }\n}\nexports.ShapeRecursive = ShapeRecursive;\n//# sourceMappingURL=ShapeRecursive.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeFollow = void 0;\nconst Shape_1 = require(\"./Shape\");\n/**\n * @category Core.Shapes\n */\nclass ShapeFollow extends Shape_1.Shape {\n /**\n * Creates an instance of ShapeFollow.\n *\n * @param {IShapeFollowSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'ShapeFollow';\n super(settings);\n this.follow = settings.follow || settings.shape;\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n this.shapeUseFollow = !!settings.shapeUseFollow;\n // this.currentGenerationRecursiveBounding = Bounding.empty()\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n if (bClearIndexed) {\n this.shapeFollowBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n *\n * @returns {boolean}\n */\n isStatic() {\n return (this.follow ? this.follow.isStatic() : true) && super.isStatic();\n }\n /**\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return (this.follow ? this.follow.isStaticIndexed() : true) && super.isStaticIndexed();\n }\n /**\n * Return a buffer of children shape with recursion\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape && this.follow) {\n if (typeof this.shapeFollowBuffer === 'undefined' ||\n this.shapeUseParent ||\n this.shape.generateId !== generateId ||\n this.follow.generateId !== generateId) {\n this.bindBuffer(generateId, propArguments);\n }\n return this.shapeFollowBuffer;\n }\n return Shape_1.Shape.EMPTY_BUFFER;\n }\n /**\n * Generate Recoursive shape buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n */\n bindBuffer(generateId, propArguments) {\n const followShape = this.follow;\n followShape.generate(generateId, false, propArguments);\n const followBuffer = followShape.getBuffer();\n // const followIndexed = followShape.getIndexedBuffer() as Array\n const followPropArguments = {\n ...propArguments,\n follow: {\n index: 1,\n offset: 1,\n count: 1,\n },\n // follow_repetition: followIndexed[0].repetition,\n };\n const childShape = this.shape;\n childShape.generate(generateId, false, followPropArguments);\n let shapeBuffer = childShape.getBuffer();\n // const tmpBounding = [undefined, undefined, undefined, undefined]\n const singleShapeBufferLength = shapeBuffer.length;\n const followShapeBuffer = new Float32Array(singleShapeBufferLength * (followBuffer.length / 2));\n const totalFollowVertexCount = followBuffer.length / 2;\n for (let currentShapeFollowRepetition = 0; currentShapeFollowRepetition < totalFollowVertexCount; currentShapeFollowRepetition++) {\n const currentFollowRepetition = {\n index: currentShapeFollowRepetition + 1,\n offset: totalFollowVertexCount > 1 ? currentShapeFollowRepetition / (totalFollowVertexCount - 1) : 1,\n count: totalFollowVertexCount,\n };\n if (this.shapeUseFollow) {\n followPropArguments.follow = currentFollowRepetition;\n // followPropArguments.follow_repetition = followIndexed[currentShapeFollowRepetition].repetition\n childShape.generate(generateId, false, followPropArguments);\n shapeBuffer = childShape.getBuffer();\n }\n const shapeVertexBufferIndex = currentShapeFollowRepetition * singleShapeBufferLength;\n // const centerVertexIndex = parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2\n const centerVertexIndex = currentShapeFollowRepetition * 2;\n const centerX = followBuffer[centerVertexIndex];\n const centerY = followBuffer[centerVertexIndex + 1];\n for (let i = 0, len = shapeBuffer.length; i < len; i += 2) {\n followShapeBuffer[shapeVertexBufferIndex + i] = centerX + shapeBuffer[i];\n followShapeBuffer[shapeVertexBufferIndex + i + 1] = centerY + shapeBuffer[i + 1];\n // Bounding.add(\n // \ttmpBounding,\n // \tfollowShapeBuffer[shapeVertexBufferIndex + i],\n // \tfollowShapeBuffer[shapeVertexBufferIndex + i + 1]\n // )\n }\n }\n // Bounding.bind(this.currentGenerationRecursiveBounding, tmpBounding)\n this.shapeFollowBuffer = followShapeBuffer;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const propArguments = { repetition, shape: this };\n const bufferIndex = {\n shape: this,\n frameLength: frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n follow: {\n index: 1,\n offset: 1,\n count: 1,\n },\n };\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const vertexCount = this.follow.getBuffer().length / 2; // this.follow.getBufferLength({ ...propArguments, parent: { ...bufferIndex } }) / 2\n for (let j = 0, len = vertexCount; j < len; j++) {\n const followOffset = len > 1 ? j / (len - 1) : 1;\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentFollowRepetition = {\n index: j + 1,\n offset: followOffset,\n count: len,\n };\n const followBufferIndex = { ...bufferIndex, follow: currentFollowRepetition };\n const parent = currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, followBufferIndex)\n : followBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n }\n }\n }\n }\n }\n /**\n * Retturn summation value\n *\n * @static\n * @param {number} recursion\n * @param {number} vertexCount\n * @returns {number}\n */\n static summmation(recursion, vertexCount) {\n if (recursion === 1)\n return 1;\n let result = 1;\n for (let i = 1; i < recursion; i++)\n result += vertexCount ** i;\n return result;\n }\n /**\n * Empty recursion repetition\n *\n * @static\n * @return {*} {IRecursionRepetition}\n */\n static getEmptyRecursion() {\n return {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: 1, count: 1 },\n };\n }\n}\nexports.ShapeFollow = ShapeFollow;\n//# sourceMappingURL=ShapeFollow.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Line = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n *\n * @category Core.Primitives\n * @class Line\n * @extends {ShapeBuffer}\n */\nclass Line extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Two point, based on ShapeBuffer\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Line\n */\n constructor(settings = {}) {\n settings.type = 'Line';\n settings.shape = Line.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n settings.bClosed = false;\n super(settings);\n }\n /**\n * @link https://gist.github.com/pborissow/5c92b77a804688385c77749d1187ba07\n */\n static toPolygon(buffer, thickness) {\n const solidified = [];\n //Convert thickness into an array as needed\n if (!Array.isArray(thickness)) {\n const _thickness = thickness;\n const points = buffer.length / 2;\n thickness = new Array(points);\n for (let i = 0; i < points; i++) {\n thickness[i] = _thickness;\n }\n }\n function getOffsets(ax, ay, bx, by, thickness) {\n const dx = bx - ax, dy = by - ay, len = Math.sqrt(dx * dx + dy * dy), scale = thickness / (2 * len);\n return [-scale * dy, scale * dx];\n }\n function getIntersection(a1, b1, a2, b2) {\n // directional constants\n const k1 = (b1[1] - a1[1]) / (b1[0] - a1[0]), k2 = (b2[1] - a2[1]) / (b2[0] - a2[0]);\n // if the directional constants are equal, the lines are parallel\n if (Math.abs(k1 - k2) < 0.00001) {\n return;\n }\n // y offset constants for both lines\n const m1 = a1[1] - k1 * a1[0];\n const m2 = a2[1] - k2 * a2[0];\n // compute x\n const x = (m1 - m2) / (k2 - k1);\n // use y = k * x + m to get y coordinate\n const y = k1 * x + m1;\n return [x, y];\n }\n let bFirst, bLast, prevA = [\n [0, 0],\n [0, 0],\n ], prevB = [\n [0, 0],\n [0, 0],\n ];\n for (let i = 0, len = buffer.length - 2; i < len; i += 2) {\n bFirst = i === 0;\n bLast = i === len - 2;\n const off = getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], thickness[i]);\n const p0a = [buffer[i] + off[0], buffer[i + 1] + off[1]];\n const p1a = [buffer[i + 2] + off[0], buffer[i + 3] + off[1]];\n const p0b = [buffer[i] - off[0], buffer[i + 1] - off[1]];\n const p1b = [buffer[i + 2] - off[0], buffer[i + 3] - off[1]];\n if (!bFirst) {\n const interA = getIntersection(prevA[0], prevA[1], p0a, p1a);\n if (interA) {\n solidified.unshift(interA[1]);\n solidified.unshift(interA[0]);\n }\n const interB = getIntersection(prevB[0], prevB[1], p0b, p1b);\n if (interB) {\n solidified.push(interB[0]);\n solidified.push(interB[1]);\n }\n }\n if (bFirst) {\n solidified.unshift(p0a[1]);\n solidified.unshift(p0a[0]);\n solidified.push(p0b[0]);\n solidified.push(p0b[1]);\n }\n if (bLast) {\n solidified.unshift(p1a[1]);\n solidified.unshift(p1a[0]);\n solidified.push(p1b[0]);\n solidified.push(p1b[1]);\n }\n if (!bLast) {\n prevA = [p0a, p1a];\n prevB = [p0b, p1b];\n }\n }\n return Float32Array.from(solidified);\n }\n}\nexports.Line = Line;\nLine.buffer = [-1, 0, 1, 0];\n//# sourceMappingURL=Line.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Triangle = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n * Triangle ShapeBuffer\n *\n * @category Core.Primitives\n */\nclass Triangle extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Creates an instance of Triangleeee.\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Triangle\n */\n constructor(settings = {}) {\n settings.type = 'Triangle';\n settings.shape = Triangle.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n super(settings);\n }\n}\nexports.Triangle = Triangle;\nTriangle.buffer = [1, 0, -1, 1, -1, -1];\n//# sourceMappingURL=Triangle.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Rect = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n *\n * @category Core.Primitives\n * @class Rect\n * @extends {ShapeBuffer}\n */\nclass Rect extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Creates an instance of Rect.\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Rect\n */\n constructor(settings = {}) {\n settings.type = 'Rect';\n settings.shape = Rect.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n super(settings);\n }\n}\nexports.Rect = Rect;\nRect.buffer = [1, 1, -1, 1, -1, -1, 1, -1];\n//# sourceMappingURL=Rect.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Polygon = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Polygon shape\n *\n * @category Core.Primitives\n * @class Polygon\n * @extends {ShapeLoop}\n */\nclass Polygon extends ShapeLoop_1.ShapeLoop {\n /**\n * Is based on ShapeLoop and you can pass `sideNumber` property to define\n * a number of sides.\n *\n * @param settings\n */\n constructor(settings = {}) {\n settings.type = settings.type || 'Polygon';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['sideNumber']);\n super(settings, true);\n this.props.sideNumber = settings.sideNumber;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: (propArguments) => {\n return math_1.PI2 / this.getProp('sideNumber', propArguments, 5);\n },\n vertex: shapeLoopRepetition => {\n return [Math.cos(shapeLoopRepetition.current), Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n}\nexports.Polygon = Polygon;\n//# sourceMappingURL=Polygon.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Circle = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n *\n * @category Core.Primitives\n * @class Circle\n * @extends {ShapeLoop}\n */\nclass Circle extends ShapeLoop_1.ShapeLoop {\n /**\n * Based on ShapeLoop, the number of point (resolution) is based on sideLength.\n *\n * @param {ShapeLoopSettings} [settings={}]\n * @memberof Circle\n */\n constructor(settings = {}) {\n settings.type = 'Circle';\n super(settings, true);\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const sideLength = this.getRepetitionSideLength(propArguments);\n return (1 / Math.pow(sideLength[0] * sideLength[1], 0.25)) * ShapeLoop_1.ShapeLoop.PId2;\n },\n vertex: shapeLoopRepetition => [Math.cos(shapeLoopRepetition.current), Math.sin(shapeLoopRepetition.current)],\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n}\nexports.Circle = Circle;\n//# sourceMappingURL=Circle.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Star = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Polygon shape\n *\n * @category Core.Primitives\n * @class Polygon\n * @extends {ShapeLoop}\n */\nclass Star extends ShapeLoop_1.ShapeLoop {\n /**\n * Is based on ShapeLoop and you can pass `spikes` property to define\n * a number of spikes and `innerRadius`\n *\n * @param settings\n */\n constructor(settings = {}) {\n settings.type = settings.type || 'Polygon';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['spikes', 'innerRadius']);\n super(settings, true);\n this.props.spikes = settings.spikes;\n this.props.innerRadius = settings.innerRadius;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: (propArguments) => {\n // dyamic binding in `generateLoopBuffer`\n return this.inc;\n },\n vertex: shapeLoopRepetition => {\n const angle = (Math.PI / this.spikes) * shapeLoopRepetition.index;\n const radius = shapeLoopRepetition.index % 2 === 0 ? 1 : this.innerRadius;\n return [Math.cos(angle) * radius, Math.sin(angle) * radius];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.spikes = this.getProp('spikes', propArguments, 5);\n this.innerRadius = this.getProp('innerRadius', propArguments, 0.5);\n this.inc = Math.PI / this.spikes;\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.Star = Star;\n//# sourceMappingURL=Star.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Rose = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Rose shape\n *\n * @category Core.Primitives\n * @class Rose\n * @extends {ShapeLoop}\n */\nclass Rose extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Rose.\n *\n * @param {IRoseSettings} [settings={}]\n * @memberof Rose\n */\n constructor(settings = {}) {\n var _a, _b;\n settings.type = 'Rose';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['n', 'd']);\n super(settings, true);\n this.props.n = (_a = settings.n) !== null && _a !== void 0 ? _a : 1;\n this.props.d = (_b = settings.d) !== null && _b !== void 0 ? _b : 2;\n this.loop = {\n start: 0,\n end: (propArguments) => Rose.getFinalAngleFromK(this.getProp('n', propArguments), this.getProp('d', propArguments)),\n inc: (propArguments) => {\n const n = this.getProp('n', propArguments);\n const d = this.getProp('d', propArguments);\n const sideLength = this.getRepetitionSideLength(propArguments);\n const sides = Math.pow(sideLength[0] * sideLength[1], 0.45);\n const k = d < n ? n / d : 1.5;\n return math_1.PI2 / (sides * k);\n },\n vertex: (shapeLoopRepetition) => {\n const f = Math.cos(this.k * shapeLoopRepetition.current);\n return [f * Math.cos(shapeLoopRepetition.current), f * Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.k = this.getProp('n', propArguments) / this.getProp('d', propArguments);\n return super.generateLoopBuffer(propArguments);\n }\n /**\n * Return end angle of rose\n *\n * @static\n * @param {number} n\n * @param {number} d\n * @returns {number}\n * @memberof Rose\n */\n static getFinalAngleFromK(n, d) {\n if (n == d)\n return math_1.PI2;\n const k = n / d;\n const p = n * d;\n if (!Number.isInteger(k) && k % 0.5 == 0)\n return 4 * Math.PI;\n return Math.PI * d * (p % 2 == 0 ? 2 : 1);\n }\n}\nexports.Rose = Rose;\n//# sourceMappingURL=Rose.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Spiral = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n * Spiral shape\n *\n * @category Core.Primitives\n * @class Spiral\n * @extends {ShapeLoop}\n */\nclass Spiral extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Spiral.\n *\n * @param {SpiralSettings} [settings={}]\n * @memberof Spiral\n */\n constructor(settings = {}) {\n var _a, _b, _c;\n settings.type = 'Spiral';\n settings.bClosed = false;\n settings.loopDependencies = (settings.loopDependencies || []).concat(['twists', 'twistsStart', 'spiral']);\n super(settings, true);\n this.props.spiral = (_a = settings.spiral) !== null && _a !== void 0 ? _a : Spiral.types.ARCHIMEDE;\n this.props.twists = (_b = settings.twists) !== null && _b !== void 0 ? _b : 2;\n this.props.twistsStart = (_c = settings.twistsStart) !== null && _c !== void 0 ? _c : 0;\n this.loop = {\n start: (propArguments) => math_1.PI2 * this.getProp('twistsStart', propArguments),\n end: (propArguments) => math_1.PI2 *\n (this.getProp('twistsStart', propArguments) + this.getProp('twists', propArguments)),\n inc: (propArguments) => {\n const twists = this.getProp('twists', propArguments);\n const rep = math_1.PI2 * twists;\n const sideLength = this.getRepetitionSideLength(propArguments);\n const radius = 4 + Math.sqrt(sideLength[0] * sideLength[1]);\n return rep / (radius * twists);\n },\n vertex: (shapeLoopRepetition) => {\n const r = this.r(shapeLoopRepetition.current);\n return [r * Math.cos(shapeLoopRepetition.current), r * Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.spiral = this.getProp('spiral', propArguments);\n this.r = Spiral.getRFromTSpiralType(this.spiral);\n return super.generateLoopBuffer(propArguments);\n }\n /**\n * Point position and scale factor for spiral types\n *\n * @static\n * @param {TSpiralType} spiral\n * @returns {number}\n * @memberof Spiral\n */\n static getRFromTSpiralType(spiral) {\n switch (spiral) {\n case Spiral.types.ARCHIMEDE:\n return angle => angle / 10;\n case Spiral.types.HYPERBOLIC:\n return angle => (1 / angle) * 3;\n case Spiral.types.FERMAT:\n return angle => angle ** 0.5 / 3;\n case Spiral.types.LITUUS:\n return angle => angle ** -0.5;\n case Spiral.types.LOGARITHMIC:\n return angle => Math.E ** (angle * 0.2) / 10;\n }\n return angle => angle;\n }\n}\nexports.Spiral = Spiral;\n/**\n * Spural types\n *\n * @static\n * @type {{ [name in TSpiralType]: TSpiralType }}\n * @memberof Spiral\n */\nSpiral.types = {\n ARCHIMEDE: 'ARCHIMEDE',\n HYPERBOLIC: 'HYPERBOLIC',\n FERMAT: 'FERMAT',\n LITUUS: 'LITUUS',\n LOGARITHMIC: 'LOGARITHMIC',\n};\n//# sourceMappingURL=Spiral.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Lissajous = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Lissajous shape\n *\n * @category Core.Primitives\n * @class Lissajous\n * @extends {ShapeLoop}\n */\nclass Lissajous extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Lissajous.\n *\n * @param {ILissajousSettings} [settings={}]\n * @memberof Lissajous\n */\n constructor(settings = {}) {\n settings.type = 'Lissajous';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['wx', 'wy', 'wz']);\n super(settings, true);\n this.props.wx = settings.wx || 1;\n this.props.wy = settings.wy || 2;\n this.props.wz = settings.wz || 0;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const wx = this.getProp('wx', propArguments);\n const wy = this.getProp('wy', propArguments);\n const ratio = wx == wy ? ShapeLoop_1.ShapeLoop.PId2 : 0.5 - Math.min(49, wx + wy) * 0.01;\n const sideLength = this.getRepetitionSideLength(propArguments);\n return (1 / Math.pow(sideLength[0] * sideLength[1], 0.25)) * ratio;\n },\n vertex: (shapeLoopRepetition) => {\n return this.wx === this.wy\n ? [Math.cos(shapeLoopRepetition.current + this.wz), Math.sin(shapeLoopRepetition.current)]\n : [Math.cos(this.wx * shapeLoopRepetition.current + this.wz), Math.sin(this.wy * shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.wx = this.getProp('wx', propArguments, 1);\n this.wy = this.getProp('wy', propArguments, 2);\n this.wz = this.getProp('wz', propArguments, 2);\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.Lissajous = Lissajous;\n//# sourceMappingURL=Lissajous.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SuperShape = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n * ShperShape\n *\n * @category Core.Primitives\n * @class SuperShape\n * @extends {ShapeLoop}\n */\nclass SuperShape extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of SuperShape.\n *\n * @param {ISuperShapeSettings} [settings={}]\n * @memberof SuperShape\n */\n constructor(settings = {}) {\n var _a, _b, _c, _d, _e, _f;\n settings.type = 'SuperShape';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['a', 'b', 'm', 'n1', 'n2', 'n3']);\n super(settings, true);\n this.props.a = (_a = settings.a) !== null && _a !== void 0 ? _a : 1;\n this.props.b = (_b = settings.b) !== null && _b !== void 0 ? _b : 1;\n this.props.m = (_c = settings.m) !== null && _c !== void 0 ? _c : 6;\n this.props.n1 = (_d = settings.n1) !== null && _d !== void 0 ? _d : 1;\n this.props.n2 = (_e = settings.n2) !== null && _e !== void 0 ? _e : 1;\n this.props.n3 = (_f = settings.n3) !== null && _f !== void 0 ? _f : 1;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const sideLength = this.getRepetitionSideLength(propArguments);\n return Math.PI / Math.pow(sideLength[0] * sideLength[1], 0.5);\n },\n vertex: (shapeLoopRepetition) => {\n const angle = shapeLoopRepetition.current;\n const m = (this.m * angle) / 4;\n const a = Math.abs(Math.cos(m) / this.a) ** this.n2;\n const b = Math.abs(Math.sin(m) / this.b) ** this.n3;\n const raux = (a + b) ** (1 / this.n1);\n const r = raux === 0 ? 1 : 1 / raux;\n return [r * Math.cos(angle), r * Math.sin(angle)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.a = this.getProp('a', propArguments);\n this.b = this.getProp('b', propArguments);\n this.m = this.getProp('m', propArguments);\n this.n1 = this.getProp('n1', propArguments);\n this.n2 = this.getProp('n2', propArguments);\n this.n3 = this.getProp('n3', propArguments);\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.SuperShape = SuperShape;\n//# sourceMappingURL=SuperShape.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Modifiers = void 0;\nconst Adapt_1 = require(\"./Adapt\");\nconst Mirror_1 = require(\"./Mirror\");\nconst Smooth_1 = require(\"./Smooth\");\nconst Solidify_1 = require(\"./Solidify\");\nconst Subdivide_1 = require(\"./Subdivide\");\nconst Close_1 = require(\"./Close\");\nconst Offset_1 = require(\"./Offset\");\nconst Modifiers = {\n Adapt: Adapt_1.Adapt,\n Mirror: Mirror_1.Mirror,\n Smooth: Smooth_1.Smooth,\n Solidify: Solidify_1.Solidify,\n Subdivide: Subdivide_1.Subdivide,\n Close: Close_1.Close,\n Offset: Offset_1.Offset,\n};\nexports.Modifiers = Modifiers;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Mirror = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Mirror extends Modifier_1.Modifier {\n constructor(args = { x: true, y: true }) {\n super();\n this.x = args.x === true;\n this.y = args.y === true;\n }\n apply(buffer, bClosed) {\n const bufferLength = buffer.length;\n const mirror = new Float32Array(bufferLength * (this.x ? 2 : 1) * (this.y ? 2 : 1));\n const sideLengthX = 1;\n const sideLengthY = 1;\n if (this.x && this.y) {\n const bufferLengthX2 = bufferLength + bufferLength;\n const bufferLengthX3 = bufferLengthX2 + bufferLength;\n // |1|2|\n // |4|3|\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i] - sideLengthX;\n mirror[i + 1] = buffer[i + 1] - sideLengthY;\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i] * -1 + sideLengthX;\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1] - sideLengthY;\n mirror[bufferLengthX2 + i] = buffer[i] * -1 + sideLengthX;\n mirror[bufferLengthX2 + i + 1] = buffer[i + 1] * -1 + sideLengthY;\n mirror[bufferLengthX3 + i] = buffer[bufferLength - 2 - i] - sideLengthX;\n mirror[bufferLengthX3 + i + 1] = buffer[bufferLength - 2 - i + 1] * -1 + sideLengthY;\n }\n }\n else if (this.x) {\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i] - sideLengthX;\n mirror[i + 1] = buffer[i + 1];\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i] * -1 + sideLengthX;\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1];\n }\n }\n else if (this.y) {\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i];\n mirror[i + 1] = buffer[i + 1] - sideLengthY;\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i];\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1] * -1 + sideLengthY;\n }\n }\n else {\n return buffer;\n }\n return mirror;\n }\n}\nexports.Mirror = Mirror;\n//# sourceMappingURL=Mirror.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Smooth = void 0;\nconst Utilities_1 = require(\"../Utilities\");\nconst Close_1 = require(\"./Close\");\nconst Modifier_1 = require(\"./Modifier\");\nclass Smooth extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.level = args.level || 1;\n const tension = Array.isArray(args.tension) ? args.tension : [args.tension];\n this.tension = new Array(this.level).fill(0.5).map((v, i) => Utilities_1.clamp(0, 1, tension[i] || v));\n this.level = this.level < 1 ? 1 : this.level;\n this.closed = args.closed === true;\n }\n apply(buffer, bClosed) {\n if (bClosed && !Close_1.Close.isClosed(buffer)) {\n const bufferLen = buffer.length;\n const mofified = new Float32Array(bufferLen + 2);\n mofified.set(buffer, 0);\n mofified[bufferLen] = buffer[0];\n mofified[bufferLen + 1] = buffer[1];\n buffer = mofified;\n }\n let smoothed = buffer;\n for (let i = 0, len = this.level; i < len; i++)\n smoothed = Smooth.smooth(smoothed, this.tension[i], bClosed || this.closed);\n return smoothed;\n }\n /**\n * Chaikin smooth\n *\n * the tension factor defines a scale between corner cutting distance in segment half length,\n * i.e. between 0.05 and 0.45. The opposite corner will be cut by the inverse\n * (i.e. 1-cutting distance) to keep symmetry.\n * with a tension value of 0.5 this amounts to 0.25 = 1/4 and 0.75 = 3/4,\n * the original Chaikin values\n *\n * @link https://www.codeproject.com/Articles/1093960/D-Polyline-Vertex-Smoothing\n * @param buffer\n */\n static smooth(buffer, tension = 0.5, bClosed = false) {\n const bufferLength = buffer.length;\n const smoothed = new Float32Array((buffer.length - (bClosed ? 1 : 0)) * 2);\n if (!bClosed) {\n smoothed[0] = buffer[0];\n smoothed[1] = buffer[1];\n }\n const cutdist = 0.05 + tension * 0.4;\n const ncutdist = 1 - cutdist;\n let smoothedLength = bClosed ? 0 : 2;\n for (let i = 0, len = bufferLength - 2; i < len; i += 2, smoothedLength += 4) {\n // q\n smoothed[smoothedLength] = ncutdist * buffer[i] + cutdist * buffer[i + 2];\n smoothed[smoothedLength + 1] = ncutdist * buffer[i + 1] + cutdist * buffer[i + 3];\n // r\n smoothed[smoothedLength + 2] = cutdist * buffer[i] + ncutdist * buffer[i + 2];\n smoothed[smoothedLength + 3] = cutdist * buffer[i + 1] + ncutdist * buffer[i + 3];\n }\n if (!bClosed) {\n smoothed[smoothedLength] = buffer[bufferLength - 2];\n smoothed[smoothedLength + 1] = buffer[bufferLength - 1];\n }\n else {\n smoothed[smoothedLength] = smoothed[0];\n smoothed[smoothedLength + 1] = smoothed[1];\n }\n return smoothed;\n }\n}\nexports.Smooth = Smooth;\n//# sourceMappingURL=Smooth.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Close = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Close extends Modifier_1.Modifier {\n constructor() {\n super();\n }\n apply(buffer, bClosed, shape) {\n return Close.call(buffer);\n }\n static call(buffer) {\n const len = buffer.length;\n if (Close.isClosed(buffer))\n return buffer;\n const result = new Float32Array(len + 2);\n result.set(buffer, 0);\n result[len] = result[0];\n result[len + 1] = result[1];\n return result;\n }\n static isClosed(buffer) {\n const len = buffer.length;\n return buffer[0] === buffer[len - 2] && buffer[1] === buffer[len - 1];\n }\n}\nexports.Close = Close;\n//# sourceMappingURL=Close.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Solidify = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Solidify extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.closed = args.closed === true;\n this.thickness = args.thickness || 0.2;\n this.error = args.error;\n }\n apply(buffer, bClosed) {\n return Solidify.solidify(buffer, this.thickness, this.closed, this.error);\n }\n /**\n * @link https://gist.github.com/kekscom/4194148\n */\n static solidify(buffer, thickness, bClosed = false, error) {\n const solidified = [];\n thickness = typeof thickness === 'number' ? [thickness] : thickness;\n const thicknessLength = thickness.length;\n let bFirst, bLast, prevA = [\n [0, 0],\n [0, 0],\n ], prevB = [\n [0, 0],\n [0, 0],\n ];\n for (let i = 0, t = 0, len = buffer.length - 2; i < len; i += 2, t++) {\n bFirst = i === 0;\n bLast = i === len - 2;\n const currentThicknessRep = {\n index: i + 1,\n offset: i / len,\n count: len,\n };\n const nextThicknessRep = {\n index: i + 2,\n offset: (i + 1) / len,\n count: len,\n };\n const currentThickness = typeof thickness === 'function' ? thickness(currentThicknessRep) : thickness[t % thicknessLength];\n const nextThickness = typeof thickness === 'function' ? thickness(nextThicknessRep) : thickness[(t + 1) % thicknessLength];\n const off = Solidify.getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], currentThickness);\n const off2 = Solidify.getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], nextThickness);\n const p0a = [buffer[i] + off[0], buffer[i + 1] + off[1]];\n const p1a = [buffer[i + 2] + off2[0], buffer[i + 3] + off2[1]];\n const p0b = [buffer[i] - off[0], buffer[i + 1] - off[1]];\n const p1b = [buffer[i + 2] - off2[0], buffer[i + 3] - off2[1]];\n if (!bFirst) {\n const interA = Solidify.getIntersection(prevA[0], prevA[1], p0a, p1a, error);\n if (interA) {\n solidified.unshift(interA[1]);\n solidified.unshift(interA[0]);\n }\n const interB = Solidify.getIntersection(prevB[0], prevB[1], p0b, p1b, error);\n if (interB) {\n solidified.push(interB[0]);\n solidified.push(interB[1]);\n }\n }\n if (bFirst) {\n solidified.unshift(p0a[1]);\n solidified.unshift(p0a[0]);\n solidified.push(p0b[0]);\n solidified.push(p0b[1]);\n }\n if (bLast) {\n solidified.unshift(p1a[1]);\n solidified.unshift(p1a[0]);\n solidified.push(p1b[0]);\n solidified.push(p1b[1]);\n }\n if (!bLast) {\n prevA = [p0a, p1a];\n prevB = [p0b, p1b];\n }\n }\n if (bClosed) {\n const centerIndex = buffer.length - 2;\n const lastIndex = solidified.length - 2;\n const x = 0.5 * solidified[0] + solidified[centerIndex] * 0.5;\n const y = 0.5 * solidified[1] + solidified[centerIndex + 1] * 0.5;\n const x2 = 0.5 * solidified[centerIndex + 2] + solidified[lastIndex] * 0.5;\n const y2 = 0.5 * solidified[centerIndex + 3] + solidified[lastIndex + 1] * 0.5;\n solidified[0] = x;\n solidified[1] = y;\n solidified[centerIndex] = x;\n solidified[centerIndex + 1] = y;\n solidified[centerIndex + 2] = x2;\n solidified[centerIndex + 3] = y2;\n solidified[lastIndex] = x2;\n solidified[lastIndex + 1] = y2;\n }\n return Float32Array.from(solidified);\n }\n static getOffsets(ax, ay, bx, by, thickness) {\n const dx = bx - ax, dy = by - ay, len = Math.sqrt(dx * dx + dy * dy), scale = thickness / (2 * len);\n return [-scale * dy, scale * dx];\n }\n static getIntersection(a1, b1, a2, b2, error = 0.00001) {\n // directional constants\n const k1 = (b1[1] - a1[1]) / (b1[0] - a1[0]), k2 = (b2[1] - a2[1]) / (b2[0] - a2[0]);\n // if the directional constants are equal, the lines are parallel\n // if (Math.abs(k1 - k2) < 0.00001) {\n if (Math.abs(k1 - k2) < error) {\n return;\n }\n // y offset constants for both lines\n const m1 = a1[1] - k1 * a1[0];\n const m2 = a2[1] - k2 * a2[0];\n // compute x\n const x = (m1 - m2) / (k2 - k1);\n // use y = k * x + m to get y coordinate\n const y = k1 * x + m1;\n return [x, y];\n }\n}\nexports.Solidify = Solidify;\n//# sourceMappingURL=Solidify.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Subdivide = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Subdivide extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.level = args.level || 1;\n this.level = this.level < 1 ? 1 : this.level;\n }\n apply(buffer, bClosed) {\n const level = this.level;\n let subdivided = buffer;\n if (subdivided && subdivided.length > 0) {\n for (let i = 0; i < level; i++)\n subdivided = Subdivide.subdivide(subdivided, bClosed);\n }\n return subdivided;\n }\n /**\n * Subdivide buffer\n *\n * @static\n * @param {Float32Array} shape\n * @param {boolean} [bClosed=true]\n * @returns {(Float32Array)}\n */\n static subdivide(buffer, bClosed = false) {\n const bufferLength = buffer.length;\n const subdivided = new Float32Array(bufferLength * 2 - (bClosed ? 0 : 2));\n for (let i = 0; i < bufferLength; i += 2) {\n if (i === 0) {\n subdivided[0] = buffer[0];\n subdivided[1] = buffer[1];\n }\n else {\n const px = buffer[i - 2];\n const py = buffer[i - 1];\n const x = buffer[i];\n const y = buffer[i + 1];\n const nx = (x + px) / 2;\n const ny = (y + py) / 2;\n subdivided[(i - 1) * 2] = nx;\n subdivided[(i - 1) * 2 + 1] = ny;\n subdivided[i * 2] = x;\n subdivided[i * 2 + 1] = y;\n }\n }\n if (bClosed) {\n subdivided[(bufferLength - 1) * 2] = (buffer[0] + buffer[bufferLength - 2]) / 2;\n subdivided[(bufferLength - 1) * 2 + 1] = (buffer[1] + buffer[bufferLength - 1]) / 2;\n }\n return subdivided;\n }\n}\nexports.Subdivide = Subdivide;\n//# sourceMappingURL=Subdivide.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Offset = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Offset extends Modifier_1.Modifier {\n constructor(args = { from: 0, to: undefined }) {\n super();\n this.from = args.from;\n this.to = args.to;\n }\n apply(buffer, bClosed) {\n return buffer.subarray(this.from, this.to ? (this.to < 0 ? buffer.length + this.to : this.to) : undefined);\n }\n}\nexports.Offset = Offset;\n//# sourceMappingURL=Offset.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./utilities\"), exports);\n__exportStar(require(\"./createAnimation\"), exports);\n__exportStar(require(\"./createInterpolator\"), exports);\n__exportStar(require(\"./Easings\"), exports);\n__exportStar(require(\"./Animation\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.interpolateColorHSL = exports.interpolateColorRGB = exports.cosp = exports.sinp = exports.clockOffset = exports.clock = void 0;\n/**\n * Return time (from 0 to duration) in milliseconds\n *\n * @export\n * @param {number} time Current time\n * @param {number} duration Clock duration\n * @param {(number | boolean)} [loop=true]\n * @param {('normal' | 'reverse' | 'alternate')} [direction='alternate']\n * @param {number} [delay=0]\n * @param {number} [afterDelay=0]\n * @return {*} {number} Between 0 and duration\n */\nfunction clock(time, duration, loop = true, direction = 'alternate', delay = 0, afterDelay = 0) {\n const totalDuration = direction === 'normal'\n ? duration + delay\n : direction === 'reverse'\n ? duration + delay\n : duration * 2 + delay + afterDelay;\n if ((typeof loop === 'number' && time >= totalDuration * loop) || (loop === false && time >= totalDuration)) {\n return direction === 'normal' ? duration : 0;\n }\n time %= totalDuration;\n if ((time -= delay) <= 0) {\n return 0;\n }\n if (direction === 'alternate') {\n if (time <= duration) {\n // normal\n return time;\n }\n else {\n // reverse\n time -= duration;\n if ((time -= afterDelay) >= 0) {\n return duration - (time >= duration ? duration : time);\n }\n return duration;\n }\n }\n else {\n return time >= duration ? duration : time;\n }\n}\nexports.clock = clock;\n/**\n * Return offset between 0 and 1 from current time based on duration and other parameters\n *\n * @export\n * @param {number} time\n * @param {number} duration\n * @param {(number | boolean)} [loop=true]\n * @param {('normal' | 'reverse' | 'alternate')} [direction='alternate']\n * @param {number} [delay=0]\n * @param {number} [afterDelay=0]\n * @return {*} {number}\n */\nfunction clockOffset(time, duration, loop = true, direction = 'alternate', delay = 0, afterDelay = 0) {\n return clock(time, duration, loop, direction, delay, afterDelay) / duration;\n}\nexports.clockOffset = clockOffset;\nconst PI2 = Math.PI * 2;\n/**\n * Return sin of period 'durate' in time 'time'\n *\n * @export\n * @param {number} time\n * @param {number} durate\n * @param {number} phase\n * @param {boolean} [normalize=false]\n * @return {*} {number}\n */\nfunction sinp(time, durate, phase = 0, normalize = false) {\n const value = Math.sin((time * PI2) / durate + phase);\n return normalize ? 0.5 + value * 0.5 : value;\n}\nexports.sinp = sinp;\n/**\n * Return cos of period 'durate' in time 'time'\n *\n * @export\n * @param {number} time\n * @param {number} durate\n * @param {number} phase\n * @param {boolean} [normalize=false]\n * @return {*} {number}\n */\nfunction cosp(time, durate, phase = 0, normalize = false) {\n const value = Math.cos((time * PI2) / durate + phase);\n return normalize ? 0.5 + value * 0.5 : value;\n}\nexports.cosp = cosp;\nfunction interpolateColorRGB(start, end, offset) {\n const r = start.r + offset * (end.r - start.r);\n const g = start.g + offset * (end.g - start.g);\n const b = start.b + offset * (end.b - start.b);\n const alpha = start.alpha + offset * (end.alpha - start.alpha);\n return `rgba(${Math.floor(r)},${Math.floor(g)},${Math.floor(b)},${alpha})`;\n}\nexports.interpolateColorRGB = interpolateColorRGB;\nfunction interpolateColorHSL(start, end, offset) {\n const h = start.h + offset * (end.h - start.h);\n const s = start.s + offset * (end.s - start.s);\n const l = start.l + offset * (end.l - start.l);\n const alpha = start.alpha + offset * (end.alpha - start.alpha);\n return `hsla(${h},${s}%,${l}%,${alpha})`;\n}\nexports.interpolateColorHSL = interpolateColorHSL;\n//# sourceMappingURL=utilities.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createAnimation = void 0;\nconst createInterpolator_1 = require(\"./createInterpolator\");\n/**\n * Create TAnimation from object\n *\n * @param simpleAnimation\n * @returns\n */\nfunction createAnimation(simpleAnimation) {\n const interpolate = createInterpolator_1.createInterpolationCallback(simpleAnimation);\n if (typeof interpolate === 'undefined')\n return undefined;\n const delay = simpleAnimation.delay || 0;\n const afterDelay = simpleAnimation.afterDelay || 0;\n const direction = simpleAnimation.direction || 'normal';\n const duration = simpleAnimation.duration || 1000;\n const totalDuration = direction === 'normal'\n ? duration + delay\n : direction === 'reverse'\n ? duration + delay\n : duration * 2 + delay + afterDelay;\n const loop = typeof simpleAnimation.loop === 'number' ? simpleAnimation.loop : !!simpleAnimation.loop;\n const bindedValues = {\n delay,\n afterDelay,\n direction,\n duration,\n totalDuration,\n loop,\n };\n const animationFunction = createInterpolator_1.createInterpolator(simpleAnimation.interpolator);\n const animation = {\n loop: 0,\n offset: 0,\n loopDuration: totalDuration,\n direction: direction === 'alternate' ? 'normal' : direction,\n started: false,\n ended: false,\n value: undefined,\n };\n animation.update = createUpdate(animation, bindedValues, animationFunction, interpolate);\n return animation;\n}\nexports.createAnimation = createAnimation;\n/**\n *\n * @internal\n * @param animation\n * @param bindedValues\n * @param animationFunction\n * @param interpolate\n * @returns\n */\nfunction createUpdate(animation, bindedValues, animationFunction, interpolate) {\n const { loop, totalDuration, delay, afterDelay, direction, duration } = bindedValues;\n return (time) => {\n // Check animation is ended\n if ((typeof loop === 'number' && time >= totalDuration * loop) ||\n (loop === false && time >= bindedValues.totalDuration)) {\n animation.started = false;\n animation.ended = true;\n animation.offset = animationFunction(direction === 'normal' ? duration : 0, duration);\n animation.value = interpolate(animation.offset);\n return;\n }\n animation.loop = Math.ceil(time / totalDuration);\n time %= totalDuration;\n if ((time -= delay) <= 0) {\n animation.started = false;\n animation.offset = animationFunction(0, duration);\n animation.value = interpolate(animation.offset);\n return;\n }\n animation.started = true;\n if (direction === 'alternate') {\n if (time <= duration) {\n animation.direction = 'normal';\n animation.offset = animationFunction(time, duration);\n }\n else {\n animation.direction = 'reverse';\n time -= duration;\n // wait afterDelay\n if ((time -= afterDelay) >= 0) {\n animation.offset = 1 - animationFunction(time >= duration ? duration : time, duration);\n }\n else {\n animation.offset = 1;\n }\n }\n }\n else {\n const animationValue = animationFunction(time >= duration ? duration : time, duration);\n animation.offset = direction === 'normal' ? animationValue : 1 - animationValue;\n }\n animation.value = interpolate(animation.offset);\n };\n}\n//# sourceMappingURL=createAnimation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createInterpolator = exports.createInterpolationCallback = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst bezier_easing_1 = require(\"bezier-easing\");\nconst Easings_1 = require(\"./Easings\");\nconst utilities_1 = require(\"./utilities\");\n/**\n * Return a callback for value interpolation passing offset from 0 to 1\n *\n * @param simpleAnimation\n * @returns\n */\nfunction createInterpolationCallback(simpleAnimation) {\n const from = Array.isArray(simpleAnimation.from) ? simpleAnimation.from : [simpleAnimation.from];\n const to = Array.isArray(simpleAnimation.to) ? simpleAnimation.to : [simpleAnimation.to];\n const round = simpleAnimation.round;\n const colorInterpolation = simpleAnimation.colorTransitionMode === 'hue' ? utilities_1.interpolateColorHSL : utilities_1.interpolateColorRGB;\n if (from.length !== to.length)\n return undefined;\n const callbacks = [];\n for (let i = 0, len = from.length; i < len; i++) {\n if (typeof from[i] !== typeof to[i]) {\n console.warn('[@urpflanze/animation]: `from` and `to` values mismatch');\n return undefined;\n }\n else {\n if (typeof from[i] !== 'string') {\n const a = from[i], b = to[i];\n callbacks.push(typeof round !== 'undefined'\n ? (offset) => offset === 1 ? b : offset === 0 ? a : Math.round((a + offset * (b - a)) * round) / round\n : (offset) => (offset === 1 ? b : offset === 0 ? a : a + offset * (b - a)));\n }\n else {\n const a = from[i];\n const b = to[i];\n const parsed_a = color_1.parseColorAndConvert(a);\n const parsed_b = color_1.parseColorAndConvert(b);\n if (typeof parsed_a !== 'undefined' && typeof parsed_b !== 'undefined') {\n callbacks.push((offset) => offset === 1 ? b : offset === 0 ? a : colorInterpolation(parsed_a, parsed_b, offset));\n }\n }\n }\n }\n return (offset) => {\n const values = callbacks.map(c => c(offset));\n return values.length === 1 ? values[0] : values;\n };\n}\nexports.createInterpolationCallback = createInterpolationCallback;\n/**\n * Return a callback for calculate offset (0 to 1) from elapsed time and animation duration\n *\n * @param type\n * @returns\n */\nfunction createInterpolator(type) {\n var _a, _b;\n switch (typeof type) {\n case 'function':\n return (elapsed, duration) => type(elapsed / duration, elapsed);\n case 'string':\n switch (type) {\n case 'wave':\n return (elapsed, duration) => 0.5 + Math.sin((elapsed * Math.PI * 2) / duration + Math.PI * 1.5) * 0.5;\n default: {\n if (type in Easings_1.Easings) {\n const easing = Easings_1.Easings[type];\n return (elapsed, duration) => easing(elapsed, 0, 1, duration);\n }\n return (elapsed, duration) => Easings_1.Easings.linear(elapsed, 0, 1, duration);\n }\n }\n case 'object':\n switch (type.type) {\n case 'wave': {\n const phase = Math.PI * 1.5 + (((_a = type.params) === null || _a === void 0 ? void 0 : _a.phase) || 0);\n return (elapsed, duration) => {\n return 0.5 + Math.sin((elapsed * Math.PI * 2) / duration + phase) * 0.5;\n };\n }\n case 'elasticIn':\n case 'elasticOut':\n case 'elasticInOut': {\n const easing = Easings_1.Easings[type.type];\n const { amplitude, period } = type.params || {};\n return (elapsed, duration) => easing(elapsed, 0, 1, duration, amplitude, period);\n }\n case 'backIn':\n case 'backOut':\n case 'backInOut': {\n const easing = Easings_1.Easings[type.type];\n const overshoot = ((_b = type.params) === null || _b === void 0 ? void 0 : _b.overshoot) || undefined;\n return (elapsed, duration) => easing(elapsed, 0, 1, duration, overshoot);\n }\n case 'cubicBezier': {\n const easing = bezier_easing_1.default(type.params[0], type.params[1], type.params[2], type.params[3]);\n return (elapsed, duration) => easing(elapsed / duration);\n }\n }\n }\n return (elapsed, duration) => Easings_1.Easings.linear(elapsed, 0, 1, duration);\n}\nexports.createInterpolator = createInterpolator;\n//# sourceMappingURL=createInterpolator.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./conversions\"), exports);\n__exportStar(require(\"./parsing\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.rgbToHsl = exports.hslToRgb = exports.rgbToHex = void 0;\n/**\n * Convert rgb to hex\n *\n * @param r number between 0 - 255\n * @param g number between 0 - 255\n * @param b number between 0 - 255\n * @returns #ffffff\n */\nfunction rgbToHex(r, g, b) {\n return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;\n}\nexports.rgbToHex = rgbToHex;\n/**\n * Convert hsl (0-360, 0-100, 0-100) color to rgb(0-255, 0-255, 0-255)\n *\n * @param {number} h number between 0 - 360\n * @param {number} s number between 0 - 100\n * @param {number} l number between 0 - 100\n * @returns {[number, number, number]} [0-255, 0-255, 0-255]\n */\nfunction hslToRgb(h, s, l) {\n h /= 360;\n s /= 100;\n l /= 100;\n let r, g, b;\n if (s == 0) {\n r = g = b = l; // achromatic\n }\n else {\n const hue2rgb = (p, q, t) => {\n t += t < 0 ? 1 : t > 1 ? -1 : 0;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n };\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return [(0.5 + r * 255) << 0, (0.5 + g * 255) << 0, (0.5 + b * 255) << 0];\n}\nexports.hslToRgb = hslToRgb;\n/**\n * Convert rbg (0-255, 0-255, 0-255) to hsl (0-360, 0-100, 0-100)\n *\n * @param {number} r number between 0 - 255\n * @param {number} g number between 0 - 255\n * @param {number} b number between 0 - 255\n * @returns {[number, number, number]} (0-360, 0-100, 0-100)\n */\nfunction rgbToHsl(r, g, b) {\n r /= 255;\n g /= 255;\n b /= 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s;\n if (max === min) {\n h = s = 0;\n }\n else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h = h / 6;\n }\n return [(0.5 + h * 360) << 0, (0.5 + s * 100) << 0, (0.5 + l * 100) << 0];\n}\nexports.rgbToHsl = rgbToHsl;\n//# sourceMappingURL=conversions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseColor = exports.parseColorAndConvert = void 0;\nconst htmlcolors_1 = require(\"./htmlcolors\");\nconst conversions_1 = require(\"./conversions\");\n/**\n * Convert color to IConvertedColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IConvertedColor | undefined)}\n */\nfunction parseColorAndConvert(color) {\n const parsed = parseColor(color);\n if (parsed) {\n if (parsed.type === 'hsl') {\n const [r, g, b] = conversions_1.hslToRgb(parsed.a, parsed.b, parsed.c);\n return {\n r,\n g,\n b,\n h: parsed.a,\n s: parsed.b,\n l: parsed.c,\n alpha: parsed.alpha,\n };\n }\n else {\n const [h, s, l] = conversions_1.rgbToHsl(parsed.a, parsed.b, parsed.c);\n return {\n h,\n s,\n l,\n r: parsed.a,\n g: parsed.b,\n b: parsed.c,\n alpha: parsed.alpha,\n };\n }\n }\n}\nexports.parseColorAndConvert = parseColorAndConvert;\n/**\n * Convert color to IColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IColor | undefined)}\n */\nfunction parseColor(color) {\n if (typeof color === 'number') {\n if (color > 0xffffff) {\n return {\n type: 'rgb',\n a: (color >> 24) & 255,\n b: (color >> 16) & 255,\n c: (color >> 8) & 255,\n alpha: (color & 255) / 255,\n };\n }\n else {\n return { type: 'rgb', a: (color >> 16) & 255, b: (color >> 8) & 255, c: color & 255, alpha: 1 };\n }\n }\n color = color.replace(/\\s/g, '');\n if (htmlcolors_1.default[color])\n color = htmlcolors_1.default[color];\n let match = /^#([0-9a-f]{3,8})$/i.exec(color);\n if (match) {\n const hex = match[1];\n if (hex.length === 3) {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[0], 16),\n b: parseInt(hex[1] + hex[1], 16),\n c: parseInt(hex[2] + hex[2], 16),\n alpha: 1,\n };\n }\n else {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[1], 16),\n b: parseInt(hex[2] + hex[3], 16),\n c: parseInt(hex[4] + hex[5], 16),\n alpha: hex.length > 6 ? parseInt(hex.substring(6), 16) / 255 : 1,\n };\n }\n }\n match = /^((hsl|rgb)a?)\\((\\d+),(\\d+)%?,(\\d+)%?,?(.+)?\\)$/i.exec(color);\n if (match) {\n const [, , type, a, b, c, alpha] = match;\n return {\n type: type,\n a: +a,\n b: +b,\n c: +c,\n alpha: alpha ? +alpha : 1,\n };\n }\n}\nexports.parseColor = parseColor;\n//# sourceMappingURL=parsing.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst colors = {\n aliceblue: '#f0f8ff',\n antiquewhite: '#faebd7',\n aqua: '#00ffff',\n aquamarine: '#7fffd4',\n azure: '#f0ffff',\n beige: '#f5f5dc',\n bisque: '#ffe4c4',\n black: '#000000',\n blanchedalmond: '#ffebcd',\n blue: '#0000ff',\n blueviolet: '#8a2be2',\n brown: '#a52a2a',\n burlywood: '#deb887',\n cadetblue: '#5f9ea0',\n chartreuse: '#7fff00',\n chocolate: '#d2691e',\n coral: '#ff7f50',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyan: '#00ffff',\n darkblue: '#00008b',\n darkcyan: '#008b8b',\n darkgoldenrod: '#b8860b',\n darkgray: '#a9a9a9',\n darkgreen: '#006400',\n darkkhaki: '#bdb76b',\n darkmagenta: '#8b008b',\n darkolivegreen: '#556b2f',\n darkorange: '#ff8c00',\n darkorchid: '#9932cc',\n darkred: '#8b0000',\n darksalmon: '#e9967a',\n darkseagreen: '#8fbc8f',\n darkslateblue: '#483d8b',\n darkslategray: '#2f4f4f',\n darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n gold: '#ffd700',\n goldenrod: '#daa520',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n indianred: '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n lavender: '#e6e6fa',\n lavenderblush: '#fff0f5',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrodyellow: '#fafad2',\n lightgrey: '#d3d3d3',\n lightgreen: '#90ee90',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\n maroon: '#800000',\n mediumaquamarine: '#66cdaa',\n mediumblue: '#0000cd',\n mediumorchid: '#ba55d3',\n mediumpurple: '#9370d8',\n mediumseagreen: '#3cb371',\n mediumslateblue: '#7b68ee',\n mediumspringgreen: '#00fa9a',\n mediumturquoise: '#48d1cc',\n mediumvioletred: '#c71585',\n midnightblue: '#191970',\n mintcream: '#f5fffa',\n mistyrose: '#ffe4e1',\n moccasin: '#ffe4b5',\n navajowhite: '#ffdead',\n navy: '#000080',\n oldlace: '#fdf5e6',\n olive: '#808000',\n olivedrab: '#6b8e23',\n orange: '#ffa500',\n orangered: '#ff4500',\n orchid: '#da70d6',\n palegoldenrod: '#eee8aa',\n palegreen: '#98fb98',\n paleturquoise: '#afeeee',\n palevioletred: '#d87093',\n papayawhip: '#ffefd5',\n peachpuff: '#ffdab9',\n peru: '#cd853f',\n pink: '#ffc0cb',\n plum: '#dda0dd',\n powderblue: '#b0e0e6',\n purple: '#800080',\n rebeccapurple: '#663399',\n red: '#ff0000',\n rosybrown: '#bc8f8f',\n royalblue: '#4169e1',\n saddlebrown: '#8b4513',\n salmon: '#fa8072',\n sandybrown: '#f4a460',\n seagreen: '#2e8b57',\n seashell: '#fff5ee',\n sienna: '#a0522d',\n silver: '#c0c0c0',\n skyblue: '#87ceeb',\n slateblue: '#6a5acd',\n slategray: '#708090',\n snow: '#fffafa',\n springgreen: '#00ff7f',\n steelblue: '#4682b4',\n tan: '#d2b48c',\n teal: '#008080',\n thistle: '#d8bfd8',\n tomato: '#ff6347',\n turquoise: '#40e0d0',\n violet: '#ee82ee',\n wheat: '#f5deb3',\n white: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32',\n};\nexports.default = colors;\n//# sourceMappingURL=htmlcolors.js.map","/**\n * https://github.com/gre/bezier-easing\n * BezierEasing - use bezier curve for transition easing function\n * by Gaëtan Renaudeau 2014 - 2015 – MIT License\n */\n\n// These values are established by empiricism with tests (tradeoff: performance VS precision)\nvar NEWTON_ITERATIONS = 4;\nvar NEWTON_MIN_SLOPE = 0.001;\nvar SUBDIVISION_PRECISION = 0.0000001;\nvar SUBDIVISION_MAX_ITERATIONS = 10;\n\nvar kSplineTableSize = 11;\nvar kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\nvar float32ArraySupported = typeof Float32Array === 'function';\n\nfunction A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\nfunction B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\nfunction C (aA1) { return 3.0 * aA1; }\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nfunction calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }\n\n// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\nfunction getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); }\n\nfunction binarySubdivide (aX, aA, aB, mX1, mX2) {\n var currentX, currentT, i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n return currentT;\n}\n\nfunction newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {\n for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n if (currentSlope === 0.0) {\n return aGuessT;\n }\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n}\n\nfunction LinearEasing (x) {\n return x;\n}\n\nmodule.exports = function bezier (mX1, mY1, mX2, mY2) {\n if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {\n throw new Error('bezier x values must be in [0, 1] range');\n }\n\n if (mX1 === mY1 && mX2 === mY2) {\n return LinearEasing;\n }\n\n // Precompute samples table\n var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n for (var i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n\n function getTForX (aX) {\n var intervalStart = 0.0;\n var currentSample = 1;\n var lastSample = kSplineTableSize - 1;\n\n for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n --currentSample;\n\n // Interpolate to provide an initial guess for t\n var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n var guessForT = intervalStart + dist * kSampleStepSize;\n\n var initialSlope = getSlope(guessForT, mX1, mX2);\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if (initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n }\n\n return function BezierEasing (x) {\n // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n if (x === 0) {\n return 0;\n }\n if (x === 1) {\n return 1;\n }\n return calcBezier(getTForX(x), mY1, mY2);\n };\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Easings = void 0;\n/**\n * Easing functions\n *\n * @category Services.Animation\n */\nconst Easings = {\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n linear: (timeOrOffset, start, end, duration = 1) => (end * timeOrOffset) / duration + start,\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return -end * timeOrOffset * (timeOrOffset - 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset + start;\n timeOrOffset--;\n return (-end / 2) * (timeOrOffset * (timeOrOffset - 2) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * (timeOrOffset * timeOrOffset * timeOrOffset + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return -end * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (-end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset - 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalIn: (timeOrOffset, start, end, duration = 1) => {\n return -end * Math.cos((timeOrOffset / duration) * (Math.PI / 2)) + end + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalOut: (timeOrOffset, start, end, duration = 1) => {\n return end * Math.sin((timeOrOffset / duration) * (Math.PI / 2)) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalInOut: (timeOrOffset, start, end, duration = 1) => {\n return (-end / 2) * (Math.cos((Math.PI * timeOrOffset) / duration) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialIn: (timeOrOffset, start, end, duration = 1) => {\n return end * Math.pow(2, 10 * (timeOrOffset / duration - 1)) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialOut: (timeOrOffset, start, end, duration = 1) => {\n return end * (-Math.pow(2, (-10 * timeOrOffset) / duration) + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * Math.pow(2, 10 * (timeOrOffset - 1)) + start;\n timeOrOffset--;\n return (end / 2) * (-Math.pow(2, -10 * timeOrOffset) + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return -end * (Math.sqrt(1 - timeOrOffset * timeOrOffset) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * Math.sqrt(1 - timeOrOffset * timeOrOffset) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (-end / 2) * (Math.sqrt(1 - timeOrOffset * timeOrOffset) - 1) + start;\n timeOrOffset -= 2;\n return (end / 2) * (Math.sqrt(1 - timeOrOffset * timeOrOffset) + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticIn: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration) === 1) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n return (-(amplitude *\n Math.pow(2, 10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period)) + start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticOut: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration) === 1) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n return (amplitude * Math.pow(2, -10 * timeOrOffset) * Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period) +\n end +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticInOut: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration / 2) === 2) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n if (timeOrOffset < 1) {\n return (-0.5 *\n (amplitude *\n Math.pow(2, 10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period)) +\n start);\n }\n return (amplitude *\n Math.pow(2, -10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period) *\n 0.5 +\n end +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} overshoot (optional)\n * @return {number}\n */\n backIn: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n return end * (timeOrOffset /= duration) * timeOrOffset * ((overshoot + 1) * timeOrOffset - overshoot) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} s overshoot (optional)\n * @return {number}\n */\n backOut: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n return (end *\n ((timeOrOffset = timeOrOffset / duration - 1) * timeOrOffset * ((overshoot + 1) * timeOrOffset + overshoot) +\n 1) +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} overshoot (optional)\n * @return {number}\n */\n backInOut: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n if ((timeOrOffset /= duration / 2) < 1) {\n return (end / 2) * (timeOrOffset * timeOrOffset * (((overshoot *= 1.525) + 1) * timeOrOffset - overshoot)) + start;\n }\n return ((end / 2) * ((timeOrOffset -= 2) * timeOrOffset * (((overshoot *= 1.525) + 1) * timeOrOffset + overshoot) + 2) +\n start);\n },\n /**\n * @param {number} t current time\n * @param {number} b start value\n * @param {number} c end value\n * @param {number} d duration\n * @return {number}\n */\n bounceIn: (timeOrOffset, start, end, duration = 1) => {\n return end - Easings.bounceOut(duration - timeOrOffset, 0, end, duration) + start;\n },\n /**\n * @param {number} t current time\n * @param {number} b start value\n * @param {number} c end value\n * @param {number} d duration\n * @return {number}\n */\n bounceOut: (timeOrOffset, start, end, duration = 1) => {\n if ((timeOrOffset /= duration) < 1 / 2.75) {\n return end * (7.5625 * timeOrOffset * timeOrOffset) + start;\n }\n else if (timeOrOffset < 2 / 2.75) {\n return end * (7.5625 * (timeOrOffset -= 1.5 / 2.75) * timeOrOffset + 0.75) + start;\n }\n else if (timeOrOffset < 2.5 / 2.75) {\n return end * (7.5625 * (timeOrOffset -= 2.25 / 2.75) * timeOrOffset + 0.9375) + start;\n }\n return end * (7.5625 * (timeOrOffset -= 2.625 / 2.75) * timeOrOffset + 0.984375) + start;\n },\n /**\n *\n *\n * @param {number} time\n * @param {number} start\n * @param {number} end\n * @param {number} duration\n * @returns\n */\n bounceInOut: (timeOrOffset, start, end, duration = 1) => {\n if (timeOrOffset < duration / 2) {\n return Easings.bounceIn(timeOrOffset * 2, 0, end, duration) * 0.5 + start;\n }\n return Easings.bounceOut(timeOrOffset * 2 - duration, 0, end, duration) * 0.5 + end * 0.5 + start;\n },\n};\nexports.Easings = Easings;\n//# sourceMappingURL=Easings.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UncontrolledLoop = exports.Static = exports.Loop = exports.Compose = exports.Simple = exports.resolveSimpleAnimation = void 0;\nconst composeAnimations_1 = require(\"./composeAnimations\");\nconst createAnimation_1 = require(\"./createAnimation\");\nfunction resolveSimpleAnimation(simpleAnimation) {\n const animation = createAnimation_1.createAnimation(simpleAnimation);\n if (animation) {\n return (propArgumentsOrCurrentTime) => {\n var _a;\n const currentTime = typeof propArgumentsOrCurrentTime === 'number'\n ? propArgumentsOrCurrentTime\n : ((_a = propArgumentsOrCurrentTime.shape.scene) === null || _a === void 0 ? void 0 : _a.currentTime) || 0;\n animation.update(currentTime);\n return animation.value;\n };\n }\n}\nexports.resolveSimpleAnimation = resolveSimpleAnimation;\n// Alias\nexports.Simple = resolveSimpleAnimation;\n// Compose multiple animations\nconst Compose = (animations) => {\n const composed = composeAnimations_1.composeAnimations(animations);\n if (composed) {\n return (propArgumentsOrCurrentTime) => {\n var _a;\n const currentTime = typeof propArgumentsOrCurrentTime === 'number'\n ? propArgumentsOrCurrentTime\n : ((_a = propArgumentsOrCurrentTime.shape.scene) === null || _a === void 0 ? void 0 : _a.currentTime) || 0;\n return composed(currentTime);\n };\n }\n};\nexports.Compose = Compose;\nconst Loop = (loopAnimation) => {\n const simpleAnimation = loopAnimation;\n if (typeof simpleAnimation.interpolator === 'undefined') {\n simpleAnimation.interpolator = 'wave';\n }\n if (simpleAnimation.interpolator) {\n if (typeof simpleAnimation.interpolator === 'string') {\n if (simpleAnimation.interpolator !== 'wave') {\n simpleAnimation.direction = 'alternate';\n }\n }\n else if (typeof simpleAnimation.interpolator === 'object' && simpleAnimation.interpolator.type !== 'wave') {\n simpleAnimation.direction = 'alternate';\n }\n }\n simpleAnimation.loop = true;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.Loop = Loop;\nconst Static = (staticAnimation) => {\n const simpleAnimation = staticAnimation;\n simpleAnimation.direction = 'normal';\n simpleAnimation.loop = false;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.Static = Static;\nconst UncontrolledLoop = (uncontrolledLoopAnimation) => {\n const simpleAnimation = uncontrolledLoopAnimation;\n simpleAnimation.direction = 'normal';\n simpleAnimation.loop = true;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.UncontrolledLoop = UncontrolledLoop;\n//# sourceMappingURL=Animation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.composeAnimations = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst createAnimation_1 = require(\"./createAnimation\");\nconst utilities_1 = require(\"./utilities\");\n/**\n *\n *\n * @export\n * @param {Array} simpleAnimations\n * @return {*} {(((currentTime: number) => string | number | Array | undefined) | undefined)}\n */\nfunction composeAnimations(simpleAnimations) {\n const animations = simpleAnimations.map(createAnimation_1.createAnimation).filter(a => typeof a !== 'undefined');\n const animationsLength = animations.length;\n if (animationsLength > 0) {\n return (currentTime) => {\n let value = undefined;\n for (let i = 0; i < animationsLength; i++) {\n const animation = animations[i];\n animation.update(currentTime);\n value = typeof value === 'undefined' ? animation.value : interpolate(value, animation.value);\n }\n return value;\n };\n }\n}\nexports.composeAnimations = composeAnimations;\nfunction interpolate(a, b, offset = 0.5) {\n const from = Array.isArray(a) ? a : [a];\n const to = Array.isArray(b) ? b : [b];\n const results = [];\n for (let i = 0, len = from.length; i < len; i++) {\n if (typeof from[i] !== typeof to[i]) {\n console.error('[@urpflanze/animation]: cannot interpolate');\n return undefined;\n }\n else {\n if (typeof from[i] !== 'string') {\n const a = from[i], b = to[i];\n results.push(a + offset * (b - a));\n }\n else {\n const a = from[i];\n const b = to[i];\n const parsed_a = color_1.parseColorAndConvert(a);\n const parsed_b = color_1.parseColorAndConvert(b);\n if (typeof parsed_a !== 'undefined' && typeof parsed_b !== 'undefined') {\n results.push(utilities_1.interpolateColorRGB(parsed_a, parsed_b, offset));\n }\n }\n }\n }\n return results.length === 1 ? results[0] : results;\n}\n//# sourceMappingURL=composeAnimations.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BrowserDrawerCanvas = void 0;\nconst DrawerCanvas_1 = require(\"../DrawerCanvas\");\nconst utils_1 = require(\"../utils\");\n/**\n *\n * @category DrawerCanvas\n * @class BrowserDrawerCanvas\n * @extends {DrawerCanvas}\n */\nclass BrowserDrawerCanvas extends DrawerCanvas_1.DrawerCanvas {\n constructor(scene, canvasOrContainer, drawerOptions, duration = 60000, framerate = 60) {\n super(scene, canvasOrContainer, drawerOptions, duration, framerate);\n this.dpi = 1;\n this.dpi = (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.dpi) || 1;\n this.draw_id = null;\n this.redraw_id = null;\n this.animation_id = null;\n this.draw = this.draw.bind(this);\n this.animate = this.animate.bind(this);\n this.startAnimation = this.startAnimation.bind(this);\n this.resize(this.drawerOptions.width, this.drawerOptions.height);\n }\n resize(width, height, sceneFit, dpi = this.dpi) {\n this.drawerOptions.width = width * dpi;\n this.drawerOptions.height = height * dpi;\n if (this.canvas) {\n this.canvas.width = width * dpi;\n this.canvas.height = height * dpi;\n if (utils_1.bBrowser && this.canvas instanceof HTMLCanvasElement) {\n this.canvas.style.width = width + 'px';\n this.canvas.style.height = height + 'px';\n }\n }\n if (typeof sceneFit !== 'undefined') {\n this.drawerOptions.sceneFit = sceneFit;\n }\n this.dispatch('drawer-canvas:resize');\n }\n /**\n * Internal tick animation\n */\n animate(timestamp) {\n if (this.timeline.bSequenceStarted()) {\n this.animation_id = requestAnimationFrame(this.animate);\n if (this.timeline.tick(timestamp))\n this.draw();\n }\n }\n /**\n * Start animation drawing\n */\n startAnimation() {\n this.stopAnimation();\n this.timeline.start();\n this.animation_id = requestAnimationFrame(this.animate);\n }\n /**\n * Stop animation drawing\n */\n stopAnimation() {\n this.timeline.stop();\n if (this.animation_id)\n cancelAnimationFrame(this.animation_id);\n }\n /**\n * Pause animation drawing\n */\n pauseAnimation() {\n this.timeline.pause();\n if (this.animation_id)\n cancelAnimationFrame(this.animation_id);\n }\n /**\n * Play animation drawing\n */\n playAnimation() {\n this.timeline.start();\n requestAnimationFrame(this.animate);\n }\n redraw() {\n if (!this.timeline.bSequenceStarted()) {\n this.draw_id && cancelAnimationFrame(this.draw_id);\n if (typeof this.drawerOptions.ghosts === undefined || this.drawerOptions.ghosts === 0)\n this.timeline.stop();\n this.draw_id = requestAnimationFrame(this.draw);\n }\n else if (typeof this.drawerOptions.ghosts === undefined || this.drawerOptions.ghosts === 0) {\n this.stopAnimation();\n this.redraw_id && cancelAnimationFrame(this.redraw_id);\n this.redraw_id = requestAnimationFrame(this.startAnimation);\n }\n }\n}\nexports.BrowserDrawerCanvas = BrowserDrawerCanvas;\n//# sourceMappingURL=BrowserDrawerCanvas.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DrawerCanvas = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nconst math_1 = require(\"@urpflanze/core/dist/cjs/math\");\nconst Vec2_1 = require(\"@urpflanze/core/dist/cjs/math/Vec2\");\nconst canvas_1 = require(\"canvas\");\nconst Emitter_1 = require(\"./Emitter\");\nconst Timeline_1 = require(\"./Timeline\");\nconst utils_1 = require(\"./utils\");\n/**\n *\n * @category DrawerCanvas\n * @extends {Emitter}\n */\nclass DrawerCanvas extends Emitter_1.Emitter {\n constructor(scene, canvasOrContainer, drawerOptions, duration = 60000, framerate = 60) {\n var _a, _b, _c, _d, _e;\n super();\n this.drawerOptions = {\n width: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.width) || (scene === null || scene === void 0 ? void 0 : scene.width) || 400,\n height: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.height) || (scene === null || scene === void 0 ? void 0 : scene.height) || 400,\n clear: (_a = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.clear) !== null && _a !== void 0 ? _a : true,\n time: (_b = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.time) !== null && _b !== void 0 ? _b : 0,\n simmetricLines: (_c = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.simmetricLines) !== null && _c !== void 0 ? _c : 0,\n noBackground: (_d = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.noBackground) !== null && _d !== void 0 ? _d : false,\n ghosts: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghosts) || 0,\n ghostAlpha: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostAlpha) === false ? false : true,\n ghostSkipTime: (_e = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostSkipTime) !== null && _e !== void 0 ? _e : 30,\n ghostSkipFunction: drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostSkipFunction,\n sceneFit: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.sceneFit) || 'contain',\n backgroundImage: drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.backgroundImage,\n backgroundImageFit: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.backgroundImageFit) || 'cover',\n };\n this.timeline = new Timeline_1.Timeline(duration, framerate);\n this.timeline.setTime(this.drawerOptions.time);\n this.draw_id = null;\n this.redraw_id = null;\n this.animation_id = null;\n if (scene) {\n this.setScene(scene);\n }\n if (!utils_1.bWorker || (utils_1.bWorker && canvasOrContainer instanceof OffscreenCanvas))\n this.setCanvas(canvasOrContainer);\n }\n /**\n * Return option value or default\n *\n * @param {K keyof IDrawerCanvasOptions} name\n * @param {IDrawerCanvasOptions[K]} defaultValue\n */\n getOption(name, defaultValue) {\n var _a;\n return (_a = this.drawerOptions[name]) !== null && _a !== void 0 ? _a : defaultValue;\n }\n /**\n * Create instance of canvas (HTMLCanvasElement in browser o Canvas in Node)\n */\n setCanvas(canvasOrContainer) {\n if (utils_1.bWorker) {\n if (canvasOrContainer instanceof OffscreenCanvas) {\n this.canvas = canvasOrContainer;\n }\n else {\n console.error('Cannot set cavas');\n }\n }\n else {\n if (utils_1.bBrowser) {\n const canvas = canvas_1.createCanvas(this.drawerOptions.width, this.drawerOptions.height);\n if (canvasOrContainer instanceof HTMLElement &&\n !(canvasOrContainer instanceof HTMLCanvasElement || canvasOrContainer instanceof OffscreenCanvas)) {\n this.canvas = canvas;\n while (canvasOrContainer.lastChild)\n canvasOrContainer.removeChild(canvasOrContainer.lastChild);\n canvasOrContainer.appendChild(canvas);\n }\n else {\n this.canvas = typeof canvasOrContainer === 'undefined' ? canvas : canvasOrContainer;\n }\n }\n else {\n this.canvas = canvas_1.createCanvas(this.drawerOptions.width, this.drawerOptions.height);\n }\n }\n if (this.canvas) {\n this.canvas.width = this.drawerOptions.width;\n this.canvas.height = this.drawerOptions.height;\n this.context = this.canvas.getContext('2d', {\n alpha: true,\n // desynchronized: true,\n });\n }\n }\n /**\n * Return instance of canvas\n *\n * @returns canvas\n */\n getCanvas() {\n return this.canvas;\n }\n setScene(scene) {\n this.scene = scene;\n }\n draw() {\n if (this.context === null || typeof this.scene === 'undefined')\n return 0;\n const start_time = Utilities_1.now();\n const timeline = this.timeline;\n const drawAtTime = timeline.getTime();\n const drawerOptions = {\n ...this.drawerOptions,\n ghostIndex: undefined,\n clear: this.drawerOptions.clear || timeline.getCurrentFrame() <= 1,\n time: drawAtTime,\n };\n const currentFrame = timeline.getFrameAtTime(drawAtTime);\n this.dispatch('drawer-canvas:before_draw', {\n currentFrame: currentFrame,\n currentTime: drawAtTime,\n });\n if (drawerOptions.simmetricLines > 0) {\n if (drawerOptions.clear) {\n DrawerCanvas.clear(this.context, drawerOptions.width, drawerOptions.height, drawerOptions.noBackground ? false : this.scene.background, drawerOptions.backgroundImage, drawerOptions.backgroundImageFit);\n }\n DrawerCanvas.drawSimmetricLines(this.context, drawerOptions.simmetricLines, drawerOptions.width, drawerOptions.height, this.scene.color);\n drawerOptions.clear = false;\n }\n if (drawerOptions.ghosts) {\n const ghostDrawerOptions = {\n ...drawerOptions,\n };\n const drawAtTime = timeline.getTime();\n const sequenceDuration = timeline.getDuration();\n const ghostRepetition = {\n offset: 0,\n index: 0,\n count: drawerOptions.ghosts,\n };\n for (let i = 1; i <= drawerOptions.ghosts; i++) {\n ghostRepetition.index = i;\n ghostRepetition.offset = ghostRepetition.index / ghostRepetition.count;\n const ghostTime = drawAtTime -\n (drawerOptions.ghostSkipFunction\n ? drawerOptions.ghostSkipFunction(ghostRepetition, drawAtTime)\n : i * drawerOptions.ghostSkipTime);\n ghostDrawerOptions.ghostIndex = i;\n ghostDrawerOptions.time = math_1.mod(ghostTime, sequenceDuration);\n ghostDrawerOptions.clear = drawerOptions.clear && ghostDrawerOptions.ghostIndex === 1;\n this.realDraw(ghostDrawerOptions);\n }\n drawerOptions.clear = false;\n }\n this.realDraw(drawerOptions);\n return Utilities_1.now() - start_time;\n }\n realDraw(options) {\n var _a;\n const width = this.drawerOptions.width;\n const height = this.drawerOptions.height;\n const context = this.context;\n const scene = this.scene;\n const time = (_a = options.time) !== null && _a !== void 0 ? _a : 0;\n const bGhost = typeof options.ghosts !== 'undefined' &&\n options.ghosts > 0 &&\n typeof options.ghostIndex !== 'undefined' &&\n options.ghostIndex > 0;\n const ghostMultiplier = bGhost ? 1 - options.ghostIndex / (options.ghosts + 0.5) : 0;\n const ghostAlpha = options.ghostAlpha === true;\n const sceneFit = utils_1.fit(scene.width, scene.height, width, height, this.drawerOptions.sceneFit);\n const translateX = sceneFit.x;\n const translateY = sceneFit.y;\n options.clear &&\n DrawerCanvas.clear(context, width, height, options.noBackground ? false : scene.background, options.backgroundImage, options.backgroundImageFit);\n let logFillColorWarn = false;\n let logStrokeColorWarn = false;\n scene.currentTime = time;\n const sceneChilds = scene.getChildren();\n for (let i = 0, len = sceneChilds.length; i < len; i++) {\n const sceneChild = sceneChilds[i];\n if (!sceneChild.data ||\n (!(sceneChild.data.visible === false) && !(bGhost && sceneChild.data.disableGhost === true))) {\n sceneChilds[i].generate(time, true);\n const childIndexedBuffer = sceneChilds[i].getIndexedBuffer() || [];\n const childBuffer = sceneChilds[i].getBuffer() || [];\n let childVertexIndex = 0;\n for (let currentBufferIndex = 0, len = childIndexedBuffer.length; currentBufferIndex < len; currentBufferIndex++) {\n const currentIndexing = childIndexedBuffer[currentBufferIndex];\n const shape = currentIndexing.shape;\n const propArguments = {\n canvasContext: context,\n ...currentIndexing,\n };\n const composite = DrawerCanvas.getStreamDrawerProp(shape, 'composite', propArguments, 'source-over');\n context.globalCompositeOperation = composite;\n context.beginPath();\n context.moveTo(childBuffer[childVertexIndex] * sceneFit.scale + translateX, childBuffer[childVertexIndex + 1] * sceneFit.scale + translateY);\n childVertexIndex += 2;\n for (let currentFrameLength = childVertexIndex + currentIndexing.frameLength - 2; childVertexIndex < currentFrameLength; childVertexIndex += 2)\n context.lineTo(childBuffer[childVertexIndex] * sceneFit.scale + translateX, childBuffer[childVertexIndex + 1] * sceneFit.scale + translateY);\n if (shape.isClosed())\n context.closePath();\n const alpha = DrawerCanvas.getStreamDrawerProp(shape, 'opacity', propArguments, 1);\n context.globalAlpha = alpha;\n const shadowColor = DrawerCanvas.getStreamDrawerProp(shape, 'shadowColor', propArguments);\n const shadowBlur = DrawerCanvas.getStreamDrawerProp(shape, 'shadowBlur', propArguments);\n const shadowOffsetX = DrawerCanvas.getStreamDrawerProp(shape, 'shadowOffsetX', propArguments);\n const shadowOffsetY = DrawerCanvas.getStreamDrawerProp(shape, 'shadowOffsetY', propArguments);\n context.shadowColor = shadowColor;\n context.shadowBlur = shadowBlur;\n shadowOffsetX && (context.shadowOffsetX = shadowOffsetX);\n shadowOffsetY && (context.shadowOffsetY = shadowOffsetY);\n let fill = DrawerCanvas.getStreamDrawerProp(shape, 'fill', propArguments);\n if (typeof fill !== 'undefined') {\n if (bGhost && ghostAlpha) {\n const color = DrawerCanvas.ghostifyColor(fill, ghostMultiplier);\n if (color) {\n fill = color;\n }\n else if (!logFillColorWarn) {\n console.warn(`[Urpflanze:DrawerCanvas] Unable ghost fill color '${fill}',\n\t\t\t\t\t\t\t\tplease enter a rgba or hsla color`);\n logFillColorWarn = true;\n }\n }\n context.fillStyle = fill;\n context.fill();\n }\n let stroke = DrawerCanvas.getStreamDrawerProp(shape, 'stroke', propArguments, typeof fill === 'undefined' ? scene.color : undefined);\n let lineWidth = DrawerCanvas.getStreamDrawerProp(shape, 'lineWidth', propArguments, 1);\n if (stroke) {\n if (bGhost && ghostAlpha) {\n const color = DrawerCanvas.ghostifyColor(stroke, ghostMultiplier);\n if (color) {\n stroke = color;\n }\n else if (!logStrokeColorWarn) {\n console.warn(`[Urpflanze:DrawerCanvas] Unable ghost stroke color '${stroke}',\n\t\t\t\t\t\t\t\tplease enter a rgba or hsla color`);\n logStrokeColorWarn = true;\n }\n lineWidth *= ghostMultiplier;\n }\n const lineJoin = DrawerCanvas.getStreamDrawerProp(shape, 'lineJoin', propArguments);\n const lineCap = DrawerCanvas.getStreamDrawerProp(shape, 'lineCap', propArguments);\n const lineDash = DrawerCanvas.getStreamDrawerProp(shape, 'lineDash', propArguments);\n const lineDashOffset = DrawerCanvas.getStreamDrawerProp(shape, 'lineDashOffset', propArguments);\n const miterLimit = DrawerCanvas.getStreamDrawerProp(shape, 'miterLimit', propArguments);\n context.setLineDash.call(context, lineDash || []);\n context.lineJoin = lineJoin;\n context.lineCap = lineCap;\n context.lineDashOffset = lineDashOffset;\n context.miterLimit = miterLimit;\n context.lineWidth = lineWidth * sceneFit.scale;\n context.strokeStyle = stroke;\n context.stroke();\n }\n }\n context.restore();\n }\n }\n }\n /**\n * Return a drawer value\n *\n * @static\n * @template T\n * @param {ShapePrimitive} shape\n * @param {keyof T} key\n * @param {IDrawerPropArguments} propArguments\n * @param {*} [defaultValue]\n * @returns {*}\n */\n static getStreamDrawerProp(shape, key, propArguments, defaultValue) {\n let attribute = shape.drawer[key];\n if (typeof attribute === 'function') {\n attribute = attribute(propArguments);\n }\n return attribute !== null && attribute !== void 0 ? attribute : defaultValue;\n }\n /**\n * Create color based on ghostMultiplier\n *\n * @static\n * @param {any} color\n * @param {number} ghostMultiplier\n * @return {*} {(string | undefined)}\n */\n static ghostifyColor(color, ghostMultiplier) {\n if (typeof color === 'string' || typeof color === 'number') {\n const parsed = color_1.parseColor(color);\n if (parsed) {\n const ghostAlpha = parsed.alpha * ghostMultiplier;\n return parsed.type === 'rgb'\n ? `rgba(${parsed.a},${parsed.b},${parsed.c},${ghostAlpha})`\n : `hsla(${parsed.a},${parsed.b}%,${parsed.c}%,${ghostAlpha})`;\n }\n }\n return color;\n }\n /**\n * Clear canvas, draw background or image (and fit)\n *\n * @param context\n * @param width\n * @param height\n * @param background\n * @param backgroundImage\n * @param backgroundImageFit\n */\n static clear(context, width, height, background, backgroundImage, backgroundImageFit) {\n if (typeof background === 'boolean' && background === false) {\n context.clearRect(0, 0, width, height);\n }\n else {\n context.globalCompositeOperation = 'source-over';\n context.fillStyle = background; // or true\n context.fillRect(0, 0, width, height);\n if (backgroundImage) {\n const sourceWidth = backgroundImage instanceof SVGImageElement ? backgroundImage.width.baseVal.value : backgroundImage.width;\n const sourceHeight = backgroundImage instanceof SVGImageElement ? backgroundImage.height.baseVal.value : backgroundImage.height;\n const fitRect = utils_1.fit(sourceWidth, sourceHeight, width, height, backgroundImageFit);\n context.drawImage(backgroundImage, fitRect.x, fitRect.y, fitRect.width, fitRect.height);\n }\n }\n }\n /**\n * Draw utility lines\n *\n * @param context\n * @param simmetricLines\n * @param width\n * @param height\n * @param color\n */\n static drawSimmetricLines(context, simmetricLines, width, height, color) {\n const offset = Math.PI / simmetricLines;\n const size = Math.max(width, height);\n const sizeMin = Math.min(width, height);\n const k = width < height ? 1 : 0;\n const centerX = [size / 2, size / 2];\n const centerY = [sizeMin / 2, sizeMin / 2];\n for (let i = 0; i < simmetricLines; i++) {\n const a = [-size, -size];\n const b = [size * 2, size * 2];\n const rotate = i * offset + Math.PI / 4;\n Vec2_1.default.rotateZ(a, i % 2 === k ? centerX : centerY, rotate);\n Vec2_1.default.rotateZ(b, i % 2 === k ? centerX : centerY, rotate);\n context.beginPath();\n context.strokeStyle = color;\n context.lineWidth = 1;\n context.moveTo(a[0], a[1]);\n context.lineTo(b[0], b[1]);\n context.stroke();\n }\n }\n}\nexports.DrawerCanvas = DrawerCanvas;\n// const sourceRatio = sourceWidth / sourceHeight\n// let x = 0,\n// \ty = 0,\n// \tbgWidth = width,\n// \tbgHeight = height\n// if (sourceRatio !== ratio) {\n// \tif (options.backgroundImageFit === 'contain') {\n// \t\tbgWidth = ratio > sourceRatio ? (sourceWidth * height) / sourceHeight : width\n// \t\tbgHeight = ratio > sourceRatio ? height : (sourceHeight * width) / sourceWidth\n// \t} else {\n// \t\tbgWidth = ratio < sourceRatio ? (sourceWidth * height) / sourceHeight : width\n// \t\tbgHeight = ratio < sourceRatio ? height : (sourceHeight * width) / sourceWidth\n// \t}\n// \tx = (width - bgWidth) / 2\n// \ty = (height - bgHeight) / 2\n//# sourceMappingURL=DrawerCanvas.js.map","/* globals document, ImageData */\n\nconst parseFont = require('./lib/parse-font')\n\nexports.parseFont = parseFont\n\nexports.createCanvas = function (width, height) {\n return Object.assign(document.createElement('canvas'), { width: width, height: height })\n}\n\nexports.createImageData = function (array, width, height) {\n // Browser implementation of ImageData looks at the number of arguments passed\n switch (arguments.length) {\n case 0: return new ImageData()\n case 1: return new ImageData(array)\n case 2: return new ImageData(array, width)\n default: return new ImageData(array, width, height)\n }\n}\n\nexports.loadImage = function (src, options) {\n return new Promise(function (resolve, reject) {\n const image = Object.assign(document.createElement('img'), options)\n\n function cleanup () {\n image.onload = null\n image.onerror = null\n }\n\n image.onload = function () { cleanup(); resolve(image) }\n image.onerror = function () { cleanup(); reject(new Error('Failed to load the image \"' + src + '\"')) }\n\n image.src = src\n })\n}\n","'use strict'\n\n/**\n * Font RegExp helpers.\n */\n\nconst weights = 'bold|bolder|lighter|[1-9]00'\n , styles = 'italic|oblique'\n , variants = 'small-caps'\n , stretches = 'ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded'\n , units = 'px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q'\n , string = '\\'([^\\']+)\\'|\"([^\"]+)\"|[\\\\w\\\\s-]+'\n\n// [ [ <‘font-style’> || || <‘font-weight’> || <‘font-stretch’> ]?\n// <‘font-size’> [ / <‘line-height’> ]? <‘font-family’> ]\n// https://drafts.csswg.org/css-fonts-3/#font-prop\nconst weightRe = new RegExp('(' + weights + ') +', 'i')\nconst styleRe = new RegExp('(' + styles + ') +', 'i')\nconst variantRe = new RegExp('(' + variants + ') +', 'i')\nconst stretchRe = new RegExp('(' + stretches + ') +', 'i')\nconst sizeFamilyRe = new RegExp(\n '([\\\\d\\\\.]+)(' + units + ') *'\n + '((?:' + string + ')( *, *(?:' + string + '))*)')\n\n/**\n * Cache font parsing.\n */\n\nconst cache = {}\n\nconst defaultHeight = 16 // pt, common browser default\n\n/**\n * Parse font `str`.\n *\n * @param {String} str\n * @return {Object} Parsed font. `size` is in device units. `unit` is the unit\n * appearing in the input string.\n * @api private\n */\n\nmodule.exports = function (str) {\n // Cached\n if (cache[str]) return cache[str]\n\n // Try for required properties first.\n const sizeFamily = sizeFamilyRe.exec(str)\n if (!sizeFamily) return // invalid\n\n // Default values and required properties\n const font = {\n weight: 'normal',\n style: 'normal',\n stretch: 'normal',\n variant: 'normal',\n size: parseFloat(sizeFamily[1]),\n unit: sizeFamily[2],\n family: sizeFamily[3].replace(/[\"']/g, '').replace(/ *, */g, ',')\n }\n\n // Optional, unordered properties.\n let weight, style, variant, stretch\n // Stop search at `sizeFamily.index`\n let substr = str.substring(0, sizeFamily.index)\n if ((weight = weightRe.exec(substr))) font.weight = weight[1]\n if ((style = styleRe.exec(substr))) font.style = style[1]\n if ((variant = variantRe.exec(substr))) font.variant = variant[1]\n if ((stretch = stretchRe.exec(substr))) font.stretch = stretch[1]\n\n // Convert to device units. (`font.unit` is the original unit)\n // TODO: ch, ex\n switch (font.unit) {\n case 'pt':\n font.size /= 0.75\n break\n case 'pc':\n font.size *= 16\n break\n case 'in':\n font.size *= 96\n break\n case 'cm':\n font.size *= 96.0 / 2.54\n break\n case 'mm':\n font.size *= 96.0 / 25.4\n break\n case '%':\n // TODO disabled because existing unit tests assume 100\n // font.size *= defaultHeight / 100 / 0.75\n break\n case 'em':\n case 'rem':\n font.size *= defaultHeight / 0.75\n break\n case 'q':\n font.size *= 96 / 25.4 / 4\n break\n }\n\n return (cache[str] = font)\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Emitter = void 0;\n/**\n * Class used for emit and dispatch events\n *\n * @category Emitter\n * @abstract\n * @class Emitter\n * @template EventTypes\n */\nclass Emitter {\n constructor() {\n this.callbacks = {};\n }\n /**\n * Attach callback at event\n *\n * @param {keyof EventTypes} e\n * @param {(value: EventTypes[keyof EventTypes]) => any} callback\n * @memberof Emitter\n */\n attach(e, callback) {\n if (!(e in this.callbacks)) {\n this.callbacks[e] = [];\n }\n this.callbacks[e].push(callback);\n }\n /**\n * Remove callbach listener at event\n *\n * @param {keyof EventTypes} e\n * @param {(value: EventTypes[keyof EventTypes]) => void} callback\n * @memberof Emitter\n */\n detach(e, callback) {\n if (e in this.callbacks) {\n const index = this.callbacks[e].indexOf(callback);\n if (index >= 0) {\n this.callbacks[e].splice(index, 1);\n }\n }\n }\n /**\n * Dispatch event\n *\n * @param {keyof EventTypes} e\n * @param {EventTypes[keyof EventTypes]} [params]\n * @memberof Emitter\n */\n dispatch(e, params) {\n if (e in this.callbacks && this.callbacks[e].length > 0) {\n for (let i = 0, len = this.callbacks[e].length; i < len; i++)\n if (this.callbacks[e][i](params) === false)\n break;\n }\n }\n}\nexports.Emitter = Emitter;\n//# sourceMappingURL=Emitter.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Timeline = void 0;\nconst Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nconst math_1 = require(\"@urpflanze/core/dist/cjs/math\");\nconst Emitter_1 = require(\"./Emitter\");\n/**\n * Is used for sequence time management.\n * It is necessary to set the duration and the number of frames per second (frame rate).\n *\n * @category Timeline\n * @class Timeline\n * @extends {Emitter}\n */\nclass Timeline extends Emitter_1.Emitter {\n constructor(duration = 60000, framerate = 30) {\n super();\n this.fps_samples_size = 30;\n this.fps_samples = [];\n this.fps_samples_index = 0;\n this.paused_time = 0;\n this.sequence = {\n duration,\n framerate,\n frames: Math.round((duration / 1000) * framerate),\n };\n this.tick_time = 1000 / this.sequence.framerate;\n this.fps = this.sequence.framerate;\n this.b_sequence_started = false;\n this.currentFrame = 0;\n this.currentTime = 0;\n this.last_tick = 0;\n this.start_time = 0;\n }\n //#region sequence meta\n /**\n * Return the sequence\n *\n * @returns {Sequence}\n */\n getSequence() {\n return { ...this.sequence };\n }\n /**\n * Set Sequence\n *\n * @param {number} duration in ms\n * @param {number} framerate\n * @param {number} atTime\n */\n setSequence(duration, framerate, atTime) {\n this.sequence.duration = duration;\n this.sequence.framerate = framerate;\n this.tick_time = 1000 / this.sequence.framerate;\n this.sequence.frames = Math.round((this.sequence.duration / 1000) * this.sequence.framerate);\n if (typeof atTime !== 'undefined') {\n this.setTime(atTime);\n }\n else {\n this.dispatch('timeline:update_sequence', this.getSequence());\n }\n }\n /**\n * Set duration of timeline\n *\n * @param {number} framerate\n */\n setDuration(duration) {\n this.setSequence(duration, this.sequence.framerate);\n }\n /**\n * Get timeline duration\n *\n * @returns {number}\n */\n getDuration() {\n return this.sequence.duration;\n }\n /**\n * Return framerate\n *\n * @returns {number}\n */\n getFramerate() {\n return this.sequence.framerate;\n }\n /**\n * Set a framerate\n *\n * @param {number} framerate\n */\n setFramerate(framerate) {\n this.setSequence(this.sequence.duration, framerate);\n }\n /**\n * Get number of frames based on duration and framerate\n *\n * @returns {number}\n */\n getFramesCount() {\n return this.sequence.frames;\n }\n //#endregion meta\n //#region change status\n bSequenceStarted() {\n return this.b_sequence_started;\n }\n /**\n * Start the sequence\n *\n */\n start() {\n if (!this.b_sequence_started) {\n this.b_sequence_started = true;\n this.start_time = this.paused_time;\n this.dispatch('timeline:change_status', Timeline.START);\n }\n }\n /**\n * Pause the sequence\n *\n */\n pause() {\n if (this.b_sequence_started) {\n this.paused_time = Utilities_1.now();\n this.b_sequence_started = false;\n this.dispatch('timeline:change_status', Timeline.PAUSE);\n }\n }\n /**\n * Stop the sequence and reset\n *\n */\n stop() {\n if (this.b_sequence_started) {\n this.b_sequence_started = false;\n this.currentTime = 0;\n this.currentFrame = 0;\n this.start_time = 0;\n this.paused_time = 0;\n this.dispatch('timeline:change_status', Timeline.STOP);\n }\n }\n /**\n * Animation tick\n *\n * @param {number} timestamp current timestamp\n * @returns {boolean}\n */\n tick(timestamp) {\n if (this.b_sequence_started) {\n if (!this.start_time) {\n this.start_time = timestamp;\n this.last_tick = -this.tick_time;\n }\n const currentTime = timestamp - this.start_time;\n const elapsed = currentTime - this.last_tick;\n if (elapsed >= this.tick_time) {\n this.calculateFPS(1 / (elapsed / 1000));\n this.last_tick = currentTime;\n this.currentTime = (currentTime - (elapsed % this.tick_time)) % this.sequence.duration;\n this.currentFrame = this.getFrameAtTime(this.currentTime);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n return true;\n }\n }\n return false;\n }\n /**\n * Calculate fps\n *\n * @private\n * @param {number} currentFPS\n */\n calculateFPS(currentFPS) {\n const samples = this.fps_samples.length;\n if (samples > 0) {\n let average = 0;\n for (let i = 0; i < samples; i++)\n average += this.fps_samples[i];\n this.fps = Math.round(average / samples);\n }\n this.fps_samples[this.fps_samples_index] = Math.round(currentFPS);\n this.fps_samples_index = (this.fps_samples_index + 1) % this.fps_samples_size;\n }\n //#endregion\n //#region Frame and Time\n /**\n * Return current animation frame\n *\n * @returns {number}\n */\n getCurrentFrame() {\n return this.currentFrame;\n }\n /**\n * get the time at specific frame number\n *\n * @param {number} frame\n * @returns {number}\n */\n getFrameTime(frame) {\n frame = math_1.mod(frame, this.sequence.frames);\n return (frame * this.tick_time) % this.sequence.duration;\n }\n /**\n * Return frame number at time\n *\n * @param {number} time\n * @returns {number}\n */\n getFrameAtTime(time) {\n return Math.round((time % this.sequence.duration) / this.tick_time);\n }\n /**\n * set current frame\n *\n * @param {number} frame\n */\n setFrame(frame) {\n this.currentFrame = math_1.mod(frame, this.sequence.frames);\n this.currentTime = this.getFrameTime(this.currentFrame);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n }\n /**\n * Return tick time (based on framerate)\n *\n * @returns {number}\n */\n getTickTime() {\n return this.tick_time;\n }\n /**\n * Return the current time\n *\n * @returns {number}\n */\n getTime() {\n return this.currentTime;\n }\n /**\n * Set animation at time\n *\n * @param {number} time\n */\n setTime(time) {\n time = math_1.mod(time, this.sequence.duration);\n this.currentTime = time;\n this.currentFrame = this.getFrameAtTime(time);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n }\n}\nexports.Timeline = Timeline;\n/**\n * Animation status started\n * @internal\n */\nTimeline.START = 'start';\n/**\n * Animation status paused\n * @internal\n */\nTimeline.PAUSE = 'pause';\n/**\n * Animation status stop\n * @internal\n */\nTimeline.STOP = 'stop';\n//# sourceMappingURL=Timeline.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fit = exports.bWorker = exports.bBrowser = exports.bNode = void 0;\nexports.bNode = typeof process !== 'undefined' &&\n typeof process.versions !== 'undefined' &&\n typeof process.versions.node !== 'undefined';\nexports.bBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';\nexports.bWorker = typeof self === 'object' && ['ServiceWorkerGlobalScope', 'DedicatedWorkerGlobalScope'].includes(self.constructor.name);\n/**\n * Utiltites\n *\n * @category Utilities\n * @export\n * @param {number} sourceWidth\n * @param {number} sourceHeight\n * @param {number} destWidth\n * @param {number} destHeight\n * @param {('cover' | 'contain' | 'none')} [fit='none']\n * @return {*} {{ x: number; y: number; width: number; height: number; scale: number }}\n */\nfunction fit(sourceWidth, sourceHeight, destWidth, destHeight, fit = 'none') {\n let x = 0, y = 0, scale = 1, finalWidth = sourceWidth, finalHeight = sourceHeight;\n const ratio = destWidth / destHeight;\n const sourceRatio = sourceWidth / sourceHeight;\n if (fit === 'contain') {\n finalWidth = ratio > sourceRatio ? (sourceWidth * destHeight) / sourceHeight : destWidth;\n finalHeight = ratio > sourceRatio ? destHeight : (sourceHeight * destWidth) / sourceWidth;\n scale = Math.max(finalWidth, finalHeight) / Math.max(sourceWidth, sourceHeight);\n }\n else if (fit === 'cover') {\n finalWidth = ratio < sourceRatio ? (sourceWidth * destHeight) / sourceHeight : destWidth;\n finalHeight = ratio < sourceRatio ? destHeight : (sourceHeight * destWidth) / sourceWidth;\n // scale = Math.min(sourceWidth, sourceHeight) / Math.min(finalWidth, finalHeight)\n scale = Math.max(finalWidth, finalHeight) / Math.max(sourceWidth, sourceHeight);\n }\n else {\n // finalWidth = sourceWidth\n // finalHeight = sourceHeight\n }\n x = (destWidth - finalWidth) / 2;\n y = (destHeight - finalHeight) / 2;\n return {\n x,\n y,\n width: finalWidth,\n height: finalHeight,\n scale,\n };\n}\nexports.fit = fit;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./Timeline\"), exports);\n__exportStar(require(\"./DrawerCanvas\"), exports);\n__exportStar(require(\"./browser/BrowserDrawerCanvas\"), exports);\n__exportStar(require(\"./Renderer\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Renderer = void 0;\nconst ffmpeg_1 = require(\"@ffmpeg/ffmpeg\");\nconst Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nconst JSZip = require(\"jszip\");\nconst browser_1 = require(\"./browser\");\nconst Emitter_1 = require(\"./Emitter\");\nconst utils_1 = require(\"./utils\");\n/**\n * The Renderer is a class for exporting the scene\n *\n * @category Renderer\n * @class Renderer\n * @extends {Emitter}\n */\nclass Renderer extends Emitter_1.Emitter {\n constructor(drawer, ffmpegCorePath) {\n super();\n this.drawer = drawer;\n this.ffmpegCorePath =\n typeof ffmpegCorePath === 'undefined' && drawer instanceof browser_1.default\n ? 'https://unpkg.com/@ffmpeg/core@0.10.0/dist/ffmpeg-core.js'\n : ffmpegCorePath;\n }\n /**\n * Render any frame and create array of zip\n *\n * @param imagesType\n * @param quality\n * @param framesForChunk\n * @returns\n */\n async zip(imagesType = 'image/png', quality = 1, framesForChunk = 600) {\n const startTime = Utilities_1.now();\n const zip = new JSZip();\n const totalFrames = this.drawer.timeline.getFramesCount();\n const chunks = Math.ceil(totalFrames / framesForChunk);\n this.dispatch('renderer:zip_start', { chunks, totalFrames, framesForChunk });\n const extension = imagesType === 'image/jpeg' ? '.jpg' : '.png';\n const zipParts = [];\n let totalRenderTime = 0;\n for (let chunk = 0, rendered = 1; chunk < chunks; chunk++) {\n for (let frameIndex = 0; frameIndex < framesForChunk; frameIndex++, rendered++) {\n const frame = frameIndex + chunk * framesForChunk;\n if (frame < totalFrames) {\n const renderStartTime = Utilities_1.now();\n const frameName = frame.toString().padStart(5, '0') + extension;\n const blob = await this.frame(frame, imagesType, quality);\n const buffer = (await (utils_1.bNode ? blob : blob.arrayBuffer()));\n zip.file(frameName, new Uint8Array(buffer, 0, buffer.byteLength));\n const currentTime = Utilities_1.now();\n const renderTime = currentTime - renderStartTime;\n totalRenderTime += renderTime;\n this.dispatch('renderer:zip_progress', {\n chunk: chunk + 1,\n frame: frame + 1,\n totalFrames,\n framesForChunk,\n totalChunks: chunks,\n renderTime,\n remainingTime: (totalFrames - rendered) * (totalRenderTime / rendered),\n elapsedTime: currentTime - startTime,\n });\n }\n }\n this.dispatch('renderer:zip_preparing');\n zipParts.push(await zip.generateAsync({ type: 'uint8array' }));\n }\n return zipParts;\n }\n /**\n * Render animation\n *\n * @param type render type\n * @param quality\n * @param ffmpegLogger\n * @param ffmpegProgress\n * @returns\n */\n async render(type = 'video/mp4', quality = 1, ffmpegLogger, ffmpegProgress) {\n const startTime = Utilities_1.now();\n const totalFrames = this.drawer.timeline.getFramesCount();\n const framerate = this.drawer.timeline.getFramerate();\n const duration = this.drawer.timeline.getDuration();\n this.dispatch('renderer:video_init', { totalFrames, framerate, duration, type });\n if (!this.ffmpeg) {\n const ffmpegOptions = {\n log: false,\n };\n if (this.ffmpegCorePath)\n ffmpegOptions.corePath = this.ffmpegCorePath;\n if (ffmpegLogger)\n ffmpegOptions.logger = ffmpegLogger;\n if (ffmpegProgress)\n ffmpegOptions.progress = ffmpegProgress;\n this.ffmpeg = ffmpeg_1.createFFmpeg(ffmpegOptions);\n await this.ffmpeg.load();\n }\n let totalRenderTime = 0;\n this.dispatch('renderer:video_start', { totalFrames, framerate, duration, type });\n for (let frame = 0; frame < totalFrames; frame++) {\n const renderStartTime = Utilities_1.now();\n const blob = await this.frame(frame, 'image/jpeg', quality);\n const buffer = (await (utils_1.bNode ? blob : blob.arrayBuffer()));\n const frameName = frame.toString().padStart(5, '0') + '.jpg';\n this.ffmpeg.FS('writeFile', frameName, new Uint8Array(buffer, 0, buffer.byteLength));\n const currentTime = Utilities_1.now();\n const renderTime = currentTime - renderStartTime;\n totalRenderTime += renderTime;\n this.dispatch('renderer:video_progress', {\n totalFrames,\n frame: frame + 1,\n renderTime,\n duration,\n remainingTime: (totalFrames - frame) * (totalRenderTime / (frame + 1)),\n elapsedTime: currentTime - startTime,\n });\n }\n const args = ['-r', framerate.toString(), '-i', '%05d.jpg'];\n let outExt = 'mp4';\n switch (type) {\n case 'video/webm':\n args.push('-c:v', 'libvpx');\n args.push('-row-mt', '1');\n args.push('-pix_fmt', 'yuv420p');\n outExt = 'webm';\n break;\n case 'video/mp4':\n args.push('-c:v', 'libx264');\n args.push('-pix_fmt', 'yuv420p');\n outExt = 'mp4';\n break;\n case 'gif':\n args.push('-loop', '0');\n outExt = 'gif';\n break;\n }\n const outName = 'out.' + outExt;\n args.push(outName);\n this.dispatch('renderer:video_preparing');\n await this.ffmpeg.run(...args);\n const result = await this.ffmpeg.FS('readFile', outName);\n return result;\n }\n /**\n * Render frame `frameNumber` to Blob or Buffer\n *\n * @param frameNumber frame to render\n * @param mime image type\n * @param options quality or options\n * @returns Promise of Blob for browser or Buffer for Node\n */\n frame(frameNumber, mime = 'image/png', options = 1) {\n if (!this.drawer.getOption('clear', true)) {\n for (let i = 0; i <= frameNumber; i++) {\n this.drawer.timeline.setFrame(i);\n this.drawer.draw();\n }\n }\n else {\n this.drawer.timeline.setFrame(frameNumber);\n this.drawer.draw();\n }\n return this.blobOrBuffer(mime, options);\n }\n /**\n * Render frame at time to Blob or Buffer\n *\n * @param time animation time\n * @param mime image type\n * @param options quality or options\n * @returns Promise of Blob for browser or Buffer for Node\n */\n frameAtTime(time, mime = 'image/png', options = 1) {\n return this.frame(this.drawer.timeline.getFrameAtTime(time), mime, options);\n }\n /**\n * Render frame number to DataUrl\n *\n * @param frameNumber frame to render\n * @param mime image type\n * @param options quality or options\n * @returns string image\n */\n frameToDataUrl(frameNumber, mime = 'image/png', options = 1) {\n if (!this.drawer.getOption('clear', true)) {\n for (let i = 0; i <= frameNumber; i++) {\n this.drawer.timeline.setFrame(i);\n this.drawer.draw();\n }\n }\n else {\n this.drawer.timeline.setFrame(frameNumber);\n this.drawer.draw();\n }\n return this.toDataUrl(mime, options);\n }\n /**\n * Render a frame at `time` to DataUrl\n *\n * @param time of animation\n * @param mime image type\n * @param options quality or options\n * @returns string image\n */\n frameAtTimeToDataUrl(time, mime = 'image/png', options = 1) {\n return this.frameToDataUrl(this.drawer.timeline.getFrameAtTime(time), mime, options);\n }\n /**\n * Canvas to DataURL\n *\n * @param mime\n * @param optionsOrQuality\n * @returns\n */\n toDataUrl(mime, optionsOrQuality = 1) {\n const canvas = this.drawer.getCanvas();\n if (canvas) {\n if (utils_1.bBrowser && canvas instanceof OffscreenCanvas) {\n console.warn('Cannot convert toDataURL in OffscreenCanvas');\n }\n else {\n return canvas.toDataURL(mime, optionsOrQuality);\n }\n }\n return null;\n }\n /**\n * Canvas to BoB\n *\n * @param mime\n * @param optionsOrQuality\n * @returns\n */\n blobOrBuffer(mime, optionsOrQuality = 1) {\n const canvas = this.drawer.getCanvas();\n if (canvas === null)\n throw new Error('Canvas not setted into Drawer');\n if (utils_1.bNode) {\n // TODO default node quality for jpeg and png\n switch (mime) {\n case 'image/png': {\n const pngConf = typeof optionsOrQuality === 'number'\n ? {\n compressionLevel: (9 - Utilities_1.clamp(0, 1, optionsOrQuality) * 9),\n }\n : optionsOrQuality;\n return Promise.resolve(canvas.toBuffer(mime, pngConf));\n }\n case 'image/jpeg': {\n const jpegConf = typeof optionsOrQuality === 'number'\n ? {\n quality: optionsOrQuality,\n }\n : optionsOrQuality;\n return Promise.resolve(canvas.toBuffer(mime, jpegConf));\n }\n }\n }\n if (canvas instanceof OffscreenCanvas) {\n return canvas.convertToBlob({ type: mime, quality: typeof optionsOrQuality === 'number' ? optionsOrQuality : 1 });\n }\n return new Promise(resolve => {\n ;\n canvas.toBlob(blob => {\n if (blob)\n resolve(blob);\n else\n throw new Error('Blob error');\n }, mime, typeof optionsOrQuality === 'number' ? optionsOrQuality : 1);\n });\n }\n}\nexports.Renderer = Renderer;\n//# sourceMappingURL=Renderer.js.map","require('regenerator-runtime/runtime');\nconst createFFmpeg = require('./createFFmpeg');\nconst { fetchFile } = require('./node');\n\nmodule.exports = {\n /*\n * Create ffmpeg instance.\n * Each ffmpeg instance owns an isolated MEMFS and works\n * independently.\n *\n * For example:\n *\n * ```\n * const ffmpeg = createFFmpeg({\n * log: true,\n * logger: () => {},\n * progress: () => {},\n * corePath: '',\n * })\n * ```\n *\n * For the usage of these four arguments, check config.js\n *\n */\n createFFmpeg,\n /*\n * Helper function for fetching files from various resource.\n * Sometimes the video/audio file you want to process may located\n * in a remote URL and somewhere in your local file system.\n *\n * This helper function helps you to fetch to file and return an\n * Uint8Array variable for ffmpeg.wasm to consume.\n *\n */\n fetchFile,\n};\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","const { defaultArgs, baseOptions } = require('./config');\nconst { setLogging, setCustomLogger, log } = require('./utils/log');\nconst parseProgress = require('./utils/parseProgress');\nconst parseArgs = require('./utils/parseArgs');\nconst { defaultOptions, getCreateFFmpegCore } = require('./node');\nconst { version } = require('../package.json');\n\nconst NO_LOAD = Error('ffmpeg.wasm is not ready, make sure you have completed load().');\n\nmodule.exports = (_options = {}) => {\n const {\n log: logging,\n logger,\n progress: optProgress,\n ...options\n } = {\n ...baseOptions,\n ...defaultOptions,\n ..._options,\n };\n let Core = null;\n let ffmpeg = null;\n let runResolve = null;\n let running = false;\n let progress = optProgress;\n const detectCompletion = (message) => {\n if (message === 'FFMPEG_END' && runResolve !== null) {\n runResolve();\n runResolve = null;\n running = false;\n }\n };\n const parseMessage = ({ type, message }) => {\n log(type, message);\n parseProgress(message, progress);\n detectCompletion(message);\n };\n\n /*\n * Load ffmpeg.wasm-core script.\n * In browser environment, the ffmpeg.wasm-core script is fetch from\n * CDN and can be assign to a local path by assigning `corePath`.\n * In node environment, we use dynamic require and the default `corePath`\n * is `$ffmpeg/core`.\n *\n * Typically the load() func might take few seconds to minutes to complete,\n * better to do it as early as possible.\n *\n */\n const load = async () => {\n log('info', 'load ffmpeg-core');\n if (Core === null) {\n log('info', 'loading ffmpeg-core');\n /*\n * In node environment, all paths are undefined as there\n * is no need to set them.\n */\n const {\n createFFmpegCore,\n corePath,\n workerPath,\n wasmPath,\n } = await getCreateFFmpegCore(options);\n Core = await createFFmpegCore({\n /*\n * Assign mainScriptUrlOrBlob fixes chrome extension web worker issue\n * as there is no document.currentScript in the context of content_scripts\n */\n mainScriptUrlOrBlob: corePath,\n printErr: (message) => parseMessage({ type: 'fferr', message }),\n print: (message) => parseMessage({ type: 'ffout', message }),\n /*\n * locateFile overrides paths of files that is loaded by main script (ffmpeg-core.js).\n * It is critical for browser environment and we override both wasm and worker paths\n * as we are using blob URL instead of original URL to avoid cross origin issues.\n */\n locateFile: (path, prefix) => {\n if (typeof window !== 'undefined') {\n if (typeof wasmPath !== 'undefined'\n && path.endsWith('ffmpeg-core.wasm')) {\n return wasmPath;\n }\n if (typeof workerPath !== 'undefined'\n && path.endsWith('ffmpeg-core.worker.js')) {\n return workerPath;\n }\n }\n return prefix + path;\n },\n });\n ffmpeg = Core.cwrap('proxy_main', 'number', ['number', 'number']);\n log('info', 'ffmpeg-core loaded');\n } else {\n throw Error('ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.');\n }\n };\n\n /*\n * Determine whether the Core is loaded.\n */\n const isLoaded = () => Core !== null;\n\n /*\n * Run ffmpeg command.\n * This is the major function in ffmpeg.wasm, you can just imagine it\n * as ffmpeg native cli and what you need to pass is the same.\n *\n * For example, you can convert native command below:\n *\n * ```\n * $ ffmpeg -i video.avi -c:v libx264 video.mp4\n * ```\n *\n * To\n *\n * ```\n * await ffmpeg.run('-i', 'video.avi', '-c:v', 'libx264', 'video.mp4');\n * ```\n *\n */\n const run = (..._args) => {\n log('info', `run ffmpeg command: ${_args.join(' ')}`);\n if (Core === null) {\n throw NO_LOAD;\n } else if (running) {\n throw Error('ffmpeg.wasm can only run one command at a time');\n } else {\n running = true;\n return new Promise((resolve) => {\n const args = [...defaultArgs, ..._args].filter((s) => s.length !== 0);\n runResolve = resolve;\n ffmpeg(...parseArgs(Core, args));\n });\n }\n };\n\n /*\n * Run FS operations.\n * For input/output file of ffmpeg.wasm, it is required to save them to MEMFS\n * first so that ffmpeg.wasm is able to consume them. Here we rely on the FS\n * methods provided by Emscripten.\n *\n * Common methods to use are:\n * ffmpeg.FS('writeFile', 'video.avi', new Uint8Array(...)): writeFile writes\n * data to MEMFS. You need to use Uint8Array for binary data.\n * ffmpeg.FS('readFile', 'video.mp4'): readFile from MEMFS.\n * ffmpeg.FS('unlink', 'video.map'): delete file from MEMFS.\n *\n * For more info, check https://emscripten.org/docs/api_reference/Filesystem-API.html\n *\n */\n const FS = (method, ...args) => {\n log('info', `run FS.${method} ${args.map((arg) => (typeof arg === 'string' ? arg : `<${arg.length} bytes binary file>`)).join(' ')}`);\n if (Core === null) {\n throw NO_LOAD;\n } else {\n let ret = null;\n try {\n ret = Core.FS[method](...args);\n } catch (e) {\n if (method === 'readdir') {\n throw Error(`ffmpeg.FS('readdir', '${args[0]}') error. Check if the path exists, ex: ffmpeg.FS('readdir', '/')`);\n } else if (method === 'readFile') {\n throw Error(`ffmpeg.FS('readFile', '${args[0]}') error. Check if the path exists`);\n } else {\n throw Error('Oops, something went wrong in FS operation.');\n }\n }\n return ret;\n }\n };\n\n /**\n * forcibly terminate the ffmpeg program.\n */\n const exit = () => {\n if (Core === null) {\n throw NO_LOAD;\n } else {\n running = false;\n Core.exit(1);\n Core = null;\n ffmpeg = null;\n runResolve = null;\n }\n };\n\n const setProgress = (_progress) => {\n progress = _progress;\n };\n\n const setLogger = (_logger) => {\n setCustomLogger(_logger);\n };\n\n setLogging(logging);\n setCustomLogger(logger);\n\n log('info', `use ffmpeg.wasm v${version}`);\n\n return {\n setProgress,\n setLogger,\n setLogging,\n load,\n isLoaded,\n run,\n exit,\n FS,\n };\n};\n","module.exports = {\n defaultArgs: [\n /* args[0] is always the binary path */\n './ffmpeg',\n /* Disable interaction mode */\n '-nostdin',\n /* Force to override output file */\n '-y',\n ],\n baseOptions: {\n /* Flag to turn on/off log messages in console */\n log: false,\n /*\n * Custom logger to get ffmpeg.wasm output messages.\n * a sample logger looks like this:\n *\n * ```\n * logger = ({ type, message }) => {\n * console.log(type, message);\n * }\n * ```\n *\n * type can be one of following:\n *\n * info: internal workflow debug messages\n * fferr: ffmpeg native stderr output\n * ffout: ffmpeg native stdout output\n */\n logger: () => {},\n /*\n * Progress handler to get current progress of ffmpeg command.\n * a sample progress handler looks like this:\n *\n * ```\n * progress = ({ ratio }) => {\n * console.log(ratio);\n * }\n * ```\n *\n * ratio is a float number between 0 to 1.\n */\n progress: () => {},\n /*\n * Path to find/download ffmpeg.wasm-core,\n * this value should be overwriten by `defaultOptions` in\n * each environment.\n */\n corePath: '',\n },\n};\n","let logging = false;\nlet customLogger = () => {};\n\nconst setLogging = (_logging) => {\n logging = _logging;\n};\n\nconst setCustomLogger = (logger) => {\n customLogger = logger;\n};\n\nconst log = (type, message) => {\n customLogger({ type, message });\n if (logging) {\n console.log(`[${type}] ${message}`);\n }\n};\n\nmodule.exports = {\n logging,\n setLogging,\n setCustomLogger,\n log,\n};\n","let duration = 0;\nlet ratio = 0;\n\nconst ts2sec = (ts) => {\n const [h, m, s] = ts.split(':');\n return (parseFloat(h) * 60 * 60) + (parseFloat(m) * 60) + parseFloat(s);\n};\n\nmodule.exports = (message, progress) => {\n if (typeof message === 'string') {\n if (message.startsWith(' Duration')) {\n const ts = message.split(', ')[0].split(': ')[1];\n const d = ts2sec(ts);\n progress({ duration: d, ratio });\n if (duration === 0 || duration > d) {\n duration = d;\n }\n } else if (message.startsWith('frame') || message.startsWith('size')) {\n const ts = message.split('time=')[1].split(' ')[0];\n const t = ts2sec(ts);\n ratio = t / duration;\n progress({ ratio, time: t });\n } else if (message.startsWith('video:')) {\n progress({ ratio: 1 });\n duration = 0;\n }\n }\n};\n","module.exports = (Core, args) => {\n const argsPtr = Core._malloc(args.length * Uint32Array.BYTES_PER_ELEMENT);\n args.forEach((s, idx) => {\n const buf = Core._malloc(s.length + 1);\n Core.writeAsciiToMemory(s, buf);\n Core.setValue(argsPtr + (Uint32Array.BYTES_PER_ELEMENT * idx), buf, 'i32');\n });\n return [args.length, argsPtr];\n};\n","const defaultOptions = require('./defaultOptions');\nconst getCreateFFmpegCore = require('./getCreateFFmpegCore');\nconst fetchFile = require('./fetchFile');\n\nmodule.exports = {\n defaultOptions,\n getCreateFFmpegCore,\n fetchFile,\n};\n","const resolveURL = require('resolve-url');\nconst { devDependencies } = require('../../package.json');\n\n/*\n * Default options for browser environment\n */\nmodule.exports = {\n corePath: process.env.NODE_ENV === 'development'\n ? resolveURL('/node_modules/@ffmpeg/core/dist/ffmpeg-core.js')\n : `https://unpkg.com/@ffmpeg/core@${devDependencies['@ffmpeg/core'].substring(1)}/dist/ffmpeg-core.js`,\n};\n","// Copyright 2014 Simon Lydell\r\n// X11 (“MIT”) Licensed. (See LICENSE.)\r\n\r\nvoid (function(root, factory) {\r\n if (typeof define === \"function\" && define.amd) {\r\n define(factory)\r\n } else if (typeof exports === \"object\") {\r\n module.exports = factory()\r\n } else {\r\n root.resolveUrl = factory()\r\n }\r\n}(this, function() {\r\n\r\n function resolveUrl(/* ...urls */) {\r\n var numUrls = arguments.length\r\n\r\n if (numUrls === 0) {\r\n throw new Error(\"resolveUrl requires at least one argument; got none.\")\r\n }\r\n\r\n var base = document.createElement(\"base\")\r\n base.href = arguments[0]\r\n\r\n if (numUrls === 1) {\r\n return base.href\r\n }\r\n\r\n var head = document.getElementsByTagName(\"head\")[0]\r\n head.insertBefore(base, head.firstChild)\r\n\r\n var a = document.createElement(\"a\")\r\n var resolved\r\n\r\n for (var index = 1; index < numUrls; index++) {\r\n a.href = arguments[index]\r\n resolved = a.href\r\n base.href = resolved\r\n }\r\n\r\n head.removeChild(base)\r\n\r\n return resolved\r\n }\r\n\r\n return resolveUrl\r\n\r\n}));\r\n","/* eslint-disable no-undef */\nconst resolveURL = require('resolve-url');\nconst { log } = require('../utils/log');\n\n/*\n * Fetch data from remote URL and convert to blob URL\n * to avoid CORS issue\n */\nconst toBlobURL = async (url, mimeType) => {\n log('info', `fetch ${url}`);\n const buf = await (await fetch(url)).arrayBuffer();\n log('info', `${url} file size = ${buf.byteLength} bytes`);\n const blob = new Blob([buf], { type: mimeType });\n const blobURL = URL.createObjectURL(blob);\n log('info', `${url} blob URL = ${blobURL}`);\n return blobURL;\n};\n\nmodule.exports = async ({ corePath: _corePath }) => {\n if (typeof _corePath !== 'string') {\n throw Error('corePath should be a string!');\n }\n const coreRemotePath = resolveURL(_corePath);\n const corePath = await toBlobURL(\n coreRemotePath,\n 'application/javascript',\n );\n const wasmPath = await toBlobURL(\n coreRemotePath.replace('ffmpeg-core.js', 'ffmpeg-core.wasm'),\n 'application/wasm',\n );\n const workerPath = await toBlobURL(\n coreRemotePath.replace('ffmpeg-core.js', 'ffmpeg-core.worker.js'),\n 'application/javascript',\n );\n if (typeof createFFmpegCore === 'undefined') {\n return new Promise((resolve) => {\n const script = document.createElement('script');\n const eventHandler = () => {\n script.removeEventListener('load', eventHandler);\n log('info', 'ffmpeg-core.js script loaded');\n resolve({\n createFFmpegCore,\n corePath,\n wasmPath,\n workerPath,\n });\n };\n script.src = corePath;\n script.type = 'text/javascript';\n script.addEventListener('load', eventHandler);\n document.getElementsByTagName('head')[0].appendChild(script);\n });\n }\n log('info', 'ffmpeg-core.js script is loaded already');\n return Promise.resolve({\n createFFmpegCore,\n corePath,\n wasmPath,\n workerPath,\n });\n};\n","const resolveURL = require('resolve-url');\n\nconst readFromBlobOrFile = (blob) => (\n new Promise((resolve, reject) => {\n const fileReader = new FileReader();\n fileReader.onload = () => {\n resolve(fileReader.result);\n };\n fileReader.onerror = ({ target: { error: { code } } }) => {\n reject(Error(`File could not be read! Code=${code}`));\n };\n fileReader.readAsArrayBuffer(blob);\n })\n);\n\nmodule.exports = async (_data) => {\n let data = _data;\n if (typeof _data === 'undefined') {\n return new Uint8Array();\n }\n\n if (typeof _data === 'string') {\n /* From base64 format */\n if (/data:_data\\/([a-zA-Z]*);base64,([^\"]*)/.test(_data)) {\n data = atob(_data.split(',')[1])\n .split('')\n .map((c) => c.charCodeAt(0));\n /* From remote server/URL */\n } else {\n const res = await fetch(resolveURL(_data));\n data = await res.arrayBuffer();\n }\n /* From Blob or File */\n } else if (_data instanceof File || _data instanceof Blob) {\n data = await readFromBlobOrFile(_data);\n }\n\n return new Uint8Array(data);\n};\n","/*!\n\nJSZip v3.7.0 - A JavaScript class for generating and reading zip files\n\n\n(c) 2009-2016 Stuart Knightley \nDual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.\n\nJSZip uses the library pako released under the MIT license :\nhttps://github.com/nodeca/pako/blob/master/LICENSE\n*/\n\n!function(e){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=e();else if(\"function\"==typeof define&&define.amd)define([],e);else{(\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:this).JSZip=e()}}(function(){return function s(o,a,f){function u(r,e){if(!a[r]){if(!o[r]){var t=\"function\"==typeof require&&require;if(!e&&t)return t(r,!0);if(d)return d(r,!0);var n=new Error(\"Cannot find module '\"+r+\"'\");throw n.code=\"MODULE_NOT_FOUND\",n}var i=a[r]={exports:{}};o[r][0].call(i.exports,function(e){var t=o[r][1][e];return u(t||e)},i,i.exports,s,o,a,f)}return a[r].exports}for(var d=\"function\"==typeof require&&require,e=0;e>2,s=(3&t)<<4|r>>4,o=1>6:64,a=2>4,r=(15&i)<<4|(s=p.indexOf(e.charAt(a++)))>>2,n=(3&s)<<6|(o=p.indexOf(e.charAt(a++))),u[f++]=t,64!==s&&(u[f++]=r),64!==o&&(u[f++]=n);return u}},{\"./support\":30,\"./utils\":32}],2:[function(e,t,r){\"use strict\";var n=e(\"./external\"),i=e(\"./stream/DataWorker\"),s=e(\"./stream/Crc32Probe\"),o=e(\"./stream/DataLengthProbe\");function a(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}a.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o(\"data_length\")),t=this;return e.on(\"end\",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error(\"Bug : uncompressed data size mismatch\")}),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo(\"compressedSize\",this.compressedSize).withStreamInfo(\"uncompressedSize\",this.uncompressedSize).withStreamInfo(\"crc32\",this.crc32).withStreamInfo(\"compression\",this.compression)}},a.createWorkerFrom=function(e,t,r){return e.pipe(new s).pipe(new o(\"uncompressedSize\")).pipe(t.compressWorker(r)).pipe(new o(\"compressedSize\")).withStreamInfo(\"compression\",t)},t.exports=a},{\"./external\":6,\"./stream/Crc32Probe\":25,\"./stream/DataLengthProbe\":26,\"./stream/DataWorker\":27}],3:[function(e,t,r){\"use strict\";var n=e(\"./stream/GenericWorker\");r.STORE={magic:\"\\0\\0\",compressWorker:function(e){return new n(\"STORE compression\")},uncompressWorker:function(){return new n(\"STORE decompression\")}},r.DEFLATE=e(\"./flate\")},{\"./flate\":7,\"./stream/GenericWorker\":28}],4:[function(e,t,r){\"use strict\";var n=e(\"./utils\"),o=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?\"string\"!==n.getTypeOf(e)?function(e,t,r){var n=o,i=0+r;e^=-1;for(var s=0;s>>8^n[255&(e^t[s])];return-1^e}(0|t,e,e.length):function(e,t,r){var n=o,i=0+r;e^=-1;for(var s=0;s>>8^n[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length):0}},{\"./utils\":32}],5:[function(e,t,r){\"use strict\";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){\"use strict\";var n;n=\"undefined\"!=typeof Promise?Promise:e(\"lie\"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,r){\"use strict\";var n=\"undefined\"!=typeof Uint8Array&&\"undefined\"!=typeof Uint16Array&&\"undefined\"!=typeof Uint32Array,i=e(\"pako\"),s=e(\"./utils\"),o=e(\"./stream/GenericWorker\"),a=n?\"uint8array\":\"array\";function f(e,t){o.call(this,\"FlateWorker/\"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}r.magic=\"\\b\\0\",s.inherits(f,o),f.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,e.data),!1)},f.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},f.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},f.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(e){return new f(\"Deflate\",e)},r.uncompressWorker=function(){return new f(\"Inflate\",{})}},{\"./stream/GenericWorker\":28,\"./utils\":32,pako:38}],8:[function(e,t,r){\"use strict\";function O(e,t){var r,n=\"\";for(r=0;r>>=8;return n}function i(e,t,r,n,i,s){var o,a,f=e.file,u=e.compression,d=s!==D.utf8encode,h=I.transformTo(\"string\",s(f.name)),l=I.transformTo(\"string\",D.utf8encode(f.name)),c=f.comment,p=I.transformTo(\"string\",s(c)),m=I.transformTo(\"string\",D.utf8encode(c)),_=l.length!==f.name.length,w=m.length!==c.length,v=\"\",g=\"\",y=\"\",b=f.dir,k=f.date,x={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(x.crc32=e.crc32,x.compressedSize=e.compressedSize,x.uncompressedSize=e.uncompressedSize);var S=0;t&&(S|=8),d||!_&&!w||(S|=2048);var E,z=0,C=0;b&&(z|=16),\"UNIX\"===i?(C=798,z|=((E=f.unixPermissions)||(E=b?16893:33204),(65535&E)<<16)):(C=20,z|=63&(f.dosPermissions||0)),o=k.getUTCHours(),o<<=6,o|=k.getUTCMinutes(),o<<=5,o|=k.getUTCSeconds()/2,a=k.getUTCFullYear()-1980,a<<=4,a|=k.getUTCMonth()+1,a<<=5,a|=k.getUTCDate(),_&&(v+=\"up\"+O((g=O(1,1)+O(B(h),4)+l).length,2)+g),w&&(v+=\"uc\"+O((y=O(1,1)+O(B(p),4)+m).length,2)+y);var A=\"\";return A+=\"\\n\\0\",A+=O(S,2),A+=u.magic,A+=O(o,2),A+=O(a,2),A+=O(x.crc32,4),A+=O(x.compressedSize,4),A+=O(x.uncompressedSize,4),A+=O(h.length,2),A+=O(v.length,2),{fileRecord:T.LOCAL_FILE_HEADER+A+h+v,dirRecord:T.CENTRAL_FILE_HEADER+O(C,2)+A+O(p.length,2)+\"\\0\\0\\0\\0\"+O(z,4)+O(n,4)+h+v+p}}var I=e(\"../utils\"),s=e(\"../stream/GenericWorker\"),D=e(\"../utf8\"),B=e(\"../crc32\"),T=e(\"../signature\");function n(e,t,r,n){s.call(this,\"ZipFileWorker\"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}I.inherits(n,s),n.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,s.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},n.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},n.prototype.closedSource=function(e){this.accumulate=!1;var t,r=this.streamFiles&&!e.file.dir,n=i(e,r,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),r)this.push({data:(t=e,T.DATA_DESCRIPTOR+O(t.crc32,4)+O(t.compressedSize,4)+O(t.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},n.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo(\"string\",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{\"../utils\":32}],19:[function(e,t,r){\"use strict\";var n=e(\"./Uint8ArrayReader\");function i(e){n.call(this,e)}e(\"../utils\").inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{\"../utils\":32,\"./Uint8ArrayReader\":21}],20:[function(e,t,r){\"use strict\";var n=e(\"./DataReader\");function i(e){n.call(this,e)}e(\"../utils\").inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{\"../utils\":32,\"./DataReader\":18}],21:[function(e,t,r){\"use strict\";var n=e(\"./ArrayReader\");function i(e){n.call(this,e)}e(\"../utils\").inherits(i,n),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{\"../utils\":32,\"./ArrayReader\":17}],22:[function(e,t,r){\"use strict\";var n=e(\"../utils\"),i=e(\"../support\"),s=e(\"./ArrayReader\"),o=e(\"./StringReader\"),a=e(\"./NodeBufferReader\"),f=e(\"./Uint8ArrayReader\");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),\"string\"!==t||i.uint8array?\"nodebuffer\"===t?new a(e):i.uint8array?new f(n.transformTo(\"uint8array\",e)):new s(n.transformTo(\"array\",e)):new o(e)}},{\"../support\":30,\"../utils\":32,\"./ArrayReader\":17,\"./NodeBufferReader\":19,\"./StringReader\":20,\"./Uint8ArrayReader\":21}],23:[function(e,t,r){\"use strict\";r.LOCAL_FILE_HEADER=\"PK\u0003\u0004\",r.CENTRAL_FILE_HEADER=\"PK\u0001\u0002\",r.CENTRAL_DIRECTORY_END=\"PK\u0005\u0006\",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR=\"PK\u0006\u0007\",r.ZIP64_CENTRAL_DIRECTORY_END=\"PK\u0006\u0006\",r.DATA_DESCRIPTOR=\"PK\u0007\\b\"},{}],24:[function(e,t,r){\"use strict\";var n=e(\"./GenericWorker\"),i=e(\"../utils\");function s(e){n.call(this,\"ConvertWorker to \"+e),this.destType=e}i.inherits(s,n),s.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],25:[function(e,t,r){\"use strict\";var n=e(\"./GenericWorker\"),i=e(\"../crc32\");function s(){n.call(this,\"Crc32Probe\"),this.withStreamInfo(\"crc32\",0)}e(\"../utils\").inherits(s,n),s.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=s},{\"../crc32\":4,\"../utils\":32,\"./GenericWorker\":28}],26:[function(e,t,r){\"use strict\";var n=e(\"../utils\"),i=e(\"./GenericWorker\");function s(e){i.call(this,\"DataLengthProbe for \"+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(s,i),s.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],27:[function(e,t,r){\"use strict\";var n=e(\"../utils\"),i=e(\"./GenericWorker\");function s(e){i.call(this,\"DataWorker\");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=\"\",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}n.inherits(s,i),s.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case\"string\":e=this.data.substring(this.index,t);break;case\"uint8array\":e=this.data.subarray(this.index,t);break;case\"array\":case\"nodebuffer\":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],28:[function(e,t,r){\"use strict\";function n(e){this.name=e||\"default\",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit(\"data\",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit(\"end\"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit(\"error\",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit(\"error\",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r \"+e:e}},t.exports=n},{}],29:[function(e,t,r){\"use strict\";var u=e(\"../utils\"),i=e(\"./ConvertWorker\"),s=e(\"./GenericWorker\"),d=e(\"../base64\"),n=e(\"../support\"),o=e(\"../external\"),a=null;if(n.nodestream)try{a=e(\"../nodejs/NodejsStreamOutputAdapter\")}catch(e){}function f(e,t,r){var n=t;switch(t){case\"blob\":case\"arraybuffer\":n=\"uint8array\";break;case\"base64\":n=\"string\"}try{this._internalType=n,this._outputType=t,this._mimeType=r,u.checkSupport(n),this._worker=e.pipe(new i(n)),e.lock()}catch(e){this._worker=new s(\"error\"),this._worker.error(e)}}f.prototype={accumulate:function(e){return a=this,f=e,new o.Promise(function(t,r){var n=[],i=a._internalType,s=a._outputType,o=a._mimeType;a.on(\"data\",function(e,t){n.push(e),f&&f(t)}).on(\"error\",function(e){n=[],r(e)}).on(\"end\",function(){try{var e=function(e,t,r){switch(e){case\"blob\":return u.newBlob(u.transformTo(\"arraybuffer\",t),r);case\"base64\":return d.encode(t);default:return u.transformTo(e,t)}}(s,function(e,t){var r,n=0,i=null,s=0;for(r=0;r>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t}(e)},s.utf8decode=function(e){return f.nodebuffer?a.transformTo(\"nodebuffer\",e).toString(\"utf-8\"):function(e){var t,r,n,i,s=e.length,o=new Array(2*s);for(t=r=0;t>10&1023,o[r++]=56320|1023&n)}return o.length!==r&&(o.subarray?o=o.subarray(0,r):o.length=r),a.applyFromCharCode(o)}(e=a.transformTo(f.uint8array?\"uint8array\":\"array\",e))},a.inherits(o,n),o.prototype.processChunk=function(e){var t=a.transformTo(f.uint8array?\"uint8array\":\"array\",e.data);if(this.leftOver&&this.leftOver.length){if(f.uint8array){var r=t;(t=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),t.set(r,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var n=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+u[e[r]]>t?r:t}(t),i=t;n!==t.length&&(f.uint8array?(i=t.subarray(0,n),this.leftOver=t.subarray(n,t.length)):(i=t.slice(0,n),this.leftOver=t.slice(n,t.length))),this.push({data:s.utf8decode(i),meta:e.meta})},o.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=o,a.inherits(d,n),d.prototype.processChunk=function(e){this.push({data:s.utf8encode(e.data),meta:e.meta})},s.Utf8EncodeWorker=d},{\"./nodejsUtils\":14,\"./stream/GenericWorker\":28,\"./support\":30,\"./utils\":32}],32:[function(e,t,a){\"use strict\";var f=e(\"./support\"),u=e(\"./base64\"),r=e(\"./nodejsUtils\"),n=e(\"set-immediate-shim\"),d=e(\"./external\");function i(e){return e}function h(e,t){for(var r=0;r>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||\"/\"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=n(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t},r.buf2binstring=function(e){return d(e,e.length)},r.binstring2buf=function(e){for(var t=new f.Buf8(e.length),r=0,n=t.length;r>10&1023,a[n++]=56320|1023&i)}return d(a,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+u[e[r]]>t?r:t}},{\"./common\":41}],43:[function(e,t,r){\"use strict\";t.exports=function(e,t,r,n){for(var i=65535&e|0,s=e>>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,n){var i=a,s=n+r;e^=-1;for(var o=n;o>>8^i[255&(e^t[o])];return-1^e}},{}],46:[function(e,t,r){\"use strict\";var f,l=e(\"../utils/common\"),u=e(\"./trees\"),c=e(\"./adler32\"),p=e(\"./crc32\"),n=e(\"./messages\"),d=0,h=0,m=-2,i=2,_=8,s=286,o=30,a=19,w=2*s+1,v=15,g=3,y=258,b=y+g+1,k=42,x=113;function S(e,t){return e.msg=n[t],t}function E(e){return(e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(l.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function A(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,C(e.strm)}function O(e,t){e.pending_buf[e.pending++]=t}function I(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function D(e,t){var r,n,i=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match,f=e.strstart>e.w_size-b?e.strstart-(e.w_size-b):0,u=e.window,d=e.w_mask,h=e.prev,l=e.strstart+y,c=u[s+o-1],p=u[s+o];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(u[(r=t)+o]===p&&u[r+o-1]===c&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do{}while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&sf&&0!=--i);return o<=e.lookahead?o:e.lookahead}function B(e){var t,r,n,i,s,o,a,f,u,d,h=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=h+(h-b)){for(l.arraySet(e.window,e.window,h,h,0),e.match_start-=h,e.strstart-=h,e.block_start-=h,t=r=e.hash_size;n=e.head[--t],e.head[t]=h<=n?n-h:0,--r;);for(t=r=h;n=e.prev[--t],e.prev[t]=h<=n?n-h:0,--r;);i+=h}if(0===e.strm.avail_in)break;if(o=e.strm,a=e.window,f=e.strstart+e.lookahead,d=void 0,(u=i)<(d=o.avail_in)&&(d=u),r=0===d?0:(o.avail_in-=d,l.arraySet(a,o.input,o.next_in,d,f),1===o.state.wrap?o.adler=c(o.adler,a,d,f):2===o.state.wrap&&(o.adler=p(o.adler,a,d,f)),o.next_in+=d,o.total_in+=d,d),e.lookahead+=r,e.lookahead+e.insert>=g)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<=g&&(e.ins_h=(e.ins_h<=g)if(n=u._tr_tally(e,e.strstart-e.match_start,e.match_length-g),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=g){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=g&&(e.ins_h=(e.ins_h<=g&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-g,n=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-g),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(B(e),0===e.lookahead&&t===d)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,A(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-b&&(A(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(A(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(A(e,!1),e.strm.avail_out),1)}),new F(4,4,8,4,T),new F(4,5,16,8,T),new F(4,6,32,32,T),new F(4,4,16,16,R),new F(8,16,32,32,R),new F(8,16,128,128,R),new F(8,32,128,256,R),new F(32,128,258,1024,R),new F(32,258,258,4096,R)],r.deflateInit=function(e,t){return P(e,t,_,15,8,0)},r.deflateInit2=P,r.deflateReset=L,r.deflateResetKeep=U,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?m:(e.state.gzhead=t,h):m},r.deflate=function(e,t){var r,n,i,s;if(!e||!e.state||5>8&255),O(n,n.gzhead.time>>16&255),O(n,n.gzhead.time>>24&255),O(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),O(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(O(n,255&n.gzhead.extra.length),O(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=p(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(O(n,0),O(n,0),O(n,0),O(n,0),O(n,0),O(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),O(n,3),n.status=x);else{var o=_+(n.w_bits-8<<4)<<8;o|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(o|=32),o+=31-o%31,n.status=x,I(n,o),0!==n.strstart&&(I(n,e.adler>>>16),I(n,65535&e.adler)),e.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),C(e),i=n.pending,n.pending!==n.pending_buf_size));)O(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),C(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindexi&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),C(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindexi&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&C(e),n.pending+2<=n.pending_buf_size&&(O(n,255&e.adler),O(n,e.adler>>8&255),e.adler=0,n.status=x)):n.status=x),0!==n.pending){if(C(e),0===e.avail_out)return n.last_flush=-1,h}else if(0===e.avail_in&&E(t)<=E(r)&&4!==t)return S(e,-5);if(666===n.status&&0!==e.avail_in)return S(e,-5);if(0!==e.avail_in||0!==n.lookahead||t!==d&&666!==n.status){var a=2===n.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(B(e),0===e.lookahead)){if(t===d)return 1;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(A(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(A(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(A(e,!1),0===e.strm.avail_out)?1:2}(n,t):3===n.strategy?function(e,t){for(var r,n,i,s,o=e.window;;){if(e.lookahead<=y){if(B(e),e.lookahead<=y&&t===d)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=g&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=g?(r=u._tr_tally(e,1,e.match_length-g),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(A(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(A(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(A(e,!1),0===e.strm.avail_out)?1:2}(n,t):f[n.level].func(n,t);if(3!==a&&4!==a||(n.status=666),1===a||3===a)return 0===e.avail_out&&(n.last_flush=-1),h;if(2===a&&(1===t?u._tr_align(n):5!==t&&(u._tr_stored_block(n,0,0,!1),3===t&&(z(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),C(e),0===e.avail_out))return n.last_flush=-1,h}return 4!==t?h:n.wrap<=0?1:(2===n.wrap?(O(n,255&e.adler),O(n,e.adler>>8&255),O(n,e.adler>>16&255),O(n,e.adler>>24&255),O(n,255&e.total_in),O(n,e.total_in>>8&255),O(n,e.total_in>>16&255),O(n,e.total_in>>24&255)):(I(n,e.adler>>>16),I(n,65535&e.adler)),C(e),0=r.w_size&&(0===s&&(z(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new l.Buf8(r.w_size),l.arraySet(u,t,d-r.w_size,r.w_size,0),t=u,d=r.w_size),o=e.avail_in,a=e.next_in,f=e.input,e.avail_in=d,e.next_in=0,e.input=t,B(r);r.lookahead>=g;){for(n=r.strstart,i=r.lookahead-(g-1);r.ins_h=(r.ins_h<>>=y=g>>>24,p-=y,0==(y=g>>>16&255))z[s++]=65535&g;else{if(!(16&y)){if(0==(64&y)){g=m[(65535&g)+(c&(1<>>=y,p-=y),p<15&&(c+=E[n++]<>>=y=g>>>24,p-=y,!(16&(y=g>>>16&255))){if(0==(64&y)){g=_[(65535&g)+(c&(1<>>=y,p-=y,(y=s-o)>3,c&=(1<<(p-=b<<3))-1,e.next_in=n,e.next_out=s,e.avail_in=n>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function s(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new O.Buf16(320),this.work=new O.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=\"\",t.wrap&&(e.adler=1&t.wrap),t.mode=L,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new O.Buf32(n),t.distcode=t.distdyn=new O.Buf32(i),t.sane=1,t.back=-1,N):U}function a(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,o(e)):U}function f(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=s.wsize?(O.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(n<(i=s.wsize-s.wnext)&&(i=n),O.arraySet(s.window,t,r-n,i,s.wnext),(n-=i)?(O.arraySet(s.window,t,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=D(r.check,C,2,0),d=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg=\"incorrect header check\",r.mode=30;break}if(8!=(15&u)){e.msg=\"unknown compression method\",r.mode=30;break}if(d-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg=\"invalid window size\",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=D(r.check,C,2,0)),d=u=0,r.mode=3;case 3:for(;d<32;){if(0===a)break e;a--,u+=n[s++]<>>8&255,C[2]=u>>>16&255,C[3]=u>>>24&255,r.check=D(r.check,C,4,0)),d=u=0,r.mode=4;case 4:for(;d<16;){if(0===a)break e;a--,u+=n[s++]<>8),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=D(r.check,C,2,0)),d=u=0,r.mode=5;case 5:if(1024&r.flags){for(;d<16;){if(0===a)break e;a--,u+=n[s++]<>>8&255,r.check=D(r.check,C,2,0)),d=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(a<(c=r.length)&&(c=a),c&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),O.arraySet(r.head.extra,n,s,c,k)),512&r.flags&&(r.check=D(r.check,n,c,s)),a-=c,s+=c,r.length-=c),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===a)break e;for(c=0;k=n[s+c++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&c>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;d<32;){if(0===a)break e;a--,u+=n[s++]<>>=7&d,d-=7&d,r.mode=27;break}for(;d<3;){if(0===a)break e;a--,u+=n[s++]<>>=1)){case 0:r.mode=14;break;case 1:if(j(r),r.mode=20,6!==t)break;u>>>=2,d-=2;break e;case 2:r.mode=17;break;case 3:e.msg=\"invalid block type\",r.mode=30}u>>>=2,d-=2;break;case 14:for(u>>>=7&d,d-=7&d;d<32;){if(0===a)break e;a--,u+=n[s++]<>>16^65535)){e.msg=\"invalid stored block lengths\",r.mode=30;break}if(r.length=65535&u,d=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(c=r.length){if(a>>=5,d-=5,r.ndist=1+(31&u),u>>>=5,d-=5,r.ncode=4+(15&u),u>>>=4,d-=4,286>>=3,d-=3}for(;r.have<19;)r.lens[A[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=T(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg=\"invalid code lengths set\",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,v=65535&z,!((_=z>>>24)<=d);){if(0===a)break e;a--,u+=n[s++]<>>=_,d-=_,r.lens[r.have++]=v;else{if(16===v){for(E=_+2;d>>=_,d-=_,0===r.have){e.msg=\"invalid bit length repeat\",r.mode=30;break}k=r.lens[r.have-1],c=3+(3&u),u>>>=2,d-=2}else if(17===v){for(E=_+3;d>>=_)),u>>>=3,d-=3}else{for(E=_+7;d>>=_)),u>>>=7,d-=7}if(r.have+c>r.nlen+r.ndist){e.msg=\"invalid bit length repeat\",r.mode=30;break}for(;c--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg=\"invalid code -- missing end-of-block\",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=T(R,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg=\"invalid literal/lengths set\",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=T(F,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg=\"invalid distances set\",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=a&&258<=f){e.next_out=o,e.avail_out=f,e.next_in=s,e.avail_in=a,r.hold=u,r.bits=d,B(e,l),o=e.next_out,i=e.output,f=e.avail_out,s=e.next_in,n=e.input,a=e.avail_in,u=r.hold,d=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;w=(z=r.lencode[u&(1<>>16&255,v=65535&z,!((_=z>>>24)<=d);){if(0===a)break e;a--,u+=n[s++]<>g)])>>>16&255,v=65535&z,!(g+(_=z>>>24)<=d);){if(0===a)break e;a--,u+=n[s++]<>>=g,d-=g,r.back+=g}if(u>>>=_,d-=_,r.back+=_,r.length=v,0===w){r.mode=26;break}if(32&w){r.back=-1,r.mode=12;break}if(64&w){e.msg=\"invalid literal/length code\",r.mode=30;break}r.extra=15&w,r.mode=22;case 22:if(r.extra){for(E=r.extra;d>>=r.extra,d-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;w=(z=r.distcode[u&(1<>>16&255,v=65535&z,!((_=z>>>24)<=d);){if(0===a)break e;a--,u+=n[s++]<>g)])>>>16&255,v=65535&z,!(g+(_=z>>>24)<=d);){if(0===a)break e;a--,u+=n[s++]<>>=g,d-=g,r.back+=g}if(u>>>=_,d-=_,r.back+=_,64&w){e.msg=\"invalid distance code\",r.mode=30;break}r.offset=v,r.extra=15&w,r.mode=24;case 24:if(r.extra){for(E=r.extra;d>>=r.extra,d-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg=\"invalid distance too far back\",r.mode=30;break}r.mode=25;case 25:if(0===f)break e;if(c=l-f,r.offset>c){if((c=r.offset-c)>r.whave&&r.sane){e.msg=\"invalid distance too far back\",r.mode=30;break}p=c>r.wnext?(c-=r.wnext,r.wsize-c):r.wnext-c,c>r.length&&(c=r.length),m=r.window}else m=i,p=o-r.offset,c=r.length;for(fc?(m=B[T+o[g]],A[O+o[g]]):(m=96,0),f=1<>S)+(u-=f)]=p<<24|m<<16|_|0,0!==u;);for(f=1<>=1;if(0!==f?(C&=f-1,C+=f):C=0,g++,0==--I[v]){if(v===b)break;v=t[r+o[g]]}if(k>>7)]}function x(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function S(e,t,r){e.bi_valid>i-r?(e.bi_buf|=t<>i-e.bi_valid,e.bi_valid+=r-i):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function C(e,t,r){var n,i,s=new Array(_+1),o=0;for(n=1;n<=_;n++)s[n]=o=o+r[n-1]<<1;for(i=0;i<=t;i++){var a=e[2*i+1];0!==a&&(e[2*i]=z(s[a]++,a))}}function A(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function O(e){8>1;1<=r;r--)D(e,s,r);for(i=f;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],D(e,s,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,s[2*i]=s[2*r]+s[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,s[2*r+1]=s[2*n+1]=i,e.heap[1]=i++,D(e,s,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,s,o,a,f=t.dyn_tree,u=t.max_code,d=t.stat_desc.static_tree,h=t.stat_desc.has_stree,l=t.stat_desc.extra_bits,c=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(s=0;s<=_;s++)e.bl_count[s]=0;for(f[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)p<(s=f[2*f[2*(n=e.heap[r])+1]+1]+1)&&(s=p,m++),f[2*n+1]=s,u>=7;n<30;n++)for(y[n]=i<<7,e=0;e<1<>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),T(e,e.l_desc),T(e,e.d_desc),o=function(e){var t;for(R(e,e.dyn_ltree,e.l_desc.max_code),R(e,e.dyn_dtree,e.d_desc.max_code),T(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*d[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==t?U(e,t,r,n):4===e.strategy||s===i?(S(e,2+(n?1:0),3),B(e,h,l)):(S(e,4+(n?1:0),3),function(e,t,r,n){var i;for(S(e,t-257,5),S(e,r-1,5),S(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(p[r]+256+1)]++,e.dyn_dtree[2*k(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){var t;S(e,2,3),E(e,256,h),16===(t=e).bi_valid?(x(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{\"../utils/common\":41}],53:[function(e,t,r){\"use strict\";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,r){\"use strict\";t.exports=\"function\"==typeof setImmediate?setImmediate:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e)}},{}]},{},[10])(10)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)});","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"../Timeline\"), exports);\n__exportStar(require(\"../DrawerCanvas\"), exports);\n__exportStar(require(\"../Renderer\"), exports);\n__exportStar(require(\"./BrowserDrawerCanvas\"), exports);\nconst BrowserDrawerCanvas_1 = require(\"./BrowserDrawerCanvas\");\nexports.default = BrowserDrawerCanvas_1.BrowserDrawerCanvas;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GCODEExporter = void 0;\n__exportStar(require(\"./types\"), exports);\nconst GCODEExporter_1 = require(\"./GCODEExporter\");\nObject.defineProperty(exports, \"GCODEExporter\", { enumerable: true, get: function () { return GCODEExporter_1.GCODEExporter; } });\nif (typeof Urpflanze !== 'undefined') {\n Urpflanze.GCODEExporter = GCODEExporter_1.GCODEExporter;\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GCODEExporter = void 0;\nconst core_1 = require(\"@urpflanze/core\");\nconst simplify_js_1 = require(\"simplify-js\");\nconst utilities_1 = require(\"./utilities\");\nclass GCODEExporter {\n static parse(scene, settings) {\n const bindedSettings = {\n ...GCODEExporter.defaults,\n ...settings,\n };\n return GCODEExporter.generate(scene, bindedSettings).join('\\n');\n }\n /**\n * Set units to inches or millimeters.\n * When unit is set, all positions, offsets, rates, accelerations, etc., specified in G-code parameters are interpreted in that unit.\n *\n * @param unit 'millimeters' | 'inches'\n * @returns\n */\n static setUnit(unit) {\n return unit === 'inches' ? 'G20' : 'G21';\n }\n /**\n * In this mode all coordinates are interpreted as relative to the last position.\n *\n * @returns\n */\n static useRelativePosition() {\n return 'G91';\n }\n /**\n * All coordinates given in G-code are interpreted as positions in the logical coordinate space\n *\n * @returns\n */\n static useAbsolutePosition() {\n return 'G90';\n }\n /**\n * Up pen and go home\n *\n * @param penUpCommand\n * @returns\n */\n static goHome(penUpCommand) {\n return [penUpCommand, 'G28 X0 Y0'];\n }\n /**\n * Store the origin position that the machine goes to when the {G28} command is issued\n *\n * @param x\n * @param y\n * @param decimals\n * @returns\n */\n static setCurrentMachinePosition(x, y, decimals) {\n return `G28.1 X${utilities_1.round(x, decimals)} Y${utilities_1.round(y, decimals)}`;\n }\n /**\n * Set the current position to the values specified.\n *\n * @param x\n * @param y\n * @param decimals\n * @returns\n */\n static setCurrentWorkspacePosition(x, y, decimals) {\n return `G92 X${utilities_1.round(x, decimals)} Y${utilities_1.round(y, decimals)}`;\n }\n /**\n * Linear move.\n * G0 is a rapid moviment (max speed)\n * G1 moviment of setted velocity\n *\n * @param x\n * @param y\n * @param decimals\n * @param velocity\n * @returns\n */\n static goTo(x, y, decimals, velocity) {\n return typeof velocity !== 'undefined'\n ? `G1 X${utilities_1.round(x, decimals)} Y${utilities_1.round(y, decimals)} F${velocity}`\n : `G0 X${utilities_1.round(x, decimals)} Y${utilities_1.round(y, decimals)}`;\n }\n /**\n * Up the pen, move and down\n *\n * @param penUpCommand\n * @param penDownCommand\n * @param x\n * @param y\n * @param round\n * @returns\n */\n static moveTo(penUpCommand, penDownCommand, x, y, round) {\n return [penUpCommand, this.goTo(x, y, round), penDownCommand];\n }\n /**\n * goTo alias\n *\n * @param x\n * @param y\n * @param velocity\n * @param round\n * @returns\n */\n static lineTo(x, y, velocity, round) {\n return this.goTo(x, y, round, velocity);\n }\n /**\n * Generate gcode frm scene\n *\n * @param scene\n * @param settings\n * @returns\n */\n static generate(scene, settings) {\n // Calculate workspace area\n const workspaceWidth = settings.maxX - settings.minX;\n const workspaceHeight = settings.maxY - settings.minY;\n const workspaceRatio = workspaceWidth / workspaceHeight;\n // Calculate drawArea from scene\n const sceneRatio = scene.width / scene.height;\n const drawArea = [\n workspaceRatio > sceneRatio ? (scene.width * workspaceHeight) / scene.height : workspaceWidth,\n workspaceRatio > sceneRatio ? workspaceHeight : (scene.height * workspaceWidth) / scene.width,\n ];\n const drawAreaSceneOffset = [(workspaceWidth - drawArea[0]) / 2, (workspaceHeight - drawArea[1]) / 2];\n // Adapt drawArea to workspace\n const scale = workspaceRatio > sceneRatio ? scene.width / drawArea[0] : scene.height / drawArea[1];\n // const machineCenterPosition = [(settings.maxX + settings.minX) / 2, (settings.maxY + settings.minY) / 2]\n const gcode = [];\n utilities_1.concat(gcode, settings.penUpCommand);\n utilities_1.concat(gcode, this.setUnit(settings.unit));\n utilities_1.concat(gcode, this.useAbsolutePosition());\n utilities_1.concat(gcode, this.setCurrentMachinePosition(settings.minX, settings.minY, settings.decimals));\n utilities_1.concat(gcode, this.setCurrentWorkspacePosition(settings.minX, settings.minY, settings.decimals));\n const sceneChilds = scene.getChildren();\n for (let i = 0, len = sceneChilds.length; i < len; i++) {\n sceneChilds[i].generate(0, true);\n const childBuffer = sceneChilds[i].getBuffer() || [];\n const childIndexedBuffer = sceneChilds[i].getIndexedBuffer() || [];\n let childVertexIndex = 0;\n for (let currentBufferIndex = 0, len = childIndexedBuffer.length; currentBufferIndex < len; currentBufferIndex++) {\n const currentIndexing = childIndexedBuffer[currentBufferIndex];\n const initialPointX = core_1.clamp(settings.minX, settings.maxX, settings.minX + childBuffer[childVertexIndex] / scale + drawAreaSceneOffset[0]);\n const initialPointY = core_1.clamp(settings.minY, settings.maxY, settings.minY + childBuffer[childVertexIndex + 1] / scale + drawAreaSceneOffset[1]);\n utilities_1.concat(gcode, this.moveTo(settings.penUpCommand, settings.penDownCommand, initialPointX, initialPointY, settings.decimals));\n const simplifiedBuffer = GCODEExporter.pointsToBuffer(simplify_js_1.default(GCODEExporter.bufferToPoints(childBuffer.slice(childVertexIndex, childVertexIndex + currentIndexing.frameLength)), 1 / 10 ** settings.decimals, true));\n for (let i = 0, len = simplifiedBuffer.length; i < len; i += 2) {\n const currentX = core_1.clamp(settings.minX, settings.maxX, settings.minX + simplifiedBuffer[i] / scale + drawAreaSceneOffset[0]);\n const currentY = core_1.clamp(settings.minY, settings.maxY, settings.minY + simplifiedBuffer[i + 1] / scale + drawAreaSceneOffset[1]);\n utilities_1.concat(gcode, this.lineTo(currentX, currentY, settings.velocity, settings.decimals));\n }\n if (currentIndexing.shape.isClosed())\n utilities_1.concat(gcode, this.lineTo(initialPointX, initialPointY, settings.velocity, settings.decimals));\n childVertexIndex += currentIndexing.frameLength;\n }\n }\n /**\n *\n * @param penUpCommand\n * @returns\n */\n utilities_1.concat(gcode, this.goHome(settings.penUpCommand));\n return gcode;\n }\n static bufferToPoints(buffer) {\n const result = [];\n for (let i = 0, len = buffer.length; i < len; i += 2)\n result.push({ x: buffer[i], y: buffer[i + 1] });\n return result;\n }\n static pointsToBuffer(points) {\n const result = [];\n for (let i = 0, len = points.length; i < len; i++) {\n result.push(points[i].x);\n result.push(points[i].y);\n }\n return Float32Array.from(result);\n }\n}\nexports.GCODEExporter = GCODEExporter;\nGCODEExporter.defaults = {\n minX: 0,\n minY: 0,\n maxX: 297,\n maxY: 210,\n unit: 'millimeters',\n velocity: 1500,\n penUpCommand: 'M3 S30',\n penDownCommand: 'M3 S0',\n decimals: 2,\n};\n//# sourceMappingURL=GCODEExporter.js.map","/*! For license information please see urpflanze.min.js.LICENSE.txt */\n!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.Urpflanze=e():t.Urpflanze=e()}(window,(function(){return(()=>{var t={193:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Group=void 0;const n=r(107),i=r(15),o=r(485),a=r(658);class s extends i.SceneChild{constructor(t={}){t.type=\"Group\",super(t),this.children=[],[\"id\",\"name\",\"data\",\"order\",\"type\"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=a.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){\"object\"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=s},107:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Scene=void 0;const n=r(15),i=r(193),o=r(775),a=r(932);class s{constructor(t={}){this.width=400,this.height=400,this.background=\"hsla(0, 0%, 0%, 1)\",this.color=\"hsla(0, 0%, 100%, 1)\",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?[\"number\"==typeof t.anchor[0]?(.5+.5*a.clamp(-1,1,t.anchor[0]))*this.width:\"left\"===t.anchor[0]?0:\"right\"===t.anchor[0]?this.width:this.center[0],\"number\"==typeof t.anchor[1]?(.5+.5*a.clamp(-1,1,t.anchor[1]))*this.height:\"top\"===t.anchor[1]?0:\"bottom\"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e=\"number\"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,s.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{s.propagateToChilden(t,e)})):t instanceof o.Shape&&t.shape&&(t.shape.scene=e,s.propagateToChilden(t.shape,e))}}e.Scene=s},15:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||\"SceneChild\",this.name=t.name||this.type+\"_\"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){\"string\"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},932:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(21),i=r(345),o=r(271),a=\"undefined\"!=typeof performance?performance:Date;function s(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return a.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=s,e.relativeClamp=function(t,e,r,n,i){return s(n,i,(r-t)/(e-t)*(i-n)+n)};const u={random:new n(Math.random)};e.noise=function(t=\"random\",e=0,r=0,i=0){return void 0===u[t]&&(u[t]=new n(t)),u[t].noise3D(e,r,i)};const h={};function c(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),o=rn?[o,a]:[a,o]}function f(t,e){const r=t.length,n=r/2,i=2*(n+e),o=n-1;if(o>1){const n=r-2,a=Math.floor(e/o);let s=(i-(r+a*n))/2;const u=Math.round(o/s),h=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%u==0||e===n-2),p=a+(d?1:0),M=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);h[i]=(o=t(),a=t(),s=t(),u=t(),function(){let t=(o>>>=0)+(a>>>=0)|0;return o=a^a>>>9,a=(s>>>=0)+(s<<3)|0,t=t+(u=1+(u>>>=0)|0)|0,s=(s=s<<21|s>>>11)+t|0,(t>>>0)/4294967296})}var o,a,s,u;const c=e+h[i]()*(r-e);return void 0!==n?Math.round(c*10**n)/10**n:c},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return o.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=c,e.interpolate=function(t,e,r=.5){const[n,i]=c(t,e),o=Math.max(n.length,i.length),a=\"number\"==typeof r?[r]:r,s=o/2;if(a.length!==s){const t=a.length;for(let e=0;e{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return\"number\"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},348:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(887);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},888:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},658:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(700);var i;!function(t){t[t.None=0]=\"None\",t[t.Scale=2]=\"Scale\",t[t.Center=4]=\"Center\",t[t.Fill=8]=\"Fill\"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn(\"[Urplfanze:Bounding] cannot sum bounding\")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn(\"[Urplfanze:Bounding] cannot bind bounding\")}};class o extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return o.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=o.getBounding(t));const a=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,s=e>=i.Center?r.cx:0,u=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Close=void 0;const n=r(700);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},991:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Mirror=void 0;const n=r(700);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let o=0;o{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},62:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Offset=void 0;const n=r(700);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i},785:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Smooth=void 0;const n=r(932),i=r(364),o=r(700);class a extends o.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Solidify=void 0;const n=r(700);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const o=[],a=(e=\"number\"==typeof e?[e]:e).length;let s,u,h=[[0,0],[0,0]],c=[[0,0],[0,0]];for(let r=0,f=0,l=t.length-2;r{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Subdivide=void 0;const n=r(700);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Modifiers=void 0;const n=r(658),i=r(991),o=r(785),a=r(982),s=r(301),u=r(364),h=r(62),c={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:o.Smooth,Solidify:a.Solidify,Subdivide:s.Subdivide,Close:u.Close,Offset:h.Offset};e.Modifiers=c},775:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Shape=void 0;const n=r(107),i=r(15),o=r(485);class a extends o.ShapeBase{constructor(t){t.type=t.type||\"Shape\",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn(\"[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\\nYou passed:\",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):a.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeBase=void 0;const n=r(887),i=r(46),o=r(348),a=r(271),s=r(888),u=r(658),h=r(932),c=r(15),f=n.mat4.create(),l=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class M extends c.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?[\"number\"==typeof t.anchor[0]?-1*h.clamp(-1,1,t.anchor[0]):\"left\"===t.anchor[0]?1:\"right\"===t.anchor[0]?-1:0,\"number\"==typeof t.anchor[1]?-1*h.clamp(-1,1,t.anchor[1]):\"top\"===t.anchor[1]?1:\"bottom\"===t.anchor[1]?-1:0]:[0,0],this.boundingType=\"string\"==typeof t.boundingType?\"relative\"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return\"function\"!=typeof t.repetitions&&\"function\"!=typeof t.distance&&\"function\"!=typeof t.displace&&\"function\"!=typeof t.scale&&\"function\"!=typeof t.translate&&\"function\"!=typeof t.skewX&&\"function\"!=typeof t.skewY&&\"function\"!=typeof t.squeezeX&&\"function\"!=typeof t.squeezeY&&\"function\"!=typeof t.rotateX&&\"function\"!=typeof t.rotateY&&\"function\"!=typeof t.rotateZ&&\"function\"!=typeof t.transformOrigin&&\"function\"!=typeof t.perspective&&\"function\"!=typeof t.perspectiveOrigin}isStaticIndexed(){return\"function\"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return\"function\"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){\"string\"==typeof t?(r=r||\"repetitions\"==t,this.props[t]=e):(r=r||\"repetitions\"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var c,g;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const v=M.getEmptyPropArguments(this,r),m=v.repetition,b=this.getProp(\"repetitions\",v,1),y=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,x=Array.isArray(b)?b[0]*(null!==(c=b[1])&&void 0!==c?c:b[0]):b,S=Array.isArray(b)?b[0]:x,P=Array.isArray(b)?null!==(g=b[1])&&void 0!==g?g:b[0]:1,w=m.row;w.count=S;const B=m.col;B.count=P,m.count=x,m.col.count=P,m.row.count=S,m.type=y;let I=0;const R=[];let O=0;const A=n.vec2.fromValues((P-1)/2,(S-1)/2),L=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],E=[void 0,void 0,void 0,void 0],_=[void 0,void 0,void 0,void 0];for(let r=0;r1?O/(x-1):1,m.angle=y===i.ERepetitionType.Ring?s.PI2/x*O:0,B.index=c+1,B.offset=P>1?c/(P-1):1,w.index=r+1,w.offset=S>1?r/(S-1):1;const M=this.generateBuffer(t,v),g=M.length,b=this.getShapeBounding();R[O]=new Float32Array(g),I+=g;{const t=o.toVec2(this.getProp(\"distance\",v,o.VEC2_ZERO)),s=this.getProp(\"displace\",v,0),x=o.toVec3(this.getProp(\"scale\",v,o.VEC2_ONE),1),S=o.toVec3(this.getProp(\"translate\",v,o.VEC2_ZERO),0),P=this.getProp(\"skewX\",v,0),w=this.getProp(\"skewY\",v,0),B=this.getProp(\"squeezeX\",v,0),I=this.getProp(\"squeezeY\",v,0),F=this.getProp(\"rotateX\",v,0),C=this.getProp(\"rotateY\",v,0),j=this.getProp(\"rotateZ\",v,0),q=h.clamp(0,1,this.getProp(\"perspective\",v,0)),T=o.toVec3(this.getProp(\"perspectiveOrigin\",v,o.VEC2_ZERO),0),D=o.toVec3(this.getProp(\"transformOrigin\",v,o.VEC2_ZERO),0);let V;switch(y){case i.ERepetitionType.Ring:V=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(V,V,o.VEC3_ZERO,m.angle+s);break;case i.ERepetitionType.Matrix:V=n.vec3.fromValues(t[1]*(c-A[0]),t[0]*(r-A[1]),0)}const k=q>0?Math.max(b.width,b.height)/2:1,z=q>0?k+10*k*(1-q):0,U=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==q||0!==D[0]||0!==D[1],Y=0!==T[0]||0!==T[1];U&&(this.boundingType===i.EBoundingType.Relative?(D[0]=D[0]*(b.width/2)+b.cx,D[1]=D[1]*(b.height/2)+b.cy):(D[0]*=b.width/2,D[1]*=b.height/2),D[2]=z);{n.mat4.identity(l),U&&n.mat4.translate(l,l,D),0===S[0]&&0===S[1]||n.mat4.translate(l,l,S),0===P&&0===w||(o.fromSkew(f,[P,w]),n.mat4.multiply(l,l,f)),0!==F&&n.mat4.rotateX(l,l,F),0!==C&&n.mat4.rotateY(l,l,C),0!==j&&n.mat4.rotateZ(l,l,j),1===x[0]&&1===x[1]||n.mat4.scale(l,l,x),U&&n.mat4.translate(l,l,n.vec3.scale(D,D,-1)),z>0&&(Y&&(this.boundingType===i.EBoundingType.Relative?(T[0]=T[0]*(b.width/2)+b.cx,T[1]=T[1]*(b.height/2)+b.cy):(T[0]*=b.width/2,T[1]*=b.height/2),T[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,V),e&&n.mat4.translate(p,p,L);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),y===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,m.angle+s)}u.Bounding.clear(_);for(let t=0;t0&&(Y&&n.vec3.add(e,e,T),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,z),Y&&n.vec3.sub(e,e,T)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=g/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,v)}R[O][t]=e[0],R[O][t+1]=e[1],u.Bounding.add(_,e[0],e[1]),u.Bounding.add(E,e[0],e[1])}}const F={cx:0,cy:0,x:-1,y:-1,width:2,height:2};u.Bounding.bind(F,_),this.bStaticIndexed&&this.bIndexed||this.addIndex(g,m,F)}u.Bounding.bind(this.bounding,E),this.buffer=new Float32Array(I);for(let t=0,e=0,r=R.length;t({index:1,offset:1,count:1}),M.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...M.getEmptySimpleRepetition(),row:M.getEmptySimpleRepetition(),col:M.getEmptySimpleRepetition()})},425:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeBuffer=void 0;const n=r(658),i=r(436);class o extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||\"ShapeBuffer\",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn(\"[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property\"),this.shape=o.EMPTY_BUFFER):this.shape=\"function\"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return\"function\"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return\"function\"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from(\"function\"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,o=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&\"function\"!=typeof this.props.sideLength&&\"function\"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=o},549:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeFollow=void 0;const n=r(775);class i extends n.Shape{constructor(t){t.type=t.type||\"ShapeFollow\",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},o=this.shape;o.generate(t,!1,i);let a=o.getBuffer();const s=a.length,u=new Float32Array(s*(n.length/2)),h=n.length/2;for(let e=0;e1?e/(h-1):1,count:h};this.shapeUseFollow&&(i.follow=r,o.generate(t,!1,i),a=o.getBuffer());const c=e*s,f=2*e,l=n[f],d=n[f+1];for(let t=0,e=a.length;t1?t/(e-1):1;for(let a=0,s=o.length;a{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeLoop=void 0;const n=r(888),i=r(658),o=r(436),a=r(485);class s extends o.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||\"ShapeLoop\",super(t),this.loopDependencies=(t.loopDependencies||[]).concat(\"sideLength\"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes(\"propArguments\"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}\"loop\"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||a.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?(\"function\"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),o=this.getRepetitionSideLength(t),a=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,s={index:0,offset:0,current:0,count:n},u=s.count,h=new Float32Array(2*u);for(let n=0,i=0;n1?n/(s.count-1):1;s.current=o,s.index=n+1,s.offset=u;const c=a(s,t);h[i]=c[0],h[i+1]=c[1]}const c=[void 0,void 0,void 0,void 0],f=this.applyModifiers(h,t);for(let t=0,e=f.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapePrimitive=void 0;const n=r(348),i=r(485),o=r(700),a=r(658);class s extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=a.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:\"function\"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return\"function\"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:\"number\"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp(\"sideLength\",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeRecursive=void 0;const n=r(775);class i extends n.Shape{constructor(t){t.type=t.type||\"ShapeRecursive\",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return\"function\"!=typeof this.props.recursions&&\"function\"!=typeof this.props.recursionScale&&\"function\"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return\"function\"!=typeof this.props.recursions&&\"function\"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp(\"recursions\",e,1)),n=Math.floor(this.getProp(\"recursionVertex\",e,0)),o=this.getProp(\"recursionScale\",e,2),a=this.shape;let s={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const u={...e,recursion:s};a.generate(t,!1,u);const h=a.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=h);let c=h;const f=[s];let l=0,d=1;const p=c.length,M=p/2,g=n<=0?M:Math.min(n,M),v=0===n?1:M/Math.min(n,M),m=new Float32Array(i.summmation(r,g)*p);for(let t=0;t1?e/(r-1):1,h=i.summmation(e,g)*p,M=e-1,b=0===M?0:i.summmation(M,g)*p;for(let i=0,M=g**e;i1?i/(M-1):1,count:M,level:{index:e+1,offset:n,count:r},parent:f[l]},f.push(s),this.shapeUseRecursion&&(u.recursion=s,a.generate(t,!1,u),c=a.getBuffer());const y=h+i*p,x=Math.floor(b+2*i*v),S=m[x],P=m[x+1],w=o**e;for(let t=0,e=p;t1?0:1,count:o}}},u=this.shape.getIndexedBuffer()||[];for(let t=0,e=u.length;t1?0:1,count:o}},i={...s,recursion:r},a=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:a})}if(o>1){const t=this.shape.getBufferLength({...i,parent:{...s}})/2,e=a<=0?t:Math.min(a,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let h=0,c=1;for(let t=1;t1?t/(o-1):1;for(let a=0,f=e**t;a1?a/(f-1):1;for(let d=0,p=u.length;d{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Circle=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){t.type=\"Circle\",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=o},702:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Line=void 0;const n=r(658),i=r(425);class o extends i.ShapeBuffer{constructor(t={}){t.type=\"Line\",t.shape=o.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Lissajous=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){t.type=\"Lissajous\",t.loopDependencies=(t.loopDependencies||[]).concat([\"wx\",\"wy\",\"wz\"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp(\"wx\",t),r=this.getProp(\"wy\",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),o=this.getRepetitionSideLength(t);return 1/Math.pow(o[0]*o[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp(\"wx\",t,1),this.wy=this.getProp(\"wy\",t,2),this.wz=this.getProp(\"wz\",t,2),super.generateLoopBuffer(t)}}e.Lissajous=o},873:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Polygon=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){t.type=t.type||\"Polygon\",t.loopDependencies=(t.loopDependencies||[]).concat([\"sideNumber\"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp(\"sideNumber\",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=o},478:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Rect=void 0;const n=r(658),i=r(425);class o extends i.ShapeBuffer{constructor(t={}){t.type=\"Rect\",t.shape=o.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=o,o.buffer=[1,1,-1,1,-1,-1,1,-1]},710:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Rose=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){var e,r;t.type=\"Rose\",t.loopDependencies=(t.loopDependencies||[]).concat([\"n\",\"d\"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>o.getFinalAngleFromK(this.getProp(\"n\",t),this.getProp(\"d\",t)),inc:t=>{const e=this.getProp(\"n\",t),r=this.getProp(\"d\",t),i=this.getRepetitionSideLength(t),o=Math.pow(i[0]*i[1],.45),a=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp(\"n\",t)/this.getProp(\"d\",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=o},82:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Spiral=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type=\"Spiral\",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat([\"twists\",\"twistsStart\",\"spiral\"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:o.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp(\"twistsStart\",t),end:t=>n.PI2*(this.getProp(\"twistsStart\",t)+this.getProp(\"twists\",t)),inc:t=>{const e=this.getProp(\"twists\",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp(\"spiral\",t),this.r=o.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case o.types.ARCHIMEDE:return t=>t/10;case o.types.HYPERBOLIC:return t=>1/t*3;case o.types.FERMAT:return t=>t**.5/3;case o.types.LITUUS:return t=>t**-.5;case o.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=o,o.types={ARCHIMEDE:\"ARCHIMEDE\",HYPERBOLIC:\"HYPERBOLIC\",FERMAT:\"FERMAT\",LITUUS:\"LITUUS\",LOGARITHMIC:\"LOGARITHMIC\"}},490:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Star=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){t.type=t.type||\"Polygon\",t.loopDependencies=(t.loopDependencies||[]).concat([\"spikes\",\"innerRadius\"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp(\"spikes\",t,5),this.innerRadius=this.getProp(\"innerRadius\",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=o},845:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.SuperShape=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){var e,r,i,o,a,s;t.type=\"SuperShape\",t.loopDependencies=(t.loopDependencies||[]).concat([\"a\",\"b\",\"m\",\"n1\",\"n2\",\"n3\"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(o=t.n1)&&void 0!==o?o:1,this.props.n2=null!==(a=t.n2)&&void 0!==a?a:1,this.props.n3=null!==(s=t.n3)&&void 0!==s?s:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp(\"a\",t),this.b=this.getProp(\"b\",t),this.m=this.getProp(\"m\",t),this.n1=this.getProp(\"n1\",t),this.n2=this.getProp(\"n2\",t),this.n3=this.getProp(\"n3\",t),super.generateLoopBuffer(t)}}e.SuperShape=o},123:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Triangle=void 0;const n=r(658),i=r(425);class o extends i.ShapeBuffer{constructor(t={}){t.type=\"Triangle\",t.shape=o.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=o,o.buffer=[1,0,-1,1,-1,-1]},46:function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(574),e),i(r(636),e),i(r(345),e),i(r(920),e),i(r(676),e),i(r(300),e),i(r(273),e),i(r(511),e)},574:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},636:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},345:(t,e)=>{\"use strict\";var r;Object.defineProperty(e,\"__esModule\",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]=\"Ring\",r[r.Matrix=2]=\"Matrix\"},920:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},676:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},300:(t,e)=>{\"use strict\";var r;Object.defineProperty(e,\"__esModule\",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]=\"Relative\",r[r.Fixed=2]=\"Fixed\"},273:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},511:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},887:(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>o,mat3:()=>a,mat4:()=>s,quat:()=>c,quat2:()=>f,vec2:()=>l,vec3:()=>u,vec4:()=>h});var n={};r.r(n),r.d(n,{ARRAY_TYPE:()=>p,EPSILON:()=>d,RANDOM:()=>M,equals:()=>b,setMatrixArrayType:()=>g,toRadian:()=>m});var i={};r.r(i),r.d(i,{LDU:()=>T,add:()=>D,adjoint:()=>O,clone:()=>x,copy:()=>S,create:()=>y,determinant:()=>A,equals:()=>z,exactEquals:()=>k,frob:()=>q,fromRotation:()=>F,fromScaling:()=>C,fromValues:()=>w,identity:()=>P,invert:()=>R,mul:()=>N,multiply:()=>L,multiplyScalar:()=>U,multiplyScalarAndAdd:()=>Y,rotate:()=>E,scale:()=>_,set:()=>B,str:()=>j,sub:()=>Z,subtract:()=>V,transpose:()=>I});var o={};r.r(o),r.d(o,{add:()=>ht,clone:()=>H,copy:()=>G,create:()=>X,determinant:()=>J,equals:()=>pt,exactEquals:()=>dt,frob:()=>ut,fromRotation:()=>it,fromScaling:()=>ot,fromTranslation:()=>at,fromValues:()=>K,identity:()=>Q,invert:()=>$,mul:()=>Mt,multiply:()=>tt,multiplyScalar:()=>ft,multiplyScalarAndAdd:()=>lt,rotate:()=>et,scale:()=>rt,set:()=>W,str:()=>st,sub:()=>gt,subtract:()=>ct,translate:()=>nt});var a={};r.r(a),r.d(a,{add:()=>zt,adjoint:()=>It,clone:()=>bt,copy:()=>yt,create:()=>vt,determinant:()=>Rt,equals:()=>Xt,exactEquals:()=>Zt,frob:()=>kt,fromMat2d:()=>jt,fromMat4:()=>mt,fromQuat:()=>qt,fromRotation:()=>Ft,fromScaling:()=>Ct,fromTranslation:()=>_t,fromValues:()=>xt,identity:()=>Pt,invert:()=>Bt,mul:()=>Ht,multiply:()=>Ot,multiplyScalar:()=>Yt,multiplyScalarAndAdd:()=>Nt,normalFromMat4:()=>Tt,projection:()=>Dt,rotate:()=>Lt,scale:()=>Et,set:()=>St,str:()=>Vt,sub:()=>Gt,subtract:()=>Ut,translate:()=>At,transpose:()=>wt});var s={};r.r(s),r.d(s,{add:()=>Ce,adjoint:()=>ne,clone:()=>Kt,copy:()=>Wt,create:()=>Qt,determinant:()=>ie,equals:()=>Ve,exactEquals:()=>De,frob:()=>Fe,fromQuat:()=>Be,fromQuat2:()=>be,fromRotation:()=>pe,fromRotationTranslation:()=>me,fromRotationTranslationScale:()=>Pe,fromRotationTranslationScaleOrigin:()=>we,fromScaling:()=>de,fromTranslation:()=>le,fromValues:()=>$t,fromXRotation:()=>Me,fromYRotation:()=>ge,fromZRotation:()=>ve,frustum:()=>Ie,getRotation:()=>Se,getScaling:()=>xe,getTranslation:()=>ye,identity:()=>te,invert:()=>re,lookAt:()=>Le,mul:()=>ke,multiply:()=>oe,multiplyScalar:()=>qe,multiplyScalarAndAdd:()=>Te,ortho:()=>Ae,perspective:()=>Re,perspectiveFromFieldOfView:()=>Oe,rotate:()=>ue,rotateX:()=>he,rotateY:()=>ce,rotateZ:()=>fe,scale:()=>se,set:()=>Jt,str:()=>_e,sub:()=>ze,subtract:()=>je,targetTo:()=>Ee,translate:()=>ae,transpose:()=>ee});var u={};r.r(u),r.d(u,{add:()=>Ge,angle:()=>Pr,bezier:()=>Mr,ceil:()=>$e,clone:()=>Ye,copy:()=>Xe,create:()=>Ue,cross:()=>lr,dist:()=>_r,distance:()=>or,div:()=>Er,divide:()=>We,dot:()=>fr,equals:()=>Rr,exactEquals:()=>Ir,floor:()=>Je,forEach:()=>qr,fromValues:()=>Ze,hermite:()=>pr,inverse:()=>hr,len:()=>Cr,length:()=>Ne,lerp:()=>dr,max:()=>er,min:()=>tr,mul:()=>Lr,multiply:()=>Ke,negate:()=>ur,normalize:()=>cr,random:()=>gr,rotateX:()=>yr,rotateY:()=>xr,rotateZ:()=>Sr,round:()=>rr,scale:()=>nr,scaleAndAdd:()=>ir,set:()=>He,sqrDist:()=>Fr,sqrLen:()=>jr,squaredDistance:()=>ar,squaredLength:()=>sr,str:()=>Br,sub:()=>Ar,subtract:()=>Qe,transformMat3:()=>mr,transformMat4:()=>vr,transformQuat:()=>br,zero:()=>wr});var h={};r.r(h),r.d(h,{add:()=>Ur,ceil:()=>Xr,clone:()=>Dr,copy:()=>kr,create:()=>Tr,cross:()=>un,dist:()=>yn,distance:()=>Jr,div:()=>bn,divide:()=>Zr,dot:()=>sn,equals:()=>gn,exactEquals:()=>Mn,floor:()=>Hr,forEach:()=>wn,fromValues:()=>Vr,inverse:()=>on,len:()=>Sn,length:()=>en,lerp:()=>hn,max:()=>Qr,min:()=>Gr,mul:()=>mn,multiply:()=>Nr,negate:()=>nn,normalize:()=>an,random:()=>cn,round:()=>Kr,scale:()=>Wr,scaleAndAdd:()=>$r,set:()=>zr,sqrDist:()=>xn,sqrLen:()=>Pn,squaredDistance:()=>tn,squaredLength:()=>rn,str:()=>pn,sub:()=>vn,subtract:()=>Yr,transformMat4:()=>fn,transformQuat:()=>ln,zero:()=>dn});var c={};r.r(c),r.d(c,{add:()=>ei,calculateW:()=>Cn,clone:()=>Wn,conjugate:()=>zn,copy:()=>Jn,create:()=>Bn,dot:()=>ii,equals:()=>li,exactEquals:()=>fi,exp:()=>jn,fromEuler:()=>Yn,fromMat3:()=>Un,fromValues:()=>$n,getAngle:()=>An,getAxisAngle:()=>On,identity:()=>In,invert:()=>kn,len:()=>si,length:()=>ai,lerp:()=>oi,ln:()=>qn,mul:()=>ri,multiply:()=>Ln,normalize:()=>ci,pow:()=>Tn,random:()=>Vn,rotateX:()=>En,rotateY:()=>_n,rotateZ:()=>Fn,rotationTo:()=>di,scale:()=>ni,set:()=>ti,setAxes:()=>Mi,setAxisAngle:()=>Rn,slerp:()=>Dn,sqlerp:()=>pi,sqrLen:()=>hi,squaredLength:()=>ui,str:()=>Nn});var f={};r.r(f),r.d(f,{add:()=>Vi,clone:()=>vi,conjugate:()=>Xi,copy:()=>wi,create:()=>gi,dot:()=>Yi,equals:()=>to,exactEquals:()=>Ji,fromMat4:()=>Pi,fromRotation:()=>Si,fromRotationTranslation:()=>yi,fromRotationTranslationValues:()=>bi,fromTranslation:()=>xi,fromValues:()=>mi,getDual:()=>Oi,getReal:()=>Ri,getTranslation:()=>Ei,identity:()=>Bi,invert:()=>Zi,len:()=>Gi,length:()=>Hi,lerp:()=>Ni,mul:()=>zi,multiply:()=>ki,normalize:()=>Wi,rotateAroundAxis:()=>Di,rotateByQuatAppend:()=>qi,rotateByQuatPrepend:()=>Ti,rotateX:()=>Fi,rotateY:()=>Ci,rotateZ:()=>ji,scale:()=>Ui,set:()=>Ii,setDual:()=>Li,setReal:()=>Ai,sqrLen:()=>Ki,squaredLength:()=>Qi,str:()=>$i,translate:()=>_i});var l={};r.r(l),r.d(l,{add:()=>ao,angle:()=>Co,ceil:()=>co,clone:()=>ro,copy:()=>io,create:()=>eo,cross:()=>Io,dist:()=>Yo,distance:()=>mo,div:()=>Uo,divide:()=>ho,dot:()=>Bo,equals:()=>Do,exactEquals:()=>To,floor:()=>fo,forEach:()=>Xo,fromValues:()=>no,inverse:()=>Po,len:()=>Vo,length:()=>yo,lerp:()=>Ro,max:()=>po,min:()=>lo,mul:()=>zo,multiply:()=>uo,negate:()=>So,normalize:()=>wo,random:()=>Oo,rotate:()=>Fo,round:()=>Mo,scale:()=>go,scaleAndAdd:()=>vo,set:()=>oo,sqrDist:()=>No,sqrLen:()=>Zo,squaredDistance:()=>bo,squaredLength:()=>xo,str:()=>qo,sub:()=>ko,subtract:()=>so,transformMat2:()=>Ao,transformMat2d:()=>Lo,transformMat3:()=>Eo,transformMat4:()=>_o,zero:()=>jo});var d=1e-6,p=\"undefined\"!=typeof Float32Array?Float32Array:Array,M=Math.random;function g(t){p=t}var v=Math.PI/180;function m(t){return t*v}function b(t,e){return Math.abs(t-e)<=d*Math.max(1,Math.abs(t),Math.abs(e))}function y(){var t=new p(4);return p!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function x(t){var e=new p(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function S(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function P(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function w(t,e,r,n){var i=new p(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function B(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function I(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function R(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*o-i*n;return a?(a=1/a,t[0]=o*a,t[1]=-n*a,t[2]=-i*a,t[3]=r*a,t):null}function O(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function A(t){return t[0]*t[3]-t[2]*t[1]}function L(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*s+o*u,t[1]=i*s+a*u,t[2]=n*h+o*c,t[3]=i*h+a*c,t}function E(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+o*s,t[1]=i*u+a*s,t[2]=n*-s+o*u,t[3]=i*-s+a*u,t}function _(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1];return t[0]=n*s,t[1]=i*s,t[2]=o*u,t[3]=a*u,t}function F(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function C(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function j(t){return\"mat2(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}function q(t){return Math.hypot(t[0],t[1],t[2],t[3])}function T(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function D(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function V(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function k(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function z(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],h=e[3];return Math.abs(r-a)<=d*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-h)<=d*Math.max(1,Math.abs(o),Math.abs(h))}function U(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Y(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var N=L,Z=V;function X(){var t=new p(6);return p!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function H(t){var e=new p(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function G(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Q(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function K(t,e,r,n,i,o){var a=new p(6);return a[0]=t,a[1]=e,a[2]=r,a[3]=n,a[4]=i,a[5]=o,a}function W(t,e,r,n,i,o,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t}function $(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=r*o-n*i;return u?(u=1/u,t[0]=o*u,t[1]=-n*u,t[2]=-i*u,t[3]=r*u,t[4]=(i*s-o*a)*u,t[5]=(n*a-r*s)*u,t):null}function J(t){return t[0]*t[3]-t[1]*t[2]}function tt(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=r[0],c=r[1],f=r[2],l=r[3],d=r[4],p=r[5];return t[0]=n*h+o*c,t[1]=i*h+a*c,t[2]=n*f+o*l,t[3]=i*f+a*l,t[4]=n*d+o*p+s,t[5]=i*d+a*p+u,t}function et(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=Math.sin(r),c=Math.cos(r);return t[0]=n*c+o*h,t[1]=i*c+a*h,t[2]=n*-h+o*c,t[3]=i*-h+a*c,t[4]=s,t[5]=u,t}function rt(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=r[0],c=r[1];return t[0]=n*h,t[1]=i*h,t[2]=o*c,t[3]=a*c,t[4]=s,t[5]=u,t}function nt(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=n*h+o*c+s,t[5]=i*h+a*c+u,t}function it(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function ot(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function at(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function st(t){return\"mat2d(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\")\"}function ut(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function ht(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function ct(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function ft(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function lt(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function dt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function pt(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=e[0],h=e[1],c=e[2],f=e[3],l=e[4],p=e[5];return Math.abs(r-u)<=d*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-h)<=d*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-c)<=d*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(o-f)<=d*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-l)<=d*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(s-p)<=d*Math.max(1,Math.abs(s),Math.abs(p))}var Mt=tt,gt=ct;function vt(){var t=new p(9);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function mt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function bt(t){var e=new p(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function xt(t,e,r,n,i,o,a,s,u){var h=new p(9);return h[0]=t,h[1]=e,h[2]=r,h[3]=n,h[4]=i,h[5]=o,h[6]=a,h[7]=s,h[8]=u,h}function St(t,e,r,n,i,o,a,s,u,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=h,t}function Pt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function wt(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function Bt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8],f=c*a-s*h,l=-c*o+s*u,d=h*o-a*u,p=r*f+n*l+i*d;return p?(p=1/p,t[0]=f*p,t[1]=(-c*n+i*h)*p,t[2]=(s*n-i*a)*p,t[3]=l*p,t[4]=(c*r-i*u)*p,t[5]=(-s*r+i*o)*p,t[6]=d*p,t[7]=(-h*r+n*u)*p,t[8]=(a*r-n*o)*p,t):null}function It(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8];return t[0]=a*c-s*h,t[1]=i*h-n*c,t[2]=n*s-i*a,t[3]=s*u-o*c,t[4]=r*c-i*u,t[5]=i*o-r*s,t[6]=o*h-a*u,t[7]=n*u-r*h,t[8]=r*a-n*o,t}function Rt(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],h=t[8];return e*(h*o-a*u)+r*(-h*i+a*s)+n*(u*i-o*s)}function Ot(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=r[0],d=r[1],p=r[2],M=r[3],g=r[4],v=r[5],m=r[6],b=r[7],y=r[8];return t[0]=l*n+d*a+p*h,t[1]=l*i+d*s+p*c,t[2]=l*o+d*u+p*f,t[3]=M*n+g*a+v*h,t[4]=M*i+g*s+v*c,t[5]=M*o+g*u+v*f,t[6]=m*n+b*a+y*h,t[7]=m*i+b*s+y*c,t[8]=m*o+b*u+y*f,t}function At(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=l*n+d*a+h,t[7]=l*i+d*s+c,t[8]=l*o+d*u+f,t}function Lt(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=Math.sin(r),d=Math.cos(r);return t[0]=d*n+l*a,t[1]=d*i+l*s,t[2]=d*o+l*u,t[3]=d*a-l*n,t[4]=d*s-l*i,t[5]=d*u-l*o,t[6]=h,t[7]=c,t[8]=f,t}function Et(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function _t(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function Ft(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Ct(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function jt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function qt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,h=r*a,c=n*a,f=n*s,l=i*a,d=i*s,p=i*u,M=o*a,g=o*s,v=o*u;return t[0]=1-f-p,t[3]=c-v,t[6]=l+g,t[1]=c+v,t[4]=1-h-p,t[7]=d-M,t[2]=l-g,t[5]=d+M,t[8]=1-h-f,t}function Tt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8],f=e[9],l=e[10],d=e[11],p=e[12],M=e[13],g=e[14],v=e[15],m=r*s-n*a,b=r*u-i*a,y=r*h-o*a,x=n*u-i*s,S=n*h-o*s,P=i*h-o*u,w=c*M-f*p,B=c*g-l*p,I=c*v-d*p,R=f*g-l*M,O=f*v-d*M,A=l*v-d*g,L=m*A-b*O+y*R+x*I-S*B+P*w;return L?(L=1/L,t[0]=(s*A-u*O+h*R)*L,t[1]=(u*I-a*A-h*B)*L,t[2]=(a*O-s*I+h*w)*L,t[3]=(i*O-n*A-o*R)*L,t[4]=(r*A-i*I+o*B)*L,t[5]=(n*I-r*O-o*w)*L,t[6]=(M*P-g*S+v*x)*L,t[7]=(g*y-p*P-v*b)*L,t[8]=(p*S-M*y+v*m)*L,t):null}function Dt(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function Vt(t){return\"mat3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\")\"}function kt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function zt(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function Ut(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function Yt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function Nt(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function Zt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function Xt(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],h=t[7],c=t[8],f=e[0],l=e[1],p=e[2],M=e[3],g=e[4],v=e[5],m=e[6],b=e[7],y=e[8];return Math.abs(r-f)<=d*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(n-l)<=d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-p)<=d*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(o-M)<=d*Math.max(1,Math.abs(o),Math.abs(M))&&Math.abs(a-g)<=d*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(s-v)<=d*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(u-m)<=d*Math.max(1,Math.abs(u),Math.abs(m))&&Math.abs(h-b)<=d*Math.max(1,Math.abs(h),Math.abs(b))&&Math.abs(c-y)<=d*Math.max(1,Math.abs(c),Math.abs(y))}var Ht=Ot,Gt=Ut;function Qt(){var t=new p(16);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Kt(t){var e=new p(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Wt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function $t(t,e,r,n,i,o,a,s,u,h,c,f,l,d,M,g){var v=new p(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=n,v[4]=i,v[5]=o,v[6]=a,v[7]=s,v[8]=u,v[9]=h,v[10]=c,v[11]=f,v[12]=l,v[13]=d,v[14]=M,v[15]=g,v}function Jt(t,e,r,n,i,o,a,s,u,h,c,f,l,d,p,M,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=h,t[9]=c,t[10]=f,t[11]=l,t[12]=d,t[13]=p,t[14]=M,t[15]=g,t}function te(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ee(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function re(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8],f=e[9],l=e[10],d=e[11],p=e[12],M=e[13],g=e[14],v=e[15],m=r*s-n*a,b=r*u-i*a,y=r*h-o*a,x=n*u-i*s,S=n*h-o*s,P=i*h-o*u,w=c*M-f*p,B=c*g-l*p,I=c*v-d*p,R=f*g-l*M,O=f*v-d*M,A=l*v-d*g,L=m*A-b*O+y*R+x*I-S*B+P*w;return L?(L=1/L,t[0]=(s*A-u*O+h*R)*L,t[1]=(i*O-n*A-o*R)*L,t[2]=(M*P-g*S+v*x)*L,t[3]=(l*S-f*P-d*x)*L,t[4]=(u*I-a*A-h*B)*L,t[5]=(r*A-i*I+o*B)*L,t[6]=(g*y-p*P-v*b)*L,t[7]=(c*P-l*y+d*b)*L,t[8]=(a*O-s*I+h*w)*L,t[9]=(n*I-r*O-o*w)*L,t[10]=(p*S-M*y+v*m)*L,t[11]=(f*y-c*S-d*m)*L,t[12]=(s*B-a*R-u*w)*L,t[13]=(r*R-n*B+i*w)*L,t[14]=(M*b-p*x-g*m)*L,t[15]=(c*x-f*b+l*m)*L,t):null}function ne(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8],f=e[9],l=e[10],d=e[11],p=e[12],M=e[13],g=e[14],v=e[15];return t[0]=s*(l*v-d*g)-f*(u*v-h*g)+M*(u*d-h*l),t[1]=-(n*(l*v-d*g)-f*(i*v-o*g)+M*(i*d-o*l)),t[2]=n*(u*v-h*g)-s*(i*v-o*g)+M*(i*h-o*u),t[3]=-(n*(u*d-h*l)-s*(i*d-o*l)+f*(i*h-o*u)),t[4]=-(a*(l*v-d*g)-c*(u*v-h*g)+p*(u*d-h*l)),t[5]=r*(l*v-d*g)-c*(i*v-o*g)+p*(i*d-o*l),t[6]=-(r*(u*v-h*g)-a*(i*v-o*g)+p*(i*h-o*u)),t[7]=r*(u*d-h*l)-a*(i*d-o*l)+c*(i*h-o*u),t[8]=a*(f*v-d*M)-c*(s*v-h*M)+p*(s*d-h*f),t[9]=-(r*(f*v-d*M)-c*(n*v-o*M)+p*(n*d-o*f)),t[10]=r*(s*v-h*M)-a*(n*v-o*M)+p*(n*h-o*s),t[11]=-(r*(s*d-h*f)-a*(n*d-o*f)+c*(n*h-o*s)),t[12]=-(a*(f*g-l*M)-c*(s*g-u*M)+p*(s*l-u*f)),t[13]=r*(f*g-l*M)-c*(n*g-i*M)+p*(n*l-i*f),t[14]=-(r*(s*g-u*M)-a*(n*g-i*M)+p*(n*u-i*s)),t[15]=r*(s*l-u*f)-a*(n*l-i*f)+c*(n*u-i*s),t}function ie(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],h=t[8],c=t[9],f=t[10],l=t[11],d=t[12],p=t[13],M=t[14],g=t[15];return(e*a-r*o)*(f*g-l*M)-(e*s-n*o)*(c*g-l*p)+(e*u-i*o)*(c*M-f*p)+(r*s-n*a)*(h*g-l*d)-(r*u-i*a)*(h*M-f*d)+(n*u-i*s)*(h*p-c*d)}function oe(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=e[9],d=e[10],p=e[11],M=e[12],g=e[13],v=e[14],m=e[15],b=r[0],y=r[1],x=r[2],S=r[3];return t[0]=b*n+y*s+x*f+S*M,t[1]=b*i+y*u+x*l+S*g,t[2]=b*o+y*h+x*d+S*v,t[3]=b*a+y*c+x*p+S*m,b=r[4],y=r[5],x=r[6],S=r[7],t[4]=b*n+y*s+x*f+S*M,t[5]=b*i+y*u+x*l+S*g,t[6]=b*o+y*h+x*d+S*v,t[7]=b*a+y*c+x*p+S*m,b=r[8],y=r[9],x=r[10],S=r[11],t[8]=b*n+y*s+x*f+S*M,t[9]=b*i+y*u+x*l+S*g,t[10]=b*o+y*h+x*d+S*v,t[11]=b*a+y*c+x*p+S*m,b=r[12],y=r[13],x=r[14],S=r[15],t[12]=b*n+y*s+x*f+S*M,t[13]=b*i+y*u+x*l+S*g,t[14]=b*o+y*h+x*d+S*v,t[15]=b*a+y*c+x*p+S*m,t}function ae(t,e,r){var n,i,o,a,s,u,h,c,f,l,d,p,M=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*M+e[4]*g+e[8]*v+e[12],t[13]=e[1]*M+e[5]*g+e[9]*v+e[13],t[14]=e[2]*M+e[6]*g+e[10]*v+e[14],t[15]=e[3]*M+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=h,t[7]=c,t[8]=f,t[9]=l,t[10]=d,t[11]=p,t[12]=n*M+s*g+f*v+e[12],t[13]=i*M+u*g+l*v+e[13],t[14]=o*M+h*g+d*v+e[14],t[15]=a*M+c*g+p*v+e[15]),t}function se(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ue(t,e,r,n){var i,o,a,s,u,h,c,f,l,p,M,g,v,m,b,y,x,S,P,w,B,I,R,O,A=n[0],L=n[1],E=n[2],_=Math.hypot(A,L,E);return _0?(r[0]=2*(s*a+c*n+u*o-h*i)/f,r[1]=2*(u*a+c*i+h*n-s*o)/f,r[2]=2*(h*a+c*o+s*i-u*n)/f):(r[0]=2*(s*a+c*n+u*o-h*i),r[1]=2*(u*a+c*i+h*n-s*o),r[2]=2*(h*a+c*o+s*i-u*n)),me(t,e,r),t}function ye(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function xe(t,e){var r=e[0],n=e[1],i=e[2],o=e[4],a=e[5],s=e[6],u=e[8],h=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,h,c),t}function Se(t,e){var r=new p(3);xe(r,e);var n=1/r[0],i=1/r[1],o=1/r[2],a=e[0]*n,s=e[1]*i,u=e[2]*o,h=e[4]*n,c=e[5]*i,f=e[6]*o,l=e[8]*n,d=e[9]*i,M=e[10]*o,g=a+c+M,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(f-d)/v,t[1]=(l-u)/v,t[2]=(s-h)/v):a>c&&a>M?(v=2*Math.sqrt(1+a-c-M),t[3]=(f-d)/v,t[0]=.25*v,t[1]=(s+h)/v,t[2]=(l+u)/v):c>M?(v=2*Math.sqrt(1+c-a-M),t[3]=(l-u)/v,t[0]=(s+h)/v,t[1]=.25*v,t[2]=(f+d)/v):(v=2*Math.sqrt(1+M-a-c),t[3]=(s-h)/v,t[0]=(l+u)/v,t[1]=(f+d)/v,t[2]=.25*v),t}function Pe(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,h=o+o,c=a+a,f=i*u,l=i*h,d=i*c,p=o*h,M=o*c,g=a*c,v=s*u,m=s*h,b=s*c,y=n[0],x=n[1],S=n[2];return t[0]=(1-(p+g))*y,t[1]=(l+b)*y,t[2]=(d-m)*y,t[3]=0,t[4]=(l-b)*x,t[5]=(1-(f+g))*x,t[6]=(M+v)*x,t[7]=0,t[8]=(d+m)*S,t[9]=(M-v)*S,t[10]=(1-(f+p))*S,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function we(t,e,r,n,i){var o=e[0],a=e[1],s=e[2],u=e[3],h=o+o,c=a+a,f=s+s,l=o*h,d=o*c,p=o*f,M=a*c,g=a*f,v=s*f,m=u*h,b=u*c,y=u*f,x=n[0],S=n[1],P=n[2],w=i[0],B=i[1],I=i[2],R=(1-(M+v))*x,O=(d+y)*x,A=(p-b)*x,L=(d-y)*S,E=(1-(l+v))*S,_=(g+m)*S,F=(p+b)*P,C=(g-m)*P,j=(1-(l+M))*P;return t[0]=R,t[1]=O,t[2]=A,t[3]=0,t[4]=L,t[5]=E,t[6]=_,t[7]=0,t[8]=F,t[9]=C,t[10]=j,t[11]=0,t[12]=r[0]+w-(R*w+L*B+F*I),t[13]=r[1]+B-(O*w+E*B+C*I),t[14]=r[2]+I-(A*w+_*B+j*I),t[15]=1,t}function Be(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,h=r*a,c=n*a,f=n*s,l=i*a,d=i*s,p=i*u,M=o*a,g=o*s,v=o*u;return t[0]=1-f-p,t[1]=c+v,t[2]=l-g,t[3]=0,t[4]=c-v,t[5]=1-h-p,t[6]=d+M,t[7]=0,t[8]=l+g,t[9]=d-M,t[10]=1-h-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ie(t,e,r,n,i,o,a){var s=1/(r-e),u=1/(i-n),h=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*u,t[10]=(a+o)*h,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*h,t[15]=0,t}function Re(t,e,r,n,i){var o,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(n-i),t[10]=(i+n)*o,t[14]=2*i*n*o):(t[10]=-1,t[14]=-2*n),t}function Oe(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),h=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=h,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*h*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function Ae(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),h=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*h,t[15]=1,t}function Le(t,e,r,n){var i,o,a,s,u,h,c,f,l,p,M=e[0],g=e[1],v=e[2],m=n[0],b=n[1],y=n[2],x=r[0],S=r[1],P=r[2];return Math.abs(M-x)0&&(c*=d=1/Math.sqrt(d),f*=d,l*=d);var p=u*l-h*f,M=h*c-s*l,g=s*f-u*c;return(d=p*p+M*M+g*g)>0&&(p*=d=1/Math.sqrt(d),M*=d,g*=d),t[0]=p,t[1]=M,t[2]=g,t[3]=0,t[4]=f*g-l*M,t[5]=l*p-c*g,t[6]=c*M-f*p,t[7]=0,t[8]=c,t[9]=f,t[10]=l,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function _e(t){return\"mat4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\", \"+t[9]+\", \"+t[10]+\", \"+t[11]+\", \"+t[12]+\", \"+t[13]+\", \"+t[14]+\", \"+t[15]+\")\"}function Fe(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Ce(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function je(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function qe(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function Te(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function De(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function Ve(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],h=t[7],c=t[8],f=t[9],l=t[10],p=t[11],M=t[12],g=t[13],v=t[14],m=t[15],b=e[0],y=e[1],x=e[2],S=e[3],P=e[4],w=e[5],B=e[6],I=e[7],R=e[8],O=e[9],A=e[10],L=e[11],E=e[12],_=e[13],F=e[14],C=e[15];return Math.abs(r-b)<=d*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-y)<=d*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-x)<=d*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-S)<=d*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(a-P)<=d*Math.max(1,Math.abs(a),Math.abs(P))&&Math.abs(s-w)<=d*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(u-B)<=d*Math.max(1,Math.abs(u),Math.abs(B))&&Math.abs(h-I)<=d*Math.max(1,Math.abs(h),Math.abs(I))&&Math.abs(c-R)<=d*Math.max(1,Math.abs(c),Math.abs(R))&&Math.abs(f-O)<=d*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(l-A)<=d*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(p-L)<=d*Math.max(1,Math.abs(p),Math.abs(L))&&Math.abs(M-E)<=d*Math.max(1,Math.abs(M),Math.abs(E))&&Math.abs(g-_)<=d*Math.max(1,Math.abs(g),Math.abs(_))&&Math.abs(v-F)<=d*Math.max(1,Math.abs(v),Math.abs(F))&&Math.abs(m-C)<=d*Math.max(1,Math.abs(m),Math.abs(C))}var ke=oe,ze=je;function Ue(){var t=new p(3);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ye(t){var e=new p(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Ne(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function Ze(t,e,r){var n=new p(3);return n[0]=t,n[1]=e,n[2]=r,n}function Xe(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function He(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function Ge(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function Qe(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function Ke(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function We(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function $e(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Je(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function tr(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function er(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function rr(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function nr(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function ir(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function or(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function ar(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function sr(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function ur(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function hr(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function cr(t,e){var r=e[0],n=e[1],i=e[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function fr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function lr(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2];return t[0]=i*u-o*s,t[1]=o*a-n*u,t[2]=n*s-i*a,t}function dr(t,e,r,n){var i=e[0],o=e[1],a=e[2];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t}function pr(t,e,r,n,i,o){var a=o*o,s=a*(2*o-3)+1,u=a*(o-2)+o,h=a*(o-1),c=a*(3-2*o);return t[0]=e[0]*s+r[0]*u+n[0]*h+i[0]*c,t[1]=e[1]*s+r[1]*u+n[1]*h+i[1]*c,t[2]=e[2]*s+r[2]*u+n[2]*h+i[2]*c,t}function Mr(t,e,r,n,i,o){var a=1-o,s=a*a,u=o*o,h=s*a,c=3*o*s,f=3*u*a,l=u*o;return t[0]=e[0]*h+r[0]*c+n[0]*f+i[0]*l,t[1]=e[1]*h+r[1]*c+n[1]*f+i[1]*l,t[2]=e[2]*h+r[2]*c+n[2]*f+i[2]*l,t}function gr(t,e){e=e||1;var r=2*M()*Math.PI,n=2*M()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}function vr(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return a=a||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/a,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,t}function mr(t,e,r){var n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}function br(t,e,r){var n=r[0],i=r[1],o=r[2],a=r[3],s=e[0],u=e[1],h=e[2],c=i*h-o*u,f=o*s-n*h,l=n*u-i*s,d=i*l-o*f,p=o*c-n*l,M=n*f-i*c,g=2*a;return c*=g,f*=g,l*=g,d*=2,p*=2,M*=2,t[0]=s+c+d,t[1]=u+f+p,t[2]=h+l+M,t}function yr(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function xr(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function Sr(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function Pr(t,e){var r=t[0],n=t[1],i=t[2],o=e[0],a=e[1],s=e[2],u=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(o*o+a*a+s*s),h=u&&fr(t,e)/u;return Math.acos(Math.min(Math.max(h,-1),1))}function wr(t){return t[0]=0,t[1]=0,t[2]=0,t}function Br(t){return\"vec3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\")\"}function Ir(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Rr(t,e){var r=t[0],n=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-s)<=d*Math.max(1,Math.abs(i),Math.abs(s))}var Or,Ar=Qe,Lr=Ke,Er=We,_r=or,Fr=ar,Cr=Ne,jr=sr,qr=(Or=Ue(),function(t,e,r,n,i,o){var a,s;for(e||(e=3),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,a=r;a0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=o*a,t}function sn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function un(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],o=r[0]*n[2]-r[2]*n[0],a=r[0]*n[3]-r[3]*n[0],s=r[1]*n[2]-r[2]*n[1],u=r[1]*n[3]-r[3]*n[1],h=r[2]*n[3]-r[3]*n[2],c=e[0],f=e[1],l=e[2],d=e[3];return t[0]=f*h-l*u+d*s,t[1]=-c*h+l*a-d*o,t[2]=c*u-f*a+d*i,t[3]=-c*s+f*o-l*i,t}function hn(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t[3]=s+n*(r[3]-s),t}function cn(t,e){var r,n,i,o,a,s;e=e||1;do{a=(r=2*M()-1)*r+(n=2*M()-1)*n}while(a>=1);do{s=(i=2*M()-1)*i+(o=2*M()-1)*o}while(s>=1);var u=Math.sqrt((1-a)/s);return t[0]=e*r,t[1]=e*n,t[2]=e*i*u,t[3]=e*o*u,t}function fn(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}function ln(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2],h=r[3],c=h*n+s*o-u*i,f=h*i+u*n-a*o,l=h*o+a*i-s*n,d=-a*n-s*i-u*o;return t[0]=c*h+d*-a+f*-u-l*-s,t[1]=f*h+d*-s+l*-a-c*-u,t[2]=l*h+d*-u+c*-s-f*-a,t[3]=e[3],t}function dn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function pn(t){return\"vec4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}function Mn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function gn(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],h=e[3];return Math.abs(r-a)<=d*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-h)<=d*Math.max(1,Math.abs(o),Math.abs(h))}var vn=Yr,mn=Nr,bn=Zr,yn=Jr,xn=tn,Sn=en,Pn=rn,wn=function(){var t=Tr();return function(e,r,n,i,o,a){var s,u;for(r||(r=4),n||(n=0),u=i?Math.min(i*r+n,e.length):e.length,s=n;sd?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r}function An(t,e){var r=ii(t,e);return Math.acos(2*r*r-1)}function Ln(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*c+a*s+i*h-o*u,t[1]=i*c+a*u+o*s-n*h,t[2]=o*c+a*h+n*u-i*s,t[3]=a*c-n*s-i*u-o*h,t}function En(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+a*s,t[1]=i*u+o*s,t[2]=o*u-i*s,t[3]=a*u-n*s,t}function _n(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u-o*s,t[1]=i*u+a*s,t[2]=o*u+n*s,t[3]=a*u-i*s,t}function Fn(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+i*s,t[1]=i*u-n*s,t[2]=o*u+a*s,t[3]=a*u-o*s,t}function Cn(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function jn(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=Math.sqrt(r*r+n*n+i*i),s=Math.exp(o),u=a>0?s*Math.sin(a)/a:0;return t[0]=r*u,t[1]=n*u,t[2]=i*u,t[3]=s*Math.cos(a),t}function qn(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=Math.sqrt(r*r+n*n+i*i),s=a>0?Math.atan2(a,o)/a:0;return t[0]=r*s,t[1]=n*s,t[2]=i*s,t[3]=.5*Math.log(r*r+n*n+i*i+o*o),t}function Tn(t,e,r){return qn(t,e),ni(t,t,r),jn(t,t),t}function Dn(t,e,r,n){var i,o,a,s,u,h=e[0],c=e[1],f=e[2],l=e[3],p=r[0],M=r[1],g=r[2],v=r[3];return(o=h*p+c*M+f*g+l*v)<0&&(o=-o,p=-p,M=-M,g=-g,v=-v),1-o>d?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-n)*i)/a,u=Math.sin(n*i)/a):(s=1-n,u=n),t[0]=s*h+u*p,t[1]=s*c+u*M,t[2]=s*f+u*g,t[3]=s*l+u*v,t}function Vn(t){var e=M(),r=M(),n=M(),i=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*r),t[1]=i*Math.cos(2*Math.PI*r),t[2]=o*Math.sin(2*Math.PI*n),t[3]=o*Math.cos(2*Math.PI*n),t}function kn(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o,s=a?1/a:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=o*s,t}function zn(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Un(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*o+a]-e[3*a+o])*r,t[o]=(e[3*o+i]+e[3*i+o])*r,t[a]=(e[3*a+i]+e[3*i+a])*r}return t}function Yn(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(r),u=Math.cos(r),h=Math.sin(n),c=Math.cos(n);return t[0]=o*u*c-a*s*h,t[1]=a*s*c+o*u*h,t[2]=a*u*h-o*s*c,t[3]=a*u*c+o*s*h,t}function Nn(t){return\"quat(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}var Zn,Xn,Hn,Gn,Qn,Kn,Wn=Dr,$n=Vr,Jn=kr,ti=zr,ei=Ur,ri=Ln,ni=Wr,ii=sn,oi=hn,ai=en,si=ai,ui=rn,hi=ui,ci=an,fi=Mn,li=gn,di=(Zn=Ue(),Xn=Ze(1,0,0),Hn=Ze(0,1,0),function(t,e,r){var n=fr(e,r);return n<-.999999?(lr(Zn,Xn,e),Cr(Zn)<1e-6&&lr(Zn,Hn,e),cr(Zn,Zn),Rn(t,Zn,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(lr(Zn,e,r),t[0]=Zn[0],t[1]=Zn[1],t[2]=Zn[2],t[3]=1+n,ci(t,t))}),pi=(Gn=Bn(),Qn=Bn(),function(t,e,r,n,i,o){return Dn(Gn,e,i,o),Dn(Qn,r,n,o),Dn(t,Gn,Qn,2*o*(1-o)),t}),Mi=(Kn=vt(),function(t,e,r,n){return Kn[0]=r[0],Kn[3]=r[1],Kn[6]=r[2],Kn[1]=n[0],Kn[4]=n[1],Kn[7]=n[2],Kn[2]=-e[0],Kn[5]=-e[1],Kn[8]=-e[2],ci(t,Un(t,Kn))});function gi(){var t=new p(8);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function vi(t){var e=new p(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function mi(t,e,r,n,i,o,a,s){var u=new p(8);return u[0]=t,u[1]=e,u[2]=r,u[3]=n,u[4]=i,u[5]=o,u[6]=a,u[7]=s,u}function bi(t,e,r,n,i,o,a){var s=new p(8);s[0]=t,s[1]=e,s[2]=r,s[3]=n;var u=.5*i,h=.5*o,c=.5*a;return s[4]=u*n+h*r-c*e,s[5]=h*n+c*t-u*r,s[6]=c*n+u*e-h*t,s[7]=-u*t-h*e-c*r,s}function yi(t,e,r){var n=.5*r[0],i=.5*r[1],o=.5*r[2],a=e[0],s=e[1],u=e[2],h=e[3];return t[0]=a,t[1]=s,t[2]=u,t[3]=h,t[4]=n*h+i*u-o*s,t[5]=i*h+o*a-n*u,t[6]=o*h+n*s-i*a,t[7]=-n*a-i*s-o*u,t}function xi(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function Si(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Pi(t,e){var r=Bn();Se(r,e);var n=new p(3);return ye(n,e),yi(t,r,n),t}function wi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function Bi(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Ii(t,e,r,n,i,o,a,s,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t}var Ri=Jn;function Oi(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var Ai=Jn;function Li(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function Ei(t,e){var r=e[4],n=e[5],i=e[6],o=e[7],a=-e[0],s=-e[1],u=-e[2],h=e[3];return t[0]=2*(r*h+o*a+n*u-i*s),t[1]=2*(n*h+o*s+i*a-r*u),t[2]=2*(i*h+o*u+r*s-n*a),t}function _i(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=.5*r[0],u=.5*r[1],h=.5*r[2],c=e[4],f=e[5],l=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=a*s+i*h-o*u+c,t[5]=a*u+o*s-n*h+f,t[6]=a*h+n*u-i*s+l,t[7]=-n*s-i*u-o*h+d,t}function Fi(t,e,r){var n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=s*a+c*n+u*o-h*i,l=u*a+c*i+h*n-s*o,d=h*a+c*o+s*i-u*n,p=c*a-s*n-u*i-h*o;return En(t,e,r),n=t[0],i=t[1],o=t[2],a=t[3],t[4]=f*a+p*n+l*o-d*i,t[5]=l*a+p*i+d*n-f*o,t[6]=d*a+p*o+f*i-l*n,t[7]=p*a-f*n-l*i-d*o,t}function Ci(t,e,r){var n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=s*a+c*n+u*o-h*i,l=u*a+c*i+h*n-s*o,d=h*a+c*o+s*i-u*n,p=c*a-s*n-u*i-h*o;return _n(t,e,r),n=t[0],i=t[1],o=t[2],a=t[3],t[4]=f*a+p*n+l*o-d*i,t[5]=l*a+p*i+d*n-f*o,t[6]=d*a+p*o+f*i-l*n,t[7]=p*a-f*n-l*i-d*o,t}function ji(t,e,r){var n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=s*a+c*n+u*o-h*i,l=u*a+c*i+h*n-s*o,d=h*a+c*o+s*i-u*n,p=c*a-s*n-u*i-h*o;return Fn(t,e,r),n=t[0],i=t[1],o=t[2],a=t[3],t[4]=f*a+p*n+l*o-d*i,t[5]=l*a+p*i+d*n-f*o,t[6]=d*a+p*o+f*i-l*n,t[7]=p*a-f*n-l*i-d*o,t}function qi(t,e,r){var n=r[0],i=r[1],o=r[2],a=r[3],s=e[0],u=e[1],h=e[2],c=e[3];return t[0]=s*a+c*n+u*o-h*i,t[1]=u*a+c*i+h*n-s*o,t[2]=h*a+c*o+s*i-u*n,t[3]=c*a-s*n-u*i-h*o,s=e[4],u=e[5],h=e[6],c=e[7],t[4]=s*a+c*n+u*o-h*i,t[5]=u*a+c*i+h*n-s*o,t[6]=h*a+c*o+s*i-u*n,t[7]=c*a-s*n-u*i-h*o,t}function Ti(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*c+a*s+i*h-o*u,t[1]=i*c+a*u+o*s-n*h,t[2]=o*c+a*h+n*u-i*s,t[3]=a*c-n*s-i*u-o*h,s=r[4],u=r[5],h=r[6],c=r[7],t[4]=n*c+a*s+i*h-o*u,t[5]=i*c+a*u+o*s-n*h,t[6]=o*c+a*h+n*u-i*s,t[7]=a*c-n*s-i*u-o*h,t}function Di(t,e,r,n){if(Math.abs(n)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,o=e[2]/r,a=e[3]/r,s=e[4],u=e[5],h=e[6],c=e[7],f=n*s+i*u+o*h+a*c;t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=(s-n*f)/r,t[5]=(u-i*f)/r,t[6]=(h-o*f)/r,t[7]=(c-a*f)/r}return t}function $i(t){return\"quat2(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\")\"}function Ji(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function to(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],h=t[7],c=e[0],f=e[1],l=e[2],p=e[3],M=e[4],g=e[5],v=e[6],m=e[7];return Math.abs(r-c)<=d*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(n-f)<=d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-l)<=d*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(o-p)<=d*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-M)<=d*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(s-g)<=d*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(u-v)<=d*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(h-m)<=d*Math.max(1,Math.abs(h),Math.abs(m))}function eo(){var t=new p(2);return p!=Float32Array&&(t[0]=0,t[1]=0),t}function ro(t){var e=new p(2);return e[0]=t[0],e[1]=t[1],e}function no(t,e){var r=new p(2);return r[0]=t,r[1]=e,r}function io(t,e){return t[0]=e[0],t[1]=e[1],t}function oo(t,e,r){return t[0]=e,t[1]=r,t}function ao(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function so(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function uo(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function ho(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function co(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function fo(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function lo(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function po(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function Mo(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function go(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function vo(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function mo(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function bo(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function yo(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function xo(t){var e=t[0],r=t[1];return e*e+r*r}function So(t,e){return t[0]=-e[0],t[1]=-e[1],t}function Po(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function wo(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function Bo(t,e){return t[0]*e[0]+t[1]*e[1]}function Io(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function Ro(t,e,r,n){var i=e[0],o=e[1];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t}function Oo(t,e){e=e||1;var r=2*M()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function Ao(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function Lo(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function Eo(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function _o(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function Fo(t,e,r,n){var i=e[0]-r[0],o=e[1]-r[1],a=Math.sin(n),s=Math.cos(n);return t[0]=i*s-o*a+r[0],t[1]=i*a+o*s+r[1],t}function Co(t,e){var r=t[0],n=t[1],i=e[0],o=e[1],a=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+o*o),s=a&&(r*i+n*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function jo(t){return t[0]=0,t[1]=0,t}function qo(t){return\"vec2(\"+t[0]+\", \"+t[1]+\")\"}function To(t,e){return t[0]===e[0]&&t[1]===e[1]}function Do(t,e){var r=t[0],n=t[1],i=e[0],o=e[1];return Math.abs(r-i)<=d*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-o)<=d*Math.max(1,Math.abs(n),Math.abs(o))}var Vo=yo,ko=so,zo=uo,Uo=ho,Yo=mo,No=bo,Zo=xo,Xo=function(){var t=eo();return function(e,r,n,i,o,a){var s,u;for(r||(r=2),n||(n=0),u=i?Math.min(i*r+n,e.length):e.length,s=n;s{var n;!function(){\"use strict\";var i=.5*(Math.sqrt(3)-1),o=(3-Math.sqrt(3))/6,a=1/6,s=(Math.sqrt(5)-1)/4,u=(5-Math.sqrt(5))/20;function h(t){var e;e=\"function\"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=f();t=i(\" \"),e=i(\" \"),r=i(\" \");for(var o=0;o>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}h.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,a=this.permMod12,s=this.perm,u=this.grad3,h=0,c=0,f=0,l=(t+e)*i,d=Math.floor(t+l),p=Math.floor(e+l),M=(d+p)*o,g=t-(d-M),v=e-(p-M);g>v?(r=1,n=0):(r=0,n=1);var m=g-r+o,b=v-n+o,y=g-1+2*o,x=v-1+2*o,S=255&d,P=255&p,w=.5-g*g-v*v;if(w>=0){var B=3*a[S+s[P]];h=(w*=w)*w*(u[B]*g+u[B+1]*v)}var I=.5-m*m-b*b;if(I>=0){var R=3*a[S+r+s[P+n]];c=(I*=I)*I*(u[R]*m+u[R+1]*b)}var O=.5-y*y-x*x;if(O>=0){var A=3*a[S+1+s[P+1]];f=(O*=O)*O*(u[A]*y+u[A+1]*x)}return 70*(h+c+f)},noise3D:function(t,e,r){var n,i,o,s,u,h,c,f,l,d,p=this.permMod12,M=this.perm,g=this.grad3,v=.3333333333333333*(t+e+r),m=Math.floor(t+v),b=Math.floor(e+v),y=Math.floor(r+v),x=(m+b+y)*a,S=t-(m-x),P=e-(b-x),w=r-(y-x);S>=P?P>=w?(u=1,h=0,c=0,f=1,l=1,d=0):S>=w?(u=1,h=0,c=0,f=1,l=0,d=1):(u=0,h=0,c=1,f=1,l=0,d=1):P_?j++:q++,E>F?j++:T++,E>C?j++:D++,_>F?q++:T++,_>C?q++:D++,F>C?T++:D++;var V=E-(f=j>=3?1:0)+u,k=_-(l=q>=3?1:0)+u,z=F-(d=T>=3?1:0)+u,U=C-(p=D>=3?1:0)+u,Y=E-(M=j>=2?1:0)+2*u,N=_-(g=q>=2?1:0)+2*u,Z=F-(v=T>=2?1:0)+2*u,X=C-(m=D>=2?1:0)+2*u,H=E-(b=j>=1?1:0)+3*u,G=_-(y=q>=1?1:0)+3*u,Q=F-(x=T>=1?1:0)+3*u,K=C-(S=D>=1?1:0)+3*u,W=E-1+4*u,$=_-1+4*u,J=F-1+4*u,tt=C-1+4*u,et=255&I,rt=255&R,nt=255&O,it=255&A,ot=.6-E*E-_*_-F*F-C*C;if(ot<0)i=0;else{var at=P[et+P[rt+P[nt+P[it]]]]%32*4;i=(ot*=ot)*ot*(w[at]*E+w[at+1]*_+w[at+2]*F+w[at+3]*C)}var st=.6-V*V-k*k-z*z-U*U;if(st<0)o=0;else{var ut=P[et+f+P[rt+l+P[nt+d+P[it+p]]]]%32*4;o=(st*=st)*st*(w[ut]*V+w[ut+1]*k+w[ut+2]*z+w[ut+3]*U)}var ht=.6-Y*Y-N*N-Z*Z-X*X;if(ht<0)a=0;else{var ct=P[et+M+P[rt+g+P[nt+v+P[it+m]]]]%32*4;a=(ht*=ht)*ht*(w[ct]*Y+w[ct+1]*N+w[ct+2]*Z+w[ct+3]*X)}var ft=.6-H*H-G*G-Q*Q-K*K;if(ft<0)h=0;else{var lt=P[et+b+P[rt+y+P[nt+x+P[it+S]]]]%32*4;h=(ft*=ft)*ft*(w[lt]*H+w[lt+1]*G+w[lt+2]*Q+w[lt+3]*K)}var dt=.6-W*W-$*$-J*J-tt*tt;if(dt<0)c=0;else{var pt=P[et+1+P[rt+1+P[nt+1+P[it+1]]]]%32*4;c=(dt*=dt)*dt*(w[pt]*W+w[pt+1]*$+w[pt+2]*J+w[pt+3]*tt)}return 27*(i+o+a+h+c)}},h._buildPermutationTable=c,void 0===(n=function(){return h}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=h,t.exports=h}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r(915)})()}));","/*\n (c) 2017, Vladimir Agafonkin\n Simplify.js, a high-performance JS polyline simplification library\n mourner.github.io/simplify-js\n*/\n\n(function () { 'use strict';\n\n// to suit your point format, run search/replace for '.x' and '.y';\n// for 3D version, see 3d branch (configurability would draw significant performance overhead)\n\n// square distance between 2 points\nfunction getSqDist(p1, p2) {\n\n var dx = p1.x - p2.x,\n dy = p1.y - p2.y;\n\n return dx * dx + dy * dy;\n}\n\n// square distance from a point to a segment\nfunction getSqSegDist(p, p1, p2) {\n\n var x = p1.x,\n y = p1.y,\n dx = p2.x - x,\n dy = p2.y - y;\n\n if (dx !== 0 || dy !== 0) {\n\n var t = ((p.x - x) * dx + (p.y - y) * dy) / (dx * dx + dy * dy);\n\n if (t > 1) {\n x = p2.x;\n y = p2.y;\n\n } else if (t > 0) {\n x += dx * t;\n y += dy * t;\n }\n }\n\n dx = p.x - x;\n dy = p.y - y;\n\n return dx * dx + dy * dy;\n}\n// rest of the code doesn't care about point format\n\n// basic distance-based simplification\nfunction simplifyRadialDist(points, sqTolerance) {\n\n var prevPoint = points[0],\n newPoints = [prevPoint],\n point;\n\n for (var i = 1, len = points.length; i < len; i++) {\n point = points[i];\n\n if (getSqDist(point, prevPoint) > sqTolerance) {\n newPoints.push(point);\n prevPoint = point;\n }\n }\n\n if (prevPoint !== point) newPoints.push(point);\n\n return newPoints;\n}\n\nfunction simplifyDPStep(points, first, last, sqTolerance, simplified) {\n var maxSqDist = sqTolerance,\n index;\n\n for (var i = first + 1; i < last; i++) {\n var sqDist = getSqSegDist(points[i], points[first], points[last]);\n\n if (sqDist > maxSqDist) {\n index = i;\n maxSqDist = sqDist;\n }\n }\n\n if (maxSqDist > sqTolerance) {\n if (index - first > 1) simplifyDPStep(points, first, index, sqTolerance, simplified);\n simplified.push(points[index]);\n if (last - index > 1) simplifyDPStep(points, index, last, sqTolerance, simplified);\n }\n}\n\n// simplification using Ramer-Douglas-Peucker algorithm\nfunction simplifyDouglasPeucker(points, sqTolerance) {\n var last = points.length - 1;\n\n var simplified = [points[0]];\n simplifyDPStep(points, 0, last, sqTolerance, simplified);\n simplified.push(points[last]);\n\n return simplified;\n}\n\n// both algorithms combined for awesome performance\nfunction simplify(points, tolerance, highestQuality) {\n\n if (points.length <= 2) return points;\n\n var sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1;\n\n points = highestQuality ? points : simplifyRadialDist(points, sqTolerance);\n points = simplifyDouglasPeucker(points, sqTolerance);\n\n return points;\n}\n\n// export as AMD module / Node module / browser or worker variable\nif (typeof define === 'function' && define.amd) define(function() { return simplify; });\nelse if (typeof module !== 'undefined') {\n module.exports = simplify;\n module.exports.default = simplify;\n} else if (typeof self !== 'undefined') self.simplify = simplify;\nelse window.simplify = simplify;\n\n})();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.concat = exports.round = void 0;\nconst round = (value, decimals) => Math.round(value * 10 ** decimals) / 10 ** decimals;\nexports.round = round;\nconst concat = (result, data) => {\n if (typeof data === 'string')\n result.push(data);\n else\n data.forEach(line => result.push(line));\n};\nexports.concat = concat;\n//# sourceMappingURL=utilities.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./SVGExporter\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SVGExporter = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nclass SVGExporter {\n static parse(scene, settings = {}) {\n const bindedSettings = {\n ...SVGExporter.defaults,\n ...settings,\n };\n return SVGExporter.generate(scene, bindedSettings);\n }\n /**\n * Get drawer prop\n *\n * @param key name of the property (fill, stroke, lineWidth)\n * @param propArguments currentIndexing propArguments\n * @param defaultValue\n *\n * @returns string | number\n */\n static getSVGProp(key, propArguments, defaultValue) {\n let attribute = propArguments.shape.drawer[key];\n if (typeof attribute === 'function') {\n attribute = attribute(propArguments);\n }\n return attribute !== null && attribute !== void 0 ? attribute : defaultValue;\n }\n /**\n *\n * @param type fill | stroke\n * @param color string\n * @param attriburesPtr list of attributes to apply\n * @param stylePtr Array of string to put in style attr\n *\n * @returns\n */\n static bindColorAttribute(type, color, attriburesPtr, stylePtr) {\n if (typeof color === 'undefined')\n return;\n if (color === 'none') {\n attriburesPtr.push(`${type}=\"none\"`);\n }\n else {\n const parsed = color_1.parseColorAndConvert(color);\n if (parsed) {\n if (parsed.alpha !== 1) {\n stylePtr.push(`${type}-opacity: ${parsed.alpha}`);\n }\n attriburesPtr.push(`${type}=\"${color_1.rgbToHex(parsed.r, parsed.g, parsed.b)}\"`);\n }\n }\n }\n /**\n * Generate SVG from scene and settings\n *\n * @param scene\n * @param settings\n * @returns\n */\n static generate(scene, settings) {\n const paths = SVGExporter.generatePaths(scene, settings);\n let background;\n if (settings.background) {\n const attributes = [];\n const styles = [];\n SVGExporter.bindColorAttribute('fill', scene.background, attributes, styles);\n styles.length > 0 && attributes.push(`styles=\"${styles.join('; ')}\"`);\n background = ``;\n }\n return (`` +\n `\\n\\t` +\n (background ? `\\n\\t${background}` : '') +\n `\\n\\t${paths.join('\\n\\t')}` +\n `\\n`);\n }\n /**\n * Convert shapes to paths\n *\n * @param scene\n * @param settings\n * @returns\n */\n static generatePaths(scene, settings) {\n const paths = [];\n const sceneChilds = scene.getChildren();\n for (let i = 0, len = sceneChilds.length; i < len; i++) {\n sceneChilds[i].generate(0, true);\n const childBuffer = sceneChilds[i].getBuffer() || [];\n const childIndexedBuffer = sceneChilds[i].getIndexedBuffer() || [];\n let childVertexIndex = 0;\n for (let currentBufferIndex = 0, len = childIndexedBuffer.length; currentBufferIndex < len; currentBufferIndex++) {\n const currentIndexing = childIndexedBuffer[currentBufferIndex];\n // Store points\n const points = [];\n for (let len = childVertexIndex + currentIndexing.frameLength; childVertexIndex < len; childVertexIndex += 2) {\n points.push(childBuffer[childVertexIndex].toFixed(settings.decimals) +\n ' ' +\n childBuffer[childVertexIndex + 1].toFixed(settings.decimals));\n }\n // get styles and bind attributes\n const propArguments = {\n shape: currentIndexing.shape,\n repetition: currentIndexing.repetition,\n parent: currentIndexing.parent,\n };\n const attributes = [];\n const styles = [];\n const fill = SVGExporter.getSVGProp('fill', propArguments);\n SVGExporter.bindColorAttribute('fill', fill || 'none', attributes, styles);\n const stroke = SVGExporter.getSVGProp('stroke', propArguments, typeof fill === 'undefined' ? scene.color : undefined);\n SVGExporter.bindColorAttribute('stroke', stroke, attributes, styles);\n const lineWidth = SVGExporter.getSVGProp('lineWidth', propArguments, 1);\n if (stroke)\n attributes.push(`stroke-width=\"${lineWidth || 1}\"`);\n // move style to attributes\n styles.length > 0 && attributes.push(`style=\"${styles.join('; ')}\"`);\n // build path\n const d = `M${points.join(' L')} ${currentIndexing.shape.isClosed() ? 'Z' : ''}`;\n const path = ``;\n paths.push(path);\n }\n }\n return paths;\n }\n}\nexports.SVGExporter = SVGExporter;\nSVGExporter.defaults = {\n decimals: 3,\n background: true,\n};\n//# sourceMappingURL=SVGExporter.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./conversions\"), exports);\n__exportStar(require(\"./parsing\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.rgbToHsl = exports.hslToRgb = exports.rgbToHex = void 0;\n/**\n * Convert rgb to hex\n *\n * @param r number between 0 - 255\n * @param g number between 0 - 255\n * @param b number between 0 - 255\n * @returns #ffffff\n */\nfunction rgbToHex(r, g, b) {\n return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;\n}\nexports.rgbToHex = rgbToHex;\n/**\n * Convert hsl (0-360, 0-100, 0-100) color to rgb(0-255, 0-255, 0-255)\n *\n * @param {number} h number between 0 - 360\n * @param {number} s number between 0 - 100\n * @param {number} l number between 0 - 100\n * @returns {[number, number, number]} [0-255, 0-255, 0-255]\n */\nfunction hslToRgb(h, s, l) {\n h /= 360;\n s /= 100;\n l /= 100;\n let r, g, b;\n if (s == 0) {\n r = g = b = l; // achromatic\n }\n else {\n const hue2rgb = (p, q, t) => {\n t += t < 0 ? 1 : t > 1 ? -1 : 0;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n };\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return [(0.5 + r * 255) << 0, (0.5 + g * 255) << 0, (0.5 + b * 255) << 0];\n}\nexports.hslToRgb = hslToRgb;\n/**\n * Convert rbg (0-255, 0-255, 0-255) to hsl (0-360, 0-100, 0-100)\n *\n * @param {number} r number between 0 - 255\n * @param {number} g number between 0 - 255\n * @param {number} b number between 0 - 255\n * @returns {[number, number, number]} (0-360, 0-100, 0-100)\n */\nfunction rgbToHsl(r, g, b) {\n r /= 255;\n g /= 255;\n b /= 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s;\n if (max === min) {\n h = s = 0;\n }\n else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h = h / 6;\n }\n return [(0.5 + h * 360) << 0, (0.5 + s * 100) << 0, (0.5 + l * 100) << 0];\n}\nexports.rgbToHsl = rgbToHsl;\n//# sourceMappingURL=conversions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseColor = exports.parseColorAndConvert = void 0;\nconst conversions_1 = require(\"./conversions\");\n/**\n * Convert color to IConvertedColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IConvertedColor | undefined)}\n */\nfunction parseColorAndConvert(color) {\n const parsed = parseColor(color);\n if (parsed) {\n if (parsed.type === 'hsl') {\n const [r, g, b] = conversions_1.hslToRgb(parsed.a, parsed.b, parsed.c);\n return {\n r,\n g,\n b,\n h: parsed.a,\n s: parsed.b,\n l: parsed.c,\n alpha: parsed.alpha,\n };\n }\n else {\n const [h, s, l] = conversions_1.rgbToHsl(parsed.a, parsed.b, parsed.c);\n return {\n h,\n s,\n l,\n r: parsed.a,\n g: parsed.b,\n b: parsed.c,\n alpha: parsed.alpha,\n };\n }\n }\n}\nexports.parseColorAndConvert = parseColorAndConvert;\n/**\n * Convert color to IColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IColor | undefined)}\n */\nfunction parseColor(color) {\n if (typeof color === 'number') {\n if (color > 0xffffff) {\n return {\n type: 'rgb',\n a: (color >> 24) & 255,\n b: (color >> 16) & 255,\n c: (color >> 8) & 255,\n alpha: (color & 255) / 255,\n };\n }\n else {\n return { type: 'rgb', a: (color >> 16) & 255, b: (color >> 8) & 255, c: color & 255, alpha: 1 };\n }\n }\n color = color.replace(/\\s/g, '');\n let match = /^#([0-9a-f]{3,8})$/i.exec(color);\n if (match) {\n const hex = match[1];\n if (hex.length === 3) {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[0], 16),\n b: parseInt(hex[1] + hex[1], 16),\n c: parseInt(hex[2] + hex[2], 16),\n alpha: 1,\n };\n }\n else {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[1], 16),\n b: parseInt(hex[2] + hex[3], 16),\n c: parseInt(hex[4] + hex[5], 16),\n alpha: hex.length > 6 ? parseInt(hex.substring(6), 16) / 255 : 1,\n };\n }\n }\n match = /^((hsl|rgb)a?)\\((\\d+),(\\d+)%?,(\\d+)%?,?(.+)?\\)$/i.exec(color);\n if (match) {\n const [, , type, a, b, c, alpha] = match;\n return {\n type: type,\n a: +a,\n b: +b,\n c: +c,\n alpha: alpha ? +alpha : 1,\n };\n }\n}\nexports.parseColor = parseColor;\n//# sourceMappingURL=parsing.js.map","/*! For license information please see urpflanze-svg-importer.min.js.LICENSE.txt */\n!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.SVGImporter=e():t.SVGImporter=e()}(window,(function(){return(()=>{var t={877:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.SVGImporter=void 0;const n=r(500),i=r(688),s=r(926),o=r(926),a=r(479),h=r(721),u=r(197),c=r(825);class l{static isSVG(t){return l.SVG_REGEX.test(t.replace(l.COMMENT_REGEX,\"\"))}static getWindowInstance(){return l.windowInstance}static setWindowInstance(t){l.windowInstance=t}static stringToSVG(t){if(t=t.trim(),!l.isSVG(t))return console.warn(\"[Urpflanze:SVGImport] | Input is not valid SVG string\",t),null;const e=l.windowInstance.document.createElement(\"div\");return e.innerHTML=t,e.firstChild}static parse(t,e=.01,r){if(!1===l.isSVG(t))return console.warn(\"[Urpflanze:SVGImport] | Input is not valid svg\",t),null;const n=l.svgToBuffers(t,e);return n?l.parsedToShape(n,r):null}static parsedToShape(t,e){const r=[];if(t.buffers.forEach(((t,n)=>{const i=new s.ShapeBuffer({shape:t.buffer,bClosed:t.bClosed,sideLength:e,drawer:t.drawer});i&&r.push(i)})),1===r.length)return r[0];const n=new s.Group;return r.forEach((t=>n.add(t))),new s.Shape({shape:n})}static svgToBuffers(t,e=.01){const r=\"string\"==typeof t?l.stringToSVG(t):t;if(null===r)return console.error(\"[Urpflanze:SVGImport] | Cannot convert string to svg\",t),null;const n=l.getViewbox(r);r.querySelectorAll(\"g\").forEach(l.propagateGroupTransformAndStyleToChildren);const i=Array.from(r.querySelectorAll(\"rect, circle, ellipse, line, polyline, polygon, path\")),o=[].concat(...i.map((t=>l.elementToPath(t)))),a=Math.max(n[2]-n[0],n[3]-n[1]).toExponential(1).match(/e(\\+?[0-9]+)/),h=10/(1e3/Math.min(10**Math.max(a?+a[1]:0,0),1e3));let u=o.map((t=>l.pathToBuffer(t,h,n))).filter((t=>!!t&&t.length>=2));u=u.map((t=>l.simpliyBuffer(t,e))),u=u.map(((t,e)=>l.pathIsClosed(o[e])&&s.Vec2.distance([t[0],t[1]],[t[t.length-2],t[t.length-1]])<1?t.subarray(0,t.length-2):t));const f=Math.sqrt((n[2]-n[0])*(n[3]-n[1])),d=l.getStyleAttr(\"fill\",r),p=l.getStyleAttr(\"stroke\",r),m=l.getStyleAttr(\"stroke-width\",r,f/100),g=[];for(let t=0;t=0?c.fromPercentage(parseFloat(e),f):parseFloat(e));const n=l.getStyleAttr(\"fill\",o[t],d||void 0),i=l.getStyleAttr(\"stroke\",o[t],n?void 0:p||\"rgba(255,255,255)\"),s=r||(i?m:void 0);g.push({buffer:u[t],bClosed:l.pathIsClosed(o[t]),drawer:{fill:n,stroke:i,lineWidth:s?s/(f/100):void 0}})}return i.forEach((t=>t.remove())),{viewBox:n,buffers:g}}static getStyleAttr(t,e,r){const n=e.getAttribute(t);if(\"none\"===n)return;let s;if(null!=n)s=n;else{const r=\"stroke-width\"===t?\"strokeWidth\":t;void 0!==e.style[r]&&e.style[r].length>0&&(s=e.style[r])}if(void 0===s)return r;if(\"stroke-width\"===t)return parseFloat(s);let o=parseFloat(e.getAttribute(\"opacity\")||\"1\");const a=e.getAttribute(\"style\");if(a&&a.length){const e=new RegExp(`${t}-opacity: +?(\\\\d?.\\\\d|\\\\d)`,\"i\"),r=a.match(e);r&&(o=parseFloat(r[1]))}const h=i.parseColor(s);return h?(o=1!==h.alpha?h.alpha:o,\"rgb\"===h.type?`rgba(${h.a}, ${h.b}, ${h.c}, ${o})`:`hsla(${h.a}, ${h.b}%, ${h.c}%, ${o})`):r}static getViewbox(t){const e=t.getAttribute(\"viewBox\");if(e)return e.split(\" \").map((t=>parseFloat(t)));const r=t.getAttribute(\"width\"),n=t.getAttribute(\"height\");if(r&&n)return[0,0,parseFloat(r),parseFloat(n)];t=t.cloneNode(!0);const i=Array.from(t.querySelectorAll(\"rect, circle, ellipse, line, polyline, polygon, path\")),s=[].concat.apply([],i.map(l.elementToPath));let a=0,h=0;for(let t=0,e=s.length;ta&&(a=t.width),t.height>h&&(h=t.height)}}return[0,0,a,h]}static pathIsClosed(t){var e;return\"z\"===(null===(e=t.getAttribute(\"d\"))||void 0===e?void 0:e.trim().substr(-1).toLowerCase())}static simpliyBuffer(t,e=.01){const r=[];for(let e=0,n=t.length;e{i[2*e]=t.x,i[2*e+1]=t.y})),i}static sanitizePath(t,e){return h(t).abs().unarc().transform(e||\"\").toString()}static pathToBuffer(t,e=.01,r=[-1,-1,1,1]){const i=r[2]-r[0],s=r[3]-r[1],o=2/Math.max(i,s),a=t.getAttribute(\"d\"),h=t.getAttribute(\"transform\")||\"\",u=new n.Path({d:l.sanitizePath(a,h)}),c=Math.floor(u.length()),f=2*Math.floor(c/e),d=new Float32Array(f);let p=0;for(let t=0;t0){const r=u.compose(u.fromDefinition(u.fromTransformAttribute(e))),n=t.children;Array.from(n).forEach((t=>{let n=t.getAttribute(\"transform\");if(n&&n.length>0){const t=u.compose(u.fromDefinition(u.fromTransformAttribute(n))),e=u.compose(r,t);n=u.toSVG(e)}else n=e;t.setAttribute(\"transform\",n)}))}[\"fill\",\"stroke\",\"stroke-width\",\"style\"].forEach((e=>{const r=t.getAttribute(e);r&&Array.from(t.children).forEach((t=>{null===t.getAttribute(e)&&t.setAttribute(e,r)}))}))}static elementToPath(t){const e=l.windowInstance.document;let r=[];return\"path\"===t.nodeName?r=h(t.getAttribute(\"d\")||\"\").abs().unarc().toString().split(\"M\").filter((t=>t.length>0)).map((t=>\"M\"+t)):[\"rect\",\"ellipse\",\"circle\",\"line\",\"polyline\",\"polygon\"].includes(t.nodeName)?r=[c.conversion[t.nodeName](t)]:console.warn(`[Urpflanze:SVGImport] | Cannot convert ${t.nodeName} to path`),r.map((r=>{const n=e.createElementNS(\"http://www.w3.org/2000/svg\",\"path\");return n.setAttribute(\"d\",r),n.setAttribute(\"transform\",t.getAttribute(\"transform\")||\"\"),n.setAttribute(\"style\",t.getAttribute(\"style\")||\"\"),n.setAttribute(\"fill\",l.getStyleAttr(\"fill\",t,\"\")+\"\"),n.setAttribute(\"stroke\",l.getStyleAttr(\"stroke\",t,\"\")+\"\"),n.setAttribute(\"opacity\",t.getAttribute(\"opacity\")||\"1\"),n.setAttribute(\"stroke-width\",l.getStyleAttr(\"stroke-width\",t,\"\")+\"\"),n}))}}e.SVGImporter=l,l.HEX_REGEX=\"#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})\",l.SVG_REGEX=/^\\s*(?:<\\?xml[^>]*>\\s*)?(?:]*\\s*(?:\\[?(?:\\s*]*>\\s*)*\\]?)*[^>]*>\\s*)?(?:]*>[^]*<\\/svg>|]*\\/\\s*>)\\s*$/i,l.COMMENT_REGEX=//g},625:function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),e.SVGImporter=void 0;const s=r(877);Object.defineProperty(e,\"SVGImporter\",{enumerable:!0,get:function(){return s.SVGImporter}}),i(r(291),e),s.SVGImporter.setWindowInstance(window),e.default=s.SVGImporter},291:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},825:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.conversion=e.fromPercentage=void 0,e.fromPercentage=(t,e)=>/%$/.test(t+\"\")?100*parseFloat((t+\"\").replace(\"%\",\"\"))/e:+t;const r={rect:t=>{const r=parseFloat(t.getAttribute(\"width\")||\"0\"),n=parseFloat(t.getAttribute(\"height\")||\"0\"),i=parseFloat(t.getAttribute(\"x\")||\"0\"),s=parseFloat(t.getAttribute(\"y\")||\"0\");let o=t.getAttribute(\"rx\")||\"auto\",a=t.getAttribute(\"ry\")||\"auto\";\"auto\"===o&&\"auto\"===a?o=a=0:\"auto\"!==o&&\"auto\"===a?o=a=e.fromPercentage(o,r):\"auto\"!==a&&\"auto\"===o?a=o=e.fromPercentage(a,n):(o=e.fromPercentage(o,r),a=e.fromPercentage(a,n)),o>r/2&&(o=r/2),a>n/2&&(a=n/2);const h=o>0&&a>0;return[`M${i+o} ${s}`,\"H\"+(i+r-o),...h?[`A${o} ${a} 0 0 1 ${i+r} ${s+a}`]:[],\"V\"+(s+n-a),...h?[`A${o} ${a} 0 0 1 ${i+r-o} ${s+n}`]:[],`H${i+o}`,...h?[`A${o} ${a} 0 0 1 ${i} ${s+n-a}`]:[],`V${s+a}`,...h?[`A${o} ${a} 0 0 1 ${i+o} ${s}`]:[],\"Z\"].join(\" \")},ellipse:t=>{var e,r,n,i;const s=parseFloat(t.getAttribute(\"cx\")||\"0\"),o=parseFloat(t.getAttribute(\"cy\")||\"0\"),a=parseFloat(null!==(r=null!==(e=t.getAttribute(\"rx\"))&&void 0!==e?e:t.getAttribute(\"r\"))&&void 0!==r?r:\"0\"),h=parseFloat(null!==(i=null!==(n=t.getAttribute(\"ry\"))&&void 0!==n?n:t.getAttribute(\"r\"))&&void 0!==i?i:\"0\");return[`M${s+a} ${o}`,`A${a} ${h} 0 0 1 ${s} ${o+h}`,`A${a} ${h} 0 0 1 ${s-a} ${o}`,`A${a} ${h} 0 0 1 ${s+a} ${o}`,\"Z\"].join(\" \")},circle:t=>r.ellipse(t),line:t=>`M${t.getAttribute(\"x1\")||\"0\"} ${t.getAttribute(\"y1\")||\"0\"} L${t.getAttribute(\"x2\")||\"0\"} ${t.getAttribute(\"y2\")||\"0\"}`,polyline:t=>((t,e=2)=>{const r=[];for(;t.length>0;)r.push(t.splice(0,e));return r})((t.getAttribute(\"points\")||\"\").trim().replace(/ +/g,\" \").split(\" \").reduce(((t,e)=>[...t,...e.includes(\",\")?e.split(\",\"):[e]]),[]),2).map((([t,e],r)=>`${0===r?\"M\":\"L\"}${t} ${e}`)).join(\" \"),polygon:t=>r.polyline(t)+\" Z\",path:t=>t.getAttribute(\"d\")+\"\"};e.conversion=r},500:(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{A:()=>ur,Animator:()=>Ve,Array:()=>Lt,Box:()=>mt,Circle:()=>ir,ClipPath:()=>sr,Color:()=>ut,Container:()=>qt,Controller:()=>pe,Defs:()=>Yt,Dom:()=>Nt,Ease:()=>de,Element:()=>Ft,Ellipse:()=>Wt,EventTarget:()=>Ot,ForeignObject:()=>or,Fragment:()=>Jt,G:()=>hr,Gradient:()=>ne,Image:()=>se,Line:()=>he,List:()=>yt,Marker:()=>ue,Mask:()=>cr,Matrix:()=>ft,Morphable:()=>Ie,NonMorphable:()=>Re,Number:()=>kt,ObjectBag:()=>Le,PID:()=>ye,Path:()=>Fe,PathArray:()=>Ee,Pattern:()=>ie,Point:()=>ct,PointArray:()=>oe,Polygon:()=>qe,Polyline:()=>Ye,Queue:()=>ze,Rect:()=>De,Runner:()=>Ue,SVG:()=>mr,Shape:()=>Dt,Spring:()=>ge,Stop:()=>lr,Style:()=>fr,Svg:()=>Ke,Symbol:()=>tr,Text:()=>rr,TextPath:()=>dr,Timeline:()=>Xe,TransformBag:()=>Ce,Tspan:()=>nr,Use:()=>pr,adopt:()=>N,assignNewId:()=>V,clearEvents:()=>St,create:()=>L,defaults:()=>Tt,dispatch:()=>Et,easing:()=>le,eid:()=>z,extend:()=>$,find:()=>bt,getClass:()=>Y,getEventTarget:()=>_t,getEvents:()=>wt,getWindow:()=>I,makeInstance:()=>k,makeMorphable:()=>Ne,mockAdopt:()=>j,namespaces:()=>w,nodeOrNew:()=>B,off:()=>Pt,on:()=>At,parser:()=>dt,regex:()=>st,register:()=>q,registerMorphableType:()=>Be,registerWindow:()=>S,restoreWindow:()=>E,root:()=>T,saveWindow:()=>P,utils:()=>g,windowEvents:()=>Mt,withWindow:()=>O,wrapWithAttrCheck:()=>G});const n={},i=[];function s(t,e){if(Array.isArray(t))for(const r of t)s(r,e);else if(\"object\"!=typeof t)a(Object.getOwnPropertyNames(e)),n[t]=Object.assign(n[t]||{},e);else for(const e in t)s(e,t[e])}function o(t){return n[t]||{}}function a(t){i.push(...t)}function h(t,e){let r;const n=t.length,i=[];for(r=0;r=0;e--)V(t.children[e]);return t.id?(t.id=z(t.nodeName),t):t}function $(t,e){let r,n;for(n=(t=Array.isArray(t)?t:[t]).length-1;n>=0;n--)for(r in e)t[n].prototype[r]=e[r]}function G(t){return function(...e){const r=e[e.length-1];return!r||r.constructor!==Object||r instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(r)}}s(\"Dom\",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=k(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=k(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=k(t)).before(this),this},insertAfter:function(t){return(t=k(t)).after(this),this}});const X=/^([+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?)([a-z%]*)$/i,U=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i,H=/rgb\\((\\d+),(\\d+),(\\d+)\\)/,Z=/(#[a-z_][a-z0-9\\-_]*)/i,Q=/\\)\\s*,?\\s*/,W=/\\s/g,J=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,K=/^rgb\\(/,tt=/^(\\s+)?$/,et=/^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,rt=/\\.(jpg|jpeg|png|gif|svg)(\\?[^=]+.*)?/i,nt=/[\\s,]+/,it=/[MLHVCSQTAZ]/i;var st={__proto__:null,numberAndUnit:X,hex:U,rgb:H,reference:Z,transforms:Q,whitespace:W,isHex:J,isRgb:K,isBlank:tt,isNumber:et,isImage:rt,delimiter:nt,isPathLetter:it};function ot(t){const e=Math.round(t),r=Math.max(0,Math.min(255,e)).toString(16);return 1===r.length?\"0\"+r:r}function at(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function ht(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}s(\"Dom\",{classes:function(){const t=this.attr(\"class\");return null==t?[]:t.trim().split(nt)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr(\"class\",e.join(\" \"))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr(\"class\",this.classes().filter((function(e){return e!==t})).join(\" \")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),s(\"Dom\",{css:function(t,e){const r={};if(0===arguments.length)return this.node.style.cssText.split(/\\s*;\\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\\s*:\\s*/);r[e[0]]=e[1]})),r;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=l(e);r[t]=this.node.style[t]}return r}if(\"string\"==typeof t)return this.node.style[l(t)];if(\"object\"==typeof t)for(const e in t)this.node.style[l(e)]=null==t[e]||tt.test(t[e])?\"\":t[e]}return 2===arguments.length&&(this.node.style[l(t)]=null==e||tt.test(e)?\"\":e),this},show:function(){return this.css(\"display\",\"\")},hide:function(){return this.css(\"display\",\"none\")},visible:function(){return\"none\"!==this.css(\"display\")}}),s(\"Dom\",{data:function(t,e,r){if(null==t)return this.data(h(u(this.node.attributes,(t=>0===t.nodeName.indexOf(\"data-\"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const r of t)e[r]=this.data(r);return e}if(\"object\"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr(\"data-\"+t))}catch(e){return this.attr(\"data-\"+t)}else this.attr(\"data-\"+t,null===e?null:!0===r||\"string\"==typeof e||\"number\"==typeof e?e:JSON.stringify(e));return this}}),s(\"Dom\",{remember:function(t,e){if(\"object\"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class ut{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof ut||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&\"number\"==typeof t.r&&\"number\"==typeof t.g&&\"number\"==typeof t.b}static random(t=\"vibrant\",e,r){const{random:n,round:i,sin:s,PI:o}=Math;if(\"vibrant\"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new ut(t,e,r,\"lch\")}if(\"sine\"===t){const t=i(80*s(2*o*(e=null==e?n():e)/.5+.01)+150),r=i(50*s(2*o*e/.5+4.6)+200),a=i(100*s(2*o*e/.5+2.3)+150);return new ut(t,r,a)}if(\"pastel\"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new ut(t,e,r,\"lch\")}if(\"dark\"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new ut(t,e,r,\"lch\")}if(\"rgb\"===t){const t=255*n(),e=255*n(),r=255*n();return new ut(t,e,r)}if(\"lab\"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new ut(t,e,r,\"lab\")}if(\"grey\"===t){const t=255*n();return new ut(t,t,t)}throw new Error(\"Unsupported random color mode\")}static test(t){return\"string\"==typeof t&&(J.test(t)||K.test(t))}cmyk(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.min(1-n,1-i,1-s);return 1===o?new ut(0,0,0,1,\"cmyk\"):new ut((1-n-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,\"cmyk\")}hsl(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.max(n,i,s),a=Math.min(n,i,s),h=(o+a)/2,u=o===a,c=o-a;return new ut(360*(u?0:o===n?((i-s)/c+(i.5?c/(2-o-a):c/(o+a)),100*h,\"hsl\")}init(t=0,e=0,r=0,n=0,i=\"rgb\"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if(\"number\"==typeof t)i=\"string\"==typeof n?n:i,n=\"string\"==typeof n?0:n,Object.assign(this,{_a:t,_b:e,_c:r,_d:n,space:i});else if(t instanceof Array)this.space=e||(\"string\"==typeof t[3]?t[3]:t[4])||\"rgb\",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const r=function(t,e){const r=at(t,\"rgb\")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:\"rgb\"}:at(t,\"xyz\")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:\"xyz\"}:at(t,\"hsl\")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:\"hsl\"}:at(t,\"lab\")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:\"lab\"}:at(t,\"lch\")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:\"lch\"}:at(t,\"cmyk\")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:\"cmyk\"}:{_a:0,_b:0,_c:0,space:\"rgb\"};return r.space=e||r.space,r}(t,e);Object.assign(this,r)}else if(\"string\"==typeof t)if(K.test(t)){const e=t.replace(W,\"\"),[r,n,i]=H.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:\"rgb\"})}else{if(!J.test(t))throw Error(\"Unsupported string format, can't construct Color\");{const e=t=>parseInt(t,16),[,r,n,i]=U.exec(function(t){return 4===t.length?[\"#\",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(\"\"):t}(t)).map(e);Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:\"rgb\"})}}const{_a:s,_b:o,_c:a,_d:h}=this,u=\"rgb\"===this.space?{r:s,g:o,b:a}:\"xyz\"===this.space?{x:s,y:o,z:a}:\"hsl\"===this.space?{h:s,s:o,l:a}:\"lab\"===this.space?{l:s,a:o,b:a}:\"lch\"===this.space?{l:s,c:o,h:a}:\"cmyk\"===this.space?{c:s,m:o,y:a,k:h}:{};Object.assign(this,u)}lab(){const{x:t,y:e,z:r}=this.xyz();return new ut(116*e-16,500*(t-e),200*(e-r),\"lab\")}lch(){const{l:t,a:e,b:r}=this.lab(),n=Math.sqrt(e**2+r**2);let i=180*Math.atan2(r,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new ut(t,n,i,\"lch\")}rgb(){if(\"rgb\"===this.space)return this;if(\"lab\"===(t=this.space)||\"xyz\"===t||\"lch\"===t){let{x:t,y:e,z:r}=this;if(\"lab\"===this.space||\"lch\"===this.space){let{l:n,a:i,b:s}=this;if(\"lch\"===this.space){const{c:t,h:e}=this,r=Math.PI/180;i=t*Math.cos(r*e),s=t*Math.sin(r*e)}const o=(n+16)/116,a=i/500+o,h=o-s/200,u=16/116,c=.008856,l=7.787;t=.95047*(a**3>c?a**3:(a-u)/l),e=1*(o**3>c?o**3:(o-u)/l),r=1.08883*(h**3>c?h**3:(h-u)/l)}const n=3.2406*t+-1.5372*e+-.4986*r,i=-.9689*t+1.8758*e+.0415*r,s=.0557*t+-.204*e+1.057*r,o=Math.pow,a=.0031308,h=n>a?1.055*o(n,1/2.4)-.055:12.92*n,u=i>a?1.055*o(i,1/2.4)-.055:12.92*i,c=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new ut(255*h,255*u,255*c)}if(\"hsl\"===this.space){let{h:t,s:e,l:r}=this;if(t/=360,e/=100,r/=100,0===e)return r*=255,new ut(r,r,r);const n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,s=255*ht(i,n,t+1/3),o=255*ht(i,n,t),a=255*ht(i,n,t-1/3);return new ut(s,o,a)}if(\"cmyk\"===this.space){const{c:t,m:e,y:r,k:n}=this,i=255*(1-Math.min(1,t*(1-n)+n)),s=255*(1-Math.min(1,e*(1-n)+n)),o=255*(1-Math.min(1,r*(1-n)+n));return new ut(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:r,_d:n,space:i}=this;return[t,e,r,n,i]}toHex(){const[t,e,r]=this._clamped().map(ot);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,h=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,u=(.4124*o+.3576*a+.1805*h)/.95047,c=(.2126*o+.7152*a+.0722*h)/1,l=(.0193*o+.1192*a+.9505*h)/1.08883,f=u>.008856?Math.pow(u,1/3):7.787*u+16/116,d=c>.008856?Math.pow(c,1/3):7.787*c+16/116,p=l>.008856?Math.pow(l,1/3):7.787*l+16/116;return new ut(f,d,p,\"xyz\")}_clamped(){const{_a:t,_b:e,_c:r}=this.rgb(),{max:n,min:i,round:s}=Math;return[t,e,r].map((t=>n(0,i(s(t),255))))}}class ct{constructor(...t){this.init(...t)}clone(){return new ct(this)}init(t,e){const r=Array.isArray(t)?{x:t[0],y:t[1]}:\"object\"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==r.x?0:r.x,this.y=null==r.y?0:r.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){ft.isMatrixLike(t)||(t=new ft(t));const{x:e,y:r}=this;return this.x=t.a*e+t.c*r+t.e,this.y=t.b*e+t.d*r+t.f,this}}function lt(t,e,r){return Math.abs(e-t)<(r||1e-6)}class ft{constructor(...t){this.init(...t)}static formatTransforms(t){const e=\"both\"===t.flip||!0===t.flip,r=t.flip&&(e||\"x\"===t.flip)?-1:1,n=t.flip&&(e||\"y\"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleX)?t.scaleX*r:r,a=t.scale&&t.scale.length?t.scale[1]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleY)?t.scaleY*n:n,h=t.shear||0,u=t.rotate||t.theta||0,c=new ct(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=c.x,f=c.y,d=new ct(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.y,g=new ct(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,v=g.y,b=new ct(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:h,theta:u,rx:b.x,ry:b.y,tx:y,ty:v,ox:l,oy:f,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,r){const n=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,h=t.f+t.b*e.e+t.d*e.f;return r.a=n,r.b=i,r.c=s,r.d=o,r.e=a,r.f=h,r}around(t,e,r){return this.clone().aroundO(t,e,r)}aroundO(t,e,r){const n=t||0,i=e||0;return this.translateO(-n,-i).lmultiplyO(r).translateO(n,i)}clone(){return new ft(this)}decompose(t=0,e=0){const r=this.a,n=this.b,i=this.c,s=this.d,o=this.e,a=this.f,h=r*s-n*i,u=h>0?1:-1,c=u*Math.sqrt(r*r+n*n),l=Math.atan2(u*n,u*r),f=180/Math.PI*l,d=Math.cos(l),p=Math.sin(l),m=(r*i+n*s)/h,g=i*c/(m*r-n)||s*c/(m*n+r);return{scaleX:c,scaleY:g,shear:m,rotate:f,translateX:o-t+t*d*c+e*(m*d*c-p*g),translateY:a-e+t*p*c+e*(m*p*c+d*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new ft(t);return lt(this.a,e.a)&<(this.b,e.b)&<(this.c,e.c)&<(this.d,e.d)&<(this.e,e.e)&<(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return\"x\"===t?this.scaleO(-1,1,e,0):\"y\"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=ft.fromArray([1,0,0,1,0,0]);return t=t instanceof Ft?t.matrixify():\"string\"==typeof t?ft.fromArray(t.split(nt).map(parseFloat)):Array.isArray(t)?ft.fromArray(t):\"object\"==typeof t&&ft.isMatrixLike(t)?t:\"object\"==typeof t?(new ft).transform(t):6===arguments.length?ft.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,r=this.c,n=this.d,i=this.e,s=this.f,o=t*n-e*r;if(!o)throw new Error(\"Cannot invert \"+this);const a=n/o,h=-e/o,u=-r/o,c=t/o,l=-(a*i+u*s),f=-(h*i+c*s);return this.a=a,this.b=h,this.c=u,this.d=c,this.e=l,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof ft?t:new ft(t);return ft.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof ft?t:new ft(t);return ft.matrixMultiply(this,e,this)}rotate(t,e,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=c(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:h,e:u,f:l}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-h*i,this.d=h*n+a*i,this.e=u*n-l*i+r*i-e*n+e,this.f=l*n+u*i-e*i-r*n+r,this}scale(t,e,r,n){return this.clone().scaleO(...arguments)}scaleO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t);const{a:i,b:s,c:o,d:a,e:h,f:u}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=h*t-r*t+r,this.f=u*e-n*e+n,this}shear(t,e,r){return this.clone().shearO(t,e,r)}shearO(t,e=0,r=0){const{a:n,b:i,c:s,d:o,e:a,f:h}=this;return this.a=n+i*t,this.c=s+o*t,this.e=a+h*t-r*t,this}skew(t,e,r,n){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=c(t),e=c(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:h,d:u,e:l,f}=this;return this.a=o+a*i,this.b=a+o*s,this.c=h+u*i,this.d=u+h*s,this.e=l+f*i-n*i,this.f=f+l*s-r*s,this}skewX(t,e,r){return this.skew(t,0,e,r)}skewY(t,e,r){return this.skew(0,t,e,r)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return\"matrix(\"+this.a+\",\"+this.b+\",\"+this.c+\",\"+this.d+\",\"+this.e+\",\"+this.f+\")\"}transform(t){if(ft.isMatrixLike(t))return new ft(t).multiplyO(this);const e=ft.formatTransforms(t),{x:r,y:n}=new ct(e.ox,e.oy).transform(this),i=(new ft).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-r,-n).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(r,n);if(isFinite(e.px)||isFinite(e.py)){const t=new ct(r,n).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function dt(){if(!dt.nodes){const t=k().size(2,0);t.node.style.cssText=[\"opacity: 0\",\"position: absolute\",\"left: -100%\",\"top: -100%\",\"overflow: hidden\"].join(\";\"),t.attr(\"focusable\",\"false\"),t.attr(\"aria-hidden\",\"true\");const e=t.path().node;dt.nodes={svg:t,path:e}}if(!dt.nodes.svg.node.parentNode){const t=_.document.body||_.document.documentElement;dt.nodes.svg.addTo(t)}return dt.nodes}function pt(t){return!(t.width||t.height||t.x||t.y)}q(ft,\"Matrix\");class mt{constructor(...t){this.init(...t)}addOffset(){return this.x+=_.window.pageXOffset,this.y+=_.window.pageYOffset,new mt(this)}init(t){return t=\"string\"==typeof t?t.split(nt).map(parseFloat):Array.isArray(t)?t:\"object\"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return pt(this)}merge(t){const e=Math.min(this.x,t.x),r=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-r;return new mt(e,r,n,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+\" \"+this.y+\" \"+this.width+\" \"+this.height}transform(t){t instanceof ft||(t=new ft(t));let e=1/0,r=-1/0,n=1/0,i=-1/0;return[new ct(this.x,this.y),new ct(this.x2,this.y),new ct(this.x,this.y2),new ct(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),r=Math.max(r,s.x),n=Math.min(n,s.y),i=Math.max(i,s.y)})),new mt(e,n,r-e,i-n)}}function gt(t,e,r){let n;try{if(n=e(t.node),pt(n)&&(i=t.node)!==_.document&&!(_.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===_.document}).call(_.document.documentElement,i))throw new Error(\"Element not in the dom\")}catch(e){n=r(t)}var i;return n}s({viewbox:{viewbox(t,e,r,n){return null==t?new mt(this.attr(\"viewBox\")):this.attr(\"viewBox\",new mt(t,e,r,n))},zoom(t,e){let{width:r,height:n}=this.attr([\"width\",\"height\"]);if((r||n)&&\"string\"!=typeof r&&\"string\"!=typeof n||(r=this.node.clientWidth,n=this.node.clientHeight),!r||!n)throw new Error(\"Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element\");const i=this.viewbox(),s=r/i.width,o=n/i.height,a=Math.min(s,o);if(null==t)return a;let h=a/t;h===1/0&&(h=Number.MAX_SAFE_INTEGER/100),e=e||new ct(r/2/s+i.x,n/2/o+i.y);const u=new mt(i).transform(new ft({scale:h,origin:e}));return this.viewbox(u)}}}),q(mt,\"Box\");class yt extends Array{constructor(t=[],...e){if(super(t,...e),\"number\"==typeof t)return this;this.length=0,this.push(...t)}}$([yt],{each(t,...e){return\"function\"==typeof t?this.map(((e,r,n)=>t.call(e,e,r,n))):this.map((r=>r[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const vt=[\"toArray\",\"constructor\",\"each\"];function bt(t,e){return new yt(h((e||_.document).querySelectorAll(t),(function(t){return N(t)})))}yt.extend=function(t){t=t.reduce(((t,e)=>(vt.includes(e)||\"_\"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),$([yt],t)};let xt=0;const Mt={};function wt(t){let e=t.getEventHolder();return e===_.window&&(e=Mt),e.events||(e.events={}),e.events}function _t(t){return t.getEventTarget()}function St(t){let e=t.getEventHolder();e===_.window&&(e=Mt),e.events&&(e.events={})}function At(t,e,r,n,i){const s=r.bind(n||t),o=k(t),a=wt(o),h=_t(o);e=Array.isArray(e)?e:e.split(nt),r._svgjsListenerId||(r._svgjsListenerId=++xt),e.forEach((function(t){const e=t.split(\".\")[0],n=t.split(\".\")[1]||\"*\";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][r._svgjsListenerId]=s,h.addEventListener(e,s,i||!1)}))}function Pt(t,e,r,n){const i=k(t),s=wt(i),o=_t(i);(\"function\"!=typeof r||(r=r._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||\"\").split(nt)).forEach((function(t){const e=t&&t.split(\".\")[0],a=t&&t.split(\".\")[1];let h,u;if(r)s[e]&&s[e][a||\"*\"]&&(o.removeEventListener(e,s[e][a||\"*\"][r],n||!1),delete s[e][a||\"*\"][r]);else if(e&&a){if(s[e]&&s[e][a]){for(u in s[e][a])Pt(o,[e,a].join(\".\"),u);delete s[e][a]}}else if(a)for(t in s)for(h in s[t])a===h&&Pt(o,[t,a].join(\".\"));else if(e){if(s[e]){for(h in s[e])Pt(o,[e,h].join(\".\"));delete s[e]}}else{for(t in s)Pt(o,t);St(i)}}))}function Et(t,e,r,n){const i=_t(t);return e instanceof _.window.Event||(e=new _.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}class Ot extends R{addEventListener(){}dispatch(t,e,r){return Et(this,t,e,r)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const r=e[t.type];for(const e in r)for(const n in r[e])r[e][n](t);return!t.defaultPrevented}fire(t,e,r){return this.dispatch(t,e,r),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e){return Pt(this,t,e),this}on(t,e,r,n){return At(this,t,e,r,n),this}removeEventListener(){}}function It(){}q(Ot,\"EventTarget\");const Rt={duration:400,ease:\">\",delay:0},Ct={\"fill-opacity\":1,\"stroke-opacity\":1,\"stroke-width\":0,\"stroke-linejoin\":\"miter\",\"stroke-linecap\":\"butt\",fill:\"#000000\",stroke:\"#000000\",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,\"stop-opacity\":1,\"stop-color\":\"#000000\",\"text-anchor\":\"start\"};var Tt={__proto__:null,noop:It,timeline:Rt,attrs:Ct};class Lt extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return\"number\"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(nt).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(\" \")}valueOf(){const t=[];return t.push(...this),t}}class kt{constructor(...t){this.init(...t)}convert(t){return new kt(this.value,t)}divide(t){return t=new kt(t),new kt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||\"\",\"number\"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:\"string\"==typeof t?(e=t.match(X))&&(this.value=parseFloat(e[1]),\"%\"===e[5]?this.value/=100:\"s\"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof kt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new kt(t),new kt(this-t,this.unit||t.unit)}plus(t){return t=new kt(t),new kt(this+t,this.unit||t.unit)}times(t){return t=new kt(t),new kt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return(\"%\"===this.unit?~~(1e8*this.value)/1e6:\"s\"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const Bt=[];class Nt extends Ot{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=k(t)).removeNamespace&&this.node instanceof _.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return k(t).put(this,e)}children(){return new yt(h(this.node.children,(function(t){return N(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0){return this.writeDataToDom(),new this.constructor(V(this.node.cloneNode(t)))}each(t,e){const r=this.children();let n,i;for(n=0,i=r.length;n=0}html(t,e){return this.xml(t,e,v)}id(t){return void 0!==t||this.node.id||(this.node.id=z(this.type)),this.attr(\"id\",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return N(this.node.lastChild)}matches(t){const e=this.node,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return r&&r.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=N(e.node.parentNode),!t)return e;do{if(\"string\"==typeof t?e.matches(t):e instanceof t)return e}while(e=N(e.node.parentNode));return e}put(t,e){return t=k(t),this.add(t,e),t}putIn(t,e){return k(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=k(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const r=10**t,n=this.attr(e);for(const t in n)\"number\"==typeof n[t]&&(n[t]=Math.round(n[t]*r)/r);return this.attr(n),this}svg(t,e){return this.xml(t,e,y)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const r=e.index(this);return e.put(t,r).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,r){if(\"boolean\"==typeof t&&(r=e,e=t,t=null),null==t||\"function\"==typeof t){e=null==e||e,this.writeDataToDom();let r=this;if(null!=t){if(r=N(r.node.cloneNode(!0)),e){const e=t(r);if(r=e||r,!1===e)return\"\"}r.each((function(){const e=t(this),r=e||this;!1===e?this.remove():e&&this!==r&&this.replace(r)}),!0)}return e?r.node.outerHTML:r.node.innerHTML}e=null!=e&&e;const n=L(\"wrapper\",r),i=_.document.createDocumentFragment();n.innerHTML=t;for(let t=n.children.length;t--;)i.appendChild(n.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}$(Nt,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=et.test(r.nodeValue)?parseFloat(r.nodeValue):r.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if(\"object\"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?Ct[t]:et.test(e)?parseFloat(e):e;\"number\"==typeof(e=Bt.reduce(((e,r)=>r(t,e,this)),e))?e=new kt(e):ut.isColor(e)?e=new ut(e):e.constructor===Array&&(e=new Lt(e)),\"leading\"===t?this.leading&&this.leading(e):\"string\"==typeof r?this.node.setAttributeNS(r,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||\"font-size\"!==t&&\"x\"!==t||this.rebuild()}return this},find:function(t){return bt(t,this.node)},findOne:function(t){return N(this.node.querySelector(t))}}),q(Nt,\"Dom\");class Ft extends Nt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,t.hasAttribute(\"svgjs:data\")&&this.setData(JSON.parse(t.getAttribute(\"svgjs:data\"))||{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new kt(t).plus(this.x()))}dy(t=0){return this.y(new kt(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr(\"height\",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){t=k(t);const e=new yt;let r=this;for(;(r=r.parent())&&r.node!==_.document&&\"#document-fragment\"!==r.nodeName&&(e.push(r),r.node!==t.node););return e}reference(t){if(!(t=this.attr(t)))return null;const e=(t+\"\").match(Z);return e?k(e[1]):null}root(){const t=this.parent(Y(T));return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const r=p(this,t,e);return this.width(new kt(r.width)).height(new kt(r.height))}width(t){return this.attr(\"width\",t)}writeDataToDom(){return this.node.removeAttribute(\"svgjs:data\"),Object.keys(this.dom).length&&this.node.setAttribute(\"svgjs:data\",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr(\"x\",t)}y(t){return this.attr(\"y\",t)}}$(Ft,{bbox:function(){const t=gt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(dt().svg).show(),r=e.node.getBBox();return e.remove(),r}catch(e){throw new Error(`Getting bbox of element \"${t.node.nodeName}\" is not possible: ${e.toString()}`)}}));return new mt(t)},rbox:function(t){const e=gt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element \"${t.node.nodeName}\" is not possible`)})),r=new mt(e);return t?r.transform(t.screenCTM().inverseO()):r.addOffset()},inside:function(t,e){const r=this.bbox();return t>r.x&&e>r.y&&t=0;r--)null!=e[jt[t][r]]&&this.attr(jt.prefix(t,jt[t][r]),e[jt[t][r]]);return this},s([\"Element\",\"Runner\"],e)})),s([\"Element\",\"Runner\"],{matrix:function(t,e,r,n,i,s){return null==t?new ft(this):this.attr(\"transform\",new ft(t,e,r,n,i,s))},rotate:function(t,e,r){return this.transform({rotate:t,ox:e,oy:r},!0)},skew:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:r},!0):this.transform({skew:[t,e],ox:r,oy:n},!0)},shear:function(t,e,r){return this.transform({shear:t,ox:e,oy:r},!0)},scale:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:r},!0):this.transform({scale:[t,e],ox:r,oy:n},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t=\"both\",e=\"center\"){return-1===\"xybothtrue\".indexOf(t)&&(e=t,t=\"both\"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr(\"opacity\",t)}}),s(\"radius\",{radius:function(t,e=t){return\"radialGradient\"===(this._element||this).type?this.attr(\"r\",new kt(t)):this.rx(t).ry(e)}}),s(\"Path\",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new ct(this.node.getPointAtLength(t))}}),s([\"Element\",\"Runner\"],{font:function(t,e){if(\"object\"==typeof t){for(e in t)this.font(e,t[e]);return this}return\"leading\"===t?this.leading(e):\"anchor\"===t?this.attr(\"text-anchor\",e):\"size\"===t||\"family\"===t||\"weight\"===t||\"stretch\"===t||\"variant\"===t||\"style\"===t?this.attr(\"font-\"+t,e):this.attr(t,e)}}),s(\"Element\",[\"click\",\"dblclick\",\"mousedown\",\"mouseup\",\"mouseover\",\"mouseout\",\"mousemove\",\"mouseenter\",\"mouseleave\",\"touchstart\",\"touchmove\",\"touchleave\",\"touchend\",\"touchcancel\"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),s(\"Element\",{untransform:function(){return this.attr(\"transform\",null)},matrixify:function(){return(this.attr(\"transform\")||\"\").split(Q).slice(0,-1).map((function(t){const e=t.trim().split(\"(\");return[e[0],e[1].split(nt).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return\"matrix\"===e[0]?t.lmultiply(ft.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new ft)},toParent:function(t,e){if(this===t)return this;const r=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(n.multiply(r)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||\"string\"==typeof t){const e=new ft(this).decompose();return null==t?e:e[t]}ft.isMatrixLike(t)||(t={...t,origin:m(t,this)});const r=new ft(!0===e?this:e||!1).transform(t);return this.attr(\"transform\",r)}});class qt extends Ft{flatten(t=this,e){return this.each((function(){if(this instanceof qt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(r,n){return n[n.length-r-1].toParent(t,e)})),this.remove()}}q(qt,\"Container\");class Yt extends qt{constructor(t,e=t){super(B(\"defs\",t),e)}flatten(){return this}ungroup(){return this}}q(Yt,\"Defs\");class Dt extends Ft{}function zt(t){return this.attr(\"rx\",t)}function Vt(t){return this.attr(\"ry\",t)}function $t(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Gt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Xt(t){return this.attr(\"cx\",t)}function Ut(t){return this.attr(\"cy\",t)}function Ht(t){return null==t?2*this.rx():this.rx(new kt(t).divide(2))}function Zt(t){return null==t?2*this.ry():this.ry(new kt(t).divide(2))}q(Dt,\"Shape\");var Qt={__proto__:null,rx:zt,ry:Vt,x:$t,y:Gt,cx:Xt,cy:Ut,width:Ht,height:Zt};class Wt extends Dt{constructor(t,e=t){super(B(\"ellipse\",t),e)}size(t,e){const r=p(this,t,e);return this.rx(new kt(r.width).divide(2)).ry(new kt(r.height).divide(2))}}$(Wt,Qt),s(\"Container\",{ellipse:G((function(t=0,e=t){return this.put(new Wt).size(t,e).move(0,0)}))}),q(Wt,\"Ellipse\");class Jt extends Nt{constructor(t=_.document.createDocumentFragment()){super(t)}xml(t,e,r){if(\"boolean\"==typeof t&&(r=e,e=t,t=null),null==t||\"function\"==typeof t){const t=new Nt(L(\"wrapper\",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}}function Kt(t,e){return\"radialGradient\"===(this._element||this).type?this.attr({fx:new kt(t),fy:new kt(e)}):this.attr({x1:new kt(t),y1:new kt(e)})}function te(t,e){return\"radialGradient\"===(this._element||this).type?this.attr({cx:new kt(t),cy:new kt(e)}):this.attr({x2:new kt(t),y2:new kt(e)})}q(Jt,\"Fragment\");var ee,re={__proto__:null,from:Kt,to:te};class ne extends qt{constructor(t,e){super(B(t+\"Gradient\",\"string\"==typeof t?null:t),e)}attr(t,e,r){return\"transform\"===t&&(t=\"gradientTransform\"),super.attr(t,e,r)}bbox(){return new mt}targets(){return bt('svg [fill*=\"'+this.id()+'\"]')}toString(){return this.url()}update(t){return this.clear(),\"function\"==typeof t&&t.call(this,this),this}url(){return'url(\"#'+this.id()+'\")'}}$(ne,re),s({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:G((function(t,e){return this.put(new ne(t)).update(e)}))}}),q(ne,\"Gradient\");class ie extends qt{constructor(t,e=t){super(B(\"pattern\",t),e)}attr(t,e,r){return\"transform\"===t&&(t=\"patternTransform\"),super.attr(t,e,r)}bbox(){return new mt}targets(){return bt('svg [fill*=\"'+this.id()+'\"]')}toString(){return this.url()}update(t){return this.clear(),\"function\"==typeof t&&t.call(this,this),this}url(){return'url(\"#'+this.id()+'\")'}}s({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:G((function(t,e,r){return this.put(new ie).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:\"userSpaceOnUse\"})}))}}),q(ie,\"Pattern\");class se extends Dt{constructor(t,e=t){super(B(\"image\",t),e)}load(t,e){if(!t)return this;const r=new _.window.Image;return At(r,\"load\",(function(t){const n=this.parent(ie);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof ie&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),\"function\"==typeof e&&e.call(this,t)}),this),At(r,\"load error\",(function(){Pt(r)})),this.attr(\"href\",r.src=t,x)}}ee=function(t,e,r){return\"fill\"!==t&&\"stroke\"!==t||rt.test(e)&&(e=r.root().defs().image(e)),e instanceof se&&(e=r.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},Bt.push(ee),s({Container:{image:G((function(t,e){return this.put(new se).size(0,0).load(t,e)}))}}),q(se,\"Image\");class oe extends Lt{bbox(){let t=-1/0,e=-1/0,r=1/0,n=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),r=Math.min(i[0],r),n=Math.min(i[1],n)})),new mt(r,n,t-r,e-n)}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(nt).map(parseFloat)).length%2!=0&&t.pop();for(let r=0,n=t.length;r=0;r--)n.width&&(this[r][0]=(this[r][0]-n.x)*t/n.width+n.x),n.height&&(this[r][1]=(this[r][1]-n.y)*e/n.height+n.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,r=this.length;e\":function(t){return-Math.cos(t*Math.PI)/2+.5},\">\":function(t){return Math.sin(t*Math.PI/2)},\"<\":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,r,n){return function(i){return i<0?t>0?e/t*i:r>0?n/r*i:0:i>1?r<1?(1-n)/(1-r)*i+(n-r)/(1-r):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*n+i**3}},steps:function(t,e=\"end\"){e=e.split(\"-\").reverse()[0];let r=t;return\"none\"===e?--r:\"both\"===e&&++r,(n,i=!1)=>{let s=Math.floor(n*t);const o=n*s%1==0;return\"start\"!==e&&\"both\"!==e||++s,i&&o&&--s,n>=0&&s<0&&(s=0),n<=1&&s>r&&(s=r),s/r}}};class fe{done(){return!1}}class de extends fe{constructor(t=Rt.ease){super(),this.ease=le[t]||t}step(t,e,r){return\"number\"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}}class pe extends fe{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}}function me(){const t=(this._duration||500)/1e3,e=this._overshoot||0,r=Math.PI,n=Math.log(e/100+1e-10),i=-n/Math.sqrt(r*r+n*n),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}class ge extends pe{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,r,n){if(\"string\"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;r>100&&(r=16),r/=1e3;const i=n.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*r+s*r*r/2;return n.velocity=i+s*r,n.done=Math.abs(e-o)+Math.abs(i)<.002,n.done?e:o}}$(ge,{duration:ce(\"_duration\",me),overshoot:ce(\"_overshoot\",me)});class ye extends pe{constructor(t=.1,e=.01,r=0,n=1e3){super(),this.p(t).i(e).d(r).windup(n)}step(t,e,r,n){if(\"string\"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;const i=e-t;let s=(n.integral||0)+i*r;const o=(i-(n.error||0))/r,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),n.error=i,n.integral=s,n.done=Math.abs(i)<.001,n.done?e:t+(this.P*i+this.I*s+this.D*o)}}$(ye,{windup:ce(\"_windup\"),p:ce(\"P\"),i:ce(\"I\"),d:ce(\"D\")});const ve={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},be={M:function(t,e,r){return e.x=r.x=t[0],e.y=r.y=t[1],[\"M\",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],[\"L\",t[0],t[1]]},H:function(t,e){return e.x=t[0],[\"H\",t[0]]},V:function(t,e){return e.y=t[0],[\"V\",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],[\"C\",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],[\"S\",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],[\"Q\",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],[\"T\",t[0],t[1]]},Z:function(t,e,r){return e.x=r.x,e.y=r.y,[\"Z\"]},A:function(t,e){return e.x=t[5],e.y=t[6],[\"A\",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},xe=\"mlhvqtcsaz\".split(\"\");for(let t=0,e=xe.length;t=0;n--)r=this[n][0],\"M\"===r||\"L\"===r||\"T\"===r?(this[n][1]+=t,this[n][2]+=e):\"H\"===r?this[n][1]+=t:\"V\"===r?this[n][1]+=e:\"C\"===r||\"S\"===r||\"Q\"===r?(this[n][1]+=t,this[n][2]+=e,this[n][3]+=t,this[n][4]+=e,\"C\"===r&&(this[n][5]+=t,this[n][6]+=e)):\"A\"===r&&(this[n][6]+=t,this[n][7]+=e);return this}parse(t=\"M0 0\"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let r=0,n=\"\";const i={segment:[],inNumber:!1,number:\"\",lastToken:\"\",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new ct,p:new ct};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!we(i,n))if(\".\"!==n)if(isNaN(parseInt(n)))if(\" \"!==n&&\",\"!==n)if(\"-\"!==n)if(\"E\"!==n.toUpperCase()){if(it.test(n)){if(i.inNumber)_e(i,!1);else{if(!Me(i))throw new Error(\"parser Error\");Se(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!Pe(i)){_e(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else i.inNumber&&_e(i,!1);else{if(\"0\"===i.number||Ae(i)){i.inNumber=!0,i.number=n,_e(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){_e(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&_e(i,!1),i.inSegment&&Me(i)&&Se(i),i.segments}(t)}size(t,e){const r=this.bbox();let n,i;for(r.width=0===r.width?1:r.width,r.height=0===r.height?1:r.height,n=this.length-1;n>=0;n--)i=this[n][0],\"M\"===i||\"L\"===i||\"T\"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):\"H\"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:\"V\"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:\"C\"===i||\"S\"===i||\"Q\"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,\"C\"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):\"A\"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this}toString(){return function(t){let e=\"\";for(let r=0,n=t.length;r{const e=typeof t;return\"number\"===e?kt:\"string\"===e?ut.isColor(t)?ut:nt.test(t)?it.test(t)?Ee:Lt:X.test(t)?kt:Re:ke.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Lt:\"object\"===e?Le:Re};class Ie{constructor(t){this._stepper=t||new de(\"-\"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){const e=this;return this._morphObj.fromArray(this._from.map((function(r,n){return e._stepper.step(r,e._to[n],t,e._context[n],e._context)})))}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(Oe(t));let e=new this._type(t);return this._type===ut&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Le&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toArray(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class Re{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class Ce{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,Ce.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}Ce.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Te=(t,e)=>t[0]e[0]?1:0;class Le{constructor(...t){this.init(...t)}align(t){for(let e=0,r=this.values.length;et.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const r=e.shift(),n=e.shift(),i=e.shift(),s=e.splice(0,i);t[r]=new n(s).valueOf()}return t}}const ke=[Re,Ce,Le];function Be(t=[]){ke.push(...[].concat(t))}function Ne(){$(ke,{to(t){return(new Ie).type(this.constructor).from(this.valueOf()).to(t)},fromArray(t){return this.init(t),this}})}class Fe extends Dt{constructor(t,e=t){super(B(\"path\",t),e)}array(){return this._array||(this._array=new Ee(this.attr(\"d\")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr(\"d\",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr(\"d\",\"string\"==typeof t?t:this._array=new Ee(t))}size(t,e){const r=p(this,t,e);return this.attr(\"d\",this.array().size(r.width,r.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}Fe.prototype.MorphArray=Ee,s({Container:{path:G((function(t){return this.put(new Fe).plot(t||new Ee)}))}}),q(Fe,\"Path\");var je={__proto__:null,array:function(){return this._array||(this._array=new oe(this.attr(\"points\")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr(\"points\",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr(\"points\",\"string\"==typeof t?t:this._array=new oe(t))},size:function(t,e){const r=p(this,t,e);return this.attr(\"points\",this.array().size(r.width,r.height))}};class qe extends Dt{constructor(t,e=t){super(B(\"polygon\",t),e)}}s({Container:{polygon:G((function(t){return this.put(new qe).plot(t||new oe)}))}}),$(qe,ae),$(qe,je),q(qe,\"Polygon\");class Ye extends Dt{constructor(t,e=t){super(B(\"polyline\",t),e)}}s({Container:{polyline:G((function(t){return this.put(new Ye).plot(t||new oe)}))}}),$(Ye,ae),$(Ye,je),q(Ye,\"Polyline\");class De extends Dt{constructor(t,e=t){super(B(\"rect\",t),e)}}$(De,{rx:zt,ry:Vt}),s({Container:{rect:G((function(t,e){return this.put(new De).size(t,e)}))}}),q(De,\"Rect\");class ze{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Ve={nextDraw:null,frames:new ze,timeouts:new ze,immediates:new ze,timer:()=>_.window.performance||_.window.Date,transforms:[],frame(t){const e=Ve.frames.push({run:t});return null===Ve.nextDraw&&(Ve.nextDraw=_.window.requestAnimationFrame(Ve._draw)),e},timeout(t,e){e=e||0;const r=Ve.timer().now()+e,n=Ve.timeouts.push({run:t,time:r});return null===Ve.nextDraw&&(Ve.nextDraw=_.window.requestAnimationFrame(Ve._draw)),n},immediate(t){const e=Ve.immediates.push(t);return null===Ve.nextDraw&&(Ve.nextDraw=_.window.requestAnimationFrame(Ve._draw)),e},cancelFrame(t){null!=t&&Ve.frames.remove(t)},clearTimeout(t){null!=t&&Ve.timeouts.remove(t)},cancelImmediate(t){null!=t&&Ve.immediates.remove(t)},_draw(t){let e=null;const r=Ve.timeouts.last();for(;(e=Ve.timeouts.shift())&&(t>=e.time?e.run():Ve.timeouts.push(e),e!==r););let n=null;const i=Ve.frames.last();for(;n!==i&&(n=Ve.frames.shift());)n.run(t);let s=null;for(;s=Ve.immediates.shift();)s();Ve.nextDraw=Ve.timeouts.first()||Ve.frames.first()?_.window.requestAnimationFrame(Ve._draw):null}},$e=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},Ge=function(){const t=_.window;return(t.performance||t.Date).now()};class Xe extends Ot{constructor(t=Ge){super(),this._timeSource=t,this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const r=Math.abs(e);return this.speed(t?-r:r)}schedule(t,e,r){if(null==t)return this._runners.map($e);let n=0;const i=this.getEndTime();if(e=e||0,null==r||\"last\"===r||\"after\"===r)n=i;else if(\"absolute\"===r||\"start\"===r)n=e,e=0;else if(\"now\"===r)n=this._time;else if(\"relative\"===r){const r=this.getRunnerInfoById(t.id);r&&(n=r.start+e,e=0)}else{if(\"with-last\"!==r)throw new Error('Invalid value for the \"when\" parameter');{const t=this.getLastRunnerInfo();n=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:n+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Ve.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Ve.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let r=e-this._lastSourceTime;t&&(r=0);const n=this._speed*r+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=n,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire(\"time\",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],r=e.runner;this._time-e.start<=0&&r.reset()}let i=!1;for(let t=0,e=this._runners.length;t0?this._continue():(this.pause(),this.fire(\"finished\")),this}}s({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Xe,this._timeline):(this._timeline=t,this)}}});class Ue extends Ot{constructor(t){super(),this.id=Ue.id++,t=\"function\"==typeof(t=null==t?Rt.duration:t)?new pe(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration=\"number\"==typeof t&&t,this._isDeclarative=t instanceof pe,this._stepper=this._isDeclarative?t:new de,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new ft,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,r){let n=1,i=!1,s=0;return e=e||Rt.delay,r=r||\"last\",\"object\"!=typeof(t=t||Rt.duration)||t instanceof fe||(e=t.delay||e,r=t.when||r,i=t.swing||i,n=t.times||n,s=t.wait||s,t=t.duration||Rt.duration),{duration:t,delay:e,swing:i,times:n,wait:s,when:r}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t,e){return this.transforms.lmultiplyO(t),this}after(t){return this.on(\"finished\",t)}animate(t,e,r){const n=Ue.sanitise(t,e,r),i=new Ue(n.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(n).schedule(n.delay,n.when)}clearTransform(){return this.transforms=new ft,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new de(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,r){return\"object\"==typeof t&&(e=t.swing,r=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=r||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),r=(this._time-t*e)/this._duration;return Math.min(t+r,this._times)}const r=t%1,n=e*Math.floor(t)+this._duration*r;return this.time(n)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,r=this._duration,n=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(n+r))/(n+r)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(n+r))/r+i;return Math.max(Math.min(a,1),0)},h=i*(n+r)-n;return a=e<=0?Math.round(t(1e-5)):e=0;this._lastPosition=e;const n=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime=n;this._lastTime=this._time,i&&this.fire(\"start\",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=n,this._reseted=!1;let a=!1;return(r||o)&&(this._initialise(r),this.transforms=new ft,a=this._run(o?t:e),this.fire(\"step\",this)),this.done=this.done||a&&o,s&&this.fire(\"finished\",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,r=this._queue.length;et.lmultiplyO(e),Qe=t=>t.transforms;function We(){const t=this._transformationRunners.runners.map(Qe).reduce(Ze,new ft);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Je{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new He).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const r=this.ids.indexOf(t+1);return this.ids.splice(r,1,t+1),this.runners.splice(r,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;ee.id<=t.id)).map(Qe).reduce(Ze,new ft)},_addRunner(t){this._transformationRunners.add(t),Ve.cancelImmediate(this._frameId),this._frameId=Ve.immediate(We.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Je).add(new He(new ft(this))))}}}),$(Ue,{attr(t,e){return this.styleAttr(\"attr\",t,e)},css(t,e){return this.styleAttr(\"css\",t,e)},styleAttr(t,e,r){if(\"string\"==typeof e)return this.styleAttr(t,{[e]:r});let n=e;if(this._tryRetarget(t,n))return this;let i=new Ie(this._stepper).to(n),s=Object.keys(n);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const r=Object.keys(e),o=(a=s,r.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),r=new Le(i.from()).valueOf();Object.assign(r,e),i.from(r)}const h=new Le(i.to()).valueOf();Object.assign(h,e),i.to(h),s=r,n=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget(\"zoom\",t,e))return this;let r=new Ie(this._stepper).to(new kt(t));return this.queue((function(){r=r.from(this.element().zoom())}),(function(t){return this.element().zoom(r.at(t),e),r.done()}),(function(t,n){e=n,r.to(t)})),this._rememberMorpher(\"zoom\",r),this},transform(t,e,r){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget(\"transform\",t))return this;const n=ft.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new Ie(this._stepper).type(r?Ce:ft);let s,o,a,h,u;return this.queue((function(){o=o||this.element(),s=s||m(t,o),u=new ft(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:l,y:f}=new ct(s).transform(o._currentTransform(this));let d=new ft({...t,origin:[l,f]}),p=this._isDeclarative&&a?a:u;if(r){d=d.decompose(l,f),p=p.decompose(l,f);const t=d.rotate,e=p.rotate,r=[t-360,t,t+360],n=r.map((t=>Math.abs(t-e))),i=Math.min(...n),s=n.indexOf(i);d.rotate=r[s]}e&&(n||(d.rotate=t.rotate||0),this._isDeclarative&&h&&(p.rotate=h)),i.from(p),i.to(d);const m=i.at(c);return h=m.rotate,a=new ft(m),this.addTransform(a),o._addRunner(this),i.done()}),(function(e){(e.origin||\"center\").toString()!==(t.origin||\"center\").toString()&&(s=m(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher(\"transform\",i),this},x(t,e){return this._queueNumber(\"x\",t)},y(t){return this._queueNumber(\"y\",t)},dx(t=0){return this._queueNumberDelta(\"x\",t)},dy(t=0){return this._queueNumberDelta(\"y\",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new kt(e),this._tryRetarget(t,e))return this;const r=new Ie(this._stepper).to(e);let n=null;return this.queue((function(){n=this.element()[t](),r.from(n),r.to(n+e)}),(function(e){return this.element()[t](r.at(e)),r.done()}),(function(t){r.to(n+new kt(t))})),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new Ie(this._stepper).to(e);return this.queue((function(){r.from(this.element()[t]())}),(function(e){return this.element()[t](r.at(e)),r.done()})),this._rememberMorpher(t,r),this},_queueNumber(t,e){return this._queueObject(t,new kt(e))},cx(t){return this._queueNumber(\"cx\",t)},cy(t){return this._queueNumber(\"cy\",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let r;return t&&e||(r=this._element.bbox()),t||(t=r.width/r.height*e),e||(e=r.height/r.width*t),this.width(t).height(e)},width(t){return this._queueNumber(\"width\",t)},height(t){return this._queueNumber(\"height\",t)},plot(t,e,r,n){if(4===arguments.length)return this.plot([t,e,r,n]);if(this._tryRetarget(\"plot\",t))return this;const i=new Ie(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher(\"plot\",i),this},leading(t){return this._queueNumber(\"leading\",t)},viewbox(t,e,r,n){return this._queueObject(\"viewbox\",new mt(t,e,r,n))},update(t){return\"object\"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr(\"stop-opacity\",t.opacity),null!=t.color&&this.attr(\"stop-color\",t.color),null!=t.offset&&this.attr(\"offset\",t.offset),this)}}),$(Ue,{rx:zt,ry:Vt,from:Kt,to:te}),q(Ue,\"Runner\");class Ke extends qt{constructor(t,e=t){super(B(\"svg\",t),e),this.namespace()}defs(){return this.isRoot()?N(this.node.querySelector(\"defs\"))||this.put(new Yt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof _.window.SVGElement)&&\"#document-fragment\"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:y,version:\"1.1\"}).attr(\"xmlns:xlink\",x,b).attr(\"xmlns:svgjs\",M,b):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr(\"xmlns:xlink\",null,b).attr(\"xmlns:svgjs\",null,b)}root(){return this.isRoot()?this:super.root()}}s({Container:{nested:G((function(){return this.put(new Ke)}))}}),q(Ke,\"Svg\",!0);class tr extends qt{constructor(t,e=t){super(B(\"symbol\",t),e)}}s({Container:{symbol:G((function(){return this.put(new tr)}))}}),q(tr,\"Symbol\");var er={__proto__:null,plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(_.document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()},x:function(t,e=this.bbox()){return null==t?e.x:this.attr(\"x\",this.attr(\"x\")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr(\"y\",this.attr(\"y\")+t-e.y)},move:function(t,e,r=this.bbox()){return this.x(t,r).y(e,r)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr(\"x\",this.attr(\"x\")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr(\"y\",this.attr(\"y\")+t-e.cy)},center:function(t,e,r=this.bbox()){return this.cx(t,r).cy(e,r)},ax:function(t){return this.attr(\"x\",t)},ay:function(t){return this.attr(\"y\",t)},amove:function(t,e){return this.ax(t).ay(e)},build:function(t){return this._build=!!t,this}};class rr extends Dt{constructor(t,e=t){super(B(\"text\",t),e),this.dom.leading=new kt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new kt(t),this.rebuild())}rebuild(t){if(\"boolean\"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const r=this.dom.leading;this.each((function(n){const i=_.window.getComputedStyle(this.node).getPropertyValue(\"font-size\"),s=r*new kt(i);this.dom.newLined&&(this.attr(\"x\",t.attr(\"x\")),\"\\n\"===this.text()?e+=s:(this.attr(\"dy\",n?s+e:0),e=0))})),this.fire(\"rebuild\")}return this}setData(t){return this.dom=t,this.dom.leading=new kt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let r=0;t=\"\";for(let n=0,i=e.length;n{let i;try{i=r.bbox()}catch(t){return}const s=new ft(r),o=s.translate(t,e).transform(s.inverse()),a=new ct(i.x,i.y).transform(o);r.move(a.x,a.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)},size:function(t,e,r=this.bbox()){const n=p(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach(((t,e)=>{const n=new ct(r).transform(new ft(t).inverse());t.scale(i,s,n.x,n.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}};class hr extends qt{constructor(t,e=t){super(B(\"g\",t),e)}}$(hr,ar),s({Container:{group:G((function(){return this.put(new hr)}))}}),q(hr,\"G\");class ur extends qt{constructor(t,e=t){super(B(\"a\",t),e)}target(t){return this.attr(\"target\",t)}to(t){return this.attr(\"href\",t,x)}}$(ur,ar),s({Container:{link:G((function(t){return this.put(new ur).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const r=e.index(t);return e.add(this,r),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new ur,this.wrap(e)),\"function\"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&\"a\"===t.node.nodeName.toLowerCase()?t:null}}}),q(ur,\"A\");class cr extends qt{constructor(t,e=t){super(B(\"mask\",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return bt('svg [mask*=\"'+this.id()+'\"]')}}s({Container:{mask:G((function(){return this.defs().put(new cr)}))},Element:{masker(){return this.reference(\"mask\")},maskWith(t){const e=t instanceof cr?t:this.parent().mask().add(t);return this.attr(\"mask\",'url(\"#'+e.id()+'\")')},unmask(){return this.attr(\"mask\",null)}}}),q(cr,\"Mask\");class lr extends Ft{constructor(t,e=t){super(B(\"stop\",t),e)}update(t){return(\"number\"==typeof t||t instanceof kt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr(\"stop-opacity\",t.opacity),null!=t.color&&this.attr(\"stop-color\",t.color),null!=t.offset&&this.attr(\"offset\",new kt(t.offset)),this}}s({Gradient:{stop:function(t,e,r){return this.put(new lr).update(t,e,r)}}}),q(lr,\"Stop\");class fr extends Ft{constructor(t,e=t){super(B(\"style\",t),e)}addText(t=\"\"){return this.node.textContent+=t,this}font(t,e,r={}){return this.rule(\"@font-face\",{fontFamily:t,src:e,...r})}rule(t,e){return this.addText(function(t,e){if(!t)return\"\";if(!e)return t;let r=t+\"{\";for(const t in e)r+=f(t)+\":\"+e[t]+\";\";return r+=\"}\",r}(t,e))}}s(\"Dom\",{style(t,e){return this.put(new fr).rule(t,e)},fontface(t,e,r){return this.put(new fr).font(t,e,r)}}),q(fr,\"Style\");class dr extends rr{constructor(t,e=t){super(B(\"textPath\",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let r=null;return e&&(r=e.plot(t)),null==t?r:this}track(){return this.reference(\"href\")}}s({Container:{textPath:G((function(t,e){return t instanceof rr||(t=this.text(t)),t.path(e)}))},Text:{path:G((function(t,e=!0){const r=new dr;let n;if(t instanceof Fe||(t=this.defs().path(t)),r.attr(\"href\",\"#\"+t,x),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)})),textPath(){return this.findOne(\"textPath\")}},Path:{text:G((function(t){return t instanceof rr||(t=(new rr).addTo(this.parent()).text(t)),t.path(this)})),targets(){return bt(\"svg textPath\").filter((t=>(t.attr(\"href\")||\"\").includes(this.id())))}}}),dr.prototype.MorphArray=Ee,q(dr,\"TextPath\");class pr extends Dt{constructor(t,e=t){super(B(\"use\",t),e)}use(t,e){return this.attr(\"href\",(e||\"\")+\"#\"+t,x)}}s({Container:{use:G((function(t,e){return this.put(new pr).use(t,e)}))}}),q(pr,\"Use\");const mr=k;$([Ke,tr,se,ie,ue],o(\"viewbox\")),$([he,Ye,qe,Fe],o(\"marker\")),$(rr,o(\"Text\")),$(Fe,o(\"Path\")),$(Yt,o(\"Defs\")),$([rr,nr],o(\"Tspan\")),$([De,Wt,ne,Ue],o(\"radius\")),$(Ot,o(\"EventTarget\")),$(Nt,o(\"Dom\")),$(Ft,o(\"Element\")),$(Dt,o(\"Shape\")),$([qt,Jt],o(\"Container\")),$(ne,o(\"Gradient\")),$(Ue,o(\"Runner\")),yt.extend([...new Set(i)]),Be([kt,ut,mt,ft,Lt,oe,Ee]),Ne()},725:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.rgbToHsl=e.hslToRgb=e.rgbToHex=void 0,e.rgbToHex=function(t,e,r){return`#${((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}`},e.hslToRgb=function(t,e,r){let n,i,s;if(t/=360,r/=100,0==(e/=100))n=i=s=r;else{const o=(t,e,r)=>(r+=r<0?1:r>1?-1:0)<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,a=r<.5?r*(1+e):r+e-r*e,h=2*r-a;n=o(h,a,t+1/3),i=o(h,a,t),s=o(h,a,t-1/3)}return[.5+255*n<<0,.5+255*i<<0,.5+255*s<<0]},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;const n=Math.max(t,e,r),i=Math.min(t,e,r),s=(n+i)/2;let o,a;if(n===i)o=a=0;else{const h=n-i;switch(a=s>.5?h/(2-n-i):h/(n+i),n){case t:o=(e-r)/h+(e{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.default={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\",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\",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\",rebeccapurple:\"#663399\",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\",wheat:\"#f5deb3\",white:\"#ffffff\",whitesmoke:\"#f5f5f5\",yellow:\"#ffff00\",yellowgreen:\"#9acd32\"}},688:function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(785),e),i(r(725),e),i(r(951),e)},951:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseColor=e.parseColorAndConvert=void 0;const n=r(202),i=r(725);function s(t){if(\"number\"==typeof t)return t>16777215?{type:\"rgb\",a:t>>24&255,b:t>>16&255,c:t>>8&255,alpha:(255&t)/255}:{type:\"rgb\",a:t>>16&255,b:t>>8&255,c:255&t,alpha:1};t=t.replace(/\\s/g,\"\"),n.default[t]&&(t=n.default[t]);let e=/^#([0-9a-f]{3,8})$/i.exec(t);if(e){const t=e[1];return 3===t.length?{type:\"rgb\",a:parseInt(t[0]+t[0],16),b:parseInt(t[1]+t[1],16),c:parseInt(t[2]+t[2],16),alpha:1}:{type:\"rgb\",a:parseInt(t[0]+t[1],16),b:parseInt(t[2]+t[3],16),c:parseInt(t[4]+t[5],16),alpha:t.length>6?parseInt(t.substring(6),16)/255:1}}if(e=/^((hsl|rgb)a?)\\((\\d+),(\\d+)%?,(\\d+)%?,?(.+)?\\)$/i.exec(t),e){const[,,t,r,n,i,s]=e;return{type:t,a:+r,b:+n,c:+i,alpha:s?+s:1}}}e.parseColorAndConvert=function(t){const e=s(t);if(e){if(\"hsl\"===e.type){const[t,r,n]=i.hslToRgb(e.a,e.b,e.c);return{r:t,g:r,b:n,h:e.a,s:e.b,l:e.c,alpha:e.alpha}}{const[t,r,n]=i.rgbToHsl(e.a,e.b,e.c);return{h:t,s:r,l:n,r:e.a,g:e.b,b:e.c,alpha:e.alpha}}}},e.parseColor=s},785:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},926:t=>{var e;window,e=function(){return(()=>{var t=[function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),e.mod=e.log=e.PI2=e.PHI=e.Vec2=e.distributePointsInBuffer=e.prepareBufferForInterpolation=e.interpolate=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.now=e.toRadians=e.toDegrees=e.relativeClamp=e.clamp=e.lerp=void 0,i(r(1),e),r(10).glMatrix.setMatrixArrayType(Array),i(r(21),e),i(r(22),e),i(r(23),e),i(r(24),e),i(r(33),e),i(r(34),e),i(r(35),e),i(r(32),e),i(r(36),e),i(r(37),e),i(r(38),e),i(r(39),e),i(r(40),e),i(r(41),e),i(r(42),e),i(r(43),e),i(r(44),e),i(r(45),e),i(r(46),e),i(r(47),e),i(r(29),e),i(r(48),e);var s=r(30);Object.defineProperty(e,\"lerp\",{enumerable:!0,get:function(){return s.lerp}}),Object.defineProperty(e,\"clamp\",{enumerable:!0,get:function(){return s.clamp}}),Object.defineProperty(e,\"relativeClamp\",{enumerable:!0,get:function(){return s.relativeClamp}}),Object.defineProperty(e,\"toDegrees\",{enumerable:!0,get:function(){return s.toDegrees}}),Object.defineProperty(e,\"toRadians\",{enumerable:!0,get:function(){return s.toRadians}}),Object.defineProperty(e,\"now\",{enumerable:!0,get:function(){return s.now}}),Object.defineProperty(e,\"noise\",{enumerable:!0,get:function(){return s.noise}}),Object.defineProperty(e,\"random\",{enumerable:!0,get:function(){return s.random}}),Object.defineProperty(e,\"angleFromRepetition\",{enumerable:!0,get:function(){return s.angleFromRepetition}}),Object.defineProperty(e,\"angle2FromRepetition\",{enumerable:!0,get:function(){return s.angle2FromRepetition}}),Object.defineProperty(e,\"distanceFromRepetition\",{enumerable:!0,get:function(){return s.distanceFromRepetition}}),Object.defineProperty(e,\"interpolate\",{enumerable:!0,get:function(){return s.interpolate}}),Object.defineProperty(e,\"prepareBufferForInterpolation\",{enumerable:!0,get:function(){return s.prepareBufferForInterpolation}}),Object.defineProperty(e,\"distributePointsInBuffer\",{enumerable:!0,get:function(){return s.distributePointsInBuffer}});var o=r(26);Object.defineProperty(e,\"Vec2\",{enumerable:!0,get:function(){return o.default}});var a=r(27);Object.defineProperty(e,\"PHI\",{enumerable:!0,get:function(){return a.PHI}}),Object.defineProperty(e,\"PI2\",{enumerable:!0,get:function(){return a.PI2}}),Object.defineProperty(e,\"log\",{enumerable:!0,get:function(){return a.log}}),Object.defineProperty(e,\"mod\",{enumerable:!0,get:function(){return a.mod}})},function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(2),e),i(r(3),e),i(r(4),e),i(r(5),e),i(r(6),e),i(r(7),e),i(r(8),e),i(r(9),e)},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e)=>{\"use strict\";var r;Object.defineProperty(e,\"__esModule\",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]=\"Ring\",r[r.Matrix=2]=\"Matrix\"},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e)=>{\"use strict\";var r;Object.defineProperty(e,\"__esModule\",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]=\"Relative\",r[r.Fixed=2]=\"Fixed\"},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>s,mat3:()=>o,mat4:()=>a,quat:()=>h,quat2:()=>u,vec2:()=>c,vec3:()=>l,vec4:()=>f});var n=r(11),i=r(12),s=r(13),o=r(14),a=r(15),h=r(16),u=r(19),c=r(20),l=r(18),f=r(17)},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{EPSILON:()=>n,ARRAY_TYPE:()=>i,RANDOM:()=>s,setMatrixArrayType:()=>o,toRadian:()=>h,equals:()=>u});var n=1e-6,i=\"undefined\"!=typeof Float32Array?Float32Array:Array,s=Math.random;function o(t){i=t}var a=Math.PI/180;function h(t){return t*a}function u(t,e){return Math.abs(t-e)<=n*Math.max(1,Math.abs(t),Math.abs(e))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,identity:()=>a,fromValues:()=>h,set:()=>u,transpose:()=>c,invert:()=>l,adjoint:()=>f,determinant:()=>d,multiply:()=>p,rotate:()=>m,scale:()=>g,fromRotation:()=>y,fromScaling:()=>v,str:()=>b,frob:()=>x,LDU:()=>M,add:()=>w,subtract:()=>_,exactEquals:()=>S,equals:()=>A,multiplyScalar:()=>P,multiplyScalarAndAdd:()=>E,mul:()=>O,sub:()=>I});var n=r(11);function i(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function s(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function a(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function h(t,e,r,i){var s=new n.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=r,s[3]=i,s}function u(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function c(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function l(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*s-i*n;return o?(o=1/o,t[0]=s*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}function f(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function d(t){return t[0]*t[3]-t[2]*t[1]}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*a+s*h,t[1]=i*a+o*h,t[2]=n*u+s*c,t[3]=i*u+o*c,t}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+s*a,t[1]=i*h+o*a,t[2]=n*-a+s*h,t[3]=i*-a+o*h,t}function g(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1];return t[0]=n*a,t[1]=i*a,t[2]=s*h,t[3]=o*h,t}function y(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function v(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function b(t){return\"mat2(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}function x(t){return Math.hypot(t[0],t[1],t[2],t[3])}function M(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function w(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function _(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function S(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function A(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=e[0],h=e[1],u=e[2],c=e[3];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-h)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-u)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}function P(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function E(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}var O=p,I=_},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,identity:()=>a,fromValues:()=>h,set:()=>u,invert:()=>c,determinant:()=>l,multiply:()=>f,rotate:()=>d,scale:()=>p,translate:()=>m,fromRotation:()=>g,fromScaling:()=>y,fromTranslation:()=>v,str:()=>b,frob:()=>x,add:()=>M,subtract:()=>w,multiplyScalar:()=>_,multiplyScalarAndAdd:()=>S,exactEquals:()=>A,equals:()=>P,mul:()=>E,sub:()=>O});var n=r(11);function i(){var t=new n.ARRAY_TYPE(6);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function s(t){var e=new n.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function a(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function h(t,e,r,i,s,o){var a=new n.ARRAY_TYPE(6);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a[4]=s,a[5]=o,a}function u(t,e,r,n,i,s,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t}function c(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=r*s-n*i;return h?(h=1/h,t[0]=s*h,t[1]=-n*h,t[2]=-i*h,t[3]=r*h,t[4]=(i*a-s*o)*h,t[5]=(n*o-r*a)*h,t):null}function l(t){return t[0]*t[3]-t[1]*t[2]}function f(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1],l=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*u+s*c,t[1]=i*u+o*c,t[2]=n*l+s*f,t[3]=i*l+o*f,t[4]=n*d+s*p+a,t[5]=i*d+o*p+h,t}function d(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*u,t[1]=i*c+o*u,t[2]=n*-u+s*c,t[3]=i*-u+o*c,t[4]=a,t[5]=h,t}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1];return t[0]=n*u,t[1]=i*u,t[2]=s*c,t[3]=o*c,t[4]=a,t[5]=h,t}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=n*u+s*c+a,t[5]=i*u+o*c+h,t}function g(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function y(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function v(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function b(t){return\"mat2d(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\")\"}function x(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function M(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function w(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function _(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function S(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function A(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function P(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=e[0],c=e[1],l=e[2],f=e[3],d=e[4],p=e[5];return Math.abs(r-u)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-c)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(s-l)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(o-f)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-d)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(h-p)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(p))}var E=f,O=w},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,fromMat4:()=>s,clone:()=>o,copy:()=>a,fromValues:()=>h,set:()=>u,identity:()=>c,transpose:()=>l,invert:()=>f,adjoint:()=>d,determinant:()=>p,multiply:()=>m,translate:()=>g,rotate:()=>y,scale:()=>v,fromTranslation:()=>b,fromRotation:()=>x,fromScaling:()=>M,fromMat2d:()=>w,fromQuat:()=>_,normalFromMat4:()=>S,projection:()=>A,str:()=>P,frob:()=>E,add:()=>O,subtract:()=>I,multiplyScalar:()=>R,multiplyScalarAndAdd:()=>C,exactEquals:()=>T,equals:()=>L,mul:()=>k,sub:()=>B});var n=r(11);function i(){var t=new n.ARRAY_TYPE(9);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function o(t){var e=new n.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function h(t,e,r,i,s,o,a,h,u){var c=new n.ARRAY_TYPE(9);return c[0]=t,c[1]=e,c[2]=r,c[3]=i,c[4]=s,c[5]=o,c[6]=a,c[7]=h,c[8]=u,c}function u(t,e,r,n,i,s,o,a,h,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t}function c(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function l(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function f(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=c*o-a*u,f=-c*s+a*h,d=u*s-o*h,p=r*l+n*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-c*n+i*u)*p,t[2]=(a*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*h)*p,t[5]=(-a*r+i*s)*p,t[6]=d*p,t[7]=(-u*r+n*h)*p,t[8]=(o*r-n*s)*p,t):null}function d(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8];return t[0]=o*c-a*u,t[1]=i*u-n*c,t[2]=n*a-i*o,t[3]=a*h-s*c,t[4]=r*c-i*h,t[5]=i*s-r*a,t[6]=s*u-o*h,t[7]=n*h-r*u,t[8]=r*o-n*s,t}function p(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],h=t[7],u=t[8];return e*(u*s-o*h)+r*(-u*i+o*a)+n*(h*i-s*a)}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=r[0],d=r[1],p=r[2],m=r[3],g=r[4],y=r[5],v=r[6],b=r[7],x=r[8];return t[0]=f*n+d*o+p*u,t[1]=f*i+d*a+p*c,t[2]=f*s+d*h+p*l,t[3]=m*n+g*o+y*u,t[4]=m*i+g*a+y*c,t[5]=m*s+g*h+y*l,t[6]=v*n+b*o+x*u,t[7]=v*i+b*a+x*c,t[8]=v*s+b*h+x*l,t}function g(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=h,t[6]=f*n+d*o+u,t[7]=f*i+d*a+c,t[8]=f*s+d*h+l,t}function y(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*a,t[2]=d*s+f*h,t[3]=d*o-f*n,t[4]=d*a-f*i,t[5]=d*h-f*s,t[6]=u,t[7]=c,t[8]=l,t}function v(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function b(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function x(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function M(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function w(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function _(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,h=i+i,u=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*h,m=s*o,g=s*a,y=s*h;return t[0]=1-l-p,t[3]=c-y,t[6]=f+g,t[1]=c+y,t[4]=1-u-p,t[7]=d-m,t[2]=f-g,t[5]=d+m,t[8]=1-u-l,t}function S(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],y=e[15],v=r*a-n*o,b=r*h-i*o,x=r*u-s*o,M=n*h-i*a,w=n*u-s*a,_=i*u-s*h,S=c*m-l*p,A=c*g-f*p,P=c*y-d*p,E=l*g-f*m,O=l*y-d*m,I=f*y-d*g,R=v*I-b*O+x*E+M*P-w*A+_*S;return R?(R=1/R,t[0]=(a*I-h*O+u*E)*R,t[1]=(h*P-o*I-u*A)*R,t[2]=(o*O-a*P+u*S)*R,t[3]=(i*O-n*I-s*E)*R,t[4]=(r*I-i*P+s*A)*R,t[5]=(n*P-r*O-s*S)*R,t[6]=(m*_-g*w+y*M)*R,t[7]=(g*x-p*_-y*b)*R,t[8]=(p*w-m*x+y*v)*R,t):null}function A(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function P(t){return\"mat3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\")\"}function E(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function O(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function I(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function R(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function C(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function T(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function L(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=t[6],c=t[7],l=t[8],f=e[0],d=e[1],p=e[2],m=e[3],g=e[4],y=e[5],v=e[6],b=e[7],x=e[8];return Math.abs(r-f)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(i-d)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(s-p)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(o-m)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(a-g)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(h-y)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(y))&&Math.abs(u-v)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(c-b)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(l-x)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(x))}var k=m,B=I},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,fromValues:()=>a,set:()=>h,identity:()=>u,transpose:()=>c,invert:()=>l,adjoint:()=>f,determinant:()=>d,multiply:()=>p,translate:()=>m,scale:()=>g,rotate:()=>y,rotateX:()=>v,rotateY:()=>b,rotateZ:()=>x,fromTranslation:()=>M,fromScaling:()=>w,fromRotation:()=>_,fromXRotation:()=>S,fromYRotation:()=>A,fromZRotation:()=>P,fromRotationTranslation:()=>E,fromQuat2:()=>O,getTranslation:()=>I,getScaling:()=>R,getRotation:()=>C,fromRotationTranslationScale:()=>T,fromRotationTranslationScaleOrigin:()=>L,fromQuat:()=>k,frustum:()=>B,perspective:()=>N,perspectiveFromFieldOfView:()=>F,ortho:()=>j,lookAt:()=>q,targetTo:()=>Y,str:()=>D,frob:()=>z,add:()=>V,subtract:()=>$,multiplyScalar:()=>G,multiplyScalarAndAdd:()=>X,exactEquals:()=>U,equals:()=>H,mul:()=>Z,sub:()=>Q});var n=r(11);function i(){var t=new n.ARRAY_TYPE(16);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function s(t){var e=new n.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function a(t,e,r,i,s,o,a,h,u,c,l,f,d,p,m,g){var y=new n.ARRAY_TYPE(16);return y[0]=t,y[1]=e,y[2]=r,y[3]=i,y[4]=s,y[5]=o,y[6]=a,y[7]=h,y[8]=u,y[9]=c,y[10]=l,y[11]=f,y[12]=d,y[13]=p,y[14]=m,y[15]=g,y}function h(t,e,r,n,i,s,o,a,h,u,c,l,f,d,p,m,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t[9]=c,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=g,t}function u(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function c(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=i,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function l(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],y=e[15],v=r*a-n*o,b=r*h-i*o,x=r*u-s*o,M=n*h-i*a,w=n*u-s*a,_=i*u-s*h,S=c*m-l*p,A=c*g-f*p,P=c*y-d*p,E=l*g-f*m,O=l*y-d*m,I=f*y-d*g,R=v*I-b*O+x*E+M*P-w*A+_*S;return R?(R=1/R,t[0]=(a*I-h*O+u*E)*R,t[1]=(i*O-n*I-s*E)*R,t[2]=(m*_-g*w+y*M)*R,t[3]=(f*w-l*_-d*M)*R,t[4]=(h*P-o*I-u*A)*R,t[5]=(r*I-i*P+s*A)*R,t[6]=(g*x-p*_-y*b)*R,t[7]=(c*_-f*x+d*b)*R,t[8]=(o*O-a*P+u*S)*R,t[9]=(n*P-r*O-s*S)*R,t[10]=(p*w-m*x+y*v)*R,t[11]=(l*x-c*w-d*v)*R,t[12]=(a*A-o*E-h*S)*R,t[13]=(r*E-n*A+i*S)*R,t[14]=(m*b-p*M-g*v)*R,t[15]=(c*M-l*b+f*v)*R,t):null}function f(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],y=e[15];return t[0]=a*(f*y-d*g)-l*(h*y-u*g)+m*(h*d-u*f),t[1]=-(n*(f*y-d*g)-l*(i*y-s*g)+m*(i*d-s*f)),t[2]=n*(h*y-u*g)-a*(i*y-s*g)+m*(i*u-s*h),t[3]=-(n*(h*d-u*f)-a*(i*d-s*f)+l*(i*u-s*h)),t[4]=-(o*(f*y-d*g)-c*(h*y-u*g)+p*(h*d-u*f)),t[5]=r*(f*y-d*g)-c*(i*y-s*g)+p*(i*d-s*f),t[6]=-(r*(h*y-u*g)-o*(i*y-s*g)+p*(i*u-s*h)),t[7]=r*(h*d-u*f)-o*(i*d-s*f)+c*(i*u-s*h),t[8]=o*(l*y-d*m)-c*(a*y-u*m)+p*(a*d-u*l),t[9]=-(r*(l*y-d*m)-c*(n*y-s*m)+p*(n*d-s*l)),t[10]=r*(a*y-u*m)-o*(n*y-s*m)+p*(n*u-s*a),t[11]=-(r*(a*d-u*l)-o*(n*d-s*l)+c*(n*u-s*a)),t[12]=-(o*(l*g-f*m)-c*(a*g-h*m)+p*(a*f-h*l)),t[13]=r*(l*g-f*m)-c*(n*g-i*m)+p*(n*f-i*l),t[14]=-(r*(a*g-h*m)-o*(n*g-i*m)+p*(n*h-i*a)),t[15]=r*(a*f-h*l)-o*(n*f-i*l)+c*(n*h-i*a),t}function d(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],h=t[7],u=t[8],c=t[9],l=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*s)*(l*g-f*m)-(e*a-n*s)*(c*g-f*p)+(e*h-i*s)*(c*m-l*p)+(r*a-n*o)*(u*g-f*d)-(r*h-i*o)*(u*m-l*d)+(n*h-i*a)*(u*p-c*d)}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],y=e[14],v=e[15],b=r[0],x=r[1],M=r[2],w=r[3];return t[0]=b*n+x*a+M*l+w*m,t[1]=b*i+x*h+M*f+w*g,t[2]=b*s+x*u+M*d+w*y,t[3]=b*o+x*c+M*p+w*v,b=r[4],x=r[5],M=r[6],w=r[7],t[4]=b*n+x*a+M*l+w*m,t[5]=b*i+x*h+M*f+w*g,t[6]=b*s+x*u+M*d+w*y,t[7]=b*o+x*c+M*p+w*v,b=r[8],x=r[9],M=r[10],w=r[11],t[8]=b*n+x*a+M*l+w*m,t[9]=b*i+x*h+M*f+w*g,t[10]=b*s+x*u+M*d+w*y,t[11]=b*o+x*c+M*p+w*v,b=r[12],x=r[13],M=r[14],w=r[15],t[12]=b*n+x*a+M*l+w*m,t[13]=b*i+x*h+M*f+w*g,t[14]=b*s+x*u+M*d+w*y,t[15]=b*o+x*c+M*p+w*v,t}function m(t,e,r){var n,i,s,o,a,h,u,c,l,f,d,p,m=r[0],g=r[1],y=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=h,t[6]=u,t[7]=c,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+a*g+l*y+e[12],t[13]=i*m+h*g+f*y+e[13],t[14]=s*m+u*g+d*y+e[14],t[15]=o*m+c*g+p*y+e[15]),t}function g(t,e,r){var n=r[0],i=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function y(t,e,r,i){var s,o,a,h,u,c,l,f,d,p,m,g,y,v,b,x,M,w,_,S,A,P,E,O,I=i[0],R=i[1],C=i[2],T=Math.hypot(I,R,C);return T0?(r[0]=2*(h*a+l*i+u*o-c*s)/f,r[1]=2*(u*a+l*s+c*i-h*o)/f,r[2]=2*(c*a+l*o+h*s-u*i)/f):(r[0]=2*(h*a+l*i+u*o-c*s),r[1]=2*(u*a+l*s+c*i-h*o),r[2]=2*(c*a+l*o+h*s-u*i)),E(t,e,r),t}function I(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function R(t,e){var r=e[0],n=e[1],i=e[2],s=e[4],o=e[5],a=e[6],h=e[8],u=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(s,o,a),t[2]=Math.hypot(h,u,c),t}function C(t,e){var r=new n.ARRAY_TYPE(3);R(r,e);var i=1/r[0],s=1/r[1],o=1/r[2],a=e[0]*i,h=e[1]*s,u=e[2]*o,c=e[4]*i,l=e[5]*s,f=e[6]*o,d=e[8]*i,p=e[9]*s,m=e[10]*o,g=a+l+m,y=0;return g>0?(y=2*Math.sqrt(g+1),t[3]=.25*y,t[0]=(f-p)/y,t[1]=(d-u)/y,t[2]=(h-c)/y):a>l&&a>m?(y=2*Math.sqrt(1+a-l-m),t[3]=(f-p)/y,t[0]=.25*y,t[1]=(h+c)/y,t[2]=(d+u)/y):l>m?(y=2*Math.sqrt(1+l-a-m),t[3]=(d-u)/y,t[0]=(h+c)/y,t[1]=.25*y,t[2]=(f+p)/y):(y=2*Math.sqrt(1+m-a-l),t[3]=(h-c)/y,t[0]=(d+u)/y,t[1]=(f+p)/y,t[2]=.25*y),t}function T(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3],h=i+i,u=s+s,c=o+o,l=i*h,f=i*u,d=i*c,p=s*u,m=s*c,g=o*c,y=a*h,v=a*u,b=a*c,x=n[0],M=n[1],w=n[2];return t[0]=(1-(p+g))*x,t[1]=(f+b)*x,t[2]=(d-v)*x,t[3]=0,t[4]=(f-b)*M,t[5]=(1-(l+g))*M,t[6]=(m+y)*M,t[7]=0,t[8]=(d+v)*w,t[9]=(m-y)*w,t[10]=(1-(l+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function L(t,e,r,n,i){var s=e[0],o=e[1],a=e[2],h=e[3],u=s+s,c=o+o,l=a+a,f=s*u,d=s*c,p=s*l,m=o*c,g=o*l,y=a*l,v=h*u,b=h*c,x=h*l,M=n[0],w=n[1],_=n[2],S=i[0],A=i[1],P=i[2],E=(1-(m+y))*M,O=(d+x)*M,I=(p-b)*M,R=(d-x)*w,C=(1-(f+y))*w,T=(g+v)*w,L=(p+b)*_,k=(g-v)*_,B=(1-(f+m))*_;return t[0]=E,t[1]=O,t[2]=I,t[3]=0,t[4]=R,t[5]=C,t[6]=T,t[7]=0,t[8]=L,t[9]=k,t[10]=B,t[11]=0,t[12]=r[0]+S-(E*S+R*A+L*P),t[13]=r[1]+A-(O*S+C*A+k*P),t[14]=r[2]+P-(I*S+T*A+B*P),t[15]=1,t}function k(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,h=i+i,u=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*h,m=s*o,g=s*a,y=s*h;return t[0]=1-l-p,t[1]=c+y,t[2]=f-g,t[3]=0,t[4]=c-y,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-u-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function B(t,e,r,n,i,s,o){var a=1/(r-e),h=1/(i-n),u=1/(s-o);return t[0]=2*s*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*h,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*h,t[10]=(o+s)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*u,t[15]=0,t}function N(t,e,r,n,i){var s,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(s=1/(n-i),t[10]=(i+n)*s,t[14]=2*i*n*s):(t[10]=-1,t[14]=-2*n),t}function F(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),h=2/(o+a),u=2/(i+s);return t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-a)*h*.5,t[9]=(i-s)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function j(t,e,r,n,i,s,o){var a=1/(e-r),h=1/(n-i),u=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*h,t[14]=(o+s)*u,t[15]=1,t}function q(t,e,r,i){var s,o,a,h,c,l,f,d,p,m,g=e[0],y=e[1],v=e[2],b=i[0],x=i[1],M=i[2],w=r[0],_=r[1],S=r[2];return Math.abs(g-w)0&&(c*=d=1/Math.sqrt(d),l*=d,f*=d);var p=h*f-u*l,m=u*c-a*f,g=a*l-h*c;return(d=p*p+m*m+g*g)>0&&(p*=d=1/Math.sqrt(d),m*=d,g*=d),t[0]=p,t[1]=m,t[2]=g,t[3]=0,t[4]=l*g-f*m,t[5]=f*p-c*g,t[6]=c*m-l*p,t[7]=0,t[8]=c,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=s,t[14]=o,t[15]=1,t}function D(t){return\"mat4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\", \"+t[9]+\", \"+t[10]+\", \"+t[11]+\", \"+t[12]+\", \"+t[13]+\", \"+t[14]+\", \"+t[15]+\")\"}function z(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function V(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function $(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function G(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function X(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function U(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function H(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=t[6],c=t[7],l=t[8],f=t[9],d=t[10],p=t[11],m=t[12],g=t[13],y=t[14],v=t[15],b=e[0],x=e[1],M=e[2],w=e[3],_=e[4],S=e[5],A=e[6],P=e[7],E=e[8],O=e[9],I=e[10],R=e[11],C=e[12],T=e[13],L=e[14],k=e[15];return Math.abs(r-b)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(s-M)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(o-w)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-_)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(h-S)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(u-A)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(c-P)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(P))&&Math.abs(l-E)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(f-O)<=n.EPSILON*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(d-I)<=n.EPSILON*Math.max(1,Math.abs(d),Math.abs(I))&&Math.abs(p-R)<=n.EPSILON*Math.max(1,Math.abs(p),Math.abs(R))&&Math.abs(m-C)<=n.EPSILON*Math.max(1,Math.abs(m),Math.abs(C))&&Math.abs(g-T)<=n.EPSILON*Math.max(1,Math.abs(g),Math.abs(T))&&Math.abs(y-L)<=n.EPSILON*Math.max(1,Math.abs(y),Math.abs(L))&&Math.abs(v-k)<=n.EPSILON*Math.max(1,Math.abs(v),Math.abs(k))}var Z=p,Q=$},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>a,identity:()=>h,setAxisAngle:()=>u,getAxisAngle:()=>c,getAngle:()=>l,multiply:()=>f,rotateX:()=>d,rotateY:()=>p,rotateZ:()=>m,calculateW:()=>g,exp:()=>y,ln:()=>v,pow:()=>b,slerp:()=>x,random:()=>M,invert:()=>w,conjugate:()=>_,fromMat3:()=>S,fromEuler:()=>A,str:()=>P,clone:()=>L,fromValues:()=>k,copy:()=>B,set:()=>N,add:()=>F,mul:()=>j,scale:()=>q,dot:()=>Y,lerp:()=>D,length:()=>z,len:()=>V,squaredLength:()=>$,sqrLen:()=>G,normalize:()=>X,exactEquals:()=>U,equals:()=>H,rotationTo:()=>Z,sqlerp:()=>Q,setAxes:()=>W});var n=r(11),i=r(14),s=r(18),o=r(17);function a(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function h(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function u(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function c(t,e){var r=2*Math.acos(e[3]),i=Math.sin(r/2);return i>n.EPSILON?(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i):(t[0]=1,t[1]=0,t[2]=0),r}function l(t,e){var r=Y(t,e);return Math.acos(2*r*r-1)}function f(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*c+o*a+i*u-s*h,t[1]=i*c+o*h+s*a-n*u,t[2]=s*c+o*u+n*h-i*a,t[3]=o*c-n*a-i*h-s*u,t}function d(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+o*a,t[1]=i*h+s*a,t[2]=s*h-i*a,t[3]=o*h-n*a,t}function p(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h-s*a,t[1]=i*h+o*a,t[2]=s*h+n*a,t[3]=o*h-i*a,t}function m(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+i*a,t[1]=i*h-n*a,t[2]=s*h+o*a,t[3]=o*h-s*a,t}function g(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function y(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=Math.exp(s),h=o>0?a*Math.sin(o)/o:0;return t[0]=r*h,t[1]=n*h,t[2]=i*h,t[3]=a*Math.cos(o),t}function v(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=o>0?Math.atan2(o,s)/o:0;return t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=.5*Math.log(r*r+n*n+i*i+s*s),t}function b(t,e,r){return v(t,e),q(t,t,r),y(t,t),t}function x(t,e,r,i){var s,o,a,h,u,c=e[0],l=e[1],f=e[2],d=e[3],p=r[0],m=r[1],g=r[2],y=r[3];return(o=c*p+l*m+f*g+d*y)<0&&(o=-o,p=-p,m=-m,g=-g,y=-y),1-o>n.EPSILON?(s=Math.acos(o),a=Math.sin(s),h=Math.sin((1-i)*s)/a,u=Math.sin(i*s)/a):(h=1-i,u=i),t[0]=h*c+u*p,t[1]=h*l+u*m,t[2]=h*f+u*g,t[3]=h*d+u*y,t}function M(t){var e=n.RANDOM(),r=n.RANDOM(),i=n.RANDOM(),s=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=s*Math.sin(2*Math.PI*r),t[1]=s*Math.cos(2*Math.PI*r),t[2]=o*Math.sin(2*Math.PI*i),t[3]=o*Math.cos(2*Math.PI*i),t}function w(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s,a=o?1/o:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=s*a,t}function _(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function S(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var s=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*s+s]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*s+o]-e[3*o+s])*r,t[s]=(e[3*s+i]+e[3*i+s])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t}function A(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var s=Math.sin(e),o=Math.cos(e),a=Math.sin(r),h=Math.cos(r),u=Math.sin(n),c=Math.cos(n);return t[0]=s*h*c-o*a*u,t[1]=o*a*c+s*h*u,t[2]=o*h*u-s*a*c,t[3]=o*h*c+s*a*u,t}function P(t){return\"quat(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}var E,O,I,R,C,T,L=o.clone,k=o.fromValues,B=o.copy,N=o.set,F=o.add,j=f,q=o.scale,Y=o.dot,D=o.lerp,z=o.length,V=z,$=o.squaredLength,G=$,X=o.normalize,U=o.exactEquals,H=o.equals,Z=(E=s.create(),O=s.fromValues(1,0,0),I=s.fromValues(0,1,0),function(t,e,r){var n=s.dot(e,r);return n<-.999999?(s.cross(E,O,e),s.len(E)<1e-6&&s.cross(E,I,e),s.normalize(E,E),u(t,E,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(s.cross(E,e,r),t[0]=E[0],t[1]=E[1],t[2]=E[2],t[3]=1+n,X(t,t))}),Q=(R=a(),C=a(),function(t,e,r,n,i,s){return x(R,e,i,s),x(C,r,n,s),x(t,R,C,2*s*(1-s)),t}),W=(T=i.create(),function(t,e,r,n){return T[0]=r[0],T[3]=r[1],T[6]=r[2],T[1]=n[0],T[4]=n[1],T[7]=n[2],T[2]=-e[0],T[5]=-e[1],T[8]=-e[2],X(t,S(t,T))})},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,fromValues:()=>o,copy:()=>a,set:()=>h,add:()=>u,subtract:()=>c,multiply:()=>l,divide:()=>f,ceil:()=>d,floor:()=>p,min:()=>m,max:()=>g,round:()=>y,scale:()=>v,scaleAndAdd:()=>b,distance:()=>x,squaredDistance:()=>M,length:()=>w,squaredLength:()=>_,negate:()=>S,inverse:()=>A,normalize:()=>P,dot:()=>E,cross:()=>O,lerp:()=>I,random:()=>R,transformMat4:()=>C,transformQuat:()=>T,zero:()=>L,str:()=>k,exactEquals:()=>B,equals:()=>N,sub:()=>j,mul:()=>q,div:()=>Y,dist:()=>D,sqrDist:()=>z,len:()=>V,sqrLen:()=>$,forEach:()=>G});var n=r(11);function i(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function s(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(t,e,r,i){var s=new n.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=r,s[3]=i,s}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function h(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function u(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function l(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}function f(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function m(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}function g(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}function y(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function v(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function b(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}function x(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return Math.hypot(r,n,i,s)}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return r*r+n*n+i*i+s*s}function w(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}function _(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function A(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function P(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s;return o>0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=s*o,t}function E(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function O(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],s=r[0]*n[2]-r[2]*n[0],o=r[0]*n[3]-r[3]*n[0],a=r[1]*n[2]-r[2]*n[1],h=r[1]*n[3]-r[3]*n[1],u=r[2]*n[3]-r[3]*n[2],c=e[0],l=e[1],f=e[2],d=e[3];return t[0]=l*u-f*h+d*a,t[1]=-c*u+f*o-d*s,t[2]=c*h-l*o+d*i,t[3]=-c*a+l*s-f*i,t}function I(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t[3]=a+n*(r[3]-a),t}function R(t,e){var r,i,s,o,a,h;e=e||1;do{a=(r=2*n.RANDOM()-1)*r+(i=2*n.RANDOM()-1)*i}while(a>=1);do{h=(s=2*n.RANDOM()-1)*s+(o=2*n.RANDOM()-1)*o}while(h>=1);var u=Math.sqrt((1-a)/h);return t[0]=e*r,t[1]=e*i,t[2]=e*s*u,t[3]=e*o*u,t}function C(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*s+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*s+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*s+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*s+r[15]*o,t}function T(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],h=r[2],u=r[3],c=u*n+a*s-h*i,l=u*i+h*n-o*s,f=u*s+o*i-a*n,d=-o*n-a*i-h*s;return t[0]=c*u+d*-o+l*-h-f*-a,t[1]=l*u+d*-a+f*-o-c*-h,t[2]=f*u+d*-h+c*-a-l*-o,t[3]=e[3],t}function L(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function k(t){return\"vec4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}function B(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function N(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=e[0],h=e[1],u=e[2],c=e[3];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-h)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-u)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}var F,j=c,q=l,Y=f,D=x,z=M,V=w,$=_,G=(F=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=4),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,length:()=>o,fromValues:()=>a,copy:()=>h,set:()=>u,add:()=>c,subtract:()=>l,multiply:()=>f,divide:()=>d,ceil:()=>p,floor:()=>m,min:()=>g,max:()=>y,round:()=>v,scale:()=>b,scaleAndAdd:()=>x,distance:()=>M,squaredDistance:()=>w,squaredLength:()=>_,negate:()=>S,inverse:()=>A,normalize:()=>P,dot:()=>E,cross:()=>O,lerp:()=>I,hermite:()=>R,bezier:()=>C,random:()=>T,transformMat4:()=>L,transformMat3:()=>k,transformQuat:()=>B,rotateX:()=>N,rotateY:()=>F,rotateZ:()=>j,angle:()=>q,zero:()=>Y,str:()=>D,exactEquals:()=>z,equals:()=>V,sub:()=>G,mul:()=>X,div:()=>U,dist:()=>H,sqrDist:()=>Z,len:()=>Q,sqrLen:()=>W,forEach:()=>J});var n=r(11);function i(){var t=new n.ARRAY_TYPE(3);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function s(t){var e=new n.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function o(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function a(t,e,r){var i=new n.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=r,i}function h(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function u(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function c(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function l(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function f(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function d(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function p(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function m(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function g(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function y(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function v(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function b(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function x(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function w(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function _(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function A(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function P(t,e){var r=e[0],n=e[1],i=e[2],s=r*r+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function E(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function O(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],h=r[2];return t[0]=i*h-s*a,t[1]=s*o-n*h,t[2]=n*a-i*o,t}function I(t,e,r,n){var i=e[0],s=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t}function R(t,e,r,n,i,s){var o=s*s,a=o*(2*s-3)+1,h=o*(s-2)+s,u=o*(s-1),c=o*(3-2*s);return t[0]=e[0]*a+r[0]*h+n[0]*u+i[0]*c,t[1]=e[1]*a+r[1]*h+n[1]*u+i[1]*c,t[2]=e[2]*a+r[2]*h+n[2]*u+i[2]*c,t}function C(t,e,r,n,i,s){var o=1-s,a=o*o,h=s*s,u=a*o,c=3*s*a,l=3*h*o,f=h*s;return t[0]=e[0]*u+r[0]*c+n[0]*l+i[0]*f,t[1]=e[1]*u+r[1]*c+n[1]*l+i[1]*f,t[2]=e[2]*u+r[2]*c+n[2]*l+i[2]*f,t}function T(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,s=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*s,t[1]=Math.sin(r)*s,t[2]=i*e,t}function L(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[3]*n+r[7]*i+r[11]*s+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*s+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*s+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*s+r[14])/o,t}function k(t,e,r){var n=e[0],i=e[1],s=e[2];return t[0]=n*r[0]+i*r[3]+s*r[6],t[1]=n*r[1]+i*r[4]+s*r[7],t[2]=n*r[2]+i*r[5]+s*r[8],t}function B(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],h=e[1],u=e[2],c=i*u-s*h,l=s*a-n*u,f=n*h-i*a,d=i*f-s*l,p=s*c-n*f,m=n*l-i*c,g=2*o;return c*=g,l*=g,f*=g,d*=2,p*=2,m*=2,t[0]=a+c+d,t[1]=h+l+p,t[2]=u+f+m,t}function N(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0],s[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),s[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function F(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),s[1]=i[1],s[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function j(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),s[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),s[2]=i[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function q(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2],h=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(s*s+o*o+a*a),u=h&&E(t,e)/h;return Math.acos(Math.min(Math.max(u,-1),1))}function Y(t){return t[0]=0,t[1]=0,t[2]=0,t}function D(t){return\"vec3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\")\"}function z(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function V(t,e){var r=t[0],i=t[1],s=t[2],o=e[0],a=e[1],h=e[2];return Math.abs(r-o)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-a)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(s-h)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(h))}var $,G=l,X=f,U=d,H=M,Z=w,Q=o,W=_,J=($=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=3),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{\"use strict\";r.r(e),r.d(e,{create:()=>o,clone:()=>a,fromValues:()=>h,fromRotationTranslationValues:()=>u,fromRotationTranslation:()=>c,fromTranslation:()=>l,fromRotation:()=>f,fromMat4:()=>d,copy:()=>p,identity:()=>m,set:()=>g,getReal:()=>y,getDual:()=>v,setReal:()=>b,setDual:()=>x,getTranslation:()=>M,translate:()=>w,rotateX:()=>_,rotateY:()=>S,rotateZ:()=>A,rotateByQuatAppend:()=>P,rotateByQuatPrepend:()=>E,rotateAroundAxis:()=>O,add:()=>I,multiply:()=>R,mul:()=>C,scale:()=>T,dot:()=>L,lerp:()=>k,invert:()=>B,conjugate:()=>N,length:()=>F,len:()=>j,squaredLength:()=>q,sqrLen:()=>Y,normalize:()=>D,str:()=>z,exactEquals:()=>V,equals:()=>$});var n=r(11),i=r(16),s=r(15);function o(){var t=new n.ARRAY_TYPE(8);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function a(t){var e=new n.ARRAY_TYPE(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function h(t,e,r,i,s,o,a,h){var u=new n.ARRAY_TYPE(8);return u[0]=t,u[1]=e,u[2]=r,u[3]=i,u[4]=s,u[5]=o,u[6]=a,u[7]=h,u}function u(t,e,r,i,s,o,a){var h=new n.ARRAY_TYPE(8);h[0]=t,h[1]=e,h[2]=r,h[3]=i;var u=.5*s,c=.5*o,l=.5*a;return h[4]=u*i+c*r-l*e,h[5]=c*i+l*t-u*r,h[6]=l*i+u*e-c*t,h[7]=-u*t-c*e-l*r,h}function c(t,e,r){var n=.5*r[0],i=.5*r[1],s=.5*r[2],o=e[0],a=e[1],h=e[2],u=e[3];return t[0]=o,t[1]=a,t[2]=h,t[3]=u,t[4]=n*u+i*h-s*a,t[5]=i*u+s*o-n*h,t[6]=s*u+n*a-i*o,t[7]=-n*o-i*a-s*h,t}function l(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function d(t,e){var r=i.create();s.getRotation(r,e);var o=new n.ARRAY_TYPE(3);return s.getTranslation(o,e),c(t,r,o),t}function p(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function m(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function g(t,e,r,n,i,s,o,a,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t}var y=i.copy;function v(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var b=i.copy;function x(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function M(t,e){var r=e[4],n=e[5],i=e[6],s=e[7],o=-e[0],a=-e[1],h=-e[2],u=e[3];return t[0]=2*(r*u+s*o+n*h-i*a),t[1]=2*(n*u+s*a+i*o-r*h),t[2]=2*(i*u+s*h+r*a-n*o),t}function w(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=.5*r[0],h=.5*r[1],u=.5*r[2],c=e[4],l=e[5],f=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=o*a+i*u-s*h+c,t[5]=o*h+s*a-n*u+l,t[6]=o*u+n*h-i*a+f,t[7]=-n*a-i*h-s*u+d,t}function _(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],h=e[4],u=e[5],c=e[6],l=e[7],f=h*a+l*n+u*o-c*s,d=u*a+l*s+c*n-h*o,p=c*a+l*o+h*s-u*n,m=l*a-h*n-u*s-c*o;return i.rotateX(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function S(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],h=e[4],u=e[5],c=e[6],l=e[7],f=h*a+l*n+u*o-c*s,d=u*a+l*s+c*n-h*o,p=c*a+l*o+h*s-u*n,m=l*a-h*n-u*s-c*o;return i.rotateY(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function A(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],h=e[4],u=e[5],c=e[6],l=e[7],f=h*a+l*n+u*o-c*s,d=u*a+l*s+c*n-h*o,p=c*a+l*o+h*s-u*n,m=l*a-h*n-u*s-c*o;return i.rotateZ(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function P(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],h=e[1],u=e[2],c=e[3];return t[0]=a*o+c*n+h*s-u*i,t[1]=h*o+c*i+u*n-a*s,t[2]=u*o+c*s+a*i-h*n,t[3]=c*o-a*n-h*i-u*s,a=e[4],h=e[5],u=e[6],c=e[7],t[4]=a*o+c*n+h*s-u*i,t[5]=h*o+c*i+u*n-a*s,t[6]=u*o+c*s+a*i-h*n,t[7]=c*o-a*n-h*i-u*s,t}function E(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*c+o*a+i*u-s*h,t[1]=i*c+o*h+s*a-n*u,t[2]=s*c+o*u+n*h-i*a,t[3]=o*c-n*a-i*h-s*u,a=r[4],h=r[5],u=r[6],c=r[7],t[4]=n*c+o*a+i*u-s*h,t[5]=i*c+o*h+s*a-n*u,t[6]=s*c+o*u+n*h-i*a,t[7]=o*c-n*a-i*h-s*u,t}function O(t,e,r,i){if(Math.abs(i)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,s=e[2]/r,o=e[3]/r,a=e[4],h=e[5],u=e[6],c=e[7],l=n*a+i*h+s*u+o*c;t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=(a-n*l)/r,t[5]=(h-i*l)/r,t[6]=(u-s*l)/r,t[7]=(c-o*l)/r}return t}function z(t){return\"quat2(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\")\"}function V(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function $(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=t[6],c=t[7],l=e[0],f=e[1],d=e[2],p=e[3],m=e[4],g=e[5],y=e[6],v=e[7];return Math.abs(r-l)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(i-f)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(s-d)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(o-p)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-m)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(h-g)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(g))&&Math.abs(u-y)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-v)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(v))}},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,fromValues:()=>o,copy:()=>a,set:()=>h,add:()=>u,subtract:()=>c,multiply:()=>l,divide:()=>f,ceil:()=>d,floor:()=>p,min:()=>m,max:()=>g,round:()=>y,scale:()=>v,scaleAndAdd:()=>b,distance:()=>x,squaredDistance:()=>M,length:()=>w,squaredLength:()=>_,negate:()=>S,inverse:()=>A,normalize:()=>P,dot:()=>E,cross:()=>O,lerp:()=>I,random:()=>R,transformMat2:()=>C,transformMat2d:()=>T,transformMat3:()=>L,transformMat4:()=>k,rotate:()=>B,angle:()=>N,zero:()=>F,str:()=>j,exactEquals:()=>q,equals:()=>Y,len:()=>z,sub:()=>V,mul:()=>$,div:()=>G,dist:()=>X,sqrDist:()=>U,sqrLen:()=>H,forEach:()=>Z});var n=r(11);function i(){var t=new n.ARRAY_TYPE(2);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function s(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e}function o(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r}function a(t,e){return t[0]=e[0],t[1]=e[1],t}function h(t,e,r){return t[0]=e,t[1]=r,t}function u(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function l(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function f(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function m(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function g(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function y(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function v(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function b(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function x(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function w(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function _(t){var e=t[0],r=t[1];return e*e+r*r}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t}function A(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function P(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function E(t,e){return t[0]*e[0]+t[1]*e[1]}function O(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function I(t,e,r,n){var i=e[0],s=e[1];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t}function R(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function C(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function T(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function L(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function k(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function B(t,e,r,n){var i=e[0]-r[0],s=e[1]-r[1],o=Math.sin(n),a=Math.cos(n);return t[0]=i*a-s*o+r[0],t[1]=i*o+s*a+r[1],t}function N(t,e){var r=t[0],n=t[1],i=e[0],s=e[1],o=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+s*s),a=o&&(r*i+n*s)/o;return Math.acos(Math.min(Math.max(a,-1),1))}function F(t){return t[0]=0,t[1]=0,t}function j(t){return\"vec2(\"+t[0]+\", \"+t[1]+\")\"}function q(t,e){return t[0]===e[0]&&t[1]===e[1]}function Y(t,e){var r=t[0],i=t[1],s=e[0],o=e[1];return Math.abs(r-s)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-o)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))}var D,z=w,V=c,$=l,G=f,X=x,U=M,H=_,Z=(D=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=2),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Scene=void 0;const n=r(22),i=r(23),s=r(32),o=r(30);class a{constructor(t={}){this.width=400,this.height=400,this.background=\"hsla(0, 0%, 0%, 1)\",this.color=\"hsla(0, 0%, 100%, 1)\",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?[\"number\"==typeof t.anchor[0]?(.5+.5*o.clamp(-1,1,t.anchor[0]))*this.width:\"left\"===t.anchor[0]?0:\"right\"===t.anchor[0]?this.width:this.center[0],\"number\"==typeof t.anchor[1]?(.5+.5*o.clamp(-1,1,t.anchor[1]))*this.height:\"top\"===t.anchor[1]?0:\"bottom\"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e=\"number\"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,a.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{a.propagateToChilden(t,e)})):t instanceof s.Shape&&t.shape&&(t.shape.scene=e,a.propagateToChilden(t.shape,e))}}e.Scene=a},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||\"SceneChild\",this.name=t.name||this.type+\"_\"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){\"string\"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Group=void 0;const n=r(21),i=r(22),s=r(24),o=r(28);class a extends i.SceneChild{constructor(t={}){t.type=\"Group\",super(t),this.children=[],[\"id\",\"name\",\"data\",\"order\",\"type\"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=o.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){\"object\"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=a},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeBase=void 0;const n=r(10),i=r(1),s=r(25),o=r(26),a=r(27),h=r(28),u=r(30),c=r(22),l=n.mat4.create(),f=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class m extends c.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?[\"number\"==typeof t.anchor[0]?-1*u.clamp(-1,1,t.anchor[0]):\"left\"===t.anchor[0]?1:\"right\"===t.anchor[0]?-1:0,\"number\"==typeof t.anchor[1]?-1*u.clamp(-1,1,t.anchor[1]):\"top\"===t.anchor[1]?1:\"bottom\"===t.anchor[1]?-1:0]:[0,0],this.boundingType=\"string\"==typeof t.boundingType?\"relative\"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return\"function\"!=typeof t.repetitions&&\"function\"!=typeof t.distance&&\"function\"!=typeof t.displace&&\"function\"!=typeof t.scale&&\"function\"!=typeof t.translate&&\"function\"!=typeof t.skewX&&\"function\"!=typeof t.skewY&&\"function\"!=typeof t.squeezeX&&\"function\"!=typeof t.squeezeY&&\"function\"!=typeof t.rotateX&&\"function\"!=typeof t.rotateY&&\"function\"!=typeof t.rotateZ&&\"function\"!=typeof t.transformOrigin&&\"function\"!=typeof t.perspective&&\"function\"!=typeof t.perspectiveOrigin}isStaticIndexed(){return\"function\"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return\"function\"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){\"string\"==typeof t?(r=r||\"repetitions\"==t,this.props[t]=e):(r=r||\"repetitions\"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var c,g;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const y=m.getEmptyPropArguments(this,r),v=y.repetition,b=this.getProp(\"repetitions\",y,1),x=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,M=Array.isArray(b)?b[0]*(null!==(c=b[1])&&void 0!==c?c:b[0]):b,w=Array.isArray(b)?b[0]:M,_=Array.isArray(b)?null!==(g=b[1])&&void 0!==g?g:b[0]:1,S=v.row;S.count=w;const A=v.col;A.count=_,v.count=M,v.col.count=_,v.row.count=w,v.type=x;let P=0;const E=[];let O=0;const I=n.vec2.fromValues((_-1)/2,(w-1)/2),R=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],C=[void 0,void 0,void 0,void 0],T=[void 0,void 0,void 0,void 0];for(let r=0;r1?O/(M-1):1,v.angle=x===i.ERepetitionType.Ring?a.PI2/M*O:0,A.index=c+1,A.offset=_>1?c/(_-1):1,S.index=r+1,S.offset=w>1?r/(w-1):1;const m=this.generateBuffer(t,y),g=m.length,b=this.getShapeBounding();E[O]=new Float32Array(g),P+=g;{const t=s.toVec2(this.getProp(\"distance\",y,s.VEC2_ZERO)),a=this.getProp(\"displace\",y,0),M=s.toVec3(this.getProp(\"scale\",y,s.VEC2_ONE),1),w=s.toVec3(this.getProp(\"translate\",y,s.VEC2_ZERO),0),_=this.getProp(\"skewX\",y,0),S=this.getProp(\"skewY\",y,0),A=this.getProp(\"squeezeX\",y,0),P=this.getProp(\"squeezeY\",y,0),L=this.getProp(\"rotateX\",y,0),k=this.getProp(\"rotateY\",y,0),B=this.getProp(\"rotateZ\",y,0),N=u.clamp(0,1,this.getProp(\"perspective\",y,0)),F=s.toVec3(this.getProp(\"perspectiveOrigin\",y,s.VEC2_ZERO),0),j=s.toVec3(this.getProp(\"transformOrigin\",y,s.VEC2_ZERO),0);let q;switch(x){case i.ERepetitionType.Ring:q=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(q,q,s.VEC3_ZERO,v.angle+a);break;case i.ERepetitionType.Matrix:q=n.vec3.fromValues(t[1]*(c-I[0]),t[0]*(r-I[1]),0)}const Y=N>0?Math.max(b.width,b.height)/2:1,D=N>0?Y+10*Y*(1-N):0,z=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==N||0!==j[0]||0!==j[1],V=0!==F[0]||0!==F[1];z&&(this.boundingType===i.EBoundingType.Relative?(j[0]=j[0]*(b.width/2)+b.cx,j[1]=j[1]*(b.height/2)+b.cy):(j[0]*=b.width/2,j[1]*=b.height/2),j[2]=D);{n.mat4.identity(f),z&&n.mat4.translate(f,f,j),0===w[0]&&0===w[1]||n.mat4.translate(f,f,w),0===_&&0===S||(s.fromSkew(l,[_,S]),n.mat4.multiply(f,f,l)),0!==L&&n.mat4.rotateX(f,f,L),0!==k&&n.mat4.rotateY(f,f,k),0!==B&&n.mat4.rotateZ(f,f,B),1===M[0]&&1===M[1]||n.mat4.scale(f,f,M),z&&n.mat4.translate(f,f,n.vec3.scale(j,j,-1)),D>0&&(V&&(this.boundingType===i.EBoundingType.Relative?(F[0]=F[0]*(b.width/2)+b.cx,F[1]=F[1]*(b.height/2)+b.cy):(F[0]*=b.width/2,F[1]*=b.height/2),F[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,q),e&&n.mat4.translate(p,p,R);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),x===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,v.angle+a)}h.Bounding.clear(T);for(let t=0;t0&&(V&&n.vec3.add(e,e,F),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,D),V&&n.vec3.sub(e,e,F)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=g/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,y)}E[O][t]=e[0],E[O][t+1]=e[1],h.Bounding.add(T,e[0],e[1]),h.Bounding.add(C,e[0],e[1])}}const L={cx:0,cy:0,x:-1,y:-1,width:2,height:2};h.Bounding.bind(L,T),this.bStaticIndexed&&this.bIndexed||this.addIndex(g,v,L)}h.Bounding.bind(this.bounding,C),this.buffer=new Float32Array(P);for(let t=0,e=0,r=E.length;t({index:1,offset:1,count:1}),m.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...m.getEmptySimpleRepetition(),row:m.getEmptySimpleRepetition(),col:m.getEmptySimpleRepetition()})},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(10);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return\"number\"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(29);var i;!function(t){t[t.None=0]=\"None\",t[t.Scale=2]=\"Scale\",t[t.Center=4]=\"Center\",t[t.Fill=8]=\"Fill\"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn(\"[Urplfanze:Bounding] cannot sum bounding\")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn(\"[Urplfanze:Bounding] cannot bind bounding\")}};class s extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return s.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=s.getBounding(t));const o=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,a=e>=i.Center?r.cx:0,h=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(31),i=r(4),s=r(26),o=\"undefined\"!=typeof performance?performance:Date;function a(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return o.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=a,e.relativeClamp=function(t,e,r,n,i){return a(n,i,(r-t)/(e-t)*(i-n)+n)};const h={random:new n(Math.random)};e.noise=function(t=\"random\",e=0,r=0,i=0){return void 0===h[t]&&(h[t]=new n(t)),h[t].noise3D(e,r,i)};const u={};function c(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),s=rn?[s,o]:[o,s]}function l(t,e){const r=t.length,n=r/2,i=2*(n+e),s=n-1;if(s>1){const n=r-2,o=Math.floor(e/s);let a=(i-(r+o*n))/2;const h=Math.round(s/a),u=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%h==0||e===n-2),p=o+(d?1:0),m=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);u[i]=(s=t(),o=t(),a=t(),h=t(),function(){let t=(s>>>=0)+(o>>>=0)|0;return s=o^o>>>9,o=(a>>>=0)+(a<<3)|0,t=t+(h=1+(h>>>=0)|0)|0,a=(a=a<<21|a>>>11)+t|0,(t>>>0)/4294967296})}var s,o,a,h;const c=e+u[i]()*(r-e);return void 0!==n?Math.round(c*10**n)/10**n:c},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return s.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=c,e.interpolate=function(t,e,r=.5){const[n,i]=c(t,e),s=Math.max(n.length,i.length),o=\"number\"==typeof r?[r]:r,a=s/2;if(o.length!==a){const t=o.length;for(let e=0;e{var n;!function(){\"use strict\";var i=.5*(Math.sqrt(3)-1),s=(3-Math.sqrt(3))/6,o=1/6,a=(Math.sqrt(5)-1)/4,h=(5-Math.sqrt(5))/20;function u(t){var e;e=\"function\"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=l();t=i(\" \"),e=i(\" \"),r=i(\" \");for(var s=0;s>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}u.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,o=this.permMod12,a=this.perm,h=this.grad3,u=0,c=0,l=0,f=(t+e)*i,d=Math.floor(t+f),p=Math.floor(e+f),m=(d+p)*s,g=t-(d-m),y=e-(p-m);g>y?(r=1,n=0):(r=0,n=1);var v=g-r+s,b=y-n+s,x=g-1+2*s,M=y-1+2*s,w=255&d,_=255&p,S=.5-g*g-y*y;if(S>=0){var A=3*o[w+a[_]];u=(S*=S)*S*(h[A]*g+h[A+1]*y)}var P=.5-v*v-b*b;if(P>=0){var E=3*o[w+r+a[_+n]];c=(P*=P)*P*(h[E]*v+h[E+1]*b)}var O=.5-x*x-M*M;if(O>=0){var I=3*o[w+1+a[_+1]];l=(O*=O)*O*(h[I]*x+h[I+1]*M)}return 70*(u+c+l)},noise3D:function(t,e,r){var n,i,s,a,h,u,c,l,f,d,p=this.permMod12,m=this.perm,g=this.grad3,y=.3333333333333333*(t+e+r),v=Math.floor(t+y),b=Math.floor(e+y),x=Math.floor(r+y),M=(v+b+x)*o,w=t-(v-M),_=e-(b-M),S=r-(x-M);w>=_?_>=S?(h=1,u=0,c=0,l=1,f=1,d=0):w>=S?(h=1,u=0,c=0,l=1,f=0,d=1):(h=0,u=0,c=1,l=1,f=0,d=1):_T?B++:N++,C>L?B++:F++,C>k?B++:j++,T>L?N++:F++,T>k?N++:j++,L>k?F++:j++;var q=C-(l=B>=3?1:0)+h,Y=T-(f=N>=3?1:0)+h,D=L-(d=F>=3?1:0)+h,z=k-(p=j>=3?1:0)+h,V=C-(m=B>=2?1:0)+2*h,$=T-(g=N>=2?1:0)+2*h,G=L-(y=F>=2?1:0)+2*h,X=k-(v=j>=2?1:0)+2*h,U=C-(b=B>=1?1:0)+3*h,H=T-(x=N>=1?1:0)+3*h,Z=L-(M=F>=1?1:0)+3*h,Q=k-(w=j>=1?1:0)+3*h,W=C-1+4*h,J=T-1+4*h,K=L-1+4*h,tt=k-1+4*h,et=255&P,rt=255&E,nt=255&O,it=255&I,st=.6-C*C-T*T-L*L-k*k;if(st<0)i=0;else{var ot=_[et+_[rt+_[nt+_[it]]]]%32*4;i=(st*=st)*st*(S[ot]*C+S[ot+1]*T+S[ot+2]*L+S[ot+3]*k)}var at=.6-q*q-Y*Y-D*D-z*z;if(at<0)s=0;else{var ht=_[et+l+_[rt+f+_[nt+d+_[it+p]]]]%32*4;s=(at*=at)*at*(S[ht]*q+S[ht+1]*Y+S[ht+2]*D+S[ht+3]*z)}var ut=.6-V*V-$*$-G*G-X*X;if(ut<0)o=0;else{var ct=_[et+m+_[rt+g+_[nt+y+_[it+v]]]]%32*4;o=(ut*=ut)*ut*(S[ct]*V+S[ct+1]*$+S[ct+2]*G+S[ct+3]*X)}var lt=.6-U*U-H*H-Z*Z-Q*Q;if(lt<0)u=0;else{var ft=_[et+b+_[rt+x+_[nt+M+_[it+w]]]]%32*4;u=(lt*=lt)*lt*(S[ft]*U+S[ft+1]*H+S[ft+2]*Z+S[ft+3]*Q)}var dt=.6-W*W-J*J-K*K-tt*tt;if(dt<0)c=0;else{var pt=_[et+1+_[rt+1+_[nt+1+_[it+1]]]]%32*4;c=(dt*=dt)*dt*(S[pt]*W+S[pt+1]*J+S[pt+2]*K+S[pt+3]*tt)}return 27*(i+s+o+u+c)}},u._buildPermutationTable=c,void 0===(n=function(){return u}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=u,t.exports=u}()},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Shape=void 0;const n=r(21),i=r(22),s=r(24);class o extends s.ShapeBase{constructor(t){t.type=t.type||\"Shape\",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn(\"[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\\nYou passed:\",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):o.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapePrimitive=void 0;const n=r(25),i=r(24),s=r(29),o=r(28);class a extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=o.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:\"function\"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return\"function\"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:\"number\"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp(\"sideLength\",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeLoop=void 0;const n=r(27),i=r(28),s=r(33),o=r(24);class a extends s.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||\"ShapeLoop\",super(t),this.loopDependencies=(t.loopDependencies||[]).concat(\"sideLength\"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes(\"propArguments\"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}\"loop\"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||o.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?(\"function\"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),s=this.getRepetitionSideLength(t),o=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,a={index:0,offset:0,current:0,count:n},h=a.count,u=new Float32Array(2*h);for(let n=0,i=0;n1?n/(a.count-1):1;a.current=s,a.index=n+1,a.offset=h;const c=o(a,t);u[i]=c[0],u[i+1]=c[1]}const c=[void 0,void 0,void 0,void 0],l=this.applyModifiers(u,t);for(let t=0,e=l.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeBuffer=void 0;const n=r(28),i=r(33);class s extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||\"ShapeBuffer\",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn(\"[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property\"),this.shape=s.EMPTY_BUFFER):this.shape=\"function\"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return\"function\"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return\"function\"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from(\"function\"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,s=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&\"function\"!=typeof this.props.sideLength&&\"function\"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeRecursive=void 0;const n=r(32);class i extends n.Shape{constructor(t){t.type=t.type||\"ShapeRecursive\",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return\"function\"!=typeof this.props.recursions&&\"function\"!=typeof this.props.recursionScale&&\"function\"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return\"function\"!=typeof this.props.recursions&&\"function\"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp(\"recursions\",e,1)),n=Math.floor(this.getProp(\"recursionVertex\",e,0)),s=this.getProp(\"recursionScale\",e,2),o=this.shape;let a={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const h={...e,recursion:a};o.generate(t,!1,h);const u=o.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=u);let c=u;const l=[a];let f=0,d=1;const p=c.length,m=p/2,g=n<=0?m:Math.min(n,m),y=0===n?1:m/Math.min(n,m),v=new Float32Array(i.summmation(r,g)*p);for(let t=0;t1?e/(r-1):1,u=i.summmation(e,g)*p,m=e-1,b=0===m?0:i.summmation(m,g)*p;for(let i=0,m=g**e;i1?i/(m-1):1,count:m,level:{index:e+1,offset:n,count:r},parent:l[f]},l.push(a),this.shapeUseRecursion&&(h.recursion=a,o.generate(t,!1,h),c=o.getBuffer());const x=u+i*p,M=Math.floor(b+2*i*y),w=v[M],_=v[M+1],S=s**e;for(let t=0,e=p;t1?0:1,count:s}}},h=this.shape.getIndexedBuffer()||[];for(let t=0,e=h.length;t1?0:1,count:s}},i={...a,recursion:r},o=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:o})}if(s>1){const t=this.shape.getBufferLength({...i,parent:{...a}})/2,e=o<=0?t:Math.min(o,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let u=0,c=1;for(let t=1;t1?t/(s-1):1;for(let o=0,l=e**t;o1?o/(l-1):1;for(let d=0,p=h.length;d{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeFollow=void 0;const n=r(32);class i extends n.Shape{constructor(t){t.type=t.type||\"ShapeFollow\",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},s=this.shape;s.generate(t,!1,i);let o=s.getBuffer();const a=o.length,h=new Float32Array(a*(n.length/2)),u=n.length/2;for(let e=0;e1?e/(u-1):1,count:u};this.shapeUseFollow&&(i.follow=r,s.generate(t,!1,i),o=s.getBuffer());const c=e*a,l=2*e,f=n[l],d=n[l+1];for(let t=0,e=o.length;t1?t/(e-1):1;for(let o=0,a=s.length;o{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Line=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type=\"Line\",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Triangle=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type=\"Triangle\",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=s,s.buffer=[1,0,-1,1,-1,-1]},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Rect=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type=\"Rect\",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=s,s.buffer=[1,1,-1,1,-1,-1,1,-1]},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Polygon=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||\"Polygon\",t.loopDependencies=(t.loopDependencies||[]).concat([\"sideNumber\"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp(\"sideNumber\",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Circle=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=\"Circle\",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Star=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||\"Polygon\",t.loopDependencies=(t.loopDependencies||[]).concat([\"spikes\",\"innerRadius\"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp(\"spikes\",t,5),this.innerRadius=this.getProp(\"innerRadius\",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Rose=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r;t.type=\"Rose\",t.loopDependencies=(t.loopDependencies||[]).concat([\"n\",\"d\"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>s.getFinalAngleFromK(this.getProp(\"n\",t),this.getProp(\"d\",t)),inc:t=>{const e=this.getProp(\"n\",t),r=this.getProp(\"d\",t),i=this.getRepetitionSideLength(t),s=Math.pow(i[0]*i[1],.45),o=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp(\"n\",t)/this.getProp(\"d\",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Spiral=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type=\"Spiral\",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat([\"twists\",\"twistsStart\",\"spiral\"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:s.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp(\"twistsStart\",t),end:t=>n.PI2*(this.getProp(\"twistsStart\",t)+this.getProp(\"twists\",t)),inc:t=>{const e=this.getProp(\"twists\",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp(\"spiral\",t),this.r=s.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case s.types.ARCHIMEDE:return t=>t/10;case s.types.HYPERBOLIC:return t=>1/t*3;case s.types.FERMAT:return t=>t**.5/3;case s.types.LITUUS:return t=>t**-.5;case s.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=s,s.types={ARCHIMEDE:\"ARCHIMEDE\",HYPERBOLIC:\"HYPERBOLIC\",FERMAT:\"FERMAT\",LITUUS:\"LITUUS\",LOGARITHMIC:\"LOGARITHMIC\"}},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Lissajous=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=\"Lissajous\",t.loopDependencies=(t.loopDependencies||[]).concat([\"wx\",\"wy\",\"wz\"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp(\"wx\",t),r=this.getProp(\"wy\",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),s=this.getRepetitionSideLength(t);return 1/Math.pow(s[0]*s[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp(\"wx\",t,1),this.wy=this.getProp(\"wy\",t,2),this.wz=this.getProp(\"wz\",t,2),super.generateLoopBuffer(t)}}e.Lissajous=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.SuperShape=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r,i,s,o,a;t.type=\"SuperShape\",t.loopDependencies=(t.loopDependencies||[]).concat([\"a\",\"b\",\"m\",\"n1\",\"n2\",\"n3\"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(s=t.n1)&&void 0!==s?s:1,this.props.n2=null!==(o=t.n2)&&void 0!==o?o:1,this.props.n3=null!==(a=t.n3)&&void 0!==a?a:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp(\"a\",t),this.b=this.getProp(\"b\",t),this.m=this.getProp(\"m\",t),this.n1=this.getProp(\"n1\",t),this.n2=this.getProp(\"n2\",t),this.n3=this.getProp(\"n3\",t),super.generateLoopBuffer(t)}}e.SuperShape=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Modifiers=void 0;const n=r(28),i=r(49),s=r(50),o=r(52),a=r(53),h=r(51),u=r(54),c={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:s.Smooth,Solidify:o.Solidify,Subdivide:a.Subdivide,Close:h.Close,Offset:u.Offset};e.Modifiers=c},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Mirror=void 0;const n=r(29);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let s=0;s{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Smooth=void 0;const n=r(30),i=r(51),s=r(29);class o extends s.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Close=void 0;const n=r(29);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Solidify=void 0;const n=r(29);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const s=[],o=(e=\"number\"==typeof e?[e]:e).length;let a,h,u=[[0,0],[0,0]],c=[[0,0],[0,0]];for(let r=0,l=0,f=t.length-2;r{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Subdivide=void 0;const n=r(29);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Offset=void 0;const n=r(29);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i}],e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r(0)})()},t.exports=e()},479:(t,e,r)=>{var n;!function(){\"use strict\";function i(t,e,r){var n=e.x,i=e.y,s=r.x-n,o=r.y-i;if(0!==s||0!==o){var a=((t.x-n)*s+(t.y-i)*o)/(s*s+o*o);a>1?(n=r.x,i=r.y):a>0&&(n+=s*a,i+=o*a)}return(s=t.x-n)*s+(o=t.y-i)*o}function s(t,e,r,n,o){for(var a,h=n,u=e+1;uh&&(a=u,h=c)}h>n&&(a-e>1&&s(t,e,a,n,o),o.push(t[a]),r-a>1&&s(t,a,r,n,o))}function o(t,e){var r=t.length-1,n=[t[0]];return s(t,0,r,e,n),n.push(t[r]),n}function a(t,e,r){if(t.length<=2)return t;var n=void 0!==e?e*e:1;return o(t=r?t:function(t,e){for(var r,n,i,s,o,a=t[0],h=[a],u=1,c=t.length;ue&&(h.push(r),a=r);return a!==r&&h.push(r),h}(t,n),n)}void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()},721:(t,e,r)=>{\"use strict\";t.exports=r(192)},921:t=>{\"use strict\";var e=2*Math.PI;function r(t,e,r,n){var i=t*r+e*n;return i>1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)}function n(t,e){var r=4/3*Math.tan(e/4),n=Math.cos(t),i=Math.sin(t),s=Math.cos(t+e),o=Math.sin(t+e);return[n,i,n-i*r,i+n*r,s+o*r,o-s*r,s,o]}t.exports=function(t,i,s,o,a,h,u,c,l){var f=Math.sin(l*e/360),d=Math.cos(l*e/360),p=d*(t-s)/2+f*(i-o)/2,m=-f*(t-s)/2+d*(i-o)/2;if(0===p&&0===m)return[];if(0===u||0===c)return[];u=Math.abs(u),c=Math.abs(c);var g=p*p/(u*u)+m*m/(c*c);g>1&&(u*=Math.sqrt(g),c*=Math.sqrt(g));var y=function(t,n,i,s,o,a,h,u,c,l){var f=l*(t-i)/2+c*(n-s)/2,d=-c*(t-i)/2+l*(n-s)/2,p=h*h,m=u*u,g=f*f,y=d*d,v=p*m-p*y-m*g;v<0&&(v=0),v/=p*y+m*g;var b=(v=Math.sqrt(v)*(o===a?-1:1))*h/u*d,x=v*-u/h*f,M=l*b-c*x+(t+i)/2,w=c*b+l*x+(n+s)/2,_=(f-b)/h,S=(d-x)/u,A=(-f-b)/h,P=(-d-x)/u,E=r(1,0,_,S),O=r(_,S,A,P);return 0===a&&O>0&&(O-=e),1===a&&O<0&&(O+=e),[M,w,E,O]}(t,i,s,o,a,h,u,c,f,d),v=[],b=y[2],x=y[3],M=Math.max(Math.ceil(Math.abs(x)/(e/4)),1);x/=M;for(var w=0;w{\"use strict\";var e=1e-10,r=Math.PI/180;function n(t,e,r){if(!(this instanceof n))return new n(t,e,r);this.rx=t,this.ry=e,this.ax=r}n.prototype.transform=function(t){var n=Math.cos(this.ax*r),i=Math.sin(this.ax*r),s=[this.rx*(t[0]*n+t[2]*i),this.rx*(t[1]*n+t[3]*i),this.ry*(-t[0]*i+t[2]*n),this.ry*(-t[1]*i+t[3]*n)],o=s[0]*s[0]+s[2]*s[2],a=s[1]*s[1]+s[3]*s[3],h=((s[0]-s[3])*(s[0]-s[3])+(s[2]+s[1])*(s[2]+s[1]))*((s[0]+s[3])*(s[0]+s[3])+(s[2]-s[1])*(s[2]-s[1])),u=(o+a)/2;if(hMath.abs(l-a)?(l-o)/c:c/(l-a))/Math.PI,this.ax>=0?(this.rx=Math.sqrt(l),this.ry=Math.sqrt(f)):(this.ax+=90,this.rx=Math.sqrt(f),this.ry=Math.sqrt(l)),this},n.prototype.isDegenerate=function(){return this.rx{\"use strict\";function e(){if(!(this instanceof e))return new e;this.queue=[],this.cache=null}e.prototype.matrix=function(t){return 1===t[0]&&0===t[1]&&0===t[2]&&1===t[3]&&0===t[4]&&0===t[5]||(this.cache=null,this.queue.push(t)),this},e.prototype.translate=function(t,e){return 0===t&&0===e||(this.cache=null,this.queue.push([1,0,0,1,t,e])),this},e.prototype.scale=function(t,e){return 1===t&&1===e||(this.cache=null,this.queue.push([t,0,0,e,0,0])),this},e.prototype.rotate=function(t,e,r){var n,i,s;return 0!==t&&(this.translate(e,r),n=t*Math.PI/180,i=Math.cos(n),s=Math.sin(n),this.queue.push([i,s,-s,i,0,0]),this.cache=null,this.translate(-e,-r)),this},e.prototype.skewX=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},e.prototype.skewY=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},e.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],1===this.queue.length)return this.cache;for(var t=1;t{\"use strict\";var e={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},r=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function n(t){return t>=48&&t<=57}function i(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err=\"\",this.segmentStart=0,this.data=[]}function s(t){for(;t.index=5760&&r.indexOf(e)>=0);)t.index++;var e}function o(t){var e=t.path.charCodeAt(t.index);return 48===e?(t.param=0,void t.index++):49===e?(t.param=1,void t.index++):void(t.err=\"SvgPath: arc flag can be 0 or 1 only (at pos \"+t.index+\")\")}function a(t){var e,r=t.index,i=r,s=t.max,o=!1,a=!1,h=!1,u=!1;if(i>=s)t.err=\"SvgPath: missed param (at pos \"+i+\")\";else if(43!==(e=t.path.charCodeAt(i))&&45!==e||(e=++i2&&(t.result.push([r,i[0],i[1]]),i=i.slice(2),n=\"l\",r=\"m\"===r?\"l\":\"L\"),\"r\"===n)t.result.push([r].concat(i));else for(;i.length>=e[n]&&(t.result.push([r].concat(i.splice(0,e[n]))),e[n]););}function u(t){var r,n,i,u,c,l,f=t.max;if(t.segmentStart=t.index,n=97==(32|(r=t.path.charCodeAt(t.index))),function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}(r))if(u=e[t.path[t.index].toLowerCase()],t.index++,s(t),t.data=[],u){for(i=!1;;){for(c=u;c>0;c--){if(!n||3!==c&&4!==c?a(t):o(t),t.err.length)return;t.data.push(t.param),s(t),i=!1,t.index=t.max)break;if(!((l=t.path.charCodeAt(t.index))>=48&&l<=57||43===l||45===l||46===l))break}}h(t)}else h(t);else t.err=\"SvgPath: bad command \"+t.path[t.index]+\" (at pos \"+t.index+\")\"}t.exports=function(t){var e=new i(t),r=e.max;for(s(e);e.index{\"use strict\";var n=r(665),i=r(94),s=r(480),o=r(921),a=r(954);function h(t){if(!(this instanceof h))return new h(t);var e=n(t);this.segments=e.segments,this.err=e.err,this.__stack=[]}h.from=function(t){if(\"string\"==typeof t)return new h(t);if(t instanceof h){var e=new h(\"\");return e.err=t.err,e.segments=t.segments.map((function(t){return t.slice()})),e.__stack=t.__stack.map((function(t){return s().matrix(t.toArray())})),e}throw new Error(\"SvgPath.from: invalid param type \"+t)},h.prototype.__matrix=function(t){var e,r=this;t.queue.length&&this.iterate((function(n,i,s,o){var h,u,c,l;switch(n[0]){case\"v\":u=0===(h=t.calc(0,n[1],!0))[0]?[\"v\",h[1]]:[\"l\",h[0],h[1]];break;case\"V\":u=(h=t.calc(s,n[1],!1))[0]===t.calc(s,o,!1)[0]?[\"V\",h[1]]:[\"L\",h[0],h[1]];break;case\"h\":u=0===(h=t.calc(n[1],0,!0))[1]?[\"h\",h[0]]:[\"l\",h[0],h[1]];break;case\"H\":u=(h=t.calc(n[1],o,!1))[1]===t.calc(s,o,!1)[1]?[\"H\",h[0]]:[\"L\",h[0],h[1]];break;case\"a\":case\"A\":var f=t.toArray(),d=a(n[1],n[2],n[3]).transform(f);if(f[0]*f[3]-f[1]*f[2]<0&&(n[5]=n[5]?\"0\":\"1\"),h=t.calc(n[6],n[7],\"a\"===n[0]),\"A\"===n[0]&&n[6]===s&&n[7]===o||\"a\"===n[0]&&0===n[6]&&0===n[7]){u=[\"a\"===n[0]?\"l\":\"L\",h[0],h[1]];break}u=d.isDegenerate()?[\"a\"===n[0]?\"l\":\"L\",h[0],h[1]]:[n[0],d.rx,d.ry,d.ax,n[4],n[5],h[0],h[1]];break;case\"m\":l=i>0,u=[\"m\",(h=t.calc(n[1],n[2],l))[0],h[1]];break;default:for(u=[c=n[0]],l=c.toLowerCase()===c,e=1;e=0;)t.matrix(this.__stack[e].toArray());this.__matrix(t),this.__stack=[]}},h.prototype.toString=function(){var t,e,r=[];this.__evaluateStack();for(var n=0;n0&&\"m\"!==e&&\"M\"!==e&&e===this.segments[n-1][0],r=r.concat(t?this.segments[n].slice(1):this.segments[n]);return r.join(\" \").replace(/ ?([achlmqrstvz]) ?/gi,\"$1\").replace(/ \\-/g,\"-\").replace(/zm/g,\"z m\")},h.prototype.translate=function(t,e){return this.__stack.push(s().translate(t,e||0)),this},h.prototype.scale=function(t,e){return this.__stack.push(s().scale(t,e||0===e?e:t)),this},h.prototype.rotate=function(t,e,r){return this.__stack.push(s().rotate(t,e||0,r||0)),this},h.prototype.skewX=function(t){return this.__stack.push(s().skewX(t)),this},h.prototype.skewY=function(t){return this.__stack.push(s().skewY(t)),this},h.prototype.matrix=function(t){return this.__stack.push(s().matrix(t)),this},h.prototype.transform=function(t){return t.trim()?(this.__stack.push(i(t)),this):this},h.prototype.round=function(t){var e,r=0,n=0,i=0,s=0;return t=t||0,this.__evaluateStack(),this.segments.forEach((function(o){var a=o[0].toLowerCase()===o[0];switch(o[0]){case\"H\":case\"h\":return a&&(o[1]+=i),i=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case\"V\":case\"v\":return a&&(o[1]+=s),s=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case\"Z\":case\"z\":return i=r,void(s=n);case\"M\":case\"m\":return a&&(o[1]+=i,o[2]+=s),i=o[1]-o[1].toFixed(t),s=o[2]-o[2].toFixed(t),r=i,n=s,o[1]=+o[1].toFixed(t),void(o[2]=+o[2].toFixed(t));case\"A\":case\"a\":return a&&(o[6]+=i,o[7]+=s),i=o[6]-o[6].toFixed(t),s=o[7]-o[7].toFixed(t),o[1]=+o[1].toFixed(t),o[2]=+o[2].toFixed(t),o[3]=+o[3].toFixed(t+2),o[6]=+o[6].toFixed(t),void(o[7]=+o[7].toFixed(t));default:return e=o.length,a&&(o[e-2]+=i,o[e-1]+=s),i=o[e-2]-o[e-2].toFixed(t),s=o[e-1]-o[e-1].toFixed(t),void o.forEach((function(e,r){r&&(o[r]=+o[r].toFixed(t))}))}})),this},h.prototype.iterate=function(t,e){var r,n,i,s=this.segments,o={},a=!1,h=0,u=0,c=0,l=0;if(e||this.__evaluateStack(),s.forEach((function(e,r){var n=t(e,r,h,u);Array.isArray(n)&&(o[r]=n,a=!0);var i=e[0]===e[0].toLowerCase();switch(e[0]){case\"m\":case\"M\":return h=e[1]+(i?h:0),u=e[2]+(i?u:0),c=h,void(l=u);case\"h\":case\"H\":return void(h=e[1]+(i?h:0));case\"v\":case\"V\":return void(u=e[1]+(i?u:0));case\"z\":case\"Z\":return h=c,void(u=l);default:h=e[e.length-2]+(i?h:0),u=e[e.length-1]+(i?u:0)}})),!a)return this;for(i=[],r=0;r{\"use strict\";var n=r(480),i={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},s=/\\s*(matrix|translate|scale|rotate|skewX|skewY)\\s*\\(\\s*(.+?)\\s*\\)[\\s,]*/,o=/[\\s,]+/;t.exports=function(t){var e,r,a=new n;return t.split(s).forEach((function(t){if(t.length)if(void 0===i[t])switch(r=t.split(o).map((function(t){return+t||0})),e){case\"matrix\":return void(6===r.length&&a.matrix(r));case\"scale\":return void(1===r.length?a.scale(r[0],r[0]):2===r.length&&a.scale(r[0],r[1]));case\"rotate\":return void(1===r.length?a.rotate(r[0],0,0):3===r.length&&a.rotate(r[0],r[1],r[2]));case\"translate\":return void(1===r.length?a.translate(r[0],0):2===r.length&&a.translate(r[0],r[1]));case\"skewX\":return void(1===r.length&&a.skewX(r[0]));case\"skewY\":return void(1===r.length&&a.skewY(r[0]))}else e=t})),a}},197:(t,e,r)=>{\"use strict\";function n(t,e){return Array.isArray(e)?[t.a*e[0]+t.c*e[1]+t.e,t.b*e[0]+t.d*e[1]+t.f]:{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function i(t,e){return e.map((e=>n(t,e)))}function s(t){return{a:parseFloat(t.a),b:parseFloat(t.b),c:parseFloat(t.c),d:parseFloat(t.d),e:parseFloat(t.e),f:parseFloat(t.f)}}r.r(e),r.d(e,{applyToPoint:()=>n,applyToPoints:()=>i,compose:()=>m,fromDefinition:()=>C,fromObject:()=>s,fromString:()=>a,fromTransformAttribute:()=>k,fromTriangles:()=>R,identity:()=>h,inverse:()=>u,isAffineMatrix:()=>f,rotate:()=>b,rotateDEG:()=>x,scale:()=>M,shear:()=>w,skew:()=>S,skewDEG:()=>A,smoothMatrix:()=>I,toCSS:()=>P,toSVG:()=>E,toString:()=>O,transform:()=>p,translate:()=>d});const o=/^matrix\\(\\s*([0-9_+-.e]+)\\s*,\\s*([0-9_+-.e]+)\\s*,\\s*([0-9_+-.e]+)\\s*,\\s*([0-9_+-.e]+)\\s*,\\s*([0-9_+-.e]+)\\s*,\\s*([0-9_+-.e]+)\\s*\\)$/i;function a(t){const e=t.match(o);if(null===e||e.length<7)throw new Error(`'${t}' is not a matrix`);return{a:parseFloat(e[1]),b:parseFloat(e[2]),c:parseFloat(e[3]),d:parseFloat(e[4]),e:parseFloat(e[5]),f:parseFloat(e[6])}}function h(){return{a:1,c:0,e:0,b:0,d:1,f:0}}function u(t){const{a:e,b:r,c:n,d:i,e:s,f:o}=t,a=e*i-r*n;return{a:i/a,b:r/-a,c:n/-a,d:e/a,e:(i*s-n*o)/-a,f:(r*s-e*o)/a}}function c(t){return void 0===t}function l(t){return\"number\"==typeof t&&!Number.isNaN(t)&&Number.isFinite(t)}function f(t){return\"object\"==typeof(e=t)&&null!==e&&!Array.isArray(e)&&\"a\"in t&&l(t.a)&&\"b\"in t&&l(t.b)&&\"c\"in t&&l(t.c)&&\"d\"in t&&l(t.d)&&\"e\"in t&&l(t.e)&&\"f\"in t&&l(t.f);var e}function d(t,e=0){return{a:1,c:0,e:t,b:0,d:1,f:e}}function p(...t){const e=(t,e)=>({a:t.a*e.a+t.c*e.b,c:t.a*e.c+t.c*e.d,e:t.a*e.e+t.c*e.f+t.e,b:t.b*e.a+t.d*e.b,d:t.b*e.c+t.d*e.d,f:t.b*e.e+t.d*e.f+t.f});switch((t=Array.isArray(t[0])?t[0]:t).length){case 0:throw new Error(\"no matrices provided\");case 1:return t[0];case 2:return e(t[0],t[1]);default:{const[r,n,...i]=t;return p(e(r,n),...i)}}}function m(...t){return p(...t)}const{cos:g,sin:y,PI:v}=Math;function b(t,e,r){const n=g(t),i=y(t),s={a:n,c:-i,e:0,b:i,d:n,f:0};return c(e)||c(r)?s:p([d(e,r),s,d(-e,-r)])}function x(t,e,r){return b(t*v/180,e,r)}function M(t,e,r,n){c(e)&&(e=t);const i={a:t,c:0,e:0,b:0,d:e,f:0};return c(r)||c(n)?i:p([d(r,n),i,d(-r,-n)])}function w(t,e){return{a:1,c:t,e:0,b:e,d:1,f:0}}const{tan:_}=Math;function S(t,e){return{a:1,c:_(t),e:0,b:_(e),d:1,f:0}}function A(t,e){return S(t*Math.PI/180,e*Math.PI/180)}function P(t){return O(t)}function E(t){return O(t)}function O(t){return`matrix(${t.a},${t.b},${t.c},${t.d},${t.e},${t.f})`}function I(t,e=1e10){return{a:Math.round(t.a*e)/e,b:Math.round(t.b*e)/e,c:Math.round(t.c*e)/e,d:Math.round(t.d*e)/e,e:Math.round(t.e*e)/e,f:Math.round(t.f*e)/e}}function R(t,e){const r=null!=t[0].x?t[0].x:t[0][0],n=null!=t[0].y?t[0].y:t[0][1],i=null!=e[0].x?e[0].x:e[0][0],s=null!=e[0].y?e[0].y:e[0][1],o=null!=t[1].x?t[1].x:t[1][0],a=null!=t[1].y?t[1].y:t[1][1],h=null!=e[1].x?e[1].x:e[1][0],c=null!=e[1].y?e[1].y:e[1][1],l=null!=t[2].x?t[2].x:t[2][0],f=null!=t[2].y?t[2].y:t[2][1],d=null!=e[2].x?e[2].x:e[2][0],m=null!=e[2].y?e[2].y:e[2][1];return I(p([{a:i-d,b:s-m,c:h-d,d:c-m,e:d,f:m},u({a:r-l,b:n-f,c:o-l,d:a-f,e:l,f})]))}function C(t){return Array.isArray(t)?t.map(e):e(t);function e(t){switch(t.type){case\"matrix\":if(\"a\"in t&&\"b\"in t&&\"c\"in t&&\"d\"in t&&\"e\"in t&&\"f\"in t)return s(t);throw new Error(\"MISSING_MANDATORY_PARAM\");case\"translate\":if(!(\"tx\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return\"ty\"in t?d(t.tx,t.ty):d(t.tx);case\"scale\":if(!(\"sx\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return\"sy\"in t?M(t.sx,t.sy):M(t.sx);case\"rotate\":if(!(\"angle\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return\"cx\"in t&&\"cy\"in t?x(t.angle,t.cx,t.cy):x(t.angle);case\"skewX\":if(!(\"angle\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return A(t.angle,0);case\"skewY\":if(!(\"angle\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return A(0,t.angle);case\"shear\":if(!(\"shx\"in t)||!(\"shy\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return w(t.shx,t.shy);default:throw new Error(\"UNSUPPORTED_DESCRIPTOR\")}}}function T(t,e,r,n){this.message=t,this.expected=e,this.found=r,this.location=n,this.name=\"SyntaxError\",\"function\"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,T)}function L(t,e){e=void 0!==e?e:{};var r,n={},i={transformList:G},s=G,o=\"matrix\",a=\"(\",h=\")\",u=\"translate\",c=\"scale\",l=\"rotate\",f=\"skewX\",d=\"skewY\",p=/^[eE]/,m=/^[+\\-]/,g=/^[0-9]/,y=/^[ \\t\\r\\n]/,v=F(\"matrix\",!1),b=F(\"(\",!1),x=F(\")\",!1),M=F(\"translate\",!1),w=F(\"scale\",!1),_=F(\"rotate\",!1),S=F(\"skewX\",!1),A=F(\"skewY\",!1),P=F(\",\",!1),E={type:\"other\",description:\"fractionalConstant\"},O=j([\"e\",\"E\"],!1,!1),I=j([\"+\",\"-\"],!1,!1),R=j([[\"0\",\"9\"]],!1,!1),C=j([\" \",\"\\t\",\"\\r\",\"\\n\"],!1,!1),L=0,k=[{line:1,column:1}],B=[],N=0;if(\"startRule\"in e){if(!(e.startRule in i))throw new Error(\"Can't start parsing from rule \\\"\"+e.startRule+'\".');s=i[e.startRule]}function F(t,e){return{type:\"literal\",text:t,ignoreCase:e}}function j(t,e,r){return{type:\"class\",parts:t,inverted:e,ignoreCase:r}}function q(e){var r,n=k[e];if(n)return n;for(r=e-1;!k[r];)r--;for(n={line:(n=k[r]).line,column:n.column};r0;function V(t,r){var n={};z&&(n.filename=e.filename);var i=q(t);n.start={offset:t,line:i.line,column:i.column};var s=q(r);return n.end={offset:r,line:s.line,column:s.column},n}function $(t){var e=B[B.length-1];Le.pos&&(e.pos=L,e.variants=[]),e.variants.push(t))}function G(){var t,e,r,i;for(L,t=[],e=rt();e!==n;)t.push(e),e=rt();for((e=X())===n&&(e=null),r=[],i=rt();i!==n;)r.push(i),i=rt();return e}function X(){var t,e,r,i,s;if(t=L,(e=U())!==n){if(r=[],(i=Q())!==n)for(;i!==n;)r.push(i),i=Q();else r=n;r!==n&&(i=X())!==n?(s=i,t=e.concat(s)):(L=t,t=n)}else L=t,t=n;return t===n&&(t=U()),t}function U(){var e;return(e=function(){var e,r,i,s,u,c,l,f,d,p,m,g,y,M=function(t){0===N&&$(t)};if(e=L,M(v),t.substr(L,6)===o?(r=o,L+=6):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(M(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(u=[],c=rt();c!==n;)u.push(c),c=rt();if((c=H())!==n)if(Q()!==n)if((l=H())!==n)if(Q()!==n)if((f=H())!==n)if(Q()!==n)if((d=H())!==n)if(Q()!==n)if((p=H())!==n)if(Q()!==n)if((m=H())!==n){for(g=[],y=rt();y!==n;)g.push(y),y=rt();M(x),41===t.charCodeAt(L)?(y=h,L++):y=n,y!==n?e=[{type:\"matrix\",a:c,b:l,c:f,d,e:p,f:m}]:(L=e,e=n)}else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,c,l,f,d,p,m,g=function(t){0===N&&$(t)};if(e=L,g(M),t.substr(L,9)===u?(r=u,L+=9):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(o=[],c=rt();c!==n;)o.push(c),c=rt();if((c=H())!==n){for((l=Z())===n&&(l=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(x),41===t.charCodeAt(L)?(d=h,L++):d=n,d!==n?(m={type:\"translate\",tx:c},(p=l)&&(m.ty=p),e=[m]):(L=e,e=n)}else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,l,f,d,p,m,g=function(t){0===N&&$(t)};if(e=L,g(w),t.substr(L,5)===c?(r=c,L+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=H())!==n){for((l=Z())===n&&(l=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(x),41===t.charCodeAt(L)?(d=h,L++):d=n,d!==n?(m={type:\"scale\",sx:u},(p=l)&&(m.sy=p),e=[m]):(L=e,e=n)}else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,c,f,d,p,m,g=function(t){0===N&&$(t)};if(e=L,g(_),t.substr(L,6)===l?(r=l,L+=6):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=H())!==n){for((c=function(){var t,e,r;return t=L,Q()!==n&&(e=H())!==n&&Q()!==n&&(r=H())!==n?t=[e,r]:(L=t,t=n),t}())===n&&(c=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(x),41===t.charCodeAt(L)?(d=h,L++):d=n,d!==n?(m={type:\"rotate\",angle:u},(p=c)&&(m.cx=p[0],m.cy=p[1]),e=[m]):(L=e,e=n)}else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,c,l,d=function(t){0===N&&$(t)};if(e=L,d(S),t.substr(L,5)===f?(r=f,L+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(d(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=H())!==n){for(c=[],l=rt();l!==n;)c.push(l),l=rt();d(x),41===t.charCodeAt(L)?(l=h,L++):l=n,l!==n?e=[{type:\"skewX\",angle:u}]:(L=e,e=n)}else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,c,l,f=function(t){0===N&&$(t)};if(e=L,f(A),t.substr(L,5)===d?(r=d,L+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(f(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=H())!==n){for(c=[],l=rt();l!==n;)c.push(l),l=rt();f(x),41===t.charCodeAt(L)?(l=h,L++):l=n,l!==n?e=[{type:\"skewY\",angle:u}]:(L=e,e=n)}else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}()),e}function H(){var e,r,i,s;return e=L,r=L,(i=K())===n&&(i=null),(s=function(){var e,r,i;return e=L,(r=function(){var e,r,i,s,o,a,h;return o=E,0===N&&$(o),N++,e=L,(r=tt())===n&&(r=null),46===t.charCodeAt(L)?(i=\".\",L++):i=n,i!==n&&(s=tt())!==n?(h=s,e=[(a=r)?a.join(\"\"):null,\".\",h.join(\"\")].join(\"\")):(L=e,e=n),e===n&&(e=L,(r=tt())!==n?(46===t.charCodeAt(L)?(i=\".\",L++):i=n,i!==n?e=r.join(\"\"):(L=e,e=n)):(L=e,e=n)),N--,e}())!==n?((i=J())===n&&(i=null),e=[r,i||null].join(\"\")):(L=e,e=n),e===n&&(e=L,(r=tt())!==n&&(i=J())!==n?e=[r,i].join(\"\"):(L=e,e=n)),e}())!==n?r=i=[i,s]:(L=r,r=n),r!==n&&(r=parseFloat(r.join(\"\"))),(e=r)===n&&(e=L,r=L,(i=K())===n&&(i=null),(s=function(){var t;return L,(t=tt())!==n&&(t=t.join(\"\")),t}())!==n?r=i=[i,s]:(L=r,r=n),r!==n&&(r=parseInt(r.join(\"\"))),e=r),e}function Z(){var t,e;return t=L,Q()!==n&&(e=H())!==n?t=e:(L=t,t=n),t}function Q(){var t,e,r,i,s;if(t=L,e=[],(r=rt())!==n)for(;r!==n;)e.push(r),r=rt();else e=n;if(e!==n){for((r=W())===n&&(r=null),i=[],s=rt();s!==n;)i.push(s),s=rt();t=e=[e,r,i]}else L=t,t=n;if(t===n)if(t=L,(e=W())!==n){for(r=[],i=rt();i!==n;)r.push(i),i=rt();t=e=[e,r]}else L=t,t=n;return t}function W(){var e,r;return r=P,0===N&&$(r),44===t.charCodeAt(L)?(e=\",\",L++):e=n,e}function J(){var e,r,i,s,o;return e=L,o=O,0===N&&$(o),p.test(t.charAt(L))?(r=t.charAt(L),L++):r=n,r!==n?((i=K())===n&&(i=null),(s=tt())!==n?e=[\"e\",i,s.join(\"\")].join(\"\"):(L=e,e=n)):(L=e,e=n),e}function K(){var e,r;return r=I,0===N&&$(r),m.test(t.charAt(L))?(e=t.charAt(L),L++):e=n,e}function tt(){var t,e;if(t=[],(e=et())!==n)for(;e!==n;)t.push(e),e=et();else t=n;return t}function et(){var e,r;return r=R,0===N&&$(r),g.test(t.charAt(L))?(e=t.charAt(L),L++):e=n,e}function rt(){var e,r;return r=C,0===N&&$(r),y.test(t.charAt(L))?(e=t.charAt(L),L++):e=n,e}if(B.push({pos:L,variants:[]}),(r=s())!==n&&L===t.length)return r;throw r!==n&&L0){for(e=1,r=1;e{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r(625)})()}));","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Urpflanze = void 0;\nconst Urpflanze = require(\"./modules\");\nexports.Urpflanze = Urpflanze;\nexports.default = Urpflanze;\n//# sourceMappingURL=index.js.map"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://Urpflanze/webpack/universalModuleDefinition","webpack://Urpflanze/./dist/cjs/index.js","webpack://Urpflanze/./dist/cjs/modules.js","webpack://Urpflanze/./dist/cjs/modules-light.js","webpack://Urpflanze/./dist/cjs/core.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/Scene.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/SceneChild.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/Group.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeBase.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/index.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/common.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/mat2.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/mat2d.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/mat3.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/mat4.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/quat.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/vec4.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/vec3.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/quat2.js","webpack://Urpflanze/./node_modules/gl-matrix/esm/vec2.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/index.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/indexedBuffer.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/propArguments.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/repetitions.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/scene-child.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/scene.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/shape-base.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/shape-primitives.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/types/shapes.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/math/gl-matrix-extensions.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/math/Vec2.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/math/index.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Adapt.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Modifier.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/Utilities.js","webpack://Urpflanze/./node_modules/simplex-noise/simplex-noise.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/Shape.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapePrimitive.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeLoop.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeBuffer.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeRecursive.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/ShapeFollow.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Line.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Triangle.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Rect.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Polygon.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Circle.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Star.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Rose.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Spiral.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/Lissajous.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/shapes/primitives/SuperShape.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/index.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Mirror.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Smooth.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Close.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Solidify.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Subdivide.js","webpack://Urpflanze/./node_modules/@urpflanze/core/dist/cjs/modifiers/Offset.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/index.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/types.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/utilities.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/createAnimation.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/createInterpolator.js","webpack://Urpflanze/./node_modules/@urpflanze/color/dist/cjs/index.js","webpack://Urpflanze/./node_modules/@urpflanze/color/dist/cjs/types.js","webpack://Urpflanze/./node_modules/@urpflanze/color/dist/cjs/conversions.js","webpack://Urpflanze/./node_modules/@urpflanze/color/dist/cjs/parsing.js","webpack://Urpflanze/./node_modules/@urpflanze/color/dist/cjs/htmlcolors.js","webpack://Urpflanze/./node_modules/bezier-easing/src/index.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/Easings.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/Animation.js","webpack://Urpflanze/./node_modules/@urpflanze/animation/dist/cjs/composeAnimations.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/browser/BrowserDrawerCanvas.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/DrawerCanvas.js","webpack://Urpflanze/./node_modules/canvas/browser.js","webpack://Urpflanze/./node_modules/canvas/lib/parse-font.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/Emitter.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/Timeline.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/utils.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/index.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/Renderer.js","webpack://Urpflanze/./node_modules/@ffmpeg/ffmpeg/src/index.js","webpack://Urpflanze/./node_modules/regenerator-runtime/runtime.js","webpack://Urpflanze/./node_modules/@ffmpeg/ffmpeg/src/createFFmpeg.js","webpack://Urpflanze/./node_modules/@ffmpeg/ffmpeg/src/config.js","webpack://Urpflanze/./node_modules/@ffmpeg/ffmpeg/src/utils/log.js","webpack://Urpflanze/./node_modules/@ffmpeg/ffmpeg/src/utils/parseProgress.js","webpack://Urpflanze/./node_modules/@ffmpeg/ffmpeg/src/utils/parseArgs.js","webpack://Urpflanze/./node_modules/@ffmpeg/ffmpeg/src/browser/index.js","webpack://Urpflanze/./node_modules/@ffmpeg/ffmpeg/src/browser/defaultOptions.js","webpack://Urpflanze/./node_modules/resolve-url/resolve-url.js","webpack://Urpflanze/./node_modules/@ffmpeg/ffmpeg/src/browser/getCreateFFmpegCore.js","webpack://Urpflanze/./node_modules/@ffmpeg/ffmpeg/src/browser/fetchFile.js","webpack://Urpflanze/./node_modules/jszip/dist/jszip.min.js","webpack://Urpflanze/./node_modules/@urpflanze/drawer-canvas/dist/cjs/browser/index.js","webpack://Urpflanze/./node_modules/@urpflanze/gcode-exporter/dist/cjs/index.js","webpack://Urpflanze/./node_modules/@urpflanze/gcode-exporter/dist/cjs/types.js","webpack://Urpflanze/./node_modules/@urpflanze/gcode-exporter/dist/cjs/GCODEExporter.js","webpack://Urpflanze/./node_modules/@urpflanze/core/build/umd/urpflanze.min.js","webpack://Urpflanze/./node_modules/simplify-js/simplify.js","webpack://Urpflanze/./node_modules/@urpflanze/gcode-exporter/dist/cjs/utilities.js","webpack://Urpflanze/./node_modules/@urpflanze/svg-exporter/dist/cjs/index.js","webpack://Urpflanze/./node_modules/@urpflanze/svg-exporter/dist/cjs/types.js","webpack://Urpflanze/./node_modules/@urpflanze/svg-exporter/dist/cjs/SVGExporter.js","webpack://Urpflanze/./node_modules/@urpflanze/svg-exporter/node_modules/@urpflanze/color/dist/index.js","webpack://Urpflanze/./node_modules/@urpflanze/svg-exporter/node_modules/@urpflanze/color/dist/types.js","webpack://Urpflanze/./node_modules/@urpflanze/svg-exporter/node_modules/@urpflanze/color/dist/conversions.js","webpack://Urpflanze/./node_modules/@urpflanze/svg-exporter/node_modules/@urpflanze/color/dist/parsing.js","webpack://Urpflanze/./node_modules/@urpflanze/svg-importer/build/umd/urpflanze-svg-importer.min.js","webpack://Urpflanze/webpack/bootstrap","webpack://Urpflanze/webpack/runtime/define property getters","webpack://Urpflanze/webpack/runtime/global","webpack://Urpflanze/webpack/runtime/hasOwnProperty shorthand","webpack://Urpflanze/webpack/runtime/make namespace object","webpack://Urpflanze/webpack/startup"],"names":[],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;ACVa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,CAAW;AAChC,iC;;;;;;;ACba;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB,GAAG,mBAAmB,GAAG,qBAAqB,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,aAAa;AACvH,aAAa,mBAAO,CAAC,CAAiB;AACtC,uCAAoD;AACpD,YAAY,mBAAO,CAAC,EAAmC;AACvD,4CAA2C,CAAC,qCAAqC,uBAAuB,EAAE,EAAE,EAAC;AAC7G,4CAA2C,CAAC,qCAAqC,uBAAuB,EAAE,EAAE,EAAC;AAC7G,YAAY,mBAAO,CAAC,EAAoC;AACxD,iDAAgD,CAAC,qCAAqC,4BAA4B,EAAE,EAAE,EAAC;AACvH,YAAY,mBAAO,CAAC,GAAkC;AACtD,+CAA8C,CAAC,qCAAqC,0BAA0B,EAAE,EAAE,EAAC;AACnH,qBAAqB,mBAAO,CAAC,GAAyB;AACtD,+CAA8C,CAAC,qCAAqC,mCAAmC,EAAE,EAAE,EAAC;AAC5H,mC;;;;;;;ACxBa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,oBAAoB,GAAG,iBAAiB;AACxC,aAAa,mBAAO,CAAC,CAAQ;AAC7B,2CAA4D;AAC5D,4BAA4B,mBAAO,CAAC,EAA+D;AACnG,gDAA+C,CAAC,qCAAqC,kDAAkD,EAAE,EAAE,EAAC;AAC5I,yC;;;;;;;ACjBa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,YAAY,GAAG,gCAAgC,GAAG,qCAAqC,GAAG,mBAAmB,GAAG,8BAA8B,GAAG,4BAA4B,GAAG,2BAA2B,GAAG,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,qBAAqB,GAAG,aAAa,GAAG,YAAY;AACjZ,aAAa,mBAAO,CAAC,CAAgC;AACrD,aAAa,mBAAO,CAAC,CAAqC;AAC1D,aAAa,mBAAO,CAAC,CAAgC;AACrD,aAAa,mBAAO,CAAC,CAA2C;AAChE,aAAa,mBAAO,CAAC,EAAgD;AACrE,aAAa,mBAAO,CAAC,EAA2C;AAChE,aAAa,mBAAO,CAAC,EAA6C;AAClE,aAAa,mBAAO,CAAC,EAAuC;AAC5D,aAAa,mBAAO,CAAC,EAAgD;AACrE,aAAa,mBAAO,CAAC,EAA6C;AAClE,aAAa,mBAAO,CAAC,EAAiD;AACtE,aAAa,mBAAO,CAAC,EAAqD;AAC1E,aAAa,mBAAO,CAAC,EAAiD;AACtE,aAAa,mBAAO,CAAC,EAAoD;AACzE,aAAa,mBAAO,CAAC,EAAmD;AACxE,aAAa,mBAAO,CAAC,EAAiD;AACtE,aAAa,mBAAO,CAAC,EAAiD;AACtE,aAAa,mBAAO,CAAC,EAAmD;AACxE,aAAa,mBAAO,CAAC,EAAsD;AAC3E,aAAa,mBAAO,CAAC,EAAuD;AAC5E,aAAa,mBAAO,CAAC,EAA6C;AAClE,aAAa,mBAAO,CAAC,EAAoC;AACzD,kBAAkB,mBAAO,CAAC,EAAoC;AAC9D,wCAAuC,CAAC,qCAAqC,yBAAyB,EAAE,EAAE,EAAC;AAC3G,yCAAwC,CAAC,qCAAqC,0BAA0B,EAAE,EAAE,EAAC;AAC7G,iDAAgD,CAAC,qCAAqC,kCAAkC,EAAE,EAAE,EAAC;AAC7H,6CAA4C,CAAC,qCAAqC,8BAA8B,EAAE,EAAE,EAAC;AACrH,6CAA4C,CAAC,qCAAqC,8BAA8B,EAAE,EAAE,EAAC;AACrH,uCAAsC,CAAC,qCAAqC,wBAAwB,EAAE,EAAE,EAAC;AACzG,yCAAwC,CAAC,qCAAqC,0BAA0B,EAAE,EAAE,EAAC;AAC7G,0CAAyC,CAAC,qCAAqC,2BAA2B,EAAE,EAAE,EAAC;AAC/G,uDAAsD,CAAC,qCAAqC,wCAAwC,EAAE,EAAE,EAAC;AACzI,wDAAuD,CAAC,qCAAqC,yCAAyC,EAAE,EAAE,EAAC;AAC3I,0DAAyD,CAAC,qCAAqC,2CAA2C,EAAE,EAAE,EAAC;AAC/I,+CAA8C,CAAC,qCAAqC,gCAAgC,EAAE,EAAE,EAAC;AACzH,iEAAgE,CAAC,qCAAqC,kDAAkD,EAAE,EAAE,EAAC;AAC7J,4DAA2D,CAAC,qCAAqC,6CAA6C,EAAE,EAAE,EAAC;AACnJ,aAAa,mBAAO,CAAC,EAAoC;AACzD,wCAAuC,CAAC,qCAAqC,uBAAuB,EAAE,EAAE,EAAC;AACzG,aAAa,mBAAO,CAAC,EAA+B;AACpD,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,uCAAsC,CAAC,qCAAqC,mBAAmB,EAAE,EAAE,EAAC;AACpG,gC;;;;;;;ACzDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,qBAAqB,mBAAO,CAAC,CAAc;AAC3C,gBAAgB,mBAAO,CAAC,CAAS;AACjC,gBAAgB,mBAAO,CAAC,EAAgB;AACxC,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB;AACpC,eAAe,WAAW;AAC1B,eAAe,4BAA4B;AAC3C,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,qBAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACxVa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,eAAe,cAAc;AAC7B,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0EAA0E;AACzF,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sC;;;;;;;AClGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,gBAAgB,mBAAO,CAAC,CAAS;AACjC,qBAAqB,mBAAO,CAAC,CAAc;AAC3C,oBAAoB,mBAAO,CAAC,CAAoB;AAChD,gBAAgB,mBAAO,CAAC,EAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,SAAS;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACxTa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,oBAAoB,mBAAO,CAAC,CAAW;AACvC,gBAAgB,mBAAO,CAAC,EAAU;AAClC,aAAa,mBAAO,CAAC,EAA8B;AACnD,eAAe,mBAAO,CAAC,EAAc;AACrC,eAAe,mBAAO,CAAC,EAAS;AAChC,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,oBAAoB,mBAAO,CAAC,EAAc;AAC1C,qBAAqB,mBAAO,CAAC,CAAe;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,cAAc;AAC7B,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0EAA0E;AACzF,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,2CAA2C;AACrF,8CAA8C,2CAA2C;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,4BAA4B;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,SAAS;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;AACA,mEAAmE,SAAS;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,gCAAgC;AAClD,kBAAkB,gCAAgC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzgBwC;AACN;AACE;AACF;AACA;AACA;AACE;AACF;AACA;AACA;;;;;;;;;;;;;;;;;ACTlC;AACA;AACA;AACA;AACA;AACO;AACA;AACA;AACP;AACA;AACA;AACA,WAAW,2CAA2C;AACtD;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjDwC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA,gBAAgB;;AAEhB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AAC7S;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC/aiC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACvd;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACreiC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACttB;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzwBiC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY,+CAAgB;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA,YAAY,+CAAgB;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP,wBAAwB,kDAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;;AAExD;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,YAAY,KAAK;AACjB;;AAEO;AACP,oBAAoB,kDAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB;AACA,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,+CAAgB,+BAA+B,+CAAgB,+BAA+B,+CAAgB;AAC/I;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,uEAAuE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB,yEAAyE,+CAAgB;AAC/zC;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO,mB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrxDiC;AACN;AACA;AACA;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,aAAa;AACzB,YAAY,OAAO;AACnB;;AAEO;AACP;AACA;;AAEA,UAAU,+CAAgB;AAC1B;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,aAAa;AACzB,YAAY,aAAa;AACzB,YAAY,OAAO;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;;AAE1C,gDAAgD;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;;AAGH,oBAAoB,+CAAgB;AACpC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA,WAAW,8CAAe;AAC1B,WAAW,8CAAe;AAC1B,WAAW,8CAAe;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,mCAAmC;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAoC;;AAEpC;AACA,wBAAwB;;AAExB;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,EAAE;AACb,WAAW,EAAE;AACb,WAAW,EAAE;AACb,aAAa,KAAK;AAClB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,YAAY,2CAAU;AAC7B;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,iBAAiB,gDAAe;AACvC;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,WAAW,0CAAS;AAC3B;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,YAAY,2CAAU;AAC7B;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;;AAEO,WAAW,0CAAS;AAC3B;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO,aAAa,4CAAW;AAC/B;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;AACA;;AAEO,oBAAoB,mDAAkB;AAC7C;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;AACA;;AAEO,gBAAgB,+CAAc;AACrC;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO,kBAAkB,iDAAgB;AACzC;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO,aAAa,4CAAW;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,4CAAW;AAC3B,kBAAkB,gDAAe;AACjC,kBAAkB,gDAAe;AACjC;AACA,cAAc,yCAAQ;;AAEtB;AACA,MAAM,2CAAU;AAChB,UAAU,yCAAQ,sBAAsB,2CAAU;AAClD,MAAM,+CAAc;AACpB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,MAAM,2CAAU;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,aAAa,4CAAW;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrsBuC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,uBAAuB;AACvB;AACA;;AAEA;AACA;;AAEA;AACA,SAAS,8CAAe;AACxB,SAAS,8CAAe;AACxB;AACA,GAAG;;AAEH;AACA,SAAS,8CAAe;AACxB,SAAS,8CAAe;AACxB;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;;AAEhB;AACA;AACA;AACA,qCAAqC;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AAC7S;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtpBuC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,UAAU,8CAAe;AACzB,UAAU,8CAAe;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;;AAEA;AACA;AACA,4BAA4B;;AAE5B;AACA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA,YAAY;;AAEZ;AACA;AACA,YAAY;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,aAAa;;AAEb;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACxN;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClxBuC;AACN;AACA;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;;AAEO;AACP,eAAe,kDAAmB;;AAElC,MAAM,kDAAmB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP,eAAe,kDAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA,cAAc,4CAAW;AACzB,EAAE,iDAAgB;AAClB,cAAc,kDAAmB;AACjC,EAAE,oDAAmB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO,cAAc,0CAAS;AAC9B;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO,cAAc,0CAAS;AAC9B;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,cAAc;AAC1B,YAAY,KAAK;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,6CAAY;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,aAAa;AACxB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA,sBAAsB,+CAAgB;AACtC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,UAAU,yCAAQ;AACzB;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,aAAa,4CAAW;AAC/B;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;AACA;;AAEO,oBAAoB,mDAAkB;AAC7C;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,cAAc;AACzB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB,qEAAqE,+CAAgB;AACjoB,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACl0BwC;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;;AAEnC,MAAM,kDAAmB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP,gBAAgB,kDAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA,UAAU,8CAAe;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA,2BAA2B;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;;AAE5C;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,OAAO;AACpB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,aAAa;AACxB,aAAa,QAAQ;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA,8BAA8B,+CAAgB,qEAAqE,+CAAgB;AACnI;AACA;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA,cAAc;AACd;AACA;;AAEO;AACP;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,G;;;;;;;AC/mBY;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAiB;AACtC,aAAa,mBAAO,CAAC,EAAiB;AACtC,aAAa,mBAAO,CAAC,EAAe;AACpC,aAAa,mBAAO,CAAC,EAAe;AACpC,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAc;AACnC,aAAa,mBAAO,CAAC,EAAoB;AACzC,aAAa,mBAAO,CAAC,EAAU;AAC/B,iC;;;;;;;ACpBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD,uBAAuB,KAAK;AAC7E,uC;;;;;;;ACxBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C,qBAAqB,KAAK;AACvE,sC;;;;;;;AChBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA,4C;;;;;;;ACHa;AACb;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kC;;;;;;;ACHa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc,GAAG,cAAc,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,iBAAiB;AAChI,oBAAoB,mBAAO,CAAC,CAAW;AACvC,iBAAiB;AACjB,gBAAgB;AAChB,iBAAiB;AACjB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,gD;;;;;;;AC5Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,cAAc;AAC7B,gBAAgB;AAChB;AACA,6BAA6B,OAAO,OAAO,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,gC;;;;;;;ACpNa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,iC;;;;;;;AClCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,GAAG,gBAAgB,GAAG,kBAAkB;AACrD,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC,kBAAkB,KAAK;AAC9D;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6BAA6B;AAC5C,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,iC;;;;;;;ACrKa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB;AACA;AACA,gBAAgB;AAChB,oC;;;;;;;ACNa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gCAAgC,GAAG,mBAAmB,GAAG,qCAAqC,GAAG,8BAA8B,GAAG,4BAA4B,GAAG,2BAA2B,GAAG,cAAc,GAAG,aAAa,GAAG,qBAAqB,GAAG,aAAa,GAAG,YAAY,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,WAAW;AAC1U,qBAAqB,mBAAO,CAAC,EAAe;AAC5C,sBAAsB,mBAAO,CAAC,EAAqB;AACnD,eAAe,mBAAO,CAAC,EAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,mBAAmB,iBAAiB;AACpC,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,gBAAgB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,iBAAiB;AAC5B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA,4BAA4B,qBAAqB;AACjD;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,eAAe;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yBAAyB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC,qC;;;;;;ACxWA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA,qBAAqB;AACrB;AACA,wBAAwB;AACxB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,4BAA4B;AAC5B;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,kCAAkC;AAClC;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA,6BAA6B;AAC7B;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA,mCAAmC;AACnC,qBAAqB;AACrB;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,yBAAyB;AACzB,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,iBAAiB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,gDAAgD;AAChD;AACA;;AAEA;AACA,MAAM,IAA2C,EAAE,mCAAO,YAAY,qBAAqB;AAAA,kGAAC;AAC5F;AACA,MAAM,IAA8B,EAAE,oBAAoB;AAC1D;AACA,OAAO,EAAsE;AAC7E;AACA,MAAM,IAA6B;AACnC;AACA;;AAEA,CAAC;;;;;;;;ACxdY;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,gBAAgB,mBAAO,CAAC,CAAU;AAClC,qBAAqB,mBAAO,CAAC,CAAe;AAC5C,oBAAoB,mBAAO,CAAC,CAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc,aAAa;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA,4DAA4D,SAAS;AACrE,wCAAwC;AACxC;AACA;AACA;AACA,yCAAyC,4BAA4B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,aAAa;AAC5B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;ACnLa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,sBAAsB;AACtB,aAAa,mBAAO,CAAC,EAA8B;AACnD,oBAAoB,mBAAO,CAAC,CAAa;AACzC,mBAAmB,mBAAO,CAAC,EAAuB;AAClD,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB,aAAa;AACpD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,0C;;;;;;;ACjJa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,eAAe,mBAAO,CAAC,EAAS;AAChC,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,yBAAyB,mBAAO,CAAC,EAA0B;AAC3D,oBAAoB,mBAAO,CAAC,CAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB,aAAa;AAC/C,eAAe,QAAQ;AACvB;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB;AACA;AACA;AACA,iDAAiD,eAAe;AAChE,sDAAsD,QAAQ;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA,eAAe,6BAA6B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,kBAAkB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,eAAe,sBAAsB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,8CAA8C;AAC9E;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,qC;;;;;;;AChOa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB;AACnB,gBAAgB,mBAAO,CAAC,EAAoB;AAC5C,yBAAyB,mBAAO,CAAC,EAA0B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB,aAAa;AACjD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,gCAAgC,8CAA8C;AAC9E;AACA;AACA;AACA;AACA,mBAAmB;AACnB,uC;;;;;;;ACnIa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,sBAAsB;AACtB,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB,aAAa;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,qDAAqD;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,6BAA6B;AACpD;AACA;AACA;AACA;AACA,sCAAsC,+BAA+B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iIAAiI,6DAA6D;AAC9L;AACA;AACA;AACA;AACA,4BAA4B,uEAAuE;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,SAAS;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,4BAA4B,8DAA8D;AAC1F,iBAAiB;AACjB;AACA;AACA,mFAAmF,gCAAgC;AACnH,wCAAwC;AACxC;AACA;AACA;AACA;AACA,4BAA4B,8DAA8D;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,oEAAoE,4BAA4B,iBAAiB,EAAE;AACnH;AACA;AACA;AACA,+BAA+B,gBAAgB;AAC/C;AACA,2DAA2D,SAAS;AACpE;AACA,+FAA+F,gCAAgC;AAC/H,oDAAoD;AACpD;AACA;AACA;AACA;AACA,wCAAwC,wDAAwD;AAChG;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;AACA,qDAAqD,4BAA4B;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA,sBAAsB;AACtB,0C;;;;;;;AChUa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB;AACnB,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB,aAAa;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,uDAAuD;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,SAAS;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,mFAAmF,gCAAgC;AACnH,uEAAuE,iCAAiC,4BAA4B,iBAAiB,EAAE;AACvJ,kDAAkD,SAAS;AAC3D;AACA,2FAA2F,gCAAgC;AAC3H,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA,iDAAiD,4BAA4B;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gCAAgC;AACpD;AACA;AACA;AACA,mBAAmB;AACnB,uC;;;;;;;AC3Na;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,YAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,SAAS;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,gC;;;;;;;AC5Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA,oC;;;;;;;AC1Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,gBAAgB,mBAAO,CAAC,EAAuB;AAC/C,sBAAsB,mBAAO,CAAC,EAAgB;AAC9C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,gC;;;;;;;AC3Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,mC;;;;;;;ACxCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB,aAAa;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACpCa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ,gC;;;;;;;AClDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,YAAY;AACZ,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc,aAAa;AAC1C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ,gC;;;;;;;ACtEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe,aAAa;AAC3C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kC;;;;;;;AC5Fa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAwB;AACpD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB,aAAa;AAC/C;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,qC;;;;;;;ACtDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB;AAClB,eAAe,mBAAO,CAAC,EAAY;AACnC,oBAAoB,mBAAO,CAAC,EAAc;AAC1C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,aAAa;AAChD;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sC;;;;;;;AC9Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,gBAAgB,mBAAO,CAAC,EAAS;AACjC,iBAAiB,mBAAO,CAAC,EAAU;AACnC,iBAAiB,mBAAO,CAAC,EAAU;AACnC,mBAAmB,mBAAO,CAAC,EAAY;AACvC,oBAAoB,mBAAO,CAAC,EAAa;AACzC,gBAAgB,mBAAO,CAAC,EAAS;AACjC,iBAAiB,mBAAO,CAAC,EAAU;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,iC;;;;;;;ACpBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACtDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,oBAAoB,mBAAO,CAAC,EAAc;AAC1C,gBAAgB,mBAAO,CAAC,EAAS;AACjC,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,SAAS;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACvEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa;AACb,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iC;;;;;;;AC3Ba;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,oC;;;;;;;ACvHa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iBAAiB;AACjB,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,WAAW;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,qC;;;;;;;ACxDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc;AACd,mBAAmB,mBAAO,CAAC,EAAY;AACvC;AACA,wBAAwB,yBAAyB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kC;;;;;;;ACfa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAa;AAClC,aAAa,mBAAO,CAAC,EAAmB;AACxC,aAAa,mBAAO,CAAC,EAAsB;AAC3C,aAAa,mBAAO,CAAC,EAAW;AAChC,aAAa,mBAAO,CAAC,EAAa;AAClC,iC;;;;;;;AClBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,2BAA2B,GAAG,2BAA2B,GAAG,YAAY,GAAG,YAAY,GAAG,mBAAmB,GAAG,aAAa;AAC7H;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,mBAAmB;AAC9B,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,EAAE,GAAG,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,mBAAmB;AAC9B,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,mBAAmB,cAAc,GAAG,cAAc,GAAG,cAAc,GAAG,MAAM;AAC5E;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA,mBAAmB,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,MAAM;AAC1C;AACA,2BAA2B;AAC3B,qC;;;;;;;AC9Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,uBAAuB;AACvB,6BAA6B,mBAAO,CAAC,EAAsB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8DAA8D;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2C;;;;;;;ACpGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,0BAA0B,GAAG,mCAAmC;AAChE,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,wBAAwB,mBAAO,CAAC,EAAe;AAC/C,kBAAkB,mBAAO,CAAC,EAAW;AACrC,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,8C;;;;;;;ACxGa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAS;AAC9B,aAAa,mBAAO,CAAC,EAAe;AACpC,aAAa,mBAAO,CAAC,EAAW;AAChC,iC;;;;;;;ACfa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6DAA6D;AAC5E;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,uC;;;;;;;ACzFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB,GAAG,4BAA4B;AACjD,qBAAqB,mBAAO,CAAC,EAAc;AAC3C,sBAAsB,mBAAO,CAAC,EAAe;AAC7C;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,6BAA6B,IAAI;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,mC;;;;;;;AC1Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,sC;;;;;;AClJA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,uBAAuB,oCAAoC;AAC3D,uBAAuB,8BAA8B;AACrD,uBAAuB,kBAAkB;;AAEzC;AACA,oCAAoC,8DAA8D;;AAElG;AACA,kCAAkC,sEAAsE;;AAExG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;;AAEA;AACA;AACA;AACA;;AAEA,UAAU,mEAAmE;AAC7E;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1Ga;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe;AACf,mC;;;;;;;AChca;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,wBAAwB,GAAG,cAAc,GAAG,YAAY,GAAG,eAAe,GAAG,cAAc,GAAG,8BAA8B;AAC5H,4BAA4B,mBAAO,CAAC,EAAqB;AACzD,0BAA0B,mBAAO,CAAC,EAAmB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB,qC;;;;;;;ACpEa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,yBAAyB;AACzB,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,0BAA0B,mBAAO,CAAC,EAAmB;AACrD,oBAAoB,mBAAO,CAAC,EAAa;AACzC;AACA;AACA;AACA;AACA,WAAW,wBAAwB;AACnC,YAAY,EAAE,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6C;;;;;;;ACxDa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,2BAA2B;AAC3B,uBAAuB,mBAAO,CAAC,EAAiB;AAChD,gBAAgB,mBAAO,CAAC,EAAU;AAClC;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,+C;;;;;;;AChGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,oBAAoB;AACpB,gBAAgB,mBAAO,CAAC,EAAkB;AAC1C,oBAAoB,mBAAO,CAAC,EAAoC;AAChE,eAAe,mBAAO,CAAC,EAA+B;AACtD,eAAe,mBAAO,CAAC,EAAoC;AAC3D,iBAAiB,mBAAO,CAAC,EAAQ;AACjC,kBAAkB,mBAAO,CAAC,EAAW;AACrC,mBAAmB,mBAAO,CAAC,EAAY;AACvC,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6BAA6B;AAC5C,eAAe,wBAAwB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,2BAA2B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,0BAA0B;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qGAAqG,uCAAuC;AAC5I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,KAAK;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oGAAoG,OAAO;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,eAAe,QAAQ;AACvB,eAAe,qBAAqB;AACpC,eAAe,EAAE;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB,eAAe,OAAO;AACtB,gBAAgB,EAAE,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW;AAC7E,8BAA8B,SAAS,GAAG,SAAS,IAAI,SAAS,IAAI,WAAW;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,wC;;;;;;ACvXA;;AAEA,kBAAkB,mBAAO,CAAC,EAAkB;;AAE5C,iBAAiB;;AAEjB,oBAAoB;AACpB,0DAA0D,+BAA+B;AACzF;;AAEA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA;AACA;;AAEA,gCAAgC,WAAW;AAC3C,iCAAiC,WAAW;;AAE5C;AACA,GAAG;AACH;;;;;;;;AClCY;;AAEZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACrGa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,6CAA6C;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,8CAA8C;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,6BAA6B;AAC5C;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,mC;;;;;;;AC3Da;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,oBAAoB,mBAAO,CAAC,EAAoC;AAChE,eAAe,mBAAO,CAAC,EAA+B;AACtD,kBAAkB,mBAAO,CAAC,EAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,2BAA2B,aAAa;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oC;;;;;;;ACxRa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,WAAW,GAAG,eAAe,GAAG,gBAAgB,GAAG,aAAa;AAChE,aAAa;AACb;AACA;AACA,gBAAgB;AAChB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,+BAA+B;AAC1C,YAAY,EAAE,IAAI,WAAW,WAAW,eAAe,gBAAgB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,iC;;;;;;;AClDa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAY;AACjC,aAAa,mBAAO,CAAC,EAAgB;AACrC,aAAa,mBAAO,CAAC,EAA+B;AACpD,aAAa,mBAAO,CAAC,EAAY;AACjC,iC;;;;;;;AChBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB;AAChB,iBAAiB,mBAAO,CAAC,EAAgB;AACzC,oBAAoB,mBAAO,CAAC,EAAoC;AAChE,cAAc,mBAAO,CAAC,EAAO;AAC7B,kBAAkB,mBAAO,CAAC,EAAW;AACrC,kBAAkB,mBAAO,CAAC,EAAW;AACrC,gBAAgB,mBAAO,CAAC,EAAS;AACjC;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,sCAAsC;AACnF;AACA;AACA;AACA,yCAAyC,gBAAgB;AACzD,oCAAoC,6BAA6B;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,mDAAmD,qBAAqB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,yCAAyC;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,yCAAyC;AACxF,2BAA2B,qBAAqB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,mFAAmF;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,gBAAgB;AAChB,oC;;;;;;ACnRA,mBAAO,CAAC,EAA6B;AACrC,qBAAqB,mBAAO,CAAC,EAAgB;AAC7C,OAAO,YAAY,GAAG,mBAAO,CAAC,EAAQ;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,wBAAwB;AACxB;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,KAAK;AACL,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;;AAEA;AACA;AACA,wCAAwC,WAAW;AACnD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA,2BAA2B;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,SAAS;AACT;AACA;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC,cAAc;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,kBAAkB;AACnD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA,iBAAiB;;AAEjB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,8CAA8C,QAAQ;AACtD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA,WAAW;AACX;AACA;AACA;;AAEA,WAAW;AACX;AACA;AACA;;AAEA,WAAW;AACX;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,8CAA8C,QAAQ;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA,KAAK;;AAEL;AACA,8CAA8C,QAAQ;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,8CAA8C,QAAQ;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,CAAC;AACD;AACA;AACA;AACA;AACA,EAAE,KAA0B,oBAAoB,CAAE;AAClD;;AAEA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;;;;;;ACjvBA,OAAO,2BAA2B,GAAG,mBAAO,CAAC,EAAU;AACvD,OAAO,mCAAmC,GAAG,mBAAO,CAAC,EAAa;AAClE,sBAAsB,mBAAO,CAAC,EAAuB;AACrD,kBAAkB,mBAAO,CAAC,EAAmB;AAC7C,OAAO,sCAAsC,GAAG,mBAAO,CAAC,EAAQ;AAChE,OAAO,UAAU,GAAG,mBAAO,CAAC,EAAiB;;AAE7C;;AAEA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,gBAAgB;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,yBAAyB;AACtE,0CAA0C,yBAAyB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,gBAAgB;AACvD;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,OAAO,GAAG,uDAAuD,WAAW,iCAAiC;AACvI;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA,+CAA+C,QAAQ;AACvD,SAAS;AACT,gDAAgD,QAAQ;AACxD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,kCAAkC,QAAQ;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AClNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,gBAAgB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;ACjDA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,gBAAgB,gBAAgB;AAChC;AACA,oBAAoB,KAAK,IAAI,QAAQ;AACrC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACvBA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB,qBAAqB;AACrC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,gBAAgB,iBAAiB;AACjC,KAAK;AACL,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;;;;;ACRA,uBAAuB,mBAAO,CAAC,EAAkB;AACjD,4BAA4B,mBAAO,CAAC,EAAuB;AAC3D,kBAAkB,mBAAO,CAAC,EAAa;;AAEvC;AACA;AACA;AACA;AACA;;;;;;;ACRA,mBAAmB,mBAAO,CAAC,EAAa;AACxC,OAAO,kBAAkB,GAAG,mBAAO,CAAC,EAAoB;;AAExD;AACA;AACA;AACA;AACA,YAAY,KAAsC;AAClD;AACA,MAAM,CAAoG;AAC1G;;;;;;;ACVA;AACA;;AAEA;AACA,MAAM,IAA0C;AAChD,IAAI,oCAAO,OAAO;AAAA;AAAA;AAAA;AAAA,kGAAC;AACnB,GAAG,MAAM,EAIN;AACH,CAAC;;AAED;AACA;;AAEA;AACA,iEAAiE;AACjE;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,CAAC;;;;;;;;;;;;;;AC9CD;AACA,mBAAmB,mBAAO,CAAC,EAAa;AACxC,OAAO,MAAM,GAAG,mBAAO,CAAC,EAAc;;AAEtC;AACA;AACA;AACA;AACA;AACA,uBAAuB,IAAI;AAC3B;AACA,iBAAiB,IAAI,eAAe,eAAe;AACnD,gCAAgC,iBAAiB;AACjD;AACA,iBAAiB,IAAI,cAAc,QAAQ;AAC3C;AACA;;AAEA,yBAAyB,sBAAsB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;AC7DA,mBAAmB,mBAAO,CAAC,EAAa;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,UAAU,SAAS,OAAO,EAAE,EAAE;AACzD,mDAAmD,KAAK;AACxD;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;;;;;;ACtCA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,aAAa,GAAG,IAAoD,oBAAoB,KAAK,EAA8K,CAAC,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,MAAM,SAAmC,CAAC,gBAAgB,OAAC,OAAO,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,iBAAiB,eAAe,sBAAsB,oBAAoB,UAAU,SAAmC,KAAK,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,aAAa,2IAA2I,YAAY,yBAAyB,gBAAgB,UAAU,UAAU,8BAA8B,wBAAwB,oBAAoB,8CAA8C,kCAAkC,YAAY,YAAY,mCAAmC,wBAAwB,sBAAsB,oBAAoB,sCAAsC,WAAW,YAAY,SAAS,EAAE,mBAAmB,aAAa,0GAA0G,qBAAqB,0EAA0E,WAAW,+OAA+O,kBAAkB,sBAAsB,wBAAwB,2GAA2G,2DAA2D,yJAAyJ,sDAAsD,WAAW,kMAAkM,UAAU,EAAE,4BAA4B,qBAAqB,aAAa,4GAA4G,sBAAsB,uGAAuG,aAAa,4BAA4B,mIAAmI,6BAA6B,6GAA6G,IAAI,gCAAgC,yPAAyP,oCAAoC,6IAA6I,aAAa,EAAE,+FAA+F,qBAAqB,aAAa,kCAAkC,SAAS,wCAAwC,kCAAkC,6BAA6B,qCAAqC,wBAAwB,EAAE,wCAAwC,qBAAqB,aAAa,gCAAgC,mBAAmB,MAAM,KAAK,IAAI,YAAY,IAAI,iCAAiC,OAAO,SAAS,GAAG,wBAAwB,sEAAsE,cAAc,MAAM,YAAY,IAAI,4BAA4B,WAAW,iCAAiC,cAAc,MAAM,YAAY,IAAI,uCAAuC,WAAW,oBAAoB,EAAE,aAAa,qBAAqB,aAAa,yKAAyK,GAAG,qBAAqB,aAAa,MAAM,0DAA0D,WAAW,EAAE,OAAO,qBAAqB,aAAa,yLAAyL,gBAAgB,kGAAkG,oEAAoE,mGAAmG,8BAA8B,0FAA0F,gCAAgC,+CAA+C,oCAAoC,oCAAoC,yCAAyC,EAAE,WAAW,8BAA8B,QAAQ,mBAAmB,GAAG,8BAA8B,0BAA0B,+BAA+B,yBAAyB,GAAG,EAAE,iDAAiD,qBAAqB,aAAa,gBAAgB,WAAW,QAAQ,IAAI,yCAAyC,SAAS,wBAAwB,gTAAgT,6CAA6C,iGAAiG,QAAQ,+BAA+B,cAAc,wXAAwX,SAAS,iKAAiK,4HAA4H,sGAAsG,oBAAoB,iRAAiR,6CAA6C,mEAAmE,yGAAyG,kBAAkB,8DAA8D,GAAG,sCAAsC,wEAAwE,oCAAoC,MAAM,8EAA8E,WAAW,wBAAwB,WAAW,EAAE,wBAAwB,sCAAsC,mBAAmB,gHAAgH,kDAAkD,8FAA8F,aAAa,EAAE,oBAAoB,wBAAwB,WAAW,EAAE,0BAA0B,uCAAuC,sBAAsB,8BAA8B,gCAAgC,yBAAyB,eAAe,8BAA8B,aAAa,EAAE,iOAAiO,WAAW,aAAa,aAAa,EAAE,0CAA0C,2IAA2I,0CAA0C,sBAAsB,WAAW,+BAA+B,kBAAkB,wBAAwB,sFAAsF,2BAA2B,WAAW,OAAO,+BAA+B,4LAA4L,+BAA+B,oBAAoB,4CAA4C,YAAY,WAAW,QAAQ,cAAc,UAAU,SAAS,6BAA6B,4BAA4B,4BAA4B,WAAW,gBAAgB,aAAa,EAAE,uFAAuF,qBAAqB,aAAa,kDAAkD,iCAAiC,6DAA6D,IAAI,wBAAwB,IAAI,oBAAoB,kBAAkB,gEAAgE,SAAS,8FAA8F,kBAAkB,8CAA8C,4GAA4G,UAAU,mBAAmB,SAAS,WAAW,UAAU,EAAE,wCAAwC,sBAAsB,aAAa,aAAa,qCAAqC,sIAAsI,aAAa,sDAAsD,YAAY,6DAA6D,UAAU,kJAAkJ,6BAA6B,wCAAwC,EAAE,uEAAuE,sBAAsB,aAAa,uHAAuH,cAAc,mCAAmC,oDAAoD,yBAAyB,KAAK,sBAAsB,6FAA6F,WAAW,EAAE,wBAAwB,WAAW,uBAAuB,EAAE,8FAA8F,6MAA6M,eAAe,mBAAmB,mBAAmB,uCAAuC,4BAA4B,WAAW,oBAAoB,wBAAwB,mBAAmB,kCAAkC,WAAW,KAAK,WAAW,qCAAqC,+MAA+M,EAAE,uDAAuD,GAAG,EAAE,sGAAsG,sBAAsB,aAAa,mDAAmD,gBAAgB,6FAA6F,oDAAoD,WAAW,iDAAiD,QAAQ,aAAa,WAAW,EAAE,yBAAyB,4CAA4C,sBAAsB,uCAAuC,EAAE,8BAA8B,gEAAgE,+BAA+B,iGAAiG,aAAa,EAAE,2CAA2C,sBAAsB,aAAa,oCAAoC,kBAAkB,8BAA8B,WAAW,0BAA0B,qCAAqC,yBAAyB,kBAAkB,sBAAsB,aAAa,EAAE,yDAAyD,sBAAsB,aAAa,EAAE,mCAAmC,sBAAsB,aAAa,WAAW,8DAA8D,sEAAsE,kFAAkF,uBAAuB,yBAAyB,uCAAuC,oBAAoB,mBAAmB,sBAAsB,0BAA0B,sBAAsB,6FAA6F,GAAG,sBAAsB,aAAa,kBAAkB,uCAAuC,IAAI,yUAAyU,iDAAiD,yBAAyB,+BAA+B,wBAAwB,mDAAmD,6SAA6S,mBAAmB,gBAAgB,cAAc,oCAAoC,2PAA2P,gFAAgF,uBAAuB,iBAAiB,cAAc,4DAA4D,OAAO,gBAAgB,8FAA8F,qBAAqB,UAAU,4JAA4J,oBAAoB,SAAS,kCAAkC,kBAAkB,IAAI,sBAAsB,qEAAqE,SAAS,QAAQ,iCAAiC,wBAAwB,EAAE,8BAA8B,wBAAwB,oBAAoB,kBAAkB,yCAAyC,wBAAwB,EAAE,kDAAkD,uBAAuB,oBAAoB,cAAc,oBAAoB,mFAAmF,yCAAyC,oCAAoC,MAAM,WAAW,iCAAiC,YAAY,sBAAsB,8FAA8F,oCAAoC,WAAW,IAAI,oBAAoB,EAAE,sJAAsJ,uKAAuK,+KAA+K,kCAAkC,6BAA6B,SAAS,4BAA4B,4CAA4C,6BAA6B,oDAAoD,kCAAkC,cAAc,iFAAiF,YAAY,EAAE,gNAAgN,sBAAsB,sBAAsB,EAAE,cAAc,sBAAsB,aAAa,wBAAwB,cAAc,eAAe,YAAY,mBAAmB,kBAAkB,2DAA2D,8BAA8B,8CAA8C,gGAAgG,KAAK,uGAAuG,SAAS,+CAA+C,+FAA+F,8CAA8C,kCAAkC,sCAAsC,mEAAmE,uBAAuB,aAAa,EAAE,gCAAgC,sBAAsB,aAAa,oBAAoB,cAAc,0DAA0D,aAAa,wBAAwB,8BAA8B,wBAAwB,6IAA6I,sBAAsB,gCAAgC,kBAAkB,4BAA4B,qBAAqB,qBAAqB,UAAU,yCAAyC,cAAc,4BAA4B,uBAAuB,wBAAwB,gDAAgD,uBAAuB,mCAAmC,oCAAoC,qBAAqB,sBAAsB,8FAA8F,aAAa,EAAE,cAAc,sBAAsB,aAAa,8BAA8B,cAAc,eAAe,6DAA6D,oBAAoB,mEAAmE,uBAAuB,aAAa,EAAE,sCAAsC,sBAAsB,aAAa,wBAAwB,cAAc,eAAe,2DAA2D,yCAAyC,8CAA8C,0CAA0C,+CAA+C,4BAA4B,kCAAkC,oBAAoB,mEAAmE,uBAAuB,aAAa,EAAE,gCAAgC,sBAAsB,aAAa,yBAAyB,cAAc,eAAe,6DAA6D,sDAAsD,sEAAsE,uBAAuB,aAAa,EAAE,iCAAiC,sBAAsB,aAAa,qIAAqI,sBAAsB,qBAAqB,0KAA0K,EAAE,qHAAqH,sBAAsB,aAAa,+LAA+L,GAAG,sBAAsB,aAAa,2CAA2C,cAAc,mDAAmD,qDAAqD,WAAW,qDAAqD,EAAE,aAAa,EAAE,mCAAmC,sBAAsB,aAAa,2CAA2C,aAAa,yDAAyD,iEAAiE,sEAAsE,aAAa,EAAE,gDAAgD,sBAAsB,aAAa,2CAA2C,cAAc,+EAA+E,qDAAqD,MAAM,wCAAwC,+CAA+C,sCAAsC,aAAa,EAAE,mCAAmC,sBAAsB,aAAa,2CAA2C,cAAc,0BAA0B,WAAW,kHAAkH,oGAAoG,aAAa,WAAW,EAAE,+CAA+C,8CAA8C,+BAA+B,kJAAkJ,uCAAuC,qJAAqJ,8BAA8B,2CAA2C,iDAAiD,0CAA0C,kBAAkB,iDAAiD,MAAM,oDAAoD,MAAM,6DAA6D,+BAA+B,aAAa,4CAA4C,EAAE,aAAa,EAAE,mCAAmC,sBAAsB,aAAa,cAAc,yCAAyC,iDAAiD,uEAAuE,wBAAwB,oBAAoB,aAAa,iBAAiB,oBAAoB,gBAAgB,4BAA4B,aAAa,IAAI,mDAAmD,SAAS,qBAAqB,SAAS,mBAAmB,gKAAgK,kBAAkB,uCAAuC,oBAAoB,iFAAiF,oBAAoB,kCAAkC,4BAA4B,uCAAuC,kBAAkB,gCAAgC,8BAA8B,iFAAiF,oEAAoE,WAAW,+BAA+B,kBAAkB,wBAAwB,QAAQ,2BAA2B,WAAW,OAAO,kBAAkB,mGAAmG,mBAAmB,4CAA4C,uBAAuB,4GAA4G,mBAAmB,0BAA0B,aAAa,8BAA8B,6DAA6D,4BAA4B,uHAAuH,iBAAiB,iFAAiF,qDAAqD,qBAAqB,0BAA0B,+CAA+C,aAAa,GAAG,sBAAsB,aAAa,+HAA+H,oBAAoB,2CAA2C,UAAU,kBAAkB,QAAQ,UAAU,4CAA4C,MAAM,wBAAwB,IAAI,kHAAkH,SAAS,mDAAmD,aAAa,uBAAuB,8CAA8C,yDAAyD,0BAA0B,kBAAkB,yBAAyB,UAAU,sBAAsB,IAAI,sBAAsB,UAAU,8DAA8D,gCAAgC,mCAAmC,iBAAiB,qBAAqB,QAAQ,WAAW,mBAAmB,UAAU,+BAA+B,sDAAsD,6CAA6C,WAAW,iCAAiC,SAAS,yCAAyC,8DAA8D,SAAS,KAAK,SAAS,KAAK,KAAK,WAAW,EAAE,QAAQ,kBAAkB,WAAW,+CAA+C,wBAAwB,+BAA+B,uBAAuB,OAAO,mBAAmB,yDAAyD,kBAAkB,iCAAiC,4BAA4B,qIAAqI,mBAAmB,2CAA2C,KAAK,aAAa,EAAE,+IAA+I,sBAAsB,aAAa,kPAAkP,KAAK,yBAAyB,IAAI,yBAAyB,uBAAuB,OAAO,SAAS,IAAI,6FAA6F,yDAAyD,SAAS,YAAY,IAAI,6CAA6C,SAAS,iBAAiB,EAAE,qBAAqB,sBAAsB,aAAa,gHAAgH,MAAM,wDAAwD,aAAa,+CAA+C,aAAa,4BAA4B,yCAAyC,2DAA2D,6BAA6B,QAAQ,IAAI,2JAA2J,wDAAwD,IAAI,6QAA6Q,SAAS,IAAI,0BAA0B,gFAAgF,wCAAwC,UAAU,IAAI,4BAA4B,uCAAuC,KAAK,2BAA2B,SAAS,sBAAsB,yFAAyF,sFAAsF,uDAAuD,sDAAsD,8DAA8D,wCAAwC,iBAAiB,QAAQ,qGAAqG,+BAA+B,mBAAmB,oBAAoB,MAAM,iDAAiD,sBAAsB,KAAK,qCAAqC,QAAQ,oJAAoJ,iCAAiC,EAAE,8BAA8B,iDAAiD,yCAAyC,sBAAsB,2EAA2E,WAAW,sCAAsC,EAAE,sBAAsB,EAAE,2EAA2E,sBAAsB,aAAa,sGAAsG,cAAc,SAAS,gBAAgB,YAAY,WAAW,6BAA6B,SAAS,wBAAwB,uBAAuB,IAAI,qBAAqB,OAAO,EAAE,SAAS,IAAI,6FAA6F,gCAAgC,SAAS,sDAAsD,OAAO,iCAAiC,wBAAwB,iDAAiD,KAAK,IAAI,6KAA6K,kBAAkB,6BAA6B,iBAAiB,WAAW,iCAAiC,SAAS,iBAAiB,sBAAsB,IAAI,kFAAkF,SAAS,UAAU,yBAAyB,IAAI,iFAAiF,SAAS,UAAU,KAAK,cAAc,kCAAkC,2GAA2G,IAAI,KAAK,iCAAiC,SAAS,kBAAkB,4BAA4B,gBAAgB,YAAY,WAAW,cAAc,SAAS,sBAAsB,SAAS,UAAU,2BAA2B,gCAAgC,yBAAyB,qCAAqC,wBAAwB,qCAAqC,wBAAwB,qCAAqC,UAAU,yCAAyC,gCAAgC,wBAAwB,yBAAyB,wBAAwB,2BAA2B,gBAAgB,mBAAmB,4BAA4B,mBAAmB,oDAAoD,sCAAsC,yBAAyB,wBAAwB,2CAA2C,eAAe,2BAA2B,gCAAgC,yBAAyB,gBAAgB,qCAAqC,2BAA2B,eAAe,2BAA2B,gCAAgC,yBAAyB,yCAAyC,wBAAwB,qCAAqC,cAAc,6BAA6B,uBAAuB,kBAAkB,qBAAqB,kBAAkB,yBAAyB,wPAAwP,4BAA4B,+EAA+E,qEAAqE,aAAa,QAAQ,iBAAiB,0EAA0E,SAAS,yBAAyB,aAAa,uBAAuB,EAAE,0BAA0B,cAAc,0CAA0C,qBAAqB,aAAa,QAAQ,mBAAmB,gGAAgG,SAAS,sCAAsC,6CAA6C,kLAAkL,qBAAqB,qBAAqB,mBAAmB,uBAAuB,kBAAkB,wBAAwB,IAAI,mBAAmB,uBAAuB,sTAAsT,GAAG,EAAE,sFAAsF,sBAAsB,aAAa,iHAAiH,cAAc,iCAAiC,aAAa,2BAA2B,0CAA0C,qBAAqB,gCAAgC,2GAA2G,2BAA2B,wBAAwB,wBAAwB,oCAAoC,iCAAiC,kCAAkC,sUAAsU,2GAA2G,mDAAmD,uCAAuC,2XAA2X,8CAA8C,IAAI,0GAA0G,uBAAuB,8CAA8C,2OAA2O,2BAA2B,QAAQ,QAAQ,oBAAoB,yKAAyK,2BAA2B,MAAM,gDAAgD,yDAAyD,WAAW,iBAAiB,oEAAoE,6NAA6N,6BAA6B,gEAAgE,0QAA0Q,wBAAwB,QAAQ,gWAAgW,mLAAmL,ybAAyb,mJAAmJ,gDAAgD,qDAAqD,UAAU,uEAAuE,6EAA6E,2BAA2B,iBAAiB,kBAAkB,2FAA2F,aAAa,EAAE,iGAAiG,sBAAsB,aAAa,2IAA2I,gBAAgB,kCAAkC,aAAa,uBAAuB,2BAA2B,oBAAoB,iCAAiC,2BAA2B,QAAQ,iUAAiU,yBAAyB,kEAAkE,YAAY,+KAA+K,gHAAgH,6BAA6B,8NAA8N,mBAAmB,ySAAyS,mHAAmH,8BAA8B,mDAAmD,4BAA4B,oOAAoO,kCAAkC,wBAAwB,mCAAmC,iUAAiU,6BAA6B,2CAA2C,0CAA0C,EAAE,YAAY,oEAAoE,uBAAuB,cAAc,uBAAuB,wCAAwC,kHAAkH,KAAK,uCAAuC,+BAA+B,KAAK,qCAAqC,oDAAoD,0CAA0C,kCAAkC,KAAK,wCAAwC,yDAAyD,sCAAsC,8BAA8B,MAAM,iBAAiB,uGAAuG,YAAY,yCAAyC,8BAA8B,MAAM,iBAAiB,0GAA0G,aAAa,aAAa,EAAE,sHAAsH,sBAAsB,aAAa,kBAAkB,oMAAoM,mEAAmE,kIAAkI,aAAa,2BAA2B,sBAAsB,IAAI,mDAAmD,iDAAiD,wEAAwE,wBAAwB,oFAAoF,SAAS,4BAA4B,qBAAqB,qBAAqB,4CAA4C,0BAA0B,8DAA8D,+BAA+B,2GAA2G,+BAA+B,sFAAsF,8BAA8B,oHAAoH,2FAA2F,8FAA8F,KAAK,WAAW,wBAAwB,YAAY,EAAE,mHAAmH,sBAAsB,aAAa,aAAa,uDAAuD,MAAM,mDAAmD,aAAa,iBAAiB,eAAe,gBAAgB,yIAAyI,yCAAyC,gCAAgC,iEAAiE,2CAA2C,YAAY,iBAAiB,KAAK,2BAA2B,iCAAiC,wBAAwB,SAAS,aAAa,QAAQ,KAAK,mBAAmB,EAAE,EAAE,kBAAkB,MAAM,QAAQ,WAAW,KAAK,sBAAsB,uBAAuB,2FAA2F,EAAE,GAAG,sBAAsB,aAAa,qBAAqB,cAAc,QAAQ,8CAA8C,cAAc,2EAA2E,gEAAgE,kBAAkB,wLAAwL,kBAAkB,aAAa,MAAM,IAAI,OAAO,SAAS,qBAAqB,qFAAqF,EAAE,cAAc,gBAAgB,yFAAyF,sBAAsB,gBAAgB,SAAS,cAAc,wBAAwB,cAAc,yBAAyB,mBAAmB,OAAO,EAAE,+BAA+B,gBAAgB,SAAS,IAAI,gCAAgC,SAAS,2BAA2B,SAAS,4CAA4C,oCAAoC,uBAAuB,6BAA6B,sCAAsC,SAAS,EAAE,aAAa,sCAAsC,QAAQ,EAAE,EAAE,+BAA+B,yBAAyB,gCAAgC,0FAA0F,8BAA8B,2FAA2F,uCAAuC,0BAA0B,4CAA4C,mCAAmC,sCAAsC,yBAAyB,2CAA2C,kCAAkC,yBAAyB,aAAa,iDAAiD,cAAc,YAAY,KAAK,sBAAsB,8BAA8B,MAAM,6BAA6B,SAAS,wBAAwB,sBAAsB,8BAA8B,MAAM,4BAA4B,SAAS,uBAAuB,oDAAoD,sBAAsB,kBAAkB,qBAAqB,mBAAmB,WAAW,8GAA8G,oBAAoB,8BAA8B,8CAA8C,MAAM,WAAW,SAAS,gBAAgB,8BAA8B,yCAAyC,aAAa,wBAAwB,GAAG,oBAAoB,8GAA8G,oBAAoB,8BAA8B,6BAA6B,MAAM,yCAAyC,yBAAyB,aAAa,wBAAwB,EAAE,UAAU,EAAE,aAAa,sBAAsB,aAAa,SAAS,kHAAkH,EAAE,wFAAwF,sBAAsB,aAAa,iKAAiK,cAAc,wCAAwC,uBAAuB,2EAA2E,MAAM,EAAE,mBAAmB,uMAAuM,oFAAoF,+BAA+B,kEAAkE,MAAM,wNAAwN,mBAAmB,gBAAgB,eAAe,4CAA4C,gBAAgB,+BAA+B,6CAA6C,uBAAuB,+KAA+K,GAAG,4IAA4I,2LAA2L,8CAA8C,mHAAmH,gCAAgC,oBAAoB,+BAA+B,+JAA+J,oDAAoD,cAAc,gBAAgB,sBAAsB,cAAc,kBAAkB,EAAE,sGAAsG,sBAAsB,aAAa,+LAA+L,cAAc,wCAAwC,uBAAuB,mCAAmC,MAAM,EAAE,mBAAmB,yVAAyV,6CAA6C,oCAAoC,4DAA4D,gBAAgB,eAAe,4CAA4C,gBAAgB,+BAA+B,oFAAoF,uBAAuB,sMAAsM,GAAG,8WAA8W,+XAA+X,2DAA2D,sLAAsL,gCAAgC,oBAAoB,+BAA+B,oKAAoK,oDAAoD,cAAc,gBAAgB,YAAY,EAAE,iJAAiJ,sBAAsB,aAAa,sGAAsG,qBAAqB,kDAAkD,SAAS,EAAE,gBAAgB,MAAM,kEAAkE,iDAAiD,SAAS,2BAA2B,iEAAiE,OAAO,6BAA6B,qDAAqD,iBAAiB,IAAI,kBAAkB,2BAA2B,gBAAgB,qBAAqB,IAAI,mBAAmB,yCAAyC,IAAI,kCAAkC,UAAU,IAAI,6BAA6B,YAAY,IAAI,kBAAkB,2BAA2B,8BAA8B,uBAAuB,oIAAoI,eAAe,GAAG,sBAAsB,aAAa,8BAA8B,IAAI,oCAAoC,SAAS,KAAK,IAAI,kDAAkD,SAAS,KAAK,8BAA8B,MAAM,wDAAwD,gBAAgB,oGAAoG,iBAAiB,IAAI,iCAAiC,SAAS,yCAAyC,6BAA6B,QAAQ,IAAI,2JAA2J,0BAA0B,IAAI,6QAA6Q,SAAS,6BAA6B,qBAAqB,6BAA6B,8CAA8C,IAAI,yBAAyB,SAAS,4BAA4B,2CAA2C,UAAU,IAAI,4BAA4B,uCAAuC,KAAK,2BAA2B,SAAS,sBAAsB,yFAAyF,cAAc,4BAA4B,MAAM,iDAAiD,sBAAsB,KAAK,sCAAsC,EAAE,cAAc,sBAAsB,aAAa,4BAA4B,yCAAyC,MAAM,EAAE,qBAAqB,yBAAyB,EAAE,kBAAkB,kBAAkB,GAAG,sBAAsB,aAAa,WAAW,+XAA+X,GAAG,sBAAsB,aAAa,iBAAiB,mBAAmB,MAAM,KAAK,IAAI,YAAY,IAAI,iCAAiC,OAAO,SAAS,GAAG,4BAA4B,cAAc,MAAM,YAAY,IAAI,4BAA4B,YAAY,GAAG,sBAAsB,aAAa,6KAA6K,gBAAgB,oBAAoB,cAAc,uBAAuB,cAAc,mBAAmB,OAAO,QAAQ,cAAc,0BAA0B,iNAAiN,gBAAgB,qHAAqH,gBAAgB,6BAA6B,gBAAgB,sEAAsE,gBAAgB,6LAA6L,oEAAoE,GAAG,+DAA+D,SAAS,IAAI,mJAAmJ,wBAAwB,kCAAkC,sBAAsB,4BAA4B,oCAAoC,cAAc,mCAAmC,GAAG,+DAA+D,wGAAwG,uCAAuC,EAAE,UAAU,uCAAuC,EAAE,KAAK,6BAA6B,sZAAsZ,sKAAsK,GAAG,0CAA0C,gBAAgB,aAAa,EAAE,kBAAkB,sCAAsC,yBAAyB,8XAA8X,qBAAqB,+KAA+K,EAAE,aAAa,iJAAiJ,wEAAwE,8CAA8C,sIAAsI,gBAAgB,eAAe,EAAE,kBAAkB,sCAAsC,yBAAyB,yeAAye,wIAAwI,oLAAoL,EAAE,kGAAkG,2BAA2B,iHAAiH,oDAAoD,yNAAyN,sBAAsB,mFAAmF,aAAa,8nCAA8nC,cAAc,MAAM,6MAA6M,cAAc,aAAa,yUAAyU,wBAAwB,eAAe,QAAQ,+GAA+G,aAAa,YAAY,ueAAue,+BAA+B,YAAY,sDAAsD,EAAE,mBAAmB,wCAAwC,yBAAyB,sCAAsC,sBAAsB,kHAAkH,iFAAiF,oHAAoH,0NAA0N,uBAAuB,yFAAyF,4DAA4D,yBAAyB,YAAY,4CAA4C,yGAAyG,mrBAAmrB,KAAK,2BAA2B,qLAAqL,oCAAoC,gBAAgB,0MAA0M,gDAAgD,0IAA0I,iBAAiB,mCAAmC,YAAY,GAAG,mKAAmK,IAAI,MAAM,oFAAoF,aAAa,8GAA8G,iBAAiB,sCAAsC,YAAY,GAAG,mKAAmK,IAAI,MAAM,0FAA0F,aAAa,mGAAmG,kBAAkB,iMAAiM,iDAAiD,yDAAyD,iDAAiD,2DAA2D,mCAAmC,WAAW,EAAE,4CAA4C,kBAAkB,MAAM,kIAAkI,0GAA0G,mCAAmC,4BAA4B,EAAE,mBAAmB,uCAAuC,yBAAyB,0GAA0G,eAAe,IAAI,2GAA2G,gFAAgF,mPAAmP,0GAA0G,2BAA2B,yFAAyF,mMAAmM,6SAA6S,0BAA0B,MAAM,kIAAkI,sCAAsC,+BAA+B,yBAAyB,uEAAuE,gRAAgR,eAAe,EAAE,qCAAqC,yHAAyH,EAAE,kCAAkC,8LAA8L,oDAAoD,EAAE,8EAA8E,sBAAsB,aAAa,qBAAqB,wIAAwI,GAAG,sBAAsB,aAAa,wBAAwB,sDAAsD,yPAAyP,KAAK,qDAAqD,QAAQ,EAAE,uDAAuD,KAAK,YAAY,cAAc,4BAA4B,WAAW,SAAS,UAAU,QAAQ,8CAA8C,QAAQ,6HAA6H,QAAQ,EAAE,4CAA4C,cAAc,4BAA4B,WAAW,wCAAwC,QAAQ,wFAAwF,gDAAgD,QAAQ,0BAA0B,sBAAsB,gDAAgD,QAAQ,kBAAkB,eAAe,SAAS,kBAAkB,EAAE,WAAW,aAAa,sBAAsB,SAAS,kBAAkB,EAAE,YAAY,WAAW,kBAAkB,EAAE,YAAY,oBAAoB,SAAS,kBAAkB,EAAE,UAAU,KAAK,IAAI,gDAAgD,wCAAwC,KAAK,UAAU,mDAAmD,EAAE,wCAAwC,OAAO,OAAO,gBAAgB,yIAAyI,GAAG,sBAAsB,aAAa,+HAA+H,cAAc,8DAA8D,aAAa,+fAA+f,cAAc,MAAM,0QAA0Q,cAAc,MAAM,mEAAmE,gBAAgB,QAAQ,mKAAmK,gBAAgB,QAAQ,8EAA8E,aAAa,cAAc,MAAM,MAAM,6CAA6C,MAAM,eAAe,KAAK,MAAM,eAAe,KAAK,MAAM,eAAe,KAAK,MAAM,eAAe,iCAAiC,OAAO,MAAM,KAAK,eAAe,4BAA4B,OAAO,OAAO,kDAAkD,oBAAoB,gBAAgB,kYAAkY,kFAAkF,eAAe,0CAA0C,2HAA2H,8DAA8D,0IAA0I,QAAQ,gBAAgB,sBAAsB,UAAU,MAAM,KAAK,KAAK,EAAE,iBAAiB,sBAAsB,wBAAwB,0EAA0E,MAAM,6EAA6E,yCAAyC,MAAM,cAAc,6CAA6C,MAAM,gDAAgD,mBAAmB,sCAAsC,MAAM,uDAAuD,MAAM,YAAY,KAAK,EAAE,iBAAiB,sBAAsB,+BAA+B,6CAA6C,MAAM,kBAAkB,2CAA2C,MAAM,8GAA8G,YAAY,KAAK,EAAE,iBAAiB,sBAAsB,yIAAyI,YAAY,KAAK,EAAE,iBAAiB,sBAAsB,8HAA8H,wBAAwB,KAAK,KAAK,EAAE,iBAAiB,sBAAsB,gHAAgH,iCAAiC,SAAS,oQAAoQ,oBAAoB,wBAAwB,iBAAiB,QAAQ,mFAAmF,EAAE,+DAA+D,gCAAgC,oBAAoB,wBAAwB,iBAAiB,QAAQ,sFAAsF,EAAE,+DAA+D,mCAAmC,SAAS,uBAAuB,KAAK,KAAK,EAAE,iBAAiB,sBAAsB,wBAAwB,sCAAsC,MAAM,MAAM,8EAA8E,MAAM,aAAa,KAAK,EAAE,iBAAiB,sBAAsB,qCAAqC,yGAAyG,4BAA4B,gCAAgC,mBAAmB,0BAA0B,MAAM,KAAK,IAAI,EAAE,iBAAiB,sBAAsB,mCAAmC,iBAAiB,MAAM,qCAAqC,YAAY,QAAQ,iBAAiB,MAAM,4CAA4C,YAAY,MAAM,4BAA4B,KAAK,EAAE,iBAAiB,sBAAsB,8BAA8B,+CAA+C,MAAM,kDAAkD,kBAAkB,uBAAuB,uCAAuC,sDAAsD,MAAM,UAAU,MAAM,aAAa,KAAK,EAAE,iBAAiB,sBAAsB,mHAAmH,sDAAsD,MAAM,mBAAmB,aAAa,eAAe,EAAE,KAAK,IAAI,EAAE,iBAAiB,sBAAsB,oCAAoC,KAAK,UAAU,uBAAuB,qCAAqC,eAAe,6DAA6D,2CAA2C,MAAM,mBAAmB,aAAa,sBAAsB,EAAE,KAAK,wEAAwE,EAAE,iBAAiB,sBAAsB,uCAAuC,KAAK,WAAW,UAAU,IAAI,EAAE,iBAAiB,sBAAsB,2BAA2B,4CAA4C,MAAM,yCAAyC,gBAAgB,UAAU,IAAI,EAAE,iBAAiB,sBAAsB,sCAAsC,KAAK,UAAU,IAAI,EAAE,iBAAiB,sBAAsB,yCAAyC,4BAA4B,4CAA4C,MAAM,KAAK,IAAI,qBAAqB,qBAAqB,oBAAoB,uDAAuD,MAAM,kBAAkB,eAAe,iEAAiE,8CAA8C,MAAM,wCAAwC,gBAAgB,yEAAyE,wCAAwC,MAAM,2BAA2B,kBAAkB,yBAAyB,iMAAiM,MAAM,aAAa,wEAAwE,EAAE,iBAAiB,sBAAsB,kBAAkB,gBAAgB,6EAA6E,EAAE,iBAAiB,sBAAsB,sBAAsB,2CAA2C,UAAU,MAAM,SAAS,oBAAoB,MAAM,SAAS,8CAA8C,MAAM,uBAAuB,oBAAoB,cAAc,IAAI,EAAE,iBAAiB,sBAAsB,mEAAmE,yBAAyB,aAAa,0EAA0E,EAAE,iBAAiB,sBAAsB,eAAe,gBAAgB,8EAA8E,EAAE,iBAAiB,sBAAsB,sBAAsB,+BAA+B,wCAAwC,MAAM,kCAAkC,oBAAoB,cAAc,IAAI,EAAE,iBAAiB,sBAAsB,mEAAmE,oBAAoB,gDAAgD,MAAM,UAAU,yBAAyB,qBAAqB,mCAAmC,gDAAgD,MAAM,iFAAiF,iCAAiC,gCAAgC,kBAAkB,EAAE,0BAA0B,MAAM,yBAAyB,8BAA8B,MAAM,mBAAmB,KAAK,KAAK,EAAE,iBAAiB,sBAAsB,qIAAqI,uCAAuC,MAAM,MAAM,UAAU,4BAA4B,KAAK,KAAK,EAAE,iBAAiB,sBAAsB,6BAA6B,yCAAyC,MAAM,MAAM,UAAU,YAAY,QAAQ,aAAa,QAAQ,iBAAiB,yBAAyB,8dAA8d,0BAA0B,yBAAyB,cAAc,gDAAgD,kCAAkC,MAAM,qEAAqE,sCAAsC,iBAAiB,wIAAwI,oDAAoD,EAAE,gFAAgF,sBAAsB,aAAa,sbAAsb,oCAAoC,iIAAiI,QAAQ,MAAM,WAAW,QAAQ,IAAI,gBAAgB,aAAa,eAAe,KAAK,sEAAsE,QAAQ,cAAc,KAAK,qBAAqB,MAAM,kCAAkC,gCAAgC,eAAe,KAAK,qBAAqB,QAAQ,IAAI,mCAAmC,+IAA+I,MAAM,EAAE,wFAAwF,yCAAyC,EAAE,aAAa,IAAI,OAAO,0CAA0C,eAAe,YAAY,mBAAmB,mCAAmC,yBAAyB,WAAW,+CAA+C,4BAA4B,oDAAoD,EAAE,qBAAqB,sBAAsB,aAAa,WAAW,4KAA4K,GAAG,sBAAsB,aAAa,2BAA2B,cAAc,mBAAmB,OAAO,QAAQ,kQAAkQ,KAAK,oBAAoB,KAAK,qBAAqB,KAAK,qBAAqB,KAAK,oBAAoB,KAAK,0BAA0B,sBAAsB,iHAAiH,gBAAgB,iDAAiD,cAAc,iCAAiC,gBAAgB,sEAAsE,kBAAkB,oJAAoJ,kBAAkB,qBAAqB,gBAAgB,YAAY,0BAA0B,EAAE,aAAa,kBAAkB,6BAA6B,QAAQ,KAAK,uBAAuB,QAAQ,KAAK,KAAK,eAAe,6BAA6B,cAAc,MAAM,QAAQ,MAAM,uBAAuB,QAAQ,KAAK,uBAAuB,QAAQ,KAAK,qBAAqB,mEAAmE,cAAc,uGAAuG,oBAAoB,gBAAgB,0CAA0C,kBAAkB,2BAA2B,iGAAiG,+BAA+B,YAAY,kBAAkB,gBAAgB,uBAAuB,0NAA0N,EAAE,WAAW,gBAAgB,kGAAkG,oCAAoC,IAAI,kEAAkE,KAAK,aAAa,gGAAgG,iCAAiC,KAAK,aAAa,QAAQ,wPAAwP,EAAE,6CAA6C,2KAA2K,QAAQ,KAAK,oBAAoB,+CAA+C,MAAM,wKAAwK,UAAU,GAAG,UAAU,kBAAkB,KAAK,wDAAwD,WAAW,QAAQ,MAAM,wBAAwB,MAAM,qFAAqF,wBAAwB,kBAAkB,gCAAgC,8CAA8C,KAAK,mMAAmM,kBAAkB,gCAAgC,2BAA2B,KAAK,2CAA2C,YAAY,wBAAwB,EAAE,6IAA6I,iDAAiD,KAAK,SAAS,oBAAoB,UAAU,6GAA6G,uBAAuB,eAAe,+BAA+B,UAAU,KAAK,mBAAmB,UAAU,aAAa,mBAAmB,KAAK,mBAAmB,UAAU,aAAa,UAAU,KAAK,sBAAsB,YAAY,iBAAiB,QAAQ,KAAK,WAAW,QAAQ,OAAO,uBAAuB,KAAK,OAAO,uBAAuB,KAAK,OAAO,uBAAuB,KAAK,OAAO,uBAAuB,mBAAmB,KAAK,6BAA6B,0EAA0E,+HAA+H,0DAA0D,YAAY,+DAA+D,mBAAmB,QAAQ,MAAM,iDAAiD,0EAA0E,SAAS,MAAM,qCAAqC,SAAS,+CAA+C,MAAM,8FAA8F,8BAA8B,KAAK,kCAAkC,oLAAoL,MAAM,2CAA2C,IAAI,+BAA+B,0CAA0C,2FAA2F,6BAA6B,kRAAkR,yBAAyB,MAAM,qKAAqK,EAAE,qBAAqB,sBAAsB,aAAa,qBAAqB,6LAA6L,GAAG,sBAAsB,aAAa,kEAAkE,gCAAgC,0CAA0C,GAAG,EAAE,GAAG,WAAW,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,2FAA2F,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,gCAAgC,qBAAM,CAAC,qBAAM,mEAAmE,EAAE,GAAG,EAAE,GAAG,SAAS,E;;;;;;;ACZt1xG;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,EAAa;AAClC,aAAa,mBAAO,CAAC,EAAiB;AACtC,aAAa,mBAAO,CAAC,EAAa;AAClC,aAAa,mBAAO,CAAC,EAAuB;AAC5C,8BAA8B,mBAAO,CAAC,EAAuB;AAC7D,eAAe;AACf,iC;;;;;;;AClBa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,qBAAqB;AACrB,aAAa,mBAAO,CAAC,EAAS;AAC9B,wBAAwB,mBAAO,CAAC,EAAiB;AACjD,iDAAgD,CAAC,qCAAqC,sCAAsC,EAAE,EAAE,EAAC;AACjI;AACA;AACA;AACA,iC;;;;;;;ACnBa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,qBAAqB;AACrB,eAAe,mBAAO,CAAC,EAAiB;AACxC,sBAAsB,mBAAO,CAAC,GAAa;AAC3C,oBAAoB,mBAAO,CAAC,GAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,IAAI;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,+BAA+B,IAAI,+BAA+B;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,+BAA+B,IAAI,+BAA+B;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,+BAA+B,IAAI,+BAA+B,IAAI,SAAS;AACpG,qBAAqB,+BAA+B,IAAI,+BAA+B;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA,6EAA6E,0BAA0B;AACvG;AACA;AACA;AACA;AACA;AACA,8DAA8D,SAAS;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD,yBAAyB,iCAAiC;AAC1D;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yC;;;;;;ACrMA;AACA,eAAe,KAAiD,oBAAoB,CAAiH,CAAC,oBAAoB,YAAY,OAAO,cAAc,aAAa,sCAAsC,SAAS,iBAAiB,yCAAyC,6BAA6B,gBAAgB,EAAE,0FAA0F,oBAAoB,gBAAgB,WAAW,sBAAsB,uBAAuB,IAAI,iCAAiC,SAAS,kBAAkB,sBAAsB,uBAAuB,IAAI,wCAAwC,SAAS,UAAU,uBAAuB,IAAI,KAAK,4BAA4B,qCAAqC,0CAA0C,kMAAkM,oBAAoB,eAAe,0HAA0H,cAAc,qBAAqB,QAAQ,0CAA0C,2BAA2B,uBAAuB,IAAI,KAAK,qBAAqB,qBAAqB,YAAY,OAAO,0DAA0D,UAAU,iCAAiC,kCAAkC,8BAA8B,SAAS,gBAAgB,mCAAmC,IAAI,oFAAoF,mBAAmB,gEAAgE,cAAc,gCAAgC,2BAA2B,oDAAoD,mCAAmC,IAAI,yJAAyJ,uCAAuC,SAAS,uBAAuB,kEAAkE,gDAAgD,4CAA4C,aAAa,8HAA8H,mBAAmB,0EAA0E,mBAAmB,2EAA2E,YAAY,wGAAwG,QAAQ,4BAA4B,cAAc,2BAA2B,IAAI,mCAAmC,SAAS,gCAAgC,mBAAmB,6EAA6E,4BAA4B,UAAU,yCAAyC,UAAU,eAAe,aAAa,sCAAsC,SAAS,iBAAiB,yCAAyC,QAAQ,gBAAgB,EAAE,qtBAAqtB,gBAAgB,wBAAwB,iBAAiB,yBAAyB,cAAc,oEAAoE,+DAA+D,gGAAgG,YAAY,mBAAmB,mCAAmC,IAAI,mDAAmD,UAAU,wCAAwC,cAAc,qBAAqB,UAAU,wFAAwF,YAAY,IAAI,KAAK,aAAa,4NAA4N,oBAAoB,eAAe,qGAAqG,QAAQ,2BAA2B,uBAAuB,IAAI,KAAK,qBAAqB,qBAAqB,YAAY,OAAO,0DAA0D,UAAU,wDAAwD,iBAAiB,iBAAiB,gBAAgB,mCAAmC,IAAI,gGAAgG,qBAAqB,mCAAmC,IAAI,2CAA2C,uCAAuC,4CAA4C,0BAA0B,yCAAyC,8BAA8B,wCAAwC,MAAM,8BAA8B,uBAAuB,kCAAkC,kBAAkB,+DAA+D,yCAAyC,wBAAwB,UAAU,uBAAuB,IAAI,KAAK,aAAa,8CAA8C,QAAQ,YAAY,iBAAiB,8BAA8B,sBAAsB,kEAAkE,yCAAyC,wBAAwB,uBAAuB,IAAI,KAAK,aAAa,+BAA+B,+BAA+B,4DAA4D,0BAA0B,qFAAqF,UAAU,YAAY,aAAa,sCAAsC,SAAS,sBAAsB,QAAQ,mBAAmB,eAAe,MAAM,wJAAwJ,eAAe,QAAQ,4CAA4C,WAAW,kBAAkB,eAAe,MAAM,gDAAgD,WAAW,8BAA8B,mBAAmB,qFAAqF,eAAe,aAAa,sCAAsC,SAAS,sOAAsO,mFAAmF,kBAAkB,uBAAuB,iBAAiB,eAAe,yBAAyB,qBAAqB,yBAAyB,qBAAqB,wBAAwB,kBAAkB,+CAA+C,mCAAmC,SAAS,2BAA2B,yCAAyC,2DAA2D,WAAW,gBAAgB,4BAA4B,qBAAqB,6DAA6D,uBAAuB,gBAAgB,uCAAuC,QAAQ,8BAA8B,oBAAoB,8CAA8C,oBAAoB,IAAI,eAAe,wCAAwC,gBAAgB,qDAAqD,YAAY,IAAI,UAAU,gBAAgB,sCAAsC,OAAO,qCAAqC,4BAA4B,YAAY,IAAI,mCAAmC,SAAS,+BAA+B,aAAa,kBAAkB,oBAAoB,8BAA8B,KAAK,WAAW,6DAA6D,kBAAkB,0FAA0F,IAAI,yCAAyC,0BAA0B,sGAAsG,EAAE,YAAY,uBAAuB,8CAA8C,2CAA2C,sCAAsC,8CAA8C,gCAAgC,gDAAgD,8BAA8B,0BAA0B,4CAA4C,sCAAsC,8CAA8C,gCAAgC,gDAAgD,+BAA+B,uBAAuB,8CAA8C,sCAAsC,gBAAgB,gCAAgC,oCAAoC,+BAA+B,SAAS,oEAAoE,iFAAiF,iBAAiB,iBAAiB,YAAY,IAAI,gBAAgB,4BAA4B,gBAAgB,IAAI,yEAAyE,SAAS,8BAA8B,qBAAqB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,gkBAAgkB,aAAa,gCAAgC,6BAA6B,eAAe,mCAAmC,6BAA6B,gBAAgB,2CAA2C,6BAA6B,wBAAwB,uCAAuC,6BAA6B,oBAAoB,uCAAuC,6BAA6B,oBAAoB,iCAAiC,6BAA6B,cAAc,mCAAmC,6BAA6B,gBAAgB,oCAAoC,6BAA6B,iBAAiB,iDAAiD,6BAA6B,8BAA8B,kDAAkD,6BAA6B,+BAA+B,oDAAoD,6BAA6B,iCAAiC,yCAAyC,6BAA6B,sBAAsB,2DAA2D,6BAA6B,wCAAwC,sDAAsD,6BAA6B,mCAAmC,EAAE,aAAa,gCAAgC,6BAA6B,kBAAkB,EAAE,aAAa,+BAA+B,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,EAAE,aAAa,aAAa,sCAAsC,SAAS,EAAE,wBAAwB,eAAe,qBAAqB,2EAA2E,eAAe,oBAAoB,mCAAmC,qMAAqM,uBAAuB,eAAe,uBAAuB,kBAAkB,qBAAqB,kBAAkB,oBAAoB,kBAAkB,8BAA8B,gDAAgD,mBAAmB,sDAAsD,mBAAmB,sDAAsD,mBAAmB,qFAAqF,mBAAmB,sBAAsB,eAAe,sBAAsB,gBAAgB,sBAAsB,mBAAmB,KAAK,OAAO,KAAK,gDAAgD,YAAY,eAAe,aAAa,sCAAsC,SAAS,oFAAoF,eAAe,wIAAwI,yJAAyJ,sBAAsB,0CAA0C,0BAA0B,+CAA+C,aAAa,aAAa,sCAAsC,SAAS,6HAA6H,YAAY,kBAAkB,eAAe,aAAa,sCAAsC,SAAS,yCAAyC,eAAe,MAAM,aAAa,kFAAkF,iCAAiC,eAAe,YAAY,qCAAqC,YAAY,gDAAgD,eAAe,wIAAwI,aAAa,uTAAuT,cAAc,uNAAuN,2BAA2B,eAAe,kDAAkD,WAAW,sCAAsC,oBAAoB,0CAA0C,mCAAmC,wBAAwB,6IAA6I,uBAAuB,IAAI,yCAAyC,SAAS,wBAAwB,mCAAmC,sCAAsC,uBAAuB,IAAI,mCAAmC,+BAA+B,oBAAoB,eAAe,aAAa,sCAAsC,SAAS,iBAAiB,eAAe,2BAA2B,cAAc,QAAQ,aAAa,iBAAiB,eAAe,iBAAiB,0BAA0B,8BAA8B,0CAA0C,mBAAmB,iBAAiB,qCAAqC,UAAU,eAAe,aAAa,sCAAsC,SAAS,kBAAkB,eAAe,2BAA2B,eAAe,UAAU,EAAE,wCAAwC,WAAW,iEAAiE,mBAAmB,kBAAkB,YAAY,IAAI,6JAA6J,2BAA2B,IAAI,wEAAwE,KAAK,oBAAoB,YAAY,IAAI,wEAAwE,UAAU,WAAW,aAAa,aAAa,sCAAsC,SAAS,uCAAuC,cAAc,aAAa,sCAAsC,SAAS,kBAAkB,eAAe,2BAA2B,eAAe,iBAAiB,EAAE,sCAAsC,WAAW,gFAAgF,WAAW,eAAe,aAAa,sCAAsC,SAAS,kBAAkB,iCAAiC,2BAA2B,gBAAgB,EAAE,8BAA8B,uDAAuD,8IAA8I,WAAW,4BAA4B,yCAAyC,qCAAqC,QAAQ,yBAAyB,IAAI,iDAAiD,SAAS,2BAA2B,0DAA0D,yBAAyB,uBAAuB,YAAY,kBAAkB,IAAI,wGAAwG,gEAAgE,WAAW,eAAe,aAAa,sCAAsC,SAAS,oBAAoB,eAAe,2BAA2B,gBAAgB,EAAE,oFAAoF,WAAW,2DAA2D,4BAA4B,iDAAiD,wCAAwC,6BAA6B,IAAI,UAAU,kBAAkB,SAAS,6BAA6B,IAAI,iCAAiC,+QAA+Q,OAAO,2CAA2C,qCAAqC,2CAA2C,+BAA+B,mJAAmJ,MAAM,gHAAgH,gEAAgE,4BAA4B,6BAA6B,6CAA6C,iBAAiB,uCAAuC,0DAA0D,0BAA0B,8CAA8C,iBAAiB,aAAa,eAAe,aAAa,sCAAsC,SAAS,qBAAqB,eAAe,2BAA2B,gBAAgB,EAAE,mEAAmE,WAAW,mBAAmB,QAAQ,6BAA6B,IAAI,uBAAuB,SAAS,yBAAyB,iDAAiD,YAAY,IAAI,kCAAkC,KAAK,4DAA4D,gDAAgD,uEAAuE,cAAc,eAAe,aAAa,sCAAsC,SAAS,qBAAqB,uEAAuE,uHAAuH,cAAc,eAAe,aAAa,sCAAsC,SAAS,iBAAiB,gCAAgC,4BAA4B,eAAe,qTAAqT,WAAW,8DAA8D,kBAAkB,4EAA4E,QAAQ,0EAA0E,mBAAmB,iJAAiJ,oBAAoB,6LAA6L,mBAAmB,yDAAyD,gBAAgB,eAAe,6CAA6C,gEAAgE,2EAA2E,wDAAwD,MAAM,2DAA2D,uBAAuB,IAAI,KAAK,SAAS,QAAQ,6CAA6C,yBAAyB,cAAc,IAAI,6BAA6B,SAAS,MAAM,4DAA4D,YAAY,0JAA0J,UAAU,eAAe,aAAa,sCAAsC,SAAS,qBAAqB,oJAAoJ,6BAA6B,gBAAgB,EAAE,+DAA+D,qCAAqC,aAAa,kUAAkU,udAAud,WAAW,mBAAmB,ieAAie,kBAAkB,gDAAgD,eAAe,oBAAoB,qEAAqE,kBAAkB,2JAA2J,uBAAuB,8LAA8L,gDAAgD,4CAA4C,qBAAqB,QAAQ,oCAAoC,8EAA8E,qTAAqT,UAAU,cAAc,yDAAyD,QAAQ,WAAW,QAAQ,8KAA8K,YAAY,IAAI,gBAAgB,IAAI,SAAS,wJAAwJ,sEAAsE,+BAA+B,wjBAAwjB,MAAM,UAAU,oGAAoG,MAAM,iFAAiF,mLAAmL,sJAAsJ,6kBAA6kB,mEAAmE,kFAAkF,oBAAoB,YAAY,IAAI,MAAM,wBAAwB,wPAAwP,qBAAqB,wCAAwC,2BAA2B,qFAAqF,SAAS,sCAAsC,8EAA8E,iEAAiE,2BAA2B,IAAI,2CAA2C,iBAAiB,cAAc,qBAAqB,qBAAqB,MAAM,6CAA6C,oEAAoE,YAAY,mBAAmB,mBAAmB,0BAA0B,8BAA8B,8BAA8B,mBAAmB,KAAK,kBAAkB,gBAAgB,SAAS,UAAU,+EAA+E,IAAI,KAAK,8BAA8B,GAAG,oHAAoH,oBAAoB,kCAAkC,OAAO,YAAY,kEAAkE,yBAAyB,MAAM,0BAA0B,oBAAoB,kFAAkF,yBAAyB,6BAA6B,sIAAsI,EAAE,eAAe,aAAa,sCAAsC,SAAS,uBAAuB,wBAAwB,iCAAiC,gBAAgB,EAAE,QAAQ,2dAA2d,WAAW,sDAAsD,kBAAkB,6DAA6D,uBAAuB,+CAA+C,cAAc,2KAA2K,uBAAuB,IAAI,qEAAqE,8EAA8E,kBAAkB,wGAAwG,oBAAoB,+IAA+I,YAAY,gEAAgE,eAAe,sBAAsB,qBAAqB,EAAE,kBAAkB,gCAAgC,EAAE,qDAAqD,gBAAgB,eAAe,aAAa,sCAAsC,SAAS,uBAAuB,eAAe,wBAAwB,eAAe,mLAAmL,uBAAuB,0DAA0D,WAAW,+DAA+D,kBAAkB,6EAA6E,oBAAoB,iNAAiN,gBAAgB,oBAAoB,mBAAmB,yBAAyB,aAAa,0BAA0B,cAAc,mBAAmB,oBAAoB,iEAAiE,YAAY,IAAI,KAAK,SAAS,wCAAwC,qEAAqE,kCAAkC,uBAAuB,IAAI,qCAAqC,yBAAyB,gBAAgB,eAAe,SAAS,gEAAgE,2EAA2E,wDAAwD,MAAM,yDAAyD,SAAS,0BAA0B,qCAAqC,uBAAuB,IAAI,mDAAmD,IAAI,KAAK,sBAAsB,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,aAAa,4BAA4B,mDAAmD,yBAAyB,cAAc,KAAK,uBAAuB,kBAAkB,QAAQ,YAAY,IAAI,YAAY,SAAS,2BAA2B,OAAO,gCAAgC,4BAA4B,gBAAgB,eAAe,aAAa,sCAAsC,SAAS,qBAAqB,0CAA0C,iCAAiC,gBAAgB,OAAO,8IAA8I,gDAAgD,+GAA+G,eAAe,4DAA4D,2CAA2C,IAAI,wEAAwE,SAAS,WAAW,0CAA0C,kBAAkB,qLAAqL,uBAAuB,uGAAuG,aAAa,SAAS,4BAA4B,MAAM,GAAG,yCAAyC,KAAK,qCAAqC,KAAK,MAAM,qBAAqB,6BAA6B,4BAA4B,mBAAmB,gEAAgE,oIAAoI,MAAM,QAAQ,0DAA0D,qCAAqC,oBAAoB,mOAAmO,sBAAsB,MAAM,sBAAsB,wIAAwI,mCAAmC,mCAAmC,gBAAgB,IAAI,UAAU,0CAA0C,mCAAmC,eAAe,sBAAsB,iEAAiE,uBAAuB,IAAI,qEAAqE,oEAAoE,WAAW,gBAAgB,+RAA+R,0FAA0F,2BAA2B,OAAO,oCAAoC,YAAY,uBAAuB,oBAAoB,kBAAkB,gCAAgC,EAAE,qDAAqD,+BAA+B,eAAe,aAAa,sCAAsC,SAAS,0BAA0B,0CAA0C,4BAA4B,gBAAgB,EAAE,MAAM,mNAAmN,6EAA6E,WAAW,iEAAiE,2BAA2B,sQAAsQ,oBAAoB,oCAAoC,QAAQ,sEAAsE,uBAAuB,IAAI,0EAA0E,SAAS,mBAAmB,+CAA+C,gBAAgB,SAAS,gEAAgE,2EAA2E,wDAAwD,MAAM,2DAA2D,2BAA2B,WAAW,oBAAoB,aAAa,gBAAgB,mBAAmB,eAAe,aAAa,sCAAsC,SAAS,0BAA0B,eAAe,wBAAwB,eAAe,kSAAkS,uBAAuB,6DAA6D,WAAW,8JAA8J,kBAAkB,uHAAuH,oBAAoB,8KAA8K,gBAAgB,uJAAuJ,OAAO,gCAAgC,iCAAiC,SAAS,kBAAkB,mBAAmB,sBAAsB,iDAAiD,QAAQ,YAAY,YAAY,gHAAgH,YAAY,IAAI,6BAA6B,YAAY,IAAI,KAAK,gFAAgF,mBAAmB,IAAI,SAAS,GAAG,8CAA8C,2BAA2B,aAAa,sFAAsF,2DAA2D,gBAAgB,IAAI,MAAM,0BAA0B,wBAAwB,gBAAgB,4BAA4B,gBAAgB,eAAe,SAAS,wBAAwB,mGAAmG,gEAAgE,2EAA2E,wDAAwD,MAAM,yDAAyD,YAAY,gCAAgC,iCAAiC,qCAAqC,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,gCAAgC,gCAAgC,IAAI,iBAAiB,mDAAmD,yBAAyB,cAAc,EAAE,QAAQ,oCAAoC,aAAa,MAAM,+EAA+E,YAAY,YAAY,IAAI,KAAK,sBAAsB,mBAAmB,IAAI,SAAS,sBAAsB,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,kCAAkC,2BAA2B,gBAAgB,IAAI,iBAAiB,mDAAmD,yBAAyB,cAAc,mCAAmC,uBAAuB,kBAAkB,QAAQ,YAAY,IAAI,YAAY,SAAS,2BAA2B,OAAO,gCAAgC,4BAA4B,mBAAmB,eAAe,aAAa,sCAAsC,SAAS,kBAAkB,wBAAwB,4BAA4B,gBAAgB,EAAE,uCAAuC,0BAA0B,wCAAwC,kDAAkD,qDAAqD,+GAA+G,WAAW,eAAe,aAAa,sCAAsC,SAAS,gBAAgB,wBAAwB,8BAA8B,gBAAgB,EAAE,mFAAmF,sBAAsB,WAAW,sBAAsB,uBAAuB,eAAe,YAAY,IAAI,WAAW,sBAAsB,6CAA6C,iBAAiB,oBAAoB,0DAA0D,6BAA6B,8CAA8C,gBAAgB,wCAAwC,yBAAyB,IAAI,MAAM,kBAAkB,sJAAsJ,OAAO,yBAAyB,qCAAqC,yBAAyB,+BAA+B,mJAAmJ,6BAA6B,6BAA6B,eAAe,aAAa,sCAAsC,SAAS,qBAAqB,wBAAwB,4BAA4B,gBAAgB,EAAE,iLAAiL,0BAA0B,sIAAsI,mCAAmC,iJAAiJ,8GAA8G,sBAAsB,iIAAiI,cAAc,eAAe,aAAa,sCAAsC,SAAS,mBAAmB,wBAAwB,4BAA4B,gBAAgB,EAAE,sJAAsJ,kHAAkH,+GAA+G,YAAY,eAAe,aAAa,sCAAsC,SAAS,gBAAgB,wBAAwB,8BAA8B,gBAAgB,EAAE,uEAAuE,wCAAwC,eAAe,aAAa,sCAAsC,SAAS,gBAAgB,wBAAwB,4BAA4B,gBAAgB,EAAE,QAAQ,2LAA2L,qFAAqF,4HAA4H,mBAAmB,YAAY,mCAAmC,qDAAqD,8GAA8G,sBAAsB,kFAAkF,+BAA+B,qBAAqB,kBAAkB,sEAAsE,SAAS,cAAc,aAAa,sCAAsC,SAAS,kBAAkB,wBAAwB,4BAA4B,gBAAgB,EAAE,UAAU,sUAAsU,2HAA2H,6EAA6E,sCAAsC,YAAY,0BAA0B,qDAAqD,8GAA8G,sBAAsB,kHAAkH,8BAA8B,UAAU,sCAAsC,wCAAwC,sCAAsC,qCAAqC,qDAAqD,aAAa,oBAAoB,yGAAyG,eAAe,aAAa,sCAAsC,SAAS,gBAAgB,wBAAwB,4BAA4B,gBAAgB,EAAE,6LAA6L,6CAA6C,sEAAsE,qCAAqC,8GAA8G,sBAAsB,0JAA0J,SAAS,eAAe,aAAa,sCAAsC,SAAS,sBAAsB,wBAAwB,4BAA4B,gBAAgB,EAAE,gBAAgB,0YAA0Y,0BAA0B,wCAAwC,sCAAsC,YAAY,0IAA0I,qCAAqC,8GAA8G,sBAAsB,4MAA4M,eAAe,eAAe,aAAa,sCAAsC,SAAS,oBAAoB,wBAAwB,8BAA8B,gBAAgB,EAAE,2EAA2E,uCAAuC,oBAAoB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,kGAAkG,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,MAAM,sCAAsC,SAAS,sEAAsE,2CAA2C,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,MAAM,sCAAsC,SAAS,gEAAgE,iDAAiD,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,sCAAsC,SAAS,EAAE,eAAe,aAAa,cAAc,oHAAoH,EAAE,SAAS,cAAc,iGAAiG,EAAE,SAAS,cAAc,mXAAmX,EAAE,SAAS,cAAc,kYAAkY,EAAE,SAAS,cAAc,mgBAAmgB,EAAE,SAAS,cAAc,80BAA80B,EAAE,SAAS,cAAc,qrBAAqrB,EAAE,SAAS,cAAc,ykBAAykB,EAAE,SAAS,cAAc,wjBAAwjB,EAAE,SAAS,cAAc,kpBAAkpB,EAAE,SAAS,cAAc,+oBAA+oB,EAAE,+EAA+E,cAAc,IAAI,kBAAkB,cAAc,WAAW,gBAAgB,4DAA4D,aAAa,eAAe,wDAAwD,cAAc,eAAe,iDAAiD,gBAAgB,iDAAiD,cAAc,qCAAqC,oBAAoB,eAAe,qCAAqC,sBAAsB,qCAAqC,gBAAgB,UAAU,WAAW,iBAAiB,6CAA6C,SAAS,gBAAgB,0CAA0C,8DAA8D,gBAAgB,WAAW,gDAAgD,cAAc,2BAA2B,kBAAkB,4DAA4D,6DAA6D,kBAAkB,4DAA4D,+DAA+D,kBAAkB,8CAA8C,6CAA6C,gBAAgB,gCAAgC,sCAAsC,gBAAgB,2CAA2C,cAAc,qDAAqD,cAAc,uCAAuC,oBAAoB,sEAAsE,kBAAkB,qEAAqE,kBAAkB,qEAAqE,gBAAgB,0DAA0D,gBAAgB,4DAA4D,8NAA8N,kBAAkB,yDAAyD,oBAAoB,6EAA6E,mCAAmC,+BAA+B,IAAI,8BAA8B,oBAAoB,EAAE,YAAY,aAAa,eAAe,sEAAsE,cAAc,eAAe,qEAAqE,gBAAgB,qEAAqE,cAAc,mDAAmD,wBAAwB,eAAe,mDAAmD,0BAA0B,mDAAmD,gBAAgB,wDAAwD,gGAAgG,cAAc,2BAA2B,mBAAmB,wFAAwF,2FAA2F,mBAAmB,0EAA0E,6EAA6E,mBAAmB,4DAA4D,2DAA2D,mBAAmB,4DAA4D,mEAAmE,iBAAiB,gCAAgC,oDAAoD,iBAAiB,yDAAyD,iBAAiB,yDAAyD,eAAe,0EAA0E,eAAe,mDAAmD,mBAAmB,mGAAmG,mBAAmB,mGAAmG,mBAAmB,iFAAiF,qBAAqB,+GAA+G,iBAAiB,oFAAoF,iBAAiB,wFAAwF,0UAA0U,gBAAgB,cAAc,eAAe,2FAA2F,iBAAiB,oGAAoG,eAAe,eAAe,mGAAmG,iBAAiB,mGAAmG,+BAA+B,eAAe,wEAAwE,iCAAiC,wEAAwE,eAAe,wEAAwE,iBAAiB,UAAU,yBAAyB,mDAAmD,+FAA+F,SAAS,iBAAiB,gHAAgH,4JAA4J,iBAAiB,mEAAmE,8HAA8H,eAAe,mEAAmE,4CAA4C,mBAAmB,kIAAkI,kKAAkK,mBAAmB,iFAAiF,gGAAgG,mBAAmB,+FAA+F,4GAA4G,mBAAmB,kBAAkB,+GAA+G,iBAAiB,8EAA8E,iBAAiB,gCAAgC,yEAAyE,iBAAiB,8EAA8E,iBAAiB,0FAA0F,iBAAiB,wGAAwG,gGAAgG,iBAAiB,4QAA4Q,qNAAqN,mBAAmB,8EAA8E,eAAe,uGAAuG,eAAe,gEAAgE,mBAAmB,gJAAgJ,mBAAmB,gJAAgJ,mBAAmB,qHAAqH,qBAAqB,kKAAkK,iBAAiB,2HAA2H,iBAAiB,kIAAkI,4eAA4e,gBAAgB,cAAc,gBAAgB,kJAAkJ,eAAe,gBAAgB,qLAAqL,iBAAiB,qLAAqL,6CAA6C,gBAAgB,+HAA+H,+CAA+C,+HAA+H,eAAe,+HAA+H,iBAAiB,UAAU,+CAA+C,6GAA6G,iLAAiL,SAAS,iBAAiB,4QAA4Q,8WAA8W,iBAAiB,0HAA0H,urBAAurB,eAAe,0HAA0H,8HAA8H,mBAAmB,sJAAsJ,ybAAyb,mBAAmB,iDAAiD,qaAAqa,mBAAmB,yBAAyB,6MAA6M,qBAAqB,6FAA6F,4gBAA4gB,mBAAmB,0FAA0F,oNAAoN,mBAAmB,0FAA0F,oNAAoN,mBAAmB,wFAAwF,sNAAsN,iBAAiB,wIAAwI,iBAAiB,wIAAwI,mBAAmB,mDAAmD,iQAAiQ,iBAAiB,gCAAgC,gIAAgI,iBAAiB,gCAAgC,gIAAgI,iBAAiB,gCAAgC,gIAAgI,mBAAmB,wGAAwG,sKAAsK,iBAAiB,4FAA4F,uLAAuL,iBAAiB,0CAA0C,iBAAiB,oEAAoE,8EAA8E,iBAAiB,eAAe,QAAQ,6HAA6H,kUAAkU,qBAAqB,6HAA6H,0MAA0M,uBAAuB,wPAAwP,wLAAwL,iBAAiB,wGAAwG,uJAAuJ,2BAA2B,kCAAkC,gKAAgK,uBAAuB,wBAAwB,iMAAiM,qBAAqB,+KAA+K,iKAAiK,2BAA2B,kCAAkC,yJAAyJ,qBAAqB,uFAAuF,mcAAmc,qBAAqB,uFAAuF,qCAAqC,kCAAkC,mMAAmM,eAAe,mLAAmL,eAAe,yGAAyG,mBAAmB,2QAA2Q,mBAAmB,2QAA2Q,mBAAmB,qNAAqN,qBAAqB,2SAA2S,iBAAiB,kOAAkO,iBAAiB,gPAAgP,s2BAAs2B,gBAAgB,cAAc,eAAe,iDAAiD,eAAe,eAAe,uCAAuC,eAAe,yBAAyB,yBAAyB,mBAAmB,eAAe,8BAA8B,iBAAiB,uCAAuC,qBAAqB,8BAA8B,mBAAmB,sDAAsD,mBAAmB,sDAAsD,mBAAmB,sDAAsD,mBAAmB,sDAAsD,iBAAiB,wEAAwE,iBAAiB,2EAA2E,mBAAmB,oFAAoF,mBAAmB,oFAAoF,iBAAiB,2EAA2E,mBAAmB,6CAA6C,qBAAqB,4DAA4D,iBAAiB,wCAAwC,yBAAyB,iBAAiB,wCAAwC,mBAAmB,eAAe,yBAAyB,mBAAmB,iBAAiB,0CAA0C,iBAAiB,6CAA6C,iBAAiB,uCAAuC,qEAAqE,iBAAiB,qCAAqC,mBAAmB,8CAA8C,gDAAgD,qBAAqB,yBAAyB,+DAA+D,yBAAyB,0DAA0D,4GAA4G,yBAAyB,kDAAkD,4GAA4G,iBAAiB,OAAO,mDAAmD,wDAAwD,mBAAmB,uDAAuD,6HAA6H,mBAAmB,yBAAyB,uFAAuF,mBAAmB,uHAAuH,wEAAwE,qBAAqB,cAAc,2LAA2L,qBAAqB,cAAc,2LAA2L,qBAAqB,cAAc,2LAA2L,iBAAiB,6GAA6G,6CAA6C,eAAe,8BAA8B,eAAe,2CAA2C,iBAAiB,6CAA6C,iBAAiB,8CAA8C,wKAAwK,mFAAmF,QAAQ,gEAAgE,IAAI,0FAA0F,SAAS,EAAE,cAAc,eAAe,wDAAwD,eAAe,eAAe,iDAAiD,qBAAqB,eAAe,qCAAqC,iBAAiB,iDAAiD,uBAAuB,qCAAqC,mBAAmB,qEAAqE,mBAAmB,qEAAqE,mBAAmB,qEAAqE,mBAAmB,qEAAqE,iBAAiB,6FAA6F,iBAAiB,iGAAiG,mBAAmB,6GAA6G,mBAAmB,6GAA6G,iBAAiB,iGAAiG,mBAAmB,yDAAyD,qBAAqB,6EAA6E,iBAAiB,oDAAoD,2BAA2B,iBAAiB,oDAAoD,uBAAuB,eAAe,gCAAgC,2BAA2B,eAAe,gCAAgC,uBAAuB,iBAAiB,qDAAqD,iBAAiB,yDAAyD,iBAAiB,kDAAkD,qEAAqE,iBAAiB,+CAA+C,qBAAqB,oKAAoK,+EAA+E,qBAAqB,gCAAgC,iFAAiF,iBAAiB,gBAAgB,OAAO,GAAG,8BAA8B,YAAY,GAAG,8BAA8B,YAAY,yBAAyB,iDAAiD,mBAAmB,gCAAgC,mJAAmJ,mBAAmB,8GAA8G,2FAA2F,eAAe,qCAAqC,eAAe,qDAAqD,iBAAiB,0DAA0D,iBAAiB,4DAA4D,8NAA8N,4DAA4D,WAAW,6BAA6B,QAAQ,gEAAgE,IAAI,0GAA0G,UAAU,GAAG,cAAc,eAAe,wDAAwD,eAAe,qCAAqC,mBAAmB,MAAM,kBAAkB,8DAA8D,iBAAiB,wCAAwC,0EAA0E,iBAAiB,cAAc,0BAA0B,mBAAmB,4DAA4D,6FAA6F,mBAAmB,MAAM,4DAA4D,6DAA6D,mBAAmB,MAAM,4DAA4D,6DAA6D,mBAAmB,MAAM,4DAA4D,6DAA6D,iBAAiB,yBAAyB,sEAAsE,iBAAiB,+FAA+F,uDAAuD,iBAAiB,mFAAmF,sEAAsE,mBAAmB,mCAAmC,qBAAqB,sEAAsE,uMAAuM,eAAe,sDAAsD,6HAA6H,iBAAiB,4DAA4D,gDAAgD,iBAAiB,oDAAoD,iBAAiB,uBAAuB,kGAAkG,KAAK,QAAQ,sCAAsC,wBAAwB,4IAA4I,SAAS,qBAAqB,qBAAqB,eAAe,wFAAwF,6EAA6E,eAAe,qDAAqD,4KAA4K,cAAc,+LAA+L,4CAA4C,yDAAyD,gCAAgC,4HAA4H,EAAE,cAAc,eAAe,oFAAoF,eAAe,eAAe,yFAAyF,6BAA6B,eAAe,iEAAiE,2BAA2B,eAAe,4BAA4B,yBAAyB,8EAA8E,mBAAmB,8DAA8D,0GAA0G,iBAAiB,mFAAmF,iBAAiB,6EAA6E,iBAAiB,WAAW,QAAQ,eAAe,2BAA2B,iBAAiB,yFAAyF,eAAe,iEAAiE,+BAA+B,iEAAiE,UAAU,iBAAiB,iDAAiD,UAAU,iBAAiB,iDAAiD,iBAAiB,+DAA+D,oFAAoF,mBAAmB,0FAA0F,kHAAkH,mBAAmB,uIAAuI,mIAAmI,mBAAmB,uIAAuI,mIAAmI,mBAAmB,uIAAuI,mIAAmI,mBAAmB,4DAA4D,6MAA6M,mBAAmB,4DAA4D,6MAA6M,qBAAqB,gCAAgC,iCAAiC,MAAM,6FAA6F,oFAAoF,gCAAgC,6FAA6F,mBAAmB,iIAAiI,mBAAmB,oHAAoH,iPAAiP,UAAU,mBAAmB,yGAAyG,UAAU,qBAAqB,UAAU,mLAAmL,iBAAiB,YAAY,+GAA+G,iBAAiB,+FAA+F,4BAA4B,iBAAiB,YAAY,QAAQ,eAAe,sFAAsF,wFAAwF,SAAS,eAAe,8FAA8F,iBAAiB,8GAA8G,iBAAiB,oHAAoH,sbAAsb,cAAc,eAAe,0CAA0C,eAAe,eAAe,6BAA6B,iBAAiB,eAAe,uBAAuB,iBAAiB,6BAA6B,mBAAmB,uBAAuB,mBAAmB,uCAAuC,mBAAmB,uCAAuC,mBAAmB,uCAAuC,mBAAmB,uCAAuC,iBAAiB,mDAAmD,iBAAiB,qDAAqD,mBAAmB,2DAA2D,mBAAmB,2DAA2D,iBAAiB,qDAAqD,mBAAmB,iCAAiC,qBAAqB,2CAA2C,iBAAiB,4BAA4B,uBAAuB,iBAAiB,4BAA4B,eAAe,eAAe,kBAAkB,uBAAuB,eAAe,kBAAkB,eAAe,iBAAiB,+BAA+B,iBAAiB,iCAAiC,iBAAiB,4BAA4B,yDAAyD,iBAAiB,2BAA2B,mBAAmB,0BAA0B,4BAA4B,qBAAqB,kBAAkB,6CAA6C,iBAAiB,OAAO,oBAAoB,+CAA+C,mBAAmB,kBAAkB,+CAA+C,mBAAmB,kBAAkB,yDAAyD,mBAAmB,kBAAkB,yDAAyD,mBAAmB,kBAAkB,2DAA2D,qBAAqB,wDAAwD,6CAA6C,iBAAiB,yFAAyF,6CAA6C,eAAe,uBAAuB,eAAe,iCAAiC,iBAAiB,gCAAgC,iBAAiB,gCAAgC,kHAAkH,4DAA4D,WAAW,6BAA6B,QAAQ,gEAAgE,IAAI,0DAA0D,UAAU,GAAG,cAAc,MAAM,YAAY,aAAa,gGAAgG,cAAc,MAAM,sCAAsC,0BAA0B,2BAA2B,YAAY,mBAAmB,iGAAiG,yBAAyB,yCAAyC,4BAA4B,6FAA6F,YAAY,MAAM,iEAAiE,cAAc,4BAA4B,QAAQ,MAAM,WAAW,QAAQ,MAAM,KAAK,+BAA+B,iBAAiB,SAAS,aAAa,iBAAiB,mBAAmB,eAAe,YAAY,WAAW,KAAK,8CAA8C,6CAA6C,uCAAuC,aAAa,8cAA8c,0IAA0I,wBAAwB,qEAAqE,SAAS,kBAAkB,6BAA6B,iBAAiB,SAAS,sBAAsB,6BAA6B,iBAAiB,SAAS,sBAAsB,6BAA6B,kBAAkB,yBAAyB,8LAA8L,mLAAmL,8HAA8H,WAAW,KAAK,uBAAuB,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,oBAAoB,2BAA2B,2NAA2N,wEAAwE,2VAA2V,YAAY,KAAK,oCAAoC,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,4BAA4B,YAAY,KAAK,4CAA4C,uDAAuD,uBAAuB,mDAAmD,SAAS,4DAA4D,IAAI,MAAM,cAAc,WAAW,+BAA+B,YAAY,YAAY,oDAAoD,mBAAmB,+DAA+D,uBAAuB,EAAE,8DAA8D,4FAA4F,eAAe,wCAAwC,SAAS,EAAE,QAAQ,IAAI,G;;;;;;ACDr91G;AACA;AACA;AACA;AACA;;AAEA,cAAc;;AAEd;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,wCAAwC,SAAS;AACjD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,2BAA2B,UAAU;AACrC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,IAAI,IAA0C,EAAE,mCAAO,YAAY,iBAAiB,EAAE;AAAA,kGAAC;AACvF,KAAK,EAI2B;;AAEhC,CAAC;;;;;;;;AC1HY;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,cAAc,GAAG,aAAa;AAC9B;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,qC;;;;;;;ACZa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,GAAS;AAC9B,aAAa,mBAAO,CAAC,GAAe;AACpC,iC;;;;;;;ACda;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,mBAAmB;AACnB,gBAAgB,mBAAO,CAAC,GAAkB;AAC1C;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,KAAK;AACvC;AACA;AACA;AACA;AACA;AACA,qCAAqC,KAAK,YAAY,aAAa;AACnE;AACA,sCAAsC,KAAK,IAAI,+CAA+C;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,cAAc,IAAI;AAC9E,yCAAyC,YAAY,YAAY,aAAa,IAAI,oDAAoD;AACtI;AACA,qCAAqC,YAAY,GAAG,aAAa;AACjE;AACA,iCAAiC,WAAW;AAC5C,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA,6EAA6E,0BAA0B;AACvG;AACA;AACA;AACA,8EAA8E,wBAAwB;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,eAAe;AACpE;AACA,+DAA+D,cAAc,IAAI;AACjF;AACA,8BAA8B,kBAAkB,GAAG,4CAA4C;AAC/F,yCAAyC,EAAE,IAAI,oDAAoD;AACnG;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA,uC;;;;;;;ACnIa;AACb;AACA;AACA,kCAAkC,oCAAoC,aAAa,EAAE,EAAE;AACvF,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,CAAC,cAAc,EAAC;AAC7D,aAAa,mBAAO,CAAC,GAAS;AAC9B,aAAa,mBAAO,CAAC,GAAe;AACpC,aAAa,mBAAO,CAAC,GAAW;AAChC,iC;;;;;;;ACfa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,iC;;;;;;;ACFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6DAA6D;AAC5E;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,yBAAyB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,uC;;;;;;;ACzFa;AACb,8CAA6C,CAAC,cAAc,EAAC;AAC7D,kBAAkB,GAAG,4BAA4B;AACjD,sBAAsB,mBAAO,CAAC,GAAe;AAC7C;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,0CAA0C,IAAI;AAC9C;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,6BAA6B,IAAI;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,mC;;;;;;ACvGA;AACA,eAAe,KAAiD,oBAAoB,CAAqH,CAAC,oBAAoB,YAAY,OAAO,cAAc,aAAa,sCAAsC,SAAS,uBAAuB,8EAA8E,QAAQ,gBAAgB,uDAAuD,2BAA2B,wBAAwB,4BAA4B,mBAAmB,sBAAsB,8GAA8G,uDAAuD,kCAAkC,wBAAwB,gGAAgG,4BAA4B,mCAAmC,0BAA0B,WAAW,8BAA8B,2BAA2B,8DAA8D,EAAE,aAAa,4BAA4B,oBAAoB,6CAA6C,QAAQ,EAAE,6BAA6B,8CAA8C,gGAAgG,wBAAwB,6EAA6E,wQAAwQ,sEAAsE,mKAAmK,iJAAiJ,YAAY,WAAW,KAAK,0CAA0C,MAAM,yEAAyE,gIAAgI,QAAQ,iDAAiD,8CAA8C,EAAE,mCAAmC,qBAAqB,2BAA2B,0BAA0B,qBAAqB,MAAM,eAAe,KAAK,2CAA2C,yDAAyD,uBAAuB,2CAA2C,iDAAiD,gCAAgC,gBAAgB,sBAAsB,EAAE,8CAA8C,wBAAwB,wBAAwB,yDAAyD,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE,WAAW,IAAI,IAAI,IAAI,KAAK,IAAI,KAAK,EAAE,MAAM,qBAAqB,kCAAkC,iDAAiD,2DAA2D,gDAAgD,kBAAkB,4IAA4I,YAAY,uBAAuB,IAAI,KAAK,+BAA+B,MAAM,yCAAyC,4EAA4E,gBAAgB,uBAAuB,MAAM,kGAAkG,8BAA8B,WAAW,uBAAuB,IAAI,aAAa,gBAAgB,EAAE,yDAAyD,0BAA0B,wBAAwB,KAAK,yBAAyB,sDAAsD,2CAA2C,sHAAsH,sBAAsB,qEAAqE,QAAQ,YAAY,IAAI,MAAM,MAAM,QAAQ,cAAc,qCAAqC,uBAAuB,oDAAoD,oCAAoC,kBAAkB,8EAA8E,2BAA2B,kCAAkC,kBAAkB,kFAAkF,aAAa,SAAS,8BAA8B,GAAG,sDAAsD,0BAA0B,uCAAuC,8CAA8C,GAAG,GAAG,wBAAwB,kCAAkC,SAAS,uSAAuS,WAAW,sBAAsB,+DAA+D,8XAA8X,IAAI,2CAA2C,EAAE,aAAa,EAAE,+LAA+L,qBAAqB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,uBAAuB,eAAe,uCAAuC,6BAA6B,sBAAsB,8EAA8E,aAAa,aAAa,sCAAsC,SAAS,EAAE,aAAa,aAAa,sCAAsC,SAAS,2HAA2H,SAAS,SAAS,2KAA2K,kEAAkE,+MAA+M,iBAAiB,WAAW,IAAI,GAAG,EAAE,wBAAwB,EAAE,GAAG,EAAE,SAAS,IAAI,GAAG,IAAI,4BAA4B,EAAE,GAAG,EAAE,SAAS,MAAM,GAAG,IAAI,UAAU,IAAI,YAAY,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,MAAM,UAAU,IAAI,YAAY,EAAE,GAAG,EAAE,SAAS,IAAI,GAAG,EAAE,qBAAqB,aAAa,YAAY,gTAAgT,WAAW,IAAI,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,IAAI,MAAM,EAAE,GAAG,EAAE,SAAS,IAAI,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,IAAI,GAAG,EAAE,iBAAiB,oCAAoC,0BAA0B,GAAG,0BAA0B,IAAI,0BAA0B,GAAG,0BAA0B,yBAAyB,WAAW,KAAK,WAAW,uBAAuB,SAAS,4JAA4J,cAAc,EAAE,EAAE,GAAG,EAAE,4EAA4E,eAAe,eAAe,aAAa,cAAc,swCAAswC,EAAE,UAAU,MAAM,gBAAgB,4CAA4C,uFAAuF,IAAI,gCAAgC,cAAc,gBAAgB,cAAc,aAAa,gBAAgB,MAAM,sBAAsB,QAAQ,IAAI,oBAAoB,SAAS,gBAAgB,MAAM,sBAAsB,QAAQ,IAAI,0BAA0B,SAAS,cAAc,yBAAyB,cAAc,sDAAsD,uBAAuB,GAAG,cAAc,2CAA2C,0BAA0B,GAAG,cAAc,4CAA4C,oBAAoB,uGAAuG,kBAAkB,gBAAgB,iBAAiB,8GAA8G,uEAAuE,gDAAgD,SAAS,MAAM,yBAAyB,UAAU,oHAAoH,YAAY,OAAO,4DAA4D,yBAAyB,wEAAwE,oKAAoK,OAAO,qDAAqD,SAAS,mGAAmG,0BAA0B,wBAAwB,WAAW,aAAa,wCAAwC,aAAa,wCAAwC,gBAAgB,wCAAwC,aAAa,gBAAgB,SAAS,UAAU,yBAAyB,kBAAkB,uCAAuC,mBAAmB,2BAA2B,kCAAkC,2BAA2B,+EAA+E,mDAAmD,qEAAqE,gBAAgB,yCAAyC,cAAc,kBAAkB,6CAA6C,8DAA8D,2BAA2B,0FAA0F,QAAQ,gBAAgB,IAAI,4BAA4B,uEAAuE,cAAc,YAAY,UAAU,cAAc,uBAAuB,cAAc,8BAA8B,KAAK,qBAAqB,qCAAqC,gBAAgB,QAAQ,0CAA0C,KAAK,sCAAsC,cAAc,sBAAsB,sBAAsB,0GAA0G,SAAS,oBAAoB,gCAAgC,qBAAqB,iCAAiC,iBAAiB,0CAA0C,iBAAiB,0CAA0C,oBAAoB,wBAAwB,iDAAiD,qBAAqB,wBAAwB,qDAAqD,kBAAkB,6CAA6C,iBAAiB,+CAA+C,oBAAoB,kBAAkB,wBAAwB,mCAAmC,mBAAmB,kBAAkB,wBAAwB,qCAAqC,0BAA0B,iCAAiC,yBAAyB,iCAAiC,EAAE,4EAA4E,EAAE,UAAU,EAAE,UAAU,EAAE,kGAAkG,EAAE,aAAa,EAAE,oJAAoJ,QAAQ,iKAAiK,eAAe,iEAAiE,4BAA4B,iBAAiB,mBAAmB,IAAI,2BAA2B,SAAS,mBAAmB,kFAAkF,SAAS,mBAAmB,2BAA2B,qCAAqC,sBAAsB,qCAAqC,sBAAsB,sBAAsB,uBAAuB,yCAAyC,YAAY,yBAAyB,8EAA8E,aAAa,mBAAmB,yBAAyB,8DAA8D,WAAW,kBAAkB,WAAW,kEAAkE,0BAA0B,iBAAiB,wBAAwB,2BAA2B,aAAa,KAAK,uBAAuB,qBAAqB,kBAAkB,aAAa,wBAAwB,SAAS,mDAAmD,+FAA+F,mFAAmF,iBAAiB,8BAA8B,iBAAiB,kCAAkC,oBAAoB,oCAAoC,WAAW,qBAAqB,sHAAsH,uBAAuB,WAAW,mCAAmC,SAAS,mDAAmD,+BAA+B,wCAAwC,SAAS,4BAA4B,2GAA2G,aAAa,WAAW,uBAAuB,wEAAwE,KAAK,gDAAgD,mBAAmB,YAAY,mBAAmB,wCAAwC,kCAAkC,KAAK,uCAAuC,YAAY,mBAAmB,sCAAsC,EAAE,SAAS,kBAAkB,gBAAgB,kBAAkB,yDAAyD,gBAAgB,2EAA2E,+BAA+B,MAAM,4BAA4B,MAAM,kBAAkB,wCAAwC,2BAA2B,eAAe,2GAA2G,qBAAqB,iBAAiB,sCAAsC,2BAA2B,eAAe,wCAAwC,2BAA2B,cAAc,oCAAoC,qBAAqB,cAAc,4CAA4C,2BAA2B,eAAe,gBAAgB,qBAAqB,iDAAiD,eAAe,iDAAiD,OAAO,MAAM,eAAe,oEAAoE,+FAA+F,MAAM,MAAM,eAAe,wGAAwG,4IAA4I,8BAA8B,0EAA0E,4FAA4F,4BAA4B,EAAE,sGAAsG,mCAAmC,EAAE,6BAA6B,sBAAsB,qBAAqB,sCAAsC,cAAc,sCAAsC,cAAc,sCAAsC,cAAc,sCAAsC,cAAc,sCAAsC,eAAe,yCAAyC,EAAE,4BAA4B,4BAA4B,MAAM,sBAAsB,yCAAyC,2EAA2E,oBAAoB,gCAAgC,EAAE,KAAK,+EAA+E,sDAAsD,2IAA2I,YAAY,oBAAoB,gCAAgC,GAAG,MAAM,oBAAoB,4BAA4B,YAAY,qBAAqB,YAAY,qBAAqB,YAAY,qBAAqB,YAAY,qBAAqB,YAAY,sBAAsB,gBAAgB,IAAI,sBAAsB,MAAM,MAAM,YAAY,YAAY,kDAAkD,MAAM,MAAM,YAAY,mCAAmC,kCAAkC,gDAAgD,MAAM,kCAAkC,iDAAiD,IAAI,YAAY,MAAM,2CAA2C,IAAI,YAAY,MAAM,uBAAuB,MAAM,QAAQ,oBAAoB,oCAAoC,kEAAkE,yFAAyF,4NAA4N,iCAAiC,uBAAuB,IAAI,YAAY,MAAM,0DAA0D,6FAA6F,qBAAqB,wBAAwB,MAAM,gBAAgB,sGAAsG,qBAAqB,YAAY,MAAM,UAAU,MAAM,4BAA4B,MAAM,kBAAkB,QAAQ,qCAAqC,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,QAAQ,6BAA6B,aAAa,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,WAAW,oBAAoB,MAAM,MAAM,eAAe,kaAAka,2BAA2B,WAAW,MAAM,eAAe,aAAa,oBAAoB,MAAM,0CAA0C,SAAS,kBAAkB,gBAAgB,QAAQ,oBAAoB,UAAU,0BAA0B,cAAc,qBAAqB,YAAY,EAAE,SAAS,0DAA0D,UAAU,sBAAsB,aAAa,kCAAkC,cAAc,kCAAkC,MAAM,QAAQ,MAAM,2DAA2D,mBAAmB,+BAA+B,SAAS,kBAAkB,gBAAgB,2BAA2B,0xBAA0xB,OAAO,+FAA+F,oBAAoB,OAAO,2CAA2C,uBAAuB,wEAAwE,6BAA6B,0HAA0H,6CAA6C,cAAc,mCAAmC,eAAe,oBAAoB,4DAA4D,QAAQ,oBAAoB,mBAAmB,mNAAmN,OAAO,oLAAoL,UAAU,qBAAqB,kBAAkB,sGAAsG,UAAU,+BAA+B,WAAW,4FAA4F,QAAQ,oCAAoC,gbAAgb,UAAU,+BAA+B,WAAW,sEAAsE,6CAA6C,0DAA0D,kEAAkE,aAAa,kCAAkC,cAAc,oCAAoC,sCAAsC,YAAY,iCAAiC,aAAa,oCAAoC,sCAAsC,cAAc,mCAAmC,mBAAmB,OAAO,mCAAmC,wBAAwB,MAAM,0HAA0H,eAAe,yCAAyC,sBAAsB,oCAAoC,MAAM,wBAAwB,MAAM,0FAA0F,aAAa,kCAAkC,kBAAkB,MAAM,wBAAwB,MAAM,uDAAuD,cAAc,wCAAwC,qBAAqB,kDAAkD,mCAAmC,sBAAsB,MAAM,kGAAkG,aAAa,0BAA0B,aAAa,0BAA0B,UAAU,kDAAkD,WAAW,kFAAkF,aAAa,uDAAuD,gCAAgC,QAAQ,yMAAyM,mCAAmC,yFAAyF,kBAAkB,iCAAiC,eAAe,oCAAoC,gBAAgB,sCAAsC,UAAU,OAAO,wDAAwD,cAAc,cAAc,sBAAsB,8GAA8G,4DAA4D,sBAAsB,UAAU,cAAc,kCAAkC,oDAAoD,sBAAsB,gBAAgB,eAAe,qCAAqC,eAAe,SAAS,kBAAkB,gBAAgB,YAAY,8EAA8E,QAAQ,2YAA2Y,WAAW,gBAAgB,SAAS,8IAA8I,uBAAuB,UAAU,6CAA6C,WAAW,wDAAwD,aAAa,+BAA+B,8BAA8B,yHAAyH,yFAAyF,wBAAwB,mBAAmB,MAAM,IAAI,kGAAkG,KAAK,aAAa,gBAAgB,sBAAsB,+EAA+E,SAAS,OAAO,MAAM,SAAS,GAAG,SAAS,iBAAiB,iFAAiF,WAAW,IAAI,iBAAiB,+BAA+B,0PAA0P,gEAAgE,oBAAoB,UAAU,0EAA0E,oCAAoC,iBAAiB,GAAG,yBAAyB,cAAc,uBAAuB,uBAAuB,gDAAgD,+BAA+B,QAAQ,aAAa,0FAA0F,WAAW,8CAA8C,EAAE,0CAA0C,iBAAiB,iEAAiE,YAAY,IAAI,sBAAsB,qEAAqE,yBAAyB,QAAQ,aAAa,SAAS,YAAY,eAAe,yBAAyB,kDAAkD,WAAW,eAAe,0BAA0B,eAAe,yBAAyB,2CAA2C,EAAE,uBAAuB,4CAA4C,sGAAsG,+CAA+C,aAAa,oBAAoB,6DAA6D,GAAG,qBAAqB,6BAA6B,8GAA8G,gDAAgD,QAAQ,iGAAiG,cAAc,kBAAkB,yCAAyC,gBAAgB,gEAAgE,WAAW,SAAS,oCAAoC,aAAa,KAAK,mBAAmB,OAAO,GAAG,qBAAqB,cAAc,mEAAmE,4BAA4B,wBAAwB,mBAAmB,oBAAoB,gBAAgB,sBAAsB,iBAAiB,qCAAqC,eAAe,kBAAkB,gDAAgD,0BAA0B,YAAY,iCAAiC,iBAAiB,YAAY,iBAAiB,YAAY,SAAS,yBAAyB,YAAY,6BAA6B,wBAAwB,eAAe,oBAAoB,UAAU,8BAA8B,KAAK,0QAA0Q,QAAQ,6CAA6C,uBAAuB,kBAAkB,4BAA4B,QAAQ,kCAAkC,QAAQ,2EAA2E,YAAY,+DAA+D,UAAU,6CAA6C,QAAQ,qBAAqB,WAAW,sBAAsB,UAAU,WAAW,0BAA0B,SAAS,kBAAkB,gBAAgB,WAAW,4BAA4B,UAAU,oDAAoD,UAAU,yWAAyW,SAAS,oDAAoD,QAAQ,oDAAoD,SAAS,oDAAoD,UAAU,6BAA6B,SAAS,uBAAuB,WAAW,mGAAmG,UAAU,mBAAmB,YAAY,oBAAoB,iBAAiB,gEAAgE,SAAS,kOAAkO,WAAW,wBAAwB,WAAW,gDAAgD,YAAY,IAAI,QAAQ,KAAK,0BAA0B,4CAA4C,YAAY,YAAY,6EAA6E,UAAU,wBAAwB,QAAQ,mBAAmB,IAAI,0CAA0C,YAAY,aAAa,gCAAgC,QAAQ,+BAA+B,OAAO,kCAAkC,iBAAiB,iBAAiB,iBAAiB,iBAAiB,OAAO,wBAAwB,UAAU,uBAAuB,MAAM,+EAA+E,SAAS,0DAA0D,OAAO,8BAA8B,WAAW,+IAA+I,sBAAsB,UAAU,WAAW,kCAAkC,sCAAsC,GAAG,2DAA2D,8BAA8B,SAAS,SAAS,8BAA8B,WAAW,wBAAwB,SAAS,6DAA6D,iBAAiB,0CAA0C,WAAW,0FAA0F,kBAAkB,6BAA6B,oEAAoE,yBAAyB,SAAS,uBAAuB,WAAW,iBAAiB,SAAS,oCAAoC,QAAQ,sBAAsB,2BAA2B,sBAAsB,4BAA4B,iBAAiB,6BAA6B,sBAAsB,QAAQ,WAAW,wEAAwE,mCAAmC,WAAW,YAAY,gCAAgC,aAAa,0BAA0B,mBAAmB,0BAA0B,kDAAkD,MAAM,2CAA2C,aAAa,6DAA6D,cAAc,4BAA4B,IAAI,oCAAoC,sBAAsB,yCAAyC,MAAM,qBAAqB,YAAY,IAAI,wBAAwB,wFAAwF,SAAS,uEAAuE,EAAE,2EAA2E,8CAA8C,KAAK,uFAAuF,0UAA0U,YAAY,kBAAkB,uBAAuB,qBAAqB,sCAAsC,cAAc,oBAAoB,iBAAiB,sBAAsB,gHAAgH,EAAE,YAAY,wBAAwB,MAAM,gEAAgE,MAAM,kEAAkE,OAAO,oBAAoB,mBAAmB,WAAW,wBAAwB,QAAQ,wCAAwC,QAAQ,wCAAwC,iBAAiB,YAAY,UAAU,6BAA6B,UAAU,sBAAsB,uBAAuB,OAAO,eAAe,WAAW,KAAK,oGAAoG,EAAE,SAAS,aAAa,iCAAiC,wBAAwB,sBAAsB,OAAO,0BAA0B,mBAAmB,WAAW,uBAAuB,UAAU,oBAAoB,4DAA4D,SAAS,4BAA4B,iBAAiB,kKAAkK,KAAK,wBAAwB,KAAK,yBAAyB,MAAM,gBAAgB,sCAAsC,IAAI,4DAA4D,oBAAoB,SAAS,4CAA4C,gBAAgB,qBAAqB,aAAa,IAAI,GAAG,iBAAiB,kBAAkB,oDAAoD,4CAA4C,gBAAgB,oBAAoB,eAAe,6DAA6D,sBAAsB,oBAAoB,mDAAmD,qBAAqB,yDAAyD,gBAAgB,kCAAkC,sBAAsB,mDAAmD,+CAA+C,4BAA4B,yCAAyC,kBAAkB,UAAU,mJAAmJ,8BAA8B,uCAAuC,WAAW,MAAM,iBAAiB,kCAAkC,oFAAoF,0BAA0B,KAAK,oEAAoE,YAAY,2BAA2B,2BAA2B,6BAA6B,uEAAuE,wBAAwB,uBAAuB,mBAAmB,KAAK,wBAAwB,kEAAkE,iBAAiB,qBAAqB,qBAAqB,KAAK,uBAAuB,uBAAuB,kBAAkB,KAAK,yBAAyB,kEAAkE,kBAAkB,qBAAqB,sBAAsB,KAAK,yBAAyB,uBAAuB,gBAAgB,KAAK,wBAAwB,uBAAuB,eAAe,KAAK,oCAAoC,mEAAmE,gBAAgB,KAAK,qBAAqB,+BAA+B,cAAc,uBAAuB,+FAA+F,YAAY,kBAAkB,kCAAkC,qBAAqB,8CAA8C,0BAA0B,mBAAmB,uBAAuB,6BAA6B,YAAY,qMAAqM,2MAA2M,wBAAwB,8CAA8C,GAAG,IAAI,gBAAgB,uBAAuB,mCAAmC,sBAAsB,yEAAyE,4BAA4B,4CAA4C,qBAAqB,IAAI,mCAAmC,4EAA4E,UAAU,wBAAwB,wBAAwB,mDAAmD,mEAAmE,oBAAoB,oCAAoC,yBAAyB,gCAAgC,iCAAiC,sBAAsB,wBAAwB,sBAAsB,EAAE,+CAA+C,iCAAiC,EAAE,oBAAoB,kBAAkB,6BAA6B,sDAAsD,QAAQ,yCAAyC,+DAA+D,qCAAqC,kBAAkB,kBAAkB,oBAAoB,mBAAmB,qBAAqB,UAAU,YAAY,UAAU,aAAa,aAAa,qBAAqB,eAAe,yBAAyB,eAAe,yBAAyB,eAAe,wDAAwD,eAAe,wDAAwD,eAAe,yBAAyB,eAAe,yBAAyB,eAAe,wDAAwD,eAAe,wDAAwD,cAAc,QAAQ,qEAAqE,oBAAoB,mBAAmB,wBAAwB,UAAU,oBAAoB,0EAA0E,wBAAwB,6BAA6B,4CAA4C,GAAG,kBAAkB,oBAAoB,mDAAmD,SAAS,WAAW,wEAAwE,+BAA+B,kDAAkD,0BAA0B,iBAAiB,+DAA+D,0BAA0B,aAAa,0BAA0B,EAAE,iBAAiB,+DAA+D,0BAA0B,aAAa,0BAA0B,EAAE,iBAAiB,WAAW,8BAA8B,oBAAoB,iBAAiB,mDAAmD,YAAY,iEAAiE,OAAO,cAAc,UAAU,yCAAyC,WAAW,kBAAkB,UAAU,iEAAiE,MAAM,+BAA+B,YAAY,WAAW,eAAe,mCAAmC,OAAO,0BAA0B,qCAAqC,IAAI,mBAAmB,oBAAoB,mBAAmB,wBAAwB,YAAY,gEAAgE,OAAO,cAAc,UAAU,yCAAyC,WAAW,kBAAkB,UAAU,iEAAiE,MAAM,+BAA+B,GAAG,WAAW,cAAc,kCAAkC,OAAO,2BAA2B,wCAAwC,uDAAuD,EAAE,IAAI,kBAAkB,oBAAoB,mBAAmB,sBAAsB,UAAU,kBAAkB,2BAA2B,gCAAgC,wBAAwB,yLAAyL,sCAAsC,MAAM,gCAAgC,mBAAmB,8HAA8H,SAAS,MAAM,gBAAgB,WAAW,uBAAuB,4CAA4C,IAAI,gBAAgB,oBAAoB,OAAO,8BAA8B,iCAAiC,4EAA4E,uBAAuB,UAAU,oBAAoB,8DAA8D,KAAK,wCAAwC,YAAY,eAAe,WAAW,kHAAkH,uBAAuB,IAAI,2BAA2B,SAAS,UAAU,MAAM,oBAAoB,oBAAoB,KAAK,gHAAgH,YAAY,SAAS,OAAO,yDAAyD,WAAW,WAAW,0BAA0B,IAAI,8BAA8B,mBAAmB,aAAa,kCAAkC,cAAc,kCAAkC,sBAAsB,IAAI,EAAE,mBAAmB,sDAAsD,aAAa,QAAQ,2CAA2C,wDAAwD,eAAe,wDAAwD,mBAAmB,oBAAoB,6CAA6C,oBAAoB,oBAAoB,+CAA+C,oBAAoB,mBAAmB,qBAAqB,QAAQ,qFAAqF,UAAU,kDAAkD,cAAc,2CAA2C,oBAAoB,kCAAkC,UAAU,oBAAoB,gEAAgE,YAAY,WAAW,uBAAuB,wEAAwE,IAAI,eAAe,oBAAoB,mBAAmB,uBAAuB,UAAU,mCAAmC,UAAU,6BAA6B,SAAS,0CAA0C,WAAW,4BAA4B,UAAU,iEAAiE,SAAS,mCAAmC,iBAAiB,mBAAmB,yDAAyD,GAAG,WAAW,aAAa,iCAAiC,OAAO,0BAA0B,gGAAgG,GAAG,SAAS,gBAAgB,iBAAiB,6HAA6H,iBAAiB,UAAU,gBAAgB,SAAS,kBAAkB,gCAAgC,iBAAiB,6BAA6B,iBAAiB,+BAA+B,0BAA0B,mBAAmB,uIAAuI,2BAA2B,4BAA4B,QAAQ,gDAAgD,sBAAsB,iBAAiB,sFAAsF,SAAS,OAAO,UAAU,oBAAoB,uBAAuB,2BAA2B,YAAY,uDAAuD,oBAAoB,eAAe,uBAAuB,QAAQ,cAAc,cAAc,8BAA8B,cAAc,6HAA6H,wBAAwB,oBAAoB,uBAAuB,sCAAsC,cAAc,+BAA+B,mCAAmC,kBAAkB,qBAAqB,+DAA+D,0EAA0E,MAAM,0DAA0D,EAAE,oBAAoB,kCAAkC,sCAAsC,cAAc,+BAA+B,mCAAmC,kBAAkB,YAAY,0BAA0B,0CAA0C,qIAAqI,MAAM,mDAAmD,EAAE,UAAU,wCAAwC,KAAK,kBAAkB,+CAA+C,iBAAiB,yCAAyC,iBAAiB,2BAA2B,iBAAiB,2BAA2B,iBAAiB,6DAA6D,iBAAiB,mDAAmD,iBAAiB,mDAAmD,iBAAiB,yCAAyC,mBAAmB,6BAA6B,iBAAiB,mEAAmE,2BAA2B,wBAAwB,IAAI,0BAA0B,uBAAuB,yBAAyB,8BAA8B,4CAA4C,4BAA4B,IAAI,4BAA4B,qBAAqB,sBAAsB,eAAe,6EAA6E,iBAAiB,qBAAqB,mBAAmB,mBAAmB,KAAK,gDAAgD,gCAAgC,mDAAmD,iBAAiB,+CAA+C,qHAAqH,eAAe,kDAAkD,qBAAqB,0CAA0C,gCAAgC,eAAe,8BAA8B,4DAA4D,yBAAyB,eAAe,sCAAsC,oBAAoB,OAAO,mFAAmF,UAAU,oBAAoB,gEAAgE,KAAK,uRAAuR,YAAY,gBAAgB,4FAA4F,aAAa,SAAS,kIAAkI,KAAK,8BAA8B,oHAAoH,eAAe,uBAAuB,KAAK,0CAA0C,MAAM,KAAK,kCAAkC,KAAK,uBAAuB,aAAa,SAAS,0BAA0B,0BAA0B,KAAK,0BAA0B,kCAAkC,SAAS,0BAA0B,KAAK,+BAA+B,aAAa,SAAS,yCAAyC,iEAAiE,IAAI,UAAU,oBAAoB,QAAQ,mFAAmF,KAAK,8qBAA8qB,YAAY,WAAW,mBAAmB,SAAS,uBAAuB,IAAI,2NAA2N,aAAa,QAAQ,aAAa,iBAAiB,mLAAmL,SAAS,eAAe,kHAAkH,MAAM,aAAa,8DAA8D,8DAA8D,IAAI,OAAO,mEAAmE,YAAY,MAAM,QAAQ,yDAAyD,WAAW,oDAAoD,MAAM,qDAAqD,QAAQ,8CAA8C,QAAQ,6BAA6B,wBAAwB,+TAA+T,mBAAmB,MAAM,SAAS,kBAAkB,gBAAgB,QAAQ,mDAAmD,UAAU,mBAAmB,UAAU,mBAAmB,SAAS,kBAAkB,gBAAgB,QAAQ,6BAA6B,yGAAyG,yCAAyC,UAAU,aAAa,0FAA0F,aAAa,kFAAkF,2CAA2C,SAAS,kBAAkB,gBAAgB,SAAS,iCAAiC,IAAI,4BAA4B,kEAAkE,+BAA+B,YAAY,QAAQ,sEAAsE,QAAQ,WAAW,kBAAkB,yCAAyC,4BAA4B,qEAAqE,UAAU,mBAAmB,UAAU,UAAU,eAAe,KAAK,SAAS,EAAE,0DAA0D,wBAAwB,UAAU,oBAAoB,kBAAkB,yBAAyB,cAAc,MAAM,MAAM,iEAAiE,cAAc,0BAA0B,EAAE,oBAAoB,mBAAmB,qBAAqB,QAAQ,yDAAyD,QAAQ,+BAA+B,UAAU,iEAAiE,UAAU,6CAA6C,QAAQ,8FAA8F,UAAU,oBAAoB,0DAA0D,SAAS,iEAAiE,KAAK,wDAAwD,KAAK,yDAAyD,8BAA8B,WAAW,oBAAoB,wCAAwC,IAAI,eAAe,QAAQ,gCAAgC,8DAA8D,kBAAkB,+BAA+B,oBAAoB,kDAAkD,kBAAkB,mGAAmG,oBAAoB,oBAAoB,iEAAiE,oBAAoB,mBAAmB,yBAAyB,GAAG,WAAW,uBAAuB,wCAAwC,IAAI,oCAAoC,oBAAoB,mBAAmB,0BAA0B,GAAG,WAAW,wBAAwB,wCAAwC,IAAI,qCAAqC,oBAAoB,mBAAmB,sBAAsB,MAAM,YAAY,KAAK,WAAW,sBAAsB,kCAAkC,IAAI,eAAe,SAAS,cAAc,iCAAiC,QAAQ,sCAAsC,OAAO,oCAAoC,QAAQ,2BAA2B,6BAA6B,oGAAoG,UAAU,4JAA4J,QAAQ,oBAAoB,wHAAwH,UAAU,mIAAmI,wBAAwB,MAAM,EAAE,oFAAoF,cAAc,OAAO,+CAA+C,aAAa,EAAE,oFAAoF,cAAc,8BAA8B,oFAAoF,gBAAgB,6BAA6B,iBAAiB,+BAA+B,oBAAoB,iCAAiC,UAAU,WAAW,2BAA2B,KAAK,uEAAuE,EAAE,WAAW,yBAAyB,KAAK,6BAA6B,UAAU,WAAW,KAAK,wBAAwB,KAAK,kGAAkG,gBAAgB,sCAAsC,OAAO,4CAA4C,eAAe,iBAAiB,qCAAqC,oBAAoB,kBAAkB,wTAAwT,SAAS,wBAAwB,SAAS,6DAA6D,aAAa,2DAA2D,+BAA+B,uBAAuB,4DAA4D,wBAAwB,oBAAoB,kDAAkD,qBAAqB,uDAAuD,QAAQ,wCAAwC,WAAW,oDAAoD,OAAO,qDAAqD,WAAW,qBAAqB,iCAAiC,oBAAoB,0BAA0B,gBAAgB,wCAAwC,QAAQ,0BAA0B,+CAA+C,4CAA4C,+BAA+B,wBAAwB,qCAAqC,qBAAqB,KAAK,8EAA8E,iCAAiC,wBAAwB,gCAAgC,uBAAuB,qDAAqD,yLAAyL,QAAQ,+BAA+B,UAAU,0DAA0D,SAAS,gDAAgD,OAAO,iCAAiC,QAAQ,4DAA4D,cAAc,sCAAsC,0FAA0F,aAAa,qEAAqE,gBAAgB,gJAAgJ,cAAc,2BAA2B,6BAA6B,SAAS,sDAAsD,0IAA0I,+BAA+B,IAAI,EAAE,oCAAoC,iCAAiC,SAAS,mCAAmC,IAAI,KAAK,oCAAoC,QAAQ,2BAA2B,yJAAyJ,4JAA4J,GAAG,SAAS,qBAAqB,gGAAgG,EAAE,oBAAoB,eAAe,yRAAyR,0QAA0Q,uBAAuB,iBAAiB,kLAAkL,kDAAkD,UAAU,kDAAkD,kBAAkB,0CAA0C,SAAS,6BAA6B,eAAe,gDAAgD,6HAA6H,iBAAiB,mCAAmC,2BAA2B,8HAA8H,SAAS,yBAAyB,WAAW,0DAA0D,UAAU,0BAA0B,QAAQ,oCAAoC,WAAW,uEAAuE,SAAS,sBAAsB,YAAY,uJAAuJ,SAAS,kCAAkC,YAAY,mEAAmE,iCAAiC,+CAA+C,oBAAoB,WAAW,oDAAoD,YAAY,6FAA6F,MAAM,YAAY,oBAAoB,sFAAsF,iCAAiC,aAAa,mEAAmE,6CAA6C,6CAA6C,YAAY,mFAAmF,eAAe,yBAAyB,mFAAmF,oDAAoD,QAAQ,2DAA2D,WAAW,mDAAmD,gBAAgB,8GAA8G,iCAAiC,QAAQ,6BAA6B,6BAA6B,gEAAgE,qBAAqB,4FAA4F,qDAAqD,4BAA4B,iDAAiD,SAAS,kKAAkK,QAAQ,6BAA6B,qBAAqB,yBAAyB,YAAY,yDAAyD,aAAa,wBAAwB,kCAAkC,eAAe,2DAA2D,IAAI,KAAK,gEAAgE,iEAAiE,sBAAsB,qBAAqB,mDAAmD,sBAAsB,wBAAwB,aAAa,QAAQ,SAAS,iCAAiC,IAAI,KAAK,+CAA+C,8CAA8C,SAAS,oBAAoB,qBAAqB,yCAAyC,qDAAqD,kCAAkC,oJAAoJ,wBAAwB,sBAAsB,UAAU,QAAQ,SAAS,gCAAgC,wCAAwC,6BAA6B,WAAW,aAAa,6DAA6D,EAAE,mDAAmD,cAAc,sEAAsE,qHAAqH,SAAS,cAAc,4BAA4B,OAAO,mCAAmC,eAAe,kDAAkD,eAAe,iCAAiC,8GAA8G,UAAU,8BAA8B,gEAAgE,WAAW,2CAA2C,SAAS,uBAAuB,QAAQ,WAAW,YAAY,sBAAsB,KAAK,wBAAwB,oIAAoI,KAAK,kBAAkB,uBAAuB,2BAA2B,YAAY,UAAU,8BAA8B,2DAA2D,GAAG,SAAS,eAAe,6CAA6C,4FAA4F,YAAY,2BAA2B,iCAAiC,8CAA8C,sBAAsB,6FAA6F,eAAe,+GAA+G,kBAAkB,wFAAwF,QAAQ,UAAU,kCAAkC,UAAU,iCAAiC,kBAAkB,+CAA+C,MAAM,EAAE,QAAQ,sCAAsC,mDAAmD,8BAA8B,+BAA+B,eAAe,qDAAqD,eAAe,6DAA6D,MAAM,aAAa,0DAA0D,6BAA6B,iCAAiC,mCAAmC,mCAAmC,WAAW,6CAA6C,0CAA0C,8BAA8B,gCAAgC,eAAe,+CAA+C,iBAAiB,YAAY,wCAAwC,kBAAkB,yFAAyF,2BAA2B,uCAAuC,4CAA4C,cAAc,8BAA8B,gHAAgH,eAAe,yBAAyB,MAAM,QAAQ,gDAAgD,cAAc,kBAAkB,+BAA+B,MAAM,sCAAsC,0GAA0G,cAAc,sFAAsF,gBAAgB,+EAA+E,eAAe,iFAAiF,eAAe,qEAAqE,QAAQ,gCAAgC,MAAM,gCAAgC,SAAS,qCAAqC,SAAS,qCAAqC,YAAY,wBAAwB,wBAAwB,kDAAkD,oCAAoC,WAAW,8BAA8B,0CAA0C,eAAe,2CAA2C,eAAe,kBAAkB,mCAAmC,mBAAmB,sCAAsC,oCAAoC,8BAA8B,4BAA4B,eAAe,2CAA2C,mCAAmC,mBAAmB,sCAAsC,OAAO,iCAAiC,OAAO,iCAAiC,WAAW,sBAAsB,aAAa,wBAAwB,WAAW,MAAM,kHAAkH,UAAU,oCAAoC,WAAW,qCAAqC,eAAe,oDAAoD,2CAA2C,mEAAmE,8BAA8B,8BAA8B,eAAe,4CAA4C,wCAAwC,YAAY,sCAAsC,kBAAkB,oDAAoD,WAAW,sCAAsC,4DAA4D,2JAA2J,QAAQ,0BAA0B,iBAAiB,oBAAoB,mBAAmB,qCAAqC,OAAO,6FAA6F,SAAS,0IAA0I,YAAY,gCAAgC,sBAAsB,0EAA0E,kBAAkB,kBAAkB,wBAAwB,wDAAwD,OAAO,wCAAwC,GAAG,WAAW,qBAAqB,wBAAwB,IAAI,iBAAiB,oBAAoB,mBAAmB,wBAAwB,GAAG,WAAW,qBAAqB,wBAAwB,IAAI,iBAAiB,QAAQ,iCAAiC,8FAA8F,mBAAmB,yCAAyC,6BAA6B,uDAAuD,6BAA6B,uDAAuD,kCAAkC,0BAA0B,8BAA8B,yDAAyD,8BAA8B,yDAAyD,oCAAoC,4BAA4B,gBAAgB,wBAAwB,gBAAgB,wBAAwB,qBAAqB,wBAAwB,mBAAmB,8BAA8B,oBAAoB,mBAAmB,kFAAkF,WAAW,4EAA4E,WAAW,yDAAyD,aAAa,QAAQ,yBAAyB,uBAAuB,yFAAyF,sGAAsG,wBAAwB,YAAY,WAAW,+DAA+D,QAAQ,eAAe,6BAA6B,QAAQ,KAAK,uBAAuB,IAAI,iIAAiI,SAAS,iEAAiE,iDAAiD,IAAI,uBAAuB,iCAAiC,YAAY,WAAW,uBAAuB,gCAAgC,2BAA2B,iCAAiC,IAAI,eAAe,oBAAoB,mBAAmB,qCAAqC,MAAM,yBAAyB,MAAM,yBAAyB,UAAU,qBAAqB,sBAAsB,kCAAkC,qHAAqH,sCAAsC,QAAQ,sKAAsK,YAAY,OAAO,wBAAwB,eAAe,qDAAqD,GAAG,OAAO,uBAAuB,iCAAiC,gBAAgB,oBAAoB,mBAAmB,uBAAuB,UAAU,wBAAwB,MAAM,wBAAwB,MAAM,kBAAkB,QAAQ,yCAAyC,MAAM,yCAAyC,KAAK,WAAW,wBAAwB,0CAA0C,IAAI,iBAAiB,oBAAoB,mBAAmB,yBAAyB,SAAS,2CAA2C,WAAW,kBAAkB,UAAU,+CAA+C,GAAG,WAAW,mBAAmB,+BAA+B,GAAG,UAAU,UAAU,mCAAmC,aAAa,sDAAsD,mDAAmD,UAAU,qCAAqC,mBAAmB,oBAAoB,mBAAmB,+BAA+B,GAAG,WAAW,+BAA+B,kCAAkC,IAAI,wBAAwB,QAAQ,mCAAmC,wCAAwC,MAAM,IAAI,WAAW,SAAS,OAAO,2FAA2F,gBAAgB,QAAQ,gBAAgB,uBAAuB,gBAAgB,uBAAuB,kCAAkC,+CAA+C,sCAAsC,sBAAsB,uBAAuB,kCAAkC,4DAA4D,wCAAwC,iDAAiD,qBAAqB,QAAQ,iCAAiC,+CAA+C,6BAA6B,sCAAsC,6BAA6B,wCAAwC,oBAAoB,mBAAmB,mBAAmB,YAAY,WAAW,oBAAoB,wBAAwB,IAAI,YAAY,oBAAoB,mBAAmB,kBAAkB,UAAU,6BAA6B,MAAM,8BAA8B,YAAY,WAAW,oBAAoB,8BAA8B,GAAG,UAAU,SAAS,sBAAsB,kBAAkB,mBAAmB,2BAA2B,mBAAmB,qCAAqC,WAAW,oBAAoB,gFAAgF,UAAU,sBAAsB,uDAAuD,YAAY,oBAAoB,mBAAmB,qBAAqB,SAAS,2CAA2C,WAAW,kBAAkB,UAAU,0CAA0C,GAAG,WAAW,mBAAmB,+BAA+B,GAAG,UAAU,SAAS,8BAA8B,aAAa,sDAAsD,8CAA8C,UAAU,gCAAgC,eAAe,oBAAoB,mBAAmB,qBAAqB,UAAU,iDAAiD,4DAA4D,iKAAiK,GAAG,UAAU,qBAAqB,wCAAwC,eAAe,oBAAoB,mBAAmB,sBAAsB,cAAc,qCAAqC,aAAa,EAAE,+BAA+B,wBAAwB,EAAE,UAAU,kCAAkC,eAAe,eAAe,UAAU,EAAE,oCAAoC,EAAE,YAAY,IAAI,QAAQ,SAAS,WAAW,kCAAkC,iBAAiB,qCAAqC,gBAAgB,oBAAoB,mBAAmB,yBAAyB,QAAQ,qBAAqB,wBAAwB,QAAQ,qBAAqB,WAAW,uCAAuC,QAAQ,+BAA+B,GAAG,WAAW,0BAA0B,mDAAmD,GAAG,OAAO,yBAAyB,eAAe,MAAM,0EAA0E,uBAAuB,uBAAuB,mBAAmB,cAAc,iCAAiC,OAAO,oBAAoB,+EAA+E,aAAa,kFAAkF,8CAA8C,oBAAoB,mBAAmB,oBAAoB,SAAS,0CAA0C,GAAG,WAAW,qBAAqB,iCAAiC,IAAI,cAAc,WAAW,sWAAsW,aAAa,aAAa,sCAAsC,SAAS,qEAAqE,UAAU,iDAAiD,EAAE,4BAA4B,UAAU,qCAAqC,KAAK,qHAAqH,yCAAyC,4CAA4C,4BAA4B,qBAAqB,oDAAoD,QAAQ,eAAe,KAAK,YAAY,mCAAmC,2BAA2B,MAAM,mBAAmB,MAAM,mBAAmB,KAAK,6CAA6C,aAAa,aAAa,sCAAsC,SAAS,aAAa,0vFAA0vF,qBAAqB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,sCAAsC,eAAe,aAAa,sCAAsC,SAAS,6CAA6C,wBAAwB,cAAc,yCAAyC,gEAAgE,EAAE,mDAAmD,qDAAqD,mBAAmB,IAAI,aAAa,MAAM,aAAa,qBAAqB,8FAA8F,EAAE,0IAA0I,mEAAmE,qBAAqB,OAAO,qCAAqC,mCAAmC,aAAa,MAAM,mBAAmB,qCAAqC,OAAO,8CAA8C,qCAAqC,OAAO,+CAA+C,gBAAgB,aAAa,aAAa,sCAAsC,SAAS,EAAE,SAAS,MAAM,oBAAoB,YAAY,uBAAuB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,0iBAA0iB,YAAY,gCAAgC,6BAA6B,eAAe,mCAAmC,6BAA6B,gBAAgB,2CAA2C,6BAA6B,wBAAwB,uCAAuC,6BAA6B,oBAAoB,uCAAuC,6BAA6B,oBAAoB,iCAAiC,6BAA6B,cAAc,mCAAmC,6BAA6B,gBAAgB,oCAAoC,6BAA6B,iBAAiB,iDAAiD,6BAA6B,8BAA8B,kDAAkD,6BAA6B,+BAA+B,oDAAoD,6BAA6B,iCAAiC,yCAAyC,6BAA6B,sBAAsB,2DAA2D,6BAA6B,wCAAwC,sDAAsD,6BAA6B,mCAAmC,EAAE,YAAY,gCAAgC,6BAA6B,kBAAkB,EAAE,YAAY,+BAA+B,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,iCAAiC,6BAA6B,cAAc,EAAE,iBAAiB,aAAa,mEAAmE,6CAA6C,6BAA6B,aAAa,EAAE,mBAAmB,4BAA4B,2CAA2C,mFAAmF,sCAAsC,SAAS,kFAAkF,SAAS,aAAa,sCAAsC,SAAS,EAAE,SAAS,aAAa,sCAAsC,SAAS,EAAE,SAAS,aAAa,MAAM,sCAAsC,SAAS,sEAAsE,2CAA2C,SAAS,aAAa,sCAAsC,SAAS,EAAE,SAAS,aAAa,sCAAsC,SAAS,EAAE,SAAS,aAAa,MAAM,sCAAsC,SAAS,gEAAgE,iDAAiD,SAAS,aAAa,sCAAsC,SAAS,EAAE,SAAS,aAAa,sCAAsC,SAAS,EAAE,WAAW,aAAa,cAAc,oHAAoH,EAAE,oFAAoF,WAAW,aAAa,cAAc,iGAAiG,EAAE,+EAA+E,cAAc,IAAI,kBAAkB,cAAc,WAAW,gBAAgB,4DAA4D,mCAAmC,+BAA+B,IAAI,8BAA8B,oBAAoB,EAAE,WAAW,aAAa,cAAc,mXAAmX,EAAE,YAAY,aAAa,0BAA0B,mEAAmE,cAAc,0BAA0B,iDAAiD,gBAAgB,iDAAiD,cAAc,qCAAqC,oBAAoB,0BAA0B,qCAAqC,sBAAsB,qCAAqC,gBAAgB,UAAU,WAAW,iBAAiB,6CAA6C,SAAS,gBAAgB,0CAA0C,8DAA8D,gBAAgB,WAAW,gDAAgD,cAAc,2BAA2B,kBAAkB,4DAA4D,6DAA6D,kBAAkB,4DAA4D,+DAA+D,kBAAkB,8CAA8C,6CAA6C,gBAAgB,gCAAgC,sCAAsC,gBAAgB,2CAA2C,cAAc,qDAAqD,cAAc,uCAAuC,oBAAoB,sEAAsE,kBAAkB,qEAAqE,kBAAkB,qEAAqE,gBAAgB,0DAA0D,gBAAgB,4DAA4D,8PAA8P,kBAAkB,yDAAyD,oBAAoB,6EAA6E,YAAY,WAAW,aAAa,cAAc,iXAAiX,EAAE,YAAY,aAAa,0BAA0B,iFAAiF,cAAc,0BAA0B,qEAAqE,gBAAgB,qEAAqE,cAAc,mDAAmD,wBAAwB,0BAA0B,mDAAmD,0BAA0B,mDAAmD,gBAAgB,wDAAwD,gGAAgG,cAAc,2BAA2B,kBAAkB,wFAAwF,2FAA2F,kBAAkB,0EAA0E,6EAA6E,kBAAkB,4DAA4D,2DAA2D,kBAAkB,4DAA4D,mEAAmE,gBAAgB,gCAAgC,oDAAoD,gBAAgB,yDAAyD,gBAAgB,yDAAyD,cAAc,0EAA0E,cAAc,mDAAmD,kBAAkB,mGAAmG,kBAAkB,mGAAmG,kBAAkB,iFAAiF,oBAAoB,+GAA+G,gBAAgB,oFAAoF,gBAAgB,wFAAwF,0XAA0X,YAAY,WAAW,aAAa,cAAc,meAAme,EAAE,YAAY,aAAa,0BAA0B,sGAAsG,gBAAgB,oGAAoG,cAAc,0BAA0B,mGAAmG,gBAAgB,mGAAmG,8BAA8B,0BAA0B,wEAAwE,gCAAgC,wEAAwE,cAAc,wEAAwE,gBAAgB,UAAU,yBAAyB,mDAAmD,+FAA+F,SAAS,gBAAgB,gHAAgH,4JAA4J,gBAAgB,mEAAmE,8HAA8H,cAAc,mEAAmE,4CAA4C,kBAAkB,kIAAkI,kKAAkK,kBAAkB,iFAAiF,gGAAgG,kBAAkB,+FAA+F,4GAA4G,kBAAkB,kBAAkB,+GAA+G,gBAAgB,8EAA8E,gBAAgB,gCAAgC,yEAAyE,gBAAgB,8EAA8E,gBAAgB,0FAA0F,gBAAgB,wGAAwG,gGAAgG,gBAAgB,4QAA4Q,qNAAqN,kBAAkB,8EAA8E,cAAc,uGAAuG,cAAc,gEAAgE,kBAAkB,gJAAgJ,kBAAkB,gJAAgJ,kBAAkB,qHAAqH,oBAAoB,kKAAkK,gBAAgB,2HAA2H,gBAAgB,kIAAkI,ojBAAojB,YAAY,WAAW,aAAa,cAAc,+xBAA+xB,EAAE,YAAY,aAAa,2BAA2B,6JAA6J,cAAc,2BAA2B,qLAAqL,gBAAgB,qLAAqL,4CAA4C,2BAA2B,+HAA+H,8CAA8C,+HAA+H,cAAc,+HAA+H,gBAAgB,UAAU,+CAA+C,6GAA6G,iLAAiL,SAAS,gBAAgB,4QAA4Q,8WAA8W,gBAAgB,0HAA0H,urBAAurB,cAAc,0HAA0H,8HAA8H,kBAAkB,sJAAsJ,ybAAyb,kBAAkB,iDAAiD,qaAAqa,kBAAkB,yBAAyB,6MAA6M,oBAAoB,6FAA6F,ohBAAohB,kBAAkB,0FAA0F,oNAAoN,kBAAkB,0FAA0F,oNAAoN,kBAAkB,wFAAwF,sNAAsN,gBAAgB,wIAAwI,gBAAgB,wIAAwI,kBAAkB,mDAAmD,yQAAyQ,gBAAgB,gCAAgC,gIAAgI,gBAAgB,gCAAgC,gIAAgI,gBAAgB,gCAAgC,gIAAgI,kBAAkB,wGAAwG,sKAAsK,gBAAgB,uGAAuG,sLAAsL,gBAAgB,0CAA0C,gBAAgB,oEAAoE,8EAA8E,gBAAgB,0BAA0B,OAAO,6HAA6H,kUAAkU,oBAAoB,6HAA6H,0MAA0M,sBAAsB,wPAAwP,wLAAwL,gBAAgB,wGAAwG,uJAAuJ,0BAA0B,kCAAkC,gKAAgK,sBAAsB,wBAAwB,iMAAiM,oBAAoB,+KAA+K,iKAAiK,0BAA0B,kCAAkC,yJAAyJ,oBAAoB,uFAAuF,0dAA0d,oBAAoB,uFAAuF,qCAAqC,kCAAkC,mMAAmM,cAAc,mLAAmL,cAAc,yGAAyG,kBAAkB,2QAA2Q,kBAAkB,2QAA2Q,kBAAkB,qNAAqN,oBAAoB,2SAA2S,gBAAgB,kOAAkO,gBAAgB,gPAAgP,s+BAAs+B,YAAY,WAAW,aAAa,cAAc,ihBAAihB,EAAE,oCAAoC,aAAa,0BAA0B,mEAAmE,cAAc,qCAAqC,kBAAkB,MAAM,kBAAkB,8DAA8D,gBAAgB,wCAAwC,kFAAkF,gBAAgB,aAAa,0BAA0B,kBAAkB,4DAA4D,6FAA6F,kBAAkB,MAAM,4DAA4D,6DAA6D,kBAAkB,MAAM,4DAA4D,6DAA6D,kBAAkB,MAAM,4DAA4D,6DAA6D,gBAAgB,yBAAyB,sEAAsE,gBAAgB,+FAA+F,uDAAuD,gBAAgB,mFAAmF,sEAAsE,kBAAkB,gCAAgC,oBAAoB,sEAAsE,+MAA+M,cAAc,2EAA2E,6HAA6H,gBAAgB,4DAA4D,gDAAgD,gBAAgB,oDAAoD,gBAAgB,uBAAuB,kGAAkG,KAAK,QAAQ,sCAAsC,wBAAwB,4IAA4I,SAAS,oBAAoB,qBAAqB,eAAe,wFAAwF,6EAA6E,cAAc,qDAAqD,2PAA2P,iBAAiB,4MAA4M,uCAAuC,kDAAkD,oCAAoC,gHAAgH,EAAE,WAAW,aAAa,cAAc,giBAAgiB,EAAE,YAAY,aAAa,0BAA0B,mEAAmE,cAAc,0BAA0B,iDAAiD,oBAAoB,0BAA0B,qCAAqC,gBAAgB,iDAAiD,sBAAsB,qCAAqC,kBAAkB,qEAAqE,kBAAkB,qEAAqE,kBAAkB,qEAAqE,kBAAkB,qEAAqE,gBAAgB,6FAA6F,gBAAgB,iGAAiG,kBAAkB,6GAA6G,kBAAkB,6GAA6G,gBAAgB,iGAAiG,kBAAkB,yDAAyD,oBAAoB,6EAA6E,gBAAgB,oDAAoD,2BAA2B,gBAAgB,oDAAoD,uBAAuB,cAAc,gCAAgC,2BAA2B,cAAc,gCAAgC,uBAAuB,gBAAgB,qDAAqD,gBAAgB,yDAAyD,gBAAgB,kDAAkD,qEAAqE,gBAAgB,+CAA+C,oBAAoB,oKAAoK,+EAA+E,oBAAoB,gCAAgC,iFAAiF,gBAAgB,gBAAgB,OAAO,GAAG,4CAA4C,YAAY,GAAG,4CAA4C,YAAY,yBAAyB,iDAAiD,kBAAkB,gCAAgC,mJAAmJ,kBAAkB,8GAA8G,2FAA2F,cAAc,qCAAqC,cAAc,qDAAqD,gBAAgB,0DAA0D,gBAAgB,4DAA4D,8PAA8P,iEAAiE,QAAQ,gEAAgE,IAAI,0GAA0G,SAAS,EAAE,WAAW,aAAa,cAAc,qoBAAqoB,EAAE,YAAY,aAAa,0BAA0B,4DAA4D,cAAc,0BAA0B,uCAAuC,cAAc,yBAAyB,yBAAyB,kBAAkB,0BAA0B,8BAA8B,gBAAgB,uCAAuC,oBAAoB,8BAA8B,kBAAkB,sDAAsD,kBAAkB,sDAAsD,kBAAkB,sDAAsD,kBAAkB,sDAAsD,gBAAgB,wEAAwE,gBAAgB,2EAA2E,kBAAkB,oFAAoF,kBAAkB,oFAAoF,gBAAgB,2EAA2E,kBAAkB,6CAA6C,oBAAoB,4DAA4D,gBAAgB,wCAAwC,yBAAyB,gBAAgB,wCAAwC,mBAAmB,cAAc,yBAAyB,mBAAmB,gBAAgB,0CAA0C,gBAAgB,6CAA6C,gBAAgB,uCAAuC,qEAAqE,gBAAgB,qCAAqC,kBAAkB,8CAA8C,gDAAgD,oBAAoB,yBAAyB,+DAA+D,wBAAwB,0DAA0D,4GAA4G,wBAAwB,kDAAkD,4GAA4G,gBAAgB,OAAO,iEAAiE,wDAAwD,kBAAkB,uDAAuD,6HAA6H,kBAAkB,yBAAyB,uFAAuF,kBAAkB,uHAAuH,wEAAwE,oBAAoB,cAAc,2LAA2L,oBAAoB,cAAc,2LAA2L,oBAAoB,cAAc,2LAA2L,gBAAgB,4GAA4G,6CAA6C,cAAc,8BAA8B,cAAc,2CAA2C,gBAAgB,6CAA6C,gBAAgB,8CAA8C,gMAAgM,iEAAiE,QAAQ,gEAAgE,IAAI,kFAAkF,SAAS,EAAE,WAAW,aAAa,cAAc,2mBAA2mB,EAAE,4BAA4B,aAAa,0BAA0B,+FAA+F,cAAc,0BAA0B,yFAAyF,4BAA4B,0BAA0B,iEAAiE,0BAA0B,0BAA0B,4BAA4B,yBAAyB,8EAA8E,kBAAkB,8DAA8D,0GAA0G,gBAAgB,mFAAmF,gBAAgB,6EAA6E,gBAAgB,iBAAiB,mBAAmB,0BAA0B,wCAAwC,gBAAgB,yFAAyF,cAAc,iEAAiE,8BAA8B,iEAAiE,aAAa,gBAAgB,iDAAiD,aAAa,gBAAgB,iDAAiD,gBAAgB,+DAA+D,oFAAoF,kBAAkB,0FAA0F,kHAAkH,kBAAkB,uIAAuI,0IAA0I,kBAAkB,uIAAuI,0IAA0I,kBAAkB,uIAAuI,0IAA0I,kBAAkB,4DAA4D,6MAA6M,kBAAkB,4DAA4D,6MAA6M,oBAAoB,uCAAuC,iCAAiC,MAAM,6FAA6F,oFAAoF,gCAAgC,6FAA6F,kBAAkB,iIAAiI,kBAAkB,oHAAoH,iPAAiP,QAAQ,kBAAkB,yGAAyG,YAAY,oBAAoB,UAAU,kLAAkL,gBAAgB,WAAW,+GAA+G,gBAAgB,+FAA+F,yCAAyC,gBAAgB,WAAW,QAAQ,eAAe,sFAAsF,wFAAwF,SAAS,cAAc,8FAA8F,gBAAgB,8GAA8G,gBAAgB,oHAAoH,ufAAuf,WAAW,aAAa,cAAc,kmBAAkmB,EAAE,YAAY,aAAa,0BAA0B,qDAAqD,cAAc,0BAA0B,6BAA6B,gBAAgB,0BAA0B,uBAAuB,gBAAgB,6BAA6B,kBAAkB,uBAAuB,kBAAkB,uCAAuC,kBAAkB,uCAAuC,kBAAkB,uCAAuC,kBAAkB,uCAAuC,gBAAgB,mDAAmD,gBAAgB,qDAAqD,kBAAkB,2DAA2D,kBAAkB,2DAA2D,gBAAgB,qDAAqD,kBAAkB,iCAAiC,oBAAoB,2CAA2C,gBAAgB,4BAA4B,uBAAuB,gBAAgB,4BAA4B,eAAe,cAAc,kBAAkB,uBAAuB,cAAc,kBAAkB,eAAe,gBAAgB,+BAA+B,gBAAgB,iCAAiC,gBAAgB,4BAA4B,yDAAyD,gBAAgB,2BAA2B,kBAAkB,0BAA0B,4BAA4B,oBAAoB,kBAAkB,6CAA6C,gBAAgB,OAAO,2BAA2B,+CAA+C,kBAAkB,kBAAkB,+CAA+C,kBAAkB,kBAAkB,yDAAyD,kBAAkB,kBAAkB,yDAAyD,kBAAkB,kBAAkB,2DAA2D,oBAAoB,wDAAwD,6CAA6C,gBAAgB,yFAAyF,6CAA6C,cAAc,uBAAuB,cAAc,iCAAiC,gBAAgB,gCAAgC,gBAAgB,gCAAgC,kIAAkI,iEAAiE,QAAQ,gEAAgE,IAAI,0DAA0D,SAAS,EAAE,WAAW,aAAa,sCAAsC,SAAS,iBAAiB,sCAAsC,QAAQ,gBAAgB,EAAE,qtBAAqtB,gBAAgB,wBAAwB,iBAAiB,yBAAyB,cAAc,oEAAoE,+DAA+D,gGAAgG,YAAY,mBAAmB,mCAAmC,IAAI,mDAAmD,UAAU,wCAAwC,cAAc,qBAAqB,UAAU,wFAAwF,YAAY,IAAI,KAAK,aAAa,4NAA4N,oBAAoB,eAAe,qGAAqG,QAAQ,2BAA2B,uBAAuB,IAAI,KAAK,qBAAqB,qBAAqB,YAAY,OAAO,0DAA0D,UAAU,wDAAwD,iBAAiB,iBAAiB,gBAAgB,mCAAmC,IAAI,gGAAgG,qBAAqB,mCAAmC,IAAI,2CAA2C,uCAAuC,4CAA4C,0BAA0B,yCAAyC,8BAA8B,wCAAwC,MAAM,8BAA8B,uBAAuB,kCAAkC,kBAAkB,+DAA+D,yCAAyC,wBAAwB,UAAU,uBAAuB,IAAI,KAAK,aAAa,8CAA8C,QAAQ,YAAY,iBAAiB,8BAA8B,sBAAsB,kEAAkE,yCAAyC,wBAAwB,uBAAuB,IAAI,KAAK,aAAa,+BAA+B,+BAA+B,4DAA4D,0BAA0B,qFAAqF,UAAU,SAAS,aAAa,sCAAsC,SAAS,sBAAsB,QAAQ,mBAAmB,eAAe,MAAM,wJAAwJ,eAAe,QAAQ,4CAA4C,WAAW,kBAAkB,eAAe,MAAM,gDAAgD,WAAW,8BAA8B,mBAAmB,qFAAqF,WAAW,aAAa,sCAAsC,SAAS,iBAAiB,sCAAsC,6BAA6B,gBAAgB,EAAE,0FAA0F,oBAAoB,gBAAgB,WAAW,sBAAsB,uBAAuB,IAAI,iCAAiC,SAAS,kBAAkB,sBAAsB,uBAAuB,IAAI,wCAAwC,SAAS,UAAU,uBAAuB,IAAI,KAAK,4BAA4B,qCAAqC,0CAA0C,kMAAkM,oBAAoB,eAAe,0HAA0H,cAAc,qBAAqB,QAAQ,0CAA0C,2BAA2B,uBAAuB,IAAI,KAAK,qBAAqB,qBAAqB,YAAY,OAAO,0DAA0D,UAAU,iCAAiC,kCAAkC,8BAA8B,SAAS,gBAAgB,mCAAmC,IAAI,oFAAoF,mBAAmB,gEAAgE,cAAc,gCAAgC,2BAA2B,oDAAoD,mCAAmC,IAAI,yJAAyJ,uCAAuC,SAAS,uBAAuB,kEAAkE,gDAAgD,4CAA4C,aAAa,8HAA8H,mBAAmB,0EAA0E,mBAAmB,2EAA2E,YAAY,wGAAwG,QAAQ,4BAA4B,cAAc,2BAA2B,IAAI,mCAAmC,SAAS,gCAAgC,mBAAmB,6EAA6E,4BAA4B,UAAU,yCAAyC,UAAU,WAAW,aAAa,sCAAsC,SAAS,qBAAqB,6IAA6I,6BAA6B,gBAAgB,EAAE,+DAA+D,qCAAqC,aAAa,kUAAkU,udAAud,WAAW,mBAAmB,ieAAie,kBAAkB,gDAAgD,eAAe,oBAAoB,qEAAqE,kBAAkB,2JAA2J,uBAAuB,8LAA8L,gDAAgD,4CAA4C,qBAAqB,QAAQ,oCAAoC,8EAA8E,qTAAqT,UAAU,cAAc,yDAAyD,QAAQ,WAAW,QAAQ,8KAA8K,YAAY,IAAI,gBAAgB,IAAI,SAAS,wJAAwJ,sEAAsE,+BAA+B,wjBAAwjB,MAAM,UAAU,oGAAoG,MAAM,iFAAiF,mLAAmL,sJAAsJ,6kBAA6kB,mEAAmE,kFAAkF,oBAAoB,YAAY,IAAI,MAAM,wBAAwB,wPAAwP,qBAAqB,wCAAwC,2BAA2B,qFAAqF,SAAS,sCAAsC,8EAA8E,iEAAiE,2BAA2B,IAAI,2CAA2C,iBAAiB,cAAc,qBAAqB,qBAAqB,MAAM,6CAA6C,oEAAoE,YAAY,mBAAmB,mBAAmB,0BAA0B,8BAA8B,8BAA8B,mBAAmB,KAAK,kBAAkB,gBAAgB,SAAS,UAAU,+EAA+E,IAAI,KAAK,8BAA8B,GAAG,oHAAoH,oBAAoB,kCAAkC,OAAO,YAAY,kEAAkE,yBAAyB,MAAM,0BAA0B,oBAAoB,kFAAkF,yBAAyB,6BAA6B,sIAAsI,EAAE,WAAW,aAAa,sCAAsC,SAAS,oFAAoF,cAAc,wIAAwI,yJAAyJ,sBAAsB,0CAA0C,0BAA0B,+CAA+C,SAAS,aAAa,sCAAsC,SAAS,EAAE,wBAAwB,eAAe,qBAAqB,2EAA2E,eAAe,oBAAoB,mCAAmC,qMAAqM,uBAAuB,eAAe,uBAAuB,kBAAkB,qBAAqB,kBAAkB,oBAAoB,kBAAkB,8BAA8B,gDAAgD,mBAAmB,sDAAsD,mBAAmB,sDAAsD,mBAAmB,qFAAqF,mBAAmB,sBAAsB,eAAe,sBAAsB,gBAAgB,sBAAsB,mBAAmB,KAAK,OAAO,KAAK,gDAAgD,YAAY,SAAS,aAAa,sCAAsC,SAAS,6HAA6H,YAAY,kBAAkB,WAAW,aAAa,sCAAsC,SAAS,yCAAyC,cAAc,MAAM,aAAa,kFAAkF,iCAAiC,eAAe,YAAY,qCAAqC,YAAY,gDAAgD,eAAe,wIAAwI,aAAa,uTAAuT,cAAc,uNAAuN,2BAA2B,eAAe,kDAAkD,WAAW,sCAAsC,oBAAoB,0CAA0C,mCAAmC,wBAAwB,6IAA6I,uBAAuB,IAAI,yCAAyC,SAAS,wBAAwB,mCAAmC,sCAAsC,uBAAuB,IAAI,mCAAmC,+BAA+B,oBAAoB,SAAS,aAAa,sCAAsC,SAAS,uCAAuC,WAAW,aAAa,sCAAsC,SAAS,sOAAsO,gFAAgF,kBAAkB,uBAAuB,iBAAiB,eAAe,yBAAyB,qBAAqB,yBAAyB,qBAAqB,wBAAwB,kBAAkB,+CAA+C,mCAAmC,SAAS,2BAA2B,yCAAyC,2DAA2D,WAAW,gBAAgB,4BAA4B,qBAAqB,6DAA6D,uBAAuB,gBAAgB,uCAAuC,QAAQ,8BAA8B,oBAAoB,8CAA8C,oBAAoB,IAAI,eAAe,wCAAwC,gBAAgB,qDAAqD,YAAY,IAAI,UAAU,gBAAgB,sCAAsC,OAAO,qCAAqC,4BAA4B,YAAY,IAAI,mCAAmC,SAAS,+BAA+B,aAAa,kBAAkB,oBAAoB,8BAA8B,KAAK,WAAW,6DAA6D,kBAAkB,0FAA0F,IAAI,yCAAyC,0BAA0B,sGAAsG,EAAE,YAAY,uBAAuB,8CAA8C,2CAA2C,sCAAsC,8CAA8C,gCAAgC,gDAAgD,8BAA8B,0BAA0B,4CAA4C,sCAAsC,8CAA8C,gCAAgC,gDAAgD,+BAA+B,uBAAuB,8CAA8C,sCAAsC,gBAAgB,gCAAgC,oCAAoC,+BAA+B,SAAS,oEAAoE,iFAAiF,iBAAiB,iBAAiB,YAAY,IAAI,gBAAgB,4BAA4B,gBAAgB,IAAI,yEAAyE,SAAS,8BAA8B,WAAW,MAAM,YAAY,aAAa,gGAAgG,cAAc,MAAM,sCAAsC,0BAA0B,2BAA2B,YAAY,mBAAmB,iGAAiG,yBAAyB,yCAAyC,4BAA4B,6FAA6F,YAAY,MAAM,iEAAiE,cAAc,4BAA4B,QAAQ,MAAM,WAAW,QAAQ,MAAM,KAAK,+BAA+B,iBAAiB,SAAS,aAAa,iBAAiB,mBAAmB,eAAe,YAAY,WAAW,KAAK,8CAA8C,6CAA6C,uCAAuC,aAAa,8cAA8c,0IAA0I,wBAAwB,qEAAqE,SAAS,kBAAkB,6BAA6B,iBAAiB,SAAS,sBAAsB,6BAA6B,iBAAiB,SAAS,sBAAsB,6BAA6B,kBAAkB,yBAAyB,8LAA8L,mLAAmL,8HAA8H,WAAW,KAAK,uBAAuB,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,qBAAqB,WAAW,KAAK,6BAA6B,sCAAsC,oBAAoB,2BAA2B,2NAA2N,wEAAwE,2VAA2V,YAAY,KAAK,oCAAoC,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,0BAA0B,YAAY,KAAK,4CAA4C,sDAAsD,4BAA4B,YAAY,KAAK,4CAA4C,uDAAuD,uBAAuB,mDAAmD,SAAS,4DAA4D,GAAG,WAAW,aAAa,sCAAsC,SAAS,iBAAiB,8BAA8B,4BAA4B,eAAe,qTAAqT,WAAW,8DAA8D,kBAAkB,4EAA4E,QAAQ,0EAA0E,mBAAmB,iJAAiJ,oBAAoB,6LAA6L,mBAAmB,yDAAyD,gBAAgB,eAAe,6CAA6C,gEAAgE,2EAA2E,wDAAwD,MAAM,2DAA2D,uBAAuB,IAAI,KAAK,SAAS,QAAQ,6CAA6C,yBAAyB,cAAc,IAAI,6BAA6B,SAAS,MAAM,4DAA4D,YAAY,0JAA0J,UAAU,WAAW,aAAa,sCAAsC,SAAS,0BAA0B,sCAAsC,4BAA4B,gBAAgB,EAAE,MAAM,mNAAmN,6EAA6E,WAAW,iEAAiE,2BAA2B,sQAAsQ,oBAAoB,oCAAoC,QAAQ,sEAAsE,uBAAuB,IAAI,0EAA0E,SAAS,mBAAmB,+CAA+C,gBAAgB,SAAS,gEAAgE,2EAA2E,wDAAwD,MAAM,2DAA2D,2BAA2B,WAAW,oBAAoB,aAAa,gBAAgB,mBAAmB,WAAW,aAAa,sCAAsC,SAAS,qBAAqB,sCAAsC,iCAAiC,gBAAgB,OAAO,8IAA8I,gDAAgD,+GAA+G,eAAe,4DAA4D,2CAA2C,IAAI,wEAAwE,SAAS,WAAW,0CAA0C,kBAAkB,qLAAqL,uBAAuB,uGAAuG,aAAa,SAAS,4BAA4B,MAAM,GAAG,yCAAyC,KAAK,qCAAqC,KAAK,MAAM,qBAAqB,6BAA6B,4BAA4B,mBAAmB,gEAAgE,oIAAoI,MAAM,QAAQ,0DAA0D,qCAAqC,oBAAoB,mOAAmO,sBAAsB,MAAM,sBAAsB,wIAAwI,mCAAmC,mCAAmC,gBAAgB,IAAI,UAAU,0CAA0C,mCAAmC,eAAe,sBAAsB,iEAAiE,uBAAuB,IAAI,qEAAqE,oEAAoE,WAAW,gBAAgB,+RAA+R,0FAA0F,2BAA2B,OAAO,oCAAoC,YAAY,uBAAuB,oBAAoB,kBAAkB,gCAAgC,EAAE,qDAAqD,+BAA+B,WAAW,aAAa,sCAAsC,SAAS,uBAAuB,sBAAsB,iCAAiC,gBAAgB,EAAE,QAAQ,2dAA2d,WAAW,sDAAsD,kBAAkB,6DAA6D,uBAAuB,+CAA+C,cAAc,2KAA2K,uBAAuB,IAAI,qEAAqE,8EAA8E,kBAAkB,wGAAwG,oBAAoB,+IAA+I,YAAY,gEAAgE,eAAe,sBAAsB,qBAAqB,EAAE,kBAAkB,gCAAgC,EAAE,qDAAqD,gBAAgB,WAAW,aAAa,sCAAsC,SAAS,0BAA0B,cAAc,wBAAwB,eAAe,kSAAkS,uBAAuB,6DAA6D,WAAW,8JAA8J,kBAAkB,uHAAuH,oBAAoB,8KAA8K,gBAAgB,uJAAuJ,OAAO,gCAAgC,iCAAiC,SAAS,kBAAkB,mBAAmB,sBAAsB,iDAAiD,QAAQ,YAAY,YAAY,gHAAgH,YAAY,IAAI,6BAA6B,YAAY,IAAI,KAAK,gFAAgF,mBAAmB,IAAI,SAAS,GAAG,8CAA8C,2BAA2B,aAAa,sFAAsF,2DAA2D,gBAAgB,IAAI,MAAM,0BAA0B,wBAAwB,gBAAgB,4BAA4B,gBAAgB,eAAe,SAAS,wBAAwB,mGAAmG,gEAAgE,2EAA2E,wDAAwD,MAAM,yDAAyD,YAAY,gCAAgC,iCAAiC,qCAAqC,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,gCAAgC,gCAAgC,IAAI,iBAAiB,mDAAmD,yBAAyB,cAAc,EAAE,QAAQ,oCAAoC,aAAa,MAAM,+EAA+E,YAAY,YAAY,IAAI,KAAK,sBAAsB,mBAAmB,IAAI,SAAS,sBAAsB,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,kCAAkC,2BAA2B,gBAAgB,IAAI,iBAAiB,mDAAmD,yBAAyB,cAAc,mCAAmC,uBAAuB,kBAAkB,QAAQ,YAAY,IAAI,YAAY,SAAS,2BAA2B,OAAO,gCAAgC,4BAA4B,mBAAmB,WAAW,aAAa,sCAAsC,SAAS,uBAAuB,cAAc,wBAAwB,eAAe,mLAAmL,uBAAuB,0DAA0D,WAAW,+DAA+D,kBAAkB,6EAA6E,oBAAoB,iNAAiN,gBAAgB,oBAAoB,mBAAmB,yBAAyB,aAAa,0BAA0B,cAAc,mBAAmB,oBAAoB,iEAAiE,YAAY,IAAI,KAAK,SAAS,wCAAwC,qEAAqE,kCAAkC,uBAAuB,IAAI,qCAAqC,yBAAyB,gBAAgB,eAAe,SAAS,gEAAgE,2EAA2E,wDAAwD,MAAM,yDAAyD,SAAS,0BAA0B,qCAAqC,uBAAuB,IAAI,mDAAmD,IAAI,KAAK,sBAAsB,uBAAuB,IAAI,KAAK,SAAS,QAAQ,IAAI,aAAa,4BAA4B,mDAAmD,yBAAyB,cAAc,KAAK,uBAAuB,kBAAkB,QAAQ,YAAY,IAAI,YAAY,SAAS,2BAA2B,OAAO,gCAAgC,4BAA4B,gBAAgB,WAAW,aAAa,sCAAsC,SAAS,gBAAgB,sBAAsB,8BAA8B,gBAAgB,EAAE,mFAAmF,sBAAsB,WAAW,sBAAsB,uBAAuB,eAAe,YAAY,IAAI,WAAW,sBAAsB,6CAA6C,iBAAiB,oBAAoB,0DAA0D,6BAA6B,8CAA8C,gBAAgB,wCAAwC,yBAAyB,IAAI,MAAM,kBAAkB,sJAAsJ,OAAO,yBAAyB,qCAAqC,yBAAyB,+BAA+B,mJAAmJ,6BAA6B,6BAA6B,WAAW,aAAa,sCAAsC,SAAS,oBAAoB,sBAAsB,8BAA8B,gBAAgB,EAAE,2EAA2E,uCAAuC,WAAW,aAAa,sCAAsC,SAAS,gBAAgB,sBAAsB,8BAA8B,gBAAgB,EAAE,uEAAuE,wCAAwC,WAAW,aAAa,sCAAsC,SAAS,mBAAmB,sBAAsB,4BAA4B,gBAAgB,EAAE,sJAAsJ,kHAAkH,+GAA+G,YAAY,WAAW,aAAa,sCAAsC,SAAS,kBAAkB,sBAAsB,4BAA4B,gBAAgB,EAAE,uCAAuC,0BAA0B,wCAAwC,kDAAkD,qDAAqD,+GAA+G,WAAW,WAAW,aAAa,sCAAsC,SAAS,gBAAgB,sBAAsB,4BAA4B,gBAAgB,EAAE,6LAA6L,6CAA6C,sEAAsE,qCAAqC,8GAA8G,sBAAsB,0JAA0J,SAAS,WAAW,aAAa,sCAAsC,SAAS,gBAAgB,sBAAsB,4BAA4B,gBAAgB,EAAE,QAAQ,2LAA2L,qFAAqF,4HAA4H,mBAAmB,YAAY,mCAAmC,qDAAqD,8GAA8G,sBAAsB,kFAAkF,+BAA+B,qBAAqB,kBAAkB,sEAAsE,SAAS,WAAW,aAAa,sCAAsC,SAAS,kBAAkB,sBAAsB,4BAA4B,gBAAgB,EAAE,UAAU,sUAAsU,2HAA2H,6EAA6E,sCAAsC,YAAY,0BAA0B,qDAAqD,8GAA8G,sBAAsB,kHAAkH,8BAA8B,UAAU,sCAAsC,wCAAwC,sCAAsC,qCAAqC,qDAAqD,aAAa,oBAAoB,yGAAyG,WAAW,aAAa,sCAAsC,SAAS,qBAAqB,sBAAsB,4BAA4B,gBAAgB,EAAE,iLAAiL,0BAA0B,sIAAsI,mCAAmC,iJAAiJ,8GAA8G,sBAAsB,iIAAiI,cAAc,WAAW,aAAa,sCAAsC,SAAS,sBAAsB,sBAAsB,4BAA4B,gBAAgB,EAAE,gBAAgB,0YAA0Y,0BAA0B,wCAAwC,sCAAsC,YAAY,0IAA0I,qCAAqC,8GAA8G,sBAAsB,4MAA4M,eAAe,WAAW,aAAa,sCAAsC,SAAS,qBAAqB,iEAAiE,uHAAuH,cAAc,WAAW,aAAa,sCAAsC,SAAS,kBAAkB,cAAc,2BAA2B,eAAe,UAAU,EAAE,wCAAwC,WAAW,iEAAiE,mBAAmB,kBAAkB,YAAY,IAAI,6JAA6J,2BAA2B,IAAI,wEAAwE,KAAK,oBAAoB,YAAY,IAAI,wEAAwE,UAAU,WAAW,WAAW,aAAa,sCAAsC,SAAS,kBAAkB,8BAA8B,2BAA2B,gBAAgB,EAAE,8BAA8B,uDAAuD,8IAA8I,WAAW,4BAA4B,yCAAyC,qCAAqC,QAAQ,yBAAyB,IAAI,iDAAiD,SAAS,2BAA2B,0DAA0D,yBAAyB,uBAAuB,YAAY,kBAAkB,IAAI,wGAAwG,gEAAgE,WAAW,WAAW,aAAa,sCAAsC,SAAS,iBAAiB,cAAc,2BAA2B,cAAc,QAAQ,aAAa,iBAAiB,eAAe,iBAAiB,0BAA0B,8BAA8B,0CAA0C,mBAAmB,iBAAiB,qCAAqC,UAAU,WAAW,aAAa,sCAAsC,SAAS,oBAAoB,cAAc,2BAA2B,gBAAgB,EAAE,oFAAoF,WAAW,2DAA2D,4BAA4B,iDAAiD,wCAAwC,6BAA6B,IAAI,UAAU,kBAAkB,SAAS,6BAA6B,IAAI,iCAAiC,+QAA+Q,OAAO,2CAA2C,qCAAqC,2CAA2C,+BAA+B,mJAAmJ,MAAM,gHAAgH,gEAAgE,4BAA4B,6BAA6B,6CAA6C,iBAAiB,uCAAuC,0DAA0D,0BAA0B,8CAA8C,iBAAiB,aAAa,WAAW,aAAa,sCAAsC,SAAS,qBAAqB,cAAc,2BAA2B,gBAAgB,EAAE,mEAAmE,WAAW,mBAAmB,QAAQ,6BAA6B,IAAI,uBAAuB,SAAS,yBAAyB,iDAAiD,YAAY,IAAI,kCAAkC,KAAK,4DAA4D,gDAAgD,uEAAuE,cAAc,WAAW,aAAa,sCAAsC,SAAS,kBAAkB,cAAc,2BAA2B,eAAe,iBAAiB,EAAE,sCAAsC,WAAW,gFAAgF,WAAW,OAAO,cAAc,WAAW,+BAA+B,YAAY,YAAY,oDAAoD,mBAAmB,+DAA+D,uBAAuB,EAAE,8DAA8D,4FAA4F,eAAe,wCAAwC,SAAS,EAAE,MAAM,IAAI,eAAe,eAAe,MAAM,YAAY,aAAa,kBAAkB,gCAAgC,iBAAiB,sCAAsC,uCAAuC,8BAA8B,sBAAsB,oBAAoB,IAAI,KAAK,wBAAwB,eAAe,4DAA4D,gBAAgB,0BAA0B,mCAAmC,kBAAkB,wBAAwB,uBAAuB,6BAA6B,8CAA8C,IAAI,8EAA8E,0BAA0B,SAAS,uBAAuB,SAAS,+BAA+B,GAAG,eAAe,aAAa,iBAAiB,SAAS,aAAa,gBAAgB,oBAAoB,cAAc,6DAA6D,gBAAgB,oFAAoF,wCAAwC,sCAAsC,yFAAyF,yBAAyB,yBAAyB,4BAA4B,0BAA0B,uCAAuC,oCAAoC,uFAAuF,sBAAsB,6JAA6J,uDAAuD,oFAAoF,KAAK,YAAY,IAAI,wBAAwB,0BAA0B,YAAY,WAAW,MAAM,oDAAoD,4BAA4B,SAAS,IAAI,SAAS,aAAa,0BAA0B,kBAAkB,4CAA4C,8BAA8B,kCAAkC,kTAAkT,4DAA4D,yDAAyD,sOAAsO,qCAAqC,4CAA4C,aAAa,SAAS,aAAa,aAAa,qCAAqC,8BAA8B,+BAA+B,6GAA6G,qCAAqC,2EAA2E,iCAAiC,2EAA2E,oCAAoC,UAAU,2JAA2J,+BAA+B,0FAA0F,+BAA+B,0FAA0F,gCAAgC,gCAAgC,iEAAiE,oEAAoE,YAAY,oBAAoB,kLAAkL,QAAQ,kBAAkB,kCAAkC,MAAM,0IAA0I,aAAa,SAAS,aAAa,OAAO,4CAA4C,4FAA4F,cAAc,oBAAoB,cAAc,oHAAoH,cAAc,KAAK,mJAAmJ,WAAW,MAAM,cAAc,iCAAiC,mJAAmJ,cAAc,gDAAgD,qDAAqD,8FAA8F,WAAW,0JAA0J,KAAK,6BAA6B,UAAU,6BAA6B,WAAW,aAAa,wBAAwB,UAAU,6BAA6B,oBAAoB,iFAAiF,0JAA0J,KAAK,6BAA6B,KAAK,kDAAkD,yEAAyE,cAAc,QAAQ,2CAA2C,aAAa,iIAAiI,UAAU,mEAAmE,GAAG,cAAc,wBAAwB,gFAAgF,aAAa,0GAA0G,SAAS,sEAAsE,UAAU,EAAE,QAAQ,IAAI,KAAK,kDAAkD,iGAAiG,OAAO,wBAAwB,+EAA+E,KAAK,UAAU,2EAA2E,sBAAsB,uBAAuB,SAAS,yBAAyB,MAAM,yKAAyK,8BAA8B,eAAe,aAAa,gDAAgD,cAAc,wCAAwC,WAAW,wDAAwD,mBAAmB,sCAAsC,mBAAmB,gBAAgB,0DAA0D,iBAAiB,wCAAwC,+BAA+B,KAAK,uDAAuD,kCAAkC,aAAa,gDAAgD,YAAY,aAAa,kEAAkE,MAAM,kFAAkF,MAAM,kEAAkE,MAAM,kFAAkF,MAAM,mEAAmE,6IAA6I,iCAAiC,MAAM,4FAA4F,MAAM,sDAAsD,MAAM,iDAAiD,WAAW,+CAA+C,gBAAgB,MAAM,wCAAwC,QAAQ,wBAAwB,uFAAuF,gCAAgC,OAAO,qCAAqC,kCAAkC,iCAAiC,aAAa,uBAAuB,YAAY,uBAAuB,sIAAsI,kGAAkG,qCAAqC,qDAAqD,iCAAiC,yDAAyD,oCAAoC,uDAAuD,+BAA+B,4CAA4C,+BAA+B,4CAA4C,gCAAgC,6CAA6C,mCAAmC,oDAAoD,+BAA+B,sBAAsB,wEAAwE,gCAAgC,aAAa,uFAAuF,uFAAuF,qCAAqC,oJAAoJ,gNAAgN,uIAAuI,2BAA2B,IAAI,QAAQ,mCAAmC,8BAA8B,sBAAsB,sDAAsD,iBAAiB,gCAAgC,gCAAgC,aAAa,mEAAmE,4CAA4C,4CAA4C,qCAAqC,yDAAyD,kBAAkB,aAAa,WAAW,6BAA6B,cAAc,oBAAoB,kBAAkB,4BAA4B,4BAA4B,uCAAuC,+BAA+B,0BAA0B,6BAA6B,qCAAqC,gBAAgB,WAAW,mBAAmB,WAAW,4BAA4B,uCAAuC,+BAA+B,4CAA4C,6BAA6B,qCAAqC,gBAAgB,WAAW,mBAAmB,WAAW,8BAA8B,uCAAuC,sBAAsB,qLAAqL,4CAA4C,OAAO,QAAQ,gCAAgC,8BAA8B,uCAAuC,+BAA+B,sVAAsV,QAAQ,aAAa,cAAc,aAAa,gBAAgB,4DAA4D,uFAAuF,sBAAsB,gBAAgB,uCAAuC,kEAAkE,YAAY,MAAM,oDAAoD,0FAA0F,iGAAiG,mGAAmG,qDAAqD,qDAAqD,SAAS,MAAM,eAAe,aAAa,gBAAgB,uEAAuE,6CAA6C,gBAAgB,0BAA0B,cAAc,OAAO,6GAA6G,cAAc,uXAAuX,EAAE,+IAA+I,cAAc,mBAAmB,4CAA4C,EAAE,oBAAoB,OAAO,mHAAmH,aAAa,OAAO,yBAAyB,cAAc,MAAM,wBAAwB,aAAa,OAAO,wDAAwD,cAAc,kBAAkB,cAAc,+DAA+D,cAAc,+JAA+J,MAAM,kBAAkB,OAAO,yBAAyB,iBAAiB,iBAAiB,oHAAoH,EAAE,8CAA8C,+CAA+C,mBAAmB,2BAA2B,SAAS,kBAAkB,wBAAwB,iBAAiB,eAAe,MAAM,iBAAiB,MAAM,kBAAkB,uBAAuB,0BAA0B,2CAA2C,kBAAkB,sBAAsB,oBAAoB,YAAY,SAAS,yBAAyB,2CAA2C,gBAAgB,OAAO,yBAAyB,MAAM,MAAM,MAAM,gBAAgB,OAAO,+BAA+B,gBAAgB,sCAAsC,cAAc,YAAY,cAAc,YAAY,cAAc,gBAAgB,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,qBAAqB,OAAO,qIAAqI,gBAAgB,8WAA8W,aAAa,gCAAgC,IAAI,8BAA8B,KAAK,cAAc,sCAAsC,cAAc,eAAe,iFAAiF,2CAA2C,0EAA0E,oCAAoC,sEAAsE,oCAAoC,0EAA0E,yDAAyD,yEAAyE,oBAAoB,yEAAyE,oBAAoB,qFAAqF,sBAAsB,oDAAoD,oBAAoB,gKAAgK,gBAAgB,kBAAkB,UAAU,IAAI,gBAAgB,+QAA+Q,8CAA8C,0GAA0G,gBAAgB,WAAW,oBAAoB,4FAA4F,iBAAiB,gBAAgB,OAAO,oCAAoC,kBAAkB,OAAO,8CAA8C,cAAc,aAAa,cAAc,UAAU,MAAM,KAAK,OAAO,oCAAoC,IAAI,2DAA2D,gBAAgB,2DAA2D,gBAAgB,SAAS,2BAA2B,WAAW,SAAS,sCAAsC,WAAW,cAAc,qCAAqC,GAAG,cAAc,oBAAoB,+DAA+D,aAAa,YAAY,kBAAkB,MAAM,kBAAkB,sCAAsC,MAAM,kBAAkB,SAAS,aAAa,cAAc,oBAAoB,yBAAyB,MAAM,iBAAiB,SAAS,iDAAiD,aAAa,wBAAwB,aAAa,MAAM,oBAAoB,4CAA4C,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,kJAAkJ,gBAAgB,MAAM,kBAAkB,kDAAkD,oCAAoC,YAAY,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,aAAa,SAAS,uBAAuB,wCAAwC,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,gBAAgB,sCAAsC,MAAM,kBAAkB,kDAAkD,sBAAsB,kCAAkC,aAAa,aAAa,aAAa,SAAS,uBAAuB,wCAAwC,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,gBAAgB,sCAAsC,MAAM,kBAAkB,kDAAkD,kBAAkB,kCAAkC,aAAa,aAAa,aAAa,SAAS,uBAAuB,wCAAwC,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,gBAAgB,kBAAkB,UAAU,0EAA0E,8BAA8B,MAAM,kBAAkB,kDAAkD,sBAAsB,+CAA+C,aAAa,aAAa,aAAa,SAAS,uBAAuB,kCAAkC,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,gBAAgB,gBAAgB,MAAM,kBAAkB,kDAAkD,qBAAqB,YAAY,aAAa,aAAa,aAAa,SAAS,uBAAuB,kCAAkC,aAAa,oDAAoD,gBAAgB,MAAM,kBAAkB,kDAAkD,gBAAgB,MAAM,kBAAkB,gBAAgB,gBAAgB,MAAM,kBAAkB,kDAAkD,qBAAqB,YAAY,aAAa,aAAa,aAAa,SAAS,MAAM,aAAa,YAAY,mDAAmD,UAAU,yBAAyB,kBAAkB,+RAA+R,qIAAqI,sHAAsH,MAAM,wCAAwC,mEAAmE,aAAa,QAAQ,gDAAgD,aAAa,cAAc,8BAA8B,MAAM,kBAAkB,SAAS,UAAU,sCAAsC,MAAM,kBAAkB,YAAY,aAAa,6BAA6B,gBAAgB,MAAM,kBAAkB,UAAU,aAAa,SAAS,aAAa,QAAQ,8DAA8D,aAAa,cAAc,sKAAsK,aAAa,QAAQ,qEAAqE,cAAc,QAAQ,0BAA0B,MAAM,kBAAkB,SAAS,SAAS,cAAc,QAAQ,qEAAqE,cAAc,QAAQ,qEAAqE,WAAW,kBAAkB,qCAAqC,4BAA4B,WAAW,iCAAiC,0CAA0C,oEAAoE,cAAc,YAAY,eAAe,aAAa,mBAAmB,0CAA0C,yCAAyC,OAAO,oBAAoB,wBAAwB,mBAAmB,+BAA+B,iDAAiD,GAAG,oCAAoC,gBAAgB,sBAAsB,gBAAgB,qBAAqB,mBAAmB,qBAAqB,iBAAiB,6BAA6B,cAAc,kDAAkD,cAAc,2KAA2K,kBAAkB,gDAAgD,iBAAiB,GAAG,cAAc,qNAAqN,kBAAkB,gDAAgD,iBAAiB,GAAG,cAAc,oBAAoB,8BAA8B,mBAAmB,wBAAwB,YAAY,WAAW,mCAAmC,WAAW,iBAAiB,mBAAmB,+BAA+B,+DAA+D,wBAAwB,qCAAqC,gBAAgB,MAAM,cAAc,WAAW,+BAA+B,YAAY,YAAY,oDAAoD,mBAAmB,+DAA+D,uBAAuB,EAAE,8DAA8D,4FAA4F,eAAe,wCAAwC,SAAS,EAAE,QAAQ,IAAI,G;;;;;UCDz49N;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,wCAAwC,yCAAyC;WACjF;WACA;WACA,E;;;;;WCPA;WACA;WACA;WACA;WACA,EAAE;WACF;WACA;WACA,CAAC,I;;;;;WCPD,wF;;;;;WCAA;WACA;WACA;WACA,sDAAsD,kBAAkB;WACxE;WACA,+CAA+C,cAAc;WAC7D,E;;;;;UCNA;UACA;UACA;UACA","file":"urpflanze.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Urpflanze\"] = factory();\n\telse\n\t\troot[\"Urpflanze\"] = factory();\n})(window, function() {\nreturn ","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./modules\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SVGImporter = exports.SVGExporter = exports.GCODEExporter = exports.Timeline = exports.Renderer = exports.Color = void 0;\n__exportStar(require(\"./modules-light\"), exports);\nexports.Color = require(\"@urpflanze/color/dist/cjs\");\nvar cjs_1 = require(\"@urpflanze/drawer-canvas/dist/cjs\");\nObject.defineProperty(exports, \"Renderer\", { enumerable: true, get: function () { return cjs_1.Renderer; } });\nObject.defineProperty(exports, \"Timeline\", { enumerable: true, get: function () { return cjs_1.Timeline; } });\nvar cjs_2 = require(\"@urpflanze/gcode-exporter/dist/cjs\");\nObject.defineProperty(exports, \"GCODEExporter\", { enumerable: true, get: function () { return cjs_2.GCODEExporter; } });\nvar cjs_3 = require(\"@urpflanze/svg-exporter/dist/cjs\");\nObject.defineProperty(exports, \"SVGExporter\", { enumerable: true, get: function () { return cjs_3.SVGExporter; } });\nvar svg_importer_1 = require(\"@urpflanze/svg-importer\");\nObject.defineProperty(exports, \"SVGImporter\", { enumerable: true, get: function () { return svg_importer_1.SVGImporter; } });\n//# sourceMappingURL=modules.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DrawerCanvas = exports.Animation = void 0;\n__exportStar(require(\"./core\"), exports);\nexports.Animation = require(\"@urpflanze/animation/dist/cjs\");\nvar BrowserDrawerCanvas_1 = require(\"@urpflanze/drawer-canvas/dist/cjs/browser/BrowserDrawerCanvas\");\nObject.defineProperty(exports, \"DrawerCanvas\", { enumerable: true, get: function () { return BrowserDrawerCanvas_1.BrowserDrawerCanvas; } });\n//# sourceMappingURL=modules-light.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mod = exports.log = exports.PI2 = exports.PHI = exports.Vec2 = exports.distributePointsInBuffer = exports.prepareBufferForInterpolation = exports.interpolate = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.now = exports.toRadians = exports.toDegrees = exports.relativeClamp = exports.clamp = exports.lerp = void 0;\n__exportStar(require(\"@urpflanze/core/dist/cjs/Scene\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/SceneChild\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/Group\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/ShapeBase\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/ShapePrimitive\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/ShapeLoop\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/ShapeBuffer\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/Shape\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/ShapeRecursive\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/ShapeFollow\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/primitives/Line\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/primitives/Triangle\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/primitives/Rect\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/primitives/Polygon\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/primitives/Circle\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/primitives/Star\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/primitives/Rose\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/primitives/Spiral\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/primitives/Lissajous\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/shapes/primitives/SuperShape\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/modifiers/Modifier\"), exports);\n__exportStar(require(\"@urpflanze/core/dist/cjs/modifiers\"), exports);\nvar Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nObject.defineProperty(exports, \"lerp\", { enumerable: true, get: function () { return Utilities_1.lerp; } });\nObject.defineProperty(exports, \"clamp\", { enumerable: true, get: function () { return Utilities_1.clamp; } });\nObject.defineProperty(exports, \"relativeClamp\", { enumerable: true, get: function () { return Utilities_1.relativeClamp; } });\nObject.defineProperty(exports, \"toDegrees\", { enumerable: true, get: function () { return Utilities_1.toDegrees; } });\nObject.defineProperty(exports, \"toRadians\", { enumerable: true, get: function () { return Utilities_1.toRadians; } });\nObject.defineProperty(exports, \"now\", { enumerable: true, get: function () { return Utilities_1.now; } });\nObject.defineProperty(exports, \"noise\", { enumerable: true, get: function () { return Utilities_1.noise; } });\nObject.defineProperty(exports, \"random\", { enumerable: true, get: function () { return Utilities_1.random; } });\nObject.defineProperty(exports, \"angleFromRepetition\", { enumerable: true, get: function () { return Utilities_1.angleFromRepetition; } });\nObject.defineProperty(exports, \"angle2FromRepetition\", { enumerable: true, get: function () { return Utilities_1.angle2FromRepetition; } });\nObject.defineProperty(exports, \"distanceFromRepetition\", { enumerable: true, get: function () { return Utilities_1.distanceFromRepetition; } });\nObject.defineProperty(exports, \"interpolate\", { enumerable: true, get: function () { return Utilities_1.interpolate; } });\nObject.defineProperty(exports, \"prepareBufferForInterpolation\", { enumerable: true, get: function () { return Utilities_1.prepareBufferForInterpolation; } });\nObject.defineProperty(exports, \"distributePointsInBuffer\", { enumerable: true, get: function () { return Utilities_1.distributePointsInBuffer; } });\nvar Vec2_1 = require(\"@urpflanze/core/dist/cjs/math/Vec2\");\nObject.defineProperty(exports, \"Vec2\", { enumerable: true, get: function () { return Vec2_1.default; } });\nvar math_1 = require(\"@urpflanze/core/dist/cjs/math\");\nObject.defineProperty(exports, \"PHI\", { enumerable: true, get: function () { return math_1.PHI; } });\nObject.defineProperty(exports, \"PI2\", { enumerable: true, get: function () { return math_1.PI2; } });\nObject.defineProperty(exports, \"log\", { enumerable: true, get: function () { return math_1.log; } });\nObject.defineProperty(exports, \"mod\", { enumerable: true, get: function () { return math_1.mod; } });\n//# sourceMappingURL=core.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Scene = void 0;\nconst SceneChild_1 = require(\"./SceneChild\");\nconst Group_1 = require(\"./Group\");\nconst Shape_1 = require(\"./shapes/Shape\");\nconst Utilities_1 = require(\"./Utilities\");\n/**\n * Container for all SceneChild.\n * The main purpose is to manage the drawing order and update the child buffers\n *\n * @order 1\n * @category Core.Scene\n * @class Scene\n */\nclass Scene {\n /**\n * Creates an instance of Scene.\n * You can see the default values in the property definitions\n */\n constructor(settings = {}) {\n /**\n * Logical number, the drawer will take care of defining the unit of measure\n */\n this.width = 400;\n /**\n * Logical number, the drawer will take care of defining the unit of measure\n */\n this.height = 400;\n /**\n * Default background color (black)\n */\n this.background = 'hsla(0, 0%, 0%, 1)';\n /**\n * Default ScenePrimitive stroke color (white)\n */\n this.color = 'hsla(0, 0%, 100%, 1)';\n /**\n * Current time\n */\n this.currentTime = 0;\n if (typeof settings.width !== 'undefined')\n this.width = settings.width;\n if (typeof settings.height !== 'undefined')\n this.height = settings.height;\n if (typeof settings.background !== 'undefined')\n this.background = settings.background;\n if (typeof settings.color !== 'undefined')\n this.color = settings.color;\n this.children = [];\n this.center = [this.width / 2, this.height / 2];\n this.anchor =\n settings.anchor && Array.isArray(settings.anchor)\n ? [\n typeof settings.anchor[0] === 'number'\n ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[0]) * 0.5) * this.width\n : settings.anchor[0] === 'left'\n ? 0\n : settings.anchor[0] === 'right'\n ? this.width\n : this.center[0],\n typeof settings.anchor[1] === 'number'\n ? (0.5 + Utilities_1.clamp(-1, 1, settings.anchor[1]) * 0.5) * this.height\n : settings.anchor[1] === 'top'\n ? 0\n : settings.anchor[1] === 'bottom'\n ? this.height\n : this.center[1],\n ]\n : [this.center[0], this.center[1]];\n }\n /**\n * Return width percentage\n *\n * @param {number} [percentage=100]\n * @returns {number}\n */\n getWidth(percentage = 100) {\n return (this.width * percentage) / 100;\n }\n /**\n * Return height percentage\n *\n * @param {number} [percentage=100]\n * @returns {number}\n */\n getHeight(percentage = 100) {\n return (this.height * percentage) / 100;\n }\n /**\n * Resize the scene size\n *\n * @param {number} width\n * @param {number} [height=width]\n * @memberof Scene\n */\n resize(width, height = width) {\n this.width = width;\n this.height = height;\n this.center = [this.width / 2, this.height / 2];\n const anchor = [this.width / this.anchor[0], this.height / this.anchor[1]];\n this.anchor = [this.width / anchor[0], this.height / anchor[1]];\n this.children.forEach(sceneChild => sceneChild.clearBuffer(true, false));\n }\n /**\n * Update all children, generate a streamable buffer for drawing\n *\n * @param {number} [atTime] time in ms\n * @memberof Scene\n */\n update(atTime = 0) {\n this.currentTime = atTime;\n for (let i = 0, len = this.children.length; i < len; i++) {\n this.children[i].generate(this.currentTime, true);\n }\n }\n /**\n * Traverse the child buffer and use it with callback\n *\n * @param {(streamArguments: IStreamArguments) => void} callback\n * @memberof Scene\n */\n stream(callback) {\n this.children.forEach(sceneChild => sceneChild.stream(callback));\n }\n /*\n |--------------------------------------------------------------------------\n | SceneChild\n |--------------------------------------------------------------------------\n */\n /**\n * Return a list of children\n *\n * @returns {Array}\n * @memberof Scene\n */\n getChildren() {\n return this.children;\n }\n /**\n * Add SceneChild to Scene, pass `order` as last parameter for drawing priorities\n *\n * @param {Array} items\n * @param {number} [order]\n * @memberof Scene\n */\n add(...items /**, order: number */) {\n const order = typeof items[items.length - 1] === 'number' ? items[items.length - 1] : undefined;\n const len = items.length - (typeof order === 'undefined' ? 0 : 1);\n for (let i = 0; i < len; i++) {\n const item = items[i];\n item.order =\n typeof order !== 'undefined'\n ? order + i\n : typeof item.order !== 'undefined'\n ? item.order\n : this.children.length > 0\n ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1\n : 0;\n Scene.propagateToChilden(item, this);\n this.children.push(item);\n item.clearBuffer(true, false);\n item.generate(0, true);\n }\n this.sortChildren();\n }\n /**\n * Sort children by order\n *\n * @memberof Scene\n */\n sortChildren() {\n this.children.sort((a, b) => a.order - b.order);\n this.children = this.children.map((child, index) => {\n child.order = index;\n return child;\n });\n }\n /**\n * Find sceneChild from id or name in the whole scene\n *\n * @param {string | number} idOrName\n * @returns {(SceneChild | null)}\n * @memberof Scene\n */\n find(idOrName) {\n const children = this.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const result = children[i].find(idOrName);\n if (result !== null)\n return result;\n }\n return null;\n }\n /**\n * Get shape by index\n *\n * @param {number} index\n * @returns {(SceneChild | null)}\n * @memberof Scene\n */\n get(index) {\n return index >= 0 && index < this.children.length ? this.children[index] : null;\n }\n /**\n * Remove a shape by index\n *\n * @param {number} index\n * @memberof Scene\n */\n remove(index) {\n index >= 0 && index < this.children.length && this.children.splice(index, 1);\n }\n /**\n * Removes all children\n *\n * @memberof Scene\n */\n removeChildren() {\n this.children = [];\n }\n /**\n * Remove sceneChild by id or name\n *\n * @param {number | number} idOrName\n * @memberof Scene\n */\n removeFromId(idOrName) {\n for (let i = 0, len = this.children.length; i < len; i++)\n if (this.children[i].id === idOrName || this.children[i].name === idOrName) {\n this.children.splice(i, 1);\n return;\n }\n }\n /**\n * Return true if sceneChild is direct children\n *\n * @param {SceneChild} sceneChild\n * @returns {boolean}\n * @memberof Scene\n */\n isFirstLevelChild(sceneChild) {\n for (let i = 0, len = this.children.length; i < len; i++)\n if (this.children[i].id === sceneChild.id)\n return true;\n const parents = this.getParentsOfSceneChild(sceneChild);\n return parents.length === 1 && parents[0] instanceof Group_1.Group;\n }\n /**\n * Returns the list of sceneChild hierarchy starting from the scene\n *\n * @param {SceneChild} sceneChild\n * @returns {Array}\n * @memberof Scene\n */\n getParentsOfSceneChild(sceneChild) {\n const result = Scene.getParentsOfSceneChild(this, sceneChild);\n if (result) {\n result.splice(0, 1);\n return result;\n }\n return [];\n }\n /**\n * Returns the list of sceneChild hierarchy starting from the scene\n *\n * @static\n * @param {(Scene | SceneChild)} current\n * @param {SceneChild} sceneChild\n * @param {(Array)} [parents=[]]\n * @returns {(Array | null)}\n * @memberof Scene\n */\n static getParentsOfSceneChild(current, sceneChild, parents = []) {\n let result;\n if (current instanceof SceneChild_1.SceneChild) {\n if (current.id == sceneChild.id)\n return parents;\n if (current instanceof Shape_1.Shape && current.shape) {\n const tmpParents = parents.slice();\n tmpParents.push(current);\n if ((result = Scene.getParentsOfSceneChild(current.shape, sceneChild, tmpParents)))\n return result;\n }\n }\n if (current instanceof Scene || current instanceof Group_1.Group) {\n const children = current.getChildren();\n parents.push(current);\n for (let i = 0, len = children.length; i < len; i++) {\n const child = children[i];\n if ((result = Scene.getParentsOfSceneChild(child, sceneChild, parents)))\n return result;\n }\n parents.pop();\n }\n return null;\n }\n /**\n * Walk through the scene\n *\n * @static\n * @param {SceneChild} callbackk\n * @param {(Scene | SceneChild)} current\n * @memberof Scene\n */\n static walk(callback, current) {\n if (current instanceof SceneChild_1.SceneChild) {\n if (callback(current) === false)\n return false;\n if (current instanceof Shape_1.Shape && current.shape)\n if (Scene.walk(callback, current.shape) === false)\n return false;\n }\n if (current instanceof Scene || current instanceof Group_1.Group) {\n const children = current.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const child = children[i];\n if (Scene.walk(callback, child) === false)\n return false;\n }\n }\n }\n /**\n * Propagate scene to sceneChild (and children)\n *\n * @static\n * @param {SceneChild} sceneChild\n * @param {Scene} scene\n * @memberof Scene\n */\n static propagateToChilden(sceneChild, scene) {\n sceneChild.scene = scene;\n if (sceneChild instanceof Group_1.Group) {\n sceneChild.getChildren().forEach((item) => {\n Scene.propagateToChilden(item, scene);\n });\n }\n else if (sceneChild instanceof Shape_1.Shape && sceneChild.shape) {\n sceneChild.shape.scene = scene;\n Scene.propagateToChilden(sceneChild.shape, scene);\n }\n }\n}\nexports.Scene = Scene;\n//# sourceMappingURL=Scene.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SceneChild = void 0;\n/**\n * Autoincrement sceneChild default id\n *\n * @internal\n * @ignore\n */\nlet __id = 0;\n/**\n * The element to be added into a scene.\n * Preserve props, drawing order, generate and return buffers.\n * The only implementations of this class are Group and ShapeBase\n *\n * @abstract\n * @category Core.Abstract\n * @order 2\n * @class SceneChild\n */\nclass SceneChild {\n /**\n * Creates an instance of SceneChild.\n * Base values will be assigned in case they are not passed\n *\n * @param {ISceneChildSettings} settings\n */\n constructor(settings) {\n var _a;\n /**\n * Shape generation id\n * used for prevent buffer calculation\n *\n * @internal\n * @ignore\n */\n this.generateId = -1;\n this.id = (_a = settings.id) !== null && _a !== void 0 ? _a : ++__id;\n this.type = settings.type || 'SceneChild';\n this.name = settings.name || this.type + '_' + this.id;\n this.data = settings.data || {};\n this.props = {};\n }\n /**\n * Find this or form or children.\n * Overridden by classes that extend it\n *\n * @param {string | number} idOrName\n * @returns {(SceneChild | null)}\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n return null;\n }\n /**\n * Return the sceneChild properties\n *\n * @returns {Props}\n */\n getProps() {\n return this.props;\n }\n /**\n * Return a sceneChild prop or default value\n *\n * @param {keyof Props} key\n * @param {PropArguments} [propArguments]\n * @param {*} [defaultValue]\n * @returns {*}\n */\n getProp(key, propArguments, defaultValue) {\n var _a;\n return ((_a = this.props[key]) !== null && _a !== void 0 ? _a : defaultValue);\n }\n /**\n * Check SceneChild has prop\n *\n * @param {keyof Props} key\n * @returns\n */\n hasProp(key) {\n return typeof this.props[key] !== 'undefined';\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n */\n setPropUnsafe(key, value) {\n if (typeof key == 'string')\n this.props[key] = value;\n else\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n }\n}\nexports.SceneChild = SceneChild;\n//# sourceMappingURL=SceneChild.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Group = void 0;\nconst Scene_1 = require(\"./Scene\");\nconst SceneChild_1 = require(\"./SceneChild\");\nconst ShapeBase_1 = require(\"./shapes/ShapeBase\");\nconst Adapt_1 = require(\"./modifiers/Adapt\");\n/**\n * A SceneChild container, propagates properties to children\n *\n * @order 3\n * @category Core.Scene\n * @extends {SceneChild}\n * @example\n * ```javascript\n * // Group example\n *\n * const rect = new Urpflanze.Rect({\n * \tdistance: 100 // <- if a property is set the group will not overwrite it\n * })\n * const group = new Urpflanze.Group({\n * \trepetitions: 3,\n * \tdistance: 200\n * })\n *\n * group.add(rect)\n * group.add(new Urpflanze.Triangle())\n * ```\n * @class Group\n */\nclass Group extends SceneChild_1.SceneChild {\n /**\n * Creates an instance of Group\n *\n * @param {ISceneChildSettings} [settings={}]\n * @memberof Group\n */\n constructor(settings = {}) {\n settings.type = 'Group';\n super(settings);\n this.children = [];\n ['id', 'name', 'data', 'order', 'type'].forEach((prop) => {\n if (prop in settings)\n delete settings[prop];\n });\n this.props = settings;\n }\n /**\n * Check group has static children\n *\n * @returns {boolean}\n * @memberof Group\n */\n isStatic() {\n const children = this.children;\n for (let i = 0, len = children.length; i < len; i++)\n if (!children[i].isStatic())\n return false;\n return true;\n }\n /**\n * Check group has static children indexed\n *\n * @returns {boolean}\n * @memberof Group\n */\n isStaticIndexed() {\n const children = this.children;\n for (let i = 0, len = children.length; i < len; i++)\n if (!children[i].isStaticIndexed())\n return false;\n return true;\n }\n /**\n * Add item to Group\n *\n * @param {Array} items\n * @memberof Group\n */\n add(...items) {\n for (let i = 0, len = items.length; i < len; i++) {\n const item = items[i];\n const rawItemProps = item.getProps();\n Object.keys(this.props).forEach((propKey) => {\n if (typeof rawItemProps[propKey] === 'undefined')\n item.setProp(propKey, this.props[propKey]);\n });\n item.order =\n typeof item.order !== 'undefined'\n ? item.order\n : this.children.length > 0\n ? Math.max.apply(this, this.children.map(e => e.order || 0)) + 1\n : 0;\n this.scene && Scene_1.Scene.propagateToChilden(item, this.scene);\n this.children.push(item);\n }\n this.sortChildren();\n }\n /**\n * Sort children\n *\n * @memberof Group\n */\n sortChildren() {\n this.children.sort((a, b) => a.order - b.order);\n this.children = this.children.map((child, index) => {\n child.order = index;\n return child;\n });\n this.clearBuffer(true);\n }\n /**\n * Return shape children\n *\n * @returns {Array}\n * @memberof Group\n */\n getChildren() {\n return this.children;\n }\n /**\n * Find scene child from id or name\n *\n * @param {number | string} idOrName\n * @returns {(SceneChild | null)}\n * @memberof Group\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n const children = this.getChildren();\n for (let i = 0, len = children.length; i < len; i++) {\n const result = children[i].find(idOrName);\n if (result !== null)\n return result;\n }\n return null;\n }\n /**\n * Get item from group\n *\n * @param {number} index\n * @returns {(SceneChild | null)}\n * @memberof Group\n */\n get(index) {\n return index >= 0 && index < this.children.length ? this.children[index] : null;\n }\n /**\n * Remove item from group\n *\n * @param {number} index\n * @returns {(false | Array)}\n * @memberof Group\n */\n remove(index) {\n if (index >= 0 && index < this.children.length) {\n const removed = this.children.splice(index, 1);\n this.clearBuffer(true);\n return removed;\n }\n return false;\n }\n /**\n * Remove from id\n *\n * @param {number} id\n * @memberof Scene\n */\n removeFromId(id) {\n for (let i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i].id == id) {\n this.children.splice(i, 1);\n return this.clearBuffer(true);\n }\n }\n }\n /**\n * Generate children buffers\n *\n * @param {number} generateId\n * @param {boolean} [bDirectSceneChild=false]\n * @param {IPropArguments} [parentPropArguments]\n * @memberof Group\n */\n generate(generateId, bDirectSceneChild = false, parentPropArguments) {\n this.generateId = generateId;\n this.children.forEach(item => item.generate(generateId, bDirectSceneChild, parentPropArguments));\n }\n /**\n * Sum the children bounding\n *\n * @return {IShapeBounding}\n */\n getBounding() {\n const boundings = [];\n const bounding = Adapt_1.Bounding.empty();\n if (this.children.length > 0) {\n this.children.forEach(item => boundings.push(item.getBounding()));\n for (let i = 0, len = this.children.length; i < len; i++) {\n bounding.x = bounding.x > boundings[i].x ? boundings[i].x : bounding.x;\n bounding.y = bounding.y > boundings[i].y ? boundings[i].y : bounding.y;\n bounding.width = bounding.width < boundings[i].width ? boundings[i].width : bounding.width;\n bounding.height = bounding.height < boundings[i].height ? boundings[i].height : bounding.height;\n }\n bounding.cx = bounding.x + bounding.width / 2;\n bounding.cy = bounding.y + bounding.height / 2;\n }\n return bounding;\n }\n /**\n * Chear children buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @memberof Group\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.children.forEach(item => item.clearBuffer(bClearIndexed, false));\n if (this.scene && bPropagateToParents) {\n const parents = this.scene.getParentsOfSceneChild(this);\n parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */);\n }\n // if (bPropagateToParents && this.scene)\n // {\n // const parents = this.scene.getParentsOfSceneChild(this)\n // parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, true, false)\n // }\n // if (bPropagateToChildren)\n // {\n // this.children.forEach(sceneChild => sceneChild.clearBuffer(bClearIndexed, false, true))\n // }\n }\n /**\n * Set a single or multiple props\n *\n * @abstract\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @memberof SceneChild\n */\n setProp(key, value) {\n if (typeof key === 'object')\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n else\n this.props[key] = value;\n this.children.forEach(item => item.setProp(key, value));\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @memberof ShapeBase\n */\n setPropUnsafe(key, value) {\n super.setPropUnsafe(key, value);\n this.children.forEach(item => item.setPropUnsafe(key, value));\n }\n /**\n * Return length of buffer\n *\n * @param {IPropArguments} propArguments\n * @returns {number}\n * @memberof Group\n */\n getBufferLength(propArguments) {\n return this.children.map(sceneChild => sceneChild.getBufferLength(propArguments)).reduce((p, c) => p + c, 0);\n }\n /**\n * return a single buffer binded from children\n *\n * @returns {Float32Array}\n * @memberof Group\n */\n getBuffer() {\n const buffers = this.children\n .map(item => item.getBuffer())\n .filter(b => b !== undefined);\n const size = buffers.reduce((currLength, buffer) => currLength + buffer.length, 0);\n if (size > 0) {\n const result = new Float32Array(size);\n result.set(buffers[0], 0);\n for (let i = 1, offset = 0, len = buffers.length; i < len; i++) {\n offset += buffers[i - 1].length;\n result.set(buffers[i], offset);\n }\n return result;\n }\n return ShapeBase_1.ShapeBase.EMPTY_BUFFER;\n }\n /**\n * return a single buffer binded from children\n *\n * @returns {(Array | undefined)}\n * @memberof Group\n */\n getIndexedBuffer() {\n const indexed = this.children.map(item => item.getIndexedBuffer()).filter(b => b !== undefined);\n return [].concat.apply([], indexed);\n }\n /**\n * Call strem on children\n *\n * @param {(streamArguments: IStreamArguments) => void} callback\n * @memberof Group\n */\n stream(callback) {\n this.children.forEach(item => item.stream(callback));\n }\n}\nexports.Group = Group;\n//# sourceMappingURL=Group.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeBase = void 0;\nconst gl_matrix_1 = require(\"gl-matrix\");\nconst types_1 = require(\"../types\");\nconst glme = require(\"../math/gl-matrix-extensions\");\nconst Vec2_1 = require(\"../math/Vec2\");\nconst math_1 = require(\"../math\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst Utilities_1 = require(\"../Utilities\");\nconst SceneChild_1 = require(\"../SceneChild\");\nconst tmpMatrix = gl_matrix_1.mat4.create();\nconst transformMatrix = gl_matrix_1.mat4.create();\nconst perspectiveMatrix = gl_matrix_1.mat4.create();\nconst repetitionMatrix = gl_matrix_1.mat4.create();\n/**\n * Main class for shape generation\n *\n * @category Core.Abstract\n * @abstract\n * @class ShapeBase\n * @order 4\n * @extends {SceneChild}\n */\nclass ShapeBase extends SceneChild_1.SceneChild {\n /**\n * Creates an instance of ShapeBase\n *\n * @param {ISceneChildSettings} [settings={}]\n */\n constructor(settings = {}) {\n super(settings);\n /**\n * Flag used to determine if indexedBuffer has been generated\n *\n * @internal\n * @ignore\n */\n this.bIndexed = false;\n /**\n * Array used for index a vertex buffer\n * only for first level scene children\n *\n * @internal\n * @ignore\n */\n this.indexedBuffer = [];\n /**\n * The bounding inside the scene\n *\n * @type {IShapeBounding}\n */\n this.bounding = {\n cx: 0,\n cy: 0,\n x: -1,\n y: -1,\n width: 2,\n height: 2,\n };\n this.props = {\n distance: settings.distance,\n repetitions: settings.repetitions,\n rotateX: settings.rotateX,\n rotateY: settings.rotateY,\n rotateZ: settings.rotateZ,\n skewX: settings.skewX,\n skewY: settings.skewY,\n squeezeX: settings.squeezeX,\n squeezeY: settings.squeezeY,\n displace: settings.displace,\n translate: settings.translate,\n scale: settings.scale,\n transformOrigin: settings.transformOrigin,\n perspective: settings.perspective,\n perspectiveOrigin: settings.perspectiveOrigin,\n };\n this.anchor =\n settings.anchor && Array.isArray(settings.anchor)\n ? [\n typeof settings.anchor[0] === 'number'\n ? Utilities_1.clamp(-1, 1, settings.anchor[0]) * -1\n : settings.anchor[0] === 'left'\n ? 1\n : settings.anchor[0] === 'right'\n ? -1\n : 0,\n typeof settings.anchor[1] === 'number'\n ? Utilities_1.clamp(-1, 1, settings.anchor[1]) * -1\n : settings.anchor[1] === 'top'\n ? 1\n : settings.anchor[1] === 'bottom'\n ? -1\n : 0,\n ]\n : [0, 0];\n this.boundingType =\n typeof settings.boundingType === 'string'\n ? settings.boundingType === 'relative'\n ? types_1.EBoundingType.Relative\n : types_1.EBoundingType.Fixed\n : settings.boundingType || types_1.EBoundingType.Fixed;\n this.vertexCallback = settings.vertexCallback;\n }\n /**\n * Check if the shape should be generated every time\n *\n * @returns {boolean}\n */\n isStatic() {\n const props = this.props;\n return (typeof props.repetitions !== 'function' &&\n typeof props.distance !== 'function' &&\n typeof props.displace !== 'function' &&\n typeof props.scale !== 'function' &&\n typeof props.translate !== 'function' &&\n typeof props.skewX !== 'function' &&\n typeof props.skewY !== 'function' &&\n typeof props.squeezeX !== 'function' &&\n typeof props.squeezeY !== 'function' &&\n typeof props.rotateX !== 'function' &&\n typeof props.rotateY !== 'function' &&\n typeof props.rotateZ !== 'function' &&\n typeof props.transformOrigin !== 'function' &&\n typeof props.perspective !== 'function' &&\n typeof props.perspectiveOrigin !== 'function');\n }\n /**\n * Check if the indexedBuffer array needs to be recreated every time,\n * this can happen when a shape generates an array of vertices different in length at each repetition\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return typeof this.props.repetitions !== 'function';\n }\n /**\n * Return a prop value\n *\n * @param {keyof ISceneChildProps} key\n * @param {PropArguments} [propArguments]\n * @param {*} [defaultValue]\n * @returns {*}\n */\n getProp(key, propArguments, defaultValue) {\n let attribute = this.props[key];\n if (typeof attribute === 'function') {\n attribute = attribute(propArguments);\n }\n return typeof attribute === 'undefined' || Number.isNaN(attribute) ? defaultValue : attribute;\n }\n /**\n * Set a single or multiple props\n *\n * @param {(keyof ISceneChildProps | ISceneChildProps)} key\n * @param {*} [value]\n * @param {boolean} [bClearIndexed=false]\n */\n setProp(key, value, bClearIndexed = false) {\n if (typeof key === 'string') {\n bClearIndexed = bClearIndexed || key == 'repetitions';\n this.props[key] = value;\n }\n else {\n bClearIndexed = bClearIndexed || 'repetitions' in key;\n Object.keys(key).forEach((k) => (this.props[k] = key[k]));\n }\n this.clearBuffer(bClearIndexed, true);\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.buffer = undefined;\n if (bClearIndexed) {\n this.bIndexed = false;\n this.indexedBuffer = [];\n }\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n if (bPropagateToParents && this.scene && !this.scene.isFirstLevelChild(this)) {\n const parents = this.scene.getParentsOfSceneChild(this);\n parents.length > 0 && parents[parents.length - 1].clearBuffer(bClearIndexed, bPropagateToParents /* true */);\n }\n }\n /**\n * Update the vertex array if the shape is not static and update the indexedBuffer if it is also not static\n *\n * @param {number} generateId generation id\n * @param {boolean} [bDirectSceneChild=false] adjust shape of center of scene\n * @param {PropArguments} [parentPropArguments]\n */\n generate(generateId = 0, bDirectSceneChild = false, parentPropArguments) {\n var _a, _b;\n if (this.buffer && this.bStatic) {\n return;\n }\n this.generateId = generateId;\n if (!this.bStaticIndexed || !this.bIndexed)\n this.indexedBuffer = [];\n const propArguments = ShapeBase.getEmptyPropArguments(this, parentPropArguments);\n const repetition = propArguments.repetition;\n const repetitions = this.getProp('repetitions', propArguments, 1);\n const repetitionType = Array.isArray(repetitions) ? types_1.ERepetitionType.Matrix : types_1.ERepetitionType.Ring;\n const repetitionCount = Array.isArray(repetitions)\n ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0])\n : repetitions;\n const repetitionRowCount = Array.isArray(repetitions) ? repetitions[0] : repetitionCount;\n const repetitionColCount = Array.isArray(repetitions) ? (_b = repetitions[1]) !== null && _b !== void 0 ? _b : repetitions[0] : 1;\n const rowRepetition = repetition.row;\n rowRepetition.count = repetitionRowCount;\n const colRepetition = repetition.col;\n colRepetition.count = repetitionColCount;\n repetition.count = repetitionCount;\n repetition.col.count = repetitionColCount;\n repetition.row.count = repetitionRowCount;\n repetition.type = repetitionType;\n let totalBufferLength = 0;\n const buffers = [];\n let currentIndex = 0;\n const centerMatrix = gl_matrix_1.vec2.fromValues((repetitionColCount - 1) / 2, (repetitionRowCount - 1) / 2);\n const sceneAnchor = this.scene ? [this.scene.anchor[0], this.scene.anchor[1], 0] : [0, 0, 0];\n const tmpTotalShapeBounding = [undefined, undefined, undefined, undefined];\n const tmpSingleRepetitionBounding = [undefined, undefined, undefined, undefined];\n for (let currentRowRepetition = 0; currentRowRepetition < repetitionRowCount; currentRowRepetition++) {\n for (let currentColRepetition = 0; currentColRepetition < repetitionColCount; currentColRepetition++, currentIndex++) {\n repetition.index = currentIndex + 1;\n repetition.offset = repetitionCount > 1 ? currentIndex / (repetitionCount - 1) : 1;\n repetition.angle = repetitionType === types_1.ERepetitionType.Ring ? (math_1.PI2 / repetitionCount) * currentIndex : 0;\n colRepetition.index = currentColRepetition + 1;\n colRepetition.offset = repetitionColCount > 1 ? currentColRepetition / (repetitionColCount - 1) : 1;\n rowRepetition.index = currentRowRepetition + 1;\n rowRepetition.offset = repetitionRowCount > 1 ? currentRowRepetition / (repetitionRowCount - 1) : 1;\n // Generate primitives buffer recursively\n const buffer = this.generateBuffer(generateId, propArguments);\n const bufferLength = buffer.length;\n const bounding = this.getShapeBounding();\n buffers[currentIndex] = new Float32Array(bufferLength);\n totalBufferLength += bufferLength;\n {\n const distance = glme.toVec2(this.getProp('distance', propArguments, glme.VEC2_ZERO));\n const displace = this.getProp('displace', propArguments, 0);\n const scale = glme.toVec3(this.getProp('scale', propArguments, glme.VEC2_ONE), 1);\n const translate = glme.toVec3(this.getProp('translate', propArguments, glme.VEC2_ZERO), 0);\n const skewX = this.getProp('skewX', propArguments, 0);\n const skewY = this.getProp('skewY', propArguments, 0);\n const squeezeX = this.getProp('squeezeX', propArguments, 0);\n const squeezeY = this.getProp('squeezeY', propArguments, 0);\n const rotateX = this.getProp('rotateX', propArguments, 0);\n const rotateY = this.getProp('rotateY', propArguments, 0);\n const rotateZ = this.getProp('rotateZ', propArguments, 0);\n const perspective = Utilities_1.clamp(0, 1, this.getProp('perspective', propArguments, 0));\n const perspectiveOrigin = glme.toVec3(this.getProp('perspectiveOrigin', propArguments, glme.VEC2_ZERO), 0);\n const transformOrigin = glme.toVec3(this.getProp('transformOrigin', propArguments, glme.VEC2_ZERO), 0);\n let offset;\n switch (repetitionType) {\n case types_1.ERepetitionType.Ring:\n offset = gl_matrix_1.vec3.fromValues(distance[0], 0, 0);\n gl_matrix_1.vec3.rotateZ(offset, offset, glme.VEC3_ZERO, repetition.angle + displace);\n break;\n case types_1.ERepetitionType.Matrix:\n offset = gl_matrix_1.vec3.fromValues(distance[1] * (currentColRepetition - centerMatrix[0]), distance[0] * (currentRowRepetition - centerMatrix[1]), 0);\n break;\n }\n const perspectiveSize = perspective > 0 ? Math.max(bounding.width, bounding.height) / 2 : 1;\n const perspectiveValue = perspective > 0 ? perspectiveSize + (1 - perspective) * (perspectiveSize * 10) : 0;\n const bTransformOrigin = (this.boundingType === types_1.EBoundingType.Relative ? bounding.cx !== 0 || bounding.cy !== 0 : true) ||\n perspective !== 0 ||\n transformOrigin[0] !== 0 ||\n transformOrigin[1] !== 0;\n const bPerspectiveOrigin = perspectiveOrigin[0] !== 0 || perspectiveOrigin[1] !== 0;\n if (bTransformOrigin) {\n if (this.boundingType === types_1.EBoundingType.Relative) {\n transformOrigin[0] = transformOrigin[0] * (bounding.width / 2) + bounding.cx;\n transformOrigin[1] = transformOrigin[1] * (bounding.height / 2) + bounding.cy;\n }\n else {\n transformOrigin[0] *= bounding.width / 2;\n transformOrigin[1] *= bounding.height / 2;\n }\n transformOrigin[2] = perspectiveValue;\n }\n /**\n * Create Matrices\n */\n {\n /**\n * Create Transformation matrix\n */\n gl_matrix_1.mat4.identity(transformMatrix);\n bTransformOrigin && gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, transformOrigin);\n if (translate[0] !== 0 || translate[1] !== 0)\n gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, translate);\n if (skewX !== 0 || skewY !== 0) {\n glme.fromSkew(tmpMatrix, [skewX, skewY]);\n gl_matrix_1.mat4.multiply(transformMatrix, transformMatrix, tmpMatrix);\n }\n rotateX !== 0 && gl_matrix_1.mat4.rotateX(transformMatrix, transformMatrix, rotateX);\n rotateY !== 0 && gl_matrix_1.mat4.rotateY(transformMatrix, transformMatrix, rotateY);\n rotateZ !== 0 && gl_matrix_1.mat4.rotateZ(transformMatrix, transformMatrix, rotateZ);\n if (scale[0] !== 1 || scale[1] !== 1)\n gl_matrix_1.mat4.scale(transformMatrix, transformMatrix, scale);\n bTransformOrigin &&\n gl_matrix_1.mat4.translate(transformMatrix, transformMatrix, gl_matrix_1.vec3.scale(transformOrigin, transformOrigin, -1));\n /**\n * Create Perspective matrix\n */\n if (perspectiveValue > 0) {\n if (bPerspectiveOrigin) {\n if (this.boundingType === types_1.EBoundingType.Relative) {\n perspectiveOrigin[0] = perspectiveOrigin[0] * (bounding.width / 2) + bounding.cx;\n perspectiveOrigin[1] = perspectiveOrigin[1] * (bounding.height / 2) + bounding.cy;\n }\n else {\n perspectiveOrigin[0] *= bounding.width / 2;\n perspectiveOrigin[1] *= bounding.height / 2;\n }\n perspectiveOrigin[2] = 0;\n }\n gl_matrix_1.mat4.perspective(perspectiveMatrix, -Math.PI / 2, 1, 0, Infinity);\n }\n /**\n * Create Repetition matrix\n */\n gl_matrix_1.mat4.identity(repetitionMatrix);\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, offset);\n if (bDirectSceneChild) {\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, sceneAnchor);\n }\n /**\n * Apply anchor\n */\n const shapeAnchor = [this.anchor[0] * (bounding.width / 2), this.anchor[1] * (bounding.height / 2), 0];\n gl_matrix_1.mat4.translate(repetitionMatrix, repetitionMatrix, shapeAnchor);\n if (repetitionType === types_1.ERepetitionType.Ring)\n gl_matrix_1.mat4.rotateZ(repetitionMatrix, repetitionMatrix, repetition.angle + displace);\n }\n Adapt_1.Bounding.clear(tmpSingleRepetitionBounding);\n // Apply matrices on vertex\n for (let bufferIndex = 0; bufferIndex < bufferLength; bufferIndex += 2) {\n const vertex = [buffer[bufferIndex], buffer[bufferIndex + 1], perspectiveValue];\n {\n // Apply squeeze, can be insert into transformMatrix?\n squeezeX !== 0 && Vec2_1.default.squeezeX(vertex, squeezeX);\n squeezeY !== 0 && Vec2_1.default.squeezeY(vertex, squeezeY);\n // Apply transforms\n gl_matrix_1.vec3.transformMat4(vertex, vertex, transformMatrix);\n // Apply perspective\n if (perspectiveValue > 0) {\n bPerspectiveOrigin && gl_matrix_1.vec3.add(vertex, vertex, perspectiveOrigin);\n gl_matrix_1.vec3.transformMat4(vertex, vertex, perspectiveMatrix);\n gl_matrix_1.vec3.scale(vertex, vertex, perspectiveValue);\n bPerspectiveOrigin && gl_matrix_1.vec3.sub(vertex, vertex, perspectiveOrigin);\n }\n // apply repetition matrix\n gl_matrix_1.vec3.transformMat4(vertex, vertex, repetitionMatrix);\n // custom vertex manipulation\n if (typeof this.vertexCallback !== 'undefined') {\n const index = bufferIndex / 2;\n const count = bufferLength / 2;\n const vertexRepetition = {\n index: index + 1,\n count,\n offset: count > 1 ? index / (count - 1) : 1,\n };\n this.vertexCallback(vertex, vertexRepetition, propArguments);\n }\n }\n buffers[currentIndex][bufferIndex] = vertex[0];\n buffers[currentIndex][bufferIndex + 1] = vertex[1];\n Adapt_1.Bounding.add(tmpSingleRepetitionBounding, vertex[0], vertex[1]);\n Adapt_1.Bounding.add(tmpTotalShapeBounding, vertex[0], vertex[1]);\n }\n }\n // Bounding.sum(tmpTotalShapeBounding, tmpSingleRepetitionBounding)\n // After buffer creation, add a frame into indexedBuffer if not static or update bounding\n const singleRepetitionBounding = { cx: 0, cy: 0, x: -1, y: -1, width: 2, height: 2 };\n Adapt_1.Bounding.bind(singleRepetitionBounding, tmpSingleRepetitionBounding);\n if (!this.bStaticIndexed || !this.bIndexed) {\n this.addIndex(bufferLength, repetition, singleRepetitionBounding);\n }\n }\n }\n Adapt_1.Bounding.bind(this.bounding, tmpTotalShapeBounding);\n this.buffer = new Float32Array(totalBufferLength);\n for (let i = 0, offset = 0, len = buffers.length; i < len; offset += buffers[i].length, i++)\n this.buffer.set(buffers[i], offset);\n this.bIndexed = true;\n }\n /**\n * Return current shape (whit repetions) bounding\n *\n * @return {*} {IShapeBounding}\n */\n getBounding() {\n return this.bounding;\n }\n /**\n * Get number of repetitions\n *\n * @returns {number}\n */\n getRepetitionCount() {\n var _a;\n const repetitions = this.getProp('repetitions', undefined, 1);\n return Array.isArray(repetitions) ? repetitions[0] * ((_a = repetitions[1]) !== null && _a !== void 0 ? _a : repetitions[0]) : repetitions;\n }\n /**\n * Return buffer\n *\n * @returns {(Float32Array | undefined)}\n */\n getBuffer() {\n return this.buffer;\n }\n /**\n * Return indexed buffer\n *\n * @returns {(Array> | undefined)}\n */\n getIndexedBuffer() {\n return this.indexedBuffer;\n }\n /**\n * Return number of encapsulation\n *\n * @param {IBufferIndex} index\n * @returns {number}\n */\n static getIndexParentLevel(index) {\n if (typeof index.parent === 'undefined')\n return 0;\n let currentParent = index.parent;\n let currentParentLevel = 1;\n while (typeof currentParent.parent !== 'undefined') {\n currentParentLevel++;\n currentParent = currentParent.parent;\n }\n return currentParentLevel;\n }\n /**\n * Stream buffer\n *\n * @param {(TStreamCallback} callback\n */\n stream(callback) {\n if (this.buffer && this.indexedBuffer) {\n for (let i = 0, j = 0, len = this.indexedBuffer.length; i < len; i++) {\n const currentIndexing = this.indexedBuffer[i];\n callback({\n buffer: this.buffer,\n frameLength: currentIndexing.frameLength,\n frameBufferIndex: j,\n currentIndexing: currentIndexing,\n currentShapeIndex: i,\n totalShapes: len,\n });\n j += currentIndexing.frameLength;\n }\n }\n }\n /**\n * Return empty propArguments\n *\n * @static\n * @param {ShapeBase} shape\n * @return {*} {PropArguments}\n */\n static getEmptyPropArguments(shape, parentPropArguments) {\n const repetition = {\n type: types_1.ERepetitionType.Ring,\n angle: 0,\n index: 1,\n offset: 1,\n count: 1,\n row: { index: 1, offset: 1, count: 1 },\n col: { index: 1, offset: 1, count: 1 },\n };\n return {\n repetition,\n shape,\n parent: parentPropArguments,\n };\n }\n}\nexports.ShapeBase = ShapeBase;\n/**\n * Empty buffer\n *\n * @internal\n * @ignore\n */\nShapeBase.EMPTY_BUFFER = new Float32Array(0);\n/**\n * Empty BaseRepetition\n *\n * @internal\n * @ignore\n */\nShapeBase.getEmptySimpleRepetition = () => ({\n index: 1,\n offset: 1,\n count: 1,\n});\n/**\n * Empty Repetition\n *\n * @internal\n * @ignore\n */\nShapeBase.getEmptyRepetition = () => ({\n type: types_1.ERepetitionType.Ring,\n angle: 0,\n ...ShapeBase.getEmptySimpleRepetition(),\n row: ShapeBase.getEmptySimpleRepetition(),\n col: ShapeBase.getEmptySimpleRepetition(),\n});\n//# sourceMappingURL=ShapeBase.js.map","import * as glMatrix from \"./common.js\";\nimport * as mat2 from \"./mat2.js\";\nimport * as mat2d from \"./mat2d.js\";\nimport * as mat3 from \"./mat3.js\";\nimport * as mat4 from \"./mat4.js\";\nimport * as quat from \"./quat.js\";\nimport * as quat2 from \"./quat2.js\";\nimport * as vec2 from \"./vec2.js\";\nimport * as vec3 from \"./vec3.js\";\nimport * as vec4 from \"./vec4.js\";\nexport { glMatrix, mat2, mat2d, mat3, mat4, quat, quat2, vec2, vec3, vec4 };","/**\r\n * Common utilities\r\n * @module glMatrix\r\n */\n// Configuration Constants\nexport var EPSILON = 0.000001;\nexport var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexport var RANDOM = Math.random;\n/**\r\n * Sets the type of array used when creating new vectors and matrices\r\n *\r\n * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array\r\n */\n\nexport function setMatrixArrayType(type) {\n ARRAY_TYPE = type;\n}\nvar degree = Math.PI / 180;\n/**\r\n * Convert Degree To Radian\r\n *\r\n * @param {Number} a Angle in Degrees\r\n */\n\nexport function toRadian(a) {\n return a * degree;\n}\n/**\r\n * Tests whether or not the arguments have approximately the same value, within an absolute\r\n * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less\r\n * than or equal to 1.0, and a relative tolerance is used for larger values)\r\n *\r\n * @param {Number} a The first number to test.\r\n * @param {Number} b The second number to test.\r\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n}\nif (!Math.hypot) Math.hypot = function () {\n var y = 0,\n i = arguments.length;\n\n while (i--) {\n y += arguments[i] * arguments[i];\n }\n\n return Math.sqrt(y);\n};","import * as glMatrix from \"./common.js\";\n/**\r\n * 2x2 Matrix\r\n * @module mat2\r\n */\n\n/**\r\n * Creates a new identity mat2\r\n *\r\n * @returns {mat2} a new 2x2 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\r\n * Creates a new mat2 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat2} a matrix to clone\r\n * @returns {mat2} a new 2x2 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Copy the values from one mat2 to another\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set a mat2 to the identity matrix\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @returns {mat2} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\r\n * Create a new mat2 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\r\n * @returns {mat2} out A new 2x2 matrix\r\n */\n\nexport function fromValues(m00, m01, m10, m11) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\r\n * Set the components of a mat2 to the given values\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\r\n * @returns {mat2} out\r\n */\n\nexport function set(out, m00, m01, m10, m11) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\r\n * Transpose the values of a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache\n // some values\n if (out === a) {\n var a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3]; // Calculate the determinant\n\n var det = a0 * a3 - a2 * a1;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nexport function adjoint(out, a) {\n // Caching this value is nessecary if out == a\n var a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat2\r\n *\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n}\n/**\r\n * Multiplies two mat2's\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n}\n/**\r\n * Rotates a mat2 by the given angle\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n}\n/**\r\n * Scales the mat2 by the dimensions in the given vec2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to rotate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat2} out\r\n **/\n\nexport function scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n *\r\n * @param {mat2} out mat2 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n *\r\n * @param {mat2} out mat2 receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat2} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n}\n/**\r\n * Returns a string representation of a mat2\r\n *\r\n * @param {ReadonlyMat2} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat2\r\n *\r\n * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3]);\n}\n/**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @param {ReadonlyMat2} L the lower triangular matrix\r\n * @param {ReadonlyMat2} D the diagonal matrix\r\n * @param {ReadonlyMat2} U the upper triangular matrix\r\n * @param {ReadonlyMat2} a the input matrix to factorize\r\n */\n\nexport function LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n}\n/**\r\n * Adds two mat2's\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat2} a The first matrix.\r\n * @param {ReadonlyMat2} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat2} a The first matrix.\r\n * @param {ReadonlyMat2} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat2} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\r\n * Adds two mat2's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat2} out the receiving vector\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat2} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\r\n * Alias for {@link mat2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat2.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 2x3 Matrix\r\n * @module mat2d\r\n * @description\r\n * A mat2d contains six elements defined as:\r\n *
\r\n * [a, b,\r\n *  c, d,\r\n *  tx, ty]\r\n * 
\r\n * This is a short form for the 3x3 matrix:\r\n *
\r\n * [a, b, 0,\r\n *  c, d, 0,\r\n *  tx, ty, 1]\r\n * 
\r\n * The last column is ignored so the array is shorter and operations are faster.\r\n */\n\n/**\r\n * Creates a new identity mat2d\r\n *\r\n * @returns {mat2d} a new 2x3 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(6);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[4] = 0;\n out[5] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\r\n * Creates a new mat2d initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat2d} a matrix to clone\r\n * @returns {mat2d} a new 2x3 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\r\n * Copy the values from one mat2d to another\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\r\n * Set a mat2d to the identity matrix\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Create a new mat2d with the given values\r\n *\r\n * @param {Number} a Component A (index 0)\r\n * @param {Number} b Component B (index 1)\r\n * @param {Number} c Component C (index 2)\r\n * @param {Number} d Component D (index 3)\r\n * @param {Number} tx Component TX (index 4)\r\n * @param {Number} ty Component TY (index 5)\r\n * @returns {mat2d} A new mat2d\r\n */\n\nexport function fromValues(a, b, c, d, tx, ty) {\n var out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\r\n * Set the components of a mat2d to the given values\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {Number} a Component A (index 0)\r\n * @param {Number} b Component B (index 1)\r\n * @param {Number} c Component C (index 2)\r\n * @param {Number} d Component D (index 3)\r\n * @param {Number} tx Component TX (index 4)\r\n * @param {Number} ty Component TY (index 5)\r\n * @returns {mat2d} out\r\n */\n\nexport function set(out, a, b, c, d, tx, ty) {\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\r\n * Inverts a mat2d\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {mat2d} out\r\n */\n\nexport function invert(out, a) {\n var aa = a[0],\n ab = a[1],\n ac = a[2],\n ad = a[3];\n var atx = a[4],\n aty = a[5];\n var det = aa * ad - ab * ac;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n}\n/**\r\n * Multiplies two mat2d's\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n}\n/**\r\n * Rotates a mat2d by the given angle\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2d} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\r\n * Scales the mat2d by the dimensions in the given vec2\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to translate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat2d} out\r\n **/\n\nexport function scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\r\n * Translates the mat2d by the dimensions in the given vec2\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to translate\r\n * @param {ReadonlyVec2} v the vec2 to translate the matrix by\r\n * @returns {mat2d} out\r\n **/\n\nexport function translate(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.rotate(dest, dest, rad);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2d} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.scale(dest, dest, vec);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat2d} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.translate(dest, dest, vec);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {ReadonlyVec2} v Translation vector\r\n * @returns {mat2d} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n}\n/**\r\n * Returns a string representation of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat2d(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1);\n}\n/**\r\n * Adds two mat2d's\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat2d} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n}\n/**\r\n * Adds two mat2d's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat2d} out the receiving vector\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat2d} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat2d} a The first matrix.\r\n * @param {ReadonlyMat2d} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat2d} a The first matrix.\r\n * @param {ReadonlyMat2d} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5));\n}\n/**\r\n * Alias for {@link mat2d.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat2d.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 3x3 Matrix\r\n * @module mat3\r\n */\n\n/**\r\n * Creates a new identity mat3\r\n *\r\n * @returns {mat3} a new 3x3 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(9);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n }\n\n out[0] = 1;\n out[4] = 1;\n out[8] = 1;\n return out;\n}\n/**\r\n * Copies the upper-left 3x3 values into the given mat3.\r\n *\r\n * @param {mat3} out the receiving 3x3 matrix\r\n * @param {ReadonlyMat4} a the source 4x4 matrix\r\n * @returns {mat3} out\r\n */\n\nexport function fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n}\n/**\r\n * Creates a new mat3 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat3} a matrix to clone\r\n * @returns {mat3} a new 3x3 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Copy the values from one mat3 to another\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Create a new mat3 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\r\n * @returns {mat3} A new mat3\r\n */\n\nexport function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\r\n * Set the components of a mat3 to the given values\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\r\n * @returns {mat3} out\r\n */\n\nexport function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\r\n * Set a mat3 to the identity matrix\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @returns {mat3} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Transpose the values of a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b01 = a22 * a11 - a12 * a21;\n var b11 = -a22 * a10 + a12 * a20;\n var b21 = a21 * a10 - a11 * a20; // Calculate the determinant\n\n var det = a00 * b01 + a01 * b11 + a02 * b21;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nexport function adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat3\r\n *\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n}\n/**\r\n * Multiplies two mat3's\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b00 = b[0],\n b01 = b[1],\n b02 = b[2];\n var b10 = b[3],\n b11 = b[4],\n b12 = b[5];\n var b20 = b[6],\n b21 = b[7],\n b22 = b[8];\n out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n return out;\n}\n/**\r\n * Translate a mat3 by the given vector\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to translate\r\n * @param {ReadonlyVec2} v vector to translate by\r\n * @returns {mat3} out\r\n */\n\nexport function translate(out, a, v) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n x = v[0],\n y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n}\n/**\r\n * Rotates a mat3 by the given angle\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat3} out\r\n */\n\nexport function rotate(out, a, rad) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n}\n/**\r\n * Scales the mat3 by the dimensions in the given vec2\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to rotate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat3} out\r\n **/\n\nexport function scale(out, a, v) {\n var x = v[0],\n y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyVec2} v Translation vector\r\n * @returns {mat3} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat3} out\r\n */\n\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat3} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Copies the values from a mat2d into a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to copy\r\n * @returns {mat3} out\r\n **/\n\nexport function fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n}\n/**\r\n * Calculates a 3x3 matrix from the given quaternion\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyQuat} q Quaternion to create matrix from\r\n *\r\n * @returns {mat3} out\r\n */\n\nexport function fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n}\n/**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n *\r\n * @returns {mat3} out\r\n */\n\nexport function normalFromMat4(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n}\n/**\r\n * Generates a 2D projection matrix with the given bounds\r\n *\r\n * @param {mat3} out mat3 frustum matrix will be written into\r\n * @param {number} width Width of your gl context\r\n * @param {number} height Height of gl context\r\n * @returns {mat3} out\r\n */\n\nexport function projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n}\n/**\r\n * Returns a string representation of a mat3\r\n *\r\n * @param {ReadonlyMat3} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat3\r\n *\r\n * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);\n}\n/**\r\n * Adds two mat3's\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat3} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n}\n/**\r\n * Adds two mat3's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat3} out the receiving vector\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat3} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat3} a The first matrix.\r\n * @param {ReadonlyMat3} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat3} a The first matrix.\r\n * @param {ReadonlyMat3} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7],\n a8 = a[8];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7],\n b8 = b[8];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8));\n}\n/**\r\n * Alias for {@link mat3.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat3.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n/**\r\n * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied.\r\n * @module mat4\r\n */\n\n/**\r\n * Creates a new identity mat4\r\n *\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(16);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n }\n\n out[0] = 1;\n out[5] = 1;\n out[10] = 1;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a new mat4 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat4} a matrix to clone\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Copy the values from one mat4 to another\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Create a new mat4 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} A new mat4\r\n */\n\nexport function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\r\n * Set the components of a mat4 to the given values\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} out\r\n */\n\nexport function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\r\n * Set a mat4 to the identity matrix\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @returns {mat4} out\r\n */\n\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Transpose the values of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a12 = a[6],\n a13 = a[7];\n var a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nexport function adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22);\n out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\n out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12);\n out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\n out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\n out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22);\n out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\n out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12);\n out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21);\n out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\n out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11);\n out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\n out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\n out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21);\n out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\n out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11);\n return out;\n}\n/**\r\n * Calculates the determinant of a mat4\r\n *\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nexport function determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n}\n/**\r\n * Multiplies two mat4s\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15]; // Cache only the current line of the second matrix\n\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n/**\r\n * Translate a mat4 by the given vector\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to translate\r\n * @param {ReadonlyVec3} v vector to translate by\r\n * @returns {mat4} out\r\n */\n\nexport function translate(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n\n return out;\n}\n/**\r\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to scale\r\n * @param {ReadonlyVec3} v the vec3 to scale the matrix by\r\n * @returns {mat4} out\r\n **/\n\nexport function scale(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Rotates a mat4 by the given angle around the given axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nexport function rotate(out, a, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n var b00, b01, b02;\n var b10, b11, b12;\n var b20, b21, b22;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11]; // Construct the elements of the rotation matrix\n\n b00 = x * x * t + c;\n b01 = y * x * t + z * s;\n b02 = z * x * t - y * s;\n b10 = x * y * t - z * s;\n b11 = y * y * t + c;\n b12 = z * y * t + x * s;\n b20 = x * z * t + y * s;\n b21 = y * z * t - x * s;\n b22 = z * z * t + c; // Perform rotation-specific matrix multiplication\n\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the X axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateX(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Y axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateY(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Z axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyVec3} v Scaling vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotation(out, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c; // Perform rotation-specific matrix multiplication\n\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromXRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromYRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nexport function fromZRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslation(out, q, v) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a new mat4 from a dual quat.\r\n *\r\n * @param {mat4} out Matrix\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @returns {mat4} mat4 receiving operation result\r\n */\n\nexport function fromQuat2(out, a) {\n var translation = new glMatrix.ARRAY_TYPE(3);\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense\n\n if (magnitude > 0) {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n\n fromRotationTranslation(out, a, translation);\n return out;\n}\n/**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nexport function getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n}\n/**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion paramter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nexport function getScaling(out, mat) {\n var m11 = mat[0];\n var m12 = mat[1];\n var m13 = mat[2];\n var m21 = mat[4];\n var m22 = mat[5];\n var m23 = mat[6];\n var m31 = mat[8];\n var m32 = mat[9];\n var m33 = mat[10];\n out[0] = Math.hypot(m11, m12, m13);\n out[1] = Math.hypot(m21, m22, m23);\n out[2] = Math.hypot(m31, m32, m33);\n return out;\n}\n/**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @param {quat} out Quaternion to receive the rotation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {quat} out\r\n */\n\nexport function getRotation(out, mat) {\n var scaling = new glMatrix.ARRAY_TYPE(3);\n getScaling(scaling, mat);\n var is1 = 1 / scaling[0];\n var is2 = 1 / scaling[1];\n var is3 = 1 / scaling[2];\n var sm11 = mat[0] * is1;\n var sm12 = mat[1] * is2;\n var sm13 = mat[2] * is3;\n var sm21 = mat[4] * is1;\n var sm22 = mat[5] * is2;\n var sm23 = mat[6] * is3;\n var sm31 = mat[8] * is1;\n var sm32 = mat[9] * is2;\n var sm33 = mat[10] * is3;\n var trace = sm11 + sm22 + sm33;\n var S = 0;\n\n if (trace > 0) {\n S = Math.sqrt(trace + 1.0) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @param {ReadonlyVec3} s Scaling vector\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslationScale(out, q, v, s) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @param {ReadonlyVec3} s Scaling vector\r\n * @param {ReadonlyVec3} o The origin vector around which to scale and rotate\r\n * @returns {mat4} out\r\n */\n\nexport function fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n var ox = o[0];\n var oy = o[1];\n var oz = o[2];\n var out0 = (1 - (yy + zz)) * sx;\n var out1 = (xy + wz) * sx;\n var out2 = (xz - wy) * sx;\n var out4 = (xy - wz) * sy;\n var out5 = (1 - (xx + zz)) * sy;\n var out6 = (yz + wx) * sy;\n var out8 = (xz + wy) * sz;\n var out9 = (yz - wx) * sz;\n var out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n}\n/**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyQuat} q Quaternion to create matrix from\r\n *\r\n * @returns {mat4} out\r\n */\n\nexport function fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a frustum matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Number} left Left bound of the frustum\r\n * @param {Number} right Right bound of the frustum\r\n * @param {Number} bottom Bottom bound of the frustum\r\n * @param {Number} top Top bound of the frustum\r\n * @param {Number} near Near bound of the frustum\r\n * @param {Number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function frustum(out, left, right, bottom, top, near, far) {\n var rl = 1 / (right - left);\n var tb = 1 / (top - bottom);\n var nf = 1 / (near - far);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near * 2 * nf;\n out[15] = 0;\n return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} fovy Vertical field of view in radians\r\n * @param {number} aspect Aspect ratio. typically viewport width/height\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum, can be null or Infinity\r\n * @returns {mat4} out\r\n */\n\nexport function perspective(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n\n return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function perspectiveFromFieldOfView(out, fov, near, far) {\n var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);\n var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);\n var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);\n var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);\n var xScale = 2.0 / (leftTan + rightTan);\n var yScale = 2.0 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n out[4] = 0.0;\n out[5] = yScale;\n out[6] = 0.0;\n out[7] = 0.0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1.0;\n out[12] = 0.0;\n out[13] = 0.0;\n out[14] = far * near / (near - far);\n out[15] = 0.0;\n return out;\n}\n/**\r\n * Generates a orthogonal projection matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} left Left bound of the frustum\r\n * @param {number} right Right bound of the frustum\r\n * @param {number} bottom Bottom bound of the frustum\r\n * @param {number} top Top bound of the frustum\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nexport function ortho(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {ReadonlyVec3} eye Position of the viewer\r\n * @param {ReadonlyVec3} center Point the viewer is looking at\r\n * @param {ReadonlyVec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nexport function lookAt(out, eye, center, up) {\n var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;\n var eyex = eye[0];\n var eyey = eye[1];\n var eyez = eye[2];\n var upx = up[0];\n var upy = up[1];\n var upz = up[2];\n var centerx = center[0];\n var centery = center[1];\n var centerz = center[2];\n\n if (Math.abs(eyex - centerx) < glMatrix.EPSILON && Math.abs(eyey - centery) < glMatrix.EPSILON && Math.abs(eyez - centerz) < glMatrix.EPSILON) {\n return identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n len = 1 / Math.hypot(z0, z1, z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.hypot(x0, x1, x2);\n\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n len = Math.hypot(y0, y1, y2);\n\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a matrix that makes something look at something else.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {ReadonlyVec3} eye Position of the viewer\r\n * @param {ReadonlyVec3} center Point the viewer is looking at\r\n * @param {ReadonlyVec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nexport function targetTo(out, eye, target, up) {\n var eyex = eye[0],\n eyey = eye[1],\n eyez = eye[2],\n upx = up[0],\n upy = up[1],\n upz = up[2];\n var z0 = eyex - target[0],\n z1 = eyey - target[1],\n z2 = eyez - target[2];\n var len = z0 * z0 + z1 * z1 + z2 * z2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n\n var x0 = upy * z2 - upz * z1,\n x1 = upz * z0 - upx * z2,\n x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n}\n/**\r\n * Returns a string representation of a mat4\r\n *\r\n * @param {ReadonlyMat4} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nexport function str(a) {\n return \"mat4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \", \" + a[9] + \", \" + a[10] + \", \" + a[11] + \", \" + a[12] + \", \" + a[13] + \", \" + a[14] + \", \" + a[15] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat4\r\n *\r\n * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nexport function frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);\n}\n/**\r\n * Adds two mat4's\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat4} out\r\n */\n\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n}\n/**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat4} out the receiving vector\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat4} out\r\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat4} a The first matrix.\r\n * @param {ReadonlyMat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat4} a The first matrix.\r\n * @param {ReadonlyMat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var a8 = a[8],\n a9 = a[9],\n a10 = a[10],\n a11 = a[11];\n var a12 = a[12],\n a13 = a[13],\n a14 = a[14],\n a15 = a[15];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n var b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n var b8 = b[8],\n b9 = b[9],\n b10 = b[10],\n b11 = b[11];\n var b12 = b[12],\n b13 = b[13],\n b14 = b[14],\n b15 = b[15];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15));\n}\n/**\r\n * Alias for {@link mat4.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link mat4.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\nimport * as mat3 from \"./mat3.js\";\nimport * as vec3 from \"./vec3.js\";\nimport * as vec4 from \"./vec4.js\";\n/**\r\n * Quaternion\r\n * @module quat\r\n */\n\n/**\r\n * Creates a new identity quat\r\n *\r\n * @returns {quat} a new quaternion\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n out[3] = 1;\n return out;\n}\n/**\r\n * Set a quat to the identity quaternion\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @returns {quat} out\r\n */\n\nexport function identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyVec3} axis the axis around which to rotate\r\n * @param {Number} rad the angle in radians\r\n * @returns {quat} out\r\n **/\n\nexport function setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n var s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n}\n/**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @param {vec3} out_axis Vector receiving the axis of rotation\r\n * @param {ReadonlyQuat} q Quaternion to be decomposed\r\n * @return {Number} Angle, in radians, of the rotation\r\n */\n\nexport function getAxisAngle(out_axis, q) {\n var rad = Math.acos(q[3]) * 2.0;\n var s = Math.sin(rad / 2.0);\n\n if (s > glMatrix.EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n // If s is zero, return any axis (no rotation - axis does not matter)\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n\n return rad;\n}\n/**\r\n * Gets the angular distance between two unit quaternions\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\n\nexport function getAngle(a, b) {\n var dotproduct = dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n}\n/**\r\n * Multiplies two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {quat} out\r\n */\n\nexport function multiply(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the X axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateX(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateY(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var by = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bz = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n}\n/**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate W component of\r\n * @returns {quat} out\r\n */\n\nexport function calculateW(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\n return out;\n}\n/**\r\n * Calculate the exponential of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @returns {quat} out\r\n */\n\nexport function exp(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var et = Math.exp(w);\n var s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n}\n/**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @returns {quat} out\r\n */\n\nexport function ln(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n}\n/**\r\n * Calculate the scalar power of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @param {Number} b amount to scale the quaternion by\r\n * @returns {quat} out\r\n */\n\nexport function pow(out, a, b) {\n ln(out, a);\n scale(out, out, b);\n exp(out, out);\n return out;\n}\n/**\r\n * Performs a spherical linear interpolation between two quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n */\n\nexport function slerp(out, a, b, t) {\n // benchmarks:\n // http://jsperf.com/quaternion-slerp-implementations\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n var omega, cosom, sinom, scale0, scale1; // calc cosine\n\n cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary)\n\n if (cosom < 0.0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n } // calculate coefficients\n\n\n if (1.0 - cosom > glMatrix.EPSILON) {\n // standard case (slerp)\n omega = Math.acos(cosom);\n sinom = Math.sin(omega);\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n // \"from\" and \"to\" quaternions are very close\n // ... so we can do a linear interpolation\n scale0 = 1.0 - t;\n scale1 = t;\n } // calculate final values\n\n\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n}\n/**\r\n * Generates a random unit quaternion\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @returns {quat} out\r\n */\n\nexport function random(out) {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n var u1 = glMatrix.RANDOM();\n var u2 = glMatrix.RANDOM();\n var u3 = glMatrix.RANDOM();\n var sqrt1MinusU1 = Math.sqrt(1 - u1);\n var sqrtU1 = Math.sqrt(u1);\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n}\n/**\r\n * Calculates the inverse of a quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate inverse of\r\n * @returns {quat} out\r\n */\n\nexport function invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\n\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n}\n/**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate conjugate of\r\n * @returns {quat} out\r\n */\n\nexport function conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyMat3} m rotation matrix\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport function fromMat3(out, m) {\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n var fTrace = m[0] + m[4] + m[8];\n var fRoot;\n\n if (fTrace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\n\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot; // 1/(4w)\n\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n // |w| <= 1/2\n var i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n var j = (i + 1) % 3;\n var k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n\n return out;\n}\n/**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {x} Angle to rotate around X axis in degrees.\r\n * @param {y} Angle to rotate around Y axis in degrees.\r\n * @param {z} Angle to rotate around Z axis in degrees.\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport function fromEuler(out, x, y, z) {\n var halfToRad = 0.5 * Math.PI / 180.0;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n var sx = Math.sin(x);\n var cx = Math.cos(x);\n var sy = Math.sin(y);\n var cy = Math.cos(y);\n var sz = Math.sin(z);\n var cz = Math.cos(z);\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n return out;\n}\n/**\r\n * Returns a string representation of a quatenion\r\n *\r\n * @param {ReadonlyQuat} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"quat(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n *\r\n * @param {ReadonlyQuat} a quaternion to clone\r\n * @returns {quat} a new quaternion\r\n * @function\r\n */\n\nexport var clone = vec4.clone;\n/**\r\n * Creates a new quat initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {quat} a new quaternion\r\n * @function\r\n */\n\nexport var fromValues = vec4.fromValues;\n/**\r\n * Copy the values from one quat to another\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the source quaternion\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var copy = vec4.copy;\n/**\r\n * Set the components of a quat to the given values\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var set = vec4.set;\n/**\r\n * Adds two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var add = vec4.add;\n/**\r\n * Alias for {@link quat.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Scales a quat by a scalar number\r\n *\r\n * @param {quat} out the receiving vector\r\n * @param {ReadonlyQuat} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var scale = vec4.scale;\n/**\r\n * Calculates the dot product of two quat's\r\n *\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {Number} dot product of a and b\r\n * @function\r\n */\n\nexport var dot = vec4.dot;\n/**\r\n * Performs a linear interpolation between two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var lerp = vec4.lerp;\n/**\r\n * Calculates the length of a quat\r\n *\r\n * @param {ReadonlyQuat} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport var length = vec4.length;\n/**\r\n * Alias for {@link quat.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Calculates the squared length of a quat\r\n *\r\n * @param {ReadonlyQuat} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n * @function\r\n */\n\nexport var squaredLength = vec4.squaredLength;\n/**\r\n * Alias for {@link quat.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Normalize a quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quaternion to normalize\r\n * @returns {quat} out\r\n * @function\r\n */\n\nexport var normalize = vec4.normalize;\n/**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyQuat} a The first quaternion.\r\n * @param {ReadonlyQuat} b The second quaternion.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport var exactEquals = vec4.exactEquals;\n/**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyQuat} a The first vector.\r\n * @param {ReadonlyQuat} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport var equals = vec4.equals;\n/**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n *\r\n * @param {quat} out the receiving quaternion.\r\n * @param {ReadonlyVec3} a the initial vector\r\n * @param {ReadonlyVec3} b the destination vector\r\n * @returns {quat} out\r\n */\n\nexport var rotationTo = function () {\n var tmpvec3 = vec3.create();\n var xUnitVec3 = vec3.fromValues(1, 0, 0);\n var yUnitVec3 = vec3.fromValues(0, 1, 0);\n return function (out, a, b) {\n var dot = vec3.dot(a, b);\n\n if (dot < -0.999999) {\n vec3.cross(tmpvec3, xUnitVec3, a);\n if (vec3.len(tmpvec3) < 0.000001) vec3.cross(tmpvec3, yUnitVec3, a);\n vec3.normalize(tmpvec3, tmpvec3);\n setAxisAngle(out, tmpvec3, Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n vec3.cross(tmpvec3, a, b);\n out[0] = tmpvec3[0];\n out[1] = tmpvec3[1];\n out[2] = tmpvec3[2];\n out[3] = 1 + dot;\n return normalize(out, out);\n }\n };\n}();\n/**\r\n * Performs a spherical linear interpolation with two control points\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {ReadonlyQuat} c the third operand\r\n * @param {ReadonlyQuat} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n */\n\nexport var sqlerp = function () {\n var temp1 = create();\n var temp2 = create();\n return function (out, a, b, c, d, t) {\n slerp(temp1, a, d, t);\n slerp(temp2, b, c, t);\n slerp(out, temp1, temp2, 2 * t * (1 - t));\n return out;\n };\n}();\n/**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n *\r\n * @param {ReadonlyVec3} view the vector representing the viewing direction\r\n * @param {ReadonlyVec3} right the vector representing the local \"right\" direction\r\n * @param {ReadonlyVec3} up the vector representing the local \"up\" direction\r\n * @returns {quat} out\r\n */\n\nexport var setAxes = function () {\n var matr = mat3.create();\n return function (out, view, right, up) {\n matr[0] = right[0];\n matr[3] = right[1];\n matr[6] = right[2];\n matr[1] = up[0];\n matr[4] = up[1];\n matr[7] = up[2];\n matr[2] = -view[0];\n matr[5] = -view[1];\n matr[8] = -view[2];\n return normalize(out, fromMat3(out, matr));\n };\n}();","import * as glMatrix from \"./common.js\";\n/**\r\n * 4 Dimensional Vector\r\n * @module vec4\r\n */\n\n/**\r\n * Creates a new, empty vec4\r\n *\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec4 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec4} a vector to clone\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Creates a new vec4 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} a new 4D vector\r\n */\n\nexport function fromValues(x, y, z, w) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\r\n * Copy the values from one vec4 to another\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the source vector\r\n * @returns {vec4} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set the components of a vec4 to the given values\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} out\r\n */\n\nexport function set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\r\n * Adds two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\r\n * Multiplies two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n}\n/**\r\n * Divides two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to ceil\r\n * @returns {vec4} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to floor\r\n * @returns {vec4} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n}\n/**\r\n * Math.round the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to round\r\n * @returns {vec4} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n}\n/**\r\n * Scales a vec4 by a scalar number\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec4} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\r\n * Adds two vec4's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec4} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Calculates the length of a vec4\r\n *\r\n * @param {ReadonlyVec4} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\r\n * Calculates the squared length of a vec4\r\n *\r\n * @param {ReadonlyVec4} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Negates the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to negate\r\n * @returns {vec4} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to invert\r\n * @returns {vec4} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n out[3] = 1.0 / a[3];\n return out;\n}\n/**\r\n * Normalize a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to normalize\r\n * @returns {vec4} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n var len = x * x + y * y + z * z + w * w;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n}\n/**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n *\r\n * @param {ReadonlyVec4} result the receiving vector\r\n * @param {ReadonlyVec4} U the first vector\r\n * @param {ReadonlyVec4} V the second vector\r\n * @param {ReadonlyVec4} W the third vector\r\n * @returns {vec4} result\r\n */\n\nexport function cross(out, u, v, w) {\n var A = v[0] * w[1] - v[1] * w[0],\n B = v[0] * w[2] - v[2] * w[0],\n C = v[0] * w[3] - v[3] * w[0],\n D = v[1] * w[2] - v[2] * w[1],\n E = v[1] * w[3] - v[3] * w[1],\n F = v[2] * w[3] - v[3] * w[2];\n var G = u[0];\n var H = u[1];\n var I = u[2];\n var J = u[3];\n out[0] = H * F - I * E + J * D;\n out[1] = -(G * F) + I * C - J * B;\n out[2] = G * E - H * C + J * A;\n out[3] = -(G * D) + H * B - I * A;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec4} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n var aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec4} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n\n var v1, v2, v3, v4;\n var s1, s2;\n\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n\n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n}\n/**\r\n * Transforms the vec4 with a mat4.\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec4} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n}\n/**\r\n * Transforms the vec4 with a quat\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to transform\r\n * @param {ReadonlyQuat} q quaternion to transform with\r\n * @returns {vec4} out\r\n */\n\nexport function transformQuat(out, a, q) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3]; // calculate quat * vec\n\n var ix = qw * x + qy * z - qz * y;\n var iy = qw * y + qz * x - qx * z;\n var iz = qw * z + qx * y - qy * x;\n var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set the components of a vec4 to zero\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @returns {vec4} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec4} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec4} a The first vector.\r\n * @param {ReadonlyVec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec4} a The first vector.\r\n * @param {ReadonlyVec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\r\n * Alias for {@link vec4.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec4.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec4.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec4.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec4.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec4.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec4.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec4s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 4;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n vec[3] = a[i + 3];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n a[i + 3] = vec[3];\n }\n\n return a;\n };\n}();","import * as glMatrix from \"./common.js\";\n/**\r\n * 3 Dimensional Vector\r\n * @module vec3\r\n */\n\n/**\r\n * Creates a new, empty vec3\r\n *\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(3);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec3} a vector to clone\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\r\n * Calculates the length of a vec3\r\n *\r\n * @param {ReadonlyVec3} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return Math.hypot(x, y, z);\n}\n/**\r\n * Creates a new vec3 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} a new 3D vector\r\n */\n\nexport function fromValues(x, y, z) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\r\n * Copy the values from one vec3 to another\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the source vector\r\n * @returns {vec3} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\r\n * Set the components of a vec3 to the given values\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} out\r\n */\n\nexport function set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\r\n * Adds two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n}\n/**\r\n * Multiplies two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n}\n/**\r\n * Divides two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to ceil\r\n * @returns {vec3} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to floor\r\n * @returns {vec3} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n}\n/**\r\n * Math.round the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to round\r\n * @returns {vec3} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n return out;\n}\n/**\r\n * Scales a vec3 by a scalar number\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec3} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n return out;\n}\n/**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec3} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return Math.hypot(x, y, z);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return x * x + y * y + z * z;\n}\n/**\r\n * Calculates the squared length of a vec3\r\n *\r\n * @param {ReadonlyVec3} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return x * x + y * y + z * z;\n}\n/**\r\n * Negates the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to negate\r\n * @returns {vec3} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to invert\r\n * @returns {vec3} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n return out;\n}\n/**\r\n * Normalize a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to normalize\r\n * @returns {vec3} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var len = x * x + y * y + z * z;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n/**\r\n * Computes the cross product of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function cross(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2];\n var bx = b[0],\n by = b[1],\n bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n}\n/**\r\n * Performs a hermite interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {ReadonlyVec3} c the third operand\r\n * @param {ReadonlyVec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function hermite(out, a, b, c, d, t) {\n var factorTimes2 = t * t;\n var factor1 = factorTimes2 * (2 * t - 3) + 1;\n var factor2 = factorTimes2 * (t - 2) + t;\n var factor3 = factorTimes2 * (t - 1);\n var factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\r\n * Performs a bezier interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {ReadonlyVec3} c the third operand\r\n * @param {ReadonlyVec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nexport function bezier(out, a, b, c, d, t) {\n var inverseFactor = 1 - t;\n var inverseFactorTimesTwo = inverseFactor * inverseFactor;\n var factorTimes2 = t * t;\n var factor1 = inverseFactorTimesTwo * inverseFactor;\n var factor2 = 3 * t * inverseFactorTimesTwo;\n var factor3 = 3 * factorTimes2 * inverseFactor;\n var factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec3} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n var z = glMatrix.RANDOM() * 2.0 - 1.0;\n var zScale = Math.sqrt(1.0 - z * z) * scale;\n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n}\n/**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n/**\r\n * Transforms the vec3 with a mat3.\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyMat3} m the 3x3 matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformMat3(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n}\n/**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyQuat} q quaternion to transform with\r\n * @returns {vec3} out\r\n */\n\nexport function transformQuat(out, a, q) {\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3];\n var x = a[0],\n y = a[1],\n z = a[2]; // var qvec = [qx, qy, qz];\n // var uv = vec3.cross([], qvec, a);\n\n var uvx = qy * z - qz * y,\n uvy = qz * x - qx * z,\n uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv);\n\n var uuvx = qy * uvz - qz * uvy,\n uuvy = qz * uvx - qx * uvz,\n uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w);\n\n var w2 = qw * 2;\n uvx *= w2;\n uvy *= w2;\n uvz *= w2; // vec3.scale(uuv, uuv, 2);\n\n uuvx *= 2;\n uuvy *= 2;\n uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv));\n\n out[0] = x + uvx + uuvx;\n out[1] = y + uvy + uuvy;\n out[2] = z + uvz + uuvz;\n return out;\n}\n/**\r\n * Rotate a 3D vector around the x-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateX(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Rotate a 3D vector around the y-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateY(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Rotate a 3D vector around the z-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nexport function rotateZ(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2]; //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Get the angle between two 3D vectors\r\n * @param {ReadonlyVec3} a The first operand\r\n * @param {ReadonlyVec3} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nexport function angle(a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n bx = b[0],\n by = b[1],\n bz = b[2],\n mag1 = Math.sqrt(ax * ax + ay * ay + az * az),\n mag2 = Math.sqrt(bx * bx + by * by + bz * bz),\n mag = mag1 * mag2,\n cosine = mag && dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\r\n * Set the components of a vec3 to zero\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @returns {vec3} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec3} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \")\";\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec3} a The first vector.\r\n * @param {ReadonlyVec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec3} a The first vector.\r\n * @param {ReadonlyVec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2));\n}\n/**\r\n * Alias for {@link vec3.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec3.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec3.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec3.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec3.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec3.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec3.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec3s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 3;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n }\n\n return a;\n };\n}();","import * as glMatrix from \"./common.js\";\nimport * as quat from \"./quat.js\";\nimport * as mat4 from \"./mat4.js\";\n/**\r\n * Dual Quaternion
\r\n * Format: [real, dual]
\r\n * Quaternion format: XYZW
\r\n * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
\r\n * @module quat2\r\n */\n\n/**\r\n * Creates a new identity dual quat\r\n *\r\n * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation]\r\n */\n\nexport function create() {\n var dq = new glMatrix.ARRAY_TYPE(8);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n dq[0] = 0;\n dq[1] = 0;\n dq[2] = 0;\n dq[4] = 0;\n dq[5] = 0;\n dq[6] = 0;\n dq[7] = 0;\n }\n\n dq[3] = 1;\n return dq;\n}\n/**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n *\r\n * @param {ReadonlyQuat2} a dual quaternion to clone\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function clone(a) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = a[0];\n dq[1] = a[1];\n dq[2] = a[2];\n dq[3] = a[3];\n dq[4] = a[4];\n dq[5] = a[5];\n dq[6] = a[6];\n dq[7] = a[7];\n return dq;\n}\n/**\r\n * Creates a new dual quat initialized with the given values\r\n *\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component\r\n * @param {Number} y2 Y component\r\n * @param {Number} z2 Z component\r\n * @param {Number} w2 W component\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n dq[4] = x2;\n dq[5] = y2;\n dq[6] = z2;\n dq[7] = w2;\n return dq;\n}\n/**\r\n * Creates a new dual quat from the given values (quat and translation)\r\n *\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component (translation)\r\n * @param {Number} y2 Y component (translation)\r\n * @param {Number} z2 Z component (translation)\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nexport function fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n var dq = new glMatrix.ARRAY_TYPE(8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n var ax = x2 * 0.5,\n ay = y2 * 0.5,\n az = z2 * 0.5;\n dq[4] = ax * w1 + ay * z1 - az * y1;\n dq[5] = ay * w1 + az * x1 - ax * z1;\n dq[6] = az * w1 + ax * y1 - ay * x1;\n dq[7] = -ax * x1 - ay * y1 - az * z1;\n return dq;\n}\n/**\r\n * Creates a dual quat from a quaternion and a translation\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyQuat} q a normalized quaternion\r\n * @param {ReadonlyVec3} t tranlation vector\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromRotationTranslation(out, q, t) {\n var ax = t[0] * 0.5,\n ay = t[1] * 0.5,\n az = t[2] * 0.5,\n bx = q[0],\n by = q[1],\n bz = q[2],\n bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Creates a dual quat from a translation\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyVec3} t translation vector\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n}\n/**\r\n * Creates a dual quat from a quaternion\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyQuat} q the quaternion\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nexport function fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\r\n * Creates a new dual quat from a matrix (4x4)\r\n *\r\n * @param {quat2} out the dual quaternion\r\n * @param {ReadonlyMat4} a the matrix\r\n * @returns {quat2} dual quat receiving operation result\r\n * @function\r\n */\n\nexport function fromMat4(out, a) {\n //TODO Optimize this\n var outer = quat.create();\n mat4.getRotation(outer, a);\n var t = new glMatrix.ARRAY_TYPE(3);\n mat4.getTranslation(t, a);\n fromRotationTranslation(out, outer, t);\n return out;\n}\n/**\r\n * Copy the values from one dual quat to another\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the source dual quaternion\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n}\n/**\r\n * Set a dual quat to the identity dual quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @returns {quat2} out\r\n */\n\nexport function identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\r\n * Set the components of a dual quat to the given values\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component\r\n * @param {Number} y2 Y component\r\n * @param {Number} z2 Z component\r\n * @param {Number} w2 W component\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n}\n/**\r\n * Gets the real part of a dual quat\r\n * @param {quat} out real part\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @return {quat} real part\r\n */\n\nexport var getReal = quat.copy;\n/**\r\n * Gets the dual part of a dual quat\r\n * @param {quat} out dual part\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @return {quat} dual part\r\n */\n\nexport function getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n}\n/**\r\n * Set the real component of a dual quat to the given quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat} q a quaternion representing the real part\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport var setReal = quat.copy;\n/**\r\n * Set the dual component of a dual quat to the given quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat} q a quaternion representing the dual part\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function setDual(out, q) {\n out[4] = q[0];\n out[5] = q[1];\n out[6] = q[2];\n out[7] = q[3];\n return out;\n}\n/**\r\n * Gets the translation of a normalized dual quat\r\n * @param {vec3} out translation\r\n * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed\r\n * @return {vec3} translation\r\n */\n\nexport function getTranslation(out, a) {\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n}\n/**\r\n * Translates a dual quat by the given vector\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to translate\r\n * @param {ReadonlyVec3} v vector to translate by\r\n * @returns {quat2} out\r\n */\n\nexport function translate(out, a, v) {\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3],\n bx1 = v[0] * 0.5,\n by1 = v[1] * 0.5,\n bz1 = v[2] * 0.5,\n ax2 = a[4],\n ay2 = a[5],\n az2 = a[6],\n aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n}\n/**\r\n * Rotates a dual quat around the X axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateX(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around the Y axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateY(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around the Z axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateZ(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat by a given quaternion (a * q)\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {ReadonlyQuat} q quaternion to rotate by\r\n * @returns {quat2} out\r\n */\n\nexport function rotateByQuatAppend(out, a, q) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n}\n/**\r\n * Rotates a dual quat by a given quaternion (q * a)\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat} q quaternion to rotate by\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @returns {quat2} out\r\n */\n\nexport function rotateByQuatPrepend(out, q, a) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n bx = a[0],\n by = a[1],\n bz = a[2],\n bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around a given axis. Does the normalisation automatically\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @param {Number} rad how far the rotation should be\r\n * @returns {quat2} out\r\n */\n\nexport function rotateAroundAxis(out, a, axis, rad) {\n //Special case for rad = 0\n if (Math.abs(rad) < glMatrix.EPSILON) {\n return copy(out, a);\n }\n\n var axisLength = Math.hypot(axis[0], axis[1], axis[2]);\n rad = rad * 0.5;\n var s = Math.sin(rad);\n var bx = s * axis[0] / axisLength;\n var by = s * axis[1] / axisLength;\n var bz = s * axis[2] / axisLength;\n var bw = Math.cos(rad);\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Adds two dual quat's\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n}\n/**\r\n * Multiplies two dual quat's\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {quat2} out\r\n */\n\nexport function multiply(out, a, b) {\n var ax0 = a[0],\n ay0 = a[1],\n az0 = a[2],\n aw0 = a[3],\n bx1 = b[4],\n by1 = b[5],\n bz1 = b[6],\n bw1 = b[7],\n ax1 = a[4],\n ay1 = a[5],\n az1 = a[6],\n aw1 = a[7],\n bx0 = b[0],\n by0 = b[1],\n bz0 = b[2],\n bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n}\n/**\r\n * Alias for {@link quat2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Scales a dual quat by a scalar number\r\n *\r\n * @param {quat2} out the receiving dual quat\r\n * @param {ReadonlyQuat2} a the dual quat to scale\r\n * @param {Number} b amount to scale the dual quat by\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n}\n/**\r\n * Calculates the dot product of two dual quat's (The dot product of the real parts)\r\n *\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {Number} dot product of a and b\r\n * @function\r\n */\n\nexport var dot = quat.dot;\n/**\r\n * Performs a linear interpolation between two dual quats's\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5)\r\n *\r\n * @param {quat2} out the receiving dual quat\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat2} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var mt = 1 - t;\n if (dot(a, b) < 0) t = -t;\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n}\n/**\r\n * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a dual quat to calculate inverse of\r\n * @returns {quat2} out\r\n */\n\nexport function invert(out, a) {\n var sqlen = squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n}\n/**\r\n * Calculates the conjugate of a dual quat\r\n * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result.\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat2} a quat to calculate conjugate of\r\n * @returns {quat2} out\r\n */\n\nexport function conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n}\n/**\r\n * Calculates the length of a dual quat\r\n *\r\n * @param {ReadonlyQuat2} a dual quat to calculate length of\r\n * @returns {Number} length of a\r\n * @function\r\n */\n\nexport var length = quat.length;\n/**\r\n * Alias for {@link quat2.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Calculates the squared length of a dual quat\r\n *\r\n * @param {ReadonlyQuat2} a dual quat to calculate squared length of\r\n * @returns {Number} squared length of a\r\n * @function\r\n */\n\nexport var squaredLength = quat.squaredLength;\n/**\r\n * Alias for {@link quat2.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Normalize a dual quat\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a dual quaternion to normalize\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nexport function normalize(out, a) {\n var magnitude = squaredLength(a);\n\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n var a0 = a[0] / magnitude;\n var a1 = a[1] / magnitude;\n var a2 = a[2] / magnitude;\n var a3 = a[3] / magnitude;\n var b0 = a[4];\n var b1 = a[5];\n var b2 = a[6];\n var b3 = a[7];\n var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n\n return out;\n}\n/**\r\n * Returns a string representation of a dual quatenion\r\n *\r\n * @param {ReadonlyQuat2} a dual quaternion to represent as a string\r\n * @returns {String} string representation of the dual quat\r\n */\n\nexport function str(a) {\n return \"quat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \")\";\n}\n/**\r\n * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyQuat2} a the first dual quaternion.\r\n * @param {ReadonlyQuat2} b the second dual quaternion.\r\n * @returns {Boolean} true if the dual quaternions are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7];\n}\n/**\r\n * Returns whether or not the dual quaternions have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyQuat2} a the first dual quat.\r\n * @param {ReadonlyQuat2} b the second dual quat.\r\n * @returns {Boolean} true if the dual quats are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7));\n}","import * as glMatrix from \"./common.js\";\n/**\r\n * 2 Dimensional Vector\r\n * @module vec2\r\n */\n\n/**\r\n * Creates a new, empty vec2\r\n *\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(2);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec2 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec2} a vector to clone\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\r\n * Creates a new vec2 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} a new 2D vector\r\n */\n\nexport function fromValues(x, y) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\r\n * Copy the values from one vec2 to another\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the source vector\r\n * @returns {vec2} out\r\n */\n\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\r\n * Set the components of a vec2 to the given values\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} out\r\n */\n\nexport function set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\r\n * Adds two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n}\n/**\r\n * Multiplies two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n}\n/**\r\n * Divides two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to ceil\r\n * @returns {vec2} out\r\n */\n\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to floor\r\n * @returns {vec2} out\r\n */\n\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n}\n/**\r\n * Math.round the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to round\r\n * @returns {vec2} out\r\n */\n\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n}\n/**\r\n * Scales a vec2 by a scalar number\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec2} out\r\n */\n\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n}\n/**\r\n * Adds two vec2's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec2} out\r\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nexport function distance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return Math.hypot(x, y);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return x * x + y * y;\n}\n/**\r\n * Calculates the length of a vec2\r\n *\r\n * @param {ReadonlyVec2} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nexport function length(a) {\n var x = a[0],\n y = a[1];\n return Math.hypot(x, y);\n}\n/**\r\n * Calculates the squared length of a vec2\r\n *\r\n * @param {ReadonlyVec2} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nexport function squaredLength(a) {\n var x = a[0],\n y = a[1];\n return x * x + y * y;\n}\n/**\r\n * Negates the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to negate\r\n * @returns {vec2} out\r\n */\n\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to invert\r\n * @returns {vec2} out\r\n */\n\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n return out;\n}\n/**\r\n * Normalize a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to normalize\r\n * @returns {vec2} out\r\n */\n\nexport function normalize(out, a) {\n var x = a[0],\n y = a[1];\n var len = x * x + y * y;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n}\n/**\r\n * Computes the cross product of two vec2's\r\n * Note that the cross product must by definition produce a 3D vector\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec3} out\r\n */\n\nexport function cross(out, a, b) {\n var z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec2} out\r\n */\n\nexport function lerp(out, a, b, t) {\n var ax = a[0],\n ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec2} out\r\n */\n\nexport function random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n out[0] = Math.cos(r) * scale;\n out[1] = Math.sin(r) * scale;\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat2} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat2(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat2d\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat2d} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat2d(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat3\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat3} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat3(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat4\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nexport function transformMat4(out, a, m) {\n var x = a[0];\n var y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n}\n/**\r\n * Rotate a 2D vector\r\n * @param {vec2} out The receiving vec2\r\n * @param {ReadonlyVec2} a The vec2 point to rotate\r\n * @param {ReadonlyVec2} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec2} out\r\n */\n\nexport function rotate(out, a, b, rad) {\n //Translate point to the origin\n var p0 = a[0] - b[0],\n p1 = a[1] - b[1],\n sinC = Math.sin(rad),\n cosC = Math.cos(rad); //perform rotation and translate to correct position\n\n out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n}\n/**\r\n * Get the angle between two 2D vectors\r\n * @param {ReadonlyVec2} a The first operand\r\n * @param {ReadonlyVec2} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nexport function angle(a, b) {\n var x1 = a[0],\n y1 = a[1],\n x2 = b[0],\n y2 = b[1],\n // mag is the product of the magnitudes of a and b\n mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2),\n // mag &&.. short circuits if mag == 0\n cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\n\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\r\n * Set the components of a vec2 to zero\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @returns {vec2} out\r\n */\n\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec2} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nexport function str(a) {\n return \"vec2(\" + a[0] + \", \" + a[1] + \")\";\n}\n/**\r\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec2} a The first vector.\r\n * @param {ReadonlyVec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec2} a The first vector.\r\n * @param {ReadonlyVec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1];\n var b0 = b[0],\n b1 = b[1];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1));\n}\n/**\r\n * Alias for {@link vec2.length}\r\n * @function\r\n */\n\nexport var len = length;\n/**\r\n * Alias for {@link vec2.subtract}\r\n * @function\r\n */\n\nexport var sub = subtract;\n/**\r\n * Alias for {@link vec2.multiply}\r\n * @function\r\n */\n\nexport var mul = multiply;\n/**\r\n * Alias for {@link vec2.divide}\r\n * @function\r\n */\n\nexport var div = divide;\n/**\r\n * Alias for {@link vec2.distance}\r\n * @function\r\n */\n\nexport var dist = distance;\n/**\r\n * Alias for {@link vec2.squaredDistance}\r\n * @function\r\n */\n\nexport var sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec2.squaredLength}\r\n * @function\r\n */\n\nexport var sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec2s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nexport var forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 2;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n }\n\n return a;\n };\n}();","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./indexedBuffer\"), exports);\n__exportStar(require(\"./propArguments\"), exports);\n__exportStar(require(\"./repetitions\"), exports);\n__exportStar(require(\"./scene-child\"), exports);\n__exportStar(require(\"./scene\"), exports);\n__exportStar(require(\"./shape-base\"), exports);\n__exportStar(require(\"./shape-primitives\"), exports);\n__exportStar(require(\"./shapes\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=indexedBuffer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=propArguments.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ERepetitionType = void 0;\n/**\n * Repetition type enumerator.\n *\n * @category Core.Repetition\n * @internal\n */\nvar ERepetitionType;\n(function (ERepetitionType) {\n /**\n * Defines the type of repetition of the shape,\n * in a circular way starting from the center of the scene\n * @order 1\n */\n ERepetitionType[ERepetitionType[\"Ring\"] = 1] = \"Ring\";\n /**\n * Defines the type of repetition of the shape,\n * on a nxm grid starting from the center of the scene\n * @order 2\n */\n ERepetitionType[ERepetitionType[\"Matrix\"] = 2] = \"Matrix\";\n})(ERepetitionType = exports.ERepetitionType || (exports.ERepetitionType = {}));\n//# sourceMappingURL=repetitions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=scene-child.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=scene.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EBoundingType = void 0;\nvar EBoundingType;\n(function (EBoundingType) {\n /**\n * Relative to the real bounding of the shape\n * @order 2\n */\n EBoundingType[EBoundingType[\"Relative\"] = 1] = \"Relative\";\n /**\n * Fixed to te width and height of the shape\n * @order 3\n */\n EBoundingType[EBoundingType[\"Fixed\"] = 2] = \"Fixed\";\n})(EBoundingType = exports.EBoundingType || (exports.EBoundingType = {}));\n//# sourceMappingURL=shape-base.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//////\n//# sourceMappingURL=shape-primitives.js.map","\"use strict\";\n// Shape\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=shapes.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toVec3 = exports.toVec2 = exports.fromSkew = exports.VEC2_ONE = exports.VEC2_ZERO = exports.VEC3_ONE = exports.VEC3_ZERO = void 0;\nconst gl_matrix_1 = require(\"gl-matrix\");\nexports.VEC3_ZERO = [0, 0, 0];\nexports.VEC3_ONE = [1, 1, 1];\nexports.VEC2_ZERO = [0, 0];\nexports.VEC2_ONE = [1, 1];\ngl_matrix_1.glMatrix.setMatrixArrayType(Array);\n/**\n * Skew matrix\n *\n * @internal\n * @ignore\n */\nfunction fromSkew(out, skew) {\n out[0] = 1;\n out[1] = Math.tan(skew[1]);\n out[2] = 0;\n out[3] = 0;\n out[4] = Math.tan(skew[0]);\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\nexports.fromSkew = fromSkew;\n/**\n * number to vec 2\n *\n * @internal\n * @ignore\n */\nfunction toVec2(x) {\n if (Array.isArray(x))\n return [x[0], x[1]];\n return [x, x];\n}\nexports.toVec2 = toVec2;\n/**\n * number to vec 3\n *\n * @internal\n * @ignore\n */\nfunction toVec3(x, defaultZValue = 0) {\n if (Array.isArray(x)) {\n return [x[0], x[1], defaultZValue];\n }\n return [x, x, defaultZValue];\n}\nexports.toVec3 = toVec3;\n//# sourceMappingURL=gl-matrix-extensions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Temporany matrix\n *\n * @internal\n * @ignore\n */\nconst MATRIX = new Array(4);\n/**\n * Vec2 operation\n *\n * @category Core.Utilities\n */\nconst Vec2 = {\n /**\n * from new vertex\n *\n * @param {Array | number} [x=0]\n * @param {number} [y]\n * @returns {Array}\n */\n from: (x = 0, y) => {\n const out = new Array(2);\n if (typeof x === 'number') {\n out[0] = x;\n out[1] = y !== null && y !== void 0 ? y : x;\n }\n else {\n out[0] = x[0];\n out[1] = x[1];\n }\n return out;\n },\n normalize: (v) => {\n const len = Vec2.length(v);\n return len !== 0 ? [v[0] / len, v[1] / len] : [0, 0];\n },\n /**\n * Distance between two points\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n distance: (a, b) => Math.hypot(a[0] - b[0], a[1] - b[1]),\n /**\n * dot product\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n dot: (a, b) => a[0] * b[0] + a[1] * b[1],\n /**\n * length of point\n *\n * @param {Array} vec\n * @returns {number}\n */\n length: (vec) => Math.hypot(vec[0], vec[1]),\n /**\n * angle between two point\n *\n * @param {Array} a\n * @param {Array} b\n * @returns {number}\n */\n angle: (a, b) => {\n a = Vec2.normalize(a);\n b = Vec2.normalize(b);\n return Math.acos(Vec2.dot(a, b));\n },\n /**\n * skewX point\n *\n * @param {Array} vec\n * @param {number} m\n */\n skewX: (vec, m) => {\n vec[0] += Math.tan(m) * vec[1];\n },\n /**\n * skewY point\n *\n * @param {Array} vec\n * @param {number} m\n */\n skewY: (vec, m) => {\n vec[1] += Math.tan(m) * vec[0];\n },\n /**\n * squeezeX point\n *\n * @param {Array} vec\n * @param {number} m\n */\n squeezeX: (vec, m) => {\n vec[1] += vec[1] * (vec[0] * -m);\n },\n /**\n * squeezeY point\n *\n * @param {Array} vec\n * @param {number} m\n */\n squeezeY: (vec, m) => {\n vec[0] += vec[0] * (vec[1] * m);\n },\n /**\n * Rotate point\n *\n * @param {Array} vec\n * @param {Array} MATRIX\n * @param {Array} fromPoint\n * @internal\n */\n rotate: (vec, MATRIX, fromPoint) => {\n const p0 = vec[0] - fromPoint[0];\n const p1 = vec[1] - fromPoint[1];\n vec[0] = p0 * MATRIX[0] + p1 * MATRIX[1] + fromPoint[0];\n vec[1] = p0 * MATRIX[2] + p1 * MATRIX[3] + fromPoint[1];\n },\n /**\n * RotateX point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateX: (vec, fromPoint, rad) => {\n MATRIX[0] = 1;\n MATRIX[1] = 0;\n MATRIX[2] = 0;\n MATRIX[3] = Math.cos(rad);\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * RotateY point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateY: (vec, fromPoint, rad) => {\n MATRIX[0] = Math.cos(rad);\n MATRIX[1] = 0;\n MATRIX[2] = 0;\n MATRIX[3] = 1;\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * RotateZ point\n *\n * @param {Array} vec\n * @param {Array} fromPoint\n * @param {number} rad\n */\n rotateZ: (vec, fromPoint, rad) => {\n MATRIX[0] = Math.cos(rad);\n MATRIX[1] = -Math.sin(rad);\n MATRIX[2] = Math.sin(rad);\n MATRIX[3] = Math.cos(rad);\n Vec2.rotate(vec, MATRIX, fromPoint);\n },\n /**\n * Translate vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n translate: (vec, to) => {\n vec[0] += to[0];\n vec[1] += to[1];\n },\n /**\n * Scale vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n scale: (vec, to) => {\n vec[0] *= to[0];\n vec[1] *= to[1];\n },\n /**\n * Scale vertex\n *\n * @param {Array} vec\n * @param {Array} to\n */\n divide: (vec, to) => {\n vec[0] /= to[0];\n vec[1] /= to[1];\n },\n /**\n * Vec to string\n *\n * @param {Array} vec\n * @return {string}\n */\n toString: (vec) => `x: ${vec[0]}, y: ${vec[1]}`,\n /**\n * Vertex [0, 0]\n */\n ZERO: Array.from([0, 0]),\n /**\n * Vertex [1, 1]\n */\n ONE: Array.from([1, 1]),\n};\nexports.default = Vec2;\n//# sourceMappingURL=Vec2.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mod = exports.PHI = exports.PI2 = exports.log = void 0;\n/**\n * Return logarith value and base\n *\n * @category Core.Utilities\n *\n * @param n number\n * @param base number\n */\nconst log = (n, base) => Math.log(n) / Math.log(base);\nexports.log = log;\n/**\n * @category Core.Utilities\n */\nexports.PI2 = Math.PI * 2;\n/**\n * @category Core.Utilities\n */\nexports.PHI = (1 + Math.sqrt(5)) / 2;\n/**\n * Return a positive module of positive or negative value\n *\n * @category Core.Utilities\n *\n * @param value number\n * @param base number\n */\nconst mod = (value, base) => {\n const result = value % base;\n return result < 0 ? result + base : result;\n};\nexports.mod = mod;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Adapt = exports.Bounding = exports.EAdaptMode = void 0;\nconst Modifier_1 = require(\"./Modifier\");\n/**\n *\n *\n * @category Core.Enums\n */\nvar EAdaptMode;\n(function (EAdaptMode) {\n /**\n * The buffer is not changed\n * @order 1\n */\n EAdaptMode[EAdaptMode[\"None\"] = 0] = \"None\";\n /**\n * The buffer is scaled in a range between [-1, -1] and [1,1]\n * @order 2\n */\n EAdaptMode[EAdaptMode[\"Scale\"] = 2] = \"Scale\";\n /**\n * The buffer is scaled in a range between [-1, -1] and [1,1] and is centered\n * @order 3\n */\n EAdaptMode[EAdaptMode[\"Center\"] = 4] = \"Center\";\n /**\n * The buffer is adapted centrally and expanded in a range between [-1, -1] and [1,1]\n * @order 4\n */\n EAdaptMode[EAdaptMode[\"Fill\"] = 8] = \"Fill\";\n})(EAdaptMode = exports.EAdaptMode || (exports.EAdaptMode = {}));\n/**\n * @internal\n * @ignore\n */\nexports.Bounding = {\n empty: () => ({\n cx: 0,\n cy: 0,\n x: -1,\n y: -1,\n width: 2,\n height: 2,\n }),\n clear: (tmpBounding) => {\n tmpBounding[0] = undefined;\n tmpBounding[1] = undefined;\n tmpBounding[2] = undefined;\n tmpBounding[3] = undefined;\n },\n add: (tmpBounding, x, y) => {\n if (typeof tmpBounding[0] === 'undefined' || x < tmpBounding[0])\n tmpBounding[0] = x;\n if (typeof tmpBounding[2] === 'undefined' || x > tmpBounding[2])\n tmpBounding[2] = x;\n if (typeof tmpBounding[1] === 'undefined' || y < tmpBounding[1])\n tmpBounding[1] = y;\n if (typeof tmpBounding[3] === 'undefined' || y > tmpBounding[3])\n tmpBounding[3] = y;\n },\n sum: (dest, bounding) => {\n if (typeof bounding[0] !== 'undefined' &&\n typeof bounding[1] !== 'undefined' &&\n typeof bounding[2] !== 'undefined' &&\n typeof bounding[3] !== 'undefined') {\n if (typeof dest[0] === 'undefined' ||\n typeof dest[1] === 'undefined' ||\n typeof dest[2] === 'undefined' ||\n typeof dest[3] === 'undefined') {\n dest[0] = bounding[0];\n dest[1] = bounding[1];\n dest[2] = bounding[2];\n dest[3] = bounding[3];\n }\n else {\n if (dest[0] < bounding[0])\n dest[0] = bounding[0];\n if (dest[2] > bounding[2])\n dest[2] = bounding[2];\n if (dest[1] < bounding[1])\n dest[1] = bounding[1];\n if (dest[3] > bounding[3])\n dest[3] = bounding[3];\n }\n }\n else {\n console.warn('[Urplfanze:Bounding] cannot sum bounding');\n }\n },\n bind: (bounding, tmpBounding) => {\n if (typeof tmpBounding[0] !== 'undefined' &&\n typeof tmpBounding[1] !== 'undefined' &&\n typeof tmpBounding[2] !== 'undefined' &&\n typeof tmpBounding[3] !== 'undefined') {\n bounding.x = tmpBounding[0];\n bounding.y = tmpBounding[1];\n bounding.width = tmpBounding[2] - tmpBounding[0];\n bounding.height = tmpBounding[3] - tmpBounding[1];\n bounding.cx = bounding.x + bounding.width / 2;\n bounding.cy = bounding.y + bounding.height / 2;\n }\n else {\n console.warn('[Urplfanze:Bounding] cannot bind bounding');\n }\n },\n};\nclass Adapt extends Modifier_1.Modifier {\n constructor(args) {\n super();\n this.mode = args.mode || EAdaptMode.Fill;\n this.rect = args.rect;\n }\n apply(buffer, bClosed) {\n return Adapt.adapt(buffer, this.mode, this.rect);\n }\n /**\n * Return adapted buffer between [-1,-1] and [1,1]\n *\n * @public\n * @static\n * @param {Float32Array} input\n * @param {EAdaptMode} mode\n * @returns {Float32Array}\n * @memberof ShapeBuffer\n */\n static adapt(input, mode, rect) {\n if (mode === EAdaptMode.None)\n return Float32Array.from(input);\n const output = new Float32Array(input.length);\n if (!rect) {\n rect = Adapt.getBounding(input);\n }\n const scale = rect.width >= 2 || rect.height >= 2 || (mode >= EAdaptMode.Fill && (rect.width < 2 || rect.height < 2))\n ? 2 / Math.max(rect.width, rect.height)\n : 1;\n const translateX = mode >= EAdaptMode.Center ? rect.cx : 0;\n const translateY = mode >= EAdaptMode.Center ? rect.cy : 0;\n for (let i = 0, len = input.length; i < len; i += 2) {\n output[i] = (input[i] - translateX) * scale;\n output[i + 1] = (input[i + 1] - translateY) * scale;\n }\n return output;\n }\n /**\n * Get buffer bounding\n *\n * @static\n * @param {Float32Array | Array} buffer\n * @returns {IShapeBounding}\n * @memberof ShapePrimitive\n */\n static getBounding(buffer, bounding) {\n if (typeof bounding === 'undefined')\n bounding = exports.Bounding.empty();\n const tmp_bounding = [undefined, undefined, undefined, undefined];\n for (let i = 0, len = buffer.length; i < len; i += 2) {\n exports.Bounding.add(tmp_bounding, buffer[i], buffer[i + 1]);\n }\n exports.Bounding.bind(bounding, tmp_bounding);\n return bounding;\n }\n}\nexports.Adapt = Adapt;\nAdapt.MODES = EAdaptMode;\n//# sourceMappingURL=Adapt.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Modifier = void 0;\nclass Modifier {\n}\nexports.Modifier = Modifier;\n//# sourceMappingURL=Modifier.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.distributePointsInBuffer = exports.interpolate = exports.prepareBufferForInterpolation = exports.distanceFromRepetition = exports.angle2FromRepetition = exports.angleFromRepetition = exports.random = exports.noise = exports.relativeClamp = exports.clamp = exports.lerp = exports.toRadians = exports.toDegrees = exports.now = void 0;\nconst SimplexNoise = require(\"simplex-noise\");\nconst repetitions_1 = require(\"./types/repetitions\");\nconst Vec2_1 = require(\"./math/Vec2\");\n// isDef: (object: any): boolean => typeof object !== 'undefined' && object !== null,\nconst measurement = typeof performance !== 'undefined' ? performance : Date;\n/**\n * Get current timestamp in milliseconds\n *\n * @category Utilities\n * @returns {number}\n */\nfunction now() {\n return measurement.now();\n}\nexports.now = now;\n// aOr: (...args: Array): any => {\n// \tfor (let i = 0; i < args.length; i++) if (Utilities.isDef(args[i])) return args[i]\n// },\n/**\n * Convert number from radians to degrees\n *\n * @category Utilities\n *\n * @example\n * ```javascript\n * Urpflanze.toDegrees(Math.PI) // 180\n * ```\n *\n * @param {number} radians\n * @returns {number}\n */\nfunction toDegrees(radians) {\n return (radians * 180) / Math.PI;\n}\nexports.toDegrees = toDegrees;\n/**\n * Convert angle from degrees to radians\n * @example\n * ```javascript\n * Urpflanze.toRadians(180) // 3.141592653589793\n * ```\n *\n * @category Utilities\n * @param {number} degrees\n * @returns {number}\n */\nfunction toRadians(degrees) {\n return (degrees * Math.PI) / 180;\n}\nexports.toRadians = toRadians;\n// perf: (name: string, callback: any, log: boolean = false): number => {\n// \tconst t1 = now()\n// \tcallback()\n// \tconst t2 = now()\n// \tlog && console.log('perf ' + name + ': ' + (t2 - t1))\n// \treturn t2 - t1\n// }\n/**\n * Linear interpolation from `a` when `i` as 0 an `b` when `i' as 1\n *\n * @category Utilities\n * @param {number} a\n * @param {number} b\n * @param {number} i\n * @returns {number}\n */\nfunction lerp(a, b, i) {\n return (1 - i) * a + i * b;\n}\nexports.lerp = lerp;\n/**\n * Return number between min and max\n *\n * @category Utilities\n * @example\n * ```javascript\n * Urpflanze.clamp(0, 1, 1.2) // 1\n * Urpflanze.clamp(0, 1, -2) // 0\n * ```\n * @param {number} min\n * @param {number} max\n * @param {number} value\n * @returns {number}\n */\nfunction clamp(min, max, value) {\n return value <= min ? min : value >= max ? max : value;\n}\nexports.clamp = clamp;\n/**\n * Map number between refMin e refMax from min and max\n *\n * @category Utilities\n *\n * @example\n * ```javascript\n * Urpflanze.relativeClamp(0, 1, 0.5, 100, 200) // 150\n * ```\n *\n * @param {number} refMin\n * @param {number} refMax\n * @param {number} value\n * @param {number} toMin\n * @param {number} toMax\n * @returns {number}\n */\nfunction relativeClamp(refMin, refMax, value, toMin, toMax) {\n return clamp(toMin, toMax, ((value - refMin) / (refMax - refMin)) * (toMax - toMin) + toMin);\n}\nexports.relativeClamp = relativeClamp;\n/**\n * @internal\n * @ignore\n */\nconst noises = {\n random: new SimplexNoise(Math.random),\n};\n/**\n * SimplexNoise\n * Use 'random' as seed property for random seed.\n * Return value between -1 and 1\n *\n * @category Utilities\n *\n * @param {string} [seed='random']\n * @param {number} [x=0]\n * @param {number} [y=0]\n * @param {number} [z=0]\n * @returns {number} between -1 and 1\n */\nfunction noise(seed = 'random', x = 0, y = 0, z = 0) {\n if (typeof noises[seed] === 'undefined') {\n noises[seed] = new SimplexNoise(seed);\n }\n return noises[seed].noise3D(x, y, z);\n}\nexports.noise = noise;\n/**\n * Random number generator\n */\nconst randoms = {};\n/**\n * random number generator\n * @param seed\n * @returns\n */\nfunction random(seed, min = 0, max = 1, decimals) {\n const key = seed + '';\n if (typeof randoms[key] === 'undefined') {\n const seed = xmur3(key);\n randoms[key] = sfc32(seed(), seed(), seed(), seed());\n }\n const value = min + randoms[key]() * (max - min);\n return typeof decimals !== 'undefined' ? Math.round(value * 10 ** decimals) / 10 ** decimals : value;\n}\nexports.random = random;\n/**\n *\n * @internal\n * @param str\n * @returns\n */\nfunction xmur3(str) {\n let i = 0, h = 1779033703 ^ str.length;\n for (; i < str.length; i++)\n (h = Math.imul(h ^ str.charCodeAt(i), 3432918353)), (h = (h << 13) | (h >>> 19));\n return function () {\n h = Math.imul(h ^ (h >>> 16), 2246822507);\n h = Math.imul(h ^ (h >>> 13), 3266489909);\n return (h ^= h >>> 16) >>> 0;\n };\n}\n/**\n * @internal\n * @param a\n * @param b\n * @param c\n * @param d\n * @returns\n */\nfunction sfc32(a, b, c, d) {\n return function () {\n a >>>= 0;\n b >>>= 0;\n c >>>= 0;\n d >>>= 0;\n let t = (a + b) | 0;\n a = b ^ (b >>> 9);\n b = (c + (c << 3)) | 0;\n c = (c << 21) | (c >>> 11);\n d = (d + 1) | 0;\n t = (t + d) | 0;\n c = (c + t) | 0;\n return (t >>> 0) / 4294967296;\n };\n}\n/**\n * Return angle (atan) from offset (or center) for matrix repetition.\n * Offset is array between [-1, -1] and [1, 1].\n * The return value is between -Math.PI / 2 and Math.PI / 2\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter\n * @returns {number} between -Math.PI / 2 and Math.PI / 2\n */\nfunction angleFromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [(repetition.col.count - 1) / 2, (repetition.row.count - 1) / 2];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const x = repetition.col.index - 1 - centerMatrix[0];\n const y = repetition.row.index - 1 - centerMatrix[1];\n return x === 0 ? 0 : Math.atan(y / x);\n }\n return (repetition.angle - Math.PI) / 2;\n}\nexports.angleFromRepetition = angleFromRepetition;\n/**\n * Return angle (atan2, 4 quadrants) from offset (or center) for matrix repetition.\n * Offset is array between [-1, -1] and [1, 1].\n * The return value is between -Math.PI an Math.PI\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter\n * @returns {number} between -Math.PI an Math.PI\n */\nfunction angle2FromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [(repetition.col.count - 1) / 2, (repetition.row.count - 1) / 2];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const x = repetition.col.index - 1 - centerMatrix[0];\n const y = repetition.row.index - 1 - centerMatrix[1];\n return x === 0 ? 0 : Math.atan2(y, x);\n }\n return repetition.angle - Math.PI;\n}\nexports.angle2FromRepetition = angle2FromRepetition;\n/**\n * Return distance from offset (or center) for matrix repetition.\n * The return value is between 0 and 1\n *\n * @category Utilities\n *\n * @param {IRepetition} repetition\n * @param {[number, number]} offsetFromCenter offset relative to distance prop\n * @returns {number} between 0 and 1\n */\nfunction distanceFromRepetition(repetition, offsetFromCenter = [0, 0]) {\n if (repetition.type === repetitions_1.ERepetitionType.Matrix) {\n const centerMatrix = [0.5, 0.5];\n centerMatrix[0] += centerMatrix[0] * offsetFromCenter[0];\n centerMatrix[1] += centerMatrix[1] * offsetFromCenter[1];\n const current = [repetition.col.offset, repetition.row.offset];\n return Vec2_1.default.distance(current, centerMatrix);\n }\n return 1;\n}\nexports.distanceFromRepetition = distanceFromRepetition;\n/// Interpolation\n/**\n *\n * @param from\n * @param to\n * @returns\n */\nfunction prepareBufferForInterpolation(from, to) {\n const fromBufferLength = from.length;\n const toBufferLength = to.length;\n if (fromBufferLength === toBufferLength) {\n return [from, to];\n }\n const maxBufferLength = fromBufferLength > toBufferLength ? fromBufferLength : toBufferLength;\n const difference = Math.abs(fromBufferLength - toBufferLength);\n const minBufferLength = maxBufferLength - difference;\n /////\n const b = fromBufferLength < toBufferLength ? to : from;\n const t = fromBufferLength < toBufferLength ? from : to;\n const a = distributePointsInBuffer(t, Math.floor(difference / 2));\n // a[maxBufferLength - 2] = t[minBufferLength - 2]\n // a[maxBufferLength - 1] = t[minBufferLength - 1]\n return fromBufferLength > toBufferLength ? [b, a] : [a, b];\n}\nexports.prepareBufferForInterpolation = prepareBufferForInterpolation;\n/**\n *\n * @param from\n * @param to\n * @param offset\n * @returns\n */\nfunction interpolate(from, to, initialOffset = 0.5) {\n const [a, b] = prepareBufferForInterpolation(from, to);\n const maxBufferLength = Math.max(a.length, b.length);\n const offset = typeof initialOffset === 'number' ? [initialOffset] : initialOffset;\n const maxPoints = maxBufferLength / 2;\n if (offset.length !== maxPoints) {\n const tl = offset.length;\n for (let i = 0; i < maxPoints; i++) {\n offset[i] = offset[i % tl];\n }\n }\n ////\n const result = new Float32Array(maxBufferLength);\n for (let i = 0, off = 0; i < maxBufferLength; i += 2, off++) {\n result[i] = (1 - offset[off]) * a[i] + offset[off] * b[i];\n result[i + 1] = (1 - offset[off]) * a[i + 1] + offset[off] * b[i + 1];\n }\n return result;\n}\nexports.interpolate = interpolate;\nfunction distributePointsInBuffer(buffer, count) {\n const bufferLen = buffer.length;\n const pointsLen = bufferLen / 2;\n const finalBufferLength = (pointsLen + count) * 2;\n const edges = pointsLen - 1;\n if (edges > 1) {\n const lastPoint = bufferLen - 2;\n const newPointsOnEdge = Math.floor(count / edges);\n const bufferWithPointsEveryEdge = bufferLen + newPointsOnEdge * lastPoint;\n let remainingPoints = (finalBufferLength - bufferWithPointsEveryEdge) / 2;\n const edgeRemainingIndex = Math.round(edges / remainingPoints);\n const result = new Float32Array(finalBufferLength);\n for (let i = 0, edgeIndex = 0, r = 0; i < lastPoint; i += 2, edgeIndex++, r += 2) {\n const ax = buffer[i];\n const ay = buffer[i + 1];\n const bx = buffer[i + 2];\n const by = buffer[i + 3];\n result[r] = ax;\n result[r + 1] = ay;\n const addReminingPoints = remainingPoints > 0 && (edgeIndex % edgeRemainingIndex === 0 || i === lastPoint - 2);\n const currentPointsOnEdge = newPointsOnEdge + (addReminingPoints ? 1 : 0);\n const newPointOffset = 1 / (currentPointsOnEdge + 1);\n for (let h = 0; h < currentPointsOnEdge; h++, r += 2) {\n const o = newPointOffset * (h + 1);\n result[r + 2] = (1 - o) * ax + o * bx;\n result[r + 3] = (1 - o) * ay + o * by;\n }\n if (addReminingPoints) {\n remainingPoints--;\n }\n }\n result[finalBufferLength - 2] = buffer[bufferLen - 2];\n result[finalBufferLength - 1] = buffer[bufferLen - 1];\n return result;\n }\n const result = new Float32Array(finalBufferLength);\n for (let i = 0; i < finalBufferLength; i += 2) {\n result[i] = buffer[i % bufferLen];\n result[i + 1] = buffer[(i + 1) % bufferLen];\n }\n return result;\n}\nexports.distributePointsInBuffer = distributePointsInBuffer;\n//# sourceMappingURL=Utilities.js.map","/*\n * A fast javascript implementation of simplex noise by Jonas Wagner\n\nBased on a speed-improved simplex noise algorithm for 2D, 3D and 4D in Java.\nWhich is based on example code by Stefan Gustavson (stegu@itn.liu.se).\nWith Optimisations by Peter Eastman (peastman@drizzle.stanford.edu).\nBetter rank ordering method by Stefan Gustavson in 2012.\n\n\n Copyright (c) 2018 Jonas Wagner\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n(function() {\n 'use strict';\n\n var F2 = 0.5 * (Math.sqrt(3.0) - 1.0);\n var G2 = (3.0 - Math.sqrt(3.0)) / 6.0;\n var F3 = 1.0 / 3.0;\n var G3 = 1.0 / 6.0;\n var F4 = (Math.sqrt(5.0) - 1.0) / 4.0;\n var G4 = (5.0 - Math.sqrt(5.0)) / 20.0;\n\n function SimplexNoise(randomOrSeed) {\n var random;\n if (typeof randomOrSeed == 'function') {\n random = randomOrSeed;\n }\n else if (randomOrSeed) {\n random = alea(randomOrSeed);\n } else {\n random = Math.random;\n }\n this.p = buildPermutationTable(random);\n this.perm = new Uint8Array(512);\n this.permMod12 = new Uint8Array(512);\n for (var i = 0; i < 512; i++) {\n this.perm[i] = this.p[i & 255];\n this.permMod12[i] = this.perm[i] % 12;\n }\n\n }\n SimplexNoise.prototype = {\n grad3: new Float32Array([1, 1, 0,\n -1, 1, 0,\n 1, -1, 0,\n\n -1, -1, 0,\n 1, 0, 1,\n -1, 0, 1,\n\n 1, 0, -1,\n -1, 0, -1,\n 0, 1, 1,\n\n 0, -1, 1,\n 0, 1, -1,\n 0, -1, -1]),\n grad4: new Float32Array([0, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1,\n 0, -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1,\n 1, 0, 1, 1, 1, 0, 1, -1, 1, 0, -1, 1, 1, 0, -1, -1,\n -1, 0, 1, 1, -1, 0, 1, -1, -1, 0, -1, 1, -1, 0, -1, -1,\n 1, 1, 0, 1, 1, 1, 0, -1, 1, -1, 0, 1, 1, -1, 0, -1,\n -1, 1, 0, 1, -1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, -1,\n 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0,\n -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1, 0]),\n noise2D: function(xin, yin) {\n var permMod12 = this.permMod12;\n var perm = this.perm;\n var grad3 = this.grad3;\n var n0 = 0; // Noise contributions from the three corners\n var n1 = 0;\n var n2 = 0;\n // Skew the input space to determine which simplex cell we're in\n var s = (xin + yin) * F2; // Hairy factor for 2D\n var i = Math.floor(xin + s);\n var j = Math.floor(yin + s);\n var t = (i + j) * G2;\n var X0 = i - t; // Unskew the cell origin back to (x,y) space\n var Y0 = j - t;\n var x0 = xin - X0; // The x,y distances from the cell origin\n var y0 = yin - Y0;\n // For the 2D case, the simplex shape is an equilateral triangle.\n // Determine which simplex we are in.\n var i1, j1; // Offsets for second (middle) corner of simplex in (i,j) coords\n if (x0 > y0) {\n i1 = 1;\n j1 = 0;\n } // lower triangle, XY order: (0,0)->(1,0)->(1,1)\n else {\n i1 = 0;\n j1 = 1;\n } // upper triangle, YX order: (0,0)->(0,1)->(1,1)\n // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and\n // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where\n // c = (3-sqrt(3))/6\n var x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords\n var y1 = y0 - j1 + G2;\n var x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords\n var y2 = y0 - 1.0 + 2.0 * G2;\n // Work out the hashed gradient indices of the three simplex corners\n var ii = i & 255;\n var jj = j & 255;\n // Calculate the contribution from the three corners\n var t0 = 0.5 - x0 * x0 - y0 * y0;\n if (t0 >= 0) {\n var gi0 = permMod12[ii + perm[jj]] * 3;\n t0 *= t0;\n n0 = t0 * t0 * (grad3[gi0] * x0 + grad3[gi0 + 1] * y0); // (x,y) of grad3 used for 2D gradient\n }\n var t1 = 0.5 - x1 * x1 - y1 * y1;\n if (t1 >= 0) {\n var gi1 = permMod12[ii + i1 + perm[jj + j1]] * 3;\n t1 *= t1;\n n1 = t1 * t1 * (grad3[gi1] * x1 + grad3[gi1 + 1] * y1);\n }\n var t2 = 0.5 - x2 * x2 - y2 * y2;\n if (t2 >= 0) {\n var gi2 = permMod12[ii + 1 + perm[jj + 1]] * 3;\n t2 *= t2;\n n2 = t2 * t2 * (grad3[gi2] * x2 + grad3[gi2 + 1] * y2);\n }\n // Add contributions from each corner to get the final noise value.\n // The result is scaled to return values in the interval [-1,1].\n return 70.0 * (n0 + n1 + n2);\n },\n // 3D simplex noise\n noise3D: function(xin, yin, zin) {\n var permMod12 = this.permMod12;\n var perm = this.perm;\n var grad3 = this.grad3;\n var n0, n1, n2, n3; // Noise contributions from the four corners\n // Skew the input space to determine which simplex cell we're in\n var s = (xin + yin + zin) * F3; // Very nice and simple skew factor for 3D\n var i = Math.floor(xin + s);\n var j = Math.floor(yin + s);\n var k = Math.floor(zin + s);\n var t = (i + j + k) * G3;\n var X0 = i - t; // Unskew the cell origin back to (x,y,z) space\n var Y0 = j - t;\n var Z0 = k - t;\n var x0 = xin - X0; // The x,y,z distances from the cell origin\n var y0 = yin - Y0;\n var z0 = zin - Z0;\n // For the 3D case, the simplex shape is a slightly irregular tetrahedron.\n // Determine which simplex we are in.\n var i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords\n var i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords\n if (x0 >= y0) {\n if (y0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 1;\n k2 = 0;\n } // X Y Z order\n else if (x0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n } // X Z Y order\n else {\n i1 = 0;\n j1 = 0;\n k1 = 1;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n } // Z X Y order\n }\n else { // x0 y0) rankx++;\n else ranky++;\n if (x0 > z0) rankx++;\n else rankz++;\n if (x0 > w0) rankx++;\n else rankw++;\n if (y0 > z0) ranky++;\n else rankz++;\n if (y0 > w0) ranky++;\n else rankw++;\n if (z0 > w0) rankz++;\n else rankw++;\n var i1, j1, k1, l1; // The integer offsets for the second simplex corner\n var i2, j2, k2, l2; // The integer offsets for the third simplex corner\n var i3, j3, k3, l3; // The integer offsets for the fourth simplex corner\n // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order.\n // Many values of c will never occur, since e.g. x>y>z>w makes x= 3 ? 1 : 0;\n j1 = ranky >= 3 ? 1 : 0;\n k1 = rankz >= 3 ? 1 : 0;\n l1 = rankw >= 3 ? 1 : 0;\n // Rank 2 denotes the second largest coordinate.\n i2 = rankx >= 2 ? 1 : 0;\n j2 = ranky >= 2 ? 1 : 0;\n k2 = rankz >= 2 ? 1 : 0;\n l2 = rankw >= 2 ? 1 : 0;\n // Rank 1 denotes the second smallest coordinate.\n i3 = rankx >= 1 ? 1 : 0;\n j3 = ranky >= 1 ? 1 : 0;\n k3 = rankz >= 1 ? 1 : 0;\n l3 = rankw >= 1 ? 1 : 0;\n // The fifth corner has all coordinate offsets = 1, so no need to compute that.\n var x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords\n var y1 = y0 - j1 + G4;\n var z1 = z0 - k1 + G4;\n var w1 = w0 - l1 + G4;\n var x2 = x0 - i2 + 2.0 * G4; // Offsets for third corner in (x,y,z,w) coords\n var y2 = y0 - j2 + 2.0 * G4;\n var z2 = z0 - k2 + 2.0 * G4;\n var w2 = w0 - l2 + 2.0 * G4;\n var x3 = x0 - i3 + 3.0 * G4; // Offsets for fourth corner in (x,y,z,w) coords\n var y3 = y0 - j3 + 3.0 * G4;\n var z3 = z0 - k3 + 3.0 * G4;\n var w3 = w0 - l3 + 3.0 * G4;\n var x4 = x0 - 1.0 + 4.0 * G4; // Offsets for last corner in (x,y,z,w) coords\n var y4 = y0 - 1.0 + 4.0 * G4;\n var z4 = z0 - 1.0 + 4.0 * G4;\n var w4 = w0 - 1.0 + 4.0 * G4;\n // Work out the hashed gradient indices of the five simplex corners\n var ii = i & 255;\n var jj = j & 255;\n var kk = k & 255;\n var ll = l & 255;\n // Calculate the contribution from the five corners\n var t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0;\n if (t0 < 0) n0 = 0.0;\n else {\n var gi0 = (perm[ii + perm[jj + perm[kk + perm[ll]]]] % 32) * 4;\n t0 *= t0;\n n0 = t0 * t0 * (grad4[gi0] * x0 + grad4[gi0 + 1] * y0 + grad4[gi0 + 2] * z0 + grad4[gi0 + 3] * w0);\n }\n var t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1;\n if (t1 < 0) n1 = 0.0;\n else {\n var gi1 = (perm[ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]]] % 32) * 4;\n t1 *= t1;\n n1 = t1 * t1 * (grad4[gi1] * x1 + grad4[gi1 + 1] * y1 + grad4[gi1 + 2] * z1 + grad4[gi1 + 3] * w1);\n }\n var t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2;\n if (t2 < 0) n2 = 0.0;\n else {\n var gi2 = (perm[ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]]] % 32) * 4;\n t2 *= t2;\n n2 = t2 * t2 * (grad4[gi2] * x2 + grad4[gi2 + 1] * y2 + grad4[gi2 + 2] * z2 + grad4[gi2 + 3] * w2);\n }\n var t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3;\n if (t3 < 0) n3 = 0.0;\n else {\n var gi3 = (perm[ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]]] % 32) * 4;\n t3 *= t3;\n n3 = t3 * t3 * (grad4[gi3] * x3 + grad4[gi3 + 1] * y3 + grad4[gi3 + 2] * z3 + grad4[gi3 + 3] * w3);\n }\n var t4 = 0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4;\n if (t4 < 0) n4 = 0.0;\n else {\n var gi4 = (perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32) * 4;\n t4 *= t4;\n n4 = t4 * t4 * (grad4[gi4] * x4 + grad4[gi4 + 1] * y4 + grad4[gi4 + 2] * z4 + grad4[gi4 + 3] * w4);\n }\n // Sum up and scale the result to cover the range [-1,1]\n return 27.0 * (n0 + n1 + n2 + n3 + n4);\n }\n };\n\n function buildPermutationTable(random) {\n var i;\n var p = new Uint8Array(256);\n for (i = 0; i < 256; i++) {\n p[i] = i;\n }\n for (i = 0; i < 255; i++) {\n var r = i + ~~(random() * (256 - i));\n var aux = p[i];\n p[i] = p[r];\n p[r] = aux;\n }\n return p;\n }\n SimplexNoise._buildPermutationTable = buildPermutationTable;\n\n function alea() {\n // Johannes Baagøe , 2010\n var s0 = 0;\n var s1 = 0;\n var s2 = 0;\n var c = 1;\n\n var mash = masher();\n s0 = mash(' ');\n s1 = mash(' ');\n s2 = mash(' ');\n\n for (var i = 0; i < arguments.length; i++) {\n s0 -= mash(arguments[i]);\n if (s0 < 0) {\n s0 += 1;\n }\n s1 -= mash(arguments[i]);\n if (s1 < 0) {\n s1 += 1;\n }\n s2 -= mash(arguments[i]);\n if (s2 < 0) {\n s2 += 1;\n }\n }\n mash = null;\n return function() {\n var t = 2091639 * s0 + c * 2.3283064365386963e-10; // 2^-32\n s0 = s1;\n s1 = s2;\n return s2 = t - (c = t | 0);\n };\n }\n function masher() {\n var n = 0xefc8249d;\n return function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n }\n\n // amd\n if (typeof define !== 'undefined' && define.amd) define(function() {return SimplexNoise;});\n // common js\n if (typeof exports !== 'undefined') exports.SimplexNoise = SimplexNoise;\n // browser\n else if (typeof window !== 'undefined') window.SimplexNoise = SimplexNoise;\n // nodejs\n if (typeof module !== 'undefined') {\n module.exports = SimplexNoise;\n }\n\n})();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Shape = void 0;\nconst Scene_1 = require(\"../Scene\");\nconst SceneChild_1 = require(\"../SceneChild\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\n/**\n * Container of ShapeBase or Group, it applies transformations on each repetition\n *\n * @category Core.Shapes\n */\nclass Shape extends ShapeBase_1.ShapeBase {\n /**\n * Creates an instance of Shape.\n *\n * @param {ShapeSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'Shape';\n super(settings);\n if (settings.shape instanceof SceneChild_1.SceneChild) {\n this.shape = settings.shape;\n }\n else {\n console.warn(\"[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\\nYou passed:\", settings.shape);\n }\n this.shapeUseParent = !!settings.shapeUseParent;\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n */\n isStatic() {\n // return super.isStatic() && !this.shapeUseParent\n return super.isStatic() && (this.shape ? this.shape.isStatic() : true);\n }\n /**\n * Check if shape has static index\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return super.isStaticIndexed() && (this.shape ? this.shape.isStaticIndexed() : true);\n }\n /**\n * Find shape by id or name\n *\n * @param {number | string} idOrName\n * @returns {(SceneChild | null)}\n */\n find(idOrName) {\n if (this.id === idOrName || this.name === idOrName)\n return this;\n if (this.shape)\n return this.shape.find(idOrName);\n return null;\n }\n /**\n * Return length of buffer\n *\n * @param {PropArguments} propArguments\n * @returns {number}\n */\n getBufferLength(propArguments) {\n if (this.bStatic && this.buffer && this.buffer.length > 0)\n return this.buffer.length;\n const childBufferLength = this.shape ? this.shape.getBufferLength(propArguments) : 0;\n return childBufferLength * this.getRepetitionCount();\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape) {\n if (this.shapeUseParent || this.shape.generateId !== generateId) {\n if (this.shapeUseParent) {\n this.shape.clearBuffer(true, false);\n }\n this.shape.generate(generateId, false, propArguments);\n }\n return this.shape.getBuffer();\n }\n return Shape.EMPTY_BUFFER;\n }\n /**\n * Return bounding\n *\n * @param {boolean} bDirectSceneChild\n * @returns {IShapeBounding}\n */\n getShapeBounding() {\n if (this.shape) {\n return this.shape.getBounding();\n }\n return this.bounding; // empty bounding defined in ShapeBase\n }\n /**\n * Add to indexed buffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n const parentBufferIndex = {\n shape: this,\n frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n };\n for (let i = 0, len = childIndexedBuffer.length; i < len; i++) {\n const currentIndexed = { ...childIndexedBuffer[i] };\n const parent = currentIndexed.parent\n ? Shape.setIndexedParent(currentIndexed.parent, parentBufferIndex)\n : parentBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n }\n }\n }\n /**\n * Set parent of indexed\n *\n * @static\n * @param {(IBufferIndex )} current\n * @param {IBufferIndex} parent\n * @returns {(IBufferIndex )}\n */\n static setIndexedParent(current, parent) {\n const index = {\n ...current,\n };\n index.parent = current.parent ? Shape.setIndexedParent(current.parent, parent) : parent;\n return index;\n }\n /**\n * Set shape\n *\n * @param {(SceneChild | undefined)} [shape]\n */\n setShape(shape) {\n if (typeof shape === 'undefined') {\n this.shape = undefined;\n this.clearBuffer(true, true);\n }\n else {\n this.scene && Scene_1.Scene.propagateToChilden(shape, this.scene);\n this.shape = shape;\n this.shape.clearBuffer(true, true);\n }\n }\n}\nexports.Shape = Shape;\n//# sourceMappingURL=Shape.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapePrimitive = void 0;\nconst glme = require(\"../math/gl-matrix-extensions\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\nconst Modifier_1 = require(\"../modifiers/Modifier\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\n/**\n * @category Core.Abstract\n */\nclass ShapePrimitive extends ShapeBase_1.ShapeBase {\n /**\n * Creates an instance of ShapePrimitive.\n *\n * @param {IShapePrimitiveSettings} [settings={}]\n */\n constructor(settings = {}) {\n var _a;\n super(settings);\n /**\n * Contain the bounding of the last generated buffer\n *\n * @type {IShapeBounding}\n */\n this.currentGenerationPrimitiveBounding = Adapt_1.Bounding.empty();\n this.props.sideLength =\n typeof settings.sideLength === 'undefined'\n ? undefined\n : typeof settings.sideLength === 'function'\n ? settings.sideLength\n : glme.toVec2(settings.sideLength);\n this.drawer = settings.drawer || {};\n this.modifiers = settings.modifiers;\n this.bClosed = (_a = settings.bClosed) !== null && _a !== void 0 ? _a : true;\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n * @memberof ShapePrimitive\n */\n isStatic() {\n return typeof this.props.sideLength !== 'function' && super.isStatic();\n }\n /**\n * Return sideLength for current repetition\n *\n * @param propArguments\n * @returns\n */\n getRepetitionSideLength(propArguments) {\n if (this.bStatic) {\n // not set default value into constructor because it can be overridden by group\n if (typeof this.props.sideLength === 'undefined') {\n this.props.sideLength = [50, 50];\n }\n else if (typeof this.props.sideLength === 'number') {\n this.props.sideLength = [this.props.sideLength, this.props.sideLength];\n }\n return this.props.sideLength;\n }\n return glme.toVec2(this.getProp('sideLength', propArguments, [50, 50]));\n }\n /**\n * Apply modifiers on single repetition buffer\n *\n * @param buffer\n * @returns\n */\n applyModifiers(buffer, propArguments) {\n if (typeof this.modifiers === 'undefined')\n return buffer;\n let modified = buffer;\n const modifiers = Array.isArray(this.modifiers) ? this.modifiers : [this.modifiers];\n for (let i = 0, len = modifiers.length; i < len; i++) {\n const modifier = modifiers[i] instanceof Modifier_1.Modifier\n ? modifiers[i]\n : modifiers[i](propArguments);\n //@ts-ignore\n modified = modifier.apply(modified, this.bClosed, this);\n }\n return modified;\n }\n /**\n * Return a bounding of generated buffer if is direct scene child\n *\n * @returns {IShapeBounding}\n * @memberof ShapePrimitive\n */\n getShapeBounding() {\n return this.currentGenerationPrimitiveBounding;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n const index = {\n shape: this,\n frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n };\n this.indexedBuffer.push(index);\n }\n /**\n * Return bClosed\n *\n * @returns {boolean}\n * @memberof ShapePrimitive\n */\n isClosed() {\n return this.bClosed;\n }\n /**\n * Set bClosed\n *\n * @param {boolean} bClosed\n * @memberof ShapePrimitive\n */\n setClosed(bClosed) {\n this.bClosed = bClosed;\n }\n}\nexports.ShapePrimitive = ShapePrimitive;\n//# sourceMappingURL=ShapePrimitive.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeLoop = void 0;\nconst math_1 = require(\"../math\");\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst ShapePrimitive_1 = require(\"../shapes/ShapePrimitive\");\nconst ShapeBase_1 = require(\"./ShapeBase\");\n/**\n * Shape Loop\n *\n * @category Core.Shapes\n * @public\n * @class ShapeLoop\n * @extends {ShapePrimitive}\n */\nclass ShapeLoop extends ShapePrimitive_1.ShapePrimitive {\n /**\n * Creates an instance of ShapeLoop.\n *\n * @param {IShapeLoopSettings} [settings={}]\n * @param {boolean} [bPreventGeneration=false]\n */\n constructor(settings = {}, bPreventGeneration = false) {\n settings.type = settings.type || 'ShapeLoop';\n super(settings);\n this.loopDependencies = (settings.loopDependencies || []).concat('sideLength');\n this.props.loop = settings.loop;\n if (!bPreventGeneration) {\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: math_1.PI2 / 10,\n vertex: () => [0, 0],\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n }\n /**\n * Check if currentOrSingleLoopBuffer is static\n *\n * @returns {boolean}\n */\n isStaticLoop() {\n if (this.loopDependencies.includes('propArguments'))\n return false;\n for (let i = 0, len = this.loopDependencies.length; i < len; i++)\n if (typeof this.props[this.loopDependencies[i]] === 'function')\n return false;\n return true;\n }\n /**\n * Check if shape is static\n *\n * @returns {boolean}\n */\n isStatic() {\n return this.bStaticLoop && super.isStatic();\n }\n /**\n * Check if shape has static indexed\n * The number of vertices is defined by number of loop iteration\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n // return this.bStaticLoop && super.isStaticIndexed()\n return (super.isStaticIndexed() &&\n (typeof this.props.loop !== 'undefined'\n ? typeof this.props.loop.start !== 'function' &&\n typeof this.props.loop.end !== 'function' &&\n typeof this.props.loop.inc !== 'function'\n : true));\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n this.bStaticLoop = this.isStaticLoop();\n if (bClearIndexed) {\n this.currentOrSingleLoopBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n * Set single or multiple props\n *\n * @param {(Props)} key\n * @param {*} [value]\n * @param {boolean} [bClearIndexed=false]\n */\n setProp(key, value) {\n let bClearIndexed = false;\n const keys = (typeof key === 'string' ? { [key]: value } : key);\n for (let i = this.loopDependencies.length - 1; i >= 0; i--) {\n if (this.loopDependencies[i] in keys) {\n // this.props.loop = undefined\n bClearIndexed = true;\n break;\n }\n }\n if ('loop' in keys) {\n keys.loop = { ...this.props.loop, ...keys.loop };\n bClearIndexed = true;\n }\n super.setProp(keys, value, bClearIndexed);\n }\n /**\n * Return length of buffer\n *\n * @param {PropArguments} [propArguments]\n * @returns {number}\n */\n getBufferLength(propArguments) {\n if (this.bStatic && typeof this.buffer !== 'undefined')\n return this.buffer.length;\n if (this.bStaticLoop && typeof this.currentOrSingleLoopBuffer !== 'undefined')\n return this.currentOrSingleLoopBuffer.length * this.getRepetitionCount();\n const { count } = this.getLoop(propArguments || ShapeBase_1.ShapeBase.getEmptyPropArguments(this));\n return this.getRepetitionCount() * count * 2;\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (!this.bStaticLoop)\n return this.generateLoopBuffer(propArguments);\n if (typeof this.props.sideLength === 'function' || typeof this.currentOrSingleLoopBuffer === 'undefined')\n this.currentOrSingleLoopBuffer = this.generateLoopBuffer(propArguments);\n return this.currentOrSingleLoopBuffer;\n }\n /**\n * Generate loop buffer\n *\n * @protected\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateLoopBuffer(propArguments) {\n const { start, inc, /*end,*/ count } = this.getLoop(propArguments);\n const sideLength = this.getRepetitionSideLength(propArguments);\n const getVertex = (this.props.loop && this.props.loop.vertex ? this.props.loop.vertex : this.loop.vertex);\n const shapeLoop = {\n index: 0,\n offset: 0,\n current: 0,\n count: count,\n };\n const vertexLength = shapeLoop.count;\n const bufferLength = vertexLength * 2;\n const currentOrSingleLoopBuffer = new Float32Array(bufferLength);\n for (let i = 0, j = 0; i < vertexLength; i++, j += 2) {\n const current = start + inc * i;\n const offset = shapeLoop.count > 1 ? i / (shapeLoop.count - 1) : 1;\n // const angle = (end - start) * offset + start\n shapeLoop.current = current;\n shapeLoop.index = i + 1;\n shapeLoop.offset = offset;\n const vertex = getVertex(shapeLoop, propArguments);\n currentOrSingleLoopBuffer[j] = vertex[0];\n currentOrSingleLoopBuffer[j + 1] = vertex[1];\n // currentOrSingleLoopBuffer[j] *= sideLength[0]\n // currentOrSingleLoopBuffer[j + 1] *= sideLength[1]\n // Bounding.add(tmpBounding, currentOrSingleLoopBuffer[j], currentOrSingleLoopBuffer[j + 1])\n }\n const tmpBounding = [undefined, undefined, undefined, undefined];\n const buffer = this.applyModifiers(currentOrSingleLoopBuffer, propArguments);\n for (let i = 0, len = buffer.length; i < len; i += 2) {\n buffer[i] = buffer[i] * sideLength[0];\n buffer[i + 1] = buffer[i + 1] * sideLength[1];\n Adapt_1.Bounding.add(tmpBounding, buffer[i], buffer[i + 1]);\n }\n Adapt_1.Bounding.bind(this.currentGenerationPrimitiveBounding, tmpBounding);\n return buffer;\n }\n /**\n * Return information about a client loop gnerator\n *\n * @public\n * @param {PropArguments} propArguments\n * @returns {ShapeLoopInformation}\n */\n getLoop(propArguments) {\n var _a, _b, _c, _d, _e, _f;\n let start = (_b = (_a = this.props.loop) === null || _a === void 0 ? void 0 : _a.start) !== null && _b !== void 0 ? _b : this.loop.start;\n let end = (_d = (_c = this.props.loop) === null || _c === void 0 ? void 0 : _c.end) !== null && _d !== void 0 ? _d : this.loop.end;\n let inc = (_f = (_e = this.props.loop) === null || _e === void 0 ? void 0 : _e.inc) !== null && _f !== void 0 ? _f : this.loop.inc;\n start = (typeof start === 'function' ? start(propArguments) : start);\n end = (typeof end === 'function' ? end(propArguments) : end);\n inc = (typeof inc === 'function' ? inc(propArguments) : inc);\n const count = Math.ceil((end - start) / inc);\n return { start, end, inc, count: count <= 0 ? 0 : count };\n }\n /**\n * Set shape from loop generator\n *\n * @param {(IShapeLoopGenerator)} [shape]\n */\n setShape(loop) {\n this.setProp('loop', loop);\n }\n /**\n * Get static buffer\n *\n * @param sideLength\n * @returns\n */\n static getBuffer(props) {\n const shape = new this({ ...props, sideLength: props.sideLength || 1 });\n shape.generate();\n return shape.getBuffer() || new Float32Array();\n }\n}\nexports.ShapeLoop = ShapeLoop;\nShapeLoop.PId2 = Math.PI / 2;\n//# sourceMappingURL=ShapeLoop.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeBuffer = void 0;\nconst Adapt_1 = require(\"../modifiers/Adapt\");\nconst ShapePrimitive_1 = require(\"../shapes/ShapePrimitive\");\n/**\n * @category Core.Shapes\n */\nclass ShapeBuffer extends ShapePrimitive_1.ShapePrimitive {\n /**\n * Creates an instance of ShapeBuffer.\n *\n * @param {IShapeBufferSettings} [settings={}]\n */\n constructor(settings = {}) {\n var _a, _b;\n settings.type = settings.type || 'ShapeBuffer';\n settings.adaptMode = (_a = settings.adaptMode) !== null && _a !== void 0 ? _a : Adapt_1.EAdaptMode.Scale;\n super(settings);\n this.adaptMode = (_b = settings.adaptMode) !== null && _b !== void 0 ? _b : Adapt_1.EAdaptMode.Fill;\n if (typeof settings.shape === 'undefined') {\n console.warn('[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property');\n this.shape = ShapeBuffer.EMPTY_BUFFER;\n }\n else {\n this.shape = typeof settings.shape !== 'function' ? Adapt_1.Adapt.adapt(settings.shape, this.adaptMode) : settings.shape;\n }\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n /**\n * Check shape is static\n *\n * @returns boolean\n */\n isStatic() {\n return typeof this.shape !== 'function' && super.isStatic();\n }\n /**\n * Check shape is static indexed\n *\n * @returns boolean\n */\n isStaticIndexed() {\n return typeof this.shape !== 'function' && super.isStaticIndexed();\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n this.shapeBuffer = undefined;\n }\n /**\n * Apply sideLength on .shape buffer and calculate bounding\n *\n * @protected\n */\n bindBuffer(propArguments) {\n const sideLength = this.getRepetitionSideLength(propArguments);\n const shapeBuffer = this.applyModifiers(Float32Array.from(typeof this.shape === 'function' ? this.shape(propArguments) : this.shape), propArguments);\n const tmpBounding = [undefined, undefined, undefined, undefined];\n for (let i = 0, len = shapeBuffer.length; i < len; i += 2) {\n shapeBuffer[i] = shapeBuffer[i] * sideLength[0];\n shapeBuffer[i + 1] = shapeBuffer[i + 1] * sideLength[1];\n Adapt_1.Bounding.add(tmpBounding, shapeBuffer[i], shapeBuffer[i + 1]);\n }\n Adapt_1.Bounding.bind(this.currentGenerationPrimitiveBounding, tmpBounding);\n this.shapeBuffer = shapeBuffer;\n }\n /**\n * Return length of buffer\n *\n * @param {IPropArguments} propArguments\n * @returns {number}\n */\n getBufferLength( /*propArguments?: IPropArguments*/) {\n if (this.buffer && this.buffer.length > 0)\n return this.buffer.length;\n return this.shape.length * this.getRepetitionCount();\n }\n /**\n * Return a buffer of children shape or loop generated buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (typeof this.shapeBuffer === 'undefined' ||\n typeof this.props.sideLength === 'function' ||\n typeof this.shape === 'function') {\n this.bindBuffer(propArguments);\n }\n return this.shapeBuffer;\n }\n /**\n * Set shape\n *\n * @param {(Float32Array)} [shape]\n */\n setShape(shape) {\n this.shape = Adapt_1.Adapt.adapt(shape, this.adaptMode);\n this.clearBuffer(true);\n }\n /**\n * Return adaptMode\n *\n * @returns {EAdaptMode}\n * @memberof ShapeBase\n */\n getAdaptMode() {\n return this.adaptMode;\n }\n /**\n * Get static buffer\n *\n * @param sideLength\n * @returns\n */\n static getBuffer(props = {}) {\n const shape = new this({ ...props, sideLength: props.sideLength || 1 });\n shape.generate();\n return shape.getBuffer() || new Float32Array();\n }\n}\nexports.ShapeBuffer = ShapeBuffer;\n//# sourceMappingURL=ShapeBuffer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeRecursive = void 0;\nconst Shape_1 = require(\"./Shape\");\n/**\n * @category Core.Shapes\n */\nclass ShapeRecursive extends Shape_1.Shape {\n /**\n * Creates an instance of ShapeRecursive.\n *\n * @param {IShapeRecursiveSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'ShapeRecursive';\n super(settings);\n this.props.recursions = settings.recursions || 1;\n this.props.recursionScale = settings.recursionScale || 2;\n this.props.recursionVertex = settings.recursionVertex || 0;\n // this.bInner = settings.bInner ?? false\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n this.shapeUseRecursion = !!settings.shapeUseRecursion;\n // this.currentGenerationRecursiveBounding = Bounding.empty()\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n if (bClearIndexed) {\n this.shapeRecursiveBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n * Set type of recursion\n *\n * @param {boolean} inner\n */\n // public setRecursionnInner(inner: boolean): void {\n // \tthis.bInner = inner\n // \tthis.clearBuffer(true)\n // }\n /**\n *\n * @returns {boolean}\n */\n isStatic() {\n return (typeof this.props.recursions !== 'function' &&\n typeof this.props.recursionScale !== 'function' &&\n typeof this.props.recursionVertex !== 'function' &&\n super.isStatic());\n }\n /**\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return (typeof this.props.recursions !== 'function' &&\n typeof this.props.recursionVertex !== 'function' &&\n super.isStaticIndexed());\n }\n /**\n * Return a buffer of children shape with recursion\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape) {\n if (typeof this.shapeRecursiveBuffer === 'undefined' ||\n this.shapeUseParent ||\n this.shape.generateId !== generateId) {\n this.bindBuffer(generateId, propArguments);\n }\n return this.shapeRecursiveBuffer;\n }\n return Shape_1.Shape.EMPTY_BUFFER;\n }\n /**\n * Generate Recoursive shape buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n */\n bindBuffer(generateId, propArguments) {\n const recursions = Math.floor(this.getProp('recursions', propArguments, 1));\n const recursionVertex = Math.floor(this.getProp('recursionVertex', propArguments, 0));\n const recursionScale = this.getProp('recursionScale', propArguments, 2);\n const childShape = this.shape;\n let currentRecursionRepetition = {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: 1 },\n };\n const recursionPropArguments = {\n ...propArguments,\n recursion: currentRecursionRepetition,\n };\n childShape.generate(generateId, false, recursionPropArguments);\n const firstGenerationChildBuffer = childShape.getBuffer();\n if (recursions <= 1) {\n // this.currentGenerationRecursiveBounding = this.shape.getBounding()\n this.shapeRecursiveBuffer = firstGenerationChildBuffer;\n return;\n }\n let shapeBuffer = firstGenerationChildBuffer;\n const storedRecursion = [currentRecursionRepetition];\n let paretRecursionIndex = 0, added = 1;\n // const tmpBounding = [undefined, undefined, undefined, undefined]\n const singleShapeBufferLength = shapeBuffer.length;\n const realVertexCount = singleShapeBufferLength / 2;\n const singleShapeVertexCount = recursionVertex <= 0 ? realVertexCount : Math.min(recursionVertex, realVertexCount);\n const recursionOffsetMultiplier = recursionVertex === 0 ? 1 : realVertexCount / Math.min(recursionVertex, realVertexCount);\n const recusiveShapeBuffer = new Float32Array(ShapeRecursive.summmation(recursions, singleShapeVertexCount) * singleShapeBufferLength);\n for (let i = 0; i < singleShapeBufferLength; i += 2) {\n recusiveShapeBuffer[i] = shapeBuffer[i];\n recusiveShapeBuffer[i + 1] = shapeBuffer[i + 1];\n // Bounding.add(tmpBounding, recusiveShapeBuffer[i], recusiveShapeBuffer[i + 1])\n }\n for (let currentRecursion = 1; currentRecursion < recursions; currentRecursion++) {\n const level_offset = recursions > 1 ? currentRecursion / (recursions - 1) : 1;\n const currentRecursionVertexCount = ShapeRecursive.summmation(currentRecursion, singleShapeVertexCount);\n const recursionBufferStartIndex = currentRecursionVertexCount * singleShapeBufferLength;\n const parentRecursion = currentRecursion - 1;\n const parentRecursionBufferStartIndex = parentRecursion === 0\n ? 0\n : ShapeRecursive.summmation(parentRecursion, singleShapeVertexCount) * singleShapeBufferLength;\n for (let currentShapeRecursionRepetition = 0, totalRecursionRepetitions = singleShapeVertexCount ** currentRecursion; currentShapeRecursionRepetition < totalRecursionRepetitions; currentShapeRecursionRepetition++, added++) {\n currentRecursionRepetition = {\n index: currentShapeRecursionRepetition + 1,\n offset: totalRecursionRepetitions > 1 ? currentShapeRecursionRepetition / (totalRecursionRepetitions - 1) : 1,\n count: totalRecursionRepetitions,\n level: { index: currentRecursion + 1, offset: level_offset, count: recursions },\n parent: storedRecursion[paretRecursionIndex],\n };\n storedRecursion.push(currentRecursionRepetition);\n if (this.shapeUseRecursion) {\n recursionPropArguments.recursion = currentRecursionRepetition;\n childShape.generate(generateId, false, recursionPropArguments);\n shapeBuffer = childShape.getBuffer();\n }\n const shapeVertexBufferIndex = recursionBufferStartIndex + currentShapeRecursionRepetition * singleShapeBufferLength;\n // const centerVertexIndex = parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2\n const centerVertexIndex = Math.floor(parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2 * recursionOffsetMultiplier);\n const centerX = recusiveShapeBuffer[centerVertexIndex];\n const centerY = recusiveShapeBuffer[centerVertexIndex + 1];\n const currentRecursionScale = recursionScale ** currentRecursion;\n for (let i = 0, len = singleShapeBufferLength; i < len; i += 2) {\n // if (this.bInner) {\n // \tconst parentCurrentVertex =\n // \t\tparentRecursionBufferStartIndex +\n // \t\tMath.floor(currentShapeRecursionRepetition / singleShapeVertexCount) *\n // \t\t\tsingleShapeVertexCount *\n // \t\t\trecursionOffsetMultiplier *\n // \t\t\t2\n // \tconst parentX = recusiveShapeBuffer[parentCurrentVertex + i]\n // \tconst parentY = recusiveShapeBuffer[parentCurrentVertex + i + 1]\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i] = (centerX - parentX) / recursionScale + parentX\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = (centerY - parentY) / recursionScale + parentY\n // const parentX = shapeBuffer[i] / recursionScale ** currentRecursion\n // const parentY = shapeBuffer[i + 1] / recursionScale ** currentRecursion\n // recusiveShapeBuffer[shapeVertexBufferIndex + i] = (centerX - parentX) / recursionScale + parentX\n // recusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = (centerY - parentY) / recursionScale + parentY\n // } else {\n const parentXScaled = shapeBuffer[i] / currentRecursionScale;\n const parentYScaled = shapeBuffer[i + 1] / currentRecursionScale;\n recusiveShapeBuffer[shapeVertexBufferIndex + i] = centerX + parentXScaled;\n recusiveShapeBuffer[shapeVertexBufferIndex + i + 1] = centerY + parentYScaled;\n // }\n // Bounding.add(\n // \ttmpBounding,\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i],\n // \trecusiveShapeBuffer[shapeVertexBufferIndex + i + 1]\n // )\n }\n if (added % singleShapeVertexCount === 0) {\n paretRecursionIndex += 1;\n }\n }\n }\n // Bounding.bind(this.currentGenerationRecursiveBounding, tmpBounding)\n this.shapeRecursiveBuffer = recusiveShapeBuffer;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const propArguments = { repetition, shape: this };\n const recursions = Math.floor(this.getProp('recursions', propArguments, 1));\n const recursionVertex = Math.floor(this.getProp('recursionVertex', propArguments, 0));\n // const realFrameLength = ShapeRecursive.summmation(recursions, this.shape.getBufferLength() / 2)\n const bufferIndex = {\n shape: this,\n frameLength: frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n recursion: {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: recursions },\n },\n };\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentRecursionRepetition = {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: recursions > 1 ? 0 : 1, count: recursions },\n };\n const recursionBufferIndex = {\n ...bufferIndex,\n recursion: currentRecursionRepetition,\n };\n const parent = (currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, recursionBufferIndex)\n : recursionBufferIndex);\n this.indexedBuffer.push({\n ...currentIndexed,\n parent,\n });\n }\n if (recursions > 1) {\n const realVertexCount = this.shape.getBufferLength({ ...propArguments, parent: { ...bufferIndex } }) / 2;\n const vertexCount = recursionVertex <= 0 ? realVertexCount : Math.min(recursionVertex, realVertexCount);\n const storedRecursion = this.indexedBuffer.map(indexed => [indexed.parent.recursion]);\n let paretRecursionIndex = 0, added = 1;\n for (let i = 1; i < recursions; i++) {\n const level_offset = recursions > 1 ? i / (recursions - 1) : 1;\n for (let j = 0, len = vertexCount ** i; j < len; j++, added++) {\n const recursionOffset = len > 1 ? j / (len - 1) : 1;\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentRecursionRepetition = {\n index: j + 1,\n offset: recursionOffset,\n count: len,\n level: { index: i + 1, offset: level_offset, count: recursions },\n parent: storedRecursion[childIndexed][paretRecursionIndex],\n };\n const recursionBufferIndex = { ...bufferIndex, recursion: currentRecursionRepetition };\n const parent = currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, recursionBufferIndex)\n : recursionBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n storedRecursion[childIndexed].push(currentRecursionRepetition);\n if (added % vertexCount === 0) {\n paretRecursionIndex += 1;\n }\n }\n }\n }\n }\n }\n }\n /**\n * Retturn summation value\n *\n * @static\n * @param {number} recursion\n * @param {number} vertexCount\n * @returns {number}\n */\n static summmation(recursion, vertexCount) {\n if (recursion === 1)\n return 1;\n let result = 1;\n for (let i = 1; i < recursion; i++)\n result += vertexCount ** i;\n return result;\n }\n /**\n * Empty recursion repetition\n *\n * @static\n * @return {*} {IRecursionRepetition}\n */\n static getEmptyRecursion() {\n return {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: 1, count: 1 },\n };\n }\n}\nexports.ShapeRecursive = ShapeRecursive;\n//# sourceMappingURL=ShapeRecursive.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShapeFollow = void 0;\nconst Shape_1 = require(\"./Shape\");\n/**\n * @category Core.Shapes\n */\nclass ShapeFollow extends Shape_1.Shape {\n /**\n * Creates an instance of ShapeFollow.\n *\n * @param {IShapeFollowSettings} [settings={}]\n */\n constructor(settings) {\n settings.type = settings.type || 'ShapeFollow';\n super(settings);\n this.follow = settings.follow || settings.shape;\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n this.shapeUseFollow = !!settings.shapeUseFollow;\n // this.currentGenerationRecursiveBounding = Bounding.empty()\n }\n /**\n * Unset buffer\n *\n * @param {boolean} [bClearIndexed=false]\n * @param {boolean} [bPropagateToParents=false]\n * @param {boolean} [bPropagateToChildren=false]\n */\n clearBuffer(bClearIndexed = false, bPropagateToParents = true) {\n if (bClearIndexed) {\n this.shapeFollowBuffer = undefined;\n }\n super.clearBuffer(bClearIndexed, bPropagateToParents);\n }\n /**\n *\n * @returns {boolean}\n */\n isStatic() {\n return (this.follow ? this.follow.isStatic() : true) && super.isStatic();\n }\n /**\n *\n * @returns {boolean}\n */\n isStaticIndexed() {\n return (this.follow ? this.follow.isStaticIndexed() : true) && super.isStaticIndexed();\n }\n /**\n * Return a buffer of children shape with recursion\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n * @returns {Float32Array}\n */\n generateBuffer(generateId, propArguments) {\n if (this.shape && this.follow) {\n if (typeof this.shapeFollowBuffer === 'undefined' ||\n this.shapeUseParent ||\n this.shape.generateId !== generateId ||\n this.follow.generateId !== generateId) {\n this.bindBuffer(generateId, propArguments);\n }\n return this.shapeFollowBuffer;\n }\n return Shape_1.Shape.EMPTY_BUFFER;\n }\n /**\n * Generate Recoursive shape buffer\n *\n * @protected\n * @param {number} generateId\n * @param {PropArguments} propArguments\n */\n bindBuffer(generateId, propArguments) {\n const followShape = this.follow;\n followShape.generate(generateId, false, propArguments);\n const followBuffer = followShape.getBuffer();\n // const followIndexed = followShape.getIndexedBuffer() as Array\n const followPropArguments = {\n ...propArguments,\n follow: {\n index: 1,\n offset: 1,\n count: 1,\n },\n // follow_repetition: followIndexed[0].repetition,\n };\n const childShape = this.shape;\n childShape.generate(generateId, false, followPropArguments);\n let shapeBuffer = childShape.getBuffer();\n // const tmpBounding = [undefined, undefined, undefined, undefined]\n const singleShapeBufferLength = shapeBuffer.length;\n const followShapeBuffer = new Float32Array(singleShapeBufferLength * (followBuffer.length / 2));\n const totalFollowVertexCount = followBuffer.length / 2;\n for (let currentShapeFollowRepetition = 0; currentShapeFollowRepetition < totalFollowVertexCount; currentShapeFollowRepetition++) {\n const currentFollowRepetition = {\n index: currentShapeFollowRepetition + 1,\n offset: totalFollowVertexCount > 1 ? currentShapeFollowRepetition / (totalFollowVertexCount - 1) : 1,\n count: totalFollowVertexCount,\n };\n if (this.shapeUseFollow) {\n followPropArguments.follow = currentFollowRepetition;\n // followPropArguments.follow_repetition = followIndexed[currentShapeFollowRepetition].repetition\n childShape.generate(generateId, false, followPropArguments);\n shapeBuffer = childShape.getBuffer();\n }\n const shapeVertexBufferIndex = currentShapeFollowRepetition * singleShapeBufferLength;\n // const centerVertexIndex = parentRecursionBufferStartIndex + currentShapeRecursionRepetition * 2\n const centerVertexIndex = currentShapeFollowRepetition * 2;\n const centerX = followBuffer[centerVertexIndex];\n const centerY = followBuffer[centerVertexIndex + 1];\n for (let i = 0, len = shapeBuffer.length; i < len; i += 2) {\n followShapeBuffer[shapeVertexBufferIndex + i] = centerX + shapeBuffer[i];\n followShapeBuffer[shapeVertexBufferIndex + i + 1] = centerY + shapeBuffer[i + 1];\n // Bounding.add(\n // \ttmpBounding,\n // \tfollowShapeBuffer[shapeVertexBufferIndex + i],\n // \tfollowShapeBuffer[shapeVertexBufferIndex + i + 1]\n // )\n }\n }\n // Bounding.bind(this.currentGenerationRecursiveBounding, tmpBounding)\n this.shapeFollowBuffer = followShapeBuffer;\n }\n /**\n * Add this to indexedBuffer\n *\n * @protected\n * @param {number} frameLength\n * @param {IRepetition} repetition\n * @returns {number} nextIndex\n */\n addIndex(frameLength, repetition, singleRepetitionBounding) {\n if (this.shape) {\n const propArguments = { repetition, shape: this };\n const bufferIndex = {\n shape: this,\n frameLength: frameLength,\n singleRepetitionBounding,\n repetition: {\n type: repetition.type,\n angle: repetition.angle,\n index: repetition.index,\n count: repetition.count,\n offset: repetition.offset,\n row: {\n index: repetition.row.index,\n count: repetition.row.count,\n offset: repetition.row.offset,\n },\n col: {\n index: repetition.col.index,\n count: repetition.col.count,\n offset: repetition.col.offset,\n },\n },\n follow: {\n index: 1,\n offset: 1,\n count: 1,\n },\n };\n const childIndexedBuffer = this.shape.getIndexedBuffer() || [];\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const vertexCount = this.follow.getBuffer().length / 2; // this.follow.getBufferLength({ ...propArguments, parent: { ...bufferIndex } }) / 2\n for (let j = 0, len = vertexCount; j < len; j++) {\n const followOffset = len > 1 ? j / (len - 1) : 1;\n for (let childIndexed = 0, childIndexedLen = childIndexedBuffer.length; childIndexed < childIndexedLen; childIndexed++) {\n const currentIndexed = { ...childIndexedBuffer[childIndexed] };\n const currentFollowRepetition = {\n index: j + 1,\n offset: followOffset,\n count: len,\n };\n const followBufferIndex = { ...bufferIndex, follow: currentFollowRepetition };\n const parent = currentIndexed.parent\n ? Shape_1.Shape.setIndexedParent(currentIndexed.parent, followBufferIndex)\n : followBufferIndex;\n this.indexedBuffer.push({ ...currentIndexed, parent });\n }\n }\n }\n }\n }\n /**\n * Retturn summation value\n *\n * @static\n * @param {number} recursion\n * @param {number} vertexCount\n * @returns {number}\n */\n static summmation(recursion, vertexCount) {\n if (recursion === 1)\n return 1;\n let result = 1;\n for (let i = 1; i < recursion; i++)\n result += vertexCount ** i;\n return result;\n }\n /**\n * Empty recursion repetition\n *\n * @static\n * @return {*} {IRecursionRepetition}\n */\n static getEmptyRecursion() {\n return {\n index: 1,\n offset: 1,\n count: 1,\n level: { index: 1, offset: 1, count: 1 },\n };\n }\n}\nexports.ShapeFollow = ShapeFollow;\n//# sourceMappingURL=ShapeFollow.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Line = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n *\n * @category Core.Primitives\n * @class Line\n * @extends {ShapeBuffer}\n */\nclass Line extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Two point, based on ShapeBuffer\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Line\n */\n constructor(settings = {}) {\n settings.type = 'Line';\n settings.shape = Line.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n settings.bClosed = false;\n super(settings);\n }\n /**\n * @link https://gist.github.com/pborissow/5c92b77a804688385c77749d1187ba07\n */\n static toPolygon(buffer, thickness) {\n const solidified = [];\n //Convert thickness into an array as needed\n if (!Array.isArray(thickness)) {\n const _thickness = thickness;\n const points = buffer.length / 2;\n thickness = new Array(points);\n for (let i = 0; i < points; i++) {\n thickness[i] = _thickness;\n }\n }\n function getOffsets(ax, ay, bx, by, thickness) {\n const dx = bx - ax, dy = by - ay, len = Math.sqrt(dx * dx + dy * dy), scale = thickness / (2 * len);\n return [-scale * dy, scale * dx];\n }\n function getIntersection(a1, b1, a2, b2) {\n // directional constants\n const k1 = (b1[1] - a1[1]) / (b1[0] - a1[0]), k2 = (b2[1] - a2[1]) / (b2[0] - a2[0]);\n // if the directional constants are equal, the lines are parallel\n if (Math.abs(k1 - k2) < 0.00001) {\n return;\n }\n // y offset constants for both lines\n const m1 = a1[1] - k1 * a1[0];\n const m2 = a2[1] - k2 * a2[0];\n // compute x\n const x = (m1 - m2) / (k2 - k1);\n // use y = k * x + m to get y coordinate\n const y = k1 * x + m1;\n return [x, y];\n }\n let bFirst, bLast, prevA = [\n [0, 0],\n [0, 0],\n ], prevB = [\n [0, 0],\n [0, 0],\n ];\n for (let i = 0, len = buffer.length - 2; i < len; i += 2) {\n bFirst = i === 0;\n bLast = i === len - 2;\n const off = getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], thickness[i]);\n const p0a = [buffer[i] + off[0], buffer[i + 1] + off[1]];\n const p1a = [buffer[i + 2] + off[0], buffer[i + 3] + off[1]];\n const p0b = [buffer[i] - off[0], buffer[i + 1] - off[1]];\n const p1b = [buffer[i + 2] - off[0], buffer[i + 3] - off[1]];\n if (!bFirst) {\n const interA = getIntersection(prevA[0], prevA[1], p0a, p1a);\n if (interA) {\n solidified.unshift(interA[1]);\n solidified.unshift(interA[0]);\n }\n const interB = getIntersection(prevB[0], prevB[1], p0b, p1b);\n if (interB) {\n solidified.push(interB[0]);\n solidified.push(interB[1]);\n }\n }\n if (bFirst) {\n solidified.unshift(p0a[1]);\n solidified.unshift(p0a[0]);\n solidified.push(p0b[0]);\n solidified.push(p0b[1]);\n }\n if (bLast) {\n solidified.unshift(p1a[1]);\n solidified.unshift(p1a[0]);\n solidified.push(p1b[0]);\n solidified.push(p1b[1]);\n }\n if (!bLast) {\n prevA = [p0a, p1a];\n prevB = [p0b, p1b];\n }\n }\n return Float32Array.from(solidified);\n }\n}\nexports.Line = Line;\nLine.buffer = [-1, 0, 1, 0];\n//# sourceMappingURL=Line.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Triangle = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n * Triangle ShapeBuffer\n *\n * @category Core.Primitives\n */\nclass Triangle extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Creates an instance of Triangleeee.\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Triangle\n */\n constructor(settings = {}) {\n settings.type = 'Triangle';\n settings.shape = Triangle.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n super(settings);\n }\n}\nexports.Triangle = Triangle;\nTriangle.buffer = [1, 0, -1, 1, -1, -1];\n//# sourceMappingURL=Triangle.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Rect = void 0;\nconst Adapt_1 = require(\"../../modifiers/Adapt\");\nconst ShapeBuffer_1 = require(\"../ShapeBuffer\");\n/**\n *\n * @category Core.Primitives\n * @class Rect\n * @extends {ShapeBuffer}\n */\nclass Rect extends ShapeBuffer_1.ShapeBuffer {\n /**\n * Creates an instance of Rect.\n *\n * @param {ShapeBaseSettings} [settings={}]\n * @memberof Rect\n */\n constructor(settings = {}) {\n settings.type = 'Rect';\n settings.shape = Rect.buffer;\n settings.adaptMode = Adapt_1.EAdaptMode.None;\n super(settings);\n }\n}\nexports.Rect = Rect;\nRect.buffer = [1, 1, -1, 1, -1, -1, 1, -1];\n//# sourceMappingURL=Rect.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Polygon = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Polygon shape\n *\n * @category Core.Primitives\n * @class Polygon\n * @extends {ShapeLoop}\n */\nclass Polygon extends ShapeLoop_1.ShapeLoop {\n /**\n * Is based on ShapeLoop and you can pass `sideNumber` property to define\n * a number of sides.\n *\n * @param settings\n */\n constructor(settings = {}) {\n settings.type = settings.type || 'Polygon';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['sideNumber']);\n super(settings, true);\n this.props.sideNumber = settings.sideNumber;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: (propArguments) => {\n return math_1.PI2 / this.getProp('sideNumber', propArguments, 5);\n },\n vertex: shapeLoopRepetition => {\n return [Math.cos(shapeLoopRepetition.current), Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n}\nexports.Polygon = Polygon;\n//# sourceMappingURL=Polygon.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Circle = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n *\n * @category Core.Primitives\n * @class Circle\n * @extends {ShapeLoop}\n */\nclass Circle extends ShapeLoop_1.ShapeLoop {\n /**\n * Based on ShapeLoop, the number of point (resolution) is based on sideLength.\n *\n * @param {ShapeLoopSettings} [settings={}]\n * @memberof Circle\n */\n constructor(settings = {}) {\n settings.type = 'Circle';\n super(settings, true);\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const sideLength = this.getRepetitionSideLength(propArguments);\n return (1 / Math.pow(sideLength[0] * sideLength[1], 0.25)) * ShapeLoop_1.ShapeLoop.PId2;\n },\n vertex: shapeLoopRepetition => [Math.cos(shapeLoopRepetition.current), Math.sin(shapeLoopRepetition.current)],\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n}\nexports.Circle = Circle;\n//# sourceMappingURL=Circle.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Star = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Polygon shape\n *\n * @category Core.Primitives\n * @class Polygon\n * @extends {ShapeLoop}\n */\nclass Star extends ShapeLoop_1.ShapeLoop {\n /**\n * Is based on ShapeLoop and you can pass `spikes` property to define\n * a number of spikes and `innerRadius`\n *\n * @param settings\n */\n constructor(settings = {}) {\n settings.type = settings.type || 'Polygon';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['spikes', 'innerRadius']);\n super(settings, true);\n this.props.spikes = settings.spikes;\n this.props.innerRadius = settings.innerRadius;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: (propArguments) => {\n // dyamic binding in `generateLoopBuffer`\n return this.inc;\n },\n vertex: shapeLoopRepetition => {\n const angle = (Math.PI / this.spikes) * shapeLoopRepetition.index;\n const radius = shapeLoopRepetition.index % 2 === 0 ? 1 : this.innerRadius;\n return [Math.cos(angle) * radius, Math.sin(angle) * radius];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.spikes = this.getProp('spikes', propArguments, 5);\n this.innerRadius = this.getProp('innerRadius', propArguments, 0.5);\n this.inc = Math.PI / this.spikes;\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.Star = Star;\n//# sourceMappingURL=Star.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Rose = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Rose shape\n *\n * @category Core.Primitives\n * @class Rose\n * @extends {ShapeLoop}\n */\nclass Rose extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Rose.\n *\n * @param {IRoseSettings} [settings={}]\n * @memberof Rose\n */\n constructor(settings = {}) {\n var _a, _b;\n settings.type = 'Rose';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['n', 'd']);\n super(settings, true);\n this.props.n = (_a = settings.n) !== null && _a !== void 0 ? _a : 1;\n this.props.d = (_b = settings.d) !== null && _b !== void 0 ? _b : 2;\n this.loop = {\n start: 0,\n end: (propArguments) => Rose.getFinalAngleFromK(this.getProp('n', propArguments), this.getProp('d', propArguments)),\n inc: (propArguments) => {\n const n = this.getProp('n', propArguments);\n const d = this.getProp('d', propArguments);\n const sideLength = this.getRepetitionSideLength(propArguments);\n const sides = Math.pow(sideLength[0] * sideLength[1], 0.45);\n const k = d < n ? n / d : 1.5;\n return math_1.PI2 / (sides * k);\n },\n vertex: (shapeLoopRepetition) => {\n const f = Math.cos(this.k * shapeLoopRepetition.current);\n return [f * Math.cos(shapeLoopRepetition.current), f * Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.k = this.getProp('n', propArguments) / this.getProp('d', propArguments);\n return super.generateLoopBuffer(propArguments);\n }\n /**\n * Return end angle of rose\n *\n * @static\n * @param {number} n\n * @param {number} d\n * @returns {number}\n * @memberof Rose\n */\n static getFinalAngleFromK(n, d) {\n if (n == d)\n return math_1.PI2;\n const k = n / d;\n const p = n * d;\n if (!Number.isInteger(k) && k % 0.5 == 0)\n return 4 * Math.PI;\n return Math.PI * d * (p % 2 == 0 ? 2 : 1);\n }\n}\nexports.Rose = Rose;\n//# sourceMappingURL=Rose.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Spiral = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n * Spiral shape\n *\n * @category Core.Primitives\n * @class Spiral\n * @extends {ShapeLoop}\n */\nclass Spiral extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Spiral.\n *\n * @param {SpiralSettings} [settings={}]\n * @memberof Spiral\n */\n constructor(settings = {}) {\n var _a, _b, _c;\n settings.type = 'Spiral';\n settings.bClosed = false;\n settings.loopDependencies = (settings.loopDependencies || []).concat(['twists', 'twistsStart', 'spiral']);\n super(settings, true);\n this.props.spiral = (_a = settings.spiral) !== null && _a !== void 0 ? _a : Spiral.types.ARCHIMEDE;\n this.props.twists = (_b = settings.twists) !== null && _b !== void 0 ? _b : 2;\n this.props.twistsStart = (_c = settings.twistsStart) !== null && _c !== void 0 ? _c : 0;\n this.loop = {\n start: (propArguments) => math_1.PI2 * this.getProp('twistsStart', propArguments),\n end: (propArguments) => math_1.PI2 *\n (this.getProp('twistsStart', propArguments) + this.getProp('twists', propArguments)),\n inc: (propArguments) => {\n const twists = this.getProp('twists', propArguments);\n const rep = math_1.PI2 * twists;\n const sideLength = this.getRepetitionSideLength(propArguments);\n const radius = 4 + Math.sqrt(sideLength[0] * sideLength[1]);\n return rep / (radius * twists);\n },\n vertex: (shapeLoopRepetition) => {\n const r = this.r(shapeLoopRepetition.current);\n return [r * Math.cos(shapeLoopRepetition.current), r * Math.sin(shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.spiral = this.getProp('spiral', propArguments);\n this.r = Spiral.getRFromTSpiralType(this.spiral);\n return super.generateLoopBuffer(propArguments);\n }\n /**\n * Point position and scale factor for spiral types\n *\n * @static\n * @param {TSpiralType} spiral\n * @returns {number}\n * @memberof Spiral\n */\n static getRFromTSpiralType(spiral) {\n switch (spiral) {\n case Spiral.types.ARCHIMEDE:\n return angle => angle / 10;\n case Spiral.types.HYPERBOLIC:\n return angle => (1 / angle) * 3;\n case Spiral.types.FERMAT:\n return angle => angle ** 0.5 / 3;\n case Spiral.types.LITUUS:\n return angle => angle ** -0.5;\n case Spiral.types.LOGARITHMIC:\n return angle => Math.E ** (angle * 0.2) / 10;\n }\n return angle => angle;\n }\n}\nexports.Spiral = Spiral;\n/**\n * Spural types\n *\n * @static\n * @type {{ [name in TSpiralType]: TSpiralType }}\n * @memberof Spiral\n */\nSpiral.types = {\n ARCHIMEDE: 'ARCHIMEDE',\n HYPERBOLIC: 'HYPERBOLIC',\n FERMAT: 'FERMAT',\n LITUUS: 'LITUUS',\n LOGARITHMIC: 'LOGARITHMIC',\n};\n//# sourceMappingURL=Spiral.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Lissajous = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../../shapes/ShapeLoop\");\n/**\n * Lissajous shape\n *\n * @category Core.Primitives\n * @class Lissajous\n * @extends {ShapeLoop}\n */\nclass Lissajous extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of Lissajous.\n *\n * @param {ILissajousSettings} [settings={}]\n * @memberof Lissajous\n */\n constructor(settings = {}) {\n settings.type = 'Lissajous';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['wx', 'wy', 'wz']);\n super(settings, true);\n this.props.wx = settings.wx || 1;\n this.props.wy = settings.wy || 2;\n this.props.wz = settings.wz || 0;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const wx = this.getProp('wx', propArguments);\n const wy = this.getProp('wy', propArguments);\n const ratio = wx == wy ? ShapeLoop_1.ShapeLoop.PId2 : 0.5 - Math.min(49, wx + wy) * 0.01;\n const sideLength = this.getRepetitionSideLength(propArguments);\n return (1 / Math.pow(sideLength[0] * sideLength[1], 0.25)) * ratio;\n },\n vertex: (shapeLoopRepetition) => {\n return this.wx === this.wy\n ? [Math.cos(shapeLoopRepetition.current + this.wz), Math.sin(shapeLoopRepetition.current)]\n : [Math.cos(this.wx * shapeLoopRepetition.current + this.wz), Math.sin(this.wy * shapeLoopRepetition.current)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.wx = this.getProp('wx', propArguments, 1);\n this.wy = this.getProp('wy', propArguments, 2);\n this.wz = this.getProp('wz', propArguments, 2);\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.Lissajous = Lissajous;\n//# sourceMappingURL=Lissajous.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SuperShape = void 0;\nconst math_1 = require(\"../../math\");\nconst ShapeLoop_1 = require(\"../ShapeLoop\");\n/**\n * ShperShape\n *\n * @category Core.Primitives\n * @class SuperShape\n * @extends {ShapeLoop}\n */\nclass SuperShape extends ShapeLoop_1.ShapeLoop {\n /**\n * Creates an instance of SuperShape.\n *\n * @param {ISuperShapeSettings} [settings={}]\n * @memberof SuperShape\n */\n constructor(settings = {}) {\n var _a, _b, _c, _d, _e, _f;\n settings.type = 'SuperShape';\n settings.loopDependencies = (settings.loopDependencies || []).concat(['a', 'b', 'm', 'n1', 'n2', 'n3']);\n super(settings, true);\n this.props.a = (_a = settings.a) !== null && _a !== void 0 ? _a : 1;\n this.props.b = (_b = settings.b) !== null && _b !== void 0 ? _b : 1;\n this.props.m = (_c = settings.m) !== null && _c !== void 0 ? _c : 6;\n this.props.n1 = (_d = settings.n1) !== null && _d !== void 0 ? _d : 1;\n this.props.n2 = (_e = settings.n2) !== null && _e !== void 0 ? _e : 1;\n this.props.n3 = (_f = settings.n3) !== null && _f !== void 0 ? _f : 1;\n this.loop = {\n start: 0,\n end: math_1.PI2,\n inc: propArguments => {\n const sideLength = this.getRepetitionSideLength(propArguments);\n return Math.PI / Math.pow(sideLength[0] * sideLength[1], 0.5);\n },\n vertex: (shapeLoopRepetition) => {\n const angle = shapeLoopRepetition.current;\n const m = (this.m * angle) / 4;\n const a = Math.abs(Math.cos(m) / this.a) ** this.n2;\n const b = Math.abs(Math.sin(m) / this.b) ** this.n3;\n const raux = (a + b) ** (1 / this.n1);\n const r = raux === 0 ? 1 : 1 / raux;\n return [r * Math.cos(angle), r * Math.sin(angle)];\n },\n };\n this.bStaticLoop = this.isStaticLoop();\n this.bStatic = this.isStatic();\n this.bStaticIndexed = this.isStaticIndexed();\n }\n generateLoopBuffer(propArguments) {\n this.a = this.getProp('a', propArguments);\n this.b = this.getProp('b', propArguments);\n this.m = this.getProp('m', propArguments);\n this.n1 = this.getProp('n1', propArguments);\n this.n2 = this.getProp('n2', propArguments);\n this.n3 = this.getProp('n3', propArguments);\n return super.generateLoopBuffer(propArguments);\n }\n}\nexports.SuperShape = SuperShape;\n//# sourceMappingURL=SuperShape.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Modifiers = void 0;\nconst Adapt_1 = require(\"./Adapt\");\nconst Mirror_1 = require(\"./Mirror\");\nconst Smooth_1 = require(\"./Smooth\");\nconst Solidify_1 = require(\"./Solidify\");\nconst Subdivide_1 = require(\"./Subdivide\");\nconst Close_1 = require(\"./Close\");\nconst Offset_1 = require(\"./Offset\");\nconst Modifiers = {\n Adapt: Adapt_1.Adapt,\n Mirror: Mirror_1.Mirror,\n Smooth: Smooth_1.Smooth,\n Solidify: Solidify_1.Solidify,\n Subdivide: Subdivide_1.Subdivide,\n Close: Close_1.Close,\n Offset: Offset_1.Offset,\n};\nexports.Modifiers = Modifiers;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Mirror = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Mirror extends Modifier_1.Modifier {\n constructor(args = { x: true, y: true }) {\n super();\n this.x = args.x === true;\n this.y = args.y === true;\n }\n apply(buffer, bClosed) {\n const bufferLength = buffer.length;\n const mirror = new Float32Array(bufferLength * (this.x ? 2 : 1) * (this.y ? 2 : 1));\n const sideLengthX = 1;\n const sideLengthY = 1;\n if (this.x && this.y) {\n const bufferLengthX2 = bufferLength + bufferLength;\n const bufferLengthX3 = bufferLengthX2 + bufferLength;\n // |1|2|\n // |4|3|\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i] - sideLengthX;\n mirror[i + 1] = buffer[i + 1] - sideLengthY;\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i] * -1 + sideLengthX;\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1] - sideLengthY;\n mirror[bufferLengthX2 + i] = buffer[i] * -1 + sideLengthX;\n mirror[bufferLengthX2 + i + 1] = buffer[i + 1] * -1 + sideLengthY;\n mirror[bufferLengthX3 + i] = buffer[bufferLength - 2 - i] - sideLengthX;\n mirror[bufferLengthX3 + i + 1] = buffer[bufferLength - 2 - i + 1] * -1 + sideLengthY;\n }\n }\n else if (this.x) {\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i] - sideLengthX;\n mirror[i + 1] = buffer[i + 1];\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i] * -1 + sideLengthX;\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1];\n }\n }\n else if (this.y) {\n for (let i = 0; i < bufferLength; i += 2) {\n mirror[i] = buffer[i];\n mirror[i + 1] = buffer[i + 1] - sideLengthY;\n mirror[bufferLength + i] = buffer[bufferLength - 2 - i];\n mirror[bufferLength + i + 1] = buffer[bufferLength - 2 - i + 1] * -1 + sideLengthY;\n }\n }\n else {\n return buffer;\n }\n return mirror;\n }\n}\nexports.Mirror = Mirror;\n//# sourceMappingURL=Mirror.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Smooth = void 0;\nconst Utilities_1 = require(\"../Utilities\");\nconst Close_1 = require(\"./Close\");\nconst Modifier_1 = require(\"./Modifier\");\nclass Smooth extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.level = args.level || 1;\n const tension = Array.isArray(args.tension) ? args.tension : [args.tension];\n this.tension = new Array(this.level).fill(0.5).map((v, i) => Utilities_1.clamp(0, 1, tension[i] || v));\n this.level = this.level < 1 ? 1 : this.level;\n this.closed = args.closed === true;\n }\n apply(buffer, bClosed) {\n if (bClosed && !Close_1.Close.isClosed(buffer)) {\n const bufferLen = buffer.length;\n const mofified = new Float32Array(bufferLen + 2);\n mofified.set(buffer, 0);\n mofified[bufferLen] = buffer[0];\n mofified[bufferLen + 1] = buffer[1];\n buffer = mofified;\n }\n let smoothed = buffer;\n for (let i = 0, len = this.level; i < len; i++)\n smoothed = Smooth.smooth(smoothed, this.tension[i], bClosed || this.closed);\n return smoothed;\n }\n /**\n * Chaikin smooth\n *\n * the tension factor defines a scale between corner cutting distance in segment half length,\n * i.e. between 0.05 and 0.45. The opposite corner will be cut by the inverse\n * (i.e. 1-cutting distance) to keep symmetry.\n * with a tension value of 0.5 this amounts to 0.25 = 1/4 and 0.75 = 3/4,\n * the original Chaikin values\n *\n * @link https://www.codeproject.com/Articles/1093960/D-Polyline-Vertex-Smoothing\n * @param buffer\n */\n static smooth(buffer, tension = 0.5, bClosed = false) {\n const bufferLength = buffer.length;\n const smoothed = new Float32Array((buffer.length - (bClosed ? 1 : 0)) * 2);\n if (!bClosed) {\n smoothed[0] = buffer[0];\n smoothed[1] = buffer[1];\n }\n const cutdist = 0.05 + tension * 0.4;\n const ncutdist = 1 - cutdist;\n let smoothedLength = bClosed ? 0 : 2;\n for (let i = 0, len = bufferLength - 2; i < len; i += 2, smoothedLength += 4) {\n // q\n smoothed[smoothedLength] = ncutdist * buffer[i] + cutdist * buffer[i + 2];\n smoothed[smoothedLength + 1] = ncutdist * buffer[i + 1] + cutdist * buffer[i + 3];\n // r\n smoothed[smoothedLength + 2] = cutdist * buffer[i] + ncutdist * buffer[i + 2];\n smoothed[smoothedLength + 3] = cutdist * buffer[i + 1] + ncutdist * buffer[i + 3];\n }\n if (!bClosed) {\n smoothed[smoothedLength] = buffer[bufferLength - 2];\n smoothed[smoothedLength + 1] = buffer[bufferLength - 1];\n }\n else {\n smoothed[smoothedLength] = smoothed[0];\n smoothed[smoothedLength + 1] = smoothed[1];\n }\n return smoothed;\n }\n}\nexports.Smooth = Smooth;\n//# sourceMappingURL=Smooth.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Close = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Close extends Modifier_1.Modifier {\n constructor() {\n super();\n }\n apply(buffer, bClosed, shape) {\n return Close.call(buffer);\n }\n static call(buffer) {\n const len = buffer.length;\n if (Close.isClosed(buffer))\n return buffer;\n const result = new Float32Array(len + 2);\n result.set(buffer, 0);\n result[len] = result[0];\n result[len + 1] = result[1];\n return result;\n }\n static isClosed(buffer) {\n const len = buffer.length;\n return buffer[0] === buffer[len - 2] && buffer[1] === buffer[len - 1];\n }\n}\nexports.Close = Close;\n//# sourceMappingURL=Close.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Solidify = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Solidify extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.closed = args.closed === true;\n this.thickness = args.thickness || 0.2;\n this.error = args.error;\n }\n apply(buffer, bClosed) {\n return Solidify.solidify(buffer, this.thickness, this.closed, this.error);\n }\n /**\n * @link https://gist.github.com/kekscom/4194148\n */\n static solidify(buffer, thickness, bClosed = false, error) {\n const solidified = [];\n thickness = typeof thickness === 'number' ? [thickness] : thickness;\n const thicknessLength = thickness.length;\n let bFirst, bLast, prevA = [\n [0, 0],\n [0, 0],\n ], prevB = [\n [0, 0],\n [0, 0],\n ];\n for (let i = 0, t = 0, len = buffer.length - 2; i < len; i += 2, t++) {\n bFirst = i === 0;\n bLast = i === len - 2;\n const currentThicknessRep = {\n index: i + 1,\n offset: i / len,\n count: len,\n };\n const nextThicknessRep = {\n index: i + 2,\n offset: (i + 1) / len,\n count: len,\n };\n const currentThickness = typeof thickness === 'function' ? thickness(currentThicknessRep) : thickness[t % thicknessLength];\n const nextThickness = typeof thickness === 'function' ? thickness(nextThicknessRep) : thickness[(t + 1) % thicknessLength];\n const off = Solidify.getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], currentThickness);\n const off2 = Solidify.getOffsets(buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3], nextThickness);\n const p0a = [buffer[i] + off[0], buffer[i + 1] + off[1]];\n const p1a = [buffer[i + 2] + off2[0], buffer[i + 3] + off2[1]];\n const p0b = [buffer[i] - off[0], buffer[i + 1] - off[1]];\n const p1b = [buffer[i + 2] - off2[0], buffer[i + 3] - off2[1]];\n if (!bFirst) {\n const interA = Solidify.getIntersection(prevA[0], prevA[1], p0a, p1a, error);\n if (interA) {\n solidified.unshift(interA[1]);\n solidified.unshift(interA[0]);\n }\n const interB = Solidify.getIntersection(prevB[0], prevB[1], p0b, p1b, error);\n if (interB) {\n solidified.push(interB[0]);\n solidified.push(interB[1]);\n }\n }\n if (bFirst) {\n solidified.unshift(p0a[1]);\n solidified.unshift(p0a[0]);\n solidified.push(p0b[0]);\n solidified.push(p0b[1]);\n }\n if (bLast) {\n solidified.unshift(p1a[1]);\n solidified.unshift(p1a[0]);\n solidified.push(p1b[0]);\n solidified.push(p1b[1]);\n }\n if (!bLast) {\n prevA = [p0a, p1a];\n prevB = [p0b, p1b];\n }\n }\n if (bClosed) {\n const centerIndex = buffer.length - 2;\n const lastIndex = solidified.length - 2;\n const x = 0.5 * solidified[0] + solidified[centerIndex] * 0.5;\n const y = 0.5 * solidified[1] + solidified[centerIndex + 1] * 0.5;\n const x2 = 0.5 * solidified[centerIndex + 2] + solidified[lastIndex] * 0.5;\n const y2 = 0.5 * solidified[centerIndex + 3] + solidified[lastIndex + 1] * 0.5;\n solidified[0] = x;\n solidified[1] = y;\n solidified[centerIndex] = x;\n solidified[centerIndex + 1] = y;\n solidified[centerIndex + 2] = x2;\n solidified[centerIndex + 3] = y2;\n solidified[lastIndex] = x2;\n solidified[lastIndex + 1] = y2;\n }\n return Float32Array.from(solidified);\n }\n static getOffsets(ax, ay, bx, by, thickness) {\n const dx = bx - ax, dy = by - ay, len = Math.sqrt(dx * dx + dy * dy), scale = thickness / (2 * len);\n return [-scale * dy, scale * dx];\n }\n static getIntersection(a1, b1, a2, b2, error = 0.00001) {\n // directional constants\n const k1 = (b1[1] - a1[1]) / (b1[0] - a1[0]), k2 = (b2[1] - a2[1]) / (b2[0] - a2[0]);\n // if the directional constants are equal, the lines are parallel\n // if (Math.abs(k1 - k2) < 0.00001) {\n if (Math.abs(k1 - k2) < error) {\n return;\n }\n // y offset constants for both lines\n const m1 = a1[1] - k1 * a1[0];\n const m2 = a2[1] - k2 * a2[0];\n // compute x\n const x = (m1 - m2) / (k2 - k1);\n // use y = k * x + m to get y coordinate\n const y = k1 * x + m1;\n return [x, y];\n }\n}\nexports.Solidify = Solidify;\n//# sourceMappingURL=Solidify.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Subdivide = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Subdivide extends Modifier_1.Modifier {\n constructor(args = {}) {\n super();\n this.level = args.level || 1;\n this.level = this.level < 1 ? 1 : this.level;\n }\n apply(buffer, bClosed) {\n const level = this.level;\n let subdivided = buffer;\n if (subdivided && subdivided.length > 0) {\n for (let i = 0; i < level; i++)\n subdivided = Subdivide.subdivide(subdivided, bClosed);\n }\n return subdivided;\n }\n /**\n * Subdivide buffer\n *\n * @static\n * @param {Float32Array} shape\n * @param {boolean} [bClosed=true]\n * @returns {(Float32Array)}\n */\n static subdivide(buffer, bClosed = false) {\n const bufferLength = buffer.length;\n const subdivided = new Float32Array(bufferLength * 2 - (bClosed ? 0 : 2));\n for (let i = 0; i < bufferLength; i += 2) {\n if (i === 0) {\n subdivided[0] = buffer[0];\n subdivided[1] = buffer[1];\n }\n else {\n const px = buffer[i - 2];\n const py = buffer[i - 1];\n const x = buffer[i];\n const y = buffer[i + 1];\n const nx = (x + px) / 2;\n const ny = (y + py) / 2;\n subdivided[(i - 1) * 2] = nx;\n subdivided[(i - 1) * 2 + 1] = ny;\n subdivided[i * 2] = x;\n subdivided[i * 2 + 1] = y;\n }\n }\n if (bClosed) {\n subdivided[(bufferLength - 1) * 2] = (buffer[0] + buffer[bufferLength - 2]) / 2;\n subdivided[(bufferLength - 1) * 2 + 1] = (buffer[1] + buffer[bufferLength - 1]) / 2;\n }\n return subdivided;\n }\n}\nexports.Subdivide = Subdivide;\n//# sourceMappingURL=Subdivide.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Offset = void 0;\nconst Modifier_1 = require(\"./Modifier\");\nclass Offset extends Modifier_1.Modifier {\n constructor(args = { from: 0, to: undefined }) {\n super();\n this.from = args.from;\n this.to = args.to;\n }\n apply(buffer, bClosed) {\n return buffer.subarray(this.from, this.to ? (this.to < 0 ? buffer.length + this.to : this.to) : undefined);\n }\n}\nexports.Offset = Offset;\n//# sourceMappingURL=Offset.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./utilities\"), exports);\n__exportStar(require(\"./createAnimation\"), exports);\n__exportStar(require(\"./createInterpolator\"), exports);\n__exportStar(require(\"./Easings\"), exports);\n__exportStar(require(\"./Animation\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.interpolateColorHSL = exports.interpolateColorRGB = exports.cosp = exports.sinp = exports.clockOffset = exports.clock = void 0;\n/**\n * Return time (from 0 to duration) in milliseconds\n *\n * @export\n * @param {number} time Current time\n * @param {number} duration Clock duration\n * @param {(number | boolean)} [loop=true]\n * @param {('normal' | 'reverse' | 'alternate')} [direction='alternate']\n * @param {number} [delay=0]\n * @param {number} [afterDelay=0]\n * @return {*} {number} Between 0 and duration\n */\nfunction clock(time, duration, loop = true, direction = 'alternate', delay = 0, afterDelay = 0) {\n const totalDuration = direction === 'normal'\n ? duration + delay\n : direction === 'reverse'\n ? duration + delay\n : duration * 2 + delay + afterDelay;\n if ((typeof loop === 'number' && time >= totalDuration * loop) || (loop === false && time >= totalDuration)) {\n return direction === 'normal' ? duration : 0;\n }\n time %= totalDuration;\n if ((time -= delay) <= 0) {\n return 0;\n }\n if (direction === 'alternate') {\n if (time <= duration) {\n // normal\n return time;\n }\n else {\n // reverse\n time -= duration;\n if ((time -= afterDelay) >= 0) {\n return duration - (time >= duration ? duration : time);\n }\n return duration;\n }\n }\n else {\n return time >= duration ? duration : time;\n }\n}\nexports.clock = clock;\n/**\n * Return offset between 0 and 1 from current time based on duration and other parameters\n *\n * @export\n * @param {number} time\n * @param {number} duration\n * @param {(number | boolean)} [loop=true]\n * @param {('normal' | 'reverse' | 'alternate')} [direction='alternate']\n * @param {number} [delay=0]\n * @param {number} [afterDelay=0]\n * @return {*} {number}\n */\nfunction clockOffset(time, duration, loop = true, direction = 'alternate', delay = 0, afterDelay = 0) {\n return clock(time, duration, loop, direction, delay, afterDelay) / duration;\n}\nexports.clockOffset = clockOffset;\nconst PI2 = Math.PI * 2;\n/**\n * Return sin of period 'durate' in time 'time'\n *\n * @export\n * @param {number} time\n * @param {number} durate\n * @param {number} phase\n * @param {boolean} [normalize=false]\n * @return {*} {number}\n */\nfunction sinp(time, durate, phase = 0, normalize = false) {\n const value = Math.sin((time * PI2) / durate + phase);\n return normalize ? 0.5 + value * 0.5 : value;\n}\nexports.sinp = sinp;\n/**\n * Return cos of period 'durate' in time 'time'\n *\n * @export\n * @param {number} time\n * @param {number} durate\n * @param {number} phase\n * @param {boolean} [normalize=false]\n * @return {*} {number}\n */\nfunction cosp(time, durate, phase = 0, normalize = false) {\n const value = Math.cos((time * PI2) / durate + phase);\n return normalize ? 0.5 + value * 0.5 : value;\n}\nexports.cosp = cosp;\nfunction interpolateColorRGB(start, end, offset) {\n const r = start.r + offset * (end.r - start.r);\n const g = start.g + offset * (end.g - start.g);\n const b = start.b + offset * (end.b - start.b);\n const alpha = start.alpha + offset * (end.alpha - start.alpha);\n return `rgba(${Math.floor(r)},${Math.floor(g)},${Math.floor(b)},${alpha})`;\n}\nexports.interpolateColorRGB = interpolateColorRGB;\nfunction interpolateColorHSL(start, end, offset) {\n const h = start.h + offset * (end.h - start.h);\n const s = start.s + offset * (end.s - start.s);\n const l = start.l + offset * (end.l - start.l);\n const alpha = start.alpha + offset * (end.alpha - start.alpha);\n return `hsla(${h},${s}%,${l}%,${alpha})`;\n}\nexports.interpolateColorHSL = interpolateColorHSL;\n//# sourceMappingURL=utilities.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createAnimation = void 0;\nconst createInterpolator_1 = require(\"./createInterpolator\");\n/**\n * Create TAnimation from object\n *\n * @param simpleAnimation\n * @returns\n */\nfunction createAnimation(simpleAnimation) {\n const interpolate = createInterpolator_1.createInterpolationCallback(simpleAnimation);\n if (typeof interpolate === 'undefined')\n return undefined;\n const delay = simpleAnimation.delay || 0;\n const afterDelay = simpleAnimation.afterDelay || 0;\n const direction = simpleAnimation.direction || 'normal';\n const duration = simpleAnimation.duration || 1000;\n const totalDuration = direction === 'normal'\n ? duration + delay\n : direction === 'reverse'\n ? duration + delay\n : duration * 2 + delay + afterDelay;\n const loop = typeof simpleAnimation.loop === 'number' ? simpleAnimation.loop : !!simpleAnimation.loop;\n const bindedValues = {\n delay,\n afterDelay,\n direction,\n duration,\n totalDuration,\n loop,\n };\n const animationFunction = createInterpolator_1.createInterpolator(simpleAnimation.interpolator);\n const animation = {\n loop: 0,\n offset: 0,\n loopDuration: totalDuration,\n direction: direction === 'alternate' ? 'normal' : direction,\n started: false,\n ended: false,\n value: undefined,\n };\n animation.update = createUpdate(animation, bindedValues, animationFunction, interpolate);\n return animation;\n}\nexports.createAnimation = createAnimation;\n/**\n *\n * @internal\n * @param animation\n * @param bindedValues\n * @param animationFunction\n * @param interpolate\n * @returns\n */\nfunction createUpdate(animation, bindedValues, animationFunction, interpolate) {\n const { loop, totalDuration, delay, afterDelay, direction, duration } = bindedValues;\n return (time) => {\n // Check animation is ended\n if ((typeof loop === 'number' && time >= totalDuration * loop) ||\n (loop === false && time >= bindedValues.totalDuration)) {\n animation.started = false;\n animation.ended = true;\n animation.offset = animationFunction(direction === 'normal' ? duration : 0, duration);\n animation.value = interpolate(animation.offset);\n return;\n }\n animation.loop = Math.ceil(time / totalDuration);\n time %= totalDuration;\n if ((time -= delay) <= 0) {\n animation.started = false;\n animation.offset = animationFunction(0, duration);\n animation.value = interpolate(animation.offset);\n return;\n }\n animation.started = true;\n if (direction === 'alternate') {\n if (time <= duration) {\n animation.direction = 'normal';\n animation.offset = animationFunction(time, duration);\n }\n else {\n animation.direction = 'reverse';\n time -= duration;\n // wait afterDelay\n if ((time -= afterDelay) >= 0) {\n animation.offset = 1 - animationFunction(time >= duration ? duration : time, duration);\n }\n else {\n animation.offset = 1;\n }\n }\n }\n else {\n const animationValue = animationFunction(time >= duration ? duration : time, duration);\n animation.offset = direction === 'normal' ? animationValue : 1 - animationValue;\n }\n animation.value = interpolate(animation.offset);\n };\n}\n//# sourceMappingURL=createAnimation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createInterpolator = exports.createInterpolationCallback = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst bezier_easing_1 = require(\"bezier-easing\");\nconst Easings_1 = require(\"./Easings\");\nconst utilities_1 = require(\"./utilities\");\n/**\n * Return a callback for value interpolation passing offset from 0 to 1\n *\n * @param simpleAnimation\n * @returns\n */\nfunction createInterpolationCallback(simpleAnimation) {\n const from = Array.isArray(simpleAnimation.from) ? simpleAnimation.from : [simpleAnimation.from];\n const to = Array.isArray(simpleAnimation.to) ? simpleAnimation.to : [simpleAnimation.to];\n const round = simpleAnimation.round;\n const colorInterpolation = simpleAnimation.colorTransitionMode === 'hue' ? utilities_1.interpolateColorHSL : utilities_1.interpolateColorRGB;\n if (from.length !== to.length)\n return undefined;\n const callbacks = [];\n for (let i = 0, len = from.length; i < len; i++) {\n if (typeof from[i] !== typeof to[i]) {\n console.warn('[@urpflanze/animation]: `from` and `to` values mismatch');\n return undefined;\n }\n else {\n if (typeof from[i] !== 'string') {\n const a = from[i], b = to[i];\n callbacks.push(typeof round !== 'undefined'\n ? (offset) => offset === 1 ? b : offset === 0 ? a : Math.round((a + offset * (b - a)) * round) / round\n : (offset) => (offset === 1 ? b : offset === 0 ? a : a + offset * (b - a)));\n }\n else {\n const a = from[i];\n const b = to[i];\n const parsed_a = color_1.parseColorAndConvert(a);\n const parsed_b = color_1.parseColorAndConvert(b);\n if (typeof parsed_a !== 'undefined' && typeof parsed_b !== 'undefined') {\n callbacks.push((offset) => offset === 1 ? b : offset === 0 ? a : colorInterpolation(parsed_a, parsed_b, offset));\n }\n }\n }\n }\n return (offset) => {\n const values = callbacks.map(c => c(offset));\n return values.length === 1 ? values[0] : values;\n };\n}\nexports.createInterpolationCallback = createInterpolationCallback;\n/**\n * Return a callback for calculate offset (0 to 1) from elapsed time and animation duration\n *\n * @param type\n * @returns\n */\nfunction createInterpolator(type) {\n var _a, _b;\n switch (typeof type) {\n case 'function':\n return (elapsed, duration) => type(elapsed / duration, elapsed);\n case 'string':\n switch (type) {\n case 'wave':\n return (elapsed, duration) => 0.5 + Math.sin((elapsed * Math.PI * 2) / duration + Math.PI * 1.5) * 0.5;\n default: {\n if (type in Easings_1.Easings) {\n const easing = Easings_1.Easings[type];\n return (elapsed, duration) => easing(elapsed, 0, 1, duration);\n }\n return (elapsed, duration) => Easings_1.Easings.linear(elapsed, 0, 1, duration);\n }\n }\n case 'object':\n switch (type.type) {\n case 'wave': {\n const phase = Math.PI * 1.5 + (((_a = type.params) === null || _a === void 0 ? void 0 : _a.phase) || 0);\n return (elapsed, duration) => {\n return 0.5 + Math.sin((elapsed * Math.PI * 2) / duration + phase) * 0.5;\n };\n }\n case 'elasticIn':\n case 'elasticOut':\n case 'elasticInOut': {\n const easing = Easings_1.Easings[type.type];\n const { amplitude, period } = type.params || {};\n return (elapsed, duration) => easing(elapsed, 0, 1, duration, amplitude, period);\n }\n case 'backIn':\n case 'backOut':\n case 'backInOut': {\n const easing = Easings_1.Easings[type.type];\n const overshoot = ((_b = type.params) === null || _b === void 0 ? void 0 : _b.overshoot) || undefined;\n return (elapsed, duration) => easing(elapsed, 0, 1, duration, overshoot);\n }\n case 'cubicBezier': {\n const easing = bezier_easing_1.default(type.params[0], type.params[1], type.params[2], type.params[3]);\n return (elapsed, duration) => easing(elapsed / duration);\n }\n }\n }\n return (elapsed, duration) => Easings_1.Easings.linear(elapsed, 0, 1, duration);\n}\nexports.createInterpolator = createInterpolator;\n//# sourceMappingURL=createInterpolator.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./conversions\"), exports);\n__exportStar(require(\"./parsing\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.rgbToHsl = exports.hslToRgb = exports.rgbToHex = void 0;\n/**\n * Convert rgb to hex\n *\n * @param r number between 0 - 255\n * @param g number between 0 - 255\n * @param b number between 0 - 255\n * @returns #ffffff\n */\nfunction rgbToHex(r, g, b) {\n return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;\n}\nexports.rgbToHex = rgbToHex;\n/**\n * Convert hsl (0-360, 0-100, 0-100) color to rgb(0-255, 0-255, 0-255)\n *\n * @param {number} h number between 0 - 360\n * @param {number} s number between 0 - 100\n * @param {number} l number between 0 - 100\n * @returns {[number, number, number]} [0-255, 0-255, 0-255]\n */\nfunction hslToRgb(h, s, l) {\n h /= 360;\n s /= 100;\n l /= 100;\n let r, g, b;\n if (s == 0) {\n r = g = b = l; // achromatic\n }\n else {\n const hue2rgb = (p, q, t) => {\n t += t < 0 ? 1 : t > 1 ? -1 : 0;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n };\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return [(0.5 + r * 255) << 0, (0.5 + g * 255) << 0, (0.5 + b * 255) << 0];\n}\nexports.hslToRgb = hslToRgb;\n/**\n * Convert rbg (0-255, 0-255, 0-255) to hsl (0-360, 0-100, 0-100)\n *\n * @param {number} r number between 0 - 255\n * @param {number} g number between 0 - 255\n * @param {number} b number between 0 - 255\n * @returns {[number, number, number]} (0-360, 0-100, 0-100)\n */\nfunction rgbToHsl(r, g, b) {\n r /= 255;\n g /= 255;\n b /= 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s;\n if (max === min) {\n h = s = 0;\n }\n else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h = h / 6;\n }\n return [(0.5 + h * 360) << 0, (0.5 + s * 100) << 0, (0.5 + l * 100) << 0];\n}\nexports.rgbToHsl = rgbToHsl;\n//# sourceMappingURL=conversions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseColor = exports.parseColorAndConvert = void 0;\nconst htmlcolors_1 = require(\"./htmlcolors\");\nconst conversions_1 = require(\"./conversions\");\n/**\n * Convert color to IConvertedColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IConvertedColor | undefined)}\n */\nfunction parseColorAndConvert(color) {\n const parsed = parseColor(color);\n if (parsed) {\n if (parsed.type === 'hsl') {\n const [r, g, b] = conversions_1.hslToRgb(parsed.a, parsed.b, parsed.c);\n return {\n r,\n g,\n b,\n h: parsed.a,\n s: parsed.b,\n l: parsed.c,\n alpha: parsed.alpha,\n };\n }\n else {\n const [h, s, l] = conversions_1.rgbToHsl(parsed.a, parsed.b, parsed.c);\n return {\n h,\n s,\n l,\n r: parsed.a,\n g: parsed.b,\n b: parsed.c,\n alpha: parsed.alpha,\n };\n }\n }\n}\nexports.parseColorAndConvert = parseColorAndConvert;\n/**\n * Convert color to IColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IColor | undefined)}\n */\nfunction parseColor(color) {\n if (typeof color === 'number') {\n if (color > 0xffffff) {\n return {\n type: 'rgb',\n a: (color >> 24) & 255,\n b: (color >> 16) & 255,\n c: (color >> 8) & 255,\n alpha: (color & 255) / 255,\n };\n }\n else {\n return { type: 'rgb', a: (color >> 16) & 255, b: (color >> 8) & 255, c: color & 255, alpha: 1 };\n }\n }\n color = color.replace(/\\s/g, '');\n if (htmlcolors_1.default[color])\n color = htmlcolors_1.default[color];\n let match = /^#([0-9a-f]{3,8})$/i.exec(color);\n if (match) {\n const hex = match[1];\n if (hex.length === 3) {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[0], 16),\n b: parseInt(hex[1] + hex[1], 16),\n c: parseInt(hex[2] + hex[2], 16),\n alpha: 1,\n };\n }\n else {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[1], 16),\n b: parseInt(hex[2] + hex[3], 16),\n c: parseInt(hex[4] + hex[5], 16),\n alpha: hex.length > 6 ? parseInt(hex.substring(6), 16) / 255 : 1,\n };\n }\n }\n match = /^((hsl|rgb)a?)\\((\\d+),(\\d+)%?,(\\d+)%?,?(.+)?\\)$/i.exec(color);\n if (match) {\n const [, , type, a, b, c, alpha] = match;\n return {\n type: type,\n a: +a,\n b: +b,\n c: +c,\n alpha: alpha ? +alpha : 1,\n };\n }\n}\nexports.parseColor = parseColor;\n//# sourceMappingURL=parsing.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst colors = {\n aliceblue: '#f0f8ff',\n antiquewhite: '#faebd7',\n aqua: '#00ffff',\n aquamarine: '#7fffd4',\n azure: '#f0ffff',\n beige: '#f5f5dc',\n bisque: '#ffe4c4',\n black: '#000000',\n blanchedalmond: '#ffebcd',\n blue: '#0000ff',\n blueviolet: '#8a2be2',\n brown: '#a52a2a',\n burlywood: '#deb887',\n cadetblue: '#5f9ea0',\n chartreuse: '#7fff00',\n chocolate: '#d2691e',\n coral: '#ff7f50',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyan: '#00ffff',\n darkblue: '#00008b',\n darkcyan: '#008b8b',\n darkgoldenrod: '#b8860b',\n darkgray: '#a9a9a9',\n darkgreen: '#006400',\n darkkhaki: '#bdb76b',\n darkmagenta: '#8b008b',\n darkolivegreen: '#556b2f',\n darkorange: '#ff8c00',\n darkorchid: '#9932cc',\n darkred: '#8b0000',\n darksalmon: '#e9967a',\n darkseagreen: '#8fbc8f',\n darkslateblue: '#483d8b',\n darkslategray: '#2f4f4f',\n darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n gold: '#ffd700',\n goldenrod: '#daa520',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n indianred: '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n lavender: '#e6e6fa',\n lavenderblush: '#fff0f5',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrodyellow: '#fafad2',\n lightgrey: '#d3d3d3',\n lightgreen: '#90ee90',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\n maroon: '#800000',\n mediumaquamarine: '#66cdaa',\n mediumblue: '#0000cd',\n mediumorchid: '#ba55d3',\n mediumpurple: '#9370d8',\n mediumseagreen: '#3cb371',\n mediumslateblue: '#7b68ee',\n mediumspringgreen: '#00fa9a',\n mediumturquoise: '#48d1cc',\n mediumvioletred: '#c71585',\n midnightblue: '#191970',\n mintcream: '#f5fffa',\n mistyrose: '#ffe4e1',\n moccasin: '#ffe4b5',\n navajowhite: '#ffdead',\n navy: '#000080',\n oldlace: '#fdf5e6',\n olive: '#808000',\n olivedrab: '#6b8e23',\n orange: '#ffa500',\n orangered: '#ff4500',\n orchid: '#da70d6',\n palegoldenrod: '#eee8aa',\n palegreen: '#98fb98',\n paleturquoise: '#afeeee',\n palevioletred: '#d87093',\n papayawhip: '#ffefd5',\n peachpuff: '#ffdab9',\n peru: '#cd853f',\n pink: '#ffc0cb',\n plum: '#dda0dd',\n powderblue: '#b0e0e6',\n purple: '#800080',\n rebeccapurple: '#663399',\n red: '#ff0000',\n rosybrown: '#bc8f8f',\n royalblue: '#4169e1',\n saddlebrown: '#8b4513',\n salmon: '#fa8072',\n sandybrown: '#f4a460',\n seagreen: '#2e8b57',\n seashell: '#fff5ee',\n sienna: '#a0522d',\n silver: '#c0c0c0',\n skyblue: '#87ceeb',\n slateblue: '#6a5acd',\n slategray: '#708090',\n snow: '#fffafa',\n springgreen: '#00ff7f',\n steelblue: '#4682b4',\n tan: '#d2b48c',\n teal: '#008080',\n thistle: '#d8bfd8',\n tomato: '#ff6347',\n turquoise: '#40e0d0',\n violet: '#ee82ee',\n wheat: '#f5deb3',\n white: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32',\n};\nexports.default = colors;\n//# sourceMappingURL=htmlcolors.js.map","/**\n * https://github.com/gre/bezier-easing\n * BezierEasing - use bezier curve for transition easing function\n * by Gaëtan Renaudeau 2014 - 2015 – MIT License\n */\n\n// These values are established by empiricism with tests (tradeoff: performance VS precision)\nvar NEWTON_ITERATIONS = 4;\nvar NEWTON_MIN_SLOPE = 0.001;\nvar SUBDIVISION_PRECISION = 0.0000001;\nvar SUBDIVISION_MAX_ITERATIONS = 10;\n\nvar kSplineTableSize = 11;\nvar kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\nvar float32ArraySupported = typeof Float32Array === 'function';\n\nfunction A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\nfunction B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\nfunction C (aA1) { return 3.0 * aA1; }\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nfunction calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }\n\n// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\nfunction getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); }\n\nfunction binarySubdivide (aX, aA, aB, mX1, mX2) {\n var currentX, currentT, i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n return currentT;\n}\n\nfunction newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {\n for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n if (currentSlope === 0.0) {\n return aGuessT;\n }\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n}\n\nfunction LinearEasing (x) {\n return x;\n}\n\nmodule.exports = function bezier (mX1, mY1, mX2, mY2) {\n if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {\n throw new Error('bezier x values must be in [0, 1] range');\n }\n\n if (mX1 === mY1 && mX2 === mY2) {\n return LinearEasing;\n }\n\n // Precompute samples table\n var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n for (var i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n\n function getTForX (aX) {\n var intervalStart = 0.0;\n var currentSample = 1;\n var lastSample = kSplineTableSize - 1;\n\n for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n --currentSample;\n\n // Interpolate to provide an initial guess for t\n var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n var guessForT = intervalStart + dist * kSampleStepSize;\n\n var initialSlope = getSlope(guessForT, mX1, mX2);\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if (initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n }\n\n return function BezierEasing (x) {\n // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n if (x === 0) {\n return 0;\n }\n if (x === 1) {\n return 1;\n }\n return calcBezier(getTForX(x), mY1, mY2);\n };\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Easings = void 0;\n/**\n * Easing functions\n *\n * @category Services.Animation\n */\nconst Easings = {\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n linear: (timeOrOffset, start, end, duration = 1) => (end * timeOrOffset) / duration + start,\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return -end * timeOrOffset * (timeOrOffset - 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quadraticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset + start;\n timeOrOffset--;\n return (-end / 2) * (timeOrOffset * (timeOrOffset - 2) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * (timeOrOffset * timeOrOffset * timeOrOffset + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n cubicInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return -end * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quarticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (-end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset - 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return end * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n quinticInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + start;\n timeOrOffset -= 2;\n return (end / 2) * (timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset * timeOrOffset + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalIn: (timeOrOffset, start, end, duration = 1) => {\n return -end * Math.cos((timeOrOffset / duration) * (Math.PI / 2)) + end + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalOut: (timeOrOffset, start, end, duration = 1) => {\n return end * Math.sin((timeOrOffset / duration) * (Math.PI / 2)) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n sinusoidalInOut: (timeOrOffset, start, end, duration = 1) => {\n return (-end / 2) * (Math.cos((Math.PI * timeOrOffset) / duration) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialIn: (timeOrOffset, start, end, duration = 1) => {\n return end * Math.pow(2, 10 * (timeOrOffset / duration - 1)) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialOut: (timeOrOffset, start, end, duration = 1) => {\n return end * (-Math.pow(2, (-10 * timeOrOffset) / duration) + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n exponentialInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (end / 2) * Math.pow(2, 10 * (timeOrOffset - 1)) + start;\n timeOrOffset--;\n return (end / 2) * (-Math.pow(2, -10 * timeOrOffset) + 2) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularIn: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n return -end * (Math.sqrt(1 - timeOrOffset * timeOrOffset) - 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration;\n timeOrOffset--;\n return end * Math.sqrt(1 - timeOrOffset * timeOrOffset) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @returns {number}\n */\n circularInOut: (timeOrOffset, start, end, duration = 1) => {\n timeOrOffset /= duration / 2;\n if (timeOrOffset < 1)\n return (-end / 2) * (Math.sqrt(1 - timeOrOffset * timeOrOffset) - 1) + start;\n timeOrOffset -= 2;\n return (end / 2) * (Math.sqrt(1 - timeOrOffset * timeOrOffset) + 1) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticIn: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration) === 1) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n return (-(amplitude *\n Math.pow(2, 10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period)) + start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticOut: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration) === 1) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n return (amplitude * Math.pow(2, -10 * timeOrOffset) * Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period) +\n end +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} amplitude (optional)\n * @param {number} period (optional)\n * @return {number}\n */\n elasticInOut: (timeOrOffset, start, end, duration = 1, amplitude = 1, period = 0.5) => {\n if (timeOrOffset === 0) {\n return start;\n }\n if ((timeOrOffset /= duration / 2) === 2) {\n return start + end;\n }\n period *= duration;\n let s = 0;\n if (amplitude < Math.abs(end)) {\n amplitude = end;\n s = period / 4;\n }\n else {\n s = (period / (2 * Math.PI)) * Math.asin(end / amplitude);\n }\n if (timeOrOffset < 1) {\n return (-0.5 *\n (amplitude *\n Math.pow(2, 10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period)) +\n start);\n }\n return (amplitude *\n Math.pow(2, -10 * (timeOrOffset -= 1)) *\n Math.sin(((timeOrOffset * duration - s) * (2 * Math.PI)) / period) *\n 0.5 +\n end +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} overshoot (optional)\n * @return {number}\n */\n backIn: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n return end * (timeOrOffset /= duration) * timeOrOffset * ((overshoot + 1) * timeOrOffset - overshoot) + start;\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} s overshoot (optional)\n * @return {number}\n */\n backOut: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n return (end *\n ((timeOrOffset = timeOrOffset / duration - 1) * timeOrOffset * ((overshoot + 1) * timeOrOffset + overshoot) +\n 1) +\n start);\n },\n /**\n * @param {number} timeOrOffset current time\n * @param {number} start start value\n * @param {number} end end value\n * @param {number} duration duration\n * @param {number} overshoot (optional)\n * @return {number}\n */\n backInOut: (timeOrOffset, start, end, duration = 1, overshoot = 1.70158) => {\n if ((timeOrOffset /= duration / 2) < 1) {\n return (end / 2) * (timeOrOffset * timeOrOffset * (((overshoot *= 1.525) + 1) * timeOrOffset - overshoot)) + start;\n }\n return ((end / 2) * ((timeOrOffset -= 2) * timeOrOffset * (((overshoot *= 1.525) + 1) * timeOrOffset + overshoot) + 2) +\n start);\n },\n /**\n * @param {number} t current time\n * @param {number} b start value\n * @param {number} c end value\n * @param {number} d duration\n * @return {number}\n */\n bounceIn: (timeOrOffset, start, end, duration = 1) => {\n return end - Easings.bounceOut(duration - timeOrOffset, 0, end, duration) + start;\n },\n /**\n * @param {number} t current time\n * @param {number} b start value\n * @param {number} c end value\n * @param {number} d duration\n * @return {number}\n */\n bounceOut: (timeOrOffset, start, end, duration = 1) => {\n if ((timeOrOffset /= duration) < 1 / 2.75) {\n return end * (7.5625 * timeOrOffset * timeOrOffset) + start;\n }\n else if (timeOrOffset < 2 / 2.75) {\n return end * (7.5625 * (timeOrOffset -= 1.5 / 2.75) * timeOrOffset + 0.75) + start;\n }\n else if (timeOrOffset < 2.5 / 2.75) {\n return end * (7.5625 * (timeOrOffset -= 2.25 / 2.75) * timeOrOffset + 0.9375) + start;\n }\n return end * (7.5625 * (timeOrOffset -= 2.625 / 2.75) * timeOrOffset + 0.984375) + start;\n },\n /**\n *\n *\n * @param {number} time\n * @param {number} start\n * @param {number} end\n * @param {number} duration\n * @returns\n */\n bounceInOut: (timeOrOffset, start, end, duration = 1) => {\n if (timeOrOffset < duration / 2) {\n return Easings.bounceIn(timeOrOffset * 2, 0, end, duration) * 0.5 + start;\n }\n return Easings.bounceOut(timeOrOffset * 2 - duration, 0, end, duration) * 0.5 + end * 0.5 + start;\n },\n};\nexports.Easings = Easings;\n//# sourceMappingURL=Easings.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UncontrolledLoop = exports.Static = exports.Loop = exports.Compose = exports.Simple = exports.resolveSimpleAnimation = void 0;\nconst composeAnimations_1 = require(\"./composeAnimations\");\nconst createAnimation_1 = require(\"./createAnimation\");\nfunction resolveSimpleAnimation(simpleAnimation) {\n const animation = createAnimation_1.createAnimation(simpleAnimation);\n if (animation) {\n return (propArgumentsOrCurrentTime) => {\n var _a;\n const currentTime = typeof propArgumentsOrCurrentTime === 'number'\n ? propArgumentsOrCurrentTime\n : ((_a = propArgumentsOrCurrentTime.shape.scene) === null || _a === void 0 ? void 0 : _a.currentTime) || 0;\n animation.update(currentTime);\n return animation.value;\n };\n }\n}\nexports.resolveSimpleAnimation = resolveSimpleAnimation;\n// Alias\nexports.Simple = resolveSimpleAnimation;\n// Compose multiple animations\nconst Compose = (animations) => {\n const composed = composeAnimations_1.composeAnimations(animations);\n if (composed) {\n return (propArgumentsOrCurrentTime) => {\n var _a;\n const currentTime = typeof propArgumentsOrCurrentTime === 'number'\n ? propArgumentsOrCurrentTime\n : ((_a = propArgumentsOrCurrentTime.shape.scene) === null || _a === void 0 ? void 0 : _a.currentTime) || 0;\n return composed(currentTime);\n };\n }\n};\nexports.Compose = Compose;\nconst Loop = (loopAnimation) => {\n const simpleAnimation = loopAnimation;\n if (typeof simpleAnimation.interpolator === 'undefined') {\n simpleAnimation.interpolator = 'wave';\n }\n if (simpleAnimation.interpolator) {\n if (typeof simpleAnimation.interpolator === 'string') {\n if (simpleAnimation.interpolator !== 'wave') {\n simpleAnimation.direction = 'alternate';\n }\n }\n else if (typeof simpleAnimation.interpolator === 'object' && simpleAnimation.interpolator.type !== 'wave') {\n simpleAnimation.direction = 'alternate';\n }\n }\n simpleAnimation.loop = true;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.Loop = Loop;\nconst Static = (staticAnimation) => {\n const simpleAnimation = staticAnimation;\n simpleAnimation.direction = 'normal';\n simpleAnimation.loop = false;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.Static = Static;\nconst UncontrolledLoop = (uncontrolledLoopAnimation) => {\n const simpleAnimation = uncontrolledLoopAnimation;\n simpleAnimation.direction = 'normal';\n simpleAnimation.loop = true;\n return resolveSimpleAnimation(simpleAnimation);\n};\nexports.UncontrolledLoop = UncontrolledLoop;\n//# sourceMappingURL=Animation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.composeAnimations = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst createAnimation_1 = require(\"./createAnimation\");\nconst utilities_1 = require(\"./utilities\");\n/**\n *\n *\n * @export\n * @param {Array} simpleAnimations\n * @return {*} {(((currentTime: number) => string | number | Array | undefined) | undefined)}\n */\nfunction composeAnimations(simpleAnimations) {\n const animations = simpleAnimations.map(createAnimation_1.createAnimation).filter(a => typeof a !== 'undefined');\n const animationsLength = animations.length;\n if (animationsLength > 0) {\n return (currentTime) => {\n let value = undefined;\n for (let i = 0; i < animationsLength; i++) {\n const animation = animations[i];\n animation.update(currentTime);\n value = typeof value === 'undefined' ? animation.value : interpolate(value, animation.value);\n }\n return value;\n };\n }\n}\nexports.composeAnimations = composeAnimations;\nfunction interpolate(a, b, offset = 0.5) {\n const from = Array.isArray(a) ? a : [a];\n const to = Array.isArray(b) ? b : [b];\n const results = [];\n for (let i = 0, len = from.length; i < len; i++) {\n if (typeof from[i] !== typeof to[i]) {\n console.error('[@urpflanze/animation]: cannot interpolate');\n return undefined;\n }\n else {\n if (typeof from[i] !== 'string') {\n const a = from[i], b = to[i];\n results.push(a + offset * (b - a));\n }\n else {\n const a = from[i];\n const b = to[i];\n const parsed_a = color_1.parseColorAndConvert(a);\n const parsed_b = color_1.parseColorAndConvert(b);\n if (typeof parsed_a !== 'undefined' && typeof parsed_b !== 'undefined') {\n results.push(utilities_1.interpolateColorRGB(parsed_a, parsed_b, offset));\n }\n }\n }\n }\n return results.length === 1 ? results[0] : results;\n}\n//# sourceMappingURL=composeAnimations.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BrowserDrawerCanvas = void 0;\nconst DrawerCanvas_1 = require(\"../DrawerCanvas\");\nconst utils_1 = require(\"../utils\");\n/**\n *\n * @category DrawerCanvas\n * @class BrowserDrawerCanvas\n * @extends {DrawerCanvas}\n */\nclass BrowserDrawerCanvas extends DrawerCanvas_1.DrawerCanvas {\n constructor(scene, canvasOrContainer, drawerOptions, duration = 60000, framerate = 60) {\n super(scene, canvasOrContainer, drawerOptions, duration, framerate);\n this.dpi = 1;\n this.dpi = (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.dpi) || 1;\n this.draw_id = null;\n this.redraw_id = null;\n this.animation_id = null;\n this.draw = this.draw.bind(this);\n this.animate = this.animate.bind(this);\n this.startAnimation = this.startAnimation.bind(this);\n this.resize(this.drawerOptions.width, this.drawerOptions.height);\n }\n resize(width, height, sceneFit, dpi = this.dpi) {\n this.drawerOptions.width = width * dpi;\n this.drawerOptions.height = height * dpi;\n if (this.canvas) {\n this.canvas.width = width * dpi;\n this.canvas.height = height * dpi;\n if (utils_1.bBrowser && this.canvas instanceof HTMLCanvasElement) {\n this.canvas.style.width = width + 'px';\n this.canvas.style.height = height + 'px';\n }\n }\n if (typeof sceneFit !== 'undefined') {\n this.drawerOptions.sceneFit = sceneFit;\n }\n this.dispatch('drawer-canvas:resize');\n }\n /**\n * Internal tick animation\n */\n animate(timestamp) {\n if (this.timeline.bSequenceStarted()) {\n this.animation_id = requestAnimationFrame(this.animate);\n if (this.timeline.tick(timestamp))\n this.draw();\n }\n }\n /**\n * Start animation drawing\n */\n startAnimation() {\n this.stopAnimation();\n this.timeline.start();\n this.animation_id = requestAnimationFrame(this.animate);\n }\n /**\n * Stop animation drawing\n */\n stopAnimation() {\n this.timeline.stop();\n if (this.animation_id)\n cancelAnimationFrame(this.animation_id);\n }\n /**\n * Pause animation drawing\n */\n pauseAnimation() {\n this.timeline.pause();\n if (this.animation_id)\n cancelAnimationFrame(this.animation_id);\n }\n /**\n * Play animation drawing\n */\n playAnimation() {\n this.timeline.start();\n requestAnimationFrame(this.animate);\n }\n redraw() {\n if (!this.timeline.bSequenceStarted()) {\n this.draw_id && cancelAnimationFrame(this.draw_id);\n if (typeof this.drawerOptions.ghosts === undefined || this.drawerOptions.ghosts === 0)\n this.timeline.stop();\n this.draw_id = requestAnimationFrame(this.draw);\n }\n else if (typeof this.drawerOptions.ghosts === undefined || this.drawerOptions.ghosts === 0) {\n this.stopAnimation();\n this.redraw_id && cancelAnimationFrame(this.redraw_id);\n this.redraw_id = requestAnimationFrame(this.startAnimation);\n }\n }\n}\nexports.BrowserDrawerCanvas = BrowserDrawerCanvas;\n//# sourceMappingURL=BrowserDrawerCanvas.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DrawerCanvas = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nconst Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nconst math_1 = require(\"@urpflanze/core/dist/cjs/math\");\nconst Vec2_1 = require(\"@urpflanze/core/dist/cjs/math/Vec2\");\nconst canvas_1 = require(\"canvas\");\nconst Emitter_1 = require(\"./Emitter\");\nconst Timeline_1 = require(\"./Timeline\");\nconst utils_1 = require(\"./utils\");\n/**\n *\n * @category DrawerCanvas\n * @extends {Emitter}\n */\nclass DrawerCanvas extends Emitter_1.Emitter {\n constructor(scene, canvasOrContainer, drawerOptions, duration = 60000, framerate = 60) {\n var _a, _b, _c, _d, _e;\n super();\n this.drawerOptions = {\n width: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.width) || (scene === null || scene === void 0 ? void 0 : scene.width) || 400,\n height: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.height) || (scene === null || scene === void 0 ? void 0 : scene.height) || 400,\n clear: (_a = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.clear) !== null && _a !== void 0 ? _a : true,\n time: (_b = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.time) !== null && _b !== void 0 ? _b : 0,\n simmetricLines: (_c = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.simmetricLines) !== null && _c !== void 0 ? _c : 0,\n noBackground: (_d = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.noBackground) !== null && _d !== void 0 ? _d : false,\n ghosts: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghosts) || 0,\n ghostAlpha: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostAlpha) === false ? false : true,\n ghostSkipTime: (_e = drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostSkipTime) !== null && _e !== void 0 ? _e : 30,\n ghostSkipFunction: drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.ghostSkipFunction,\n sceneFit: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.sceneFit) || 'contain',\n backgroundImage: drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.backgroundImage,\n backgroundImageFit: (drawerOptions === null || drawerOptions === void 0 ? void 0 : drawerOptions.backgroundImageFit) || 'cover',\n };\n this.timeline = new Timeline_1.Timeline(duration, framerate);\n this.timeline.setTime(this.drawerOptions.time);\n this.draw_id = null;\n this.redraw_id = null;\n this.animation_id = null;\n if (scene) {\n this.setScene(scene);\n }\n if (!utils_1.bWorker || (utils_1.bWorker && canvasOrContainer instanceof OffscreenCanvas))\n this.setCanvas(canvasOrContainer);\n }\n /**\n * Return option value or default\n *\n * @param {K keyof IDrawerCanvasOptions} name\n * @param {IDrawerCanvasOptions[K]} defaultValue\n */\n getOption(name, defaultValue) {\n var _a;\n return (_a = this.drawerOptions[name]) !== null && _a !== void 0 ? _a : defaultValue;\n }\n /**\n * Create instance of canvas (HTMLCanvasElement in browser o Canvas in Node)\n */\n setCanvas(canvasOrContainer) {\n if (utils_1.bWorker) {\n if (canvasOrContainer instanceof OffscreenCanvas) {\n this.canvas = canvasOrContainer;\n }\n else {\n console.error('Cannot set cavas');\n }\n }\n else {\n if (utils_1.bBrowser) {\n const canvas = canvas_1.createCanvas(this.drawerOptions.width, this.drawerOptions.height);\n if (canvasOrContainer instanceof HTMLElement &&\n !(canvasOrContainer instanceof HTMLCanvasElement || canvasOrContainer instanceof OffscreenCanvas)) {\n this.canvas = canvas;\n while (canvasOrContainer.lastChild)\n canvasOrContainer.removeChild(canvasOrContainer.lastChild);\n canvasOrContainer.appendChild(canvas);\n }\n else {\n this.canvas = typeof canvasOrContainer === 'undefined' ? canvas : canvasOrContainer;\n }\n }\n else {\n this.canvas = canvas_1.createCanvas(this.drawerOptions.width, this.drawerOptions.height);\n }\n }\n if (this.canvas) {\n this.canvas.width = this.drawerOptions.width;\n this.canvas.height = this.drawerOptions.height;\n this.context = this.canvas.getContext('2d', {\n alpha: true,\n // desynchronized: true,\n });\n }\n }\n /**\n * Return instance of canvas\n *\n * @returns canvas\n */\n getCanvas() {\n return this.canvas;\n }\n setScene(scene) {\n this.scene = scene;\n }\n draw() {\n if (this.context === null || typeof this.scene === 'undefined')\n return 0;\n const start_time = Utilities_1.now();\n const timeline = this.timeline;\n const drawAtTime = timeline.getTime();\n const drawerOptions = {\n ...this.drawerOptions,\n ghostIndex: undefined,\n clear: this.drawerOptions.clear || timeline.getCurrentFrame() <= 1,\n time: drawAtTime,\n };\n const currentFrame = timeline.getFrameAtTime(drawAtTime);\n this.dispatch('drawer-canvas:before_draw', {\n currentFrame: currentFrame,\n currentTime: drawAtTime,\n });\n if (drawerOptions.simmetricLines > 0) {\n if (drawerOptions.clear) {\n DrawerCanvas.clear(this.context, drawerOptions.width, drawerOptions.height, drawerOptions.noBackground ? false : this.scene.background, drawerOptions.backgroundImage, drawerOptions.backgroundImageFit);\n }\n DrawerCanvas.drawSimmetricLines(this.context, drawerOptions.simmetricLines, drawerOptions.width, drawerOptions.height, this.scene.color);\n drawerOptions.clear = false;\n }\n if (drawerOptions.ghosts) {\n const ghostDrawerOptions = {\n ...drawerOptions,\n };\n const drawAtTime = timeline.getTime();\n const sequenceDuration = timeline.getDuration();\n const ghostRepetition = {\n offset: 0,\n index: 0,\n count: drawerOptions.ghosts,\n };\n for (let i = 1; i <= drawerOptions.ghosts; i++) {\n ghostRepetition.index = i;\n ghostRepetition.offset = ghostRepetition.index / ghostRepetition.count;\n const ghostTime = drawAtTime -\n (drawerOptions.ghostSkipFunction\n ? drawerOptions.ghostSkipFunction(ghostRepetition, drawAtTime)\n : i * drawerOptions.ghostSkipTime);\n ghostDrawerOptions.ghostIndex = i;\n ghostDrawerOptions.time = math_1.mod(ghostTime, sequenceDuration);\n ghostDrawerOptions.clear = drawerOptions.clear && ghostDrawerOptions.ghostIndex === 1;\n this.realDraw(ghostDrawerOptions);\n }\n drawerOptions.clear = false;\n }\n this.realDraw(drawerOptions);\n return Utilities_1.now() - start_time;\n }\n realDraw(options) {\n var _a;\n const width = this.drawerOptions.width;\n const height = this.drawerOptions.height;\n const context = this.context;\n const scene = this.scene;\n const time = (_a = options.time) !== null && _a !== void 0 ? _a : 0;\n const bGhost = typeof options.ghosts !== 'undefined' &&\n options.ghosts > 0 &&\n typeof options.ghostIndex !== 'undefined' &&\n options.ghostIndex > 0;\n const ghostMultiplier = bGhost ? 1 - options.ghostIndex / (options.ghosts + 0.5) : 0;\n const ghostAlpha = options.ghostAlpha === true;\n const sceneFit = utils_1.fit(scene.width, scene.height, width, height, this.drawerOptions.sceneFit);\n const translateX = sceneFit.x;\n const translateY = sceneFit.y;\n options.clear &&\n DrawerCanvas.clear(context, width, height, options.noBackground ? false : scene.background, options.backgroundImage, options.backgroundImageFit);\n let logFillColorWarn = false;\n let logStrokeColorWarn = false;\n scene.currentTime = time;\n const sceneChilds = scene.getChildren();\n for (let i = 0, len = sceneChilds.length; i < len; i++) {\n const sceneChild = sceneChilds[i];\n if (!sceneChild.data ||\n (!(sceneChild.data.visible === false) && !(bGhost && sceneChild.data.disableGhost === true))) {\n sceneChilds[i].generate(time, true);\n const childIndexedBuffer = sceneChilds[i].getIndexedBuffer() || [];\n const childBuffer = sceneChilds[i].getBuffer() || [];\n let childVertexIndex = 0;\n for (let currentBufferIndex = 0, len = childIndexedBuffer.length; currentBufferIndex < len; currentBufferIndex++) {\n const currentIndexing = childIndexedBuffer[currentBufferIndex];\n const shape = currentIndexing.shape;\n const propArguments = {\n canvasContext: context,\n ...currentIndexing,\n };\n const composite = DrawerCanvas.getStreamDrawerProp(shape, 'composite', propArguments, 'source-over');\n context.globalCompositeOperation = composite;\n context.beginPath();\n context.moveTo(childBuffer[childVertexIndex] * sceneFit.scale + translateX, childBuffer[childVertexIndex + 1] * sceneFit.scale + translateY);\n childVertexIndex += 2;\n for (let currentFrameLength = childVertexIndex + currentIndexing.frameLength - 2; childVertexIndex < currentFrameLength; childVertexIndex += 2)\n context.lineTo(childBuffer[childVertexIndex] * sceneFit.scale + translateX, childBuffer[childVertexIndex + 1] * sceneFit.scale + translateY);\n if (shape.isClosed())\n context.closePath();\n const alpha = DrawerCanvas.getStreamDrawerProp(shape, 'opacity', propArguments, 1);\n context.globalAlpha = alpha;\n const shadowColor = DrawerCanvas.getStreamDrawerProp(shape, 'shadowColor', propArguments);\n const shadowBlur = DrawerCanvas.getStreamDrawerProp(shape, 'shadowBlur', propArguments);\n const shadowOffsetX = DrawerCanvas.getStreamDrawerProp(shape, 'shadowOffsetX', propArguments);\n const shadowOffsetY = DrawerCanvas.getStreamDrawerProp(shape, 'shadowOffsetY', propArguments);\n context.shadowColor = shadowColor;\n context.shadowBlur = shadowBlur;\n shadowOffsetX && (context.shadowOffsetX = shadowOffsetX);\n shadowOffsetY && (context.shadowOffsetY = shadowOffsetY);\n let fill = DrawerCanvas.getStreamDrawerProp(shape, 'fill', propArguments);\n if (typeof fill !== 'undefined') {\n if (bGhost && ghostAlpha) {\n const color = DrawerCanvas.ghostifyColor(fill, ghostMultiplier);\n if (color) {\n fill = color;\n }\n else if (!logFillColorWarn) {\n console.warn(`[Urpflanze:DrawerCanvas] Unable ghost fill color '${fill}',\n\t\t\t\t\t\t\t\tplease enter a rgba or hsla color`);\n logFillColorWarn = true;\n }\n }\n context.fillStyle = fill;\n context.fill();\n }\n let stroke = DrawerCanvas.getStreamDrawerProp(shape, 'stroke', propArguments, typeof fill === 'undefined' ? scene.color : undefined);\n let lineWidth = DrawerCanvas.getStreamDrawerProp(shape, 'lineWidth', propArguments, 1);\n if (stroke) {\n if (bGhost && ghostAlpha) {\n const color = DrawerCanvas.ghostifyColor(stroke, ghostMultiplier);\n if (color) {\n stroke = color;\n }\n else if (!logStrokeColorWarn) {\n console.warn(`[Urpflanze:DrawerCanvas] Unable ghost stroke color '${stroke}',\n\t\t\t\t\t\t\t\tplease enter a rgba or hsla color`);\n logStrokeColorWarn = true;\n }\n lineWidth *= ghostMultiplier;\n }\n const lineJoin = DrawerCanvas.getStreamDrawerProp(shape, 'lineJoin', propArguments);\n const lineCap = DrawerCanvas.getStreamDrawerProp(shape, 'lineCap', propArguments);\n const lineDash = DrawerCanvas.getStreamDrawerProp(shape, 'lineDash', propArguments);\n const lineDashOffset = DrawerCanvas.getStreamDrawerProp(shape, 'lineDashOffset', propArguments);\n const miterLimit = DrawerCanvas.getStreamDrawerProp(shape, 'miterLimit', propArguments);\n context.setLineDash.call(context, lineDash || []);\n context.lineJoin = lineJoin;\n context.lineCap = lineCap;\n context.lineDashOffset = lineDashOffset;\n context.miterLimit = miterLimit;\n context.lineWidth = lineWidth * sceneFit.scale;\n context.strokeStyle = stroke;\n context.stroke();\n }\n }\n context.restore();\n }\n }\n }\n /**\n * Return a drawer value\n *\n * @static\n * @template T\n * @param {ShapePrimitive} shape\n * @param {keyof T} key\n * @param {IDrawerPropArguments} propArguments\n * @param {*} [defaultValue]\n * @returns {*}\n */\n static getStreamDrawerProp(shape, key, propArguments, defaultValue) {\n let attribute = shape.drawer[key];\n if (typeof attribute === 'function') {\n attribute = attribute(propArguments);\n }\n return attribute !== null && attribute !== void 0 ? attribute : defaultValue;\n }\n /**\n * Create color based on ghostMultiplier\n *\n * @static\n * @param {any} color\n * @param {number} ghostMultiplier\n * @return {*} {(string | undefined)}\n */\n static ghostifyColor(color, ghostMultiplier) {\n if (typeof color === 'string' || typeof color === 'number') {\n const parsed = color_1.parseColor(color);\n if (parsed) {\n const ghostAlpha = parsed.alpha * ghostMultiplier;\n return parsed.type === 'rgb'\n ? `rgba(${parsed.a},${parsed.b},${parsed.c},${ghostAlpha})`\n : `hsla(${parsed.a},${parsed.b}%,${parsed.c}%,${ghostAlpha})`;\n }\n }\n return color;\n }\n /**\n * Clear canvas, draw background or image (and fit)\n *\n * @param context\n * @param width\n * @param height\n * @param background\n * @param backgroundImage\n * @param backgroundImageFit\n */\n static clear(context, width, height, background, backgroundImage, backgroundImageFit) {\n if (typeof background === 'boolean' && background === false) {\n context.clearRect(0, 0, width, height);\n }\n else {\n context.globalCompositeOperation = 'source-over';\n context.fillStyle = background; // or true\n context.fillRect(0, 0, width, height);\n if (backgroundImage) {\n const sourceWidth = backgroundImage instanceof SVGImageElement ? backgroundImage.width.baseVal.value : backgroundImage.width;\n const sourceHeight = backgroundImage instanceof SVGImageElement ? backgroundImage.height.baseVal.value : backgroundImage.height;\n const fitRect = utils_1.fit(sourceWidth, sourceHeight, width, height, backgroundImageFit);\n context.drawImage(backgroundImage, fitRect.x, fitRect.y, fitRect.width, fitRect.height);\n }\n }\n }\n /**\n * Draw utility lines\n *\n * @param context\n * @param simmetricLines\n * @param width\n * @param height\n * @param color\n */\n static drawSimmetricLines(context, simmetricLines, width, height, color) {\n const offset = Math.PI / simmetricLines;\n const size = Math.max(width, height);\n const sizeMin = Math.min(width, height);\n const k = width < height ? 1 : 0;\n const centerX = [size / 2, size / 2];\n const centerY = [sizeMin / 2, sizeMin / 2];\n for (let i = 0; i < simmetricLines; i++) {\n const a = [-size, -size];\n const b = [size * 2, size * 2];\n const rotate = i * offset + Math.PI / 4;\n Vec2_1.default.rotateZ(a, i % 2 === k ? centerX : centerY, rotate);\n Vec2_1.default.rotateZ(b, i % 2 === k ? centerX : centerY, rotate);\n context.beginPath();\n context.strokeStyle = color;\n context.lineWidth = 1;\n context.moveTo(a[0], a[1]);\n context.lineTo(b[0], b[1]);\n context.stroke();\n }\n }\n}\nexports.DrawerCanvas = DrawerCanvas;\n// const sourceRatio = sourceWidth / sourceHeight\n// let x = 0,\n// \ty = 0,\n// \tbgWidth = width,\n// \tbgHeight = height\n// if (sourceRatio !== ratio) {\n// \tif (options.backgroundImageFit === 'contain') {\n// \t\tbgWidth = ratio > sourceRatio ? (sourceWidth * height) / sourceHeight : width\n// \t\tbgHeight = ratio > sourceRatio ? height : (sourceHeight * width) / sourceWidth\n// \t} else {\n// \t\tbgWidth = ratio < sourceRatio ? (sourceWidth * height) / sourceHeight : width\n// \t\tbgHeight = ratio < sourceRatio ? height : (sourceHeight * width) / sourceWidth\n// \t}\n// \tx = (width - bgWidth) / 2\n// \ty = (height - bgHeight) / 2\n//# sourceMappingURL=DrawerCanvas.js.map","/* globals document, ImageData */\n\nconst parseFont = require('./lib/parse-font')\n\nexports.parseFont = parseFont\n\nexports.createCanvas = function (width, height) {\n return Object.assign(document.createElement('canvas'), { width: width, height: height })\n}\n\nexports.createImageData = function (array, width, height) {\n // Browser implementation of ImageData looks at the number of arguments passed\n switch (arguments.length) {\n case 0: return new ImageData()\n case 1: return new ImageData(array)\n case 2: return new ImageData(array, width)\n default: return new ImageData(array, width, height)\n }\n}\n\nexports.loadImage = function (src, options) {\n return new Promise(function (resolve, reject) {\n const image = Object.assign(document.createElement('img'), options)\n\n function cleanup () {\n image.onload = null\n image.onerror = null\n }\n\n image.onload = function () { cleanup(); resolve(image) }\n image.onerror = function () { cleanup(); reject(new Error('Failed to load the image \"' + src + '\"')) }\n\n image.src = src\n })\n}\n","'use strict'\n\n/**\n * Font RegExp helpers.\n */\n\nconst weights = 'bold|bolder|lighter|[1-9]00'\n , styles = 'italic|oblique'\n , variants = 'small-caps'\n , stretches = 'ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded'\n , units = 'px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q'\n , string = '\\'([^\\']+)\\'|\"([^\"]+)\"|[\\\\w\\\\s-]+'\n\n// [ [ <‘font-style’> || || <‘font-weight’> || <‘font-stretch’> ]?\n// <‘font-size’> [ / <‘line-height’> ]? <‘font-family’> ]\n// https://drafts.csswg.org/css-fonts-3/#font-prop\nconst weightRe = new RegExp('(' + weights + ') +', 'i')\nconst styleRe = new RegExp('(' + styles + ') +', 'i')\nconst variantRe = new RegExp('(' + variants + ') +', 'i')\nconst stretchRe = new RegExp('(' + stretches + ') +', 'i')\nconst sizeFamilyRe = new RegExp(\n '([\\\\d\\\\.]+)(' + units + ') *'\n + '((?:' + string + ')( *, *(?:' + string + '))*)')\n\n/**\n * Cache font parsing.\n */\n\nconst cache = {}\n\nconst defaultHeight = 16 // pt, common browser default\n\n/**\n * Parse font `str`.\n *\n * @param {String} str\n * @return {Object} Parsed font. `size` is in device units. `unit` is the unit\n * appearing in the input string.\n * @api private\n */\n\nmodule.exports = function (str) {\n // Cached\n if (cache[str]) return cache[str]\n\n // Try for required properties first.\n const sizeFamily = sizeFamilyRe.exec(str)\n if (!sizeFamily) return // invalid\n\n // Default values and required properties\n const font = {\n weight: 'normal',\n style: 'normal',\n stretch: 'normal',\n variant: 'normal',\n size: parseFloat(sizeFamily[1]),\n unit: sizeFamily[2],\n family: sizeFamily[3].replace(/[\"']/g, '').replace(/ *, */g, ',')\n }\n\n // Optional, unordered properties.\n let weight, style, variant, stretch\n // Stop search at `sizeFamily.index`\n let substr = str.substring(0, sizeFamily.index)\n if ((weight = weightRe.exec(substr))) font.weight = weight[1]\n if ((style = styleRe.exec(substr))) font.style = style[1]\n if ((variant = variantRe.exec(substr))) font.variant = variant[1]\n if ((stretch = stretchRe.exec(substr))) font.stretch = stretch[1]\n\n // Convert to device units. (`font.unit` is the original unit)\n // TODO: ch, ex\n switch (font.unit) {\n case 'pt':\n font.size /= 0.75\n break\n case 'pc':\n font.size *= 16\n break\n case 'in':\n font.size *= 96\n break\n case 'cm':\n font.size *= 96.0 / 2.54\n break\n case 'mm':\n font.size *= 96.0 / 25.4\n break\n case '%':\n // TODO disabled because existing unit tests assume 100\n // font.size *= defaultHeight / 100 / 0.75\n break\n case 'em':\n case 'rem':\n font.size *= defaultHeight / 0.75\n break\n case 'q':\n font.size *= 96 / 25.4 / 4\n break\n }\n\n return (cache[str] = font)\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Emitter = void 0;\n/**\n * Class used for emit and dispatch events\n *\n * @category Emitter\n * @abstract\n * @class Emitter\n * @template EventTypes\n */\nclass Emitter {\n constructor() {\n this.callbacks = {};\n }\n /**\n * Attach callback at event\n *\n * @param {keyof EventTypes} e\n * @param {(value: EventTypes[keyof EventTypes]) => any} callback\n * @memberof Emitter\n */\n attach(e, callback) {\n if (!(e in this.callbacks)) {\n this.callbacks[e] = [];\n }\n this.callbacks[e].push(callback);\n }\n /**\n * Remove callbach listener at event\n *\n * @param {keyof EventTypes} e\n * @param {(value: EventTypes[keyof EventTypes]) => void} callback\n * @memberof Emitter\n */\n detach(e, callback) {\n if (e in this.callbacks) {\n const index = this.callbacks[e].indexOf(callback);\n if (index >= 0) {\n this.callbacks[e].splice(index, 1);\n }\n }\n }\n /**\n * Dispatch event\n *\n * @param {keyof EventTypes} e\n * @param {EventTypes[keyof EventTypes]} [params]\n * @memberof Emitter\n */\n dispatch(e, params) {\n if (e in this.callbacks && this.callbacks[e].length > 0) {\n for (let i = 0, len = this.callbacks[e].length; i < len; i++)\n if (this.callbacks[e][i](params) === false)\n break;\n }\n }\n}\nexports.Emitter = Emitter;\n//# sourceMappingURL=Emitter.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Timeline = void 0;\nconst Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nconst math_1 = require(\"@urpflanze/core/dist/cjs/math\");\nconst Emitter_1 = require(\"./Emitter\");\n/**\n * Is used for sequence time management.\n * It is necessary to set the duration and the number of frames per second (frame rate).\n *\n * @category Timeline\n * @class Timeline\n * @extends {Emitter}\n */\nclass Timeline extends Emitter_1.Emitter {\n constructor(duration = 60000, framerate = 30) {\n super();\n this.fps_samples_size = 30;\n this.fps_samples = [];\n this.fps_samples_index = 0;\n this.paused_time = 0;\n this.sequence = {\n duration,\n framerate,\n frames: Math.round((duration / 1000) * framerate),\n };\n this.tick_time = 1000 / this.sequence.framerate;\n this.fps = this.sequence.framerate;\n this.b_sequence_started = false;\n this.currentFrame = 0;\n this.currentTime = 0;\n this.last_tick = 0;\n this.start_time = 0;\n }\n //#region sequence meta\n /**\n * Return the sequence\n *\n * @returns {Sequence}\n */\n getSequence() {\n return { ...this.sequence };\n }\n /**\n * Set Sequence\n *\n * @param {number} duration in ms\n * @param {number} framerate\n * @param {number} atTime\n */\n setSequence(duration, framerate, atTime) {\n this.sequence.duration = duration;\n this.sequence.framerate = framerate;\n this.tick_time = 1000 / this.sequence.framerate;\n this.sequence.frames = Math.round((this.sequence.duration / 1000) * this.sequence.framerate);\n if (typeof atTime !== 'undefined') {\n this.setTime(atTime);\n }\n else {\n this.dispatch('timeline:update_sequence', this.getSequence());\n }\n }\n /**\n * Set duration of timeline\n *\n * @param {number} framerate\n */\n setDuration(duration) {\n this.setSequence(duration, this.sequence.framerate);\n }\n /**\n * Get timeline duration\n *\n * @returns {number}\n */\n getDuration() {\n return this.sequence.duration;\n }\n /**\n * Return framerate\n *\n * @returns {number}\n */\n getFramerate() {\n return this.sequence.framerate;\n }\n /**\n * Set a framerate\n *\n * @param {number} framerate\n */\n setFramerate(framerate) {\n this.setSequence(this.sequence.duration, framerate);\n }\n /**\n * Get number of frames based on duration and framerate\n *\n * @returns {number}\n */\n getFramesCount() {\n return this.sequence.frames;\n }\n //#endregion meta\n //#region change status\n bSequenceStarted() {\n return this.b_sequence_started;\n }\n /**\n * Start the sequence\n *\n */\n start() {\n if (!this.b_sequence_started) {\n this.b_sequence_started = true;\n this.start_time = this.paused_time;\n this.dispatch('timeline:change_status', Timeline.START);\n }\n }\n /**\n * Pause the sequence\n *\n */\n pause() {\n if (this.b_sequence_started) {\n this.paused_time = Utilities_1.now();\n this.b_sequence_started = false;\n this.dispatch('timeline:change_status', Timeline.PAUSE);\n }\n }\n /**\n * Stop the sequence and reset\n *\n */\n stop() {\n if (this.b_sequence_started) {\n this.b_sequence_started = false;\n this.currentTime = 0;\n this.currentFrame = 0;\n this.start_time = 0;\n this.paused_time = 0;\n this.dispatch('timeline:change_status', Timeline.STOP);\n }\n }\n /**\n * Animation tick\n *\n * @param {number} timestamp current timestamp\n * @returns {boolean}\n */\n tick(timestamp) {\n if (this.b_sequence_started) {\n if (!this.start_time) {\n this.start_time = timestamp;\n this.last_tick = -this.tick_time;\n }\n const currentTime = timestamp - this.start_time;\n const elapsed = currentTime - this.last_tick;\n if (elapsed >= this.tick_time) {\n this.calculateFPS(1 / (elapsed / 1000));\n this.last_tick = currentTime;\n this.currentTime = (currentTime - (elapsed % this.tick_time)) % this.sequence.duration;\n this.currentFrame = this.getFrameAtTime(this.currentTime);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n return true;\n }\n }\n return false;\n }\n /**\n * Calculate fps\n *\n * @private\n * @param {number} currentFPS\n */\n calculateFPS(currentFPS) {\n const samples = this.fps_samples.length;\n if (samples > 0) {\n let average = 0;\n for (let i = 0; i < samples; i++)\n average += this.fps_samples[i];\n this.fps = Math.round(average / samples);\n }\n this.fps_samples[this.fps_samples_index] = Math.round(currentFPS);\n this.fps_samples_index = (this.fps_samples_index + 1) % this.fps_samples_size;\n }\n //#endregion\n //#region Frame and Time\n /**\n * Return current animation frame\n *\n * @returns {number}\n */\n getCurrentFrame() {\n return this.currentFrame;\n }\n /**\n * get the time at specific frame number\n *\n * @param {number} frame\n * @returns {number}\n */\n getFrameTime(frame) {\n frame = math_1.mod(frame, this.sequence.frames);\n return (frame * this.tick_time) % this.sequence.duration;\n }\n /**\n * Return frame number at time\n *\n * @param {number} time\n * @returns {number}\n */\n getFrameAtTime(time) {\n return Math.round((time % this.sequence.duration) / this.tick_time);\n }\n /**\n * set current frame\n *\n * @param {number} frame\n */\n setFrame(frame) {\n this.currentFrame = math_1.mod(frame, this.sequence.frames);\n this.currentTime = this.getFrameTime(this.currentFrame);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n }\n /**\n * Return tick time (based on framerate)\n *\n * @returns {number}\n */\n getTickTime() {\n return this.tick_time;\n }\n /**\n * Return the current time\n *\n * @returns {number}\n */\n getTime() {\n return this.currentTime;\n }\n /**\n * Set animation at time\n *\n * @param {number} time\n */\n setTime(time) {\n time = math_1.mod(time, this.sequence.duration);\n this.currentTime = time;\n this.currentFrame = this.getFrameAtTime(time);\n this.dispatch('timeline:progress', {\n currentFrame: this.currentFrame,\n currentTime: this.currentTime,\n fps: this.fps,\n });\n }\n}\nexports.Timeline = Timeline;\n/**\n * Animation status started\n * @internal\n */\nTimeline.START = 'start';\n/**\n * Animation status paused\n * @internal\n */\nTimeline.PAUSE = 'pause';\n/**\n * Animation status stop\n * @internal\n */\nTimeline.STOP = 'stop';\n//# sourceMappingURL=Timeline.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fit = exports.bWorker = exports.bBrowser = exports.bNode = void 0;\nexports.bNode = typeof process !== 'undefined' &&\n typeof process.versions !== 'undefined' &&\n typeof process.versions.node !== 'undefined';\nexports.bBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';\nexports.bWorker = typeof self === 'object' && ['ServiceWorkerGlobalScope', 'DedicatedWorkerGlobalScope'].includes(self.constructor.name);\n/**\n * Utiltites\n *\n * @category Utilities\n * @export\n * @param {number} sourceWidth\n * @param {number} sourceHeight\n * @param {number} destWidth\n * @param {number} destHeight\n * @param {('cover' | 'contain' | 'none')} [fit='none']\n * @return {*} {{ x: number; y: number; width: number; height: number; scale: number }}\n */\nfunction fit(sourceWidth, sourceHeight, destWidth, destHeight, fit = 'none') {\n let x = 0, y = 0, scale = 1, finalWidth = sourceWidth, finalHeight = sourceHeight;\n const ratio = destWidth / destHeight;\n const sourceRatio = sourceWidth / sourceHeight;\n if (fit === 'contain') {\n finalWidth = ratio > sourceRatio ? (sourceWidth * destHeight) / sourceHeight : destWidth;\n finalHeight = ratio > sourceRatio ? destHeight : (sourceHeight * destWidth) / sourceWidth;\n scale = Math.max(finalWidth, finalHeight) / Math.max(sourceWidth, sourceHeight);\n }\n else if (fit === 'cover') {\n finalWidth = ratio < sourceRatio ? (sourceWidth * destHeight) / sourceHeight : destWidth;\n finalHeight = ratio < sourceRatio ? destHeight : (sourceHeight * destWidth) / sourceWidth;\n // scale = Math.min(sourceWidth, sourceHeight) / Math.min(finalWidth, finalHeight)\n scale = Math.max(finalWidth, finalHeight) / Math.max(sourceWidth, sourceHeight);\n }\n else {\n // finalWidth = sourceWidth\n // finalHeight = sourceHeight\n }\n x = (destWidth - finalWidth) / 2;\n y = (destHeight - finalHeight) / 2;\n return {\n x,\n y,\n width: finalWidth,\n height: finalHeight,\n scale,\n };\n}\nexports.fit = fit;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./Timeline\"), exports);\n__exportStar(require(\"./DrawerCanvas\"), exports);\n__exportStar(require(\"./browser/BrowserDrawerCanvas\"), exports);\n__exportStar(require(\"./Renderer\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Renderer = void 0;\nconst ffmpeg_1 = require(\"@ffmpeg/ffmpeg\");\nconst Utilities_1 = require(\"@urpflanze/core/dist/cjs/Utilities\");\nconst JSZip = require(\"jszip\");\nconst browser_1 = require(\"./browser\");\nconst Emitter_1 = require(\"./Emitter\");\nconst utils_1 = require(\"./utils\");\n/**\n * The Renderer is a class for exporting the scene\n *\n * @category Renderer\n * @class Renderer\n * @extends {Emitter}\n */\nclass Renderer extends Emitter_1.Emitter {\n constructor(drawer, ffmpegCorePath) {\n super();\n this.drawer = drawer;\n this.ffmpegCorePath =\n typeof ffmpegCorePath === 'undefined' && drawer instanceof browser_1.default\n ? 'https://unpkg.com/@ffmpeg/core@0.10.0/dist/ffmpeg-core.js'\n : ffmpegCorePath;\n }\n /**\n * Render any frame and create array of zip\n *\n * @param imagesType\n * @param quality\n * @param framesForChunk\n * @returns\n */\n async zip(imagesType = 'image/png', quality = 1, framesForChunk = 600) {\n const startTime = Utilities_1.now();\n const zip = new JSZip();\n const totalFrames = this.drawer.timeline.getFramesCount();\n const chunks = Math.ceil(totalFrames / framesForChunk);\n this.dispatch('renderer:zip_start', { chunks, totalFrames, framesForChunk });\n const extension = imagesType === 'image/jpeg' ? '.jpg' : '.png';\n const zipParts = [];\n let totalRenderTime = 0;\n for (let chunk = 0, rendered = 1; chunk < chunks; chunk++) {\n for (let frameIndex = 0; frameIndex < framesForChunk; frameIndex++, rendered++) {\n const frame = frameIndex + chunk * framesForChunk;\n if (frame < totalFrames) {\n const renderStartTime = Utilities_1.now();\n const frameName = frame.toString().padStart(5, '0') + extension;\n const blob = await this.frame(frame, imagesType, quality);\n const buffer = (await (utils_1.bNode ? blob : blob.arrayBuffer()));\n zip.file(frameName, new Uint8Array(buffer, 0, buffer.byteLength));\n const currentTime = Utilities_1.now();\n const renderTime = currentTime - renderStartTime;\n totalRenderTime += renderTime;\n this.dispatch('renderer:zip_progress', {\n chunk: chunk + 1,\n frame: frame + 1,\n totalFrames,\n framesForChunk,\n totalChunks: chunks,\n renderTime,\n remainingTime: (totalFrames - rendered) * (totalRenderTime / rendered),\n elapsedTime: currentTime - startTime,\n });\n }\n }\n this.dispatch('renderer:zip_preparing');\n zipParts.push(await zip.generateAsync({ type: 'uint8array' }));\n }\n return zipParts;\n }\n /**\n * Render animation\n *\n * @param type render type\n * @param quality\n * @param ffmpegLogger\n * @param ffmpegProgress\n * @returns\n */\n async render(type = 'video/mp4', quality = 1, ffmpegLogger, ffmpegProgress) {\n const startTime = Utilities_1.now();\n const totalFrames = this.drawer.timeline.getFramesCount();\n const framerate = this.drawer.timeline.getFramerate();\n const duration = this.drawer.timeline.getDuration();\n this.dispatch('renderer:video_init', { totalFrames, framerate, duration, type });\n if (!this.ffmpeg) {\n const ffmpegOptions = {\n log: false,\n };\n if (this.ffmpegCorePath)\n ffmpegOptions.corePath = this.ffmpegCorePath;\n if (ffmpegLogger)\n ffmpegOptions.logger = ffmpegLogger;\n if (ffmpegProgress)\n ffmpegOptions.progress = ffmpegProgress;\n this.ffmpeg = ffmpeg_1.createFFmpeg(ffmpegOptions);\n await this.ffmpeg.load();\n }\n let totalRenderTime = 0;\n this.dispatch('renderer:video_start', { totalFrames, framerate, duration, type });\n for (let frame = 0; frame < totalFrames; frame++) {\n const renderStartTime = Utilities_1.now();\n const blob = await this.frame(frame, 'image/jpeg', quality);\n const buffer = (await (utils_1.bNode ? blob : blob.arrayBuffer()));\n const frameName = frame.toString().padStart(5, '0') + '.jpg';\n this.ffmpeg.FS('writeFile', frameName, new Uint8Array(buffer, 0, buffer.byteLength));\n const currentTime = Utilities_1.now();\n const renderTime = currentTime - renderStartTime;\n totalRenderTime += renderTime;\n this.dispatch('renderer:video_progress', {\n totalFrames,\n frame: frame + 1,\n renderTime,\n duration,\n remainingTime: (totalFrames - frame) * (totalRenderTime / (frame + 1)),\n elapsedTime: currentTime - startTime,\n });\n }\n const args = ['-r', framerate.toString(), '-i', '%05d.jpg'];\n let outExt = 'mp4';\n switch (type) {\n case 'video/webm':\n args.push('-c:v', 'libvpx');\n args.push('-row-mt', '1');\n args.push('-pix_fmt', 'yuv420p');\n outExt = 'webm';\n break;\n case 'video/mp4':\n args.push('-c:v', 'libx264');\n args.push('-pix_fmt', 'yuv420p');\n outExt = 'mp4';\n break;\n case 'gif':\n args.push('-loop', '0');\n outExt = 'gif';\n break;\n }\n const outName = 'out.' + outExt;\n args.push(outName);\n this.dispatch('renderer:video_preparing');\n await this.ffmpeg.run(...args);\n const result = await this.ffmpeg.FS('readFile', outName);\n return result;\n }\n /**\n * Render frame `frameNumber` to Blob or Buffer\n *\n * @param frameNumber frame to render\n * @param mime image type\n * @param options quality or options\n * @returns Promise of Blob for browser or Buffer for Node\n */\n frame(frameNumber, mime = 'image/png', options = 1) {\n if (!this.drawer.getOption('clear', true)) {\n for (let i = 0; i <= frameNumber; i++) {\n this.drawer.timeline.setFrame(i);\n this.drawer.draw();\n }\n }\n else {\n this.drawer.timeline.setFrame(frameNumber);\n this.drawer.draw();\n }\n return this.blobOrBuffer(mime, options);\n }\n /**\n * Render frame at time to Blob or Buffer\n *\n * @param time animation time\n * @param mime image type\n * @param options quality or options\n * @returns Promise of Blob for browser or Buffer for Node\n */\n frameAtTime(time, mime = 'image/png', options = 1) {\n return this.frame(this.drawer.timeline.getFrameAtTime(time), mime, options);\n }\n /**\n * Render frame number to DataUrl\n *\n * @param frameNumber frame to render\n * @param mime image type\n * @param options quality or options\n * @returns string image\n */\n frameToDataUrl(frameNumber, mime = 'image/png', options = 1) {\n if (!this.drawer.getOption('clear', true)) {\n for (let i = 0; i <= frameNumber; i++) {\n this.drawer.timeline.setFrame(i);\n this.drawer.draw();\n }\n }\n else {\n this.drawer.timeline.setFrame(frameNumber);\n this.drawer.draw();\n }\n return this.toDataUrl(mime, options);\n }\n /**\n * Render a frame at `time` to DataUrl\n *\n * @param time of animation\n * @param mime image type\n * @param options quality or options\n * @returns string image\n */\n frameAtTimeToDataUrl(time, mime = 'image/png', options = 1) {\n return this.frameToDataUrl(this.drawer.timeline.getFrameAtTime(time), mime, options);\n }\n /**\n * Canvas to DataURL\n *\n * @param mime\n * @param optionsOrQuality\n * @returns\n */\n toDataUrl(mime, optionsOrQuality = 1) {\n const canvas = this.drawer.getCanvas();\n if (canvas) {\n if (utils_1.bBrowser && canvas instanceof OffscreenCanvas) {\n console.warn('Cannot convert toDataURL in OffscreenCanvas');\n }\n else {\n return canvas.toDataURL(mime, optionsOrQuality);\n }\n }\n return null;\n }\n /**\n * Canvas to BoB\n *\n * @param mime\n * @param optionsOrQuality\n * @returns\n */\n blobOrBuffer(mime, optionsOrQuality = 1) {\n const canvas = this.drawer.getCanvas();\n if (canvas === null)\n throw new Error('Canvas not setted into Drawer');\n if (utils_1.bNode) {\n // TODO default node quality for jpeg and png\n switch (mime) {\n case 'image/png': {\n const pngConf = typeof optionsOrQuality === 'number'\n ? {\n compressionLevel: (9 - Utilities_1.clamp(0, 1, optionsOrQuality) * 9),\n }\n : optionsOrQuality;\n return Promise.resolve(canvas.toBuffer(mime, pngConf));\n }\n case 'image/jpeg': {\n const jpegConf = typeof optionsOrQuality === 'number'\n ? {\n quality: optionsOrQuality,\n }\n : optionsOrQuality;\n return Promise.resolve(canvas.toBuffer(mime, jpegConf));\n }\n }\n }\n if (canvas instanceof OffscreenCanvas) {\n return canvas.convertToBlob({ type: mime, quality: typeof optionsOrQuality === 'number' ? optionsOrQuality : 1 });\n }\n return new Promise(resolve => {\n ;\n canvas.toBlob(blob => {\n if (blob)\n resolve(blob);\n else\n throw new Error('Blob error');\n }, mime, typeof optionsOrQuality === 'number' ? optionsOrQuality : 1);\n });\n }\n}\nexports.Renderer = Renderer;\n//# sourceMappingURL=Renderer.js.map","require('regenerator-runtime/runtime');\nconst createFFmpeg = require('./createFFmpeg');\nconst { fetchFile } = require('./node');\n\nmodule.exports = {\n /*\n * Create ffmpeg instance.\n * Each ffmpeg instance owns an isolated MEMFS and works\n * independently.\n *\n * For example:\n *\n * ```\n * const ffmpeg = createFFmpeg({\n * log: true,\n * logger: () => {},\n * progress: () => {},\n * corePath: '',\n * })\n * ```\n *\n * For the usage of these four arguments, check config.js\n *\n */\n createFFmpeg,\n /*\n * Helper function for fetching files from various resource.\n * Sometimes the video/audio file you want to process may located\n * in a remote URL and somewhere in your local file system.\n *\n * This helper function helps you to fetch to file and return an\n * Uint8Array variable for ffmpeg.wasm to consume.\n *\n */\n fetchFile,\n};\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","const { defaultArgs, baseOptions } = require('./config');\nconst { setLogging, setCustomLogger, log } = require('./utils/log');\nconst parseProgress = require('./utils/parseProgress');\nconst parseArgs = require('./utils/parseArgs');\nconst { defaultOptions, getCreateFFmpegCore } = require('./node');\nconst { version } = require('../package.json');\n\nconst NO_LOAD = Error('ffmpeg.wasm is not ready, make sure you have completed load().');\n\nmodule.exports = (_options = {}) => {\n const {\n log: logging,\n logger,\n progress: optProgress,\n ...options\n } = {\n ...baseOptions,\n ...defaultOptions,\n ..._options,\n };\n let Core = null;\n let ffmpeg = null;\n let runResolve = null;\n let running = false;\n let progress = optProgress;\n const detectCompletion = (message) => {\n if (message === 'FFMPEG_END' && runResolve !== null) {\n runResolve();\n runResolve = null;\n running = false;\n }\n };\n const parseMessage = ({ type, message }) => {\n log(type, message);\n parseProgress(message, progress);\n detectCompletion(message);\n };\n\n /*\n * Load ffmpeg.wasm-core script.\n * In browser environment, the ffmpeg.wasm-core script is fetch from\n * CDN and can be assign to a local path by assigning `corePath`.\n * In node environment, we use dynamic require and the default `corePath`\n * is `$ffmpeg/core`.\n *\n * Typically the load() func might take few seconds to minutes to complete,\n * better to do it as early as possible.\n *\n */\n const load = async () => {\n log('info', 'load ffmpeg-core');\n if (Core === null) {\n log('info', 'loading ffmpeg-core');\n /*\n * In node environment, all paths are undefined as there\n * is no need to set them.\n */\n const {\n createFFmpegCore,\n corePath,\n workerPath,\n wasmPath,\n } = await getCreateFFmpegCore(options);\n Core = await createFFmpegCore({\n /*\n * Assign mainScriptUrlOrBlob fixes chrome extension web worker issue\n * as there is no document.currentScript in the context of content_scripts\n */\n mainScriptUrlOrBlob: corePath,\n printErr: (message) => parseMessage({ type: 'fferr', message }),\n print: (message) => parseMessage({ type: 'ffout', message }),\n /*\n * locateFile overrides paths of files that is loaded by main script (ffmpeg-core.js).\n * It is critical for browser environment and we override both wasm and worker paths\n * as we are using blob URL instead of original URL to avoid cross origin issues.\n */\n locateFile: (path, prefix) => {\n if (typeof window !== 'undefined') {\n if (typeof wasmPath !== 'undefined'\n && path.endsWith('ffmpeg-core.wasm')) {\n return wasmPath;\n }\n if (typeof workerPath !== 'undefined'\n && path.endsWith('ffmpeg-core.worker.js')) {\n return workerPath;\n }\n }\n return prefix + path;\n },\n });\n ffmpeg = Core.cwrap('proxy_main', 'number', ['number', 'number']);\n log('info', 'ffmpeg-core loaded');\n } else {\n throw Error('ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.');\n }\n };\n\n /*\n * Determine whether the Core is loaded.\n */\n const isLoaded = () => Core !== null;\n\n /*\n * Run ffmpeg command.\n * This is the major function in ffmpeg.wasm, you can just imagine it\n * as ffmpeg native cli and what you need to pass is the same.\n *\n * For example, you can convert native command below:\n *\n * ```\n * $ ffmpeg -i video.avi -c:v libx264 video.mp4\n * ```\n *\n * To\n *\n * ```\n * await ffmpeg.run('-i', 'video.avi', '-c:v', 'libx264', 'video.mp4');\n * ```\n *\n */\n const run = (..._args) => {\n log('info', `run ffmpeg command: ${_args.join(' ')}`);\n if (Core === null) {\n throw NO_LOAD;\n } else if (running) {\n throw Error('ffmpeg.wasm can only run one command at a time');\n } else {\n running = true;\n return new Promise((resolve) => {\n const args = [...defaultArgs, ..._args].filter((s) => s.length !== 0);\n runResolve = resolve;\n ffmpeg(...parseArgs(Core, args));\n });\n }\n };\n\n /*\n * Run FS operations.\n * For input/output file of ffmpeg.wasm, it is required to save them to MEMFS\n * first so that ffmpeg.wasm is able to consume them. Here we rely on the FS\n * methods provided by Emscripten.\n *\n * Common methods to use are:\n * ffmpeg.FS('writeFile', 'video.avi', new Uint8Array(...)): writeFile writes\n * data to MEMFS. You need to use Uint8Array for binary data.\n * ffmpeg.FS('readFile', 'video.mp4'): readFile from MEMFS.\n * ffmpeg.FS('unlink', 'video.map'): delete file from MEMFS.\n *\n * For more info, check https://emscripten.org/docs/api_reference/Filesystem-API.html\n *\n */\n const FS = (method, ...args) => {\n log('info', `run FS.${method} ${args.map((arg) => (typeof arg === 'string' ? arg : `<${arg.length} bytes binary file>`)).join(' ')}`);\n if (Core === null) {\n throw NO_LOAD;\n } else {\n let ret = null;\n try {\n ret = Core.FS[method](...args);\n } catch (e) {\n if (method === 'readdir') {\n throw Error(`ffmpeg.FS('readdir', '${args[0]}') error. Check if the path exists, ex: ffmpeg.FS('readdir', '/')`);\n } else if (method === 'readFile') {\n throw Error(`ffmpeg.FS('readFile', '${args[0]}') error. Check if the path exists`);\n } else {\n throw Error('Oops, something went wrong in FS operation.');\n }\n }\n return ret;\n }\n };\n\n /**\n * forcibly terminate the ffmpeg program.\n */\n const exit = () => {\n if (Core === null) {\n throw NO_LOAD;\n } else {\n running = false;\n Core.exit(1);\n Core = null;\n ffmpeg = null;\n runResolve = null;\n }\n };\n\n const setProgress = (_progress) => {\n progress = _progress;\n };\n\n const setLogger = (_logger) => {\n setCustomLogger(_logger);\n };\n\n setLogging(logging);\n setCustomLogger(logger);\n\n log('info', `use ffmpeg.wasm v${version}`);\n\n return {\n setProgress,\n setLogger,\n setLogging,\n load,\n isLoaded,\n run,\n exit,\n FS,\n };\n};\n","module.exports = {\n defaultArgs: [\n /* args[0] is always the binary path */\n './ffmpeg',\n /* Disable interaction mode */\n '-nostdin',\n /* Force to override output file */\n '-y',\n ],\n baseOptions: {\n /* Flag to turn on/off log messages in console */\n log: false,\n /*\n * Custom logger to get ffmpeg.wasm output messages.\n * a sample logger looks like this:\n *\n * ```\n * logger = ({ type, message }) => {\n * console.log(type, message);\n * }\n * ```\n *\n * type can be one of following:\n *\n * info: internal workflow debug messages\n * fferr: ffmpeg native stderr output\n * ffout: ffmpeg native stdout output\n */\n logger: () => {},\n /*\n * Progress handler to get current progress of ffmpeg command.\n * a sample progress handler looks like this:\n *\n * ```\n * progress = ({ ratio }) => {\n * console.log(ratio);\n * }\n * ```\n *\n * ratio is a float number between 0 to 1.\n */\n progress: () => {},\n /*\n * Path to find/download ffmpeg.wasm-core,\n * this value should be overwriten by `defaultOptions` in\n * each environment.\n */\n corePath: '',\n },\n};\n","let logging = false;\nlet customLogger = () => {};\n\nconst setLogging = (_logging) => {\n logging = _logging;\n};\n\nconst setCustomLogger = (logger) => {\n customLogger = logger;\n};\n\nconst log = (type, message) => {\n customLogger({ type, message });\n if (logging) {\n console.log(`[${type}] ${message}`);\n }\n};\n\nmodule.exports = {\n logging,\n setLogging,\n setCustomLogger,\n log,\n};\n","let duration = 0;\nlet ratio = 0;\n\nconst ts2sec = (ts) => {\n const [h, m, s] = ts.split(':');\n return (parseFloat(h) * 60 * 60) + (parseFloat(m) * 60) + parseFloat(s);\n};\n\nmodule.exports = (message, progress) => {\n if (typeof message === 'string') {\n if (message.startsWith(' Duration')) {\n const ts = message.split(', ')[0].split(': ')[1];\n const d = ts2sec(ts);\n progress({ duration: d, ratio });\n if (duration === 0 || duration > d) {\n duration = d;\n }\n } else if (message.startsWith('frame') || message.startsWith('size')) {\n const ts = message.split('time=')[1].split(' ')[0];\n const t = ts2sec(ts);\n ratio = t / duration;\n progress({ ratio, time: t });\n } else if (message.startsWith('video:')) {\n progress({ ratio: 1 });\n duration = 0;\n }\n }\n};\n","module.exports = (Core, args) => {\n const argsPtr = Core._malloc(args.length * Uint32Array.BYTES_PER_ELEMENT);\n args.forEach((s, idx) => {\n const buf = Core._malloc(s.length + 1);\n Core.writeAsciiToMemory(s, buf);\n Core.setValue(argsPtr + (Uint32Array.BYTES_PER_ELEMENT * idx), buf, 'i32');\n });\n return [args.length, argsPtr];\n};\n","const defaultOptions = require('./defaultOptions');\nconst getCreateFFmpegCore = require('./getCreateFFmpegCore');\nconst fetchFile = require('./fetchFile');\n\nmodule.exports = {\n defaultOptions,\n getCreateFFmpegCore,\n fetchFile,\n};\n","const resolveURL = require('resolve-url');\nconst { devDependencies } = require('../../package.json');\n\n/*\n * Default options for browser environment\n */\nmodule.exports = {\n corePath: process.env.NODE_ENV === 'development'\n ? resolveURL('/node_modules/@ffmpeg/core/dist/ffmpeg-core.js')\n : `https://unpkg.com/@ffmpeg/core@${devDependencies['@ffmpeg/core'].substring(1)}/dist/ffmpeg-core.js`,\n};\n","// Copyright 2014 Simon Lydell\r\n// X11 (“MIT”) Licensed. (See LICENSE.)\r\n\r\nvoid (function(root, factory) {\r\n if (typeof define === \"function\" && define.amd) {\r\n define(factory)\r\n } else if (typeof exports === \"object\") {\r\n module.exports = factory()\r\n } else {\r\n root.resolveUrl = factory()\r\n }\r\n}(this, function() {\r\n\r\n function resolveUrl(/* ...urls */) {\r\n var numUrls = arguments.length\r\n\r\n if (numUrls === 0) {\r\n throw new Error(\"resolveUrl requires at least one argument; got none.\")\r\n }\r\n\r\n var base = document.createElement(\"base\")\r\n base.href = arguments[0]\r\n\r\n if (numUrls === 1) {\r\n return base.href\r\n }\r\n\r\n var head = document.getElementsByTagName(\"head\")[0]\r\n head.insertBefore(base, head.firstChild)\r\n\r\n var a = document.createElement(\"a\")\r\n var resolved\r\n\r\n for (var index = 1; index < numUrls; index++) {\r\n a.href = arguments[index]\r\n resolved = a.href\r\n base.href = resolved\r\n }\r\n\r\n head.removeChild(base)\r\n\r\n return resolved\r\n }\r\n\r\n return resolveUrl\r\n\r\n}));\r\n","/* eslint-disable no-undef */\nconst resolveURL = require('resolve-url');\nconst { log } = require('../utils/log');\n\n/*\n * Fetch data from remote URL and convert to blob URL\n * to avoid CORS issue\n */\nconst toBlobURL = async (url, mimeType) => {\n log('info', `fetch ${url}`);\n const buf = await (await fetch(url)).arrayBuffer();\n log('info', `${url} file size = ${buf.byteLength} bytes`);\n const blob = new Blob([buf], { type: mimeType });\n const blobURL = URL.createObjectURL(blob);\n log('info', `${url} blob URL = ${blobURL}`);\n return blobURL;\n};\n\nmodule.exports = async ({ corePath: _corePath }) => {\n if (typeof _corePath !== 'string') {\n throw Error('corePath should be a string!');\n }\n const coreRemotePath = resolveURL(_corePath);\n const corePath = await toBlobURL(\n coreRemotePath,\n 'application/javascript',\n );\n const wasmPath = await toBlobURL(\n coreRemotePath.replace('ffmpeg-core.js', 'ffmpeg-core.wasm'),\n 'application/wasm',\n );\n const workerPath = await toBlobURL(\n coreRemotePath.replace('ffmpeg-core.js', 'ffmpeg-core.worker.js'),\n 'application/javascript',\n );\n if (typeof createFFmpegCore === 'undefined') {\n return new Promise((resolve) => {\n const script = document.createElement('script');\n const eventHandler = () => {\n script.removeEventListener('load', eventHandler);\n log('info', 'ffmpeg-core.js script loaded');\n resolve({\n createFFmpegCore,\n corePath,\n wasmPath,\n workerPath,\n });\n };\n script.src = corePath;\n script.type = 'text/javascript';\n script.addEventListener('load', eventHandler);\n document.getElementsByTagName('head')[0].appendChild(script);\n });\n }\n log('info', 'ffmpeg-core.js script is loaded already');\n return Promise.resolve({\n createFFmpegCore,\n corePath,\n wasmPath,\n workerPath,\n });\n};\n","const resolveURL = require('resolve-url');\n\nconst readFromBlobOrFile = (blob) => (\n new Promise((resolve, reject) => {\n const fileReader = new FileReader();\n fileReader.onload = () => {\n resolve(fileReader.result);\n };\n fileReader.onerror = ({ target: { error: { code } } }) => {\n reject(Error(`File could not be read! Code=${code}`));\n };\n fileReader.readAsArrayBuffer(blob);\n })\n);\n\nmodule.exports = async (_data) => {\n let data = _data;\n if (typeof _data === 'undefined') {\n return new Uint8Array();\n }\n\n if (typeof _data === 'string') {\n /* From base64 format */\n if (/data:_data\\/([a-zA-Z]*);base64,([^\"]*)/.test(_data)) {\n data = atob(_data.split(',')[1])\n .split('')\n .map((c) => c.charCodeAt(0));\n /* From remote server/URL */\n } else {\n const res = await fetch(resolveURL(_data));\n data = await res.arrayBuffer();\n }\n /* From Blob or File */\n } else if (_data instanceof File || _data instanceof Blob) {\n data = await readFromBlobOrFile(_data);\n }\n\n return new Uint8Array(data);\n};\n","/*!\n\nJSZip v3.7.0 - A JavaScript class for generating and reading zip files\n\n\n(c) 2009-2016 Stuart Knightley \nDual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.\n\nJSZip uses the library pako released under the MIT license :\nhttps://github.com/nodeca/pako/blob/master/LICENSE\n*/\n\n!function(e){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=e();else if(\"function\"==typeof define&&define.amd)define([],e);else{(\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:this).JSZip=e()}}(function(){return function s(o,a,f){function u(r,e){if(!a[r]){if(!o[r]){var t=\"function\"==typeof require&&require;if(!e&&t)return t(r,!0);if(d)return d(r,!0);var n=new Error(\"Cannot find module '\"+r+\"'\");throw n.code=\"MODULE_NOT_FOUND\",n}var i=a[r]={exports:{}};o[r][0].call(i.exports,function(e){var t=o[r][1][e];return u(t||e)},i,i.exports,s,o,a,f)}return a[r].exports}for(var d=\"function\"==typeof require&&require,e=0;e>2,s=(3&t)<<4|r>>4,o=1>6:64,a=2>4,r=(15&i)<<4|(s=p.indexOf(e.charAt(a++)))>>2,n=(3&s)<<6|(o=p.indexOf(e.charAt(a++))),u[f++]=t,64!==s&&(u[f++]=r),64!==o&&(u[f++]=n);return u}},{\"./support\":30,\"./utils\":32}],2:[function(e,t,r){\"use strict\";var n=e(\"./external\"),i=e(\"./stream/DataWorker\"),s=e(\"./stream/Crc32Probe\"),o=e(\"./stream/DataLengthProbe\");function a(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}a.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o(\"data_length\")),t=this;return e.on(\"end\",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error(\"Bug : uncompressed data size mismatch\")}),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo(\"compressedSize\",this.compressedSize).withStreamInfo(\"uncompressedSize\",this.uncompressedSize).withStreamInfo(\"crc32\",this.crc32).withStreamInfo(\"compression\",this.compression)}},a.createWorkerFrom=function(e,t,r){return e.pipe(new s).pipe(new o(\"uncompressedSize\")).pipe(t.compressWorker(r)).pipe(new o(\"compressedSize\")).withStreamInfo(\"compression\",t)},t.exports=a},{\"./external\":6,\"./stream/Crc32Probe\":25,\"./stream/DataLengthProbe\":26,\"./stream/DataWorker\":27}],3:[function(e,t,r){\"use strict\";var n=e(\"./stream/GenericWorker\");r.STORE={magic:\"\\0\\0\",compressWorker:function(e){return new n(\"STORE compression\")},uncompressWorker:function(){return new n(\"STORE decompression\")}},r.DEFLATE=e(\"./flate\")},{\"./flate\":7,\"./stream/GenericWorker\":28}],4:[function(e,t,r){\"use strict\";var n=e(\"./utils\"),o=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?\"string\"!==n.getTypeOf(e)?function(e,t,r){var n=o,i=0+r;e^=-1;for(var s=0;s>>8^n[255&(e^t[s])];return-1^e}(0|t,e,e.length):function(e,t,r){var n=o,i=0+r;e^=-1;for(var s=0;s>>8^n[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length):0}},{\"./utils\":32}],5:[function(e,t,r){\"use strict\";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){\"use strict\";var n;n=\"undefined\"!=typeof Promise?Promise:e(\"lie\"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,r){\"use strict\";var n=\"undefined\"!=typeof Uint8Array&&\"undefined\"!=typeof Uint16Array&&\"undefined\"!=typeof Uint32Array,i=e(\"pako\"),s=e(\"./utils\"),o=e(\"./stream/GenericWorker\"),a=n?\"uint8array\":\"array\";function f(e,t){o.call(this,\"FlateWorker/\"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}r.magic=\"\\b\\0\",s.inherits(f,o),f.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,e.data),!1)},f.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},f.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},f.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(e){return new f(\"Deflate\",e)},r.uncompressWorker=function(){return new f(\"Inflate\",{})}},{\"./stream/GenericWorker\":28,\"./utils\":32,pako:38}],8:[function(e,t,r){\"use strict\";function O(e,t){var r,n=\"\";for(r=0;r>>=8;return n}function i(e,t,r,n,i,s){var o,a,f=e.file,u=e.compression,d=s!==D.utf8encode,h=I.transformTo(\"string\",s(f.name)),l=I.transformTo(\"string\",D.utf8encode(f.name)),c=f.comment,p=I.transformTo(\"string\",s(c)),m=I.transformTo(\"string\",D.utf8encode(c)),_=l.length!==f.name.length,w=m.length!==c.length,v=\"\",g=\"\",y=\"\",b=f.dir,k=f.date,x={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(x.crc32=e.crc32,x.compressedSize=e.compressedSize,x.uncompressedSize=e.uncompressedSize);var S=0;t&&(S|=8),d||!_&&!w||(S|=2048);var E,z=0,C=0;b&&(z|=16),\"UNIX\"===i?(C=798,z|=((E=f.unixPermissions)||(E=b?16893:33204),(65535&E)<<16)):(C=20,z|=63&(f.dosPermissions||0)),o=k.getUTCHours(),o<<=6,o|=k.getUTCMinutes(),o<<=5,o|=k.getUTCSeconds()/2,a=k.getUTCFullYear()-1980,a<<=4,a|=k.getUTCMonth()+1,a<<=5,a|=k.getUTCDate(),_&&(v+=\"up\"+O((g=O(1,1)+O(B(h),4)+l).length,2)+g),w&&(v+=\"uc\"+O((y=O(1,1)+O(B(p),4)+m).length,2)+y);var A=\"\";return A+=\"\\n\\0\",A+=O(S,2),A+=u.magic,A+=O(o,2),A+=O(a,2),A+=O(x.crc32,4),A+=O(x.compressedSize,4),A+=O(x.uncompressedSize,4),A+=O(h.length,2),A+=O(v.length,2),{fileRecord:T.LOCAL_FILE_HEADER+A+h+v,dirRecord:T.CENTRAL_FILE_HEADER+O(C,2)+A+O(p.length,2)+\"\\0\\0\\0\\0\"+O(z,4)+O(n,4)+h+v+p}}var I=e(\"../utils\"),s=e(\"../stream/GenericWorker\"),D=e(\"../utf8\"),B=e(\"../crc32\"),T=e(\"../signature\");function n(e,t,r,n){s.call(this,\"ZipFileWorker\"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}I.inherits(n,s),n.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,s.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},n.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},n.prototype.closedSource=function(e){this.accumulate=!1;var t,r=this.streamFiles&&!e.file.dir,n=i(e,r,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),r)this.push({data:(t=e,T.DATA_DESCRIPTOR+O(t.crc32,4)+O(t.compressedSize,4)+O(t.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},n.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo(\"string\",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{\"../utils\":32}],19:[function(e,t,r){\"use strict\";var n=e(\"./Uint8ArrayReader\");function i(e){n.call(this,e)}e(\"../utils\").inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{\"../utils\":32,\"./Uint8ArrayReader\":21}],20:[function(e,t,r){\"use strict\";var n=e(\"./DataReader\");function i(e){n.call(this,e)}e(\"../utils\").inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{\"../utils\":32,\"./DataReader\":18}],21:[function(e,t,r){\"use strict\";var n=e(\"./ArrayReader\");function i(e){n.call(this,e)}e(\"../utils\").inherits(i,n),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{\"../utils\":32,\"./ArrayReader\":17}],22:[function(e,t,r){\"use strict\";var n=e(\"../utils\"),i=e(\"../support\"),s=e(\"./ArrayReader\"),o=e(\"./StringReader\"),a=e(\"./NodeBufferReader\"),f=e(\"./Uint8ArrayReader\");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),\"string\"!==t||i.uint8array?\"nodebuffer\"===t?new a(e):i.uint8array?new f(n.transformTo(\"uint8array\",e)):new s(n.transformTo(\"array\",e)):new o(e)}},{\"../support\":30,\"../utils\":32,\"./ArrayReader\":17,\"./NodeBufferReader\":19,\"./StringReader\":20,\"./Uint8ArrayReader\":21}],23:[function(e,t,r){\"use strict\";r.LOCAL_FILE_HEADER=\"PK\u0003\u0004\",r.CENTRAL_FILE_HEADER=\"PK\u0001\u0002\",r.CENTRAL_DIRECTORY_END=\"PK\u0005\u0006\",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR=\"PK\u0006\u0007\",r.ZIP64_CENTRAL_DIRECTORY_END=\"PK\u0006\u0006\",r.DATA_DESCRIPTOR=\"PK\u0007\\b\"},{}],24:[function(e,t,r){\"use strict\";var n=e(\"./GenericWorker\"),i=e(\"../utils\");function s(e){n.call(this,\"ConvertWorker to \"+e),this.destType=e}i.inherits(s,n),s.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],25:[function(e,t,r){\"use strict\";var n=e(\"./GenericWorker\"),i=e(\"../crc32\");function s(){n.call(this,\"Crc32Probe\"),this.withStreamInfo(\"crc32\",0)}e(\"../utils\").inherits(s,n),s.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=s},{\"../crc32\":4,\"../utils\":32,\"./GenericWorker\":28}],26:[function(e,t,r){\"use strict\";var n=e(\"../utils\"),i=e(\"./GenericWorker\");function s(e){i.call(this,\"DataLengthProbe for \"+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(s,i),s.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],27:[function(e,t,r){\"use strict\";var n=e(\"../utils\"),i=e(\"./GenericWorker\");function s(e){i.call(this,\"DataWorker\");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=\"\",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}n.inherits(s,i),s.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case\"string\":e=this.data.substring(this.index,t);break;case\"uint8array\":e=this.data.subarray(this.index,t);break;case\"array\":case\"nodebuffer\":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],28:[function(e,t,r){\"use strict\";function n(e){this.name=e||\"default\",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit(\"data\",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit(\"end\"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit(\"error\",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit(\"error\",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r \"+e:e}},t.exports=n},{}],29:[function(e,t,r){\"use strict\";var u=e(\"../utils\"),i=e(\"./ConvertWorker\"),s=e(\"./GenericWorker\"),d=e(\"../base64\"),n=e(\"../support\"),o=e(\"../external\"),a=null;if(n.nodestream)try{a=e(\"../nodejs/NodejsStreamOutputAdapter\")}catch(e){}function f(e,t,r){var n=t;switch(t){case\"blob\":case\"arraybuffer\":n=\"uint8array\";break;case\"base64\":n=\"string\"}try{this._internalType=n,this._outputType=t,this._mimeType=r,u.checkSupport(n),this._worker=e.pipe(new i(n)),e.lock()}catch(e){this._worker=new s(\"error\"),this._worker.error(e)}}f.prototype={accumulate:function(e){return a=this,f=e,new o.Promise(function(t,r){var n=[],i=a._internalType,s=a._outputType,o=a._mimeType;a.on(\"data\",function(e,t){n.push(e),f&&f(t)}).on(\"error\",function(e){n=[],r(e)}).on(\"end\",function(){try{var e=function(e,t,r){switch(e){case\"blob\":return u.newBlob(u.transformTo(\"arraybuffer\",t),r);case\"base64\":return d.encode(t);default:return u.transformTo(e,t)}}(s,function(e,t){var r,n=0,i=null,s=0;for(r=0;r>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t}(e)},s.utf8decode=function(e){return f.nodebuffer?a.transformTo(\"nodebuffer\",e).toString(\"utf-8\"):function(e){var t,r,n,i,s=e.length,o=new Array(2*s);for(t=r=0;t>10&1023,o[r++]=56320|1023&n)}return o.length!==r&&(o.subarray?o=o.subarray(0,r):o.length=r),a.applyFromCharCode(o)}(e=a.transformTo(f.uint8array?\"uint8array\":\"array\",e))},a.inherits(o,n),o.prototype.processChunk=function(e){var t=a.transformTo(f.uint8array?\"uint8array\":\"array\",e.data);if(this.leftOver&&this.leftOver.length){if(f.uint8array){var r=t;(t=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),t.set(r,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var n=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+u[e[r]]>t?r:t}(t),i=t;n!==t.length&&(f.uint8array?(i=t.subarray(0,n),this.leftOver=t.subarray(n,t.length)):(i=t.slice(0,n),this.leftOver=t.slice(n,t.length))),this.push({data:s.utf8decode(i),meta:e.meta})},o.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=o,a.inherits(d,n),d.prototype.processChunk=function(e){this.push({data:s.utf8encode(e.data),meta:e.meta})},s.Utf8EncodeWorker=d},{\"./nodejsUtils\":14,\"./stream/GenericWorker\":28,\"./support\":30,\"./utils\":32}],32:[function(e,t,a){\"use strict\";var f=e(\"./support\"),u=e(\"./base64\"),r=e(\"./nodejsUtils\"),n=e(\"set-immediate-shim\"),d=e(\"./external\");function i(e){return e}function h(e,t){for(var r=0;r>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||\"/\"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=n(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t},r.buf2binstring=function(e){return d(e,e.length)},r.binstring2buf=function(e){for(var t=new f.Buf8(e.length),r=0,n=t.length;r>10&1023,a[n++]=56320|1023&i)}return d(a,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+u[e[r]]>t?r:t}},{\"./common\":41}],43:[function(e,t,r){\"use strict\";t.exports=function(e,t,r,n){for(var i=65535&e|0,s=e>>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,n){var i=a,s=n+r;e^=-1;for(var o=n;o>>8^i[255&(e^t[o])];return-1^e}},{}],46:[function(e,t,r){\"use strict\";var f,l=e(\"../utils/common\"),u=e(\"./trees\"),c=e(\"./adler32\"),p=e(\"./crc32\"),n=e(\"./messages\"),d=0,h=0,m=-2,i=2,_=8,s=286,o=30,a=19,w=2*s+1,v=15,g=3,y=258,b=y+g+1,k=42,x=113;function S(e,t){return e.msg=n[t],t}function E(e){return(e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(l.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function A(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,C(e.strm)}function O(e,t){e.pending_buf[e.pending++]=t}function I(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function D(e,t){var r,n,i=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match,f=e.strstart>e.w_size-b?e.strstart-(e.w_size-b):0,u=e.window,d=e.w_mask,h=e.prev,l=e.strstart+y,c=u[s+o-1],p=u[s+o];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(u[(r=t)+o]===p&&u[r+o-1]===c&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do{}while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&sf&&0!=--i);return o<=e.lookahead?o:e.lookahead}function B(e){var t,r,n,i,s,o,a,f,u,d,h=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=h+(h-b)){for(l.arraySet(e.window,e.window,h,h,0),e.match_start-=h,e.strstart-=h,e.block_start-=h,t=r=e.hash_size;n=e.head[--t],e.head[t]=h<=n?n-h:0,--r;);for(t=r=h;n=e.prev[--t],e.prev[t]=h<=n?n-h:0,--r;);i+=h}if(0===e.strm.avail_in)break;if(o=e.strm,a=e.window,f=e.strstart+e.lookahead,d=void 0,(u=i)<(d=o.avail_in)&&(d=u),r=0===d?0:(o.avail_in-=d,l.arraySet(a,o.input,o.next_in,d,f),1===o.state.wrap?o.adler=c(o.adler,a,d,f):2===o.state.wrap&&(o.adler=p(o.adler,a,d,f)),o.next_in+=d,o.total_in+=d,d),e.lookahead+=r,e.lookahead+e.insert>=g)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<=g&&(e.ins_h=(e.ins_h<=g)if(n=u._tr_tally(e,e.strstart-e.match_start,e.match_length-g),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=g){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=g&&(e.ins_h=(e.ins_h<=g&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-g,n=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-g),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(B(e),0===e.lookahead&&t===d)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,A(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-b&&(A(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(A(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(A(e,!1),e.strm.avail_out),1)}),new F(4,4,8,4,T),new F(4,5,16,8,T),new F(4,6,32,32,T),new F(4,4,16,16,R),new F(8,16,32,32,R),new F(8,16,128,128,R),new F(8,32,128,256,R),new F(32,128,258,1024,R),new F(32,258,258,4096,R)],r.deflateInit=function(e,t){return P(e,t,_,15,8,0)},r.deflateInit2=P,r.deflateReset=L,r.deflateResetKeep=U,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?m:(e.state.gzhead=t,h):m},r.deflate=function(e,t){var r,n,i,s;if(!e||!e.state||5>8&255),O(n,n.gzhead.time>>16&255),O(n,n.gzhead.time>>24&255),O(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),O(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(O(n,255&n.gzhead.extra.length),O(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=p(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(O(n,0),O(n,0),O(n,0),O(n,0),O(n,0),O(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),O(n,3),n.status=x);else{var o=_+(n.w_bits-8<<4)<<8;o|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(o|=32),o+=31-o%31,n.status=x,I(n,o),0!==n.strstart&&(I(n,e.adler>>>16),I(n,65535&e.adler)),e.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),C(e),i=n.pending,n.pending!==n.pending_buf_size));)O(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),C(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindexi&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),C(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindexi&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&C(e),n.pending+2<=n.pending_buf_size&&(O(n,255&e.adler),O(n,e.adler>>8&255),e.adler=0,n.status=x)):n.status=x),0!==n.pending){if(C(e),0===e.avail_out)return n.last_flush=-1,h}else if(0===e.avail_in&&E(t)<=E(r)&&4!==t)return S(e,-5);if(666===n.status&&0!==e.avail_in)return S(e,-5);if(0!==e.avail_in||0!==n.lookahead||t!==d&&666!==n.status){var a=2===n.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(B(e),0===e.lookahead)){if(t===d)return 1;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(A(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(A(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(A(e,!1),0===e.strm.avail_out)?1:2}(n,t):3===n.strategy?function(e,t){for(var r,n,i,s,o=e.window;;){if(e.lookahead<=y){if(B(e),e.lookahead<=y&&t===d)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=g&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=g?(r=u._tr_tally(e,1,e.match_length-g),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(A(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(A(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(A(e,!1),0===e.strm.avail_out)?1:2}(n,t):f[n.level].func(n,t);if(3!==a&&4!==a||(n.status=666),1===a||3===a)return 0===e.avail_out&&(n.last_flush=-1),h;if(2===a&&(1===t?u._tr_align(n):5!==t&&(u._tr_stored_block(n,0,0,!1),3===t&&(z(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),C(e),0===e.avail_out))return n.last_flush=-1,h}return 4!==t?h:n.wrap<=0?1:(2===n.wrap?(O(n,255&e.adler),O(n,e.adler>>8&255),O(n,e.adler>>16&255),O(n,e.adler>>24&255),O(n,255&e.total_in),O(n,e.total_in>>8&255),O(n,e.total_in>>16&255),O(n,e.total_in>>24&255)):(I(n,e.adler>>>16),I(n,65535&e.adler)),C(e),0=r.w_size&&(0===s&&(z(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new l.Buf8(r.w_size),l.arraySet(u,t,d-r.w_size,r.w_size,0),t=u,d=r.w_size),o=e.avail_in,a=e.next_in,f=e.input,e.avail_in=d,e.next_in=0,e.input=t,B(r);r.lookahead>=g;){for(n=r.strstart,i=r.lookahead-(g-1);r.ins_h=(r.ins_h<>>=y=g>>>24,p-=y,0==(y=g>>>16&255))z[s++]=65535&g;else{if(!(16&y)){if(0==(64&y)){g=m[(65535&g)+(c&(1<>>=y,p-=y),p<15&&(c+=E[n++]<>>=y=g>>>24,p-=y,!(16&(y=g>>>16&255))){if(0==(64&y)){g=_[(65535&g)+(c&(1<>>=y,p-=y,(y=s-o)>3,c&=(1<<(p-=b<<3))-1,e.next_in=n,e.next_out=s,e.avail_in=n>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function s(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new O.Buf16(320),this.work=new O.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=\"\",t.wrap&&(e.adler=1&t.wrap),t.mode=L,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new O.Buf32(n),t.distcode=t.distdyn=new O.Buf32(i),t.sane=1,t.back=-1,N):U}function a(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,o(e)):U}function f(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=s.wsize?(O.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(n<(i=s.wsize-s.wnext)&&(i=n),O.arraySet(s.window,t,r-n,i,s.wnext),(n-=i)?(O.arraySet(s.window,t,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=D(r.check,C,2,0),d=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg=\"incorrect header check\",r.mode=30;break}if(8!=(15&u)){e.msg=\"unknown compression method\",r.mode=30;break}if(d-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg=\"invalid window size\",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=D(r.check,C,2,0)),d=u=0,r.mode=3;case 3:for(;d<32;){if(0===a)break e;a--,u+=n[s++]<>>8&255,C[2]=u>>>16&255,C[3]=u>>>24&255,r.check=D(r.check,C,4,0)),d=u=0,r.mode=4;case 4:for(;d<16;){if(0===a)break e;a--,u+=n[s++]<>8),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=D(r.check,C,2,0)),d=u=0,r.mode=5;case 5:if(1024&r.flags){for(;d<16;){if(0===a)break e;a--,u+=n[s++]<>>8&255,r.check=D(r.check,C,2,0)),d=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(a<(c=r.length)&&(c=a),c&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),O.arraySet(r.head.extra,n,s,c,k)),512&r.flags&&(r.check=D(r.check,n,c,s)),a-=c,s+=c,r.length-=c),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===a)break e;for(c=0;k=n[s+c++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&c>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;d<32;){if(0===a)break e;a--,u+=n[s++]<>>=7&d,d-=7&d,r.mode=27;break}for(;d<3;){if(0===a)break e;a--,u+=n[s++]<>>=1)){case 0:r.mode=14;break;case 1:if(j(r),r.mode=20,6!==t)break;u>>>=2,d-=2;break e;case 2:r.mode=17;break;case 3:e.msg=\"invalid block type\",r.mode=30}u>>>=2,d-=2;break;case 14:for(u>>>=7&d,d-=7&d;d<32;){if(0===a)break e;a--,u+=n[s++]<>>16^65535)){e.msg=\"invalid stored block lengths\",r.mode=30;break}if(r.length=65535&u,d=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(c=r.length){if(a>>=5,d-=5,r.ndist=1+(31&u),u>>>=5,d-=5,r.ncode=4+(15&u),u>>>=4,d-=4,286>>=3,d-=3}for(;r.have<19;)r.lens[A[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=T(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg=\"invalid code lengths set\",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,v=65535&z,!((_=z>>>24)<=d);){if(0===a)break e;a--,u+=n[s++]<>>=_,d-=_,r.lens[r.have++]=v;else{if(16===v){for(E=_+2;d>>=_,d-=_,0===r.have){e.msg=\"invalid bit length repeat\",r.mode=30;break}k=r.lens[r.have-1],c=3+(3&u),u>>>=2,d-=2}else if(17===v){for(E=_+3;d>>=_)),u>>>=3,d-=3}else{for(E=_+7;d>>=_)),u>>>=7,d-=7}if(r.have+c>r.nlen+r.ndist){e.msg=\"invalid bit length repeat\",r.mode=30;break}for(;c--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg=\"invalid code -- missing end-of-block\",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=T(R,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg=\"invalid literal/lengths set\",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=T(F,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg=\"invalid distances set\",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=a&&258<=f){e.next_out=o,e.avail_out=f,e.next_in=s,e.avail_in=a,r.hold=u,r.bits=d,B(e,l),o=e.next_out,i=e.output,f=e.avail_out,s=e.next_in,n=e.input,a=e.avail_in,u=r.hold,d=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;w=(z=r.lencode[u&(1<>>16&255,v=65535&z,!((_=z>>>24)<=d);){if(0===a)break e;a--,u+=n[s++]<>g)])>>>16&255,v=65535&z,!(g+(_=z>>>24)<=d);){if(0===a)break e;a--,u+=n[s++]<>>=g,d-=g,r.back+=g}if(u>>>=_,d-=_,r.back+=_,r.length=v,0===w){r.mode=26;break}if(32&w){r.back=-1,r.mode=12;break}if(64&w){e.msg=\"invalid literal/length code\",r.mode=30;break}r.extra=15&w,r.mode=22;case 22:if(r.extra){for(E=r.extra;d>>=r.extra,d-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;w=(z=r.distcode[u&(1<>>16&255,v=65535&z,!((_=z>>>24)<=d);){if(0===a)break e;a--,u+=n[s++]<>g)])>>>16&255,v=65535&z,!(g+(_=z>>>24)<=d);){if(0===a)break e;a--,u+=n[s++]<>>=g,d-=g,r.back+=g}if(u>>>=_,d-=_,r.back+=_,64&w){e.msg=\"invalid distance code\",r.mode=30;break}r.offset=v,r.extra=15&w,r.mode=24;case 24:if(r.extra){for(E=r.extra;d>>=r.extra,d-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg=\"invalid distance too far back\",r.mode=30;break}r.mode=25;case 25:if(0===f)break e;if(c=l-f,r.offset>c){if((c=r.offset-c)>r.whave&&r.sane){e.msg=\"invalid distance too far back\",r.mode=30;break}p=c>r.wnext?(c-=r.wnext,r.wsize-c):r.wnext-c,c>r.length&&(c=r.length),m=r.window}else m=i,p=o-r.offset,c=r.length;for(fc?(m=B[T+o[g]],A[O+o[g]]):(m=96,0),f=1<>S)+(u-=f)]=p<<24|m<<16|_|0,0!==u;);for(f=1<>=1;if(0!==f?(C&=f-1,C+=f):C=0,g++,0==--I[v]){if(v===b)break;v=t[r+o[g]]}if(k>>7)]}function x(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function S(e,t,r){e.bi_valid>i-r?(e.bi_buf|=t<>i-e.bi_valid,e.bi_valid+=r-i):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function C(e,t,r){var n,i,s=new Array(_+1),o=0;for(n=1;n<=_;n++)s[n]=o=o+r[n-1]<<1;for(i=0;i<=t;i++){var a=e[2*i+1];0!==a&&(e[2*i]=z(s[a]++,a))}}function A(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function O(e){8>1;1<=r;r--)D(e,s,r);for(i=f;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],D(e,s,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,s[2*i]=s[2*r]+s[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,s[2*r+1]=s[2*n+1]=i,e.heap[1]=i++,D(e,s,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,s,o,a,f=t.dyn_tree,u=t.max_code,d=t.stat_desc.static_tree,h=t.stat_desc.has_stree,l=t.stat_desc.extra_bits,c=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(s=0;s<=_;s++)e.bl_count[s]=0;for(f[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)p<(s=f[2*f[2*(n=e.heap[r])+1]+1]+1)&&(s=p,m++),f[2*n+1]=s,u>=7;n<30;n++)for(y[n]=i<<7,e=0;e<1<>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),T(e,e.l_desc),T(e,e.d_desc),o=function(e){var t;for(R(e,e.dyn_ltree,e.l_desc.max_code),R(e,e.dyn_dtree,e.d_desc.max_code),T(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*d[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==t?U(e,t,r,n):4===e.strategy||s===i?(S(e,2+(n?1:0),3),B(e,h,l)):(S(e,4+(n?1:0),3),function(e,t,r,n){var i;for(S(e,t-257,5),S(e,r-1,5),S(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(p[r]+256+1)]++,e.dyn_dtree[2*k(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){var t;S(e,2,3),E(e,256,h),16===(t=e).bi_valid?(x(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{\"../utils/common\":41}],53:[function(e,t,r){\"use strict\";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,r){\"use strict\";t.exports=\"function\"==typeof setImmediate?setImmediate:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e)}},{}]},{},[10])(10)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,void 0!==r?r:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)})}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}]},{},[1])(1)});","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"../Timeline\"), exports);\n__exportStar(require(\"../DrawerCanvas\"), exports);\n__exportStar(require(\"../Renderer\"), exports);\n__exportStar(require(\"./BrowserDrawerCanvas\"), exports);\nconst BrowserDrawerCanvas_1 = require(\"./BrowserDrawerCanvas\");\nexports.default = BrowserDrawerCanvas_1.BrowserDrawerCanvas;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GCODEExporter = void 0;\n__exportStar(require(\"./types\"), exports);\nconst GCODEExporter_1 = require(\"./GCODEExporter\");\nObject.defineProperty(exports, \"GCODEExporter\", { enumerable: true, get: function () { return GCODEExporter_1.GCODEExporter; } });\nif (typeof Urpflanze !== 'undefined') {\n Urpflanze.GCODEExporter = GCODEExporter_1.GCODEExporter;\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GCODEExporter = void 0;\nconst core_1 = require(\"@urpflanze/core\");\nconst simplify_js_1 = require(\"simplify-js\");\nconst utilities_1 = require(\"./utilities\");\nclass GCODEExporter {\n static parse(scene, settings) {\n const bindedSettings = {\n ...GCODEExporter.defaults,\n ...settings,\n };\n return GCODEExporter.generate(scene, bindedSettings).join('\\n');\n }\n /**\n * Set units to inches or millimeters.\n * When unit is set, all positions, offsets, rates, accelerations, etc., specified in G-code parameters are interpreted in that unit.\n *\n * @param unit 'millimeters' | 'inches'\n * @returns\n */\n static setUnit(unit) {\n return unit === 'inches' ? 'G20' : 'G21';\n }\n /**\n * In this mode all coordinates are interpreted as relative to the last position.\n *\n * @returns\n */\n static useRelativePosition() {\n return 'G91';\n }\n /**\n * All coordinates given in G-code are interpreted as positions in the logical coordinate space\n *\n * @returns\n */\n static useAbsolutePosition() {\n return 'G90';\n }\n /**\n * Up pen and go home\n *\n * @param penUpCommand\n * @returns\n */\n static goHome(penUpCommand) {\n return [penUpCommand, 'G28 X0 Y0'];\n }\n /**\n * Store the origin position that the machine goes to when the {G28} command is issued\n *\n * @param x\n * @param y\n * @param decimals\n * @returns\n */\n static setCurrentMachinePosition(x, y, decimals) {\n return `G28.1 X${utilities_1.round(x, decimals)} Y${utilities_1.round(y, decimals)}`;\n }\n /**\n * Set the current position to the values specified.\n *\n * @param x\n * @param y\n * @param decimals\n * @returns\n */\n static setCurrentWorkspacePosition(x, y, decimals) {\n return `G92 X${utilities_1.round(x, decimals)} Y${utilities_1.round(y, decimals)}`;\n }\n /**\n * Linear move.\n * G0 is a rapid moviment (max speed)\n * G1 moviment of setted velocity\n *\n * @param x\n * @param y\n * @param decimals\n * @param velocity\n * @returns\n */\n static goTo(x, y, decimals, velocity) {\n return typeof velocity !== 'undefined'\n ? `G1 X${utilities_1.round(x, decimals)} Y${utilities_1.round(y, decimals)} F${velocity}`\n : `G0 X${utilities_1.round(x, decimals)} Y${utilities_1.round(y, decimals)}`;\n }\n /**\n * Up the pen, move and down\n *\n * @param penUpCommand\n * @param penDownCommand\n * @param x\n * @param y\n * @param round\n * @returns\n */\n static moveTo(penUpCommand, penDownCommand, x, y, round) {\n return [penUpCommand, this.goTo(x, y, round), penDownCommand];\n }\n /**\n * goTo alias\n *\n * @param x\n * @param y\n * @param velocity\n * @param round\n * @returns\n */\n static lineTo(x, y, velocity, round) {\n return this.goTo(x, y, round, velocity);\n }\n /**\n * Generate gcode frm scene\n *\n * @param scene\n * @param settings\n * @returns\n */\n static generate(scene, settings) {\n // Calculate workspace area\n const workspaceWidth = settings.maxX - settings.minX;\n const workspaceHeight = settings.maxY - settings.minY;\n const workspaceRatio = workspaceWidth / workspaceHeight;\n // Calculate drawArea from scene\n const sceneRatio = scene.width / scene.height;\n const drawArea = [\n workspaceRatio > sceneRatio ? (scene.width * workspaceHeight) / scene.height : workspaceWidth,\n workspaceRatio > sceneRatio ? workspaceHeight : (scene.height * workspaceWidth) / scene.width,\n ];\n const drawAreaSceneOffset = [(workspaceWidth - drawArea[0]) / 2, (workspaceHeight - drawArea[1]) / 2];\n // Adapt drawArea to workspace\n const scale = workspaceRatio > sceneRatio ? scene.width / drawArea[0] : scene.height / drawArea[1];\n // const machineCenterPosition = [(settings.maxX + settings.minX) / 2, (settings.maxY + settings.minY) / 2]\n const gcode = [];\n utilities_1.concat(gcode, settings.penUpCommand);\n utilities_1.concat(gcode, this.setUnit(settings.unit));\n utilities_1.concat(gcode, this.useAbsolutePosition());\n utilities_1.concat(gcode, this.setCurrentMachinePosition(settings.minX, settings.minY, settings.decimals));\n utilities_1.concat(gcode, this.setCurrentWorkspacePosition(settings.minX, settings.minY, settings.decimals));\n const sceneChilds = scene.getChildren();\n for (let i = 0, len = sceneChilds.length; i < len; i++) {\n sceneChilds[i].generate(0, true);\n const childBuffer = sceneChilds[i].getBuffer() || [];\n const childIndexedBuffer = sceneChilds[i].getIndexedBuffer() || [];\n let childVertexIndex = 0;\n for (let currentBufferIndex = 0, len = childIndexedBuffer.length; currentBufferIndex < len; currentBufferIndex++) {\n const currentIndexing = childIndexedBuffer[currentBufferIndex];\n const initialPointX = core_1.clamp(settings.minX, settings.maxX, settings.minX + childBuffer[childVertexIndex] / scale + drawAreaSceneOffset[0]);\n const initialPointY = core_1.clamp(settings.minY, settings.maxY, settings.minY + childBuffer[childVertexIndex + 1] / scale + drawAreaSceneOffset[1]);\n utilities_1.concat(gcode, this.moveTo(settings.penUpCommand, settings.penDownCommand, initialPointX, initialPointY, settings.decimals));\n const simplifiedBuffer = GCODEExporter.pointsToBuffer(simplify_js_1.default(GCODEExporter.bufferToPoints(childBuffer.slice(childVertexIndex, childVertexIndex + currentIndexing.frameLength)), 1 / 10 ** settings.decimals, true));\n for (let i = 0, len = simplifiedBuffer.length; i < len; i += 2) {\n const currentX = core_1.clamp(settings.minX, settings.maxX, settings.minX + simplifiedBuffer[i] / scale + drawAreaSceneOffset[0]);\n const currentY = core_1.clamp(settings.minY, settings.maxY, settings.minY + simplifiedBuffer[i + 1] / scale + drawAreaSceneOffset[1]);\n utilities_1.concat(gcode, this.lineTo(currentX, currentY, settings.velocity, settings.decimals));\n }\n if (currentIndexing.shape.isClosed())\n utilities_1.concat(gcode, this.lineTo(initialPointX, initialPointY, settings.velocity, settings.decimals));\n childVertexIndex += currentIndexing.frameLength;\n }\n }\n /**\n *\n * @param penUpCommand\n * @returns\n */\n utilities_1.concat(gcode, this.goHome(settings.penUpCommand));\n return gcode;\n }\n static bufferToPoints(buffer) {\n const result = [];\n for (let i = 0, len = buffer.length; i < len; i += 2)\n result.push({ x: buffer[i], y: buffer[i + 1] });\n return result;\n }\n static pointsToBuffer(points) {\n const result = [];\n for (let i = 0, len = points.length; i < len; i++) {\n result.push(points[i].x);\n result.push(points[i].y);\n }\n return Float32Array.from(result);\n }\n}\nexports.GCODEExporter = GCODEExporter;\nGCODEExporter.defaults = {\n minX: 0,\n minY: 0,\n maxX: 297,\n maxY: 210,\n unit: 'millimeters',\n velocity: 1500,\n penUpCommand: 'M3 S30',\n penDownCommand: 'M3 S0',\n decimals: 2,\n};\n//# sourceMappingURL=GCODEExporter.js.map","/*! For license information please see urpflanze.min.js.LICENSE.txt */\n!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.Urpflanze=e():t.Urpflanze=e()}(window,(function(){return(()=>{var t={193:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Group=void 0;const n=r(107),i=r(15),o=r(485),a=r(658);class s extends i.SceneChild{constructor(t={}){t.type=\"Group\",super(t),this.children=[],[\"id\",\"name\",\"data\",\"order\",\"type\"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=a.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){\"object\"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=s},107:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Scene=void 0;const n=r(15),i=r(193),o=r(775),a=r(932);class s{constructor(t={}){this.width=400,this.height=400,this.background=\"hsla(0, 0%, 0%, 1)\",this.color=\"hsla(0, 0%, 100%, 1)\",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?[\"number\"==typeof t.anchor[0]?(.5+.5*a.clamp(-1,1,t.anchor[0]))*this.width:\"left\"===t.anchor[0]?0:\"right\"===t.anchor[0]?this.width:this.center[0],\"number\"==typeof t.anchor[1]?(.5+.5*a.clamp(-1,1,t.anchor[1]))*this.height:\"top\"===t.anchor[1]?0:\"bottom\"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e=\"number\"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,s.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{s.propagateToChilden(t,e)})):t instanceof o.Shape&&t.shape&&(t.shape.scene=e,s.propagateToChilden(t.shape,e))}}e.Scene=s},15:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||\"SceneChild\",this.name=t.name||this.type+\"_\"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){\"string\"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},932:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(21),i=r(345),o=r(271),a=\"undefined\"!=typeof performance?performance:Date;function s(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return a.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=s,e.relativeClamp=function(t,e,r,n,i){return s(n,i,(r-t)/(e-t)*(i-n)+n)};const u={random:new n(Math.random)};e.noise=function(t=\"random\",e=0,r=0,i=0){return void 0===u[t]&&(u[t]=new n(t)),u[t].noise3D(e,r,i)};const h={};function c(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),o=rn?[o,a]:[a,o]}function f(t,e){const r=t.length,n=r/2,i=2*(n+e),o=n-1;if(o>1){const n=r-2,a=Math.floor(e/o);let s=(i-(r+a*n))/2;const u=Math.round(o/s),h=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%u==0||e===n-2),p=a+(d?1:0),M=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);h[i]=(o=t(),a=t(),s=t(),u=t(),function(){let t=(o>>>=0)+(a>>>=0)|0;return o=a^a>>>9,a=(s>>>=0)+(s<<3)|0,t=t+(u=1+(u>>>=0)|0)|0,s=(s=s<<21|s>>>11)+t|0,(t>>>0)/4294967296})}var o,a,s,u;const c=e+h[i]()*(r-e);return void 0!==n?Math.round(c*10**n)/10**n:c},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return o.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=c,e.interpolate=function(t,e,r=.5){const[n,i]=c(t,e),o=Math.max(n.length,i.length),a=\"number\"==typeof r?[r]:r,s=o/2;if(a.length!==s){const t=a.length;for(let e=0;e{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return\"number\"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},348:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(887);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},888:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},658:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(700);var i;!function(t){t[t.None=0]=\"None\",t[t.Scale=2]=\"Scale\",t[t.Center=4]=\"Center\",t[t.Fill=8]=\"Fill\"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn(\"[Urplfanze:Bounding] cannot sum bounding\")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn(\"[Urplfanze:Bounding] cannot bind bounding\")}};class o extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return o.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=o.getBounding(t));const a=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,s=e>=i.Center?r.cx:0,u=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Close=void 0;const n=r(700);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},991:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Mirror=void 0;const n=r(700);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let o=0;o{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},62:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Offset=void 0;const n=r(700);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i},785:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Smooth=void 0;const n=r(932),i=r(364),o=r(700);class a extends o.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Solidify=void 0;const n=r(700);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const o=[],a=(e=\"number\"==typeof e?[e]:e).length;let s,u,h=[[0,0],[0,0]],c=[[0,0],[0,0]];for(let r=0,f=0,l=t.length-2;r{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Subdivide=void 0;const n=r(700);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Modifiers=void 0;const n=r(658),i=r(991),o=r(785),a=r(982),s=r(301),u=r(364),h=r(62),c={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:o.Smooth,Solidify:a.Solidify,Subdivide:s.Subdivide,Close:u.Close,Offset:h.Offset};e.Modifiers=c},775:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Shape=void 0;const n=r(107),i=r(15),o=r(485);class a extends o.ShapeBase{constructor(t){t.type=t.type||\"Shape\",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn(\"[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\\nYou passed:\",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):a.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeBase=void 0;const n=r(887),i=r(46),o=r(348),a=r(271),s=r(888),u=r(658),h=r(932),c=r(15),f=n.mat4.create(),l=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class M extends c.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?[\"number\"==typeof t.anchor[0]?-1*h.clamp(-1,1,t.anchor[0]):\"left\"===t.anchor[0]?1:\"right\"===t.anchor[0]?-1:0,\"number\"==typeof t.anchor[1]?-1*h.clamp(-1,1,t.anchor[1]):\"top\"===t.anchor[1]?1:\"bottom\"===t.anchor[1]?-1:0]:[0,0],this.boundingType=\"string\"==typeof t.boundingType?\"relative\"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return\"function\"!=typeof t.repetitions&&\"function\"!=typeof t.distance&&\"function\"!=typeof t.displace&&\"function\"!=typeof t.scale&&\"function\"!=typeof t.translate&&\"function\"!=typeof t.skewX&&\"function\"!=typeof t.skewY&&\"function\"!=typeof t.squeezeX&&\"function\"!=typeof t.squeezeY&&\"function\"!=typeof t.rotateX&&\"function\"!=typeof t.rotateY&&\"function\"!=typeof t.rotateZ&&\"function\"!=typeof t.transformOrigin&&\"function\"!=typeof t.perspective&&\"function\"!=typeof t.perspectiveOrigin}isStaticIndexed(){return\"function\"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return\"function\"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){\"string\"==typeof t?(r=r||\"repetitions\"==t,this.props[t]=e):(r=r||\"repetitions\"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var c,g;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const v=M.getEmptyPropArguments(this,r),m=v.repetition,b=this.getProp(\"repetitions\",v,1),y=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,x=Array.isArray(b)?b[0]*(null!==(c=b[1])&&void 0!==c?c:b[0]):b,S=Array.isArray(b)?b[0]:x,P=Array.isArray(b)?null!==(g=b[1])&&void 0!==g?g:b[0]:1,w=m.row;w.count=S;const B=m.col;B.count=P,m.count=x,m.col.count=P,m.row.count=S,m.type=y;let I=0;const R=[];let O=0;const A=n.vec2.fromValues((P-1)/2,(S-1)/2),L=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],E=[void 0,void 0,void 0,void 0],_=[void 0,void 0,void 0,void 0];for(let r=0;r1?O/(x-1):1,m.angle=y===i.ERepetitionType.Ring?s.PI2/x*O:0,B.index=c+1,B.offset=P>1?c/(P-1):1,w.index=r+1,w.offset=S>1?r/(S-1):1;const M=this.generateBuffer(t,v),g=M.length,b=this.getShapeBounding();R[O]=new Float32Array(g),I+=g;{const t=o.toVec2(this.getProp(\"distance\",v,o.VEC2_ZERO)),s=this.getProp(\"displace\",v,0),x=o.toVec3(this.getProp(\"scale\",v,o.VEC2_ONE),1),S=o.toVec3(this.getProp(\"translate\",v,o.VEC2_ZERO),0),P=this.getProp(\"skewX\",v,0),w=this.getProp(\"skewY\",v,0),B=this.getProp(\"squeezeX\",v,0),I=this.getProp(\"squeezeY\",v,0),F=this.getProp(\"rotateX\",v,0),C=this.getProp(\"rotateY\",v,0),j=this.getProp(\"rotateZ\",v,0),q=h.clamp(0,1,this.getProp(\"perspective\",v,0)),T=o.toVec3(this.getProp(\"perspectiveOrigin\",v,o.VEC2_ZERO),0),D=o.toVec3(this.getProp(\"transformOrigin\",v,o.VEC2_ZERO),0);let V;switch(y){case i.ERepetitionType.Ring:V=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(V,V,o.VEC3_ZERO,m.angle+s);break;case i.ERepetitionType.Matrix:V=n.vec3.fromValues(t[1]*(c-A[0]),t[0]*(r-A[1]),0)}const k=q>0?Math.max(b.width,b.height)/2:1,z=q>0?k+10*k*(1-q):0,U=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==q||0!==D[0]||0!==D[1],Y=0!==T[0]||0!==T[1];U&&(this.boundingType===i.EBoundingType.Relative?(D[0]=D[0]*(b.width/2)+b.cx,D[1]=D[1]*(b.height/2)+b.cy):(D[0]*=b.width/2,D[1]*=b.height/2),D[2]=z);{n.mat4.identity(l),U&&n.mat4.translate(l,l,D),0===S[0]&&0===S[1]||n.mat4.translate(l,l,S),0===P&&0===w||(o.fromSkew(f,[P,w]),n.mat4.multiply(l,l,f)),0!==F&&n.mat4.rotateX(l,l,F),0!==C&&n.mat4.rotateY(l,l,C),0!==j&&n.mat4.rotateZ(l,l,j),1===x[0]&&1===x[1]||n.mat4.scale(l,l,x),U&&n.mat4.translate(l,l,n.vec3.scale(D,D,-1)),z>0&&(Y&&(this.boundingType===i.EBoundingType.Relative?(T[0]=T[0]*(b.width/2)+b.cx,T[1]=T[1]*(b.height/2)+b.cy):(T[0]*=b.width/2,T[1]*=b.height/2),T[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,V),e&&n.mat4.translate(p,p,L);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),y===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,m.angle+s)}u.Bounding.clear(_);for(let t=0;t0&&(Y&&n.vec3.add(e,e,T),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,z),Y&&n.vec3.sub(e,e,T)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=g/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,v)}R[O][t]=e[0],R[O][t+1]=e[1],u.Bounding.add(_,e[0],e[1]),u.Bounding.add(E,e[0],e[1])}}const F={cx:0,cy:0,x:-1,y:-1,width:2,height:2};u.Bounding.bind(F,_),this.bStaticIndexed&&this.bIndexed||this.addIndex(g,m,F)}u.Bounding.bind(this.bounding,E),this.buffer=new Float32Array(I);for(let t=0,e=0,r=R.length;t({index:1,offset:1,count:1}),M.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...M.getEmptySimpleRepetition(),row:M.getEmptySimpleRepetition(),col:M.getEmptySimpleRepetition()})},425:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeBuffer=void 0;const n=r(658),i=r(436);class o extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||\"ShapeBuffer\",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn(\"[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property\"),this.shape=o.EMPTY_BUFFER):this.shape=\"function\"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return\"function\"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return\"function\"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from(\"function\"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,o=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&\"function\"!=typeof this.props.sideLength&&\"function\"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=o},549:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeFollow=void 0;const n=r(775);class i extends n.Shape{constructor(t){t.type=t.type||\"ShapeFollow\",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},o=this.shape;o.generate(t,!1,i);let a=o.getBuffer();const s=a.length,u=new Float32Array(s*(n.length/2)),h=n.length/2;for(let e=0;e1?e/(h-1):1,count:h};this.shapeUseFollow&&(i.follow=r,o.generate(t,!1,i),a=o.getBuffer());const c=e*s,f=2*e,l=n[f],d=n[f+1];for(let t=0,e=a.length;t1?t/(e-1):1;for(let a=0,s=o.length;a{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeLoop=void 0;const n=r(888),i=r(658),o=r(436),a=r(485);class s extends o.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||\"ShapeLoop\",super(t),this.loopDependencies=(t.loopDependencies||[]).concat(\"sideLength\"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes(\"propArguments\"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}\"loop\"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||a.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?(\"function\"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),o=this.getRepetitionSideLength(t),a=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,s={index:0,offset:0,current:0,count:n},u=s.count,h=new Float32Array(2*u);for(let n=0,i=0;n1?n/(s.count-1):1;s.current=o,s.index=n+1,s.offset=u;const c=a(s,t);h[i]=c[0],h[i+1]=c[1]}const c=[void 0,void 0,void 0,void 0],f=this.applyModifiers(h,t);for(let t=0,e=f.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapePrimitive=void 0;const n=r(348),i=r(485),o=r(700),a=r(658);class s extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=a.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:\"function\"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return\"function\"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:\"number\"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp(\"sideLength\",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeRecursive=void 0;const n=r(775);class i extends n.Shape{constructor(t){t.type=t.type||\"ShapeRecursive\",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return\"function\"!=typeof this.props.recursions&&\"function\"!=typeof this.props.recursionScale&&\"function\"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return\"function\"!=typeof this.props.recursions&&\"function\"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp(\"recursions\",e,1)),n=Math.floor(this.getProp(\"recursionVertex\",e,0)),o=this.getProp(\"recursionScale\",e,2),a=this.shape;let s={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const u={...e,recursion:s};a.generate(t,!1,u);const h=a.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=h);let c=h;const f=[s];let l=0,d=1;const p=c.length,M=p/2,g=n<=0?M:Math.min(n,M),v=0===n?1:M/Math.min(n,M),m=new Float32Array(i.summmation(r,g)*p);for(let t=0;t1?e/(r-1):1,h=i.summmation(e,g)*p,M=e-1,b=0===M?0:i.summmation(M,g)*p;for(let i=0,M=g**e;i1?i/(M-1):1,count:M,level:{index:e+1,offset:n,count:r},parent:f[l]},f.push(s),this.shapeUseRecursion&&(u.recursion=s,a.generate(t,!1,u),c=a.getBuffer());const y=h+i*p,x=Math.floor(b+2*i*v),S=m[x],P=m[x+1],w=o**e;for(let t=0,e=p;t1?0:1,count:o}}},u=this.shape.getIndexedBuffer()||[];for(let t=0,e=u.length;t1?0:1,count:o}},i={...s,recursion:r},a=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:a})}if(o>1){const t=this.shape.getBufferLength({...i,parent:{...s}})/2,e=a<=0?t:Math.min(a,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let h=0,c=1;for(let t=1;t1?t/(o-1):1;for(let a=0,f=e**t;a1?a/(f-1):1;for(let d=0,p=u.length;d{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Circle=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){t.type=\"Circle\",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=o},702:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Line=void 0;const n=r(658),i=r(425);class o extends i.ShapeBuffer{constructor(t={}){t.type=\"Line\",t.shape=o.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Lissajous=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){t.type=\"Lissajous\",t.loopDependencies=(t.loopDependencies||[]).concat([\"wx\",\"wy\",\"wz\"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp(\"wx\",t),r=this.getProp(\"wy\",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),o=this.getRepetitionSideLength(t);return 1/Math.pow(o[0]*o[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp(\"wx\",t,1),this.wy=this.getProp(\"wy\",t,2),this.wz=this.getProp(\"wz\",t,2),super.generateLoopBuffer(t)}}e.Lissajous=o},873:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Polygon=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){t.type=t.type||\"Polygon\",t.loopDependencies=(t.loopDependencies||[]).concat([\"sideNumber\"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp(\"sideNumber\",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=o},478:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Rect=void 0;const n=r(658),i=r(425);class o extends i.ShapeBuffer{constructor(t={}){t.type=\"Rect\",t.shape=o.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=o,o.buffer=[1,1,-1,1,-1,-1,1,-1]},710:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Rose=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){var e,r;t.type=\"Rose\",t.loopDependencies=(t.loopDependencies||[]).concat([\"n\",\"d\"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>o.getFinalAngleFromK(this.getProp(\"n\",t),this.getProp(\"d\",t)),inc:t=>{const e=this.getProp(\"n\",t),r=this.getProp(\"d\",t),i=this.getRepetitionSideLength(t),o=Math.pow(i[0]*i[1],.45),a=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp(\"n\",t)/this.getProp(\"d\",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=o},82:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Spiral=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type=\"Spiral\",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat([\"twists\",\"twistsStart\",\"spiral\"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:o.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp(\"twistsStart\",t),end:t=>n.PI2*(this.getProp(\"twistsStart\",t)+this.getProp(\"twists\",t)),inc:t=>{const e=this.getProp(\"twists\",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp(\"spiral\",t),this.r=o.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case o.types.ARCHIMEDE:return t=>t/10;case o.types.HYPERBOLIC:return t=>1/t*3;case o.types.FERMAT:return t=>t**.5/3;case o.types.LITUUS:return t=>t**-.5;case o.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=o,o.types={ARCHIMEDE:\"ARCHIMEDE\",HYPERBOLIC:\"HYPERBOLIC\",FERMAT:\"FERMAT\",LITUUS:\"LITUUS\",LOGARITHMIC:\"LOGARITHMIC\"}},490:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Star=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){t.type=t.type||\"Polygon\",t.loopDependencies=(t.loopDependencies||[]).concat([\"spikes\",\"innerRadius\"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp(\"spikes\",t,5),this.innerRadius=this.getProp(\"innerRadius\",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=o},845:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.SuperShape=void 0;const n=r(888),i=r(210);class o extends i.ShapeLoop{constructor(t={}){var e,r,i,o,a,s;t.type=\"SuperShape\",t.loopDependencies=(t.loopDependencies||[]).concat([\"a\",\"b\",\"m\",\"n1\",\"n2\",\"n3\"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(o=t.n1)&&void 0!==o?o:1,this.props.n2=null!==(a=t.n2)&&void 0!==a?a:1,this.props.n3=null!==(s=t.n3)&&void 0!==s?s:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp(\"a\",t),this.b=this.getProp(\"b\",t),this.m=this.getProp(\"m\",t),this.n1=this.getProp(\"n1\",t),this.n2=this.getProp(\"n2\",t),this.n3=this.getProp(\"n3\",t),super.generateLoopBuffer(t)}}e.SuperShape=o},123:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Triangle=void 0;const n=r(658),i=r(425);class o extends i.ShapeBuffer{constructor(t={}){t.type=\"Triangle\",t.shape=o.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=o,o.buffer=[1,0,-1,1,-1,-1]},46:function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(574),e),i(r(636),e),i(r(345),e),i(r(920),e),i(r(676),e),i(r(300),e),i(r(273),e),i(r(511),e)},574:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},636:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},345:(t,e)=>{\"use strict\";var r;Object.defineProperty(e,\"__esModule\",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]=\"Ring\",r[r.Matrix=2]=\"Matrix\"},920:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},676:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},300:(t,e)=>{\"use strict\";var r;Object.defineProperty(e,\"__esModule\",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]=\"Relative\",r[r.Fixed=2]=\"Fixed\"},273:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},511:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},887:(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>o,mat3:()=>a,mat4:()=>s,quat:()=>c,quat2:()=>f,vec2:()=>l,vec3:()=>u,vec4:()=>h});var n={};r.r(n),r.d(n,{ARRAY_TYPE:()=>p,EPSILON:()=>d,RANDOM:()=>M,equals:()=>b,setMatrixArrayType:()=>g,toRadian:()=>m});var i={};r.r(i),r.d(i,{LDU:()=>T,add:()=>D,adjoint:()=>O,clone:()=>x,copy:()=>S,create:()=>y,determinant:()=>A,equals:()=>z,exactEquals:()=>k,frob:()=>q,fromRotation:()=>F,fromScaling:()=>C,fromValues:()=>w,identity:()=>P,invert:()=>R,mul:()=>N,multiply:()=>L,multiplyScalar:()=>U,multiplyScalarAndAdd:()=>Y,rotate:()=>E,scale:()=>_,set:()=>B,str:()=>j,sub:()=>Z,subtract:()=>V,transpose:()=>I});var o={};r.r(o),r.d(o,{add:()=>ht,clone:()=>H,copy:()=>G,create:()=>X,determinant:()=>J,equals:()=>pt,exactEquals:()=>dt,frob:()=>ut,fromRotation:()=>it,fromScaling:()=>ot,fromTranslation:()=>at,fromValues:()=>K,identity:()=>Q,invert:()=>$,mul:()=>Mt,multiply:()=>tt,multiplyScalar:()=>ft,multiplyScalarAndAdd:()=>lt,rotate:()=>et,scale:()=>rt,set:()=>W,str:()=>st,sub:()=>gt,subtract:()=>ct,translate:()=>nt});var a={};r.r(a),r.d(a,{add:()=>zt,adjoint:()=>It,clone:()=>bt,copy:()=>yt,create:()=>vt,determinant:()=>Rt,equals:()=>Xt,exactEquals:()=>Zt,frob:()=>kt,fromMat2d:()=>jt,fromMat4:()=>mt,fromQuat:()=>qt,fromRotation:()=>Ft,fromScaling:()=>Ct,fromTranslation:()=>_t,fromValues:()=>xt,identity:()=>Pt,invert:()=>Bt,mul:()=>Ht,multiply:()=>Ot,multiplyScalar:()=>Yt,multiplyScalarAndAdd:()=>Nt,normalFromMat4:()=>Tt,projection:()=>Dt,rotate:()=>Lt,scale:()=>Et,set:()=>St,str:()=>Vt,sub:()=>Gt,subtract:()=>Ut,translate:()=>At,transpose:()=>wt});var s={};r.r(s),r.d(s,{add:()=>Ce,adjoint:()=>ne,clone:()=>Kt,copy:()=>Wt,create:()=>Qt,determinant:()=>ie,equals:()=>Ve,exactEquals:()=>De,frob:()=>Fe,fromQuat:()=>Be,fromQuat2:()=>be,fromRotation:()=>pe,fromRotationTranslation:()=>me,fromRotationTranslationScale:()=>Pe,fromRotationTranslationScaleOrigin:()=>we,fromScaling:()=>de,fromTranslation:()=>le,fromValues:()=>$t,fromXRotation:()=>Me,fromYRotation:()=>ge,fromZRotation:()=>ve,frustum:()=>Ie,getRotation:()=>Se,getScaling:()=>xe,getTranslation:()=>ye,identity:()=>te,invert:()=>re,lookAt:()=>Le,mul:()=>ke,multiply:()=>oe,multiplyScalar:()=>qe,multiplyScalarAndAdd:()=>Te,ortho:()=>Ae,perspective:()=>Re,perspectiveFromFieldOfView:()=>Oe,rotate:()=>ue,rotateX:()=>he,rotateY:()=>ce,rotateZ:()=>fe,scale:()=>se,set:()=>Jt,str:()=>_e,sub:()=>ze,subtract:()=>je,targetTo:()=>Ee,translate:()=>ae,transpose:()=>ee});var u={};r.r(u),r.d(u,{add:()=>Ge,angle:()=>Pr,bezier:()=>Mr,ceil:()=>$e,clone:()=>Ye,copy:()=>Xe,create:()=>Ue,cross:()=>lr,dist:()=>_r,distance:()=>or,div:()=>Er,divide:()=>We,dot:()=>fr,equals:()=>Rr,exactEquals:()=>Ir,floor:()=>Je,forEach:()=>qr,fromValues:()=>Ze,hermite:()=>pr,inverse:()=>hr,len:()=>Cr,length:()=>Ne,lerp:()=>dr,max:()=>er,min:()=>tr,mul:()=>Lr,multiply:()=>Ke,negate:()=>ur,normalize:()=>cr,random:()=>gr,rotateX:()=>yr,rotateY:()=>xr,rotateZ:()=>Sr,round:()=>rr,scale:()=>nr,scaleAndAdd:()=>ir,set:()=>He,sqrDist:()=>Fr,sqrLen:()=>jr,squaredDistance:()=>ar,squaredLength:()=>sr,str:()=>Br,sub:()=>Ar,subtract:()=>Qe,transformMat3:()=>mr,transformMat4:()=>vr,transformQuat:()=>br,zero:()=>wr});var h={};r.r(h),r.d(h,{add:()=>Ur,ceil:()=>Xr,clone:()=>Dr,copy:()=>kr,create:()=>Tr,cross:()=>un,dist:()=>yn,distance:()=>Jr,div:()=>bn,divide:()=>Zr,dot:()=>sn,equals:()=>gn,exactEquals:()=>Mn,floor:()=>Hr,forEach:()=>wn,fromValues:()=>Vr,inverse:()=>on,len:()=>Sn,length:()=>en,lerp:()=>hn,max:()=>Qr,min:()=>Gr,mul:()=>mn,multiply:()=>Nr,negate:()=>nn,normalize:()=>an,random:()=>cn,round:()=>Kr,scale:()=>Wr,scaleAndAdd:()=>$r,set:()=>zr,sqrDist:()=>xn,sqrLen:()=>Pn,squaredDistance:()=>tn,squaredLength:()=>rn,str:()=>pn,sub:()=>vn,subtract:()=>Yr,transformMat4:()=>fn,transformQuat:()=>ln,zero:()=>dn});var c={};r.r(c),r.d(c,{add:()=>ei,calculateW:()=>Cn,clone:()=>Wn,conjugate:()=>zn,copy:()=>Jn,create:()=>Bn,dot:()=>ii,equals:()=>li,exactEquals:()=>fi,exp:()=>jn,fromEuler:()=>Yn,fromMat3:()=>Un,fromValues:()=>$n,getAngle:()=>An,getAxisAngle:()=>On,identity:()=>In,invert:()=>kn,len:()=>si,length:()=>ai,lerp:()=>oi,ln:()=>qn,mul:()=>ri,multiply:()=>Ln,normalize:()=>ci,pow:()=>Tn,random:()=>Vn,rotateX:()=>En,rotateY:()=>_n,rotateZ:()=>Fn,rotationTo:()=>di,scale:()=>ni,set:()=>ti,setAxes:()=>Mi,setAxisAngle:()=>Rn,slerp:()=>Dn,sqlerp:()=>pi,sqrLen:()=>hi,squaredLength:()=>ui,str:()=>Nn});var f={};r.r(f),r.d(f,{add:()=>Vi,clone:()=>vi,conjugate:()=>Xi,copy:()=>wi,create:()=>gi,dot:()=>Yi,equals:()=>to,exactEquals:()=>Ji,fromMat4:()=>Pi,fromRotation:()=>Si,fromRotationTranslation:()=>yi,fromRotationTranslationValues:()=>bi,fromTranslation:()=>xi,fromValues:()=>mi,getDual:()=>Oi,getReal:()=>Ri,getTranslation:()=>Ei,identity:()=>Bi,invert:()=>Zi,len:()=>Gi,length:()=>Hi,lerp:()=>Ni,mul:()=>zi,multiply:()=>ki,normalize:()=>Wi,rotateAroundAxis:()=>Di,rotateByQuatAppend:()=>qi,rotateByQuatPrepend:()=>Ti,rotateX:()=>Fi,rotateY:()=>Ci,rotateZ:()=>ji,scale:()=>Ui,set:()=>Ii,setDual:()=>Li,setReal:()=>Ai,sqrLen:()=>Ki,squaredLength:()=>Qi,str:()=>$i,translate:()=>_i});var l={};r.r(l),r.d(l,{add:()=>ao,angle:()=>Co,ceil:()=>co,clone:()=>ro,copy:()=>io,create:()=>eo,cross:()=>Io,dist:()=>Yo,distance:()=>mo,div:()=>Uo,divide:()=>ho,dot:()=>Bo,equals:()=>Do,exactEquals:()=>To,floor:()=>fo,forEach:()=>Xo,fromValues:()=>no,inverse:()=>Po,len:()=>Vo,length:()=>yo,lerp:()=>Ro,max:()=>po,min:()=>lo,mul:()=>zo,multiply:()=>uo,negate:()=>So,normalize:()=>wo,random:()=>Oo,rotate:()=>Fo,round:()=>Mo,scale:()=>go,scaleAndAdd:()=>vo,set:()=>oo,sqrDist:()=>No,sqrLen:()=>Zo,squaredDistance:()=>bo,squaredLength:()=>xo,str:()=>qo,sub:()=>ko,subtract:()=>so,transformMat2:()=>Ao,transformMat2d:()=>Lo,transformMat3:()=>Eo,transformMat4:()=>_o,zero:()=>jo});var d=1e-6,p=\"undefined\"!=typeof Float32Array?Float32Array:Array,M=Math.random;function g(t){p=t}var v=Math.PI/180;function m(t){return t*v}function b(t,e){return Math.abs(t-e)<=d*Math.max(1,Math.abs(t),Math.abs(e))}function y(){var t=new p(4);return p!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function x(t){var e=new p(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function S(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function P(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function w(t,e,r,n){var i=new p(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function B(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function I(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function R(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*o-i*n;return a?(a=1/a,t[0]=o*a,t[1]=-n*a,t[2]=-i*a,t[3]=r*a,t):null}function O(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function A(t){return t[0]*t[3]-t[2]*t[1]}function L(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*s+o*u,t[1]=i*s+a*u,t[2]=n*h+o*c,t[3]=i*h+a*c,t}function E(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+o*s,t[1]=i*u+a*s,t[2]=n*-s+o*u,t[3]=i*-s+a*u,t}function _(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1];return t[0]=n*s,t[1]=i*s,t[2]=o*u,t[3]=a*u,t}function F(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function C(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function j(t){return\"mat2(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}function q(t){return Math.hypot(t[0],t[1],t[2],t[3])}function T(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function D(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function V(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function k(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function z(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],h=e[3];return Math.abs(r-a)<=d*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-h)<=d*Math.max(1,Math.abs(o),Math.abs(h))}function U(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Y(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var N=L,Z=V;function X(){var t=new p(6);return p!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function H(t){var e=new p(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function G(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Q(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function K(t,e,r,n,i,o){var a=new p(6);return a[0]=t,a[1]=e,a[2]=r,a[3]=n,a[4]=i,a[5]=o,a}function W(t,e,r,n,i,o,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t}function $(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=r*o-n*i;return u?(u=1/u,t[0]=o*u,t[1]=-n*u,t[2]=-i*u,t[3]=r*u,t[4]=(i*s-o*a)*u,t[5]=(n*a-r*s)*u,t):null}function J(t){return t[0]*t[3]-t[1]*t[2]}function tt(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=r[0],c=r[1],f=r[2],l=r[3],d=r[4],p=r[5];return t[0]=n*h+o*c,t[1]=i*h+a*c,t[2]=n*f+o*l,t[3]=i*f+a*l,t[4]=n*d+o*p+s,t[5]=i*d+a*p+u,t}function et(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=Math.sin(r),c=Math.cos(r);return t[0]=n*c+o*h,t[1]=i*c+a*h,t[2]=n*-h+o*c,t[3]=i*-h+a*c,t[4]=s,t[5]=u,t}function rt(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=r[0],c=r[1];return t[0]=n*h,t[1]=i*h,t[2]=o*c,t[3]=a*c,t[4]=s,t[5]=u,t}function nt(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=n*h+o*c+s,t[5]=i*h+a*c+u,t}function it(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function ot(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function at(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function st(t){return\"mat2d(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\")\"}function ut(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function ht(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function ct(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function ft(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function lt(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function dt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function pt(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=e[0],h=e[1],c=e[2],f=e[3],l=e[4],p=e[5];return Math.abs(r-u)<=d*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-h)<=d*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-c)<=d*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(o-f)<=d*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-l)<=d*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(s-p)<=d*Math.max(1,Math.abs(s),Math.abs(p))}var Mt=tt,gt=ct;function vt(){var t=new p(9);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function mt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function bt(t){var e=new p(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function xt(t,e,r,n,i,o,a,s,u){var h=new p(9);return h[0]=t,h[1]=e,h[2]=r,h[3]=n,h[4]=i,h[5]=o,h[6]=a,h[7]=s,h[8]=u,h}function St(t,e,r,n,i,o,a,s,u,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=h,t}function Pt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function wt(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function Bt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8],f=c*a-s*h,l=-c*o+s*u,d=h*o-a*u,p=r*f+n*l+i*d;return p?(p=1/p,t[0]=f*p,t[1]=(-c*n+i*h)*p,t[2]=(s*n-i*a)*p,t[3]=l*p,t[4]=(c*r-i*u)*p,t[5]=(-s*r+i*o)*p,t[6]=d*p,t[7]=(-h*r+n*u)*p,t[8]=(a*r-n*o)*p,t):null}function It(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8];return t[0]=a*c-s*h,t[1]=i*h-n*c,t[2]=n*s-i*a,t[3]=s*u-o*c,t[4]=r*c-i*u,t[5]=i*o-r*s,t[6]=o*h-a*u,t[7]=n*u-r*h,t[8]=r*a-n*o,t}function Rt(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],h=t[8];return e*(h*o-a*u)+r*(-h*i+a*s)+n*(u*i-o*s)}function Ot(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=r[0],d=r[1],p=r[2],M=r[3],g=r[4],v=r[5],m=r[6],b=r[7],y=r[8];return t[0]=l*n+d*a+p*h,t[1]=l*i+d*s+p*c,t[2]=l*o+d*u+p*f,t[3]=M*n+g*a+v*h,t[4]=M*i+g*s+v*c,t[5]=M*o+g*u+v*f,t[6]=m*n+b*a+y*h,t[7]=m*i+b*s+y*c,t[8]=m*o+b*u+y*f,t}function At(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=l*n+d*a+h,t[7]=l*i+d*s+c,t[8]=l*o+d*u+f,t}function Lt(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=Math.sin(r),d=Math.cos(r);return t[0]=d*n+l*a,t[1]=d*i+l*s,t[2]=d*o+l*u,t[3]=d*a-l*n,t[4]=d*s-l*i,t[5]=d*u-l*o,t[6]=h,t[7]=c,t[8]=f,t}function Et(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function _t(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function Ft(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Ct(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function jt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function qt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,h=r*a,c=n*a,f=n*s,l=i*a,d=i*s,p=i*u,M=o*a,g=o*s,v=o*u;return t[0]=1-f-p,t[3]=c-v,t[6]=l+g,t[1]=c+v,t[4]=1-h-p,t[7]=d-M,t[2]=l-g,t[5]=d+M,t[8]=1-h-f,t}function Tt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8],f=e[9],l=e[10],d=e[11],p=e[12],M=e[13],g=e[14],v=e[15],m=r*s-n*a,b=r*u-i*a,y=r*h-o*a,x=n*u-i*s,S=n*h-o*s,P=i*h-o*u,w=c*M-f*p,B=c*g-l*p,I=c*v-d*p,R=f*g-l*M,O=f*v-d*M,A=l*v-d*g,L=m*A-b*O+y*R+x*I-S*B+P*w;return L?(L=1/L,t[0]=(s*A-u*O+h*R)*L,t[1]=(u*I-a*A-h*B)*L,t[2]=(a*O-s*I+h*w)*L,t[3]=(i*O-n*A-o*R)*L,t[4]=(r*A-i*I+o*B)*L,t[5]=(n*I-r*O-o*w)*L,t[6]=(M*P-g*S+v*x)*L,t[7]=(g*y-p*P-v*b)*L,t[8]=(p*S-M*y+v*m)*L,t):null}function Dt(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function Vt(t){return\"mat3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\")\"}function kt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function zt(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function Ut(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function Yt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function Nt(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function Zt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function Xt(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],h=t[7],c=t[8],f=e[0],l=e[1],p=e[2],M=e[3],g=e[4],v=e[5],m=e[6],b=e[7],y=e[8];return Math.abs(r-f)<=d*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(n-l)<=d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-p)<=d*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(o-M)<=d*Math.max(1,Math.abs(o),Math.abs(M))&&Math.abs(a-g)<=d*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(s-v)<=d*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(u-m)<=d*Math.max(1,Math.abs(u),Math.abs(m))&&Math.abs(h-b)<=d*Math.max(1,Math.abs(h),Math.abs(b))&&Math.abs(c-y)<=d*Math.max(1,Math.abs(c),Math.abs(y))}var Ht=Ot,Gt=Ut;function Qt(){var t=new p(16);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Kt(t){var e=new p(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Wt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function $t(t,e,r,n,i,o,a,s,u,h,c,f,l,d,M,g){var v=new p(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=n,v[4]=i,v[5]=o,v[6]=a,v[7]=s,v[8]=u,v[9]=h,v[10]=c,v[11]=f,v[12]=l,v[13]=d,v[14]=M,v[15]=g,v}function Jt(t,e,r,n,i,o,a,s,u,h,c,f,l,d,p,M,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=h,t[9]=c,t[10]=f,t[11]=l,t[12]=d,t[13]=p,t[14]=M,t[15]=g,t}function te(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ee(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function re(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8],f=e[9],l=e[10],d=e[11],p=e[12],M=e[13],g=e[14],v=e[15],m=r*s-n*a,b=r*u-i*a,y=r*h-o*a,x=n*u-i*s,S=n*h-o*s,P=i*h-o*u,w=c*M-f*p,B=c*g-l*p,I=c*v-d*p,R=f*g-l*M,O=f*v-d*M,A=l*v-d*g,L=m*A-b*O+y*R+x*I-S*B+P*w;return L?(L=1/L,t[0]=(s*A-u*O+h*R)*L,t[1]=(i*O-n*A-o*R)*L,t[2]=(M*P-g*S+v*x)*L,t[3]=(l*S-f*P-d*x)*L,t[4]=(u*I-a*A-h*B)*L,t[5]=(r*A-i*I+o*B)*L,t[6]=(g*y-p*P-v*b)*L,t[7]=(c*P-l*y+d*b)*L,t[8]=(a*O-s*I+h*w)*L,t[9]=(n*I-r*O-o*w)*L,t[10]=(p*S-M*y+v*m)*L,t[11]=(f*y-c*S-d*m)*L,t[12]=(s*B-a*R-u*w)*L,t[13]=(r*R-n*B+i*w)*L,t[14]=(M*b-p*x-g*m)*L,t[15]=(c*x-f*b+l*m)*L,t):null}function ne(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8],f=e[9],l=e[10],d=e[11],p=e[12],M=e[13],g=e[14],v=e[15];return t[0]=s*(l*v-d*g)-f*(u*v-h*g)+M*(u*d-h*l),t[1]=-(n*(l*v-d*g)-f*(i*v-o*g)+M*(i*d-o*l)),t[2]=n*(u*v-h*g)-s*(i*v-o*g)+M*(i*h-o*u),t[3]=-(n*(u*d-h*l)-s*(i*d-o*l)+f*(i*h-o*u)),t[4]=-(a*(l*v-d*g)-c*(u*v-h*g)+p*(u*d-h*l)),t[5]=r*(l*v-d*g)-c*(i*v-o*g)+p*(i*d-o*l),t[6]=-(r*(u*v-h*g)-a*(i*v-o*g)+p*(i*h-o*u)),t[7]=r*(u*d-h*l)-a*(i*d-o*l)+c*(i*h-o*u),t[8]=a*(f*v-d*M)-c*(s*v-h*M)+p*(s*d-h*f),t[9]=-(r*(f*v-d*M)-c*(n*v-o*M)+p*(n*d-o*f)),t[10]=r*(s*v-h*M)-a*(n*v-o*M)+p*(n*h-o*s),t[11]=-(r*(s*d-h*f)-a*(n*d-o*f)+c*(n*h-o*s)),t[12]=-(a*(f*g-l*M)-c*(s*g-u*M)+p*(s*l-u*f)),t[13]=r*(f*g-l*M)-c*(n*g-i*M)+p*(n*l-i*f),t[14]=-(r*(s*g-u*M)-a*(n*g-i*M)+p*(n*u-i*s)),t[15]=r*(s*l-u*f)-a*(n*l-i*f)+c*(n*u-i*s),t}function ie(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],h=t[8],c=t[9],f=t[10],l=t[11],d=t[12],p=t[13],M=t[14],g=t[15];return(e*a-r*o)*(f*g-l*M)-(e*s-n*o)*(c*g-l*p)+(e*u-i*o)*(c*M-f*p)+(r*s-n*a)*(h*g-l*d)-(r*u-i*a)*(h*M-f*d)+(n*u-i*s)*(h*p-c*d)}function oe(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=e[9],d=e[10],p=e[11],M=e[12],g=e[13],v=e[14],m=e[15],b=r[0],y=r[1],x=r[2],S=r[3];return t[0]=b*n+y*s+x*f+S*M,t[1]=b*i+y*u+x*l+S*g,t[2]=b*o+y*h+x*d+S*v,t[3]=b*a+y*c+x*p+S*m,b=r[4],y=r[5],x=r[6],S=r[7],t[4]=b*n+y*s+x*f+S*M,t[5]=b*i+y*u+x*l+S*g,t[6]=b*o+y*h+x*d+S*v,t[7]=b*a+y*c+x*p+S*m,b=r[8],y=r[9],x=r[10],S=r[11],t[8]=b*n+y*s+x*f+S*M,t[9]=b*i+y*u+x*l+S*g,t[10]=b*o+y*h+x*d+S*v,t[11]=b*a+y*c+x*p+S*m,b=r[12],y=r[13],x=r[14],S=r[15],t[12]=b*n+y*s+x*f+S*M,t[13]=b*i+y*u+x*l+S*g,t[14]=b*o+y*h+x*d+S*v,t[15]=b*a+y*c+x*p+S*m,t}function ae(t,e,r){var n,i,o,a,s,u,h,c,f,l,d,p,M=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*M+e[4]*g+e[8]*v+e[12],t[13]=e[1]*M+e[5]*g+e[9]*v+e[13],t[14]=e[2]*M+e[6]*g+e[10]*v+e[14],t[15]=e[3]*M+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=h,t[7]=c,t[8]=f,t[9]=l,t[10]=d,t[11]=p,t[12]=n*M+s*g+f*v+e[12],t[13]=i*M+u*g+l*v+e[13],t[14]=o*M+h*g+d*v+e[14],t[15]=a*M+c*g+p*v+e[15]),t}function se(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ue(t,e,r,n){var i,o,a,s,u,h,c,f,l,p,M,g,v,m,b,y,x,S,P,w,B,I,R,O,A=n[0],L=n[1],E=n[2],_=Math.hypot(A,L,E);return _0?(r[0]=2*(s*a+c*n+u*o-h*i)/f,r[1]=2*(u*a+c*i+h*n-s*o)/f,r[2]=2*(h*a+c*o+s*i-u*n)/f):(r[0]=2*(s*a+c*n+u*o-h*i),r[1]=2*(u*a+c*i+h*n-s*o),r[2]=2*(h*a+c*o+s*i-u*n)),me(t,e,r),t}function ye(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function xe(t,e){var r=e[0],n=e[1],i=e[2],o=e[4],a=e[5],s=e[6],u=e[8],h=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,h,c),t}function Se(t,e){var r=new p(3);xe(r,e);var n=1/r[0],i=1/r[1],o=1/r[2],a=e[0]*n,s=e[1]*i,u=e[2]*o,h=e[4]*n,c=e[5]*i,f=e[6]*o,l=e[8]*n,d=e[9]*i,M=e[10]*o,g=a+c+M,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(f-d)/v,t[1]=(l-u)/v,t[2]=(s-h)/v):a>c&&a>M?(v=2*Math.sqrt(1+a-c-M),t[3]=(f-d)/v,t[0]=.25*v,t[1]=(s+h)/v,t[2]=(l+u)/v):c>M?(v=2*Math.sqrt(1+c-a-M),t[3]=(l-u)/v,t[0]=(s+h)/v,t[1]=.25*v,t[2]=(f+d)/v):(v=2*Math.sqrt(1+M-a-c),t[3]=(s-h)/v,t[0]=(l+u)/v,t[1]=(f+d)/v,t[2]=.25*v),t}function Pe(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,h=o+o,c=a+a,f=i*u,l=i*h,d=i*c,p=o*h,M=o*c,g=a*c,v=s*u,m=s*h,b=s*c,y=n[0],x=n[1],S=n[2];return t[0]=(1-(p+g))*y,t[1]=(l+b)*y,t[2]=(d-m)*y,t[3]=0,t[4]=(l-b)*x,t[5]=(1-(f+g))*x,t[6]=(M+v)*x,t[7]=0,t[8]=(d+m)*S,t[9]=(M-v)*S,t[10]=(1-(f+p))*S,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function we(t,e,r,n,i){var o=e[0],a=e[1],s=e[2],u=e[3],h=o+o,c=a+a,f=s+s,l=o*h,d=o*c,p=o*f,M=a*c,g=a*f,v=s*f,m=u*h,b=u*c,y=u*f,x=n[0],S=n[1],P=n[2],w=i[0],B=i[1],I=i[2],R=(1-(M+v))*x,O=(d+y)*x,A=(p-b)*x,L=(d-y)*S,E=(1-(l+v))*S,_=(g+m)*S,F=(p+b)*P,C=(g-m)*P,j=(1-(l+M))*P;return t[0]=R,t[1]=O,t[2]=A,t[3]=0,t[4]=L,t[5]=E,t[6]=_,t[7]=0,t[8]=F,t[9]=C,t[10]=j,t[11]=0,t[12]=r[0]+w-(R*w+L*B+F*I),t[13]=r[1]+B-(O*w+E*B+C*I),t[14]=r[2]+I-(A*w+_*B+j*I),t[15]=1,t}function Be(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,h=r*a,c=n*a,f=n*s,l=i*a,d=i*s,p=i*u,M=o*a,g=o*s,v=o*u;return t[0]=1-f-p,t[1]=c+v,t[2]=l-g,t[3]=0,t[4]=c-v,t[5]=1-h-p,t[6]=d+M,t[7]=0,t[8]=l+g,t[9]=d-M,t[10]=1-h-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ie(t,e,r,n,i,o,a){var s=1/(r-e),u=1/(i-n),h=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*u,t[10]=(a+o)*h,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*h,t[15]=0,t}function Re(t,e,r,n,i){var o,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(n-i),t[10]=(i+n)*o,t[14]=2*i*n*o):(t[10]=-1,t[14]=-2*n),t}function Oe(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),h=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=h,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*h*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function Ae(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),h=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*h,t[15]=1,t}function Le(t,e,r,n){var i,o,a,s,u,h,c,f,l,p,M=e[0],g=e[1],v=e[2],m=n[0],b=n[1],y=n[2],x=r[0],S=r[1],P=r[2];return Math.abs(M-x)0&&(c*=d=1/Math.sqrt(d),f*=d,l*=d);var p=u*l-h*f,M=h*c-s*l,g=s*f-u*c;return(d=p*p+M*M+g*g)>0&&(p*=d=1/Math.sqrt(d),M*=d,g*=d),t[0]=p,t[1]=M,t[2]=g,t[3]=0,t[4]=f*g-l*M,t[5]=l*p-c*g,t[6]=c*M-f*p,t[7]=0,t[8]=c,t[9]=f,t[10]=l,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function _e(t){return\"mat4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\", \"+t[9]+\", \"+t[10]+\", \"+t[11]+\", \"+t[12]+\", \"+t[13]+\", \"+t[14]+\", \"+t[15]+\")\"}function Fe(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Ce(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function je(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function qe(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function Te(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function De(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function Ve(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],h=t[7],c=t[8],f=t[9],l=t[10],p=t[11],M=t[12],g=t[13],v=t[14],m=t[15],b=e[0],y=e[1],x=e[2],S=e[3],P=e[4],w=e[5],B=e[6],I=e[7],R=e[8],O=e[9],A=e[10],L=e[11],E=e[12],_=e[13],F=e[14],C=e[15];return Math.abs(r-b)<=d*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-y)<=d*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-x)<=d*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-S)<=d*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(a-P)<=d*Math.max(1,Math.abs(a),Math.abs(P))&&Math.abs(s-w)<=d*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(u-B)<=d*Math.max(1,Math.abs(u),Math.abs(B))&&Math.abs(h-I)<=d*Math.max(1,Math.abs(h),Math.abs(I))&&Math.abs(c-R)<=d*Math.max(1,Math.abs(c),Math.abs(R))&&Math.abs(f-O)<=d*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(l-A)<=d*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(p-L)<=d*Math.max(1,Math.abs(p),Math.abs(L))&&Math.abs(M-E)<=d*Math.max(1,Math.abs(M),Math.abs(E))&&Math.abs(g-_)<=d*Math.max(1,Math.abs(g),Math.abs(_))&&Math.abs(v-F)<=d*Math.max(1,Math.abs(v),Math.abs(F))&&Math.abs(m-C)<=d*Math.max(1,Math.abs(m),Math.abs(C))}var ke=oe,ze=je;function Ue(){var t=new p(3);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ye(t){var e=new p(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Ne(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function Ze(t,e,r){var n=new p(3);return n[0]=t,n[1]=e,n[2]=r,n}function Xe(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function He(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function Ge(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function Qe(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function Ke(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function We(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function $e(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Je(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function tr(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function er(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function rr(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function nr(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function ir(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function or(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function ar(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function sr(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function ur(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function hr(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function cr(t,e){var r=e[0],n=e[1],i=e[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function fr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function lr(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2];return t[0]=i*u-o*s,t[1]=o*a-n*u,t[2]=n*s-i*a,t}function dr(t,e,r,n){var i=e[0],o=e[1],a=e[2];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t}function pr(t,e,r,n,i,o){var a=o*o,s=a*(2*o-3)+1,u=a*(o-2)+o,h=a*(o-1),c=a*(3-2*o);return t[0]=e[0]*s+r[0]*u+n[0]*h+i[0]*c,t[1]=e[1]*s+r[1]*u+n[1]*h+i[1]*c,t[2]=e[2]*s+r[2]*u+n[2]*h+i[2]*c,t}function Mr(t,e,r,n,i,o){var a=1-o,s=a*a,u=o*o,h=s*a,c=3*o*s,f=3*u*a,l=u*o;return t[0]=e[0]*h+r[0]*c+n[0]*f+i[0]*l,t[1]=e[1]*h+r[1]*c+n[1]*f+i[1]*l,t[2]=e[2]*h+r[2]*c+n[2]*f+i[2]*l,t}function gr(t,e){e=e||1;var r=2*M()*Math.PI,n=2*M()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}function vr(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return a=a||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/a,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,t}function mr(t,e,r){var n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}function br(t,e,r){var n=r[0],i=r[1],o=r[2],a=r[3],s=e[0],u=e[1],h=e[2],c=i*h-o*u,f=o*s-n*h,l=n*u-i*s,d=i*l-o*f,p=o*c-n*l,M=n*f-i*c,g=2*a;return c*=g,f*=g,l*=g,d*=2,p*=2,M*=2,t[0]=s+c+d,t[1]=u+f+p,t[2]=h+l+M,t}function yr(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function xr(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function Sr(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function Pr(t,e){var r=t[0],n=t[1],i=t[2],o=e[0],a=e[1],s=e[2],u=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(o*o+a*a+s*s),h=u&&fr(t,e)/u;return Math.acos(Math.min(Math.max(h,-1),1))}function wr(t){return t[0]=0,t[1]=0,t[2]=0,t}function Br(t){return\"vec3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\")\"}function Ir(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Rr(t,e){var r=t[0],n=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-s)<=d*Math.max(1,Math.abs(i),Math.abs(s))}var Or,Ar=Qe,Lr=Ke,Er=We,_r=or,Fr=ar,Cr=Ne,jr=sr,qr=(Or=Ue(),function(t,e,r,n,i,o){var a,s;for(e||(e=3),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,a=r;a0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=o*a,t}function sn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function un(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],o=r[0]*n[2]-r[2]*n[0],a=r[0]*n[3]-r[3]*n[0],s=r[1]*n[2]-r[2]*n[1],u=r[1]*n[3]-r[3]*n[1],h=r[2]*n[3]-r[3]*n[2],c=e[0],f=e[1],l=e[2],d=e[3];return t[0]=f*h-l*u+d*s,t[1]=-c*h+l*a-d*o,t[2]=c*u-f*a+d*i,t[3]=-c*s+f*o-l*i,t}function hn(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t[3]=s+n*(r[3]-s),t}function cn(t,e){var r,n,i,o,a,s;e=e||1;do{a=(r=2*M()-1)*r+(n=2*M()-1)*n}while(a>=1);do{s=(i=2*M()-1)*i+(o=2*M()-1)*o}while(s>=1);var u=Math.sqrt((1-a)/s);return t[0]=e*r,t[1]=e*n,t[2]=e*i*u,t[3]=e*o*u,t}function fn(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}function ln(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2],h=r[3],c=h*n+s*o-u*i,f=h*i+u*n-a*o,l=h*o+a*i-s*n,d=-a*n-s*i-u*o;return t[0]=c*h+d*-a+f*-u-l*-s,t[1]=f*h+d*-s+l*-a-c*-u,t[2]=l*h+d*-u+c*-s-f*-a,t[3]=e[3],t}function dn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function pn(t){return\"vec4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}function Mn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function gn(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],h=e[3];return Math.abs(r-a)<=d*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-h)<=d*Math.max(1,Math.abs(o),Math.abs(h))}var vn=Yr,mn=Nr,bn=Zr,yn=Jr,xn=tn,Sn=en,Pn=rn,wn=function(){var t=Tr();return function(e,r,n,i,o,a){var s,u;for(r||(r=4),n||(n=0),u=i?Math.min(i*r+n,e.length):e.length,s=n;sd?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r}function An(t,e){var r=ii(t,e);return Math.acos(2*r*r-1)}function Ln(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*c+a*s+i*h-o*u,t[1]=i*c+a*u+o*s-n*h,t[2]=o*c+a*h+n*u-i*s,t[3]=a*c-n*s-i*u-o*h,t}function En(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+a*s,t[1]=i*u+o*s,t[2]=o*u-i*s,t[3]=a*u-n*s,t}function _n(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u-o*s,t[1]=i*u+a*s,t[2]=o*u+n*s,t[3]=a*u-i*s,t}function Fn(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+i*s,t[1]=i*u-n*s,t[2]=o*u+a*s,t[3]=a*u-o*s,t}function Cn(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function jn(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=Math.sqrt(r*r+n*n+i*i),s=Math.exp(o),u=a>0?s*Math.sin(a)/a:0;return t[0]=r*u,t[1]=n*u,t[2]=i*u,t[3]=s*Math.cos(a),t}function qn(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=Math.sqrt(r*r+n*n+i*i),s=a>0?Math.atan2(a,o)/a:0;return t[0]=r*s,t[1]=n*s,t[2]=i*s,t[3]=.5*Math.log(r*r+n*n+i*i+o*o),t}function Tn(t,e,r){return qn(t,e),ni(t,t,r),jn(t,t),t}function Dn(t,e,r,n){var i,o,a,s,u,h=e[0],c=e[1],f=e[2],l=e[3],p=r[0],M=r[1],g=r[2],v=r[3];return(o=h*p+c*M+f*g+l*v)<0&&(o=-o,p=-p,M=-M,g=-g,v=-v),1-o>d?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-n)*i)/a,u=Math.sin(n*i)/a):(s=1-n,u=n),t[0]=s*h+u*p,t[1]=s*c+u*M,t[2]=s*f+u*g,t[3]=s*l+u*v,t}function Vn(t){var e=M(),r=M(),n=M(),i=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*r),t[1]=i*Math.cos(2*Math.PI*r),t[2]=o*Math.sin(2*Math.PI*n),t[3]=o*Math.cos(2*Math.PI*n),t}function kn(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o,s=a?1/a:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=o*s,t}function zn(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Un(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*o+a]-e[3*a+o])*r,t[o]=(e[3*o+i]+e[3*i+o])*r,t[a]=(e[3*a+i]+e[3*i+a])*r}return t}function Yn(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(r),u=Math.cos(r),h=Math.sin(n),c=Math.cos(n);return t[0]=o*u*c-a*s*h,t[1]=a*s*c+o*u*h,t[2]=a*u*h-o*s*c,t[3]=a*u*c+o*s*h,t}function Nn(t){return\"quat(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}var Zn,Xn,Hn,Gn,Qn,Kn,Wn=Dr,$n=Vr,Jn=kr,ti=zr,ei=Ur,ri=Ln,ni=Wr,ii=sn,oi=hn,ai=en,si=ai,ui=rn,hi=ui,ci=an,fi=Mn,li=gn,di=(Zn=Ue(),Xn=Ze(1,0,0),Hn=Ze(0,1,0),function(t,e,r){var n=fr(e,r);return n<-.999999?(lr(Zn,Xn,e),Cr(Zn)<1e-6&&lr(Zn,Hn,e),cr(Zn,Zn),Rn(t,Zn,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(lr(Zn,e,r),t[0]=Zn[0],t[1]=Zn[1],t[2]=Zn[2],t[3]=1+n,ci(t,t))}),pi=(Gn=Bn(),Qn=Bn(),function(t,e,r,n,i,o){return Dn(Gn,e,i,o),Dn(Qn,r,n,o),Dn(t,Gn,Qn,2*o*(1-o)),t}),Mi=(Kn=vt(),function(t,e,r,n){return Kn[0]=r[0],Kn[3]=r[1],Kn[6]=r[2],Kn[1]=n[0],Kn[4]=n[1],Kn[7]=n[2],Kn[2]=-e[0],Kn[5]=-e[1],Kn[8]=-e[2],ci(t,Un(t,Kn))});function gi(){var t=new p(8);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function vi(t){var e=new p(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function mi(t,e,r,n,i,o,a,s){var u=new p(8);return u[0]=t,u[1]=e,u[2]=r,u[3]=n,u[4]=i,u[5]=o,u[6]=a,u[7]=s,u}function bi(t,e,r,n,i,o,a){var s=new p(8);s[0]=t,s[1]=e,s[2]=r,s[3]=n;var u=.5*i,h=.5*o,c=.5*a;return s[4]=u*n+h*r-c*e,s[5]=h*n+c*t-u*r,s[6]=c*n+u*e-h*t,s[7]=-u*t-h*e-c*r,s}function yi(t,e,r){var n=.5*r[0],i=.5*r[1],o=.5*r[2],a=e[0],s=e[1],u=e[2],h=e[3];return t[0]=a,t[1]=s,t[2]=u,t[3]=h,t[4]=n*h+i*u-o*s,t[5]=i*h+o*a-n*u,t[6]=o*h+n*s-i*a,t[7]=-n*a-i*s-o*u,t}function xi(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function Si(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Pi(t,e){var r=Bn();Se(r,e);var n=new p(3);return ye(n,e),yi(t,r,n),t}function wi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function Bi(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Ii(t,e,r,n,i,o,a,s,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t}var Ri=Jn;function Oi(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var Ai=Jn;function Li(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function Ei(t,e){var r=e[4],n=e[5],i=e[6],o=e[7],a=-e[0],s=-e[1],u=-e[2],h=e[3];return t[0]=2*(r*h+o*a+n*u-i*s),t[1]=2*(n*h+o*s+i*a-r*u),t[2]=2*(i*h+o*u+r*s-n*a),t}function _i(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=.5*r[0],u=.5*r[1],h=.5*r[2],c=e[4],f=e[5],l=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=a*s+i*h-o*u+c,t[5]=a*u+o*s-n*h+f,t[6]=a*h+n*u-i*s+l,t[7]=-n*s-i*u-o*h+d,t}function Fi(t,e,r){var n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=s*a+c*n+u*o-h*i,l=u*a+c*i+h*n-s*o,d=h*a+c*o+s*i-u*n,p=c*a-s*n-u*i-h*o;return En(t,e,r),n=t[0],i=t[1],o=t[2],a=t[3],t[4]=f*a+p*n+l*o-d*i,t[5]=l*a+p*i+d*n-f*o,t[6]=d*a+p*o+f*i-l*n,t[7]=p*a-f*n-l*i-d*o,t}function Ci(t,e,r){var n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=s*a+c*n+u*o-h*i,l=u*a+c*i+h*n-s*o,d=h*a+c*o+s*i-u*n,p=c*a-s*n-u*i-h*o;return _n(t,e,r),n=t[0],i=t[1],o=t[2],a=t[3],t[4]=f*a+p*n+l*o-d*i,t[5]=l*a+p*i+d*n-f*o,t[6]=d*a+p*o+f*i-l*n,t[7]=p*a-f*n-l*i-d*o,t}function ji(t,e,r){var n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],f=s*a+c*n+u*o-h*i,l=u*a+c*i+h*n-s*o,d=h*a+c*o+s*i-u*n,p=c*a-s*n-u*i-h*o;return Fn(t,e,r),n=t[0],i=t[1],o=t[2],a=t[3],t[4]=f*a+p*n+l*o-d*i,t[5]=l*a+p*i+d*n-f*o,t[6]=d*a+p*o+f*i-l*n,t[7]=p*a-f*n-l*i-d*o,t}function qi(t,e,r){var n=r[0],i=r[1],o=r[2],a=r[3],s=e[0],u=e[1],h=e[2],c=e[3];return t[0]=s*a+c*n+u*o-h*i,t[1]=u*a+c*i+h*n-s*o,t[2]=h*a+c*o+s*i-u*n,t[3]=c*a-s*n-u*i-h*o,s=e[4],u=e[5],h=e[6],c=e[7],t[4]=s*a+c*n+u*o-h*i,t[5]=u*a+c*i+h*n-s*o,t[6]=h*a+c*o+s*i-u*n,t[7]=c*a-s*n-u*i-h*o,t}function Ti(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*c+a*s+i*h-o*u,t[1]=i*c+a*u+o*s-n*h,t[2]=o*c+a*h+n*u-i*s,t[3]=a*c-n*s-i*u-o*h,s=r[4],u=r[5],h=r[6],c=r[7],t[4]=n*c+a*s+i*h-o*u,t[5]=i*c+a*u+o*s-n*h,t[6]=o*c+a*h+n*u-i*s,t[7]=a*c-n*s-i*u-o*h,t}function Di(t,e,r,n){if(Math.abs(n)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,o=e[2]/r,a=e[3]/r,s=e[4],u=e[5],h=e[6],c=e[7],f=n*s+i*u+o*h+a*c;t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=(s-n*f)/r,t[5]=(u-i*f)/r,t[6]=(h-o*f)/r,t[7]=(c-a*f)/r}return t}function $i(t){return\"quat2(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\")\"}function Ji(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function to(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],h=t[7],c=e[0],f=e[1],l=e[2],p=e[3],M=e[4],g=e[5],v=e[6],m=e[7];return Math.abs(r-c)<=d*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(n-f)<=d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-l)<=d*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(o-p)<=d*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-M)<=d*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(s-g)<=d*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(u-v)<=d*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(h-m)<=d*Math.max(1,Math.abs(h),Math.abs(m))}function eo(){var t=new p(2);return p!=Float32Array&&(t[0]=0,t[1]=0),t}function ro(t){var e=new p(2);return e[0]=t[0],e[1]=t[1],e}function no(t,e){var r=new p(2);return r[0]=t,r[1]=e,r}function io(t,e){return t[0]=e[0],t[1]=e[1],t}function oo(t,e,r){return t[0]=e,t[1]=r,t}function ao(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function so(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function uo(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function ho(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function co(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function fo(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function lo(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function po(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function Mo(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function go(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function vo(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function mo(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function bo(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function yo(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function xo(t){var e=t[0],r=t[1];return e*e+r*r}function So(t,e){return t[0]=-e[0],t[1]=-e[1],t}function Po(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function wo(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function Bo(t,e){return t[0]*e[0]+t[1]*e[1]}function Io(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function Ro(t,e,r,n){var i=e[0],o=e[1];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t}function Oo(t,e){e=e||1;var r=2*M()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function Ao(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function Lo(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function Eo(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function _o(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function Fo(t,e,r,n){var i=e[0]-r[0],o=e[1]-r[1],a=Math.sin(n),s=Math.cos(n);return t[0]=i*s-o*a+r[0],t[1]=i*a+o*s+r[1],t}function Co(t,e){var r=t[0],n=t[1],i=e[0],o=e[1],a=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+o*o),s=a&&(r*i+n*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function jo(t){return t[0]=0,t[1]=0,t}function qo(t){return\"vec2(\"+t[0]+\", \"+t[1]+\")\"}function To(t,e){return t[0]===e[0]&&t[1]===e[1]}function Do(t,e){var r=t[0],n=t[1],i=e[0],o=e[1];return Math.abs(r-i)<=d*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-o)<=d*Math.max(1,Math.abs(n),Math.abs(o))}var Vo=yo,ko=so,zo=uo,Uo=ho,Yo=mo,No=bo,Zo=xo,Xo=function(){var t=eo();return function(e,r,n,i,o,a){var s,u;for(r||(r=2),n||(n=0),u=i?Math.min(i*r+n,e.length):e.length,s=n;s{var n;!function(){\"use strict\";var i=.5*(Math.sqrt(3)-1),o=(3-Math.sqrt(3))/6,a=1/6,s=(Math.sqrt(5)-1)/4,u=(5-Math.sqrt(5))/20;function h(t){var e;e=\"function\"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=f();t=i(\" \"),e=i(\" \"),r=i(\" \");for(var o=0;o>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}h.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,a=this.permMod12,s=this.perm,u=this.grad3,h=0,c=0,f=0,l=(t+e)*i,d=Math.floor(t+l),p=Math.floor(e+l),M=(d+p)*o,g=t-(d-M),v=e-(p-M);g>v?(r=1,n=0):(r=0,n=1);var m=g-r+o,b=v-n+o,y=g-1+2*o,x=v-1+2*o,S=255&d,P=255&p,w=.5-g*g-v*v;if(w>=0){var B=3*a[S+s[P]];h=(w*=w)*w*(u[B]*g+u[B+1]*v)}var I=.5-m*m-b*b;if(I>=0){var R=3*a[S+r+s[P+n]];c=(I*=I)*I*(u[R]*m+u[R+1]*b)}var O=.5-y*y-x*x;if(O>=0){var A=3*a[S+1+s[P+1]];f=(O*=O)*O*(u[A]*y+u[A+1]*x)}return 70*(h+c+f)},noise3D:function(t,e,r){var n,i,o,s,u,h,c,f,l,d,p=this.permMod12,M=this.perm,g=this.grad3,v=.3333333333333333*(t+e+r),m=Math.floor(t+v),b=Math.floor(e+v),y=Math.floor(r+v),x=(m+b+y)*a,S=t-(m-x),P=e-(b-x),w=r-(y-x);S>=P?P>=w?(u=1,h=0,c=0,f=1,l=1,d=0):S>=w?(u=1,h=0,c=0,f=1,l=0,d=1):(u=0,h=0,c=1,f=1,l=0,d=1):P_?j++:q++,E>F?j++:T++,E>C?j++:D++,_>F?q++:T++,_>C?q++:D++,F>C?T++:D++;var V=E-(f=j>=3?1:0)+u,k=_-(l=q>=3?1:0)+u,z=F-(d=T>=3?1:0)+u,U=C-(p=D>=3?1:0)+u,Y=E-(M=j>=2?1:0)+2*u,N=_-(g=q>=2?1:0)+2*u,Z=F-(v=T>=2?1:0)+2*u,X=C-(m=D>=2?1:0)+2*u,H=E-(b=j>=1?1:0)+3*u,G=_-(y=q>=1?1:0)+3*u,Q=F-(x=T>=1?1:0)+3*u,K=C-(S=D>=1?1:0)+3*u,W=E-1+4*u,$=_-1+4*u,J=F-1+4*u,tt=C-1+4*u,et=255&I,rt=255&R,nt=255&O,it=255&A,ot=.6-E*E-_*_-F*F-C*C;if(ot<0)i=0;else{var at=P[et+P[rt+P[nt+P[it]]]]%32*4;i=(ot*=ot)*ot*(w[at]*E+w[at+1]*_+w[at+2]*F+w[at+3]*C)}var st=.6-V*V-k*k-z*z-U*U;if(st<0)o=0;else{var ut=P[et+f+P[rt+l+P[nt+d+P[it+p]]]]%32*4;o=(st*=st)*st*(w[ut]*V+w[ut+1]*k+w[ut+2]*z+w[ut+3]*U)}var ht=.6-Y*Y-N*N-Z*Z-X*X;if(ht<0)a=0;else{var ct=P[et+M+P[rt+g+P[nt+v+P[it+m]]]]%32*4;a=(ht*=ht)*ht*(w[ct]*Y+w[ct+1]*N+w[ct+2]*Z+w[ct+3]*X)}var ft=.6-H*H-G*G-Q*Q-K*K;if(ft<0)h=0;else{var lt=P[et+b+P[rt+y+P[nt+x+P[it+S]]]]%32*4;h=(ft*=ft)*ft*(w[lt]*H+w[lt+1]*G+w[lt+2]*Q+w[lt+3]*K)}var dt=.6-W*W-$*$-J*J-tt*tt;if(dt<0)c=0;else{var pt=P[et+1+P[rt+1+P[nt+1+P[it+1]]]]%32*4;c=(dt*=dt)*dt*(w[pt]*W+w[pt+1]*$+w[pt+2]*J+w[pt+3]*tt)}return 27*(i+o+a+h+c)}},h._buildPermutationTable=c,void 0===(n=function(){return h}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=h,t.exports=h}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r(915)})()}));","/*\n (c) 2017, Vladimir Agafonkin\n Simplify.js, a high-performance JS polyline simplification library\n mourner.github.io/simplify-js\n*/\n\n(function () { 'use strict';\n\n// to suit your point format, run search/replace for '.x' and '.y';\n// for 3D version, see 3d branch (configurability would draw significant performance overhead)\n\n// square distance between 2 points\nfunction getSqDist(p1, p2) {\n\n var dx = p1.x - p2.x,\n dy = p1.y - p2.y;\n\n return dx * dx + dy * dy;\n}\n\n// square distance from a point to a segment\nfunction getSqSegDist(p, p1, p2) {\n\n var x = p1.x,\n y = p1.y,\n dx = p2.x - x,\n dy = p2.y - y;\n\n if (dx !== 0 || dy !== 0) {\n\n var t = ((p.x - x) * dx + (p.y - y) * dy) / (dx * dx + dy * dy);\n\n if (t > 1) {\n x = p2.x;\n y = p2.y;\n\n } else if (t > 0) {\n x += dx * t;\n y += dy * t;\n }\n }\n\n dx = p.x - x;\n dy = p.y - y;\n\n return dx * dx + dy * dy;\n}\n// rest of the code doesn't care about point format\n\n// basic distance-based simplification\nfunction simplifyRadialDist(points, sqTolerance) {\n\n var prevPoint = points[0],\n newPoints = [prevPoint],\n point;\n\n for (var i = 1, len = points.length; i < len; i++) {\n point = points[i];\n\n if (getSqDist(point, prevPoint) > sqTolerance) {\n newPoints.push(point);\n prevPoint = point;\n }\n }\n\n if (prevPoint !== point) newPoints.push(point);\n\n return newPoints;\n}\n\nfunction simplifyDPStep(points, first, last, sqTolerance, simplified) {\n var maxSqDist = sqTolerance,\n index;\n\n for (var i = first + 1; i < last; i++) {\n var sqDist = getSqSegDist(points[i], points[first], points[last]);\n\n if (sqDist > maxSqDist) {\n index = i;\n maxSqDist = sqDist;\n }\n }\n\n if (maxSqDist > sqTolerance) {\n if (index - first > 1) simplifyDPStep(points, first, index, sqTolerance, simplified);\n simplified.push(points[index]);\n if (last - index > 1) simplifyDPStep(points, index, last, sqTolerance, simplified);\n }\n}\n\n// simplification using Ramer-Douglas-Peucker algorithm\nfunction simplifyDouglasPeucker(points, sqTolerance) {\n var last = points.length - 1;\n\n var simplified = [points[0]];\n simplifyDPStep(points, 0, last, sqTolerance, simplified);\n simplified.push(points[last]);\n\n return simplified;\n}\n\n// both algorithms combined for awesome performance\nfunction simplify(points, tolerance, highestQuality) {\n\n if (points.length <= 2) return points;\n\n var sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1;\n\n points = highestQuality ? points : simplifyRadialDist(points, sqTolerance);\n points = simplifyDouglasPeucker(points, sqTolerance);\n\n return points;\n}\n\n// export as AMD module / Node module / browser or worker variable\nif (typeof define === 'function' && define.amd) define(function() { return simplify; });\nelse if (typeof module !== 'undefined') {\n module.exports = simplify;\n module.exports.default = simplify;\n} else if (typeof self !== 'undefined') self.simplify = simplify;\nelse window.simplify = simplify;\n\n})();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.concat = exports.round = void 0;\nconst round = (value, decimals) => Math.round(value * 10 ** decimals) / 10 ** decimals;\nexports.round = round;\nconst concat = (result, data) => {\n if (typeof data === 'string')\n result.push(data);\n else\n data.forEach(line => result.push(line));\n};\nexports.concat = concat;\n//# sourceMappingURL=utilities.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./SVGExporter\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SVGExporter = void 0;\nconst color_1 = require(\"@urpflanze/color\");\nclass SVGExporter {\n static parse(scene, settings = {}) {\n const bindedSettings = {\n ...SVGExporter.defaults,\n ...settings,\n };\n return SVGExporter.generate(scene, bindedSettings);\n }\n /**\n * Get drawer prop\n *\n * @param key name of the property (fill, stroke, lineWidth)\n * @param propArguments currentIndexing propArguments\n * @param defaultValue\n *\n * @returns string | number\n */\n static getSVGProp(key, propArguments, defaultValue) {\n let attribute = propArguments.shape.drawer[key];\n if (typeof attribute === 'function') {\n attribute = attribute(propArguments);\n }\n return attribute !== null && attribute !== void 0 ? attribute : defaultValue;\n }\n /**\n *\n * @param type fill | stroke\n * @param color string\n * @param attriburesPtr list of attributes to apply\n * @param stylePtr Array of string to put in style attr\n *\n * @returns\n */\n static bindColorAttribute(type, color, attriburesPtr, stylePtr) {\n if (typeof color === 'undefined')\n return;\n if (color === 'none') {\n attriburesPtr.push(`${type}=\"none\"`);\n }\n else {\n const parsed = color_1.parseColorAndConvert(color);\n if (parsed) {\n if (parsed.alpha !== 1) {\n stylePtr.push(`${type}-opacity: ${parsed.alpha}`);\n }\n attriburesPtr.push(`${type}=\"${color_1.rgbToHex(parsed.r, parsed.g, parsed.b)}\"`);\n }\n }\n }\n /**\n * Generate SVG from scene and settings\n *\n * @param scene\n * @param settings\n * @returns\n */\n static generate(scene, settings) {\n const paths = SVGExporter.generatePaths(scene, settings);\n let background;\n if (settings.background) {\n const attributes = [];\n const styles = [];\n SVGExporter.bindColorAttribute('fill', scene.background, attributes, styles);\n styles.length > 0 && attributes.push(`styles=\"${styles.join('; ')}\"`);\n background = ``;\n }\n return (`` +\n `\\n\\t` +\n (background ? `\\n\\t${background}` : '') +\n `\\n\\t${paths.join('\\n\\t')}` +\n `\\n`);\n }\n /**\n * Convert shapes to paths\n *\n * @param scene\n * @param settings\n * @returns\n */\n static generatePaths(scene, settings) {\n const paths = [];\n const sceneChilds = scene.getChildren();\n for (let i = 0, len = sceneChilds.length; i < len; i++) {\n sceneChilds[i].generate(0, true);\n const childBuffer = sceneChilds[i].getBuffer() || [];\n const childIndexedBuffer = sceneChilds[i].getIndexedBuffer() || [];\n let childVertexIndex = 0;\n for (let currentBufferIndex = 0, len = childIndexedBuffer.length; currentBufferIndex < len; currentBufferIndex++) {\n const currentIndexing = childIndexedBuffer[currentBufferIndex];\n // Store points\n const points = [];\n for (let len = childVertexIndex + currentIndexing.frameLength; childVertexIndex < len; childVertexIndex += 2) {\n points.push(childBuffer[childVertexIndex].toFixed(settings.decimals) +\n ' ' +\n childBuffer[childVertexIndex + 1].toFixed(settings.decimals));\n }\n // get styles and bind attributes\n const propArguments = {\n shape: currentIndexing.shape,\n repetition: currentIndexing.repetition,\n parent: currentIndexing.parent,\n };\n const attributes = [];\n const styles = [];\n const fill = SVGExporter.getSVGProp('fill', propArguments);\n SVGExporter.bindColorAttribute('fill', fill || 'none', attributes, styles);\n const stroke = SVGExporter.getSVGProp('stroke', propArguments, typeof fill === 'undefined' ? scene.color : undefined);\n SVGExporter.bindColorAttribute('stroke', stroke, attributes, styles);\n const lineWidth = SVGExporter.getSVGProp('lineWidth', propArguments, 1);\n if (stroke)\n attributes.push(`stroke-width=\"${lineWidth || 1}\"`);\n // move style to attributes\n styles.length > 0 && attributes.push(`style=\"${styles.join('; ')}\"`);\n // build path\n const d = `M${points.join(' L')} ${currentIndexing.shape.isClosed() ? 'Z' : ''}`;\n const path = ``;\n paths.push(path);\n }\n }\n return paths;\n }\n}\nexports.SVGExporter = SVGExporter;\nSVGExporter.defaults = {\n decimals: 3,\n background: true,\n};\n//# sourceMappingURL=SVGExporter.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./conversions\"), exports);\n__exportStar(require(\"./parsing\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.rgbToHsl = exports.hslToRgb = exports.rgbToHex = void 0;\n/**\n * Convert rgb to hex\n *\n * @param r number between 0 - 255\n * @param g number between 0 - 255\n * @param b number between 0 - 255\n * @returns #ffffff\n */\nfunction rgbToHex(r, g, b) {\n return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;\n}\nexports.rgbToHex = rgbToHex;\n/**\n * Convert hsl (0-360, 0-100, 0-100) color to rgb(0-255, 0-255, 0-255)\n *\n * @param {number} h number between 0 - 360\n * @param {number} s number between 0 - 100\n * @param {number} l number between 0 - 100\n * @returns {[number, number, number]} [0-255, 0-255, 0-255]\n */\nfunction hslToRgb(h, s, l) {\n h /= 360;\n s /= 100;\n l /= 100;\n let r, g, b;\n if (s == 0) {\n r = g = b = l; // achromatic\n }\n else {\n const hue2rgb = (p, q, t) => {\n t += t < 0 ? 1 : t > 1 ? -1 : 0;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n };\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return [(0.5 + r * 255) << 0, (0.5 + g * 255) << 0, (0.5 + b * 255) << 0];\n}\nexports.hslToRgb = hslToRgb;\n/**\n * Convert rbg (0-255, 0-255, 0-255) to hsl (0-360, 0-100, 0-100)\n *\n * @param {number} r number between 0 - 255\n * @param {number} g number between 0 - 255\n * @param {number} b number between 0 - 255\n * @returns {[number, number, number]} (0-360, 0-100, 0-100)\n */\nfunction rgbToHsl(r, g, b) {\n r /= 255;\n g /= 255;\n b /= 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s;\n if (max === min) {\n h = s = 0;\n }\n else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h = h / 6;\n }\n return [(0.5 + h * 360) << 0, (0.5 + s * 100) << 0, (0.5 + l * 100) << 0];\n}\nexports.rgbToHsl = rgbToHsl;\n//# sourceMappingURL=conversions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseColor = exports.parseColorAndConvert = void 0;\nconst conversions_1 = require(\"./conversions\");\n/**\n * Convert color to IConvertedColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IConvertedColor | undefined)}\n */\nfunction parseColorAndConvert(color) {\n const parsed = parseColor(color);\n if (parsed) {\n if (parsed.type === 'hsl') {\n const [r, g, b] = conversions_1.hslToRgb(parsed.a, parsed.b, parsed.c);\n return {\n r,\n g,\n b,\n h: parsed.a,\n s: parsed.b,\n l: parsed.c,\n alpha: parsed.alpha,\n };\n }\n else {\n const [h, s, l] = conversions_1.rgbToHsl(parsed.a, parsed.b, parsed.c);\n return {\n h,\n s,\n l,\n r: parsed.a,\n g: parsed.b,\n b: parsed.c,\n alpha: parsed.alpha,\n };\n }\n }\n}\nexports.parseColorAndConvert = parseColorAndConvert;\n/**\n * Convert color to IColor\n * Supported format: 'hsla?' 'rgba?' 'hex{3,8}' number (0xFFFFFF[FF])\n * hsla format: hsla(360, 100%, 100%, 1)\n * rgba format: rgb(255, 255, 255, 1)\n *\n * @param {(string | number)} color\n * @returns {(IColor | undefined)}\n */\nfunction parseColor(color) {\n if (typeof color === 'number') {\n if (color > 0xffffff) {\n return {\n type: 'rgb',\n a: (color >> 24) & 255,\n b: (color >> 16) & 255,\n c: (color >> 8) & 255,\n alpha: (color & 255) / 255,\n };\n }\n else {\n return { type: 'rgb', a: (color >> 16) & 255, b: (color >> 8) & 255, c: color & 255, alpha: 1 };\n }\n }\n color = color.replace(/\\s/g, '');\n let match = /^#([0-9a-f]{3,8})$/i.exec(color);\n if (match) {\n const hex = match[1];\n if (hex.length === 3) {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[0], 16),\n b: parseInt(hex[1] + hex[1], 16),\n c: parseInt(hex[2] + hex[2], 16),\n alpha: 1,\n };\n }\n else {\n return {\n type: 'rgb',\n a: parseInt(hex[0] + hex[1], 16),\n b: parseInt(hex[2] + hex[3], 16),\n c: parseInt(hex[4] + hex[5], 16),\n alpha: hex.length > 6 ? parseInt(hex.substring(6), 16) / 255 : 1,\n };\n }\n }\n match = /^((hsl|rgb)a?)\\((\\d+),(\\d+)%?,(\\d+)%?,?(.+)?\\)$/i.exec(color);\n if (match) {\n const [, , type, a, b, c, alpha] = match;\n return {\n type: type,\n a: +a,\n b: +b,\n c: +c,\n alpha: alpha ? +alpha : 1,\n };\n }\n}\nexports.parseColor = parseColor;\n//# sourceMappingURL=parsing.js.map","/*! For license information please see urpflanze-svg-importer.min.js.LICENSE.txt */\n!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.SVGImporter=e():t.SVGImporter=e()}(window,(function(){return(()=>{var t={877:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.SVGImporter=void 0;const n=r(500),i=r(688),s=r(926),o=r(926),a=r(479),h=r(721),u=r(197),c=r(825);class l{static isSVG(t){return l.SVG_REGEX.test(t.replace(l.COMMENT_REGEX,\"\"))}static getWindowInstance(){return l.windowInstance}static setWindowInstance(t){l.windowInstance=t}static stringToSVG(t){if(t=t.trim(),!l.isSVG(t))return console.warn(\"[Urpflanze:SVGImport] | Input is not valid SVG string\",t),null;const e=l.windowInstance.document.createElement(\"div\");return e.innerHTML=t,e.firstChild}static parse(t,e=.01,r){if(!1===l.isSVG(t))return console.warn(\"[Urpflanze:SVGImport] | Input is not valid svg\",t),null;const n=l.svgToBuffers(t,e);return n?l.parsedToShape(n,r):null}static parsedToShape(t,e){const r=[];if(t.buffers.forEach(((t,n)=>{const i=new s.ShapeBuffer({shape:t.buffer,bClosed:t.bClosed,sideLength:e,drawer:t.drawer});i&&r.push(i)})),1===r.length)return r[0];const n=new s.Group;return r.forEach((t=>n.add(t))),new s.Shape({shape:n})}static svgToBuffers(t,e=.01){const r=\"string\"==typeof t?l.stringToSVG(t):t;if(null===r)return console.error(\"[Urpflanze:SVGImport] | Cannot convert string to svg\",t),null;const n=l.getViewbox(r);r.querySelectorAll(\"g\").forEach(l.propagateGroupTransformAndStyleToChildren);const i=Array.from(r.querySelectorAll(\"rect, circle, ellipse, line, polyline, polygon, path\")),o=[].concat(...i.map((t=>l.elementToPath(t)))),a=Math.max(n[2]-n[0],n[3]-n[1]).toExponential(1).match(/e(\\+?[0-9]+)/),h=10/(1e3/Math.min(10**Math.max(a?+a[1]:0,0),1e3));let u=o.map((t=>l.pathToBuffer(t,h,n))).filter((t=>!!t&&t.length>=2));u=u.map((t=>l.simpliyBuffer(t,e))),u=u.map(((t,e)=>l.pathIsClosed(o[e])&&s.Vec2.distance([t[0],t[1]],[t[t.length-2],t[t.length-1]])<1?t.subarray(0,t.length-2):t));const f=Math.sqrt((n[2]-n[0])*(n[3]-n[1])),d=l.getStyleAttr(\"fill\",r),p=l.getStyleAttr(\"stroke\",r),m=l.getStyleAttr(\"stroke-width\",r,f/100),g=[];for(let t=0;t=0?c.fromPercentage(parseFloat(e),f):parseFloat(e));const n=l.getStyleAttr(\"fill\",o[t],d||void 0),i=l.getStyleAttr(\"stroke\",o[t],n?void 0:p||\"rgba(255,255,255)\"),s=r||(i?m:void 0);g.push({buffer:u[t],bClosed:l.pathIsClosed(o[t]),drawer:{fill:n,stroke:i,lineWidth:s?s/(f/100):void 0}})}return i.forEach((t=>t.remove())),{viewBox:n,buffers:g}}static getStyleAttr(t,e,r){const n=e.getAttribute(t);if(\"none\"===n)return;let s;if(null!=n)s=n;else{const r=\"stroke-width\"===t?\"strokeWidth\":t;void 0!==e.style[r]&&e.style[r].length>0&&(s=e.style[r])}if(void 0===s)return r;if(\"stroke-width\"===t)return parseFloat(s);let o=parseFloat(e.getAttribute(\"opacity\")||\"1\");const a=e.getAttribute(\"style\");if(a&&a.length){const e=new RegExp(`${t}-opacity: +?(\\\\d?.\\\\d|\\\\d)`,\"i\"),r=a.match(e);r&&(o=parseFloat(r[1]))}const h=i.parseColor(s);return h?(o=1!==h.alpha?h.alpha:o,\"rgb\"===h.type?`rgba(${h.a}, ${h.b}, ${h.c}, ${o})`:`hsla(${h.a}, ${h.b}%, ${h.c}%, ${o})`):r}static getViewbox(t){const e=t.getAttribute(\"viewBox\");if(e)return e.split(\" \").map((t=>parseFloat(t)));const r=t.getAttribute(\"width\"),n=t.getAttribute(\"height\");if(r&&n)return[0,0,parseFloat(r),parseFloat(n)];t=t.cloneNode(!0);const i=Array.from(t.querySelectorAll(\"rect, circle, ellipse, line, polyline, polygon, path\")),s=[].concat.apply([],i.map(l.elementToPath));let a=0,h=0;for(let t=0,e=s.length;ta&&(a=t.width),t.height>h&&(h=t.height)}}return[0,0,a,h]}static pathIsClosed(t){var e;return\"z\"===(null===(e=t.getAttribute(\"d\"))||void 0===e?void 0:e.trim().substr(-1).toLowerCase())}static simpliyBuffer(t,e=.01){const r=[];for(let e=0,n=t.length;e{i[2*e]=t.x,i[2*e+1]=t.y})),i}static sanitizePath(t,e){return h(t).abs().unarc().transform(e||\"\").toString()}static pathToBuffer(t,e=.01,r=[-1,-1,1,1]){const i=r[2]-r[0],s=r[3]-r[1],o=2/Math.max(i,s),a=t.getAttribute(\"d\"),h=t.getAttribute(\"transform\")||\"\",u=new n.Path({d:l.sanitizePath(a,h)}),c=Math.floor(u.length()),f=2*Math.floor(c/e),d=new Float32Array(f);let p=0;for(let t=0;t0){const r=u.compose(u.fromDefinition(u.fromTransformAttribute(e))),n=t.children;Array.from(n).forEach((t=>{let n=t.getAttribute(\"transform\");if(n&&n.length>0){const t=u.compose(u.fromDefinition(u.fromTransformAttribute(n))),e=u.compose(r,t);n=u.toSVG(e)}else n=e;t.setAttribute(\"transform\",n)}))}[\"fill\",\"stroke\",\"stroke-width\",\"style\"].forEach((e=>{const r=t.getAttribute(e);r&&Array.from(t.children).forEach((t=>{null===t.getAttribute(e)&&t.setAttribute(e,r)}))}))}static elementToPath(t){const e=l.windowInstance.document;let r=[];return\"path\"===t.nodeName?r=h(t.getAttribute(\"d\")||\"\").abs().unarc().toString().split(\"M\").filter((t=>t.length>0)).map((t=>\"M\"+t)):[\"rect\",\"ellipse\",\"circle\",\"line\",\"polyline\",\"polygon\"].includes(t.nodeName)?r=[c.conversion[t.nodeName](t)]:console.warn(`[Urpflanze:SVGImport] | Cannot convert ${t.nodeName} to path`),r.map((r=>{const n=e.createElementNS(\"http://www.w3.org/2000/svg\",\"path\");return n.setAttribute(\"d\",r),n.setAttribute(\"transform\",t.getAttribute(\"transform\")||\"\"),n.setAttribute(\"style\",t.getAttribute(\"style\")||\"\"),n.setAttribute(\"fill\",l.getStyleAttr(\"fill\",t,\"\")+\"\"),n.setAttribute(\"stroke\",l.getStyleAttr(\"stroke\",t,\"\")+\"\"),n.setAttribute(\"opacity\",t.getAttribute(\"opacity\")||\"1\"),n.setAttribute(\"stroke-width\",l.getStyleAttr(\"stroke-width\",t,\"\")+\"\"),n}))}}e.SVGImporter=l,l.HEX_REGEX=\"#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})\",l.SVG_REGEX=/^\\s*(?:<\\?xml[^>]*>\\s*)?(?:]*\\s*(?:\\[?(?:\\s*]*>\\s*)*\\]?)*[^>]*>\\s*)?(?:]*>[^]*<\\/svg>|]*\\/\\s*>)\\s*$/i,l.COMMENT_REGEX=//g},625:function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),e.SVGImporter=void 0;const s=r(877);Object.defineProperty(e,\"SVGImporter\",{enumerable:!0,get:function(){return s.SVGImporter}}),i(r(291),e),s.SVGImporter.setWindowInstance(window),e.default=s.SVGImporter},291:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},825:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.conversion=e.fromPercentage=void 0,e.fromPercentage=(t,e)=>/%$/.test(t+\"\")?100*parseFloat((t+\"\").replace(\"%\",\"\"))/e:+t;const r={rect:t=>{const r=parseFloat(t.getAttribute(\"width\")||\"0\"),n=parseFloat(t.getAttribute(\"height\")||\"0\"),i=parseFloat(t.getAttribute(\"x\")||\"0\"),s=parseFloat(t.getAttribute(\"y\")||\"0\");let o=t.getAttribute(\"rx\")||\"auto\",a=t.getAttribute(\"ry\")||\"auto\";\"auto\"===o&&\"auto\"===a?o=a=0:\"auto\"!==o&&\"auto\"===a?o=a=e.fromPercentage(o,r):\"auto\"!==a&&\"auto\"===o?a=o=e.fromPercentage(a,n):(o=e.fromPercentage(o,r),a=e.fromPercentage(a,n)),o>r/2&&(o=r/2),a>n/2&&(a=n/2);const h=o>0&&a>0;return[`M${i+o} ${s}`,\"H\"+(i+r-o),...h?[`A${o} ${a} 0 0 1 ${i+r} ${s+a}`]:[],\"V\"+(s+n-a),...h?[`A${o} ${a} 0 0 1 ${i+r-o} ${s+n}`]:[],`H${i+o}`,...h?[`A${o} ${a} 0 0 1 ${i} ${s+n-a}`]:[],`V${s+a}`,...h?[`A${o} ${a} 0 0 1 ${i+o} ${s}`]:[],\"Z\"].join(\" \")},ellipse:t=>{var e,r,n,i;const s=parseFloat(t.getAttribute(\"cx\")||\"0\"),o=parseFloat(t.getAttribute(\"cy\")||\"0\"),a=parseFloat(null!==(r=null!==(e=t.getAttribute(\"rx\"))&&void 0!==e?e:t.getAttribute(\"r\"))&&void 0!==r?r:\"0\"),h=parseFloat(null!==(i=null!==(n=t.getAttribute(\"ry\"))&&void 0!==n?n:t.getAttribute(\"r\"))&&void 0!==i?i:\"0\");return[`M${s+a} ${o}`,`A${a} ${h} 0 0 1 ${s} ${o+h}`,`A${a} ${h} 0 0 1 ${s-a} ${o}`,`A${a} ${h} 0 0 1 ${s+a} ${o}`,\"Z\"].join(\" \")},circle:t=>r.ellipse(t),line:t=>`M${t.getAttribute(\"x1\")||\"0\"} ${t.getAttribute(\"y1\")||\"0\"} L${t.getAttribute(\"x2\")||\"0\"} ${t.getAttribute(\"y2\")||\"0\"}`,polyline:t=>((t,e=2)=>{const r=[];for(;t.length>0;)r.push(t.splice(0,e));return r})((t.getAttribute(\"points\")||\"\").trim().replace(/ +/g,\" \").split(\" \").reduce(((t,e)=>[...t,...e.includes(\",\")?e.split(\",\"):[e]]),[]),2).map((([t,e],r)=>`${0===r?\"M\":\"L\"}${t} ${e}`)).join(\" \"),polygon:t=>r.polyline(t)+\" Z\",path:t=>t.getAttribute(\"d\")+\"\"};e.conversion=r},500:(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{A:()=>ur,Animator:()=>Ve,Array:()=>Lt,Box:()=>mt,Circle:()=>ir,ClipPath:()=>sr,Color:()=>ut,Container:()=>qt,Controller:()=>pe,Defs:()=>Yt,Dom:()=>Nt,Ease:()=>de,Element:()=>Ft,Ellipse:()=>Wt,EventTarget:()=>Ot,ForeignObject:()=>or,Fragment:()=>Jt,G:()=>hr,Gradient:()=>ne,Image:()=>se,Line:()=>he,List:()=>yt,Marker:()=>ue,Mask:()=>cr,Matrix:()=>ft,Morphable:()=>Ie,NonMorphable:()=>Re,Number:()=>kt,ObjectBag:()=>Le,PID:()=>ye,Path:()=>Fe,PathArray:()=>Ee,Pattern:()=>ie,Point:()=>ct,PointArray:()=>oe,Polygon:()=>qe,Polyline:()=>Ye,Queue:()=>ze,Rect:()=>De,Runner:()=>Ue,SVG:()=>mr,Shape:()=>Dt,Spring:()=>ge,Stop:()=>lr,Style:()=>fr,Svg:()=>Ke,Symbol:()=>tr,Text:()=>rr,TextPath:()=>dr,Timeline:()=>Xe,TransformBag:()=>Ce,Tspan:()=>nr,Use:()=>pr,adopt:()=>N,assignNewId:()=>V,clearEvents:()=>St,create:()=>L,defaults:()=>Tt,dispatch:()=>Et,easing:()=>le,eid:()=>z,extend:()=>$,find:()=>bt,getClass:()=>Y,getEventTarget:()=>_t,getEvents:()=>wt,getWindow:()=>I,makeInstance:()=>k,makeMorphable:()=>Ne,mockAdopt:()=>j,namespaces:()=>w,nodeOrNew:()=>B,off:()=>Pt,on:()=>At,parser:()=>dt,regex:()=>st,register:()=>q,registerMorphableType:()=>Be,registerWindow:()=>S,restoreWindow:()=>E,root:()=>T,saveWindow:()=>P,utils:()=>g,windowEvents:()=>Mt,withWindow:()=>O,wrapWithAttrCheck:()=>G});const n={},i=[];function s(t,e){if(Array.isArray(t))for(const r of t)s(r,e);else if(\"object\"!=typeof t)a(Object.getOwnPropertyNames(e)),n[t]=Object.assign(n[t]||{},e);else for(const e in t)s(e,t[e])}function o(t){return n[t]||{}}function a(t){i.push(...t)}function h(t,e){let r;const n=t.length,i=[];for(r=0;r=0;e--)V(t.children[e]);return t.id?(t.id=z(t.nodeName),t):t}function $(t,e){let r,n;for(n=(t=Array.isArray(t)?t:[t]).length-1;n>=0;n--)for(r in e)t[n].prototype[r]=e[r]}function G(t){return function(...e){const r=e[e.length-1];return!r||r.constructor!==Object||r instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(r)}}s(\"Dom\",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=k(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=k(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=k(t)).before(this),this},insertAfter:function(t){return(t=k(t)).after(this),this}});const X=/^([+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?)([a-z%]*)$/i,U=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i,H=/rgb\\((\\d+),(\\d+),(\\d+)\\)/,Z=/(#[a-z_][a-z0-9\\-_]*)/i,Q=/\\)\\s*,?\\s*/,W=/\\s/g,J=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,K=/^rgb\\(/,tt=/^(\\s+)?$/,et=/^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,rt=/\\.(jpg|jpeg|png|gif|svg)(\\?[^=]+.*)?/i,nt=/[\\s,]+/,it=/[MLHVCSQTAZ]/i;var st={__proto__:null,numberAndUnit:X,hex:U,rgb:H,reference:Z,transforms:Q,whitespace:W,isHex:J,isRgb:K,isBlank:tt,isNumber:et,isImage:rt,delimiter:nt,isPathLetter:it};function ot(t){const e=Math.round(t),r=Math.max(0,Math.min(255,e)).toString(16);return 1===r.length?\"0\"+r:r}function at(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function ht(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}s(\"Dom\",{classes:function(){const t=this.attr(\"class\");return null==t?[]:t.trim().split(nt)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr(\"class\",e.join(\" \"))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr(\"class\",this.classes().filter((function(e){return e!==t})).join(\" \")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),s(\"Dom\",{css:function(t,e){const r={};if(0===arguments.length)return this.node.style.cssText.split(/\\s*;\\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\\s*:\\s*/);r[e[0]]=e[1]})),r;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=l(e);r[t]=this.node.style[t]}return r}if(\"string\"==typeof t)return this.node.style[l(t)];if(\"object\"==typeof t)for(const e in t)this.node.style[l(e)]=null==t[e]||tt.test(t[e])?\"\":t[e]}return 2===arguments.length&&(this.node.style[l(t)]=null==e||tt.test(e)?\"\":e),this},show:function(){return this.css(\"display\",\"\")},hide:function(){return this.css(\"display\",\"none\")},visible:function(){return\"none\"!==this.css(\"display\")}}),s(\"Dom\",{data:function(t,e,r){if(null==t)return this.data(h(u(this.node.attributes,(t=>0===t.nodeName.indexOf(\"data-\"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const r of t)e[r]=this.data(r);return e}if(\"object\"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr(\"data-\"+t))}catch(e){return this.attr(\"data-\"+t)}else this.attr(\"data-\"+t,null===e?null:!0===r||\"string\"==typeof e||\"number\"==typeof e?e:JSON.stringify(e));return this}}),s(\"Dom\",{remember:function(t,e){if(\"object\"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class ut{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof ut||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&\"number\"==typeof t.r&&\"number\"==typeof t.g&&\"number\"==typeof t.b}static random(t=\"vibrant\",e,r){const{random:n,round:i,sin:s,PI:o}=Math;if(\"vibrant\"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new ut(t,e,r,\"lch\")}if(\"sine\"===t){const t=i(80*s(2*o*(e=null==e?n():e)/.5+.01)+150),r=i(50*s(2*o*e/.5+4.6)+200),a=i(100*s(2*o*e/.5+2.3)+150);return new ut(t,r,a)}if(\"pastel\"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new ut(t,e,r,\"lch\")}if(\"dark\"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new ut(t,e,r,\"lch\")}if(\"rgb\"===t){const t=255*n(),e=255*n(),r=255*n();return new ut(t,e,r)}if(\"lab\"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new ut(t,e,r,\"lab\")}if(\"grey\"===t){const t=255*n();return new ut(t,t,t)}throw new Error(\"Unsupported random color mode\")}static test(t){return\"string\"==typeof t&&(J.test(t)||K.test(t))}cmyk(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.min(1-n,1-i,1-s);return 1===o?new ut(0,0,0,1,\"cmyk\"):new ut((1-n-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,\"cmyk\")}hsl(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.max(n,i,s),a=Math.min(n,i,s),h=(o+a)/2,u=o===a,c=o-a;return new ut(360*(u?0:o===n?((i-s)/c+(i.5?c/(2-o-a):c/(o+a)),100*h,\"hsl\")}init(t=0,e=0,r=0,n=0,i=\"rgb\"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if(\"number\"==typeof t)i=\"string\"==typeof n?n:i,n=\"string\"==typeof n?0:n,Object.assign(this,{_a:t,_b:e,_c:r,_d:n,space:i});else if(t instanceof Array)this.space=e||(\"string\"==typeof t[3]?t[3]:t[4])||\"rgb\",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const r=function(t,e){const r=at(t,\"rgb\")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:\"rgb\"}:at(t,\"xyz\")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:\"xyz\"}:at(t,\"hsl\")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:\"hsl\"}:at(t,\"lab\")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:\"lab\"}:at(t,\"lch\")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:\"lch\"}:at(t,\"cmyk\")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:\"cmyk\"}:{_a:0,_b:0,_c:0,space:\"rgb\"};return r.space=e||r.space,r}(t,e);Object.assign(this,r)}else if(\"string\"==typeof t)if(K.test(t)){const e=t.replace(W,\"\"),[r,n,i]=H.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:\"rgb\"})}else{if(!J.test(t))throw Error(\"Unsupported string format, can't construct Color\");{const e=t=>parseInt(t,16),[,r,n,i]=U.exec(function(t){return 4===t.length?[\"#\",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(\"\"):t}(t)).map(e);Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:\"rgb\"})}}const{_a:s,_b:o,_c:a,_d:h}=this,u=\"rgb\"===this.space?{r:s,g:o,b:a}:\"xyz\"===this.space?{x:s,y:o,z:a}:\"hsl\"===this.space?{h:s,s:o,l:a}:\"lab\"===this.space?{l:s,a:o,b:a}:\"lch\"===this.space?{l:s,c:o,h:a}:\"cmyk\"===this.space?{c:s,m:o,y:a,k:h}:{};Object.assign(this,u)}lab(){const{x:t,y:e,z:r}=this.xyz();return new ut(116*e-16,500*(t-e),200*(e-r),\"lab\")}lch(){const{l:t,a:e,b:r}=this.lab(),n=Math.sqrt(e**2+r**2);let i=180*Math.atan2(r,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new ut(t,n,i,\"lch\")}rgb(){if(\"rgb\"===this.space)return this;if(\"lab\"===(t=this.space)||\"xyz\"===t||\"lch\"===t){let{x:t,y:e,z:r}=this;if(\"lab\"===this.space||\"lch\"===this.space){let{l:n,a:i,b:s}=this;if(\"lch\"===this.space){const{c:t,h:e}=this,r=Math.PI/180;i=t*Math.cos(r*e),s=t*Math.sin(r*e)}const o=(n+16)/116,a=i/500+o,h=o-s/200,u=16/116,c=.008856,l=7.787;t=.95047*(a**3>c?a**3:(a-u)/l),e=1*(o**3>c?o**3:(o-u)/l),r=1.08883*(h**3>c?h**3:(h-u)/l)}const n=3.2406*t+-1.5372*e+-.4986*r,i=-.9689*t+1.8758*e+.0415*r,s=.0557*t+-.204*e+1.057*r,o=Math.pow,a=.0031308,h=n>a?1.055*o(n,1/2.4)-.055:12.92*n,u=i>a?1.055*o(i,1/2.4)-.055:12.92*i,c=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new ut(255*h,255*u,255*c)}if(\"hsl\"===this.space){let{h:t,s:e,l:r}=this;if(t/=360,e/=100,r/=100,0===e)return r*=255,new ut(r,r,r);const n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,s=255*ht(i,n,t+1/3),o=255*ht(i,n,t),a=255*ht(i,n,t-1/3);return new ut(s,o,a)}if(\"cmyk\"===this.space){const{c:t,m:e,y:r,k:n}=this,i=255*(1-Math.min(1,t*(1-n)+n)),s=255*(1-Math.min(1,e*(1-n)+n)),o=255*(1-Math.min(1,r*(1-n)+n));return new ut(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:r,_d:n,space:i}=this;return[t,e,r,n,i]}toHex(){const[t,e,r]=this._clamped().map(ot);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,h=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,u=(.4124*o+.3576*a+.1805*h)/.95047,c=(.2126*o+.7152*a+.0722*h)/1,l=(.0193*o+.1192*a+.9505*h)/1.08883,f=u>.008856?Math.pow(u,1/3):7.787*u+16/116,d=c>.008856?Math.pow(c,1/3):7.787*c+16/116,p=l>.008856?Math.pow(l,1/3):7.787*l+16/116;return new ut(f,d,p,\"xyz\")}_clamped(){const{_a:t,_b:e,_c:r}=this.rgb(),{max:n,min:i,round:s}=Math;return[t,e,r].map((t=>n(0,i(s(t),255))))}}class ct{constructor(...t){this.init(...t)}clone(){return new ct(this)}init(t,e){const r=Array.isArray(t)?{x:t[0],y:t[1]}:\"object\"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==r.x?0:r.x,this.y=null==r.y?0:r.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){ft.isMatrixLike(t)||(t=new ft(t));const{x:e,y:r}=this;return this.x=t.a*e+t.c*r+t.e,this.y=t.b*e+t.d*r+t.f,this}}function lt(t,e,r){return Math.abs(e-t)<(r||1e-6)}class ft{constructor(...t){this.init(...t)}static formatTransforms(t){const e=\"both\"===t.flip||!0===t.flip,r=t.flip&&(e||\"x\"===t.flip)?-1:1,n=t.flip&&(e||\"y\"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleX)?t.scaleX*r:r,a=t.scale&&t.scale.length?t.scale[1]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleY)?t.scaleY*n:n,h=t.shear||0,u=t.rotate||t.theta||0,c=new ct(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=c.x,f=c.y,d=new ct(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.y,g=new ct(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,v=g.y,b=new ct(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:h,theta:u,rx:b.x,ry:b.y,tx:y,ty:v,ox:l,oy:f,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,r){const n=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,h=t.f+t.b*e.e+t.d*e.f;return r.a=n,r.b=i,r.c=s,r.d=o,r.e=a,r.f=h,r}around(t,e,r){return this.clone().aroundO(t,e,r)}aroundO(t,e,r){const n=t||0,i=e||0;return this.translateO(-n,-i).lmultiplyO(r).translateO(n,i)}clone(){return new ft(this)}decompose(t=0,e=0){const r=this.a,n=this.b,i=this.c,s=this.d,o=this.e,a=this.f,h=r*s-n*i,u=h>0?1:-1,c=u*Math.sqrt(r*r+n*n),l=Math.atan2(u*n,u*r),f=180/Math.PI*l,d=Math.cos(l),p=Math.sin(l),m=(r*i+n*s)/h,g=i*c/(m*r-n)||s*c/(m*n+r);return{scaleX:c,scaleY:g,shear:m,rotate:f,translateX:o-t+t*d*c+e*(m*d*c-p*g),translateY:a-e+t*p*c+e*(m*p*c+d*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new ft(t);return lt(this.a,e.a)&<(this.b,e.b)&<(this.c,e.c)&<(this.d,e.d)&<(this.e,e.e)&<(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return\"x\"===t?this.scaleO(-1,1,e,0):\"y\"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=ft.fromArray([1,0,0,1,0,0]);return t=t instanceof Ft?t.matrixify():\"string\"==typeof t?ft.fromArray(t.split(nt).map(parseFloat)):Array.isArray(t)?ft.fromArray(t):\"object\"==typeof t&&ft.isMatrixLike(t)?t:\"object\"==typeof t?(new ft).transform(t):6===arguments.length?ft.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,r=this.c,n=this.d,i=this.e,s=this.f,o=t*n-e*r;if(!o)throw new Error(\"Cannot invert \"+this);const a=n/o,h=-e/o,u=-r/o,c=t/o,l=-(a*i+u*s),f=-(h*i+c*s);return this.a=a,this.b=h,this.c=u,this.d=c,this.e=l,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof ft?t:new ft(t);return ft.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof ft?t:new ft(t);return ft.matrixMultiply(this,e,this)}rotate(t,e,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=c(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:h,e:u,f:l}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-h*i,this.d=h*n+a*i,this.e=u*n-l*i+r*i-e*n+e,this.f=l*n+u*i-e*i-r*n+r,this}scale(t,e,r,n){return this.clone().scaleO(...arguments)}scaleO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t);const{a:i,b:s,c:o,d:a,e:h,f:u}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=h*t-r*t+r,this.f=u*e-n*e+n,this}shear(t,e,r){return this.clone().shearO(t,e,r)}shearO(t,e=0,r=0){const{a:n,b:i,c:s,d:o,e:a,f:h}=this;return this.a=n+i*t,this.c=s+o*t,this.e=a+h*t-r*t,this}skew(t,e,r,n){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=c(t),e=c(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:h,d:u,e:l,f}=this;return this.a=o+a*i,this.b=a+o*s,this.c=h+u*i,this.d=u+h*s,this.e=l+f*i-n*i,this.f=f+l*s-r*s,this}skewX(t,e,r){return this.skew(t,0,e,r)}skewY(t,e,r){return this.skew(0,t,e,r)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return\"matrix(\"+this.a+\",\"+this.b+\",\"+this.c+\",\"+this.d+\",\"+this.e+\",\"+this.f+\")\"}transform(t){if(ft.isMatrixLike(t))return new ft(t).multiplyO(this);const e=ft.formatTransforms(t),{x:r,y:n}=new ct(e.ox,e.oy).transform(this),i=(new ft).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-r,-n).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(r,n);if(isFinite(e.px)||isFinite(e.py)){const t=new ct(r,n).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function dt(){if(!dt.nodes){const t=k().size(2,0);t.node.style.cssText=[\"opacity: 0\",\"position: absolute\",\"left: -100%\",\"top: -100%\",\"overflow: hidden\"].join(\";\"),t.attr(\"focusable\",\"false\"),t.attr(\"aria-hidden\",\"true\");const e=t.path().node;dt.nodes={svg:t,path:e}}if(!dt.nodes.svg.node.parentNode){const t=_.document.body||_.document.documentElement;dt.nodes.svg.addTo(t)}return dt.nodes}function pt(t){return!(t.width||t.height||t.x||t.y)}q(ft,\"Matrix\");class mt{constructor(...t){this.init(...t)}addOffset(){return this.x+=_.window.pageXOffset,this.y+=_.window.pageYOffset,new mt(this)}init(t){return t=\"string\"==typeof t?t.split(nt).map(parseFloat):Array.isArray(t)?t:\"object\"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return pt(this)}merge(t){const e=Math.min(this.x,t.x),r=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-r;return new mt(e,r,n,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+\" \"+this.y+\" \"+this.width+\" \"+this.height}transform(t){t instanceof ft||(t=new ft(t));let e=1/0,r=-1/0,n=1/0,i=-1/0;return[new ct(this.x,this.y),new ct(this.x2,this.y),new ct(this.x,this.y2),new ct(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),r=Math.max(r,s.x),n=Math.min(n,s.y),i=Math.max(i,s.y)})),new mt(e,n,r-e,i-n)}}function gt(t,e,r){let n;try{if(n=e(t.node),pt(n)&&(i=t.node)!==_.document&&!(_.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===_.document}).call(_.document.documentElement,i))throw new Error(\"Element not in the dom\")}catch(e){n=r(t)}var i;return n}s({viewbox:{viewbox(t,e,r,n){return null==t?new mt(this.attr(\"viewBox\")):this.attr(\"viewBox\",new mt(t,e,r,n))},zoom(t,e){let{width:r,height:n}=this.attr([\"width\",\"height\"]);if((r||n)&&\"string\"!=typeof r&&\"string\"!=typeof n||(r=this.node.clientWidth,n=this.node.clientHeight),!r||!n)throw new Error(\"Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element\");const i=this.viewbox(),s=r/i.width,o=n/i.height,a=Math.min(s,o);if(null==t)return a;let h=a/t;h===1/0&&(h=Number.MAX_SAFE_INTEGER/100),e=e||new ct(r/2/s+i.x,n/2/o+i.y);const u=new mt(i).transform(new ft({scale:h,origin:e}));return this.viewbox(u)}}}),q(mt,\"Box\");class yt extends Array{constructor(t=[],...e){if(super(t,...e),\"number\"==typeof t)return this;this.length=0,this.push(...t)}}$([yt],{each(t,...e){return\"function\"==typeof t?this.map(((e,r,n)=>t.call(e,e,r,n))):this.map((r=>r[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const vt=[\"toArray\",\"constructor\",\"each\"];function bt(t,e){return new yt(h((e||_.document).querySelectorAll(t),(function(t){return N(t)})))}yt.extend=function(t){t=t.reduce(((t,e)=>(vt.includes(e)||\"_\"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),$([yt],t)};let xt=0;const Mt={};function wt(t){let e=t.getEventHolder();return e===_.window&&(e=Mt),e.events||(e.events={}),e.events}function _t(t){return t.getEventTarget()}function St(t){let e=t.getEventHolder();e===_.window&&(e=Mt),e.events&&(e.events={})}function At(t,e,r,n,i){const s=r.bind(n||t),o=k(t),a=wt(o),h=_t(o);e=Array.isArray(e)?e:e.split(nt),r._svgjsListenerId||(r._svgjsListenerId=++xt),e.forEach((function(t){const e=t.split(\".\")[0],n=t.split(\".\")[1]||\"*\";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][r._svgjsListenerId]=s,h.addEventListener(e,s,i||!1)}))}function Pt(t,e,r,n){const i=k(t),s=wt(i),o=_t(i);(\"function\"!=typeof r||(r=r._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||\"\").split(nt)).forEach((function(t){const e=t&&t.split(\".\")[0],a=t&&t.split(\".\")[1];let h,u;if(r)s[e]&&s[e][a||\"*\"]&&(o.removeEventListener(e,s[e][a||\"*\"][r],n||!1),delete s[e][a||\"*\"][r]);else if(e&&a){if(s[e]&&s[e][a]){for(u in s[e][a])Pt(o,[e,a].join(\".\"),u);delete s[e][a]}}else if(a)for(t in s)for(h in s[t])a===h&&Pt(o,[t,a].join(\".\"));else if(e){if(s[e]){for(h in s[e])Pt(o,[e,h].join(\".\"));delete s[e]}}else{for(t in s)Pt(o,t);St(i)}}))}function Et(t,e,r,n){const i=_t(t);return e instanceof _.window.Event||(e=new _.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}class Ot extends R{addEventListener(){}dispatch(t,e,r){return Et(this,t,e,r)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const r=e[t.type];for(const e in r)for(const n in r[e])r[e][n](t);return!t.defaultPrevented}fire(t,e,r){return this.dispatch(t,e,r),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e){return Pt(this,t,e),this}on(t,e,r,n){return At(this,t,e,r,n),this}removeEventListener(){}}function It(){}q(Ot,\"EventTarget\");const Rt={duration:400,ease:\">\",delay:0},Ct={\"fill-opacity\":1,\"stroke-opacity\":1,\"stroke-width\":0,\"stroke-linejoin\":\"miter\",\"stroke-linecap\":\"butt\",fill:\"#000000\",stroke:\"#000000\",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,\"stop-opacity\":1,\"stop-color\":\"#000000\",\"text-anchor\":\"start\"};var Tt={__proto__:null,noop:It,timeline:Rt,attrs:Ct};class Lt extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return\"number\"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(nt).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(\" \")}valueOf(){const t=[];return t.push(...this),t}}class kt{constructor(...t){this.init(...t)}convert(t){return new kt(this.value,t)}divide(t){return t=new kt(t),new kt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||\"\",\"number\"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:\"string\"==typeof t?(e=t.match(X))&&(this.value=parseFloat(e[1]),\"%\"===e[5]?this.value/=100:\"s\"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof kt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new kt(t),new kt(this-t,this.unit||t.unit)}plus(t){return t=new kt(t),new kt(this+t,this.unit||t.unit)}times(t){return t=new kt(t),new kt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return(\"%\"===this.unit?~~(1e8*this.value)/1e6:\"s\"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const Bt=[];class Nt extends Ot{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=k(t)).removeNamespace&&this.node instanceof _.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return k(t).put(this,e)}children(){return new yt(h(this.node.children,(function(t){return N(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0){return this.writeDataToDom(),new this.constructor(V(this.node.cloneNode(t)))}each(t,e){const r=this.children();let n,i;for(n=0,i=r.length;n=0}html(t,e){return this.xml(t,e,v)}id(t){return void 0!==t||this.node.id||(this.node.id=z(this.type)),this.attr(\"id\",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return N(this.node.lastChild)}matches(t){const e=this.node,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return r&&r.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=N(e.node.parentNode),!t)return e;do{if(\"string\"==typeof t?e.matches(t):e instanceof t)return e}while(e=N(e.node.parentNode));return e}put(t,e){return t=k(t),this.add(t,e),t}putIn(t,e){return k(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=k(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const r=10**t,n=this.attr(e);for(const t in n)\"number\"==typeof n[t]&&(n[t]=Math.round(n[t]*r)/r);return this.attr(n),this}svg(t,e){return this.xml(t,e,y)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const r=e.index(this);return e.put(t,r).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,r){if(\"boolean\"==typeof t&&(r=e,e=t,t=null),null==t||\"function\"==typeof t){e=null==e||e,this.writeDataToDom();let r=this;if(null!=t){if(r=N(r.node.cloneNode(!0)),e){const e=t(r);if(r=e||r,!1===e)return\"\"}r.each((function(){const e=t(this),r=e||this;!1===e?this.remove():e&&this!==r&&this.replace(r)}),!0)}return e?r.node.outerHTML:r.node.innerHTML}e=null!=e&&e;const n=L(\"wrapper\",r),i=_.document.createDocumentFragment();n.innerHTML=t;for(let t=n.children.length;t--;)i.appendChild(n.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}$(Nt,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=et.test(r.nodeValue)?parseFloat(r.nodeValue):r.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if(\"object\"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?Ct[t]:et.test(e)?parseFloat(e):e;\"number\"==typeof(e=Bt.reduce(((e,r)=>r(t,e,this)),e))?e=new kt(e):ut.isColor(e)?e=new ut(e):e.constructor===Array&&(e=new Lt(e)),\"leading\"===t?this.leading&&this.leading(e):\"string\"==typeof r?this.node.setAttributeNS(r,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||\"font-size\"!==t&&\"x\"!==t||this.rebuild()}return this},find:function(t){return bt(t,this.node)},findOne:function(t){return N(this.node.querySelector(t))}}),q(Nt,\"Dom\");class Ft extends Nt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,t.hasAttribute(\"svgjs:data\")&&this.setData(JSON.parse(t.getAttribute(\"svgjs:data\"))||{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new kt(t).plus(this.x()))}dy(t=0){return this.y(new kt(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr(\"height\",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){t=k(t);const e=new yt;let r=this;for(;(r=r.parent())&&r.node!==_.document&&\"#document-fragment\"!==r.nodeName&&(e.push(r),r.node!==t.node););return e}reference(t){if(!(t=this.attr(t)))return null;const e=(t+\"\").match(Z);return e?k(e[1]):null}root(){const t=this.parent(Y(T));return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const r=p(this,t,e);return this.width(new kt(r.width)).height(new kt(r.height))}width(t){return this.attr(\"width\",t)}writeDataToDom(){return this.node.removeAttribute(\"svgjs:data\"),Object.keys(this.dom).length&&this.node.setAttribute(\"svgjs:data\",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr(\"x\",t)}y(t){return this.attr(\"y\",t)}}$(Ft,{bbox:function(){const t=gt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(dt().svg).show(),r=e.node.getBBox();return e.remove(),r}catch(e){throw new Error(`Getting bbox of element \"${t.node.nodeName}\" is not possible: ${e.toString()}`)}}));return new mt(t)},rbox:function(t){const e=gt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element \"${t.node.nodeName}\" is not possible`)})),r=new mt(e);return t?r.transform(t.screenCTM().inverseO()):r.addOffset()},inside:function(t,e){const r=this.bbox();return t>r.x&&e>r.y&&t=0;r--)null!=e[jt[t][r]]&&this.attr(jt.prefix(t,jt[t][r]),e[jt[t][r]]);return this},s([\"Element\",\"Runner\"],e)})),s([\"Element\",\"Runner\"],{matrix:function(t,e,r,n,i,s){return null==t?new ft(this):this.attr(\"transform\",new ft(t,e,r,n,i,s))},rotate:function(t,e,r){return this.transform({rotate:t,ox:e,oy:r},!0)},skew:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:r},!0):this.transform({skew:[t,e],ox:r,oy:n},!0)},shear:function(t,e,r){return this.transform({shear:t,ox:e,oy:r},!0)},scale:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:r},!0):this.transform({scale:[t,e],ox:r,oy:n},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t=\"both\",e=\"center\"){return-1===\"xybothtrue\".indexOf(t)&&(e=t,t=\"both\"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr(\"opacity\",t)}}),s(\"radius\",{radius:function(t,e=t){return\"radialGradient\"===(this._element||this).type?this.attr(\"r\",new kt(t)):this.rx(t).ry(e)}}),s(\"Path\",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new ct(this.node.getPointAtLength(t))}}),s([\"Element\",\"Runner\"],{font:function(t,e){if(\"object\"==typeof t){for(e in t)this.font(e,t[e]);return this}return\"leading\"===t?this.leading(e):\"anchor\"===t?this.attr(\"text-anchor\",e):\"size\"===t||\"family\"===t||\"weight\"===t||\"stretch\"===t||\"variant\"===t||\"style\"===t?this.attr(\"font-\"+t,e):this.attr(t,e)}}),s(\"Element\",[\"click\",\"dblclick\",\"mousedown\",\"mouseup\",\"mouseover\",\"mouseout\",\"mousemove\",\"mouseenter\",\"mouseleave\",\"touchstart\",\"touchmove\",\"touchleave\",\"touchend\",\"touchcancel\"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),s(\"Element\",{untransform:function(){return this.attr(\"transform\",null)},matrixify:function(){return(this.attr(\"transform\")||\"\").split(Q).slice(0,-1).map((function(t){const e=t.trim().split(\"(\");return[e[0],e[1].split(nt).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return\"matrix\"===e[0]?t.lmultiply(ft.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new ft)},toParent:function(t,e){if(this===t)return this;const r=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(n.multiply(r)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||\"string\"==typeof t){const e=new ft(this).decompose();return null==t?e:e[t]}ft.isMatrixLike(t)||(t={...t,origin:m(t,this)});const r=new ft(!0===e?this:e||!1).transform(t);return this.attr(\"transform\",r)}});class qt extends Ft{flatten(t=this,e){return this.each((function(){if(this instanceof qt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(r,n){return n[n.length-r-1].toParent(t,e)})),this.remove()}}q(qt,\"Container\");class Yt extends qt{constructor(t,e=t){super(B(\"defs\",t),e)}flatten(){return this}ungroup(){return this}}q(Yt,\"Defs\");class Dt extends Ft{}function zt(t){return this.attr(\"rx\",t)}function Vt(t){return this.attr(\"ry\",t)}function $t(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Gt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Xt(t){return this.attr(\"cx\",t)}function Ut(t){return this.attr(\"cy\",t)}function Ht(t){return null==t?2*this.rx():this.rx(new kt(t).divide(2))}function Zt(t){return null==t?2*this.ry():this.ry(new kt(t).divide(2))}q(Dt,\"Shape\");var Qt={__proto__:null,rx:zt,ry:Vt,x:$t,y:Gt,cx:Xt,cy:Ut,width:Ht,height:Zt};class Wt extends Dt{constructor(t,e=t){super(B(\"ellipse\",t),e)}size(t,e){const r=p(this,t,e);return this.rx(new kt(r.width).divide(2)).ry(new kt(r.height).divide(2))}}$(Wt,Qt),s(\"Container\",{ellipse:G((function(t=0,e=t){return this.put(new Wt).size(t,e).move(0,0)}))}),q(Wt,\"Ellipse\");class Jt extends Nt{constructor(t=_.document.createDocumentFragment()){super(t)}xml(t,e,r){if(\"boolean\"==typeof t&&(r=e,e=t,t=null),null==t||\"function\"==typeof t){const t=new Nt(L(\"wrapper\",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}}function Kt(t,e){return\"radialGradient\"===(this._element||this).type?this.attr({fx:new kt(t),fy:new kt(e)}):this.attr({x1:new kt(t),y1:new kt(e)})}function te(t,e){return\"radialGradient\"===(this._element||this).type?this.attr({cx:new kt(t),cy:new kt(e)}):this.attr({x2:new kt(t),y2:new kt(e)})}q(Jt,\"Fragment\");var ee,re={__proto__:null,from:Kt,to:te};class ne extends qt{constructor(t,e){super(B(t+\"Gradient\",\"string\"==typeof t?null:t),e)}attr(t,e,r){return\"transform\"===t&&(t=\"gradientTransform\"),super.attr(t,e,r)}bbox(){return new mt}targets(){return bt('svg [fill*=\"'+this.id()+'\"]')}toString(){return this.url()}update(t){return this.clear(),\"function\"==typeof t&&t.call(this,this),this}url(){return'url(\"#'+this.id()+'\")'}}$(ne,re),s({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:G((function(t,e){return this.put(new ne(t)).update(e)}))}}),q(ne,\"Gradient\");class ie extends qt{constructor(t,e=t){super(B(\"pattern\",t),e)}attr(t,e,r){return\"transform\"===t&&(t=\"patternTransform\"),super.attr(t,e,r)}bbox(){return new mt}targets(){return bt('svg [fill*=\"'+this.id()+'\"]')}toString(){return this.url()}update(t){return this.clear(),\"function\"==typeof t&&t.call(this,this),this}url(){return'url(\"#'+this.id()+'\")'}}s({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:G((function(t,e,r){return this.put(new ie).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:\"userSpaceOnUse\"})}))}}),q(ie,\"Pattern\");class se extends Dt{constructor(t,e=t){super(B(\"image\",t),e)}load(t,e){if(!t)return this;const r=new _.window.Image;return At(r,\"load\",(function(t){const n=this.parent(ie);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof ie&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),\"function\"==typeof e&&e.call(this,t)}),this),At(r,\"load error\",(function(){Pt(r)})),this.attr(\"href\",r.src=t,x)}}ee=function(t,e,r){return\"fill\"!==t&&\"stroke\"!==t||rt.test(e)&&(e=r.root().defs().image(e)),e instanceof se&&(e=r.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},Bt.push(ee),s({Container:{image:G((function(t,e){return this.put(new se).size(0,0).load(t,e)}))}}),q(se,\"Image\");class oe extends Lt{bbox(){let t=-1/0,e=-1/0,r=1/0,n=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),r=Math.min(i[0],r),n=Math.min(i[1],n)})),new mt(r,n,t-r,e-n)}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(nt).map(parseFloat)).length%2!=0&&t.pop();for(let r=0,n=t.length;r=0;r--)n.width&&(this[r][0]=(this[r][0]-n.x)*t/n.width+n.x),n.height&&(this[r][1]=(this[r][1]-n.y)*e/n.height+n.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,r=this.length;e\":function(t){return-Math.cos(t*Math.PI)/2+.5},\">\":function(t){return Math.sin(t*Math.PI/2)},\"<\":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,r,n){return function(i){return i<0?t>0?e/t*i:r>0?n/r*i:0:i>1?r<1?(1-n)/(1-r)*i+(n-r)/(1-r):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*n+i**3}},steps:function(t,e=\"end\"){e=e.split(\"-\").reverse()[0];let r=t;return\"none\"===e?--r:\"both\"===e&&++r,(n,i=!1)=>{let s=Math.floor(n*t);const o=n*s%1==0;return\"start\"!==e&&\"both\"!==e||++s,i&&o&&--s,n>=0&&s<0&&(s=0),n<=1&&s>r&&(s=r),s/r}}};class fe{done(){return!1}}class de extends fe{constructor(t=Rt.ease){super(),this.ease=le[t]||t}step(t,e,r){return\"number\"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}}class pe extends fe{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}}function me(){const t=(this._duration||500)/1e3,e=this._overshoot||0,r=Math.PI,n=Math.log(e/100+1e-10),i=-n/Math.sqrt(r*r+n*n),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}class ge extends pe{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,r,n){if(\"string\"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;r>100&&(r=16),r/=1e3;const i=n.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*r+s*r*r/2;return n.velocity=i+s*r,n.done=Math.abs(e-o)+Math.abs(i)<.002,n.done?e:o}}$(ge,{duration:ce(\"_duration\",me),overshoot:ce(\"_overshoot\",me)});class ye extends pe{constructor(t=.1,e=.01,r=0,n=1e3){super(),this.p(t).i(e).d(r).windup(n)}step(t,e,r,n){if(\"string\"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;const i=e-t;let s=(n.integral||0)+i*r;const o=(i-(n.error||0))/r,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),n.error=i,n.integral=s,n.done=Math.abs(i)<.001,n.done?e:t+(this.P*i+this.I*s+this.D*o)}}$(ye,{windup:ce(\"_windup\"),p:ce(\"P\"),i:ce(\"I\"),d:ce(\"D\")});const ve={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},be={M:function(t,e,r){return e.x=r.x=t[0],e.y=r.y=t[1],[\"M\",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],[\"L\",t[0],t[1]]},H:function(t,e){return e.x=t[0],[\"H\",t[0]]},V:function(t,e){return e.y=t[0],[\"V\",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],[\"C\",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],[\"S\",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],[\"Q\",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],[\"T\",t[0],t[1]]},Z:function(t,e,r){return e.x=r.x,e.y=r.y,[\"Z\"]},A:function(t,e){return e.x=t[5],e.y=t[6],[\"A\",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},xe=\"mlhvqtcsaz\".split(\"\");for(let t=0,e=xe.length;t=0;n--)r=this[n][0],\"M\"===r||\"L\"===r||\"T\"===r?(this[n][1]+=t,this[n][2]+=e):\"H\"===r?this[n][1]+=t:\"V\"===r?this[n][1]+=e:\"C\"===r||\"S\"===r||\"Q\"===r?(this[n][1]+=t,this[n][2]+=e,this[n][3]+=t,this[n][4]+=e,\"C\"===r&&(this[n][5]+=t,this[n][6]+=e)):\"A\"===r&&(this[n][6]+=t,this[n][7]+=e);return this}parse(t=\"M0 0\"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let r=0,n=\"\";const i={segment:[],inNumber:!1,number:\"\",lastToken:\"\",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new ct,p:new ct};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!we(i,n))if(\".\"!==n)if(isNaN(parseInt(n)))if(\" \"!==n&&\",\"!==n)if(\"-\"!==n)if(\"E\"!==n.toUpperCase()){if(it.test(n)){if(i.inNumber)_e(i,!1);else{if(!Me(i))throw new Error(\"parser Error\");Se(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!Pe(i)){_e(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else i.inNumber&&_e(i,!1);else{if(\"0\"===i.number||Ae(i)){i.inNumber=!0,i.number=n,_e(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){_e(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&_e(i,!1),i.inSegment&&Me(i)&&Se(i),i.segments}(t)}size(t,e){const r=this.bbox();let n,i;for(r.width=0===r.width?1:r.width,r.height=0===r.height?1:r.height,n=this.length-1;n>=0;n--)i=this[n][0],\"M\"===i||\"L\"===i||\"T\"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):\"H\"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:\"V\"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:\"C\"===i||\"S\"===i||\"Q\"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,\"C\"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):\"A\"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this}toString(){return function(t){let e=\"\";for(let r=0,n=t.length;r{const e=typeof t;return\"number\"===e?kt:\"string\"===e?ut.isColor(t)?ut:nt.test(t)?it.test(t)?Ee:Lt:X.test(t)?kt:Re:ke.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Lt:\"object\"===e?Le:Re};class Ie{constructor(t){this._stepper=t||new de(\"-\"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){const e=this;return this._morphObj.fromArray(this._from.map((function(r,n){return e._stepper.step(r,e._to[n],t,e._context[n],e._context)})))}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(Oe(t));let e=new this._type(t);return this._type===ut&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Le&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toArray(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class Re{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class Ce{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,Ce.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}Ce.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Te=(t,e)=>t[0]e[0]?1:0;class Le{constructor(...t){this.init(...t)}align(t){for(let e=0,r=this.values.length;et.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const r=e.shift(),n=e.shift(),i=e.shift(),s=e.splice(0,i);t[r]=new n(s).valueOf()}return t}}const ke=[Re,Ce,Le];function Be(t=[]){ke.push(...[].concat(t))}function Ne(){$(ke,{to(t){return(new Ie).type(this.constructor).from(this.valueOf()).to(t)},fromArray(t){return this.init(t),this}})}class Fe extends Dt{constructor(t,e=t){super(B(\"path\",t),e)}array(){return this._array||(this._array=new Ee(this.attr(\"d\")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr(\"d\",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr(\"d\",\"string\"==typeof t?t:this._array=new Ee(t))}size(t,e){const r=p(this,t,e);return this.attr(\"d\",this.array().size(r.width,r.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}Fe.prototype.MorphArray=Ee,s({Container:{path:G((function(t){return this.put(new Fe).plot(t||new Ee)}))}}),q(Fe,\"Path\");var je={__proto__:null,array:function(){return this._array||(this._array=new oe(this.attr(\"points\")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr(\"points\",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr(\"points\",\"string\"==typeof t?t:this._array=new oe(t))},size:function(t,e){const r=p(this,t,e);return this.attr(\"points\",this.array().size(r.width,r.height))}};class qe extends Dt{constructor(t,e=t){super(B(\"polygon\",t),e)}}s({Container:{polygon:G((function(t){return this.put(new qe).plot(t||new oe)}))}}),$(qe,ae),$(qe,je),q(qe,\"Polygon\");class Ye extends Dt{constructor(t,e=t){super(B(\"polyline\",t),e)}}s({Container:{polyline:G((function(t){return this.put(new Ye).plot(t||new oe)}))}}),$(Ye,ae),$(Ye,je),q(Ye,\"Polyline\");class De extends Dt{constructor(t,e=t){super(B(\"rect\",t),e)}}$(De,{rx:zt,ry:Vt}),s({Container:{rect:G((function(t,e){return this.put(new De).size(t,e)}))}}),q(De,\"Rect\");class ze{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Ve={nextDraw:null,frames:new ze,timeouts:new ze,immediates:new ze,timer:()=>_.window.performance||_.window.Date,transforms:[],frame(t){const e=Ve.frames.push({run:t});return null===Ve.nextDraw&&(Ve.nextDraw=_.window.requestAnimationFrame(Ve._draw)),e},timeout(t,e){e=e||0;const r=Ve.timer().now()+e,n=Ve.timeouts.push({run:t,time:r});return null===Ve.nextDraw&&(Ve.nextDraw=_.window.requestAnimationFrame(Ve._draw)),n},immediate(t){const e=Ve.immediates.push(t);return null===Ve.nextDraw&&(Ve.nextDraw=_.window.requestAnimationFrame(Ve._draw)),e},cancelFrame(t){null!=t&&Ve.frames.remove(t)},clearTimeout(t){null!=t&&Ve.timeouts.remove(t)},cancelImmediate(t){null!=t&&Ve.immediates.remove(t)},_draw(t){let e=null;const r=Ve.timeouts.last();for(;(e=Ve.timeouts.shift())&&(t>=e.time?e.run():Ve.timeouts.push(e),e!==r););let n=null;const i=Ve.frames.last();for(;n!==i&&(n=Ve.frames.shift());)n.run(t);let s=null;for(;s=Ve.immediates.shift();)s();Ve.nextDraw=Ve.timeouts.first()||Ve.frames.first()?_.window.requestAnimationFrame(Ve._draw):null}},$e=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},Ge=function(){const t=_.window;return(t.performance||t.Date).now()};class Xe extends Ot{constructor(t=Ge){super(),this._timeSource=t,this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const r=Math.abs(e);return this.speed(t?-r:r)}schedule(t,e,r){if(null==t)return this._runners.map($e);let n=0;const i=this.getEndTime();if(e=e||0,null==r||\"last\"===r||\"after\"===r)n=i;else if(\"absolute\"===r||\"start\"===r)n=e,e=0;else if(\"now\"===r)n=this._time;else if(\"relative\"===r){const r=this.getRunnerInfoById(t.id);r&&(n=r.start+e,e=0)}else{if(\"with-last\"!==r)throw new Error('Invalid value for the \"when\" parameter');{const t=this.getLastRunnerInfo();n=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:n+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Ve.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Ve.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let r=e-this._lastSourceTime;t&&(r=0);const n=this._speed*r+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=n,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire(\"time\",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],r=e.runner;this._time-e.start<=0&&r.reset()}let i=!1;for(let t=0,e=this._runners.length;t0?this._continue():(this.pause(),this.fire(\"finished\")),this}}s({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Xe,this._timeline):(this._timeline=t,this)}}});class Ue extends Ot{constructor(t){super(),this.id=Ue.id++,t=\"function\"==typeof(t=null==t?Rt.duration:t)?new pe(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration=\"number\"==typeof t&&t,this._isDeclarative=t instanceof pe,this._stepper=this._isDeclarative?t:new de,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new ft,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,r){let n=1,i=!1,s=0;return e=e||Rt.delay,r=r||\"last\",\"object\"!=typeof(t=t||Rt.duration)||t instanceof fe||(e=t.delay||e,r=t.when||r,i=t.swing||i,n=t.times||n,s=t.wait||s,t=t.duration||Rt.duration),{duration:t,delay:e,swing:i,times:n,wait:s,when:r}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t,e){return this.transforms.lmultiplyO(t),this}after(t){return this.on(\"finished\",t)}animate(t,e,r){const n=Ue.sanitise(t,e,r),i=new Ue(n.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(n).schedule(n.delay,n.when)}clearTransform(){return this.transforms=new ft,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new de(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,r){return\"object\"==typeof t&&(e=t.swing,r=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=r||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),r=(this._time-t*e)/this._duration;return Math.min(t+r,this._times)}const r=t%1,n=e*Math.floor(t)+this._duration*r;return this.time(n)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,r=this._duration,n=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(n+r))/(n+r)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(n+r))/r+i;return Math.max(Math.min(a,1),0)},h=i*(n+r)-n;return a=e<=0?Math.round(t(1e-5)):e=0;this._lastPosition=e;const n=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime=n;this._lastTime=this._time,i&&this.fire(\"start\",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=n,this._reseted=!1;let a=!1;return(r||o)&&(this._initialise(r),this.transforms=new ft,a=this._run(o?t:e),this.fire(\"step\",this)),this.done=this.done||a&&o,s&&this.fire(\"finished\",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,r=this._queue.length;et.lmultiplyO(e),Qe=t=>t.transforms;function We(){const t=this._transformationRunners.runners.map(Qe).reduce(Ze,new ft);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Je{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new He).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const r=this.ids.indexOf(t+1);return this.ids.splice(r,1,t+1),this.runners.splice(r,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;ee.id<=t.id)).map(Qe).reduce(Ze,new ft)},_addRunner(t){this._transformationRunners.add(t),Ve.cancelImmediate(this._frameId),this._frameId=Ve.immediate(We.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Je).add(new He(new ft(this))))}}}),$(Ue,{attr(t,e){return this.styleAttr(\"attr\",t,e)},css(t,e){return this.styleAttr(\"css\",t,e)},styleAttr(t,e,r){if(\"string\"==typeof e)return this.styleAttr(t,{[e]:r});let n=e;if(this._tryRetarget(t,n))return this;let i=new Ie(this._stepper).to(n),s=Object.keys(n);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const r=Object.keys(e),o=(a=s,r.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),r=new Le(i.from()).valueOf();Object.assign(r,e),i.from(r)}const h=new Le(i.to()).valueOf();Object.assign(h,e),i.to(h),s=r,n=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget(\"zoom\",t,e))return this;let r=new Ie(this._stepper).to(new kt(t));return this.queue((function(){r=r.from(this.element().zoom())}),(function(t){return this.element().zoom(r.at(t),e),r.done()}),(function(t,n){e=n,r.to(t)})),this._rememberMorpher(\"zoom\",r),this},transform(t,e,r){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget(\"transform\",t))return this;const n=ft.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new Ie(this._stepper).type(r?Ce:ft);let s,o,a,h,u;return this.queue((function(){o=o||this.element(),s=s||m(t,o),u=new ft(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:l,y:f}=new ct(s).transform(o._currentTransform(this));let d=new ft({...t,origin:[l,f]}),p=this._isDeclarative&&a?a:u;if(r){d=d.decompose(l,f),p=p.decompose(l,f);const t=d.rotate,e=p.rotate,r=[t-360,t,t+360],n=r.map((t=>Math.abs(t-e))),i=Math.min(...n),s=n.indexOf(i);d.rotate=r[s]}e&&(n||(d.rotate=t.rotate||0),this._isDeclarative&&h&&(p.rotate=h)),i.from(p),i.to(d);const m=i.at(c);return h=m.rotate,a=new ft(m),this.addTransform(a),o._addRunner(this),i.done()}),(function(e){(e.origin||\"center\").toString()!==(t.origin||\"center\").toString()&&(s=m(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher(\"transform\",i),this},x(t,e){return this._queueNumber(\"x\",t)},y(t){return this._queueNumber(\"y\",t)},dx(t=0){return this._queueNumberDelta(\"x\",t)},dy(t=0){return this._queueNumberDelta(\"y\",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new kt(e),this._tryRetarget(t,e))return this;const r=new Ie(this._stepper).to(e);let n=null;return this.queue((function(){n=this.element()[t](),r.from(n),r.to(n+e)}),(function(e){return this.element()[t](r.at(e)),r.done()}),(function(t){r.to(n+new kt(t))})),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new Ie(this._stepper).to(e);return this.queue((function(){r.from(this.element()[t]())}),(function(e){return this.element()[t](r.at(e)),r.done()})),this._rememberMorpher(t,r),this},_queueNumber(t,e){return this._queueObject(t,new kt(e))},cx(t){return this._queueNumber(\"cx\",t)},cy(t){return this._queueNumber(\"cy\",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let r;return t&&e||(r=this._element.bbox()),t||(t=r.width/r.height*e),e||(e=r.height/r.width*t),this.width(t).height(e)},width(t){return this._queueNumber(\"width\",t)},height(t){return this._queueNumber(\"height\",t)},plot(t,e,r,n){if(4===arguments.length)return this.plot([t,e,r,n]);if(this._tryRetarget(\"plot\",t))return this;const i=new Ie(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher(\"plot\",i),this},leading(t){return this._queueNumber(\"leading\",t)},viewbox(t,e,r,n){return this._queueObject(\"viewbox\",new mt(t,e,r,n))},update(t){return\"object\"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr(\"stop-opacity\",t.opacity),null!=t.color&&this.attr(\"stop-color\",t.color),null!=t.offset&&this.attr(\"offset\",t.offset),this)}}),$(Ue,{rx:zt,ry:Vt,from:Kt,to:te}),q(Ue,\"Runner\");class Ke extends qt{constructor(t,e=t){super(B(\"svg\",t),e),this.namespace()}defs(){return this.isRoot()?N(this.node.querySelector(\"defs\"))||this.put(new Yt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof _.window.SVGElement)&&\"#document-fragment\"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:y,version:\"1.1\"}).attr(\"xmlns:xlink\",x,b).attr(\"xmlns:svgjs\",M,b):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr(\"xmlns:xlink\",null,b).attr(\"xmlns:svgjs\",null,b)}root(){return this.isRoot()?this:super.root()}}s({Container:{nested:G((function(){return this.put(new Ke)}))}}),q(Ke,\"Svg\",!0);class tr extends qt{constructor(t,e=t){super(B(\"symbol\",t),e)}}s({Container:{symbol:G((function(){return this.put(new tr)}))}}),q(tr,\"Symbol\");var er={__proto__:null,plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(_.document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()},x:function(t,e=this.bbox()){return null==t?e.x:this.attr(\"x\",this.attr(\"x\")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr(\"y\",this.attr(\"y\")+t-e.y)},move:function(t,e,r=this.bbox()){return this.x(t,r).y(e,r)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr(\"x\",this.attr(\"x\")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr(\"y\",this.attr(\"y\")+t-e.cy)},center:function(t,e,r=this.bbox()){return this.cx(t,r).cy(e,r)},ax:function(t){return this.attr(\"x\",t)},ay:function(t){return this.attr(\"y\",t)},amove:function(t,e){return this.ax(t).ay(e)},build:function(t){return this._build=!!t,this}};class rr extends Dt{constructor(t,e=t){super(B(\"text\",t),e),this.dom.leading=new kt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new kt(t),this.rebuild())}rebuild(t){if(\"boolean\"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const r=this.dom.leading;this.each((function(n){const i=_.window.getComputedStyle(this.node).getPropertyValue(\"font-size\"),s=r*new kt(i);this.dom.newLined&&(this.attr(\"x\",t.attr(\"x\")),\"\\n\"===this.text()?e+=s:(this.attr(\"dy\",n?s+e:0),e=0))})),this.fire(\"rebuild\")}return this}setData(t){return this.dom=t,this.dom.leading=new kt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let r=0;t=\"\";for(let n=0,i=e.length;n{let i;try{i=r.bbox()}catch(t){return}const s=new ft(r),o=s.translate(t,e).transform(s.inverse()),a=new ct(i.x,i.y).transform(o);r.move(a.x,a.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)},size:function(t,e,r=this.bbox()){const n=p(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach(((t,e)=>{const n=new ct(r).transform(new ft(t).inverse());t.scale(i,s,n.x,n.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}};class hr extends qt{constructor(t,e=t){super(B(\"g\",t),e)}}$(hr,ar),s({Container:{group:G((function(){return this.put(new hr)}))}}),q(hr,\"G\");class ur extends qt{constructor(t,e=t){super(B(\"a\",t),e)}target(t){return this.attr(\"target\",t)}to(t){return this.attr(\"href\",t,x)}}$(ur,ar),s({Container:{link:G((function(t){return this.put(new ur).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const r=e.index(t);return e.add(this,r),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new ur,this.wrap(e)),\"function\"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&\"a\"===t.node.nodeName.toLowerCase()?t:null}}}),q(ur,\"A\");class cr extends qt{constructor(t,e=t){super(B(\"mask\",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return bt('svg [mask*=\"'+this.id()+'\"]')}}s({Container:{mask:G((function(){return this.defs().put(new cr)}))},Element:{masker(){return this.reference(\"mask\")},maskWith(t){const e=t instanceof cr?t:this.parent().mask().add(t);return this.attr(\"mask\",'url(\"#'+e.id()+'\")')},unmask(){return this.attr(\"mask\",null)}}}),q(cr,\"Mask\");class lr extends Ft{constructor(t,e=t){super(B(\"stop\",t),e)}update(t){return(\"number\"==typeof t||t instanceof kt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr(\"stop-opacity\",t.opacity),null!=t.color&&this.attr(\"stop-color\",t.color),null!=t.offset&&this.attr(\"offset\",new kt(t.offset)),this}}s({Gradient:{stop:function(t,e,r){return this.put(new lr).update(t,e,r)}}}),q(lr,\"Stop\");class fr extends Ft{constructor(t,e=t){super(B(\"style\",t),e)}addText(t=\"\"){return this.node.textContent+=t,this}font(t,e,r={}){return this.rule(\"@font-face\",{fontFamily:t,src:e,...r})}rule(t,e){return this.addText(function(t,e){if(!t)return\"\";if(!e)return t;let r=t+\"{\";for(const t in e)r+=f(t)+\":\"+e[t]+\";\";return r+=\"}\",r}(t,e))}}s(\"Dom\",{style(t,e){return this.put(new fr).rule(t,e)},fontface(t,e,r){return this.put(new fr).font(t,e,r)}}),q(fr,\"Style\");class dr extends rr{constructor(t,e=t){super(B(\"textPath\",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let r=null;return e&&(r=e.plot(t)),null==t?r:this}track(){return this.reference(\"href\")}}s({Container:{textPath:G((function(t,e){return t instanceof rr||(t=this.text(t)),t.path(e)}))},Text:{path:G((function(t,e=!0){const r=new dr;let n;if(t instanceof Fe||(t=this.defs().path(t)),r.attr(\"href\",\"#\"+t,x),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)})),textPath(){return this.findOne(\"textPath\")}},Path:{text:G((function(t){return t instanceof rr||(t=(new rr).addTo(this.parent()).text(t)),t.path(this)})),targets(){return bt(\"svg textPath\").filter((t=>(t.attr(\"href\")||\"\").includes(this.id())))}}}),dr.prototype.MorphArray=Ee,q(dr,\"TextPath\");class pr extends Dt{constructor(t,e=t){super(B(\"use\",t),e)}use(t,e){return this.attr(\"href\",(e||\"\")+\"#\"+t,x)}}s({Container:{use:G((function(t,e){return this.put(new pr).use(t,e)}))}}),q(pr,\"Use\");const mr=k;$([Ke,tr,se,ie,ue],o(\"viewbox\")),$([he,Ye,qe,Fe],o(\"marker\")),$(rr,o(\"Text\")),$(Fe,o(\"Path\")),$(Yt,o(\"Defs\")),$([rr,nr],o(\"Tspan\")),$([De,Wt,ne,Ue],o(\"radius\")),$(Ot,o(\"EventTarget\")),$(Nt,o(\"Dom\")),$(Ft,o(\"Element\")),$(Dt,o(\"Shape\")),$([qt,Jt],o(\"Container\")),$(ne,o(\"Gradient\")),$(Ue,o(\"Runner\")),yt.extend([...new Set(i)]),Be([kt,ut,mt,ft,Lt,oe,Ee]),Ne()},725:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.rgbToHsl=e.hslToRgb=e.rgbToHex=void 0,e.rgbToHex=function(t,e,r){return`#${((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}`},e.hslToRgb=function(t,e,r){let n,i,s;if(t/=360,r/=100,0==(e/=100))n=i=s=r;else{const o=(t,e,r)=>(r+=r<0?1:r>1?-1:0)<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,a=r<.5?r*(1+e):r+e-r*e,h=2*r-a;n=o(h,a,t+1/3),i=o(h,a,t),s=o(h,a,t-1/3)}return[.5+255*n<<0,.5+255*i<<0,.5+255*s<<0]},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;const n=Math.max(t,e,r),i=Math.min(t,e,r),s=(n+i)/2;let o,a;if(n===i)o=a=0;else{const h=n-i;switch(a=s>.5?h/(2-n-i):h/(n+i),n){case t:o=(e-r)/h+(e{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.default={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\",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\",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\",rebeccapurple:\"#663399\",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\",wheat:\"#f5deb3\",white:\"#ffffff\",whitesmoke:\"#f5f5f5\",yellow:\"#ffff00\",yellowgreen:\"#9acd32\"}},688:function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(785),e),i(r(725),e),i(r(951),e)},951:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.parseColor=e.parseColorAndConvert=void 0;const n=r(202),i=r(725);function s(t){if(\"number\"==typeof t)return t>16777215?{type:\"rgb\",a:t>>24&255,b:t>>16&255,c:t>>8&255,alpha:(255&t)/255}:{type:\"rgb\",a:t>>16&255,b:t>>8&255,c:255&t,alpha:1};t=t.replace(/\\s/g,\"\"),n.default[t]&&(t=n.default[t]);let e=/^#([0-9a-f]{3,8})$/i.exec(t);if(e){const t=e[1];return 3===t.length?{type:\"rgb\",a:parseInt(t[0]+t[0],16),b:parseInt(t[1]+t[1],16),c:parseInt(t[2]+t[2],16),alpha:1}:{type:\"rgb\",a:parseInt(t[0]+t[1],16),b:parseInt(t[2]+t[3],16),c:parseInt(t[4]+t[5],16),alpha:t.length>6?parseInt(t.substring(6),16)/255:1}}if(e=/^((hsl|rgb)a?)\\((\\d+),(\\d+)%?,(\\d+)%?,?(.+)?\\)$/i.exec(t),e){const[,,t,r,n,i,s]=e;return{type:t,a:+r,b:+n,c:+i,alpha:s?+s:1}}}e.parseColorAndConvert=function(t){const e=s(t);if(e){if(\"hsl\"===e.type){const[t,r,n]=i.hslToRgb(e.a,e.b,e.c);return{r:t,g:r,b:n,h:e.a,s:e.b,l:e.c,alpha:e.alpha}}{const[t,r,n]=i.rgbToHsl(e.a,e.b,e.c);return{h:t,s:r,l:n,r:e.a,g:e.b,b:e.c,alpha:e.alpha}}}},e.parseColor=s},785:(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},926:t=>{var e;window,e=function(){return(()=>{var t=[function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),e.mod=e.log=e.PI2=e.PHI=e.Vec2=e.distributePointsInBuffer=e.prepareBufferForInterpolation=e.interpolate=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.now=e.toRadians=e.toDegrees=e.relativeClamp=e.clamp=e.lerp=void 0,i(r(1),e),r(10).glMatrix.setMatrixArrayType(Array),i(r(21),e),i(r(22),e),i(r(23),e),i(r(24),e),i(r(33),e),i(r(34),e),i(r(35),e),i(r(32),e),i(r(36),e),i(r(37),e),i(r(38),e),i(r(39),e),i(r(40),e),i(r(41),e),i(r(42),e),i(r(43),e),i(r(44),e),i(r(45),e),i(r(46),e),i(r(47),e),i(r(29),e),i(r(48),e);var s=r(30);Object.defineProperty(e,\"lerp\",{enumerable:!0,get:function(){return s.lerp}}),Object.defineProperty(e,\"clamp\",{enumerable:!0,get:function(){return s.clamp}}),Object.defineProperty(e,\"relativeClamp\",{enumerable:!0,get:function(){return s.relativeClamp}}),Object.defineProperty(e,\"toDegrees\",{enumerable:!0,get:function(){return s.toDegrees}}),Object.defineProperty(e,\"toRadians\",{enumerable:!0,get:function(){return s.toRadians}}),Object.defineProperty(e,\"now\",{enumerable:!0,get:function(){return s.now}}),Object.defineProperty(e,\"noise\",{enumerable:!0,get:function(){return s.noise}}),Object.defineProperty(e,\"random\",{enumerable:!0,get:function(){return s.random}}),Object.defineProperty(e,\"angleFromRepetition\",{enumerable:!0,get:function(){return s.angleFromRepetition}}),Object.defineProperty(e,\"angle2FromRepetition\",{enumerable:!0,get:function(){return s.angle2FromRepetition}}),Object.defineProperty(e,\"distanceFromRepetition\",{enumerable:!0,get:function(){return s.distanceFromRepetition}}),Object.defineProperty(e,\"interpolate\",{enumerable:!0,get:function(){return s.interpolate}}),Object.defineProperty(e,\"prepareBufferForInterpolation\",{enumerable:!0,get:function(){return s.prepareBufferForInterpolation}}),Object.defineProperty(e,\"distributePointsInBuffer\",{enumerable:!0,get:function(){return s.distributePointsInBuffer}});var o=r(26);Object.defineProperty(e,\"Vec2\",{enumerable:!0,get:function(){return o.default}});var a=r(27);Object.defineProperty(e,\"PHI\",{enumerable:!0,get:function(){return a.PHI}}),Object.defineProperty(e,\"PI2\",{enumerable:!0,get:function(){return a.PI2}}),Object.defineProperty(e,\"log\",{enumerable:!0,get:function(){return a.log}}),Object.defineProperty(e,\"mod\",{enumerable:!0,get:function(){return a.mod}})},function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(2),e),i(r(3),e),i(r(4),e),i(r(5),e),i(r(6),e),i(r(7),e),i(r(8),e),i(r(9),e)},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e)=>{\"use strict\";var r;Object.defineProperty(e,\"__esModule\",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]=\"Ring\",r[r.Matrix=2]=\"Matrix\"},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e)=>{\"use strict\";var r;Object.defineProperty(e,\"__esModule\",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]=\"Relative\",r[r.Fixed=2]=\"Fixed\"},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>s,mat3:()=>o,mat4:()=>a,quat:()=>h,quat2:()=>u,vec2:()=>c,vec3:()=>l,vec4:()=>f});var n=r(11),i=r(12),s=r(13),o=r(14),a=r(15),h=r(16),u=r(19),c=r(20),l=r(18),f=r(17)},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{EPSILON:()=>n,ARRAY_TYPE:()=>i,RANDOM:()=>s,setMatrixArrayType:()=>o,toRadian:()=>h,equals:()=>u});var n=1e-6,i=\"undefined\"!=typeof Float32Array?Float32Array:Array,s=Math.random;function o(t){i=t}var a=Math.PI/180;function h(t){return t*a}function u(t,e){return Math.abs(t-e)<=n*Math.max(1,Math.abs(t),Math.abs(e))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,identity:()=>a,fromValues:()=>h,set:()=>u,transpose:()=>c,invert:()=>l,adjoint:()=>f,determinant:()=>d,multiply:()=>p,rotate:()=>m,scale:()=>g,fromRotation:()=>y,fromScaling:()=>v,str:()=>b,frob:()=>x,LDU:()=>M,add:()=>w,subtract:()=>_,exactEquals:()=>S,equals:()=>A,multiplyScalar:()=>P,multiplyScalarAndAdd:()=>E,mul:()=>O,sub:()=>I});var n=r(11);function i(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function s(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function a(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function h(t,e,r,i){var s=new n.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=r,s[3]=i,s}function u(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function c(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function l(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*s-i*n;return o?(o=1/o,t[0]=s*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}function f(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function d(t){return t[0]*t[3]-t[2]*t[1]}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*a+s*h,t[1]=i*a+o*h,t[2]=n*u+s*c,t[3]=i*u+o*c,t}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+s*a,t[1]=i*h+o*a,t[2]=n*-a+s*h,t[3]=i*-a+o*h,t}function g(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1];return t[0]=n*a,t[1]=i*a,t[2]=s*h,t[3]=o*h,t}function y(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function v(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function b(t){return\"mat2(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}function x(t){return Math.hypot(t[0],t[1],t[2],t[3])}function M(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function w(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function _(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function S(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function A(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=e[0],h=e[1],u=e[2],c=e[3];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-h)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-u)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}function P(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function E(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}var O=p,I=_},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,identity:()=>a,fromValues:()=>h,set:()=>u,invert:()=>c,determinant:()=>l,multiply:()=>f,rotate:()=>d,scale:()=>p,translate:()=>m,fromRotation:()=>g,fromScaling:()=>y,fromTranslation:()=>v,str:()=>b,frob:()=>x,add:()=>M,subtract:()=>w,multiplyScalar:()=>_,multiplyScalarAndAdd:()=>S,exactEquals:()=>A,equals:()=>P,mul:()=>E,sub:()=>O});var n=r(11);function i(){var t=new n.ARRAY_TYPE(6);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function s(t){var e=new n.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function a(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function h(t,e,r,i,s,o){var a=new n.ARRAY_TYPE(6);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a[4]=s,a[5]=o,a}function u(t,e,r,n,i,s,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t}function c(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=r*s-n*i;return h?(h=1/h,t[0]=s*h,t[1]=-n*h,t[2]=-i*h,t[3]=r*h,t[4]=(i*a-s*o)*h,t[5]=(n*o-r*a)*h,t):null}function l(t){return t[0]*t[3]-t[1]*t[2]}function f(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1],l=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*u+s*c,t[1]=i*u+o*c,t[2]=n*l+s*f,t[3]=i*l+o*f,t[4]=n*d+s*p+a,t[5]=i*d+o*p+h,t}function d(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*u,t[1]=i*c+o*u,t[2]=n*-u+s*c,t[3]=i*-u+o*c,t[4]=a,t[5]=h,t}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1];return t[0]=n*u,t[1]=i*u,t[2]=s*c,t[3]=o*c,t[4]=a,t[5]=h,t}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=n*u+s*c+a,t[5]=i*u+o*c+h,t}function g(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function y(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function v(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function b(t){return\"mat2d(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\")\"}function x(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function M(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function w(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function _(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function S(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function A(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function P(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=e[0],c=e[1],l=e[2],f=e[3],d=e[4],p=e[5];return Math.abs(r-u)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-c)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(s-l)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(o-f)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-d)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(h-p)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(p))}var E=f,O=w},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,fromMat4:()=>s,clone:()=>o,copy:()=>a,fromValues:()=>h,set:()=>u,identity:()=>c,transpose:()=>l,invert:()=>f,adjoint:()=>d,determinant:()=>p,multiply:()=>m,translate:()=>g,rotate:()=>y,scale:()=>v,fromTranslation:()=>b,fromRotation:()=>x,fromScaling:()=>M,fromMat2d:()=>w,fromQuat:()=>_,normalFromMat4:()=>S,projection:()=>A,str:()=>P,frob:()=>E,add:()=>O,subtract:()=>I,multiplyScalar:()=>R,multiplyScalarAndAdd:()=>C,exactEquals:()=>T,equals:()=>L,mul:()=>k,sub:()=>B});var n=r(11);function i(){var t=new n.ARRAY_TYPE(9);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function o(t){var e=new n.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function h(t,e,r,i,s,o,a,h,u){var c=new n.ARRAY_TYPE(9);return c[0]=t,c[1]=e,c[2]=r,c[3]=i,c[4]=s,c[5]=o,c[6]=a,c[7]=h,c[8]=u,c}function u(t,e,r,n,i,s,o,a,h,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t}function c(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function l(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function f(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=c*o-a*u,f=-c*s+a*h,d=u*s-o*h,p=r*l+n*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-c*n+i*u)*p,t[2]=(a*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*h)*p,t[5]=(-a*r+i*s)*p,t[6]=d*p,t[7]=(-u*r+n*h)*p,t[8]=(o*r-n*s)*p,t):null}function d(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8];return t[0]=o*c-a*u,t[1]=i*u-n*c,t[2]=n*a-i*o,t[3]=a*h-s*c,t[4]=r*c-i*h,t[5]=i*s-r*a,t[6]=s*u-o*h,t[7]=n*h-r*u,t[8]=r*o-n*s,t}function p(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],h=t[7],u=t[8];return e*(u*s-o*h)+r*(-u*i+o*a)+n*(h*i-s*a)}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=r[0],d=r[1],p=r[2],m=r[3],g=r[4],y=r[5],v=r[6],b=r[7],x=r[8];return t[0]=f*n+d*o+p*u,t[1]=f*i+d*a+p*c,t[2]=f*s+d*h+p*l,t[3]=m*n+g*o+y*u,t[4]=m*i+g*a+y*c,t[5]=m*s+g*h+y*l,t[6]=v*n+b*o+x*u,t[7]=v*i+b*a+x*c,t[8]=v*s+b*h+x*l,t}function g(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=h,t[6]=f*n+d*o+u,t[7]=f*i+d*a+c,t[8]=f*s+d*h+l,t}function y(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*a,t[2]=d*s+f*h,t[3]=d*o-f*n,t[4]=d*a-f*i,t[5]=d*h-f*s,t[6]=u,t[7]=c,t[8]=l,t}function v(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function b(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function x(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function M(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function w(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function _(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,h=i+i,u=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*h,m=s*o,g=s*a,y=s*h;return t[0]=1-l-p,t[3]=c-y,t[6]=f+g,t[1]=c+y,t[4]=1-u-p,t[7]=d-m,t[2]=f-g,t[5]=d+m,t[8]=1-u-l,t}function S(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],y=e[15],v=r*a-n*o,b=r*h-i*o,x=r*u-s*o,M=n*h-i*a,w=n*u-s*a,_=i*u-s*h,S=c*m-l*p,A=c*g-f*p,P=c*y-d*p,E=l*g-f*m,O=l*y-d*m,I=f*y-d*g,R=v*I-b*O+x*E+M*P-w*A+_*S;return R?(R=1/R,t[0]=(a*I-h*O+u*E)*R,t[1]=(h*P-o*I-u*A)*R,t[2]=(o*O-a*P+u*S)*R,t[3]=(i*O-n*I-s*E)*R,t[4]=(r*I-i*P+s*A)*R,t[5]=(n*P-r*O-s*S)*R,t[6]=(m*_-g*w+y*M)*R,t[7]=(g*x-p*_-y*b)*R,t[8]=(p*w-m*x+y*v)*R,t):null}function A(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function P(t){return\"mat3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\")\"}function E(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function O(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function I(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function R(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function C(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function T(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function L(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=t[6],c=t[7],l=t[8],f=e[0],d=e[1],p=e[2],m=e[3],g=e[4],y=e[5],v=e[6],b=e[7],x=e[8];return Math.abs(r-f)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(i-d)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(s-p)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(o-m)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(a-g)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(h-y)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(y))&&Math.abs(u-v)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(c-b)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(l-x)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(x))}var k=m,B=I},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,fromValues:()=>a,set:()=>h,identity:()=>u,transpose:()=>c,invert:()=>l,adjoint:()=>f,determinant:()=>d,multiply:()=>p,translate:()=>m,scale:()=>g,rotate:()=>y,rotateX:()=>v,rotateY:()=>b,rotateZ:()=>x,fromTranslation:()=>M,fromScaling:()=>w,fromRotation:()=>_,fromXRotation:()=>S,fromYRotation:()=>A,fromZRotation:()=>P,fromRotationTranslation:()=>E,fromQuat2:()=>O,getTranslation:()=>I,getScaling:()=>R,getRotation:()=>C,fromRotationTranslationScale:()=>T,fromRotationTranslationScaleOrigin:()=>L,fromQuat:()=>k,frustum:()=>B,perspective:()=>N,perspectiveFromFieldOfView:()=>F,ortho:()=>j,lookAt:()=>q,targetTo:()=>Y,str:()=>D,frob:()=>z,add:()=>V,subtract:()=>$,multiplyScalar:()=>G,multiplyScalarAndAdd:()=>X,exactEquals:()=>U,equals:()=>H,mul:()=>Z,sub:()=>Q});var n=r(11);function i(){var t=new n.ARRAY_TYPE(16);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function s(t){var e=new n.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function a(t,e,r,i,s,o,a,h,u,c,l,f,d,p,m,g){var y=new n.ARRAY_TYPE(16);return y[0]=t,y[1]=e,y[2]=r,y[3]=i,y[4]=s,y[5]=o,y[6]=a,y[7]=h,y[8]=u,y[9]=c,y[10]=l,y[11]=f,y[12]=d,y[13]=p,y[14]=m,y[15]=g,y}function h(t,e,r,n,i,s,o,a,h,u,c,l,f,d,p,m,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t[9]=c,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=g,t}function u(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function c(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=i,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function l(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],y=e[15],v=r*a-n*o,b=r*h-i*o,x=r*u-s*o,M=n*h-i*a,w=n*u-s*a,_=i*u-s*h,S=c*m-l*p,A=c*g-f*p,P=c*y-d*p,E=l*g-f*m,O=l*y-d*m,I=f*y-d*g,R=v*I-b*O+x*E+M*P-w*A+_*S;return R?(R=1/R,t[0]=(a*I-h*O+u*E)*R,t[1]=(i*O-n*I-s*E)*R,t[2]=(m*_-g*w+y*M)*R,t[3]=(f*w-l*_-d*M)*R,t[4]=(h*P-o*I-u*A)*R,t[5]=(r*I-i*P+s*A)*R,t[6]=(g*x-p*_-y*b)*R,t[7]=(c*_-f*x+d*b)*R,t[8]=(o*O-a*P+u*S)*R,t[9]=(n*P-r*O-s*S)*R,t[10]=(p*w-m*x+y*v)*R,t[11]=(l*x-c*w-d*v)*R,t[12]=(a*A-o*E-h*S)*R,t[13]=(r*E-n*A+i*S)*R,t[14]=(m*b-p*M-g*v)*R,t[15]=(c*M-l*b+f*v)*R,t):null}function f(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],y=e[15];return t[0]=a*(f*y-d*g)-l*(h*y-u*g)+m*(h*d-u*f),t[1]=-(n*(f*y-d*g)-l*(i*y-s*g)+m*(i*d-s*f)),t[2]=n*(h*y-u*g)-a*(i*y-s*g)+m*(i*u-s*h),t[3]=-(n*(h*d-u*f)-a*(i*d-s*f)+l*(i*u-s*h)),t[4]=-(o*(f*y-d*g)-c*(h*y-u*g)+p*(h*d-u*f)),t[5]=r*(f*y-d*g)-c*(i*y-s*g)+p*(i*d-s*f),t[6]=-(r*(h*y-u*g)-o*(i*y-s*g)+p*(i*u-s*h)),t[7]=r*(h*d-u*f)-o*(i*d-s*f)+c*(i*u-s*h),t[8]=o*(l*y-d*m)-c*(a*y-u*m)+p*(a*d-u*l),t[9]=-(r*(l*y-d*m)-c*(n*y-s*m)+p*(n*d-s*l)),t[10]=r*(a*y-u*m)-o*(n*y-s*m)+p*(n*u-s*a),t[11]=-(r*(a*d-u*l)-o*(n*d-s*l)+c*(n*u-s*a)),t[12]=-(o*(l*g-f*m)-c*(a*g-h*m)+p*(a*f-h*l)),t[13]=r*(l*g-f*m)-c*(n*g-i*m)+p*(n*f-i*l),t[14]=-(r*(a*g-h*m)-o*(n*g-i*m)+p*(n*h-i*a)),t[15]=r*(a*f-h*l)-o*(n*f-i*l)+c*(n*h-i*a),t}function d(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],h=t[7],u=t[8],c=t[9],l=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*s)*(l*g-f*m)-(e*a-n*s)*(c*g-f*p)+(e*h-i*s)*(c*m-l*p)+(r*a-n*o)*(u*g-f*d)-(r*h-i*o)*(u*m-l*d)+(n*h-i*a)*(u*p-c*d)}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],y=e[14],v=e[15],b=r[0],x=r[1],M=r[2],w=r[3];return t[0]=b*n+x*a+M*l+w*m,t[1]=b*i+x*h+M*f+w*g,t[2]=b*s+x*u+M*d+w*y,t[3]=b*o+x*c+M*p+w*v,b=r[4],x=r[5],M=r[6],w=r[7],t[4]=b*n+x*a+M*l+w*m,t[5]=b*i+x*h+M*f+w*g,t[6]=b*s+x*u+M*d+w*y,t[7]=b*o+x*c+M*p+w*v,b=r[8],x=r[9],M=r[10],w=r[11],t[8]=b*n+x*a+M*l+w*m,t[9]=b*i+x*h+M*f+w*g,t[10]=b*s+x*u+M*d+w*y,t[11]=b*o+x*c+M*p+w*v,b=r[12],x=r[13],M=r[14],w=r[15],t[12]=b*n+x*a+M*l+w*m,t[13]=b*i+x*h+M*f+w*g,t[14]=b*s+x*u+M*d+w*y,t[15]=b*o+x*c+M*p+w*v,t}function m(t,e,r){var n,i,s,o,a,h,u,c,l,f,d,p,m=r[0],g=r[1],y=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=h,t[6]=u,t[7]=c,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+a*g+l*y+e[12],t[13]=i*m+h*g+f*y+e[13],t[14]=s*m+u*g+d*y+e[14],t[15]=o*m+c*g+p*y+e[15]),t}function g(t,e,r){var n=r[0],i=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function y(t,e,r,i){var s,o,a,h,u,c,l,f,d,p,m,g,y,v,b,x,M,w,_,S,A,P,E,O,I=i[0],R=i[1],C=i[2],T=Math.hypot(I,R,C);return T0?(r[0]=2*(h*a+l*i+u*o-c*s)/f,r[1]=2*(u*a+l*s+c*i-h*o)/f,r[2]=2*(c*a+l*o+h*s-u*i)/f):(r[0]=2*(h*a+l*i+u*o-c*s),r[1]=2*(u*a+l*s+c*i-h*o),r[2]=2*(c*a+l*o+h*s-u*i)),E(t,e,r),t}function I(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function R(t,e){var r=e[0],n=e[1],i=e[2],s=e[4],o=e[5],a=e[6],h=e[8],u=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(s,o,a),t[2]=Math.hypot(h,u,c),t}function C(t,e){var r=new n.ARRAY_TYPE(3);R(r,e);var i=1/r[0],s=1/r[1],o=1/r[2],a=e[0]*i,h=e[1]*s,u=e[2]*o,c=e[4]*i,l=e[5]*s,f=e[6]*o,d=e[8]*i,p=e[9]*s,m=e[10]*o,g=a+l+m,y=0;return g>0?(y=2*Math.sqrt(g+1),t[3]=.25*y,t[0]=(f-p)/y,t[1]=(d-u)/y,t[2]=(h-c)/y):a>l&&a>m?(y=2*Math.sqrt(1+a-l-m),t[3]=(f-p)/y,t[0]=.25*y,t[1]=(h+c)/y,t[2]=(d+u)/y):l>m?(y=2*Math.sqrt(1+l-a-m),t[3]=(d-u)/y,t[0]=(h+c)/y,t[1]=.25*y,t[2]=(f+p)/y):(y=2*Math.sqrt(1+m-a-l),t[3]=(h-c)/y,t[0]=(d+u)/y,t[1]=(f+p)/y,t[2]=.25*y),t}function T(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3],h=i+i,u=s+s,c=o+o,l=i*h,f=i*u,d=i*c,p=s*u,m=s*c,g=o*c,y=a*h,v=a*u,b=a*c,x=n[0],M=n[1],w=n[2];return t[0]=(1-(p+g))*x,t[1]=(f+b)*x,t[2]=(d-v)*x,t[3]=0,t[4]=(f-b)*M,t[5]=(1-(l+g))*M,t[6]=(m+y)*M,t[7]=0,t[8]=(d+v)*w,t[9]=(m-y)*w,t[10]=(1-(l+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function L(t,e,r,n,i){var s=e[0],o=e[1],a=e[2],h=e[3],u=s+s,c=o+o,l=a+a,f=s*u,d=s*c,p=s*l,m=o*c,g=o*l,y=a*l,v=h*u,b=h*c,x=h*l,M=n[0],w=n[1],_=n[2],S=i[0],A=i[1],P=i[2],E=(1-(m+y))*M,O=(d+x)*M,I=(p-b)*M,R=(d-x)*w,C=(1-(f+y))*w,T=(g+v)*w,L=(p+b)*_,k=(g-v)*_,B=(1-(f+m))*_;return t[0]=E,t[1]=O,t[2]=I,t[3]=0,t[4]=R,t[5]=C,t[6]=T,t[7]=0,t[8]=L,t[9]=k,t[10]=B,t[11]=0,t[12]=r[0]+S-(E*S+R*A+L*P),t[13]=r[1]+A-(O*S+C*A+k*P),t[14]=r[2]+P-(I*S+T*A+B*P),t[15]=1,t}function k(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,h=i+i,u=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*h,m=s*o,g=s*a,y=s*h;return t[0]=1-l-p,t[1]=c+y,t[2]=f-g,t[3]=0,t[4]=c-y,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-u-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function B(t,e,r,n,i,s,o){var a=1/(r-e),h=1/(i-n),u=1/(s-o);return t[0]=2*s*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*h,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*h,t[10]=(o+s)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*u,t[15]=0,t}function N(t,e,r,n,i){var s,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(s=1/(n-i),t[10]=(i+n)*s,t[14]=2*i*n*s):(t[10]=-1,t[14]=-2*n),t}function F(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),h=2/(o+a),u=2/(i+s);return t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-a)*h*.5,t[9]=(i-s)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function j(t,e,r,n,i,s,o){var a=1/(e-r),h=1/(n-i),u=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*h,t[14]=(o+s)*u,t[15]=1,t}function q(t,e,r,i){var s,o,a,h,c,l,f,d,p,m,g=e[0],y=e[1],v=e[2],b=i[0],x=i[1],M=i[2],w=r[0],_=r[1],S=r[2];return Math.abs(g-w)0&&(c*=d=1/Math.sqrt(d),l*=d,f*=d);var p=h*f-u*l,m=u*c-a*f,g=a*l-h*c;return(d=p*p+m*m+g*g)>0&&(p*=d=1/Math.sqrt(d),m*=d,g*=d),t[0]=p,t[1]=m,t[2]=g,t[3]=0,t[4]=l*g-f*m,t[5]=f*p-c*g,t[6]=c*m-l*p,t[7]=0,t[8]=c,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=s,t[14]=o,t[15]=1,t}function D(t){return\"mat4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\", \"+t[9]+\", \"+t[10]+\", \"+t[11]+\", \"+t[12]+\", \"+t[13]+\", \"+t[14]+\", \"+t[15]+\")\"}function z(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function V(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function $(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function G(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function X(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function U(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function H(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=t[6],c=t[7],l=t[8],f=t[9],d=t[10],p=t[11],m=t[12],g=t[13],y=t[14],v=t[15],b=e[0],x=e[1],M=e[2],w=e[3],_=e[4],S=e[5],A=e[6],P=e[7],E=e[8],O=e[9],I=e[10],R=e[11],C=e[12],T=e[13],L=e[14],k=e[15];return Math.abs(r-b)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(s-M)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(o-w)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-_)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(h-S)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(u-A)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(c-P)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(P))&&Math.abs(l-E)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(f-O)<=n.EPSILON*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(d-I)<=n.EPSILON*Math.max(1,Math.abs(d),Math.abs(I))&&Math.abs(p-R)<=n.EPSILON*Math.max(1,Math.abs(p),Math.abs(R))&&Math.abs(m-C)<=n.EPSILON*Math.max(1,Math.abs(m),Math.abs(C))&&Math.abs(g-T)<=n.EPSILON*Math.max(1,Math.abs(g),Math.abs(T))&&Math.abs(y-L)<=n.EPSILON*Math.max(1,Math.abs(y),Math.abs(L))&&Math.abs(v-k)<=n.EPSILON*Math.max(1,Math.abs(v),Math.abs(k))}var Z=p,Q=$},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>a,identity:()=>h,setAxisAngle:()=>u,getAxisAngle:()=>c,getAngle:()=>l,multiply:()=>f,rotateX:()=>d,rotateY:()=>p,rotateZ:()=>m,calculateW:()=>g,exp:()=>y,ln:()=>v,pow:()=>b,slerp:()=>x,random:()=>M,invert:()=>w,conjugate:()=>_,fromMat3:()=>S,fromEuler:()=>A,str:()=>P,clone:()=>L,fromValues:()=>k,copy:()=>B,set:()=>N,add:()=>F,mul:()=>j,scale:()=>q,dot:()=>Y,lerp:()=>D,length:()=>z,len:()=>V,squaredLength:()=>$,sqrLen:()=>G,normalize:()=>X,exactEquals:()=>U,equals:()=>H,rotationTo:()=>Z,sqlerp:()=>Q,setAxes:()=>W});var n=r(11),i=r(14),s=r(18),o=r(17);function a(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function h(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function u(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function c(t,e){var r=2*Math.acos(e[3]),i=Math.sin(r/2);return i>n.EPSILON?(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i):(t[0]=1,t[1]=0,t[2]=0),r}function l(t,e){var r=Y(t,e);return Math.acos(2*r*r-1)}function f(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*c+o*a+i*u-s*h,t[1]=i*c+o*h+s*a-n*u,t[2]=s*c+o*u+n*h-i*a,t[3]=o*c-n*a-i*h-s*u,t}function d(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+o*a,t[1]=i*h+s*a,t[2]=s*h-i*a,t[3]=o*h-n*a,t}function p(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h-s*a,t[1]=i*h+o*a,t[2]=s*h+n*a,t[3]=o*h-i*a,t}function m(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=n*h+i*a,t[1]=i*h-n*a,t[2]=s*h+o*a,t[3]=o*h-s*a,t}function g(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function y(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=Math.exp(s),h=o>0?a*Math.sin(o)/o:0;return t[0]=r*h,t[1]=n*h,t[2]=i*h,t[3]=a*Math.cos(o),t}function v(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=o>0?Math.atan2(o,s)/o:0;return t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=.5*Math.log(r*r+n*n+i*i+s*s),t}function b(t,e,r){return v(t,e),q(t,t,r),y(t,t),t}function x(t,e,r,i){var s,o,a,h,u,c=e[0],l=e[1],f=e[2],d=e[3],p=r[0],m=r[1],g=r[2],y=r[3];return(o=c*p+l*m+f*g+d*y)<0&&(o=-o,p=-p,m=-m,g=-g,y=-y),1-o>n.EPSILON?(s=Math.acos(o),a=Math.sin(s),h=Math.sin((1-i)*s)/a,u=Math.sin(i*s)/a):(h=1-i,u=i),t[0]=h*c+u*p,t[1]=h*l+u*m,t[2]=h*f+u*g,t[3]=h*d+u*y,t}function M(t){var e=n.RANDOM(),r=n.RANDOM(),i=n.RANDOM(),s=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=s*Math.sin(2*Math.PI*r),t[1]=s*Math.cos(2*Math.PI*r),t[2]=o*Math.sin(2*Math.PI*i),t[3]=o*Math.cos(2*Math.PI*i),t}function w(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s,a=o?1/o:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=s*a,t}function _(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function S(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var s=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*s+s]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*s+o]-e[3*o+s])*r,t[s]=(e[3*s+i]+e[3*i+s])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t}function A(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var s=Math.sin(e),o=Math.cos(e),a=Math.sin(r),h=Math.cos(r),u=Math.sin(n),c=Math.cos(n);return t[0]=s*h*c-o*a*u,t[1]=o*a*c+s*h*u,t[2]=o*h*u-s*a*c,t[3]=o*h*c+s*a*u,t}function P(t){return\"quat(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}var E,O,I,R,C,T,L=o.clone,k=o.fromValues,B=o.copy,N=o.set,F=o.add,j=f,q=o.scale,Y=o.dot,D=o.lerp,z=o.length,V=z,$=o.squaredLength,G=$,X=o.normalize,U=o.exactEquals,H=o.equals,Z=(E=s.create(),O=s.fromValues(1,0,0),I=s.fromValues(0,1,0),function(t,e,r){var n=s.dot(e,r);return n<-.999999?(s.cross(E,O,e),s.len(E)<1e-6&&s.cross(E,I,e),s.normalize(E,E),u(t,E,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(s.cross(E,e,r),t[0]=E[0],t[1]=E[1],t[2]=E[2],t[3]=1+n,X(t,t))}),Q=(R=a(),C=a(),function(t,e,r,n,i,s){return x(R,e,i,s),x(C,r,n,s),x(t,R,C,2*s*(1-s)),t}),W=(T=i.create(),function(t,e,r,n){return T[0]=r[0],T[3]=r[1],T[6]=r[2],T[1]=n[0],T[4]=n[1],T[7]=n[2],T[2]=-e[0],T[5]=-e[1],T[8]=-e[2],X(t,S(t,T))})},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,fromValues:()=>o,copy:()=>a,set:()=>h,add:()=>u,subtract:()=>c,multiply:()=>l,divide:()=>f,ceil:()=>d,floor:()=>p,min:()=>m,max:()=>g,round:()=>y,scale:()=>v,scaleAndAdd:()=>b,distance:()=>x,squaredDistance:()=>M,length:()=>w,squaredLength:()=>_,negate:()=>S,inverse:()=>A,normalize:()=>P,dot:()=>E,cross:()=>O,lerp:()=>I,random:()=>R,transformMat4:()=>C,transformQuat:()=>T,zero:()=>L,str:()=>k,exactEquals:()=>B,equals:()=>N,sub:()=>j,mul:()=>q,div:()=>Y,dist:()=>D,sqrDist:()=>z,len:()=>V,sqrLen:()=>$,forEach:()=>G});var n=r(11);function i(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function s(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(t,e,r,i){var s=new n.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=r,s[3]=i,s}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function h(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function u(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function l(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}function f(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function m(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}function g(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}function y(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function v(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function b(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}function x(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return Math.hypot(r,n,i,s)}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return r*r+n*n+i*i+s*s}function w(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}function _(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function A(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function P(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s;return o>0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=s*o,t}function E(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function O(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],s=r[0]*n[2]-r[2]*n[0],o=r[0]*n[3]-r[3]*n[0],a=r[1]*n[2]-r[2]*n[1],h=r[1]*n[3]-r[3]*n[1],u=r[2]*n[3]-r[3]*n[2],c=e[0],l=e[1],f=e[2],d=e[3];return t[0]=l*u-f*h+d*a,t[1]=-c*u+f*o-d*s,t[2]=c*h-l*o+d*i,t[3]=-c*a+l*s-f*i,t}function I(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t[3]=a+n*(r[3]-a),t}function R(t,e){var r,i,s,o,a,h;e=e||1;do{a=(r=2*n.RANDOM()-1)*r+(i=2*n.RANDOM()-1)*i}while(a>=1);do{h=(s=2*n.RANDOM()-1)*s+(o=2*n.RANDOM()-1)*o}while(h>=1);var u=Math.sqrt((1-a)/h);return t[0]=e*r,t[1]=e*i,t[2]=e*s*u,t[3]=e*o*u,t}function C(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*s+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*s+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*s+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*s+r[15]*o,t}function T(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],h=r[2],u=r[3],c=u*n+a*s-h*i,l=u*i+h*n-o*s,f=u*s+o*i-a*n,d=-o*n-a*i-h*s;return t[0]=c*u+d*-o+l*-h-f*-a,t[1]=l*u+d*-a+f*-o-c*-h,t[2]=f*u+d*-h+c*-a-l*-o,t[3]=e[3],t}function L(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function k(t){return\"vec4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}function B(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function N(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=e[0],h=e[1],u=e[2],c=e[3];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-h)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-u)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}var F,j=c,q=l,Y=f,D=x,z=M,V=w,$=_,G=(F=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=4),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,length:()=>o,fromValues:()=>a,copy:()=>h,set:()=>u,add:()=>c,subtract:()=>l,multiply:()=>f,divide:()=>d,ceil:()=>p,floor:()=>m,min:()=>g,max:()=>y,round:()=>v,scale:()=>b,scaleAndAdd:()=>x,distance:()=>M,squaredDistance:()=>w,squaredLength:()=>_,negate:()=>S,inverse:()=>A,normalize:()=>P,dot:()=>E,cross:()=>O,lerp:()=>I,hermite:()=>R,bezier:()=>C,random:()=>T,transformMat4:()=>L,transformMat3:()=>k,transformQuat:()=>B,rotateX:()=>N,rotateY:()=>F,rotateZ:()=>j,angle:()=>q,zero:()=>Y,str:()=>D,exactEquals:()=>z,equals:()=>V,sub:()=>G,mul:()=>X,div:()=>U,dist:()=>H,sqrDist:()=>Z,len:()=>Q,sqrLen:()=>W,forEach:()=>J});var n=r(11);function i(){var t=new n.ARRAY_TYPE(3);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function s(t){var e=new n.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function o(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function a(t,e,r){var i=new n.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=r,i}function h(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function u(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function c(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function l(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function f(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function d(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function p(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function m(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function g(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function y(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function v(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function b(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function x(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function w(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function _(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function A(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function P(t,e){var r=e[0],n=e[1],i=e[2],s=r*r+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function E(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function O(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],h=r[2];return t[0]=i*h-s*a,t[1]=s*o-n*h,t[2]=n*a-i*o,t}function I(t,e,r,n){var i=e[0],s=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t}function R(t,e,r,n,i,s){var o=s*s,a=o*(2*s-3)+1,h=o*(s-2)+s,u=o*(s-1),c=o*(3-2*s);return t[0]=e[0]*a+r[0]*h+n[0]*u+i[0]*c,t[1]=e[1]*a+r[1]*h+n[1]*u+i[1]*c,t[2]=e[2]*a+r[2]*h+n[2]*u+i[2]*c,t}function C(t,e,r,n,i,s){var o=1-s,a=o*o,h=s*s,u=a*o,c=3*s*a,l=3*h*o,f=h*s;return t[0]=e[0]*u+r[0]*c+n[0]*l+i[0]*f,t[1]=e[1]*u+r[1]*c+n[1]*l+i[1]*f,t[2]=e[2]*u+r[2]*c+n[2]*l+i[2]*f,t}function T(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,s=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*s,t[1]=Math.sin(r)*s,t[2]=i*e,t}function L(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[3]*n+r[7]*i+r[11]*s+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*s+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*s+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*s+r[14])/o,t}function k(t,e,r){var n=e[0],i=e[1],s=e[2];return t[0]=n*r[0]+i*r[3]+s*r[6],t[1]=n*r[1]+i*r[4]+s*r[7],t[2]=n*r[2]+i*r[5]+s*r[8],t}function B(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],h=e[1],u=e[2],c=i*u-s*h,l=s*a-n*u,f=n*h-i*a,d=i*f-s*l,p=s*c-n*f,m=n*l-i*c,g=2*o;return c*=g,l*=g,f*=g,d*=2,p*=2,m*=2,t[0]=a+c+d,t[1]=h+l+p,t[2]=u+f+m,t}function N(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0],s[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),s[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function F(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),s[1]=i[1],s[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function j(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),s[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),s[2]=i[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function q(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2],h=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(s*s+o*o+a*a),u=h&&E(t,e)/h;return Math.acos(Math.min(Math.max(u,-1),1))}function Y(t){return t[0]=0,t[1]=0,t[2]=0,t}function D(t){return\"vec3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\")\"}function z(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function V(t,e){var r=t[0],i=t[1],s=t[2],o=e[0],a=e[1],h=e[2];return Math.abs(r-o)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-a)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(s-h)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(h))}var $,G=l,X=f,U=d,H=M,Z=w,Q=o,W=_,J=($=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=3),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{\"use strict\";r.r(e),r.d(e,{create:()=>o,clone:()=>a,fromValues:()=>h,fromRotationTranslationValues:()=>u,fromRotationTranslation:()=>c,fromTranslation:()=>l,fromRotation:()=>f,fromMat4:()=>d,copy:()=>p,identity:()=>m,set:()=>g,getReal:()=>y,getDual:()=>v,setReal:()=>b,setDual:()=>x,getTranslation:()=>M,translate:()=>w,rotateX:()=>_,rotateY:()=>S,rotateZ:()=>A,rotateByQuatAppend:()=>P,rotateByQuatPrepend:()=>E,rotateAroundAxis:()=>O,add:()=>I,multiply:()=>R,mul:()=>C,scale:()=>T,dot:()=>L,lerp:()=>k,invert:()=>B,conjugate:()=>N,length:()=>F,len:()=>j,squaredLength:()=>q,sqrLen:()=>Y,normalize:()=>D,str:()=>z,exactEquals:()=>V,equals:()=>$});var n=r(11),i=r(16),s=r(15);function o(){var t=new n.ARRAY_TYPE(8);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function a(t){var e=new n.ARRAY_TYPE(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function h(t,e,r,i,s,o,a,h){var u=new n.ARRAY_TYPE(8);return u[0]=t,u[1]=e,u[2]=r,u[3]=i,u[4]=s,u[5]=o,u[6]=a,u[7]=h,u}function u(t,e,r,i,s,o,a){var h=new n.ARRAY_TYPE(8);h[0]=t,h[1]=e,h[2]=r,h[3]=i;var u=.5*s,c=.5*o,l=.5*a;return h[4]=u*i+c*r-l*e,h[5]=c*i+l*t-u*r,h[6]=l*i+u*e-c*t,h[7]=-u*t-c*e-l*r,h}function c(t,e,r){var n=.5*r[0],i=.5*r[1],s=.5*r[2],o=e[0],a=e[1],h=e[2],u=e[3];return t[0]=o,t[1]=a,t[2]=h,t[3]=u,t[4]=n*u+i*h-s*a,t[5]=i*u+s*o-n*h,t[6]=s*u+n*a-i*o,t[7]=-n*o-i*a-s*h,t}function l(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function d(t,e){var r=i.create();s.getRotation(r,e);var o=new n.ARRAY_TYPE(3);return s.getTranslation(o,e),c(t,r,o),t}function p(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function m(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function g(t,e,r,n,i,s,o,a,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t}var y=i.copy;function v(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var b=i.copy;function x(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function M(t,e){var r=e[4],n=e[5],i=e[6],s=e[7],o=-e[0],a=-e[1],h=-e[2],u=e[3];return t[0]=2*(r*u+s*o+n*h-i*a),t[1]=2*(n*u+s*a+i*o-r*h),t[2]=2*(i*u+s*h+r*a-n*o),t}function w(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=.5*r[0],h=.5*r[1],u=.5*r[2],c=e[4],l=e[5],f=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=o*a+i*u-s*h+c,t[5]=o*h+s*a-n*u+l,t[6]=o*u+n*h-i*a+f,t[7]=-n*a-i*h-s*u+d,t}function _(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],h=e[4],u=e[5],c=e[6],l=e[7],f=h*a+l*n+u*o-c*s,d=u*a+l*s+c*n-h*o,p=c*a+l*o+h*s-u*n,m=l*a-h*n-u*s-c*o;return i.rotateX(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function S(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],h=e[4],u=e[5],c=e[6],l=e[7],f=h*a+l*n+u*o-c*s,d=u*a+l*s+c*n-h*o,p=c*a+l*o+h*s-u*n,m=l*a-h*n-u*s-c*o;return i.rotateY(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function A(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],h=e[4],u=e[5],c=e[6],l=e[7],f=h*a+l*n+u*o-c*s,d=u*a+l*s+c*n-h*o,p=c*a+l*o+h*s-u*n,m=l*a-h*n-u*s-c*o;return i.rotateZ(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function P(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],h=e[1],u=e[2],c=e[3];return t[0]=a*o+c*n+h*s-u*i,t[1]=h*o+c*i+u*n-a*s,t[2]=u*o+c*s+a*i-h*n,t[3]=c*o-a*n-h*i-u*s,a=e[4],h=e[5],u=e[6],c=e[7],t[4]=a*o+c*n+h*s-u*i,t[5]=h*o+c*i+u*n-a*s,t[6]=u*o+c*s+a*i-h*n,t[7]=c*o-a*n-h*i-u*s,t}function E(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],h=r[1],u=r[2],c=r[3];return t[0]=n*c+o*a+i*u-s*h,t[1]=i*c+o*h+s*a-n*u,t[2]=s*c+o*u+n*h-i*a,t[3]=o*c-n*a-i*h-s*u,a=r[4],h=r[5],u=r[6],c=r[7],t[4]=n*c+o*a+i*u-s*h,t[5]=i*c+o*h+s*a-n*u,t[6]=s*c+o*u+n*h-i*a,t[7]=o*c-n*a-i*h-s*u,t}function O(t,e,r,i){if(Math.abs(i)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,s=e[2]/r,o=e[3]/r,a=e[4],h=e[5],u=e[6],c=e[7],l=n*a+i*h+s*u+o*c;t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=(a-n*l)/r,t[5]=(h-i*l)/r,t[6]=(u-s*l)/r,t[7]=(c-o*l)/r}return t}function z(t){return\"quat2(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\")\"}function V(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function $(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],h=t[5],u=t[6],c=t[7],l=e[0],f=e[1],d=e[2],p=e[3],m=e[4],g=e[5],y=e[6],v=e[7];return Math.abs(r-l)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(i-f)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(s-d)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(o-p)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-m)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(h-g)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(g))&&Math.abs(u-y)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-v)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(v))}},(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{create:()=>i,clone:()=>s,fromValues:()=>o,copy:()=>a,set:()=>h,add:()=>u,subtract:()=>c,multiply:()=>l,divide:()=>f,ceil:()=>d,floor:()=>p,min:()=>m,max:()=>g,round:()=>y,scale:()=>v,scaleAndAdd:()=>b,distance:()=>x,squaredDistance:()=>M,length:()=>w,squaredLength:()=>_,negate:()=>S,inverse:()=>A,normalize:()=>P,dot:()=>E,cross:()=>O,lerp:()=>I,random:()=>R,transformMat2:()=>C,transformMat2d:()=>T,transformMat3:()=>L,transformMat4:()=>k,rotate:()=>B,angle:()=>N,zero:()=>F,str:()=>j,exactEquals:()=>q,equals:()=>Y,len:()=>z,sub:()=>V,mul:()=>$,div:()=>G,dist:()=>X,sqrDist:()=>U,sqrLen:()=>H,forEach:()=>Z});var n=r(11);function i(){var t=new n.ARRAY_TYPE(2);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function s(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e}function o(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r}function a(t,e){return t[0]=e[0],t[1]=e[1],t}function h(t,e,r){return t[0]=e,t[1]=r,t}function u(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function l(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function f(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function m(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function g(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function y(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function v(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function b(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function x(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function w(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function _(t){var e=t[0],r=t[1];return e*e+r*r}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t}function A(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function P(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function E(t,e){return t[0]*e[0]+t[1]*e[1]}function O(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function I(t,e,r,n){var i=e[0],s=e[1];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t}function R(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function C(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function T(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function L(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function k(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function B(t,e,r,n){var i=e[0]-r[0],s=e[1]-r[1],o=Math.sin(n),a=Math.cos(n);return t[0]=i*a-s*o+r[0],t[1]=i*o+s*a+r[1],t}function N(t,e){var r=t[0],n=t[1],i=e[0],s=e[1],o=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+s*s),a=o&&(r*i+n*s)/o;return Math.acos(Math.min(Math.max(a,-1),1))}function F(t){return t[0]=0,t[1]=0,t}function j(t){return\"vec2(\"+t[0]+\", \"+t[1]+\")\"}function q(t,e){return t[0]===e[0]&&t[1]===e[1]}function Y(t,e){var r=t[0],i=t[1],s=e[0],o=e[1];return Math.abs(r-s)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-o)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))}var D,z=w,V=c,$=l,G=f,X=x,U=M,H=_,Z=(D=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=2),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Scene=void 0;const n=r(22),i=r(23),s=r(32),o=r(30);class a{constructor(t={}){this.width=400,this.height=400,this.background=\"hsla(0, 0%, 0%, 1)\",this.color=\"hsla(0, 0%, 100%, 1)\",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?[\"number\"==typeof t.anchor[0]?(.5+.5*o.clamp(-1,1,t.anchor[0]))*this.width:\"left\"===t.anchor[0]?0:\"right\"===t.anchor[0]?this.width:this.center[0],\"number\"==typeof t.anchor[1]?(.5+.5*o.clamp(-1,1,t.anchor[1]))*this.height:\"top\"===t.anchor[1]?0:\"bottom\"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e=\"number\"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,a.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{a.propagateToChilden(t,e)})):t instanceof s.Shape&&t.shape&&(t.shape.scene=e,a.propagateToChilden(t.shape,e))}}e.Scene=a},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||\"SceneChild\",this.name=t.name||this.type+\"_\"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){\"string\"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Group=void 0;const n=r(21),i=r(22),s=r(24),o=r(28);class a extends i.SceneChild{constructor(t={}){t.type=\"Group\",super(t),this.children=[],[\"id\",\"name\",\"data\",\"order\",\"type\"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=o.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){\"object\"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=a},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeBase=void 0;const n=r(10),i=r(1),s=r(25),o=r(26),a=r(27),h=r(28),u=r(30),c=r(22),l=n.mat4.create(),f=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class m extends c.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?[\"number\"==typeof t.anchor[0]?-1*u.clamp(-1,1,t.anchor[0]):\"left\"===t.anchor[0]?1:\"right\"===t.anchor[0]?-1:0,\"number\"==typeof t.anchor[1]?-1*u.clamp(-1,1,t.anchor[1]):\"top\"===t.anchor[1]?1:\"bottom\"===t.anchor[1]?-1:0]:[0,0],this.boundingType=\"string\"==typeof t.boundingType?\"relative\"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return\"function\"!=typeof t.repetitions&&\"function\"!=typeof t.distance&&\"function\"!=typeof t.displace&&\"function\"!=typeof t.scale&&\"function\"!=typeof t.translate&&\"function\"!=typeof t.skewX&&\"function\"!=typeof t.skewY&&\"function\"!=typeof t.squeezeX&&\"function\"!=typeof t.squeezeY&&\"function\"!=typeof t.rotateX&&\"function\"!=typeof t.rotateY&&\"function\"!=typeof t.rotateZ&&\"function\"!=typeof t.transformOrigin&&\"function\"!=typeof t.perspective&&\"function\"!=typeof t.perspectiveOrigin}isStaticIndexed(){return\"function\"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return\"function\"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){\"string\"==typeof t?(r=r||\"repetitions\"==t,this.props[t]=e):(r=r||\"repetitions\"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var c,g;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const y=m.getEmptyPropArguments(this,r),v=y.repetition,b=this.getProp(\"repetitions\",y,1),x=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,M=Array.isArray(b)?b[0]*(null!==(c=b[1])&&void 0!==c?c:b[0]):b,w=Array.isArray(b)?b[0]:M,_=Array.isArray(b)?null!==(g=b[1])&&void 0!==g?g:b[0]:1,S=v.row;S.count=w;const A=v.col;A.count=_,v.count=M,v.col.count=_,v.row.count=w,v.type=x;let P=0;const E=[];let O=0;const I=n.vec2.fromValues((_-1)/2,(w-1)/2),R=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],C=[void 0,void 0,void 0,void 0],T=[void 0,void 0,void 0,void 0];for(let r=0;r1?O/(M-1):1,v.angle=x===i.ERepetitionType.Ring?a.PI2/M*O:0,A.index=c+1,A.offset=_>1?c/(_-1):1,S.index=r+1,S.offset=w>1?r/(w-1):1;const m=this.generateBuffer(t,y),g=m.length,b=this.getShapeBounding();E[O]=new Float32Array(g),P+=g;{const t=s.toVec2(this.getProp(\"distance\",y,s.VEC2_ZERO)),a=this.getProp(\"displace\",y,0),M=s.toVec3(this.getProp(\"scale\",y,s.VEC2_ONE),1),w=s.toVec3(this.getProp(\"translate\",y,s.VEC2_ZERO),0),_=this.getProp(\"skewX\",y,0),S=this.getProp(\"skewY\",y,0),A=this.getProp(\"squeezeX\",y,0),P=this.getProp(\"squeezeY\",y,0),L=this.getProp(\"rotateX\",y,0),k=this.getProp(\"rotateY\",y,0),B=this.getProp(\"rotateZ\",y,0),N=u.clamp(0,1,this.getProp(\"perspective\",y,0)),F=s.toVec3(this.getProp(\"perspectiveOrigin\",y,s.VEC2_ZERO),0),j=s.toVec3(this.getProp(\"transformOrigin\",y,s.VEC2_ZERO),0);let q;switch(x){case i.ERepetitionType.Ring:q=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(q,q,s.VEC3_ZERO,v.angle+a);break;case i.ERepetitionType.Matrix:q=n.vec3.fromValues(t[1]*(c-I[0]),t[0]*(r-I[1]),0)}const Y=N>0?Math.max(b.width,b.height)/2:1,D=N>0?Y+10*Y*(1-N):0,z=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==N||0!==j[0]||0!==j[1],V=0!==F[0]||0!==F[1];z&&(this.boundingType===i.EBoundingType.Relative?(j[0]=j[0]*(b.width/2)+b.cx,j[1]=j[1]*(b.height/2)+b.cy):(j[0]*=b.width/2,j[1]*=b.height/2),j[2]=D);{n.mat4.identity(f),z&&n.mat4.translate(f,f,j),0===w[0]&&0===w[1]||n.mat4.translate(f,f,w),0===_&&0===S||(s.fromSkew(l,[_,S]),n.mat4.multiply(f,f,l)),0!==L&&n.mat4.rotateX(f,f,L),0!==k&&n.mat4.rotateY(f,f,k),0!==B&&n.mat4.rotateZ(f,f,B),1===M[0]&&1===M[1]||n.mat4.scale(f,f,M),z&&n.mat4.translate(f,f,n.vec3.scale(j,j,-1)),D>0&&(V&&(this.boundingType===i.EBoundingType.Relative?(F[0]=F[0]*(b.width/2)+b.cx,F[1]=F[1]*(b.height/2)+b.cy):(F[0]*=b.width/2,F[1]*=b.height/2),F[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,q),e&&n.mat4.translate(p,p,R);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),x===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,v.angle+a)}h.Bounding.clear(T);for(let t=0;t0&&(V&&n.vec3.add(e,e,F),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,D),V&&n.vec3.sub(e,e,F)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=g/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,y)}E[O][t]=e[0],E[O][t+1]=e[1],h.Bounding.add(T,e[0],e[1]),h.Bounding.add(C,e[0],e[1])}}const L={cx:0,cy:0,x:-1,y:-1,width:2,height:2};h.Bounding.bind(L,T),this.bStaticIndexed&&this.bIndexed||this.addIndex(g,v,L)}h.Bounding.bind(this.bounding,C),this.buffer=new Float32Array(P);for(let t=0,e=0,r=E.length;t({index:1,offset:1,count:1}),m.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...m.getEmptySimpleRepetition(),row:m.getEmptySimpleRepetition(),col:m.getEmptySimpleRepetition()})},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(10);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return\"number\"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},(t,e)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(29);var i;!function(t){t[t.None=0]=\"None\",t[t.Scale=2]=\"Scale\",t[t.Center=4]=\"Center\",t[t.Fill=8]=\"Fill\"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn(\"[Urplfanze:Bounding] cannot sum bounding\")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn(\"[Urplfanze:Bounding] cannot bind bounding\")}};class s extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return s.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=s.getBounding(t));const o=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,a=e>=i.Center?r.cx:0,h=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(31),i=r(4),s=r(26),o=\"undefined\"!=typeof performance?performance:Date;function a(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return o.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=a,e.relativeClamp=function(t,e,r,n,i){return a(n,i,(r-t)/(e-t)*(i-n)+n)};const h={random:new n(Math.random)};e.noise=function(t=\"random\",e=0,r=0,i=0){return void 0===h[t]&&(h[t]=new n(t)),h[t].noise3D(e,r,i)};const u={};function c(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),s=rn?[s,o]:[o,s]}function l(t,e){const r=t.length,n=r/2,i=2*(n+e),s=n-1;if(s>1){const n=r-2,o=Math.floor(e/s);let a=(i-(r+o*n))/2;const h=Math.round(s/a),u=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%h==0||e===n-2),p=o+(d?1:0),m=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);u[i]=(s=t(),o=t(),a=t(),h=t(),function(){let t=(s>>>=0)+(o>>>=0)|0;return s=o^o>>>9,o=(a>>>=0)+(a<<3)|0,t=t+(h=1+(h>>>=0)|0)|0,a=(a=a<<21|a>>>11)+t|0,(t>>>0)/4294967296})}var s,o,a,h;const c=e+u[i]()*(r-e);return void 0!==n?Math.round(c*10**n)/10**n:c},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return s.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=c,e.interpolate=function(t,e,r=.5){const[n,i]=c(t,e),s=Math.max(n.length,i.length),o=\"number\"==typeof r?[r]:r,a=s/2;if(o.length!==a){const t=o.length;for(let e=0;e{var n;!function(){\"use strict\";var i=.5*(Math.sqrt(3)-1),s=(3-Math.sqrt(3))/6,o=1/6,a=(Math.sqrt(5)-1)/4,h=(5-Math.sqrt(5))/20;function u(t){var e;e=\"function\"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=l();t=i(\" \"),e=i(\" \"),r=i(\" \");for(var s=0;s>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}u.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,o=this.permMod12,a=this.perm,h=this.grad3,u=0,c=0,l=0,f=(t+e)*i,d=Math.floor(t+f),p=Math.floor(e+f),m=(d+p)*s,g=t-(d-m),y=e-(p-m);g>y?(r=1,n=0):(r=0,n=1);var v=g-r+s,b=y-n+s,x=g-1+2*s,M=y-1+2*s,w=255&d,_=255&p,S=.5-g*g-y*y;if(S>=0){var A=3*o[w+a[_]];u=(S*=S)*S*(h[A]*g+h[A+1]*y)}var P=.5-v*v-b*b;if(P>=0){var E=3*o[w+r+a[_+n]];c=(P*=P)*P*(h[E]*v+h[E+1]*b)}var O=.5-x*x-M*M;if(O>=0){var I=3*o[w+1+a[_+1]];l=(O*=O)*O*(h[I]*x+h[I+1]*M)}return 70*(u+c+l)},noise3D:function(t,e,r){var n,i,s,a,h,u,c,l,f,d,p=this.permMod12,m=this.perm,g=this.grad3,y=.3333333333333333*(t+e+r),v=Math.floor(t+y),b=Math.floor(e+y),x=Math.floor(r+y),M=(v+b+x)*o,w=t-(v-M),_=e-(b-M),S=r-(x-M);w>=_?_>=S?(h=1,u=0,c=0,l=1,f=1,d=0):w>=S?(h=1,u=0,c=0,l=1,f=0,d=1):(h=0,u=0,c=1,l=1,f=0,d=1):_T?B++:N++,C>L?B++:F++,C>k?B++:j++,T>L?N++:F++,T>k?N++:j++,L>k?F++:j++;var q=C-(l=B>=3?1:0)+h,Y=T-(f=N>=3?1:0)+h,D=L-(d=F>=3?1:0)+h,z=k-(p=j>=3?1:0)+h,V=C-(m=B>=2?1:0)+2*h,$=T-(g=N>=2?1:0)+2*h,G=L-(y=F>=2?1:0)+2*h,X=k-(v=j>=2?1:0)+2*h,U=C-(b=B>=1?1:0)+3*h,H=T-(x=N>=1?1:0)+3*h,Z=L-(M=F>=1?1:0)+3*h,Q=k-(w=j>=1?1:0)+3*h,W=C-1+4*h,J=T-1+4*h,K=L-1+4*h,tt=k-1+4*h,et=255&P,rt=255&E,nt=255&O,it=255&I,st=.6-C*C-T*T-L*L-k*k;if(st<0)i=0;else{var ot=_[et+_[rt+_[nt+_[it]]]]%32*4;i=(st*=st)*st*(S[ot]*C+S[ot+1]*T+S[ot+2]*L+S[ot+3]*k)}var at=.6-q*q-Y*Y-D*D-z*z;if(at<0)s=0;else{var ht=_[et+l+_[rt+f+_[nt+d+_[it+p]]]]%32*4;s=(at*=at)*at*(S[ht]*q+S[ht+1]*Y+S[ht+2]*D+S[ht+3]*z)}var ut=.6-V*V-$*$-G*G-X*X;if(ut<0)o=0;else{var ct=_[et+m+_[rt+g+_[nt+y+_[it+v]]]]%32*4;o=(ut*=ut)*ut*(S[ct]*V+S[ct+1]*$+S[ct+2]*G+S[ct+3]*X)}var lt=.6-U*U-H*H-Z*Z-Q*Q;if(lt<0)u=0;else{var ft=_[et+b+_[rt+x+_[nt+M+_[it+w]]]]%32*4;u=(lt*=lt)*lt*(S[ft]*U+S[ft+1]*H+S[ft+2]*Z+S[ft+3]*Q)}var dt=.6-W*W-J*J-K*K-tt*tt;if(dt<0)c=0;else{var pt=_[et+1+_[rt+1+_[nt+1+_[it+1]]]]%32*4;c=(dt*=dt)*dt*(S[pt]*W+S[pt+1]*J+S[pt+2]*K+S[pt+3]*tt)}return 27*(i+s+o+u+c)}},u._buildPermutationTable=c,void 0===(n=function(){return u}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=u,t.exports=u}()},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Shape=void 0;const n=r(21),i=r(22),s=r(24);class o extends s.ShapeBase{constructor(t){t.type=t.type||\"Shape\",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn(\"[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\\nYou passed:\",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):o.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapePrimitive=void 0;const n=r(25),i=r(24),s=r(29),o=r(28);class a extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=o.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:\"function\"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return\"function\"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:\"number\"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp(\"sideLength\",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeLoop=void 0;const n=r(27),i=r(28),s=r(33),o=r(24);class a extends s.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||\"ShapeLoop\",super(t),this.loopDependencies=(t.loopDependencies||[]).concat(\"sideLength\"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes(\"propArguments\"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}\"loop\"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||o.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?(\"function\"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),s=this.getRepetitionSideLength(t),o=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,a={index:0,offset:0,current:0,count:n},h=a.count,u=new Float32Array(2*h);for(let n=0,i=0;n1?n/(a.count-1):1;a.current=s,a.index=n+1,a.offset=h;const c=o(a,t);u[i]=c[0],u[i+1]=c[1]}const c=[void 0,void 0,void 0,void 0],l=this.applyModifiers(u,t);for(let t=0,e=l.length;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeBuffer=void 0;const n=r(28),i=r(33);class s extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||\"ShapeBuffer\",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn(\"[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property\"),this.shape=s.EMPTY_BUFFER):this.shape=\"function\"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return\"function\"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return\"function\"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from(\"function\"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,s=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&\"function\"!=typeof this.props.sideLength&&\"function\"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeRecursive=void 0;const n=r(32);class i extends n.Shape{constructor(t){t.type=t.type||\"ShapeRecursive\",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return\"function\"!=typeof this.props.recursions&&\"function\"!=typeof this.props.recursionScale&&\"function\"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return\"function\"!=typeof this.props.recursions&&\"function\"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp(\"recursions\",e,1)),n=Math.floor(this.getProp(\"recursionVertex\",e,0)),s=this.getProp(\"recursionScale\",e,2),o=this.shape;let a={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const h={...e,recursion:a};o.generate(t,!1,h);const u=o.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=u);let c=u;const l=[a];let f=0,d=1;const p=c.length,m=p/2,g=n<=0?m:Math.min(n,m),y=0===n?1:m/Math.min(n,m),v=new Float32Array(i.summmation(r,g)*p);for(let t=0;t1?e/(r-1):1,u=i.summmation(e,g)*p,m=e-1,b=0===m?0:i.summmation(m,g)*p;for(let i=0,m=g**e;i1?i/(m-1):1,count:m,level:{index:e+1,offset:n,count:r},parent:l[f]},l.push(a),this.shapeUseRecursion&&(h.recursion=a,o.generate(t,!1,h),c=o.getBuffer());const x=u+i*p,M=Math.floor(b+2*i*y),w=v[M],_=v[M+1],S=s**e;for(let t=0,e=p;t1?0:1,count:s}}},h=this.shape.getIndexedBuffer()||[];for(let t=0,e=h.length;t1?0:1,count:s}},i={...a,recursion:r},o=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:o})}if(s>1){const t=this.shape.getBufferLength({...i,parent:{...a}})/2,e=o<=0?t:Math.min(o,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let u=0,c=1;for(let t=1;t1?t/(s-1):1;for(let o=0,l=e**t;o1?o/(l-1):1;for(let d=0,p=h.length;d{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.ShapeFollow=void 0;const n=r(32);class i extends n.Shape{constructor(t){t.type=t.type||\"ShapeFollow\",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},s=this.shape;s.generate(t,!1,i);let o=s.getBuffer();const a=o.length,h=new Float32Array(a*(n.length/2)),u=n.length/2;for(let e=0;e1?e/(u-1):1,count:u};this.shapeUseFollow&&(i.follow=r,s.generate(t,!1,i),o=s.getBuffer());const c=e*a,l=2*e,f=n[l],d=n[l+1];for(let t=0,e=o.length;t1?t/(e-1):1;for(let o=0,a=s.length;o{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Line=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type=\"Line\",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Triangle=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type=\"Triangle\",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=s,s.buffer=[1,0,-1,1,-1,-1]},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Rect=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type=\"Rect\",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=s,s.buffer=[1,1,-1,1,-1,-1,1,-1]},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Polygon=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||\"Polygon\",t.loopDependencies=(t.loopDependencies||[]).concat([\"sideNumber\"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp(\"sideNumber\",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Circle=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=\"Circle\",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Star=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||\"Polygon\",t.loopDependencies=(t.loopDependencies||[]).concat([\"spikes\",\"innerRadius\"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp(\"spikes\",t,5),this.innerRadius=this.getProp(\"innerRadius\",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Rose=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r;t.type=\"Rose\",t.loopDependencies=(t.loopDependencies||[]).concat([\"n\",\"d\"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>s.getFinalAngleFromK(this.getProp(\"n\",t),this.getProp(\"d\",t)),inc:t=>{const e=this.getProp(\"n\",t),r=this.getProp(\"d\",t),i=this.getRepetitionSideLength(t),s=Math.pow(i[0]*i[1],.45),o=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp(\"n\",t)/this.getProp(\"d\",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Spiral=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type=\"Spiral\",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat([\"twists\",\"twistsStart\",\"spiral\"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:s.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp(\"twistsStart\",t),end:t=>n.PI2*(this.getProp(\"twistsStart\",t)+this.getProp(\"twists\",t)),inc:t=>{const e=this.getProp(\"twists\",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp(\"spiral\",t),this.r=s.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case s.types.ARCHIMEDE:return t=>t/10;case s.types.HYPERBOLIC:return t=>1/t*3;case s.types.FERMAT:return t=>t**.5/3;case s.types.LITUUS:return t=>t**-.5;case s.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=s,s.types={ARCHIMEDE:\"ARCHIMEDE\",HYPERBOLIC:\"HYPERBOLIC\",FERMAT:\"FERMAT\",LITUUS:\"LITUUS\",LOGARITHMIC:\"LOGARITHMIC\"}},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Lissajous=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=\"Lissajous\",t.loopDependencies=(t.loopDependencies||[]).concat([\"wx\",\"wy\",\"wz\"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp(\"wx\",t),r=this.getProp(\"wy\",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),s=this.getRepetitionSideLength(t);return 1/Math.pow(s[0]*s[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp(\"wx\",t,1),this.wy=this.getProp(\"wy\",t,2),this.wz=this.getProp(\"wz\",t,2),super.generateLoopBuffer(t)}}e.Lissajous=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.SuperShape=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r,i,s,o,a;t.type=\"SuperShape\",t.loopDependencies=(t.loopDependencies||[]).concat([\"a\",\"b\",\"m\",\"n1\",\"n2\",\"n3\"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(s=t.n1)&&void 0!==s?s:1,this.props.n2=null!==(o=t.n2)&&void 0!==o?o:1,this.props.n3=null!==(a=t.n3)&&void 0!==a?a:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp(\"a\",t),this.b=this.getProp(\"b\",t),this.m=this.getProp(\"m\",t),this.n1=this.getProp(\"n1\",t),this.n2=this.getProp(\"n2\",t),this.n3=this.getProp(\"n3\",t),super.generateLoopBuffer(t)}}e.SuperShape=s},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Modifiers=void 0;const n=r(28),i=r(49),s=r(50),o=r(52),a=r(53),h=r(51),u=r(54),c={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:s.Smooth,Solidify:o.Solidify,Subdivide:a.Subdivide,Close:h.Close,Offset:u.Offset};e.Modifiers=c},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Mirror=void 0;const n=r(29);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let s=0;s{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Smooth=void 0;const n=r(30),i=r(51),s=r(29);class o extends s.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Close=void 0;const n=r(29);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Solidify=void 0;const n=r(29);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const s=[],o=(e=\"number\"==typeof e?[e]:e).length;let a,h,u=[[0,0],[0,0]],c=[[0,0],[0,0]];for(let r=0,l=0,f=t.length-2;r{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Subdivide=void 0;const n=r(29);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Offset=void 0;const n=r(29);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i}],e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r(0)})()},t.exports=e()},479:(t,e,r)=>{var n;!function(){\"use strict\";function i(t,e,r){var n=e.x,i=e.y,s=r.x-n,o=r.y-i;if(0!==s||0!==o){var a=((t.x-n)*s+(t.y-i)*o)/(s*s+o*o);a>1?(n=r.x,i=r.y):a>0&&(n+=s*a,i+=o*a)}return(s=t.x-n)*s+(o=t.y-i)*o}function s(t,e,r,n,o){for(var a,h=n,u=e+1;uh&&(a=u,h=c)}h>n&&(a-e>1&&s(t,e,a,n,o),o.push(t[a]),r-a>1&&s(t,a,r,n,o))}function o(t,e){var r=t.length-1,n=[t[0]];return s(t,0,r,e,n),n.push(t[r]),n}function a(t,e,r){if(t.length<=2)return t;var n=void 0!==e?e*e:1;return o(t=r?t:function(t,e){for(var r,n,i,s,o,a=t[0],h=[a],u=1,c=t.length;ue&&(h.push(r),a=r);return a!==r&&h.push(r),h}(t,n),n)}void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()},721:(t,e,r)=>{\"use strict\";t.exports=r(192)},921:t=>{\"use strict\";var e=2*Math.PI;function r(t,e,r,n){var i=t*r+e*n;return i>1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)}function n(t,e){var r=4/3*Math.tan(e/4),n=Math.cos(t),i=Math.sin(t),s=Math.cos(t+e),o=Math.sin(t+e);return[n,i,n-i*r,i+n*r,s+o*r,o-s*r,s,o]}t.exports=function(t,i,s,o,a,h,u,c,l){var f=Math.sin(l*e/360),d=Math.cos(l*e/360),p=d*(t-s)/2+f*(i-o)/2,m=-f*(t-s)/2+d*(i-o)/2;if(0===p&&0===m)return[];if(0===u||0===c)return[];u=Math.abs(u),c=Math.abs(c);var g=p*p/(u*u)+m*m/(c*c);g>1&&(u*=Math.sqrt(g),c*=Math.sqrt(g));var y=function(t,n,i,s,o,a,h,u,c,l){var f=l*(t-i)/2+c*(n-s)/2,d=-c*(t-i)/2+l*(n-s)/2,p=h*h,m=u*u,g=f*f,y=d*d,v=p*m-p*y-m*g;v<0&&(v=0),v/=p*y+m*g;var b=(v=Math.sqrt(v)*(o===a?-1:1))*h/u*d,x=v*-u/h*f,M=l*b-c*x+(t+i)/2,w=c*b+l*x+(n+s)/2,_=(f-b)/h,S=(d-x)/u,A=(-f-b)/h,P=(-d-x)/u,E=r(1,0,_,S),O=r(_,S,A,P);return 0===a&&O>0&&(O-=e),1===a&&O<0&&(O+=e),[M,w,E,O]}(t,i,s,o,a,h,u,c,f,d),v=[],b=y[2],x=y[3],M=Math.max(Math.ceil(Math.abs(x)/(e/4)),1);x/=M;for(var w=0;w{\"use strict\";var e=1e-10,r=Math.PI/180;function n(t,e,r){if(!(this instanceof n))return new n(t,e,r);this.rx=t,this.ry=e,this.ax=r}n.prototype.transform=function(t){var n=Math.cos(this.ax*r),i=Math.sin(this.ax*r),s=[this.rx*(t[0]*n+t[2]*i),this.rx*(t[1]*n+t[3]*i),this.ry*(-t[0]*i+t[2]*n),this.ry*(-t[1]*i+t[3]*n)],o=s[0]*s[0]+s[2]*s[2],a=s[1]*s[1]+s[3]*s[3],h=((s[0]-s[3])*(s[0]-s[3])+(s[2]+s[1])*(s[2]+s[1]))*((s[0]+s[3])*(s[0]+s[3])+(s[2]-s[1])*(s[2]-s[1])),u=(o+a)/2;if(hMath.abs(l-a)?(l-o)/c:c/(l-a))/Math.PI,this.ax>=0?(this.rx=Math.sqrt(l),this.ry=Math.sqrt(f)):(this.ax+=90,this.rx=Math.sqrt(f),this.ry=Math.sqrt(l)),this},n.prototype.isDegenerate=function(){return this.rx{\"use strict\";function e(){if(!(this instanceof e))return new e;this.queue=[],this.cache=null}e.prototype.matrix=function(t){return 1===t[0]&&0===t[1]&&0===t[2]&&1===t[3]&&0===t[4]&&0===t[5]||(this.cache=null,this.queue.push(t)),this},e.prototype.translate=function(t,e){return 0===t&&0===e||(this.cache=null,this.queue.push([1,0,0,1,t,e])),this},e.prototype.scale=function(t,e){return 1===t&&1===e||(this.cache=null,this.queue.push([t,0,0,e,0,0])),this},e.prototype.rotate=function(t,e,r){var n,i,s;return 0!==t&&(this.translate(e,r),n=t*Math.PI/180,i=Math.cos(n),s=Math.sin(n),this.queue.push([i,s,-s,i,0,0]),this.cache=null,this.translate(-e,-r)),this},e.prototype.skewX=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},e.prototype.skewY=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},e.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],1===this.queue.length)return this.cache;for(var t=1;t{\"use strict\";var e={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},r=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function n(t){return t>=48&&t<=57}function i(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err=\"\",this.segmentStart=0,this.data=[]}function s(t){for(;t.index=5760&&r.indexOf(e)>=0);)t.index++;var e}function o(t){var e=t.path.charCodeAt(t.index);return 48===e?(t.param=0,void t.index++):49===e?(t.param=1,void t.index++):void(t.err=\"SvgPath: arc flag can be 0 or 1 only (at pos \"+t.index+\")\")}function a(t){var e,r=t.index,i=r,s=t.max,o=!1,a=!1,h=!1,u=!1;if(i>=s)t.err=\"SvgPath: missed param (at pos \"+i+\")\";else if(43!==(e=t.path.charCodeAt(i))&&45!==e||(e=++i2&&(t.result.push([r,i[0],i[1]]),i=i.slice(2),n=\"l\",r=\"m\"===r?\"l\":\"L\"),\"r\"===n)t.result.push([r].concat(i));else for(;i.length>=e[n]&&(t.result.push([r].concat(i.splice(0,e[n]))),e[n]););}function u(t){var r,n,i,u,c,l,f=t.max;if(t.segmentStart=t.index,n=97==(32|(r=t.path.charCodeAt(t.index))),function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}(r))if(u=e[t.path[t.index].toLowerCase()],t.index++,s(t),t.data=[],u){for(i=!1;;){for(c=u;c>0;c--){if(!n||3!==c&&4!==c?a(t):o(t),t.err.length)return;t.data.push(t.param),s(t),i=!1,t.index=t.max)break;if(!((l=t.path.charCodeAt(t.index))>=48&&l<=57||43===l||45===l||46===l))break}}h(t)}else h(t);else t.err=\"SvgPath: bad command \"+t.path[t.index]+\" (at pos \"+t.index+\")\"}t.exports=function(t){var e=new i(t),r=e.max;for(s(e);e.index{\"use strict\";var n=r(665),i=r(94),s=r(480),o=r(921),a=r(954);function h(t){if(!(this instanceof h))return new h(t);var e=n(t);this.segments=e.segments,this.err=e.err,this.__stack=[]}h.from=function(t){if(\"string\"==typeof t)return new h(t);if(t instanceof h){var e=new h(\"\");return e.err=t.err,e.segments=t.segments.map((function(t){return t.slice()})),e.__stack=t.__stack.map((function(t){return s().matrix(t.toArray())})),e}throw new Error(\"SvgPath.from: invalid param type \"+t)},h.prototype.__matrix=function(t){var e,r=this;t.queue.length&&this.iterate((function(n,i,s,o){var h,u,c,l;switch(n[0]){case\"v\":u=0===(h=t.calc(0,n[1],!0))[0]?[\"v\",h[1]]:[\"l\",h[0],h[1]];break;case\"V\":u=(h=t.calc(s,n[1],!1))[0]===t.calc(s,o,!1)[0]?[\"V\",h[1]]:[\"L\",h[0],h[1]];break;case\"h\":u=0===(h=t.calc(n[1],0,!0))[1]?[\"h\",h[0]]:[\"l\",h[0],h[1]];break;case\"H\":u=(h=t.calc(n[1],o,!1))[1]===t.calc(s,o,!1)[1]?[\"H\",h[0]]:[\"L\",h[0],h[1]];break;case\"a\":case\"A\":var f=t.toArray(),d=a(n[1],n[2],n[3]).transform(f);if(f[0]*f[3]-f[1]*f[2]<0&&(n[5]=n[5]?\"0\":\"1\"),h=t.calc(n[6],n[7],\"a\"===n[0]),\"A\"===n[0]&&n[6]===s&&n[7]===o||\"a\"===n[0]&&0===n[6]&&0===n[7]){u=[\"a\"===n[0]?\"l\":\"L\",h[0],h[1]];break}u=d.isDegenerate()?[\"a\"===n[0]?\"l\":\"L\",h[0],h[1]]:[n[0],d.rx,d.ry,d.ax,n[4],n[5],h[0],h[1]];break;case\"m\":l=i>0,u=[\"m\",(h=t.calc(n[1],n[2],l))[0],h[1]];break;default:for(u=[c=n[0]],l=c.toLowerCase()===c,e=1;e=0;)t.matrix(this.__stack[e].toArray());this.__matrix(t),this.__stack=[]}},h.prototype.toString=function(){var t,e,r=[];this.__evaluateStack();for(var n=0;n0&&\"m\"!==e&&\"M\"!==e&&e===this.segments[n-1][0],r=r.concat(t?this.segments[n].slice(1):this.segments[n]);return r.join(\" \").replace(/ ?([achlmqrstvz]) ?/gi,\"$1\").replace(/ \\-/g,\"-\").replace(/zm/g,\"z m\")},h.prototype.translate=function(t,e){return this.__stack.push(s().translate(t,e||0)),this},h.prototype.scale=function(t,e){return this.__stack.push(s().scale(t,e||0===e?e:t)),this},h.prototype.rotate=function(t,e,r){return this.__stack.push(s().rotate(t,e||0,r||0)),this},h.prototype.skewX=function(t){return this.__stack.push(s().skewX(t)),this},h.prototype.skewY=function(t){return this.__stack.push(s().skewY(t)),this},h.prototype.matrix=function(t){return this.__stack.push(s().matrix(t)),this},h.prototype.transform=function(t){return t.trim()?(this.__stack.push(i(t)),this):this},h.prototype.round=function(t){var e,r=0,n=0,i=0,s=0;return t=t||0,this.__evaluateStack(),this.segments.forEach((function(o){var a=o[0].toLowerCase()===o[0];switch(o[0]){case\"H\":case\"h\":return a&&(o[1]+=i),i=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case\"V\":case\"v\":return a&&(o[1]+=s),s=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case\"Z\":case\"z\":return i=r,void(s=n);case\"M\":case\"m\":return a&&(o[1]+=i,o[2]+=s),i=o[1]-o[1].toFixed(t),s=o[2]-o[2].toFixed(t),r=i,n=s,o[1]=+o[1].toFixed(t),void(o[2]=+o[2].toFixed(t));case\"A\":case\"a\":return a&&(o[6]+=i,o[7]+=s),i=o[6]-o[6].toFixed(t),s=o[7]-o[7].toFixed(t),o[1]=+o[1].toFixed(t),o[2]=+o[2].toFixed(t),o[3]=+o[3].toFixed(t+2),o[6]=+o[6].toFixed(t),void(o[7]=+o[7].toFixed(t));default:return e=o.length,a&&(o[e-2]+=i,o[e-1]+=s),i=o[e-2]-o[e-2].toFixed(t),s=o[e-1]-o[e-1].toFixed(t),void o.forEach((function(e,r){r&&(o[r]=+o[r].toFixed(t))}))}})),this},h.prototype.iterate=function(t,e){var r,n,i,s=this.segments,o={},a=!1,h=0,u=0,c=0,l=0;if(e||this.__evaluateStack(),s.forEach((function(e,r){var n=t(e,r,h,u);Array.isArray(n)&&(o[r]=n,a=!0);var i=e[0]===e[0].toLowerCase();switch(e[0]){case\"m\":case\"M\":return h=e[1]+(i?h:0),u=e[2]+(i?u:0),c=h,void(l=u);case\"h\":case\"H\":return void(h=e[1]+(i?h:0));case\"v\":case\"V\":return void(u=e[1]+(i?u:0));case\"z\":case\"Z\":return h=c,void(u=l);default:h=e[e.length-2]+(i?h:0),u=e[e.length-1]+(i?u:0)}})),!a)return this;for(i=[],r=0;r{\"use strict\";var n=r(480),i={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},s=/\\s*(matrix|translate|scale|rotate|skewX|skewY)\\s*\\(\\s*(.+?)\\s*\\)[\\s,]*/,o=/[\\s,]+/;t.exports=function(t){var e,r,a=new n;return t.split(s).forEach((function(t){if(t.length)if(void 0===i[t])switch(r=t.split(o).map((function(t){return+t||0})),e){case\"matrix\":return void(6===r.length&&a.matrix(r));case\"scale\":return void(1===r.length?a.scale(r[0],r[0]):2===r.length&&a.scale(r[0],r[1]));case\"rotate\":return void(1===r.length?a.rotate(r[0],0,0):3===r.length&&a.rotate(r[0],r[1],r[2]));case\"translate\":return void(1===r.length?a.translate(r[0],0):2===r.length&&a.translate(r[0],r[1]));case\"skewX\":return void(1===r.length&&a.skewX(r[0]));case\"skewY\":return void(1===r.length&&a.skewY(r[0]))}else e=t})),a}},197:(t,e,r)=>{\"use strict\";function n(t,e){return Array.isArray(e)?[t.a*e[0]+t.c*e[1]+t.e,t.b*e[0]+t.d*e[1]+t.f]:{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function i(t,e){return e.map((e=>n(t,e)))}function s(t){return{a:parseFloat(t.a),b:parseFloat(t.b),c:parseFloat(t.c),d:parseFloat(t.d),e:parseFloat(t.e),f:parseFloat(t.f)}}r.r(e),r.d(e,{applyToPoint:()=>n,applyToPoints:()=>i,compose:()=>m,fromDefinition:()=>C,fromObject:()=>s,fromString:()=>a,fromTransformAttribute:()=>k,fromTriangles:()=>R,identity:()=>h,inverse:()=>u,isAffineMatrix:()=>f,rotate:()=>b,rotateDEG:()=>x,scale:()=>M,shear:()=>w,skew:()=>S,skewDEG:()=>A,smoothMatrix:()=>I,toCSS:()=>P,toSVG:()=>E,toString:()=>O,transform:()=>p,translate:()=>d});const o=/^matrix\\(\\s*([0-9_+-.e]+)\\s*,\\s*([0-9_+-.e]+)\\s*,\\s*([0-9_+-.e]+)\\s*,\\s*([0-9_+-.e]+)\\s*,\\s*([0-9_+-.e]+)\\s*,\\s*([0-9_+-.e]+)\\s*\\)$/i;function a(t){const e=t.match(o);if(null===e||e.length<7)throw new Error(`'${t}' is not a matrix`);return{a:parseFloat(e[1]),b:parseFloat(e[2]),c:parseFloat(e[3]),d:parseFloat(e[4]),e:parseFloat(e[5]),f:parseFloat(e[6])}}function h(){return{a:1,c:0,e:0,b:0,d:1,f:0}}function u(t){const{a:e,b:r,c:n,d:i,e:s,f:o}=t,a=e*i-r*n;return{a:i/a,b:r/-a,c:n/-a,d:e/a,e:(i*s-n*o)/-a,f:(r*s-e*o)/a}}function c(t){return void 0===t}function l(t){return\"number\"==typeof t&&!Number.isNaN(t)&&Number.isFinite(t)}function f(t){return\"object\"==typeof(e=t)&&null!==e&&!Array.isArray(e)&&\"a\"in t&&l(t.a)&&\"b\"in t&&l(t.b)&&\"c\"in t&&l(t.c)&&\"d\"in t&&l(t.d)&&\"e\"in t&&l(t.e)&&\"f\"in t&&l(t.f);var e}function d(t,e=0){return{a:1,c:0,e:t,b:0,d:1,f:e}}function p(...t){const e=(t,e)=>({a:t.a*e.a+t.c*e.b,c:t.a*e.c+t.c*e.d,e:t.a*e.e+t.c*e.f+t.e,b:t.b*e.a+t.d*e.b,d:t.b*e.c+t.d*e.d,f:t.b*e.e+t.d*e.f+t.f});switch((t=Array.isArray(t[0])?t[0]:t).length){case 0:throw new Error(\"no matrices provided\");case 1:return t[0];case 2:return e(t[0],t[1]);default:{const[r,n,...i]=t;return p(e(r,n),...i)}}}function m(...t){return p(...t)}const{cos:g,sin:y,PI:v}=Math;function b(t,e,r){const n=g(t),i=y(t),s={a:n,c:-i,e:0,b:i,d:n,f:0};return c(e)||c(r)?s:p([d(e,r),s,d(-e,-r)])}function x(t,e,r){return b(t*v/180,e,r)}function M(t,e,r,n){c(e)&&(e=t);const i={a:t,c:0,e:0,b:0,d:e,f:0};return c(r)||c(n)?i:p([d(r,n),i,d(-r,-n)])}function w(t,e){return{a:1,c:t,e:0,b:e,d:1,f:0}}const{tan:_}=Math;function S(t,e){return{a:1,c:_(t),e:0,b:_(e),d:1,f:0}}function A(t,e){return S(t*Math.PI/180,e*Math.PI/180)}function P(t){return O(t)}function E(t){return O(t)}function O(t){return`matrix(${t.a},${t.b},${t.c},${t.d},${t.e},${t.f})`}function I(t,e=1e10){return{a:Math.round(t.a*e)/e,b:Math.round(t.b*e)/e,c:Math.round(t.c*e)/e,d:Math.round(t.d*e)/e,e:Math.round(t.e*e)/e,f:Math.round(t.f*e)/e}}function R(t,e){const r=null!=t[0].x?t[0].x:t[0][0],n=null!=t[0].y?t[0].y:t[0][1],i=null!=e[0].x?e[0].x:e[0][0],s=null!=e[0].y?e[0].y:e[0][1],o=null!=t[1].x?t[1].x:t[1][0],a=null!=t[1].y?t[1].y:t[1][1],h=null!=e[1].x?e[1].x:e[1][0],c=null!=e[1].y?e[1].y:e[1][1],l=null!=t[2].x?t[2].x:t[2][0],f=null!=t[2].y?t[2].y:t[2][1],d=null!=e[2].x?e[2].x:e[2][0],m=null!=e[2].y?e[2].y:e[2][1];return I(p([{a:i-d,b:s-m,c:h-d,d:c-m,e:d,f:m},u({a:r-l,b:n-f,c:o-l,d:a-f,e:l,f})]))}function C(t){return Array.isArray(t)?t.map(e):e(t);function e(t){switch(t.type){case\"matrix\":if(\"a\"in t&&\"b\"in t&&\"c\"in t&&\"d\"in t&&\"e\"in t&&\"f\"in t)return s(t);throw new Error(\"MISSING_MANDATORY_PARAM\");case\"translate\":if(!(\"tx\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return\"ty\"in t?d(t.tx,t.ty):d(t.tx);case\"scale\":if(!(\"sx\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return\"sy\"in t?M(t.sx,t.sy):M(t.sx);case\"rotate\":if(!(\"angle\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return\"cx\"in t&&\"cy\"in t?x(t.angle,t.cx,t.cy):x(t.angle);case\"skewX\":if(!(\"angle\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return A(t.angle,0);case\"skewY\":if(!(\"angle\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return A(0,t.angle);case\"shear\":if(!(\"shx\"in t)||!(\"shy\"in t))throw new Error(\"MISSING_MANDATORY_PARAM\");return w(t.shx,t.shy);default:throw new Error(\"UNSUPPORTED_DESCRIPTOR\")}}}function T(t,e,r,n){this.message=t,this.expected=e,this.found=r,this.location=n,this.name=\"SyntaxError\",\"function\"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,T)}function L(t,e){e=void 0!==e?e:{};var r,n={},i={transformList:G},s=G,o=\"matrix\",a=\"(\",h=\")\",u=\"translate\",c=\"scale\",l=\"rotate\",f=\"skewX\",d=\"skewY\",p=/^[eE]/,m=/^[+\\-]/,g=/^[0-9]/,y=/^[ \\t\\r\\n]/,v=F(\"matrix\",!1),b=F(\"(\",!1),x=F(\")\",!1),M=F(\"translate\",!1),w=F(\"scale\",!1),_=F(\"rotate\",!1),S=F(\"skewX\",!1),A=F(\"skewY\",!1),P=F(\",\",!1),E={type:\"other\",description:\"fractionalConstant\"},O=j([\"e\",\"E\"],!1,!1),I=j([\"+\",\"-\"],!1,!1),R=j([[\"0\",\"9\"]],!1,!1),C=j([\" \",\"\\t\",\"\\r\",\"\\n\"],!1,!1),L=0,k=[{line:1,column:1}],B=[],N=0;if(\"startRule\"in e){if(!(e.startRule in i))throw new Error(\"Can't start parsing from rule \\\"\"+e.startRule+'\".');s=i[e.startRule]}function F(t,e){return{type:\"literal\",text:t,ignoreCase:e}}function j(t,e,r){return{type:\"class\",parts:t,inverted:e,ignoreCase:r}}function q(e){var r,n=k[e];if(n)return n;for(r=e-1;!k[r];)r--;for(n={line:(n=k[r]).line,column:n.column};r0;function V(t,r){var n={};z&&(n.filename=e.filename);var i=q(t);n.start={offset:t,line:i.line,column:i.column};var s=q(r);return n.end={offset:r,line:s.line,column:s.column},n}function $(t){var e=B[B.length-1];Le.pos&&(e.pos=L,e.variants=[]),e.variants.push(t))}function G(){var t,e,r,i;for(L,t=[],e=rt();e!==n;)t.push(e),e=rt();for((e=X())===n&&(e=null),r=[],i=rt();i!==n;)r.push(i),i=rt();return e}function X(){var t,e,r,i,s;if(t=L,(e=U())!==n){if(r=[],(i=Q())!==n)for(;i!==n;)r.push(i),i=Q();else r=n;r!==n&&(i=X())!==n?(s=i,t=e.concat(s)):(L=t,t=n)}else L=t,t=n;return t===n&&(t=U()),t}function U(){var e;return(e=function(){var e,r,i,s,u,c,l,f,d,p,m,g,y,M=function(t){0===N&&$(t)};if(e=L,M(v),t.substr(L,6)===o?(r=o,L+=6):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(M(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(u=[],c=rt();c!==n;)u.push(c),c=rt();if((c=H())!==n)if(Q()!==n)if((l=H())!==n)if(Q()!==n)if((f=H())!==n)if(Q()!==n)if((d=H())!==n)if(Q()!==n)if((p=H())!==n)if(Q()!==n)if((m=H())!==n){for(g=[],y=rt();y!==n;)g.push(y),y=rt();M(x),41===t.charCodeAt(L)?(y=h,L++):y=n,y!==n?e=[{type:\"matrix\",a:c,b:l,c:f,d,e:p,f:m}]:(L=e,e=n)}else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n;else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,c,l,f,d,p,m,g=function(t){0===N&&$(t)};if(e=L,g(M),t.substr(L,9)===u?(r=u,L+=9):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(o=[],c=rt();c!==n;)o.push(c),c=rt();if((c=H())!==n){for((l=Z())===n&&(l=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(x),41===t.charCodeAt(L)?(d=h,L++):d=n,d!==n?(m={type:\"translate\",tx:c},(p=l)&&(m.ty=p),e=[m]):(L=e,e=n)}else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,l,f,d,p,m,g=function(t){0===N&&$(t)};if(e=L,g(w),t.substr(L,5)===c?(r=c,L+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=H())!==n){for((l=Z())===n&&(l=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(x),41===t.charCodeAt(L)?(d=h,L++):d=n,d!==n?(m={type:\"scale\",sx:u},(p=l)&&(m.sy=p),e=[m]):(L=e,e=n)}else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,c,f,d,p,m,g=function(t){0===N&&$(t)};if(e=L,g(_),t.substr(L,6)===l?(r=l,L+=6):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=H())!==n){for((c=function(){var t,e,r;return t=L,Q()!==n&&(e=H())!==n&&Q()!==n&&(r=H())!==n?t=[e,r]:(L=t,t=n),t}())===n&&(c=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(x),41===t.charCodeAt(L)?(d=h,L++):d=n,d!==n?(m={type:\"rotate\",angle:u},(p=c)&&(m.cx=p[0],m.cy=p[1]),e=[m]):(L=e,e=n)}else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,c,l,d=function(t){0===N&&$(t)};if(e=L,d(S),t.substr(L,5)===f?(r=f,L+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(d(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=H())!==n){for(c=[],l=rt();l!==n;)c.push(l),l=rt();d(x),41===t.charCodeAt(L)?(l=h,L++):l=n,l!==n?e=[{type:\"skewX\",angle:u}]:(L=e,e=n)}else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,u,c,l,f=function(t){0===N&&$(t)};if(e=L,f(A),t.substr(L,5)===d?(r=d,L+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(f(b),40===t.charCodeAt(L)?(s=a,L++):s=n,s!==n){for(o=[],u=rt();u!==n;)o.push(u),u=rt();if((u=H())!==n){for(c=[],l=rt();l!==n;)c.push(l),l=rt();f(x),41===t.charCodeAt(L)?(l=h,L++):l=n,l!==n?e=[{type:\"skewY\",angle:u}]:(L=e,e=n)}else L=e,e=n}else L=e,e=n}else L=e,e=n;return e}()),e}function H(){var e,r,i,s;return e=L,r=L,(i=K())===n&&(i=null),(s=function(){var e,r,i;return e=L,(r=function(){var e,r,i,s,o,a,h;return o=E,0===N&&$(o),N++,e=L,(r=tt())===n&&(r=null),46===t.charCodeAt(L)?(i=\".\",L++):i=n,i!==n&&(s=tt())!==n?(h=s,e=[(a=r)?a.join(\"\"):null,\".\",h.join(\"\")].join(\"\")):(L=e,e=n),e===n&&(e=L,(r=tt())!==n?(46===t.charCodeAt(L)?(i=\".\",L++):i=n,i!==n?e=r.join(\"\"):(L=e,e=n)):(L=e,e=n)),N--,e}())!==n?((i=J())===n&&(i=null),e=[r,i||null].join(\"\")):(L=e,e=n),e===n&&(e=L,(r=tt())!==n&&(i=J())!==n?e=[r,i].join(\"\"):(L=e,e=n)),e}())!==n?r=i=[i,s]:(L=r,r=n),r!==n&&(r=parseFloat(r.join(\"\"))),(e=r)===n&&(e=L,r=L,(i=K())===n&&(i=null),(s=function(){var t;return L,(t=tt())!==n&&(t=t.join(\"\")),t}())!==n?r=i=[i,s]:(L=r,r=n),r!==n&&(r=parseInt(r.join(\"\"))),e=r),e}function Z(){var t,e;return t=L,Q()!==n&&(e=H())!==n?t=e:(L=t,t=n),t}function Q(){var t,e,r,i,s;if(t=L,e=[],(r=rt())!==n)for(;r!==n;)e.push(r),r=rt();else e=n;if(e!==n){for((r=W())===n&&(r=null),i=[],s=rt();s!==n;)i.push(s),s=rt();t=e=[e,r,i]}else L=t,t=n;if(t===n)if(t=L,(e=W())!==n){for(r=[],i=rt();i!==n;)r.push(i),i=rt();t=e=[e,r]}else L=t,t=n;return t}function W(){var e,r;return r=P,0===N&&$(r),44===t.charCodeAt(L)?(e=\",\",L++):e=n,e}function J(){var e,r,i,s,o;return e=L,o=O,0===N&&$(o),p.test(t.charAt(L))?(r=t.charAt(L),L++):r=n,r!==n?((i=K())===n&&(i=null),(s=tt())!==n?e=[\"e\",i,s.join(\"\")].join(\"\"):(L=e,e=n)):(L=e,e=n),e}function K(){var e,r;return r=I,0===N&&$(r),m.test(t.charAt(L))?(e=t.charAt(L),L++):e=n,e}function tt(){var t,e;if(t=[],(e=et())!==n)for(;e!==n;)t.push(e),e=et();else t=n;return t}function et(){var e,r;return r=R,0===N&&$(r),g.test(t.charAt(L))?(e=t.charAt(L),L++):e=n,e}function rt(){var e,r;return r=C,0===N&&$(r),y.test(t.charAt(L))?(e=t.charAt(L),L++):e=n,e}if(B.push({pos:L,variants:[]}),(r=s())!==n&&L===t.length)return r;throw r!==n&&L0){for(e=1,r=1;e{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r(625)})()}));","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(0);\n"],"sourceRoot":""} \ No newline at end of file diff --git a/build/umd/urpflanze.min.js b/build/umd/urpflanze.min.js index dcbddbe..4f52ca7 100644 --- a/build/umd/urpflanze.min.js +++ b/build/umd/urpflanze.min.js @@ -1,2 +1,2 @@ /*! For license information please see urpflanze.min.js.LICENSE.txt */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Urpflanze=e():t.Urpflanze=e()}(window,(function(){return(()=>{var t={9367:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.DrawerCanvas=e.Animation=void 0,i(r(1714),e),e.Animation=r(7518);var s=r(2251);Object.defineProperty(e,"DrawerCanvas",{enumerable:!0,get:function(){return s.BrowserDrawerCanvas}})},5475:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.SVGImporter=e.SVGExporter=e.GCODEExporter=e.Timeline=e.Renderer=e.Color=void 0,i(r(9367),e),i(r(9367),e),e.Color=r(7358);var s=r(1532);Object.defineProperty(e,"Renderer",{enumerable:!0,get:function(){return s.Renderer}}),Object.defineProperty(e,"Timeline",{enumerable:!0,get:function(){return s.Timeline}});var o=r(884);Object.defineProperty(e,"GCODEExporter",{enumerable:!0,get:function(){return o.GCODEExporter}});var a=r(7773);Object.defineProperty(e,"SVGExporter",{enumerable:!0,get:function(){return a.SVGExporter}});var u=r(5052);Object.defineProperty(e,"SVGImporter",{enumerable:!0,get:function(){return u.SVGImporter}})},50:t=>{"use strict";t.exports=JSON.parse('{"name":"@ffmpeg/ffmpeg","version":"0.10.1","description":"FFmpeg WebAssembly version","main":"src/index.js","types":"src/index.d.ts","directories":{"example":"examples"},"scripts":{"start":"node scripts/server.js","build":"rimraf dist && webpack --config scripts/webpack.config.prod.js","prepublishOnly":"npm run build","lint":"eslint src","wait":"rimraf dist && wait-on http://localhost:3000/dist/ffmpeg.dev.js","test":"npm-run-all -p -r start test:all","test:all":"npm-run-all wait test:browser:ffmpeg test:node:all","test:node":"node --experimental-wasm-threads --experimental-wasm-bulk-memory node_modules/.bin/_mocha --exit --bail --require ./scripts/test-helper.js","test:node:all":"npm run test:node -- ./tests/*.test.js","test:browser":"mocha-headless-chrome -a allow-file-access-from-files -a incognito -a no-sandbox -a disable-setuid-sandbox -a disable-logging -t 300000","test:browser:ffmpeg":"npm run test:browser -- -f ./tests/ffmpeg.test.html"},"browser":{"./src/node/index.js":"./src/browser/index.js"},"repository":{"type":"git","url":"git+https://github.com/ffmpegwasm/ffmpeg.wasm.git"},"keywords":["ffmpeg","WebAssembly","video"],"author":"Jerome Wu ","license":"MIT","bugs":{"url":"https://github.com/ffmpegwasm/ffmpeg.wasm/issues"},"engines":{"node":">=12.16.1"},"homepage":"https://github.com/ffmpegwasm/ffmpeg.wasm#readme","dependencies":{"is-url":"^1.2.4","node-fetch":"^2.6.1","regenerator-runtime":"^0.13.7","resolve-url":"^0.2.1"},"devDependencies":{"@babel/core":"^7.12.3","@babel/preset-env":"^7.12.1","@ffmpeg/core":"^0.10.0","@types/emscripten":"^1.39.4","babel-loader":"^8.1.0","chai":"^4.2.0","cors":"^2.8.5","eslint":"^7.12.1","eslint-config-airbnb-base":"^14.1.0","eslint-plugin-import":"^2.22.1","express":"^4.17.1","mocha":"^8.2.1","mocha-headless-chrome":"^2.0.3","npm-run-all":"^4.1.5","wait-on":"^5.3.0","webpack":"^5.3.2","webpack-cli":"^4.1.0","webpack-dev-middleware":"^4.0.0"}}')},4076:(t,e,r)=>{r(5072);const{devDependencies:n}=r(50);t.exports={corePath:`https://unpkg.com/@ffmpeg/core@${n["@ffmpeg/core"].substring(1)}/dist/ffmpeg-core.js`}},2339:(t,e,r)=>{const n=r(5072);t.exports=async t=>{let e=t;if(void 0===t)return new Uint8Array;if("string"==typeof t)if(/data:_data\/([a-zA-Z]*);base64,([^"]*)/.test(t))e=atob(t.split(",")[1]).split("").map((t=>t.charCodeAt(0)));else{const r=await fetch(n(t));e=await r.arrayBuffer()}else(t instanceof File||t instanceof Blob)&&(e=await(r=t,new Promise(((t,e)=>{const n=new FileReader;n.onload=()=>{t(n.result)},n.onerror=({target:{error:{code:t}}})=>{e(Error(`File could not be read! Code=${t}`))},n.readAsArrayBuffer(r)}))));var r;return new Uint8Array(e)}},1440:(t,e,r)=>{const n=r(5072),{log:i}=r(888),s=async(t,e)=>{i("info",`fetch ${t}`);const r=await(await fetch(t)).arrayBuffer();i("info",`${t} file size = ${r.byteLength} bytes`);const n=new Blob([r],{type:e}),s=URL.createObjectURL(n);return i("info",`${t} blob URL = ${s}`),s};t.exports=async({corePath:t})=>{if("string"!=typeof t)throw Error("corePath should be a string!");const e=n(t),r=await s(e,"application/javascript"),o=await s(e.replace("ffmpeg-core.js","ffmpeg-core.wasm"),"application/wasm"),a=await s(e.replace("ffmpeg-core.js","ffmpeg-core.worker.js"),"application/javascript");return"undefined"==typeof createFFmpegCore?new Promise((t=>{const e=document.createElement("script"),n=()=>{e.removeEventListener("load",n),i("info","ffmpeg-core.js script loaded"),t({createFFmpegCore,corePath:r,wasmPath:o,workerPath:a})};e.src=r,e.type="text/javascript",e.addEventListener("load",n),document.getElementsByTagName("head")[0].appendChild(e)})):(i("info","ffmpeg-core.js script is loaded already"),Promise.resolve({createFFmpegCore,corePath:r,wasmPath:o,workerPath:a}))}},3451:(t,e,r)=>{const n=r(4076),i=r(1440),s=r(2339);t.exports={defaultOptions:n,getCreateFFmpegCore:i,fetchFile:s}},1617:t=>{t.exports={defaultArgs:["./ffmpeg","-nostdin","-y"],baseOptions:{log:!1,logger:()=>{},progress:()=>{},corePath:""}}},9289:(t,e,r)=>{const{defaultArgs:n,baseOptions:i}=r(1617),{setLogging:s,setCustomLogger:o,log:a}=r(888),u=r(6405),h=r(7010),{defaultOptions:c,getCreateFFmpegCore:l}=r(3451),{version:f}=r(50),d=Error("ffmpeg.wasm is not ready, make sure you have completed load().");t.exports=(t={})=>{const{log:e,logger:r,progress:p,...m}={...i,...c,...t};let g=null,v=null,y=null,b=!1,w=p;const M=({type:t,message:e})=>{a(t,e),u(e,w),(t=>{"FFMPEG_END"===t&&null!==y&&(y(),y=null,b=!1)})(e)};return s(e),o(r),a("info",`use ffmpeg.wasm v${f}`),{setProgress:t=>{w=t},setLogger:t=>{o(t)},setLogging:s,load:async()=>{if(a("info","load ffmpeg-core"),null!==g)throw Error("ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.");{a("info","loading ffmpeg-core");const{createFFmpegCore:t,corePath:e,workerPath:r,wasmPath:n}=await l(m);g=await t({mainScriptUrlOrBlob:e,printErr:t=>M({type:"fferr",message:t}),print:t=>M({type:"ffout",message:t}),locateFile:(t,e)=>{if("undefined"!=typeof window){if(void 0!==n&&t.endsWith("ffmpeg-core.wasm"))return n;if(void 0!==r&&t.endsWith("ffmpeg-core.worker.js"))return r}return e+t}}),v=g.cwrap("proxy_main","number",["number","number"]),a("info","ffmpeg-core loaded")}},isLoaded:()=>null!==g,run:(...t)=>{if(a("info",`run ffmpeg command: ${t.join(" ")}`),null===g)throw d;if(b)throw Error("ffmpeg.wasm can only run one command at a time");return b=!0,new Promise((e=>{const r=[...n,...t].filter((t=>0!==t.length));y=e,v(...h(g,r))}))},exit:()=>{if(null===g)throw d;b=!1,g.exit(1),g=null,v=null,y=null},FS:(t,...e)=>{if(a("info",`run FS.${t} ${e.map((t=>"string"==typeof t?t:`<${t.length} bytes binary file>`)).join(" ")}`),null===g)throw d;{let r=null;try{r=g.FS[t](...e)}catch(r){throw"readdir"===t?Error(`ffmpeg.FS('readdir', '${e[0]}') error. Check if the path exists, ex: ffmpeg.FS('readdir', '/')`):"readFile"===t?Error(`ffmpeg.FS('readFile', '${e[0]}') error. Check if the path exists`):Error("Oops, something went wrong in FS operation.")}return r}}}}},5045:(t,e,r)=>{r(5666);const n=r(9289),{fetchFile:i}=r(3451);t.exports={createFFmpeg:n,fetchFile:i}},888:t=>{let e=!1,r=()=>{};t.exports={logging:e,setLogging:t=>{e=t},setCustomLogger:t=>{r=t},log:(t,n)=>{r({type:t,message:n}),e&&console.log(`[${t}] ${n}`)}}},7010:t=>{t.exports=(t,e)=>{const r=t._malloc(e.length*Uint32Array.BYTES_PER_ELEMENT);return e.forEach(((e,n)=>{const i=t._malloc(e.length+1);t.writeAsciiToMemory(e,i),t.setValue(r+Uint32Array.BYTES_PER_ELEMENT*n,i,"i32")})),[e.length,r]}},6405:t=>{let e=0,r=0;const n=t=>{const[e,r,n]=t.split(":");return 60*parseFloat(e)*60+60*parseFloat(r)+parseFloat(n)};t.exports=(t,i)=>{if("string"==typeof t)if(t.startsWith(" Duration")){const s=t.split(", ")[0].split(": ")[1],o=n(s);i({duration:o,ratio:r}),(0===e||e>o)&&(e=o)}else if(t.startsWith("frame")||t.startsWith("size")){const s=t.split("time=")[1].split(" ")[0],o=n(s);r=o/e,i({ratio:r,time:o})}else t.startsWith("video:")&&(i({ratio:1}),e=0)}},2894:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UncontrolledLoop=e.Static=e.Loop=e.Compose=e.Simple=e.resolveSimpleAnimation=void 0;const n=r(4825),i=r(2765);function s(t){const e=i.createAnimation(t);if(e)return t=>{var r;const n="number"==typeof t?t:(null===(r=t.shape.scene)||void 0===r?void 0:r.currentTime)||0;return e.update(n),e.value}}e.resolveSimpleAnimation=s,e.Simple=s,e.Compose=t=>{const e=n.composeAnimations(t);if(e)return t=>{var r;const n="number"==typeof t?t:(null===(r=t.shape.scene)||void 0===r?void 0:r.currentTime)||0;return e(n)}},e.Loop=t=>{const e=t;return void 0===e.interpolator&&(e.interpolator="wave"),e.interpolator&&("string"==typeof e.interpolator?"wave"!==e.interpolator&&(e.direction="alternate"):"object"==typeof e.interpolator&&"wave"!==e.interpolator.type&&(e.direction="alternate")),e.loop=!0,s(e)},e.Static=t=>{const e=t;return e.direction="normal",e.loop=!1,s(e)},e.UncontrolledLoop=t=>{const e=t;return e.direction="normal",e.loop=!0,s(e)}},9727:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=void 0;const r={linear:(t,e,r,n=1)=>r*t/n+e,quadraticIn:(t,e,r,n=1)=>r*(t/=n)*t+e,quadraticOut:(t,e,r,n=1)=>-r*(t/=n)*(t-2)+e,quadraticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t+e:-r/2*(--t*(t-2)-1)+e,cubicIn:(t,e,r,n=1)=>r*(t/=n)*t*t+e,cubicOut:(t,e,r,n=1)=>(t/=n,r*(--t*t*t+1)+e),cubicInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t+e:r/2*((t-=2)*t*t+2)+e,quarticIn:(t,e,r,n=1)=>r*(t/=n)*t*t*t+e,quarticOut:(t,e,r,n=1)=>(t/=n,-r*(--t*t*t*t-1)+e),quarticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t*t+e:-r/2*((t-=2)*t*t*t-2)+e,quinticIn:(t,e,r,n=1)=>r*(t/=n)*t*t*t*t+e,quinticOut:(t,e,r,n=1)=>(t/=n,r*(--t*t*t*t*t+1)+e),quinticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t*t*t+e:r/2*((t-=2)*t*t*t*t+2)+e,sinusoidalIn:(t,e,r,n=1)=>-r*Math.cos(t/n*(Math.PI/2))+r+e,sinusoidalOut:(t,e,r,n=1)=>r*Math.sin(t/n*(Math.PI/2))+e,sinusoidalInOut:(t,e,r,n=1)=>-r/2*(Math.cos(Math.PI*t/n)-1)+e,exponentialIn:(t,e,r,n=1)=>r*Math.pow(2,10*(t/n-1))+e,exponentialOut:(t,e,r,n=1)=>r*(1-Math.pow(2,-10*t/n))+e,exponentialInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*Math.pow(2,10*(t-1))+e:(t--,r/2*(2-Math.pow(2,-10*t))+e),circularIn:(t,e,r,n=1)=>(t/=n,-r*(Math.sqrt(1-t*t)-1)+e),circularOut:(t,e,r,n=1)=>(t/=n,t--,r*Math.sqrt(1-t*t)+e),circularInOut:(t,e,r,n=1)=>(t/=n/2)<1?-r/2*(Math.sqrt(1-t*t)-1)+e:(t-=2,r/2*(Math.sqrt(1-t*t)+1)+e),elasticIn:(t,e,r,n=1,i=1,s=.5)=>{if(0===t)return e;if(1==(t/=n))return e+r;s*=n;let o=0;return i{if(0===t)return e;if(1==(t/=n))return e+r;s*=n;let o=0;return i{if(0===t)return e;if(2==(t/=n/2))return e+r;s*=n;let o=0;return ir*(t/=n)*t*((i+1)*t-i)+e,backOut:(t,e,r,n=1,i=1.70158)=>r*((t=t/n-1)*t*((i+1)*t+i)+1)+e,backInOut:(t,e,r,n=1,i=1.70158)=>(t/=n/2)<1?r/2*(t*t*((1+(i*=1.525))*t-i))+e:r/2*((t-=2)*t*((1+(i*=1.525))*t+i)+2)+e,bounceIn:(t,e,n,i=1)=>n-r.bounceOut(i-t,0,n,i)+e,bounceOut:(t,e,r,n=1)=>(t/=n)<1/2.75?r*(7.5625*t*t)+e:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+e:r*(7.5625*(t-=2.625/2.75)*t+.984375)+e,bounceInOut:(t,e,n,i=1)=>t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.composeAnimations=void 0;const n=r(7358),i=r(2765),s=r(8782);function o(t,e,r=.5){const i=Array.isArray(t)?t:[t],o=Array.isArray(e)?e:[e],a=[];for(let t=0,e=i.length;tvoid 0!==t)),r=e.length;if(r>0)return t=>{let n;for(let i=0;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createAnimation=void 0;const n=r(9298);e.createAnimation=function(t){const e=n.createInterpolationCallback(t);if(void 0===e)return;const r=t.delay||0,i=t.afterDelay||0,s=t.direction||"normal",o=t.duration||1e3,a="normal"===s||"reverse"===s?o+r:2*o+r+i,u={delay:r,afterDelay:i,direction:s,duration:o,totalDuration:a,loop:"number"==typeof t.loop?t.loop:!!t.loop},h=n.createInterpolator(t.interpolator),c={loop:0,offset:0,loopDuration:a,direction:"alternate"===s?"normal":s,started:!1,ended:!1,value:void 0};return c.update=function(t,e,r,n){const{loop:i,totalDuration:s,delay:o,afterDelay:a,direction:u,duration:h}=e;return c=>{if("number"==typeof i&&c>=s*i||!1===i&&c>=e.totalDuration)return t.started=!1,t.ended=!0,t.offset=r("normal"===u?h:0,h),void(t.value=n(t.offset));if(t.loop=Math.ceil(c/s),c%=s,(c-=o)<=0)return t.started=!1,t.offset=r(0,h),void(t.value=n(t.offset));if(t.started=!0,"alternate"===u)c<=h?(t.direction="normal",t.offset=r(c,h)):(t.direction="reverse",c-=h,(c-=a)>=0?t.offset=1-r(c>=h?h:c,h):t.offset=1);else{const e=r(c>=h?h:c,h);t.offset="normal"===u?e:1-e}t.value=n(t.offset)}}(c,u,h,e),c}},9298:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createInterpolator=e.createInterpolationCallback=void 0;const n=r(7358),i=r(3431),s=r(9727),o=r(8782);e.createInterpolationCallback=function(t){const e=Array.isArray(t.from)?t.from:[t.from],r=Array.isArray(t.to)?t.to:[t.to],i=t.round,s="hue"===t.colorTransitionMode?o.interpolateColorHSL:o.interpolateColorRGB;if(e.length!==r.length)return;const a=[];for(let t=0,o=e.length;t1===t?s:0===t?n:Math.round((n+t*(s-n))*i)/i:t=>1===t?s:0===t?n:n+t*(s-n))}else{const i=e[t],o=r[t],u=n.parseColorAndConvert(i),h=n.parseColorAndConvert(o);void 0!==u&&void 0!==h&&a.push((t=>1===t?o:0===t?i:s(u,h,t)))}}return t=>{const e=a.map((e=>e(t)));return 1===e.length?e[0]:e}},e.createInterpolator=function(t){var e,r;switch(typeof t){case"function":return(e,r)=>t(e/r,e);case"string":switch(t){case"wave":return(t,e)=>.5+.5*Math.sin(t*Math.PI*2/e+1.5*Math.PI);default:if(t in s.Easings){const e=s.Easings[t];return(t,r)=>e(t,0,1,r)}return(t,e)=>s.Easings.linear(t,0,1,e)}case"object":switch(t.type){case"wave":{const r=1.5*Math.PI+((null===(e=t.params)||void 0===e?void 0:e.phase)||0);return(t,e)=>.5+.5*Math.sin(t*Math.PI*2/e+r)}case"elasticIn":case"elasticOut":case"elasticInOut":{const e=s.Easings[t.type],{amplitude:r,period:n}=t.params||{};return(t,i)=>e(t,0,1,i,r,n)}case"backIn":case"backOut":case"backInOut":{const e=s.Easings[t.type],n=(null===(r=t.params)||void 0===r?void 0:r.overshoot)||void 0;return(t,r)=>e(t,0,1,r,n)}case"cubicBezier":{const e=i.default(t.params[0],t.params[1],t.params[2],t.params[3]);return(t,r)=>e(t/r)}}}return(t,e)=>s.Easings.linear(t,0,1,e)}},7518:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(5240),e),i(r(8782),e),i(r(2765),e),i(r(9298),e),i(r(9727),e),i(r(2894),e)},5240:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},8782:(t,e)=>{"use strict";function r(t,e,r=!0,n="alternate",i=0,s=0){const o="normal"===n||"reverse"===n?e+i:2*e+i+s;return"number"==typeof r&&t>=o*r||!1===r&&t>=o?"normal"===n?e:0:(t%=o,(t-=i)<=0?0:"alternate"===n?t<=e?t:(t-=e,(t-=s)>=0?e-(t>=e?e:t):e):t>=e?e:t)}Object.defineProperty(e,"__esModule",{value:!0}),e.interpolateColorHSL=e.interpolateColorRGB=e.cosp=e.sinp=e.clockOffset=e.clock=void 0,e.clock=r,e.clockOffset=function(t,e,n=!0,i="alternate",s=0,o=0){return r(t,e,n,i,s,o)/e};const n=2*Math.PI;e.sinp=function(t,e,r=0,i=!1){const s=Math.sin(t*n/e+r);return i?.5+.5*s:s},e.cosp=function(t,e,r=0,i=!1){const s=Math.cos(t*n/e+r);return i?.5+.5*s:s},e.interpolateColorRGB=function(t,e,r){const n=t.r+r*(e.r-t.r),i=t.g+r*(e.g-t.g),s=t.b+r*(e.b-t.b),o=t.alpha+r*(e.alpha-t.alpha);return`rgba(${Math.floor(n)},${Math.floor(i)},${Math.floor(s)},${o})`},e.interpolateColorHSL=function(t,e,r){return`hsla(${t.h+r*(e.h-t.h)},${t.s+r*(e.s-t.s)}%,${t.l+r*(e.l-t.l)}%,${t.alpha+r*(e.alpha-t.alpha)})`}},814:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rgbToHsl=e.hslToRgb=e.rgbToHex=void 0,e.rgbToHex=function(t,e,r){return`#${((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}`},e.hslToRgb=function(t,e,r){let n,i,s;if(t/=360,r/=100,0==(e/=100))n=i=s=r;else{const o=(t,e,r)=>(r+=r<0?1:r>1?-1:0)<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,a=r<.5?r*(1+e):r+e-r*e,u=2*r-a;n=o(u,a,t+1/3),i=o(u,a,t),s=o(u,a,t-1/3)}return[.5+255*n<<0,.5+255*i<<0,.5+255*s<<0]},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;const n=Math.max(t,e,r),i=Math.min(t,e,r),s=(n+i)/2;let o,a;if(n===i)o=a=0;else{const u=n-i;switch(a=s>.5?u/(2-n-i):u/(n+i),n){case t:o=(e-r)/u+(e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={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",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",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",rebeccapurple:"#663399",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",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},7358:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(6097),e),i(r(814),e),i(r(5576),e)},5576:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.parseColorAndConvert=void 0;const n=r(4947),i=r(814);function s(t){if("number"==typeof t)return t>16777215?{type:"rgb",a:t>>24&255,b:t>>16&255,c:t>>8&255,alpha:(255&t)/255}:{type:"rgb",a:t>>16&255,b:t>>8&255,c:255&t,alpha:1};t=t.replace(/\s/g,""),n.default[t]&&(t=n.default[t]);let e=/^#([0-9a-f]{3,8})$/i.exec(t);if(e){const t=e[1];return 3===t.length?{type:"rgb",a:parseInt(t[0]+t[0],16),b:parseInt(t[1]+t[1],16),c:parseInt(t[2]+t[2],16),alpha:1}:{type:"rgb",a:parseInt(t[0]+t[1],16),b:parseInt(t[2]+t[3],16),c:parseInt(t[4]+t[5],16),alpha:t.length>6?parseInt(t.substring(6),16)/255:1}}if(e=/^((hsl|rgb)a?)\((\d+),(\d+)%?,(\d+)%?,?(.+)?\)$/i.exec(t),e){const[,,t,r,n,i,s]=e;return{type:t,a:+r,b:+n,c:+i,alpha:s?+s:1}}}e.parseColorAndConvert=function(t){const e=s(t);if(e){if("hsl"===e.type){const[t,r,n]=i.hslToRgb(e.a,e.b,e.c);return{r:t,g:r,b:n,h:e.a,s:e.b,l:e.c,alpha:e.alpha}}{const[t,r,n]=i.rgbToHsl(e.a,e.b,e.c);return{h:t,s:r,l:n,r:e.a,g:e.b,b:e.c,alpha:e.alpha}}}},e.parseColor=s},6097:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1172:t=>{window,t.exports=(()=>{var t={193:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Group=void 0;const n=r(107),i=r(15),s=r(485),o=r(658);class a extends i.SceneChild{constructor(t={}){t.type="Group",super(t),this.children=[],["id","name","data","order","type"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=o.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){"object"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=a},107:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Scene=void 0;const n=r(15),i=r(193),s=r(775),o=r(932);class a{constructor(t={}){this.width=400,this.height=400,this.background="hsla(0, 0%, 0%, 1)",this.color="hsla(0, 0%, 100%, 1)",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?(.5+.5*o.clamp(-1,1,t.anchor[0]))*this.width:"left"===t.anchor[0]?0:"right"===t.anchor[0]?this.width:this.center[0],"number"==typeof t.anchor[1]?(.5+.5*o.clamp(-1,1,t.anchor[1]))*this.height:"top"===t.anchor[1]?0:"bottom"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e="number"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,a.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{a.propagateToChilden(t,e)})):t instanceof s.Shape&&t.shape&&(t.shape.scene=e,a.propagateToChilden(t.shape,e))}}e.Scene=a},15:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||"SceneChild",this.name=t.name||this.type+"_"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){"string"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},932:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(21),i=r(345),s=r(271),o="undefined"!=typeof performance?performance:Date;function a(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return o.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=a,e.relativeClamp=function(t,e,r,n,i){return a(n,i,(r-t)/(e-t)*(i-n)+n)};const u={random:new n(Math.random)};e.noise=function(t="random",e=0,r=0,i=0){return void 0===u[t]&&(u[t]=new n(t)),u[t].noise3D(e,r,i)};const h={};function c(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),s=rn?[s,o]:[o,s]}function l(t,e){const r=t.length,n=r/2,i=2*(n+e),s=n-1;if(s>1){const n=r-2,o=Math.floor(e/s);let a=(i-(r+o*n))/2;const u=Math.round(s/a),h=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%u==0||e===n-2),p=o+(d?1:0),m=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);h[i]=(s=t(),o=t(),a=t(),u=t(),function(){let t=(s>>>=0)+(o>>>=0)|0;return s=o^o>>>9,o=(a>>>=0)+(a<<3)|0,t=t+(u=1+(u>>>=0)|0)|0,a=(a=a<<21|a>>>11)+t|0,(t>>>0)/4294967296})}var s,o,a,u;const c=e+h[i]()*(r-e);return void 0!==n?Math.round(c*10**n)/10**n:c},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return s.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=c,e.interpolate=function(t,e,r=.5){const[n,i]=c(t,e),s=Math.max(n.length,i.length),o="number"==typeof r?[r]:r,a=s/2;if(o.length!==a){const t=o.length;for(let e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return"number"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},348:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(887);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},888:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},658:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(700);var i;!function(t){t[t.None=0]="None",t[t.Scale=2]="Scale",t[t.Center=4]="Center",t[t.Fill=8]="Fill"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn("[Urplfanze:Bounding] cannot sum bounding")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn("[Urplfanze:Bounding] cannot bind bounding")}};class s extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return s.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=s.getBounding(t));const o=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,a=e>=i.Center?r.cx:0,u=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Close=void 0;const n=r(700);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},991:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Mirror=void 0;const n=r(700);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let s=0;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},62:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Offset=void 0;const n=r(700);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i},785:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Smooth=void 0;const n=r(932),i=r(364),s=r(700);class o extends s.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Solidify=void 0;const n=r(700);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const s=[],o=(e="number"==typeof e?[e]:e).length;let a,u,h=[[0,0],[0,0]],c=[[0,0],[0,0]];for(let r=0,l=0,f=t.length-2;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Subdivide=void 0;const n=r(700);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Modifiers=void 0;const n=r(658),i=r(991),s=r(785),o=r(982),a=r(301),u=r(364),h=r(62),c={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:s.Smooth,Solidify:o.Solidify,Subdivide:a.Subdivide,Close:u.Close,Offset:h.Offset};e.Modifiers=c},775:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=void 0;const n=r(107),i=r(15),s=r(485);class o extends s.ShapeBase{constructor(t){t.type=t.type||"Shape",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn("[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\nYou passed:",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):o.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBase=void 0;const n=r(887),i=r(46),s=r(348),o=r(271),a=r(888),u=r(658),h=r(932),c=r(15),l=n.mat4.create(),f=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class m extends c.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?-1*h.clamp(-1,1,t.anchor[0]):"left"===t.anchor[0]?1:"right"===t.anchor[0]?-1:0,"number"==typeof t.anchor[1]?-1*h.clamp(-1,1,t.anchor[1]):"top"===t.anchor[1]?1:"bottom"===t.anchor[1]?-1:0]:[0,0],this.boundingType="string"==typeof t.boundingType?"relative"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return"function"!=typeof t.repetitions&&"function"!=typeof t.distance&&"function"!=typeof t.displace&&"function"!=typeof t.scale&&"function"!=typeof t.translate&&"function"!=typeof t.skewX&&"function"!=typeof t.skewY&&"function"!=typeof t.squeezeX&&"function"!=typeof t.squeezeY&&"function"!=typeof t.rotateX&&"function"!=typeof t.rotateY&&"function"!=typeof t.rotateZ&&"function"!=typeof t.transformOrigin&&"function"!=typeof t.perspective&&"function"!=typeof t.perspectiveOrigin}isStaticIndexed(){return"function"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return"function"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){"string"==typeof t?(r=r||"repetitions"==t,this.props[t]=e):(r=r||"repetitions"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var c,g;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const v=m.getEmptyPropArguments(this,r),y=v.repetition,b=this.getProp("repetitions",v,1),w=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,M=Array.isArray(b)?b[0]*(null!==(c=b[1])&&void 0!==c?c:b[0]):b,x=Array.isArray(b)?b[0]:M,_=Array.isArray(b)?null!==(g=b[1])&&void 0!==g?g:b[0]:1,S=y.row;S.count=x;const P=y.col;P.count=_,y.count=M,y.col.count=_,y.row.count=x,y.type=w;let A=0;const O=[];let E=0;const k=n.vec2.fromValues((_-1)/2,(x-1)/2),I=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],C=[void 0,void 0,void 0,void 0],B=[void 0,void 0,void 0,void 0];for(let r=0;r1?E/(M-1):1,y.angle=w===i.ERepetitionType.Ring?a.PI2/M*E:0,P.index=c+1,P.offset=_>1?c/(_-1):1,S.index=r+1,S.offset=x>1?r/(x-1):1;const m=this.generateBuffer(t,v),g=m.length,b=this.getShapeBounding();O[E]=new Float32Array(g),A+=g;{const t=s.toVec2(this.getProp("distance",v,s.VEC2_ZERO)),a=this.getProp("displace",v,0),M=s.toVec3(this.getProp("scale",v,s.VEC2_ONE),1),x=s.toVec3(this.getProp("translate",v,s.VEC2_ZERO),0),_=this.getProp("skewX",v,0),S=this.getProp("skewY",v,0),P=this.getProp("squeezeX",v,0),A=this.getProp("squeezeY",v,0),R=this.getProp("rotateX",v,0),T=this.getProp("rotateY",v,0),L=this.getProp("rotateZ",v,0),F=h.clamp(0,1,this.getProp("perspective",v,0)),j=s.toVec3(this.getProp("perspectiveOrigin",v,s.VEC2_ZERO),0),D=s.toVec3(this.getProp("transformOrigin",v,s.VEC2_ZERO),0);let z;switch(w){case i.ERepetitionType.Ring:z=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(z,z,s.VEC3_ZERO,y.angle+a);break;case i.ERepetitionType.Matrix:z=n.vec3.fromValues(t[1]*(c-k[0]),t[0]*(r-k[1]),0)}const q=F>0?Math.max(b.width,b.height)/2:1,N=F>0?q+10*q*(1-F):0,U=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==F||0!==D[0]||0!==D[1],Y=0!==j[0]||0!==j[1];U&&(this.boundingType===i.EBoundingType.Relative?(D[0]=D[0]*(b.width/2)+b.cx,D[1]=D[1]*(b.height/2)+b.cy):(D[0]*=b.width/2,D[1]*=b.height/2),D[2]=N);{n.mat4.identity(f),U&&n.mat4.translate(f,f,D),0===x[0]&&0===x[1]||n.mat4.translate(f,f,x),0===_&&0===S||(s.fromSkew(l,[_,S]),n.mat4.multiply(f,f,l)),0!==R&&n.mat4.rotateX(f,f,R),0!==T&&n.mat4.rotateY(f,f,T),0!==L&&n.mat4.rotateZ(f,f,L),1===M[0]&&1===M[1]||n.mat4.scale(f,f,M),U&&n.mat4.translate(f,f,n.vec3.scale(D,D,-1)),N>0&&(Y&&(this.boundingType===i.EBoundingType.Relative?(j[0]=j[0]*(b.width/2)+b.cx,j[1]=j[1]*(b.height/2)+b.cy):(j[0]*=b.width/2,j[1]*=b.height/2),j[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,z),e&&n.mat4.translate(p,p,I);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),w===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,y.angle+a)}u.Bounding.clear(B);for(let t=0;t0&&(Y&&n.vec3.add(e,e,j),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,N),Y&&n.vec3.sub(e,e,j)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=g/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,v)}O[E][t]=e[0],O[E][t+1]=e[1],u.Bounding.add(B,e[0],e[1]),u.Bounding.add(C,e[0],e[1])}}const R={cx:0,cy:0,x:-1,y:-1,width:2,height:2};u.Bounding.bind(R,B),this.bStaticIndexed&&this.bIndexed||this.addIndex(g,y,R)}u.Bounding.bind(this.bounding,C),this.buffer=new Float32Array(A);for(let t=0,e=0,r=O.length;t({index:1,offset:1,count:1}),m.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...m.getEmptySimpleRepetition(),row:m.getEmptySimpleRepetition(),col:m.getEmptySimpleRepetition()})},425:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBuffer=void 0;const n=r(658),i=r(436);class s extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||"ShapeBuffer",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn("[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property"),this.shape=s.EMPTY_BUFFER):this.shape="function"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return"function"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from("function"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,s=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&"function"!=typeof this.props.sideLength&&"function"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=s},549:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeFollow=void 0;const n=r(775);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeFollow",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},s=this.shape;s.generate(t,!1,i);let o=s.getBuffer();const a=o.length,u=new Float32Array(a*(n.length/2)),h=n.length/2;for(let e=0;e1?e/(h-1):1,count:h};this.shapeUseFollow&&(i.follow=r,s.generate(t,!1,i),o=s.getBuffer());const c=e*a,l=2*e,f=n[l],d=n[l+1];for(let t=0,e=o.length;t1?t/(e-1):1;for(let o=0,a=s.length;o{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeLoop=void 0;const n=r(888),i=r(658),s=r(436),o=r(485);class a extends s.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||"ShapeLoop",super(t),this.loopDependencies=(t.loopDependencies||[]).concat("sideLength"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes("propArguments"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}"loop"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||o.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?("function"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),s=this.getRepetitionSideLength(t),o=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,a={index:0,offset:0,current:0,count:n},u=a.count,h=new Float32Array(2*u);for(let n=0,i=0;n1?n/(a.count-1):1;a.current=s,a.index=n+1,a.offset=u;const c=o(a,t);h[i]=c[0],h[i+1]=c[1]}const c=[void 0,void 0,void 0,void 0],l=this.applyModifiers(h,t);for(let t=0,e=l.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapePrimitive=void 0;const n=r(348),i=r(485),s=r(700),o=r(658);class a extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=o.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:"function"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return"function"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:"number"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp("sideLength",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeRecursive=void 0;const n=r(775);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeRecursive",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionScale&&"function"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp("recursions",e,1)),n=Math.floor(this.getProp("recursionVertex",e,0)),s=this.getProp("recursionScale",e,2),o=this.shape;let a={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const u={...e,recursion:a};o.generate(t,!1,u);const h=o.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=h);let c=h;const l=[a];let f=0,d=1;const p=c.length,m=p/2,g=n<=0?m:Math.min(n,m),v=0===n?1:m/Math.min(n,m),y=new Float32Array(i.summmation(r,g)*p);for(let t=0;t1?e/(r-1):1,h=i.summmation(e,g)*p,m=e-1,b=0===m?0:i.summmation(m,g)*p;for(let i=0,m=g**e;i1?i/(m-1):1,count:m,level:{index:e+1,offset:n,count:r},parent:l[f]},l.push(a),this.shapeUseRecursion&&(u.recursion=a,o.generate(t,!1,u),c=o.getBuffer());const w=h+i*p,M=Math.floor(b+2*i*v),x=y[M],_=y[M+1],S=s**e;for(let t=0,e=p;t1?0:1,count:s}}},u=this.shape.getIndexedBuffer()||[];for(let t=0,e=u.length;t1?0:1,count:s}},i={...a,recursion:r},o=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:o})}if(s>1){const t=this.shape.getBufferLength({...i,parent:{...a}})/2,e=o<=0?t:Math.min(o,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let h=0,c=1;for(let t=1;t1?t/(s-1):1;for(let o=0,l=e**t;o1?o/(l-1):1;for(let d=0,p=u.length;d{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Circle=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){t.type="Circle",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=s},702:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Line=void 0;const n=r(658),i=r(425);class s extends i.ShapeBuffer{constructor(t={}){t.type="Line",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lissajous=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){t.type="Lissajous",t.loopDependencies=(t.loopDependencies||[]).concat(["wx","wy","wz"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp("wx",t),r=this.getProp("wy",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),s=this.getRepetitionSideLength(t);return 1/Math.pow(s[0]*s[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp("wx",t,1),this.wy=this.getProp("wy",t,2),this.wz=this.getProp("wz",t,2),super.generateLoopBuffer(t)}}e.Lissajous=s},873:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Polygon=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["sideNumber"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp("sideNumber",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=s},478:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Rect=void 0;const n=r(658),i=r(425);class s extends i.ShapeBuffer{constructor(t={}){t.type="Rect",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=s,s.buffer=[1,1,-1,1,-1,-1,1,-1]},710:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Rose=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){var e,r;t.type="Rose",t.loopDependencies=(t.loopDependencies||[]).concat(["n","d"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>s.getFinalAngleFromK(this.getProp("n",t),this.getProp("d",t)),inc:t=>{const e=this.getProp("n",t),r=this.getProp("d",t),i=this.getRepetitionSideLength(t),s=Math.pow(i[0]*i[1],.45),o=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp("n",t)/this.getProp("d",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=s},82:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Spiral=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type="Spiral",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat(["twists","twistsStart","spiral"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:s.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp("twistsStart",t),end:t=>n.PI2*(this.getProp("twistsStart",t)+this.getProp("twists",t)),inc:t=>{const e=this.getProp("twists",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp("spiral",t),this.r=s.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case s.types.ARCHIMEDE:return t=>t/10;case s.types.HYPERBOLIC:return t=>1/t*3;case s.types.FERMAT:return t=>t**.5/3;case s.types.LITUUS:return t=>t**-.5;case s.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=s,s.types={ARCHIMEDE:"ARCHIMEDE",HYPERBOLIC:"HYPERBOLIC",FERMAT:"FERMAT",LITUUS:"LITUUS",LOGARITHMIC:"LOGARITHMIC"}},490:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Star=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["spikes","innerRadius"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp("spikes",t,5),this.innerRadius=this.getProp("innerRadius",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=s},845:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SuperShape=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){var e,r,i,s,o,a;t.type="SuperShape",t.loopDependencies=(t.loopDependencies||[]).concat(["a","b","m","n1","n2","n3"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(s=t.n1)&&void 0!==s?s:1,this.props.n2=null!==(o=t.n2)&&void 0!==o?o:1,this.props.n3=null!==(a=t.n3)&&void 0!==a?a:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp("a",t),this.b=this.getProp("b",t),this.m=this.getProp("m",t),this.n1=this.getProp("n1",t),this.n2=this.getProp("n2",t),this.n3=this.getProp("n3",t),super.generateLoopBuffer(t)}}e.SuperShape=s},123:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Triangle=void 0;const n=r(658),i=r(425);class s extends i.ShapeBuffer{constructor(t={}){t.type="Triangle",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=s,s.buffer=[1,0,-1,1,-1,-1]},46:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(574),e),i(r(636),e),i(r(345),e),i(r(920),e),i(r(676),e),i(r(300),e),i(r(273),e),i(r(511),e)},574:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},636:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},345:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]="Ring",r[r.Matrix=2]="Matrix"},920:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},676:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},300:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]="Relative",r[r.Fixed=2]="Fixed"},273:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},511:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},887:(t,e,r)=>{"use strict";r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>s,mat3:()=>o,mat4:()=>a,quat:()=>c,quat2:()=>l,vec2:()=>f,vec3:()=>u,vec4:()=>h});var n={};r.r(n),r.d(n,{ARRAY_TYPE:()=>p,EPSILON:()=>d,RANDOM:()=>m,equals:()=>b,setMatrixArrayType:()=>g,toRadian:()=>y});var i={};r.r(i),r.d(i,{LDU:()=>j,add:()=>D,adjoint:()=>E,clone:()=>M,copy:()=>x,create:()=>w,determinant:()=>k,equals:()=>N,exactEquals:()=>q,frob:()=>F,fromRotation:()=>R,fromScaling:()=>T,fromValues:()=>S,identity:()=>_,invert:()=>O,mul:()=>V,multiply:()=>I,multiplyScalar:()=>U,multiplyScalarAndAdd:()=>Y,rotate:()=>C,scale:()=>B,set:()=>P,str:()=>L,sub:()=>Z,subtract:()=>z,transpose:()=>A});var s={};r.r(s),r.d(s,{add:()=>ht,clone:()=>$,copy:()=>X,create:()=>G,determinant:()=>K,equals:()=>pt,exactEquals:()=>dt,frob:()=>ut,fromRotation:()=>it,fromScaling:()=>st,fromTranslation:()=>ot,fromValues:()=>W,identity:()=>H,invert:()=>Q,mul:()=>mt,multiply:()=>tt,multiplyScalar:()=>lt,multiplyScalarAndAdd:()=>ft,rotate:()=>et,scale:()=>rt,set:()=>J,str:()=>at,sub:()=>gt,subtract:()=>ct,translate:()=>nt});var o={};r.r(o),r.d(o,{add:()=>Nt,adjoint:()=>At,clone:()=>bt,copy:()=>wt,create:()=>vt,determinant:()=>Ot,equals:()=>Gt,exactEquals:()=>Zt,frob:()=>qt,fromMat2d:()=>Lt,fromMat4:()=>yt,fromQuat:()=>Ft,fromRotation:()=>Rt,fromScaling:()=>Tt,fromTranslation:()=>Bt,fromValues:()=>Mt,identity:()=>_t,invert:()=>Pt,mul:()=>$t,multiply:()=>Et,multiplyScalar:()=>Yt,multiplyScalarAndAdd:()=>Vt,normalFromMat4:()=>jt,projection:()=>Dt,rotate:()=>It,scale:()=>Ct,set:()=>xt,str:()=>zt,sub:()=>Xt,subtract:()=>Ut,translate:()=>kt,transpose:()=>St});var a={};r.r(a),r.d(a,{add:()=>Te,adjoint:()=>ne,clone:()=>Wt,copy:()=>Jt,create:()=>Ht,determinant:()=>ie,equals:()=>ze,exactEquals:()=>De,frob:()=>Re,fromQuat:()=>Pe,fromQuat2:()=>be,fromRotation:()=>pe,fromRotationTranslation:()=>ye,fromRotationTranslationScale:()=>_e,fromRotationTranslationScaleOrigin:()=>Se,fromScaling:()=>de,fromTranslation:()=>fe,fromValues:()=>Qt,fromXRotation:()=>me,fromYRotation:()=>ge,fromZRotation:()=>ve,frustum:()=>Ae,getRotation:()=>xe,getScaling:()=>Me,getTranslation:()=>we,identity:()=>te,invert:()=>re,lookAt:()=>Ie,mul:()=>qe,multiply:()=>se,multiplyScalar:()=>Fe,multiplyScalarAndAdd:()=>je,ortho:()=>ke,perspective:()=>Oe,perspectiveFromFieldOfView:()=>Ee,rotate:()=>ue,rotateX:()=>he,rotateY:()=>ce,rotateZ:()=>le,scale:()=>ae,set:()=>Kt,str:()=>Be,sub:()=>Ne,subtract:()=>Le,targetTo:()=>Ce,translate:()=>oe,transpose:()=>ee});var u={};r.r(u),r.d(u,{add:()=>Xe,angle:()=>_r,bezier:()=>mr,ceil:()=>Qe,clone:()=>Ye,copy:()=>Ge,create:()=>Ue,cross:()=>fr,dist:()=>Br,distance:()=>sr,div:()=>Cr,divide:()=>Je,dot:()=>lr,equals:()=>Or,exactEquals:()=>Ar,floor:()=>Ke,forEach:()=>Fr,fromValues:()=>Ze,hermite:()=>pr,inverse:()=>hr,len:()=>Tr,length:()=>Ve,lerp:()=>dr,max:()=>er,min:()=>tr,mul:()=>Ir,multiply:()=>We,negate:()=>ur,normalize:()=>cr,random:()=>gr,rotateX:()=>wr,rotateY:()=>Mr,rotateZ:()=>xr,round:()=>rr,scale:()=>nr,scaleAndAdd:()=>ir,set:()=>$e,sqrDist:()=>Rr,sqrLen:()=>Lr,squaredDistance:()=>or,squaredLength:()=>ar,str:()=>Pr,sub:()=>kr,subtract:()=>He,transformMat3:()=>yr,transformMat4:()=>vr,transformQuat:()=>br,zero:()=>Sr});var h={};r.r(h),r.d(h,{add:()=>Ur,ceil:()=>Gr,clone:()=>Dr,copy:()=>qr,create:()=>jr,cross:()=>un,dist:()=>wn,distance:()=>Kr,div:()=>bn,divide:()=>Zr,dot:()=>an,equals:()=>gn,exactEquals:()=>mn,floor:()=>$r,forEach:()=>Sn,fromValues:()=>zr,inverse:()=>sn,len:()=>xn,length:()=>en,lerp:()=>hn,max:()=>Hr,min:()=>Xr,mul:()=>yn,multiply:()=>Vr,negate:()=>nn,normalize:()=>on,random:()=>cn,round:()=>Wr,scale:()=>Jr,scaleAndAdd:()=>Qr,set:()=>Nr,sqrDist:()=>Mn,sqrLen:()=>_n,squaredDistance:()=>tn,squaredLength:()=>rn,str:()=>pn,sub:()=>vn,subtract:()=>Yr,transformMat4:()=>ln,transformQuat:()=>fn,zero:()=>dn});var c={};r.r(c),r.d(c,{add:()=>ei,calculateW:()=>Tn,clone:()=>Jn,conjugate:()=>Nn,copy:()=>Kn,create:()=>Pn,dot:()=>ii,equals:()=>fi,exactEquals:()=>li,exp:()=>Ln,fromEuler:()=>Yn,fromMat3:()=>Un,fromValues:()=>Qn,getAngle:()=>kn,getAxisAngle:()=>En,identity:()=>An,invert:()=>qn,len:()=>ai,length:()=>oi,lerp:()=>si,ln:()=>Fn,mul:()=>ri,multiply:()=>In,normalize:()=>ci,pow:()=>jn,random:()=>zn,rotateX:()=>Cn,rotateY:()=>Bn,rotateZ:()=>Rn,rotationTo:()=>di,scale:()=>ni,set:()=>ti,setAxes:()=>mi,setAxisAngle:()=>On,slerp:()=>Dn,sqlerp:()=>pi,sqrLen:()=>hi,squaredLength:()=>ui,str:()=>Vn});var l={};r.r(l),r.d(l,{add:()=>zi,clone:()=>vi,conjugate:()=>Gi,copy:()=>Si,create:()=>gi,dot:()=>Yi,equals:()=>ts,exactEquals:()=>Ki,fromMat4:()=>_i,fromRotation:()=>xi,fromRotationTranslation:()=>wi,fromRotationTranslationValues:()=>bi,fromTranslation:()=>Mi,fromValues:()=>yi,getDual:()=>Ei,getReal:()=>Oi,getTranslation:()=>Ci,identity:()=>Pi,invert:()=>Zi,len:()=>Xi,length:()=>$i,lerp:()=>Vi,mul:()=>Ni,multiply:()=>qi,normalize:()=>Ji,rotateAroundAxis:()=>Di,rotateByQuatAppend:()=>Fi,rotateByQuatPrepend:()=>ji,rotateX:()=>Ri,rotateY:()=>Ti,rotateZ:()=>Li,scale:()=>Ui,set:()=>Ai,setDual:()=>Ii,setReal:()=>ki,sqrLen:()=>Wi,squaredLength:()=>Hi,str:()=>Qi,translate:()=>Bi});var f={};r.r(f),r.d(f,{add:()=>os,angle:()=>Rs,ceil:()=>cs,clone:()=>rs,copy:()=>is,create:()=>es,cross:()=>Ps,dist:()=>Us,distance:()=>vs,div:()=>Ns,divide:()=>hs,dot:()=>Ss,equals:()=>js,exactEquals:()=>Fs,floor:()=>ls,forEach:()=>Zs,fromValues:()=>ns,inverse:()=>xs,len:()=>Ds,length:()=>bs,lerp:()=>As,max:()=>ds,min:()=>fs,mul:()=>qs,multiply:()=>us,negate:()=>Ms,normalize:()=>_s,random:()=>Os,rotate:()=>Bs,round:()=>ps,scale:()=>ms,scaleAndAdd:()=>gs,set:()=>ss,sqrDist:()=>Ys,sqrLen:()=>Vs,squaredDistance:()=>ys,squaredLength:()=>ws,str:()=>Ls,sub:()=>zs,subtract:()=>as,transformMat2:()=>Es,transformMat2d:()=>ks,transformMat3:()=>Is,transformMat4:()=>Cs,zero:()=>Ts});var d=1e-6,p="undefined"!=typeof Float32Array?Float32Array:Array,m=Math.random;function g(t){p=t}var v=Math.PI/180;function y(t){return t*v}function b(t,e){return Math.abs(t-e)<=d*Math.max(1,Math.abs(t),Math.abs(e))}function w(){var t=new p(4);return p!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function M(t){var e=new p(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function x(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function _(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function S(t,e,r,n){var i=new p(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function P(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function A(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function O(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*s-i*n;return o?(o=1/o,t[0]=s*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}function E(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function k(t){return t[0]*t[3]-t[2]*t[1]}function I(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*a+s*u,t[1]=i*a+o*u,t[2]=n*h+s*c,t[3]=i*h+o*c,t}function C(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u+s*a,t[1]=i*u+o*a,t[2]=n*-a+s*u,t[3]=i*-a+o*u,t}function B(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1];return t[0]=n*a,t[1]=i*a,t[2]=s*u,t[3]=o*u,t}function R(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function T(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function L(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function F(t){return Math.hypot(t[0],t[1],t[2],t[3])}function j(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function D(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function z(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function q(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function N(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=e[0],a=e[1],u=e[2],h=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(s-h)<=d*Math.max(1,Math.abs(s),Math.abs(h))}function U(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Y(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var V=I,Z=z;function G(){var t=new p(6);return p!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function $(t){var e=new p(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function X(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function H(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function W(t,e,r,n,i,s){var o=new p(6);return o[0]=t,o[1]=e,o[2]=r,o[3]=n,o[4]=i,o[5]=s,o}function J(t,e,r,n,i,s,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t}function Q(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=r*s-n*i;return u?(u=1/u,t[0]=s*u,t[1]=-n*u,t[2]=-i*u,t[3]=r*u,t[4]=(i*a-s*o)*u,t[5]=(n*o-r*a)*u,t):null}function K(t){return t[0]*t[3]-t[1]*t[2]}function tt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=r[0],c=r[1],l=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*h+s*c,t[1]=i*h+o*c,t[2]=n*l+s*f,t[3]=i*l+o*f,t[4]=n*d+s*p+a,t[5]=i*d+o*p+u,t}function et(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*h,t[1]=i*c+o*h,t[2]=n*-h+s*c,t[3]=i*-h+o*c,t[4]=a,t[5]=u,t}function rt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=r[0],c=r[1];return t[0]=n*h,t[1]=i*h,t[2]=s*c,t[3]=o*c,t[4]=a,t[5]=u,t}function nt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=n*h+s*c+a,t[5]=i*h+o*c+u,t}function it(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function st(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function ot(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function at(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function ut(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function ht(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function ct(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function lt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function ft(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function dt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function pt(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],u=e[0],h=e[1],c=e[2],l=e[3],f=e[4],p=e[5];return Math.abs(r-u)<=d*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-h)<=d*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-c)<=d*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(s-l)<=d*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(o-f)<=d*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-p)<=d*Math.max(1,Math.abs(a),Math.abs(p))}var mt=tt,gt=ct;function vt(){var t=new p(9);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function bt(t){var e=new p(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function wt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Mt(t,e,r,n,i,s,o,a,u){var h=new p(9);return h[0]=t,h[1]=e,h[2]=r,h[3]=n,h[4]=i,h[5]=s,h[6]=o,h[7]=a,h[8]=u,h}function xt(t,e,r,n,i,s,o,a,u,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=u,t[8]=h,t}function _t(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function St(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function Pt(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=c*o-a*h,f=-c*s+a*u,d=h*s-o*u,p=r*l+n*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-c*n+i*h)*p,t[2]=(a*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*u)*p,t[5]=(-a*r+i*s)*p,t[6]=d*p,t[7]=(-h*r+n*u)*p,t[8]=(o*r-n*s)*p,t):null}function At(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8];return t[0]=o*c-a*h,t[1]=i*h-n*c,t[2]=n*a-i*o,t[3]=a*u-s*c,t[4]=r*c-i*u,t[5]=i*s-r*a,t[6]=s*h-o*u,t[7]=n*u-r*h,t[8]=r*o-n*s,t}function Ot(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],u=t[7],h=t[8];return e*(h*s-o*u)+r*(-h*i+o*a)+n*(u*i-s*a)}function Et(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=r[0],d=r[1],p=r[2],m=r[3],g=r[4],v=r[5],y=r[6],b=r[7],w=r[8];return t[0]=f*n+d*o+p*h,t[1]=f*i+d*a+p*c,t[2]=f*s+d*u+p*l,t[3]=m*n+g*o+v*h,t[4]=m*i+g*a+v*c,t[5]=m*s+g*u+v*l,t[6]=y*n+b*o+w*h,t[7]=y*i+b*a+w*c,t[8]=y*s+b*u+w*l,t}function kt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=u,t[6]=f*n+d*o+h,t[7]=f*i+d*a+c,t[8]=f*s+d*u+l,t}function It(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*a,t[2]=d*s+f*u,t[3]=d*o-f*n,t[4]=d*a-f*i,t[5]=d*u-f*s,t[6]=h,t[7]=c,t[8]=l,t}function Ct(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Bt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function Rt(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Tt(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Lt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function Ft(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,u=i+i,h=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*u,m=s*o,g=s*a,v=s*u;return t[0]=1-l-p,t[3]=c-v,t[6]=f+g,t[1]=c+v,t[4]=1-h-p,t[7]=d-m,t[2]=f-g,t[5]=d+m,t[8]=1-h-l,t}function jt(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*u-i*o,w=r*h-s*o,M=n*u-i*a,x=n*h-s*a,_=i*h-s*u,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,O=l*g-f*m,E=l*v-d*m,k=f*v-d*g,I=y*k-b*E+w*O+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-u*E+h*O)*I,t[1]=(u*A-o*k-h*P)*I,t[2]=(o*E-a*A+h*S)*I,t[3]=(i*E-n*k-s*O)*I,t[4]=(r*k-i*A+s*P)*I,t[5]=(n*A-r*E-s*S)*I,t[6]=(m*_-g*x+v*M)*I,t[7]=(g*w-p*_-v*b)*I,t[8]=(p*x-m*w+v*y)*I,t):null}function Dt(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function zt(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function qt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Nt(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function Ut(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function Yt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function Vt(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function Zt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function Gt(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],u=t[6],h=t[7],c=t[8],l=e[0],f=e[1],p=e[2],m=e[3],g=e[4],v=e[5],y=e[6],b=e[7],w=e[8];return Math.abs(r-l)<=d*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(n-f)<=d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-p)<=d*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(s-m)<=d*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(o-g)<=d*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(a-v)<=d*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(u-y)<=d*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(h-b)<=d*Math.max(1,Math.abs(h),Math.abs(b))&&Math.abs(c-w)<=d*Math.max(1,Math.abs(c),Math.abs(w))}var $t=Et,Xt=Ut;function Ht(){var t=new p(16);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Wt(t){var e=new p(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Jt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Qt(t,e,r,n,i,s,o,a,u,h,c,l,f,d,m,g){var v=new p(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=n,v[4]=i,v[5]=s,v[6]=o,v[7]=a,v[8]=u,v[9]=h,v[10]=c,v[11]=l,v[12]=f,v[13]=d,v[14]=m,v[15]=g,v}function Kt(t,e,r,n,i,s,o,a,u,h,c,l,f,d,p,m,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=u,t[8]=h,t[9]=c,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=g,t}function te(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ee(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=i,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function re(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*u-i*o,w=r*h-s*o,M=n*u-i*a,x=n*h-s*a,_=i*h-s*u,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,O=l*g-f*m,E=l*v-d*m,k=f*v-d*g,I=y*k-b*E+w*O+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-u*E+h*O)*I,t[1]=(i*E-n*k-s*O)*I,t[2]=(m*_-g*x+v*M)*I,t[3]=(f*x-l*_-d*M)*I,t[4]=(u*A-o*k-h*P)*I,t[5]=(r*k-i*A+s*P)*I,t[6]=(g*w-p*_-v*b)*I,t[7]=(c*_-f*w+d*b)*I,t[8]=(o*E-a*A+h*S)*I,t[9]=(n*A-r*E-s*S)*I,t[10]=(p*x-m*w+v*y)*I,t[11]=(l*w-c*x-d*y)*I,t[12]=(a*P-o*O-u*S)*I,t[13]=(r*O-n*P+i*S)*I,t[14]=(m*b-p*M-g*y)*I,t[15]=(c*M-l*b+f*y)*I,t):null}function ne(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15];return t[0]=a*(f*v-d*g)-l*(u*v-h*g)+m*(u*d-h*f),t[1]=-(n*(f*v-d*g)-l*(i*v-s*g)+m*(i*d-s*f)),t[2]=n*(u*v-h*g)-a*(i*v-s*g)+m*(i*h-s*u),t[3]=-(n*(u*d-h*f)-a*(i*d-s*f)+l*(i*h-s*u)),t[4]=-(o*(f*v-d*g)-c*(u*v-h*g)+p*(u*d-h*f)),t[5]=r*(f*v-d*g)-c*(i*v-s*g)+p*(i*d-s*f),t[6]=-(r*(u*v-h*g)-o*(i*v-s*g)+p*(i*h-s*u)),t[7]=r*(u*d-h*f)-o*(i*d-s*f)+c*(i*h-s*u),t[8]=o*(l*v-d*m)-c*(a*v-h*m)+p*(a*d-h*l),t[9]=-(r*(l*v-d*m)-c*(n*v-s*m)+p*(n*d-s*l)),t[10]=r*(a*v-h*m)-o*(n*v-s*m)+p*(n*h-s*a),t[11]=-(r*(a*d-h*l)-o*(n*d-s*l)+c*(n*h-s*a)),t[12]=-(o*(l*g-f*m)-c*(a*g-u*m)+p*(a*f-u*l)),t[13]=r*(l*g-f*m)-c*(n*g-i*m)+p*(n*f-i*l),t[14]=-(r*(a*g-u*m)-o*(n*g-i*m)+p*(n*u-i*a)),t[15]=r*(a*f-u*l)-o*(n*f-i*l)+c*(n*u-i*a),t}function ie(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],u=t[7],h=t[8],c=t[9],l=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*s)*(l*g-f*m)-(e*a-n*s)*(c*g-f*p)+(e*u-i*s)*(c*m-l*p)+(r*a-n*o)*(h*g-f*d)-(r*u-i*o)*(h*m-l*d)+(n*u-i*a)*(h*p-c*d)}function se(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],v=e[14],y=e[15],b=r[0],w=r[1],M=r[2],x=r[3];return t[0]=b*n+w*a+M*l+x*m,t[1]=b*i+w*u+M*f+x*g,t[2]=b*s+w*h+M*d+x*v,t[3]=b*o+w*c+M*p+x*y,b=r[4],w=r[5],M=r[6],x=r[7],t[4]=b*n+w*a+M*l+x*m,t[5]=b*i+w*u+M*f+x*g,t[6]=b*s+w*h+M*d+x*v,t[7]=b*o+w*c+M*p+x*y,b=r[8],w=r[9],M=r[10],x=r[11],t[8]=b*n+w*a+M*l+x*m,t[9]=b*i+w*u+M*f+x*g,t[10]=b*s+w*h+M*d+x*v,t[11]=b*o+w*c+M*p+x*y,b=r[12],w=r[13],M=r[14],x=r[15],t[12]=b*n+w*a+M*l+x*m,t[13]=b*i+w*u+M*f+x*g,t[14]=b*s+w*h+M*d+x*v,t[15]=b*o+w*c+M*p+x*y,t}function oe(t,e,r){var n,i,s,o,a,u,h,c,l,f,d,p,m=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=u,t[6]=h,t[7]=c,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+a*g+l*v+e[12],t[13]=i*m+u*g+f*v+e[13],t[14]=s*m+h*g+d*v+e[14],t[15]=o*m+c*g+p*v+e[15]),t}function ae(t,e,r){var n=r[0],i=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ue(t,e,r,n){var i,s,o,a,u,h,c,l,f,p,m,g,v,y,b,w,M,x,_,S,P,A,O,E,k=n[0],I=n[1],C=n[2],B=Math.hypot(k,I,C);return B0?(r[0]=2*(a*o+c*n+u*s-h*i)/l,r[1]=2*(u*o+c*i+h*n-a*s)/l,r[2]=2*(h*o+c*s+a*i-u*n)/l):(r[0]=2*(a*o+c*n+u*s-h*i),r[1]=2*(u*o+c*i+h*n-a*s),r[2]=2*(h*o+c*s+a*i-u*n)),ye(t,e,r),t}function we(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Me(t,e){var r=e[0],n=e[1],i=e[2],s=e[4],o=e[5],a=e[6],u=e[8],h=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(s,o,a),t[2]=Math.hypot(u,h,c),t}function xe(t,e){var r=new p(3);Me(r,e);var n=1/r[0],i=1/r[1],s=1/r[2],o=e[0]*n,a=e[1]*i,u=e[2]*s,h=e[4]*n,c=e[5]*i,l=e[6]*s,f=e[8]*n,d=e[9]*i,m=e[10]*s,g=o+c+m,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(l-d)/v,t[1]=(f-u)/v,t[2]=(a-h)/v):o>c&&o>m?(v=2*Math.sqrt(1+o-c-m),t[3]=(l-d)/v,t[0]=.25*v,t[1]=(a+h)/v,t[2]=(f+u)/v):c>m?(v=2*Math.sqrt(1+c-o-m),t[3]=(f-u)/v,t[0]=(a+h)/v,t[1]=.25*v,t[2]=(l+d)/v):(v=2*Math.sqrt(1+m-o-c),t[3]=(a-h)/v,t[0]=(f+u)/v,t[1]=(l+d)/v,t[2]=.25*v),t}function _e(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3],u=i+i,h=s+s,c=o+o,l=i*u,f=i*h,d=i*c,p=s*h,m=s*c,g=o*c,v=a*u,y=a*h,b=a*c,w=n[0],M=n[1],x=n[2];return t[0]=(1-(p+g))*w,t[1]=(f+b)*w,t[2]=(d-y)*w,t[3]=0,t[4]=(f-b)*M,t[5]=(1-(l+g))*M,t[6]=(m+v)*M,t[7]=0,t[8]=(d+y)*x,t[9]=(m-v)*x,t[10]=(1-(l+p))*x,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function Se(t,e,r,n,i){var s=e[0],o=e[1],a=e[2],u=e[3],h=s+s,c=o+o,l=a+a,f=s*h,d=s*c,p=s*l,m=o*c,g=o*l,v=a*l,y=u*h,b=u*c,w=u*l,M=n[0],x=n[1],_=n[2],S=i[0],P=i[1],A=i[2],O=(1-(m+v))*M,E=(d+w)*M,k=(p-b)*M,I=(d-w)*x,C=(1-(f+v))*x,B=(g+y)*x,R=(p+b)*_,T=(g-y)*_,L=(1-(f+m))*_;return t[0]=O,t[1]=E,t[2]=k,t[3]=0,t[4]=I,t[5]=C,t[6]=B,t[7]=0,t[8]=R,t[9]=T,t[10]=L,t[11]=0,t[12]=r[0]+S-(O*S+I*P+R*A),t[13]=r[1]+P-(E*S+C*P+T*A),t[14]=r[2]+A-(k*S+B*P+L*A),t[15]=1,t}function Pe(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,u=i+i,h=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*u,m=s*o,g=s*a,v=s*u;return t[0]=1-l-p,t[1]=c+v,t[2]=f-g,t[3]=0,t[4]=c-v,t[5]=1-h-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-h-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ae(t,e,r,n,i,s,o){var a=1/(r-e),u=1/(i-n),h=1/(s-o);return t[0]=2*s*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*u,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*u,t[10]=(o+s)*h,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*h,t[15]=0,t}function Oe(t,e,r,n,i){var s,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(s=1/(n-i),t[10]=(i+n)*s,t[14]=2*i*n*s):(t[10]=-1,t[14]=-2*n),t}function Ee(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),u=2/(o+a),h=2/(i+s);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=h,t[6]=0,t[7]=0,t[8]=-(o-a)*u*.5,t[9]=(i-s)*h*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function ke(t,e,r,n,i,s,o){var a=1/(e-r),u=1/(n-i),h=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*u,t[14]=(o+s)*h,t[15]=1,t}function Ie(t,e,r,n){var i,s,o,a,u,h,c,l,f,p,m=e[0],g=e[1],v=e[2],y=n[0],b=n[1],w=n[2],M=r[0],x=r[1],_=r[2];return Math.abs(m-M)0&&(c*=d=1/Math.sqrt(d),l*=d,f*=d);var p=u*f-h*l,m=h*c-a*f,g=a*l-u*c;return(d=p*p+m*m+g*g)>0&&(p*=d=1/Math.sqrt(d),m*=d,g*=d),t[0]=p,t[1]=m,t[2]=g,t[3]=0,t[4]=l*g-f*m,t[5]=f*p-c*g,t[6]=c*m-l*p,t[7]=0,t[8]=c,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=s,t[14]=o,t[15]=1,t}function Be(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Re(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Te(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Le(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function Fe(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function je(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function De(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function ze(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],u=t[6],h=t[7],c=t[8],l=t[9],f=t[10],p=t[11],m=t[12],g=t[13],v=t[14],y=t[15],b=e[0],w=e[1],M=e[2],x=e[3],_=e[4],S=e[5],P=e[6],A=e[7],O=e[8],E=e[9],k=e[10],I=e[11],C=e[12],B=e[13],R=e[14],T=e[15];return Math.abs(r-b)<=d*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-w)<=d*Math.max(1,Math.abs(n),Math.abs(w))&&Math.abs(i-M)<=d*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(s-x)<=d*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(o-_)<=d*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(a-S)<=d*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(u-P)<=d*Math.max(1,Math.abs(u),Math.abs(P))&&Math.abs(h-A)<=d*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(c-O)<=d*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(l-E)<=d*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(f-k)<=d*Math.max(1,Math.abs(f),Math.abs(k))&&Math.abs(p-I)<=d*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(m-C)<=d*Math.max(1,Math.abs(m),Math.abs(C))&&Math.abs(g-B)<=d*Math.max(1,Math.abs(g),Math.abs(B))&&Math.abs(v-R)<=d*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(y-T)<=d*Math.max(1,Math.abs(y),Math.abs(T))}var qe=se,Ne=Le;function Ue(){var t=new p(3);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ye(t){var e=new p(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Ve(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function Ze(t,e,r){var n=new p(3);return n[0]=t,n[1]=e,n[2]=r,n}function Ge(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function $e(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function Xe(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function He(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function We(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function Je(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function Qe(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Ke(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function tr(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function er(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function rr(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function nr(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function ir(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function sr(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function or(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function ar(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function ur(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function hr(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function cr(t,e){var r=e[0],n=e[1],i=e[2],s=r*r+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function lr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function fr(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],u=r[2];return t[0]=i*u-s*a,t[1]=s*o-n*u,t[2]=n*a-i*o,t}function dr(t,e,r,n){var i=e[0],s=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t}function pr(t,e,r,n,i,s){var o=s*s,a=o*(2*s-3)+1,u=o*(s-2)+s,h=o*(s-1),c=o*(3-2*s);return t[0]=e[0]*a+r[0]*u+n[0]*h+i[0]*c,t[1]=e[1]*a+r[1]*u+n[1]*h+i[1]*c,t[2]=e[2]*a+r[2]*u+n[2]*h+i[2]*c,t}function mr(t,e,r,n,i,s){var o=1-s,a=o*o,u=s*s,h=a*o,c=3*s*a,l=3*u*o,f=u*s;return t[0]=e[0]*h+r[0]*c+n[0]*l+i[0]*f,t[1]=e[1]*h+r[1]*c+n[1]*l+i[1]*f,t[2]=e[2]*h+r[2]*c+n[2]*l+i[2]*f,t}function gr(t,e){e=e||1;var r=2*m()*Math.PI,n=2*m()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}function vr(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[3]*n+r[7]*i+r[11]*s+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*s+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*s+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*s+r[14])/o,t}function yr(t,e,r){var n=e[0],i=e[1],s=e[2];return t[0]=n*r[0]+i*r[3]+s*r[6],t[1]=n*r[1]+i*r[4]+s*r[7],t[2]=n*r[2]+i*r[5]+s*r[8],t}function br(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],u=e[1],h=e[2],c=i*h-s*u,l=s*a-n*h,f=n*u-i*a,d=i*f-s*l,p=s*c-n*f,m=n*l-i*c,g=2*o;return c*=g,l*=g,f*=g,d*=2,p*=2,m*=2,t[0]=a+c+d,t[1]=u+l+p,t[2]=h+f+m,t}function wr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0],s[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),s[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function Mr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),s[1]=i[1],s[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function xr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),s[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),s[2]=i[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function _r(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2],u=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(s*s+o*o+a*a),h=u&&lr(t,e)/u;return Math.acos(Math.min(Math.max(h,-1),1))}function Sr(t){return t[0]=0,t[1]=0,t[2]=0,t}function Pr(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function Ar(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Or(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2];return Math.abs(r-s)<=d*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-o)<=d*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=d*Math.max(1,Math.abs(i),Math.abs(a))}var Er,kr=He,Ir=We,Cr=Je,Br=sr,Rr=or,Tr=Ve,Lr=ar,Fr=(Er=Ue(),function(t,e,r,n,i,s){var o,a;for(e||(e=3),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=s*o,t}function an(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function un(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],s=r[0]*n[2]-r[2]*n[0],o=r[0]*n[3]-r[3]*n[0],a=r[1]*n[2]-r[2]*n[1],u=r[1]*n[3]-r[3]*n[1],h=r[2]*n[3]-r[3]*n[2],c=e[0],l=e[1],f=e[2],d=e[3];return t[0]=l*h-f*u+d*a,t[1]=-c*h+f*o-d*s,t[2]=c*u-l*o+d*i,t[3]=-c*a+l*s-f*i,t}function hn(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t[3]=a+n*(r[3]-a),t}function cn(t,e){var r,n,i,s,o,a;e=e||1;do{o=(r=2*m()-1)*r+(n=2*m()-1)*n}while(o>=1);do{a=(i=2*m()-1)*i+(s=2*m()-1)*s}while(a>=1);var u=Math.sqrt((1-o)/a);return t[0]=e*r,t[1]=e*n,t[2]=e*i*u,t[3]=e*s*u,t}function ln(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*s+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*s+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*s+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*s+r[15]*o,t}function fn(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],u=r[2],h=r[3],c=h*n+a*s-u*i,l=h*i+u*n-o*s,f=h*s+o*i-a*n,d=-o*n-a*i-u*s;return t[0]=c*h+d*-o+l*-u-f*-a,t[1]=l*h+d*-a+f*-o-c*-u,t[2]=f*h+d*-u+c*-a-l*-o,t[3]=e[3],t}function dn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function pn(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function mn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function gn(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=e[0],a=e[1],u=e[2],h=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(s-h)<=d*Math.max(1,Math.abs(s),Math.abs(h))}var vn=Yr,yn=Vr,bn=Zr,wn=Kr,Mn=tn,xn=en,_n=rn,Sn=function(){var t=jr();return function(e,r,n,i,s,o){var a,u;for(r||(r=4),n||(n=0),u=i?Math.min(i*r+n,e.length):e.length,a=n;ad?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r}function kn(t,e){var r=ii(t,e);return Math.acos(2*r*r-1)}function In(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*c+o*a+i*h-s*u,t[1]=i*c+o*u+s*a-n*h,t[2]=s*c+o*h+n*u-i*a,t[3]=o*c-n*a-i*u-s*h,t}function Cn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u+o*a,t[1]=i*u+s*a,t[2]=s*u-i*a,t[3]=o*u-n*a,t}function Bn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u-s*a,t[1]=i*u+o*a,t[2]=s*u+n*a,t[3]=o*u-i*a,t}function Rn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u+i*a,t[1]=i*u-n*a,t[2]=s*u+o*a,t[3]=o*u-s*a,t}function Tn(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function Ln(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=Math.exp(s),u=o>0?a*Math.sin(o)/o:0;return t[0]=r*u,t[1]=n*u,t[2]=i*u,t[3]=a*Math.cos(o),t}function Fn(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=o>0?Math.atan2(o,s)/o:0;return t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=.5*Math.log(r*r+n*n+i*i+s*s),t}function jn(t,e,r){return Fn(t,e),ni(t,t,r),Ln(t,t),t}function Dn(t,e,r,n){var i,s,o,a,u,h=e[0],c=e[1],l=e[2],f=e[3],p=r[0],m=r[1],g=r[2],v=r[3];return(s=h*p+c*m+l*g+f*v)<0&&(s=-s,p=-p,m=-m,g=-g,v=-v),1-s>d?(i=Math.acos(s),o=Math.sin(i),a=Math.sin((1-n)*i)/o,u=Math.sin(n*i)/o):(a=1-n,u=n),t[0]=a*h+u*p,t[1]=a*c+u*m,t[2]=a*l+u*g,t[3]=a*f+u*v,t}function zn(t){var e=m(),r=m(),n=m(),i=Math.sqrt(1-e),s=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*r),t[1]=i*Math.cos(2*Math.PI*r),t[2]=s*Math.sin(2*Math.PI*n),t[3]=s*Math.cos(2*Math.PI*n),t}function qn(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s,a=o?1/o:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=s*a,t}function Nn(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Un(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var s=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*s+s]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*s+o]-e[3*o+s])*r,t[s]=(e[3*s+i]+e[3*i+s])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t}function Yn(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var s=Math.sin(e),o=Math.cos(e),a=Math.sin(r),u=Math.cos(r),h=Math.sin(n),c=Math.cos(n);return t[0]=s*u*c-o*a*h,t[1]=o*a*c+s*u*h,t[2]=o*u*h-s*a*c,t[3]=o*u*c+s*a*h,t}function Vn(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var Zn,Gn,$n,Xn,Hn,Wn,Jn=Dr,Qn=zr,Kn=qr,ti=Nr,ei=Ur,ri=In,ni=Jr,ii=an,si=hn,oi=en,ai=oi,ui=rn,hi=ui,ci=on,li=mn,fi=gn,di=(Zn=Ue(),Gn=Ze(1,0,0),$n=Ze(0,1,0),function(t,e,r){var n=lr(e,r);return n<-.999999?(fr(Zn,Gn,e),Tr(Zn)<1e-6&&fr(Zn,$n,e),cr(Zn,Zn),On(t,Zn,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(fr(Zn,e,r),t[0]=Zn[0],t[1]=Zn[1],t[2]=Zn[2],t[3]=1+n,ci(t,t))}),pi=(Xn=Pn(),Hn=Pn(),function(t,e,r,n,i,s){return Dn(Xn,e,i,s),Dn(Hn,r,n,s),Dn(t,Xn,Hn,2*s*(1-s)),t}),mi=(Wn=vt(),function(t,e,r,n){return Wn[0]=r[0],Wn[3]=r[1],Wn[6]=r[2],Wn[1]=n[0],Wn[4]=n[1],Wn[7]=n[2],Wn[2]=-e[0],Wn[5]=-e[1],Wn[8]=-e[2],ci(t,Un(t,Wn))});function gi(){var t=new p(8);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function vi(t){var e=new p(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function yi(t,e,r,n,i,s,o,a){var u=new p(8);return u[0]=t,u[1]=e,u[2]=r,u[3]=n,u[4]=i,u[5]=s,u[6]=o,u[7]=a,u}function bi(t,e,r,n,i,s,o){var a=new p(8);a[0]=t,a[1]=e,a[2]=r,a[3]=n;var u=.5*i,h=.5*s,c=.5*o;return a[4]=u*n+h*r-c*e,a[5]=h*n+c*t-u*r,a[6]=c*n+u*e-h*t,a[7]=-u*t-h*e-c*r,a}function wi(t,e,r){var n=.5*r[0],i=.5*r[1],s=.5*r[2],o=e[0],a=e[1],u=e[2],h=e[3];return t[0]=o,t[1]=a,t[2]=u,t[3]=h,t[4]=n*h+i*u-s*a,t[5]=i*h+s*o-n*u,t[6]=s*h+n*a-i*o,t[7]=-n*o-i*a-s*u,t}function Mi(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function xi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function _i(t,e){var r=Pn();xe(r,e);var n=new p(3);return we(n,e),wi(t,r,n),t}function Si(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function Pi(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Ai(t,e,r,n,i,s,o,a,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=u,t}var Oi=Kn;function Ei(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var ki=Kn;function Ii(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function Ci(t,e){var r=e[4],n=e[5],i=e[6],s=e[7],o=-e[0],a=-e[1],u=-e[2],h=e[3];return t[0]=2*(r*h+s*o+n*u-i*a),t[1]=2*(n*h+s*a+i*o-r*u),t[2]=2*(i*h+s*u+r*a-n*o),t}function Bi(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=.5*r[0],u=.5*r[1],h=.5*r[2],c=e[4],l=e[5],f=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=o*a+i*h-s*u+c,t[5]=o*u+s*a-n*h+l,t[6]=o*h+n*u-i*a+f,t[7]=-n*a-i*u-s*h+d,t}function Ri(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=a*o+c*n+u*s-h*i,f=u*o+c*i+h*n-a*s,d=h*o+c*s+a*i-u*n,p=c*o-a*n-u*i-h*s;return Cn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Ti(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=a*o+c*n+u*s-h*i,f=u*o+c*i+h*n-a*s,d=h*o+c*s+a*i-u*n,p=c*o-a*n-u*i-h*s;return Bn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Li(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=a*o+c*n+u*s-h*i,f=u*o+c*i+h*n-a*s,d=h*o+c*s+a*i-u*n,p=c*o-a*n-u*i-h*s;return Rn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Fi(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],u=e[1],h=e[2],c=e[3];return t[0]=a*o+c*n+u*s-h*i,t[1]=u*o+c*i+h*n-a*s,t[2]=h*o+c*s+a*i-u*n,t[3]=c*o-a*n-u*i-h*s,a=e[4],u=e[5],h=e[6],c=e[7],t[4]=a*o+c*n+u*s-h*i,t[5]=u*o+c*i+h*n-a*s,t[6]=h*o+c*s+a*i-u*n,t[7]=c*o-a*n-u*i-h*s,t}function ji(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*c+o*a+i*h-s*u,t[1]=i*c+o*u+s*a-n*h,t[2]=s*c+o*h+n*u-i*a,t[3]=o*c-n*a-i*u-s*h,a=r[4],u=r[5],h=r[6],c=r[7],t[4]=n*c+o*a+i*h-s*u,t[5]=i*c+o*u+s*a-n*h,t[6]=s*c+o*h+n*u-i*a,t[7]=o*c-n*a-i*u-s*h,t}function Di(t,e,r,n){if(Math.abs(n)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,s=e[2]/r,o=e[3]/r,a=e[4],u=e[5],h=e[6],c=e[7],l=n*a+i*u+s*h+o*c;t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=(a-n*l)/r,t[5]=(u-i*l)/r,t[6]=(h-s*l)/r,t[7]=(c-o*l)/r}return t}function Qi(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function Ki(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function ts(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],u=t[6],h=t[7],c=e[0],l=e[1],f=e[2],p=e[3],m=e[4],g=e[5],v=e[6],y=e[7];return Math.abs(r-c)<=d*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(n-l)<=d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-f)<=d*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(s-p)<=d*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(o-m)<=d*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(a-g)<=d*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(u-v)<=d*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(h-y)<=d*Math.max(1,Math.abs(h),Math.abs(y))}function es(){var t=new p(2);return p!=Float32Array&&(t[0]=0,t[1]=0),t}function rs(t){var e=new p(2);return e[0]=t[0],e[1]=t[1],e}function ns(t,e){var r=new p(2);return r[0]=t,r[1]=e,r}function is(t,e){return t[0]=e[0],t[1]=e[1],t}function ss(t,e,r){return t[0]=e,t[1]=r,t}function os(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function as(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function us(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function hs(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function cs(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function ls(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function fs(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function ds(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function ps(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function ms(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function gs(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function vs(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function ys(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function bs(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function ws(t){var e=t[0],r=t[1];return e*e+r*r}function Ms(t,e){return t[0]=-e[0],t[1]=-e[1],t}function xs(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function _s(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function Ss(t,e){return t[0]*e[0]+t[1]*e[1]}function Ps(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function As(t,e,r,n){var i=e[0],s=e[1];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t}function Os(t,e){e=e||1;var r=2*m()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function Es(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function ks(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function Is(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function Cs(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function Bs(t,e,r,n){var i=e[0]-r[0],s=e[1]-r[1],o=Math.sin(n),a=Math.cos(n);return t[0]=i*a-s*o+r[0],t[1]=i*o+s*a+r[1],t}function Rs(t,e){var r=t[0],n=t[1],i=e[0],s=e[1],o=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+s*s),a=o&&(r*i+n*s)/o;return Math.acos(Math.min(Math.max(a,-1),1))}function Ts(t){return t[0]=0,t[1]=0,t}function Ls(t){return"vec2("+t[0]+", "+t[1]+")"}function Fs(t,e){return t[0]===e[0]&&t[1]===e[1]}function js(t,e){var r=t[0],n=t[1],i=e[0],s=e[1];return Math.abs(r-i)<=d*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))}var Ds=bs,zs=as,qs=us,Ns=hs,Us=vs,Ys=ys,Vs=ws,Zs=function(){var t=es();return function(e,r,n,i,s,o){var a,u;for(r||(r=2),n||(n=0),u=i?Math.min(i*r+n,e.length):e.length,a=n;a{var n;!function(){"use strict";var i=.5*(Math.sqrt(3)-1),s=(3-Math.sqrt(3))/6,o=1/6,a=(Math.sqrt(5)-1)/4,u=(5-Math.sqrt(5))/20;function h(t){var e;e="function"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=l();t=i(" "),e=i(" "),r=i(" ");for(var s=0;s>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}h.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,o=this.permMod12,a=this.perm,u=this.grad3,h=0,c=0,l=0,f=(t+e)*i,d=Math.floor(t+f),p=Math.floor(e+f),m=(d+p)*s,g=t-(d-m),v=e-(p-m);g>v?(r=1,n=0):(r=0,n=1);var y=g-r+s,b=v-n+s,w=g-1+2*s,M=v-1+2*s,x=255&d,_=255&p,S=.5-g*g-v*v;if(S>=0){var P=3*o[x+a[_]];h=(S*=S)*S*(u[P]*g+u[P+1]*v)}var A=.5-y*y-b*b;if(A>=0){var O=3*o[x+r+a[_+n]];c=(A*=A)*A*(u[O]*y+u[O+1]*b)}var E=.5-w*w-M*M;if(E>=0){var k=3*o[x+1+a[_+1]];l=(E*=E)*E*(u[k]*w+u[k+1]*M)}return 70*(h+c+l)},noise3D:function(t,e,r){var n,i,s,a,u,h,c,l,f,d,p=this.permMod12,m=this.perm,g=this.grad3,v=.3333333333333333*(t+e+r),y=Math.floor(t+v),b=Math.floor(e+v),w=Math.floor(r+v),M=(y+b+w)*o,x=t-(y-M),_=e-(b-M),S=r-(w-M);x>=_?_>=S?(u=1,h=0,c=0,l=1,f=1,d=0):x>=S?(u=1,h=0,c=0,l=1,f=0,d=1):(u=0,h=0,c=1,l=1,f=0,d=1):_B?L++:F++,C>R?L++:j++,C>T?L++:D++,B>R?F++:j++,B>T?F++:D++,R>T?j++:D++;var z=C-(l=L>=3?1:0)+u,q=B-(f=F>=3?1:0)+u,N=R-(d=j>=3?1:0)+u,U=T-(p=D>=3?1:0)+u,Y=C-(m=L>=2?1:0)+2*u,V=B-(g=F>=2?1:0)+2*u,Z=R-(v=j>=2?1:0)+2*u,G=T-(y=D>=2?1:0)+2*u,$=C-(b=L>=1?1:0)+3*u,X=B-(w=F>=1?1:0)+3*u,H=R-(M=j>=1?1:0)+3*u,W=T-(x=D>=1?1:0)+3*u,J=C-1+4*u,Q=B-1+4*u,K=R-1+4*u,tt=T-1+4*u,et=255&A,rt=255&O,nt=255&E,it=255&k,st=.6-C*C-B*B-R*R-T*T;if(st<0)i=0;else{var ot=_[et+_[rt+_[nt+_[it]]]]%32*4;i=(st*=st)*st*(S[ot]*C+S[ot+1]*B+S[ot+2]*R+S[ot+3]*T)}var at=.6-z*z-q*q-N*N-U*U;if(at<0)s=0;else{var ut=_[et+l+_[rt+f+_[nt+d+_[it+p]]]]%32*4;s=(at*=at)*at*(S[ut]*z+S[ut+1]*q+S[ut+2]*N+S[ut+3]*U)}var ht=.6-Y*Y-V*V-Z*Z-G*G;if(ht<0)o=0;else{var ct=_[et+m+_[rt+g+_[nt+v+_[it+y]]]]%32*4;o=(ht*=ht)*ht*(S[ct]*Y+S[ct+1]*V+S[ct+2]*Z+S[ct+3]*G)}var lt=.6-$*$-X*X-H*H-W*W;if(lt<0)h=0;else{var ft=_[et+b+_[rt+w+_[nt+M+_[it+x]]]]%32*4;h=(lt*=lt)*lt*(S[ft]*$+S[ft+1]*X+S[ft+2]*H+S[ft+3]*W)}var dt=.6-J*J-Q*Q-K*K-tt*tt;if(dt<0)c=0;else{var pt=_[et+1+_[rt+1+_[nt+1+_[it+1]]]]%32*4;c=(dt*=dt)*dt*(S[pt]*J+S[pt+1]*Q+S[pt+2]*K+S[pt+3]*tt)}return 27*(i+s+o+h+c)}},h._buildPermutationTable=c,void 0===(n=function(){return h}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=h,t.exports=h}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(915)})()},2513:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Group=void 0;const n=r(1378),i=r(541),s=r(2648),o=r(5511);class a extends i.SceneChild{constructor(t={}){t.type="Group",super(t),this.children=[],["id","name","data","order","type"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=o.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){"object"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=a},1378:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Scene=void 0;const n=r(541),i=r(2513),s=r(6448),o=r(313);class a{constructor(t={}){this.width=400,this.height=400,this.background="hsla(0, 0%, 0%, 1)",this.color="hsla(0, 0%, 100%, 1)",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?(.5+.5*o.clamp(-1,1,t.anchor[0]))*this.width:"left"===t.anchor[0]?0:"right"===t.anchor[0]?this.width:this.center[0],"number"==typeof t.anchor[1]?(.5+.5*o.clamp(-1,1,t.anchor[1]))*this.height:"top"===t.anchor[1]?0:"bottom"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e="number"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,a.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{a.propagateToChilden(t,e)})):t instanceof s.Shape&&t.shape&&(t.shape.scene=e,a.propagateToChilden(t.shape,e))}}e.Scene=a},541:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||"SceneChild",this.name=t.name||this.type+"_"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){"string"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},313:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(21),i=r(2769),s=r(795),o="undefined"!=typeof performance?performance:Date;function a(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return o.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=a,e.relativeClamp=function(t,e,r,n,i){return a(n,i,(r-t)/(e-t)*(i-n)+n)};const u={random:new n(Math.random)};e.noise=function(t="random",e=0,r=0,i=0){return void 0===u[t]&&(u[t]=new n(t)),u[t].noise3D(e,r,i)};const h={};function c(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),s=rn?[s,o]:[o,s]}function l(t,e){const r=t.length,n=r/2,i=2*(n+e),s=n-1;if(s>1){const n=r-2,o=Math.floor(e/s);let a=(i-(r+o*n))/2;const u=Math.round(s/a),h=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%u==0||e===n-2),p=o+(d?1:0),m=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);h[i]=(s=t(),o=t(),a=t(),u=t(),function(){let t=(s>>>=0)+(o>>>=0)|0;return s=o^o>>>9,o=(a>>>=0)+(a<<3)|0,t=t+(u=1+(u>>>=0)|0)|0,a=(a=a<<21|a>>>11)+t|0,(t>>>0)/4294967296})}var s,o,a,u;const c=e+h[i]()*(r-e);return void 0!==n?Math.round(c*10**n)/10**n:c},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return s.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=c,e.interpolate=function(t,e,r=.5){const[n,i]=c(t,e),s=Math.max(n.length,i.length),o="number"==typeof r?[r]:r,a=s/2;if(o.length!==a){const t=o.length;for(let e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return"number"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},8721:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(887);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},3792:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},5511:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(9958);var i;!function(t){t[t.None=0]="None",t[t.Scale=2]="Scale",t[t.Center=4]="Center",t[t.Fill=8]="Fill"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn("[Urplfanze:Bounding] cannot sum bounding")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn("[Urplfanze:Bounding] cannot bind bounding")}};class s extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return s.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=s.getBounding(t));const o=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,a=e>=i.Center?r.cx:0,u=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Close=void 0;const n=r(9958);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},1740:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Mirror=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let s=0;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},3315:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Offset=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i},4660:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Smooth=void 0;const n=r(313),i=r(8301),s=r(9958);class o extends s.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Solidify=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const s=[],o=(e="number"==typeof e?[e]:e).length;let a,u,h=[[0,0],[0,0]],c=[[0,0],[0,0]];for(let r=0,l=0,f=t.length-2;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Subdivide=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Modifiers=void 0;const n=r(5511),i=r(1740),s=r(4660),o=r(5838),a=r(5588),u=r(8301),h=r(3315),c={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:s.Smooth,Solidify:o.Solidify,Subdivide:a.Subdivide,Close:u.Close,Offset:h.Offset};e.Modifiers=c},6448:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=void 0;const n=r(1378),i=r(541),s=r(2648);class o extends s.ShapeBase{constructor(t){t.type=t.type||"Shape",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn("[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\nYou passed:",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):o.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBase=void 0;const n=r(887),i=r(3757),s=r(8721),o=r(795),a=r(3792),u=r(5511),h=r(313),c=r(541),l=n.mat4.create(),f=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class m extends c.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?-1*h.clamp(-1,1,t.anchor[0]):"left"===t.anchor[0]?1:"right"===t.anchor[0]?-1:0,"number"==typeof t.anchor[1]?-1*h.clamp(-1,1,t.anchor[1]):"top"===t.anchor[1]?1:"bottom"===t.anchor[1]?-1:0]:[0,0],this.boundingType="string"==typeof t.boundingType?"relative"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return"function"!=typeof t.repetitions&&"function"!=typeof t.distance&&"function"!=typeof t.displace&&"function"!=typeof t.scale&&"function"!=typeof t.translate&&"function"!=typeof t.skewX&&"function"!=typeof t.skewY&&"function"!=typeof t.squeezeX&&"function"!=typeof t.squeezeY&&"function"!=typeof t.rotateX&&"function"!=typeof t.rotateY&&"function"!=typeof t.rotateZ&&"function"!=typeof t.transformOrigin&&"function"!=typeof t.perspective&&"function"!=typeof t.perspectiveOrigin}isStaticIndexed(){return"function"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return"function"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){"string"==typeof t?(r=r||"repetitions"==t,this.props[t]=e):(r=r||"repetitions"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var c,g;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const v=m.getEmptyPropArguments(this,r),y=v.repetition,b=this.getProp("repetitions",v,1),w=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,M=Array.isArray(b)?b[0]*(null!==(c=b[1])&&void 0!==c?c:b[0]):b,x=Array.isArray(b)?b[0]:M,_=Array.isArray(b)?null!==(g=b[1])&&void 0!==g?g:b[0]:1,S=y.row;S.count=x;const P=y.col;P.count=_,y.count=M,y.col.count=_,y.row.count=x,y.type=w;let A=0;const O=[];let E=0;const k=n.vec2.fromValues((_-1)/2,(x-1)/2),I=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],C=[void 0,void 0,void 0,void 0],B=[void 0,void 0,void 0,void 0];for(let r=0;r1?E/(M-1):1,y.angle=w===i.ERepetitionType.Ring?a.PI2/M*E:0,P.index=c+1,P.offset=_>1?c/(_-1):1,S.index=r+1,S.offset=x>1?r/(x-1):1;const m=this.generateBuffer(t,v),g=m.length,b=this.getShapeBounding();O[E]=new Float32Array(g),A+=g;{const t=s.toVec2(this.getProp("distance",v,s.VEC2_ZERO)),a=this.getProp("displace",v,0),M=s.toVec3(this.getProp("scale",v,s.VEC2_ONE),1),x=s.toVec3(this.getProp("translate",v,s.VEC2_ZERO),0),_=this.getProp("skewX",v,0),S=this.getProp("skewY",v,0),P=this.getProp("squeezeX",v,0),A=this.getProp("squeezeY",v,0),R=this.getProp("rotateX",v,0),T=this.getProp("rotateY",v,0),L=this.getProp("rotateZ",v,0),F=h.clamp(0,1,this.getProp("perspective",v,0)),j=s.toVec3(this.getProp("perspectiveOrigin",v,s.VEC2_ZERO),0),D=s.toVec3(this.getProp("transformOrigin",v,s.VEC2_ZERO),0);let z;switch(w){case i.ERepetitionType.Ring:z=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(z,z,s.VEC3_ZERO,y.angle+a);break;case i.ERepetitionType.Matrix:z=n.vec3.fromValues(t[1]*(c-k[0]),t[0]*(r-k[1]),0)}const q=F>0?Math.max(b.width,b.height)/2:1,N=F>0?q+10*q*(1-F):0,U=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==F||0!==D[0]||0!==D[1],Y=0!==j[0]||0!==j[1];U&&(this.boundingType===i.EBoundingType.Relative?(D[0]=D[0]*(b.width/2)+b.cx,D[1]=D[1]*(b.height/2)+b.cy):(D[0]*=b.width/2,D[1]*=b.height/2),D[2]=N);{n.mat4.identity(f),U&&n.mat4.translate(f,f,D),0===x[0]&&0===x[1]||n.mat4.translate(f,f,x),0===_&&0===S||(s.fromSkew(l,[_,S]),n.mat4.multiply(f,f,l)),0!==R&&n.mat4.rotateX(f,f,R),0!==T&&n.mat4.rotateY(f,f,T),0!==L&&n.mat4.rotateZ(f,f,L),1===M[0]&&1===M[1]||n.mat4.scale(f,f,M),U&&n.mat4.translate(f,f,n.vec3.scale(D,D,-1)),N>0&&(Y&&(this.boundingType===i.EBoundingType.Relative?(j[0]=j[0]*(b.width/2)+b.cx,j[1]=j[1]*(b.height/2)+b.cy):(j[0]*=b.width/2,j[1]*=b.height/2),j[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,z),e&&n.mat4.translate(p,p,I);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),w===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,y.angle+a)}u.Bounding.clear(B);for(let t=0;t0&&(Y&&n.vec3.add(e,e,j),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,N),Y&&n.vec3.sub(e,e,j)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=g/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,v)}O[E][t]=e[0],O[E][t+1]=e[1],u.Bounding.add(B,e[0],e[1]),u.Bounding.add(C,e[0],e[1])}}const R={cx:0,cy:0,x:-1,y:-1,width:2,height:2};u.Bounding.bind(R,B),this.bStaticIndexed&&this.bIndexed||this.addIndex(g,y,R)}u.Bounding.bind(this.bounding,C),this.buffer=new Float32Array(A);for(let t=0,e=0,r=O.length;t({index:1,offset:1,count:1}),m.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...m.getEmptySimpleRepetition(),row:m.getEmptySimpleRepetition(),col:m.getEmptySimpleRepetition()})},7439:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBuffer=void 0;const n=r(5511),i=r(3674);class s extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||"ShapeBuffer",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn("[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property"),this.shape=s.EMPTY_BUFFER):this.shape="function"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return"function"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from("function"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,s=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&"function"!=typeof this.props.sideLength&&"function"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=s},5382:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeFollow=void 0;const n=r(6448);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeFollow",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},s=this.shape;s.generate(t,!1,i);let o=s.getBuffer();const a=o.length,u=new Float32Array(a*(n.length/2)),h=n.length/2;for(let e=0;e1?e/(h-1):1,count:h};this.shapeUseFollow&&(i.follow=r,s.generate(t,!1,i),o=s.getBuffer());const c=e*a,l=2*e,f=n[l],d=n[l+1];for(let t=0,e=o.length;t1?t/(e-1):1;for(let o=0,a=s.length;o{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeLoop=void 0;const n=r(3792),i=r(5511),s=r(3674),o=r(2648);class a extends s.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||"ShapeLoop",super(t),this.loopDependencies=(t.loopDependencies||[]).concat("sideLength"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes("propArguments"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}"loop"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||o.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?("function"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),s=this.getRepetitionSideLength(t),o=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,a={index:0,offset:0,current:0,count:n},u=a.count,h=new Float32Array(2*u);for(let n=0,i=0;n1?n/(a.count-1):1;a.current=s,a.index=n+1,a.offset=u;const c=o(a,t);h[i]=c[0],h[i+1]=c[1]}const c=[void 0,void 0,void 0,void 0],l=this.applyModifiers(h,t);for(let t=0,e=l.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapePrimitive=void 0;const n=r(8721),i=r(2648),s=r(9958),o=r(5511);class a extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=o.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:"function"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return"function"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:"number"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp("sideLength",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeRecursive=void 0;const n=r(6448);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeRecursive",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionScale&&"function"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp("recursions",e,1)),n=Math.floor(this.getProp("recursionVertex",e,0)),s=this.getProp("recursionScale",e,2),o=this.shape;let a={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const u={...e,recursion:a};o.generate(t,!1,u);const h=o.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=h);let c=h;const l=[a];let f=0,d=1;const p=c.length,m=p/2,g=n<=0?m:Math.min(n,m),v=0===n?1:m/Math.min(n,m),y=new Float32Array(i.summmation(r,g)*p);for(let t=0;t1?e/(r-1):1,h=i.summmation(e,g)*p,m=e-1,b=0===m?0:i.summmation(m,g)*p;for(let i=0,m=g**e;i1?i/(m-1):1,count:m,level:{index:e+1,offset:n,count:r},parent:l[f]},l.push(a),this.shapeUseRecursion&&(u.recursion=a,o.generate(t,!1,u),c=o.getBuffer());const w=h+i*p,M=Math.floor(b+2*i*v),x=y[M],_=y[M+1],S=s**e;for(let t=0,e=p;t1?0:1,count:s}}},u=this.shape.getIndexedBuffer()||[];for(let t=0,e=u.length;t1?0:1,count:s}},i={...a,recursion:r},o=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:o})}if(s>1){const t=this.shape.getBufferLength({...i,parent:{...a}})/2,e=o<=0?t:Math.min(o,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let h=0,c=1;for(let t=1;t1?t/(s-1):1;for(let o=0,l=e**t;o1?o/(l-1):1;for(let d=0,p=u.length;d{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Circle=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){t.type="Circle",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=s},6329:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Line=void 0;const n=r(5511),i=r(7439);class s extends i.ShapeBuffer{constructor(t={}){t.type="Line",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lissajous=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){t.type="Lissajous",t.loopDependencies=(t.loopDependencies||[]).concat(["wx","wy","wz"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp("wx",t),r=this.getProp("wy",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),s=this.getRepetitionSideLength(t);return 1/Math.pow(s[0]*s[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp("wx",t,1),this.wy=this.getProp("wy",t,2),this.wz=this.getProp("wz",t,2),super.generateLoopBuffer(t)}}e.Lissajous=s},2982:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Polygon=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["sideNumber"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp("sideNumber",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=s},5510:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Rect=void 0;const n=r(5511),i=r(7439);class s extends i.ShapeBuffer{constructor(t={}){t.type="Rect",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=s,s.buffer=[1,1,-1,1,-1,-1,1,-1]},894:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Rose=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){var e,r;t.type="Rose",t.loopDependencies=(t.loopDependencies||[]).concat(["n","d"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>s.getFinalAngleFromK(this.getProp("n",t),this.getProp("d",t)),inc:t=>{const e=this.getProp("n",t),r=this.getProp("d",t),i=this.getRepetitionSideLength(t),s=Math.pow(i[0]*i[1],.45),o=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp("n",t)/this.getProp("d",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=s},5719:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Spiral=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type="Spiral",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat(["twists","twistsStart","spiral"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:s.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp("twistsStart",t),end:t=>n.PI2*(this.getProp("twistsStart",t)+this.getProp("twists",t)),inc:t=>{const e=this.getProp("twists",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp("spiral",t),this.r=s.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case s.types.ARCHIMEDE:return t=>t/10;case s.types.HYPERBOLIC:return t=>1/t*3;case s.types.FERMAT:return t=>t**.5/3;case s.types.LITUUS:return t=>t**-.5;case s.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=s,s.types={ARCHIMEDE:"ARCHIMEDE",HYPERBOLIC:"HYPERBOLIC",FERMAT:"FERMAT",LITUUS:"LITUUS",LOGARITHMIC:"LOGARITHMIC"}},9667:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Star=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["spikes","innerRadius"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp("spikes",t,5),this.innerRadius=this.getProp("innerRadius",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=s},3977:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SuperShape=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){var e,r,i,s,o,a;t.type="SuperShape",t.loopDependencies=(t.loopDependencies||[]).concat(["a","b","m","n1","n2","n3"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(s=t.n1)&&void 0!==s?s:1,this.props.n2=null!==(o=t.n2)&&void 0!==o?o:1,this.props.n3=null!==(a=t.n3)&&void 0!==a?a:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp("a",t),this.b=this.getProp("b",t),this.m=this.getProp("m",t),this.n1=this.getProp("n1",t),this.n2=this.getProp("n2",t),this.n3=this.getProp("n3",t),super.generateLoopBuffer(t)}}e.SuperShape=s},4233:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Triangle=void 0;const n=r(5511),i=r(7439);class s extends i.ShapeBuffer{constructor(t={}){t.type="Triangle",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=s,s.buffer=[1,0,-1,1,-1,-1]},3757:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(7678),e),i(r(7066),e),i(r(2769),e),i(r(7266),e),i(r(3647),e),i(r(4526),e),i(r(1618),e),i(r(6787),e)},7678:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},7066:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},2769:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]="Ring",r[r.Matrix=2]="Matrix"},7266:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3647:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4526:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]="Relative",r[r.Fixed=2]="Fixed"},1618:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6787:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},9962:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DrawerCanvas=void 0;const n=r(7358),i=r(313),s=r(3792),o=r(795),a=r(292),u=r(1189),h=r(8909),c=r(9724);class l extends u.Emitter{constructor(t,e,r,n=6e4,i=60){var s,o,a,u,l;super(),this.drawerOptions={width:(null==r?void 0:r.width)||(null==t?void 0:t.width)||400,height:(null==r?void 0:r.height)||(null==t?void 0:t.height)||400,clear:null===(s=null==r?void 0:r.clear)||void 0===s||s,time:null!==(o=null==r?void 0:r.time)&&void 0!==o?o:0,simmetricLines:null!==(a=null==r?void 0:r.simmetricLines)&&void 0!==a?a:0,noBackground:null!==(u=null==r?void 0:r.noBackground)&&void 0!==u&&u,ghosts:(null==r?void 0:r.ghosts)||0,ghostAlpha:!1!==(null==r?void 0:r.ghostAlpha),ghostSkipTime:null!==(l=null==r?void 0:r.ghostSkipTime)&&void 0!==l?l:30,ghostSkipFunction:null==r?void 0:r.ghostSkipFunction,sceneFit:(null==r?void 0:r.sceneFit)||"contain",backgroundImage:null==r?void 0:r.backgroundImage,backgroundImageFit:(null==r?void 0:r.backgroundImageFit)||"cover"},this.timeline=new h.Timeline(n,i),this.timeline.setTime(this.drawerOptions.time),this.draw_id=null,this.redraw_id=null,this.animation_id=null,t&&this.setScene(t),(!c.bWorker||c.bWorker&&e instanceof OffscreenCanvas)&&this.setCanvas(e)}getOption(t,e){var r;return null!==(r=this.drawerOptions[t])&&void 0!==r?r:e}setCanvas(t){if(c.bWorker)t instanceof OffscreenCanvas?this.canvas=t:console.error("Cannot set cavas");else if(c.bBrowser){const e=a.createCanvas(this.drawerOptions.width,this.drawerOptions.height);if(t instanceof HTMLElement&&!(t instanceof HTMLCanvasElement||t instanceof OffscreenCanvas)){for(this.canvas=e;t.lastChild;)t.removeChild(t.lastChild);t.appendChild(e)}else this.canvas=void 0===t?e:t}else this.canvas=a.createCanvas(this.drawerOptions.width,this.drawerOptions.height);this.canvas&&(this.canvas.width=this.drawerOptions.width,this.canvas.height=this.drawerOptions.height,this.context=this.canvas.getContext("2d",{alpha:!0}))}getCanvas(){return this.canvas}setScene(t){this.scene=t}draw(){if(null===this.context||void 0===this.scene)return 0;const t=i.now(),e=this.timeline,r=e.getTime(),n={...this.drawerOptions,ghostIndex:void 0,clear:this.drawerOptions.clear||e.getCurrentFrame()<=1,time:r},o=e.getFrameAtTime(r);if(this.dispatch("drawer-canvas:before_draw",{currentFrame:o,currentTime:r}),n.simmetricLines>0&&(n.clear&&l.clear(this.context,n.width,n.height,!n.noBackground&&this.scene.background,n.backgroundImage,n.backgroundImageFit),l.drawSimmetricLines(this.context,n.simmetricLines,n.width,n.height,this.scene.color),n.clear=!1),n.ghosts){const t={...n},r=e.getTime(),i=e.getDuration(),o={offset:0,index:0,count:n.ghosts};for(let e=1;e<=n.ghosts;e++){o.index=e,o.offset=o.index/o.count;const a=r-(n.ghostSkipFunction?n.ghostSkipFunction(o,r):e*n.ghostSkipTime);t.ghostIndex=e,t.time=s.mod(a,i),t.clear=n.clear&&1===t.ghostIndex,this.realDraw(t)}n.clear=!1}return this.realDraw(n),i.now()-t}realDraw(t){var e;const r=this.drawerOptions.width,n=this.drawerOptions.height,i=this.context,s=this.scene,o=null!==(e=t.time)&&void 0!==e?e:0,a=void 0!==t.ghosts&&t.ghosts>0&&void 0!==t.ghostIndex&&t.ghostIndex>0,u=a?1-t.ghostIndex/(t.ghosts+.5):0,h=!0===t.ghostAlpha,f=c.fit(s.width,s.height,r,n,this.drawerOptions.sceneFit),d=f.x,p=f.y;t.clear&&l.clear(i,r,n,!t.noBackground&&s.background,t.backgroundImage,t.backgroundImageFit);let m=!1,g=!1;s.currentTime=o;const v=s.getChildren();for(let t=0,e=v.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=void 0,e.Emitter=class{constructor(){this.callbacks={}}attach(t,e){t in this.callbacks||(this.callbacks[t]=[]),this.callbacks[t].push(e)}detach(t,e){if(t in this.callbacks){const r=this.callbacks[t].indexOf(e);r>=0&&this.callbacks[t].splice(r,1)}}dispatch(t,e){if(t in this.callbacks&&this.callbacks[t].length>0)for(let r=0,n=this.callbacks[t].length;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Renderer=void 0;const n=r(5045),i=r(313),s=r(5733),o=r(6151),a=r(1189),u=r(9724);class h extends a.Emitter{constructor(t,e){super(),this.drawer=t,this.ffmpegCorePath=void 0===e&&t instanceof o.default?"https://unpkg.com/@ffmpeg/core@0.10.0/dist/ffmpeg-core.js":e}async zip(t="image/png",e=1,r=600){const n=i.now(),o=new s,a=this.drawer.timeline.getFramesCount(),h=Math.ceil(a/r);this.dispatch("renderer:zip_start",{chunks:h,totalFrames:a,framesForChunk:r});const c="image/jpeg"===t?".jpg":".png",l=[];let f=0;for(let s=0,d=1;s{r.toBlob((t=>{if(!t)throw new Error("Blob error");n(t)}),t,"number"==typeof e?e:1)}))}}e.Renderer=h},8909:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=void 0;const n=r(313),i=r(3792),s=r(1189);class o extends s.Emitter{constructor(t=6e4,e=30){super(),this.fps_samples_size=30,this.fps_samples=[],this.fps_samples_index=0,this.paused_time=0,this.sequence={duration:t,framerate:e,frames:Math.round(t/1e3*e)},this.tick_time=1e3/this.sequence.framerate,this.fps=this.sequence.framerate,this.b_sequence_started=!1,this.currentFrame=0,this.currentTime=0,this.last_tick=0,this.start_time=0}getSequence(){return{...this.sequence}}setSequence(t,e,r){this.sequence.duration=t,this.sequence.framerate=e,this.tick_time=1e3/this.sequence.framerate,this.sequence.frames=Math.round(this.sequence.duration/1e3*this.sequence.framerate),void 0!==r?this.setTime(r):this.dispatch("timeline:update_sequence",this.getSequence())}setDuration(t){this.setSequence(t,this.sequence.framerate)}getDuration(){return this.sequence.duration}getFramerate(){return this.sequence.framerate}setFramerate(t){this.setSequence(this.sequence.duration,t)}getFramesCount(){return this.sequence.frames}bSequenceStarted(){return this.b_sequence_started}start(){this.b_sequence_started||(this.b_sequence_started=!0,this.start_time=this.paused_time,this.dispatch("timeline:change_status",o.START))}pause(){this.b_sequence_started&&(this.paused_time=n.now(),this.b_sequence_started=!1,this.dispatch("timeline:change_status",o.PAUSE))}stop(){this.b_sequence_started&&(this.b_sequence_started=!1,this.currentTime=0,this.currentFrame=0,this.start_time=0,this.paused_time=0,this.dispatch("timeline:change_status",o.STOP))}tick(t){if(this.b_sequence_started){this.start_time||(this.start_time=t,this.last_tick=-this.tick_time);const e=t-this.start_time,r=e-this.last_tick;if(r>=this.tick_time)return this.calculateFPS(1/(r/1e3)),this.last_tick=e,this.currentTime=(e-r%this.tick_time)%this.sequence.duration,this.currentFrame=this.getFrameAtTime(this.currentTime),this.dispatch("timeline:progress",{currentFrame:this.currentFrame,currentTime:this.currentTime,fps:this.fps}),!0}return!1}calculateFPS(t){const e=this.fps_samples.length;if(e>0){let t=0;for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BrowserDrawerCanvas=void 0;const n=r(9962),i=r(9724);class s extends n.DrawerCanvas{constructor(t,e,r,n=6e4,i=60){super(t,e,r,n,i),this.dpi=1,this.dpi=(null==r?void 0:r.dpi)||1,this.draw_id=null,this.redraw_id=null,this.animation_id=null,this.draw=this.draw.bind(this),this.animate=this.animate.bind(this),this.startAnimation=this.startAnimation.bind(this),this.resize(this.drawerOptions.width,this.drawerOptions.height)}resize(t,e,r,n=this.dpi){this.drawerOptions.width=t*n,this.drawerOptions.height=e*n,this.canvas&&(this.canvas.width=t*n,this.canvas.height=e*n,i.bBrowser&&this.canvas instanceof HTMLCanvasElement&&(this.canvas.style.width=t+"px",this.canvas.style.height=e+"px")),void 0!==r&&(this.drawerOptions.sceneFit=r),this.dispatch("drawer-canvas:resize")}animate(t){this.timeline.bSequenceStarted()&&(this.animation_id=requestAnimationFrame(this.animate),this.timeline.tick(t)&&this.draw())}startAnimation(){this.stopAnimation(),this.timeline.start(),this.animation_id=requestAnimationFrame(this.animate)}stopAnimation(){this.timeline.stop(),this.animation_id&&cancelAnimationFrame(this.animation_id)}pauseAnimation(){this.timeline.pause(),this.animation_id&&cancelAnimationFrame(this.animation_id)}playAnimation(){this.timeline.start(),requestAnimationFrame(this.animate)}redraw(){this.timeline.bSequenceStarted()?void 0!==typeof this.drawerOptions.ghosts&&0!==this.drawerOptions.ghosts||(this.stopAnimation(),this.redraw_id&&cancelAnimationFrame(this.redraw_id),this.redraw_id=requestAnimationFrame(this.startAnimation)):(this.draw_id&&cancelAnimationFrame(this.draw_id),void 0!==typeof this.drawerOptions.ghosts&&0!==this.drawerOptions.ghosts||this.timeline.stop(),this.draw_id=requestAnimationFrame(this.draw))}}e.BrowserDrawerCanvas=s},6151:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(8909),e),i(r(9962),e),i(r(4425),e),i(r(2251),e);const s=r(2251);e.default=s.BrowserDrawerCanvas},1532:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(8909),e),i(r(9962),e),i(r(2251),e),i(r(4425),e)},9724:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fit=e.bWorker=e.bBrowser=e.bNode=void 0,e.bNode="undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node,e.bBrowser="undefined"!=typeof window&&void 0!==window.document,e.bWorker="object"==typeof self&&["ServiceWorkerGlobalScope","DedicatedWorkerGlobalScope"].includes(self.constructor.name),e.fit=function(t,e,r,n,i="none"){let s=0,o=0,a=1,u=t,h=e;const c=r/n,l=t/e;return"contain"===i?(u=c>l?t*n/e:r,h=c>l?n:e*r/t,a=Math.max(u,h)/Math.max(t,e)):"cover"===i&&(u=c{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GCODEExporter=void 0;const n=r(1172),i=r(6479),s=r(310);class o{static parse(t,e){const r={...o.defaults,...e};return o.generate(t,r).join("\n")}static setUnit(t){return"inches"===t?"G20":"G21"}static useRelativePosition(){return"G91"}static useAbsolutePosition(){return"G90"}static goHome(t){return[t,"G28 X0 Y0"]}static setCurrentMachinePosition(t,e,r){return`G28.1 X${s.round(t,r)} Y${s.round(e,r)}`}static setCurrentWorkspacePosition(t,e,r){return`G92 X${s.round(t,r)} Y${s.round(e,r)}`}static goTo(t,e,r,n){return void 0!==n?`G1 X${s.round(t,r)} Y${s.round(e,r)} F${n}`:`G0 X${s.round(t,r)} Y${s.round(e,r)}`}static moveTo(t,e,r,n,i){return[t,this.goTo(r,n,i),e]}static lineTo(t,e,r,n){return this.goTo(t,e,n,r)}static generate(t,e){const r=e.maxX-e.minX,a=e.maxY-e.minY,u=r/a,h=t.width/t.height,c=[u>h?t.width*a/t.height:r,u>h?a:t.height*r/t.width],l=[(r-c[0])/2,(a-c[1])/2],f=u>h?t.width/c[0]:t.height/c[1],d=[];s.concat(d,e.penUpCommand),s.concat(d,this.setUnit(e.unit)),s.concat(d,this.useAbsolutePosition()),s.concat(d,this.setCurrentMachinePosition(e.minX,e.minY,e.decimals)),s.concat(d,this.setCurrentWorkspacePosition(e.minX,e.minY,e.decimals));const p=t.getChildren();for(let t=0,r=p.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},310:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.concat=e.round=void 0,e.round=(t,e)=>Math.round(t*10**e)/10**e,e.concat=(t,e)=>{"string"==typeof e?t.push(e):e.forEach((e=>t.push(e)))}},2674:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SVGExporter=void 0;const n=r(9887);class i{static parse(t,e={}){const r={...i.defaults,...e};return i.generate(t,r)}static getSVGProp(t,e,r){let n=e.shape.drawer[t];return"function"==typeof n&&(n=n(e)),null!=n?n:r}static bindColorAttribute(t,e,r,i){if(void 0!==e)if("none"===e)r.push(`${t}="none"`);else{const s=n.parseColorAndConvert(e);s&&(1!==s.alpha&&i.push(`${t}-opacity: ${s.alpha}`),r.push(`${t}="${n.rgbToHex(s.r,s.g,s.b)}"`))}}static generate(t,e){const r=i.generatePaths(t,e);let n;if(e.background){const e=[],r=[];i.bindColorAttribute("fill",t.background,e,r),r.length>0&&e.push(`styles="${r.join("; ")}"`),n=``}return`\n\t\x3c!-- Create with Urpflanze --\x3e`+(n?`\n\t${n}`:"")+`\n\t${r.join("\n\t")}\n`}static generatePaths(t,e){const r=[],n=t.getChildren();for(let s=0,o=n.length;s0&&l.push(`style="${f.join("; ")}"`);const g=``;r.push(g)}}return r}}e.SVGExporter=i,i.defaults={decimals:3,background:!0}},7773:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(4105),e),i(r(2674),e)},4105:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5917:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rgbToHsl=e.hslToRgb=e.rgbToHex=void 0,e.rgbToHex=function(t,e,r){return`#${((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}`},e.hslToRgb=function(t,e,r){let n,i,s;if(t/=360,r/=100,0==(e/=100))n=i=s=r;else{const o=(t,e,r)=>(r+=r<0?1:r>1?-1:0)<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,a=r<.5?r*(1+e):r+e-r*e,u=2*r-a;n=o(u,a,t+1/3),i=o(u,a,t),s=o(u,a,t-1/3)}return[.5+255*n<<0,.5+255*i<<0,.5+255*s<<0]},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;const n=Math.max(t,e,r),i=Math.min(t,e,r),s=(n+i)/2;let o,a;if(n===i)o=a=0;else{const u=n-i;switch(a=s>.5?u/(2-n-i):u/(n+i),n){case t:o=(e-r)/u+(e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.parseColorAndConvert=void 0;const n=r(5917);function i(t){if("number"==typeof t)return t>16777215?{type:"rgb",a:t>>24&255,b:t>>16&255,c:t>>8&255,alpha:(255&t)/255}:{type:"rgb",a:t>>16&255,b:t>>8&255,c:255&t,alpha:1};t=t.replace(/\s/g,"");let e=/^#([0-9a-f]{3,8})$/i.exec(t);if(e){const t=e[1];return 3===t.length?{type:"rgb",a:parseInt(t[0]+t[0],16),b:parseInt(t[1]+t[1],16),c:parseInt(t[2]+t[2],16),alpha:1}:{type:"rgb",a:parseInt(t[0]+t[1],16),b:parseInt(t[2]+t[3],16),c:parseInt(t[4]+t[5],16),alpha:t.length>6?parseInt(t.substring(6),16)/255:1}}if(e=/^((hsl|rgb)a?)\((\d+),(\d+)%?,(\d+)%?,?(.+)?\)$/i.exec(t),e){const[,,t,r,n,i,s]=e;return{type:t,a:+r,b:+n,c:+i,alpha:s?+s:1}}}e.parseColorAndConvert=function(t){const e=i(t);if(e){if("hsl"===e.type){const[t,r,i]=n.hslToRgb(e.a,e.b,e.c);return{r:t,g:r,b:i,h:e.a,s:e.b,l:e.c,alpha:e.alpha}}{const[t,r,i]=n.rgbToHsl(e.a,e.b,e.c);return{h:t,s:r,l:i,r:e.a,g:e.b,b:e.c,alpha:e.alpha}}}},e.parseColor=i},6073:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5052:t=>{window,t.exports=(()=>{var t={877:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SVGImporter=void 0;const n=r(500),i=r(688),s=r(926),o=r(926),a=r(479),u=r(721),h=r(197),c=r(825);class l{static isSVG(t){return l.SVG_REGEX.test(t.replace(l.COMMENT_REGEX,""))}static getWindowInstance(){return l.windowInstance}static setWindowInstance(t){l.windowInstance=t}static stringToSVG(t){if(t=t.trim(),!l.isSVG(t))return console.warn("[Urpflanze:SVGImport] | Input is not valid SVG string",t),null;const e=l.windowInstance.document.createElement("div");return e.innerHTML=t,e.firstChild}static parse(t,e=.01,r){if(!1===l.isSVG(t))return console.warn("[Urpflanze:SVGImport] | Input is not valid svg",t),null;const n=l.svgToBuffers(t,e);return n?l.parsedToShape(n,r):null}static parsedToShape(t,e){const r=[];if(t.buffers.forEach(((t,n)=>{const i=new s.ShapeBuffer({shape:t.buffer,bClosed:t.bClosed,sideLength:e,drawer:t.drawer});i&&r.push(i)})),1===r.length)return r[0];const n=new s.Group;return r.forEach((t=>n.add(t))),new s.Shape({shape:n})}static svgToBuffers(t,e=.01){const r="string"==typeof t?l.stringToSVG(t):t;if(null===r)return console.error("[Urpflanze:SVGImport] | Cannot convert string to svg",t),null;const n=l.getViewbox(r);r.querySelectorAll("g").forEach(l.propagateGroupTransformAndStyleToChildren);const i=Array.from(r.querySelectorAll("rect, circle, ellipse, line, polyline, polygon, path")),o=[].concat(...i.map((t=>l.elementToPath(t)))),a=Math.max(n[2]-n[0],n[3]-n[1]).toExponential(1).match(/e(\+?[0-9]+)/),u=10/(1e3/Math.min(10**Math.max(a?+a[1]:0,0),1e3));let h=o.map((t=>l.pathToBuffer(t,u,n))).filter((t=>!!t&&t.length>=2));h=h.map((t=>l.simpliyBuffer(t,e))),h=h.map(((t,e)=>l.pathIsClosed(o[e])&&s.Vec2.distance([t[0],t[1]],[t[t.length-2],t[t.length-1]])<1?t.subarray(0,t.length-2):t));const f=Math.sqrt((n[2]-n[0])*(n[3]-n[1])),d=l.getStyleAttr("fill",r),p=l.getStyleAttr("stroke",r),m=l.getStyleAttr("stroke-width",r,f/100),g=[];for(let t=0;t=0?c.fromPercentage(parseFloat(e),f):parseFloat(e));const n=l.getStyleAttr("fill",o[t],d||void 0),i=l.getStyleAttr("stroke",o[t],n?void 0:p||"rgba(255,255,255)"),s=r||(i?m:void 0);g.push({buffer:h[t],bClosed:l.pathIsClosed(o[t]),drawer:{fill:n,stroke:i,lineWidth:s?s/(f/100):void 0}})}return i.forEach((t=>t.remove())),{viewBox:n,buffers:g}}static getStyleAttr(t,e,r){const n=e.getAttribute(t);if("none"===n)return;let s;if(null!=n)s=n;else{const r="stroke-width"===t?"strokeWidth":t;void 0!==e.style[r]&&e.style[r].length>0&&(s=e.style[r])}if(void 0===s)return r;if("stroke-width"===t)return parseFloat(s);let o=parseFloat(e.getAttribute("opacity")||"1");const a=e.getAttribute("style");if(a&&a.length){const e=new RegExp(`${t}-opacity: +?(\\d?.\\d|\\d)`,"i"),r=a.match(e);r&&(o=parseFloat(r[1]))}const u=i.parseColor(s);return u?(o=1!==u.alpha?u.alpha:o,"rgb"===u.type?`rgba(${u.a}, ${u.b}, ${u.c}, ${o})`:`hsla(${u.a}, ${u.b}%, ${u.c}%, ${o})`):r}static getViewbox(t){const e=t.getAttribute("viewBox");if(e)return e.split(" ").map((t=>parseFloat(t)));const r=t.getAttribute("width"),n=t.getAttribute("height");if(r&&n)return[0,0,parseFloat(r),parseFloat(n)];t=t.cloneNode(!0);const i=Array.from(t.querySelectorAll("rect, circle, ellipse, line, polyline, polygon, path")),s=[].concat.apply([],i.map(l.elementToPath));let a=0,u=0;for(let t=0,e=s.length;ta&&(a=t.width),t.height>u&&(u=t.height)}}return[0,0,a,u]}static pathIsClosed(t){var e;return"z"===(null===(e=t.getAttribute("d"))||void 0===e?void 0:e.trim().substr(-1).toLowerCase())}static simpliyBuffer(t,e=.01){const r=[];for(let e=0,n=t.length;e{i[2*e]=t.x,i[2*e+1]=t.y})),i}static sanitizePath(t,e){return u(t).abs().unarc().transform(e||"").toString()}static pathToBuffer(t,e=.01,r=[-1,-1,1,1]){const i=r[2]-r[0],s=r[3]-r[1],o=2/Math.max(i,s),a=t.getAttribute("d"),u=t.getAttribute("transform")||"",h=new n.Path({d:l.sanitizePath(a,u)}),c=Math.floor(h.length()),f=2*Math.floor(c/e),d=new Float32Array(f);let p=0;for(let t=0;t0){const r=h.compose(h.fromDefinition(h.fromTransformAttribute(e))),n=t.children;Array.from(n).forEach((t=>{let n=t.getAttribute("transform");if(n&&n.length>0){const t=h.compose(h.fromDefinition(h.fromTransformAttribute(n))),e=h.compose(r,t);n=h.toSVG(e)}else n=e;t.setAttribute("transform",n)}))}["fill","stroke","stroke-width","style"].forEach((e=>{const r=t.getAttribute(e);r&&Array.from(t.children).forEach((t=>{null===t.getAttribute(e)&&t.setAttribute(e,r)}))}))}static elementToPath(t){const e=l.windowInstance.document;let r=[];return"path"===t.nodeName?r=u(t.getAttribute("d")||"").abs().unarc().toString().split("M").filter((t=>t.length>0)).map((t=>"M"+t)):["rect","ellipse","circle","line","polyline","polygon"].includes(t.nodeName)?r=[c.conversion[t.nodeName](t)]:console.warn(`[Urpflanze:SVGImport] | Cannot convert ${t.nodeName} to path`),r.map((r=>{const n=e.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d",r),n.setAttribute("transform",t.getAttribute("transform")||""),n.setAttribute("style",t.getAttribute("style")||""),n.setAttribute("fill",l.getStyleAttr("fill",t,"")+""),n.setAttribute("stroke",l.getStyleAttr("stroke",t,"")+""),n.setAttribute("opacity",t.getAttribute("opacity")||"1"),n.setAttribute("stroke-width",l.getStyleAttr("stroke-width",t,"")+""),n}))}}e.SVGImporter=l,l.HEX_REGEX="#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})",l.SVG_REGEX=/^\s*(?:<\?xml[^>]*>\s*)?(?:]*\s*(?:\[?(?:\s*]*>\s*)*\]?)*[^>]*>\s*)?(?:]*>[^]*<\/svg>|]*\/\s*>)\s*$/i,l.COMMENT_REGEX=//g},625:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.SVGImporter=void 0;const s=r(877);Object.defineProperty(e,"SVGImporter",{enumerable:!0,get:function(){return s.SVGImporter}}),i(r(291),e),s.SVGImporter.setWindowInstance(window),e.default=s.SVGImporter},291:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},825:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.conversion=e.fromPercentage=void 0,e.fromPercentage=(t,e)=>/%$/.test(t+"")?100*parseFloat((t+"").replace("%",""))/e:+t;const r={rect:t=>{const r=parseFloat(t.getAttribute("width")||"0"),n=parseFloat(t.getAttribute("height")||"0"),i=parseFloat(t.getAttribute("x")||"0"),s=parseFloat(t.getAttribute("y")||"0");let o=t.getAttribute("rx")||"auto",a=t.getAttribute("ry")||"auto";"auto"===o&&"auto"===a?o=a=0:"auto"!==o&&"auto"===a?o=a=e.fromPercentage(o,r):"auto"!==a&&"auto"===o?a=o=e.fromPercentage(a,n):(o=e.fromPercentage(o,r),a=e.fromPercentage(a,n)),o>r/2&&(o=r/2),a>n/2&&(a=n/2);const u=o>0&&a>0;return[`M${i+o} ${s}`,"H"+(i+r-o),...u?[`A${o} ${a} 0 0 1 ${i+r} ${s+a}`]:[],"V"+(s+n-a),...u?[`A${o} ${a} 0 0 1 ${i+r-o} ${s+n}`]:[],`H${i+o}`,...u?[`A${o} ${a} 0 0 1 ${i} ${s+n-a}`]:[],`V${s+a}`,...u?[`A${o} ${a} 0 0 1 ${i+o} ${s}`]:[],"Z"].join(" ")},ellipse:t=>{var e,r,n,i;const s=parseFloat(t.getAttribute("cx")||"0"),o=parseFloat(t.getAttribute("cy")||"0"),a=parseFloat(null!==(r=null!==(e=t.getAttribute("rx"))&&void 0!==e?e:t.getAttribute("r"))&&void 0!==r?r:"0"),u=parseFloat(null!==(i=null!==(n=t.getAttribute("ry"))&&void 0!==n?n:t.getAttribute("r"))&&void 0!==i?i:"0");return[`M${s+a} ${o}`,`A${a} ${u} 0 0 1 ${s} ${o+u}`,`A${a} ${u} 0 0 1 ${s-a} ${o}`,`A${a} ${u} 0 0 1 ${s+a} ${o}`,"Z"].join(" ")},circle:t=>r.ellipse(t),line:t=>`M${t.getAttribute("x1")||"0"} ${t.getAttribute("y1")||"0"} L${t.getAttribute("x2")||"0"} ${t.getAttribute("y2")||"0"}`,polyline:t=>((t,e=2)=>{const r=[];for(;t.length>0;)r.push(t.splice(0,e));return r})((t.getAttribute("points")||"").trim().replace(/ +/g," ").split(" ").reduce(((t,e)=>[...t,...e.includes(",")?e.split(","):[e]]),[]),2).map((([t,e],r)=>`${0===r?"M":"L"}${t} ${e}`)).join(" "),polygon:t=>r.polyline(t)+" Z",path:t=>t.getAttribute("d")+""};e.conversion=r},500:(t,e,r)=>{"use strict";r.r(e),r.d(e,{A:()=>hr,Animator:()=>Ye,Array:()=>Rt,Box:()=>mt,Circle:()=>ir,ClipPath:()=>sr,Color:()=>ht,Container:()=>zt,Controller:()=>pe,Defs:()=>qt,Dom:()=>Ft,Ease:()=>de,Element:()=>jt,Ellipse:()=>Jt,EventTarget:()=>Et,ForeignObject:()=>or,Fragment:()=>Qt,G:()=>ur,Gradient:()=>ne,Image:()=>se,Line:()=>ue,List:()=>vt,Marker:()=>he,Mask:()=>cr,Matrix:()=>ft,Morphable:()=>ke,NonMorphable:()=>Ie,Number:()=>Tt,ObjectBag:()=>Re,PID:()=>ve,Path:()=>je,PathArray:()=>Oe,Pattern:()=>ie,Point:()=>ct,PointArray:()=>oe,Polygon:()=>ze,Polyline:()=>qe,Queue:()=>Ue,Rect:()=>Ne,Runner:()=>$e,SVG:()=>mr,Shape:()=>Nt,Spring:()=>ge,Stop:()=>lr,Style:()=>fr,Svg:()=>Ke,Symbol:()=>tr,Text:()=>rr,TextPath:()=>dr,Timeline:()=>Ge,TransformBag:()=>Ce,Tspan:()=>nr,Use:()=>pr,adopt:()=>F,assignNewId:()=>Y,clearEvents:()=>St,create:()=>R,defaults:()=>Bt,dispatch:()=>Ot,easing:()=>le,eid:()=>U,extend:()=>V,find:()=>bt,getClass:()=>q,getEventTarget:()=>_t,getEvents:()=>xt,getWindow:()=>k,makeInstance:()=>T,makeMorphable:()=>Fe,mockAdopt:()=>D,namespaces:()=>x,nodeOrNew:()=>L,off:()=>At,on:()=>Pt,parser:()=>dt,regex:()=>st,register:()=>z,registerMorphableType:()=>Le,registerWindow:()=>S,restoreWindow:()=>O,root:()=>B,saveWindow:()=>A,utils:()=>g,windowEvents:()=>Mt,withWindow:()=>E,wrapWithAttrCheck:()=>Z});const n={},i=[];function s(t,e){if(Array.isArray(t))for(const r of t)s(r,e);else if("object"!=typeof t)a(Object.getOwnPropertyNames(e)),n[t]=Object.assign(n[t]||{},e);else for(const e in t)s(e,t[e])}function o(t){return n[t]||{}}function a(t){i.push(...t)}function u(t,e){let r;const n=t.length,i=[];for(r=0;r=0;e--)Y(t.children[e]);return t.id?(t.id=U(t.nodeName),t):t}function V(t,e){let r,n;for(n=(t=Array.isArray(t)?t:[t]).length-1;n>=0;n--)for(r in e)t[n].prototype[r]=e[r]}function Z(t){return function(...e){const r=e[e.length-1];return!r||r.constructor!==Object||r instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(r)}}s("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=T(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=T(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=T(t)).before(this),this},insertAfter:function(t){return(t=T(t)).after(this),this}});const G=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,$=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,X=/rgb\((\d+),(\d+),(\d+)\)/,H=/(#[a-z_][a-z0-9\-_]*)/i,W=/\)\s*,?\s*/,J=/\s/g,Q=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,K=/^rgb\(/,tt=/^(\s+)?$/,et=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,rt=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,nt=/[\s,]+/,it=/[MLHVCSQTAZ]/i;var st={__proto__:null,numberAndUnit:G,hex:$,rgb:X,reference:H,transforms:W,whitespace:J,isHex:Q,isRgb:K,isBlank:tt,isNumber:et,isImage:rt,delimiter:nt,isPathLetter:it};function ot(t){const e=Math.round(t),r=Math.max(0,Math.min(255,e)).toString(16);return 1===r.length?"0"+r:r}function at(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function ut(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}s("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(nt)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),s("Dom",{css:function(t,e){const r={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);r[e[0]]=e[1]})),r;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=l(e);r[t]=this.node.style[t]}return r}if("string"==typeof t)return this.node.style[l(t)];if("object"==typeof t)for(const e in t)this.node.style[l(e)]=null==t[e]||tt.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[l(t)]=null==e||tt.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),s("Dom",{data:function(t,e,r){if(null==t)return this.data(u(h(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const r of t)e[r]=this.data(r);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===r||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),s("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class ht{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof ht||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e,r){const{random:n,round:i,sin:s,PI:o}=Math;if("vibrant"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new ht(t,e,r,"lch")}if("sine"===t){const t=i(80*s(2*o*(e=null==e?n():e)/.5+.01)+150),r=i(50*s(2*o*e/.5+4.6)+200),a=i(100*s(2*o*e/.5+2.3)+150);return new ht(t,r,a)}if("pastel"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new ht(t,e,r,"lch")}if("dark"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new ht(t,e,r,"lch")}if("rgb"===t){const t=255*n(),e=255*n(),r=255*n();return new ht(t,e,r)}if("lab"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new ht(t,e,r,"lab")}if("grey"===t){const t=255*n();return new ht(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(Q.test(t)||K.test(t))}cmyk(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.min(1-n,1-i,1-s);return 1===o?new ht(0,0,0,1,"cmyk"):new ht((1-n-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.max(n,i,s),a=Math.min(n,i,s),u=(o+a)/2,h=o===a,c=o-a;return new ht(360*(h?0:o===n?((i-s)/c+(i.5?c/(2-o-a):c/(o+a)),100*u,"hsl")}init(t=0,e=0,r=0,n=0,i="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)i="string"==typeof n?n:i,n="string"==typeof n?0:n,Object.assign(this,{_a:t,_b:e,_c:r,_d:n,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const r=function(t,e){const r=at(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:at(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:at(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:at(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:at(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:at(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return r.space=e||r.space,r}(t,e);Object.assign(this,r)}else if("string"==typeof t)if(K.test(t)){const e=t.replace(J,""),[r,n,i]=X.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}else{if(!Q.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,r,n,i]=$.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:u}=this,h="rgb"===this.space?{r:s,g:o,b:a}:"xyz"===this.space?{x:s,y:o,z:a}:"hsl"===this.space?{h:s,s:o,l:a}:"lab"===this.space?{l:s,a:o,b:a}:"lch"===this.space?{l:s,c:o,h:a}:"cmyk"===this.space?{c:s,m:o,y:a,k:u}:{};Object.assign(this,h)}lab(){const{x:t,y:e,z:r}=this.xyz();return new ht(116*e-16,500*(t-e),200*(e-r),"lab")}lch(){const{l:t,a:e,b:r}=this.lab(),n=Math.sqrt(e**2+r**2);let i=180*Math.atan2(r,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new ht(t,n,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:n,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,r=Math.PI/180;i=t*Math.cos(r*e),s=t*Math.sin(r*e)}const o=(n+16)/116,a=i/500+o,u=o-s/200,h=16/116,c=.008856,l=7.787;t=.95047*(a**3>c?a**3:(a-h)/l),e=1*(o**3>c?o**3:(o-h)/l),r=1.08883*(u**3>c?u**3:(u-h)/l)}const n=3.2406*t+-1.5372*e+-.4986*r,i=-.9689*t+1.8758*e+.0415*r,s=.0557*t+-.204*e+1.057*r,o=Math.pow,a=.0031308,u=n>a?1.055*o(n,1/2.4)-.055:12.92*n,h=i>a?1.055*o(i,1/2.4)-.055:12.92*i,c=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new ht(255*u,255*h,255*c)}if("hsl"===this.space){let{h:t,s:e,l:r}=this;if(t/=360,e/=100,r/=100,0===e)return r*=255,new ht(r,r,r);const n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,s=255*ut(i,n,t+1/3),o=255*ut(i,n,t),a=255*ut(i,n,t-1/3);return new ht(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:r,k:n}=this,i=255*(1-Math.min(1,t*(1-n)+n)),s=255*(1-Math.min(1,e*(1-n)+n)),o=255*(1-Math.min(1,r*(1-n)+n));return new ht(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:r,_d:n,space:i}=this;return[t,e,r,n,i]}toHex(){const[t,e,r]=this._clamped().map(ot);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,u=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=(.4124*o+.3576*a+.1805*u)/.95047,c=(.2126*o+.7152*a+.0722*u)/1,l=(.0193*o+.1192*a+.9505*u)/1.08883,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,d=c>.008856?Math.pow(c,1/3):7.787*c+16/116,p=l>.008856?Math.pow(l,1/3):7.787*l+16/116;return new ht(f,d,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:r}=this.rgb(),{max:n,min:i,round:s}=Math;return[t,e,r].map((t=>n(0,i(s(t),255))))}}class ct{constructor(...t){this.init(...t)}clone(){return new ct(this)}init(t,e){const r=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==r.x?0:r.x,this.y=null==r.y?0:r.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){ft.isMatrixLike(t)||(t=new ft(t));const{x:e,y:r}=this;return this.x=t.a*e+t.c*r+t.e,this.y=t.b*e+t.d*r+t.f,this}}function lt(t,e,r){return Math.abs(e-t)<(r||1e-6)}class ft{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,r=t.flip&&(e||"x"===t.flip)?-1:1,n=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleX)?t.scaleX*r:r,a=t.scale&&t.scale.length?t.scale[1]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleY)?t.scaleY*n:n,u=t.shear||0,h=t.rotate||t.theta||0,c=new ct(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=c.x,f=c.y,d=new ct(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.y,g=new ct(t.translate||t.tx||t.translateX,t.ty||t.translateY),v=g.x,y=g.y,b=new ct(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:u,theta:h,rx:b.x,ry:b.y,tx:v,ty:y,ox:l,oy:f,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,r){const n=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,u=t.f+t.b*e.e+t.d*e.f;return r.a=n,r.b=i,r.c=s,r.d=o,r.e=a,r.f=u,r}around(t,e,r){return this.clone().aroundO(t,e,r)}aroundO(t,e,r){const n=t||0,i=e||0;return this.translateO(-n,-i).lmultiplyO(r).translateO(n,i)}clone(){return new ft(this)}decompose(t=0,e=0){const r=this.a,n=this.b,i=this.c,s=this.d,o=this.e,a=this.f,u=r*s-n*i,h=u>0?1:-1,c=h*Math.sqrt(r*r+n*n),l=Math.atan2(h*n,h*r),f=180/Math.PI*l,d=Math.cos(l),p=Math.sin(l),m=(r*i+n*s)/u,g=i*c/(m*r-n)||s*c/(m*n+r);return{scaleX:c,scaleY:g,shear:m,rotate:f,translateX:o-t+t*d*c+e*(m*d*c-p*g),translateY:a-e+t*p*c+e*(m*p*c+d*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new ft(t);return lt(this.a,e.a)&<(this.b,e.b)&<(this.c,e.c)&<(this.d,e.d)&<(this.e,e.e)&<(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=ft.fromArray([1,0,0,1,0,0]);return t=t instanceof jt?t.matrixify():"string"==typeof t?ft.fromArray(t.split(nt).map(parseFloat)):Array.isArray(t)?ft.fromArray(t):"object"==typeof t&&ft.isMatrixLike(t)?t:"object"==typeof t?(new ft).transform(t):6===arguments.length?ft.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,r=this.c,n=this.d,i=this.e,s=this.f,o=t*n-e*r;if(!o)throw new Error("Cannot invert "+this);const a=n/o,u=-e/o,h=-r/o,c=t/o,l=-(a*i+h*s),f=-(u*i+c*s);return this.a=a,this.b=u,this.c=h,this.d=c,this.e=l,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof ft?t:new ft(t);return ft.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof ft?t:new ft(t);return ft.matrixMultiply(this,e,this)}rotate(t,e,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=c(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:u,e:h,f:l}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-u*i,this.d=u*n+a*i,this.e=h*n-l*i+r*i-e*n+e,this.f=l*n+h*i-e*i-r*n+r,this}scale(t,e,r,n){return this.clone().scaleO(...arguments)}scaleO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t);const{a:i,b:s,c:o,d:a,e:u,f:h}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=u*t-r*t+r,this.f=h*e-n*e+n,this}shear(t,e,r){return this.clone().shearO(t,e,r)}shearO(t,e=0,r=0){const{a:n,b:i,c:s,d:o,e:a,f:u}=this;return this.a=n+i*t,this.c=s+o*t,this.e=a+u*t-r*t,this}skew(t,e,r,n){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=c(t),e=c(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:u,d:h,e:l,f}=this;return this.a=o+a*i,this.b=a+o*s,this.c=u+h*i,this.d=h+u*s,this.e=l+f*i-n*i,this.f=f+l*s-r*s,this}skewX(t,e,r){return this.skew(t,0,e,r)}skewY(t,e,r){return this.skew(0,t,e,r)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(ft.isMatrixLike(t))return new ft(t).multiplyO(this);const e=ft.formatTransforms(t),{x:r,y:n}=new ct(e.ox,e.oy).transform(this),i=(new ft).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-r,-n).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(r,n);if(isFinite(e.px)||isFinite(e.py)){const t=new ct(r,n).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function dt(){if(!dt.nodes){const t=T().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;dt.nodes={svg:t,path:e}}if(!dt.nodes.svg.node.parentNode){const t=_.document.body||_.document.documentElement;dt.nodes.svg.addTo(t)}return dt.nodes}function pt(t){return!(t.width||t.height||t.x||t.y)}z(ft,"Matrix");class mt{constructor(...t){this.init(...t)}addOffset(){return this.x+=_.window.pageXOffset,this.y+=_.window.pageYOffset,new mt(this)}init(t){return t="string"==typeof t?t.split(nt).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return pt(this)}merge(t){const e=Math.min(this.x,t.x),r=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-r;return new mt(e,r,n,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof ft||(t=new ft(t));let e=1/0,r=-1/0,n=1/0,i=-1/0;return[new ct(this.x,this.y),new ct(this.x2,this.y),new ct(this.x,this.y2),new ct(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),r=Math.max(r,s.x),n=Math.min(n,s.y),i=Math.max(i,s.y)})),new mt(e,n,r-e,i-n)}}function gt(t,e,r){let n;try{if(n=e(t.node),pt(n)&&(i=t.node)!==_.document&&!(_.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===_.document}).call(_.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){n=r(t)}var i;return n}s({viewbox:{viewbox(t,e,r,n){return null==t?new mt(this.attr("viewBox")):this.attr("viewBox",new mt(t,e,r,n))},zoom(t,e){let{width:r,height:n}=this.attr(["width","height"]);if((r||n)&&"string"!=typeof r&&"string"!=typeof n||(r=this.node.clientWidth,n=this.node.clientHeight),!r||!n)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=r/i.width,o=n/i.height,a=Math.min(s,o);if(null==t)return a;let u=a/t;u===1/0&&(u=Number.MAX_SAFE_INTEGER/100),e=e||new ct(r/2/s+i.x,n/2/o+i.y);const h=new mt(i).transform(new ft({scale:u,origin:e}));return this.viewbox(h)}}}),z(mt,"Box");class vt extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}V([vt],{each(t,...e){return"function"==typeof t?this.map(((e,r,n)=>t.call(e,e,r,n))):this.map((r=>r[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const yt=["toArray","constructor","each"];function bt(t,e){return new vt(u((e||_.document).querySelectorAll(t),(function(t){return F(t)})))}vt.extend=function(t){t=t.reduce(((t,e)=>(yt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),V([vt],t)};let wt=0;const Mt={};function xt(t){let e=t.getEventHolder();return e===_.window&&(e=Mt),e.events||(e.events={}),e.events}function _t(t){return t.getEventTarget()}function St(t){let e=t.getEventHolder();e===_.window&&(e=Mt),e.events&&(e.events={})}function Pt(t,e,r,n,i){const s=r.bind(n||t),o=T(t),a=xt(o),u=_t(o);e=Array.isArray(e)?e:e.split(nt),r._svgjsListenerId||(r._svgjsListenerId=++wt),e.forEach((function(t){const e=t.split(".")[0],n=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][r._svgjsListenerId]=s,u.addEventListener(e,s,i||!1)}))}function At(t,e,r,n){const i=T(t),s=xt(i),o=_t(i);("function"!=typeof r||(r=r._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(nt)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,h;if(r)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][r],n||!1),delete s[e][a||"*"][r]);else if(e&&a){if(s[e]&&s[e][a]){for(h in s[e][a])At(o,[e,a].join("."),h);delete s[e][a]}}else if(a)for(t in s)for(u in s[t])a===u&&At(o,[t,a].join("."));else if(e){if(s[e]){for(u in s[e])At(o,[e,u].join("."));delete s[e]}}else{for(t in s)At(o,t);St(i)}}))}function Ot(t,e,r,n){const i=_t(t);return e instanceof _.window.Event||(e=new _.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}class Et extends I{addEventListener(){}dispatch(t,e,r){return Ot(this,t,e,r)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const r=e[t.type];for(const e in r)for(const n in r[e])r[e][n](t);return!t.defaultPrevented}fire(t,e,r){return this.dispatch(t,e,r),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e){return At(this,t,e),this}on(t,e,r,n){return Pt(this,t,e,r,n),this}removeEventListener(){}}function kt(){}z(Et,"EventTarget");const It={duration:400,ease:">",delay:0},Ct={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};var Bt={__proto__:null,noop:kt,timeline:It,attrs:Ct};class Rt extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(nt).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class Tt{constructor(...t){this.init(...t)}convert(t){return new Tt(this.value,t)}divide(t){return t=new Tt(t),new Tt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(G))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof Tt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new Tt(t),new Tt(this-t,this.unit||t.unit)}plus(t){return t=new Tt(t),new Tt(this+t,this.unit||t.unit)}times(t){return t=new Tt(t),new Tt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const Lt=[];class Ft extends Et{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=T(t)).removeNamespace&&this.node instanceof _.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return T(t).put(this,e)}children(){return new vt(u(this.node.children,(function(t){return F(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0){return this.writeDataToDom(),new this.constructor(Y(this.node.cloneNode(t)))}each(t,e){const r=this.children();let n,i;for(n=0,i=r.length;n=0}html(t,e){return this.xml(t,e,y)}id(t){return void 0!==t||this.node.id||(this.node.id=U(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return F(this.node.lastChild)}matches(t){const e=this.node,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return r&&r.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=F(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=F(e.node.parentNode));return e}put(t,e){return t=T(t),this.add(t,e),t}putIn(t,e){return T(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=T(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const r=10**t,n=this.attr(e);for(const t in n)"number"==typeof n[t]&&(n[t]=Math.round(n[t]*r)/r);return this.attr(n),this}svg(t,e){return this.xml(t,e,v)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const r=e.index(this);return e.put(t,r).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let r=this;if(null!=t){if(r=F(r.node.cloneNode(!0)),e){const e=t(r);if(r=e||r,!1===e)return""}r.each((function(){const e=t(this),r=e||this;!1===e?this.remove():e&&this!==r&&this.replace(r)}),!0)}return e?r.node.outerHTML:r.node.innerHTML}e=null!=e&&e;const n=R("wrapper",r),i=_.document.createDocumentFragment();n.innerHTML=t;for(let t=n.children.length;t--;)i.appendChild(n.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}V(Ft,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=et.test(r.nodeValue)?parseFloat(r.nodeValue):r.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?Ct[t]:et.test(e)?parseFloat(e):e;"number"==typeof(e=Lt.reduce(((e,r)=>r(t,e,this)),e))?e=new Tt(e):ht.isColor(e)?e=new ht(e):e.constructor===Array&&(e=new Rt(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof r?this.node.setAttributeNS(r,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return bt(t,this.node)},findOne:function(t){return F(this.node.querySelector(t))}}),z(Ft,"Dom");class jt extends Ft{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,t.hasAttribute("svgjs:data")&&this.setData(JSON.parse(t.getAttribute("svgjs:data"))||{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new Tt(t).plus(this.x()))}dy(t=0){return this.y(new Tt(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){t=T(t);const e=new vt;let r=this;for(;(r=r.parent())&&r.node!==_.document&&"#document-fragment"!==r.nodeName&&(e.push(r),r.node!==t.node););return e}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(H);return e?T(e[1]):null}root(){const t=this.parent(q(B));return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const r=p(this,t,e);return this.width(new Tt(r.width)).height(new Tt(r.height))}width(t){return this.attr("width",t)}writeDataToDom(){return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}V(jt,{bbox:function(){const t=gt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(dt().svg).show(),r=e.node.getBBox();return e.remove(),r}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new mt(t)},rbox:function(t){const e=gt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),r=new mt(e);return t?r.transform(t.screenCTM().inverseO()):r.addOffset()},inside:function(t,e){const r=this.bbox();return t>r.x&&e>r.y&&t=0;r--)null!=e[Dt[t][r]]&&this.attr(Dt.prefix(t,Dt[t][r]),e[Dt[t][r]]);return this},s(["Element","Runner"],e)})),s(["Element","Runner"],{matrix:function(t,e,r,n,i,s){return null==t?new ft(this):this.attr("transform",new ft(t,e,r,n,i,s))},rotate:function(t,e,r){return this.transform({rotate:t,ox:e,oy:r},!0)},skew:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:r},!0):this.transform({skew:[t,e],ox:r,oy:n},!0)},shear:function(t,e,r){return this.transform({shear:t,ox:e,oy:r},!0)},scale:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:r},!0):this.transform({scale:[t,e],ox:r,oy:n},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),s("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new Tt(t)):this.rx(t).ry(e)}}),s("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new ct(this.node.getPointAtLength(t))}}),s(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),s("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),s("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(W).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(nt).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(ft.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new ft)},toParent:function(t,e){if(this===t)return this;const r=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(n.multiply(r)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new ft(this).decompose();return null==t?e:e[t]}ft.isMatrixLike(t)||(t={...t,origin:m(t,this)});const r=new ft(!0===e?this:e||!1).transform(t);return this.attr("transform",r)}});class zt extends jt{flatten(t=this,e){return this.each((function(){if(this instanceof zt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(r,n){return n[n.length-r-1].toParent(t,e)})),this.remove()}}z(zt,"Container");class qt extends zt{constructor(t,e=t){super(L("defs",t),e)}flatten(){return this}ungroup(){return this}}z(qt,"Defs");class Nt extends jt{}function Ut(t){return this.attr("rx",t)}function Yt(t){return this.attr("ry",t)}function Vt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Zt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Gt(t){return this.attr("cx",t)}function $t(t){return this.attr("cy",t)}function Xt(t){return null==t?2*this.rx():this.rx(new Tt(t).divide(2))}function Ht(t){return null==t?2*this.ry():this.ry(new Tt(t).divide(2))}z(Nt,"Shape");var Wt={__proto__:null,rx:Ut,ry:Yt,x:Vt,y:Zt,cx:Gt,cy:$t,width:Xt,height:Ht};class Jt extends Nt{constructor(t,e=t){super(L("ellipse",t),e)}size(t,e){const r=p(this,t,e);return this.rx(new Tt(r.width).divide(2)).ry(new Tt(r.height).divide(2))}}V(Jt,Wt),s("Container",{ellipse:Z((function(t=0,e=t){return this.put(new Jt).size(t,e).move(0,0)}))}),z(Jt,"Ellipse");class Qt extends Ft{constructor(t=_.document.createDocumentFragment()){super(t)}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){const t=new Ft(R("wrapper",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}}function Kt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new Tt(t),fy:new Tt(e)}):this.attr({x1:new Tt(t),y1:new Tt(e)})}function te(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new Tt(t),cy:new Tt(e)}):this.attr({x2:new Tt(t),y2:new Tt(e)})}z(Qt,"Fragment");var ee,re={__proto__:null,from:Kt,to:te};class ne extends zt{constructor(t,e){super(L(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,r){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,r)}bbox(){return new mt}targets(){return bt('svg [fill*="'+this.id()+'"]')}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return'url("#'+this.id()+'")'}}V(ne,re),s({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:Z((function(t,e){return this.put(new ne(t)).update(e)}))}}),z(ne,"Gradient");class ie extends zt{constructor(t,e=t){super(L("pattern",t),e)}attr(t,e,r){return"transform"===t&&(t="patternTransform"),super.attr(t,e,r)}bbox(){return new mt}targets(){return bt('svg [fill*="'+this.id()+'"]')}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return'url("#'+this.id()+'")'}}s({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:Z((function(t,e,r){return this.put(new ie).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),z(ie,"Pattern");class se extends Nt{constructor(t,e=t){super(L("image",t),e)}load(t,e){if(!t)return this;const r=new _.window.Image;return Pt(r,"load",(function(t){const n=this.parent(ie);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof ie&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),Pt(r,"load error",(function(){At(r)})),this.attr("href",r.src=t,w)}}ee=function(t,e,r){return"fill"!==t&&"stroke"!==t||rt.test(e)&&(e=r.root().defs().image(e)),e instanceof se&&(e=r.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},Lt.push(ee),s({Container:{image:Z((function(t,e){return this.put(new se).size(0,0).load(t,e)}))}}),z(se,"Image");class oe extends Rt{bbox(){let t=-1/0,e=-1/0,r=1/0,n=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),r=Math.min(i[0],r),n=Math.min(i[1],n)})),new mt(r,n,t-r,e-n)}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(nt).map(parseFloat)).length%2!=0&&t.pop();for(let r=0,n=t.length;r=0;r--)n.width&&(this[r][0]=(this[r][0]-n.x)*t/n.width+n.x),n.height&&(this[r][1]=(this[r][1]-n.y)*e/n.height+n.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,r=this.length;e":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,r,n){return function(i){return i<0?t>0?e/t*i:r>0?n/r*i:0:i>1?r<1?(1-n)/(1-r)*i+(n-r)/(1-r):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*n+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let r=t;return"none"===e?--r:"both"===e&&++r,(n,i=!1)=>{let s=Math.floor(n*t);const o=n*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,n>=0&&s<0&&(s=0),n<=1&&s>r&&(s=r),s/r}}};class fe{done(){return!1}}class de extends fe{constructor(t=It.ease){super(),this.ease=le[t]||t}step(t,e,r){return"number"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}}class pe extends fe{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}}function me(){const t=(this._duration||500)/1e3,e=this._overshoot||0,r=Math.PI,n=Math.log(e/100+1e-10),i=-n/Math.sqrt(r*r+n*n),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}class ge extends pe{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;r>100&&(r=16),r/=1e3;const i=n.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*r+s*r*r/2;return n.velocity=i+s*r,n.done=Math.abs(e-o)+Math.abs(i)<.002,n.done?e:o}}V(ge,{duration:ce("_duration",me),overshoot:ce("_overshoot",me)});class ve extends pe{constructor(t=.1,e=.01,r=0,n=1e3){super(),this.p(t).i(e).d(r).windup(n)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;const i=e-t;let s=(n.integral||0)+i*r;const o=(i-(n.error||0))/r,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),n.error=i,n.integral=s,n.done=Math.abs(i)<.001,n.done?e:t+(this.P*i+this.I*s+this.D*o)}}V(ve,{windup:ce("_windup"),p:ce("P"),i:ce("I"),d:ce("D")});const ye={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},be={M:function(t,e,r){return e.x=r.x=t[0],e.y=r.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,r){return e.x=r.x,e.y=r.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},we="mlhvqtcsaz".split("");for(let t=0,e=we.length;t=0;n--)r=this[n][0],"M"===r||"L"===r||"T"===r?(this[n][1]+=t,this[n][2]+=e):"H"===r?this[n][1]+=t:"V"===r?this[n][1]+=e:"C"===r||"S"===r||"Q"===r?(this[n][1]+=t,this[n][2]+=e,this[n][3]+=t,this[n][4]+=e,"C"===r&&(this[n][5]+=t,this[n][6]+=e)):"A"===r&&(this[n][6]+=t,this[n][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let r=0,n="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new ct,p:new ct};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!xe(i,n))if("."!==n)if(isNaN(parseInt(n)))if(" "!==n&&","!==n)if("-"!==n)if("E"!==n.toUpperCase()){if(it.test(n)){if(i.inNumber)_e(i,!1);else{if(!Me(i))throw new Error("parser Error");Se(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!Ae(i)){_e(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else i.inNumber&&_e(i,!1);else{if("0"===i.number||Pe(i)){i.inNumber=!0,i.number=n,_e(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){_e(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&_e(i,!1),i.inSegment&&Me(i)&&Se(i),i.segments}(t)}size(t,e){const r=this.bbox();let n,i;for(r.width=0===r.width?1:r.width,r.height=0===r.height?1:r.height,n=this.length-1;n>=0;n--)i=this[n][0],"M"===i||"L"===i||"T"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):"H"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:"V"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:"C"===i||"S"===i||"Q"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,"C"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):"A"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this}toString(){return function(t){let e="";for(let r=0,n=t.length;r{const e=typeof t;return"number"===e?Tt:"string"===e?ht.isColor(t)?ht:nt.test(t)?it.test(t)?Oe:Rt:G.test(t)?Tt:Ie:Te.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Rt:"object"===e?Re:Ie};class ke{constructor(t){this._stepper=t||new de("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){const e=this;return this._morphObj.fromArray(this._from.map((function(r,n){return e._stepper.step(r,e._to[n],t,e._context[n],e._context)})))}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(Ee(t));let e=new this._type(t);return this._type===ht&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Re&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toArray(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class Ie{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class Ce{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,Ce.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}Ce.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Be=(t,e)=>t[0]e[0]?1:0;class Re{constructor(...t){this.init(...t)}align(t){for(let e=0,r=this.values.length;et.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const r=e.shift(),n=e.shift(),i=e.shift(),s=e.splice(0,i);t[r]=new n(s).valueOf()}return t}}const Te=[Ie,Ce,Re];function Le(t=[]){Te.push(...[].concat(t))}function Fe(){V(Te,{to(t){return(new ke).type(this.constructor).from(this.valueOf()).to(t)},fromArray(t){return this.init(t),this}})}class je extends Nt{constructor(t,e=t){super(L("path",t),e)}array(){return this._array||(this._array=new Oe(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new Oe(t))}size(t,e){const r=p(this,t,e);return this.attr("d",this.array().size(r.width,r.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}je.prototype.MorphArray=Oe,s({Container:{path:Z((function(t){return this.put(new je).plot(t||new Oe)}))}}),z(je,"Path");var De={__proto__:null,array:function(){return this._array||(this._array=new oe(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new oe(t))},size:function(t,e){const r=p(this,t,e);return this.attr("points",this.array().size(r.width,r.height))}};class ze extends Nt{constructor(t,e=t){super(L("polygon",t),e)}}s({Container:{polygon:Z((function(t){return this.put(new ze).plot(t||new oe)}))}}),V(ze,ae),V(ze,De),z(ze,"Polygon");class qe extends Nt{constructor(t,e=t){super(L("polyline",t),e)}}s({Container:{polyline:Z((function(t){return this.put(new qe).plot(t||new oe)}))}}),V(qe,ae),V(qe,De),z(qe,"Polyline");class Ne extends Nt{constructor(t,e=t){super(L("rect",t),e)}}V(Ne,{rx:Ut,ry:Yt}),s({Container:{rect:Z((function(t,e){return this.put(new Ne).size(t,e)}))}}),z(Ne,"Rect");class Ue{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Ye={nextDraw:null,frames:new Ue,timeouts:new Ue,immediates:new Ue,timer:()=>_.window.performance||_.window.Date,transforms:[],frame(t){const e=Ye.frames.push({run:t});return null===Ye.nextDraw&&(Ye.nextDraw=_.window.requestAnimationFrame(Ye._draw)),e},timeout(t,e){e=e||0;const r=Ye.timer().now()+e,n=Ye.timeouts.push({run:t,time:r});return null===Ye.nextDraw&&(Ye.nextDraw=_.window.requestAnimationFrame(Ye._draw)),n},immediate(t){const e=Ye.immediates.push(t);return null===Ye.nextDraw&&(Ye.nextDraw=_.window.requestAnimationFrame(Ye._draw)),e},cancelFrame(t){null!=t&&Ye.frames.remove(t)},clearTimeout(t){null!=t&&Ye.timeouts.remove(t)},cancelImmediate(t){null!=t&&Ye.immediates.remove(t)},_draw(t){let e=null;const r=Ye.timeouts.last();for(;(e=Ye.timeouts.shift())&&(t>=e.time?e.run():Ye.timeouts.push(e),e!==r););let n=null;const i=Ye.frames.last();for(;n!==i&&(n=Ye.frames.shift());)n.run(t);let s=null;for(;s=Ye.immediates.shift();)s();Ye.nextDraw=Ye.timeouts.first()||Ye.frames.first()?_.window.requestAnimationFrame(Ye._draw):null}},Ve=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},Ze=function(){const t=_.window;return(t.performance||t.Date).now()};class Ge extends Et{constructor(t=Ze){super(),this._timeSource=t,this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const r=Math.abs(e);return this.speed(t?-r:r)}schedule(t,e,r){if(null==t)return this._runners.map(Ve);let n=0;const i=this.getEndTime();if(e=e||0,null==r||"last"===r||"after"===r)n=i;else if("absolute"===r||"start"===r)n=e,e=0;else if("now"===r)n=this._time;else if("relative"===r){const r=this.getRunnerInfoById(t.id);r&&(n=r.start+e,e=0)}else{if("with-last"!==r)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();n=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:n+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Ye.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Ye.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let r=e-this._lastSourceTime;t&&(r=0);const n=this._speed*r+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=n,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],r=e.runner;this._time-e.start<=0&&r.reset()}let i=!1;for(let t=0,e=this._runners.length;t0?this._continue():(this.pause(),this.fire("finished")),this}}s({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Ge,this._timeline):(this._timeline=t,this)}}});class $e extends Et{constructor(t){super(),this.id=$e.id++,t="function"==typeof(t=null==t?It.duration:t)?new pe(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof pe,this._stepper=this._isDeclarative?t:new de,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new ft,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,r){let n=1,i=!1,s=0;return e=e||It.delay,r=r||"last","object"!=typeof(t=t||It.duration)||t instanceof fe||(e=t.delay||e,r=t.when||r,i=t.swing||i,n=t.times||n,s=t.wait||s,t=t.duration||It.duration),{duration:t,delay:e,swing:i,times:n,wait:s,when:r}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t,e){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,r){const n=$e.sanitise(t,e,r),i=new $e(n.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(n).schedule(n.delay,n.when)}clearTransform(){return this.transforms=new ft,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new de(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,r){return"object"==typeof t&&(e=t.swing,r=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=r||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),r=(this._time-t*e)/this._duration;return Math.min(t+r,this._times)}const r=t%1,n=e*Math.floor(t)+this._duration*r;return this.time(n)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,r=this._duration,n=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(n+r))/(n+r)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(n+r))/r+i;return Math.max(Math.min(a,1),0)},u=i*(n+r)-n;return a=e<=0?Math.round(t(1e-5)):e=0;this._lastPosition=e;const n=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime=n;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=n,this._reseted=!1;let a=!1;return(r||o)&&(this._initialise(r),this.transforms=new ft,a=this._run(o?t:e),this.fire("step",this)),this.done=this.done||a&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,r=this._queue.length;et.lmultiplyO(e),We=t=>t.transforms;function Je(){const t=this._transformationRunners.runners.map(We).reduce(He,new ft);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Qe{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Xe).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const r=this.ids.indexOf(t+1);return this.ids.splice(r,1,t+1),this.runners.splice(r,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;ee.id<=t.id)).map(We).reduce(He,new ft)},_addRunner(t){this._transformationRunners.add(t),Ye.cancelImmediate(this._frameId),this._frameId=Ye.immediate(Je.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Qe).add(new Xe(new ft(this))))}}}),V($e,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,r){if("string"==typeof e)return this.styleAttr(t,{[e]:r});let n=e;if(this._tryRetarget(t,n))return this;let i=new ke(this._stepper).to(n),s=Object.keys(n);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const r=Object.keys(e),o=(a=s,r.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),r=new Re(i.from()).valueOf();Object.assign(r,e),i.from(r)}const u=new Re(i.to()).valueOf();Object.assign(u,e),i.to(u),s=r,n=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let r=new ke(this._stepper).to(new Tt(t));return this.queue((function(){r=r.from(this.element().zoom())}),(function(t){return this.element().zoom(r.at(t),e),r.done()}),(function(t,n){e=n,r.to(t)})),this._rememberMorpher("zoom",r),this},transform(t,e,r){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const n=ft.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new ke(this._stepper).type(r?Ce:ft);let s,o,a,u,h;return this.queue((function(){o=o||this.element(),s=s||m(t,o),h=new ft(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:l,y:f}=new ct(s).transform(o._currentTransform(this));let d=new ft({...t,origin:[l,f]}),p=this._isDeclarative&&a?a:h;if(r){d=d.decompose(l,f),p=p.decompose(l,f);const t=d.rotate,e=p.rotate,r=[t-360,t,t+360],n=r.map((t=>Math.abs(t-e))),i=Math.min(...n),s=n.indexOf(i);d.rotate=r[s]}e&&(n||(d.rotate=t.rotate||0),this._isDeclarative&&u&&(p.rotate=u)),i.from(p),i.to(d);const m=i.at(c);return u=m.rotate,a=new ft(m),this.addTransform(a),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=m(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t,e){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new Tt(e),this._tryRetarget(t,e))return this;const r=new ke(this._stepper).to(e);let n=null;return this.queue((function(){n=this.element()[t](),r.from(n),r.to(n+e)}),(function(e){return this.element()[t](r.at(e)),r.done()}),(function(t){r.to(n+new Tt(t))})),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new ke(this._stepper).to(e);return this.queue((function(){r.from(this.element()[t]())}),(function(e){return this.element()[t](r.at(e)),r.done()})),this._rememberMorpher(t,r),this},_queueNumber(t,e){return this._queueObject(t,new Tt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let r;return t&&e||(r=this._element.bbox()),t||(t=r.width/r.height*e),e||(e=r.height/r.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,r,n){if(4===arguments.length)return this.plot([t,e,r,n]);if(this._tryRetarget("plot",t))return this;const i=new ke(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,r,n){return this._queueObject("viewbox",new mt(t,e,r,n))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),V($e,{rx:Ut,ry:Yt,from:Kt,to:te}),z($e,"Runner");class Ke extends zt{constructor(t,e=t){super(L("svg",t),e),this.namespace()}defs(){return this.isRoot()?F(this.node.querySelector("defs"))||this.put(new qt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof _.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:v,version:"1.1"}).attr("xmlns:xlink",w,b).attr("xmlns:svgjs",M,b):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,b).attr("xmlns:svgjs",null,b)}root(){return this.isRoot()?this:super.root()}}s({Container:{nested:Z((function(){return this.put(new Ke)}))}}),z(Ke,"Svg",!0);class tr extends zt{constructor(t,e=t){super(L("symbol",t),e)}}s({Container:{symbol:Z((function(){return this.put(new tr)}))}}),z(tr,"Symbol");var er={__proto__:null,plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(_.document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)},move:function(t,e,r=this.bbox()){return this.x(t,r).y(e,r)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},center:function(t,e,r=this.bbox()){return this.cx(t,r).cy(e,r)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},amove:function(t,e){return this.ax(t).ay(e)},build:function(t){return this._build=!!t,this}};class rr extends Nt{constructor(t,e=t){super(L("text",t),e),this.dom.leading=new Tt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new Tt(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const r=this.dom.leading;this.each((function(n){const i=_.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=r*new Tt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",n?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new Tt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let r=0;t="";for(let n=0,i=e.length;n{let i;try{i=r.bbox()}catch(t){return}const s=new ft(r),o=s.translate(t,e).transform(s.inverse()),a=new ct(i.x,i.y).transform(o);r.move(a.x,a.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)},size:function(t,e,r=this.bbox()){const n=p(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach(((t,e)=>{const n=new ct(r).transform(new ft(t).inverse());t.scale(i,s,n.x,n.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}};class ur extends zt{constructor(t,e=t){super(L("g",t),e)}}V(ur,ar),s({Container:{group:Z((function(){return this.put(new ur)}))}}),z(ur,"G");class hr extends zt{constructor(t,e=t){super(L("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,w)}}V(hr,ar),s({Container:{link:Z((function(t){return this.put(new hr).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const r=e.index(t);return e.add(this,r),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new hr,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),z(hr,"A");class cr extends zt{constructor(t,e=t){super(L("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return bt('svg [mask*="'+this.id()+'"]')}}s({Container:{mask:Z((function(){return this.defs().put(new cr)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof cr?t:this.parent().mask().add(t);return this.attr("mask",'url("#'+e.id()+'")')},unmask(){return this.attr("mask",null)}}}),z(cr,"Mask");class lr extends jt{constructor(t,e=t){super(L("stop",t),e)}update(t){return("number"==typeof t||t instanceof Tt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new Tt(t.offset)),this}}s({Gradient:{stop:function(t,e,r){return this.put(new lr).update(t,e,r)}}}),z(lr,"Stop");class fr extends jt{constructor(t,e=t){super(L("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,r={}){return this.rule("@font-face",{fontFamily:t,src:e,...r})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let r=t+"{";for(const t in e)r+=f(t)+":"+e[t]+";";return r+="}",r}(t,e))}}s("Dom",{style(t,e){return this.put(new fr).rule(t,e)},fontface(t,e,r){return this.put(new fr).font(t,e,r)}}),z(fr,"Style");class dr extends rr{constructor(t,e=t){super(L("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let r=null;return e&&(r=e.plot(t)),null==t?r:this}track(){return this.reference("href")}}s({Container:{textPath:Z((function(t,e){return t instanceof rr||(t=this.text(t)),t.path(e)}))},Text:{path:Z((function(t,e=!0){const r=new dr;let n;if(t instanceof je||(t=this.defs().path(t)),r.attr("href","#"+t,w),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)})),textPath(){return this.findOne("textPath")}},Path:{text:Z((function(t){return t instanceof rr||(t=(new rr).addTo(this.parent()).text(t)),t.path(this)})),targets(){return bt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),dr.prototype.MorphArray=Oe,z(dr,"TextPath");class pr extends Nt{constructor(t,e=t){super(L("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,w)}}s({Container:{use:Z((function(t,e){return this.put(new pr).use(t,e)}))}}),z(pr,"Use");const mr=T;V([Ke,tr,se,ie,he],o("viewbox")),V([ue,qe,ze,je],o("marker")),V(rr,o("Text")),V(je,o("Path")),V(qt,o("Defs")),V([rr,nr],o("Tspan")),V([Ne,Jt,ne,$e],o("radius")),V(Et,o("EventTarget")),V(Ft,o("Dom")),V(jt,o("Element")),V(Nt,o("Shape")),V([zt,Qt],o("Container")),V(ne,o("Gradient")),V($e,o("Runner")),vt.extend([...new Set(i)]),Le([Tt,ht,mt,ft,Rt,oe,Oe]),Fe()},725:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rgbToHsl=e.hslToRgb=e.rgbToHex=void 0,e.rgbToHex=function(t,e,r){return`#${((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}`},e.hslToRgb=function(t,e,r){let n,i,s;if(t/=360,r/=100,0==(e/=100))n=i=s=r;else{const o=(t,e,r)=>(r+=r<0?1:r>1?-1:0)<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,a=r<.5?r*(1+e):r+e-r*e,u=2*r-a;n=o(u,a,t+1/3),i=o(u,a,t),s=o(u,a,t-1/3)}return[.5+255*n<<0,.5+255*i<<0,.5+255*s<<0]},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;const n=Math.max(t,e,r),i=Math.min(t,e,r),s=(n+i)/2;let o,a;if(n===i)o=a=0;else{const u=n-i;switch(a=s>.5?u/(2-n-i):u/(n+i),n){case t:o=(e-r)/u+(e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={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",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",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",rebeccapurple:"#663399",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",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},688:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(785),e),i(r(725),e),i(r(951),e)},951:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.parseColorAndConvert=void 0;const n=r(202),i=r(725);function s(t){if("number"==typeof t)return t>16777215?{type:"rgb",a:t>>24&255,b:t>>16&255,c:t>>8&255,alpha:(255&t)/255}:{type:"rgb",a:t>>16&255,b:t>>8&255,c:255&t,alpha:1};t=t.replace(/\s/g,""),n.default[t]&&(t=n.default[t]);let e=/^#([0-9a-f]{3,8})$/i.exec(t);if(e){const t=e[1];return 3===t.length?{type:"rgb",a:parseInt(t[0]+t[0],16),b:parseInt(t[1]+t[1],16),c:parseInt(t[2]+t[2],16),alpha:1}:{type:"rgb",a:parseInt(t[0]+t[1],16),b:parseInt(t[2]+t[3],16),c:parseInt(t[4]+t[5],16),alpha:t.length>6?parseInt(t.substring(6),16)/255:1}}if(e=/^((hsl|rgb)a?)\((\d+),(\d+)%?,(\d+)%?,?(.+)?\)$/i.exec(t),e){const[,,t,r,n,i,s]=e;return{type:t,a:+r,b:+n,c:+i,alpha:s?+s:1}}}e.parseColorAndConvert=function(t){const e=s(t);if(e){if("hsl"===e.type){const[t,r,n]=i.hslToRgb(e.a,e.b,e.c);return{r:t,g:r,b:n,h:e.a,s:e.b,l:e.c,alpha:e.alpha}}{const[t,r,n]=i.rgbToHsl(e.a,e.b,e.c);return{h:t,s:r,l:n,r:e.a,g:e.b,b:e.c,alpha:e.alpha}}}},e.parseColor=s},785:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},926:t=>{var e;window,e=function(){return(()=>{var t=[function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.log=e.PI2=e.PHI=e.Vec2=e.distributePointsInBuffer=e.prepareBufferForInterpolation=e.interpolate=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.now=e.toRadians=e.toDegrees=e.relativeClamp=e.clamp=e.lerp=void 0,i(r(1),e),r(10).glMatrix.setMatrixArrayType(Array),i(r(21),e),i(r(22),e),i(r(23),e),i(r(24),e),i(r(33),e),i(r(34),e),i(r(35),e),i(r(32),e),i(r(36),e),i(r(37),e),i(r(38),e),i(r(39),e),i(r(40),e),i(r(41),e),i(r(42),e),i(r(43),e),i(r(44),e),i(r(45),e),i(r(46),e),i(r(47),e),i(r(29),e),i(r(48),e);var s=r(30);Object.defineProperty(e,"lerp",{enumerable:!0,get:function(){return s.lerp}}),Object.defineProperty(e,"clamp",{enumerable:!0,get:function(){return s.clamp}}),Object.defineProperty(e,"relativeClamp",{enumerable:!0,get:function(){return s.relativeClamp}}),Object.defineProperty(e,"toDegrees",{enumerable:!0,get:function(){return s.toDegrees}}),Object.defineProperty(e,"toRadians",{enumerable:!0,get:function(){return s.toRadians}}),Object.defineProperty(e,"now",{enumerable:!0,get:function(){return s.now}}),Object.defineProperty(e,"noise",{enumerable:!0,get:function(){return s.noise}}),Object.defineProperty(e,"random",{enumerable:!0,get:function(){return s.random}}),Object.defineProperty(e,"angleFromRepetition",{enumerable:!0,get:function(){return s.angleFromRepetition}}),Object.defineProperty(e,"angle2FromRepetition",{enumerable:!0,get:function(){return s.angle2FromRepetition}}),Object.defineProperty(e,"distanceFromRepetition",{enumerable:!0,get:function(){return s.distanceFromRepetition}}),Object.defineProperty(e,"interpolate",{enumerable:!0,get:function(){return s.interpolate}}),Object.defineProperty(e,"prepareBufferForInterpolation",{enumerable:!0,get:function(){return s.prepareBufferForInterpolation}}),Object.defineProperty(e,"distributePointsInBuffer",{enumerable:!0,get:function(){return s.distributePointsInBuffer}});var o=r(26);Object.defineProperty(e,"Vec2",{enumerable:!0,get:function(){return o.default}});var a=r(27);Object.defineProperty(e,"PHI",{enumerable:!0,get:function(){return a.PHI}}),Object.defineProperty(e,"PI2",{enumerable:!0,get:function(){return a.PI2}}),Object.defineProperty(e,"log",{enumerable:!0,get:function(){return a.log}}),Object.defineProperty(e,"mod",{enumerable:!0,get:function(){return a.mod}})},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(2),e),i(r(3),e),i(r(4),e),i(r(5),e),i(r(6),e),i(r(7),e),i(r(8),e),i(r(9),e)},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]="Ring",r[r.Matrix=2]="Matrix"},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]="Relative",r[r.Fixed=2]="Fixed"},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},(t,e,r)=>{"use strict";r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>s,mat3:()=>o,mat4:()=>a,quat:()=>u,quat2:()=>h,vec2:()=>c,vec3:()=>l,vec4:()=>f});var n=r(11),i=r(12),s=r(13),o=r(14),a=r(15),u=r(16),h=r(19),c=r(20),l=r(18),f=r(17)},(t,e,r)=>{"use strict";r.r(e),r.d(e,{EPSILON:()=>n,ARRAY_TYPE:()=>i,RANDOM:()=>s,setMatrixArrayType:()=>o,toRadian:()=>u,equals:()=>h});var n=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array,s=Math.random;function o(t){i=t}var a=Math.PI/180;function u(t){return t*a}function h(t,e){return Math.abs(t-e)<=n*Math.max(1,Math.abs(t),Math.abs(e))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},(t,e,r)=>{"use strict";r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,identity:()=>a,fromValues:()=>u,set:()=>h,transpose:()=>c,invert:()=>l,adjoint:()=>f,determinant:()=>d,multiply:()=>p,rotate:()=>m,scale:()=>g,fromRotation:()=>v,fromScaling:()=>y,str:()=>b,frob:()=>w,LDU:()=>M,add:()=>x,subtract:()=>_,exactEquals:()=>S,equals:()=>P,multiplyScalar:()=>A,multiplyScalarAndAdd:()=>O,mul:()=>E,sub:()=>k});var n=r(11);function i(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function s(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function a(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function u(t,e,r,i){var s=new n.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=r,s[3]=i,s}function h(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function c(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function l(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*s-i*n;return o?(o=1/o,t[0]=s*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}function f(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function d(t){return t[0]*t[3]-t[2]*t[1]}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*a+s*u,t[1]=i*a+o*u,t[2]=n*h+s*c,t[3]=i*h+o*c,t}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u+s*a,t[1]=i*u+o*a,t[2]=n*-a+s*u,t[3]=i*-a+o*u,t}function g(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1];return t[0]=n*a,t[1]=i*a,t[2]=s*u,t[3]=o*u,t}function v(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function y(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function b(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function w(t){return Math.hypot(t[0],t[1],t[2],t[3])}function M(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function x(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function _(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function S(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function P(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=e[0],u=e[1],h=e[2],c=e[3];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-u)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(s-h)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(h))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}function A(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function O(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}var E=p,k=_},(t,e,r)=>{"use strict";r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,identity:()=>a,fromValues:()=>u,set:()=>h,invert:()=>c,determinant:()=>l,multiply:()=>f,rotate:()=>d,scale:()=>p,translate:()=>m,fromRotation:()=>g,fromScaling:()=>v,fromTranslation:()=>y,str:()=>b,frob:()=>w,add:()=>M,subtract:()=>x,multiplyScalar:()=>_,multiplyScalarAndAdd:()=>S,exactEquals:()=>P,equals:()=>A,mul:()=>O,sub:()=>E});var n=r(11);function i(){var t=new n.ARRAY_TYPE(6);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function s(t){var e=new n.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function a(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function u(t,e,r,i,s,o){var a=new n.ARRAY_TYPE(6);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a[4]=s,a[5]=o,a}function h(t,e,r,n,i,s,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t}function c(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=r*s-n*i;return u?(u=1/u,t[0]=s*u,t[1]=-n*u,t[2]=-i*u,t[3]=r*u,t[4]=(i*a-s*o)*u,t[5]=(n*o-r*a)*u,t):null}function l(t){return t[0]*t[3]-t[1]*t[2]}function f(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=r[0],c=r[1],l=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*h+s*c,t[1]=i*h+o*c,t[2]=n*l+s*f,t[3]=i*l+o*f,t[4]=n*d+s*p+a,t[5]=i*d+o*p+u,t}function d(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*h,t[1]=i*c+o*h,t[2]=n*-h+s*c,t[3]=i*-h+o*c,t[4]=a,t[5]=u,t}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=r[0],c=r[1];return t[0]=n*h,t[1]=i*h,t[2]=s*c,t[3]=o*c,t[4]=a,t[5]=u,t}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=n*h+s*c+a,t[5]=i*h+o*c+u,t}function g(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function v(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function y(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function b(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function w(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function M(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function x(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function _(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function S(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function P(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function A(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],u=t[5],h=e[0],c=e[1],l=e[2],f=e[3],d=e[4],p=e[5];return Math.abs(r-h)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-c)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(s-l)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(o-f)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-d)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(u-p)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(p))}var O=f,E=x},(t,e,r)=>{"use strict";r.r(e),r.d(e,{create:()=>i,fromMat4:()=>s,clone:()=>o,copy:()=>a,fromValues:()=>u,set:()=>h,identity:()=>c,transpose:()=>l,invert:()=>f,adjoint:()=>d,determinant:()=>p,multiply:()=>m,translate:()=>g,rotate:()=>v,scale:()=>y,fromTranslation:()=>b,fromRotation:()=>w,fromScaling:()=>M,fromMat2d:()=>x,fromQuat:()=>_,normalFromMat4:()=>S,projection:()=>P,str:()=>A,frob:()=>O,add:()=>E,subtract:()=>k,multiplyScalar:()=>I,multiplyScalarAndAdd:()=>C,exactEquals:()=>B,equals:()=>R,mul:()=>T,sub:()=>L});var n=r(11);function i(){var t=new n.ARRAY_TYPE(9);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function o(t){var e=new n.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function u(t,e,r,i,s,o,a,u,h){var c=new n.ARRAY_TYPE(9);return c[0]=t,c[1]=e,c[2]=r,c[3]=i,c[4]=s,c[5]=o,c[6]=a,c[7]=u,c[8]=h,c}function h(t,e,r,n,i,s,o,a,u,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=u,t[8]=h,t}function c(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function l(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function f(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=c*o-a*h,f=-c*s+a*u,d=h*s-o*u,p=r*l+n*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-c*n+i*h)*p,t[2]=(a*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*u)*p,t[5]=(-a*r+i*s)*p,t[6]=d*p,t[7]=(-h*r+n*u)*p,t[8]=(o*r-n*s)*p,t):null}function d(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8];return t[0]=o*c-a*h,t[1]=i*h-n*c,t[2]=n*a-i*o,t[3]=a*u-s*c,t[4]=r*c-i*u,t[5]=i*s-r*a,t[6]=s*h-o*u,t[7]=n*u-r*h,t[8]=r*o-n*s,t}function p(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],u=t[7],h=t[8];return e*(h*s-o*u)+r*(-h*i+o*a)+n*(u*i-s*a)}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=r[0],d=r[1],p=r[2],m=r[3],g=r[4],v=r[5],y=r[6],b=r[7],w=r[8];return t[0]=f*n+d*o+p*h,t[1]=f*i+d*a+p*c,t[2]=f*s+d*u+p*l,t[3]=m*n+g*o+v*h,t[4]=m*i+g*a+v*c,t[5]=m*s+g*u+v*l,t[6]=y*n+b*o+w*h,t[7]=y*i+b*a+w*c,t[8]=y*s+b*u+w*l,t}function g(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=u,t[6]=f*n+d*o+h,t[7]=f*i+d*a+c,t[8]=f*s+d*u+l,t}function v(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*a,t[2]=d*s+f*u,t[3]=d*o-f*n,t[4]=d*a-f*i,t[5]=d*u-f*s,t[6]=h,t[7]=c,t[8]=l,t}function y(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function b(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function w(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function M(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function x(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function _(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,u=i+i,h=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*u,m=s*o,g=s*a,v=s*u;return t[0]=1-l-p,t[3]=c-v,t[6]=f+g,t[1]=c+v,t[4]=1-h-p,t[7]=d-m,t[2]=f-g,t[5]=d+m,t[8]=1-h-l,t}function S(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*u-i*o,w=r*h-s*o,M=n*u-i*a,x=n*h-s*a,_=i*h-s*u,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,O=l*g-f*m,E=l*v-d*m,k=f*v-d*g,I=y*k-b*E+w*O+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-u*E+h*O)*I,t[1]=(u*A-o*k-h*P)*I,t[2]=(o*E-a*A+h*S)*I,t[3]=(i*E-n*k-s*O)*I,t[4]=(r*k-i*A+s*P)*I,t[5]=(n*A-r*E-s*S)*I,t[6]=(m*_-g*x+v*M)*I,t[7]=(g*w-p*_-v*b)*I,t[8]=(p*x-m*w+v*y)*I,t):null}function P(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function A(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function O(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function E(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function k(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function I(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function C(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function B(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function R(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],u=t[5],h=t[6],c=t[7],l=t[8],f=e[0],d=e[1],p=e[2],m=e[3],g=e[4],v=e[5],y=e[6],b=e[7],w=e[8];return Math.abs(r-f)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(i-d)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(s-p)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(o-m)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(a-g)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(u-v)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(h-y)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(y))&&Math.abs(c-b)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(l-w)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(w))}var T=m,L=k},(t,e,r)=>{"use strict";r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,fromValues:()=>a,set:()=>u,identity:()=>h,transpose:()=>c,invert:()=>l,adjoint:()=>f,determinant:()=>d,multiply:()=>p,translate:()=>m,scale:()=>g,rotate:()=>v,rotateX:()=>y,rotateY:()=>b,rotateZ:()=>w,fromTranslation:()=>M,fromScaling:()=>x,fromRotation:()=>_,fromXRotation:()=>S,fromYRotation:()=>P,fromZRotation:()=>A,fromRotationTranslation:()=>O,fromQuat2:()=>E,getTranslation:()=>k,getScaling:()=>I,getRotation:()=>C,fromRotationTranslationScale:()=>B,fromRotationTranslationScaleOrigin:()=>R,fromQuat:()=>T,frustum:()=>L,perspective:()=>F,perspectiveFromFieldOfView:()=>j,ortho:()=>D,lookAt:()=>z,targetTo:()=>q,str:()=>N,frob:()=>U,add:()=>Y,subtract:()=>V,multiplyScalar:()=>Z,multiplyScalarAndAdd:()=>G,exactEquals:()=>$,equals:()=>X,mul:()=>H,sub:()=>W});var n=r(11);function i(){var t=new n.ARRAY_TYPE(16);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function s(t){var e=new n.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function a(t,e,r,i,s,o,a,u,h,c,l,f,d,p,m,g){var v=new n.ARRAY_TYPE(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=i,v[4]=s,v[5]=o,v[6]=a,v[7]=u,v[8]=h,v[9]=c,v[10]=l,v[11]=f,v[12]=d,v[13]=p,v[14]=m,v[15]=g,v}function u(t,e,r,n,i,s,o,a,u,h,c,l,f,d,p,m,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=u,t[8]=h,t[9]=c,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=g,t}function h(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function c(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=i,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function l(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*u-i*o,w=r*h-s*o,M=n*u-i*a,x=n*h-s*a,_=i*h-s*u,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,O=l*g-f*m,E=l*v-d*m,k=f*v-d*g,I=y*k-b*E+w*O+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-u*E+h*O)*I,t[1]=(i*E-n*k-s*O)*I,t[2]=(m*_-g*x+v*M)*I,t[3]=(f*x-l*_-d*M)*I,t[4]=(u*A-o*k-h*P)*I,t[5]=(r*k-i*A+s*P)*I,t[6]=(g*w-p*_-v*b)*I,t[7]=(c*_-f*w+d*b)*I,t[8]=(o*E-a*A+h*S)*I,t[9]=(n*A-r*E-s*S)*I,t[10]=(p*x-m*w+v*y)*I,t[11]=(l*w-c*x-d*y)*I,t[12]=(a*P-o*O-u*S)*I,t[13]=(r*O-n*P+i*S)*I,t[14]=(m*b-p*M-g*y)*I,t[15]=(c*M-l*b+f*y)*I,t):null}function f(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15];return t[0]=a*(f*v-d*g)-l*(u*v-h*g)+m*(u*d-h*f),t[1]=-(n*(f*v-d*g)-l*(i*v-s*g)+m*(i*d-s*f)),t[2]=n*(u*v-h*g)-a*(i*v-s*g)+m*(i*h-s*u),t[3]=-(n*(u*d-h*f)-a*(i*d-s*f)+l*(i*h-s*u)),t[4]=-(o*(f*v-d*g)-c*(u*v-h*g)+p*(u*d-h*f)),t[5]=r*(f*v-d*g)-c*(i*v-s*g)+p*(i*d-s*f),t[6]=-(r*(u*v-h*g)-o*(i*v-s*g)+p*(i*h-s*u)),t[7]=r*(u*d-h*f)-o*(i*d-s*f)+c*(i*h-s*u),t[8]=o*(l*v-d*m)-c*(a*v-h*m)+p*(a*d-h*l),t[9]=-(r*(l*v-d*m)-c*(n*v-s*m)+p*(n*d-s*l)),t[10]=r*(a*v-h*m)-o*(n*v-s*m)+p*(n*h-s*a),t[11]=-(r*(a*d-h*l)-o*(n*d-s*l)+c*(n*h-s*a)),t[12]=-(o*(l*g-f*m)-c*(a*g-u*m)+p*(a*f-u*l)),t[13]=r*(l*g-f*m)-c*(n*g-i*m)+p*(n*f-i*l),t[14]=-(r*(a*g-u*m)-o*(n*g-i*m)+p*(n*u-i*a)),t[15]=r*(a*f-u*l)-o*(n*f-i*l)+c*(n*u-i*a),t}function d(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],u=t[7],h=t[8],c=t[9],l=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*s)*(l*g-f*m)-(e*a-n*s)*(c*g-f*p)+(e*u-i*s)*(c*m-l*p)+(r*a-n*o)*(h*g-f*d)-(r*u-i*o)*(h*m-l*d)+(n*u-i*a)*(h*p-c*d)}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],v=e[14],y=e[15],b=r[0],w=r[1],M=r[2],x=r[3];return t[0]=b*n+w*a+M*l+x*m,t[1]=b*i+w*u+M*f+x*g,t[2]=b*s+w*h+M*d+x*v,t[3]=b*o+w*c+M*p+x*y,b=r[4],w=r[5],M=r[6],x=r[7],t[4]=b*n+w*a+M*l+x*m,t[5]=b*i+w*u+M*f+x*g,t[6]=b*s+w*h+M*d+x*v,t[7]=b*o+w*c+M*p+x*y,b=r[8],w=r[9],M=r[10],x=r[11],t[8]=b*n+w*a+M*l+x*m,t[9]=b*i+w*u+M*f+x*g,t[10]=b*s+w*h+M*d+x*v,t[11]=b*o+w*c+M*p+x*y,b=r[12],w=r[13],M=r[14],x=r[15],t[12]=b*n+w*a+M*l+x*m,t[13]=b*i+w*u+M*f+x*g,t[14]=b*s+w*h+M*d+x*v,t[15]=b*o+w*c+M*p+x*y,t}function m(t,e,r){var n,i,s,o,a,u,h,c,l,f,d,p,m=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=u,t[6]=h,t[7]=c,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+a*g+l*v+e[12],t[13]=i*m+u*g+f*v+e[13],t[14]=s*m+h*g+d*v+e[14],t[15]=o*m+c*g+p*v+e[15]),t}function g(t,e,r){var n=r[0],i=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function v(t,e,r,i){var s,o,a,u,h,c,l,f,d,p,m,g,v,y,b,w,M,x,_,S,P,A,O,E,k=i[0],I=i[1],C=i[2],B=Math.hypot(k,I,C);return B0?(r[0]=2*(u*a+l*i+h*o-c*s)/f,r[1]=2*(h*a+l*s+c*i-u*o)/f,r[2]=2*(c*a+l*o+u*s-h*i)/f):(r[0]=2*(u*a+l*i+h*o-c*s),r[1]=2*(h*a+l*s+c*i-u*o),r[2]=2*(c*a+l*o+u*s-h*i)),O(t,e,r),t}function k(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function I(t,e){var r=e[0],n=e[1],i=e[2],s=e[4],o=e[5],a=e[6],u=e[8],h=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(s,o,a),t[2]=Math.hypot(u,h,c),t}function C(t,e){var r=new n.ARRAY_TYPE(3);I(r,e);var i=1/r[0],s=1/r[1],o=1/r[2],a=e[0]*i,u=e[1]*s,h=e[2]*o,c=e[4]*i,l=e[5]*s,f=e[6]*o,d=e[8]*i,p=e[9]*s,m=e[10]*o,g=a+l+m,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(f-p)/v,t[1]=(d-h)/v,t[2]=(u-c)/v):a>l&&a>m?(v=2*Math.sqrt(1+a-l-m),t[3]=(f-p)/v,t[0]=.25*v,t[1]=(u+c)/v,t[2]=(d+h)/v):l>m?(v=2*Math.sqrt(1+l-a-m),t[3]=(d-h)/v,t[0]=(u+c)/v,t[1]=.25*v,t[2]=(f+p)/v):(v=2*Math.sqrt(1+m-a-l),t[3]=(u-c)/v,t[0]=(d+h)/v,t[1]=(f+p)/v,t[2]=.25*v),t}function B(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3],u=i+i,h=s+s,c=o+o,l=i*u,f=i*h,d=i*c,p=s*h,m=s*c,g=o*c,v=a*u,y=a*h,b=a*c,w=n[0],M=n[1],x=n[2];return t[0]=(1-(p+g))*w,t[1]=(f+b)*w,t[2]=(d-y)*w,t[3]=0,t[4]=(f-b)*M,t[5]=(1-(l+g))*M,t[6]=(m+v)*M,t[7]=0,t[8]=(d+y)*x,t[9]=(m-v)*x,t[10]=(1-(l+p))*x,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function R(t,e,r,n,i){var s=e[0],o=e[1],a=e[2],u=e[3],h=s+s,c=o+o,l=a+a,f=s*h,d=s*c,p=s*l,m=o*c,g=o*l,v=a*l,y=u*h,b=u*c,w=u*l,M=n[0],x=n[1],_=n[2],S=i[0],P=i[1],A=i[2],O=(1-(m+v))*M,E=(d+w)*M,k=(p-b)*M,I=(d-w)*x,C=(1-(f+v))*x,B=(g+y)*x,R=(p+b)*_,T=(g-y)*_,L=(1-(f+m))*_;return t[0]=O,t[1]=E,t[2]=k,t[3]=0,t[4]=I,t[5]=C,t[6]=B,t[7]=0,t[8]=R,t[9]=T,t[10]=L,t[11]=0,t[12]=r[0]+S-(O*S+I*P+R*A),t[13]=r[1]+P-(E*S+C*P+T*A),t[14]=r[2]+A-(k*S+B*P+L*A),t[15]=1,t}function T(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,u=i+i,h=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*u,m=s*o,g=s*a,v=s*u;return t[0]=1-l-p,t[1]=c+v,t[2]=f-g,t[3]=0,t[4]=c-v,t[5]=1-h-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-h-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function L(t,e,r,n,i,s,o){var a=1/(r-e),u=1/(i-n),h=1/(s-o);return t[0]=2*s*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*u,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*u,t[10]=(o+s)*h,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*h,t[15]=0,t}function F(t,e,r,n,i){var s,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(s=1/(n-i),t[10]=(i+n)*s,t[14]=2*i*n*s):(t[10]=-1,t[14]=-2*n),t}function j(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),u=2/(o+a),h=2/(i+s);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=h,t[6]=0,t[7]=0,t[8]=-(o-a)*u*.5,t[9]=(i-s)*h*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function D(t,e,r,n,i,s,o){var a=1/(e-r),u=1/(n-i),h=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*u,t[14]=(o+s)*h,t[15]=1,t}function z(t,e,r,i){var s,o,a,u,c,l,f,d,p,m,g=e[0],v=e[1],y=e[2],b=i[0],w=i[1],M=i[2],x=r[0],_=r[1],S=r[2];return Math.abs(g-x)0&&(c*=d=1/Math.sqrt(d),l*=d,f*=d);var p=u*f-h*l,m=h*c-a*f,g=a*l-u*c;return(d=p*p+m*m+g*g)>0&&(p*=d=1/Math.sqrt(d),m*=d,g*=d),t[0]=p,t[1]=m,t[2]=g,t[3]=0,t[4]=l*g-f*m,t[5]=f*p-c*g,t[6]=c*m-l*p,t[7]=0,t[8]=c,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=s,t[14]=o,t[15]=1,t}function N(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function U(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Y(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function V(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function Z(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function G(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function $(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function X(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],u=t[5],h=t[6],c=t[7],l=t[8],f=t[9],d=t[10],p=t[11],m=t[12],g=t[13],v=t[14],y=t[15],b=e[0],w=e[1],M=e[2],x=e[3],_=e[4],S=e[5],P=e[6],A=e[7],O=e[8],E=e[9],k=e[10],I=e[11],C=e[12],B=e[13],R=e[14],T=e[15];return Math.abs(r-b)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-w)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(w))&&Math.abs(s-M)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(o-x)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(a-_)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(u-S)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(h-P)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(c-A)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(l-O)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(f-E)<=n.EPSILON*Math.max(1,Math.abs(f),Math.abs(E))&&Math.abs(d-k)<=n.EPSILON*Math.max(1,Math.abs(d),Math.abs(k))&&Math.abs(p-I)<=n.EPSILON*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(m-C)<=n.EPSILON*Math.max(1,Math.abs(m),Math.abs(C))&&Math.abs(g-B)<=n.EPSILON*Math.max(1,Math.abs(g),Math.abs(B))&&Math.abs(v-R)<=n.EPSILON*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(y-T)<=n.EPSILON*Math.max(1,Math.abs(y),Math.abs(T))}var H=p,W=V},(t,e,r)=>{"use strict";r.r(e),r.d(e,{create:()=>a,identity:()=>u,setAxisAngle:()=>h,getAxisAngle:()=>c,getAngle:()=>l,multiply:()=>f,rotateX:()=>d,rotateY:()=>p,rotateZ:()=>m,calculateW:()=>g,exp:()=>v,ln:()=>y,pow:()=>b,slerp:()=>w,random:()=>M,invert:()=>x,conjugate:()=>_,fromMat3:()=>S,fromEuler:()=>P,str:()=>A,clone:()=>R,fromValues:()=>T,copy:()=>L,set:()=>F,add:()=>j,mul:()=>D,scale:()=>z,dot:()=>q,lerp:()=>N,length:()=>U,len:()=>Y,squaredLength:()=>V,sqrLen:()=>Z,normalize:()=>G,exactEquals:()=>$,equals:()=>X,rotationTo:()=>H,sqlerp:()=>W,setAxes:()=>J});var n=r(11),i=r(14),s=r(18),o=r(17);function a(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function u(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function h(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function c(t,e){var r=2*Math.acos(e[3]),i=Math.sin(r/2);return i>n.EPSILON?(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i):(t[0]=1,t[1]=0,t[2]=0),r}function l(t,e){var r=q(t,e);return Math.acos(2*r*r-1)}function f(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*c+o*a+i*h-s*u,t[1]=i*c+o*u+s*a-n*h,t[2]=s*c+o*h+n*u-i*a,t[3]=o*c-n*a-i*u-s*h,t}function d(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u+o*a,t[1]=i*u+s*a,t[2]=s*u-i*a,t[3]=o*u-n*a,t}function p(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u-s*a,t[1]=i*u+o*a,t[2]=s*u+n*a,t[3]=o*u-i*a,t}function m(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u+i*a,t[1]=i*u-n*a,t[2]=s*u+o*a,t[3]=o*u-s*a,t}function g(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function v(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=Math.exp(s),u=o>0?a*Math.sin(o)/o:0;return t[0]=r*u,t[1]=n*u,t[2]=i*u,t[3]=a*Math.cos(o),t}function y(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=o>0?Math.atan2(o,s)/o:0;return t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=.5*Math.log(r*r+n*n+i*i+s*s),t}function b(t,e,r){return y(t,e),z(t,t,r),v(t,t),t}function w(t,e,r,i){var s,o,a,u,h,c=e[0],l=e[1],f=e[2],d=e[3],p=r[0],m=r[1],g=r[2],v=r[3];return(o=c*p+l*m+f*g+d*v)<0&&(o=-o,p=-p,m=-m,g=-g,v=-v),1-o>n.EPSILON?(s=Math.acos(o),a=Math.sin(s),u=Math.sin((1-i)*s)/a,h=Math.sin(i*s)/a):(u=1-i,h=i),t[0]=u*c+h*p,t[1]=u*l+h*m,t[2]=u*f+h*g,t[3]=u*d+h*v,t}function M(t){var e=n.RANDOM(),r=n.RANDOM(),i=n.RANDOM(),s=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=s*Math.sin(2*Math.PI*r),t[1]=s*Math.cos(2*Math.PI*r),t[2]=o*Math.sin(2*Math.PI*i),t[3]=o*Math.cos(2*Math.PI*i),t}function x(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s,a=o?1/o:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=s*a,t}function _(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function S(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var s=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*s+s]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*s+o]-e[3*o+s])*r,t[s]=(e[3*s+i]+e[3*i+s])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t}function P(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var s=Math.sin(e),o=Math.cos(e),a=Math.sin(r),u=Math.cos(r),h=Math.sin(n),c=Math.cos(n);return t[0]=s*u*c-o*a*h,t[1]=o*a*c+s*u*h,t[2]=o*u*h-s*a*c,t[3]=o*u*c+s*a*h,t}function A(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var O,E,k,I,C,B,R=o.clone,T=o.fromValues,L=o.copy,F=o.set,j=o.add,D=f,z=o.scale,q=o.dot,N=o.lerp,U=o.length,Y=U,V=o.squaredLength,Z=V,G=o.normalize,$=o.exactEquals,X=o.equals,H=(O=s.create(),E=s.fromValues(1,0,0),k=s.fromValues(0,1,0),function(t,e,r){var n=s.dot(e,r);return n<-.999999?(s.cross(O,E,e),s.len(O)<1e-6&&s.cross(O,k,e),s.normalize(O,O),h(t,O,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(s.cross(O,e,r),t[0]=O[0],t[1]=O[1],t[2]=O[2],t[3]=1+n,G(t,t))}),W=(I=a(),C=a(),function(t,e,r,n,i,s){return w(I,e,i,s),w(C,r,n,s),w(t,I,C,2*s*(1-s)),t}),J=(B=i.create(),function(t,e,r,n){return B[0]=r[0],B[3]=r[1],B[6]=r[2],B[1]=n[0],B[4]=n[1],B[7]=n[2],B[2]=-e[0],B[5]=-e[1],B[8]=-e[2],G(t,S(t,B))})},(t,e,r)=>{"use strict";r.r(e),r.d(e,{create:()=>i,clone:()=>s,fromValues:()=>o,copy:()=>a,set:()=>u,add:()=>h,subtract:()=>c,multiply:()=>l,divide:()=>f,ceil:()=>d,floor:()=>p,min:()=>m,max:()=>g,round:()=>v,scale:()=>y,scaleAndAdd:()=>b,distance:()=>w,squaredDistance:()=>M,length:()=>x,squaredLength:()=>_,negate:()=>S,inverse:()=>P,normalize:()=>A,dot:()=>O,cross:()=>E,lerp:()=>k,random:()=>I,transformMat4:()=>C,transformQuat:()=>B,zero:()=>R,str:()=>T,exactEquals:()=>L,equals:()=>F,sub:()=>D,mul:()=>z,div:()=>q,dist:()=>N,sqrDist:()=>U,len:()=>Y,sqrLen:()=>V,forEach:()=>Z});var n=r(11);function i(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function s(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(t,e,r,i){var s=new n.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=r,s[3]=i,s}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function u(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function h(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function l(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}function f(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function m(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}function g(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}function v(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function y(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function b(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}function w(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return Math.hypot(r,n,i,s)}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return r*r+n*n+i*i+s*s}function x(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}function _(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function P(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function A(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s;return o>0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=s*o,t}function O(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function E(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],s=r[0]*n[2]-r[2]*n[0],o=r[0]*n[3]-r[3]*n[0],a=r[1]*n[2]-r[2]*n[1],u=r[1]*n[3]-r[3]*n[1],h=r[2]*n[3]-r[3]*n[2],c=e[0],l=e[1],f=e[2],d=e[3];return t[0]=l*h-f*u+d*a,t[1]=-c*h+f*o-d*s,t[2]=c*u-l*o+d*i,t[3]=-c*a+l*s-f*i,t}function k(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t[3]=a+n*(r[3]-a),t}function I(t,e){var r,i,s,o,a,u;e=e||1;do{a=(r=2*n.RANDOM()-1)*r+(i=2*n.RANDOM()-1)*i}while(a>=1);do{u=(s=2*n.RANDOM()-1)*s+(o=2*n.RANDOM()-1)*o}while(u>=1);var h=Math.sqrt((1-a)/u);return t[0]=e*r,t[1]=e*i,t[2]=e*s*h,t[3]=e*o*h,t}function C(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*s+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*s+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*s+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*s+r[15]*o,t}function B(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],u=r[2],h=r[3],c=h*n+a*s-u*i,l=h*i+u*n-o*s,f=h*s+o*i-a*n,d=-o*n-a*i-u*s;return t[0]=c*h+d*-o+l*-u-f*-a,t[1]=l*h+d*-a+f*-o-c*-u,t[2]=f*h+d*-u+c*-a-l*-o,t[3]=e[3],t}function R(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function T(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function L(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function F(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=e[0],u=e[1],h=e[2],c=e[3];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-u)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(s-h)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(h))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}var j,D=c,z=l,q=f,N=w,U=M,Y=x,V=_,Z=(j=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=4),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{"use strict";r.r(e),r.d(e,{create:()=>i,clone:()=>s,length:()=>o,fromValues:()=>a,copy:()=>u,set:()=>h,add:()=>c,subtract:()=>l,multiply:()=>f,divide:()=>d,ceil:()=>p,floor:()=>m,min:()=>g,max:()=>v,round:()=>y,scale:()=>b,scaleAndAdd:()=>w,distance:()=>M,squaredDistance:()=>x,squaredLength:()=>_,negate:()=>S,inverse:()=>P,normalize:()=>A,dot:()=>O,cross:()=>E,lerp:()=>k,hermite:()=>I,bezier:()=>C,random:()=>B,transformMat4:()=>R,transformMat3:()=>T,transformQuat:()=>L,rotateX:()=>F,rotateY:()=>j,rotateZ:()=>D,angle:()=>z,zero:()=>q,str:()=>N,exactEquals:()=>U,equals:()=>Y,sub:()=>Z,mul:()=>G,div:()=>$,dist:()=>X,sqrDist:()=>H,len:()=>W,sqrLen:()=>J,forEach:()=>Q});var n=r(11);function i(){var t=new n.ARRAY_TYPE(3);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function s(t){var e=new n.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function o(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function a(t,e,r){var i=new n.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=r,i}function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function h(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function c(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function l(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function f(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function d(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function p(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function m(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function g(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function v(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function y(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function b(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function w(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function x(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function _(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function P(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function A(t,e){var r=e[0],n=e[1],i=e[2],s=r*r+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function O(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function E(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],u=r[2];return t[0]=i*u-s*a,t[1]=s*o-n*u,t[2]=n*a-i*o,t}function k(t,e,r,n){var i=e[0],s=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t}function I(t,e,r,n,i,s){var o=s*s,a=o*(2*s-3)+1,u=o*(s-2)+s,h=o*(s-1),c=o*(3-2*s);return t[0]=e[0]*a+r[0]*u+n[0]*h+i[0]*c,t[1]=e[1]*a+r[1]*u+n[1]*h+i[1]*c,t[2]=e[2]*a+r[2]*u+n[2]*h+i[2]*c,t}function C(t,e,r,n,i,s){var o=1-s,a=o*o,u=s*s,h=a*o,c=3*s*a,l=3*u*o,f=u*s;return t[0]=e[0]*h+r[0]*c+n[0]*l+i[0]*f,t[1]=e[1]*h+r[1]*c+n[1]*l+i[1]*f,t[2]=e[2]*h+r[2]*c+n[2]*l+i[2]*f,t}function B(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,s=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*s,t[1]=Math.sin(r)*s,t[2]=i*e,t}function R(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[3]*n+r[7]*i+r[11]*s+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*s+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*s+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*s+r[14])/o,t}function T(t,e,r){var n=e[0],i=e[1],s=e[2];return t[0]=n*r[0]+i*r[3]+s*r[6],t[1]=n*r[1]+i*r[4]+s*r[7],t[2]=n*r[2]+i*r[5]+s*r[8],t}function L(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],u=e[1],h=e[2],c=i*h-s*u,l=s*a-n*h,f=n*u-i*a,d=i*f-s*l,p=s*c-n*f,m=n*l-i*c,g=2*o;return c*=g,l*=g,f*=g,d*=2,p*=2,m*=2,t[0]=a+c+d,t[1]=u+l+p,t[2]=h+f+m,t}function F(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0],s[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),s[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function j(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),s[1]=i[1],s[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function D(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),s[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),s[2]=i[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function z(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2],u=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(s*s+o*o+a*a),h=u&&O(t,e)/u;return Math.acos(Math.min(Math.max(h,-1),1))}function q(t){return t[0]=0,t[1]=0,t[2]=0,t}function N(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function U(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Y(t,e){var r=t[0],i=t[1],s=t[2],o=e[0],a=e[1],u=e[2];return Math.abs(r-o)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-a)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(s-u)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))}var V,Z=l,G=f,$=d,X=M,H=x,W=o,J=_,Q=(V=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=3),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{"use strict";r.r(e),r.d(e,{create:()=>o,clone:()=>a,fromValues:()=>u,fromRotationTranslationValues:()=>h,fromRotationTranslation:()=>c,fromTranslation:()=>l,fromRotation:()=>f,fromMat4:()=>d,copy:()=>p,identity:()=>m,set:()=>g,getReal:()=>v,getDual:()=>y,setReal:()=>b,setDual:()=>w,getTranslation:()=>M,translate:()=>x,rotateX:()=>_,rotateY:()=>S,rotateZ:()=>P,rotateByQuatAppend:()=>A,rotateByQuatPrepend:()=>O,rotateAroundAxis:()=>E,add:()=>k,multiply:()=>I,mul:()=>C,scale:()=>B,dot:()=>R,lerp:()=>T,invert:()=>L,conjugate:()=>F,length:()=>j,len:()=>D,squaredLength:()=>z,sqrLen:()=>q,normalize:()=>N,str:()=>U,exactEquals:()=>Y,equals:()=>V});var n=r(11),i=r(16),s=r(15);function o(){var t=new n.ARRAY_TYPE(8);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function a(t){var e=new n.ARRAY_TYPE(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function u(t,e,r,i,s,o,a,u){var h=new n.ARRAY_TYPE(8);return h[0]=t,h[1]=e,h[2]=r,h[3]=i,h[4]=s,h[5]=o,h[6]=a,h[7]=u,h}function h(t,e,r,i,s,o,a){var u=new n.ARRAY_TYPE(8);u[0]=t,u[1]=e,u[2]=r,u[3]=i;var h=.5*s,c=.5*o,l=.5*a;return u[4]=h*i+c*r-l*e,u[5]=c*i+l*t-h*r,u[6]=l*i+h*e-c*t,u[7]=-h*t-c*e-l*r,u}function c(t,e,r){var n=.5*r[0],i=.5*r[1],s=.5*r[2],o=e[0],a=e[1],u=e[2],h=e[3];return t[0]=o,t[1]=a,t[2]=u,t[3]=h,t[4]=n*h+i*u-s*a,t[5]=i*h+s*o-n*u,t[6]=s*h+n*a-i*o,t[7]=-n*o-i*a-s*u,t}function l(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function d(t,e){var r=i.create();s.getRotation(r,e);var o=new n.ARRAY_TYPE(3);return s.getTranslation(o,e),c(t,r,o),t}function p(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function m(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function g(t,e,r,n,i,s,o,a,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=u,t}var v=i.copy;function y(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var b=i.copy;function w(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function M(t,e){var r=e[4],n=e[5],i=e[6],s=e[7],o=-e[0],a=-e[1],u=-e[2],h=e[3];return t[0]=2*(r*h+s*o+n*u-i*a),t[1]=2*(n*h+s*a+i*o-r*u),t[2]=2*(i*h+s*u+r*a-n*o),t}function x(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=.5*r[0],u=.5*r[1],h=.5*r[2],c=e[4],l=e[5],f=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=o*a+i*h-s*u+c,t[5]=o*u+s*a-n*h+l,t[6]=o*h+n*u-i*a+f,t[7]=-n*a-i*u-s*h+d,t}function _(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],u=e[4],h=e[5],c=e[6],l=e[7],f=u*a+l*n+h*o-c*s,d=h*a+l*s+c*n-u*o,p=c*a+l*o+u*s-h*n,m=l*a-u*n-h*s-c*o;return i.rotateX(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function S(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],u=e[4],h=e[5],c=e[6],l=e[7],f=u*a+l*n+h*o-c*s,d=h*a+l*s+c*n-u*o,p=c*a+l*o+u*s-h*n,m=l*a-u*n-h*s-c*o;return i.rotateY(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function P(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],u=e[4],h=e[5],c=e[6],l=e[7],f=u*a+l*n+h*o-c*s,d=h*a+l*s+c*n-u*o,p=c*a+l*o+u*s-h*n,m=l*a-u*n-h*s-c*o;return i.rotateZ(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function A(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],u=e[1],h=e[2],c=e[3];return t[0]=a*o+c*n+u*s-h*i,t[1]=u*o+c*i+h*n-a*s,t[2]=h*o+c*s+a*i-u*n,t[3]=c*o-a*n-u*i-h*s,a=e[4],u=e[5],h=e[6],c=e[7],t[4]=a*o+c*n+u*s-h*i,t[5]=u*o+c*i+h*n-a*s,t[6]=h*o+c*s+a*i-u*n,t[7]=c*o-a*n-u*i-h*s,t}function O(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*c+o*a+i*h-s*u,t[1]=i*c+o*u+s*a-n*h,t[2]=s*c+o*h+n*u-i*a,t[3]=o*c-n*a-i*u-s*h,a=r[4],u=r[5],h=r[6],c=r[7],t[4]=n*c+o*a+i*h-s*u,t[5]=i*c+o*u+s*a-n*h,t[6]=s*c+o*h+n*u-i*a,t[7]=o*c-n*a-i*u-s*h,t}function E(t,e,r,i){if(Math.abs(i)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,s=e[2]/r,o=e[3]/r,a=e[4],u=e[5],h=e[6],c=e[7],l=n*a+i*u+s*h+o*c;t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=(a-n*l)/r,t[5]=(u-i*l)/r,t[6]=(h-s*l)/r,t[7]=(c-o*l)/r}return t}function U(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function Y(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function V(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],u=t[5],h=t[6],c=t[7],l=e[0],f=e[1],d=e[2],p=e[3],m=e[4],g=e[5],v=e[6],y=e[7];return Math.abs(r-l)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(i-f)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(s-d)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(o-p)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-m)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(u-g)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(h-v)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(v))&&Math.abs(c-y)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(y))}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{create:()=>i,clone:()=>s,fromValues:()=>o,copy:()=>a,set:()=>u,add:()=>h,subtract:()=>c,multiply:()=>l,divide:()=>f,ceil:()=>d,floor:()=>p,min:()=>m,max:()=>g,round:()=>v,scale:()=>y,scaleAndAdd:()=>b,distance:()=>w,squaredDistance:()=>M,length:()=>x,squaredLength:()=>_,negate:()=>S,inverse:()=>P,normalize:()=>A,dot:()=>O,cross:()=>E,lerp:()=>k,random:()=>I,transformMat2:()=>C,transformMat2d:()=>B,transformMat3:()=>R,transformMat4:()=>T,rotate:()=>L,angle:()=>F,zero:()=>j,str:()=>D,exactEquals:()=>z,equals:()=>q,len:()=>U,sub:()=>Y,mul:()=>V,div:()=>Z,dist:()=>G,sqrDist:()=>$,sqrLen:()=>X,forEach:()=>H});var n=r(11);function i(){var t=new n.ARRAY_TYPE(2);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function s(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e}function o(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r}function a(t,e){return t[0]=e[0],t[1]=e[1],t}function u(t,e,r){return t[0]=e,t[1]=r,t}function h(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function l(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function f(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function m(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function g(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function v(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function y(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function b(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function w(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function x(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function _(t){var e=t[0],r=t[1];return e*e+r*r}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t}function P(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function A(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function O(t,e){return t[0]*e[0]+t[1]*e[1]}function E(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function k(t,e,r,n){var i=e[0],s=e[1];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t}function I(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function C(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function B(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function R(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function T(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function L(t,e,r,n){var i=e[0]-r[0],s=e[1]-r[1],o=Math.sin(n),a=Math.cos(n);return t[0]=i*a-s*o+r[0],t[1]=i*o+s*a+r[1],t}function F(t,e){var r=t[0],n=t[1],i=e[0],s=e[1],o=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+s*s),a=o&&(r*i+n*s)/o;return Math.acos(Math.min(Math.max(a,-1),1))}function j(t){return t[0]=0,t[1]=0,t}function D(t){return"vec2("+t[0]+", "+t[1]+")"}function z(t,e){return t[0]===e[0]&&t[1]===e[1]}function q(t,e){var r=t[0],i=t[1],s=e[0],o=e[1];return Math.abs(r-s)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-o)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))}var N,U=x,Y=c,V=l,Z=f,G=w,$=M,X=_,H=(N=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=2),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Scene=void 0;const n=r(22),i=r(23),s=r(32),o=r(30);class a{constructor(t={}){this.width=400,this.height=400,this.background="hsla(0, 0%, 0%, 1)",this.color="hsla(0, 0%, 100%, 1)",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?(.5+.5*o.clamp(-1,1,t.anchor[0]))*this.width:"left"===t.anchor[0]?0:"right"===t.anchor[0]?this.width:this.center[0],"number"==typeof t.anchor[1]?(.5+.5*o.clamp(-1,1,t.anchor[1]))*this.height:"top"===t.anchor[1]?0:"bottom"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e="number"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,a.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{a.propagateToChilden(t,e)})):t instanceof s.Shape&&t.shape&&(t.shape.scene=e,a.propagateToChilden(t.shape,e))}}e.Scene=a},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||"SceneChild",this.name=t.name||this.type+"_"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){"string"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Group=void 0;const n=r(21),i=r(22),s=r(24),o=r(28);class a extends i.SceneChild{constructor(t={}){t.type="Group",super(t),this.children=[],["id","name","data","order","type"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=o.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){"object"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=a},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBase=void 0;const n=r(10),i=r(1),s=r(25),o=r(26),a=r(27),u=r(28),h=r(30),c=r(22),l=n.mat4.create(),f=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class m extends c.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?-1*h.clamp(-1,1,t.anchor[0]):"left"===t.anchor[0]?1:"right"===t.anchor[0]?-1:0,"number"==typeof t.anchor[1]?-1*h.clamp(-1,1,t.anchor[1]):"top"===t.anchor[1]?1:"bottom"===t.anchor[1]?-1:0]:[0,0],this.boundingType="string"==typeof t.boundingType?"relative"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return"function"!=typeof t.repetitions&&"function"!=typeof t.distance&&"function"!=typeof t.displace&&"function"!=typeof t.scale&&"function"!=typeof t.translate&&"function"!=typeof t.skewX&&"function"!=typeof t.skewY&&"function"!=typeof t.squeezeX&&"function"!=typeof t.squeezeY&&"function"!=typeof t.rotateX&&"function"!=typeof t.rotateY&&"function"!=typeof t.rotateZ&&"function"!=typeof t.transformOrigin&&"function"!=typeof t.perspective&&"function"!=typeof t.perspectiveOrigin}isStaticIndexed(){return"function"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return"function"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){"string"==typeof t?(r=r||"repetitions"==t,this.props[t]=e):(r=r||"repetitions"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var c,g;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const v=m.getEmptyPropArguments(this,r),y=v.repetition,b=this.getProp("repetitions",v,1),w=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,M=Array.isArray(b)?b[0]*(null!==(c=b[1])&&void 0!==c?c:b[0]):b,x=Array.isArray(b)?b[0]:M,_=Array.isArray(b)?null!==(g=b[1])&&void 0!==g?g:b[0]:1,S=y.row;S.count=x;const P=y.col;P.count=_,y.count=M,y.col.count=_,y.row.count=x,y.type=w;let A=0;const O=[];let E=0;const k=n.vec2.fromValues((_-1)/2,(x-1)/2),I=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],C=[void 0,void 0,void 0,void 0],B=[void 0,void 0,void 0,void 0];for(let r=0;r1?E/(M-1):1,y.angle=w===i.ERepetitionType.Ring?a.PI2/M*E:0,P.index=c+1,P.offset=_>1?c/(_-1):1,S.index=r+1,S.offset=x>1?r/(x-1):1;const m=this.generateBuffer(t,v),g=m.length,b=this.getShapeBounding();O[E]=new Float32Array(g),A+=g;{const t=s.toVec2(this.getProp("distance",v,s.VEC2_ZERO)),a=this.getProp("displace",v,0),M=s.toVec3(this.getProp("scale",v,s.VEC2_ONE),1),x=s.toVec3(this.getProp("translate",v,s.VEC2_ZERO),0),_=this.getProp("skewX",v,0),S=this.getProp("skewY",v,0),P=this.getProp("squeezeX",v,0),A=this.getProp("squeezeY",v,0),R=this.getProp("rotateX",v,0),T=this.getProp("rotateY",v,0),L=this.getProp("rotateZ",v,0),F=h.clamp(0,1,this.getProp("perspective",v,0)),j=s.toVec3(this.getProp("perspectiveOrigin",v,s.VEC2_ZERO),0),D=s.toVec3(this.getProp("transformOrigin",v,s.VEC2_ZERO),0);let z;switch(w){case i.ERepetitionType.Ring:z=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(z,z,s.VEC3_ZERO,y.angle+a);break;case i.ERepetitionType.Matrix:z=n.vec3.fromValues(t[1]*(c-k[0]),t[0]*(r-k[1]),0)}const q=F>0?Math.max(b.width,b.height)/2:1,N=F>0?q+10*q*(1-F):0,U=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==F||0!==D[0]||0!==D[1],Y=0!==j[0]||0!==j[1];U&&(this.boundingType===i.EBoundingType.Relative?(D[0]=D[0]*(b.width/2)+b.cx,D[1]=D[1]*(b.height/2)+b.cy):(D[0]*=b.width/2,D[1]*=b.height/2),D[2]=N);{n.mat4.identity(f),U&&n.mat4.translate(f,f,D),0===x[0]&&0===x[1]||n.mat4.translate(f,f,x),0===_&&0===S||(s.fromSkew(l,[_,S]),n.mat4.multiply(f,f,l)),0!==R&&n.mat4.rotateX(f,f,R),0!==T&&n.mat4.rotateY(f,f,T),0!==L&&n.mat4.rotateZ(f,f,L),1===M[0]&&1===M[1]||n.mat4.scale(f,f,M),U&&n.mat4.translate(f,f,n.vec3.scale(D,D,-1)),N>0&&(Y&&(this.boundingType===i.EBoundingType.Relative?(j[0]=j[0]*(b.width/2)+b.cx,j[1]=j[1]*(b.height/2)+b.cy):(j[0]*=b.width/2,j[1]*=b.height/2),j[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,z),e&&n.mat4.translate(p,p,I);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),w===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,y.angle+a)}u.Bounding.clear(B);for(let t=0;t0&&(Y&&n.vec3.add(e,e,j),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,N),Y&&n.vec3.sub(e,e,j)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=g/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,v)}O[E][t]=e[0],O[E][t+1]=e[1],u.Bounding.add(B,e[0],e[1]),u.Bounding.add(C,e[0],e[1])}}const R={cx:0,cy:0,x:-1,y:-1,width:2,height:2};u.Bounding.bind(R,B),this.bStaticIndexed&&this.bIndexed||this.addIndex(g,y,R)}u.Bounding.bind(this.bounding,C),this.buffer=new Float32Array(A);for(let t=0,e=0,r=O.length;t({index:1,offset:1,count:1}),m.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...m.getEmptySimpleRepetition(),row:m.getEmptySimpleRepetition(),col:m.getEmptySimpleRepetition()})},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(10);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return"number"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(29);var i;!function(t){t[t.None=0]="None",t[t.Scale=2]="Scale",t[t.Center=4]="Center",t[t.Fill=8]="Fill"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn("[Urplfanze:Bounding] cannot sum bounding")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn("[Urplfanze:Bounding] cannot bind bounding")}};class s extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return s.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=s.getBounding(t));const o=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,a=e>=i.Center?r.cx:0,u=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(31),i=r(4),s=r(26),o="undefined"!=typeof performance?performance:Date;function a(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return o.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=a,e.relativeClamp=function(t,e,r,n,i){return a(n,i,(r-t)/(e-t)*(i-n)+n)};const u={random:new n(Math.random)};e.noise=function(t="random",e=0,r=0,i=0){return void 0===u[t]&&(u[t]=new n(t)),u[t].noise3D(e,r,i)};const h={};function c(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),s=rn?[s,o]:[o,s]}function l(t,e){const r=t.length,n=r/2,i=2*(n+e),s=n-1;if(s>1){const n=r-2,o=Math.floor(e/s);let a=(i-(r+o*n))/2;const u=Math.round(s/a),h=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%u==0||e===n-2),p=o+(d?1:0),m=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);h[i]=(s=t(),o=t(),a=t(),u=t(),function(){let t=(s>>>=0)+(o>>>=0)|0;return s=o^o>>>9,o=(a>>>=0)+(a<<3)|0,t=t+(u=1+(u>>>=0)|0)|0,a=(a=a<<21|a>>>11)+t|0,(t>>>0)/4294967296})}var s,o,a,u;const c=e+h[i]()*(r-e);return void 0!==n?Math.round(c*10**n)/10**n:c},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return s.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=c,e.interpolate=function(t,e,r=.5){const[n,i]=c(t,e),s=Math.max(n.length,i.length),o="number"==typeof r?[r]:r,a=s/2;if(o.length!==a){const t=o.length;for(let e=0;e{var n;!function(){"use strict";var i=.5*(Math.sqrt(3)-1),s=(3-Math.sqrt(3))/6,o=1/6,a=(Math.sqrt(5)-1)/4,u=(5-Math.sqrt(5))/20;function h(t){var e;e="function"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=l();t=i(" "),e=i(" "),r=i(" ");for(var s=0;s>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}h.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,o=this.permMod12,a=this.perm,u=this.grad3,h=0,c=0,l=0,f=(t+e)*i,d=Math.floor(t+f),p=Math.floor(e+f),m=(d+p)*s,g=t-(d-m),v=e-(p-m);g>v?(r=1,n=0):(r=0,n=1);var y=g-r+s,b=v-n+s,w=g-1+2*s,M=v-1+2*s,x=255&d,_=255&p,S=.5-g*g-v*v;if(S>=0){var P=3*o[x+a[_]];h=(S*=S)*S*(u[P]*g+u[P+1]*v)}var A=.5-y*y-b*b;if(A>=0){var O=3*o[x+r+a[_+n]];c=(A*=A)*A*(u[O]*y+u[O+1]*b)}var E=.5-w*w-M*M;if(E>=0){var k=3*o[x+1+a[_+1]];l=(E*=E)*E*(u[k]*w+u[k+1]*M)}return 70*(h+c+l)},noise3D:function(t,e,r){var n,i,s,a,u,h,c,l,f,d,p=this.permMod12,m=this.perm,g=this.grad3,v=.3333333333333333*(t+e+r),y=Math.floor(t+v),b=Math.floor(e+v),w=Math.floor(r+v),M=(y+b+w)*o,x=t-(y-M),_=e-(b-M),S=r-(w-M);x>=_?_>=S?(u=1,h=0,c=0,l=1,f=1,d=0):x>=S?(u=1,h=0,c=0,l=1,f=0,d=1):(u=0,h=0,c=1,l=1,f=0,d=1):_B?L++:F++,C>R?L++:j++,C>T?L++:D++,B>R?F++:j++,B>T?F++:D++,R>T?j++:D++;var z=C-(l=L>=3?1:0)+u,q=B-(f=F>=3?1:0)+u,N=R-(d=j>=3?1:0)+u,U=T-(p=D>=3?1:0)+u,Y=C-(m=L>=2?1:0)+2*u,V=B-(g=F>=2?1:0)+2*u,Z=R-(v=j>=2?1:0)+2*u,G=T-(y=D>=2?1:0)+2*u,$=C-(b=L>=1?1:0)+3*u,X=B-(w=F>=1?1:0)+3*u,H=R-(M=j>=1?1:0)+3*u,W=T-(x=D>=1?1:0)+3*u,J=C-1+4*u,Q=B-1+4*u,K=R-1+4*u,tt=T-1+4*u,et=255&A,rt=255&O,nt=255&E,it=255&k,st=.6-C*C-B*B-R*R-T*T;if(st<0)i=0;else{var ot=_[et+_[rt+_[nt+_[it]]]]%32*4;i=(st*=st)*st*(S[ot]*C+S[ot+1]*B+S[ot+2]*R+S[ot+3]*T)}var at=.6-z*z-q*q-N*N-U*U;if(at<0)s=0;else{var ut=_[et+l+_[rt+f+_[nt+d+_[it+p]]]]%32*4;s=(at*=at)*at*(S[ut]*z+S[ut+1]*q+S[ut+2]*N+S[ut+3]*U)}var ht=.6-Y*Y-V*V-Z*Z-G*G;if(ht<0)o=0;else{var ct=_[et+m+_[rt+g+_[nt+v+_[it+y]]]]%32*4;o=(ht*=ht)*ht*(S[ct]*Y+S[ct+1]*V+S[ct+2]*Z+S[ct+3]*G)}var lt=.6-$*$-X*X-H*H-W*W;if(lt<0)h=0;else{var ft=_[et+b+_[rt+w+_[nt+M+_[it+x]]]]%32*4;h=(lt*=lt)*lt*(S[ft]*$+S[ft+1]*X+S[ft+2]*H+S[ft+3]*W)}var dt=.6-J*J-Q*Q-K*K-tt*tt;if(dt<0)c=0;else{var pt=_[et+1+_[rt+1+_[nt+1+_[it+1]]]]%32*4;c=(dt*=dt)*dt*(S[pt]*J+S[pt+1]*Q+S[pt+2]*K+S[pt+3]*tt)}return 27*(i+s+o+h+c)}},h._buildPermutationTable=c,void 0===(n=function(){return h}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=h,t.exports=h}()},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=void 0;const n=r(21),i=r(22),s=r(24);class o extends s.ShapeBase{constructor(t){t.type=t.type||"Shape",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn("[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\nYou passed:",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):o.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapePrimitive=void 0;const n=r(25),i=r(24),s=r(29),o=r(28);class a extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=o.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:"function"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return"function"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:"number"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp("sideLength",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeLoop=void 0;const n=r(27),i=r(28),s=r(33),o=r(24);class a extends s.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||"ShapeLoop",super(t),this.loopDependencies=(t.loopDependencies||[]).concat("sideLength"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes("propArguments"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}"loop"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||o.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?("function"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),s=this.getRepetitionSideLength(t),o=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,a={index:0,offset:0,current:0,count:n},u=a.count,h=new Float32Array(2*u);for(let n=0,i=0;n1?n/(a.count-1):1;a.current=s,a.index=n+1,a.offset=u;const c=o(a,t);h[i]=c[0],h[i+1]=c[1]}const c=[void 0,void 0,void 0,void 0],l=this.applyModifiers(h,t);for(let t=0,e=l.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBuffer=void 0;const n=r(28),i=r(33);class s extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||"ShapeBuffer",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn("[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property"),this.shape=s.EMPTY_BUFFER):this.shape="function"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return"function"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from("function"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,s=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&"function"!=typeof this.props.sideLength&&"function"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=s},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeRecursive=void 0;const n=r(32);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeRecursive",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionScale&&"function"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp("recursions",e,1)),n=Math.floor(this.getProp("recursionVertex",e,0)),s=this.getProp("recursionScale",e,2),o=this.shape;let a={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const u={...e,recursion:a};o.generate(t,!1,u);const h=o.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=h);let c=h;const l=[a];let f=0,d=1;const p=c.length,m=p/2,g=n<=0?m:Math.min(n,m),v=0===n?1:m/Math.min(n,m),y=new Float32Array(i.summmation(r,g)*p);for(let t=0;t1?e/(r-1):1,h=i.summmation(e,g)*p,m=e-1,b=0===m?0:i.summmation(m,g)*p;for(let i=0,m=g**e;i1?i/(m-1):1,count:m,level:{index:e+1,offset:n,count:r},parent:l[f]},l.push(a),this.shapeUseRecursion&&(u.recursion=a,o.generate(t,!1,u),c=o.getBuffer());const w=h+i*p,M=Math.floor(b+2*i*v),x=y[M],_=y[M+1],S=s**e;for(let t=0,e=p;t1?0:1,count:s}}},u=this.shape.getIndexedBuffer()||[];for(let t=0,e=u.length;t1?0:1,count:s}},i={...a,recursion:r},o=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:o})}if(s>1){const t=this.shape.getBufferLength({...i,parent:{...a}})/2,e=o<=0?t:Math.min(o,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let h=0,c=1;for(let t=1;t1?t/(s-1):1;for(let o=0,l=e**t;o1?o/(l-1):1;for(let d=0,p=u.length;d{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeFollow=void 0;const n=r(32);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeFollow",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},s=this.shape;s.generate(t,!1,i);let o=s.getBuffer();const a=o.length,u=new Float32Array(a*(n.length/2)),h=n.length/2;for(let e=0;e1?e/(h-1):1,count:h};this.shapeUseFollow&&(i.follow=r,s.generate(t,!1,i),o=s.getBuffer());const c=e*a,l=2*e,f=n[l],d=n[l+1];for(let t=0,e=o.length;t1?t/(e-1):1;for(let o=0,a=s.length;o{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Line=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type="Line",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Triangle=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type="Triangle",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=s,s.buffer=[1,0,-1,1,-1,-1]},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Rect=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type="Rect",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=s,s.buffer=[1,1,-1,1,-1,-1,1,-1]},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Polygon=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["sideNumber"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp("sideNumber",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=s},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Circle=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type="Circle",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=s},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Star=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["spikes","innerRadius"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp("spikes",t,5),this.innerRadius=this.getProp("innerRadius",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=s},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Rose=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r;t.type="Rose",t.loopDependencies=(t.loopDependencies||[]).concat(["n","d"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>s.getFinalAngleFromK(this.getProp("n",t),this.getProp("d",t)),inc:t=>{const e=this.getProp("n",t),r=this.getProp("d",t),i=this.getRepetitionSideLength(t),s=Math.pow(i[0]*i[1],.45),o=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp("n",t)/this.getProp("d",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=s},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Spiral=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type="Spiral",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat(["twists","twistsStart","spiral"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:s.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp("twistsStart",t),end:t=>n.PI2*(this.getProp("twistsStart",t)+this.getProp("twists",t)),inc:t=>{const e=this.getProp("twists",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp("spiral",t),this.r=s.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case s.types.ARCHIMEDE:return t=>t/10;case s.types.HYPERBOLIC:return t=>1/t*3;case s.types.FERMAT:return t=>t**.5/3;case s.types.LITUUS:return t=>t**-.5;case s.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=s,s.types={ARCHIMEDE:"ARCHIMEDE",HYPERBOLIC:"HYPERBOLIC",FERMAT:"FERMAT",LITUUS:"LITUUS",LOGARITHMIC:"LOGARITHMIC"}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lissajous=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type="Lissajous",t.loopDependencies=(t.loopDependencies||[]).concat(["wx","wy","wz"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp("wx",t),r=this.getProp("wy",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),s=this.getRepetitionSideLength(t);return 1/Math.pow(s[0]*s[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp("wx",t,1),this.wy=this.getProp("wy",t,2),this.wz=this.getProp("wz",t,2),super.generateLoopBuffer(t)}}e.Lissajous=s},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SuperShape=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r,i,s,o,a;t.type="SuperShape",t.loopDependencies=(t.loopDependencies||[]).concat(["a","b","m","n1","n2","n3"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(s=t.n1)&&void 0!==s?s:1,this.props.n2=null!==(o=t.n2)&&void 0!==o?o:1,this.props.n3=null!==(a=t.n3)&&void 0!==a?a:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp("a",t),this.b=this.getProp("b",t),this.m=this.getProp("m",t),this.n1=this.getProp("n1",t),this.n2=this.getProp("n2",t),this.n3=this.getProp("n3",t),super.generateLoopBuffer(t)}}e.SuperShape=s},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Modifiers=void 0;const n=r(28),i=r(49),s=r(50),o=r(52),a=r(53),u=r(51),h=r(54),c={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:s.Smooth,Solidify:o.Solidify,Subdivide:a.Subdivide,Close:u.Close,Offset:h.Offset};e.Modifiers=c},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Mirror=void 0;const n=r(29);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let s=0;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Smooth=void 0;const n=r(30),i=r(51),s=r(29);class o extends s.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Close=void 0;const n=r(29);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Solidify=void 0;const n=r(29);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const s=[],o=(e="number"==typeof e?[e]:e).length;let a,u,h=[[0,0],[0,0]],c=[[0,0],[0,0]];for(let r=0,l=0,f=t.length-2;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Subdivide=void 0;const n=r(29);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Offset=void 0;const n=r(29);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i}],e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(0)})()},t.exports=e()},479:(t,e,r)=>{var n;!function(){"use strict";function i(t,e,r){var n=e.x,i=e.y,s=r.x-n,o=r.y-i;if(0!==s||0!==o){var a=((t.x-n)*s+(t.y-i)*o)/(s*s+o*o);a>1?(n=r.x,i=r.y):a>0&&(n+=s*a,i+=o*a)}return(s=t.x-n)*s+(o=t.y-i)*o}function s(t,e,r,n,o){for(var a,u=n,h=e+1;hu&&(a=h,u=c)}u>n&&(a-e>1&&s(t,e,a,n,o),o.push(t[a]),r-a>1&&s(t,a,r,n,o))}function o(t,e){var r=t.length-1,n=[t[0]];return s(t,0,r,e,n),n.push(t[r]),n}function a(t,e,r){if(t.length<=2)return t;var n=void 0!==e?e*e:1;return o(t=r?t:function(t,e){for(var r,n,i,s,o,a=t[0],u=[a],h=1,c=t.length;he&&(u.push(r),a=r);return a!==r&&u.push(r),u}(t,n),n)}void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()},721:(t,e,r)=>{"use strict";t.exports=r(192)},921:t=>{"use strict";var e=2*Math.PI;function r(t,e,r,n){var i=t*r+e*n;return i>1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)}function n(t,e){var r=4/3*Math.tan(e/4),n=Math.cos(t),i=Math.sin(t),s=Math.cos(t+e),o=Math.sin(t+e);return[n,i,n-i*r,i+n*r,s+o*r,o-s*r,s,o]}t.exports=function(t,i,s,o,a,u,h,c,l){var f=Math.sin(l*e/360),d=Math.cos(l*e/360),p=d*(t-s)/2+f*(i-o)/2,m=-f*(t-s)/2+d*(i-o)/2;if(0===p&&0===m)return[];if(0===h||0===c)return[];h=Math.abs(h),c=Math.abs(c);var g=p*p/(h*h)+m*m/(c*c);g>1&&(h*=Math.sqrt(g),c*=Math.sqrt(g));var v=function(t,n,i,s,o,a,u,h,c,l){var f=l*(t-i)/2+c*(n-s)/2,d=-c*(t-i)/2+l*(n-s)/2,p=u*u,m=h*h,g=f*f,v=d*d,y=p*m-p*v-m*g;y<0&&(y=0),y/=p*v+m*g;var b=(y=Math.sqrt(y)*(o===a?-1:1))*u/h*d,w=y*-h/u*f,M=l*b-c*w+(t+i)/2,x=c*b+l*w+(n+s)/2,_=(f-b)/u,S=(d-w)/h,P=(-f-b)/u,A=(-d-w)/h,O=r(1,0,_,S),E=r(_,S,P,A);return 0===a&&E>0&&(E-=e),1===a&&E<0&&(E+=e),[M,x,O,E]}(t,i,s,o,a,u,h,c,f,d),y=[],b=v[2],w=v[3],M=Math.max(Math.ceil(Math.abs(w)/(e/4)),1);w/=M;for(var x=0;x{"use strict";var e=1e-10,r=Math.PI/180;function n(t,e,r){if(!(this instanceof n))return new n(t,e,r);this.rx=t,this.ry=e,this.ax=r}n.prototype.transform=function(t){var n=Math.cos(this.ax*r),i=Math.sin(this.ax*r),s=[this.rx*(t[0]*n+t[2]*i),this.rx*(t[1]*n+t[3]*i),this.ry*(-t[0]*i+t[2]*n),this.ry*(-t[1]*i+t[3]*n)],o=s[0]*s[0]+s[2]*s[2],a=s[1]*s[1]+s[3]*s[3],u=((s[0]-s[3])*(s[0]-s[3])+(s[2]+s[1])*(s[2]+s[1]))*((s[0]+s[3])*(s[0]+s[3])+(s[2]-s[1])*(s[2]-s[1])),h=(o+a)/2;if(uMath.abs(l-a)?(l-o)/c:c/(l-a))/Math.PI,this.ax>=0?(this.rx=Math.sqrt(l),this.ry=Math.sqrt(f)):(this.ax+=90,this.rx=Math.sqrt(f),this.ry=Math.sqrt(l)),this},n.prototype.isDegenerate=function(){return this.rx{"use strict";function e(){if(!(this instanceof e))return new e;this.queue=[],this.cache=null}e.prototype.matrix=function(t){return 1===t[0]&&0===t[1]&&0===t[2]&&1===t[3]&&0===t[4]&&0===t[5]||(this.cache=null,this.queue.push(t)),this},e.prototype.translate=function(t,e){return 0===t&&0===e||(this.cache=null,this.queue.push([1,0,0,1,t,e])),this},e.prototype.scale=function(t,e){return 1===t&&1===e||(this.cache=null,this.queue.push([t,0,0,e,0,0])),this},e.prototype.rotate=function(t,e,r){var n,i,s;return 0!==t&&(this.translate(e,r),n=t*Math.PI/180,i=Math.cos(n),s=Math.sin(n),this.queue.push([i,s,-s,i,0,0]),this.cache=null,this.translate(-e,-r)),this},e.prototype.skewX=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},e.prototype.skewY=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},e.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],1===this.queue.length)return this.cache;for(var t=1;t{"use strict";var e={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},r=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function n(t){return t>=48&&t<=57}function i(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function s(t){for(;t.index=5760&&r.indexOf(e)>=0);)t.index++;var e}function o(t){var e=t.path.charCodeAt(t.index);return 48===e?(t.param=0,void t.index++):49===e?(t.param=1,void t.index++):void(t.err="SvgPath: arc flag can be 0 or 1 only (at pos "+t.index+")")}function a(t){var e,r=t.index,i=r,s=t.max,o=!1,a=!1,u=!1,h=!1;if(i>=s)t.err="SvgPath: missed param (at pos "+i+")";else if(43!==(e=t.path.charCodeAt(i))&&45!==e||(e=++i2&&(t.result.push([r,i[0],i[1]]),i=i.slice(2),n="l",r="m"===r?"l":"L"),"r"===n)t.result.push([r].concat(i));else for(;i.length>=e[n]&&(t.result.push([r].concat(i.splice(0,e[n]))),e[n]););}function h(t){var r,n,i,h,c,l,f=t.max;if(t.segmentStart=t.index,n=97==(32|(r=t.path.charCodeAt(t.index))),function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}(r))if(h=e[t.path[t.index].toLowerCase()],t.index++,s(t),t.data=[],h){for(i=!1;;){for(c=h;c>0;c--){if(!n||3!==c&&4!==c?a(t):o(t),t.err.length)return;t.data.push(t.param),s(t),i=!1,t.index=t.max)break;if(!((l=t.path.charCodeAt(t.index))>=48&&l<=57||43===l||45===l||46===l))break}}u(t)}else u(t);else t.err="SvgPath: bad command "+t.path[t.index]+" (at pos "+t.index+")"}t.exports=function(t){var e=new i(t),r=e.max;for(s(e);e.index{"use strict";var n=r(665),i=r(94),s=r(480),o=r(921),a=r(954);function u(t){if(!(this instanceof u))return new u(t);var e=n(t);this.segments=e.segments,this.err=e.err,this.__stack=[]}u.from=function(t){if("string"==typeof t)return new u(t);if(t instanceof u){var e=new u("");return e.err=t.err,e.segments=t.segments.map((function(t){return t.slice()})),e.__stack=t.__stack.map((function(t){return s().matrix(t.toArray())})),e}throw new Error("SvgPath.from: invalid param type "+t)},u.prototype.__matrix=function(t){var e,r=this;t.queue.length&&this.iterate((function(n,i,s,o){var u,h,c,l;switch(n[0]){case"v":h=0===(u=t.calc(0,n[1],!0))[0]?["v",u[1]]:["l",u[0],u[1]];break;case"V":h=(u=t.calc(s,n[1],!1))[0]===t.calc(s,o,!1)[0]?["V",u[1]]:["L",u[0],u[1]];break;case"h":h=0===(u=t.calc(n[1],0,!0))[1]?["h",u[0]]:["l",u[0],u[1]];break;case"H":h=(u=t.calc(n[1],o,!1))[1]===t.calc(s,o,!1)[1]?["H",u[0]]:["L",u[0],u[1]];break;case"a":case"A":var f=t.toArray(),d=a(n[1],n[2],n[3]).transform(f);if(f[0]*f[3]-f[1]*f[2]<0&&(n[5]=n[5]?"0":"1"),u=t.calc(n[6],n[7],"a"===n[0]),"A"===n[0]&&n[6]===s&&n[7]===o||"a"===n[0]&&0===n[6]&&0===n[7]){h=["a"===n[0]?"l":"L",u[0],u[1]];break}h=d.isDegenerate()?["a"===n[0]?"l":"L",u[0],u[1]]:[n[0],d.rx,d.ry,d.ax,n[4],n[5],u[0],u[1]];break;case"m":l=i>0,h=["m",(u=t.calc(n[1],n[2],l))[0],u[1]];break;default:for(h=[c=n[0]],l=c.toLowerCase()===c,e=1;e=0;)t.matrix(this.__stack[e].toArray());this.__matrix(t),this.__stack=[]}},u.prototype.toString=function(){var t,e,r=[];this.__evaluateStack();for(var n=0;n0&&"m"!==e&&"M"!==e&&e===this.segments[n-1][0],r=r.concat(t?this.segments[n].slice(1):this.segments[n]);return r.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")},u.prototype.translate=function(t,e){return this.__stack.push(s().translate(t,e||0)),this},u.prototype.scale=function(t,e){return this.__stack.push(s().scale(t,e||0===e?e:t)),this},u.prototype.rotate=function(t,e,r){return this.__stack.push(s().rotate(t,e||0,r||0)),this},u.prototype.skewX=function(t){return this.__stack.push(s().skewX(t)),this},u.prototype.skewY=function(t){return this.__stack.push(s().skewY(t)),this},u.prototype.matrix=function(t){return this.__stack.push(s().matrix(t)),this},u.prototype.transform=function(t){return t.trim()?(this.__stack.push(i(t)),this):this},u.prototype.round=function(t){var e,r=0,n=0,i=0,s=0;return t=t||0,this.__evaluateStack(),this.segments.forEach((function(o){var a=o[0].toLowerCase()===o[0];switch(o[0]){case"H":case"h":return a&&(o[1]+=i),i=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case"V":case"v":return a&&(o[1]+=s),s=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case"Z":case"z":return i=r,void(s=n);case"M":case"m":return a&&(o[1]+=i,o[2]+=s),i=o[1]-o[1].toFixed(t),s=o[2]-o[2].toFixed(t),r=i,n=s,o[1]=+o[1].toFixed(t),void(o[2]=+o[2].toFixed(t));case"A":case"a":return a&&(o[6]+=i,o[7]+=s),i=o[6]-o[6].toFixed(t),s=o[7]-o[7].toFixed(t),o[1]=+o[1].toFixed(t),o[2]=+o[2].toFixed(t),o[3]=+o[3].toFixed(t+2),o[6]=+o[6].toFixed(t),void(o[7]=+o[7].toFixed(t));default:return e=o.length,a&&(o[e-2]+=i,o[e-1]+=s),i=o[e-2]-o[e-2].toFixed(t),s=o[e-1]-o[e-1].toFixed(t),void o.forEach((function(e,r){r&&(o[r]=+o[r].toFixed(t))}))}})),this},u.prototype.iterate=function(t,e){var r,n,i,s=this.segments,o={},a=!1,u=0,h=0,c=0,l=0;if(e||this.__evaluateStack(),s.forEach((function(e,r){var n=t(e,r,u,h);Array.isArray(n)&&(o[r]=n,a=!0);var i=e[0]===e[0].toLowerCase();switch(e[0]){case"m":case"M":return u=e[1]+(i?u:0),h=e[2]+(i?h:0),c=u,void(l=h);case"h":case"H":return void(u=e[1]+(i?u:0));case"v":case"V":return void(h=e[1]+(i?h:0));case"z":case"Z":return u=c,void(h=l);default:u=e[e.length-2]+(i?u:0),h=e[e.length-1]+(i?h:0)}})),!a)return this;for(i=[],r=0;r{"use strict";var n=r(480),i={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},s=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,o=/[\s,]+/;t.exports=function(t){var e,r,a=new n;return t.split(s).forEach((function(t){if(t.length)if(void 0===i[t])switch(r=t.split(o).map((function(t){return+t||0})),e){case"matrix":return void(6===r.length&&a.matrix(r));case"scale":return void(1===r.length?a.scale(r[0],r[0]):2===r.length&&a.scale(r[0],r[1]));case"rotate":return void(1===r.length?a.rotate(r[0],0,0):3===r.length&&a.rotate(r[0],r[1],r[2]));case"translate":return void(1===r.length?a.translate(r[0],0):2===r.length&&a.translate(r[0],r[1]));case"skewX":return void(1===r.length&&a.skewX(r[0]));case"skewY":return void(1===r.length&&a.skewY(r[0]))}else e=t})),a}},197:(t,e,r)=>{"use strict";function n(t,e){return Array.isArray(e)?[t.a*e[0]+t.c*e[1]+t.e,t.b*e[0]+t.d*e[1]+t.f]:{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function i(t,e){return e.map((e=>n(t,e)))}function s(t){return{a:parseFloat(t.a),b:parseFloat(t.b),c:parseFloat(t.c),d:parseFloat(t.d),e:parseFloat(t.e),f:parseFloat(t.f)}}r.r(e),r.d(e,{applyToPoint:()=>n,applyToPoints:()=>i,compose:()=>m,fromDefinition:()=>C,fromObject:()=>s,fromString:()=>a,fromTransformAttribute:()=>T,fromTriangles:()=>I,identity:()=>u,inverse:()=>h,isAffineMatrix:()=>f,rotate:()=>b,rotateDEG:()=>w,scale:()=>M,shear:()=>x,skew:()=>S,skewDEG:()=>P,smoothMatrix:()=>k,toCSS:()=>A,toSVG:()=>O,toString:()=>E,transform:()=>p,translate:()=>d});const o=/^matrix\(\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*\)$/i;function a(t){const e=t.match(o);if(null===e||e.length<7)throw new Error(`'${t}' is not a matrix`);return{a:parseFloat(e[1]),b:parseFloat(e[2]),c:parseFloat(e[3]),d:parseFloat(e[4]),e:parseFloat(e[5]),f:parseFloat(e[6])}}function u(){return{a:1,c:0,e:0,b:0,d:1,f:0}}function h(t){const{a:e,b:r,c:n,d:i,e:s,f:o}=t,a=e*i-r*n;return{a:i/a,b:r/-a,c:n/-a,d:e/a,e:(i*s-n*o)/-a,f:(r*s-e*o)/a}}function c(t){return void 0===t}function l(t){return"number"==typeof t&&!Number.isNaN(t)&&Number.isFinite(t)}function f(t){return"object"==typeof(e=t)&&null!==e&&!Array.isArray(e)&&"a"in t&&l(t.a)&&"b"in t&&l(t.b)&&"c"in t&&l(t.c)&&"d"in t&&l(t.d)&&"e"in t&&l(t.e)&&"f"in t&&l(t.f);var e}function d(t,e=0){return{a:1,c:0,e:t,b:0,d:1,f:e}}function p(...t){const e=(t,e)=>({a:t.a*e.a+t.c*e.b,c:t.a*e.c+t.c*e.d,e:t.a*e.e+t.c*e.f+t.e,b:t.b*e.a+t.d*e.b,d:t.b*e.c+t.d*e.d,f:t.b*e.e+t.d*e.f+t.f});switch((t=Array.isArray(t[0])?t[0]:t).length){case 0:throw new Error("no matrices provided");case 1:return t[0];case 2:return e(t[0],t[1]);default:{const[r,n,...i]=t;return p(e(r,n),...i)}}}function m(...t){return p(...t)}const{cos:g,sin:v,PI:y}=Math;function b(t,e,r){const n=g(t),i=v(t),s={a:n,c:-i,e:0,b:i,d:n,f:0};return c(e)||c(r)?s:p([d(e,r),s,d(-e,-r)])}function w(t,e,r){return b(t*y/180,e,r)}function M(t,e,r,n){c(e)&&(e=t);const i={a:t,c:0,e:0,b:0,d:e,f:0};return c(r)||c(n)?i:p([d(r,n),i,d(-r,-n)])}function x(t,e){return{a:1,c:t,e:0,b:e,d:1,f:0}}const{tan:_}=Math;function S(t,e){return{a:1,c:_(t),e:0,b:_(e),d:1,f:0}}function P(t,e){return S(t*Math.PI/180,e*Math.PI/180)}function A(t){return E(t)}function O(t){return E(t)}function E(t){return`matrix(${t.a},${t.b},${t.c},${t.d},${t.e},${t.f})`}function k(t,e=1e10){return{a:Math.round(t.a*e)/e,b:Math.round(t.b*e)/e,c:Math.round(t.c*e)/e,d:Math.round(t.d*e)/e,e:Math.round(t.e*e)/e,f:Math.round(t.f*e)/e}}function I(t,e){const r=null!=t[0].x?t[0].x:t[0][0],n=null!=t[0].y?t[0].y:t[0][1],i=null!=e[0].x?e[0].x:e[0][0],s=null!=e[0].y?e[0].y:e[0][1],o=null!=t[1].x?t[1].x:t[1][0],a=null!=t[1].y?t[1].y:t[1][1],u=null!=e[1].x?e[1].x:e[1][0],c=null!=e[1].y?e[1].y:e[1][1],l=null!=t[2].x?t[2].x:t[2][0],f=null!=t[2].y?t[2].y:t[2][1],d=null!=e[2].x?e[2].x:e[2][0],m=null!=e[2].y?e[2].y:e[2][1];return k(p([{a:i-d,b:s-m,c:u-d,d:c-m,e:d,f:m},h({a:r-l,b:n-f,c:o-l,d:a-f,e:l,f})]))}function C(t){return Array.isArray(t)?t.map(e):e(t);function e(t){switch(t.type){case"matrix":if("a"in t&&"b"in t&&"c"in t&&"d"in t&&"e"in t&&"f"in t)return s(t);throw new Error("MISSING_MANDATORY_PARAM");case"translate":if(!("tx"in t))throw new Error("MISSING_MANDATORY_PARAM");return"ty"in t?d(t.tx,t.ty):d(t.tx);case"scale":if(!("sx"in t))throw new Error("MISSING_MANDATORY_PARAM");return"sy"in t?M(t.sx,t.sy):M(t.sx);case"rotate":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return"cx"in t&&"cy"in t?w(t.angle,t.cx,t.cy):w(t.angle);case"skewX":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return P(t.angle,0);case"skewY":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return P(0,t.angle);case"shear":if(!("shx"in t)||!("shy"in t))throw new Error("MISSING_MANDATORY_PARAM");return x(t.shx,t.shy);default:throw new Error("UNSUPPORTED_DESCRIPTOR")}}}function B(t,e,r,n){this.message=t,this.expected=e,this.found=r,this.location=n,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,B)}function R(t,e){e=void 0!==e?e:{};var r,n={},i={transformList:Z},s=Z,o="matrix",a="(",u=")",h="translate",c="scale",l="rotate",f="skewX",d="skewY",p=/^[eE]/,m=/^[+\-]/,g=/^[0-9]/,v=/^[ \t\r\n]/,y=j("matrix",!1),b=j("(",!1),w=j(")",!1),M=j("translate",!1),x=j("scale",!1),_=j("rotate",!1),S=j("skewX",!1),P=j("skewY",!1),A=j(",",!1),O={type:"other",description:"fractionalConstant"},E=D(["e","E"],!1,!1),k=D(["+","-"],!1,!1),I=D([["0","9"]],!1,!1),C=D([" ","\t","\r","\n"],!1,!1),R=0,T=[{line:1,column:1}],L=[],F=0;if("startRule"in e){if(!(e.startRule in i))throw new Error("Can't start parsing from rule \""+e.startRule+'".');s=i[e.startRule]}function j(t,e){return{type:"literal",text:t,ignoreCase:e}}function D(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function z(e){var r,n=T[e];if(n)return n;for(r=e-1;!T[r];)r--;for(n={line:(n=T[r]).line,column:n.column};r0;function Y(t,r){var n={};U&&(n.filename=e.filename);var i=z(t);n.start={offset:t,line:i.line,column:i.column};var s=z(r);return n.end={offset:r,line:s.line,column:s.column},n}function V(t){var e=L[L.length-1];Re.pos&&(e.pos=R,e.variants=[]),e.variants.push(t))}function Z(){var t,e,r,i;for(t=[],e=rt();e!==n;)t.push(e),e=rt();for((e=G())===n&&(e=null),r=[],i=rt();i!==n;)r.push(i),i=rt();return e}function G(){var t,e,r,i,s;if(t=R,(e=$())!==n){if(r=[],(i=W())!==n)for(;i!==n;)r.push(i),i=W();else r=n;r!==n&&(i=G())!==n?(s=i,t=e.concat(s)):(R=t,t=n)}else R=t,t=n;return t===n&&(t=$()),t}function $(){var e;return(e=function(){var e,r,i,s,h,c,l,f,d,p,m,g,v,M=function(t){0===F&&V(t)};if(e=R,M(y),t.substr(R,6)===o?(r=o,R+=6):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(M(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(h=[],c=rt();c!==n;)h.push(c),c=rt();if((c=X())!==n)if(W()!==n)if((l=X())!==n)if(W()!==n)if((f=X())!==n)if(W()!==n)if((d=X())!==n)if(W()!==n)if((p=X())!==n)if(W()!==n)if((m=X())!==n){for(g=[],v=rt();v!==n;)g.push(v),v=rt();M(w),41===t.charCodeAt(R)?(v=u,R++):v=n,v!==n?e=[{type:"matrix",a:c,b:l,c:f,d,e:p,f:m}]:(R=e,e=n)}else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,c,l,f,d,p,m,g=function(t){0===F&&V(t)};if(e=R,g(M),t.substr(R,9)===h?(r=h,R+=9):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(o=[],c=rt();c!==n;)o.push(c),c=rt();if((c=X())!==n){for((l=H())===n&&(l=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(w),41===t.charCodeAt(R)?(d=u,R++):d=n,d!==n?(m={type:"translate",tx:c},(p=l)&&(m.ty=p),e=[m]):(R=e,e=n)}else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,h,l,f,d,p,m,g=function(t){0===F&&V(t)};if(e=R,g(x),t.substr(R,5)===c?(r=c,R+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(o=[],h=rt();h!==n;)o.push(h),h=rt();if((h=X())!==n){for((l=H())===n&&(l=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(w),41===t.charCodeAt(R)?(d=u,R++):d=n,d!==n?(m={type:"scale",sx:h},(p=l)&&(m.sy=p),e=[m]):(R=e,e=n)}else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,h,c,f,d,p,m,g=function(t){0===F&&V(t)};if(e=R,g(_),t.substr(R,6)===l?(r=l,R+=6):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(o=[],h=rt();h!==n;)o.push(h),h=rt();if((h=X())!==n){for((c=function(){var t,e,r;return t=R,W()!==n&&(e=X())!==n&&W()!==n&&(r=X())!==n?t=[e,r]:(R=t,t=n),t}())===n&&(c=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(w),41===t.charCodeAt(R)?(d=u,R++):d=n,d!==n?(m={type:"rotate",angle:h},(p=c)&&(m.cx=p[0],m.cy=p[1]),e=[m]):(R=e,e=n)}else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,h,c,l,d=function(t){0===F&&V(t)};if(e=R,d(S),t.substr(R,5)===f?(r=f,R+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(d(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(o=[],h=rt();h!==n;)o.push(h),h=rt();if((h=X())!==n){for(c=[],l=rt();l!==n;)c.push(l),l=rt();d(w),41===t.charCodeAt(R)?(l=u,R++):l=n,l!==n?e=[{type:"skewX",angle:h}]:(R=e,e=n)}else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,h,c,l,f=function(t){0===F&&V(t)};if(e=R,f(P),t.substr(R,5)===d?(r=d,R+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(f(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(o=[],h=rt();h!==n;)o.push(h),h=rt();if((h=X())!==n){for(c=[],l=rt();l!==n;)c.push(l),l=rt();f(w),41===t.charCodeAt(R)?(l=u,R++):l=n,l!==n?e=[{type:"skewY",angle:h}]:(R=e,e=n)}else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}()),e}function X(){var e,r,i,s;return e=R,r=R,(i=K())===n&&(i=null),(s=function(){var e,r,i;return e=R,(r=function(){var e,r,i,s,o,a;return 0===F&&V(O),F++,e=R,(r=tt())===n&&(r=null),46===t.charCodeAt(R)?(i=".",R++):i=n,i!==n&&(s=tt())!==n?(a=s,e=[(o=r)?o.join(""):null,".",a.join("")].join("")):(R=e,e=n),e===n&&(e=R,(r=tt())!==n?(46===t.charCodeAt(R)?(i=".",R++):i=n,i!==n?e=r.join(""):(R=e,e=n)):(R=e,e=n)),F--,e}())!==n?((i=Q())===n&&(i=null),e=[r,i||null].join("")):(R=e,e=n),e===n&&(e=R,(r=tt())!==n&&(i=Q())!==n?e=[r,i].join(""):(R=e,e=n)),e}())!==n?r=i=[i,s]:(R=r,r=n),r!==n&&(r=parseFloat(r.join(""))),(e=r)===n&&(e=R,r=R,(i=K())===n&&(i=null),(s=function(){var t;return(t=tt())!==n&&(t=t.join("")),t}())!==n?r=i=[i,s]:(R=r,r=n),r!==n&&(r=parseInt(r.join(""))),e=r),e}function H(){var t,e;return t=R,W()!==n&&(e=X())!==n?t=e:(R=t,t=n),t}function W(){var t,e,r,i,s;if(t=R,e=[],(r=rt())!==n)for(;r!==n;)e.push(r),r=rt();else e=n;if(e!==n){for((r=J())===n&&(r=null),i=[],s=rt();s!==n;)i.push(s),s=rt();t=e=[e,r,i]}else R=t,t=n;if(t===n)if(t=R,(e=J())!==n){for(r=[],i=rt();i!==n;)r.push(i),i=rt();t=e=[e,r]}else R=t,t=n;return t}function J(){var e;return 0===F&&V(A),44===t.charCodeAt(R)?(e=",",R++):e=n,e}function Q(){var e,r,i,s;return e=R,0===F&&V(E),p.test(t.charAt(R))?(r=t.charAt(R),R++):r=n,r!==n?((i=K())===n&&(i=null),(s=tt())!==n?e=["e",i,s.join("")].join(""):(R=e,e=n)):(R=e,e=n),e}function K(){var e;return 0===F&&V(k),m.test(t.charAt(R))?(e=t.charAt(R),R++):e=n,e}function tt(){var t,e;if(t=[],(e=et())!==n)for(;e!==n;)t.push(e),e=et();else t=n;return t}function et(){var e;return 0===F&&V(I),g.test(t.charAt(R))?(e=t.charAt(R),R++):e=n,e}function rt(){var e;return 0===F&&V(C),v.test(t.charAt(R))?(e=t.charAt(R),R++):e=n,e}if(L.push({pos:R,variants:[]}),(r=s())!==n&&R===t.length)return r;throw r!==n&&R0){for(e=1,r=1;e{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(625)})()},3431:t=>{var e=.1,r="function"==typeof Float32Array;function n(t,e){return 1-3*e+3*t}function i(t,e){return 3*e-6*t}function s(t){return 3*t}function o(t,e,r){return((n(e,r)*t+i(e,r))*t+s(e))*t}function a(t,e,r){return 3*n(e,r)*t*t+2*i(e,r)*t+s(e)}function u(t){return t}t.exports=function(t,n,i,s){if(!(0<=t&&t<=1&&0<=i&&i<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===n&&i===s)return u;for(var h=r?new Float32Array(11):new Array(11),c=0;c<11;++c)h[c]=o(c*e,t,i);return function(r){return 0===r?0:1===r?1:o(function(r){for(var n=0,s=1;10!==s&&h[s]<=r;++s)n+=e;--s;var u=n+(r-h[s])/(h[s+1]-h[s])*e,c=a(u,t,i);return c>=.001?function(t,e,r,n){for(var i=0;i<4;++i){var s=a(e,r,n);if(0===s)return e;e-=(o(e,r,n)-t)/s}return e}(r,u,t,i):0===c?u:function(t,e,r,n,i){var s,a,u=0;do{(s=o(a=e+(r-e)/2,n,i)-t)>0?r=a:e=a}while(Math.abs(s)>1e-7&&++u<10);return a}(r,n,n+e,t,i)}(r),n,s)}}},292:(t,e,r)=>{const n=r(9850);e.parseFont=n,e.createCanvas=function(t,e){return Object.assign(document.createElement("canvas"),{width:t,height:e})},e.createImageData=function(t,e,r){switch(arguments.length){case 0:return new ImageData;case 1:return new ImageData(t);case 2:return new ImageData(t,e);default:return new ImageData(t,e,r)}},e.loadImage=function(t,e){return new Promise((function(r,n){const i=Object.assign(document.createElement("img"),e);function s(){i.onload=null,i.onerror=null}i.onload=function(){s(),r(i)},i.onerror=function(){s(),n(new Error('Failed to load the image "'+t+'"'))},i.src=t}))}},9850:t=>{"use strict";const e="'([^']+)'|\"([^\"]+)\"|[\\w\\s-]+",r=new RegExp("(bold|bolder|lighter|[1-9]00) +","i"),n=new RegExp("(italic|oblique) +","i"),i=new RegExp("(small-caps) +","i"),s=new RegExp("(ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded) +","i"),o=new RegExp("([\\d\\.]+)(px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q) *((?:"+e+")( *, *(?:"+e+"))*)"),a={};t.exports=function(t){if(a[t])return a[t];const e=o.exec(t);if(!e)return;const u={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(e[1]),unit:e[2],family:e[3].replace(/["']/g,"").replace(/ *, */g,",")};let h,c,l,f,d=t.substring(0,e.index);switch((h=r.exec(d))&&(u.weight=h[1]),(c=n.exec(d))&&(u.style=c[1]),(l=i.exec(d))&&(u.variant=l[1]),(f=s.exec(d))&&(u.stretch=f[1]),u.unit){case"pt":u.size/=.75;break;case"pc":u.size*=16;break;case"in":u.size*=96;break;case"cm":u.size*=96/2.54;break;case"mm":u.size*=96/25.4;break;case"%":break;case"em":case"rem":u.size*=16/.75;break;case"q":u.size*=96/25.4/4}return a[t]=u}},887:(t,e,r)=>{"use strict";r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>s,mat3:()=>o,mat4:()=>a,quat:()=>c,quat2:()=>l,vec2:()=>f,vec3:()=>u,vec4:()=>h});var n={};r.r(n),r.d(n,{ARRAY_TYPE:()=>p,EPSILON:()=>d,RANDOM:()=>m,equals:()=>b,setMatrixArrayType:()=>g,toRadian:()=>y});var i={};r.r(i),r.d(i,{LDU:()=>j,add:()=>D,adjoint:()=>E,clone:()=>M,copy:()=>x,create:()=>w,determinant:()=>k,equals:()=>N,exactEquals:()=>q,frob:()=>F,fromRotation:()=>R,fromScaling:()=>T,fromValues:()=>S,identity:()=>_,invert:()=>O,mul:()=>V,multiply:()=>I,multiplyScalar:()=>U,multiplyScalarAndAdd:()=>Y,rotate:()=>C,scale:()=>B,set:()=>P,str:()=>L,sub:()=>Z,subtract:()=>z,transpose:()=>A});var s={};r.r(s),r.d(s,{add:()=>ht,clone:()=>$,copy:()=>X,create:()=>G,determinant:()=>K,equals:()=>pt,exactEquals:()=>dt,frob:()=>ut,fromRotation:()=>it,fromScaling:()=>st,fromTranslation:()=>ot,fromValues:()=>W,identity:()=>H,invert:()=>Q,mul:()=>mt,multiply:()=>tt,multiplyScalar:()=>lt,multiplyScalarAndAdd:()=>ft,rotate:()=>et,scale:()=>rt,set:()=>J,str:()=>at,sub:()=>gt,subtract:()=>ct,translate:()=>nt});var o={};r.r(o),r.d(o,{add:()=>Nt,adjoint:()=>At,clone:()=>bt,copy:()=>wt,create:()=>vt,determinant:()=>Ot,equals:()=>Gt,exactEquals:()=>Zt,frob:()=>qt,fromMat2d:()=>Lt,fromMat4:()=>yt,fromQuat:()=>Ft,fromRotation:()=>Rt,fromScaling:()=>Tt,fromTranslation:()=>Bt,fromValues:()=>Mt,identity:()=>_t,invert:()=>Pt,mul:()=>$t,multiply:()=>Et,multiplyScalar:()=>Yt,multiplyScalarAndAdd:()=>Vt,normalFromMat4:()=>jt,projection:()=>Dt,rotate:()=>It,scale:()=>Ct,set:()=>xt,str:()=>zt,sub:()=>Xt,subtract:()=>Ut,translate:()=>kt,transpose:()=>St});var a={};r.r(a),r.d(a,{add:()=>Te,adjoint:()=>ne,clone:()=>Wt,copy:()=>Jt,create:()=>Ht,determinant:()=>ie,equals:()=>ze,exactEquals:()=>De,frob:()=>Re,fromQuat:()=>Pe,fromQuat2:()=>be,fromRotation:()=>pe,fromRotationTranslation:()=>ye,fromRotationTranslationScale:()=>_e,fromRotationTranslationScaleOrigin:()=>Se,fromScaling:()=>de,fromTranslation:()=>fe,fromValues:()=>Qt,fromXRotation:()=>me,fromYRotation:()=>ge,fromZRotation:()=>ve,frustum:()=>Ae,getRotation:()=>xe,getScaling:()=>Me,getTranslation:()=>we,identity:()=>te,invert:()=>re,lookAt:()=>Ie,mul:()=>qe,multiply:()=>se,multiplyScalar:()=>Fe,multiplyScalarAndAdd:()=>je,ortho:()=>ke,perspective:()=>Oe,perspectiveFromFieldOfView:()=>Ee,rotate:()=>ue,rotateX:()=>he,rotateY:()=>ce,rotateZ:()=>le,scale:()=>ae,set:()=>Kt,str:()=>Be,sub:()=>Ne,subtract:()=>Le,targetTo:()=>Ce,translate:()=>oe,transpose:()=>ee});var u={};r.r(u),r.d(u,{add:()=>Xe,angle:()=>_r,bezier:()=>mr,ceil:()=>Qe,clone:()=>Ye,copy:()=>Ge,create:()=>Ue,cross:()=>fr,dist:()=>Br,distance:()=>sr,div:()=>Cr,divide:()=>Je,dot:()=>lr,equals:()=>Or,exactEquals:()=>Ar,floor:()=>Ke,forEach:()=>Fr,fromValues:()=>Ze,hermite:()=>pr,inverse:()=>hr,len:()=>Tr,length:()=>Ve,lerp:()=>dr,max:()=>er,min:()=>tr,mul:()=>Ir,multiply:()=>We,negate:()=>ur,normalize:()=>cr,random:()=>gr,rotateX:()=>wr,rotateY:()=>Mr,rotateZ:()=>xr,round:()=>rr,scale:()=>nr,scaleAndAdd:()=>ir,set:()=>$e,sqrDist:()=>Rr,sqrLen:()=>Lr,squaredDistance:()=>or,squaredLength:()=>ar,str:()=>Pr,sub:()=>kr,subtract:()=>He,transformMat3:()=>yr,transformMat4:()=>vr,transformQuat:()=>br,zero:()=>Sr});var h={};r.r(h),r.d(h,{add:()=>Ur,ceil:()=>Gr,clone:()=>Dr,copy:()=>qr,create:()=>jr,cross:()=>un,dist:()=>wn,distance:()=>Kr,div:()=>bn,divide:()=>Zr,dot:()=>an,equals:()=>gn,exactEquals:()=>mn,floor:()=>$r,forEach:()=>Sn,fromValues:()=>zr,inverse:()=>sn,len:()=>xn,length:()=>en,lerp:()=>hn,max:()=>Hr,min:()=>Xr,mul:()=>yn,multiply:()=>Vr,negate:()=>nn,normalize:()=>on,random:()=>cn,round:()=>Wr,scale:()=>Jr,scaleAndAdd:()=>Qr,set:()=>Nr,sqrDist:()=>Mn,sqrLen:()=>_n,squaredDistance:()=>tn,squaredLength:()=>rn,str:()=>pn,sub:()=>vn,subtract:()=>Yr,transformMat4:()=>ln,transformQuat:()=>fn,zero:()=>dn});var c={};r.r(c),r.d(c,{add:()=>ei,calculateW:()=>Tn,clone:()=>Jn,conjugate:()=>Nn,copy:()=>Kn,create:()=>Pn,dot:()=>ii,equals:()=>fi,exactEquals:()=>li,exp:()=>Ln,fromEuler:()=>Yn,fromMat3:()=>Un,fromValues:()=>Qn,getAngle:()=>kn,getAxisAngle:()=>En,identity:()=>An,invert:()=>qn,len:()=>ai,length:()=>oi,lerp:()=>si,ln:()=>Fn,mul:()=>ri,multiply:()=>In,normalize:()=>ci,pow:()=>jn,random:()=>zn,rotateX:()=>Cn,rotateY:()=>Bn,rotateZ:()=>Rn,rotationTo:()=>di,scale:()=>ni,set:()=>ti,setAxes:()=>mi,setAxisAngle:()=>On,slerp:()=>Dn,sqlerp:()=>pi,sqrLen:()=>hi,squaredLength:()=>ui,str:()=>Vn});var l={};r.r(l),r.d(l,{add:()=>zi,clone:()=>vi,conjugate:()=>Gi,copy:()=>Si,create:()=>gi,dot:()=>Yi,equals:()=>ts,exactEquals:()=>Ki,fromMat4:()=>_i,fromRotation:()=>xi,fromRotationTranslation:()=>wi,fromRotationTranslationValues:()=>bi,fromTranslation:()=>Mi,fromValues:()=>yi,getDual:()=>Ei,getReal:()=>Oi,getTranslation:()=>Ci,identity:()=>Pi,invert:()=>Zi,len:()=>Xi,length:()=>$i,lerp:()=>Vi,mul:()=>Ni,multiply:()=>qi,normalize:()=>Ji,rotateAroundAxis:()=>Di,rotateByQuatAppend:()=>Fi,rotateByQuatPrepend:()=>ji,rotateX:()=>Ri,rotateY:()=>Ti,rotateZ:()=>Li,scale:()=>Ui,set:()=>Ai,setDual:()=>Ii,setReal:()=>ki,sqrLen:()=>Wi,squaredLength:()=>Hi,str:()=>Qi,translate:()=>Bi});var f={};r.r(f),r.d(f,{add:()=>os,angle:()=>Rs,ceil:()=>cs,clone:()=>rs,copy:()=>is,create:()=>es,cross:()=>Ps,dist:()=>Us,distance:()=>vs,div:()=>Ns,divide:()=>hs,dot:()=>Ss,equals:()=>js,exactEquals:()=>Fs,floor:()=>ls,forEach:()=>Zs,fromValues:()=>ns,inverse:()=>xs,len:()=>Ds,length:()=>bs,lerp:()=>As,max:()=>ds,min:()=>fs,mul:()=>qs,multiply:()=>us,negate:()=>Ms,normalize:()=>_s,random:()=>Os,rotate:()=>Bs,round:()=>ps,scale:()=>ms,scaleAndAdd:()=>gs,set:()=>ss,sqrDist:()=>Ys,sqrLen:()=>Vs,squaredDistance:()=>ys,squaredLength:()=>ws,str:()=>Ls,sub:()=>zs,subtract:()=>as,transformMat2:()=>Es,transformMat2d:()=>ks,transformMat3:()=>Is,transformMat4:()=>Cs,zero:()=>Ts});var d=1e-6,p="undefined"!=typeof Float32Array?Float32Array:Array,m=Math.random;function g(t){p=t}var v=Math.PI/180;function y(t){return t*v}function b(t,e){return Math.abs(t-e)<=d*Math.max(1,Math.abs(t),Math.abs(e))}function w(){var t=new p(4);return p!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function M(t){var e=new p(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function x(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function _(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function S(t,e,r,n){var i=new p(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function P(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function A(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function O(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*s-i*n;return o?(o=1/o,t[0]=s*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}function E(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function k(t){return t[0]*t[3]-t[2]*t[1]}function I(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*a+s*u,t[1]=i*a+o*u,t[2]=n*h+s*c,t[3]=i*h+o*c,t}function C(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u+s*a,t[1]=i*u+o*a,t[2]=n*-a+s*u,t[3]=i*-a+o*u,t}function B(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1];return t[0]=n*a,t[1]=i*a,t[2]=s*u,t[3]=o*u,t}function R(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function T(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function L(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function F(t){return Math.hypot(t[0],t[1],t[2],t[3])}function j(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function D(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function z(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function q(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function N(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=e[0],a=e[1],u=e[2],h=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(s-h)<=d*Math.max(1,Math.abs(s),Math.abs(h))}function U(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Y(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var V=I,Z=z;function G(){var t=new p(6);return p!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function $(t){var e=new p(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function X(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function H(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function W(t,e,r,n,i,s){var o=new p(6);return o[0]=t,o[1]=e,o[2]=r,o[3]=n,o[4]=i,o[5]=s,o}function J(t,e,r,n,i,s,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t}function Q(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=r*s-n*i;return u?(u=1/u,t[0]=s*u,t[1]=-n*u,t[2]=-i*u,t[3]=r*u,t[4]=(i*a-s*o)*u,t[5]=(n*o-r*a)*u,t):null}function K(t){return t[0]*t[3]-t[1]*t[2]}function tt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=r[0],c=r[1],l=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*h+s*c,t[1]=i*h+o*c,t[2]=n*l+s*f,t[3]=i*l+o*f,t[4]=n*d+s*p+a,t[5]=i*d+o*p+u,t}function et(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*h,t[1]=i*c+o*h,t[2]=n*-h+s*c,t[3]=i*-h+o*c,t[4]=a,t[5]=u,t}function rt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=r[0],c=r[1];return t[0]=n*h,t[1]=i*h,t[2]=s*c,t[3]=o*c,t[4]=a,t[5]=u,t}function nt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=n*h+s*c+a,t[5]=i*h+o*c+u,t}function it(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function st(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function ot(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function at(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function ut(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function ht(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function ct(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function lt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function ft(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function dt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function pt(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],u=e[0],h=e[1],c=e[2],l=e[3],f=e[4],p=e[5];return Math.abs(r-u)<=d*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-h)<=d*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-c)<=d*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(s-l)<=d*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(o-f)<=d*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-p)<=d*Math.max(1,Math.abs(a),Math.abs(p))}var mt=tt,gt=ct;function vt(){var t=new p(9);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function bt(t){var e=new p(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function wt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Mt(t,e,r,n,i,s,o,a,u){var h=new p(9);return h[0]=t,h[1]=e,h[2]=r,h[3]=n,h[4]=i,h[5]=s,h[6]=o,h[7]=a,h[8]=u,h}function xt(t,e,r,n,i,s,o,a,u,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=u,t[8]=h,t}function _t(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function St(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function Pt(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=c*o-a*h,f=-c*s+a*u,d=h*s-o*u,p=r*l+n*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-c*n+i*h)*p,t[2]=(a*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*u)*p,t[5]=(-a*r+i*s)*p,t[6]=d*p,t[7]=(-h*r+n*u)*p,t[8]=(o*r-n*s)*p,t):null}function At(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8];return t[0]=o*c-a*h,t[1]=i*h-n*c,t[2]=n*a-i*o,t[3]=a*u-s*c,t[4]=r*c-i*u,t[5]=i*s-r*a,t[6]=s*h-o*u,t[7]=n*u-r*h,t[8]=r*o-n*s,t}function Ot(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],u=t[7],h=t[8];return e*(h*s-o*u)+r*(-h*i+o*a)+n*(u*i-s*a)}function Et(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=r[0],d=r[1],p=r[2],m=r[3],g=r[4],v=r[5],y=r[6],b=r[7],w=r[8];return t[0]=f*n+d*o+p*h,t[1]=f*i+d*a+p*c,t[2]=f*s+d*u+p*l,t[3]=m*n+g*o+v*h,t[4]=m*i+g*a+v*c,t[5]=m*s+g*u+v*l,t[6]=y*n+b*o+w*h,t[7]=y*i+b*a+w*c,t[8]=y*s+b*u+w*l,t}function kt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=u,t[6]=f*n+d*o+h,t[7]=f*i+d*a+c,t[8]=f*s+d*u+l,t}function It(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*a,t[2]=d*s+f*u,t[3]=d*o-f*n,t[4]=d*a-f*i,t[5]=d*u-f*s,t[6]=h,t[7]=c,t[8]=l,t}function Ct(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Bt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function Rt(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Tt(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Lt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function Ft(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,u=i+i,h=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*u,m=s*o,g=s*a,v=s*u;return t[0]=1-l-p,t[3]=c-v,t[6]=f+g,t[1]=c+v,t[4]=1-h-p,t[7]=d-m,t[2]=f-g,t[5]=d+m,t[8]=1-h-l,t}function jt(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*u-i*o,w=r*h-s*o,M=n*u-i*a,x=n*h-s*a,_=i*h-s*u,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,O=l*g-f*m,E=l*v-d*m,k=f*v-d*g,I=y*k-b*E+w*O+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-u*E+h*O)*I,t[1]=(u*A-o*k-h*P)*I,t[2]=(o*E-a*A+h*S)*I,t[3]=(i*E-n*k-s*O)*I,t[4]=(r*k-i*A+s*P)*I,t[5]=(n*A-r*E-s*S)*I,t[6]=(m*_-g*x+v*M)*I,t[7]=(g*w-p*_-v*b)*I,t[8]=(p*x-m*w+v*y)*I,t):null}function Dt(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function zt(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function qt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Nt(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function Ut(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function Yt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function Vt(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function Zt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function Gt(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],u=t[6],h=t[7],c=t[8],l=e[0],f=e[1],p=e[2],m=e[3],g=e[4],v=e[5],y=e[6],b=e[7],w=e[8];return Math.abs(r-l)<=d*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(n-f)<=d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-p)<=d*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(s-m)<=d*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(o-g)<=d*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(a-v)<=d*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(u-y)<=d*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(h-b)<=d*Math.max(1,Math.abs(h),Math.abs(b))&&Math.abs(c-w)<=d*Math.max(1,Math.abs(c),Math.abs(w))}var $t=Et,Xt=Ut;function Ht(){var t=new p(16);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Wt(t){var e=new p(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Jt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Qt(t,e,r,n,i,s,o,a,u,h,c,l,f,d,m,g){var v=new p(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=n,v[4]=i,v[5]=s,v[6]=o,v[7]=a,v[8]=u,v[9]=h,v[10]=c,v[11]=l,v[12]=f,v[13]=d,v[14]=m,v[15]=g,v}function Kt(t,e,r,n,i,s,o,a,u,h,c,l,f,d,p,m,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=u,t[8]=h,t[9]=c,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=g,t}function te(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ee(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=i,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function re(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*u-i*o,w=r*h-s*o,M=n*u-i*a,x=n*h-s*a,_=i*h-s*u,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,O=l*g-f*m,E=l*v-d*m,k=f*v-d*g,I=y*k-b*E+w*O+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-u*E+h*O)*I,t[1]=(i*E-n*k-s*O)*I,t[2]=(m*_-g*x+v*M)*I,t[3]=(f*x-l*_-d*M)*I,t[4]=(u*A-o*k-h*P)*I,t[5]=(r*k-i*A+s*P)*I,t[6]=(g*w-p*_-v*b)*I,t[7]=(c*_-f*w+d*b)*I,t[8]=(o*E-a*A+h*S)*I,t[9]=(n*A-r*E-s*S)*I,t[10]=(p*x-m*w+v*y)*I,t[11]=(l*w-c*x-d*y)*I,t[12]=(a*P-o*O-u*S)*I,t[13]=(r*O-n*P+i*S)*I,t[14]=(m*b-p*M-g*y)*I,t[15]=(c*M-l*b+f*y)*I,t):null}function ne(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15];return t[0]=a*(f*v-d*g)-l*(u*v-h*g)+m*(u*d-h*f),t[1]=-(n*(f*v-d*g)-l*(i*v-s*g)+m*(i*d-s*f)),t[2]=n*(u*v-h*g)-a*(i*v-s*g)+m*(i*h-s*u),t[3]=-(n*(u*d-h*f)-a*(i*d-s*f)+l*(i*h-s*u)),t[4]=-(o*(f*v-d*g)-c*(u*v-h*g)+p*(u*d-h*f)),t[5]=r*(f*v-d*g)-c*(i*v-s*g)+p*(i*d-s*f),t[6]=-(r*(u*v-h*g)-o*(i*v-s*g)+p*(i*h-s*u)),t[7]=r*(u*d-h*f)-o*(i*d-s*f)+c*(i*h-s*u),t[8]=o*(l*v-d*m)-c*(a*v-h*m)+p*(a*d-h*l),t[9]=-(r*(l*v-d*m)-c*(n*v-s*m)+p*(n*d-s*l)),t[10]=r*(a*v-h*m)-o*(n*v-s*m)+p*(n*h-s*a),t[11]=-(r*(a*d-h*l)-o*(n*d-s*l)+c*(n*h-s*a)),t[12]=-(o*(l*g-f*m)-c*(a*g-u*m)+p*(a*f-u*l)),t[13]=r*(l*g-f*m)-c*(n*g-i*m)+p*(n*f-i*l),t[14]=-(r*(a*g-u*m)-o*(n*g-i*m)+p*(n*u-i*a)),t[15]=r*(a*f-u*l)-o*(n*f-i*l)+c*(n*u-i*a),t}function ie(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],u=t[7],h=t[8],c=t[9],l=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*s)*(l*g-f*m)-(e*a-n*s)*(c*g-f*p)+(e*u-i*s)*(c*m-l*p)+(r*a-n*o)*(h*g-f*d)-(r*u-i*o)*(h*m-l*d)+(n*u-i*a)*(h*p-c*d)}function se(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],v=e[14],y=e[15],b=r[0],w=r[1],M=r[2],x=r[3];return t[0]=b*n+w*a+M*l+x*m,t[1]=b*i+w*u+M*f+x*g,t[2]=b*s+w*h+M*d+x*v,t[3]=b*o+w*c+M*p+x*y,b=r[4],w=r[5],M=r[6],x=r[7],t[4]=b*n+w*a+M*l+x*m,t[5]=b*i+w*u+M*f+x*g,t[6]=b*s+w*h+M*d+x*v,t[7]=b*o+w*c+M*p+x*y,b=r[8],w=r[9],M=r[10],x=r[11],t[8]=b*n+w*a+M*l+x*m,t[9]=b*i+w*u+M*f+x*g,t[10]=b*s+w*h+M*d+x*v,t[11]=b*o+w*c+M*p+x*y,b=r[12],w=r[13],M=r[14],x=r[15],t[12]=b*n+w*a+M*l+x*m,t[13]=b*i+w*u+M*f+x*g,t[14]=b*s+w*h+M*d+x*v,t[15]=b*o+w*c+M*p+x*y,t}function oe(t,e,r){var n,i,s,o,a,u,h,c,l,f,d,p,m=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=u,t[6]=h,t[7]=c,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+a*g+l*v+e[12],t[13]=i*m+u*g+f*v+e[13],t[14]=s*m+h*g+d*v+e[14],t[15]=o*m+c*g+p*v+e[15]),t}function ae(t,e,r){var n=r[0],i=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ue(t,e,r,n){var i,s,o,a,u,h,c,l,f,p,m,g,v,y,b,w,M,x,_,S,P,A,O,E,k=n[0],I=n[1],C=n[2],B=Math.hypot(k,I,C);return B0?(r[0]=2*(a*o+c*n+u*s-h*i)/l,r[1]=2*(u*o+c*i+h*n-a*s)/l,r[2]=2*(h*o+c*s+a*i-u*n)/l):(r[0]=2*(a*o+c*n+u*s-h*i),r[1]=2*(u*o+c*i+h*n-a*s),r[2]=2*(h*o+c*s+a*i-u*n)),ye(t,e,r),t}function we(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Me(t,e){var r=e[0],n=e[1],i=e[2],s=e[4],o=e[5],a=e[6],u=e[8],h=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(s,o,a),t[2]=Math.hypot(u,h,c),t}function xe(t,e){var r=new p(3);Me(r,e);var n=1/r[0],i=1/r[1],s=1/r[2],o=e[0]*n,a=e[1]*i,u=e[2]*s,h=e[4]*n,c=e[5]*i,l=e[6]*s,f=e[8]*n,d=e[9]*i,m=e[10]*s,g=o+c+m,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(l-d)/v,t[1]=(f-u)/v,t[2]=(a-h)/v):o>c&&o>m?(v=2*Math.sqrt(1+o-c-m),t[3]=(l-d)/v,t[0]=.25*v,t[1]=(a+h)/v,t[2]=(f+u)/v):c>m?(v=2*Math.sqrt(1+c-o-m),t[3]=(f-u)/v,t[0]=(a+h)/v,t[1]=.25*v,t[2]=(l+d)/v):(v=2*Math.sqrt(1+m-o-c),t[3]=(a-h)/v,t[0]=(f+u)/v,t[1]=(l+d)/v,t[2]=.25*v),t}function _e(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3],u=i+i,h=s+s,c=o+o,l=i*u,f=i*h,d=i*c,p=s*h,m=s*c,g=o*c,v=a*u,y=a*h,b=a*c,w=n[0],M=n[1],x=n[2];return t[0]=(1-(p+g))*w,t[1]=(f+b)*w,t[2]=(d-y)*w,t[3]=0,t[4]=(f-b)*M,t[5]=(1-(l+g))*M,t[6]=(m+v)*M,t[7]=0,t[8]=(d+y)*x,t[9]=(m-v)*x,t[10]=(1-(l+p))*x,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function Se(t,e,r,n,i){var s=e[0],o=e[1],a=e[2],u=e[3],h=s+s,c=o+o,l=a+a,f=s*h,d=s*c,p=s*l,m=o*c,g=o*l,v=a*l,y=u*h,b=u*c,w=u*l,M=n[0],x=n[1],_=n[2],S=i[0],P=i[1],A=i[2],O=(1-(m+v))*M,E=(d+w)*M,k=(p-b)*M,I=(d-w)*x,C=(1-(f+v))*x,B=(g+y)*x,R=(p+b)*_,T=(g-y)*_,L=(1-(f+m))*_;return t[0]=O,t[1]=E,t[2]=k,t[3]=0,t[4]=I,t[5]=C,t[6]=B,t[7]=0,t[8]=R,t[9]=T,t[10]=L,t[11]=0,t[12]=r[0]+S-(O*S+I*P+R*A),t[13]=r[1]+P-(E*S+C*P+T*A),t[14]=r[2]+A-(k*S+B*P+L*A),t[15]=1,t}function Pe(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,u=i+i,h=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*u,m=s*o,g=s*a,v=s*u;return t[0]=1-l-p,t[1]=c+v,t[2]=f-g,t[3]=0,t[4]=c-v,t[5]=1-h-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-h-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ae(t,e,r,n,i,s,o){var a=1/(r-e),u=1/(i-n),h=1/(s-o);return t[0]=2*s*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*u,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*u,t[10]=(o+s)*h,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*h,t[15]=0,t}function Oe(t,e,r,n,i){var s,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(s=1/(n-i),t[10]=(i+n)*s,t[14]=2*i*n*s):(t[10]=-1,t[14]=-2*n),t}function Ee(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),u=2/(o+a),h=2/(i+s);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=h,t[6]=0,t[7]=0,t[8]=-(o-a)*u*.5,t[9]=(i-s)*h*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function ke(t,e,r,n,i,s,o){var a=1/(e-r),u=1/(n-i),h=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*u,t[14]=(o+s)*h,t[15]=1,t}function Ie(t,e,r,n){var i,s,o,a,u,h,c,l,f,p,m=e[0],g=e[1],v=e[2],y=n[0],b=n[1],w=n[2],M=r[0],x=r[1],_=r[2];return Math.abs(m-M)0&&(c*=d=1/Math.sqrt(d),l*=d,f*=d);var p=u*f-h*l,m=h*c-a*f,g=a*l-u*c;return(d=p*p+m*m+g*g)>0&&(p*=d=1/Math.sqrt(d),m*=d,g*=d),t[0]=p,t[1]=m,t[2]=g,t[3]=0,t[4]=l*g-f*m,t[5]=f*p-c*g,t[6]=c*m-l*p,t[7]=0,t[8]=c,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=s,t[14]=o,t[15]=1,t}function Be(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Re(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Te(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Le(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function Fe(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function je(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function De(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function ze(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],u=t[6],h=t[7],c=t[8],l=t[9],f=t[10],p=t[11],m=t[12],g=t[13],v=t[14],y=t[15],b=e[0],w=e[1],M=e[2],x=e[3],_=e[4],S=e[5],P=e[6],A=e[7],O=e[8],E=e[9],k=e[10],I=e[11],C=e[12],B=e[13],R=e[14],T=e[15];return Math.abs(r-b)<=d*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-w)<=d*Math.max(1,Math.abs(n),Math.abs(w))&&Math.abs(i-M)<=d*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(s-x)<=d*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(o-_)<=d*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(a-S)<=d*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(u-P)<=d*Math.max(1,Math.abs(u),Math.abs(P))&&Math.abs(h-A)<=d*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(c-O)<=d*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(l-E)<=d*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(f-k)<=d*Math.max(1,Math.abs(f),Math.abs(k))&&Math.abs(p-I)<=d*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(m-C)<=d*Math.max(1,Math.abs(m),Math.abs(C))&&Math.abs(g-B)<=d*Math.max(1,Math.abs(g),Math.abs(B))&&Math.abs(v-R)<=d*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(y-T)<=d*Math.max(1,Math.abs(y),Math.abs(T))}var qe=se,Ne=Le;function Ue(){var t=new p(3);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ye(t){var e=new p(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Ve(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function Ze(t,e,r){var n=new p(3);return n[0]=t,n[1]=e,n[2]=r,n}function Ge(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function $e(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function Xe(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function He(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function We(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function Je(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function Qe(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Ke(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function tr(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function er(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function rr(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function nr(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function ir(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function sr(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function or(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function ar(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function ur(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function hr(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function cr(t,e){var r=e[0],n=e[1],i=e[2],s=r*r+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function lr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function fr(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],u=r[2];return t[0]=i*u-s*a,t[1]=s*o-n*u,t[2]=n*a-i*o,t}function dr(t,e,r,n){var i=e[0],s=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t}function pr(t,e,r,n,i,s){var o=s*s,a=o*(2*s-3)+1,u=o*(s-2)+s,h=o*(s-1),c=o*(3-2*s);return t[0]=e[0]*a+r[0]*u+n[0]*h+i[0]*c,t[1]=e[1]*a+r[1]*u+n[1]*h+i[1]*c,t[2]=e[2]*a+r[2]*u+n[2]*h+i[2]*c,t}function mr(t,e,r,n,i,s){var o=1-s,a=o*o,u=s*s,h=a*o,c=3*s*a,l=3*u*o,f=u*s;return t[0]=e[0]*h+r[0]*c+n[0]*l+i[0]*f,t[1]=e[1]*h+r[1]*c+n[1]*l+i[1]*f,t[2]=e[2]*h+r[2]*c+n[2]*l+i[2]*f,t}function gr(t,e){e=e||1;var r=2*m()*Math.PI,n=2*m()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}function vr(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[3]*n+r[7]*i+r[11]*s+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*s+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*s+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*s+r[14])/o,t}function yr(t,e,r){var n=e[0],i=e[1],s=e[2];return t[0]=n*r[0]+i*r[3]+s*r[6],t[1]=n*r[1]+i*r[4]+s*r[7],t[2]=n*r[2]+i*r[5]+s*r[8],t}function br(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],u=e[1],h=e[2],c=i*h-s*u,l=s*a-n*h,f=n*u-i*a,d=i*f-s*l,p=s*c-n*f,m=n*l-i*c,g=2*o;return c*=g,l*=g,f*=g,d*=2,p*=2,m*=2,t[0]=a+c+d,t[1]=u+l+p,t[2]=h+f+m,t}function wr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0],s[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),s[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function Mr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),s[1]=i[1],s[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function xr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),s[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),s[2]=i[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function _r(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2],u=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(s*s+o*o+a*a),h=u&&lr(t,e)/u;return Math.acos(Math.min(Math.max(h,-1),1))}function Sr(t){return t[0]=0,t[1]=0,t[2]=0,t}function Pr(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function Ar(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Or(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2];return Math.abs(r-s)<=d*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-o)<=d*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=d*Math.max(1,Math.abs(i),Math.abs(a))}var Er,kr=He,Ir=We,Cr=Je,Br=sr,Rr=or,Tr=Ve,Lr=ar,Fr=(Er=Ue(),function(t,e,r,n,i,s){var o,a;for(e||(e=3),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=s*o,t}function an(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function un(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],s=r[0]*n[2]-r[2]*n[0],o=r[0]*n[3]-r[3]*n[0],a=r[1]*n[2]-r[2]*n[1],u=r[1]*n[3]-r[3]*n[1],h=r[2]*n[3]-r[3]*n[2],c=e[0],l=e[1],f=e[2],d=e[3];return t[0]=l*h-f*u+d*a,t[1]=-c*h+f*o-d*s,t[2]=c*u-l*o+d*i,t[3]=-c*a+l*s-f*i,t}function hn(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t[3]=a+n*(r[3]-a),t}function cn(t,e){var r,n,i,s,o,a;e=e||1;do{o=(r=2*m()-1)*r+(n=2*m()-1)*n}while(o>=1);do{a=(i=2*m()-1)*i+(s=2*m()-1)*s}while(a>=1);var u=Math.sqrt((1-o)/a);return t[0]=e*r,t[1]=e*n,t[2]=e*i*u,t[3]=e*s*u,t}function ln(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*s+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*s+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*s+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*s+r[15]*o,t}function fn(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],u=r[2],h=r[3],c=h*n+a*s-u*i,l=h*i+u*n-o*s,f=h*s+o*i-a*n,d=-o*n-a*i-u*s;return t[0]=c*h+d*-o+l*-u-f*-a,t[1]=l*h+d*-a+f*-o-c*-u,t[2]=f*h+d*-u+c*-a-l*-o,t[3]=e[3],t}function dn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function pn(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function mn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function gn(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=e[0],a=e[1],u=e[2],h=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(s-h)<=d*Math.max(1,Math.abs(s),Math.abs(h))}var vn=Yr,yn=Vr,bn=Zr,wn=Kr,Mn=tn,xn=en,_n=rn,Sn=function(){var t=jr();return function(e,r,n,i,s,o){var a,u;for(r||(r=4),n||(n=0),u=i?Math.min(i*r+n,e.length):e.length,a=n;ad?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r}function kn(t,e){var r=ii(t,e);return Math.acos(2*r*r-1)}function In(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*c+o*a+i*h-s*u,t[1]=i*c+o*u+s*a-n*h,t[2]=s*c+o*h+n*u-i*a,t[3]=o*c-n*a-i*u-s*h,t}function Cn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u+o*a,t[1]=i*u+s*a,t[2]=s*u-i*a,t[3]=o*u-n*a,t}function Bn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u-s*a,t[1]=i*u+o*a,t[2]=s*u+n*a,t[3]=o*u-i*a,t}function Rn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u+i*a,t[1]=i*u-n*a,t[2]=s*u+o*a,t[3]=o*u-s*a,t}function Tn(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function Ln(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=Math.exp(s),u=o>0?a*Math.sin(o)/o:0;return t[0]=r*u,t[1]=n*u,t[2]=i*u,t[3]=a*Math.cos(o),t}function Fn(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=o>0?Math.atan2(o,s)/o:0;return t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=.5*Math.log(r*r+n*n+i*i+s*s),t}function jn(t,e,r){return Fn(t,e),ni(t,t,r),Ln(t,t),t}function Dn(t,e,r,n){var i,s,o,a,u,h=e[0],c=e[1],l=e[2],f=e[3],p=r[0],m=r[1],g=r[2],v=r[3];return(s=h*p+c*m+l*g+f*v)<0&&(s=-s,p=-p,m=-m,g=-g,v=-v),1-s>d?(i=Math.acos(s),o=Math.sin(i),a=Math.sin((1-n)*i)/o,u=Math.sin(n*i)/o):(a=1-n,u=n),t[0]=a*h+u*p,t[1]=a*c+u*m,t[2]=a*l+u*g,t[3]=a*f+u*v,t}function zn(t){var e=m(),r=m(),n=m(),i=Math.sqrt(1-e),s=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*r),t[1]=i*Math.cos(2*Math.PI*r),t[2]=s*Math.sin(2*Math.PI*n),t[3]=s*Math.cos(2*Math.PI*n),t}function qn(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s,a=o?1/o:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=s*a,t}function Nn(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Un(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var s=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*s+s]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*s+o]-e[3*o+s])*r,t[s]=(e[3*s+i]+e[3*i+s])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t}function Yn(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var s=Math.sin(e),o=Math.cos(e),a=Math.sin(r),u=Math.cos(r),h=Math.sin(n),c=Math.cos(n);return t[0]=s*u*c-o*a*h,t[1]=o*a*c+s*u*h,t[2]=o*u*h-s*a*c,t[3]=o*u*c+s*a*h,t}function Vn(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var Zn,Gn,$n,Xn,Hn,Wn,Jn=Dr,Qn=zr,Kn=qr,ti=Nr,ei=Ur,ri=In,ni=Jr,ii=an,si=hn,oi=en,ai=oi,ui=rn,hi=ui,ci=on,li=mn,fi=gn,di=(Zn=Ue(),Gn=Ze(1,0,0),$n=Ze(0,1,0),function(t,e,r){var n=lr(e,r);return n<-.999999?(fr(Zn,Gn,e),Tr(Zn)<1e-6&&fr(Zn,$n,e),cr(Zn,Zn),On(t,Zn,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(fr(Zn,e,r),t[0]=Zn[0],t[1]=Zn[1],t[2]=Zn[2],t[3]=1+n,ci(t,t))}),pi=(Xn=Pn(),Hn=Pn(),function(t,e,r,n,i,s){return Dn(Xn,e,i,s),Dn(Hn,r,n,s),Dn(t,Xn,Hn,2*s*(1-s)),t}),mi=(Wn=vt(),function(t,e,r,n){return Wn[0]=r[0],Wn[3]=r[1],Wn[6]=r[2],Wn[1]=n[0],Wn[4]=n[1],Wn[7]=n[2],Wn[2]=-e[0],Wn[5]=-e[1],Wn[8]=-e[2],ci(t,Un(t,Wn))});function gi(){var t=new p(8);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function vi(t){var e=new p(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function yi(t,e,r,n,i,s,o,a){var u=new p(8);return u[0]=t,u[1]=e,u[2]=r,u[3]=n,u[4]=i,u[5]=s,u[6]=o,u[7]=a,u}function bi(t,e,r,n,i,s,o){var a=new p(8);a[0]=t,a[1]=e,a[2]=r,a[3]=n;var u=.5*i,h=.5*s,c=.5*o;return a[4]=u*n+h*r-c*e,a[5]=h*n+c*t-u*r,a[6]=c*n+u*e-h*t,a[7]=-u*t-h*e-c*r,a}function wi(t,e,r){var n=.5*r[0],i=.5*r[1],s=.5*r[2],o=e[0],a=e[1],u=e[2],h=e[3];return t[0]=o,t[1]=a,t[2]=u,t[3]=h,t[4]=n*h+i*u-s*a,t[5]=i*h+s*o-n*u,t[6]=s*h+n*a-i*o,t[7]=-n*o-i*a-s*u,t}function Mi(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function xi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function _i(t,e){var r=Pn();xe(r,e);var n=new p(3);return we(n,e),wi(t,r,n),t}function Si(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function Pi(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Ai(t,e,r,n,i,s,o,a,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=u,t}var Oi=Kn;function Ei(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var ki=Kn;function Ii(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function Ci(t,e){var r=e[4],n=e[5],i=e[6],s=e[7],o=-e[0],a=-e[1],u=-e[2],h=e[3];return t[0]=2*(r*h+s*o+n*u-i*a),t[1]=2*(n*h+s*a+i*o-r*u),t[2]=2*(i*h+s*u+r*a-n*o),t}function Bi(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=.5*r[0],u=.5*r[1],h=.5*r[2],c=e[4],l=e[5],f=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=o*a+i*h-s*u+c,t[5]=o*u+s*a-n*h+l,t[6]=o*h+n*u-i*a+f,t[7]=-n*a-i*u-s*h+d,t}function Ri(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=a*o+c*n+u*s-h*i,f=u*o+c*i+h*n-a*s,d=h*o+c*s+a*i-u*n,p=c*o-a*n-u*i-h*s;return Cn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Ti(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=a*o+c*n+u*s-h*i,f=u*o+c*i+h*n-a*s,d=h*o+c*s+a*i-u*n,p=c*o-a*n-u*i-h*s;return Bn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Li(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=a*o+c*n+u*s-h*i,f=u*o+c*i+h*n-a*s,d=h*o+c*s+a*i-u*n,p=c*o-a*n-u*i-h*s;return Rn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Fi(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],u=e[1],h=e[2],c=e[3];return t[0]=a*o+c*n+u*s-h*i,t[1]=u*o+c*i+h*n-a*s,t[2]=h*o+c*s+a*i-u*n,t[3]=c*o-a*n-u*i-h*s,a=e[4],u=e[5],h=e[6],c=e[7],t[4]=a*o+c*n+u*s-h*i,t[5]=u*o+c*i+h*n-a*s,t[6]=h*o+c*s+a*i-u*n,t[7]=c*o-a*n-u*i-h*s,t}function ji(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*c+o*a+i*h-s*u,t[1]=i*c+o*u+s*a-n*h,t[2]=s*c+o*h+n*u-i*a,t[3]=o*c-n*a-i*u-s*h,a=r[4],u=r[5],h=r[6],c=r[7],t[4]=n*c+o*a+i*h-s*u,t[5]=i*c+o*u+s*a-n*h,t[6]=s*c+o*h+n*u-i*a,t[7]=o*c-n*a-i*u-s*h,t}function Di(t,e,r,n){if(Math.abs(n)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,s=e[2]/r,o=e[3]/r,a=e[4],u=e[5],h=e[6],c=e[7],l=n*a+i*u+s*h+o*c;t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=(a-n*l)/r,t[5]=(u-i*l)/r,t[6]=(h-s*l)/r,t[7]=(c-o*l)/r}return t}function Qi(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function Ki(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function ts(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],u=t[6],h=t[7],c=e[0],l=e[1],f=e[2],p=e[3],m=e[4],g=e[5],v=e[6],y=e[7];return Math.abs(r-c)<=d*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(n-l)<=d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-f)<=d*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(s-p)<=d*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(o-m)<=d*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(a-g)<=d*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(u-v)<=d*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(h-y)<=d*Math.max(1,Math.abs(h),Math.abs(y))}function es(){var t=new p(2);return p!=Float32Array&&(t[0]=0,t[1]=0),t}function rs(t){var e=new p(2);return e[0]=t[0],e[1]=t[1],e}function ns(t,e){var r=new p(2);return r[0]=t,r[1]=e,r}function is(t,e){return t[0]=e[0],t[1]=e[1],t}function ss(t,e,r){return t[0]=e,t[1]=r,t}function os(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function as(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function us(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function hs(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function cs(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function ls(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function fs(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function ds(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function ps(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function ms(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function gs(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function vs(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function ys(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function bs(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function ws(t){var e=t[0],r=t[1];return e*e+r*r}function Ms(t,e){return t[0]=-e[0],t[1]=-e[1],t}function xs(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function _s(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function Ss(t,e){return t[0]*e[0]+t[1]*e[1]}function Ps(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function As(t,e,r,n){var i=e[0],s=e[1];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t}function Os(t,e){e=e||1;var r=2*m()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function Es(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function ks(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function Is(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function Cs(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function Bs(t,e,r,n){var i=e[0]-r[0],s=e[1]-r[1],o=Math.sin(n),a=Math.cos(n);return t[0]=i*a-s*o+r[0],t[1]=i*o+s*a+r[1],t}function Rs(t,e){var r=t[0],n=t[1],i=e[0],s=e[1],o=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+s*s),a=o&&(r*i+n*s)/o;return Math.acos(Math.min(Math.max(a,-1),1))}function Ts(t){return t[0]=0,t[1]=0,t}function Ls(t){return"vec2("+t[0]+", "+t[1]+")"}function Fs(t,e){return t[0]===e[0]&&t[1]===e[1]}function js(t,e){var r=t[0],n=t[1],i=e[0],s=e[1];return Math.abs(r-i)<=d*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))}var Ds=bs,zs=as,qs=us,Ns=hs,Us=vs,Ys=ys,Vs=ws,Zs=function(){var t=es();return function(e,r,n,i,s,o){var a,u;for(r||(r=2),n||(n=0),u=i?Math.min(i*r+n,e.length):e.length,a=n;a{t.exports=function t(e,r,n){function i(o,a){if(!r[o]){if(!e[o]){if(s)return s(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[o]={exports:{}};e[o][0].call(h.exports,(function(t){return i(e[o][1][t]||t)}),h,h.exports,t,e,r,n)}return r[o].exports}for(var s=void 0,o=0;o>2,a=(3&e)<<4|r>>4,u=1>6:64,h=2>4,r=(15&o)<<4|(a=s.indexOf(t.charAt(h++)))>>2,n=(3&a)<<6|(u=s.indexOf(t.charAt(h++))),l[c++]=e,64!==a&&(l[c++]=r),64!==u&&(l[c++]=n);return l}},{"./support":30,"./utils":32}],2:[function(t,e,r){"use strict";var n=t("./external"),i=t("./stream/DataWorker"),s=t("./stream/Crc32Probe"),o=t("./stream/DataLengthProbe");function a(t,e,r,n,i){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=n,this.compressedContent=i}a.prototype={getContentWorker:function(){var t=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(t,e,r){return t.pipe(new s).pipe(new o("uncompressedSize")).pipe(e.compressWorker(r)).pipe(new o("compressedSize")).withStreamInfo("compression",e)},e.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,r){"use strict";var n=t("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(t){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,r){"use strict";var n=t("./utils"),i=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==n.getTypeOf(t)?function(t,e,r){var n=i,s=0+r;t^=-1;for(var o=0;o>>8^n[255&(t^e[o])];return-1^t}(0|e,t,t.length):function(t,e,r){var n=i,s=0+r;t^=-1;for(var o=0;o>>8^n[255&(t^e.charCodeAt(o))];return-1^t}(0|e,t,t.length):0}},{"./utils":32}],5:[function(t,e,r){"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(t,e,r){"use strict";var n;n="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:n}},{lie:37}],7:[function(t,e,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=t("pako"),s=t("./utils"),o=t("./stream/GenericWorker"),a=n?"uint8array":"array";function u(t,e){o.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic="\b\0",s.inherits(u,o),u.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,t.data),!1)},u.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(t){return new u("Deflate",t)},r.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,r){"use strict";function n(t,e){var r,n="";for(r=0;r>>=8;return n}function i(t,e,r,i,o,c){var l,f,d=t.file,p=t.compression,m=c!==a.utf8encode,g=s.transformTo("string",c(d.name)),v=s.transformTo("string",a.utf8encode(d.name)),y=d.comment,b=s.transformTo("string",c(y)),w=s.transformTo("string",a.utf8encode(y)),M=v.length!==d.name.length,x=w.length!==y.length,_="",S="",P="",A=d.dir,O=d.date,E={crc32:0,compressedSize:0,uncompressedSize:0};e&&!r||(E.crc32=t.crc32,E.compressedSize=t.compressedSize,E.uncompressedSize=t.uncompressedSize);var k=0;e&&(k|=8),m||!M&&!x||(k|=2048);var I,C=0,B=0;A&&(C|=16),"UNIX"===o?(B=798,C|=((I=d.unixPermissions)||(I=A?16893:33204),(65535&I)<<16)):(B=20,C|=63&(d.dosPermissions||0)),l=O.getUTCHours(),l<<=6,l|=O.getUTCMinutes(),l<<=5,l|=O.getUTCSeconds()/2,f=O.getUTCFullYear()-1980,f<<=4,f|=O.getUTCMonth()+1,f<<=5,f|=O.getUTCDate(),M&&(_+="up"+n((S=n(1,1)+n(u(g),4)+v).length,2)+S),x&&(_+="uc"+n((P=n(1,1)+n(u(b),4)+w).length,2)+P);var R="";return R+="\n\0",R+=n(k,2),R+=p.magic,R+=n(l,2),R+=n(f,2),R+=n(E.crc32,4),R+=n(E.compressedSize,4),R+=n(E.uncompressedSize,4),R+=n(g.length,2),R+=n(_.length,2),{fileRecord:h.LOCAL_FILE_HEADER+R+g+_,dirRecord:h.CENTRAL_FILE_HEADER+n(B,2)+R+n(b.length,2)+"\0\0\0\0"+n(C,4)+n(i,4)+g+_+b}}var s=t("../utils"),o=t("../stream/GenericWorker"),a=t("../utf8"),u=t("../crc32"),h=t("../signature");function c(t,e,r,n){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(c,o),c.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,o.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-n-1))/r:100}}))},c.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var r=i(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},c.prototype.closedSource=function(t){this.accumulate=!1;var e,r=this.streamFiles&&!t.file.dir,s=i(t,r,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(s.dirRecord),r)this.push({data:(e=t,h.DATA_DESCRIPTOR+n(e.crc32,4)+n(e.compressedSize,4)+n(e.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:s.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},c.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e=this.index;e--)r=(r<<8)+this.byteAt(e);return this.index+=t,r},readString:function(t){return n.transformTo("string",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readAndCheckSignature:function(t){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=i},{"../utils":32}],19:[function(t,e,r){"use strict";var n=t("./Uint8ArrayReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,r){"use strict";var n=t("./DataReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},i.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},i.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./DataReader":18}],21:[function(t,e,r){"use strict";var n=t("./ArrayReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../support"),s=t("./ArrayReader"),o=t("./StringReader"),a=t("./NodeBufferReader"),u=t("./Uint8ArrayReader");e.exports=function(t){var e=n.getTypeOf(t);return n.checkSupport(e),"string"!==e||i.uint8array?"nodebuffer"===e?new a(t):i.uint8array?new u(n.transformTo("uint8array",t)):new s(n.transformTo("array",t)):new o(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,r){"use strict";r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,r){"use strict";var n=t("./GenericWorker"),i=t("../utils");function s(t){n.call(this,"ConvertWorker to "+t),this.destType=t}i.inherits(s,n),s.prototype.processChunk=function(t){this.push({data:i.transformTo(this.destType,t.data),meta:t.meta})},e.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,r){"use strict";var n=t("./GenericWorker"),i=t("../crc32");function s(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(s,n),s.prototype.processChunk=function(t){this.streamInfo.crc32=i(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./GenericWorker");function s(t){i.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}n.inherits(s,i),s.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}i.prototype.processChunk.call(this,t)},e.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./GenericWorker");function s(t){i.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=n.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}n.inherits(s,i),s.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,r){"use strict";function n(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var r=0;r "+t:t}},e.exports=n},{}],29:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./ConvertWorker"),s=t("./GenericWorker"),o=t("../base64"),a=t("../support"),u=t("../external"),h=null;if(a.nodestream)try{h=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function c(t,e,r){var o=e;switch(e){case"blob":case"arraybuffer":o="uint8array";break;case"base64":o="string"}try{this._internalType=o,this._outputType=e,this._mimeType=r,n.checkSupport(o),this._worker=t.pipe(new i(o)),t.lock()}catch(t){this._worker=new s("error"),this._worker.error(t)}}c.prototype={accumulate:function(t){return e=this,r=t,new u.Promise((function(t,i){var s=[],a=e._internalType,u=e._outputType,h=e._mimeType;e.on("data",(function(t,e){s.push(t),r&&r(e)})).on("error",(function(t){s=[],i(t)})).on("end",(function(){try{var e=function(t,e,r){switch(t){case"blob":return n.newBlob(n.transformTo("arraybuffer",e),r);case"base64":return o.encode(e);default:return n.transformTo(t,e)}}(u,function(t,e){var r,n=0,i=null,s=0;for(r=0;r>>6:(r<65536?e[o++]=224|r>>>12:(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63),e[o++]=128|r>>>6&63),e[o++]=128|63&r);return e}(t)},r.utf8decode=function(t){return i.nodebuffer?n.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,r,i,s,o=t.length,u=new Array(2*o);for(e=r=0;e>10&1023,u[r++]=56320|1023&i)}return u.length!==r&&(u.subarray?u=u.subarray(0,r):u.length=r),n.applyFromCharCode(u)}(t=n.transformTo(i.uint8array?"uint8array":"array",t))},n.inherits(h,o),h.prototype.processChunk=function(t){var e=n.transformTo(i.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var s=e;(e=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),e.set(s,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var o=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+a[t[r]]>e?r:e}(e),u=e;o!==e.length&&(i.uint8array?(u=e.subarray(0,o),this.leftOver=e.subarray(o,e.length)):(u=e.slice(0,o),this.leftOver=e.slice(o,e.length))),this.push({data:r.utf8decode(u),meta:t.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=h,n.inherits(c,o),c.prototype.processChunk=function(t){this.push({data:r.utf8encode(t.data),meta:t.meta})},r.Utf8EncodeWorker=c},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,r){"use strict";var n=t("./support"),i=t("./base64"),s=t("./nodejsUtils"),o=t("set-immediate-shim"),a=t("./external");function u(t){return t}function h(t,e){for(var r=0;r>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(t){if(this.extraFields[1]){var e=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e,r,n,i=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4>>6:(r<65536?e[o++]=224|r>>>12:(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63),e[o++]=128|r>>>6&63),e[o++]=128|63&r);return e},r.buf2binstring=function(t){return u(t,t.length)},r.binstring2buf=function(t){for(var e=new n.Buf8(t.length),r=0,i=e.length;r>10&1023,h[n++]=56320|1023&i)}return u(h,n)},r.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+o[t[r]]>e?r:e}},{"./common":41}],43:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){for(var i=65535&t|0,s=t>>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e,r,i){var s=n,o=i+r;t^=-1;for(var a=i;a>>8^s[255&(t^e[a])];return-1^t}},{}],46:[function(t,e,r){"use strict";var n,i=t("../utils/common"),s=t("./trees"),o=t("./adler32"),a=t("./crc32"),u=t("./messages"),h=-2,c=258,l=262,f=113;function d(t,e){return t.msg=u[e],e}function p(t){return(t<<1)-(4t.avail_out&&(r=t.avail_out),0!==r&&(i.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function v(t,e){s._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,g(t.strm)}function y(t,e){t.pending_buf[t.pending++]=e}function b(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function w(t,e){var r,n,i=t.max_chain_length,s=t.strstart,o=t.prev_length,a=t.nice_match,u=t.strstart>t.w_size-l?t.strstart-(t.w_size-l):0,h=t.window,f=t.w_mask,d=t.prev,p=t.strstart+c,m=h[s+o-1],g=h[s+o];t.prev_length>=t.good_match&&(i>>=2),a>t.lookahead&&(a=t.lookahead);do{if(h[(r=e)+o]===g&&h[r+o-1]===m&&h[r]===h[s]&&h[++r]===h[s+1]){s+=2,r++;do{}while(h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&su&&0!=--i);return o<=t.lookahead?o:t.lookahead}function M(t){var e,r,n,s,u,h,c,f,d,p,m=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=m+(m-l)){for(i.arraySet(t.window,t.window,m,m,0),t.match_start-=m,t.strstart-=m,t.block_start-=m,e=r=t.hash_size;n=t.head[--e],t.head[e]=m<=n?n-m:0,--r;);for(e=r=m;n=t.prev[--e],t.prev[e]=m<=n?n-m:0,--r;);s+=m}if(0===t.strm.avail_in)break;if(h=t.strm,c=t.window,f=t.strstart+t.lookahead,p=void 0,(d=s)<(p=h.avail_in)&&(p=d),r=0===p?0:(h.avail_in-=p,i.arraySet(c,h.input,h.next_in,p,f),1===h.state.wrap?h.adler=o(h.adler,c,p,f):2===h.state.wrap&&(h.adler=a(h.adler,c,p,f)),h.next_in+=p,h.total_in+=p,p),t.lookahead+=r,t.lookahead+t.insert>=3)for(u=t.strstart-t.insert,t.ins_h=t.window[u],t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3)if(n=s._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3&&t.match_length<=t.prev_length){for(i=t.strstart+t.lookahead-3,n=s._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=i&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(M(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,v(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-l&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(v(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(v(t,!1),t.strm.avail_out),1)})),new S(4,4,8,4,x),new S(4,5,16,8,x),new S(4,6,32,32,x),new S(4,4,16,16,_),new S(8,16,32,32,_),new S(8,16,128,128,_),new S(8,32,128,256,_),new S(32,128,258,1024,_),new S(32,258,258,4096,_)],r.deflateInit=function(t,e){return E(t,e,8,15,8,0)},r.deflateInit2=E,r.deflateReset=O,r.deflateResetKeep=A,r.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?h:(t.state.gzhead=e,0):h},r.deflate=function(t,e){var r,i,o,u;if(!t||!t.state||5>8&255),y(i,i.gzhead.time>>16&255),y(i,i.gzhead.time>>24&255),y(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),y(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(y(i,255&i.gzhead.extra.length),y(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=a(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(y(i,0),y(i,0),y(i,0),y(i,0),y(i,0),y(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),y(i,3),i.status=f);else{var l=8+(i.w_bits-8<<4)<<8;l|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(l|=32),l+=31-l%31,i.status=f,b(i,l),0!==i.strstart&&(b(i,t.adler>>>16),b(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),g(t),o=i.pending,i.pending!==i.pending_buf_size));)y(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),g(t),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexo&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),g(t),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexo&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&g(t),i.pending+2<=i.pending_buf_size&&(y(i,255&t.adler),y(i,t.adler>>8&255),t.adler=0,i.status=f)):i.status=f),0!==i.pending){if(g(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&p(e)<=p(r)&&4!==e)return d(t,-5);if(666===i.status&&0!==t.avail_in)return d(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&666!==i.status){var w=2===i.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(M(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(v(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(v(t,!1),0===t.strm.avail_out)?1:2}(i,e):3===i.strategy?function(t,e){for(var r,n,i,o,a=t.window;;){if(t.lookahead<=c){if(M(t),t.lookahead<=c&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&0t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=s._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(v(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(v(t,!1),0===t.strm.avail_out)?1:2}(i,e):n[i.level].func(i,e);if(3!==w&&4!==w||(i.status=666),1===w||3===w)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===w&&(1===e?s._tr_align(i):5!==e&&(s._tr_stored_block(i,0,0,!1),3===e&&(m(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),g(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(y(i,255&t.adler),y(i,t.adler>>8&255),y(i,t.adler>>16&255),y(i,t.adler>>24&255),y(i,255&t.total_in),y(i,t.total_in>>8&255),y(i,t.total_in>>16&255),y(i,t.total_in>>24&255)):(b(i,t.adler>>>16),b(i,65535&t.adler)),g(t),0=r.w_size&&(0===a&&(m(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new i.Buf8(r.w_size),i.arraySet(f,e,d-r.w_size,r.w_size,0),e=f,d=r.w_size),u=t.avail_in,c=t.next_in,l=t.input,t.avail_in=d,t.next_in=0,t.input=e,M(r);r.lookahead>=3;){for(n=r.strstart,s=r.lookahead-2;r.ins_h=(r.ins_h<>>=w=b>>>24,p-=w,0==(w=b>>>16&255))A[s++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=m[(65535&b)+(d&(1<>>=w,p-=w),p<15&&(d+=P[n++]<>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=g[(65535&b)+(d&(1<>>=w,p-=w,(w=s-o)>3,d&=(1<<(p-=M<<3))-1,t.next_in=n,t.next_out=s,t.avail_in=n>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function l(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(852),e.distcode=e.distdyn=new n.Buf32(592),e.sane=1,e.back=-1,0):u}function f(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,l(t)):u}function d(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15=o.wsize?(n.arraySet(o.window,e,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i<(s=o.wsize-o.wnext)&&(s=i),n.arraySet(o.window,e,r-i,s,o.wnext),(i-=s)?(n.arraySet(o.window,e,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=s(r.check,F,2,0),v=g=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&g)<<8)+(g>>8))%31){t.msg="incorrect header check",r.mode=30;break}if(8!=(15&g)){t.msg="unknown compression method",r.mode=30;break}if(v-=4,C=8+(15&(g>>>=4)),0===r.wbits)r.wbits=C;else if(C>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,r.check=s(r.check,F,2,0)),v=g=0,r.mode=3;case 3:for(;v<32;){if(0===p)break t;p--,g+=c[f++]<>>8&255,F[2]=g>>>16&255,F[3]=g>>>24&255,r.check=s(r.check,F,4,0)),v=g=0,r.mode=4;case 4:for(;v<16;){if(0===p)break t;p--,g+=c[f++]<>8),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,r.check=s(r.check,F,2,0)),v=g=0,r.mode=5;case 5:if(1024&r.flags){for(;v<16;){if(0===p)break t;p--,g+=c[f++]<>>8&255,r.check=s(r.check,F,2,0)),v=g=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(p<(x=r.length)&&(x=p),x&&(r.head&&(C=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,c,f,x,C)),512&r.flags&&(r.check=s(r.check,c,x,f)),p-=x,f+=x,r.length-=x),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===p)break t;for(x=0;C=c[f+x++],r.head&&C&&r.length<65536&&(r.head.name+=String.fromCharCode(C)),C&&x>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;v<32;){if(0===p)break t;p--,g+=c[f++]<>>=7&v,v-=7&v,r.mode=27;break}for(;v<3;){if(0===p)break t;p--,g+=c[f++]<>>=1)){case 0:r.mode=14;break;case 1:if(y(r),r.mode=20,6!==e)break;g>>>=2,v-=2;break t;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}g>>>=2,v-=2;break;case 14:for(g>>>=7&v,v-=7&v;v<32;){if(0===p)break t;p--,g+=c[f++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&g,v=g=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(x=r.length){if(p>>=5,v-=5,r.ndist=1+(31&g),g>>>=5,v-=5,r.ncode=4+(15&g),g>>>=4,v-=4,286>>=3,v-=3}for(;r.have<19;)r.lens[j[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,R={bits:r.lenbits},B=a(0,r.lens,0,19,r.lencode,0,r.work,R),r.lenbits=R.bits,B){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,O=65535&L,!((P=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<>>=P,v-=P,r.lens[r.have++]=O;else{if(16===O){for(T=P+2;v>>=P,v-=P,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}C=r.lens[r.have-1],x=3+(3&g),g>>>=2,v-=2}else if(17===O){for(T=P+3;v>>=P)),g>>>=3,v-=3}else{for(T=P+7;v>>=P)),g>>>=7,v-=7}if(r.have+x>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;x--;)r.lens[r.have++]=C}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,R={bits:r.lenbits},B=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,R),r.lenbits=R.bits,B){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,R={bits:r.distbits},B=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,R),r.distbits=R.bits,B){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(6<=p&&258<=m){t.next_out=d,t.avail_out=m,t.next_in=f,t.avail_in=p,r.hold=g,r.bits=v,o(t,M),d=t.next_out,l=t.output,m=t.avail_out,f=t.next_in,c=t.input,p=t.avail_in,g=r.hold,v=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;A=(L=r.lencode[g&(1<>>16&255,O=65535&L,!((P=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<>E)])>>>16&255,O=65535&L,!(E+(P=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<>>=E,v-=E,r.back+=E}if(g>>>=P,v-=P,r.back+=P,r.length=O,0===A){r.mode=26;break}if(32&A){r.back=-1,r.mode=12;break}if(64&A){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&A,r.mode=22;case 22:if(r.extra){for(T=r.extra;v>>=r.extra,v-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;A=(L=r.distcode[g&(1<>>16&255,O=65535&L,!((P=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<>E)])>>>16&255,O=65535&L,!(E+(P=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<>>=E,v-=E,r.back+=E}if(g>>>=P,v-=P,r.back+=P,64&A){t.msg="invalid distance code",r.mode=30;break}r.offset=O,r.extra=15&A,r.mode=24;case 24:if(r.extra){for(T=r.extra;v>>=r.extra,v-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===m)break t;if(x=M-m,r.offset>x){if((x=r.offset-x)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}_=x>r.wnext?(x-=r.wnext,r.wsize-x):r.wnext-x,x>r.length&&(x=r.length),S=r.window}else S=l,_=d-r.offset,x=r.length;for(my?(w=j[D+l[S]],R[T+l[S]]):(w=96,0),d=1<<_-k,P=p=1<>k)+(p-=d)]=b<<24|w<<16|M|0,0!==p;);for(d=1<<_-1;B&d;)d>>=1;if(0!==d?(B&=d-1,B+=d):B=0,S++,0==--L[_]){if(_===A)break;_=e[r+l[S]]}if(O<_&&(B&g)!==m){for(0===k&&(k=O),v+=P,I=1<<(E=_-k);E+k>>7)]}function x(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function _(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<>>=1,r<<=1,0<--e;);return r>>>1}function A(t,e,r){var n,i,o=new Array(16),a=0;for(n=1;n<=s;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=e;i++){var u=t[2*i+1];0!==u&&(t[2*i]=P(o[u]++,u))}}function O(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function E(t){8>1;1<=r;r--)I(t,o,r);for(i=h;r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],I(t,o,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,o[2*i]=o[2*r]+o[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,o[2*r+1]=o[2*n+1]=i,t.heap[1]=i++,I(t,o,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,o,a,u,h=e.dyn_tree,c=e.max_code,l=e.stat_desc.static_tree,f=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,m=e.stat_desc.max_length,g=0;for(o=0;o<=s;o++)t.bl_count[o]=0;for(h[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)m<(o=h[2*h[2*(n=t.heap[r])+1]+1]+1)&&(o=m,g++),h[2*n+1]=o,c>=7;n<30;n++)for(y[n]=i<<7,t=0;t<1<>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),B(t,t.l_desc),B(t,t.d_desc),o=function(t){var e;for(R(t,t.dyn_ltree,t.l_desc.max_code),R(t,t.dyn_dtree,t.d_desc.max_code),B(t,t.bl_desc),e=18;3<=e&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==e?F(t,e,r,n):4===t.strategy||s===i?(_(t,2+(n?1:0),3),C(t,c,l)):(_(t,4+(n?1:0),3),function(t,e,r,n){var i;for(_(t,e-257,5),_(t,r-1,5),_(t,n-4,4),i=0;i>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(d[r]+256+1)]++,t.dyn_dtree[2*M(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){var e;_(t,2,3),S(t,256,c),16===(e=t).bi_valid?(x(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},{"../utils/common":41}],53:[function(t,e,r){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,r){"use strict";e.exports="function"==typeof setImmediate?setImmediate:function(){var t=[].slice.apply(arguments);t.splice(1,0,0),setTimeout.apply(null,t)}},{}]},{},[10])(10)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)},5666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,s=Object.create(i.prototype),o=new E(n||[]);return s._invoke=function(t,e,r){var n=l;return function(i,s){if(n===d)throw new Error("Generator is already running");if(n===p){if("throw"===i)throw s;return I()}for(r.method=i,r.arg=s;;){var o=r.delegate;if(o){var a=P(o,r);if(a){if(a===m)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var u=c(t,e,r);if("normal"===u.type){if(n=r.done?p:f,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=p,r.method="throw",r.arg=u.arg)}}}(t,r,o),s}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var l="suspendedStart",f="suspendedYield",d="executing",p="completed",m={};function g(){}function v(){}function y(){}var b={};u(b,s,(function(){return this}));var w=Object.getPrototypeOf,M=w&&w(w(k([])));M&&M!==r&&n.call(M,s)&&(b=M);var x=y.prototype=g.prototype=Object.create(b);function _(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(i,s,o,a){var u=c(t[i],t,s);if("throw"!==u.type){var h=u.arg,l=h.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,o,a)}),(function(t){r("throw",t,o,a)})):e.resolve(l).then((function(t){h.value=t,o(h)}),(function(t){return r("throw",t,o,a)}))}a(u.arg)}var i;this._invoke=function(t,n){function s(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(s,s):s()}}function P(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method))return m;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var i=c(n,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var s=i.arg;return s?s.done?(r[t.resultName]=s.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function k(t){if(t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i=0;--s){var o=this.tryEntries[s],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=n.call(o,"catchLoc"),h=n.call(o,"finallyLoc");if(u&&h){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;O(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:k(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},5072:function(t,e,r){var n,i;void 0===(i="function"==typeof(n=function(){return function(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var e=document.createElement("base");if(e.href=arguments[0],1===t)return e.href;var r=document.getElementsByTagName("head")[0];r.insertBefore(e,r.firstChild);for(var n,i=document.createElement("a"),s=1;s{var n;!function(){"use strict";var i=.5*(Math.sqrt(3)-1),s=(3-Math.sqrt(3))/6,o=1/6,a=(Math.sqrt(5)-1)/4,u=(5-Math.sqrt(5))/20;function h(t){var e;e="function"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=l();t=i(" "),e=i(" "),r=i(" ");for(var s=0;s>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}h.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,o=this.permMod12,a=this.perm,u=this.grad3,h=0,c=0,l=0,f=(t+e)*i,d=Math.floor(t+f),p=Math.floor(e+f),m=(d+p)*s,g=t-(d-m),v=e-(p-m);g>v?(r=1,n=0):(r=0,n=1);var y=g-r+s,b=v-n+s,w=g-1+2*s,M=v-1+2*s,x=255&d,_=255&p,S=.5-g*g-v*v;if(S>=0){var P=3*o[x+a[_]];h=(S*=S)*S*(u[P]*g+u[P+1]*v)}var A=.5-y*y-b*b;if(A>=0){var O=3*o[x+r+a[_+n]];c=(A*=A)*A*(u[O]*y+u[O+1]*b)}var E=.5-w*w-M*M;if(E>=0){var k=3*o[x+1+a[_+1]];l=(E*=E)*E*(u[k]*w+u[k+1]*M)}return 70*(h+c+l)},noise3D:function(t,e,r){var n,i,s,a,u,h,c,l,f,d,p=this.permMod12,m=this.perm,g=this.grad3,v=.3333333333333333*(t+e+r),y=Math.floor(t+v),b=Math.floor(e+v),w=Math.floor(r+v),M=(y+b+w)*o,x=t-(y-M),_=e-(b-M),S=r-(w-M);x>=_?_>=S?(u=1,h=0,c=0,l=1,f=1,d=0):x>=S?(u=1,h=0,c=0,l=1,f=0,d=1):(u=0,h=0,c=1,l=1,f=0,d=1):_B?L++:F++,C>R?L++:j++,C>T?L++:D++,B>R?F++:j++,B>T?F++:D++,R>T?j++:D++;var z=C-(l=L>=3?1:0)+u,q=B-(f=F>=3?1:0)+u,N=R-(d=j>=3?1:0)+u,U=T-(p=D>=3?1:0)+u,Y=C-(m=L>=2?1:0)+2*u,V=B-(g=F>=2?1:0)+2*u,Z=R-(v=j>=2?1:0)+2*u,G=T-(y=D>=2?1:0)+2*u,$=C-(b=L>=1?1:0)+3*u,X=B-(w=F>=1?1:0)+3*u,H=R-(M=j>=1?1:0)+3*u,W=T-(x=D>=1?1:0)+3*u,J=C-1+4*u,Q=B-1+4*u,K=R-1+4*u,tt=T-1+4*u,et=255&A,rt=255&O,nt=255&E,it=255&k,st=.6-C*C-B*B-R*R-T*T;if(st<0)i=0;else{var ot=_[et+_[rt+_[nt+_[it]]]]%32*4;i=(st*=st)*st*(S[ot]*C+S[ot+1]*B+S[ot+2]*R+S[ot+3]*T)}var at=.6-z*z-q*q-N*N-U*U;if(at<0)s=0;else{var ut=_[et+l+_[rt+f+_[nt+d+_[it+p]]]]%32*4;s=(at*=at)*at*(S[ut]*z+S[ut+1]*q+S[ut+2]*N+S[ut+3]*U)}var ht=.6-Y*Y-V*V-Z*Z-G*G;if(ht<0)o=0;else{var ct=_[et+m+_[rt+g+_[nt+v+_[it+y]]]]%32*4;o=(ht*=ht)*ht*(S[ct]*Y+S[ct+1]*V+S[ct+2]*Z+S[ct+3]*G)}var lt=.6-$*$-X*X-H*H-W*W;if(lt<0)h=0;else{var ft=_[et+b+_[rt+w+_[nt+M+_[it+x]]]]%32*4;h=(lt*=lt)*lt*(S[ft]*$+S[ft+1]*X+S[ft+2]*H+S[ft+3]*W)}var dt=.6-J*J-Q*Q-K*K-tt*tt;if(dt<0)c=0;else{var pt=_[et+1+_[rt+1+_[nt+1+_[it+1]]]]%32*4;c=(dt*=dt)*dt*(S[pt]*J+S[pt+1]*Q+S[pt+2]*K+S[pt+3]*tt)}return 27*(i+s+o+h+c)}},h._buildPermutationTable=c,void 0===(n=function(){return h}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=h,t.exports=h}()},6479:(t,e,r)=>{var n;!function(){"use strict";function i(t,e,r){var n=e.x,i=e.y,s=r.x-n,o=r.y-i;if(0!==s||0!==o){var a=((t.x-n)*s+(t.y-i)*o)/(s*s+o*o);a>1?(n=r.x,i=r.y):a>0&&(n+=s*a,i+=o*a)}return(s=t.x-n)*s+(o=t.y-i)*o}function s(t,e,r,n,o){for(var a,u=n,h=e+1;hu&&(a=h,u=c)}u>n&&(a-e>1&&s(t,e,a,n,o),o.push(t[a]),r-a>1&&s(t,a,r,n,o))}function o(t,e){var r=t.length-1,n=[t[0]];return s(t,0,r,e,n),n.push(t[r]),n}function a(t,e,r){if(t.length<=2)return t;var n=void 0!==e?e*e:1;return o(t=r?t:function(t,e){for(var r,n,i,s,o,a=t[0],u=[a],h=1,c=t.length;he&&(u.push(r),a=r);return a!==r&&u.push(r),u}(t,n),n)}void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";var t=n;Object.defineProperty(t,"__esModule",{value:!0}),t.Urpflanze=void 0;const e=r(5475);t.Urpflanze=e,t.default=e})(),n})()})); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Urpflanze=e():t.Urpflanze=e()}(window,(function(){return(()=>{var t={1346:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.log=e.PI2=e.PHI=e.Vec2=e.distributePointsInBuffer=e.prepareBufferForInterpolation=e.interpolate=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.now=e.toRadians=e.toDegrees=e.relativeClamp=e.clamp=e.lerp=void 0,i(r(1378),e),i(r(541),e),i(r(2513),e),i(r(2648),e),i(r(3674),e),i(r(6951),e),i(r(7439),e),i(r(6448),e),i(r(8563),e),i(r(5382),e),i(r(6329),e),i(r(4233),e),i(r(5510),e),i(r(2982),e),i(r(7520),e),i(r(9667),e),i(r(894),e),i(r(5719),e),i(r(1451),e),i(r(3977),e),i(r(9958),e),i(r(9514),e);var s=r(313);Object.defineProperty(e,"lerp",{enumerable:!0,get:function(){return s.lerp}}),Object.defineProperty(e,"clamp",{enumerable:!0,get:function(){return s.clamp}}),Object.defineProperty(e,"relativeClamp",{enumerable:!0,get:function(){return s.relativeClamp}}),Object.defineProperty(e,"toDegrees",{enumerable:!0,get:function(){return s.toDegrees}}),Object.defineProperty(e,"toRadians",{enumerable:!0,get:function(){return s.toRadians}}),Object.defineProperty(e,"now",{enumerable:!0,get:function(){return s.now}}),Object.defineProperty(e,"noise",{enumerable:!0,get:function(){return s.noise}}),Object.defineProperty(e,"random",{enumerable:!0,get:function(){return s.random}}),Object.defineProperty(e,"angleFromRepetition",{enumerable:!0,get:function(){return s.angleFromRepetition}}),Object.defineProperty(e,"angle2FromRepetition",{enumerable:!0,get:function(){return s.angle2FromRepetition}}),Object.defineProperty(e,"distanceFromRepetition",{enumerable:!0,get:function(){return s.distanceFromRepetition}}),Object.defineProperty(e,"interpolate",{enumerable:!0,get:function(){return s.interpolate}}),Object.defineProperty(e,"prepareBufferForInterpolation",{enumerable:!0,get:function(){return s.prepareBufferForInterpolation}}),Object.defineProperty(e,"distributePointsInBuffer",{enumerable:!0,get:function(){return s.distributePointsInBuffer}});var o=r(795);Object.defineProperty(e,"Vec2",{enumerable:!0,get:function(){return o.default}});var a=r(3792);Object.defineProperty(e,"PHI",{enumerable:!0,get:function(){return a.PHI}}),Object.defineProperty(e,"PI2",{enumerable:!0,get:function(){return a.PI2}}),Object.defineProperty(e,"log",{enumerable:!0,get:function(){return a.log}}),Object.defineProperty(e,"mod",{enumerable:!0,get:function(){return a.mod}})},2915:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(5475),e)},9367:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.DrawerCanvas=e.Animation=void 0,i(r(1346),e),e.Animation=r(7518);var s=r(2251);Object.defineProperty(e,"DrawerCanvas",{enumerable:!0,get:function(){return s.BrowserDrawerCanvas}})},5475:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.SVGImporter=e.SVGExporter=e.GCODEExporter=e.Timeline=e.Renderer=e.Color=void 0,i(r(9367),e),e.Color=r(7358);var s=r(1532);Object.defineProperty(e,"Renderer",{enumerable:!0,get:function(){return s.Renderer}}),Object.defineProperty(e,"Timeline",{enumerable:!0,get:function(){return s.Timeline}});var o=r(884);Object.defineProperty(e,"GCODEExporter",{enumerable:!0,get:function(){return o.GCODEExporter}});var a=r(7773);Object.defineProperty(e,"SVGExporter",{enumerable:!0,get:function(){return a.SVGExporter}});var u=r(5052);Object.defineProperty(e,"SVGImporter",{enumerable:!0,get:function(){return u.SVGImporter}})},50:t=>{"use strict";t.exports=JSON.parse('{"name":"@ffmpeg/ffmpeg","version":"0.10.1","description":"FFmpeg WebAssembly version","main":"src/index.js","types":"src/index.d.ts","directories":{"example":"examples"},"scripts":{"start":"node scripts/server.js","build":"rimraf dist && webpack --config scripts/webpack.config.prod.js","prepublishOnly":"npm run build","lint":"eslint src","wait":"rimraf dist && wait-on http://localhost:3000/dist/ffmpeg.dev.js","test":"npm-run-all -p -r start test:all","test:all":"npm-run-all wait test:browser:ffmpeg test:node:all","test:node":"node --experimental-wasm-threads --experimental-wasm-bulk-memory node_modules/.bin/_mocha --exit --bail --require ./scripts/test-helper.js","test:node:all":"npm run test:node -- ./tests/*.test.js","test:browser":"mocha-headless-chrome -a allow-file-access-from-files -a incognito -a no-sandbox -a disable-setuid-sandbox -a disable-logging -t 300000","test:browser:ffmpeg":"npm run test:browser -- -f ./tests/ffmpeg.test.html"},"browser":{"./src/node/index.js":"./src/browser/index.js"},"repository":{"type":"git","url":"git+https://github.com/ffmpegwasm/ffmpeg.wasm.git"},"keywords":["ffmpeg","WebAssembly","video"],"author":"Jerome Wu ","license":"MIT","bugs":{"url":"https://github.com/ffmpegwasm/ffmpeg.wasm/issues"},"engines":{"node":">=12.16.1"},"homepage":"https://github.com/ffmpegwasm/ffmpeg.wasm#readme","dependencies":{"is-url":"^1.2.4","node-fetch":"^2.6.1","regenerator-runtime":"^0.13.7","resolve-url":"^0.2.1"},"devDependencies":{"@babel/core":"^7.12.3","@babel/preset-env":"^7.12.1","@ffmpeg/core":"^0.10.0","@types/emscripten":"^1.39.4","babel-loader":"^8.1.0","chai":"^4.2.0","cors":"^2.8.5","eslint":"^7.12.1","eslint-config-airbnb-base":"^14.1.0","eslint-plugin-import":"^2.22.1","express":"^4.17.1","mocha":"^8.2.1","mocha-headless-chrome":"^2.0.3","npm-run-all":"^4.1.5","wait-on":"^5.3.0","webpack":"^5.3.2","webpack-cli":"^4.1.0","webpack-dev-middleware":"^4.0.0"}}')},4076:(t,e,r)=>{r(5072);const{devDependencies:n}=r(50);t.exports={corePath:`https://unpkg.com/@ffmpeg/core@${n["@ffmpeg/core"].substring(1)}/dist/ffmpeg-core.js`}},2339:(t,e,r)=>{const n=r(5072);t.exports=async t=>{let e=t;if(void 0===t)return new Uint8Array;if("string"==typeof t)if(/data:_data\/([a-zA-Z]*);base64,([^"]*)/.test(t))e=atob(t.split(",")[1]).split("").map((t=>t.charCodeAt(0)));else{const r=await fetch(n(t));e=await r.arrayBuffer()}else(t instanceof File||t instanceof Blob)&&(e=await(r=t,new Promise(((t,e)=>{const n=new FileReader;n.onload=()=>{t(n.result)},n.onerror=({target:{error:{code:t}}})=>{e(Error(`File could not be read! Code=${t}`))},n.readAsArrayBuffer(r)}))));var r;return new Uint8Array(e)}},1440:(t,e,r)=>{const n=r(5072),{log:i}=r(888),s=async(t,e)=>{i("info",`fetch ${t}`);const r=await(await fetch(t)).arrayBuffer();i("info",`${t} file size = ${r.byteLength} bytes`);const n=new Blob([r],{type:e}),s=URL.createObjectURL(n);return i("info",`${t} blob URL = ${s}`),s};t.exports=async({corePath:t})=>{if("string"!=typeof t)throw Error("corePath should be a string!");const e=n(t),r=await s(e,"application/javascript"),o=await s(e.replace("ffmpeg-core.js","ffmpeg-core.wasm"),"application/wasm"),a=await s(e.replace("ffmpeg-core.js","ffmpeg-core.worker.js"),"application/javascript");return"undefined"==typeof createFFmpegCore?new Promise((t=>{const e=document.createElement("script"),n=()=>{e.removeEventListener("load",n),i("info","ffmpeg-core.js script loaded"),t({createFFmpegCore,corePath:r,wasmPath:o,workerPath:a})};e.src=r,e.type="text/javascript",e.addEventListener("load",n),document.getElementsByTagName("head")[0].appendChild(e)})):(i("info","ffmpeg-core.js script is loaded already"),Promise.resolve({createFFmpegCore,corePath:r,wasmPath:o,workerPath:a}))}},3451:(t,e,r)=>{const n=r(4076),i=r(1440),s=r(2339);t.exports={defaultOptions:n,getCreateFFmpegCore:i,fetchFile:s}},1617:t=>{t.exports={defaultArgs:["./ffmpeg","-nostdin","-y"],baseOptions:{log:!1,logger:()=>{},progress:()=>{},corePath:""}}},9289:(t,e,r)=>{const{defaultArgs:n,baseOptions:i}=r(1617),{setLogging:s,setCustomLogger:o,log:a}=r(888),u=r(6405),h=r(7010),{defaultOptions:c,getCreateFFmpegCore:l}=r(3451),{version:f}=r(50),d=Error("ffmpeg.wasm is not ready, make sure you have completed load().");t.exports=(t={})=>{const{log:e,logger:r,progress:p,...m}={...i,...c,...t};let g=null,v=null,y=null,b=!1,w=p;const M=({type:t,message:e})=>{a(t,e),u(e,w),(t=>{"FFMPEG_END"===t&&null!==y&&(y(),y=null,b=!1)})(e)};return s(e),o(r),a("info",`use ffmpeg.wasm v${f}`),{setProgress:t=>{w=t},setLogger:t=>{o(t)},setLogging:s,load:async()=>{if(a("info","load ffmpeg-core"),null!==g)throw Error("ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.");{a("info","loading ffmpeg-core");const{createFFmpegCore:t,corePath:e,workerPath:r,wasmPath:n}=await l(m);g=await t({mainScriptUrlOrBlob:e,printErr:t=>M({type:"fferr",message:t}),print:t=>M({type:"ffout",message:t}),locateFile:(t,e)=>{if("undefined"!=typeof window){if(void 0!==n&&t.endsWith("ffmpeg-core.wasm"))return n;if(void 0!==r&&t.endsWith("ffmpeg-core.worker.js"))return r}return e+t}}),v=g.cwrap("proxy_main","number",["number","number"]),a("info","ffmpeg-core loaded")}},isLoaded:()=>null!==g,run:(...t)=>{if(a("info",`run ffmpeg command: ${t.join(" ")}`),null===g)throw d;if(b)throw Error("ffmpeg.wasm can only run one command at a time");return b=!0,new Promise((e=>{const r=[...n,...t].filter((t=>0!==t.length));y=e,v(...h(g,r))}))},exit:()=>{if(null===g)throw d;b=!1,g.exit(1),g=null,v=null,y=null},FS:(t,...e)=>{if(a("info",`run FS.${t} ${e.map((t=>"string"==typeof t?t:`<${t.length} bytes binary file>`)).join(" ")}`),null===g)throw d;{let r=null;try{r=g.FS[t](...e)}catch(r){throw"readdir"===t?Error(`ffmpeg.FS('readdir', '${e[0]}') error. Check if the path exists, ex: ffmpeg.FS('readdir', '/')`):"readFile"===t?Error(`ffmpeg.FS('readFile', '${e[0]}') error. Check if the path exists`):Error("Oops, something went wrong in FS operation.")}return r}}}}},5045:(t,e,r)=>{r(5666);const n=r(9289),{fetchFile:i}=r(3451);t.exports={createFFmpeg:n,fetchFile:i}},888:t=>{let e=!1,r=()=>{};t.exports={logging:e,setLogging:t=>{e=t},setCustomLogger:t=>{r=t},log:(t,n)=>{r({type:t,message:n}),e&&console.log(`[${t}] ${n}`)}}},7010:t=>{t.exports=(t,e)=>{const r=t._malloc(e.length*Uint32Array.BYTES_PER_ELEMENT);return e.forEach(((e,n)=>{const i=t._malloc(e.length+1);t.writeAsciiToMemory(e,i),t.setValue(r+Uint32Array.BYTES_PER_ELEMENT*n,i,"i32")})),[e.length,r]}},6405:t=>{let e=0,r=0;const n=t=>{const[e,r,n]=t.split(":");return 60*parseFloat(e)*60+60*parseFloat(r)+parseFloat(n)};t.exports=(t,i)=>{if("string"==typeof t)if(t.startsWith(" Duration")){const s=t.split(", ")[0].split(": ")[1],o=n(s);i({duration:o,ratio:r}),(0===e||e>o)&&(e=o)}else if(t.startsWith("frame")||t.startsWith("size")){const s=t.split("time=")[1].split(" ")[0],o=n(s);r=o/e,i({ratio:r,time:o})}else t.startsWith("video:")&&(i({ratio:1}),e=0)}},2894:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UncontrolledLoop=e.Static=e.Loop=e.Compose=e.Simple=e.resolveSimpleAnimation=void 0;const n=r(4825),i=r(2765);function s(t){const e=i.createAnimation(t);if(e)return t=>{var r;const n="number"==typeof t?t:(null===(r=t.shape.scene)||void 0===r?void 0:r.currentTime)||0;return e.update(n),e.value}}e.resolveSimpleAnimation=s,e.Simple=s,e.Compose=t=>{const e=n.composeAnimations(t);if(e)return t=>{var r;const n="number"==typeof t?t:(null===(r=t.shape.scene)||void 0===r?void 0:r.currentTime)||0;return e(n)}},e.Loop=t=>{const e=t;return void 0===e.interpolator&&(e.interpolator="wave"),e.interpolator&&("string"==typeof e.interpolator?"wave"!==e.interpolator&&(e.direction="alternate"):"object"==typeof e.interpolator&&"wave"!==e.interpolator.type&&(e.direction="alternate")),e.loop=!0,s(e)},e.Static=t=>{const e=t;return e.direction="normal",e.loop=!1,s(e)},e.UncontrolledLoop=t=>{const e=t;return e.direction="normal",e.loop=!0,s(e)}},9727:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=void 0;const r={linear:(t,e,r,n=1)=>r*t/n+e,quadraticIn:(t,e,r,n=1)=>r*(t/=n)*t+e,quadraticOut:(t,e,r,n=1)=>-r*(t/=n)*(t-2)+e,quadraticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t+e:-r/2*(--t*(t-2)-1)+e,cubicIn:(t,e,r,n=1)=>r*(t/=n)*t*t+e,cubicOut:(t,e,r,n=1)=>(t/=n,r*(--t*t*t+1)+e),cubicInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t+e:r/2*((t-=2)*t*t+2)+e,quarticIn:(t,e,r,n=1)=>r*(t/=n)*t*t*t+e,quarticOut:(t,e,r,n=1)=>(t/=n,-r*(--t*t*t*t-1)+e),quarticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t*t+e:-r/2*((t-=2)*t*t*t-2)+e,quinticIn:(t,e,r,n=1)=>r*(t/=n)*t*t*t*t+e,quinticOut:(t,e,r,n=1)=>(t/=n,r*(--t*t*t*t*t+1)+e),quinticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t*t*t+e:r/2*((t-=2)*t*t*t*t+2)+e,sinusoidalIn:(t,e,r,n=1)=>-r*Math.cos(t/n*(Math.PI/2))+r+e,sinusoidalOut:(t,e,r,n=1)=>r*Math.sin(t/n*(Math.PI/2))+e,sinusoidalInOut:(t,e,r,n=1)=>-r/2*(Math.cos(Math.PI*t/n)-1)+e,exponentialIn:(t,e,r,n=1)=>r*Math.pow(2,10*(t/n-1))+e,exponentialOut:(t,e,r,n=1)=>r*(1-Math.pow(2,-10*t/n))+e,exponentialInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*Math.pow(2,10*(t-1))+e:(t--,r/2*(2-Math.pow(2,-10*t))+e),circularIn:(t,e,r,n=1)=>(t/=n,-r*(Math.sqrt(1-t*t)-1)+e),circularOut:(t,e,r,n=1)=>(t/=n,t--,r*Math.sqrt(1-t*t)+e),circularInOut:(t,e,r,n=1)=>(t/=n/2)<1?-r/2*(Math.sqrt(1-t*t)-1)+e:(t-=2,r/2*(Math.sqrt(1-t*t)+1)+e),elasticIn:(t,e,r,n=1,i=1,s=.5)=>{if(0===t)return e;if(1==(t/=n))return e+r;s*=n;let o=0;return i{if(0===t)return e;if(1==(t/=n))return e+r;s*=n;let o=0;return i{if(0===t)return e;if(2==(t/=n/2))return e+r;s*=n;let o=0;return ir*(t/=n)*t*((i+1)*t-i)+e,backOut:(t,e,r,n=1,i=1.70158)=>r*((t=t/n-1)*t*((i+1)*t+i)+1)+e,backInOut:(t,e,r,n=1,i=1.70158)=>(t/=n/2)<1?r/2*(t*t*((1+(i*=1.525))*t-i))+e:r/2*((t-=2)*t*((1+(i*=1.525))*t+i)+2)+e,bounceIn:(t,e,n,i=1)=>n-r.bounceOut(i-t,0,n,i)+e,bounceOut:(t,e,r,n=1)=>(t/=n)<1/2.75?r*(7.5625*t*t)+e:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+e:r*(7.5625*(t-=2.625/2.75)*t+.984375)+e,bounceInOut:(t,e,n,i=1)=>t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.composeAnimations=void 0;const n=r(7358),i=r(2765),s=r(8782);function o(t,e,r=.5){const i=Array.isArray(t)?t:[t],o=Array.isArray(e)?e:[e],a=[];for(let t=0,e=i.length;tvoid 0!==t)),r=e.length;if(r>0)return t=>{let n;for(let i=0;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createAnimation=void 0;const n=r(9298);e.createAnimation=function(t){const e=n.createInterpolationCallback(t);if(void 0===e)return;const r=t.delay||0,i=t.afterDelay||0,s=t.direction||"normal",o=t.duration||1e3,a="normal"===s||"reverse"===s?o+r:2*o+r+i,u={delay:r,afterDelay:i,direction:s,duration:o,totalDuration:a,loop:"number"==typeof t.loop?t.loop:!!t.loop},h=n.createInterpolator(t.interpolator),c={loop:0,offset:0,loopDuration:a,direction:"alternate"===s?"normal":s,started:!1,ended:!1,value:void 0};return c.update=function(t,e,r,n){const{loop:i,totalDuration:s,delay:o,afterDelay:a,direction:u,duration:h}=e;return c=>{if("number"==typeof i&&c>=s*i||!1===i&&c>=e.totalDuration)return t.started=!1,t.ended=!0,t.offset=r("normal"===u?h:0,h),void(t.value=n(t.offset));if(t.loop=Math.ceil(c/s),c%=s,(c-=o)<=0)return t.started=!1,t.offset=r(0,h),void(t.value=n(t.offset));if(t.started=!0,"alternate"===u)c<=h?(t.direction="normal",t.offset=r(c,h)):(t.direction="reverse",c-=h,(c-=a)>=0?t.offset=1-r(c>=h?h:c,h):t.offset=1);else{const e=r(c>=h?h:c,h);t.offset="normal"===u?e:1-e}t.value=n(t.offset)}}(c,u,h,e),c}},9298:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createInterpolator=e.createInterpolationCallback=void 0;const n=r(7358),i=r(3431),s=r(9727),o=r(8782);e.createInterpolationCallback=function(t){const e=Array.isArray(t.from)?t.from:[t.from],r=Array.isArray(t.to)?t.to:[t.to],i=t.round,s="hue"===t.colorTransitionMode?o.interpolateColorHSL:o.interpolateColorRGB;if(e.length!==r.length)return;const a=[];for(let t=0,o=e.length;t1===t?s:0===t?n:Math.round((n+t*(s-n))*i)/i:t=>1===t?s:0===t?n:n+t*(s-n))}else{const i=e[t],o=r[t],u=n.parseColorAndConvert(i),h=n.parseColorAndConvert(o);void 0!==u&&void 0!==h&&a.push((t=>1===t?o:0===t?i:s(u,h,t)))}}return t=>{const e=a.map((e=>e(t)));return 1===e.length?e[0]:e}},e.createInterpolator=function(t){var e,r;switch(typeof t){case"function":return(e,r)=>t(e/r,e);case"string":switch(t){case"wave":return(t,e)=>.5+.5*Math.sin(t*Math.PI*2/e+1.5*Math.PI);default:if(t in s.Easings){const e=s.Easings[t];return(t,r)=>e(t,0,1,r)}return(t,e)=>s.Easings.linear(t,0,1,e)}case"object":switch(t.type){case"wave":{const r=1.5*Math.PI+((null===(e=t.params)||void 0===e?void 0:e.phase)||0);return(t,e)=>.5+.5*Math.sin(t*Math.PI*2/e+r)}case"elasticIn":case"elasticOut":case"elasticInOut":{const e=s.Easings[t.type],{amplitude:r,period:n}=t.params||{};return(t,i)=>e(t,0,1,i,r,n)}case"backIn":case"backOut":case"backInOut":{const e=s.Easings[t.type],n=(null===(r=t.params)||void 0===r?void 0:r.overshoot)||void 0;return(t,r)=>e(t,0,1,r,n)}case"cubicBezier":{const e=i.default(t.params[0],t.params[1],t.params[2],t.params[3]);return(t,r)=>e(t/r)}}}return(t,e)=>s.Easings.linear(t,0,1,e)}},7518:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(5240),e),i(r(8782),e),i(r(2765),e),i(r(9298),e),i(r(9727),e),i(r(2894),e)},5240:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},8782:(t,e)=>{"use strict";function r(t,e,r=!0,n="alternate",i=0,s=0){const o="normal"===n||"reverse"===n?e+i:2*e+i+s;return"number"==typeof r&&t>=o*r||!1===r&&t>=o?"normal"===n?e:0:(t%=o,(t-=i)<=0?0:"alternate"===n?t<=e?t:(t-=e,(t-=s)>=0?e-(t>=e?e:t):e):t>=e?e:t)}Object.defineProperty(e,"__esModule",{value:!0}),e.interpolateColorHSL=e.interpolateColorRGB=e.cosp=e.sinp=e.clockOffset=e.clock=void 0,e.clock=r,e.clockOffset=function(t,e,n=!0,i="alternate",s=0,o=0){return r(t,e,n,i,s,o)/e};const n=2*Math.PI;e.sinp=function(t,e,r=0,i=!1){const s=Math.sin(t*n/e+r);return i?.5+.5*s:s},e.cosp=function(t,e,r=0,i=!1){const s=Math.cos(t*n/e+r);return i?.5+.5*s:s},e.interpolateColorRGB=function(t,e,r){const n=t.r+r*(e.r-t.r),i=t.g+r*(e.g-t.g),s=t.b+r*(e.b-t.b),o=t.alpha+r*(e.alpha-t.alpha);return`rgba(${Math.floor(n)},${Math.floor(i)},${Math.floor(s)},${o})`},e.interpolateColorHSL=function(t,e,r){return`hsla(${t.h+r*(e.h-t.h)},${t.s+r*(e.s-t.s)}%,${t.l+r*(e.l-t.l)}%,${t.alpha+r*(e.alpha-t.alpha)})`}},814:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rgbToHsl=e.hslToRgb=e.rgbToHex=void 0,e.rgbToHex=function(t,e,r){return`#${((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}`},e.hslToRgb=function(t,e,r){let n,i,s;if(t/=360,r/=100,0==(e/=100))n=i=s=r;else{const o=(t,e,r)=>(r+=r<0?1:r>1?-1:0)<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,a=r<.5?r*(1+e):r+e-r*e,u=2*r-a;n=o(u,a,t+1/3),i=o(u,a,t),s=o(u,a,t-1/3)}return[.5+255*n<<0,.5+255*i<<0,.5+255*s<<0]},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;const n=Math.max(t,e,r),i=Math.min(t,e,r),s=(n+i)/2;let o,a;if(n===i)o=a=0;else{const u=n-i;switch(a=s>.5?u/(2-n-i):u/(n+i),n){case t:o=(e-r)/u+(e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={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",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",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",rebeccapurple:"#663399",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",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},7358:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(6097),e),i(r(814),e),i(r(5576),e)},5576:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.parseColorAndConvert=void 0;const n=r(4947),i=r(814);function s(t){if("number"==typeof t)return t>16777215?{type:"rgb",a:t>>24&255,b:t>>16&255,c:t>>8&255,alpha:(255&t)/255}:{type:"rgb",a:t>>16&255,b:t>>8&255,c:255&t,alpha:1};t=t.replace(/\s/g,""),n.default[t]&&(t=n.default[t]);let e=/^#([0-9a-f]{3,8})$/i.exec(t);if(e){const t=e[1];return 3===t.length?{type:"rgb",a:parseInt(t[0]+t[0],16),b:parseInt(t[1]+t[1],16),c:parseInt(t[2]+t[2],16),alpha:1}:{type:"rgb",a:parseInt(t[0]+t[1],16),b:parseInt(t[2]+t[3],16),c:parseInt(t[4]+t[5],16),alpha:t.length>6?parseInt(t.substring(6),16)/255:1}}if(e=/^((hsl|rgb)a?)\((\d+),(\d+)%?,(\d+)%?,?(.+)?\)$/i.exec(t),e){const[,,t,r,n,i,s]=e;return{type:t,a:+r,b:+n,c:+i,alpha:s?+s:1}}}e.parseColorAndConvert=function(t){const e=s(t);if(e){if("hsl"===e.type){const[t,r,n]=i.hslToRgb(e.a,e.b,e.c);return{r:t,g:r,b:n,h:e.a,s:e.b,l:e.c,alpha:e.alpha}}{const[t,r,n]=i.rgbToHsl(e.a,e.b,e.c);return{h:t,s:r,l:n,r:e.a,g:e.b,b:e.c,alpha:e.alpha}}}},e.parseColor=s},6097:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1172:t=>{window,t.exports=(()=>{var t={193:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Group=void 0;const n=r(107),i=r(15),s=r(485),o=r(658);class a extends i.SceneChild{constructor(t={}){t.type="Group",super(t),this.children=[],["id","name","data","order","type"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=o.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){"object"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=a},107:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Scene=void 0;const n=r(15),i=r(193),s=r(775),o=r(932);class a{constructor(t={}){this.width=400,this.height=400,this.background="hsla(0, 0%, 0%, 1)",this.color="hsla(0, 0%, 100%, 1)",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?(.5+.5*o.clamp(-1,1,t.anchor[0]))*this.width:"left"===t.anchor[0]?0:"right"===t.anchor[0]?this.width:this.center[0],"number"==typeof t.anchor[1]?(.5+.5*o.clamp(-1,1,t.anchor[1]))*this.height:"top"===t.anchor[1]?0:"bottom"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e="number"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,a.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{a.propagateToChilden(t,e)})):t instanceof s.Shape&&t.shape&&(t.shape.scene=e,a.propagateToChilden(t.shape,e))}}e.Scene=a},15:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||"SceneChild",this.name=t.name||this.type+"_"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){"string"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},932:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(21),i=r(345),s=r(271),o="undefined"!=typeof performance?performance:Date;function a(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return o.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=a,e.relativeClamp=function(t,e,r,n,i){return a(n,i,(r-t)/(e-t)*(i-n)+n)};const u={random:new n(Math.random)};e.noise=function(t="random",e=0,r=0,i=0){return void 0===u[t]&&(u[t]=new n(t)),u[t].noise3D(e,r,i)};const h={};function c(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),s=rn?[s,o]:[o,s]}function l(t,e){const r=t.length,n=r/2,i=2*(n+e),s=n-1;if(s>1){const n=r-2,o=Math.floor(e/s);let a=(i-(r+o*n))/2;const u=Math.round(s/a),h=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%u==0||e===n-2),p=o+(d?1:0),m=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);h[i]=(s=t(),o=t(),a=t(),u=t(),function(){let t=(s>>>=0)+(o>>>=0)|0;return s=o^o>>>9,o=(a>>>=0)+(a<<3)|0,t=t+(u=1+(u>>>=0)|0)|0,a=(a=a<<21|a>>>11)+t|0,(t>>>0)/4294967296})}var s,o,a,u;const c=e+h[i]()*(r-e);return void 0!==n?Math.round(c*10**n)/10**n:c},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return s.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=c,e.interpolate=function(t,e,r=.5){const[n,i]=c(t,e),s=Math.max(n.length,i.length),o="number"==typeof r?[r]:r,a=s/2;if(o.length!==a){const t=o.length;for(let e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return"number"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},348:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(887);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},888:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},658:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(700);var i;!function(t){t[t.None=0]="None",t[t.Scale=2]="Scale",t[t.Center=4]="Center",t[t.Fill=8]="Fill"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn("[Urplfanze:Bounding] cannot sum bounding")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn("[Urplfanze:Bounding] cannot bind bounding")}};class s extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return s.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=s.getBounding(t));const o=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,a=e>=i.Center?r.cx:0,u=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Close=void 0;const n=r(700);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},991:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Mirror=void 0;const n=r(700);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let s=0;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},62:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Offset=void 0;const n=r(700);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i},785:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Smooth=void 0;const n=r(932),i=r(364),s=r(700);class o extends s.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Solidify=void 0;const n=r(700);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const s=[],o=(e="number"==typeof e?[e]:e).length;let a,u,h=[[0,0],[0,0]],c=[[0,0],[0,0]];for(let r=0,l=0,f=t.length-2;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Subdivide=void 0;const n=r(700);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Modifiers=void 0;const n=r(658),i=r(991),s=r(785),o=r(982),a=r(301),u=r(364),h=r(62),c={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:s.Smooth,Solidify:o.Solidify,Subdivide:a.Subdivide,Close:u.Close,Offset:h.Offset};e.Modifiers=c},775:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=void 0;const n=r(107),i=r(15),s=r(485);class o extends s.ShapeBase{constructor(t){t.type=t.type||"Shape",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn("[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\nYou passed:",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):o.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBase=void 0;const n=r(887),i=r(46),s=r(348),o=r(271),a=r(888),u=r(658),h=r(932),c=r(15),l=n.mat4.create(),f=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class m extends c.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?-1*h.clamp(-1,1,t.anchor[0]):"left"===t.anchor[0]?1:"right"===t.anchor[0]?-1:0,"number"==typeof t.anchor[1]?-1*h.clamp(-1,1,t.anchor[1]):"top"===t.anchor[1]?1:"bottom"===t.anchor[1]?-1:0]:[0,0],this.boundingType="string"==typeof t.boundingType?"relative"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return"function"!=typeof t.repetitions&&"function"!=typeof t.distance&&"function"!=typeof t.displace&&"function"!=typeof t.scale&&"function"!=typeof t.translate&&"function"!=typeof t.skewX&&"function"!=typeof t.skewY&&"function"!=typeof t.squeezeX&&"function"!=typeof t.squeezeY&&"function"!=typeof t.rotateX&&"function"!=typeof t.rotateY&&"function"!=typeof t.rotateZ&&"function"!=typeof t.transformOrigin&&"function"!=typeof t.perspective&&"function"!=typeof t.perspectiveOrigin}isStaticIndexed(){return"function"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return"function"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){"string"==typeof t?(r=r||"repetitions"==t,this.props[t]=e):(r=r||"repetitions"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var c,g;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const v=m.getEmptyPropArguments(this,r),y=v.repetition,b=this.getProp("repetitions",v,1),w=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,M=Array.isArray(b)?b[0]*(null!==(c=b[1])&&void 0!==c?c:b[0]):b,x=Array.isArray(b)?b[0]:M,_=Array.isArray(b)?null!==(g=b[1])&&void 0!==g?g:b[0]:1,S=y.row;S.count=x;const P=y.col;P.count=_,y.count=M,y.col.count=_,y.row.count=x,y.type=w;let A=0;const O=[];let E=0;const k=n.vec2.fromValues((_-1)/2,(x-1)/2),I=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],C=[void 0,void 0,void 0,void 0],B=[void 0,void 0,void 0,void 0];for(let r=0;r1?E/(M-1):1,y.angle=w===i.ERepetitionType.Ring?a.PI2/M*E:0,P.index=c+1,P.offset=_>1?c/(_-1):1,S.index=r+1,S.offset=x>1?r/(x-1):1;const m=this.generateBuffer(t,v),g=m.length,b=this.getShapeBounding();O[E]=new Float32Array(g),A+=g;{const t=s.toVec2(this.getProp("distance",v,s.VEC2_ZERO)),a=this.getProp("displace",v,0),M=s.toVec3(this.getProp("scale",v,s.VEC2_ONE),1),x=s.toVec3(this.getProp("translate",v,s.VEC2_ZERO),0),_=this.getProp("skewX",v,0),S=this.getProp("skewY",v,0),P=this.getProp("squeezeX",v,0),A=this.getProp("squeezeY",v,0),R=this.getProp("rotateX",v,0),T=this.getProp("rotateY",v,0),L=this.getProp("rotateZ",v,0),F=h.clamp(0,1,this.getProp("perspective",v,0)),j=s.toVec3(this.getProp("perspectiveOrigin",v,s.VEC2_ZERO),0),D=s.toVec3(this.getProp("transformOrigin",v,s.VEC2_ZERO),0);let z;switch(w){case i.ERepetitionType.Ring:z=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(z,z,s.VEC3_ZERO,y.angle+a);break;case i.ERepetitionType.Matrix:z=n.vec3.fromValues(t[1]*(c-k[0]),t[0]*(r-k[1]),0)}const q=F>0?Math.max(b.width,b.height)/2:1,N=F>0?q+10*q*(1-F):0,U=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==F||0!==D[0]||0!==D[1],Y=0!==j[0]||0!==j[1];U&&(this.boundingType===i.EBoundingType.Relative?(D[0]=D[0]*(b.width/2)+b.cx,D[1]=D[1]*(b.height/2)+b.cy):(D[0]*=b.width/2,D[1]*=b.height/2),D[2]=N);{n.mat4.identity(f),U&&n.mat4.translate(f,f,D),0===x[0]&&0===x[1]||n.mat4.translate(f,f,x),0===_&&0===S||(s.fromSkew(l,[_,S]),n.mat4.multiply(f,f,l)),0!==R&&n.mat4.rotateX(f,f,R),0!==T&&n.mat4.rotateY(f,f,T),0!==L&&n.mat4.rotateZ(f,f,L),1===M[0]&&1===M[1]||n.mat4.scale(f,f,M),U&&n.mat4.translate(f,f,n.vec3.scale(D,D,-1)),N>0&&(Y&&(this.boundingType===i.EBoundingType.Relative?(j[0]=j[0]*(b.width/2)+b.cx,j[1]=j[1]*(b.height/2)+b.cy):(j[0]*=b.width/2,j[1]*=b.height/2),j[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,z),e&&n.mat4.translate(p,p,I);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),w===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,y.angle+a)}u.Bounding.clear(B);for(let t=0;t0&&(Y&&n.vec3.add(e,e,j),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,N),Y&&n.vec3.sub(e,e,j)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=g/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,v)}O[E][t]=e[0],O[E][t+1]=e[1],u.Bounding.add(B,e[0],e[1]),u.Bounding.add(C,e[0],e[1])}}const R={cx:0,cy:0,x:-1,y:-1,width:2,height:2};u.Bounding.bind(R,B),this.bStaticIndexed&&this.bIndexed||this.addIndex(g,y,R)}u.Bounding.bind(this.bounding,C),this.buffer=new Float32Array(A);for(let t=0,e=0,r=O.length;t({index:1,offset:1,count:1}),m.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...m.getEmptySimpleRepetition(),row:m.getEmptySimpleRepetition(),col:m.getEmptySimpleRepetition()})},425:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBuffer=void 0;const n=r(658),i=r(436);class s extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||"ShapeBuffer",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn("[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property"),this.shape=s.EMPTY_BUFFER):this.shape="function"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return"function"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from("function"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,s=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&"function"!=typeof this.props.sideLength&&"function"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=s},549:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeFollow=void 0;const n=r(775);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeFollow",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},s=this.shape;s.generate(t,!1,i);let o=s.getBuffer();const a=o.length,u=new Float32Array(a*(n.length/2)),h=n.length/2;for(let e=0;e1?e/(h-1):1,count:h};this.shapeUseFollow&&(i.follow=r,s.generate(t,!1,i),o=s.getBuffer());const c=e*a,l=2*e,f=n[l],d=n[l+1];for(let t=0,e=o.length;t1?t/(e-1):1;for(let o=0,a=s.length;o{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeLoop=void 0;const n=r(888),i=r(658),s=r(436),o=r(485);class a extends s.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||"ShapeLoop",super(t),this.loopDependencies=(t.loopDependencies||[]).concat("sideLength"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes("propArguments"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}"loop"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||o.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?("function"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),s=this.getRepetitionSideLength(t),o=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,a={index:0,offset:0,current:0,count:n},u=a.count,h=new Float32Array(2*u);for(let n=0,i=0;n1?n/(a.count-1):1;a.current=s,a.index=n+1,a.offset=u;const c=o(a,t);h[i]=c[0],h[i+1]=c[1]}const c=[void 0,void 0,void 0,void 0],l=this.applyModifiers(h,t);for(let t=0,e=l.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapePrimitive=void 0;const n=r(348),i=r(485),s=r(700),o=r(658);class a extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=o.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:"function"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return"function"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:"number"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp("sideLength",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeRecursive=void 0;const n=r(775);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeRecursive",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionScale&&"function"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp("recursions",e,1)),n=Math.floor(this.getProp("recursionVertex",e,0)),s=this.getProp("recursionScale",e,2),o=this.shape;let a={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const u={...e,recursion:a};o.generate(t,!1,u);const h=o.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=h);let c=h;const l=[a];let f=0,d=1;const p=c.length,m=p/2,g=n<=0?m:Math.min(n,m),v=0===n?1:m/Math.min(n,m),y=new Float32Array(i.summmation(r,g)*p);for(let t=0;t1?e/(r-1):1,h=i.summmation(e,g)*p,m=e-1,b=0===m?0:i.summmation(m,g)*p;for(let i=0,m=g**e;i1?i/(m-1):1,count:m,level:{index:e+1,offset:n,count:r},parent:l[f]},l.push(a),this.shapeUseRecursion&&(u.recursion=a,o.generate(t,!1,u),c=o.getBuffer());const w=h+i*p,M=Math.floor(b+2*i*v),x=y[M],_=y[M+1],S=s**e;for(let t=0,e=p;t1?0:1,count:s}}},u=this.shape.getIndexedBuffer()||[];for(let t=0,e=u.length;t1?0:1,count:s}},i={...a,recursion:r},o=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:o})}if(s>1){const t=this.shape.getBufferLength({...i,parent:{...a}})/2,e=o<=0?t:Math.min(o,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let h=0,c=1;for(let t=1;t1?t/(s-1):1;for(let o=0,l=e**t;o1?o/(l-1):1;for(let d=0,p=u.length;d{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Circle=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){t.type="Circle",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=s},702:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Line=void 0;const n=r(658),i=r(425);class s extends i.ShapeBuffer{constructor(t={}){t.type="Line",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lissajous=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){t.type="Lissajous",t.loopDependencies=(t.loopDependencies||[]).concat(["wx","wy","wz"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp("wx",t),r=this.getProp("wy",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),s=this.getRepetitionSideLength(t);return 1/Math.pow(s[0]*s[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp("wx",t,1),this.wy=this.getProp("wy",t,2),this.wz=this.getProp("wz",t,2),super.generateLoopBuffer(t)}}e.Lissajous=s},873:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Polygon=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["sideNumber"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp("sideNumber",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=s},478:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Rect=void 0;const n=r(658),i=r(425);class s extends i.ShapeBuffer{constructor(t={}){t.type="Rect",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=s,s.buffer=[1,1,-1,1,-1,-1,1,-1]},710:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Rose=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){var e,r;t.type="Rose",t.loopDependencies=(t.loopDependencies||[]).concat(["n","d"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>s.getFinalAngleFromK(this.getProp("n",t),this.getProp("d",t)),inc:t=>{const e=this.getProp("n",t),r=this.getProp("d",t),i=this.getRepetitionSideLength(t),s=Math.pow(i[0]*i[1],.45),o=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp("n",t)/this.getProp("d",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=s},82:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Spiral=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type="Spiral",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat(["twists","twistsStart","spiral"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:s.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp("twistsStart",t),end:t=>n.PI2*(this.getProp("twistsStart",t)+this.getProp("twists",t)),inc:t=>{const e=this.getProp("twists",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp("spiral",t),this.r=s.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case s.types.ARCHIMEDE:return t=>t/10;case s.types.HYPERBOLIC:return t=>1/t*3;case s.types.FERMAT:return t=>t**.5/3;case s.types.LITUUS:return t=>t**-.5;case s.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=s,s.types={ARCHIMEDE:"ARCHIMEDE",HYPERBOLIC:"HYPERBOLIC",FERMAT:"FERMAT",LITUUS:"LITUUS",LOGARITHMIC:"LOGARITHMIC"}},490:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Star=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["spikes","innerRadius"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp("spikes",t,5),this.innerRadius=this.getProp("innerRadius",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=s},845:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SuperShape=void 0;const n=r(888),i=r(210);class s extends i.ShapeLoop{constructor(t={}){var e,r,i,s,o,a;t.type="SuperShape",t.loopDependencies=(t.loopDependencies||[]).concat(["a","b","m","n1","n2","n3"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(s=t.n1)&&void 0!==s?s:1,this.props.n2=null!==(o=t.n2)&&void 0!==o?o:1,this.props.n3=null!==(a=t.n3)&&void 0!==a?a:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp("a",t),this.b=this.getProp("b",t),this.m=this.getProp("m",t),this.n1=this.getProp("n1",t),this.n2=this.getProp("n2",t),this.n3=this.getProp("n3",t),super.generateLoopBuffer(t)}}e.SuperShape=s},123:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Triangle=void 0;const n=r(658),i=r(425);class s extends i.ShapeBuffer{constructor(t={}){t.type="Triangle",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=s,s.buffer=[1,0,-1,1,-1,-1]},46:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(574),e),i(r(636),e),i(r(345),e),i(r(920),e),i(r(676),e),i(r(300),e),i(r(273),e),i(r(511),e)},574:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},636:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},345:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]="Ring",r[r.Matrix=2]="Matrix"},920:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},676:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},300:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]="Relative",r[r.Fixed=2]="Fixed"},273:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},511:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},887:(t,e,r)=>{"use strict";r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>s,mat3:()=>o,mat4:()=>a,quat:()=>c,quat2:()=>l,vec2:()=>f,vec3:()=>u,vec4:()=>h});var n={};r.r(n),r.d(n,{ARRAY_TYPE:()=>p,EPSILON:()=>d,RANDOM:()=>m,equals:()=>b,setMatrixArrayType:()=>g,toRadian:()=>y});var i={};r.r(i),r.d(i,{LDU:()=>j,add:()=>D,adjoint:()=>E,clone:()=>M,copy:()=>x,create:()=>w,determinant:()=>k,equals:()=>N,exactEquals:()=>q,frob:()=>F,fromRotation:()=>R,fromScaling:()=>T,fromValues:()=>S,identity:()=>_,invert:()=>O,mul:()=>V,multiply:()=>I,multiplyScalar:()=>U,multiplyScalarAndAdd:()=>Y,rotate:()=>C,scale:()=>B,set:()=>P,str:()=>L,sub:()=>Z,subtract:()=>z,transpose:()=>A});var s={};r.r(s),r.d(s,{add:()=>ht,clone:()=>$,copy:()=>X,create:()=>G,determinant:()=>K,equals:()=>pt,exactEquals:()=>dt,frob:()=>ut,fromRotation:()=>it,fromScaling:()=>st,fromTranslation:()=>ot,fromValues:()=>W,identity:()=>H,invert:()=>Q,mul:()=>mt,multiply:()=>tt,multiplyScalar:()=>lt,multiplyScalarAndAdd:()=>ft,rotate:()=>et,scale:()=>rt,set:()=>J,str:()=>at,sub:()=>gt,subtract:()=>ct,translate:()=>nt});var o={};r.r(o),r.d(o,{add:()=>Nt,adjoint:()=>At,clone:()=>bt,copy:()=>wt,create:()=>vt,determinant:()=>Ot,equals:()=>Gt,exactEquals:()=>Zt,frob:()=>qt,fromMat2d:()=>Lt,fromMat4:()=>yt,fromQuat:()=>Ft,fromRotation:()=>Rt,fromScaling:()=>Tt,fromTranslation:()=>Bt,fromValues:()=>Mt,identity:()=>_t,invert:()=>Pt,mul:()=>$t,multiply:()=>Et,multiplyScalar:()=>Yt,multiplyScalarAndAdd:()=>Vt,normalFromMat4:()=>jt,projection:()=>Dt,rotate:()=>It,scale:()=>Ct,set:()=>xt,str:()=>zt,sub:()=>Xt,subtract:()=>Ut,translate:()=>kt,transpose:()=>St});var a={};r.r(a),r.d(a,{add:()=>Te,adjoint:()=>ne,clone:()=>Wt,copy:()=>Jt,create:()=>Ht,determinant:()=>ie,equals:()=>ze,exactEquals:()=>De,frob:()=>Re,fromQuat:()=>Pe,fromQuat2:()=>be,fromRotation:()=>pe,fromRotationTranslation:()=>ye,fromRotationTranslationScale:()=>_e,fromRotationTranslationScaleOrigin:()=>Se,fromScaling:()=>de,fromTranslation:()=>fe,fromValues:()=>Qt,fromXRotation:()=>me,fromYRotation:()=>ge,fromZRotation:()=>ve,frustum:()=>Ae,getRotation:()=>xe,getScaling:()=>Me,getTranslation:()=>we,identity:()=>te,invert:()=>re,lookAt:()=>Ie,mul:()=>qe,multiply:()=>se,multiplyScalar:()=>Fe,multiplyScalarAndAdd:()=>je,ortho:()=>ke,perspective:()=>Oe,perspectiveFromFieldOfView:()=>Ee,rotate:()=>ue,rotateX:()=>he,rotateY:()=>ce,rotateZ:()=>le,scale:()=>ae,set:()=>Kt,str:()=>Be,sub:()=>Ne,subtract:()=>Le,targetTo:()=>Ce,translate:()=>oe,transpose:()=>ee});var u={};r.r(u),r.d(u,{add:()=>Xe,angle:()=>_r,bezier:()=>mr,ceil:()=>Qe,clone:()=>Ye,copy:()=>Ge,create:()=>Ue,cross:()=>fr,dist:()=>Br,distance:()=>sr,div:()=>Cr,divide:()=>Je,dot:()=>lr,equals:()=>Or,exactEquals:()=>Ar,floor:()=>Ke,forEach:()=>Fr,fromValues:()=>Ze,hermite:()=>pr,inverse:()=>hr,len:()=>Tr,length:()=>Ve,lerp:()=>dr,max:()=>er,min:()=>tr,mul:()=>Ir,multiply:()=>We,negate:()=>ur,normalize:()=>cr,random:()=>gr,rotateX:()=>wr,rotateY:()=>Mr,rotateZ:()=>xr,round:()=>rr,scale:()=>nr,scaleAndAdd:()=>ir,set:()=>$e,sqrDist:()=>Rr,sqrLen:()=>Lr,squaredDistance:()=>or,squaredLength:()=>ar,str:()=>Pr,sub:()=>kr,subtract:()=>He,transformMat3:()=>yr,transformMat4:()=>vr,transformQuat:()=>br,zero:()=>Sr});var h={};r.r(h),r.d(h,{add:()=>Ur,ceil:()=>Gr,clone:()=>Dr,copy:()=>qr,create:()=>jr,cross:()=>un,dist:()=>wn,distance:()=>Kr,div:()=>bn,divide:()=>Zr,dot:()=>an,equals:()=>gn,exactEquals:()=>mn,floor:()=>$r,forEach:()=>Sn,fromValues:()=>zr,inverse:()=>sn,len:()=>xn,length:()=>en,lerp:()=>hn,max:()=>Hr,min:()=>Xr,mul:()=>yn,multiply:()=>Vr,negate:()=>nn,normalize:()=>on,random:()=>cn,round:()=>Wr,scale:()=>Jr,scaleAndAdd:()=>Qr,set:()=>Nr,sqrDist:()=>Mn,sqrLen:()=>_n,squaredDistance:()=>tn,squaredLength:()=>rn,str:()=>pn,sub:()=>vn,subtract:()=>Yr,transformMat4:()=>ln,transformQuat:()=>fn,zero:()=>dn});var c={};r.r(c),r.d(c,{add:()=>ei,calculateW:()=>Tn,clone:()=>Jn,conjugate:()=>Nn,copy:()=>Kn,create:()=>Pn,dot:()=>ii,equals:()=>fi,exactEquals:()=>li,exp:()=>Ln,fromEuler:()=>Yn,fromMat3:()=>Un,fromValues:()=>Qn,getAngle:()=>kn,getAxisAngle:()=>En,identity:()=>An,invert:()=>qn,len:()=>ai,length:()=>oi,lerp:()=>si,ln:()=>Fn,mul:()=>ri,multiply:()=>In,normalize:()=>ci,pow:()=>jn,random:()=>zn,rotateX:()=>Cn,rotateY:()=>Bn,rotateZ:()=>Rn,rotationTo:()=>di,scale:()=>ni,set:()=>ti,setAxes:()=>mi,setAxisAngle:()=>On,slerp:()=>Dn,sqlerp:()=>pi,sqrLen:()=>hi,squaredLength:()=>ui,str:()=>Vn});var l={};r.r(l),r.d(l,{add:()=>zi,clone:()=>vi,conjugate:()=>Gi,copy:()=>Si,create:()=>gi,dot:()=>Yi,equals:()=>ts,exactEquals:()=>Ki,fromMat4:()=>_i,fromRotation:()=>xi,fromRotationTranslation:()=>wi,fromRotationTranslationValues:()=>bi,fromTranslation:()=>Mi,fromValues:()=>yi,getDual:()=>Ei,getReal:()=>Oi,getTranslation:()=>Ci,identity:()=>Pi,invert:()=>Zi,len:()=>Xi,length:()=>$i,lerp:()=>Vi,mul:()=>Ni,multiply:()=>qi,normalize:()=>Ji,rotateAroundAxis:()=>Di,rotateByQuatAppend:()=>Fi,rotateByQuatPrepend:()=>ji,rotateX:()=>Ri,rotateY:()=>Ti,rotateZ:()=>Li,scale:()=>Ui,set:()=>Ai,setDual:()=>Ii,setReal:()=>ki,sqrLen:()=>Wi,squaredLength:()=>Hi,str:()=>Qi,translate:()=>Bi});var f={};r.r(f),r.d(f,{add:()=>os,angle:()=>Rs,ceil:()=>cs,clone:()=>rs,copy:()=>is,create:()=>es,cross:()=>Ps,dist:()=>Us,distance:()=>vs,div:()=>Ns,divide:()=>hs,dot:()=>Ss,equals:()=>js,exactEquals:()=>Fs,floor:()=>ls,forEach:()=>Zs,fromValues:()=>ns,inverse:()=>xs,len:()=>Ds,length:()=>bs,lerp:()=>As,max:()=>ds,min:()=>fs,mul:()=>qs,multiply:()=>us,negate:()=>Ms,normalize:()=>_s,random:()=>Os,rotate:()=>Bs,round:()=>ps,scale:()=>ms,scaleAndAdd:()=>gs,set:()=>ss,sqrDist:()=>Ys,sqrLen:()=>Vs,squaredDistance:()=>ys,squaredLength:()=>ws,str:()=>Ls,sub:()=>zs,subtract:()=>as,transformMat2:()=>Es,transformMat2d:()=>ks,transformMat3:()=>Is,transformMat4:()=>Cs,zero:()=>Ts});var d=1e-6,p="undefined"!=typeof Float32Array?Float32Array:Array,m=Math.random;function g(t){p=t}var v=Math.PI/180;function y(t){return t*v}function b(t,e){return Math.abs(t-e)<=d*Math.max(1,Math.abs(t),Math.abs(e))}function w(){var t=new p(4);return p!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function M(t){var e=new p(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function x(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function _(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function S(t,e,r,n){var i=new p(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function P(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function A(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function O(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*s-i*n;return o?(o=1/o,t[0]=s*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}function E(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function k(t){return t[0]*t[3]-t[2]*t[1]}function I(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*a+s*u,t[1]=i*a+o*u,t[2]=n*h+s*c,t[3]=i*h+o*c,t}function C(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u+s*a,t[1]=i*u+o*a,t[2]=n*-a+s*u,t[3]=i*-a+o*u,t}function B(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1];return t[0]=n*a,t[1]=i*a,t[2]=s*u,t[3]=o*u,t}function R(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function T(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function L(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function F(t){return Math.hypot(t[0],t[1],t[2],t[3])}function j(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function D(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function z(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function q(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function N(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=e[0],a=e[1],u=e[2],h=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(s-h)<=d*Math.max(1,Math.abs(s),Math.abs(h))}function U(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Y(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var V=I,Z=z;function G(){var t=new p(6);return p!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function $(t){var e=new p(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function X(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function H(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function W(t,e,r,n,i,s){var o=new p(6);return o[0]=t,o[1]=e,o[2]=r,o[3]=n,o[4]=i,o[5]=s,o}function J(t,e,r,n,i,s,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t}function Q(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=r*s-n*i;return u?(u=1/u,t[0]=s*u,t[1]=-n*u,t[2]=-i*u,t[3]=r*u,t[4]=(i*a-s*o)*u,t[5]=(n*o-r*a)*u,t):null}function K(t){return t[0]*t[3]-t[1]*t[2]}function tt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=r[0],c=r[1],l=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*h+s*c,t[1]=i*h+o*c,t[2]=n*l+s*f,t[3]=i*l+o*f,t[4]=n*d+s*p+a,t[5]=i*d+o*p+u,t}function et(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*h,t[1]=i*c+o*h,t[2]=n*-h+s*c,t[3]=i*-h+o*c,t[4]=a,t[5]=u,t}function rt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=r[0],c=r[1];return t[0]=n*h,t[1]=i*h,t[2]=s*c,t[3]=o*c,t[4]=a,t[5]=u,t}function nt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=n*h+s*c+a,t[5]=i*h+o*c+u,t}function it(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function st(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function ot(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function at(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function ut(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function ht(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function ct(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function lt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function ft(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function dt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function pt(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],u=e[0],h=e[1],c=e[2],l=e[3],f=e[4],p=e[5];return Math.abs(r-u)<=d*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-h)<=d*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-c)<=d*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(s-l)<=d*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(o-f)<=d*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-p)<=d*Math.max(1,Math.abs(a),Math.abs(p))}var mt=tt,gt=ct;function vt(){var t=new p(9);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function bt(t){var e=new p(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function wt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Mt(t,e,r,n,i,s,o,a,u){var h=new p(9);return h[0]=t,h[1]=e,h[2]=r,h[3]=n,h[4]=i,h[5]=s,h[6]=o,h[7]=a,h[8]=u,h}function xt(t,e,r,n,i,s,o,a,u,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=u,t[8]=h,t}function _t(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function St(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function Pt(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=c*o-a*h,f=-c*s+a*u,d=h*s-o*u,p=r*l+n*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-c*n+i*h)*p,t[2]=(a*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*u)*p,t[5]=(-a*r+i*s)*p,t[6]=d*p,t[7]=(-h*r+n*u)*p,t[8]=(o*r-n*s)*p,t):null}function At(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8];return t[0]=o*c-a*h,t[1]=i*h-n*c,t[2]=n*a-i*o,t[3]=a*u-s*c,t[4]=r*c-i*u,t[5]=i*s-r*a,t[6]=s*h-o*u,t[7]=n*u-r*h,t[8]=r*o-n*s,t}function Ot(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],u=t[7],h=t[8];return e*(h*s-o*u)+r*(-h*i+o*a)+n*(u*i-s*a)}function Et(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=r[0],d=r[1],p=r[2],m=r[3],g=r[4],v=r[5],y=r[6],b=r[7],w=r[8];return t[0]=f*n+d*o+p*h,t[1]=f*i+d*a+p*c,t[2]=f*s+d*u+p*l,t[3]=m*n+g*o+v*h,t[4]=m*i+g*a+v*c,t[5]=m*s+g*u+v*l,t[6]=y*n+b*o+w*h,t[7]=y*i+b*a+w*c,t[8]=y*s+b*u+w*l,t}function kt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=u,t[6]=f*n+d*o+h,t[7]=f*i+d*a+c,t[8]=f*s+d*u+l,t}function It(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*a,t[2]=d*s+f*u,t[3]=d*o-f*n,t[4]=d*a-f*i,t[5]=d*u-f*s,t[6]=h,t[7]=c,t[8]=l,t}function Ct(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Bt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function Rt(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Tt(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Lt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function Ft(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,u=i+i,h=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*u,m=s*o,g=s*a,v=s*u;return t[0]=1-l-p,t[3]=c-v,t[6]=f+g,t[1]=c+v,t[4]=1-h-p,t[7]=d-m,t[2]=f-g,t[5]=d+m,t[8]=1-h-l,t}function jt(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*u-i*o,w=r*h-s*o,M=n*u-i*a,x=n*h-s*a,_=i*h-s*u,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,O=l*g-f*m,E=l*v-d*m,k=f*v-d*g,I=y*k-b*E+w*O+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-u*E+h*O)*I,t[1]=(u*A-o*k-h*P)*I,t[2]=(o*E-a*A+h*S)*I,t[3]=(i*E-n*k-s*O)*I,t[4]=(r*k-i*A+s*P)*I,t[5]=(n*A-r*E-s*S)*I,t[6]=(m*_-g*x+v*M)*I,t[7]=(g*w-p*_-v*b)*I,t[8]=(p*x-m*w+v*y)*I,t):null}function Dt(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function zt(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function qt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Nt(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function Ut(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function Yt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function Vt(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function Zt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function Gt(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],u=t[6],h=t[7],c=t[8],l=e[0],f=e[1],p=e[2],m=e[3],g=e[4],v=e[5],y=e[6],b=e[7],w=e[8];return Math.abs(r-l)<=d*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(n-f)<=d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-p)<=d*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(s-m)<=d*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(o-g)<=d*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(a-v)<=d*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(u-y)<=d*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(h-b)<=d*Math.max(1,Math.abs(h),Math.abs(b))&&Math.abs(c-w)<=d*Math.max(1,Math.abs(c),Math.abs(w))}var $t=Et,Xt=Ut;function Ht(){var t=new p(16);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Wt(t){var e=new p(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Jt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Qt(t,e,r,n,i,s,o,a,u,h,c,l,f,d,m,g){var v=new p(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=n,v[4]=i,v[5]=s,v[6]=o,v[7]=a,v[8]=u,v[9]=h,v[10]=c,v[11]=l,v[12]=f,v[13]=d,v[14]=m,v[15]=g,v}function Kt(t,e,r,n,i,s,o,a,u,h,c,l,f,d,p,m,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=u,t[8]=h,t[9]=c,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=g,t}function te(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ee(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=i,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function re(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*u-i*o,w=r*h-s*o,M=n*u-i*a,x=n*h-s*a,_=i*h-s*u,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,O=l*g-f*m,E=l*v-d*m,k=f*v-d*g,I=y*k-b*E+w*O+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-u*E+h*O)*I,t[1]=(i*E-n*k-s*O)*I,t[2]=(m*_-g*x+v*M)*I,t[3]=(f*x-l*_-d*M)*I,t[4]=(u*A-o*k-h*P)*I,t[5]=(r*k-i*A+s*P)*I,t[6]=(g*w-p*_-v*b)*I,t[7]=(c*_-f*w+d*b)*I,t[8]=(o*E-a*A+h*S)*I,t[9]=(n*A-r*E-s*S)*I,t[10]=(p*x-m*w+v*y)*I,t[11]=(l*w-c*x-d*y)*I,t[12]=(a*P-o*O-u*S)*I,t[13]=(r*O-n*P+i*S)*I,t[14]=(m*b-p*M-g*y)*I,t[15]=(c*M-l*b+f*y)*I,t):null}function ne(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15];return t[0]=a*(f*v-d*g)-l*(u*v-h*g)+m*(u*d-h*f),t[1]=-(n*(f*v-d*g)-l*(i*v-s*g)+m*(i*d-s*f)),t[2]=n*(u*v-h*g)-a*(i*v-s*g)+m*(i*h-s*u),t[3]=-(n*(u*d-h*f)-a*(i*d-s*f)+l*(i*h-s*u)),t[4]=-(o*(f*v-d*g)-c*(u*v-h*g)+p*(u*d-h*f)),t[5]=r*(f*v-d*g)-c*(i*v-s*g)+p*(i*d-s*f),t[6]=-(r*(u*v-h*g)-o*(i*v-s*g)+p*(i*h-s*u)),t[7]=r*(u*d-h*f)-o*(i*d-s*f)+c*(i*h-s*u),t[8]=o*(l*v-d*m)-c*(a*v-h*m)+p*(a*d-h*l),t[9]=-(r*(l*v-d*m)-c*(n*v-s*m)+p*(n*d-s*l)),t[10]=r*(a*v-h*m)-o*(n*v-s*m)+p*(n*h-s*a),t[11]=-(r*(a*d-h*l)-o*(n*d-s*l)+c*(n*h-s*a)),t[12]=-(o*(l*g-f*m)-c*(a*g-u*m)+p*(a*f-u*l)),t[13]=r*(l*g-f*m)-c*(n*g-i*m)+p*(n*f-i*l),t[14]=-(r*(a*g-u*m)-o*(n*g-i*m)+p*(n*u-i*a)),t[15]=r*(a*f-u*l)-o*(n*f-i*l)+c*(n*u-i*a),t}function ie(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],u=t[7],h=t[8],c=t[9],l=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*s)*(l*g-f*m)-(e*a-n*s)*(c*g-f*p)+(e*u-i*s)*(c*m-l*p)+(r*a-n*o)*(h*g-f*d)-(r*u-i*o)*(h*m-l*d)+(n*u-i*a)*(h*p-c*d)}function se(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],v=e[14],y=e[15],b=r[0],w=r[1],M=r[2],x=r[3];return t[0]=b*n+w*a+M*l+x*m,t[1]=b*i+w*u+M*f+x*g,t[2]=b*s+w*h+M*d+x*v,t[3]=b*o+w*c+M*p+x*y,b=r[4],w=r[5],M=r[6],x=r[7],t[4]=b*n+w*a+M*l+x*m,t[5]=b*i+w*u+M*f+x*g,t[6]=b*s+w*h+M*d+x*v,t[7]=b*o+w*c+M*p+x*y,b=r[8],w=r[9],M=r[10],x=r[11],t[8]=b*n+w*a+M*l+x*m,t[9]=b*i+w*u+M*f+x*g,t[10]=b*s+w*h+M*d+x*v,t[11]=b*o+w*c+M*p+x*y,b=r[12],w=r[13],M=r[14],x=r[15],t[12]=b*n+w*a+M*l+x*m,t[13]=b*i+w*u+M*f+x*g,t[14]=b*s+w*h+M*d+x*v,t[15]=b*o+w*c+M*p+x*y,t}function oe(t,e,r){var n,i,s,o,a,u,h,c,l,f,d,p,m=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=u,t[6]=h,t[7]=c,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+a*g+l*v+e[12],t[13]=i*m+u*g+f*v+e[13],t[14]=s*m+h*g+d*v+e[14],t[15]=o*m+c*g+p*v+e[15]),t}function ae(t,e,r){var n=r[0],i=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ue(t,e,r,n){var i,s,o,a,u,h,c,l,f,p,m,g,v,y,b,w,M,x,_,S,P,A,O,E,k=n[0],I=n[1],C=n[2],B=Math.hypot(k,I,C);return B0?(r[0]=2*(a*o+c*n+u*s-h*i)/l,r[1]=2*(u*o+c*i+h*n-a*s)/l,r[2]=2*(h*o+c*s+a*i-u*n)/l):(r[0]=2*(a*o+c*n+u*s-h*i),r[1]=2*(u*o+c*i+h*n-a*s),r[2]=2*(h*o+c*s+a*i-u*n)),ye(t,e,r),t}function we(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Me(t,e){var r=e[0],n=e[1],i=e[2],s=e[4],o=e[5],a=e[6],u=e[8],h=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(s,o,a),t[2]=Math.hypot(u,h,c),t}function xe(t,e){var r=new p(3);Me(r,e);var n=1/r[0],i=1/r[1],s=1/r[2],o=e[0]*n,a=e[1]*i,u=e[2]*s,h=e[4]*n,c=e[5]*i,l=e[6]*s,f=e[8]*n,d=e[9]*i,m=e[10]*s,g=o+c+m,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(l-d)/v,t[1]=(f-u)/v,t[2]=(a-h)/v):o>c&&o>m?(v=2*Math.sqrt(1+o-c-m),t[3]=(l-d)/v,t[0]=.25*v,t[1]=(a+h)/v,t[2]=(f+u)/v):c>m?(v=2*Math.sqrt(1+c-o-m),t[3]=(f-u)/v,t[0]=(a+h)/v,t[1]=.25*v,t[2]=(l+d)/v):(v=2*Math.sqrt(1+m-o-c),t[3]=(a-h)/v,t[0]=(f+u)/v,t[1]=(l+d)/v,t[2]=.25*v),t}function _e(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3],u=i+i,h=s+s,c=o+o,l=i*u,f=i*h,d=i*c,p=s*h,m=s*c,g=o*c,v=a*u,y=a*h,b=a*c,w=n[0],M=n[1],x=n[2];return t[0]=(1-(p+g))*w,t[1]=(f+b)*w,t[2]=(d-y)*w,t[3]=0,t[4]=(f-b)*M,t[5]=(1-(l+g))*M,t[6]=(m+v)*M,t[7]=0,t[8]=(d+y)*x,t[9]=(m-v)*x,t[10]=(1-(l+p))*x,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function Se(t,e,r,n,i){var s=e[0],o=e[1],a=e[2],u=e[3],h=s+s,c=o+o,l=a+a,f=s*h,d=s*c,p=s*l,m=o*c,g=o*l,v=a*l,y=u*h,b=u*c,w=u*l,M=n[0],x=n[1],_=n[2],S=i[0],P=i[1],A=i[2],O=(1-(m+v))*M,E=(d+w)*M,k=(p-b)*M,I=(d-w)*x,C=(1-(f+v))*x,B=(g+y)*x,R=(p+b)*_,T=(g-y)*_,L=(1-(f+m))*_;return t[0]=O,t[1]=E,t[2]=k,t[3]=0,t[4]=I,t[5]=C,t[6]=B,t[7]=0,t[8]=R,t[9]=T,t[10]=L,t[11]=0,t[12]=r[0]+S-(O*S+I*P+R*A),t[13]=r[1]+P-(E*S+C*P+T*A),t[14]=r[2]+A-(k*S+B*P+L*A),t[15]=1,t}function Pe(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,u=i+i,h=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*u,m=s*o,g=s*a,v=s*u;return t[0]=1-l-p,t[1]=c+v,t[2]=f-g,t[3]=0,t[4]=c-v,t[5]=1-h-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-h-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ae(t,e,r,n,i,s,o){var a=1/(r-e),u=1/(i-n),h=1/(s-o);return t[0]=2*s*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*u,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*u,t[10]=(o+s)*h,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*h,t[15]=0,t}function Oe(t,e,r,n,i){var s,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(s=1/(n-i),t[10]=(i+n)*s,t[14]=2*i*n*s):(t[10]=-1,t[14]=-2*n),t}function Ee(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),u=2/(o+a),h=2/(i+s);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=h,t[6]=0,t[7]=0,t[8]=-(o-a)*u*.5,t[9]=(i-s)*h*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function ke(t,e,r,n,i,s,o){var a=1/(e-r),u=1/(n-i),h=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*u,t[14]=(o+s)*h,t[15]=1,t}function Ie(t,e,r,n){var i,s,o,a,u,h,c,l,f,p,m=e[0],g=e[1],v=e[2],y=n[0],b=n[1],w=n[2],M=r[0],x=r[1],_=r[2];return Math.abs(m-M)0&&(c*=d=1/Math.sqrt(d),l*=d,f*=d);var p=u*f-h*l,m=h*c-a*f,g=a*l-u*c;return(d=p*p+m*m+g*g)>0&&(p*=d=1/Math.sqrt(d),m*=d,g*=d),t[0]=p,t[1]=m,t[2]=g,t[3]=0,t[4]=l*g-f*m,t[5]=f*p-c*g,t[6]=c*m-l*p,t[7]=0,t[8]=c,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=s,t[14]=o,t[15]=1,t}function Be(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Re(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Te(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Le(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function Fe(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function je(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function De(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function ze(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],u=t[6],h=t[7],c=t[8],l=t[9],f=t[10],p=t[11],m=t[12],g=t[13],v=t[14],y=t[15],b=e[0],w=e[1],M=e[2],x=e[3],_=e[4],S=e[5],P=e[6],A=e[7],O=e[8],E=e[9],k=e[10],I=e[11],C=e[12],B=e[13],R=e[14],T=e[15];return Math.abs(r-b)<=d*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-w)<=d*Math.max(1,Math.abs(n),Math.abs(w))&&Math.abs(i-M)<=d*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(s-x)<=d*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(o-_)<=d*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(a-S)<=d*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(u-P)<=d*Math.max(1,Math.abs(u),Math.abs(P))&&Math.abs(h-A)<=d*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(c-O)<=d*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(l-E)<=d*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(f-k)<=d*Math.max(1,Math.abs(f),Math.abs(k))&&Math.abs(p-I)<=d*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(m-C)<=d*Math.max(1,Math.abs(m),Math.abs(C))&&Math.abs(g-B)<=d*Math.max(1,Math.abs(g),Math.abs(B))&&Math.abs(v-R)<=d*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(y-T)<=d*Math.max(1,Math.abs(y),Math.abs(T))}var qe=se,Ne=Le;function Ue(){var t=new p(3);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ye(t){var e=new p(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Ve(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function Ze(t,e,r){var n=new p(3);return n[0]=t,n[1]=e,n[2]=r,n}function Ge(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function $e(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function Xe(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function He(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function We(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function Je(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function Qe(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Ke(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function tr(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function er(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function rr(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function nr(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function ir(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function sr(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function or(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function ar(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function ur(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function hr(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function cr(t,e){var r=e[0],n=e[1],i=e[2],s=r*r+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function lr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function fr(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],u=r[2];return t[0]=i*u-s*a,t[1]=s*o-n*u,t[2]=n*a-i*o,t}function dr(t,e,r,n){var i=e[0],s=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t}function pr(t,e,r,n,i,s){var o=s*s,a=o*(2*s-3)+1,u=o*(s-2)+s,h=o*(s-1),c=o*(3-2*s);return t[0]=e[0]*a+r[0]*u+n[0]*h+i[0]*c,t[1]=e[1]*a+r[1]*u+n[1]*h+i[1]*c,t[2]=e[2]*a+r[2]*u+n[2]*h+i[2]*c,t}function mr(t,e,r,n,i,s){var o=1-s,a=o*o,u=s*s,h=a*o,c=3*s*a,l=3*u*o,f=u*s;return t[0]=e[0]*h+r[0]*c+n[0]*l+i[0]*f,t[1]=e[1]*h+r[1]*c+n[1]*l+i[1]*f,t[2]=e[2]*h+r[2]*c+n[2]*l+i[2]*f,t}function gr(t,e){e=e||1;var r=2*m()*Math.PI,n=2*m()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}function vr(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[3]*n+r[7]*i+r[11]*s+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*s+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*s+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*s+r[14])/o,t}function yr(t,e,r){var n=e[0],i=e[1],s=e[2];return t[0]=n*r[0]+i*r[3]+s*r[6],t[1]=n*r[1]+i*r[4]+s*r[7],t[2]=n*r[2]+i*r[5]+s*r[8],t}function br(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],u=e[1],h=e[2],c=i*h-s*u,l=s*a-n*h,f=n*u-i*a,d=i*f-s*l,p=s*c-n*f,m=n*l-i*c,g=2*o;return c*=g,l*=g,f*=g,d*=2,p*=2,m*=2,t[0]=a+c+d,t[1]=u+l+p,t[2]=h+f+m,t}function wr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0],s[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),s[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function Mr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),s[1]=i[1],s[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function xr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),s[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),s[2]=i[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function _r(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2],u=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(s*s+o*o+a*a),h=u&&lr(t,e)/u;return Math.acos(Math.min(Math.max(h,-1),1))}function Sr(t){return t[0]=0,t[1]=0,t[2]=0,t}function Pr(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function Ar(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Or(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2];return Math.abs(r-s)<=d*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-o)<=d*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=d*Math.max(1,Math.abs(i),Math.abs(a))}var Er,kr=He,Ir=We,Cr=Je,Br=sr,Rr=or,Tr=Ve,Lr=ar,Fr=(Er=Ue(),function(t,e,r,n,i,s){var o,a;for(e||(e=3),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=s*o,t}function an(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function un(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],s=r[0]*n[2]-r[2]*n[0],o=r[0]*n[3]-r[3]*n[0],a=r[1]*n[2]-r[2]*n[1],u=r[1]*n[3]-r[3]*n[1],h=r[2]*n[3]-r[3]*n[2],c=e[0],l=e[1],f=e[2],d=e[3];return t[0]=l*h-f*u+d*a,t[1]=-c*h+f*o-d*s,t[2]=c*u-l*o+d*i,t[3]=-c*a+l*s-f*i,t}function hn(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t[3]=a+n*(r[3]-a),t}function cn(t,e){var r,n,i,s,o,a;e=e||1;do{o=(r=2*m()-1)*r+(n=2*m()-1)*n}while(o>=1);do{a=(i=2*m()-1)*i+(s=2*m()-1)*s}while(a>=1);var u=Math.sqrt((1-o)/a);return t[0]=e*r,t[1]=e*n,t[2]=e*i*u,t[3]=e*s*u,t}function ln(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*s+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*s+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*s+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*s+r[15]*o,t}function fn(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],u=r[2],h=r[3],c=h*n+a*s-u*i,l=h*i+u*n-o*s,f=h*s+o*i-a*n,d=-o*n-a*i-u*s;return t[0]=c*h+d*-o+l*-u-f*-a,t[1]=l*h+d*-a+f*-o-c*-u,t[2]=f*h+d*-u+c*-a-l*-o,t[3]=e[3],t}function dn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function pn(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function mn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function gn(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=e[0],a=e[1],u=e[2],h=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(s-h)<=d*Math.max(1,Math.abs(s),Math.abs(h))}var vn=Yr,yn=Vr,bn=Zr,wn=Kr,Mn=tn,xn=en,_n=rn,Sn=function(){var t=jr();return function(e,r,n,i,s,o){var a,u;for(r||(r=4),n||(n=0),u=i?Math.min(i*r+n,e.length):e.length,a=n;ad?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r}function kn(t,e){var r=ii(t,e);return Math.acos(2*r*r-1)}function In(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*c+o*a+i*h-s*u,t[1]=i*c+o*u+s*a-n*h,t[2]=s*c+o*h+n*u-i*a,t[3]=o*c-n*a-i*u-s*h,t}function Cn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u+o*a,t[1]=i*u+s*a,t[2]=s*u-i*a,t[3]=o*u-n*a,t}function Bn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u-s*a,t[1]=i*u+o*a,t[2]=s*u+n*a,t[3]=o*u-i*a,t}function Rn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u+i*a,t[1]=i*u-n*a,t[2]=s*u+o*a,t[3]=o*u-s*a,t}function Tn(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function Ln(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=Math.exp(s),u=o>0?a*Math.sin(o)/o:0;return t[0]=r*u,t[1]=n*u,t[2]=i*u,t[3]=a*Math.cos(o),t}function Fn(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=o>0?Math.atan2(o,s)/o:0;return t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=.5*Math.log(r*r+n*n+i*i+s*s),t}function jn(t,e,r){return Fn(t,e),ni(t,t,r),Ln(t,t),t}function Dn(t,e,r,n){var i,s,o,a,u,h=e[0],c=e[1],l=e[2],f=e[3],p=r[0],m=r[1],g=r[2],v=r[3];return(s=h*p+c*m+l*g+f*v)<0&&(s=-s,p=-p,m=-m,g=-g,v=-v),1-s>d?(i=Math.acos(s),o=Math.sin(i),a=Math.sin((1-n)*i)/o,u=Math.sin(n*i)/o):(a=1-n,u=n),t[0]=a*h+u*p,t[1]=a*c+u*m,t[2]=a*l+u*g,t[3]=a*f+u*v,t}function zn(t){var e=m(),r=m(),n=m(),i=Math.sqrt(1-e),s=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*r),t[1]=i*Math.cos(2*Math.PI*r),t[2]=s*Math.sin(2*Math.PI*n),t[3]=s*Math.cos(2*Math.PI*n),t}function qn(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s,a=o?1/o:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=s*a,t}function Nn(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Un(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var s=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*s+s]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*s+o]-e[3*o+s])*r,t[s]=(e[3*s+i]+e[3*i+s])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t}function Yn(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var s=Math.sin(e),o=Math.cos(e),a=Math.sin(r),u=Math.cos(r),h=Math.sin(n),c=Math.cos(n);return t[0]=s*u*c-o*a*h,t[1]=o*a*c+s*u*h,t[2]=o*u*h-s*a*c,t[3]=o*u*c+s*a*h,t}function Vn(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var Zn,Gn,$n,Xn,Hn,Wn,Jn=Dr,Qn=zr,Kn=qr,ti=Nr,ei=Ur,ri=In,ni=Jr,ii=an,si=hn,oi=en,ai=oi,ui=rn,hi=ui,ci=on,li=mn,fi=gn,di=(Zn=Ue(),Gn=Ze(1,0,0),$n=Ze(0,1,0),function(t,e,r){var n=lr(e,r);return n<-.999999?(fr(Zn,Gn,e),Tr(Zn)<1e-6&&fr(Zn,$n,e),cr(Zn,Zn),On(t,Zn,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(fr(Zn,e,r),t[0]=Zn[0],t[1]=Zn[1],t[2]=Zn[2],t[3]=1+n,ci(t,t))}),pi=(Xn=Pn(),Hn=Pn(),function(t,e,r,n,i,s){return Dn(Xn,e,i,s),Dn(Hn,r,n,s),Dn(t,Xn,Hn,2*s*(1-s)),t}),mi=(Wn=vt(),function(t,e,r,n){return Wn[0]=r[0],Wn[3]=r[1],Wn[6]=r[2],Wn[1]=n[0],Wn[4]=n[1],Wn[7]=n[2],Wn[2]=-e[0],Wn[5]=-e[1],Wn[8]=-e[2],ci(t,Un(t,Wn))});function gi(){var t=new p(8);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function vi(t){var e=new p(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function yi(t,e,r,n,i,s,o,a){var u=new p(8);return u[0]=t,u[1]=e,u[2]=r,u[3]=n,u[4]=i,u[5]=s,u[6]=o,u[7]=a,u}function bi(t,e,r,n,i,s,o){var a=new p(8);a[0]=t,a[1]=e,a[2]=r,a[3]=n;var u=.5*i,h=.5*s,c=.5*o;return a[4]=u*n+h*r-c*e,a[5]=h*n+c*t-u*r,a[6]=c*n+u*e-h*t,a[7]=-u*t-h*e-c*r,a}function wi(t,e,r){var n=.5*r[0],i=.5*r[1],s=.5*r[2],o=e[0],a=e[1],u=e[2],h=e[3];return t[0]=o,t[1]=a,t[2]=u,t[3]=h,t[4]=n*h+i*u-s*a,t[5]=i*h+s*o-n*u,t[6]=s*h+n*a-i*o,t[7]=-n*o-i*a-s*u,t}function Mi(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function xi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function _i(t,e){var r=Pn();xe(r,e);var n=new p(3);return we(n,e),wi(t,r,n),t}function Si(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function Pi(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Ai(t,e,r,n,i,s,o,a,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=u,t}var Oi=Kn;function Ei(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var ki=Kn;function Ii(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function Ci(t,e){var r=e[4],n=e[5],i=e[6],s=e[7],o=-e[0],a=-e[1],u=-e[2],h=e[3];return t[0]=2*(r*h+s*o+n*u-i*a),t[1]=2*(n*h+s*a+i*o-r*u),t[2]=2*(i*h+s*u+r*a-n*o),t}function Bi(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=.5*r[0],u=.5*r[1],h=.5*r[2],c=e[4],l=e[5],f=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=o*a+i*h-s*u+c,t[5]=o*u+s*a-n*h+l,t[6]=o*h+n*u-i*a+f,t[7]=-n*a-i*u-s*h+d,t}function Ri(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=a*o+c*n+u*s-h*i,f=u*o+c*i+h*n-a*s,d=h*o+c*s+a*i-u*n,p=c*o-a*n-u*i-h*s;return Cn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Ti(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=a*o+c*n+u*s-h*i,f=u*o+c*i+h*n-a*s,d=h*o+c*s+a*i-u*n,p=c*o-a*n-u*i-h*s;return Bn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Li(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=a*o+c*n+u*s-h*i,f=u*o+c*i+h*n-a*s,d=h*o+c*s+a*i-u*n,p=c*o-a*n-u*i-h*s;return Rn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Fi(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],u=e[1],h=e[2],c=e[3];return t[0]=a*o+c*n+u*s-h*i,t[1]=u*o+c*i+h*n-a*s,t[2]=h*o+c*s+a*i-u*n,t[3]=c*o-a*n-u*i-h*s,a=e[4],u=e[5],h=e[6],c=e[7],t[4]=a*o+c*n+u*s-h*i,t[5]=u*o+c*i+h*n-a*s,t[6]=h*o+c*s+a*i-u*n,t[7]=c*o-a*n-u*i-h*s,t}function ji(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*c+o*a+i*h-s*u,t[1]=i*c+o*u+s*a-n*h,t[2]=s*c+o*h+n*u-i*a,t[3]=o*c-n*a-i*u-s*h,a=r[4],u=r[5],h=r[6],c=r[7],t[4]=n*c+o*a+i*h-s*u,t[5]=i*c+o*u+s*a-n*h,t[6]=s*c+o*h+n*u-i*a,t[7]=o*c-n*a-i*u-s*h,t}function Di(t,e,r,n){if(Math.abs(n)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,s=e[2]/r,o=e[3]/r,a=e[4],u=e[5],h=e[6],c=e[7],l=n*a+i*u+s*h+o*c;t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=(a-n*l)/r,t[5]=(u-i*l)/r,t[6]=(h-s*l)/r,t[7]=(c-o*l)/r}return t}function Qi(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function Ki(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function ts(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],u=t[6],h=t[7],c=e[0],l=e[1],f=e[2],p=e[3],m=e[4],g=e[5],v=e[6],y=e[7];return Math.abs(r-c)<=d*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(n-l)<=d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-f)<=d*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(s-p)<=d*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(o-m)<=d*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(a-g)<=d*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(u-v)<=d*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(h-y)<=d*Math.max(1,Math.abs(h),Math.abs(y))}function es(){var t=new p(2);return p!=Float32Array&&(t[0]=0,t[1]=0),t}function rs(t){var e=new p(2);return e[0]=t[0],e[1]=t[1],e}function ns(t,e){var r=new p(2);return r[0]=t,r[1]=e,r}function is(t,e){return t[0]=e[0],t[1]=e[1],t}function ss(t,e,r){return t[0]=e,t[1]=r,t}function os(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function as(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function us(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function hs(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function cs(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function ls(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function fs(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function ds(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function ps(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function ms(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function gs(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function vs(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function ys(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function bs(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function ws(t){var e=t[0],r=t[1];return e*e+r*r}function Ms(t,e){return t[0]=-e[0],t[1]=-e[1],t}function xs(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function _s(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function Ss(t,e){return t[0]*e[0]+t[1]*e[1]}function Ps(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function As(t,e,r,n){var i=e[0],s=e[1];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t}function Os(t,e){e=e||1;var r=2*m()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function Es(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function ks(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function Is(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function Cs(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function Bs(t,e,r,n){var i=e[0]-r[0],s=e[1]-r[1],o=Math.sin(n),a=Math.cos(n);return t[0]=i*a-s*o+r[0],t[1]=i*o+s*a+r[1],t}function Rs(t,e){var r=t[0],n=t[1],i=e[0],s=e[1],o=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+s*s),a=o&&(r*i+n*s)/o;return Math.acos(Math.min(Math.max(a,-1),1))}function Ts(t){return t[0]=0,t[1]=0,t}function Ls(t){return"vec2("+t[0]+", "+t[1]+")"}function Fs(t,e){return t[0]===e[0]&&t[1]===e[1]}function js(t,e){var r=t[0],n=t[1],i=e[0],s=e[1];return Math.abs(r-i)<=d*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))}var Ds=bs,zs=as,qs=us,Ns=hs,Us=vs,Ys=ys,Vs=ws,Zs=function(){var t=es();return function(e,r,n,i,s,o){var a,u;for(r||(r=2),n||(n=0),u=i?Math.min(i*r+n,e.length):e.length,a=n;a{var n;!function(){"use strict";var i=.5*(Math.sqrt(3)-1),s=(3-Math.sqrt(3))/6,o=1/6,a=(Math.sqrt(5)-1)/4,u=(5-Math.sqrt(5))/20;function h(t){var e;e="function"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=l();t=i(" "),e=i(" "),r=i(" ");for(var s=0;s>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}h.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,o=this.permMod12,a=this.perm,u=this.grad3,h=0,c=0,l=0,f=(t+e)*i,d=Math.floor(t+f),p=Math.floor(e+f),m=(d+p)*s,g=t-(d-m),v=e-(p-m);g>v?(r=1,n=0):(r=0,n=1);var y=g-r+s,b=v-n+s,w=g-1+2*s,M=v-1+2*s,x=255&d,_=255&p,S=.5-g*g-v*v;if(S>=0){var P=3*o[x+a[_]];h=(S*=S)*S*(u[P]*g+u[P+1]*v)}var A=.5-y*y-b*b;if(A>=0){var O=3*o[x+r+a[_+n]];c=(A*=A)*A*(u[O]*y+u[O+1]*b)}var E=.5-w*w-M*M;if(E>=0){var k=3*o[x+1+a[_+1]];l=(E*=E)*E*(u[k]*w+u[k+1]*M)}return 70*(h+c+l)},noise3D:function(t,e,r){var n,i,s,a,u,h,c,l,f,d,p=this.permMod12,m=this.perm,g=this.grad3,v=.3333333333333333*(t+e+r),y=Math.floor(t+v),b=Math.floor(e+v),w=Math.floor(r+v),M=(y+b+w)*o,x=t-(y-M),_=e-(b-M),S=r-(w-M);x>=_?_>=S?(u=1,h=0,c=0,l=1,f=1,d=0):x>=S?(u=1,h=0,c=0,l=1,f=0,d=1):(u=0,h=0,c=1,l=1,f=0,d=1):_B?L++:F++,C>R?L++:j++,C>T?L++:D++,B>R?F++:j++,B>T?F++:D++,R>T?j++:D++;var z=C-(l=L>=3?1:0)+u,q=B-(f=F>=3?1:0)+u,N=R-(d=j>=3?1:0)+u,U=T-(p=D>=3?1:0)+u,Y=C-(m=L>=2?1:0)+2*u,V=B-(g=F>=2?1:0)+2*u,Z=R-(v=j>=2?1:0)+2*u,G=T-(y=D>=2?1:0)+2*u,$=C-(b=L>=1?1:0)+3*u,X=B-(w=F>=1?1:0)+3*u,H=R-(M=j>=1?1:0)+3*u,W=T-(x=D>=1?1:0)+3*u,J=C-1+4*u,Q=B-1+4*u,K=R-1+4*u,tt=T-1+4*u,et=255&A,rt=255&O,nt=255&E,it=255&k,st=.6-C*C-B*B-R*R-T*T;if(st<0)i=0;else{var ot=_[et+_[rt+_[nt+_[it]]]]%32*4;i=(st*=st)*st*(S[ot]*C+S[ot+1]*B+S[ot+2]*R+S[ot+3]*T)}var at=.6-z*z-q*q-N*N-U*U;if(at<0)s=0;else{var ut=_[et+l+_[rt+f+_[nt+d+_[it+p]]]]%32*4;s=(at*=at)*at*(S[ut]*z+S[ut+1]*q+S[ut+2]*N+S[ut+3]*U)}var ht=.6-Y*Y-V*V-Z*Z-G*G;if(ht<0)o=0;else{var ct=_[et+m+_[rt+g+_[nt+v+_[it+y]]]]%32*4;o=(ht*=ht)*ht*(S[ct]*Y+S[ct+1]*V+S[ct+2]*Z+S[ct+3]*G)}var lt=.6-$*$-X*X-H*H-W*W;if(lt<0)h=0;else{var ft=_[et+b+_[rt+w+_[nt+M+_[it+x]]]]%32*4;h=(lt*=lt)*lt*(S[ft]*$+S[ft+1]*X+S[ft+2]*H+S[ft+3]*W)}var dt=.6-J*J-Q*Q-K*K-tt*tt;if(dt<0)c=0;else{var pt=_[et+1+_[rt+1+_[nt+1+_[it+1]]]]%32*4;c=(dt*=dt)*dt*(S[pt]*J+S[pt+1]*Q+S[pt+2]*K+S[pt+3]*tt)}return 27*(i+s+o+h+c)}},h._buildPermutationTable=c,void 0===(n=function(){return h}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=h,t.exports=h}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(915)})()},2513:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Group=void 0;const n=r(1378),i=r(541),s=r(2648),o=r(5511);class a extends i.SceneChild{constructor(t={}){t.type="Group",super(t),this.children=[],["id","name","data","order","type"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=o.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){"object"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=a},1378:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Scene=void 0;const n=r(541),i=r(2513),s=r(6448),o=r(313);class a{constructor(t={}){this.width=400,this.height=400,this.background="hsla(0, 0%, 0%, 1)",this.color="hsla(0, 0%, 100%, 1)",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?(.5+.5*o.clamp(-1,1,t.anchor[0]))*this.width:"left"===t.anchor[0]?0:"right"===t.anchor[0]?this.width:this.center[0],"number"==typeof t.anchor[1]?(.5+.5*o.clamp(-1,1,t.anchor[1]))*this.height:"top"===t.anchor[1]?0:"bottom"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e="number"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,a.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{a.propagateToChilden(t,e)})):t instanceof s.Shape&&t.shape&&(t.shape.scene=e,a.propagateToChilden(t.shape,e))}}e.Scene=a},541:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||"SceneChild",this.name=t.name||this.type+"_"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){"string"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},313:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(21),i=r(2769),s=r(795),o="undefined"!=typeof performance?performance:Date;function a(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return o.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=a,e.relativeClamp=function(t,e,r,n,i){return a(n,i,(r-t)/(e-t)*(i-n)+n)};const u={random:new n(Math.random)};e.noise=function(t="random",e=0,r=0,i=0){return void 0===u[t]&&(u[t]=new n(t)),u[t].noise3D(e,r,i)};const h={};function c(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),s=rn?[s,o]:[o,s]}function l(t,e){const r=t.length,n=r/2,i=2*(n+e),s=n-1;if(s>1){const n=r-2,o=Math.floor(e/s);let a=(i-(r+o*n))/2;const u=Math.round(s/a),h=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%u==0||e===n-2),p=o+(d?1:0),m=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);h[i]=(s=t(),o=t(),a=t(),u=t(),function(){let t=(s>>>=0)+(o>>>=0)|0;return s=o^o>>>9,o=(a>>>=0)+(a<<3)|0,t=t+(u=1+(u>>>=0)|0)|0,a=(a=a<<21|a>>>11)+t|0,(t>>>0)/4294967296})}var s,o,a,u;const c=e+h[i]()*(r-e);return void 0!==n?Math.round(c*10**n)/10**n:c},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return s.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=c,e.interpolate=function(t,e,r=.5){const[n,i]=c(t,e),s=Math.max(n.length,i.length),o="number"==typeof r?[r]:r,a=s/2;if(o.length!==a){const t=o.length;for(let e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return"number"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},8721:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(887);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},3792:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},5511:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(9958);var i;!function(t){t[t.None=0]="None",t[t.Scale=2]="Scale",t[t.Center=4]="Center",t[t.Fill=8]="Fill"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn("[Urplfanze:Bounding] cannot sum bounding")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn("[Urplfanze:Bounding] cannot bind bounding")}};class s extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return s.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=s.getBounding(t));const o=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,a=e>=i.Center?r.cx:0,u=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Close=void 0;const n=r(9958);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},1740:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Mirror=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let s=0;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},3315:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Offset=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i},4660:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Smooth=void 0;const n=r(313),i=r(8301),s=r(9958);class o extends s.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Solidify=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const s=[],o=(e="number"==typeof e?[e]:e).length;let a,u,h=[[0,0],[0,0]],c=[[0,0],[0,0]];for(let r=0,l=0,f=t.length-2;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Subdivide=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Modifiers=void 0;const n=r(5511),i=r(1740),s=r(4660),o=r(5838),a=r(5588),u=r(8301),h=r(3315),c={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:s.Smooth,Solidify:o.Solidify,Subdivide:a.Subdivide,Close:u.Close,Offset:h.Offset};e.Modifiers=c},6448:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=void 0;const n=r(1378),i=r(541),s=r(2648);class o extends s.ShapeBase{constructor(t){t.type=t.type||"Shape",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn("[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\nYou passed:",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):o.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBase=void 0;const n=r(887),i=r(3757),s=r(8721),o=r(795),a=r(3792),u=r(5511),h=r(313),c=r(541),l=n.mat4.create(),f=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class m extends c.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?-1*h.clamp(-1,1,t.anchor[0]):"left"===t.anchor[0]?1:"right"===t.anchor[0]?-1:0,"number"==typeof t.anchor[1]?-1*h.clamp(-1,1,t.anchor[1]):"top"===t.anchor[1]?1:"bottom"===t.anchor[1]?-1:0]:[0,0],this.boundingType="string"==typeof t.boundingType?"relative"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return"function"!=typeof t.repetitions&&"function"!=typeof t.distance&&"function"!=typeof t.displace&&"function"!=typeof t.scale&&"function"!=typeof t.translate&&"function"!=typeof t.skewX&&"function"!=typeof t.skewY&&"function"!=typeof t.squeezeX&&"function"!=typeof t.squeezeY&&"function"!=typeof t.rotateX&&"function"!=typeof t.rotateY&&"function"!=typeof t.rotateZ&&"function"!=typeof t.transformOrigin&&"function"!=typeof t.perspective&&"function"!=typeof t.perspectiveOrigin}isStaticIndexed(){return"function"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return"function"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){"string"==typeof t?(r=r||"repetitions"==t,this.props[t]=e):(r=r||"repetitions"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var c,g;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const v=m.getEmptyPropArguments(this,r),y=v.repetition,b=this.getProp("repetitions",v,1),w=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,M=Array.isArray(b)?b[0]*(null!==(c=b[1])&&void 0!==c?c:b[0]):b,x=Array.isArray(b)?b[0]:M,_=Array.isArray(b)?null!==(g=b[1])&&void 0!==g?g:b[0]:1,S=y.row;S.count=x;const P=y.col;P.count=_,y.count=M,y.col.count=_,y.row.count=x,y.type=w;let A=0;const O=[];let E=0;const k=n.vec2.fromValues((_-1)/2,(x-1)/2),I=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],C=[void 0,void 0,void 0,void 0],B=[void 0,void 0,void 0,void 0];for(let r=0;r1?E/(M-1):1,y.angle=w===i.ERepetitionType.Ring?a.PI2/M*E:0,P.index=c+1,P.offset=_>1?c/(_-1):1,S.index=r+1,S.offset=x>1?r/(x-1):1;const m=this.generateBuffer(t,v),g=m.length,b=this.getShapeBounding();O[E]=new Float32Array(g),A+=g;{const t=s.toVec2(this.getProp("distance",v,s.VEC2_ZERO)),a=this.getProp("displace",v,0),M=s.toVec3(this.getProp("scale",v,s.VEC2_ONE),1),x=s.toVec3(this.getProp("translate",v,s.VEC2_ZERO),0),_=this.getProp("skewX",v,0),S=this.getProp("skewY",v,0),P=this.getProp("squeezeX",v,0),A=this.getProp("squeezeY",v,0),R=this.getProp("rotateX",v,0),T=this.getProp("rotateY",v,0),L=this.getProp("rotateZ",v,0),F=h.clamp(0,1,this.getProp("perspective",v,0)),j=s.toVec3(this.getProp("perspectiveOrigin",v,s.VEC2_ZERO),0),D=s.toVec3(this.getProp("transformOrigin",v,s.VEC2_ZERO),0);let z;switch(w){case i.ERepetitionType.Ring:z=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(z,z,s.VEC3_ZERO,y.angle+a);break;case i.ERepetitionType.Matrix:z=n.vec3.fromValues(t[1]*(c-k[0]),t[0]*(r-k[1]),0)}const q=F>0?Math.max(b.width,b.height)/2:1,N=F>0?q+10*q*(1-F):0,U=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==F||0!==D[0]||0!==D[1],Y=0!==j[0]||0!==j[1];U&&(this.boundingType===i.EBoundingType.Relative?(D[0]=D[0]*(b.width/2)+b.cx,D[1]=D[1]*(b.height/2)+b.cy):(D[0]*=b.width/2,D[1]*=b.height/2),D[2]=N);{n.mat4.identity(f),U&&n.mat4.translate(f,f,D),0===x[0]&&0===x[1]||n.mat4.translate(f,f,x),0===_&&0===S||(s.fromSkew(l,[_,S]),n.mat4.multiply(f,f,l)),0!==R&&n.mat4.rotateX(f,f,R),0!==T&&n.mat4.rotateY(f,f,T),0!==L&&n.mat4.rotateZ(f,f,L),1===M[0]&&1===M[1]||n.mat4.scale(f,f,M),U&&n.mat4.translate(f,f,n.vec3.scale(D,D,-1)),N>0&&(Y&&(this.boundingType===i.EBoundingType.Relative?(j[0]=j[0]*(b.width/2)+b.cx,j[1]=j[1]*(b.height/2)+b.cy):(j[0]*=b.width/2,j[1]*=b.height/2),j[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,z),e&&n.mat4.translate(p,p,I);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),w===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,y.angle+a)}u.Bounding.clear(B);for(let t=0;t0&&(Y&&n.vec3.add(e,e,j),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,N),Y&&n.vec3.sub(e,e,j)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=g/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,v)}O[E][t]=e[0],O[E][t+1]=e[1],u.Bounding.add(B,e[0],e[1]),u.Bounding.add(C,e[0],e[1])}}const R={cx:0,cy:0,x:-1,y:-1,width:2,height:2};u.Bounding.bind(R,B),this.bStaticIndexed&&this.bIndexed||this.addIndex(g,y,R)}u.Bounding.bind(this.bounding,C),this.buffer=new Float32Array(A);for(let t=0,e=0,r=O.length;t({index:1,offset:1,count:1}),m.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...m.getEmptySimpleRepetition(),row:m.getEmptySimpleRepetition(),col:m.getEmptySimpleRepetition()})},7439:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBuffer=void 0;const n=r(5511),i=r(3674);class s extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||"ShapeBuffer",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn("[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property"),this.shape=s.EMPTY_BUFFER):this.shape="function"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return"function"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from("function"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,s=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&"function"!=typeof this.props.sideLength&&"function"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=s},5382:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeFollow=void 0;const n=r(6448);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeFollow",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},s=this.shape;s.generate(t,!1,i);let o=s.getBuffer();const a=o.length,u=new Float32Array(a*(n.length/2)),h=n.length/2;for(let e=0;e1?e/(h-1):1,count:h};this.shapeUseFollow&&(i.follow=r,s.generate(t,!1,i),o=s.getBuffer());const c=e*a,l=2*e,f=n[l],d=n[l+1];for(let t=0,e=o.length;t1?t/(e-1):1;for(let o=0,a=s.length;o{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeLoop=void 0;const n=r(3792),i=r(5511),s=r(3674),o=r(2648);class a extends s.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||"ShapeLoop",super(t),this.loopDependencies=(t.loopDependencies||[]).concat("sideLength"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes("propArguments"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}"loop"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||o.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?("function"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),s=this.getRepetitionSideLength(t),o=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,a={index:0,offset:0,current:0,count:n},u=a.count,h=new Float32Array(2*u);for(let n=0,i=0;n1?n/(a.count-1):1;a.current=s,a.index=n+1,a.offset=u;const c=o(a,t);h[i]=c[0],h[i+1]=c[1]}const c=[void 0,void 0,void 0,void 0],l=this.applyModifiers(h,t);for(let t=0,e=l.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapePrimitive=void 0;const n=r(8721),i=r(2648),s=r(9958),o=r(5511);class a extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=o.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:"function"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return"function"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:"number"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp("sideLength",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeRecursive=void 0;const n=r(6448);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeRecursive",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionScale&&"function"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp("recursions",e,1)),n=Math.floor(this.getProp("recursionVertex",e,0)),s=this.getProp("recursionScale",e,2),o=this.shape;let a={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const u={...e,recursion:a};o.generate(t,!1,u);const h=o.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=h);let c=h;const l=[a];let f=0,d=1;const p=c.length,m=p/2,g=n<=0?m:Math.min(n,m),v=0===n?1:m/Math.min(n,m),y=new Float32Array(i.summmation(r,g)*p);for(let t=0;t1?e/(r-1):1,h=i.summmation(e,g)*p,m=e-1,b=0===m?0:i.summmation(m,g)*p;for(let i=0,m=g**e;i1?i/(m-1):1,count:m,level:{index:e+1,offset:n,count:r},parent:l[f]},l.push(a),this.shapeUseRecursion&&(u.recursion=a,o.generate(t,!1,u),c=o.getBuffer());const w=h+i*p,M=Math.floor(b+2*i*v),x=y[M],_=y[M+1],S=s**e;for(let t=0,e=p;t1?0:1,count:s}}},u=this.shape.getIndexedBuffer()||[];for(let t=0,e=u.length;t1?0:1,count:s}},i={...a,recursion:r},o=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:o})}if(s>1){const t=this.shape.getBufferLength({...i,parent:{...a}})/2,e=o<=0?t:Math.min(o,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let h=0,c=1;for(let t=1;t1?t/(s-1):1;for(let o=0,l=e**t;o1?o/(l-1):1;for(let d=0,p=u.length;d{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Circle=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){t.type="Circle",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=s},6329:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Line=void 0;const n=r(5511),i=r(7439);class s extends i.ShapeBuffer{constructor(t={}){t.type="Line",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lissajous=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){t.type="Lissajous",t.loopDependencies=(t.loopDependencies||[]).concat(["wx","wy","wz"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp("wx",t),r=this.getProp("wy",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),s=this.getRepetitionSideLength(t);return 1/Math.pow(s[0]*s[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp("wx",t,1),this.wy=this.getProp("wy",t,2),this.wz=this.getProp("wz",t,2),super.generateLoopBuffer(t)}}e.Lissajous=s},2982:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Polygon=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["sideNumber"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp("sideNumber",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=s},5510:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Rect=void 0;const n=r(5511),i=r(7439);class s extends i.ShapeBuffer{constructor(t={}){t.type="Rect",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=s,s.buffer=[1,1,-1,1,-1,-1,1,-1]},894:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Rose=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){var e,r;t.type="Rose",t.loopDependencies=(t.loopDependencies||[]).concat(["n","d"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>s.getFinalAngleFromK(this.getProp("n",t),this.getProp("d",t)),inc:t=>{const e=this.getProp("n",t),r=this.getProp("d",t),i=this.getRepetitionSideLength(t),s=Math.pow(i[0]*i[1],.45),o=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp("n",t)/this.getProp("d",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=s},5719:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Spiral=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type="Spiral",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat(["twists","twistsStart","spiral"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:s.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp("twistsStart",t),end:t=>n.PI2*(this.getProp("twistsStart",t)+this.getProp("twists",t)),inc:t=>{const e=this.getProp("twists",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp("spiral",t),this.r=s.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case s.types.ARCHIMEDE:return t=>t/10;case s.types.HYPERBOLIC:return t=>1/t*3;case s.types.FERMAT:return t=>t**.5/3;case s.types.LITUUS:return t=>t**-.5;case s.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=s,s.types={ARCHIMEDE:"ARCHIMEDE",HYPERBOLIC:"HYPERBOLIC",FERMAT:"FERMAT",LITUUS:"LITUUS",LOGARITHMIC:"LOGARITHMIC"}},9667:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Star=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["spikes","innerRadius"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp("spikes",t,5),this.innerRadius=this.getProp("innerRadius",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=s},3977:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SuperShape=void 0;const n=r(3792),i=r(6951);class s extends i.ShapeLoop{constructor(t={}){var e,r,i,s,o,a;t.type="SuperShape",t.loopDependencies=(t.loopDependencies||[]).concat(["a","b","m","n1","n2","n3"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(s=t.n1)&&void 0!==s?s:1,this.props.n2=null!==(o=t.n2)&&void 0!==o?o:1,this.props.n3=null!==(a=t.n3)&&void 0!==a?a:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp("a",t),this.b=this.getProp("b",t),this.m=this.getProp("m",t),this.n1=this.getProp("n1",t),this.n2=this.getProp("n2",t),this.n3=this.getProp("n3",t),super.generateLoopBuffer(t)}}e.SuperShape=s},4233:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Triangle=void 0;const n=r(5511),i=r(7439);class s extends i.ShapeBuffer{constructor(t={}){t.type="Triangle",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=s,s.buffer=[1,0,-1,1,-1,-1]},3757:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(7678),e),i(r(7066),e),i(r(2769),e),i(r(7266),e),i(r(3647),e),i(r(4526),e),i(r(1618),e),i(r(6787),e)},7678:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},7066:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},2769:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]="Ring",r[r.Matrix=2]="Matrix"},7266:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3647:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4526:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]="Relative",r[r.Fixed=2]="Fixed"},1618:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6787:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},9962:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DrawerCanvas=void 0;const n=r(7358),i=r(313),s=r(3792),o=r(795),a=r(292),u=r(1189),h=r(8909),c=r(9724);class l extends u.Emitter{constructor(t,e,r,n=6e4,i=60){var s,o,a,u,l;super(),this.drawerOptions={width:(null==r?void 0:r.width)||(null==t?void 0:t.width)||400,height:(null==r?void 0:r.height)||(null==t?void 0:t.height)||400,clear:null===(s=null==r?void 0:r.clear)||void 0===s||s,time:null!==(o=null==r?void 0:r.time)&&void 0!==o?o:0,simmetricLines:null!==(a=null==r?void 0:r.simmetricLines)&&void 0!==a?a:0,noBackground:null!==(u=null==r?void 0:r.noBackground)&&void 0!==u&&u,ghosts:(null==r?void 0:r.ghosts)||0,ghostAlpha:!1!==(null==r?void 0:r.ghostAlpha),ghostSkipTime:null!==(l=null==r?void 0:r.ghostSkipTime)&&void 0!==l?l:30,ghostSkipFunction:null==r?void 0:r.ghostSkipFunction,sceneFit:(null==r?void 0:r.sceneFit)||"contain",backgroundImage:null==r?void 0:r.backgroundImage,backgroundImageFit:(null==r?void 0:r.backgroundImageFit)||"cover"},this.timeline=new h.Timeline(n,i),this.timeline.setTime(this.drawerOptions.time),this.draw_id=null,this.redraw_id=null,this.animation_id=null,t&&this.setScene(t),(!c.bWorker||c.bWorker&&e instanceof OffscreenCanvas)&&this.setCanvas(e)}getOption(t,e){var r;return null!==(r=this.drawerOptions[t])&&void 0!==r?r:e}setCanvas(t){if(c.bWorker)t instanceof OffscreenCanvas?this.canvas=t:console.error("Cannot set cavas");else if(c.bBrowser){const e=a.createCanvas(this.drawerOptions.width,this.drawerOptions.height);if(t instanceof HTMLElement&&!(t instanceof HTMLCanvasElement||t instanceof OffscreenCanvas)){for(this.canvas=e;t.lastChild;)t.removeChild(t.lastChild);t.appendChild(e)}else this.canvas=void 0===t?e:t}else this.canvas=a.createCanvas(this.drawerOptions.width,this.drawerOptions.height);this.canvas&&(this.canvas.width=this.drawerOptions.width,this.canvas.height=this.drawerOptions.height,this.context=this.canvas.getContext("2d",{alpha:!0}))}getCanvas(){return this.canvas}setScene(t){this.scene=t}draw(){if(null===this.context||void 0===this.scene)return 0;const t=i.now(),e=this.timeline,r=e.getTime(),n={...this.drawerOptions,ghostIndex:void 0,clear:this.drawerOptions.clear||e.getCurrentFrame()<=1,time:r},o=e.getFrameAtTime(r);if(this.dispatch("drawer-canvas:before_draw",{currentFrame:o,currentTime:r}),n.simmetricLines>0&&(n.clear&&l.clear(this.context,n.width,n.height,!n.noBackground&&this.scene.background,n.backgroundImage,n.backgroundImageFit),l.drawSimmetricLines(this.context,n.simmetricLines,n.width,n.height,this.scene.color),n.clear=!1),n.ghosts){const t={...n},r=e.getTime(),i=e.getDuration(),o={offset:0,index:0,count:n.ghosts};for(let e=1;e<=n.ghosts;e++){o.index=e,o.offset=o.index/o.count;const a=r-(n.ghostSkipFunction?n.ghostSkipFunction(o,r):e*n.ghostSkipTime);t.ghostIndex=e,t.time=s.mod(a,i),t.clear=n.clear&&1===t.ghostIndex,this.realDraw(t)}n.clear=!1}return this.realDraw(n),i.now()-t}realDraw(t){var e;const r=this.drawerOptions.width,n=this.drawerOptions.height,i=this.context,s=this.scene,o=null!==(e=t.time)&&void 0!==e?e:0,a=void 0!==t.ghosts&&t.ghosts>0&&void 0!==t.ghostIndex&&t.ghostIndex>0,u=a?1-t.ghostIndex/(t.ghosts+.5):0,h=!0===t.ghostAlpha,f=c.fit(s.width,s.height,r,n,this.drawerOptions.sceneFit),d=f.x,p=f.y;t.clear&&l.clear(i,r,n,!t.noBackground&&s.background,t.backgroundImage,t.backgroundImageFit);let m=!1,g=!1;s.currentTime=o;const v=s.getChildren();for(let t=0,e=v.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=void 0,e.Emitter=class{constructor(){this.callbacks={}}attach(t,e){t in this.callbacks||(this.callbacks[t]=[]),this.callbacks[t].push(e)}detach(t,e){if(t in this.callbacks){const r=this.callbacks[t].indexOf(e);r>=0&&this.callbacks[t].splice(r,1)}}dispatch(t,e){if(t in this.callbacks&&this.callbacks[t].length>0)for(let r=0,n=this.callbacks[t].length;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Renderer=void 0;const n=r(5045),i=r(313),s=r(5733),o=r(6151),a=r(1189),u=r(9724);class h extends a.Emitter{constructor(t,e){super(),this.drawer=t,this.ffmpegCorePath=void 0===e&&t instanceof o.default?"https://unpkg.com/@ffmpeg/core@0.10.0/dist/ffmpeg-core.js":e}async zip(t="image/png",e=1,r=600){const n=i.now(),o=new s,a=this.drawer.timeline.getFramesCount(),h=Math.ceil(a/r);this.dispatch("renderer:zip_start",{chunks:h,totalFrames:a,framesForChunk:r});const c="image/jpeg"===t?".jpg":".png",l=[];let f=0;for(let s=0,d=1;s{r.toBlob((t=>{if(!t)throw new Error("Blob error");n(t)}),t,"number"==typeof e?e:1)}))}}e.Renderer=h},8909:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=void 0;const n=r(313),i=r(3792),s=r(1189);class o extends s.Emitter{constructor(t=6e4,e=30){super(),this.fps_samples_size=30,this.fps_samples=[],this.fps_samples_index=0,this.paused_time=0,this.sequence={duration:t,framerate:e,frames:Math.round(t/1e3*e)},this.tick_time=1e3/this.sequence.framerate,this.fps=this.sequence.framerate,this.b_sequence_started=!1,this.currentFrame=0,this.currentTime=0,this.last_tick=0,this.start_time=0}getSequence(){return{...this.sequence}}setSequence(t,e,r){this.sequence.duration=t,this.sequence.framerate=e,this.tick_time=1e3/this.sequence.framerate,this.sequence.frames=Math.round(this.sequence.duration/1e3*this.sequence.framerate),void 0!==r?this.setTime(r):this.dispatch("timeline:update_sequence",this.getSequence())}setDuration(t){this.setSequence(t,this.sequence.framerate)}getDuration(){return this.sequence.duration}getFramerate(){return this.sequence.framerate}setFramerate(t){this.setSequence(this.sequence.duration,t)}getFramesCount(){return this.sequence.frames}bSequenceStarted(){return this.b_sequence_started}start(){this.b_sequence_started||(this.b_sequence_started=!0,this.start_time=this.paused_time,this.dispatch("timeline:change_status",o.START))}pause(){this.b_sequence_started&&(this.paused_time=n.now(),this.b_sequence_started=!1,this.dispatch("timeline:change_status",o.PAUSE))}stop(){this.b_sequence_started&&(this.b_sequence_started=!1,this.currentTime=0,this.currentFrame=0,this.start_time=0,this.paused_time=0,this.dispatch("timeline:change_status",o.STOP))}tick(t){if(this.b_sequence_started){this.start_time||(this.start_time=t,this.last_tick=-this.tick_time);const e=t-this.start_time,r=e-this.last_tick;if(r>=this.tick_time)return this.calculateFPS(1/(r/1e3)),this.last_tick=e,this.currentTime=(e-r%this.tick_time)%this.sequence.duration,this.currentFrame=this.getFrameAtTime(this.currentTime),this.dispatch("timeline:progress",{currentFrame:this.currentFrame,currentTime:this.currentTime,fps:this.fps}),!0}return!1}calculateFPS(t){const e=this.fps_samples.length;if(e>0){let t=0;for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BrowserDrawerCanvas=void 0;const n=r(9962),i=r(9724);class s extends n.DrawerCanvas{constructor(t,e,r,n=6e4,i=60){super(t,e,r,n,i),this.dpi=1,this.dpi=(null==r?void 0:r.dpi)||1,this.draw_id=null,this.redraw_id=null,this.animation_id=null,this.draw=this.draw.bind(this),this.animate=this.animate.bind(this),this.startAnimation=this.startAnimation.bind(this),this.resize(this.drawerOptions.width,this.drawerOptions.height)}resize(t,e,r,n=this.dpi){this.drawerOptions.width=t*n,this.drawerOptions.height=e*n,this.canvas&&(this.canvas.width=t*n,this.canvas.height=e*n,i.bBrowser&&this.canvas instanceof HTMLCanvasElement&&(this.canvas.style.width=t+"px",this.canvas.style.height=e+"px")),void 0!==r&&(this.drawerOptions.sceneFit=r),this.dispatch("drawer-canvas:resize")}animate(t){this.timeline.bSequenceStarted()&&(this.animation_id=requestAnimationFrame(this.animate),this.timeline.tick(t)&&this.draw())}startAnimation(){this.stopAnimation(),this.timeline.start(),this.animation_id=requestAnimationFrame(this.animate)}stopAnimation(){this.timeline.stop(),this.animation_id&&cancelAnimationFrame(this.animation_id)}pauseAnimation(){this.timeline.pause(),this.animation_id&&cancelAnimationFrame(this.animation_id)}playAnimation(){this.timeline.start(),requestAnimationFrame(this.animate)}redraw(){this.timeline.bSequenceStarted()?void 0!==typeof this.drawerOptions.ghosts&&0!==this.drawerOptions.ghosts||(this.stopAnimation(),this.redraw_id&&cancelAnimationFrame(this.redraw_id),this.redraw_id=requestAnimationFrame(this.startAnimation)):(this.draw_id&&cancelAnimationFrame(this.draw_id),void 0!==typeof this.drawerOptions.ghosts&&0!==this.drawerOptions.ghosts||this.timeline.stop(),this.draw_id=requestAnimationFrame(this.draw))}}e.BrowserDrawerCanvas=s},6151:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(8909),e),i(r(9962),e),i(r(4425),e),i(r(2251),e);const s=r(2251);e.default=s.BrowserDrawerCanvas},1532:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(8909),e),i(r(9962),e),i(r(2251),e),i(r(4425),e)},9724:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fit=e.bWorker=e.bBrowser=e.bNode=void 0,e.bNode="undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node,e.bBrowser="undefined"!=typeof window&&void 0!==window.document,e.bWorker="object"==typeof self&&["ServiceWorkerGlobalScope","DedicatedWorkerGlobalScope"].includes(self.constructor.name),e.fit=function(t,e,r,n,i="none"){let s=0,o=0,a=1,u=t,h=e;const c=r/n,l=t/e;return"contain"===i?(u=c>l?t*n/e:r,h=c>l?n:e*r/t,a=Math.max(u,h)/Math.max(t,e)):"cover"===i&&(u=c{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GCODEExporter=void 0;const n=r(1172),i=r(6479),s=r(310);class o{static parse(t,e){const r={...o.defaults,...e};return o.generate(t,r).join("\n")}static setUnit(t){return"inches"===t?"G20":"G21"}static useRelativePosition(){return"G91"}static useAbsolutePosition(){return"G90"}static goHome(t){return[t,"G28 X0 Y0"]}static setCurrentMachinePosition(t,e,r){return`G28.1 X${s.round(t,r)} Y${s.round(e,r)}`}static setCurrentWorkspacePosition(t,e,r){return`G92 X${s.round(t,r)} Y${s.round(e,r)}`}static goTo(t,e,r,n){return void 0!==n?`G1 X${s.round(t,r)} Y${s.round(e,r)} F${n}`:`G0 X${s.round(t,r)} Y${s.round(e,r)}`}static moveTo(t,e,r,n,i){return[t,this.goTo(r,n,i),e]}static lineTo(t,e,r,n){return this.goTo(t,e,n,r)}static generate(t,e){const r=e.maxX-e.minX,a=e.maxY-e.minY,u=r/a,h=t.width/t.height,c=[u>h?t.width*a/t.height:r,u>h?a:t.height*r/t.width],l=[(r-c[0])/2,(a-c[1])/2],f=u>h?t.width/c[0]:t.height/c[1],d=[];s.concat(d,e.penUpCommand),s.concat(d,this.setUnit(e.unit)),s.concat(d,this.useAbsolutePosition()),s.concat(d,this.setCurrentMachinePosition(e.minX,e.minY,e.decimals)),s.concat(d,this.setCurrentWorkspacePosition(e.minX,e.minY,e.decimals));const p=t.getChildren();for(let t=0,r=p.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},310:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.concat=e.round=void 0,e.round=(t,e)=>Math.round(t*10**e)/10**e,e.concat=(t,e)=>{"string"==typeof e?t.push(e):e.forEach((e=>t.push(e)))}},2674:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SVGExporter=void 0;const n=r(9887);class i{static parse(t,e={}){const r={...i.defaults,...e};return i.generate(t,r)}static getSVGProp(t,e,r){let n=e.shape.drawer[t];return"function"==typeof n&&(n=n(e)),null!=n?n:r}static bindColorAttribute(t,e,r,i){if(void 0!==e)if("none"===e)r.push(`${t}="none"`);else{const s=n.parseColorAndConvert(e);s&&(1!==s.alpha&&i.push(`${t}-opacity: ${s.alpha}`),r.push(`${t}="${n.rgbToHex(s.r,s.g,s.b)}"`))}}static generate(t,e){const r=i.generatePaths(t,e);let n;if(e.background){const e=[],r=[];i.bindColorAttribute("fill",t.background,e,r),r.length>0&&e.push(`styles="${r.join("; ")}"`),n=``}return`\n\t\x3c!-- Create with Urpflanze --\x3e`+(n?`\n\t${n}`:"")+`\n\t${r.join("\n\t")}\n`}static generatePaths(t,e){const r=[],n=t.getChildren();for(let s=0,o=n.length;s0&&l.push(`style="${f.join("; ")}"`);const g=``;r.push(g)}}return r}}e.SVGExporter=i,i.defaults={decimals:3,background:!0}},7773:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(4105),e),i(r(2674),e)},4105:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5917:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rgbToHsl=e.hslToRgb=e.rgbToHex=void 0,e.rgbToHex=function(t,e,r){return`#${((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}`},e.hslToRgb=function(t,e,r){let n,i,s;if(t/=360,r/=100,0==(e/=100))n=i=s=r;else{const o=(t,e,r)=>(r+=r<0?1:r>1?-1:0)<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,a=r<.5?r*(1+e):r+e-r*e,u=2*r-a;n=o(u,a,t+1/3),i=o(u,a,t),s=o(u,a,t-1/3)}return[.5+255*n<<0,.5+255*i<<0,.5+255*s<<0]},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;const n=Math.max(t,e,r),i=Math.min(t,e,r),s=(n+i)/2;let o,a;if(n===i)o=a=0;else{const u=n-i;switch(a=s>.5?u/(2-n-i):u/(n+i),n){case t:o=(e-r)/u+(e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.parseColorAndConvert=void 0;const n=r(5917);function i(t){if("number"==typeof t)return t>16777215?{type:"rgb",a:t>>24&255,b:t>>16&255,c:t>>8&255,alpha:(255&t)/255}:{type:"rgb",a:t>>16&255,b:t>>8&255,c:255&t,alpha:1};t=t.replace(/\s/g,"");let e=/^#([0-9a-f]{3,8})$/i.exec(t);if(e){const t=e[1];return 3===t.length?{type:"rgb",a:parseInt(t[0]+t[0],16),b:parseInt(t[1]+t[1],16),c:parseInt(t[2]+t[2],16),alpha:1}:{type:"rgb",a:parseInt(t[0]+t[1],16),b:parseInt(t[2]+t[3],16),c:parseInt(t[4]+t[5],16),alpha:t.length>6?parseInt(t.substring(6),16)/255:1}}if(e=/^((hsl|rgb)a?)\((\d+),(\d+)%?,(\d+)%?,?(.+)?\)$/i.exec(t),e){const[,,t,r,n,i,s]=e;return{type:t,a:+r,b:+n,c:+i,alpha:s?+s:1}}}e.parseColorAndConvert=function(t){const e=i(t);if(e){if("hsl"===e.type){const[t,r,i]=n.hslToRgb(e.a,e.b,e.c);return{r:t,g:r,b:i,h:e.a,s:e.b,l:e.c,alpha:e.alpha}}{const[t,r,i]=n.rgbToHsl(e.a,e.b,e.c);return{h:t,s:r,l:i,r:e.a,g:e.b,b:e.c,alpha:e.alpha}}}},e.parseColor=i},6073:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5052:t=>{window,t.exports=(()=>{var t={877:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SVGImporter=void 0;const n=r(500),i=r(688),s=r(926),o=r(926),a=r(479),u=r(721),h=r(197),c=r(825);class l{static isSVG(t){return l.SVG_REGEX.test(t.replace(l.COMMENT_REGEX,""))}static getWindowInstance(){return l.windowInstance}static setWindowInstance(t){l.windowInstance=t}static stringToSVG(t){if(t=t.trim(),!l.isSVG(t))return console.warn("[Urpflanze:SVGImport] | Input is not valid SVG string",t),null;const e=l.windowInstance.document.createElement("div");return e.innerHTML=t,e.firstChild}static parse(t,e=.01,r){if(!1===l.isSVG(t))return console.warn("[Urpflanze:SVGImport] | Input is not valid svg",t),null;const n=l.svgToBuffers(t,e);return n?l.parsedToShape(n,r):null}static parsedToShape(t,e){const r=[];if(t.buffers.forEach(((t,n)=>{const i=new s.ShapeBuffer({shape:t.buffer,bClosed:t.bClosed,sideLength:e,drawer:t.drawer});i&&r.push(i)})),1===r.length)return r[0];const n=new s.Group;return r.forEach((t=>n.add(t))),new s.Shape({shape:n})}static svgToBuffers(t,e=.01){const r="string"==typeof t?l.stringToSVG(t):t;if(null===r)return console.error("[Urpflanze:SVGImport] | Cannot convert string to svg",t),null;const n=l.getViewbox(r);r.querySelectorAll("g").forEach(l.propagateGroupTransformAndStyleToChildren);const i=Array.from(r.querySelectorAll("rect, circle, ellipse, line, polyline, polygon, path")),o=[].concat(...i.map((t=>l.elementToPath(t)))),a=Math.max(n[2]-n[0],n[3]-n[1]).toExponential(1).match(/e(\+?[0-9]+)/),u=10/(1e3/Math.min(10**Math.max(a?+a[1]:0,0),1e3));let h=o.map((t=>l.pathToBuffer(t,u,n))).filter((t=>!!t&&t.length>=2));h=h.map((t=>l.simpliyBuffer(t,e))),h=h.map(((t,e)=>l.pathIsClosed(o[e])&&s.Vec2.distance([t[0],t[1]],[t[t.length-2],t[t.length-1]])<1?t.subarray(0,t.length-2):t));const f=Math.sqrt((n[2]-n[0])*(n[3]-n[1])),d=l.getStyleAttr("fill",r),p=l.getStyleAttr("stroke",r),m=l.getStyleAttr("stroke-width",r,f/100),g=[];for(let t=0;t=0?c.fromPercentage(parseFloat(e),f):parseFloat(e));const n=l.getStyleAttr("fill",o[t],d||void 0),i=l.getStyleAttr("stroke",o[t],n?void 0:p||"rgba(255,255,255)"),s=r||(i?m:void 0);g.push({buffer:h[t],bClosed:l.pathIsClosed(o[t]),drawer:{fill:n,stroke:i,lineWidth:s?s/(f/100):void 0}})}return i.forEach((t=>t.remove())),{viewBox:n,buffers:g}}static getStyleAttr(t,e,r){const n=e.getAttribute(t);if("none"===n)return;let s;if(null!=n)s=n;else{const r="stroke-width"===t?"strokeWidth":t;void 0!==e.style[r]&&e.style[r].length>0&&(s=e.style[r])}if(void 0===s)return r;if("stroke-width"===t)return parseFloat(s);let o=parseFloat(e.getAttribute("opacity")||"1");const a=e.getAttribute("style");if(a&&a.length){const e=new RegExp(`${t}-opacity: +?(\\d?.\\d|\\d)`,"i"),r=a.match(e);r&&(o=parseFloat(r[1]))}const u=i.parseColor(s);return u?(o=1!==u.alpha?u.alpha:o,"rgb"===u.type?`rgba(${u.a}, ${u.b}, ${u.c}, ${o})`:`hsla(${u.a}, ${u.b}%, ${u.c}%, ${o})`):r}static getViewbox(t){const e=t.getAttribute("viewBox");if(e)return e.split(" ").map((t=>parseFloat(t)));const r=t.getAttribute("width"),n=t.getAttribute("height");if(r&&n)return[0,0,parseFloat(r),parseFloat(n)];t=t.cloneNode(!0);const i=Array.from(t.querySelectorAll("rect, circle, ellipse, line, polyline, polygon, path")),s=[].concat.apply([],i.map(l.elementToPath));let a=0,u=0;for(let t=0,e=s.length;ta&&(a=t.width),t.height>u&&(u=t.height)}}return[0,0,a,u]}static pathIsClosed(t){var e;return"z"===(null===(e=t.getAttribute("d"))||void 0===e?void 0:e.trim().substr(-1).toLowerCase())}static simpliyBuffer(t,e=.01){const r=[];for(let e=0,n=t.length;e{i[2*e]=t.x,i[2*e+1]=t.y})),i}static sanitizePath(t,e){return u(t).abs().unarc().transform(e||"").toString()}static pathToBuffer(t,e=.01,r=[-1,-1,1,1]){const i=r[2]-r[0],s=r[3]-r[1],o=2/Math.max(i,s),a=t.getAttribute("d"),u=t.getAttribute("transform")||"",h=new n.Path({d:l.sanitizePath(a,u)}),c=Math.floor(h.length()),f=2*Math.floor(c/e),d=new Float32Array(f);let p=0;for(let t=0;t0){const r=h.compose(h.fromDefinition(h.fromTransformAttribute(e))),n=t.children;Array.from(n).forEach((t=>{let n=t.getAttribute("transform");if(n&&n.length>0){const t=h.compose(h.fromDefinition(h.fromTransformAttribute(n))),e=h.compose(r,t);n=h.toSVG(e)}else n=e;t.setAttribute("transform",n)}))}["fill","stroke","stroke-width","style"].forEach((e=>{const r=t.getAttribute(e);r&&Array.from(t.children).forEach((t=>{null===t.getAttribute(e)&&t.setAttribute(e,r)}))}))}static elementToPath(t){const e=l.windowInstance.document;let r=[];return"path"===t.nodeName?r=u(t.getAttribute("d")||"").abs().unarc().toString().split("M").filter((t=>t.length>0)).map((t=>"M"+t)):["rect","ellipse","circle","line","polyline","polygon"].includes(t.nodeName)?r=[c.conversion[t.nodeName](t)]:console.warn(`[Urpflanze:SVGImport] | Cannot convert ${t.nodeName} to path`),r.map((r=>{const n=e.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d",r),n.setAttribute("transform",t.getAttribute("transform")||""),n.setAttribute("style",t.getAttribute("style")||""),n.setAttribute("fill",l.getStyleAttr("fill",t,"")+""),n.setAttribute("stroke",l.getStyleAttr("stroke",t,"")+""),n.setAttribute("opacity",t.getAttribute("opacity")||"1"),n.setAttribute("stroke-width",l.getStyleAttr("stroke-width",t,"")+""),n}))}}e.SVGImporter=l,l.HEX_REGEX="#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})",l.SVG_REGEX=/^\s*(?:<\?xml[^>]*>\s*)?(?:]*\s*(?:\[?(?:\s*]*>\s*)*\]?)*[^>]*>\s*)?(?:]*>[^]*<\/svg>|]*\/\s*>)\s*$/i,l.COMMENT_REGEX=//g},625:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.SVGImporter=void 0;const s=r(877);Object.defineProperty(e,"SVGImporter",{enumerable:!0,get:function(){return s.SVGImporter}}),i(r(291),e),s.SVGImporter.setWindowInstance(window),e.default=s.SVGImporter},291:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},825:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.conversion=e.fromPercentage=void 0,e.fromPercentage=(t,e)=>/%$/.test(t+"")?100*parseFloat((t+"").replace("%",""))/e:+t;const r={rect:t=>{const r=parseFloat(t.getAttribute("width")||"0"),n=parseFloat(t.getAttribute("height")||"0"),i=parseFloat(t.getAttribute("x")||"0"),s=parseFloat(t.getAttribute("y")||"0");let o=t.getAttribute("rx")||"auto",a=t.getAttribute("ry")||"auto";"auto"===o&&"auto"===a?o=a=0:"auto"!==o&&"auto"===a?o=a=e.fromPercentage(o,r):"auto"!==a&&"auto"===o?a=o=e.fromPercentage(a,n):(o=e.fromPercentage(o,r),a=e.fromPercentage(a,n)),o>r/2&&(o=r/2),a>n/2&&(a=n/2);const u=o>0&&a>0;return[`M${i+o} ${s}`,"H"+(i+r-o),...u?[`A${o} ${a} 0 0 1 ${i+r} ${s+a}`]:[],"V"+(s+n-a),...u?[`A${o} ${a} 0 0 1 ${i+r-o} ${s+n}`]:[],`H${i+o}`,...u?[`A${o} ${a} 0 0 1 ${i} ${s+n-a}`]:[],`V${s+a}`,...u?[`A${o} ${a} 0 0 1 ${i+o} ${s}`]:[],"Z"].join(" ")},ellipse:t=>{var e,r,n,i;const s=parseFloat(t.getAttribute("cx")||"0"),o=parseFloat(t.getAttribute("cy")||"0"),a=parseFloat(null!==(r=null!==(e=t.getAttribute("rx"))&&void 0!==e?e:t.getAttribute("r"))&&void 0!==r?r:"0"),u=parseFloat(null!==(i=null!==(n=t.getAttribute("ry"))&&void 0!==n?n:t.getAttribute("r"))&&void 0!==i?i:"0");return[`M${s+a} ${o}`,`A${a} ${u} 0 0 1 ${s} ${o+u}`,`A${a} ${u} 0 0 1 ${s-a} ${o}`,`A${a} ${u} 0 0 1 ${s+a} ${o}`,"Z"].join(" ")},circle:t=>r.ellipse(t),line:t=>`M${t.getAttribute("x1")||"0"} ${t.getAttribute("y1")||"0"} L${t.getAttribute("x2")||"0"} ${t.getAttribute("y2")||"0"}`,polyline:t=>((t,e=2)=>{const r=[];for(;t.length>0;)r.push(t.splice(0,e));return r})((t.getAttribute("points")||"").trim().replace(/ +/g," ").split(" ").reduce(((t,e)=>[...t,...e.includes(",")?e.split(","):[e]]),[]),2).map((([t,e],r)=>`${0===r?"M":"L"}${t} ${e}`)).join(" "),polygon:t=>r.polyline(t)+" Z",path:t=>t.getAttribute("d")+""};e.conversion=r},500:(t,e,r)=>{"use strict";r.r(e),r.d(e,{A:()=>hr,Animator:()=>Ye,Array:()=>Rt,Box:()=>mt,Circle:()=>ir,ClipPath:()=>sr,Color:()=>ht,Container:()=>zt,Controller:()=>pe,Defs:()=>qt,Dom:()=>Ft,Ease:()=>de,Element:()=>jt,Ellipse:()=>Jt,EventTarget:()=>Et,ForeignObject:()=>or,Fragment:()=>Qt,G:()=>ur,Gradient:()=>ne,Image:()=>se,Line:()=>ue,List:()=>vt,Marker:()=>he,Mask:()=>cr,Matrix:()=>ft,Morphable:()=>ke,NonMorphable:()=>Ie,Number:()=>Tt,ObjectBag:()=>Re,PID:()=>ve,Path:()=>je,PathArray:()=>Oe,Pattern:()=>ie,Point:()=>ct,PointArray:()=>oe,Polygon:()=>ze,Polyline:()=>qe,Queue:()=>Ue,Rect:()=>Ne,Runner:()=>$e,SVG:()=>mr,Shape:()=>Nt,Spring:()=>ge,Stop:()=>lr,Style:()=>fr,Svg:()=>Ke,Symbol:()=>tr,Text:()=>rr,TextPath:()=>dr,Timeline:()=>Ge,TransformBag:()=>Ce,Tspan:()=>nr,Use:()=>pr,adopt:()=>F,assignNewId:()=>Y,clearEvents:()=>St,create:()=>R,defaults:()=>Bt,dispatch:()=>Ot,easing:()=>le,eid:()=>U,extend:()=>V,find:()=>bt,getClass:()=>q,getEventTarget:()=>_t,getEvents:()=>xt,getWindow:()=>k,makeInstance:()=>T,makeMorphable:()=>Fe,mockAdopt:()=>D,namespaces:()=>x,nodeOrNew:()=>L,off:()=>At,on:()=>Pt,parser:()=>dt,regex:()=>st,register:()=>z,registerMorphableType:()=>Le,registerWindow:()=>S,restoreWindow:()=>O,root:()=>B,saveWindow:()=>A,utils:()=>g,windowEvents:()=>Mt,withWindow:()=>E,wrapWithAttrCheck:()=>Z});const n={},i=[];function s(t,e){if(Array.isArray(t))for(const r of t)s(r,e);else if("object"!=typeof t)a(Object.getOwnPropertyNames(e)),n[t]=Object.assign(n[t]||{},e);else for(const e in t)s(e,t[e])}function o(t){return n[t]||{}}function a(t){i.push(...t)}function u(t,e){let r;const n=t.length,i=[];for(r=0;r=0;e--)Y(t.children[e]);return t.id?(t.id=U(t.nodeName),t):t}function V(t,e){let r,n;for(n=(t=Array.isArray(t)?t:[t]).length-1;n>=0;n--)for(r in e)t[n].prototype[r]=e[r]}function Z(t){return function(...e){const r=e[e.length-1];return!r||r.constructor!==Object||r instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(r)}}s("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=T(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=T(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=T(t)).before(this),this},insertAfter:function(t){return(t=T(t)).after(this),this}});const G=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,$=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,X=/rgb\((\d+),(\d+),(\d+)\)/,H=/(#[a-z_][a-z0-9\-_]*)/i,W=/\)\s*,?\s*/,J=/\s/g,Q=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,K=/^rgb\(/,tt=/^(\s+)?$/,et=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,rt=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,nt=/[\s,]+/,it=/[MLHVCSQTAZ]/i;var st={__proto__:null,numberAndUnit:G,hex:$,rgb:X,reference:H,transforms:W,whitespace:J,isHex:Q,isRgb:K,isBlank:tt,isNumber:et,isImage:rt,delimiter:nt,isPathLetter:it};function ot(t){const e=Math.round(t),r=Math.max(0,Math.min(255,e)).toString(16);return 1===r.length?"0"+r:r}function at(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function ut(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}s("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(nt)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),s("Dom",{css:function(t,e){const r={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);r[e[0]]=e[1]})),r;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=l(e);r[t]=this.node.style[t]}return r}if("string"==typeof t)return this.node.style[l(t)];if("object"==typeof t)for(const e in t)this.node.style[l(e)]=null==t[e]||tt.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[l(t)]=null==e||tt.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),s("Dom",{data:function(t,e,r){if(null==t)return this.data(u(h(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const r of t)e[r]=this.data(r);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===r||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),s("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class ht{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof ht||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e,r){const{random:n,round:i,sin:s,PI:o}=Math;if("vibrant"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new ht(t,e,r,"lch")}if("sine"===t){const t=i(80*s(2*o*(e=null==e?n():e)/.5+.01)+150),r=i(50*s(2*o*e/.5+4.6)+200),a=i(100*s(2*o*e/.5+2.3)+150);return new ht(t,r,a)}if("pastel"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new ht(t,e,r,"lch")}if("dark"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new ht(t,e,r,"lch")}if("rgb"===t){const t=255*n(),e=255*n(),r=255*n();return new ht(t,e,r)}if("lab"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new ht(t,e,r,"lab")}if("grey"===t){const t=255*n();return new ht(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(Q.test(t)||K.test(t))}cmyk(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.min(1-n,1-i,1-s);return 1===o?new ht(0,0,0,1,"cmyk"):new ht((1-n-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.max(n,i,s),a=Math.min(n,i,s),u=(o+a)/2,h=o===a,c=o-a;return new ht(360*(h?0:o===n?((i-s)/c+(i.5?c/(2-o-a):c/(o+a)),100*u,"hsl")}init(t=0,e=0,r=0,n=0,i="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)i="string"==typeof n?n:i,n="string"==typeof n?0:n,Object.assign(this,{_a:t,_b:e,_c:r,_d:n,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const r=function(t,e){const r=at(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:at(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:at(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:at(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:at(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:at(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return r.space=e||r.space,r}(t,e);Object.assign(this,r)}else if("string"==typeof t)if(K.test(t)){const e=t.replace(J,""),[r,n,i]=X.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}else{if(!Q.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,r,n,i]=$.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:u}=this,h="rgb"===this.space?{r:s,g:o,b:a}:"xyz"===this.space?{x:s,y:o,z:a}:"hsl"===this.space?{h:s,s:o,l:a}:"lab"===this.space?{l:s,a:o,b:a}:"lch"===this.space?{l:s,c:o,h:a}:"cmyk"===this.space?{c:s,m:o,y:a,k:u}:{};Object.assign(this,h)}lab(){const{x:t,y:e,z:r}=this.xyz();return new ht(116*e-16,500*(t-e),200*(e-r),"lab")}lch(){const{l:t,a:e,b:r}=this.lab(),n=Math.sqrt(e**2+r**2);let i=180*Math.atan2(r,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new ht(t,n,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:n,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,r=Math.PI/180;i=t*Math.cos(r*e),s=t*Math.sin(r*e)}const o=(n+16)/116,a=i/500+o,u=o-s/200,h=16/116,c=.008856,l=7.787;t=.95047*(a**3>c?a**3:(a-h)/l),e=1*(o**3>c?o**3:(o-h)/l),r=1.08883*(u**3>c?u**3:(u-h)/l)}const n=3.2406*t+-1.5372*e+-.4986*r,i=-.9689*t+1.8758*e+.0415*r,s=.0557*t+-.204*e+1.057*r,o=Math.pow,a=.0031308,u=n>a?1.055*o(n,1/2.4)-.055:12.92*n,h=i>a?1.055*o(i,1/2.4)-.055:12.92*i,c=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new ht(255*u,255*h,255*c)}if("hsl"===this.space){let{h:t,s:e,l:r}=this;if(t/=360,e/=100,r/=100,0===e)return r*=255,new ht(r,r,r);const n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,s=255*ut(i,n,t+1/3),o=255*ut(i,n,t),a=255*ut(i,n,t-1/3);return new ht(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:r,k:n}=this,i=255*(1-Math.min(1,t*(1-n)+n)),s=255*(1-Math.min(1,e*(1-n)+n)),o=255*(1-Math.min(1,r*(1-n)+n));return new ht(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:r,_d:n,space:i}=this;return[t,e,r,n,i]}toHex(){const[t,e,r]=this._clamped().map(ot);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,u=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=(.4124*o+.3576*a+.1805*u)/.95047,c=(.2126*o+.7152*a+.0722*u)/1,l=(.0193*o+.1192*a+.9505*u)/1.08883,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,d=c>.008856?Math.pow(c,1/3):7.787*c+16/116,p=l>.008856?Math.pow(l,1/3):7.787*l+16/116;return new ht(f,d,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:r}=this.rgb(),{max:n,min:i,round:s}=Math;return[t,e,r].map((t=>n(0,i(s(t),255))))}}class ct{constructor(...t){this.init(...t)}clone(){return new ct(this)}init(t,e){const r=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==r.x?0:r.x,this.y=null==r.y?0:r.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){ft.isMatrixLike(t)||(t=new ft(t));const{x:e,y:r}=this;return this.x=t.a*e+t.c*r+t.e,this.y=t.b*e+t.d*r+t.f,this}}function lt(t,e,r){return Math.abs(e-t)<(r||1e-6)}class ft{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,r=t.flip&&(e||"x"===t.flip)?-1:1,n=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleX)?t.scaleX*r:r,a=t.scale&&t.scale.length?t.scale[1]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleY)?t.scaleY*n:n,u=t.shear||0,h=t.rotate||t.theta||0,c=new ct(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=c.x,f=c.y,d=new ct(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.y,g=new ct(t.translate||t.tx||t.translateX,t.ty||t.translateY),v=g.x,y=g.y,b=new ct(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:u,theta:h,rx:b.x,ry:b.y,tx:v,ty:y,ox:l,oy:f,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,r){const n=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,u=t.f+t.b*e.e+t.d*e.f;return r.a=n,r.b=i,r.c=s,r.d=o,r.e=a,r.f=u,r}around(t,e,r){return this.clone().aroundO(t,e,r)}aroundO(t,e,r){const n=t||0,i=e||0;return this.translateO(-n,-i).lmultiplyO(r).translateO(n,i)}clone(){return new ft(this)}decompose(t=0,e=0){const r=this.a,n=this.b,i=this.c,s=this.d,o=this.e,a=this.f,u=r*s-n*i,h=u>0?1:-1,c=h*Math.sqrt(r*r+n*n),l=Math.atan2(h*n,h*r),f=180/Math.PI*l,d=Math.cos(l),p=Math.sin(l),m=(r*i+n*s)/u,g=i*c/(m*r-n)||s*c/(m*n+r);return{scaleX:c,scaleY:g,shear:m,rotate:f,translateX:o-t+t*d*c+e*(m*d*c-p*g),translateY:a-e+t*p*c+e*(m*p*c+d*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new ft(t);return lt(this.a,e.a)&<(this.b,e.b)&<(this.c,e.c)&<(this.d,e.d)&<(this.e,e.e)&<(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=ft.fromArray([1,0,0,1,0,0]);return t=t instanceof jt?t.matrixify():"string"==typeof t?ft.fromArray(t.split(nt).map(parseFloat)):Array.isArray(t)?ft.fromArray(t):"object"==typeof t&&ft.isMatrixLike(t)?t:"object"==typeof t?(new ft).transform(t):6===arguments.length?ft.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,r=this.c,n=this.d,i=this.e,s=this.f,o=t*n-e*r;if(!o)throw new Error("Cannot invert "+this);const a=n/o,u=-e/o,h=-r/o,c=t/o,l=-(a*i+h*s),f=-(u*i+c*s);return this.a=a,this.b=u,this.c=h,this.d=c,this.e=l,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof ft?t:new ft(t);return ft.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof ft?t:new ft(t);return ft.matrixMultiply(this,e,this)}rotate(t,e,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=c(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:u,e:h,f:l}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-u*i,this.d=u*n+a*i,this.e=h*n-l*i+r*i-e*n+e,this.f=l*n+h*i-e*i-r*n+r,this}scale(t,e,r,n){return this.clone().scaleO(...arguments)}scaleO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t);const{a:i,b:s,c:o,d:a,e:u,f:h}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=u*t-r*t+r,this.f=h*e-n*e+n,this}shear(t,e,r){return this.clone().shearO(t,e,r)}shearO(t,e=0,r=0){const{a:n,b:i,c:s,d:o,e:a,f:u}=this;return this.a=n+i*t,this.c=s+o*t,this.e=a+u*t-r*t,this}skew(t,e,r,n){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=c(t),e=c(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:u,d:h,e:l,f}=this;return this.a=o+a*i,this.b=a+o*s,this.c=u+h*i,this.d=h+u*s,this.e=l+f*i-n*i,this.f=f+l*s-r*s,this}skewX(t,e,r){return this.skew(t,0,e,r)}skewY(t,e,r){return this.skew(0,t,e,r)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(ft.isMatrixLike(t))return new ft(t).multiplyO(this);const e=ft.formatTransforms(t),{x:r,y:n}=new ct(e.ox,e.oy).transform(this),i=(new ft).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-r,-n).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(r,n);if(isFinite(e.px)||isFinite(e.py)){const t=new ct(r,n).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function dt(){if(!dt.nodes){const t=T().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;dt.nodes={svg:t,path:e}}if(!dt.nodes.svg.node.parentNode){const t=_.document.body||_.document.documentElement;dt.nodes.svg.addTo(t)}return dt.nodes}function pt(t){return!(t.width||t.height||t.x||t.y)}z(ft,"Matrix");class mt{constructor(...t){this.init(...t)}addOffset(){return this.x+=_.window.pageXOffset,this.y+=_.window.pageYOffset,new mt(this)}init(t){return t="string"==typeof t?t.split(nt).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return pt(this)}merge(t){const e=Math.min(this.x,t.x),r=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-r;return new mt(e,r,n,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof ft||(t=new ft(t));let e=1/0,r=-1/0,n=1/0,i=-1/0;return[new ct(this.x,this.y),new ct(this.x2,this.y),new ct(this.x,this.y2),new ct(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),r=Math.max(r,s.x),n=Math.min(n,s.y),i=Math.max(i,s.y)})),new mt(e,n,r-e,i-n)}}function gt(t,e,r){let n;try{if(n=e(t.node),pt(n)&&(i=t.node)!==_.document&&!(_.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===_.document}).call(_.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){n=r(t)}var i;return n}s({viewbox:{viewbox(t,e,r,n){return null==t?new mt(this.attr("viewBox")):this.attr("viewBox",new mt(t,e,r,n))},zoom(t,e){let{width:r,height:n}=this.attr(["width","height"]);if((r||n)&&"string"!=typeof r&&"string"!=typeof n||(r=this.node.clientWidth,n=this.node.clientHeight),!r||!n)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=r/i.width,o=n/i.height,a=Math.min(s,o);if(null==t)return a;let u=a/t;u===1/0&&(u=Number.MAX_SAFE_INTEGER/100),e=e||new ct(r/2/s+i.x,n/2/o+i.y);const h=new mt(i).transform(new ft({scale:u,origin:e}));return this.viewbox(h)}}}),z(mt,"Box");class vt extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}V([vt],{each(t,...e){return"function"==typeof t?this.map(((e,r,n)=>t.call(e,e,r,n))):this.map((r=>r[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const yt=["toArray","constructor","each"];function bt(t,e){return new vt(u((e||_.document).querySelectorAll(t),(function(t){return F(t)})))}vt.extend=function(t){t=t.reduce(((t,e)=>(yt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),V([vt],t)};let wt=0;const Mt={};function xt(t){let e=t.getEventHolder();return e===_.window&&(e=Mt),e.events||(e.events={}),e.events}function _t(t){return t.getEventTarget()}function St(t){let e=t.getEventHolder();e===_.window&&(e=Mt),e.events&&(e.events={})}function Pt(t,e,r,n,i){const s=r.bind(n||t),o=T(t),a=xt(o),u=_t(o);e=Array.isArray(e)?e:e.split(nt),r._svgjsListenerId||(r._svgjsListenerId=++wt),e.forEach((function(t){const e=t.split(".")[0],n=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][r._svgjsListenerId]=s,u.addEventListener(e,s,i||!1)}))}function At(t,e,r,n){const i=T(t),s=xt(i),o=_t(i);("function"!=typeof r||(r=r._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(nt)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,h;if(r)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][r],n||!1),delete s[e][a||"*"][r]);else if(e&&a){if(s[e]&&s[e][a]){for(h in s[e][a])At(o,[e,a].join("."),h);delete s[e][a]}}else if(a)for(t in s)for(u in s[t])a===u&&At(o,[t,a].join("."));else if(e){if(s[e]){for(u in s[e])At(o,[e,u].join("."));delete s[e]}}else{for(t in s)At(o,t);St(i)}}))}function Ot(t,e,r,n){const i=_t(t);return e instanceof _.window.Event||(e=new _.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}class Et extends I{addEventListener(){}dispatch(t,e,r){return Ot(this,t,e,r)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const r=e[t.type];for(const e in r)for(const n in r[e])r[e][n](t);return!t.defaultPrevented}fire(t,e,r){return this.dispatch(t,e,r),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e){return At(this,t,e),this}on(t,e,r,n){return Pt(this,t,e,r,n),this}removeEventListener(){}}function kt(){}z(Et,"EventTarget");const It={duration:400,ease:">",delay:0},Ct={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};var Bt={__proto__:null,noop:kt,timeline:It,attrs:Ct};class Rt extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(nt).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class Tt{constructor(...t){this.init(...t)}convert(t){return new Tt(this.value,t)}divide(t){return t=new Tt(t),new Tt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(G))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof Tt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new Tt(t),new Tt(this-t,this.unit||t.unit)}plus(t){return t=new Tt(t),new Tt(this+t,this.unit||t.unit)}times(t){return t=new Tt(t),new Tt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const Lt=[];class Ft extends Et{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=T(t)).removeNamespace&&this.node instanceof _.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return T(t).put(this,e)}children(){return new vt(u(this.node.children,(function(t){return F(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0){return this.writeDataToDom(),new this.constructor(Y(this.node.cloneNode(t)))}each(t,e){const r=this.children();let n,i;for(n=0,i=r.length;n=0}html(t,e){return this.xml(t,e,y)}id(t){return void 0!==t||this.node.id||(this.node.id=U(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return F(this.node.lastChild)}matches(t){const e=this.node,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return r&&r.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=F(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=F(e.node.parentNode));return e}put(t,e){return t=T(t),this.add(t,e),t}putIn(t,e){return T(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=T(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const r=10**t,n=this.attr(e);for(const t in n)"number"==typeof n[t]&&(n[t]=Math.round(n[t]*r)/r);return this.attr(n),this}svg(t,e){return this.xml(t,e,v)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const r=e.index(this);return e.put(t,r).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let r=this;if(null!=t){if(r=F(r.node.cloneNode(!0)),e){const e=t(r);if(r=e||r,!1===e)return""}r.each((function(){const e=t(this),r=e||this;!1===e?this.remove():e&&this!==r&&this.replace(r)}),!0)}return e?r.node.outerHTML:r.node.innerHTML}e=null!=e&&e;const n=R("wrapper",r),i=_.document.createDocumentFragment();n.innerHTML=t;for(let t=n.children.length;t--;)i.appendChild(n.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}V(Ft,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=et.test(r.nodeValue)?parseFloat(r.nodeValue):r.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?Ct[t]:et.test(e)?parseFloat(e):e;"number"==typeof(e=Lt.reduce(((e,r)=>r(t,e,this)),e))?e=new Tt(e):ht.isColor(e)?e=new ht(e):e.constructor===Array&&(e=new Rt(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof r?this.node.setAttributeNS(r,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return bt(t,this.node)},findOne:function(t){return F(this.node.querySelector(t))}}),z(Ft,"Dom");class jt extends Ft{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,t.hasAttribute("svgjs:data")&&this.setData(JSON.parse(t.getAttribute("svgjs:data"))||{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new Tt(t).plus(this.x()))}dy(t=0){return this.y(new Tt(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){t=T(t);const e=new vt;let r=this;for(;(r=r.parent())&&r.node!==_.document&&"#document-fragment"!==r.nodeName&&(e.push(r),r.node!==t.node););return e}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(H);return e?T(e[1]):null}root(){const t=this.parent(q(B));return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const r=p(this,t,e);return this.width(new Tt(r.width)).height(new Tt(r.height))}width(t){return this.attr("width",t)}writeDataToDom(){return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}V(jt,{bbox:function(){const t=gt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(dt().svg).show(),r=e.node.getBBox();return e.remove(),r}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new mt(t)},rbox:function(t){const e=gt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),r=new mt(e);return t?r.transform(t.screenCTM().inverseO()):r.addOffset()},inside:function(t,e){const r=this.bbox();return t>r.x&&e>r.y&&t=0;r--)null!=e[Dt[t][r]]&&this.attr(Dt.prefix(t,Dt[t][r]),e[Dt[t][r]]);return this},s(["Element","Runner"],e)})),s(["Element","Runner"],{matrix:function(t,e,r,n,i,s){return null==t?new ft(this):this.attr("transform",new ft(t,e,r,n,i,s))},rotate:function(t,e,r){return this.transform({rotate:t,ox:e,oy:r},!0)},skew:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:r},!0):this.transform({skew:[t,e],ox:r,oy:n},!0)},shear:function(t,e,r){return this.transform({shear:t,ox:e,oy:r},!0)},scale:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:r},!0):this.transform({scale:[t,e],ox:r,oy:n},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),s("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new Tt(t)):this.rx(t).ry(e)}}),s("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new ct(this.node.getPointAtLength(t))}}),s(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),s("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),s("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(W).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(nt).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(ft.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new ft)},toParent:function(t,e){if(this===t)return this;const r=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(n.multiply(r)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new ft(this).decompose();return null==t?e:e[t]}ft.isMatrixLike(t)||(t={...t,origin:m(t,this)});const r=new ft(!0===e?this:e||!1).transform(t);return this.attr("transform",r)}});class zt extends jt{flatten(t=this,e){return this.each((function(){if(this instanceof zt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(r,n){return n[n.length-r-1].toParent(t,e)})),this.remove()}}z(zt,"Container");class qt extends zt{constructor(t,e=t){super(L("defs",t),e)}flatten(){return this}ungroup(){return this}}z(qt,"Defs");class Nt extends jt{}function Ut(t){return this.attr("rx",t)}function Yt(t){return this.attr("ry",t)}function Vt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Zt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Gt(t){return this.attr("cx",t)}function $t(t){return this.attr("cy",t)}function Xt(t){return null==t?2*this.rx():this.rx(new Tt(t).divide(2))}function Ht(t){return null==t?2*this.ry():this.ry(new Tt(t).divide(2))}z(Nt,"Shape");var Wt={__proto__:null,rx:Ut,ry:Yt,x:Vt,y:Zt,cx:Gt,cy:$t,width:Xt,height:Ht};class Jt extends Nt{constructor(t,e=t){super(L("ellipse",t),e)}size(t,e){const r=p(this,t,e);return this.rx(new Tt(r.width).divide(2)).ry(new Tt(r.height).divide(2))}}V(Jt,Wt),s("Container",{ellipse:Z((function(t=0,e=t){return this.put(new Jt).size(t,e).move(0,0)}))}),z(Jt,"Ellipse");class Qt extends Ft{constructor(t=_.document.createDocumentFragment()){super(t)}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){const t=new Ft(R("wrapper",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}}function Kt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new Tt(t),fy:new Tt(e)}):this.attr({x1:new Tt(t),y1:new Tt(e)})}function te(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new Tt(t),cy:new Tt(e)}):this.attr({x2:new Tt(t),y2:new Tt(e)})}z(Qt,"Fragment");var ee,re={__proto__:null,from:Kt,to:te};class ne extends zt{constructor(t,e){super(L(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,r){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,r)}bbox(){return new mt}targets(){return bt('svg [fill*="'+this.id()+'"]')}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return'url("#'+this.id()+'")'}}V(ne,re),s({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:Z((function(t,e){return this.put(new ne(t)).update(e)}))}}),z(ne,"Gradient");class ie extends zt{constructor(t,e=t){super(L("pattern",t),e)}attr(t,e,r){return"transform"===t&&(t="patternTransform"),super.attr(t,e,r)}bbox(){return new mt}targets(){return bt('svg [fill*="'+this.id()+'"]')}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return'url("#'+this.id()+'")'}}s({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:Z((function(t,e,r){return this.put(new ie).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),z(ie,"Pattern");class se extends Nt{constructor(t,e=t){super(L("image",t),e)}load(t,e){if(!t)return this;const r=new _.window.Image;return Pt(r,"load",(function(t){const n=this.parent(ie);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof ie&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),Pt(r,"load error",(function(){At(r)})),this.attr("href",r.src=t,w)}}ee=function(t,e,r){return"fill"!==t&&"stroke"!==t||rt.test(e)&&(e=r.root().defs().image(e)),e instanceof se&&(e=r.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},Lt.push(ee),s({Container:{image:Z((function(t,e){return this.put(new se).size(0,0).load(t,e)}))}}),z(se,"Image");class oe extends Rt{bbox(){let t=-1/0,e=-1/0,r=1/0,n=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),r=Math.min(i[0],r),n=Math.min(i[1],n)})),new mt(r,n,t-r,e-n)}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(nt).map(parseFloat)).length%2!=0&&t.pop();for(let r=0,n=t.length;r=0;r--)n.width&&(this[r][0]=(this[r][0]-n.x)*t/n.width+n.x),n.height&&(this[r][1]=(this[r][1]-n.y)*e/n.height+n.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,r=this.length;e":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,r,n){return function(i){return i<0?t>0?e/t*i:r>0?n/r*i:0:i>1?r<1?(1-n)/(1-r)*i+(n-r)/(1-r):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*n+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let r=t;return"none"===e?--r:"both"===e&&++r,(n,i=!1)=>{let s=Math.floor(n*t);const o=n*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,n>=0&&s<0&&(s=0),n<=1&&s>r&&(s=r),s/r}}};class fe{done(){return!1}}class de extends fe{constructor(t=It.ease){super(),this.ease=le[t]||t}step(t,e,r){return"number"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}}class pe extends fe{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}}function me(){const t=(this._duration||500)/1e3,e=this._overshoot||0,r=Math.PI,n=Math.log(e/100+1e-10),i=-n/Math.sqrt(r*r+n*n),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}class ge extends pe{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;r>100&&(r=16),r/=1e3;const i=n.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*r+s*r*r/2;return n.velocity=i+s*r,n.done=Math.abs(e-o)+Math.abs(i)<.002,n.done?e:o}}V(ge,{duration:ce("_duration",me),overshoot:ce("_overshoot",me)});class ve extends pe{constructor(t=.1,e=.01,r=0,n=1e3){super(),this.p(t).i(e).d(r).windup(n)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;const i=e-t;let s=(n.integral||0)+i*r;const o=(i-(n.error||0))/r,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),n.error=i,n.integral=s,n.done=Math.abs(i)<.001,n.done?e:t+(this.P*i+this.I*s+this.D*o)}}V(ve,{windup:ce("_windup"),p:ce("P"),i:ce("I"),d:ce("D")});const ye={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},be={M:function(t,e,r){return e.x=r.x=t[0],e.y=r.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,r){return e.x=r.x,e.y=r.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},we="mlhvqtcsaz".split("");for(let t=0,e=we.length;t=0;n--)r=this[n][0],"M"===r||"L"===r||"T"===r?(this[n][1]+=t,this[n][2]+=e):"H"===r?this[n][1]+=t:"V"===r?this[n][1]+=e:"C"===r||"S"===r||"Q"===r?(this[n][1]+=t,this[n][2]+=e,this[n][3]+=t,this[n][4]+=e,"C"===r&&(this[n][5]+=t,this[n][6]+=e)):"A"===r&&(this[n][6]+=t,this[n][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let r=0,n="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new ct,p:new ct};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!xe(i,n))if("."!==n)if(isNaN(parseInt(n)))if(" "!==n&&","!==n)if("-"!==n)if("E"!==n.toUpperCase()){if(it.test(n)){if(i.inNumber)_e(i,!1);else{if(!Me(i))throw new Error("parser Error");Se(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!Ae(i)){_e(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else i.inNumber&&_e(i,!1);else{if("0"===i.number||Pe(i)){i.inNumber=!0,i.number=n,_e(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){_e(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&_e(i,!1),i.inSegment&&Me(i)&&Se(i),i.segments}(t)}size(t,e){const r=this.bbox();let n,i;for(r.width=0===r.width?1:r.width,r.height=0===r.height?1:r.height,n=this.length-1;n>=0;n--)i=this[n][0],"M"===i||"L"===i||"T"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):"H"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:"V"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:"C"===i||"S"===i||"Q"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,"C"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):"A"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this}toString(){return function(t){let e="";for(let r=0,n=t.length;r{const e=typeof t;return"number"===e?Tt:"string"===e?ht.isColor(t)?ht:nt.test(t)?it.test(t)?Oe:Rt:G.test(t)?Tt:Ie:Te.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Rt:"object"===e?Re:Ie};class ke{constructor(t){this._stepper=t||new de("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){const e=this;return this._morphObj.fromArray(this._from.map((function(r,n){return e._stepper.step(r,e._to[n],t,e._context[n],e._context)})))}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(Ee(t));let e=new this._type(t);return this._type===ht&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Re&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toArray(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class Ie{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class Ce{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,Ce.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}Ce.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Be=(t,e)=>t[0]e[0]?1:0;class Re{constructor(...t){this.init(...t)}align(t){for(let e=0,r=this.values.length;et.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const r=e.shift(),n=e.shift(),i=e.shift(),s=e.splice(0,i);t[r]=new n(s).valueOf()}return t}}const Te=[Ie,Ce,Re];function Le(t=[]){Te.push(...[].concat(t))}function Fe(){V(Te,{to(t){return(new ke).type(this.constructor).from(this.valueOf()).to(t)},fromArray(t){return this.init(t),this}})}class je extends Nt{constructor(t,e=t){super(L("path",t),e)}array(){return this._array||(this._array=new Oe(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new Oe(t))}size(t,e){const r=p(this,t,e);return this.attr("d",this.array().size(r.width,r.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}je.prototype.MorphArray=Oe,s({Container:{path:Z((function(t){return this.put(new je).plot(t||new Oe)}))}}),z(je,"Path");var De={__proto__:null,array:function(){return this._array||(this._array=new oe(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new oe(t))},size:function(t,e){const r=p(this,t,e);return this.attr("points",this.array().size(r.width,r.height))}};class ze extends Nt{constructor(t,e=t){super(L("polygon",t),e)}}s({Container:{polygon:Z((function(t){return this.put(new ze).plot(t||new oe)}))}}),V(ze,ae),V(ze,De),z(ze,"Polygon");class qe extends Nt{constructor(t,e=t){super(L("polyline",t),e)}}s({Container:{polyline:Z((function(t){return this.put(new qe).plot(t||new oe)}))}}),V(qe,ae),V(qe,De),z(qe,"Polyline");class Ne extends Nt{constructor(t,e=t){super(L("rect",t),e)}}V(Ne,{rx:Ut,ry:Yt}),s({Container:{rect:Z((function(t,e){return this.put(new Ne).size(t,e)}))}}),z(Ne,"Rect");class Ue{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Ye={nextDraw:null,frames:new Ue,timeouts:new Ue,immediates:new Ue,timer:()=>_.window.performance||_.window.Date,transforms:[],frame(t){const e=Ye.frames.push({run:t});return null===Ye.nextDraw&&(Ye.nextDraw=_.window.requestAnimationFrame(Ye._draw)),e},timeout(t,e){e=e||0;const r=Ye.timer().now()+e,n=Ye.timeouts.push({run:t,time:r});return null===Ye.nextDraw&&(Ye.nextDraw=_.window.requestAnimationFrame(Ye._draw)),n},immediate(t){const e=Ye.immediates.push(t);return null===Ye.nextDraw&&(Ye.nextDraw=_.window.requestAnimationFrame(Ye._draw)),e},cancelFrame(t){null!=t&&Ye.frames.remove(t)},clearTimeout(t){null!=t&&Ye.timeouts.remove(t)},cancelImmediate(t){null!=t&&Ye.immediates.remove(t)},_draw(t){let e=null;const r=Ye.timeouts.last();for(;(e=Ye.timeouts.shift())&&(t>=e.time?e.run():Ye.timeouts.push(e),e!==r););let n=null;const i=Ye.frames.last();for(;n!==i&&(n=Ye.frames.shift());)n.run(t);let s=null;for(;s=Ye.immediates.shift();)s();Ye.nextDraw=Ye.timeouts.first()||Ye.frames.first()?_.window.requestAnimationFrame(Ye._draw):null}},Ve=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},Ze=function(){const t=_.window;return(t.performance||t.Date).now()};class Ge extends Et{constructor(t=Ze){super(),this._timeSource=t,this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const r=Math.abs(e);return this.speed(t?-r:r)}schedule(t,e,r){if(null==t)return this._runners.map(Ve);let n=0;const i=this.getEndTime();if(e=e||0,null==r||"last"===r||"after"===r)n=i;else if("absolute"===r||"start"===r)n=e,e=0;else if("now"===r)n=this._time;else if("relative"===r){const r=this.getRunnerInfoById(t.id);r&&(n=r.start+e,e=0)}else{if("with-last"!==r)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();n=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:n+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Ye.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Ye.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let r=e-this._lastSourceTime;t&&(r=0);const n=this._speed*r+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=n,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],r=e.runner;this._time-e.start<=0&&r.reset()}let i=!1;for(let t=0,e=this._runners.length;t0?this._continue():(this.pause(),this.fire("finished")),this}}s({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Ge,this._timeline):(this._timeline=t,this)}}});class $e extends Et{constructor(t){super(),this.id=$e.id++,t="function"==typeof(t=null==t?It.duration:t)?new pe(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof pe,this._stepper=this._isDeclarative?t:new de,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new ft,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,r){let n=1,i=!1,s=0;return e=e||It.delay,r=r||"last","object"!=typeof(t=t||It.duration)||t instanceof fe||(e=t.delay||e,r=t.when||r,i=t.swing||i,n=t.times||n,s=t.wait||s,t=t.duration||It.duration),{duration:t,delay:e,swing:i,times:n,wait:s,when:r}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t,e){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,r){const n=$e.sanitise(t,e,r),i=new $e(n.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(n).schedule(n.delay,n.when)}clearTransform(){return this.transforms=new ft,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new de(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,r){return"object"==typeof t&&(e=t.swing,r=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=r||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),r=(this._time-t*e)/this._duration;return Math.min(t+r,this._times)}const r=t%1,n=e*Math.floor(t)+this._duration*r;return this.time(n)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,r=this._duration,n=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(n+r))/(n+r)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(n+r))/r+i;return Math.max(Math.min(a,1),0)},u=i*(n+r)-n;return a=e<=0?Math.round(t(1e-5)):e=0;this._lastPosition=e;const n=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime=n;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=n,this._reseted=!1;let a=!1;return(r||o)&&(this._initialise(r),this.transforms=new ft,a=this._run(o?t:e),this.fire("step",this)),this.done=this.done||a&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,r=this._queue.length;et.lmultiplyO(e),We=t=>t.transforms;function Je(){const t=this._transformationRunners.runners.map(We).reduce(He,new ft);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Qe{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Xe).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const r=this.ids.indexOf(t+1);return this.ids.splice(r,1,t+1),this.runners.splice(r,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;ee.id<=t.id)).map(We).reduce(He,new ft)},_addRunner(t){this._transformationRunners.add(t),Ye.cancelImmediate(this._frameId),this._frameId=Ye.immediate(Je.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Qe).add(new Xe(new ft(this))))}}}),V($e,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,r){if("string"==typeof e)return this.styleAttr(t,{[e]:r});let n=e;if(this._tryRetarget(t,n))return this;let i=new ke(this._stepper).to(n),s=Object.keys(n);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const r=Object.keys(e),o=(a=s,r.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),r=new Re(i.from()).valueOf();Object.assign(r,e),i.from(r)}const u=new Re(i.to()).valueOf();Object.assign(u,e),i.to(u),s=r,n=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let r=new ke(this._stepper).to(new Tt(t));return this.queue((function(){r=r.from(this.element().zoom())}),(function(t){return this.element().zoom(r.at(t),e),r.done()}),(function(t,n){e=n,r.to(t)})),this._rememberMorpher("zoom",r),this},transform(t,e,r){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const n=ft.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new ke(this._stepper).type(r?Ce:ft);let s,o,a,u,h;return this.queue((function(){o=o||this.element(),s=s||m(t,o),h=new ft(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:l,y:f}=new ct(s).transform(o._currentTransform(this));let d=new ft({...t,origin:[l,f]}),p=this._isDeclarative&&a?a:h;if(r){d=d.decompose(l,f),p=p.decompose(l,f);const t=d.rotate,e=p.rotate,r=[t-360,t,t+360],n=r.map((t=>Math.abs(t-e))),i=Math.min(...n),s=n.indexOf(i);d.rotate=r[s]}e&&(n||(d.rotate=t.rotate||0),this._isDeclarative&&u&&(p.rotate=u)),i.from(p),i.to(d);const m=i.at(c);return u=m.rotate,a=new ft(m),this.addTransform(a),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=m(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t,e){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new Tt(e),this._tryRetarget(t,e))return this;const r=new ke(this._stepper).to(e);let n=null;return this.queue((function(){n=this.element()[t](),r.from(n),r.to(n+e)}),(function(e){return this.element()[t](r.at(e)),r.done()}),(function(t){r.to(n+new Tt(t))})),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new ke(this._stepper).to(e);return this.queue((function(){r.from(this.element()[t]())}),(function(e){return this.element()[t](r.at(e)),r.done()})),this._rememberMorpher(t,r),this},_queueNumber(t,e){return this._queueObject(t,new Tt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let r;return t&&e||(r=this._element.bbox()),t||(t=r.width/r.height*e),e||(e=r.height/r.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,r,n){if(4===arguments.length)return this.plot([t,e,r,n]);if(this._tryRetarget("plot",t))return this;const i=new ke(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,r,n){return this._queueObject("viewbox",new mt(t,e,r,n))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),V($e,{rx:Ut,ry:Yt,from:Kt,to:te}),z($e,"Runner");class Ke extends zt{constructor(t,e=t){super(L("svg",t),e),this.namespace()}defs(){return this.isRoot()?F(this.node.querySelector("defs"))||this.put(new qt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof _.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:v,version:"1.1"}).attr("xmlns:xlink",w,b).attr("xmlns:svgjs",M,b):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,b).attr("xmlns:svgjs",null,b)}root(){return this.isRoot()?this:super.root()}}s({Container:{nested:Z((function(){return this.put(new Ke)}))}}),z(Ke,"Svg",!0);class tr extends zt{constructor(t,e=t){super(L("symbol",t),e)}}s({Container:{symbol:Z((function(){return this.put(new tr)}))}}),z(tr,"Symbol");var er={__proto__:null,plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(_.document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)},move:function(t,e,r=this.bbox()){return this.x(t,r).y(e,r)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},center:function(t,e,r=this.bbox()){return this.cx(t,r).cy(e,r)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},amove:function(t,e){return this.ax(t).ay(e)},build:function(t){return this._build=!!t,this}};class rr extends Nt{constructor(t,e=t){super(L("text",t),e),this.dom.leading=new Tt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new Tt(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const r=this.dom.leading;this.each((function(n){const i=_.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=r*new Tt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",n?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new Tt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let r=0;t="";for(let n=0,i=e.length;n{let i;try{i=r.bbox()}catch(t){return}const s=new ft(r),o=s.translate(t,e).transform(s.inverse()),a=new ct(i.x,i.y).transform(o);r.move(a.x,a.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)},size:function(t,e,r=this.bbox()){const n=p(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach(((t,e)=>{const n=new ct(r).transform(new ft(t).inverse());t.scale(i,s,n.x,n.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}};class ur extends zt{constructor(t,e=t){super(L("g",t),e)}}V(ur,ar),s({Container:{group:Z((function(){return this.put(new ur)}))}}),z(ur,"G");class hr extends zt{constructor(t,e=t){super(L("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,w)}}V(hr,ar),s({Container:{link:Z((function(t){return this.put(new hr).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const r=e.index(t);return e.add(this,r),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new hr,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),z(hr,"A");class cr extends zt{constructor(t,e=t){super(L("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return bt('svg [mask*="'+this.id()+'"]')}}s({Container:{mask:Z((function(){return this.defs().put(new cr)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof cr?t:this.parent().mask().add(t);return this.attr("mask",'url("#'+e.id()+'")')},unmask(){return this.attr("mask",null)}}}),z(cr,"Mask");class lr extends jt{constructor(t,e=t){super(L("stop",t),e)}update(t){return("number"==typeof t||t instanceof Tt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new Tt(t.offset)),this}}s({Gradient:{stop:function(t,e,r){return this.put(new lr).update(t,e,r)}}}),z(lr,"Stop");class fr extends jt{constructor(t,e=t){super(L("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,r={}){return this.rule("@font-face",{fontFamily:t,src:e,...r})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let r=t+"{";for(const t in e)r+=f(t)+":"+e[t]+";";return r+="}",r}(t,e))}}s("Dom",{style(t,e){return this.put(new fr).rule(t,e)},fontface(t,e,r){return this.put(new fr).font(t,e,r)}}),z(fr,"Style");class dr extends rr{constructor(t,e=t){super(L("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let r=null;return e&&(r=e.plot(t)),null==t?r:this}track(){return this.reference("href")}}s({Container:{textPath:Z((function(t,e){return t instanceof rr||(t=this.text(t)),t.path(e)}))},Text:{path:Z((function(t,e=!0){const r=new dr;let n;if(t instanceof je||(t=this.defs().path(t)),r.attr("href","#"+t,w),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)})),textPath(){return this.findOne("textPath")}},Path:{text:Z((function(t){return t instanceof rr||(t=(new rr).addTo(this.parent()).text(t)),t.path(this)})),targets(){return bt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),dr.prototype.MorphArray=Oe,z(dr,"TextPath");class pr extends Nt{constructor(t,e=t){super(L("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,w)}}s({Container:{use:Z((function(t,e){return this.put(new pr).use(t,e)}))}}),z(pr,"Use");const mr=T;V([Ke,tr,se,ie,he],o("viewbox")),V([ue,qe,ze,je],o("marker")),V(rr,o("Text")),V(je,o("Path")),V(qt,o("Defs")),V([rr,nr],o("Tspan")),V([Ne,Jt,ne,$e],o("radius")),V(Et,o("EventTarget")),V(Ft,o("Dom")),V(jt,o("Element")),V(Nt,o("Shape")),V([zt,Qt],o("Container")),V(ne,o("Gradient")),V($e,o("Runner")),vt.extend([...new Set(i)]),Le([Tt,ht,mt,ft,Rt,oe,Oe]),Fe()},725:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rgbToHsl=e.hslToRgb=e.rgbToHex=void 0,e.rgbToHex=function(t,e,r){return`#${((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}`},e.hslToRgb=function(t,e,r){let n,i,s;if(t/=360,r/=100,0==(e/=100))n=i=s=r;else{const o=(t,e,r)=>(r+=r<0?1:r>1?-1:0)<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,a=r<.5?r*(1+e):r+e-r*e,u=2*r-a;n=o(u,a,t+1/3),i=o(u,a,t),s=o(u,a,t-1/3)}return[.5+255*n<<0,.5+255*i<<0,.5+255*s<<0]},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;const n=Math.max(t,e,r),i=Math.min(t,e,r),s=(n+i)/2;let o,a;if(n===i)o=a=0;else{const u=n-i;switch(a=s>.5?u/(2-n-i):u/(n+i),n){case t:o=(e-r)/u+(e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={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",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",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",rebeccapurple:"#663399",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",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},688:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(785),e),i(r(725),e),i(r(951),e)},951:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.parseColorAndConvert=void 0;const n=r(202),i=r(725);function s(t){if("number"==typeof t)return t>16777215?{type:"rgb",a:t>>24&255,b:t>>16&255,c:t>>8&255,alpha:(255&t)/255}:{type:"rgb",a:t>>16&255,b:t>>8&255,c:255&t,alpha:1};t=t.replace(/\s/g,""),n.default[t]&&(t=n.default[t]);let e=/^#([0-9a-f]{3,8})$/i.exec(t);if(e){const t=e[1];return 3===t.length?{type:"rgb",a:parseInt(t[0]+t[0],16),b:parseInt(t[1]+t[1],16),c:parseInt(t[2]+t[2],16),alpha:1}:{type:"rgb",a:parseInt(t[0]+t[1],16),b:parseInt(t[2]+t[3],16),c:parseInt(t[4]+t[5],16),alpha:t.length>6?parseInt(t.substring(6),16)/255:1}}if(e=/^((hsl|rgb)a?)\((\d+),(\d+)%?,(\d+)%?,?(.+)?\)$/i.exec(t),e){const[,,t,r,n,i,s]=e;return{type:t,a:+r,b:+n,c:+i,alpha:s?+s:1}}}e.parseColorAndConvert=function(t){const e=s(t);if(e){if("hsl"===e.type){const[t,r,n]=i.hslToRgb(e.a,e.b,e.c);return{r:t,g:r,b:n,h:e.a,s:e.b,l:e.c,alpha:e.alpha}}{const[t,r,n]=i.rgbToHsl(e.a,e.b,e.c);return{h:t,s:r,l:n,r:e.a,g:e.b,b:e.c,alpha:e.alpha}}}},e.parseColor=s},785:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},926:t=>{var e;window,e=function(){return(()=>{var t=[function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.log=e.PI2=e.PHI=e.Vec2=e.distributePointsInBuffer=e.prepareBufferForInterpolation=e.interpolate=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.now=e.toRadians=e.toDegrees=e.relativeClamp=e.clamp=e.lerp=void 0,i(r(1),e),r(10).glMatrix.setMatrixArrayType(Array),i(r(21),e),i(r(22),e),i(r(23),e),i(r(24),e),i(r(33),e),i(r(34),e),i(r(35),e),i(r(32),e),i(r(36),e),i(r(37),e),i(r(38),e),i(r(39),e),i(r(40),e),i(r(41),e),i(r(42),e),i(r(43),e),i(r(44),e),i(r(45),e),i(r(46),e),i(r(47),e),i(r(29),e),i(r(48),e);var s=r(30);Object.defineProperty(e,"lerp",{enumerable:!0,get:function(){return s.lerp}}),Object.defineProperty(e,"clamp",{enumerable:!0,get:function(){return s.clamp}}),Object.defineProperty(e,"relativeClamp",{enumerable:!0,get:function(){return s.relativeClamp}}),Object.defineProperty(e,"toDegrees",{enumerable:!0,get:function(){return s.toDegrees}}),Object.defineProperty(e,"toRadians",{enumerable:!0,get:function(){return s.toRadians}}),Object.defineProperty(e,"now",{enumerable:!0,get:function(){return s.now}}),Object.defineProperty(e,"noise",{enumerable:!0,get:function(){return s.noise}}),Object.defineProperty(e,"random",{enumerable:!0,get:function(){return s.random}}),Object.defineProperty(e,"angleFromRepetition",{enumerable:!0,get:function(){return s.angleFromRepetition}}),Object.defineProperty(e,"angle2FromRepetition",{enumerable:!0,get:function(){return s.angle2FromRepetition}}),Object.defineProperty(e,"distanceFromRepetition",{enumerable:!0,get:function(){return s.distanceFromRepetition}}),Object.defineProperty(e,"interpolate",{enumerable:!0,get:function(){return s.interpolate}}),Object.defineProperty(e,"prepareBufferForInterpolation",{enumerable:!0,get:function(){return s.prepareBufferForInterpolation}}),Object.defineProperty(e,"distributePointsInBuffer",{enumerable:!0,get:function(){return s.distributePointsInBuffer}});var o=r(26);Object.defineProperty(e,"Vec2",{enumerable:!0,get:function(){return o.default}});var a=r(27);Object.defineProperty(e,"PHI",{enumerable:!0,get:function(){return a.PHI}}),Object.defineProperty(e,"PI2",{enumerable:!0,get:function(){return a.PI2}}),Object.defineProperty(e,"log",{enumerable:!0,get:function(){return a.log}}),Object.defineProperty(e,"mod",{enumerable:!0,get:function(){return a.mod}})},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(2),e),i(r(3),e),i(r(4),e),i(r(5),e),i(r(6),e),i(r(7),e),i(r(8),e),i(r(9),e)},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ERepetitionType=void 0,(r=e.ERepetitionType||(e.ERepetitionType={}))[r.Ring=1]="Ring",r[r.Matrix=2]="Matrix"},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.EBoundingType=void 0,(r=e.EBoundingType||(e.EBoundingType={}))[r.Relative=1]="Relative",r[r.Fixed=2]="Fixed"},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},(t,e,r)=>{"use strict";r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>s,mat3:()=>o,mat4:()=>a,quat:()=>u,quat2:()=>h,vec2:()=>c,vec3:()=>l,vec4:()=>f});var n=r(11),i=r(12),s=r(13),o=r(14),a=r(15),u=r(16),h=r(19),c=r(20),l=r(18),f=r(17)},(t,e,r)=>{"use strict";r.r(e),r.d(e,{EPSILON:()=>n,ARRAY_TYPE:()=>i,RANDOM:()=>s,setMatrixArrayType:()=>o,toRadian:()=>u,equals:()=>h});var n=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array,s=Math.random;function o(t){i=t}var a=Math.PI/180;function u(t){return t*a}function h(t,e){return Math.abs(t-e)<=n*Math.max(1,Math.abs(t),Math.abs(e))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},(t,e,r)=>{"use strict";r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,identity:()=>a,fromValues:()=>u,set:()=>h,transpose:()=>c,invert:()=>l,adjoint:()=>f,determinant:()=>d,multiply:()=>p,rotate:()=>m,scale:()=>g,fromRotation:()=>v,fromScaling:()=>y,str:()=>b,frob:()=>w,LDU:()=>M,add:()=>x,subtract:()=>_,exactEquals:()=>S,equals:()=>P,multiplyScalar:()=>A,multiplyScalarAndAdd:()=>O,mul:()=>E,sub:()=>k});var n=r(11);function i(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function s(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function a(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function u(t,e,r,i){var s=new n.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=r,s[3]=i,s}function h(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function c(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function l(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*s-i*n;return o?(o=1/o,t[0]=s*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}function f(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function d(t){return t[0]*t[3]-t[2]*t[1]}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*a+s*u,t[1]=i*a+o*u,t[2]=n*h+s*c,t[3]=i*h+o*c,t}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u+s*a,t[1]=i*u+o*a,t[2]=n*-a+s*u,t[3]=i*-a+o*u,t}function g(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1];return t[0]=n*a,t[1]=i*a,t[2]=s*u,t[3]=o*u,t}function v(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function y(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function b(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function w(t){return Math.hypot(t[0],t[1],t[2],t[3])}function M(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function x(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function _(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function S(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function P(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=e[0],u=e[1],h=e[2],c=e[3];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-u)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(s-h)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(h))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}function A(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function O(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}var E=p,k=_},(t,e,r)=>{"use strict";r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,identity:()=>a,fromValues:()=>u,set:()=>h,invert:()=>c,determinant:()=>l,multiply:()=>f,rotate:()=>d,scale:()=>p,translate:()=>m,fromRotation:()=>g,fromScaling:()=>v,fromTranslation:()=>y,str:()=>b,frob:()=>w,add:()=>M,subtract:()=>x,multiplyScalar:()=>_,multiplyScalarAndAdd:()=>S,exactEquals:()=>P,equals:()=>A,mul:()=>O,sub:()=>E});var n=r(11);function i(){var t=new n.ARRAY_TYPE(6);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function s(t){var e=new n.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function a(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function u(t,e,r,i,s,o){var a=new n.ARRAY_TYPE(6);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a[4]=s,a[5]=o,a}function h(t,e,r,n,i,s,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t}function c(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=r*s-n*i;return u?(u=1/u,t[0]=s*u,t[1]=-n*u,t[2]=-i*u,t[3]=r*u,t[4]=(i*a-s*o)*u,t[5]=(n*o-r*a)*u,t):null}function l(t){return t[0]*t[3]-t[1]*t[2]}function f(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=r[0],c=r[1],l=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*h+s*c,t[1]=i*h+o*c,t[2]=n*l+s*f,t[3]=i*l+o*f,t[4]=n*d+s*p+a,t[5]=i*d+o*p+u,t}function d(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*h,t[1]=i*c+o*h,t[2]=n*-h+s*c,t[3]=i*-h+o*c,t[4]=a,t[5]=u,t}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=r[0],c=r[1];return t[0]=n*h,t[1]=i*h,t[2]=s*c,t[3]=o*c,t[4]=a,t[5]=u,t}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=n*h+s*c+a,t[5]=i*h+o*c+u,t}function g(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function v(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function y(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function b(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function w(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function M(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function x(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function _(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function S(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function P(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function A(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],u=t[5],h=e[0],c=e[1],l=e[2],f=e[3],d=e[4],p=e[5];return Math.abs(r-h)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-c)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(s-l)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(o-f)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-d)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(u-p)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(p))}var O=f,E=x},(t,e,r)=>{"use strict";r.r(e),r.d(e,{create:()=>i,fromMat4:()=>s,clone:()=>o,copy:()=>a,fromValues:()=>u,set:()=>h,identity:()=>c,transpose:()=>l,invert:()=>f,adjoint:()=>d,determinant:()=>p,multiply:()=>m,translate:()=>g,rotate:()=>v,scale:()=>y,fromTranslation:()=>b,fromRotation:()=>w,fromScaling:()=>M,fromMat2d:()=>x,fromQuat:()=>_,normalFromMat4:()=>S,projection:()=>P,str:()=>A,frob:()=>O,add:()=>E,subtract:()=>k,multiplyScalar:()=>I,multiplyScalarAndAdd:()=>C,exactEquals:()=>B,equals:()=>R,mul:()=>T,sub:()=>L});var n=r(11);function i(){var t=new n.ARRAY_TYPE(9);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function o(t){var e=new n.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function u(t,e,r,i,s,o,a,u,h){var c=new n.ARRAY_TYPE(9);return c[0]=t,c[1]=e,c[2]=r,c[3]=i,c[4]=s,c[5]=o,c[6]=a,c[7]=u,c[8]=h,c}function h(t,e,r,n,i,s,o,a,u,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=u,t[8]=h,t}function c(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function l(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function f(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=c*o-a*h,f=-c*s+a*u,d=h*s-o*u,p=r*l+n*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-c*n+i*h)*p,t[2]=(a*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*u)*p,t[5]=(-a*r+i*s)*p,t[6]=d*p,t[7]=(-h*r+n*u)*p,t[8]=(o*r-n*s)*p,t):null}function d(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8];return t[0]=o*c-a*h,t[1]=i*h-n*c,t[2]=n*a-i*o,t[3]=a*u-s*c,t[4]=r*c-i*u,t[5]=i*s-r*a,t[6]=s*h-o*u,t[7]=n*u-r*h,t[8]=r*o-n*s,t}function p(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],u=t[7],h=t[8];return e*(h*s-o*u)+r*(-h*i+o*a)+n*(u*i-s*a)}function m(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=r[0],d=r[1],p=r[2],m=r[3],g=r[4],v=r[5],y=r[6],b=r[7],w=r[8];return t[0]=f*n+d*o+p*h,t[1]=f*i+d*a+p*c,t[2]=f*s+d*u+p*l,t[3]=m*n+g*o+v*h,t[4]=m*i+g*a+v*c,t[5]=m*s+g*u+v*l,t[6]=y*n+b*o+w*h,t[7]=y*i+b*a+w*c,t[8]=y*s+b*u+w*l,t}function g(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=u,t[6]=f*n+d*o+h,t[7]=f*i+d*a+c,t[8]=f*s+d*u+l,t}function v(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*a,t[2]=d*s+f*u,t[3]=d*o-f*n,t[4]=d*a-f*i,t[5]=d*u-f*s,t[6]=h,t[7]=c,t[8]=l,t}function y(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function b(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function w(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function M(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function x(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function _(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,u=i+i,h=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*u,m=s*o,g=s*a,v=s*u;return t[0]=1-l-p,t[3]=c-v,t[6]=f+g,t[1]=c+v,t[4]=1-h-p,t[7]=d-m,t[2]=f-g,t[5]=d+m,t[8]=1-h-l,t}function S(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*u-i*o,w=r*h-s*o,M=n*u-i*a,x=n*h-s*a,_=i*h-s*u,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,O=l*g-f*m,E=l*v-d*m,k=f*v-d*g,I=y*k-b*E+w*O+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-u*E+h*O)*I,t[1]=(u*A-o*k-h*P)*I,t[2]=(o*E-a*A+h*S)*I,t[3]=(i*E-n*k-s*O)*I,t[4]=(r*k-i*A+s*P)*I,t[5]=(n*A-r*E-s*S)*I,t[6]=(m*_-g*x+v*M)*I,t[7]=(g*w-p*_-v*b)*I,t[8]=(p*x-m*w+v*y)*I,t):null}function P(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function A(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function O(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function E(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function k(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function I(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function C(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function B(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function R(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],u=t[5],h=t[6],c=t[7],l=t[8],f=e[0],d=e[1],p=e[2],m=e[3],g=e[4],v=e[5],y=e[6],b=e[7],w=e[8];return Math.abs(r-f)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(i-d)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(s-p)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(o-m)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(a-g)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(u-v)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(h-y)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(y))&&Math.abs(c-b)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(l-w)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(w))}var T=m,L=k},(t,e,r)=>{"use strict";r.r(e),r.d(e,{create:()=>i,clone:()=>s,copy:()=>o,fromValues:()=>a,set:()=>u,identity:()=>h,transpose:()=>c,invert:()=>l,adjoint:()=>f,determinant:()=>d,multiply:()=>p,translate:()=>m,scale:()=>g,rotate:()=>v,rotateX:()=>y,rotateY:()=>b,rotateZ:()=>w,fromTranslation:()=>M,fromScaling:()=>x,fromRotation:()=>_,fromXRotation:()=>S,fromYRotation:()=>P,fromZRotation:()=>A,fromRotationTranslation:()=>O,fromQuat2:()=>E,getTranslation:()=>k,getScaling:()=>I,getRotation:()=>C,fromRotationTranslationScale:()=>B,fromRotationTranslationScaleOrigin:()=>R,fromQuat:()=>T,frustum:()=>L,perspective:()=>F,perspectiveFromFieldOfView:()=>j,ortho:()=>D,lookAt:()=>z,targetTo:()=>q,str:()=>N,frob:()=>U,add:()=>Y,subtract:()=>V,multiplyScalar:()=>Z,multiplyScalarAndAdd:()=>G,exactEquals:()=>$,equals:()=>X,mul:()=>H,sub:()=>W});var n=r(11);function i(){var t=new n.ARRAY_TYPE(16);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function s(t){var e=new n.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function a(t,e,r,i,s,o,a,u,h,c,l,f,d,p,m,g){var v=new n.ARRAY_TYPE(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=i,v[4]=s,v[5]=o,v[6]=a,v[7]=u,v[8]=h,v[9]=c,v[10]=l,v[11]=f,v[12]=d,v[13]=p,v[14]=m,v[15]=g,v}function u(t,e,r,n,i,s,o,a,u,h,c,l,f,d,p,m,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=u,t[8]=h,t[9]=c,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=g,t}function h(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function c(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=i,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function l(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*u-i*o,w=r*h-s*o,M=n*u-i*a,x=n*h-s*a,_=i*h-s*u,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,O=l*g-f*m,E=l*v-d*m,k=f*v-d*g,I=y*k-b*E+w*O+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-u*E+h*O)*I,t[1]=(i*E-n*k-s*O)*I,t[2]=(m*_-g*x+v*M)*I,t[3]=(f*x-l*_-d*M)*I,t[4]=(u*A-o*k-h*P)*I,t[5]=(r*k-i*A+s*P)*I,t[6]=(g*w-p*_-v*b)*I,t[7]=(c*_-f*w+d*b)*I,t[8]=(o*E-a*A+h*S)*I,t[9]=(n*A-r*E-s*S)*I,t[10]=(p*x-m*w+v*y)*I,t[11]=(l*w-c*x-d*y)*I,t[12]=(a*P-o*O-u*S)*I,t[13]=(r*O-n*P+i*S)*I,t[14]=(m*b-p*M-g*y)*I,t[15]=(c*M-l*b+f*y)*I,t):null}function f(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15];return t[0]=a*(f*v-d*g)-l*(u*v-h*g)+m*(u*d-h*f),t[1]=-(n*(f*v-d*g)-l*(i*v-s*g)+m*(i*d-s*f)),t[2]=n*(u*v-h*g)-a*(i*v-s*g)+m*(i*h-s*u),t[3]=-(n*(u*d-h*f)-a*(i*d-s*f)+l*(i*h-s*u)),t[4]=-(o*(f*v-d*g)-c*(u*v-h*g)+p*(u*d-h*f)),t[5]=r*(f*v-d*g)-c*(i*v-s*g)+p*(i*d-s*f),t[6]=-(r*(u*v-h*g)-o*(i*v-s*g)+p*(i*h-s*u)),t[7]=r*(u*d-h*f)-o*(i*d-s*f)+c*(i*h-s*u),t[8]=o*(l*v-d*m)-c*(a*v-h*m)+p*(a*d-h*l),t[9]=-(r*(l*v-d*m)-c*(n*v-s*m)+p*(n*d-s*l)),t[10]=r*(a*v-h*m)-o*(n*v-s*m)+p*(n*h-s*a),t[11]=-(r*(a*d-h*l)-o*(n*d-s*l)+c*(n*h-s*a)),t[12]=-(o*(l*g-f*m)-c*(a*g-u*m)+p*(a*f-u*l)),t[13]=r*(l*g-f*m)-c*(n*g-i*m)+p*(n*f-i*l),t[14]=-(r*(a*g-u*m)-o*(n*g-i*m)+p*(n*u-i*a)),t[15]=r*(a*f-u*l)-o*(n*f-i*l)+c*(n*u-i*a),t}function d(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],u=t[7],h=t[8],c=t[9],l=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*s)*(l*g-f*m)-(e*a-n*s)*(c*g-f*p)+(e*u-i*s)*(c*m-l*p)+(r*a-n*o)*(h*g-f*d)-(r*u-i*o)*(h*m-l*d)+(n*u-i*a)*(h*p-c*d)}function p(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],v=e[14],y=e[15],b=r[0],w=r[1],M=r[2],x=r[3];return t[0]=b*n+w*a+M*l+x*m,t[1]=b*i+w*u+M*f+x*g,t[2]=b*s+w*h+M*d+x*v,t[3]=b*o+w*c+M*p+x*y,b=r[4],w=r[5],M=r[6],x=r[7],t[4]=b*n+w*a+M*l+x*m,t[5]=b*i+w*u+M*f+x*g,t[6]=b*s+w*h+M*d+x*v,t[7]=b*o+w*c+M*p+x*y,b=r[8],w=r[9],M=r[10],x=r[11],t[8]=b*n+w*a+M*l+x*m,t[9]=b*i+w*u+M*f+x*g,t[10]=b*s+w*h+M*d+x*v,t[11]=b*o+w*c+M*p+x*y,b=r[12],w=r[13],M=r[14],x=r[15],t[12]=b*n+w*a+M*l+x*m,t[13]=b*i+w*u+M*f+x*g,t[14]=b*s+w*h+M*d+x*v,t[15]=b*o+w*c+M*p+x*y,t}function m(t,e,r){var n,i,s,o,a,u,h,c,l,f,d,p,m=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=u,t[6]=h,t[7]=c,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+a*g+l*v+e[12],t[13]=i*m+u*g+f*v+e[13],t[14]=s*m+h*g+d*v+e[14],t[15]=o*m+c*g+p*v+e[15]),t}function g(t,e,r){var n=r[0],i=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function v(t,e,r,i){var s,o,a,u,h,c,l,f,d,p,m,g,v,y,b,w,M,x,_,S,P,A,O,E,k=i[0],I=i[1],C=i[2],B=Math.hypot(k,I,C);return B0?(r[0]=2*(u*a+l*i+h*o-c*s)/f,r[1]=2*(h*a+l*s+c*i-u*o)/f,r[2]=2*(c*a+l*o+u*s-h*i)/f):(r[0]=2*(u*a+l*i+h*o-c*s),r[1]=2*(h*a+l*s+c*i-u*o),r[2]=2*(c*a+l*o+u*s-h*i)),O(t,e,r),t}function k(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function I(t,e){var r=e[0],n=e[1],i=e[2],s=e[4],o=e[5],a=e[6],u=e[8],h=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(s,o,a),t[2]=Math.hypot(u,h,c),t}function C(t,e){var r=new n.ARRAY_TYPE(3);I(r,e);var i=1/r[0],s=1/r[1],o=1/r[2],a=e[0]*i,u=e[1]*s,h=e[2]*o,c=e[4]*i,l=e[5]*s,f=e[6]*o,d=e[8]*i,p=e[9]*s,m=e[10]*o,g=a+l+m,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(f-p)/v,t[1]=(d-h)/v,t[2]=(u-c)/v):a>l&&a>m?(v=2*Math.sqrt(1+a-l-m),t[3]=(f-p)/v,t[0]=.25*v,t[1]=(u+c)/v,t[2]=(d+h)/v):l>m?(v=2*Math.sqrt(1+l-a-m),t[3]=(d-h)/v,t[0]=(u+c)/v,t[1]=.25*v,t[2]=(f+p)/v):(v=2*Math.sqrt(1+m-a-l),t[3]=(u-c)/v,t[0]=(d+h)/v,t[1]=(f+p)/v,t[2]=.25*v),t}function B(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3],u=i+i,h=s+s,c=o+o,l=i*u,f=i*h,d=i*c,p=s*h,m=s*c,g=o*c,v=a*u,y=a*h,b=a*c,w=n[0],M=n[1],x=n[2];return t[0]=(1-(p+g))*w,t[1]=(f+b)*w,t[2]=(d-y)*w,t[3]=0,t[4]=(f-b)*M,t[5]=(1-(l+g))*M,t[6]=(m+v)*M,t[7]=0,t[8]=(d+y)*x,t[9]=(m-v)*x,t[10]=(1-(l+p))*x,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function R(t,e,r,n,i){var s=e[0],o=e[1],a=e[2],u=e[3],h=s+s,c=o+o,l=a+a,f=s*h,d=s*c,p=s*l,m=o*c,g=o*l,v=a*l,y=u*h,b=u*c,w=u*l,M=n[0],x=n[1],_=n[2],S=i[0],P=i[1],A=i[2],O=(1-(m+v))*M,E=(d+w)*M,k=(p-b)*M,I=(d-w)*x,C=(1-(f+v))*x,B=(g+y)*x,R=(p+b)*_,T=(g-y)*_,L=(1-(f+m))*_;return t[0]=O,t[1]=E,t[2]=k,t[3]=0,t[4]=I,t[5]=C,t[6]=B,t[7]=0,t[8]=R,t[9]=T,t[10]=L,t[11]=0,t[12]=r[0]+S-(O*S+I*P+R*A),t[13]=r[1]+P-(E*S+C*P+T*A),t[14]=r[2]+A-(k*S+B*P+L*A),t[15]=1,t}function T(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,u=i+i,h=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*u,m=s*o,g=s*a,v=s*u;return t[0]=1-l-p,t[1]=c+v,t[2]=f-g,t[3]=0,t[4]=c-v,t[5]=1-h-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-h-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function L(t,e,r,n,i,s,o){var a=1/(r-e),u=1/(i-n),h=1/(s-o);return t[0]=2*s*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*u,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*u,t[10]=(o+s)*h,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*h,t[15]=0,t}function F(t,e,r,n,i){var s,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(s=1/(n-i),t[10]=(i+n)*s,t[14]=2*i*n*s):(t[10]=-1,t[14]=-2*n),t}function j(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),u=2/(o+a),h=2/(i+s);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=h,t[6]=0,t[7]=0,t[8]=-(o-a)*u*.5,t[9]=(i-s)*h*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function D(t,e,r,n,i,s,o){var a=1/(e-r),u=1/(n-i),h=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*u,t[14]=(o+s)*h,t[15]=1,t}function z(t,e,r,i){var s,o,a,u,c,l,f,d,p,m,g=e[0],v=e[1],y=e[2],b=i[0],w=i[1],M=i[2],x=r[0],_=r[1],S=r[2];return Math.abs(g-x)0&&(c*=d=1/Math.sqrt(d),l*=d,f*=d);var p=u*f-h*l,m=h*c-a*f,g=a*l-u*c;return(d=p*p+m*m+g*g)>0&&(p*=d=1/Math.sqrt(d),m*=d,g*=d),t[0]=p,t[1]=m,t[2]=g,t[3]=0,t[4]=l*g-f*m,t[5]=f*p-c*g,t[6]=c*m-l*p,t[7]=0,t[8]=c,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=s,t[14]=o,t[15]=1,t}function N(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function U(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Y(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function V(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function Z(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function G(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function $(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function X(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],u=t[5],h=t[6],c=t[7],l=t[8],f=t[9],d=t[10],p=t[11],m=t[12],g=t[13],v=t[14],y=t[15],b=e[0],w=e[1],M=e[2],x=e[3],_=e[4],S=e[5],P=e[6],A=e[7],O=e[8],E=e[9],k=e[10],I=e[11],C=e[12],B=e[13],R=e[14],T=e[15];return Math.abs(r-b)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-w)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(w))&&Math.abs(s-M)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(o-x)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(a-_)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(u-S)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(h-P)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(c-A)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(l-O)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(f-E)<=n.EPSILON*Math.max(1,Math.abs(f),Math.abs(E))&&Math.abs(d-k)<=n.EPSILON*Math.max(1,Math.abs(d),Math.abs(k))&&Math.abs(p-I)<=n.EPSILON*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(m-C)<=n.EPSILON*Math.max(1,Math.abs(m),Math.abs(C))&&Math.abs(g-B)<=n.EPSILON*Math.max(1,Math.abs(g),Math.abs(B))&&Math.abs(v-R)<=n.EPSILON*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(y-T)<=n.EPSILON*Math.max(1,Math.abs(y),Math.abs(T))}var H=p,W=V},(t,e,r)=>{"use strict";r.r(e),r.d(e,{create:()=>a,identity:()=>u,setAxisAngle:()=>h,getAxisAngle:()=>c,getAngle:()=>l,multiply:()=>f,rotateX:()=>d,rotateY:()=>p,rotateZ:()=>m,calculateW:()=>g,exp:()=>v,ln:()=>y,pow:()=>b,slerp:()=>w,random:()=>M,invert:()=>x,conjugate:()=>_,fromMat3:()=>S,fromEuler:()=>P,str:()=>A,clone:()=>R,fromValues:()=>T,copy:()=>L,set:()=>F,add:()=>j,mul:()=>D,scale:()=>z,dot:()=>q,lerp:()=>N,length:()=>U,len:()=>Y,squaredLength:()=>V,sqrLen:()=>Z,normalize:()=>G,exactEquals:()=>$,equals:()=>X,rotationTo:()=>H,sqlerp:()=>W,setAxes:()=>J});var n=r(11),i=r(14),s=r(18),o=r(17);function a(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function u(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function h(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function c(t,e){var r=2*Math.acos(e[3]),i=Math.sin(r/2);return i>n.EPSILON?(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i):(t[0]=1,t[1]=0,t[2]=0),r}function l(t,e){var r=q(t,e);return Math.acos(2*r*r-1)}function f(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*c+o*a+i*h-s*u,t[1]=i*c+o*u+s*a-n*h,t[2]=s*c+o*h+n*u-i*a,t[3]=o*c-n*a-i*u-s*h,t}function d(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u+o*a,t[1]=i*u+s*a,t[2]=s*u-i*a,t[3]=o*u-n*a,t}function p(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u-s*a,t[1]=i*u+o*a,t[2]=s*u+n*a,t[3]=o*u-i*a,t}function m(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u+i*a,t[1]=i*u-n*a,t[2]=s*u+o*a,t[3]=o*u-s*a,t}function g(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function v(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=Math.exp(s),u=o>0?a*Math.sin(o)/o:0;return t[0]=r*u,t[1]=n*u,t[2]=i*u,t[3]=a*Math.cos(o),t}function y(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=o>0?Math.atan2(o,s)/o:0;return t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=.5*Math.log(r*r+n*n+i*i+s*s),t}function b(t,e,r){return y(t,e),z(t,t,r),v(t,t),t}function w(t,e,r,i){var s,o,a,u,h,c=e[0],l=e[1],f=e[2],d=e[3],p=r[0],m=r[1],g=r[2],v=r[3];return(o=c*p+l*m+f*g+d*v)<0&&(o=-o,p=-p,m=-m,g=-g,v=-v),1-o>n.EPSILON?(s=Math.acos(o),a=Math.sin(s),u=Math.sin((1-i)*s)/a,h=Math.sin(i*s)/a):(u=1-i,h=i),t[0]=u*c+h*p,t[1]=u*l+h*m,t[2]=u*f+h*g,t[3]=u*d+h*v,t}function M(t){var e=n.RANDOM(),r=n.RANDOM(),i=n.RANDOM(),s=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=s*Math.sin(2*Math.PI*r),t[1]=s*Math.cos(2*Math.PI*r),t[2]=o*Math.sin(2*Math.PI*i),t[3]=o*Math.cos(2*Math.PI*i),t}function x(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s,a=o?1/o:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=s*a,t}function _(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function S(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var s=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*s+s]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*s+o]-e[3*o+s])*r,t[s]=(e[3*s+i]+e[3*i+s])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t}function P(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var s=Math.sin(e),o=Math.cos(e),a=Math.sin(r),u=Math.cos(r),h=Math.sin(n),c=Math.cos(n);return t[0]=s*u*c-o*a*h,t[1]=o*a*c+s*u*h,t[2]=o*u*h-s*a*c,t[3]=o*u*c+s*a*h,t}function A(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var O,E,k,I,C,B,R=o.clone,T=o.fromValues,L=o.copy,F=o.set,j=o.add,D=f,z=o.scale,q=o.dot,N=o.lerp,U=o.length,Y=U,V=o.squaredLength,Z=V,G=o.normalize,$=o.exactEquals,X=o.equals,H=(O=s.create(),E=s.fromValues(1,0,0),k=s.fromValues(0,1,0),function(t,e,r){var n=s.dot(e,r);return n<-.999999?(s.cross(O,E,e),s.len(O)<1e-6&&s.cross(O,k,e),s.normalize(O,O),h(t,O,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(s.cross(O,e,r),t[0]=O[0],t[1]=O[1],t[2]=O[2],t[3]=1+n,G(t,t))}),W=(I=a(),C=a(),function(t,e,r,n,i,s){return w(I,e,i,s),w(C,r,n,s),w(t,I,C,2*s*(1-s)),t}),J=(B=i.create(),function(t,e,r,n){return B[0]=r[0],B[3]=r[1],B[6]=r[2],B[1]=n[0],B[4]=n[1],B[7]=n[2],B[2]=-e[0],B[5]=-e[1],B[8]=-e[2],G(t,S(t,B))})},(t,e,r)=>{"use strict";r.r(e),r.d(e,{create:()=>i,clone:()=>s,fromValues:()=>o,copy:()=>a,set:()=>u,add:()=>h,subtract:()=>c,multiply:()=>l,divide:()=>f,ceil:()=>d,floor:()=>p,min:()=>m,max:()=>g,round:()=>v,scale:()=>y,scaleAndAdd:()=>b,distance:()=>w,squaredDistance:()=>M,length:()=>x,squaredLength:()=>_,negate:()=>S,inverse:()=>P,normalize:()=>A,dot:()=>O,cross:()=>E,lerp:()=>k,random:()=>I,transformMat4:()=>C,transformQuat:()=>B,zero:()=>R,str:()=>T,exactEquals:()=>L,equals:()=>F,sub:()=>D,mul:()=>z,div:()=>q,dist:()=>N,sqrDist:()=>U,len:()=>Y,sqrLen:()=>V,forEach:()=>Z});var n=r(11);function i(){var t=new n.ARRAY_TYPE(4);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function s(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(t,e,r,i){var s=new n.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=r,s[3]=i,s}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function u(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function h(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function l(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}function f(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function m(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}function g(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}function v(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function y(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function b(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}function w(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return Math.hypot(r,n,i,s)}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return r*r+n*n+i*i+s*s}function x(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}function _(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function P(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function A(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s;return o>0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=s*o,t}function O(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function E(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],s=r[0]*n[2]-r[2]*n[0],o=r[0]*n[3]-r[3]*n[0],a=r[1]*n[2]-r[2]*n[1],u=r[1]*n[3]-r[3]*n[1],h=r[2]*n[3]-r[3]*n[2],c=e[0],l=e[1],f=e[2],d=e[3];return t[0]=l*h-f*u+d*a,t[1]=-c*h+f*o-d*s,t[2]=c*u-l*o+d*i,t[3]=-c*a+l*s-f*i,t}function k(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t[3]=a+n*(r[3]-a),t}function I(t,e){var r,i,s,o,a,u;e=e||1;do{a=(r=2*n.RANDOM()-1)*r+(i=2*n.RANDOM()-1)*i}while(a>=1);do{u=(s=2*n.RANDOM()-1)*s+(o=2*n.RANDOM()-1)*o}while(u>=1);var h=Math.sqrt((1-a)/u);return t[0]=e*r,t[1]=e*i,t[2]=e*s*h,t[3]=e*o*h,t}function C(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*s+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*s+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*s+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*s+r[15]*o,t}function B(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],u=r[2],h=r[3],c=h*n+a*s-u*i,l=h*i+u*n-o*s,f=h*s+o*i-a*n,d=-o*n-a*i-u*s;return t[0]=c*h+d*-o+l*-u-f*-a,t[1]=l*h+d*-a+f*-o-c*-u,t[2]=f*h+d*-u+c*-a-l*-o,t[3]=e[3],t}function R(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function T(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function L(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function F(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=e[0],u=e[1],h=e[2],c=e[3];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-u)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(s-h)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(h))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}var j,D=c,z=l,q=f,N=w,U=M,Y=x,V=_,Z=(j=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=4),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{"use strict";r.r(e),r.d(e,{create:()=>i,clone:()=>s,length:()=>o,fromValues:()=>a,copy:()=>u,set:()=>h,add:()=>c,subtract:()=>l,multiply:()=>f,divide:()=>d,ceil:()=>p,floor:()=>m,min:()=>g,max:()=>v,round:()=>y,scale:()=>b,scaleAndAdd:()=>w,distance:()=>M,squaredDistance:()=>x,squaredLength:()=>_,negate:()=>S,inverse:()=>P,normalize:()=>A,dot:()=>O,cross:()=>E,lerp:()=>k,hermite:()=>I,bezier:()=>C,random:()=>B,transformMat4:()=>R,transformMat3:()=>T,transformQuat:()=>L,rotateX:()=>F,rotateY:()=>j,rotateZ:()=>D,angle:()=>z,zero:()=>q,str:()=>N,exactEquals:()=>U,equals:()=>Y,sub:()=>Z,mul:()=>G,div:()=>$,dist:()=>X,sqrDist:()=>H,len:()=>W,sqrLen:()=>J,forEach:()=>Q});var n=r(11);function i(){var t=new n.ARRAY_TYPE(3);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function s(t){var e=new n.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function o(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function a(t,e,r){var i=new n.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=r,i}function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function h(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function c(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function l(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function f(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function d(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function p(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function m(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function g(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function v(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function y(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function b(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function w(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function x(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function _(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function P(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function A(t,e){var r=e[0],n=e[1],i=e[2],s=r*r+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function O(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function E(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],u=r[2];return t[0]=i*u-s*a,t[1]=s*o-n*u,t[2]=n*a-i*o,t}function k(t,e,r,n){var i=e[0],s=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t}function I(t,e,r,n,i,s){var o=s*s,a=o*(2*s-3)+1,u=o*(s-2)+s,h=o*(s-1),c=o*(3-2*s);return t[0]=e[0]*a+r[0]*u+n[0]*h+i[0]*c,t[1]=e[1]*a+r[1]*u+n[1]*h+i[1]*c,t[2]=e[2]*a+r[2]*u+n[2]*h+i[2]*c,t}function C(t,e,r,n,i,s){var o=1-s,a=o*o,u=s*s,h=a*o,c=3*s*a,l=3*u*o,f=u*s;return t[0]=e[0]*h+r[0]*c+n[0]*l+i[0]*f,t[1]=e[1]*h+r[1]*c+n[1]*l+i[1]*f,t[2]=e[2]*h+r[2]*c+n[2]*l+i[2]*f,t}function B(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,s=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*s,t[1]=Math.sin(r)*s,t[2]=i*e,t}function R(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[3]*n+r[7]*i+r[11]*s+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*s+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*s+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*s+r[14])/o,t}function T(t,e,r){var n=e[0],i=e[1],s=e[2];return t[0]=n*r[0]+i*r[3]+s*r[6],t[1]=n*r[1]+i*r[4]+s*r[7],t[2]=n*r[2]+i*r[5]+s*r[8],t}function L(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],u=e[1],h=e[2],c=i*h-s*u,l=s*a-n*h,f=n*u-i*a,d=i*f-s*l,p=s*c-n*f,m=n*l-i*c,g=2*o;return c*=g,l*=g,f*=g,d*=2,p*=2,m*=2,t[0]=a+c+d,t[1]=u+l+p,t[2]=h+f+m,t}function F(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0],s[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),s[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function j(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),s[1]=i[1],s[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function D(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),s[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),s[2]=i[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function z(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2],u=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(s*s+o*o+a*a),h=u&&O(t,e)/u;return Math.acos(Math.min(Math.max(h,-1),1))}function q(t){return t[0]=0,t[1]=0,t[2]=0,t}function N(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function U(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Y(t,e){var r=t[0],i=t[1],s=t[2],o=e[0],a=e[1],u=e[2];return Math.abs(r-o)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-a)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(s-u)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))}var V,Z=l,G=f,$=d,X=M,H=x,W=o,J=_,Q=(V=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=3),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{"use strict";r.r(e),r.d(e,{create:()=>o,clone:()=>a,fromValues:()=>u,fromRotationTranslationValues:()=>h,fromRotationTranslation:()=>c,fromTranslation:()=>l,fromRotation:()=>f,fromMat4:()=>d,copy:()=>p,identity:()=>m,set:()=>g,getReal:()=>v,getDual:()=>y,setReal:()=>b,setDual:()=>w,getTranslation:()=>M,translate:()=>x,rotateX:()=>_,rotateY:()=>S,rotateZ:()=>P,rotateByQuatAppend:()=>A,rotateByQuatPrepend:()=>O,rotateAroundAxis:()=>E,add:()=>k,multiply:()=>I,mul:()=>C,scale:()=>B,dot:()=>R,lerp:()=>T,invert:()=>L,conjugate:()=>F,length:()=>j,len:()=>D,squaredLength:()=>z,sqrLen:()=>q,normalize:()=>N,str:()=>U,exactEquals:()=>Y,equals:()=>V});var n=r(11),i=r(16),s=r(15);function o(){var t=new n.ARRAY_TYPE(8);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function a(t){var e=new n.ARRAY_TYPE(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function u(t,e,r,i,s,o,a,u){var h=new n.ARRAY_TYPE(8);return h[0]=t,h[1]=e,h[2]=r,h[3]=i,h[4]=s,h[5]=o,h[6]=a,h[7]=u,h}function h(t,e,r,i,s,o,a){var u=new n.ARRAY_TYPE(8);u[0]=t,u[1]=e,u[2]=r,u[3]=i;var h=.5*s,c=.5*o,l=.5*a;return u[4]=h*i+c*r-l*e,u[5]=c*i+l*t-h*r,u[6]=l*i+h*e-c*t,u[7]=-h*t-c*e-l*r,u}function c(t,e,r){var n=.5*r[0],i=.5*r[1],s=.5*r[2],o=e[0],a=e[1],u=e[2],h=e[3];return t[0]=o,t[1]=a,t[2]=u,t[3]=h,t[4]=n*h+i*u-s*a,t[5]=i*h+s*o-n*u,t[6]=s*h+n*a-i*o,t[7]=-n*o-i*a-s*u,t}function l(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function d(t,e){var r=i.create();s.getRotation(r,e);var o=new n.ARRAY_TYPE(3);return s.getTranslation(o,e),c(t,r,o),t}function p(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function m(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function g(t,e,r,n,i,s,o,a,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=u,t}var v=i.copy;function y(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var b=i.copy;function w(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function M(t,e){var r=e[4],n=e[5],i=e[6],s=e[7],o=-e[0],a=-e[1],u=-e[2],h=e[3];return t[0]=2*(r*h+s*o+n*u-i*a),t[1]=2*(n*h+s*a+i*o-r*u),t[2]=2*(i*h+s*u+r*a-n*o),t}function x(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=.5*r[0],u=.5*r[1],h=.5*r[2],c=e[4],l=e[5],f=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=o*a+i*h-s*u+c,t[5]=o*u+s*a-n*h+l,t[6]=o*h+n*u-i*a+f,t[7]=-n*a-i*u-s*h+d,t}function _(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],u=e[4],h=e[5],c=e[6],l=e[7],f=u*a+l*n+h*o-c*s,d=h*a+l*s+c*n-u*o,p=c*a+l*o+u*s-h*n,m=l*a-u*n-h*s-c*o;return i.rotateX(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function S(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],u=e[4],h=e[5],c=e[6],l=e[7],f=u*a+l*n+h*o-c*s,d=h*a+l*s+c*n-u*o,p=c*a+l*o+u*s-h*n,m=l*a-u*n-h*s-c*o;return i.rotateY(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function P(t,e,r){var n=-e[0],s=-e[1],o=-e[2],a=e[3],u=e[4],h=e[5],c=e[6],l=e[7],f=u*a+l*n+h*o-c*s,d=h*a+l*s+c*n-u*o,p=c*a+l*o+u*s-h*n,m=l*a-u*n-h*s-c*o;return i.rotateZ(t,e,r),n=t[0],s=t[1],o=t[2],a=t[3],t[4]=f*a+m*n+d*o-p*s,t[5]=d*a+m*s+p*n-f*o,t[6]=p*a+m*o+f*s-d*n,t[7]=m*a-f*n-d*s-p*o,t}function A(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],u=e[1],h=e[2],c=e[3];return t[0]=a*o+c*n+u*s-h*i,t[1]=u*o+c*i+h*n-a*s,t[2]=h*o+c*s+a*i-u*n,t[3]=c*o-a*n-u*i-h*s,a=e[4],u=e[5],h=e[6],c=e[7],t[4]=a*o+c*n+u*s-h*i,t[5]=u*o+c*i+h*n-a*s,t[6]=h*o+c*s+a*i-u*n,t[7]=c*o-a*n-u*i-h*s,t}function O(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*c+o*a+i*h-s*u,t[1]=i*c+o*u+s*a-n*h,t[2]=s*c+o*h+n*u-i*a,t[3]=o*c-n*a-i*u-s*h,a=r[4],u=r[5],h=r[6],c=r[7],t[4]=n*c+o*a+i*h-s*u,t[5]=i*c+o*u+s*a-n*h,t[6]=s*c+o*h+n*u-i*a,t[7]=o*c-n*a-i*u-s*h,t}function E(t,e,r,i){if(Math.abs(i)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,s=e[2]/r,o=e[3]/r,a=e[4],u=e[5],h=e[6],c=e[7],l=n*a+i*u+s*h+o*c;t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=(a-n*l)/r,t[5]=(u-i*l)/r,t[6]=(h-s*l)/r,t[7]=(c-o*l)/r}return t}function U(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function Y(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function V(t,e){var r=t[0],i=t[1],s=t[2],o=t[3],a=t[4],u=t[5],h=t[6],c=t[7],l=e[0],f=e[1],d=e[2],p=e[3],m=e[4],g=e[5],v=e[6],y=e[7];return Math.abs(r-l)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(i-f)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(s-d)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(o-p)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-m)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(u-g)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(h-v)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(v))&&Math.abs(c-y)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(y))}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{create:()=>i,clone:()=>s,fromValues:()=>o,copy:()=>a,set:()=>u,add:()=>h,subtract:()=>c,multiply:()=>l,divide:()=>f,ceil:()=>d,floor:()=>p,min:()=>m,max:()=>g,round:()=>v,scale:()=>y,scaleAndAdd:()=>b,distance:()=>w,squaredDistance:()=>M,length:()=>x,squaredLength:()=>_,negate:()=>S,inverse:()=>P,normalize:()=>A,dot:()=>O,cross:()=>E,lerp:()=>k,random:()=>I,transformMat2:()=>C,transformMat2d:()=>B,transformMat3:()=>R,transformMat4:()=>T,rotate:()=>L,angle:()=>F,zero:()=>j,str:()=>D,exactEquals:()=>z,equals:()=>q,len:()=>U,sub:()=>Y,mul:()=>V,div:()=>Z,dist:()=>G,sqrDist:()=>$,sqrLen:()=>X,forEach:()=>H});var n=r(11);function i(){var t=new n.ARRAY_TYPE(2);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function s(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e}function o(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r}function a(t,e){return t[0]=e[0],t[1]=e[1],t}function u(t,e,r){return t[0]=e,t[1]=r,t}function h(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function l(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function f(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function m(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function g(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function v(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function y(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function b(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function w(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function M(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function x(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function _(t){var e=t[0],r=t[1];return e*e+r*r}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t}function P(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function A(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function O(t,e){return t[0]*e[0]+t[1]*e[1]}function E(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function k(t,e,r,n){var i=e[0],s=e[1];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t}function I(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function C(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function B(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function R(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function T(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function L(t,e,r,n){var i=e[0]-r[0],s=e[1]-r[1],o=Math.sin(n),a=Math.cos(n);return t[0]=i*a-s*o+r[0],t[1]=i*o+s*a+r[1],t}function F(t,e){var r=t[0],n=t[1],i=e[0],s=e[1],o=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+s*s),a=o&&(r*i+n*s)/o;return Math.acos(Math.min(Math.max(a,-1),1))}function j(t){return t[0]=0,t[1]=0,t}function D(t){return"vec2("+t[0]+", "+t[1]+")"}function z(t,e){return t[0]===e[0]&&t[1]===e[1]}function q(t,e){var r=t[0],i=t[1],s=e[0],o=e[1];return Math.abs(r-s)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-o)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))}var N,U=x,Y=c,V=l,Z=f,G=w,$=M,X=_,H=(N=i(),function(t,e,r,n,i,s){var o,a;for(e||(e=2),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Scene=void 0;const n=r(22),i=r(23),s=r(32),o=r(30);class a{constructor(t={}){this.width=400,this.height=400,this.background="hsla(0, 0%, 0%, 1)",this.color="hsla(0, 0%, 100%, 1)",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.center=[this.width/2,this.height/2],this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?(.5+.5*o.clamp(-1,1,t.anchor[0]))*this.width:"left"===t.anchor[0]?0:"right"===t.anchor[0]?this.width:this.center[0],"number"==typeof t.anchor[1]?(.5+.5*o.clamp(-1,1,t.anchor[1]))*this.height:"top"===t.anchor[1]?0:"bottom"===t.anchor[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.width=t,this.height=e,this.center=[this.width/2,this.height/2];const r=[this.width/this.anchor[0],this.height/this.anchor[1]];this.anchor=[this.width/r[0],this.height/r[1]],this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;te.stream(t)))}getChildren(){return this.children}add(...t){const e="number"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,a.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&t{a.propagateToChilden(t,e)})):t instanceof s.Shape&&t.shape&&(t.shape.scene=e,a.propagateToChilden(t.shape,e))}}e.Scene=a},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||"SceneChild",this.name=t.name||this.type+"_"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){"string"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Group=void 0;const n=r(21),i=r(22),s=r(24),o=r(28);class a extends i.SceneChild{constructor(t={}){t.type="Group",super(t),this.children=[],["id","name","data","order","type"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r=0&&t=0&&tn.generate(t,e,r)))}getBounding(){const t=[],e=o.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;rt[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.widthe.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){"object"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;et.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=a},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBase=void 0;const n=r(10),i=r(1),s=r(25),o=r(26),a=r(27),u=r(28),h=r(30),c=r(22),l=n.mat4.create(),f=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class m extends c.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?-1*h.clamp(-1,1,t.anchor[0]):"left"===t.anchor[0]?1:"right"===t.anchor[0]?-1:0,"number"==typeof t.anchor[1]?-1*h.clamp(-1,1,t.anchor[1]):"top"===t.anchor[1]?1:"bottom"===t.anchor[1]?-1:0]:[0,0],this.boundingType="string"==typeof t.boundingType?"relative"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return"function"!=typeof t.repetitions&&"function"!=typeof t.distance&&"function"!=typeof t.displace&&"function"!=typeof t.scale&&"function"!=typeof t.translate&&"function"!=typeof t.skewX&&"function"!=typeof t.skewY&&"function"!=typeof t.squeezeX&&"function"!=typeof t.squeezeY&&"function"!=typeof t.rotateX&&"function"!=typeof t.rotateY&&"function"!=typeof t.rotateZ&&"function"!=typeof t.transformOrigin&&"function"!=typeof t.perspective&&"function"!=typeof t.perspectiveOrigin}isStaticIndexed(){return"function"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return"function"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){"string"==typeof t?(r=r||"repetitions"==t,this.props[t]=e):(r=r||"repetitions"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var c,g;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const v=m.getEmptyPropArguments(this,r),y=v.repetition,b=this.getProp("repetitions",v,1),w=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,M=Array.isArray(b)?b[0]*(null!==(c=b[1])&&void 0!==c?c:b[0]):b,x=Array.isArray(b)?b[0]:M,_=Array.isArray(b)?null!==(g=b[1])&&void 0!==g?g:b[0]:1,S=y.row;S.count=x;const P=y.col;P.count=_,y.count=M,y.col.count=_,y.row.count=x,y.type=w;let A=0;const O=[];let E=0;const k=n.vec2.fromValues((_-1)/2,(x-1)/2),I=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],C=[void 0,void 0,void 0,void 0],B=[void 0,void 0,void 0,void 0];for(let r=0;r1?E/(M-1):1,y.angle=w===i.ERepetitionType.Ring?a.PI2/M*E:0,P.index=c+1,P.offset=_>1?c/(_-1):1,S.index=r+1,S.offset=x>1?r/(x-1):1;const m=this.generateBuffer(t,v),g=m.length,b=this.getShapeBounding();O[E]=new Float32Array(g),A+=g;{const t=s.toVec2(this.getProp("distance",v,s.VEC2_ZERO)),a=this.getProp("displace",v,0),M=s.toVec3(this.getProp("scale",v,s.VEC2_ONE),1),x=s.toVec3(this.getProp("translate",v,s.VEC2_ZERO),0),_=this.getProp("skewX",v,0),S=this.getProp("skewY",v,0),P=this.getProp("squeezeX",v,0),A=this.getProp("squeezeY",v,0),R=this.getProp("rotateX",v,0),T=this.getProp("rotateY",v,0),L=this.getProp("rotateZ",v,0),F=h.clamp(0,1,this.getProp("perspective",v,0)),j=s.toVec3(this.getProp("perspectiveOrigin",v,s.VEC2_ZERO),0),D=s.toVec3(this.getProp("transformOrigin",v,s.VEC2_ZERO),0);let z;switch(w){case i.ERepetitionType.Ring:z=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(z,z,s.VEC3_ZERO,y.angle+a);break;case i.ERepetitionType.Matrix:z=n.vec3.fromValues(t[1]*(c-k[0]),t[0]*(r-k[1]),0)}const q=F>0?Math.max(b.width,b.height)/2:1,N=F>0?q+10*q*(1-F):0,U=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==F||0!==D[0]||0!==D[1],Y=0!==j[0]||0!==j[1];U&&(this.boundingType===i.EBoundingType.Relative?(D[0]=D[0]*(b.width/2)+b.cx,D[1]=D[1]*(b.height/2)+b.cy):(D[0]*=b.width/2,D[1]*=b.height/2),D[2]=N);{n.mat4.identity(f),U&&n.mat4.translate(f,f,D),0===x[0]&&0===x[1]||n.mat4.translate(f,f,x),0===_&&0===S||(s.fromSkew(l,[_,S]),n.mat4.multiply(f,f,l)),0!==R&&n.mat4.rotateX(f,f,R),0!==T&&n.mat4.rotateY(f,f,T),0!==L&&n.mat4.rotateZ(f,f,L),1===M[0]&&1===M[1]||n.mat4.scale(f,f,M),U&&n.mat4.translate(f,f,n.vec3.scale(D,D,-1)),N>0&&(Y&&(this.boundingType===i.EBoundingType.Relative?(j[0]=j[0]*(b.width/2)+b.cx,j[1]=j[1]*(b.height/2)+b.cy):(j[0]*=b.width/2,j[1]*=b.height/2),j[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,z),e&&n.mat4.translate(p,p,I);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),w===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,y.angle+a)}u.Bounding.clear(B);for(let t=0;t0&&(Y&&n.vec3.add(e,e,j),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,N),Y&&n.vec3.sub(e,e,j)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=g/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,v)}O[E][t]=e[0],O[E][t+1]=e[1],u.Bounding.add(B,e[0],e[1]),u.Bounding.add(C,e[0],e[1])}}const R={cx:0,cy:0,x:-1,y:-1,width:2,height:2};u.Bounding.bind(R,B),this.bStaticIndexed&&this.bIndexed||this.addIndex(g,y,R)}u.Bounding.bind(this.bounding,C),this.buffer=new Float32Array(A);for(let t=0,e=0,r=O.length;t({index:1,offset:1,count:1}),m.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...m.getEmptySimpleRepetition(),row:m.getEmptySimpleRepetition(),col:m.getEmptySimpleRepetition()})},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(10);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return"number"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(29);var i;!function(t){t[t.None=0]="None",t[t.Scale=2]="Scale",t[t.Center=4]="Center",t[t.Fill=8]="Fill"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||et[2])&&(t[2]=e),(void 0===t[1]||rt[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]e[2]&&(t[2]=e[2]),t[1]e[3]&&(t[3]=e[3])):console.warn("[Urplfanze:Bounding] cannot sum bounding")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn("[Urplfanze:Bounding] cannot bind bounding")}};class s extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return s.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=s.getBounding(t));const o=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,a=e>=i.Center?r.cx:0,u=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.distributePointsInBuffer=e.interpolate=e.prepareBufferForInterpolation=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(31),i=r(4),s=r(26),o="undefined"!=typeof performance?performance:Date;function a(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return o.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=a,e.relativeClamp=function(t,e,r,n,i){return a(n,i,(r-t)/(e-t)*(i-n)+n)};const u={random:new n(Math.random)};e.noise=function(t="random",e=0,r=0,i=0){return void 0===u[t]&&(u[t]=new n(t)),u[t].noise3D(e,r,i)};const h={};function c(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),s=rn?[s,o]:[o,s]}function l(t,e){const r=t.length,n=r/2,i=2*(n+e),s=n-1;if(s>1){const n=r-2,o=Math.floor(e/s);let a=(i-(r+o*n))/2;const u=Math.round(s/a),h=new Float32Array(i);for(let e=0,r=0,i=0;e0&&(r%u==0||e===n-2),p=o+(d?1:0),m=1/(p+1);for(let t=0;t>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);h[i]=(s=t(),o=t(),a=t(),u=t(),function(){let t=(s>>>=0)+(o>>>=0)|0;return s=o^o>>>9,o=(a>>>=0)+(a<<3)|0,t=t+(u=1+(u>>>=0)|0)|0,a=(a=a<<21|a>>>11)+t|0,(t>>>0)/4294967296})}var s,o,a,u;const c=e+h[i]()*(r-e);return void 0!==n?Math.round(c*10**n)/10**n:c},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return s.default.distance(n,r)}return 1},e.prepareBufferForInterpolation=c,e.interpolate=function(t,e,r=.5){const[n,i]=c(t,e),s=Math.max(n.length,i.length),o="number"==typeof r?[r]:r,a=s/2;if(o.length!==a){const t=o.length;for(let e=0;e{var n;!function(){"use strict";var i=.5*(Math.sqrt(3)-1),s=(3-Math.sqrt(3))/6,o=1/6,a=(Math.sqrt(5)-1)/4,u=(5-Math.sqrt(5))/20;function h(t){var e;e="function"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=l();t=i(" "),e=i(" "),r=i(" ");for(var s=0;s>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}h.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,o=this.permMod12,a=this.perm,u=this.grad3,h=0,c=0,l=0,f=(t+e)*i,d=Math.floor(t+f),p=Math.floor(e+f),m=(d+p)*s,g=t-(d-m),v=e-(p-m);g>v?(r=1,n=0):(r=0,n=1);var y=g-r+s,b=v-n+s,w=g-1+2*s,M=v-1+2*s,x=255&d,_=255&p,S=.5-g*g-v*v;if(S>=0){var P=3*o[x+a[_]];h=(S*=S)*S*(u[P]*g+u[P+1]*v)}var A=.5-y*y-b*b;if(A>=0){var O=3*o[x+r+a[_+n]];c=(A*=A)*A*(u[O]*y+u[O+1]*b)}var E=.5-w*w-M*M;if(E>=0){var k=3*o[x+1+a[_+1]];l=(E*=E)*E*(u[k]*w+u[k+1]*M)}return 70*(h+c+l)},noise3D:function(t,e,r){var n,i,s,a,u,h,c,l,f,d,p=this.permMod12,m=this.perm,g=this.grad3,v=.3333333333333333*(t+e+r),y=Math.floor(t+v),b=Math.floor(e+v),w=Math.floor(r+v),M=(y+b+w)*o,x=t-(y-M),_=e-(b-M),S=r-(w-M);x>=_?_>=S?(u=1,h=0,c=0,l=1,f=1,d=0):x>=S?(u=1,h=0,c=0,l=1,f=0,d=1):(u=0,h=0,c=1,l=1,f=0,d=1):_B?L++:F++,C>R?L++:j++,C>T?L++:D++,B>R?F++:j++,B>T?F++:D++,R>T?j++:D++;var z=C-(l=L>=3?1:0)+u,q=B-(f=F>=3?1:0)+u,N=R-(d=j>=3?1:0)+u,U=T-(p=D>=3?1:0)+u,Y=C-(m=L>=2?1:0)+2*u,V=B-(g=F>=2?1:0)+2*u,Z=R-(v=j>=2?1:0)+2*u,G=T-(y=D>=2?1:0)+2*u,$=C-(b=L>=1?1:0)+3*u,X=B-(w=F>=1?1:0)+3*u,H=R-(M=j>=1?1:0)+3*u,W=T-(x=D>=1?1:0)+3*u,J=C-1+4*u,Q=B-1+4*u,K=R-1+4*u,tt=T-1+4*u,et=255&A,rt=255&O,nt=255&E,it=255&k,st=.6-C*C-B*B-R*R-T*T;if(st<0)i=0;else{var ot=_[et+_[rt+_[nt+_[it]]]]%32*4;i=(st*=st)*st*(S[ot]*C+S[ot+1]*B+S[ot+2]*R+S[ot+3]*T)}var at=.6-z*z-q*q-N*N-U*U;if(at<0)s=0;else{var ut=_[et+l+_[rt+f+_[nt+d+_[it+p]]]]%32*4;s=(at*=at)*at*(S[ut]*z+S[ut+1]*q+S[ut+2]*N+S[ut+3]*U)}var ht=.6-Y*Y-V*V-Z*Z-G*G;if(ht<0)o=0;else{var ct=_[et+m+_[rt+g+_[nt+v+_[it+y]]]]%32*4;o=(ht*=ht)*ht*(S[ct]*Y+S[ct+1]*V+S[ct+2]*Z+S[ct+3]*G)}var lt=.6-$*$-X*X-H*H-W*W;if(lt<0)h=0;else{var ft=_[et+b+_[rt+w+_[nt+M+_[it+x]]]]%32*4;h=(lt*=lt)*lt*(S[ft]*$+S[ft+1]*X+S[ft+2]*H+S[ft+3]*W)}var dt=.6-J*J-Q*Q-K*K-tt*tt;if(dt<0)c=0;else{var pt=_[et+1+_[rt+1+_[nt+1+_[it+1]]]]%32*4;c=(dt*=dt)*dt*(S[pt]*J+S[pt+1]*Q+S[pt+2]*K+S[pt+3]*tt)}return 27*(i+s+o+h+c)}},h._buildPermutationTable=c,void 0===(n=function(){return h}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=h,t.exports=h}()},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=void 0;const n=r(21),i=r(22),s=r(24);class o extends s.ShapeBase{constructor(t){t.type=t.type||"Shape",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn("[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\nYou passed:",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):o.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapePrimitive=void 0;const n=r(25),i=r(24),s=r(29),o=r(28);class a extends i.ShapeBase{constructor(t={}){var e;super(t),this.currentGenerationPrimitiveBounding=o.Bounding.empty(),this.props.sideLength=void 0===t.sideLength?void 0:"function"==typeof t.sideLength?t.sideLength:n.toVec2(t.sideLength),this.drawer=t.drawer||{},this.modifiers=t.modifiers,this.bClosed=null===(e=t.bClosed)||void 0===e||e}isStatic(){return"function"!=typeof this.props.sideLength&&super.isStatic()}getRepetitionSideLength(t){return this.bStatic?(void 0===this.props.sideLength?this.props.sideLength=[50,50]:"number"==typeof this.props.sideLength&&(this.props.sideLength=[this.props.sideLength,this.props.sideLength]),this.props.sideLength):n.toVec2(this.getProp("sideLength",t,[50,50]))}applyModifiers(t,e){if(void 0===this.modifiers)return t;let r=t;const n=Array.isArray(this.modifiers)?this.modifiers:[this.modifiers];for(let t=0,i=n.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeLoop=void 0;const n=r(27),i=r(28),s=r(33),o=r(24);class a extends s.ShapePrimitive{constructor(t={},e=!1){t.type=t.type||"ShapeLoop",super(t),this.loopDependencies=(t.loopDependencies||[]).concat("sideLength"),this.props.loop=t.loop,e||(this.loop={start:0,end:n.PI2,inc:n.PI2/10,vertex:()=>[0,0]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed())}isStaticLoop(){if(this.loopDependencies.includes("propArguments"))return!1;for(let t=0,e=this.loopDependencies.length;t=0;t--)if(this.loopDependencies[t]in n){r=!0;break}"loop"in n&&(n.loop={...this.props.loop,...n.loop},r=!0),super.setProp(n,e,r)}getBufferLength(t){if(this.bStatic&&void 0!==this.buffer)return this.buffer.length;if(this.bStaticLoop&&void 0!==this.currentOrSingleLoopBuffer)return this.currentOrSingleLoopBuffer.length*this.getRepetitionCount();const{count:e}=this.getLoop(t||o.ShapeBase.getEmptyPropArguments(this));return this.getRepetitionCount()*e*2}generateBuffer(t,e){return this.bStaticLoop?("function"!=typeof this.props.sideLength&&void 0!==this.currentOrSingleLoopBuffer||(this.currentOrSingleLoopBuffer=this.generateLoopBuffer(e)),this.currentOrSingleLoopBuffer):this.generateLoopBuffer(e)}generateLoopBuffer(t){const{start:e,inc:r,count:n}=this.getLoop(t),s=this.getRepetitionSideLength(t),o=this.props.loop&&this.props.loop.vertex?this.props.loop.vertex:this.loop.vertex,a={index:0,offset:0,current:0,count:n},u=a.count,h=new Float32Array(2*u);for(let n=0,i=0;n1?n/(a.count-1):1;a.current=s,a.index=n+1,a.offset=u;const c=o(a,t);h[i]=c[0],h[i+1]=c[1]}const c=[void 0,void 0,void 0,void 0],l=this.applyModifiers(h,t);for(let t=0,e=l.length;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBuffer=void 0;const n=r(28),i=r(33);class s extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||"ShapeBuffer",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn("[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property"),this.shape=s.EMPTY_BUFFER):this.shape="function"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return"function"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from("function"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,s=r.length;t0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&"function"!=typeof this.props.sideLength&&"function"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=s},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeRecursive=void 0;const n=r(32);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeRecursive",super(t),this.props.recursions=t.recursions||1,this.props.recursionScale=t.recursionScale||2,this.props.recursionVertex=t.recursionVertex||0,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseRecursion=!!t.shapeUseRecursion}clearBuffer(t=!1,e=!0){t&&(this.shapeRecursiveBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionScale&&"function"!=typeof this.props.recursionVertex&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.props.recursions&&"function"!=typeof this.props.recursionVertex&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape?((void 0===this.shapeRecursiveBuffer||this.shapeUseParent||this.shape.generateId!==t)&&this.bindBuffer(t,e),this.shapeRecursiveBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=Math.floor(this.getProp("recursions",e,1)),n=Math.floor(this.getProp("recursionVertex",e,0)),s=this.getProp("recursionScale",e,2),o=this.shape;let a={index:1,offset:1,count:1,level:{index:1,offset:r>1?0:1,count:1}};const u={...e,recursion:a};o.generate(t,!1,u);const h=o.getBuffer();if(r<=1)return void(this.shapeRecursiveBuffer=h);let c=h;const l=[a];let f=0,d=1;const p=c.length,m=p/2,g=n<=0?m:Math.min(n,m),v=0===n?1:m/Math.min(n,m),y=new Float32Array(i.summmation(r,g)*p);for(let t=0;t1?e/(r-1):1,h=i.summmation(e,g)*p,m=e-1,b=0===m?0:i.summmation(m,g)*p;for(let i=0,m=g**e;i1?i/(m-1):1,count:m,level:{index:e+1,offset:n,count:r},parent:l[f]},l.push(a),this.shapeUseRecursion&&(u.recursion=a,o.generate(t,!1,u),c=o.getBuffer());const w=h+i*p,M=Math.floor(b+2*i*v),x=y[M],_=y[M+1],S=s**e;for(let t=0,e=p;t1?0:1,count:s}}},u=this.shape.getIndexedBuffer()||[];for(let t=0,e=u.length;t1?0:1,count:s}},i={...a,recursion:r},o=e.parent?n.Shape.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:o})}if(s>1){const t=this.shape.getBufferLength({...i,parent:{...a}})/2,e=o<=0?t:Math.min(o,t),r=this.indexedBuffer.map((t=>[t.parent.recursion]));let h=0,c=1;for(let t=1;t1?t/(s-1):1;for(let o=0,l=e**t;o1?o/(l-1):1;for(let d=0,p=u.length;d{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeFollow=void 0;const n=r(32);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeFollow",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},s=this.shape;s.generate(t,!1,i);let o=s.getBuffer();const a=o.length,u=new Float32Array(a*(n.length/2)),h=n.length/2;for(let e=0;e1?e/(h-1):1,count:h};this.shapeUseFollow&&(i.follow=r,s.generate(t,!1,i),o=s.getBuffer());const c=e*a,l=2*e,f=n[l],d=n[l+1];for(let t=0,e=o.length;t1?t/(e-1):1;for(let o=0,a=s.length;o{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Line=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type="Line",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,t.bClosed=!1,super(t)}static toPolygon(t,e){const r=[];if(!Array.isArray(e)){const r=e,n=t.length/2;e=new Array(n);for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Triangle=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type="Triangle",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Triangle=s,s.buffer=[1,0,-1,1,-1,-1]},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Rect=void 0;const n=r(28),i=r(35);class s extends i.ShapeBuffer{constructor(t={}){t.type="Rect",t.shape=s.buffer,t.adaptMode=n.EAdaptMode.None,super(t)}}e.Rect=s,s.buffer=[1,1,-1,1,-1,-1,1,-1]},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Polygon=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["sideNumber"]),super(t,!0),this.props.sideNumber=t.sideNumber,this.loop={start:0,end:n.PI2,inc:t=>n.PI2/this.getProp("sideNumber",t,5),vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Polygon=s},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Circle=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type="Circle",super(t,!0),this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return 1/Math.pow(e[0]*e[1],.25)*i.ShapeLoop.PId2},vertex:t=>[Math.cos(t.current),Math.sin(t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}}e.Circle=s},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Star=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type=t.type||"Polygon",t.loopDependencies=(t.loopDependencies||[]).concat(["spikes","innerRadius"]),super(t,!0),this.props.spikes=t.spikes,this.props.innerRadius=t.innerRadius,this.loop={start:0,end:n.PI2,inc:t=>this.inc,vertex:t=>{const e=Math.PI/this.spikes*t.index,r=t.index%2==0?1:this.innerRadius;return[Math.cos(e)*r,Math.sin(e)*r]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spikes=this.getProp("spikes",t,5),this.innerRadius=this.getProp("innerRadius",t,.5),this.inc=Math.PI/this.spikes,super.generateLoopBuffer(t)}}e.Star=s},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Rose=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r;t.type="Rose",t.loopDependencies=(t.loopDependencies||[]).concat(["n","d"]),super(t,!0),this.props.n=null!==(e=t.n)&&void 0!==e?e:1,this.props.d=null!==(r=t.d)&&void 0!==r?r:2,this.loop={start:0,end:t=>s.getFinalAngleFromK(this.getProp("n",t),this.getProp("d",t)),inc:t=>{const e=this.getProp("n",t),r=this.getProp("d",t),i=this.getRepetitionSideLength(t),s=Math.pow(i[0]*i[1],.45),o=r{const e=Math.cos(this.k*t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.k=this.getProp("n",t)/this.getProp("d",t),super.generateLoopBuffer(t)}static getFinalAngleFromK(t,e){if(t==e)return n.PI2;const r=t/e,i=t*e;return Number.isInteger(r)||r%.5!=0?Math.PI*e*(i%2==0?2:1):4*Math.PI}}e.Rose=s},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Spiral=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r,i;t.type="Spiral",t.bClosed=!1,t.loopDependencies=(t.loopDependencies||[]).concat(["twists","twistsStart","spiral"]),super(t,!0),this.props.spiral=null!==(e=t.spiral)&&void 0!==e?e:s.types.ARCHIMEDE,this.props.twists=null!==(r=t.twists)&&void 0!==r?r:2,this.props.twistsStart=null!==(i=t.twistsStart)&&void 0!==i?i:0,this.loop={start:t=>n.PI2*this.getProp("twistsStart",t),end:t=>n.PI2*(this.getProp("twistsStart",t)+this.getProp("twists",t)),inc:t=>{const e=this.getProp("twists",t),r=n.PI2*e,i=this.getRepetitionSideLength(t);return r/((4+Math.sqrt(i[0]*i[1]))*e)},vertex:t=>{const e=this.r(t.current);return[e*Math.cos(t.current),e*Math.sin(t.current)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.spiral=this.getProp("spiral",t),this.r=s.getRFromTSpiralType(this.spiral),super.generateLoopBuffer(t)}static getRFromTSpiralType(t){switch(t){case s.types.ARCHIMEDE:return t=>t/10;case s.types.HYPERBOLIC:return t=>1/t*3;case s.types.FERMAT:return t=>t**.5/3;case s.types.LITUUS:return t=>t**-.5;case s.types.LOGARITHMIC:return t=>Math.E**(.2*t)/10}return t=>t}}e.Spiral=s,s.types={ARCHIMEDE:"ARCHIMEDE",HYPERBOLIC:"HYPERBOLIC",FERMAT:"FERMAT",LITUUS:"LITUUS",LOGARITHMIC:"LOGARITHMIC"}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lissajous=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){t.type="Lissajous",t.loopDependencies=(t.loopDependencies||[]).concat(["wx","wy","wz"]),super(t,!0),this.props.wx=t.wx||1,this.props.wy=t.wy||2,this.props.wz=t.wz||0,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getProp("wx",t),r=this.getProp("wy",t),n=e==r?i.ShapeLoop.PId2:.5-.01*Math.min(49,e+r),s=this.getRepetitionSideLength(t);return 1/Math.pow(s[0]*s[1],.25)*n},vertex:t=>this.wx===this.wy?[Math.cos(t.current+this.wz),Math.sin(t.current)]:[Math.cos(this.wx*t.current+this.wz),Math.sin(this.wy*t.current)]},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.wx=this.getProp("wx",t,1),this.wy=this.getProp("wy",t,2),this.wz=this.getProp("wz",t,2),super.generateLoopBuffer(t)}}e.Lissajous=s},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SuperShape=void 0;const n=r(27),i=r(34);class s extends i.ShapeLoop{constructor(t={}){var e,r,i,s,o,a;t.type="SuperShape",t.loopDependencies=(t.loopDependencies||[]).concat(["a","b","m","n1","n2","n3"]),super(t,!0),this.props.a=null!==(e=t.a)&&void 0!==e?e:1,this.props.b=null!==(r=t.b)&&void 0!==r?r:1,this.props.m=null!==(i=t.m)&&void 0!==i?i:6,this.props.n1=null!==(s=t.n1)&&void 0!==s?s:1,this.props.n2=null!==(o=t.n2)&&void 0!==o?o:1,this.props.n3=null!==(a=t.n3)&&void 0!==a?a:1,this.loop={start:0,end:n.PI2,inc:t=>{const e=this.getRepetitionSideLength(t);return Math.PI/Math.pow(e[0]*e[1],.5)},vertex:t=>{const e=t.current,r=this.m*e/4,n=(Math.abs(Math.cos(r)/this.a)**this.n2+Math.abs(Math.sin(r)/this.b)**this.n3)**(1/this.n1),i=0===n?1:1/n;return[i*Math.cos(e),i*Math.sin(e)]}},this.bStaticLoop=this.isStaticLoop(),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}generateLoopBuffer(t){return this.a=this.getProp("a",t),this.b=this.getProp("b",t),this.m=this.getProp("m",t),this.n1=this.getProp("n1",t),this.n2=this.getProp("n2",t),this.n3=this.getProp("n3",t),super.generateLoopBuffer(t)}}e.SuperShape=s},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Modifiers=void 0;const n=r(28),i=r(49),s=r(50),o=r(52),a=r(53),u=r(51),h=r(54),c={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:s.Smooth,Solidify:o.Solidify,Subdivide:a.Subdivide,Close:u.Close,Offset:h.Offset};e.Modifiers=c},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Mirror=void 0;const n=r(29);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let s=0;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Smooth=void 0;const n=r(30),i=r(51),s=r(29);class o extends s.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Close=void 0;const n=r(29);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Solidify=void 0;const n=r(29);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const s=[],o=(e="number"==typeof e?[e]:e).length;let a,u,h=[[0,0],[0,0]],c=[[0,0],[0,0]];for(let r=0,l=0,f=t.length-2;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Subdivide=void 0;const n=r(29);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Offset=void 0;const n=r(29);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i}],e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(0)})()},t.exports=e()},479:(t,e,r)=>{var n;!function(){"use strict";function i(t,e,r){var n=e.x,i=e.y,s=r.x-n,o=r.y-i;if(0!==s||0!==o){var a=((t.x-n)*s+(t.y-i)*o)/(s*s+o*o);a>1?(n=r.x,i=r.y):a>0&&(n+=s*a,i+=o*a)}return(s=t.x-n)*s+(o=t.y-i)*o}function s(t,e,r,n,o){for(var a,u=n,h=e+1;hu&&(a=h,u=c)}u>n&&(a-e>1&&s(t,e,a,n,o),o.push(t[a]),r-a>1&&s(t,a,r,n,o))}function o(t,e){var r=t.length-1,n=[t[0]];return s(t,0,r,e,n),n.push(t[r]),n}function a(t,e,r){if(t.length<=2)return t;var n=void 0!==e?e*e:1;return o(t=r?t:function(t,e){for(var r,n,i,s,o,a=t[0],u=[a],h=1,c=t.length;he&&(u.push(r),a=r);return a!==r&&u.push(r),u}(t,n),n)}void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()},721:(t,e,r)=>{"use strict";t.exports=r(192)},921:t=>{"use strict";var e=2*Math.PI;function r(t,e,r,n){var i=t*r+e*n;return i>1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)}function n(t,e){var r=4/3*Math.tan(e/4),n=Math.cos(t),i=Math.sin(t),s=Math.cos(t+e),o=Math.sin(t+e);return[n,i,n-i*r,i+n*r,s+o*r,o-s*r,s,o]}t.exports=function(t,i,s,o,a,u,h,c,l){var f=Math.sin(l*e/360),d=Math.cos(l*e/360),p=d*(t-s)/2+f*(i-o)/2,m=-f*(t-s)/2+d*(i-o)/2;if(0===p&&0===m)return[];if(0===h||0===c)return[];h=Math.abs(h),c=Math.abs(c);var g=p*p/(h*h)+m*m/(c*c);g>1&&(h*=Math.sqrt(g),c*=Math.sqrt(g));var v=function(t,n,i,s,o,a,u,h,c,l){var f=l*(t-i)/2+c*(n-s)/2,d=-c*(t-i)/2+l*(n-s)/2,p=u*u,m=h*h,g=f*f,v=d*d,y=p*m-p*v-m*g;y<0&&(y=0),y/=p*v+m*g;var b=(y=Math.sqrt(y)*(o===a?-1:1))*u/h*d,w=y*-h/u*f,M=l*b-c*w+(t+i)/2,x=c*b+l*w+(n+s)/2,_=(f-b)/u,S=(d-w)/h,P=(-f-b)/u,A=(-d-w)/h,O=r(1,0,_,S),E=r(_,S,P,A);return 0===a&&E>0&&(E-=e),1===a&&E<0&&(E+=e),[M,x,O,E]}(t,i,s,o,a,u,h,c,f,d),y=[],b=v[2],w=v[3],M=Math.max(Math.ceil(Math.abs(w)/(e/4)),1);w/=M;for(var x=0;x{"use strict";var e=1e-10,r=Math.PI/180;function n(t,e,r){if(!(this instanceof n))return new n(t,e,r);this.rx=t,this.ry=e,this.ax=r}n.prototype.transform=function(t){var n=Math.cos(this.ax*r),i=Math.sin(this.ax*r),s=[this.rx*(t[0]*n+t[2]*i),this.rx*(t[1]*n+t[3]*i),this.ry*(-t[0]*i+t[2]*n),this.ry*(-t[1]*i+t[3]*n)],o=s[0]*s[0]+s[2]*s[2],a=s[1]*s[1]+s[3]*s[3],u=((s[0]-s[3])*(s[0]-s[3])+(s[2]+s[1])*(s[2]+s[1]))*((s[0]+s[3])*(s[0]+s[3])+(s[2]-s[1])*(s[2]-s[1])),h=(o+a)/2;if(uMath.abs(l-a)?(l-o)/c:c/(l-a))/Math.PI,this.ax>=0?(this.rx=Math.sqrt(l),this.ry=Math.sqrt(f)):(this.ax+=90,this.rx=Math.sqrt(f),this.ry=Math.sqrt(l)),this},n.prototype.isDegenerate=function(){return this.rx{"use strict";function e(){if(!(this instanceof e))return new e;this.queue=[],this.cache=null}e.prototype.matrix=function(t){return 1===t[0]&&0===t[1]&&0===t[2]&&1===t[3]&&0===t[4]&&0===t[5]||(this.cache=null,this.queue.push(t)),this},e.prototype.translate=function(t,e){return 0===t&&0===e||(this.cache=null,this.queue.push([1,0,0,1,t,e])),this},e.prototype.scale=function(t,e){return 1===t&&1===e||(this.cache=null,this.queue.push([t,0,0,e,0,0])),this},e.prototype.rotate=function(t,e,r){var n,i,s;return 0!==t&&(this.translate(e,r),n=t*Math.PI/180,i=Math.cos(n),s=Math.sin(n),this.queue.push([i,s,-s,i,0,0]),this.cache=null,this.translate(-e,-r)),this},e.prototype.skewX=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},e.prototype.skewY=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},e.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],1===this.queue.length)return this.cache;for(var t=1;t{"use strict";var e={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},r=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function n(t){return t>=48&&t<=57}function i(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function s(t){for(;t.index=5760&&r.indexOf(e)>=0);)t.index++;var e}function o(t){var e=t.path.charCodeAt(t.index);return 48===e?(t.param=0,void t.index++):49===e?(t.param=1,void t.index++):void(t.err="SvgPath: arc flag can be 0 or 1 only (at pos "+t.index+")")}function a(t){var e,r=t.index,i=r,s=t.max,o=!1,a=!1,u=!1,h=!1;if(i>=s)t.err="SvgPath: missed param (at pos "+i+")";else if(43!==(e=t.path.charCodeAt(i))&&45!==e||(e=++i2&&(t.result.push([r,i[0],i[1]]),i=i.slice(2),n="l",r="m"===r?"l":"L"),"r"===n)t.result.push([r].concat(i));else for(;i.length>=e[n]&&(t.result.push([r].concat(i.splice(0,e[n]))),e[n]););}function h(t){var r,n,i,h,c,l,f=t.max;if(t.segmentStart=t.index,n=97==(32|(r=t.path.charCodeAt(t.index))),function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}(r))if(h=e[t.path[t.index].toLowerCase()],t.index++,s(t),t.data=[],h){for(i=!1;;){for(c=h;c>0;c--){if(!n||3!==c&&4!==c?a(t):o(t),t.err.length)return;t.data.push(t.param),s(t),i=!1,t.index=t.max)break;if(!((l=t.path.charCodeAt(t.index))>=48&&l<=57||43===l||45===l||46===l))break}}u(t)}else u(t);else t.err="SvgPath: bad command "+t.path[t.index]+" (at pos "+t.index+")"}t.exports=function(t){var e=new i(t),r=e.max;for(s(e);e.index{"use strict";var n=r(665),i=r(94),s=r(480),o=r(921),a=r(954);function u(t){if(!(this instanceof u))return new u(t);var e=n(t);this.segments=e.segments,this.err=e.err,this.__stack=[]}u.from=function(t){if("string"==typeof t)return new u(t);if(t instanceof u){var e=new u("");return e.err=t.err,e.segments=t.segments.map((function(t){return t.slice()})),e.__stack=t.__stack.map((function(t){return s().matrix(t.toArray())})),e}throw new Error("SvgPath.from: invalid param type "+t)},u.prototype.__matrix=function(t){var e,r=this;t.queue.length&&this.iterate((function(n,i,s,o){var u,h,c,l;switch(n[0]){case"v":h=0===(u=t.calc(0,n[1],!0))[0]?["v",u[1]]:["l",u[0],u[1]];break;case"V":h=(u=t.calc(s,n[1],!1))[0]===t.calc(s,o,!1)[0]?["V",u[1]]:["L",u[0],u[1]];break;case"h":h=0===(u=t.calc(n[1],0,!0))[1]?["h",u[0]]:["l",u[0],u[1]];break;case"H":h=(u=t.calc(n[1],o,!1))[1]===t.calc(s,o,!1)[1]?["H",u[0]]:["L",u[0],u[1]];break;case"a":case"A":var f=t.toArray(),d=a(n[1],n[2],n[3]).transform(f);if(f[0]*f[3]-f[1]*f[2]<0&&(n[5]=n[5]?"0":"1"),u=t.calc(n[6],n[7],"a"===n[0]),"A"===n[0]&&n[6]===s&&n[7]===o||"a"===n[0]&&0===n[6]&&0===n[7]){h=["a"===n[0]?"l":"L",u[0],u[1]];break}h=d.isDegenerate()?["a"===n[0]?"l":"L",u[0],u[1]]:[n[0],d.rx,d.ry,d.ax,n[4],n[5],u[0],u[1]];break;case"m":l=i>0,h=["m",(u=t.calc(n[1],n[2],l))[0],u[1]];break;default:for(h=[c=n[0]],l=c.toLowerCase()===c,e=1;e=0;)t.matrix(this.__stack[e].toArray());this.__matrix(t),this.__stack=[]}},u.prototype.toString=function(){var t,e,r=[];this.__evaluateStack();for(var n=0;n0&&"m"!==e&&"M"!==e&&e===this.segments[n-1][0],r=r.concat(t?this.segments[n].slice(1):this.segments[n]);return r.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")},u.prototype.translate=function(t,e){return this.__stack.push(s().translate(t,e||0)),this},u.prototype.scale=function(t,e){return this.__stack.push(s().scale(t,e||0===e?e:t)),this},u.prototype.rotate=function(t,e,r){return this.__stack.push(s().rotate(t,e||0,r||0)),this},u.prototype.skewX=function(t){return this.__stack.push(s().skewX(t)),this},u.prototype.skewY=function(t){return this.__stack.push(s().skewY(t)),this},u.prototype.matrix=function(t){return this.__stack.push(s().matrix(t)),this},u.prototype.transform=function(t){return t.trim()?(this.__stack.push(i(t)),this):this},u.prototype.round=function(t){var e,r=0,n=0,i=0,s=0;return t=t||0,this.__evaluateStack(),this.segments.forEach((function(o){var a=o[0].toLowerCase()===o[0];switch(o[0]){case"H":case"h":return a&&(o[1]+=i),i=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case"V":case"v":return a&&(o[1]+=s),s=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case"Z":case"z":return i=r,void(s=n);case"M":case"m":return a&&(o[1]+=i,o[2]+=s),i=o[1]-o[1].toFixed(t),s=o[2]-o[2].toFixed(t),r=i,n=s,o[1]=+o[1].toFixed(t),void(o[2]=+o[2].toFixed(t));case"A":case"a":return a&&(o[6]+=i,o[7]+=s),i=o[6]-o[6].toFixed(t),s=o[7]-o[7].toFixed(t),o[1]=+o[1].toFixed(t),o[2]=+o[2].toFixed(t),o[3]=+o[3].toFixed(t+2),o[6]=+o[6].toFixed(t),void(o[7]=+o[7].toFixed(t));default:return e=o.length,a&&(o[e-2]+=i,o[e-1]+=s),i=o[e-2]-o[e-2].toFixed(t),s=o[e-1]-o[e-1].toFixed(t),void o.forEach((function(e,r){r&&(o[r]=+o[r].toFixed(t))}))}})),this},u.prototype.iterate=function(t,e){var r,n,i,s=this.segments,o={},a=!1,u=0,h=0,c=0,l=0;if(e||this.__evaluateStack(),s.forEach((function(e,r){var n=t(e,r,u,h);Array.isArray(n)&&(o[r]=n,a=!0);var i=e[0]===e[0].toLowerCase();switch(e[0]){case"m":case"M":return u=e[1]+(i?u:0),h=e[2]+(i?h:0),c=u,void(l=h);case"h":case"H":return void(u=e[1]+(i?u:0));case"v":case"V":return void(h=e[1]+(i?h:0));case"z":case"Z":return u=c,void(h=l);default:u=e[e.length-2]+(i?u:0),h=e[e.length-1]+(i?h:0)}})),!a)return this;for(i=[],r=0;r{"use strict";var n=r(480),i={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},s=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,o=/[\s,]+/;t.exports=function(t){var e,r,a=new n;return t.split(s).forEach((function(t){if(t.length)if(void 0===i[t])switch(r=t.split(o).map((function(t){return+t||0})),e){case"matrix":return void(6===r.length&&a.matrix(r));case"scale":return void(1===r.length?a.scale(r[0],r[0]):2===r.length&&a.scale(r[0],r[1]));case"rotate":return void(1===r.length?a.rotate(r[0],0,0):3===r.length&&a.rotate(r[0],r[1],r[2]));case"translate":return void(1===r.length?a.translate(r[0],0):2===r.length&&a.translate(r[0],r[1]));case"skewX":return void(1===r.length&&a.skewX(r[0]));case"skewY":return void(1===r.length&&a.skewY(r[0]))}else e=t})),a}},197:(t,e,r)=>{"use strict";function n(t,e){return Array.isArray(e)?[t.a*e[0]+t.c*e[1]+t.e,t.b*e[0]+t.d*e[1]+t.f]:{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function i(t,e){return e.map((e=>n(t,e)))}function s(t){return{a:parseFloat(t.a),b:parseFloat(t.b),c:parseFloat(t.c),d:parseFloat(t.d),e:parseFloat(t.e),f:parseFloat(t.f)}}r.r(e),r.d(e,{applyToPoint:()=>n,applyToPoints:()=>i,compose:()=>m,fromDefinition:()=>C,fromObject:()=>s,fromString:()=>a,fromTransformAttribute:()=>T,fromTriangles:()=>I,identity:()=>u,inverse:()=>h,isAffineMatrix:()=>f,rotate:()=>b,rotateDEG:()=>w,scale:()=>M,shear:()=>x,skew:()=>S,skewDEG:()=>P,smoothMatrix:()=>k,toCSS:()=>A,toSVG:()=>O,toString:()=>E,transform:()=>p,translate:()=>d});const o=/^matrix\(\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*\)$/i;function a(t){const e=t.match(o);if(null===e||e.length<7)throw new Error(`'${t}' is not a matrix`);return{a:parseFloat(e[1]),b:parseFloat(e[2]),c:parseFloat(e[3]),d:parseFloat(e[4]),e:parseFloat(e[5]),f:parseFloat(e[6])}}function u(){return{a:1,c:0,e:0,b:0,d:1,f:0}}function h(t){const{a:e,b:r,c:n,d:i,e:s,f:o}=t,a=e*i-r*n;return{a:i/a,b:r/-a,c:n/-a,d:e/a,e:(i*s-n*o)/-a,f:(r*s-e*o)/a}}function c(t){return void 0===t}function l(t){return"number"==typeof t&&!Number.isNaN(t)&&Number.isFinite(t)}function f(t){return"object"==typeof(e=t)&&null!==e&&!Array.isArray(e)&&"a"in t&&l(t.a)&&"b"in t&&l(t.b)&&"c"in t&&l(t.c)&&"d"in t&&l(t.d)&&"e"in t&&l(t.e)&&"f"in t&&l(t.f);var e}function d(t,e=0){return{a:1,c:0,e:t,b:0,d:1,f:e}}function p(...t){const e=(t,e)=>({a:t.a*e.a+t.c*e.b,c:t.a*e.c+t.c*e.d,e:t.a*e.e+t.c*e.f+t.e,b:t.b*e.a+t.d*e.b,d:t.b*e.c+t.d*e.d,f:t.b*e.e+t.d*e.f+t.f});switch((t=Array.isArray(t[0])?t[0]:t).length){case 0:throw new Error("no matrices provided");case 1:return t[0];case 2:return e(t[0],t[1]);default:{const[r,n,...i]=t;return p(e(r,n),...i)}}}function m(...t){return p(...t)}const{cos:g,sin:v,PI:y}=Math;function b(t,e,r){const n=g(t),i=v(t),s={a:n,c:-i,e:0,b:i,d:n,f:0};return c(e)||c(r)?s:p([d(e,r),s,d(-e,-r)])}function w(t,e,r){return b(t*y/180,e,r)}function M(t,e,r,n){c(e)&&(e=t);const i={a:t,c:0,e:0,b:0,d:e,f:0};return c(r)||c(n)?i:p([d(r,n),i,d(-r,-n)])}function x(t,e){return{a:1,c:t,e:0,b:e,d:1,f:0}}const{tan:_}=Math;function S(t,e){return{a:1,c:_(t),e:0,b:_(e),d:1,f:0}}function P(t,e){return S(t*Math.PI/180,e*Math.PI/180)}function A(t){return E(t)}function O(t){return E(t)}function E(t){return`matrix(${t.a},${t.b},${t.c},${t.d},${t.e},${t.f})`}function k(t,e=1e10){return{a:Math.round(t.a*e)/e,b:Math.round(t.b*e)/e,c:Math.round(t.c*e)/e,d:Math.round(t.d*e)/e,e:Math.round(t.e*e)/e,f:Math.round(t.f*e)/e}}function I(t,e){const r=null!=t[0].x?t[0].x:t[0][0],n=null!=t[0].y?t[0].y:t[0][1],i=null!=e[0].x?e[0].x:e[0][0],s=null!=e[0].y?e[0].y:e[0][1],o=null!=t[1].x?t[1].x:t[1][0],a=null!=t[1].y?t[1].y:t[1][1],u=null!=e[1].x?e[1].x:e[1][0],c=null!=e[1].y?e[1].y:e[1][1],l=null!=t[2].x?t[2].x:t[2][0],f=null!=t[2].y?t[2].y:t[2][1],d=null!=e[2].x?e[2].x:e[2][0],m=null!=e[2].y?e[2].y:e[2][1];return k(p([{a:i-d,b:s-m,c:u-d,d:c-m,e:d,f:m},h({a:r-l,b:n-f,c:o-l,d:a-f,e:l,f})]))}function C(t){return Array.isArray(t)?t.map(e):e(t);function e(t){switch(t.type){case"matrix":if("a"in t&&"b"in t&&"c"in t&&"d"in t&&"e"in t&&"f"in t)return s(t);throw new Error("MISSING_MANDATORY_PARAM");case"translate":if(!("tx"in t))throw new Error("MISSING_MANDATORY_PARAM");return"ty"in t?d(t.tx,t.ty):d(t.tx);case"scale":if(!("sx"in t))throw new Error("MISSING_MANDATORY_PARAM");return"sy"in t?M(t.sx,t.sy):M(t.sx);case"rotate":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return"cx"in t&&"cy"in t?w(t.angle,t.cx,t.cy):w(t.angle);case"skewX":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return P(t.angle,0);case"skewY":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return P(0,t.angle);case"shear":if(!("shx"in t)||!("shy"in t))throw new Error("MISSING_MANDATORY_PARAM");return x(t.shx,t.shy);default:throw new Error("UNSUPPORTED_DESCRIPTOR")}}}function B(t,e,r,n){this.message=t,this.expected=e,this.found=r,this.location=n,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,B)}function R(t,e){e=void 0!==e?e:{};var r,n={},i={transformList:Z},s=Z,o="matrix",a="(",u=")",h="translate",c="scale",l="rotate",f="skewX",d="skewY",p=/^[eE]/,m=/^[+\-]/,g=/^[0-9]/,v=/^[ \t\r\n]/,y=j("matrix",!1),b=j("(",!1),w=j(")",!1),M=j("translate",!1),x=j("scale",!1),_=j("rotate",!1),S=j("skewX",!1),P=j("skewY",!1),A=j(",",!1),O={type:"other",description:"fractionalConstant"},E=D(["e","E"],!1,!1),k=D(["+","-"],!1,!1),I=D([["0","9"]],!1,!1),C=D([" ","\t","\r","\n"],!1,!1),R=0,T=[{line:1,column:1}],L=[],F=0;if("startRule"in e){if(!(e.startRule in i))throw new Error("Can't start parsing from rule \""+e.startRule+'".');s=i[e.startRule]}function j(t,e){return{type:"literal",text:t,ignoreCase:e}}function D(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function z(e){var r,n=T[e];if(n)return n;for(r=e-1;!T[r];)r--;for(n={line:(n=T[r]).line,column:n.column};r0;function Y(t,r){var n={};U&&(n.filename=e.filename);var i=z(t);n.start={offset:t,line:i.line,column:i.column};var s=z(r);return n.end={offset:r,line:s.line,column:s.column},n}function V(t){var e=L[L.length-1];Re.pos&&(e.pos=R,e.variants=[]),e.variants.push(t))}function Z(){var t,e,r,i;for(t=[],e=rt();e!==n;)t.push(e),e=rt();for((e=G())===n&&(e=null),r=[],i=rt();i!==n;)r.push(i),i=rt();return e}function G(){var t,e,r,i,s;if(t=R,(e=$())!==n){if(r=[],(i=W())!==n)for(;i!==n;)r.push(i),i=W();else r=n;r!==n&&(i=G())!==n?(s=i,t=e.concat(s)):(R=t,t=n)}else R=t,t=n;return t===n&&(t=$()),t}function $(){var e;return(e=function(){var e,r,i,s,h,c,l,f,d,p,m,g,v,M=function(t){0===F&&V(t)};if(e=R,M(y),t.substr(R,6)===o?(r=o,R+=6):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(M(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(h=[],c=rt();c!==n;)h.push(c),c=rt();if((c=X())!==n)if(W()!==n)if((l=X())!==n)if(W()!==n)if((f=X())!==n)if(W()!==n)if((d=X())!==n)if(W()!==n)if((p=X())!==n)if(W()!==n)if((m=X())!==n){for(g=[],v=rt();v!==n;)g.push(v),v=rt();M(w),41===t.charCodeAt(R)?(v=u,R++):v=n,v!==n?e=[{type:"matrix",a:c,b:l,c:f,d,e:p,f:m}]:(R=e,e=n)}else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n;else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,c,l,f,d,p,m,g=function(t){0===F&&V(t)};if(e=R,g(M),t.substr(R,9)===h?(r=h,R+=9):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(o=[],c=rt();c!==n;)o.push(c),c=rt();if((c=X())!==n){for((l=H())===n&&(l=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(w),41===t.charCodeAt(R)?(d=u,R++):d=n,d!==n?(m={type:"translate",tx:c},(p=l)&&(m.ty=p),e=[m]):(R=e,e=n)}else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,h,l,f,d,p,m,g=function(t){0===F&&V(t)};if(e=R,g(x),t.substr(R,5)===c?(r=c,R+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(o=[],h=rt();h!==n;)o.push(h),h=rt();if((h=X())!==n){for((l=H())===n&&(l=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(w),41===t.charCodeAt(R)?(d=u,R++):d=n,d!==n?(m={type:"scale",sx:h},(p=l)&&(m.sy=p),e=[m]):(R=e,e=n)}else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,h,c,f,d,p,m,g=function(t){0===F&&V(t)};if(e=R,g(_),t.substr(R,6)===l?(r=l,R+=6):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(g(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(o=[],h=rt();h!==n;)o.push(h),h=rt();if((h=X())!==n){for((c=function(){var t,e,r;return t=R,W()!==n&&(e=X())!==n&&W()!==n&&(r=X())!==n?t=[e,r]:(R=t,t=n),t}())===n&&(c=null),f=[],d=rt();d!==n;)f.push(d),d=rt();g(w),41===t.charCodeAt(R)?(d=u,R++):d=n,d!==n?(m={type:"rotate",angle:h},(p=c)&&(m.cx=p[0],m.cy=p[1]),e=[m]):(R=e,e=n)}else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,h,c,l,d=function(t){0===F&&V(t)};if(e=R,d(S),t.substr(R,5)===f?(r=f,R+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(d(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(o=[],h=rt();h!==n;)o.push(h),h=rt();if((h=X())!==n){for(c=[],l=rt();l!==n;)c.push(l),l=rt();d(w),41===t.charCodeAt(R)?(l=u,R++):l=n,l!==n?e=[{type:"skewX",angle:h}]:(R=e,e=n)}else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}())===n&&(e=function(){var e,r,i,s,o,h,c,l,f=function(t){0===F&&V(t)};if(e=R,f(P),t.substr(R,5)===d?(r=d,R+=5):r=n,r!==n){for(i=[],s=rt();s!==n;)i.push(s),s=rt();if(f(b),40===t.charCodeAt(R)?(s=a,R++):s=n,s!==n){for(o=[],h=rt();h!==n;)o.push(h),h=rt();if((h=X())!==n){for(c=[],l=rt();l!==n;)c.push(l),l=rt();f(w),41===t.charCodeAt(R)?(l=u,R++):l=n,l!==n?e=[{type:"skewY",angle:h}]:(R=e,e=n)}else R=e,e=n}else R=e,e=n}else R=e,e=n;return e}()),e}function X(){var e,r,i,s;return e=R,r=R,(i=K())===n&&(i=null),(s=function(){var e,r,i;return e=R,(r=function(){var e,r,i,s,o,a;return 0===F&&V(O),F++,e=R,(r=tt())===n&&(r=null),46===t.charCodeAt(R)?(i=".",R++):i=n,i!==n&&(s=tt())!==n?(a=s,e=[(o=r)?o.join(""):null,".",a.join("")].join("")):(R=e,e=n),e===n&&(e=R,(r=tt())!==n?(46===t.charCodeAt(R)?(i=".",R++):i=n,i!==n?e=r.join(""):(R=e,e=n)):(R=e,e=n)),F--,e}())!==n?((i=Q())===n&&(i=null),e=[r,i||null].join("")):(R=e,e=n),e===n&&(e=R,(r=tt())!==n&&(i=Q())!==n?e=[r,i].join(""):(R=e,e=n)),e}())!==n?r=i=[i,s]:(R=r,r=n),r!==n&&(r=parseFloat(r.join(""))),(e=r)===n&&(e=R,r=R,(i=K())===n&&(i=null),(s=function(){var t;return(t=tt())!==n&&(t=t.join("")),t}())!==n?r=i=[i,s]:(R=r,r=n),r!==n&&(r=parseInt(r.join(""))),e=r),e}function H(){var t,e;return t=R,W()!==n&&(e=X())!==n?t=e:(R=t,t=n),t}function W(){var t,e,r,i,s;if(t=R,e=[],(r=rt())!==n)for(;r!==n;)e.push(r),r=rt();else e=n;if(e!==n){for((r=J())===n&&(r=null),i=[],s=rt();s!==n;)i.push(s),s=rt();t=e=[e,r,i]}else R=t,t=n;if(t===n)if(t=R,(e=J())!==n){for(r=[],i=rt();i!==n;)r.push(i),i=rt();t=e=[e,r]}else R=t,t=n;return t}function J(){var e;return 0===F&&V(A),44===t.charCodeAt(R)?(e=",",R++):e=n,e}function Q(){var e,r,i,s;return e=R,0===F&&V(E),p.test(t.charAt(R))?(r=t.charAt(R),R++):r=n,r!==n?((i=K())===n&&(i=null),(s=tt())!==n?e=["e",i,s.join("")].join(""):(R=e,e=n)):(R=e,e=n),e}function K(){var e;return 0===F&&V(k),m.test(t.charAt(R))?(e=t.charAt(R),R++):e=n,e}function tt(){var t,e;if(t=[],(e=et())!==n)for(;e!==n;)t.push(e),e=et();else t=n;return t}function et(){var e;return 0===F&&V(I),g.test(t.charAt(R))?(e=t.charAt(R),R++):e=n,e}function rt(){var e;return 0===F&&V(C),v.test(t.charAt(R))?(e=t.charAt(R),R++):e=n,e}if(L.push({pos:R,variants:[]}),(r=s())!==n&&R===t.length)return r;throw r!==n&&R0){for(e=1,r=1;e{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(625)})()},3431:t=>{var e=.1,r="function"==typeof Float32Array;function n(t,e){return 1-3*e+3*t}function i(t,e){return 3*e-6*t}function s(t){return 3*t}function o(t,e,r){return((n(e,r)*t+i(e,r))*t+s(e))*t}function a(t,e,r){return 3*n(e,r)*t*t+2*i(e,r)*t+s(e)}function u(t){return t}t.exports=function(t,n,i,s){if(!(0<=t&&t<=1&&0<=i&&i<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===n&&i===s)return u;for(var h=r?new Float32Array(11):new Array(11),c=0;c<11;++c)h[c]=o(c*e,t,i);return function(r){return 0===r?0:1===r?1:o(function(r){for(var n=0,s=1;10!==s&&h[s]<=r;++s)n+=e;--s;var u=n+(r-h[s])/(h[s+1]-h[s])*e,c=a(u,t,i);return c>=.001?function(t,e,r,n){for(var i=0;i<4;++i){var s=a(e,r,n);if(0===s)return e;e-=(o(e,r,n)-t)/s}return e}(r,u,t,i):0===c?u:function(t,e,r,n,i){var s,a,u=0;do{(s=o(a=e+(r-e)/2,n,i)-t)>0?r=a:e=a}while(Math.abs(s)>1e-7&&++u<10);return a}(r,n,n+e,t,i)}(r),n,s)}}},292:(t,e,r)=>{const n=r(9850);e.parseFont=n,e.createCanvas=function(t,e){return Object.assign(document.createElement("canvas"),{width:t,height:e})},e.createImageData=function(t,e,r){switch(arguments.length){case 0:return new ImageData;case 1:return new ImageData(t);case 2:return new ImageData(t,e);default:return new ImageData(t,e,r)}},e.loadImage=function(t,e){return new Promise((function(r,n){const i=Object.assign(document.createElement("img"),e);function s(){i.onload=null,i.onerror=null}i.onload=function(){s(),r(i)},i.onerror=function(){s(),n(new Error('Failed to load the image "'+t+'"'))},i.src=t}))}},9850:t=>{"use strict";const e="'([^']+)'|\"([^\"]+)\"|[\\w\\s-]+",r=new RegExp("(bold|bolder|lighter|[1-9]00) +","i"),n=new RegExp("(italic|oblique) +","i"),i=new RegExp("(small-caps) +","i"),s=new RegExp("(ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded) +","i"),o=new RegExp("([\\d\\.]+)(px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q) *((?:"+e+")( *, *(?:"+e+"))*)"),a={};t.exports=function(t){if(a[t])return a[t];const e=o.exec(t);if(!e)return;const u={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(e[1]),unit:e[2],family:e[3].replace(/["']/g,"").replace(/ *, */g,",")};let h,c,l,f,d=t.substring(0,e.index);switch((h=r.exec(d))&&(u.weight=h[1]),(c=n.exec(d))&&(u.style=c[1]),(l=i.exec(d))&&(u.variant=l[1]),(f=s.exec(d))&&(u.stretch=f[1]),u.unit){case"pt":u.size/=.75;break;case"pc":u.size*=16;break;case"in":u.size*=96;break;case"cm":u.size*=96/2.54;break;case"mm":u.size*=96/25.4;break;case"%":break;case"em":case"rem":u.size*=16/.75;break;case"q":u.size*=96/25.4/4}return a[t]=u}},887:(t,e,r)=>{"use strict";r.r(e),r.d(e,{glMatrix:()=>n,mat2:()=>i,mat2d:()=>s,mat3:()=>o,mat4:()=>a,quat:()=>c,quat2:()=>l,vec2:()=>f,vec3:()=>u,vec4:()=>h});var n={};r.r(n),r.d(n,{ARRAY_TYPE:()=>p,EPSILON:()=>d,RANDOM:()=>m,equals:()=>b,setMatrixArrayType:()=>g,toRadian:()=>y});var i={};r.r(i),r.d(i,{LDU:()=>j,add:()=>D,adjoint:()=>E,clone:()=>M,copy:()=>x,create:()=>w,determinant:()=>k,equals:()=>N,exactEquals:()=>q,frob:()=>F,fromRotation:()=>R,fromScaling:()=>T,fromValues:()=>S,identity:()=>_,invert:()=>O,mul:()=>V,multiply:()=>I,multiplyScalar:()=>U,multiplyScalarAndAdd:()=>Y,rotate:()=>C,scale:()=>B,set:()=>P,str:()=>L,sub:()=>Z,subtract:()=>z,transpose:()=>A});var s={};r.r(s),r.d(s,{add:()=>ht,clone:()=>$,copy:()=>X,create:()=>G,determinant:()=>K,equals:()=>pt,exactEquals:()=>dt,frob:()=>ut,fromRotation:()=>it,fromScaling:()=>st,fromTranslation:()=>ot,fromValues:()=>W,identity:()=>H,invert:()=>Q,mul:()=>mt,multiply:()=>tt,multiplyScalar:()=>lt,multiplyScalarAndAdd:()=>ft,rotate:()=>et,scale:()=>rt,set:()=>J,str:()=>at,sub:()=>gt,subtract:()=>ct,translate:()=>nt});var o={};r.r(o),r.d(o,{add:()=>Nt,adjoint:()=>At,clone:()=>bt,copy:()=>wt,create:()=>vt,determinant:()=>Ot,equals:()=>Gt,exactEquals:()=>Zt,frob:()=>qt,fromMat2d:()=>Lt,fromMat4:()=>yt,fromQuat:()=>Ft,fromRotation:()=>Rt,fromScaling:()=>Tt,fromTranslation:()=>Bt,fromValues:()=>Mt,identity:()=>_t,invert:()=>Pt,mul:()=>$t,multiply:()=>Et,multiplyScalar:()=>Yt,multiplyScalarAndAdd:()=>Vt,normalFromMat4:()=>jt,projection:()=>Dt,rotate:()=>It,scale:()=>Ct,set:()=>xt,str:()=>zt,sub:()=>Xt,subtract:()=>Ut,translate:()=>kt,transpose:()=>St});var a={};r.r(a),r.d(a,{add:()=>Te,adjoint:()=>ne,clone:()=>Wt,copy:()=>Jt,create:()=>Ht,determinant:()=>ie,equals:()=>ze,exactEquals:()=>De,frob:()=>Re,fromQuat:()=>Pe,fromQuat2:()=>be,fromRotation:()=>pe,fromRotationTranslation:()=>ye,fromRotationTranslationScale:()=>_e,fromRotationTranslationScaleOrigin:()=>Se,fromScaling:()=>de,fromTranslation:()=>fe,fromValues:()=>Qt,fromXRotation:()=>me,fromYRotation:()=>ge,fromZRotation:()=>ve,frustum:()=>Ae,getRotation:()=>xe,getScaling:()=>Me,getTranslation:()=>we,identity:()=>te,invert:()=>re,lookAt:()=>Ie,mul:()=>qe,multiply:()=>se,multiplyScalar:()=>Fe,multiplyScalarAndAdd:()=>je,ortho:()=>ke,perspective:()=>Oe,perspectiveFromFieldOfView:()=>Ee,rotate:()=>ue,rotateX:()=>he,rotateY:()=>ce,rotateZ:()=>le,scale:()=>ae,set:()=>Kt,str:()=>Be,sub:()=>Ne,subtract:()=>Le,targetTo:()=>Ce,translate:()=>oe,transpose:()=>ee});var u={};r.r(u),r.d(u,{add:()=>Xe,angle:()=>_r,bezier:()=>mr,ceil:()=>Qe,clone:()=>Ye,copy:()=>Ge,create:()=>Ue,cross:()=>fr,dist:()=>Br,distance:()=>sr,div:()=>Cr,divide:()=>Je,dot:()=>lr,equals:()=>Or,exactEquals:()=>Ar,floor:()=>Ke,forEach:()=>Fr,fromValues:()=>Ze,hermite:()=>pr,inverse:()=>hr,len:()=>Tr,length:()=>Ve,lerp:()=>dr,max:()=>er,min:()=>tr,mul:()=>Ir,multiply:()=>We,negate:()=>ur,normalize:()=>cr,random:()=>gr,rotateX:()=>wr,rotateY:()=>Mr,rotateZ:()=>xr,round:()=>rr,scale:()=>nr,scaleAndAdd:()=>ir,set:()=>$e,sqrDist:()=>Rr,sqrLen:()=>Lr,squaredDistance:()=>or,squaredLength:()=>ar,str:()=>Pr,sub:()=>kr,subtract:()=>He,transformMat3:()=>yr,transformMat4:()=>vr,transformQuat:()=>br,zero:()=>Sr});var h={};r.r(h),r.d(h,{add:()=>Ur,ceil:()=>Gr,clone:()=>Dr,copy:()=>qr,create:()=>jr,cross:()=>un,dist:()=>wn,distance:()=>Kr,div:()=>bn,divide:()=>Zr,dot:()=>an,equals:()=>gn,exactEquals:()=>mn,floor:()=>$r,forEach:()=>Sn,fromValues:()=>zr,inverse:()=>sn,len:()=>xn,length:()=>en,lerp:()=>hn,max:()=>Hr,min:()=>Xr,mul:()=>yn,multiply:()=>Vr,negate:()=>nn,normalize:()=>on,random:()=>cn,round:()=>Wr,scale:()=>Jr,scaleAndAdd:()=>Qr,set:()=>Nr,sqrDist:()=>Mn,sqrLen:()=>_n,squaredDistance:()=>tn,squaredLength:()=>rn,str:()=>pn,sub:()=>vn,subtract:()=>Yr,transformMat4:()=>ln,transformQuat:()=>fn,zero:()=>dn});var c={};r.r(c),r.d(c,{add:()=>ei,calculateW:()=>Tn,clone:()=>Jn,conjugate:()=>Nn,copy:()=>Kn,create:()=>Pn,dot:()=>ii,equals:()=>fi,exactEquals:()=>li,exp:()=>Ln,fromEuler:()=>Yn,fromMat3:()=>Un,fromValues:()=>Qn,getAngle:()=>kn,getAxisAngle:()=>En,identity:()=>An,invert:()=>qn,len:()=>ai,length:()=>oi,lerp:()=>si,ln:()=>Fn,mul:()=>ri,multiply:()=>In,normalize:()=>ci,pow:()=>jn,random:()=>zn,rotateX:()=>Cn,rotateY:()=>Bn,rotateZ:()=>Rn,rotationTo:()=>di,scale:()=>ni,set:()=>ti,setAxes:()=>mi,setAxisAngle:()=>On,slerp:()=>Dn,sqlerp:()=>pi,sqrLen:()=>hi,squaredLength:()=>ui,str:()=>Vn});var l={};r.r(l),r.d(l,{add:()=>zi,clone:()=>vi,conjugate:()=>Gi,copy:()=>Si,create:()=>gi,dot:()=>Yi,equals:()=>ts,exactEquals:()=>Ki,fromMat4:()=>_i,fromRotation:()=>xi,fromRotationTranslation:()=>wi,fromRotationTranslationValues:()=>bi,fromTranslation:()=>Mi,fromValues:()=>yi,getDual:()=>Ei,getReal:()=>Oi,getTranslation:()=>Ci,identity:()=>Pi,invert:()=>Zi,len:()=>Xi,length:()=>$i,lerp:()=>Vi,mul:()=>Ni,multiply:()=>qi,normalize:()=>Ji,rotateAroundAxis:()=>Di,rotateByQuatAppend:()=>Fi,rotateByQuatPrepend:()=>ji,rotateX:()=>Ri,rotateY:()=>Ti,rotateZ:()=>Li,scale:()=>Ui,set:()=>Ai,setDual:()=>Ii,setReal:()=>ki,sqrLen:()=>Wi,squaredLength:()=>Hi,str:()=>Qi,translate:()=>Bi});var f={};r.r(f),r.d(f,{add:()=>os,angle:()=>Rs,ceil:()=>cs,clone:()=>rs,copy:()=>is,create:()=>es,cross:()=>Ps,dist:()=>Us,distance:()=>vs,div:()=>Ns,divide:()=>hs,dot:()=>Ss,equals:()=>js,exactEquals:()=>Fs,floor:()=>ls,forEach:()=>Zs,fromValues:()=>ns,inverse:()=>xs,len:()=>Ds,length:()=>bs,lerp:()=>As,max:()=>ds,min:()=>fs,mul:()=>qs,multiply:()=>us,negate:()=>Ms,normalize:()=>_s,random:()=>Os,rotate:()=>Bs,round:()=>ps,scale:()=>ms,scaleAndAdd:()=>gs,set:()=>ss,sqrDist:()=>Ys,sqrLen:()=>Vs,squaredDistance:()=>ys,squaredLength:()=>ws,str:()=>Ls,sub:()=>zs,subtract:()=>as,transformMat2:()=>Es,transformMat2d:()=>ks,transformMat3:()=>Is,transformMat4:()=>Cs,zero:()=>Ts});var d=1e-6,p="undefined"!=typeof Float32Array?Float32Array:Array,m=Math.random;function g(t){p=t}var v=Math.PI/180;function y(t){return t*v}function b(t,e){return Math.abs(t-e)<=d*Math.max(1,Math.abs(t),Math.abs(e))}function w(){var t=new p(4);return p!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function M(t){var e=new p(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function x(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function _(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function S(t,e,r,n){var i=new p(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function P(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function A(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function O(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*s-i*n;return o?(o=1/o,t[0]=s*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}function E(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function k(t){return t[0]*t[3]-t[2]*t[1]}function I(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*a+s*u,t[1]=i*a+o*u,t[2]=n*h+s*c,t[3]=i*h+o*c,t}function C(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u+s*a,t[1]=i*u+o*a,t[2]=n*-a+s*u,t[3]=i*-a+o*u,t}function B(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1];return t[0]=n*a,t[1]=i*a,t[2]=s*u,t[3]=o*u,t}function R(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function T(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function L(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function F(t){return Math.hypot(t[0],t[1],t[2],t[3])}function j(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function D(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function z(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function q(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function N(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=e[0],a=e[1],u=e[2],h=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(s-h)<=d*Math.max(1,Math.abs(s),Math.abs(h))}function U(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Y(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var V=I,Z=z;function G(){var t=new p(6);return p!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function $(t){var e=new p(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function X(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function H(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function W(t,e,r,n,i,s){var o=new p(6);return o[0]=t,o[1]=e,o[2]=r,o[3]=n,o[4]=i,o[5]=s,o}function J(t,e,r,n,i,s,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t}function Q(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=r*s-n*i;return u?(u=1/u,t[0]=s*u,t[1]=-n*u,t[2]=-i*u,t[3]=r*u,t[4]=(i*a-s*o)*u,t[5]=(n*o-r*a)*u,t):null}function K(t){return t[0]*t[3]-t[1]*t[2]}function tt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=r[0],c=r[1],l=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*h+s*c,t[1]=i*h+o*c,t[2]=n*l+s*f,t[3]=i*l+o*f,t[4]=n*d+s*p+a,t[5]=i*d+o*p+u,t}function et(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*h,t[1]=i*c+o*h,t[2]=n*-h+s*c,t[3]=i*-h+o*c,t[4]=a,t[5]=u,t}function rt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=r[0],c=r[1];return t[0]=n*h,t[1]=i*h,t[2]=s*c,t[3]=o*c,t[4]=a,t[5]=u,t}function nt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=n*h+s*c+a,t[5]=i*h+o*c+u,t}function it(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function st(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function ot(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function at(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function ut(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function ht(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function ct(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function lt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function ft(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function dt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function pt(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],u=e[0],h=e[1],c=e[2],l=e[3],f=e[4],p=e[5];return Math.abs(r-u)<=d*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-h)<=d*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-c)<=d*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(s-l)<=d*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(o-f)<=d*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-p)<=d*Math.max(1,Math.abs(a),Math.abs(p))}var mt=tt,gt=ct;function vt(){var t=new p(9);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function bt(t){var e=new p(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function wt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Mt(t,e,r,n,i,s,o,a,u){var h=new p(9);return h[0]=t,h[1]=e,h[2]=r,h[3]=n,h[4]=i,h[5]=s,h[6]=o,h[7]=a,h[8]=u,h}function xt(t,e,r,n,i,s,o,a,u,h){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=u,t[8]=h,t}function _t(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function St(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function Pt(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=c*o-a*h,f=-c*s+a*u,d=h*s-o*u,p=r*l+n*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-c*n+i*h)*p,t[2]=(a*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*u)*p,t[5]=(-a*r+i*s)*p,t[6]=d*p,t[7]=(-h*r+n*u)*p,t[8]=(o*r-n*s)*p,t):null}function At(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8];return t[0]=o*c-a*h,t[1]=i*h-n*c,t[2]=n*a-i*o,t[3]=a*u-s*c,t[4]=r*c-i*u,t[5]=i*s-r*a,t[6]=s*h-o*u,t[7]=n*u-r*h,t[8]=r*o-n*s,t}function Ot(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],u=t[7],h=t[8];return e*(h*s-o*u)+r*(-h*i+o*a)+n*(u*i-s*a)}function Et(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=r[0],d=r[1],p=r[2],m=r[3],g=r[4],v=r[5],y=r[6],b=r[7],w=r[8];return t[0]=f*n+d*o+p*h,t[1]=f*i+d*a+p*c,t[2]=f*s+d*u+p*l,t[3]=m*n+g*o+v*h,t[4]=m*i+g*a+v*c,t[5]=m*s+g*u+v*l,t[6]=y*n+b*o+w*h,t[7]=y*i+b*a+w*c,t[8]=y*s+b*u+w*l,t}function kt(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=u,t[6]=f*n+d*o+h,t[7]=f*i+d*a+c,t[8]=f*s+d*u+l,t}function It(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*a,t[2]=d*s+f*u,t[3]=d*o-f*n,t[4]=d*a-f*i,t[5]=d*u-f*s,t[6]=h,t[7]=c,t[8]=l,t}function Ct(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Bt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function Rt(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Tt(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Lt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function Ft(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,u=i+i,h=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*u,m=s*o,g=s*a,v=s*u;return t[0]=1-l-p,t[3]=c-v,t[6]=f+g,t[1]=c+v,t[4]=1-h-p,t[7]=d-m,t[2]=f-g,t[5]=d+m,t[8]=1-h-l,t}function jt(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*u-i*o,w=r*h-s*o,M=n*u-i*a,x=n*h-s*a,_=i*h-s*u,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,O=l*g-f*m,E=l*v-d*m,k=f*v-d*g,I=y*k-b*E+w*O+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-u*E+h*O)*I,t[1]=(u*A-o*k-h*P)*I,t[2]=(o*E-a*A+h*S)*I,t[3]=(i*E-n*k-s*O)*I,t[4]=(r*k-i*A+s*P)*I,t[5]=(n*A-r*E-s*S)*I,t[6]=(m*_-g*x+v*M)*I,t[7]=(g*w-p*_-v*b)*I,t[8]=(p*x-m*w+v*y)*I,t):null}function Dt(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function zt(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function qt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Nt(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function Ut(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function Yt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function Vt(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function Zt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function Gt(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],u=t[6],h=t[7],c=t[8],l=e[0],f=e[1],p=e[2],m=e[3],g=e[4],v=e[5],y=e[6],b=e[7],w=e[8];return Math.abs(r-l)<=d*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(n-f)<=d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-p)<=d*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(s-m)<=d*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(o-g)<=d*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(a-v)<=d*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(u-y)<=d*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(h-b)<=d*Math.max(1,Math.abs(h),Math.abs(b))&&Math.abs(c-w)<=d*Math.max(1,Math.abs(c),Math.abs(w))}var $t=Et,Xt=Ut;function Ht(){var t=new p(16);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Wt(t){var e=new p(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Jt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Qt(t,e,r,n,i,s,o,a,u,h,c,l,f,d,m,g){var v=new p(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=n,v[4]=i,v[5]=s,v[6]=o,v[7]=a,v[8]=u,v[9]=h,v[10]=c,v[11]=l,v[12]=f,v[13]=d,v[14]=m,v[15]=g,v}function Kt(t,e,r,n,i,s,o,a,u,h,c,l,f,d,p,m,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=u,t[8]=h,t[9]=c,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=g,t}function te(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ee(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=i,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function re(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*a-n*o,b=r*u-i*o,w=r*h-s*o,M=n*u-i*a,x=n*h-s*a,_=i*h-s*u,S=c*m-l*p,P=c*g-f*p,A=c*v-d*p,O=l*g-f*m,E=l*v-d*m,k=f*v-d*g,I=y*k-b*E+w*O+M*A-x*P+_*S;return I?(I=1/I,t[0]=(a*k-u*E+h*O)*I,t[1]=(i*E-n*k-s*O)*I,t[2]=(m*_-g*x+v*M)*I,t[3]=(f*x-l*_-d*M)*I,t[4]=(u*A-o*k-h*P)*I,t[5]=(r*k-i*A+s*P)*I,t[6]=(g*w-p*_-v*b)*I,t[7]=(c*_-f*w+d*b)*I,t[8]=(o*E-a*A+h*S)*I,t[9]=(n*A-r*E-s*S)*I,t[10]=(p*x-m*w+v*y)*I,t[11]=(l*w-c*x-d*y)*I,t[12]=(a*P-o*O-u*S)*I,t[13]=(r*O-n*P+i*S)*I,t[14]=(m*b-p*M-g*y)*I,t[15]=(c*M-l*b+f*y)*I,t):null}function ne(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15];return t[0]=a*(f*v-d*g)-l*(u*v-h*g)+m*(u*d-h*f),t[1]=-(n*(f*v-d*g)-l*(i*v-s*g)+m*(i*d-s*f)),t[2]=n*(u*v-h*g)-a*(i*v-s*g)+m*(i*h-s*u),t[3]=-(n*(u*d-h*f)-a*(i*d-s*f)+l*(i*h-s*u)),t[4]=-(o*(f*v-d*g)-c*(u*v-h*g)+p*(u*d-h*f)),t[5]=r*(f*v-d*g)-c*(i*v-s*g)+p*(i*d-s*f),t[6]=-(r*(u*v-h*g)-o*(i*v-s*g)+p*(i*h-s*u)),t[7]=r*(u*d-h*f)-o*(i*d-s*f)+c*(i*h-s*u),t[8]=o*(l*v-d*m)-c*(a*v-h*m)+p*(a*d-h*l),t[9]=-(r*(l*v-d*m)-c*(n*v-s*m)+p*(n*d-s*l)),t[10]=r*(a*v-h*m)-o*(n*v-s*m)+p*(n*h-s*a),t[11]=-(r*(a*d-h*l)-o*(n*d-s*l)+c*(n*h-s*a)),t[12]=-(o*(l*g-f*m)-c*(a*g-u*m)+p*(a*f-u*l)),t[13]=r*(l*g-f*m)-c*(n*g-i*m)+p*(n*f-i*l),t[14]=-(r*(a*g-u*m)-o*(n*g-i*m)+p*(n*u-i*a)),t[15]=r*(a*f-u*l)-o*(n*f-i*l)+c*(n*u-i*a),t}function ie(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],a=t[6],u=t[7],h=t[8],c=t[9],l=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*s)*(l*g-f*m)-(e*a-n*s)*(c*g-f*p)+(e*u-i*s)*(c*m-l*p)+(r*a-n*o)*(h*g-f*d)-(r*u-i*o)*(h*m-l*d)+(n*u-i*a)*(h*p-c*d)}function se(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],v=e[14],y=e[15],b=r[0],w=r[1],M=r[2],x=r[3];return t[0]=b*n+w*a+M*l+x*m,t[1]=b*i+w*u+M*f+x*g,t[2]=b*s+w*h+M*d+x*v,t[3]=b*o+w*c+M*p+x*y,b=r[4],w=r[5],M=r[6],x=r[7],t[4]=b*n+w*a+M*l+x*m,t[5]=b*i+w*u+M*f+x*g,t[6]=b*s+w*h+M*d+x*v,t[7]=b*o+w*c+M*p+x*y,b=r[8],w=r[9],M=r[10],x=r[11],t[8]=b*n+w*a+M*l+x*m,t[9]=b*i+w*u+M*f+x*g,t[10]=b*s+w*h+M*d+x*v,t[11]=b*o+w*c+M*p+x*y,b=r[12],w=r[13],M=r[14],x=r[15],t[12]=b*n+w*a+M*l+x*m,t[13]=b*i+w*u+M*f+x*g,t[14]=b*s+w*h+M*d+x*v,t[15]=b*o+w*c+M*p+x*y,t}function oe(t,e,r){var n,i,s,o,a,u,h,c,l,f,d,p,m=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=a,t[5]=u,t[6]=h,t[7]=c,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+a*g+l*v+e[12],t[13]=i*m+u*g+f*v+e[13],t[14]=s*m+h*g+d*v+e[14],t[15]=o*m+c*g+p*v+e[15]),t}function ae(t,e,r){var n=r[0],i=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ue(t,e,r,n){var i,s,o,a,u,h,c,l,f,p,m,g,v,y,b,w,M,x,_,S,P,A,O,E,k=n[0],I=n[1],C=n[2],B=Math.hypot(k,I,C);return B0?(r[0]=2*(a*o+c*n+u*s-h*i)/l,r[1]=2*(u*o+c*i+h*n-a*s)/l,r[2]=2*(h*o+c*s+a*i-u*n)/l):(r[0]=2*(a*o+c*n+u*s-h*i),r[1]=2*(u*o+c*i+h*n-a*s),r[2]=2*(h*o+c*s+a*i-u*n)),ye(t,e,r),t}function we(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Me(t,e){var r=e[0],n=e[1],i=e[2],s=e[4],o=e[5],a=e[6],u=e[8],h=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(s,o,a),t[2]=Math.hypot(u,h,c),t}function xe(t,e){var r=new p(3);Me(r,e);var n=1/r[0],i=1/r[1],s=1/r[2],o=e[0]*n,a=e[1]*i,u=e[2]*s,h=e[4]*n,c=e[5]*i,l=e[6]*s,f=e[8]*n,d=e[9]*i,m=e[10]*s,g=o+c+m,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(l-d)/v,t[1]=(f-u)/v,t[2]=(a-h)/v):o>c&&o>m?(v=2*Math.sqrt(1+o-c-m),t[3]=(l-d)/v,t[0]=.25*v,t[1]=(a+h)/v,t[2]=(f+u)/v):c>m?(v=2*Math.sqrt(1+c-o-m),t[3]=(f-u)/v,t[0]=(a+h)/v,t[1]=.25*v,t[2]=(l+d)/v):(v=2*Math.sqrt(1+m-o-c),t[3]=(a-h)/v,t[0]=(f+u)/v,t[1]=(l+d)/v,t[2]=.25*v),t}function _e(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3],u=i+i,h=s+s,c=o+o,l=i*u,f=i*h,d=i*c,p=s*h,m=s*c,g=o*c,v=a*u,y=a*h,b=a*c,w=n[0],M=n[1],x=n[2];return t[0]=(1-(p+g))*w,t[1]=(f+b)*w,t[2]=(d-y)*w,t[3]=0,t[4]=(f-b)*M,t[5]=(1-(l+g))*M,t[6]=(m+v)*M,t[7]=0,t[8]=(d+y)*x,t[9]=(m-v)*x,t[10]=(1-(l+p))*x,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function Se(t,e,r,n,i){var s=e[0],o=e[1],a=e[2],u=e[3],h=s+s,c=o+o,l=a+a,f=s*h,d=s*c,p=s*l,m=o*c,g=o*l,v=a*l,y=u*h,b=u*c,w=u*l,M=n[0],x=n[1],_=n[2],S=i[0],P=i[1],A=i[2],O=(1-(m+v))*M,E=(d+w)*M,k=(p-b)*M,I=(d-w)*x,C=(1-(f+v))*x,B=(g+y)*x,R=(p+b)*_,T=(g-y)*_,L=(1-(f+m))*_;return t[0]=O,t[1]=E,t[2]=k,t[3]=0,t[4]=I,t[5]=C,t[6]=B,t[7]=0,t[8]=R,t[9]=T,t[10]=L,t[11]=0,t[12]=r[0]+S-(O*S+I*P+R*A),t[13]=r[1]+P-(E*S+C*P+T*A),t[14]=r[2]+A-(k*S+B*P+L*A),t[15]=1,t}function Pe(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,a=n+n,u=i+i,h=r*o,c=n*o,l=n*a,f=i*o,d=i*a,p=i*u,m=s*o,g=s*a,v=s*u;return t[0]=1-l-p,t[1]=c+v,t[2]=f-g,t[3]=0,t[4]=c-v,t[5]=1-h-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-h-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ae(t,e,r,n,i,s,o){var a=1/(r-e),u=1/(i-n),h=1/(s-o);return t[0]=2*s*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*u,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*u,t[10]=(o+s)*h,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*h,t[15]=0,t}function Oe(t,e,r,n,i){var s,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(s=1/(n-i),t[10]=(i+n)*s,t[14]=2*i*n*s):(t[10]=-1,t[14]=-2*n),t}function Ee(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),u=2/(o+a),h=2/(i+s);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=h,t[6]=0,t[7]=0,t[8]=-(o-a)*u*.5,t[9]=(i-s)*h*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function ke(t,e,r,n,i,s,o){var a=1/(e-r),u=1/(n-i),h=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*u,t[14]=(o+s)*h,t[15]=1,t}function Ie(t,e,r,n){var i,s,o,a,u,h,c,l,f,p,m=e[0],g=e[1],v=e[2],y=n[0],b=n[1],w=n[2],M=r[0],x=r[1],_=r[2];return Math.abs(m-M)0&&(c*=d=1/Math.sqrt(d),l*=d,f*=d);var p=u*f-h*l,m=h*c-a*f,g=a*l-u*c;return(d=p*p+m*m+g*g)>0&&(p*=d=1/Math.sqrt(d),m*=d,g*=d),t[0]=p,t[1]=m,t[2]=g,t[3]=0,t[4]=l*g-f*m,t[5]=f*p-c*g,t[6]=c*m-l*p,t[7]=0,t[8]=c,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=s,t[14]=o,t[15]=1,t}function Be(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Re(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Te(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Le(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function Fe(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function je(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function De(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function ze(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],u=t[6],h=t[7],c=t[8],l=t[9],f=t[10],p=t[11],m=t[12],g=t[13],v=t[14],y=t[15],b=e[0],w=e[1],M=e[2],x=e[3],_=e[4],S=e[5],P=e[6],A=e[7],O=e[8],E=e[9],k=e[10],I=e[11],C=e[12],B=e[13],R=e[14],T=e[15];return Math.abs(r-b)<=d*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-w)<=d*Math.max(1,Math.abs(n),Math.abs(w))&&Math.abs(i-M)<=d*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(s-x)<=d*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(o-_)<=d*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(a-S)<=d*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(u-P)<=d*Math.max(1,Math.abs(u),Math.abs(P))&&Math.abs(h-A)<=d*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(c-O)<=d*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(l-E)<=d*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(f-k)<=d*Math.max(1,Math.abs(f),Math.abs(k))&&Math.abs(p-I)<=d*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(m-C)<=d*Math.max(1,Math.abs(m),Math.abs(C))&&Math.abs(g-B)<=d*Math.max(1,Math.abs(g),Math.abs(B))&&Math.abs(v-R)<=d*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(y-T)<=d*Math.max(1,Math.abs(y),Math.abs(T))}var qe=se,Ne=Le;function Ue(){var t=new p(3);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ye(t){var e=new p(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Ve(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function Ze(t,e,r){var n=new p(3);return n[0]=t,n[1]=e,n[2]=r,n}function Ge(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function $e(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function Xe(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function He(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function We(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function Je(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function Qe(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Ke(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function tr(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function er(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function rr(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function nr(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function ir(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function sr(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function or(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function ar(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function ur(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function hr(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function cr(t,e){var r=e[0],n=e[1],i=e[2],s=r*r+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function lr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function fr(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],u=r[2];return t[0]=i*u-s*a,t[1]=s*o-n*u,t[2]=n*a-i*o,t}function dr(t,e,r,n){var i=e[0],s=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t}function pr(t,e,r,n,i,s){var o=s*s,a=o*(2*s-3)+1,u=o*(s-2)+s,h=o*(s-1),c=o*(3-2*s);return t[0]=e[0]*a+r[0]*u+n[0]*h+i[0]*c,t[1]=e[1]*a+r[1]*u+n[1]*h+i[1]*c,t[2]=e[2]*a+r[2]*u+n[2]*h+i[2]*c,t}function mr(t,e,r,n,i,s){var o=1-s,a=o*o,u=s*s,h=a*o,c=3*s*a,l=3*u*o,f=u*s;return t[0]=e[0]*h+r[0]*c+n[0]*l+i[0]*f,t[1]=e[1]*h+r[1]*c+n[1]*l+i[1]*f,t[2]=e[2]*h+r[2]*c+n[2]*l+i[2]*f,t}function gr(t,e){e=e||1;var r=2*m()*Math.PI,n=2*m()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}function vr(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[3]*n+r[7]*i+r[11]*s+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*s+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*s+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*s+r[14])/o,t}function yr(t,e,r){var n=e[0],i=e[1],s=e[2];return t[0]=n*r[0]+i*r[3]+s*r[6],t[1]=n*r[1]+i*r[4]+s*r[7],t[2]=n*r[2]+i*r[5]+s*r[8],t}function br(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],u=e[1],h=e[2],c=i*h-s*u,l=s*a-n*h,f=n*u-i*a,d=i*f-s*l,p=s*c-n*f,m=n*l-i*c,g=2*o;return c*=g,l*=g,f*=g,d*=2,p*=2,m*=2,t[0]=a+c+d,t[1]=u+l+p,t[2]=h+f+m,t}function wr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0],s[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),s[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function Mr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),s[1]=i[1],s[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function xr(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),s[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),s[2]=i[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function _r(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2],u=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(s*s+o*o+a*a),h=u&&lr(t,e)/u;return Math.acos(Math.min(Math.max(h,-1),1))}function Sr(t){return t[0]=0,t[1]=0,t[2]=0,t}function Pr(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function Ar(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Or(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],o=e[1],a=e[2];return Math.abs(r-s)<=d*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-o)<=d*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=d*Math.max(1,Math.abs(i),Math.abs(a))}var Er,kr=He,Ir=We,Cr=Je,Br=sr,Rr=or,Tr=Ve,Lr=ar,Fr=(Er=Ue(),function(t,e,r,n,i,s){var o,a;for(e||(e=3),r||(r=0),a=n?Math.min(n*e+r,t.length):t.length,o=r;o0&&(o=1/Math.sqrt(o)),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=s*o,t}function an(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function un(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],s=r[0]*n[2]-r[2]*n[0],o=r[0]*n[3]-r[3]*n[0],a=r[1]*n[2]-r[2]*n[1],u=r[1]*n[3]-r[3]*n[1],h=r[2]*n[3]-r[3]*n[2],c=e[0],l=e[1],f=e[2],d=e[3];return t[0]=l*h-f*u+d*a,t[1]=-c*h+f*o-d*s,t[2]=c*u-l*o+d*i,t[3]=-c*a+l*s-f*i,t}function hn(t,e,r,n){var i=e[0],s=e[1],o=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=o+n*(r[2]-o),t[3]=a+n*(r[3]-a),t}function cn(t,e){var r,n,i,s,o,a;e=e||1;do{o=(r=2*m()-1)*r+(n=2*m()-1)*n}while(o>=1);do{a=(i=2*m()-1)*i+(s=2*m()-1)*s}while(a>=1);var u=Math.sqrt((1-o)/a);return t[0]=e*r,t[1]=e*n,t[2]=e*i*u,t[3]=e*s*u,t}function ln(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*s+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*s+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*s+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*s+r[15]*o,t}function fn(t,e,r){var n=e[0],i=e[1],s=e[2],o=r[0],a=r[1],u=r[2],h=r[3],c=h*n+a*s-u*i,l=h*i+u*n-o*s,f=h*s+o*i-a*n,d=-o*n-a*i-u*s;return t[0]=c*h+d*-o+l*-u-f*-a,t[1]=l*h+d*-a+f*-o-c*-u,t[2]=f*h+d*-u+c*-a-l*-o,t[3]=e[3],t}function dn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function pn(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function mn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function gn(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=e[0],a=e[1],u=e[2],h=e[3];return Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(s-h)<=d*Math.max(1,Math.abs(s),Math.abs(h))}var vn=Yr,yn=Vr,bn=Zr,wn=Kr,Mn=tn,xn=en,_n=rn,Sn=function(){var t=jr();return function(e,r,n,i,s,o){var a,u;for(r||(r=4),n||(n=0),u=i?Math.min(i*r+n,e.length):e.length,a=n;ad?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r}function kn(t,e){var r=ii(t,e);return Math.acos(2*r*r-1)}function In(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*c+o*a+i*h-s*u,t[1]=i*c+o*u+s*a-n*h,t[2]=s*c+o*h+n*u-i*a,t[3]=o*c-n*a-i*u-s*h,t}function Cn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u+o*a,t[1]=i*u+s*a,t[2]=s*u-i*a,t[3]=o*u-n*a,t}function Bn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u-s*a,t[1]=i*u+o*a,t[2]=s*u+n*a,t[3]=o*u-i*a,t}function Rn(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],o=e[3],a=Math.sin(r),u=Math.cos(r);return t[0]=n*u+i*a,t[1]=i*u-n*a,t[2]=s*u+o*a,t[3]=o*u-s*a,t}function Tn(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function Ln(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=Math.exp(s),u=o>0?a*Math.sin(o)/o:0;return t[0]=r*u,t[1]=n*u,t[2]=i*u,t[3]=a*Math.cos(o),t}function Fn(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sqrt(r*r+n*n+i*i),a=o>0?Math.atan2(o,s)/o:0;return t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=.5*Math.log(r*r+n*n+i*i+s*s),t}function jn(t,e,r){return Fn(t,e),ni(t,t,r),Ln(t,t),t}function Dn(t,e,r,n){var i,s,o,a,u,h=e[0],c=e[1],l=e[2],f=e[3],p=r[0],m=r[1],g=r[2],v=r[3];return(s=h*p+c*m+l*g+f*v)<0&&(s=-s,p=-p,m=-m,g=-g,v=-v),1-s>d?(i=Math.acos(s),o=Math.sin(i),a=Math.sin((1-n)*i)/o,u=Math.sin(n*i)/o):(a=1-n,u=n),t[0]=a*h+u*p,t[1]=a*c+u*m,t[2]=a*l+u*g,t[3]=a*f+u*v,t}function zn(t){var e=m(),r=m(),n=m(),i=Math.sqrt(1-e),s=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*r),t[1]=i*Math.cos(2*Math.PI*r),t[2]=s*Math.sin(2*Math.PI*n),t[3]=s*Math.cos(2*Math.PI*n),t}function qn(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],o=r*r+n*n+i*i+s*s,a=o?1/o:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=s*a,t}function Nn(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Un(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var s=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*s+s]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*s+o]-e[3*o+s])*r,t[s]=(e[3*s+i]+e[3*i+s])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t}function Yn(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var s=Math.sin(e),o=Math.cos(e),a=Math.sin(r),u=Math.cos(r),h=Math.sin(n),c=Math.cos(n);return t[0]=s*u*c-o*a*h,t[1]=o*a*c+s*u*h,t[2]=o*u*h-s*a*c,t[3]=o*u*c+s*a*h,t}function Vn(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var Zn,Gn,$n,Xn,Hn,Wn,Jn=Dr,Qn=zr,Kn=qr,ti=Nr,ei=Ur,ri=In,ni=Jr,ii=an,si=hn,oi=en,ai=oi,ui=rn,hi=ui,ci=on,li=mn,fi=gn,di=(Zn=Ue(),Gn=Ze(1,0,0),$n=Ze(0,1,0),function(t,e,r){var n=lr(e,r);return n<-.999999?(fr(Zn,Gn,e),Tr(Zn)<1e-6&&fr(Zn,$n,e),cr(Zn,Zn),On(t,Zn,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(fr(Zn,e,r),t[0]=Zn[0],t[1]=Zn[1],t[2]=Zn[2],t[3]=1+n,ci(t,t))}),pi=(Xn=Pn(),Hn=Pn(),function(t,e,r,n,i,s){return Dn(Xn,e,i,s),Dn(Hn,r,n,s),Dn(t,Xn,Hn,2*s*(1-s)),t}),mi=(Wn=vt(),function(t,e,r,n){return Wn[0]=r[0],Wn[3]=r[1],Wn[6]=r[2],Wn[1]=n[0],Wn[4]=n[1],Wn[7]=n[2],Wn[2]=-e[0],Wn[5]=-e[1],Wn[8]=-e[2],ci(t,Un(t,Wn))});function gi(){var t=new p(8);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function vi(t){var e=new p(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function yi(t,e,r,n,i,s,o,a){var u=new p(8);return u[0]=t,u[1]=e,u[2]=r,u[3]=n,u[4]=i,u[5]=s,u[6]=o,u[7]=a,u}function bi(t,e,r,n,i,s,o){var a=new p(8);a[0]=t,a[1]=e,a[2]=r,a[3]=n;var u=.5*i,h=.5*s,c=.5*o;return a[4]=u*n+h*r-c*e,a[5]=h*n+c*t-u*r,a[6]=c*n+u*e-h*t,a[7]=-u*t-h*e-c*r,a}function wi(t,e,r){var n=.5*r[0],i=.5*r[1],s=.5*r[2],o=e[0],a=e[1],u=e[2],h=e[3];return t[0]=o,t[1]=a,t[2]=u,t[3]=h,t[4]=n*h+i*u-s*a,t[5]=i*h+s*o-n*u,t[6]=s*h+n*a-i*o,t[7]=-n*o-i*a-s*u,t}function Mi(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function xi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function _i(t,e){var r=Pn();xe(r,e);var n=new p(3);return we(n,e),wi(t,r,n),t}function Si(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function Pi(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Ai(t,e,r,n,i,s,o,a,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=u,t}var Oi=Kn;function Ei(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var ki=Kn;function Ii(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function Ci(t,e){var r=e[4],n=e[5],i=e[6],s=e[7],o=-e[0],a=-e[1],u=-e[2],h=e[3];return t[0]=2*(r*h+s*o+n*u-i*a),t[1]=2*(n*h+s*a+i*o-r*u),t[2]=2*(i*h+s*u+r*a-n*o),t}function Bi(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=.5*r[0],u=.5*r[1],h=.5*r[2],c=e[4],l=e[5],f=e[6],d=e[7];return t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=o*a+i*h-s*u+c,t[5]=o*u+s*a-n*h+l,t[6]=o*h+n*u-i*a+f,t[7]=-n*a-i*u-s*h+d,t}function Ri(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=a*o+c*n+u*s-h*i,f=u*o+c*i+h*n-a*s,d=h*o+c*s+a*i-u*n,p=c*o-a*n-u*i-h*s;return Cn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Ti(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=a*o+c*n+u*s-h*i,f=u*o+c*i+h*n-a*s,d=h*o+c*s+a*i-u*n,p=c*o-a*n-u*i-h*s;return Bn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Li(t,e,r){var n=-e[0],i=-e[1],s=-e[2],o=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=a*o+c*n+u*s-h*i,f=u*o+c*i+h*n-a*s,d=h*o+c*s+a*i-u*n,p=c*o-a*n-u*i-h*s;return Rn(t,e,r),n=t[0],i=t[1],s=t[2],o=t[3],t[4]=l*o+p*n+f*s-d*i,t[5]=f*o+p*i+d*n-l*s,t[6]=d*o+p*s+l*i-f*n,t[7]=p*o-l*n-f*i-d*s,t}function Fi(t,e,r){var n=r[0],i=r[1],s=r[2],o=r[3],a=e[0],u=e[1],h=e[2],c=e[3];return t[0]=a*o+c*n+u*s-h*i,t[1]=u*o+c*i+h*n-a*s,t[2]=h*o+c*s+a*i-u*n,t[3]=c*o-a*n-u*i-h*s,a=e[4],u=e[5],h=e[6],c=e[7],t[4]=a*o+c*n+u*s-h*i,t[5]=u*o+c*i+h*n-a*s,t[6]=h*o+c*s+a*i-u*n,t[7]=c*o-a*n-u*i-h*s,t}function ji(t,e,r){var n=e[0],i=e[1],s=e[2],o=e[3],a=r[0],u=r[1],h=r[2],c=r[3];return t[0]=n*c+o*a+i*h-s*u,t[1]=i*c+o*u+s*a-n*h,t[2]=s*c+o*h+n*u-i*a,t[3]=o*c-n*a-i*u-s*h,a=r[4],u=r[5],h=r[6],c=r[7],t[4]=n*c+o*a+i*h-s*u,t[5]=i*c+o*u+s*a-n*h,t[6]=s*c+o*h+n*u-i*a,t[7]=o*c-n*a-i*u-s*h,t}function Di(t,e,r,n){if(Math.abs(n)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,s=e[2]/r,o=e[3]/r,a=e[4],u=e[5],h=e[6],c=e[7],l=n*a+i*u+s*h+o*c;t[0]=n,t[1]=i,t[2]=s,t[3]=o,t[4]=(a-n*l)/r,t[5]=(u-i*l)/r,t[6]=(h-s*l)/r,t[7]=(c-o*l)/r}return t}function Qi(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function Ki(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function ts(t,e){var r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],u=t[6],h=t[7],c=e[0],l=e[1],f=e[2],p=e[3],m=e[4],g=e[5],v=e[6],y=e[7];return Math.abs(r-c)<=d*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(n-l)<=d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-f)<=d*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(s-p)<=d*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(o-m)<=d*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(a-g)<=d*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(u-v)<=d*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(h-y)<=d*Math.max(1,Math.abs(h),Math.abs(y))}function es(){var t=new p(2);return p!=Float32Array&&(t[0]=0,t[1]=0),t}function rs(t){var e=new p(2);return e[0]=t[0],e[1]=t[1],e}function ns(t,e){var r=new p(2);return r[0]=t,r[1]=e,r}function is(t,e){return t[0]=e[0],t[1]=e[1],t}function ss(t,e,r){return t[0]=e,t[1]=r,t}function os(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function as(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function us(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function hs(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function cs(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function ls(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function fs(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function ds(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function ps(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function ms(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function gs(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function vs(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function ys(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function bs(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function ws(t){var e=t[0],r=t[1];return e*e+r*r}function Ms(t,e){return t[0]=-e[0],t[1]=-e[1],t}function xs(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function _s(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function Ss(t,e){return t[0]*e[0]+t[1]*e[1]}function Ps(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function As(t,e,r,n){var i=e[0],s=e[1];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t}function Os(t,e){e=e||1;var r=2*m()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function Es(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function ks(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function Is(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function Cs(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function Bs(t,e,r,n){var i=e[0]-r[0],s=e[1]-r[1],o=Math.sin(n),a=Math.cos(n);return t[0]=i*a-s*o+r[0],t[1]=i*o+s*a+r[1],t}function Rs(t,e){var r=t[0],n=t[1],i=e[0],s=e[1],o=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+s*s),a=o&&(r*i+n*s)/o;return Math.acos(Math.min(Math.max(a,-1),1))}function Ts(t){return t[0]=0,t[1]=0,t}function Ls(t){return"vec2("+t[0]+", "+t[1]+")"}function Fs(t,e){return t[0]===e[0]&&t[1]===e[1]}function js(t,e){var r=t[0],n=t[1],i=e[0],s=e[1];return Math.abs(r-i)<=d*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))}var Ds=bs,zs=as,qs=us,Ns=hs,Us=vs,Ys=ys,Vs=ws,Zs=function(){var t=es();return function(e,r,n,i,s,o){var a,u;for(r||(r=2),n||(n=0),u=i?Math.min(i*r+n,e.length):e.length,a=n;a{t.exports=function t(e,r,n){function i(o,a){if(!r[o]){if(!e[o]){if(s)return s(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[o]={exports:{}};e[o][0].call(h.exports,(function(t){return i(e[o][1][t]||t)}),h,h.exports,t,e,r,n)}return r[o].exports}for(var s=void 0,o=0;o>2,a=(3&e)<<4|r>>4,u=1>6:64,h=2>4,r=(15&o)<<4|(a=s.indexOf(t.charAt(h++)))>>2,n=(3&a)<<6|(u=s.indexOf(t.charAt(h++))),l[c++]=e,64!==a&&(l[c++]=r),64!==u&&(l[c++]=n);return l}},{"./support":30,"./utils":32}],2:[function(t,e,r){"use strict";var n=t("./external"),i=t("./stream/DataWorker"),s=t("./stream/Crc32Probe"),o=t("./stream/DataLengthProbe");function a(t,e,r,n,i){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=n,this.compressedContent=i}a.prototype={getContentWorker:function(){var t=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(t,e,r){return t.pipe(new s).pipe(new o("uncompressedSize")).pipe(e.compressWorker(r)).pipe(new o("compressedSize")).withStreamInfo("compression",e)},e.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,r){"use strict";var n=t("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(t){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,r){"use strict";var n=t("./utils"),i=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==n.getTypeOf(t)?function(t,e,r){var n=i,s=0+r;t^=-1;for(var o=0;o>>8^n[255&(t^e[o])];return-1^t}(0|e,t,t.length):function(t,e,r){var n=i,s=0+r;t^=-1;for(var o=0;o>>8^n[255&(t^e.charCodeAt(o))];return-1^t}(0|e,t,t.length):0}},{"./utils":32}],5:[function(t,e,r){"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(t,e,r){"use strict";var n;n="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:n}},{lie:37}],7:[function(t,e,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=t("pako"),s=t("./utils"),o=t("./stream/GenericWorker"),a=n?"uint8array":"array";function u(t,e){o.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic="\b\0",s.inherits(u,o),u.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,t.data),!1)},u.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(t){return new u("Deflate",t)},r.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,r){"use strict";function n(t,e){var r,n="";for(r=0;r>>=8;return n}function i(t,e,r,i,o,c){var l,f,d=t.file,p=t.compression,m=c!==a.utf8encode,g=s.transformTo("string",c(d.name)),v=s.transformTo("string",a.utf8encode(d.name)),y=d.comment,b=s.transformTo("string",c(y)),w=s.transformTo("string",a.utf8encode(y)),M=v.length!==d.name.length,x=w.length!==y.length,_="",S="",P="",A=d.dir,O=d.date,E={crc32:0,compressedSize:0,uncompressedSize:0};e&&!r||(E.crc32=t.crc32,E.compressedSize=t.compressedSize,E.uncompressedSize=t.uncompressedSize);var k=0;e&&(k|=8),m||!M&&!x||(k|=2048);var I,C=0,B=0;A&&(C|=16),"UNIX"===o?(B=798,C|=((I=d.unixPermissions)||(I=A?16893:33204),(65535&I)<<16)):(B=20,C|=63&(d.dosPermissions||0)),l=O.getUTCHours(),l<<=6,l|=O.getUTCMinutes(),l<<=5,l|=O.getUTCSeconds()/2,f=O.getUTCFullYear()-1980,f<<=4,f|=O.getUTCMonth()+1,f<<=5,f|=O.getUTCDate(),M&&(_+="up"+n((S=n(1,1)+n(u(g),4)+v).length,2)+S),x&&(_+="uc"+n((P=n(1,1)+n(u(b),4)+w).length,2)+P);var R="";return R+="\n\0",R+=n(k,2),R+=p.magic,R+=n(l,2),R+=n(f,2),R+=n(E.crc32,4),R+=n(E.compressedSize,4),R+=n(E.uncompressedSize,4),R+=n(g.length,2),R+=n(_.length,2),{fileRecord:h.LOCAL_FILE_HEADER+R+g+_,dirRecord:h.CENTRAL_FILE_HEADER+n(B,2)+R+n(b.length,2)+"\0\0\0\0"+n(C,4)+n(i,4)+g+_+b}}var s=t("../utils"),o=t("../stream/GenericWorker"),a=t("../utf8"),u=t("../crc32"),h=t("../signature");function c(t,e,r,n){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(c,o),c.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,o.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-n-1))/r:100}}))},c.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var r=i(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},c.prototype.closedSource=function(t){this.accumulate=!1;var e,r=this.streamFiles&&!t.file.dir,s=i(t,r,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(s.dirRecord),r)this.push({data:(e=t,h.DATA_DESCRIPTOR+n(e.crc32,4)+n(e.compressedSize,4)+n(e.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:s.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},c.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e=this.index;e--)r=(r<<8)+this.byteAt(e);return this.index+=t,r},readString:function(t){return n.transformTo("string",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readAndCheckSignature:function(t){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=i},{"../utils":32}],19:[function(t,e,r){"use strict";var n=t("./Uint8ArrayReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,r){"use strict";var n=t("./DataReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},i.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},i.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./DataReader":18}],21:[function(t,e,r){"use strict";var n=t("./ArrayReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../support"),s=t("./ArrayReader"),o=t("./StringReader"),a=t("./NodeBufferReader"),u=t("./Uint8ArrayReader");e.exports=function(t){var e=n.getTypeOf(t);return n.checkSupport(e),"string"!==e||i.uint8array?"nodebuffer"===e?new a(t):i.uint8array?new u(n.transformTo("uint8array",t)):new s(n.transformTo("array",t)):new o(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,r){"use strict";r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,r){"use strict";var n=t("./GenericWorker"),i=t("../utils");function s(t){n.call(this,"ConvertWorker to "+t),this.destType=t}i.inherits(s,n),s.prototype.processChunk=function(t){this.push({data:i.transformTo(this.destType,t.data),meta:t.meta})},e.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,r){"use strict";var n=t("./GenericWorker"),i=t("../crc32");function s(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(s,n),s.prototype.processChunk=function(t){this.streamInfo.crc32=i(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./GenericWorker");function s(t){i.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}n.inherits(s,i),s.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}i.prototype.processChunk.call(this,t)},e.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./GenericWorker");function s(t){i.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=n.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}n.inherits(s,i),s.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,r){"use strict";function n(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var r=0;r "+t:t}},e.exports=n},{}],29:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./ConvertWorker"),s=t("./GenericWorker"),o=t("../base64"),a=t("../support"),u=t("../external"),h=null;if(a.nodestream)try{h=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function c(t,e,r){var o=e;switch(e){case"blob":case"arraybuffer":o="uint8array";break;case"base64":o="string"}try{this._internalType=o,this._outputType=e,this._mimeType=r,n.checkSupport(o),this._worker=t.pipe(new i(o)),t.lock()}catch(t){this._worker=new s("error"),this._worker.error(t)}}c.prototype={accumulate:function(t){return e=this,r=t,new u.Promise((function(t,i){var s=[],a=e._internalType,u=e._outputType,h=e._mimeType;e.on("data",(function(t,e){s.push(t),r&&r(e)})).on("error",(function(t){s=[],i(t)})).on("end",(function(){try{var e=function(t,e,r){switch(t){case"blob":return n.newBlob(n.transformTo("arraybuffer",e),r);case"base64":return o.encode(e);default:return n.transformTo(t,e)}}(u,function(t,e){var r,n=0,i=null,s=0;for(r=0;r>>6:(r<65536?e[o++]=224|r>>>12:(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63),e[o++]=128|r>>>6&63),e[o++]=128|63&r);return e}(t)},r.utf8decode=function(t){return i.nodebuffer?n.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,r,i,s,o=t.length,u=new Array(2*o);for(e=r=0;e>10&1023,u[r++]=56320|1023&i)}return u.length!==r&&(u.subarray?u=u.subarray(0,r):u.length=r),n.applyFromCharCode(u)}(t=n.transformTo(i.uint8array?"uint8array":"array",t))},n.inherits(h,o),h.prototype.processChunk=function(t){var e=n.transformTo(i.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var s=e;(e=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),e.set(s,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var o=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+a[t[r]]>e?r:e}(e),u=e;o!==e.length&&(i.uint8array?(u=e.subarray(0,o),this.leftOver=e.subarray(o,e.length)):(u=e.slice(0,o),this.leftOver=e.slice(o,e.length))),this.push({data:r.utf8decode(u),meta:t.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=h,n.inherits(c,o),c.prototype.processChunk=function(t){this.push({data:r.utf8encode(t.data),meta:t.meta})},r.Utf8EncodeWorker=c},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,r){"use strict";var n=t("./support"),i=t("./base64"),s=t("./nodejsUtils"),o=t("set-immediate-shim"),a=t("./external");function u(t){return t}function h(t,e){for(var r=0;r>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(t){if(this.extraFields[1]){var e=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e,r,n,i=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4>>6:(r<65536?e[o++]=224|r>>>12:(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63),e[o++]=128|r>>>6&63),e[o++]=128|63&r);return e},r.buf2binstring=function(t){return u(t,t.length)},r.binstring2buf=function(t){for(var e=new n.Buf8(t.length),r=0,i=e.length;r>10&1023,h[n++]=56320|1023&i)}return u(h,n)},r.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+o[t[r]]>e?r:e}},{"./common":41}],43:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){for(var i=65535&t|0,s=t>>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e,r,i){var s=n,o=i+r;t^=-1;for(var a=i;a>>8^s[255&(t^e[a])];return-1^t}},{}],46:[function(t,e,r){"use strict";var n,i=t("../utils/common"),s=t("./trees"),o=t("./adler32"),a=t("./crc32"),u=t("./messages"),h=-2,c=258,l=262,f=113;function d(t,e){return t.msg=u[e],e}function p(t){return(t<<1)-(4t.avail_out&&(r=t.avail_out),0!==r&&(i.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function v(t,e){s._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,g(t.strm)}function y(t,e){t.pending_buf[t.pending++]=e}function b(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function w(t,e){var r,n,i=t.max_chain_length,s=t.strstart,o=t.prev_length,a=t.nice_match,u=t.strstart>t.w_size-l?t.strstart-(t.w_size-l):0,h=t.window,f=t.w_mask,d=t.prev,p=t.strstart+c,m=h[s+o-1],g=h[s+o];t.prev_length>=t.good_match&&(i>>=2),a>t.lookahead&&(a=t.lookahead);do{if(h[(r=e)+o]===g&&h[r+o-1]===m&&h[r]===h[s]&&h[++r]===h[s+1]){s+=2,r++;do{}while(h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&h[++s]===h[++r]&&su&&0!=--i);return o<=t.lookahead?o:t.lookahead}function M(t){var e,r,n,s,u,h,c,f,d,p,m=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=m+(m-l)){for(i.arraySet(t.window,t.window,m,m,0),t.match_start-=m,t.strstart-=m,t.block_start-=m,e=r=t.hash_size;n=t.head[--e],t.head[e]=m<=n?n-m:0,--r;);for(e=r=m;n=t.prev[--e],t.prev[e]=m<=n?n-m:0,--r;);s+=m}if(0===t.strm.avail_in)break;if(h=t.strm,c=t.window,f=t.strstart+t.lookahead,p=void 0,(d=s)<(p=h.avail_in)&&(p=d),r=0===p?0:(h.avail_in-=p,i.arraySet(c,h.input,h.next_in,p,f),1===h.state.wrap?h.adler=o(h.adler,c,p,f):2===h.state.wrap&&(h.adler=a(h.adler,c,p,f)),h.next_in+=p,h.total_in+=p,p),t.lookahead+=r,t.lookahead+t.insert>=3)for(u=t.strstart-t.insert,t.ins_h=t.window[u],t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3)if(n=s._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3&&t.match_length<=t.prev_length){for(i=t.strstart+t.lookahead-3,n=s._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=i&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(M(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,v(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-l&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(v(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(v(t,!1),t.strm.avail_out),1)})),new S(4,4,8,4,x),new S(4,5,16,8,x),new S(4,6,32,32,x),new S(4,4,16,16,_),new S(8,16,32,32,_),new S(8,16,128,128,_),new S(8,32,128,256,_),new S(32,128,258,1024,_),new S(32,258,258,4096,_)],r.deflateInit=function(t,e){return E(t,e,8,15,8,0)},r.deflateInit2=E,r.deflateReset=O,r.deflateResetKeep=A,r.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?h:(t.state.gzhead=e,0):h},r.deflate=function(t,e){var r,i,o,u;if(!t||!t.state||5>8&255),y(i,i.gzhead.time>>16&255),y(i,i.gzhead.time>>24&255),y(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),y(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(y(i,255&i.gzhead.extra.length),y(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=a(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(y(i,0),y(i,0),y(i,0),y(i,0),y(i,0),y(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),y(i,3),i.status=f);else{var l=8+(i.w_bits-8<<4)<<8;l|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(l|=32),l+=31-l%31,i.status=f,b(i,l),0!==i.strstart&&(b(i,t.adler>>>16),b(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),g(t),o=i.pending,i.pending!==i.pending_buf_size));)y(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),g(t),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexo&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),g(t),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexo&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&g(t),i.pending+2<=i.pending_buf_size&&(y(i,255&t.adler),y(i,t.adler>>8&255),t.adler=0,i.status=f)):i.status=f),0!==i.pending){if(g(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&p(e)<=p(r)&&4!==e)return d(t,-5);if(666===i.status&&0!==t.avail_in)return d(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&666!==i.status){var w=2===i.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(M(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(v(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(v(t,!1),0===t.strm.avail_out)?1:2}(i,e):3===i.strategy?function(t,e){for(var r,n,i,o,a=t.window;;){if(t.lookahead<=c){if(M(t),t.lookahead<=c&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&0t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=s._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(v(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(v(t,!1),0===t.strm.avail_out)?1:2}(i,e):n[i.level].func(i,e);if(3!==w&&4!==w||(i.status=666),1===w||3===w)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===w&&(1===e?s._tr_align(i):5!==e&&(s._tr_stored_block(i,0,0,!1),3===e&&(m(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),g(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(y(i,255&t.adler),y(i,t.adler>>8&255),y(i,t.adler>>16&255),y(i,t.adler>>24&255),y(i,255&t.total_in),y(i,t.total_in>>8&255),y(i,t.total_in>>16&255),y(i,t.total_in>>24&255)):(b(i,t.adler>>>16),b(i,65535&t.adler)),g(t),0=r.w_size&&(0===a&&(m(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new i.Buf8(r.w_size),i.arraySet(f,e,d-r.w_size,r.w_size,0),e=f,d=r.w_size),u=t.avail_in,c=t.next_in,l=t.input,t.avail_in=d,t.next_in=0,t.input=e,M(r);r.lookahead>=3;){for(n=r.strstart,s=r.lookahead-2;r.ins_h=(r.ins_h<>>=w=b>>>24,p-=w,0==(w=b>>>16&255))A[s++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=m[(65535&b)+(d&(1<>>=w,p-=w),p<15&&(d+=P[n++]<>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=g[(65535&b)+(d&(1<>>=w,p-=w,(w=s-o)>3,d&=(1<<(p-=M<<3))-1,t.next_in=n,t.next_out=s,t.avail_in=n>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function l(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(852),e.distcode=e.distdyn=new n.Buf32(592),e.sane=1,e.back=-1,0):u}function f(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,l(t)):u}function d(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15=o.wsize?(n.arraySet(o.window,e,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i<(s=o.wsize-o.wnext)&&(s=i),n.arraySet(o.window,e,r-i,s,o.wnext),(i-=s)?(n.arraySet(o.window,e,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=s(r.check,F,2,0),v=g=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&g)<<8)+(g>>8))%31){t.msg="incorrect header check",r.mode=30;break}if(8!=(15&g)){t.msg="unknown compression method",r.mode=30;break}if(v-=4,C=8+(15&(g>>>=4)),0===r.wbits)r.wbits=C;else if(C>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,r.check=s(r.check,F,2,0)),v=g=0,r.mode=3;case 3:for(;v<32;){if(0===p)break t;p--,g+=c[f++]<>>8&255,F[2]=g>>>16&255,F[3]=g>>>24&255,r.check=s(r.check,F,4,0)),v=g=0,r.mode=4;case 4:for(;v<16;){if(0===p)break t;p--,g+=c[f++]<>8),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,r.check=s(r.check,F,2,0)),v=g=0,r.mode=5;case 5:if(1024&r.flags){for(;v<16;){if(0===p)break t;p--,g+=c[f++]<>>8&255,r.check=s(r.check,F,2,0)),v=g=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(p<(x=r.length)&&(x=p),x&&(r.head&&(C=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,c,f,x,C)),512&r.flags&&(r.check=s(r.check,c,x,f)),p-=x,f+=x,r.length-=x),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===p)break t;for(x=0;C=c[f+x++],r.head&&C&&r.length<65536&&(r.head.name+=String.fromCharCode(C)),C&&x>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;v<32;){if(0===p)break t;p--,g+=c[f++]<>>=7&v,v-=7&v,r.mode=27;break}for(;v<3;){if(0===p)break t;p--,g+=c[f++]<>>=1)){case 0:r.mode=14;break;case 1:if(y(r),r.mode=20,6!==e)break;g>>>=2,v-=2;break t;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}g>>>=2,v-=2;break;case 14:for(g>>>=7&v,v-=7&v;v<32;){if(0===p)break t;p--,g+=c[f++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&g,v=g=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(x=r.length){if(p>>=5,v-=5,r.ndist=1+(31&g),g>>>=5,v-=5,r.ncode=4+(15&g),g>>>=4,v-=4,286>>=3,v-=3}for(;r.have<19;)r.lens[j[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,R={bits:r.lenbits},B=a(0,r.lens,0,19,r.lencode,0,r.work,R),r.lenbits=R.bits,B){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,O=65535&L,!((P=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<>>=P,v-=P,r.lens[r.have++]=O;else{if(16===O){for(T=P+2;v>>=P,v-=P,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}C=r.lens[r.have-1],x=3+(3&g),g>>>=2,v-=2}else if(17===O){for(T=P+3;v>>=P)),g>>>=3,v-=3}else{for(T=P+7;v>>=P)),g>>>=7,v-=7}if(r.have+x>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;x--;)r.lens[r.have++]=C}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,R={bits:r.lenbits},B=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,R),r.lenbits=R.bits,B){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,R={bits:r.distbits},B=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,R),r.distbits=R.bits,B){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(6<=p&&258<=m){t.next_out=d,t.avail_out=m,t.next_in=f,t.avail_in=p,r.hold=g,r.bits=v,o(t,M),d=t.next_out,l=t.output,m=t.avail_out,f=t.next_in,c=t.input,p=t.avail_in,g=r.hold,v=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;A=(L=r.lencode[g&(1<>>16&255,O=65535&L,!((P=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<>E)])>>>16&255,O=65535&L,!(E+(P=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<>>=E,v-=E,r.back+=E}if(g>>>=P,v-=P,r.back+=P,r.length=O,0===A){r.mode=26;break}if(32&A){r.back=-1,r.mode=12;break}if(64&A){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&A,r.mode=22;case 22:if(r.extra){for(T=r.extra;v>>=r.extra,v-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;A=(L=r.distcode[g&(1<>>16&255,O=65535&L,!((P=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<>E)])>>>16&255,O=65535&L,!(E+(P=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<>>=E,v-=E,r.back+=E}if(g>>>=P,v-=P,r.back+=P,64&A){t.msg="invalid distance code",r.mode=30;break}r.offset=O,r.extra=15&A,r.mode=24;case 24:if(r.extra){for(T=r.extra;v>>=r.extra,v-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===m)break t;if(x=M-m,r.offset>x){if((x=r.offset-x)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}_=x>r.wnext?(x-=r.wnext,r.wsize-x):r.wnext-x,x>r.length&&(x=r.length),S=r.window}else S=l,_=d-r.offset,x=r.length;for(my?(w=j[D+l[S]],R[T+l[S]]):(w=96,0),d=1<<_-k,P=p=1<>k)+(p-=d)]=b<<24|w<<16|M|0,0!==p;);for(d=1<<_-1;B&d;)d>>=1;if(0!==d?(B&=d-1,B+=d):B=0,S++,0==--L[_]){if(_===A)break;_=e[r+l[S]]}if(O<_&&(B&g)!==m){for(0===k&&(k=O),v+=P,I=1<<(E=_-k);E+k>>7)]}function x(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function _(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<>>=1,r<<=1,0<--e;);return r>>>1}function A(t,e,r){var n,i,o=new Array(16),a=0;for(n=1;n<=s;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=e;i++){var u=t[2*i+1];0!==u&&(t[2*i]=P(o[u]++,u))}}function O(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function E(t){8>1;1<=r;r--)I(t,o,r);for(i=h;r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],I(t,o,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,o[2*i]=o[2*r]+o[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,o[2*r+1]=o[2*n+1]=i,t.heap[1]=i++,I(t,o,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,o,a,u,h=e.dyn_tree,c=e.max_code,l=e.stat_desc.static_tree,f=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,m=e.stat_desc.max_length,g=0;for(o=0;o<=s;o++)t.bl_count[o]=0;for(h[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)m<(o=h[2*h[2*(n=t.heap[r])+1]+1]+1)&&(o=m,g++),h[2*n+1]=o,c>=7;n<30;n++)for(y[n]=i<<7,t=0;t<1<>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),B(t,t.l_desc),B(t,t.d_desc),o=function(t){var e;for(R(t,t.dyn_ltree,t.l_desc.max_code),R(t,t.dyn_dtree,t.d_desc.max_code),B(t,t.bl_desc),e=18;3<=e&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==e?F(t,e,r,n):4===t.strategy||s===i?(_(t,2+(n?1:0),3),C(t,c,l)):(_(t,4+(n?1:0),3),function(t,e,r,n){var i;for(_(t,e-257,5),_(t,r-1,5),_(t,n-4,4),i=0;i>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(d[r]+256+1)]++,t.dyn_dtree[2*M(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){var e;_(t,2,3),S(t,256,c),16===(e=t).bi_valid?(x(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},{"../utils/common":41}],53:[function(t,e,r){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,r){"use strict";e.exports="function"==typeof setImmediate?setImmediate:function(){var t=[].slice.apply(arguments);t.splice(1,0,0),setTimeout.apply(null,t)}},{}]},{},[10])(10)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)},5666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,s=Object.create(i.prototype),o=new E(n||[]);return s._invoke=function(t,e,r){var n=l;return function(i,s){if(n===d)throw new Error("Generator is already running");if(n===p){if("throw"===i)throw s;return I()}for(r.method=i,r.arg=s;;){var o=r.delegate;if(o){var a=P(o,r);if(a){if(a===m)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var u=c(t,e,r);if("normal"===u.type){if(n=r.done?p:f,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=p,r.method="throw",r.arg=u.arg)}}}(t,r,o),s}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var l="suspendedStart",f="suspendedYield",d="executing",p="completed",m={};function g(){}function v(){}function y(){}var b={};u(b,s,(function(){return this}));var w=Object.getPrototypeOf,M=w&&w(w(k([])));M&&M!==r&&n.call(M,s)&&(b=M);var x=y.prototype=g.prototype=Object.create(b);function _(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(i,s,o,a){var u=c(t[i],t,s);if("throw"!==u.type){var h=u.arg,l=h.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,o,a)}),(function(t){r("throw",t,o,a)})):e.resolve(l).then((function(t){h.value=t,o(h)}),(function(t){return r("throw",t,o,a)}))}a(u.arg)}var i;this._invoke=function(t,n){function s(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(s,s):s()}}function P(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method))return m;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var i=c(n,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var s=i.arg;return s?s.done?(r[t.resultName]=s.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function k(t){if(t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i=0;--s){var o=this.tryEntries[s],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=n.call(o,"catchLoc"),h=n.call(o,"finallyLoc");if(u&&h){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;O(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:k(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},5072:function(t,e,r){var n,i;void 0===(i="function"==typeof(n=function(){return function(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var e=document.createElement("base");if(e.href=arguments[0],1===t)return e.href;var r=document.getElementsByTagName("head")[0];r.insertBefore(e,r.firstChild);for(var n,i=document.createElement("a"),s=1;s{var n;!function(){"use strict";var i=.5*(Math.sqrt(3)-1),s=(3-Math.sqrt(3))/6,o=1/6,a=(Math.sqrt(5)-1)/4,u=(5-Math.sqrt(5))/20;function h(t){var e;e="function"==typeof t?t:t?function(){var t=0,e=0,r=0,n=1,i=l();t=i(" "),e=i(" "),r=i(" ");for(var s=0;s>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}h.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(t,e){var r,n,o=this.permMod12,a=this.perm,u=this.grad3,h=0,c=0,l=0,f=(t+e)*i,d=Math.floor(t+f),p=Math.floor(e+f),m=(d+p)*s,g=t-(d-m),v=e-(p-m);g>v?(r=1,n=0):(r=0,n=1);var y=g-r+s,b=v-n+s,w=g-1+2*s,M=v-1+2*s,x=255&d,_=255&p,S=.5-g*g-v*v;if(S>=0){var P=3*o[x+a[_]];h=(S*=S)*S*(u[P]*g+u[P+1]*v)}var A=.5-y*y-b*b;if(A>=0){var O=3*o[x+r+a[_+n]];c=(A*=A)*A*(u[O]*y+u[O+1]*b)}var E=.5-w*w-M*M;if(E>=0){var k=3*o[x+1+a[_+1]];l=(E*=E)*E*(u[k]*w+u[k+1]*M)}return 70*(h+c+l)},noise3D:function(t,e,r){var n,i,s,a,u,h,c,l,f,d,p=this.permMod12,m=this.perm,g=this.grad3,v=.3333333333333333*(t+e+r),y=Math.floor(t+v),b=Math.floor(e+v),w=Math.floor(r+v),M=(y+b+w)*o,x=t-(y-M),_=e-(b-M),S=r-(w-M);x>=_?_>=S?(u=1,h=0,c=0,l=1,f=1,d=0):x>=S?(u=1,h=0,c=0,l=1,f=0,d=1):(u=0,h=0,c=1,l=1,f=0,d=1):_B?L++:F++,C>R?L++:j++,C>T?L++:D++,B>R?F++:j++,B>T?F++:D++,R>T?j++:D++;var z=C-(l=L>=3?1:0)+u,q=B-(f=F>=3?1:0)+u,N=R-(d=j>=3?1:0)+u,U=T-(p=D>=3?1:0)+u,Y=C-(m=L>=2?1:0)+2*u,V=B-(g=F>=2?1:0)+2*u,Z=R-(v=j>=2?1:0)+2*u,G=T-(y=D>=2?1:0)+2*u,$=C-(b=L>=1?1:0)+3*u,X=B-(w=F>=1?1:0)+3*u,H=R-(M=j>=1?1:0)+3*u,W=T-(x=D>=1?1:0)+3*u,J=C-1+4*u,Q=B-1+4*u,K=R-1+4*u,tt=T-1+4*u,et=255&A,rt=255&O,nt=255&E,it=255&k,st=.6-C*C-B*B-R*R-T*T;if(st<0)i=0;else{var ot=_[et+_[rt+_[nt+_[it]]]]%32*4;i=(st*=st)*st*(S[ot]*C+S[ot+1]*B+S[ot+2]*R+S[ot+3]*T)}var at=.6-z*z-q*q-N*N-U*U;if(at<0)s=0;else{var ut=_[et+l+_[rt+f+_[nt+d+_[it+p]]]]%32*4;s=(at*=at)*at*(S[ut]*z+S[ut+1]*q+S[ut+2]*N+S[ut+3]*U)}var ht=.6-Y*Y-V*V-Z*Z-G*G;if(ht<0)o=0;else{var ct=_[et+m+_[rt+g+_[nt+v+_[it+y]]]]%32*4;o=(ht*=ht)*ht*(S[ct]*Y+S[ct+1]*V+S[ct+2]*Z+S[ct+3]*G)}var lt=.6-$*$-X*X-H*H-W*W;if(lt<0)h=0;else{var ft=_[et+b+_[rt+w+_[nt+M+_[it+x]]]]%32*4;h=(lt*=lt)*lt*(S[ft]*$+S[ft+1]*X+S[ft+2]*H+S[ft+3]*W)}var dt=.6-J*J-Q*Q-K*K-tt*tt;if(dt<0)c=0;else{var pt=_[et+1+_[rt+1+_[nt+1+_[it+1]]]]%32*4;c=(dt*=dt)*dt*(S[pt]*J+S[pt+1]*Q+S[pt+2]*K+S[pt+3]*tt)}return 27*(i+s+o+h+c)}},h._buildPermutationTable=c,void 0===(n=function(){return h}.call(e,r,e,t))||(t.exports=n),e.SimplexNoise=h,t.exports=h}()},6479:(t,e,r)=>{var n;!function(){"use strict";function i(t,e,r){var n=e.x,i=e.y,s=r.x-n,o=r.y-i;if(0!==s||0!==o){var a=((t.x-n)*s+(t.y-i)*o)/(s*s+o*o);a>1?(n=r.x,i=r.y):a>0&&(n+=s*a,i+=o*a)}return(s=t.x-n)*s+(o=t.y-i)*o}function s(t,e,r,n,o){for(var a,u=n,h=e+1;hu&&(a=h,u=c)}u>n&&(a-e>1&&s(t,e,a,n,o),o.push(t[a]),r-a>1&&s(t,a,r,n,o))}function o(t,e){var r=t.length-1,n=[t[0]];return s(t,0,r,e,n),n.push(t[r]),n}function a(t,e,r){if(t.length<=2)return t;var n=void 0!==e?e*e:1;return o(t=r?t:function(t,e){for(var r,n,i,s,o,a=t[0],u=[a],h=1,c=t.length;he&&(u.push(r),a=r);return a!==r&&u.push(r),u}(t,n),n)}void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(2915)})()})); \ No newline at end of file diff --git a/build/umd/urpflanze.min.js.LICENSE.txt b/build/umd/urpflanze.min.js.LICENSE.txt index 8e66bad..3c47f5f 100644 --- a/build/umd/urpflanze.min.js.LICENSE.txt +++ b/build/umd/urpflanze.min.js.LICENSE.txt @@ -11,7 +11,7 @@ https://github.com/nodeca/pako/blob/master/LICENSE */ /*! - * @license UrpflanzeJS v"1.0.2" + * @license UrpflanzeJS v"1.0.3" * urpflanze.min.js * * Github: https://github.com/urpflanze-org/urpflanze diff --git a/docs/index-v0001.js b/docs/index-v0001.js index 130bb45..ae13c1b 100644 --- a/docs/index-v0001.js +++ b/docs/index-v0001.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var __webpack_modules__={933:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(561);const r=async function(e){const t=await fetch(`https://api.github.com/repos/genbs/urpflanze/contents/${e}`),{name:n,html_url:r,download_url:o,content:i}=await t.json(),c=atob(i),l=c.replace(/&/g,"&").replace(//g,">").replace(/"/g,""");var s;const p=`https://codesandbox.io/api/v1/sandboxes/define?parameters=${s={files:{"index.html":{content:c}}},LZString.compressToBase64(JSON.stringify(s)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}`;return`\n\t\t

Example: ${(0,a.P)(e.split("/")[1].slice(3))} | ${(0,a.P)(n.slice(3,-5).replace(/-/gi," "))}

\n\t\t

Output

\n\t\t
\n\t\t\t\n\t\t
\n\n\t\t

Links

\n\t\t\n\n\t\t

Source

\n\t\t
\n\t\t\t
${l}
\n\t\t
\n `}},210:(e,t,n)=>{n.d(t,{TZ:()=>u,FD:()=>d,Wj:()=>_});const a={it:{Wiki:{Introduzione:{"Cos'è Urpflanze?":"it/Introduzione"},"Primi passi":{Installazione:"it/Installazione","Crea una scena":"it/Crea-una-scena","Gestire le ripetizioni":"it/Gestire-le-ripetizioni","Drawer e animazioni":"it/Drawer-e-animazioni"},Avanzate:{ShapeLoop:"it/ShapeLoop","Vertex Callback":"it/VertexCallback","Custom Drawer":"it/CustomDrawer",Renderer:"it/Renderer"}}},en:{Wiki:{Introduction:{"What is Urpflanze?":"en/Introduction"},"First steps":{Installation:"en/Installation","Creating a scene":"en/Creating-a-scene","Manage repetitions":"en/Manage-repetitions","Drawer and animations":"en/Drawer-and-animations"},Advanced:{ShapeLoop:"en/ShapeLoop","Vertex Callback":"en/VertexCallback","Custom Drawer":"en/CustomDrawer",Renderer:"en/Renderer"}}}};var r=n(561);const o=function(e,t,n){const a=document.createElement("div");return Object.keys(e).forEach((o=>{const i=e[o],c=document.createElement("h2"),l=Object.keys(i);if(0===l.length||1===l.length&&0===Object.keys(i[l[0]]).length)return;c.innerText=o;const s=document.createElement("div");l.forEach((e=>{const a=document.createElement("h3");a.innerText=e;const o=document.createElement("ul");let c=0;Object.keys(i[e]).forEach((a=>{if(void 0===t||0===t.length||(0,r.X)(a,t)){const t=document.createElement("li"),r=document.createElement("a");r.className="link",r.innerText=a,r.href="#/"+i[e][a].replace("$lang",n),t.appendChild(r),o.appendChild(t),c++}})),c&&(s.appendChild(a),s.appendChild(o))})),a.appendChild(c),a.appendChild(s)})),a};var i=n(456);const c={Core:"https://docs.urpflanze.org/core/",DrawerCanvas:"https://docs.urpflanze.org/drawer-canvas/",Animation:"https://docs.urpflanze.org/animation",SVGImporter:"https://github.com/urpflanze-org/svg-importer",SVGExporter:"https://github.com/urpflanze-org/svg-exporter",GCODEExporter:"https://github.com/urpflanze-org/gcode-exporter"};document.getElementById("menu_btn").addEventListener("click",(function(){document.querySelector("aside").classList.add("open"),document.body.style.top=`-${window.scrollY}px`,document.body.style.position="fixed"}),{passive:!0}),document.getElementById("aside-bg").addEventListener("click",_,{passive:!0});let l,s,p=null;function d(e,t){l=e,s=t;const n=document.querySelector("#nav");n.innerHTML="";const r=o(a[e],t,e);if(n.append(r),p){const a=o(p,t,e);n.firstChild.after(a)}const i=document.createElement("h1");i.innerText="API",n.append(i);const d=document.createDocumentFragment();Object.entries(c).forEach((([e,t])=>{const n=document.createElement("a");n.setAttribute("href",t),n.setAttribute("target","_blank");const a=document.createElement("h2");a.innerText=e,n.appendChild(a),d.appendChild(n)})),n.append(d)}function _(){const e=parseInt(document.body.style.top||"0");document.querySelector("aside").classList.remove("open"),document.body.style.position="",document.body.style.overflow="",window.scrollTo(0,-e)}function u(e){const t=document.querySelectorAll(".link");for(let e=0,n=t.length;e"dir"===e.type));for(let e=0,n=a.length;e"file"===e.type)).forEach((({name:e,path:t})=>{o[(0,r.P)(e.slice(3,-5).replace(/-/gi," "))]=t}))}return e})().then((e=>{p=e,d(l,s),(0,i.E9)((0,i.FZ)())}))},456:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{oA:()=>bindRouting,FZ:()=>getCurrentPage,E9:()=>goto});var _examples_bind_examples__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(933),_navigation_navigation__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(210);let currentPage;function bindRouting(){goto(window.location.hash),window.addEventListener("popstate",(()=>{goto(window.location.hash)}))}function getCurrentPage(){return currentPage}function goto(e){const t=document.getElementById("content");if(0===e.length&&(e=document.querySelector("#nav .link").getAttribute("href")),(0,_navigation_navigation__WEBPACK_IMPORTED_MODULE_0__.TZ)(e),currentPage!==e){currentPage=e,(0,_navigation_navigation__WEBPACK_IMPORTED_MODULE_0__.Wj)();const n=`pages${e.substr(1)}.html`;0===e.indexOf("#/examples")?(0,_examples_bind_examples__WEBPACK_IMPORTED_MODULE_1__.Z)(e.substr(2)).then((e=>{t.innerHTML=e,onLoadContent()})):fetch(n).then((e=>e.text())).then((e=>{t.innerHTML=e,onLoadContent()}))}}function onLoadContent(){let title=window.location.href.split("/").pop();title=title.length>0?title.replace(/-/gi," ").replace(".html",""):"Urpflanze",gtag("event","page_view",{page_location:window.location.href,page_path:"/"+window.location.hash,page_title:title}),document.title=title;const content=document.getElementById("content"),scripts=content.getElementsByTagName("script");for(let i=0;i${script}\n\t\t\t
\n\t\t\t\tHide / Show result ▸\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t`,scripts[i].before(script_container),script=script.replace(/document\.body/gi,`document.getElementById('${script_id}')`),scripts[i].innerHTML=script,eval(script)}else eval(scripts[i].innerHTML);const h2=content.getElementsByTagName("h2"),ul=document.createElement("ul");ul.className="page-navigation";for(let e=0;e{const{top:e}=n.getBoundingClientRect();window.scrollTo({top:e,behavior:"smooth"})}),!1),ul.appendChild(t)}content.firstElementChild&&ul.children.length>0&&content.firstElementChild.after(ul);const cliccables=document.getElementsByClassName("open-container");function openContainer(e){const t=document.getElementById(e.target.getAttribute("data-container"));if(t){const e=parseFloat(t.style.height);t.style.height=e>0?"0px":Math.min(t.parentNode.getBoundingClientRect().width,400)+"px"}}for(let e=0;ePR.prettyPrint())),window.scrollTo({top:0,behavior:"smooth"})}},561:(e,t,n)=>{function a(e){return e.charAt(0).toUpperCase()+e.slice(1)}n.d(t,{P:()=>a,X:()=>i});const r=(e,t)=>{let n=0;const a=Math.min(e.length,t.length);Math.max(e.length,t.length);for(let r=0;r{for(let n=0;n=70)return!0;return!1};function i(e,t){if(e=e.toLowerCase(),t=t.toLowerCase(),e.indexOf(t)>=0)return!0;if(t.indexOf(" ")>=0){t=t.split(" ").filter((e=>e.length>3)),e=e.split(" ").filter((e=>e.length>3));let n=0;for(let a=0;a70}return 1==(e=e.split(" ")).length?r(e[0],t)>=70:o(t,e)}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__={};(()=>{var e=__webpack_require__(210),t=__webpack_require__(456);let n=localStorage.getItem("lang")||(navigator.language.match(/it/gi)?"it":"en");const a=document.querySelector("#lang").getElementsByTagName("option");for(let e=0,t=a.length;e{(0,e.FD)(n,t.target.value)})),document.querySelector("#search").addEventListener("keyup",(t=>{(0,e.FD)(n,t.target.value)})),document.querySelector("#lang").addEventListener("change",(t=>{n="it"===t.target.value?"it":"en",localStorage.setItem("lang",n),(0,e.FD)(n)})),document.querySelector("#version").textContent="1.0.2",(0,t.oA)(),document.querySelector("main").style.display=""})()})(); +(()=>{"use strict";var __webpack_modules__={933:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(561);const r=async function(e){const t=await fetch(`https://api.github.com/repos/genbs/urpflanze/contents/${e}`),{name:n,html_url:r,download_url:o,content:i}=await t.json(),c=atob(i),l=c.replace(/&/g,"&").replace(//g,">").replace(/"/g,""");var s;const p=`https://codesandbox.io/api/v1/sandboxes/define?parameters=${s={files:{"index.html":{content:c}}},LZString.compressToBase64(JSON.stringify(s)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}`;return`\n\t\t

Example: ${(0,a.P)(e.split("/")[1].slice(3))} | ${(0,a.P)(n.slice(3,-5).replace(/-/gi," "))}

\n\t\t

Output

\n\t\t
\n\t\t\t\n\t\t
\n\n\t\t

Links

\n\t\t\n\n\t\t

Source

\n\t\t
\n\t\t\t
${l}
\n\t\t
\n `}},210:(e,t,n)=>{n.d(t,{TZ:()=>u,FD:()=>d,Wj:()=>_});const a={it:{Wiki:{Introduzione:{"Cos'è Urpflanze?":"it/Introduzione"},"Primi passi":{Installazione:"it/Installazione","Crea una scena":"it/Crea-una-scena","Gestire le ripetizioni":"it/Gestire-le-ripetizioni","Drawer e animazioni":"it/Drawer-e-animazioni"},Avanzate:{ShapeLoop:"it/ShapeLoop","Vertex Callback":"it/VertexCallback","Custom Drawer":"it/CustomDrawer",Renderer:"it/Renderer"}}},en:{Wiki:{Introduction:{"What is Urpflanze?":"en/Introduction"},"First steps":{Installation:"en/Installation","Creating a scene":"en/Creating-a-scene","Manage repetitions":"en/Manage-repetitions","Drawer and animations":"en/Drawer-and-animations"},Advanced:{ShapeLoop:"en/ShapeLoop","Vertex Callback":"en/VertexCallback","Custom Drawer":"en/CustomDrawer",Renderer:"en/Renderer"}}}};var r=n(561);const o=function(e,t,n){const a=document.createElement("div");return Object.keys(e).forEach((o=>{const i=e[o],c=document.createElement("h2"),l=Object.keys(i);if(0===l.length||1===l.length&&0===Object.keys(i[l[0]]).length)return;c.innerText=o;const s=document.createElement("div");l.forEach((e=>{const a=document.createElement("h3");a.innerText=e;const o=document.createElement("ul");let c=0;Object.keys(i[e]).forEach((a=>{if(void 0===t||0===t.length||(0,r.X)(a,t)){const t=document.createElement("li"),r=document.createElement("a");r.className="link",r.innerText=a,r.href="#/"+i[e][a].replace("$lang",n),t.appendChild(r),o.appendChild(t),c++}})),c&&(s.appendChild(a),s.appendChild(o))})),a.appendChild(c),a.appendChild(s)})),a};var i=n(456);const c={Core:"https://docs.urpflanze.org/core/",DrawerCanvas:"https://docs.urpflanze.org/drawer-canvas/",Animation:"https://docs.urpflanze.org/animation",SVGImporter:"https://github.com/urpflanze-org/svg-importer",SVGExporter:"https://github.com/urpflanze-org/svg-exporter",GCODEExporter:"https://github.com/urpflanze-org/gcode-exporter"};document.getElementById("menu_btn").addEventListener("click",(function(){document.querySelector("aside").classList.add("open"),document.body.style.top=`-${window.scrollY}px`,document.body.style.position="fixed"}),{passive:!0}),document.getElementById("aside-bg").addEventListener("click",_,{passive:!0});let l,s,p=null;function d(e,t){l=e,s=t;const n=document.querySelector("#nav");n.innerHTML="";const r=o(a[e],t,e);if(n.append(r),p){const a=o(p,t,e);n.firstChild.after(a)}const i=document.createElement("h1");i.innerText="API",n.append(i);const d=document.createDocumentFragment();Object.entries(c).forEach((([e,t])=>{const n=document.createElement("a");n.setAttribute("href",t),n.setAttribute("target","_blank");const a=document.createElement("h2");a.innerText=e,n.appendChild(a),d.appendChild(n)})),n.append(d)}function _(){const e=parseInt(document.body.style.top||"0");document.querySelector("aside").classList.remove("open"),document.body.style.position="",document.body.style.overflow="",window.scrollTo(0,-e)}function u(e){const t=document.querySelectorAll(".link");for(let e=0,n=t.length;e"dir"===e.type));for(let e=0,n=a.length;e"file"===e.type)).forEach((({name:e,path:t})=>{o[(0,r.P)(e.slice(3,-5).replace(/-/gi," "))]=t}))}return e})().then((e=>{p=e,d(l,s),(0,i.E9)((0,i.FZ)())}))},456:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{oA:()=>bindRouting,FZ:()=>getCurrentPage,E9:()=>goto});var _examples_bind_examples__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(933),_navigation_navigation__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(210);let currentPage;function bindRouting(){goto(window.location.hash),window.addEventListener("popstate",(()=>{goto(window.location.hash)}))}function getCurrentPage(){return currentPage}function goto(e){const t=document.getElementById("content");if(0===e.length&&(e=document.querySelector("#nav .link").getAttribute("href")),(0,_navigation_navigation__WEBPACK_IMPORTED_MODULE_0__.TZ)(e),currentPage!==e){currentPage=e,(0,_navigation_navigation__WEBPACK_IMPORTED_MODULE_0__.Wj)();const n=`pages${e.substr(1)}.html`;0===e.indexOf("#/examples")?(0,_examples_bind_examples__WEBPACK_IMPORTED_MODULE_1__.Z)(e.substr(2)).then((e=>{t.innerHTML=e,onLoadContent()})):fetch(n).then((e=>e.text())).then((e=>{t.innerHTML=e,onLoadContent()}))}}function onLoadContent(){let title=window.location.href.split("/").pop();title=title.length>0?title.replace(/-/gi," ").replace(".html",""):"Urpflanze",gtag("event","page_view",{page_location:window.location.href,page_path:"/"+window.location.hash,page_title:title}),document.title=title;const content=document.getElementById("content"),scripts=content.getElementsByTagName("script");for(let i=0;i${script}\n\t\t\t
\n\t\t\t\tHide / Show result ▸\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t`,scripts[i].before(script_container),script=script.replace(/document\.body/gi,`document.getElementById('${script_id}')`),scripts[i].innerHTML=script,eval(script)}else eval(scripts[i].innerHTML);const h2=content.getElementsByTagName("h2"),ul=document.createElement("ul");ul.className="page-navigation";for(let e=0;e{const{top:e}=n.getBoundingClientRect();window.scrollTo({top:e,behavior:"smooth"})}),!1),ul.appendChild(t)}content.firstElementChild&&ul.children.length>0&&content.firstElementChild.after(ul);const cliccables=document.getElementsByClassName("open-container");function openContainer(e){const t=document.getElementById(e.target.getAttribute("data-container"));if(t){const e=parseFloat(t.style.height);t.style.height=e>0?"0px":Math.min(t.parentNode.getBoundingClientRect().width,400)+"px"}}for(let e=0;ePR.prettyPrint())),window.scrollTo({top:0,behavior:"smooth"})}},561:(e,t,n)=>{function a(e){return e.charAt(0).toUpperCase()+e.slice(1)}n.d(t,{P:()=>a,X:()=>i});const r=(e,t)=>{let n=0;const a=Math.min(e.length,t.length);Math.max(e.length,t.length);for(let r=0;r{for(let n=0;n=70)return!0;return!1};function i(e,t){if(e=e.toLowerCase(),t=t.toLowerCase(),e.indexOf(t)>=0)return!0;if(t.indexOf(" ")>=0){t=t.split(" ").filter((e=>e.length>3)),e=e.split(" ").filter((e=>e.length>3));let n=0;for(let a=0;a70}return 1==(e=e.split(" ")).length?r(e[0],t)>=70:o(t,e)}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__={};(()=>{var e=__webpack_require__(210),t=__webpack_require__(456);let n=localStorage.getItem("lang")||(navigator.language.match(/it/gi)?"it":"en");const a=document.querySelector("#lang").getElementsByTagName("option");for(let e=0,t=a.length;e{(0,e.FD)(n,t.target.value)})),document.querySelector("#search").addEventListener("keyup",(t=>{(0,e.FD)(n,t.target.value)})),document.querySelector("#lang").addEventListener("change",(t=>{n="it"===t.target.value?"it":"en",localStorage.setItem("lang",n),(0,e.FD)(n)})),document.querySelector("#version").textContent="1.0.3",(0,t.oA)(),document.querySelector("main").style.display=""})()})(); //# sourceMappingURL=index-v0001.js.map \ No newline at end of file diff --git a/package.json b/package.json index e29b7d1..4772105 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@urpflanze/js", - "version": "1.0.2", + "version": "1.0.3", "description": "A library for developers who want to approach to creative coding, artists who want to approach coding and for those who find it fun to play with math.", "license": "GPL-3.0-or-later", "docs": "https://docs.urpflanze.org/urpflanze", @@ -55,7 +55,7 @@ "scripts": { "lint": "eslint src --ext .ts", "build-browser": "npx webpack --config webpack.config.js", - "build": "tsc --p tsconfig.json && npm run build-browser && tsc --p tsconfig-esm.json && npm run build-docs", + "build": "tsc --p tsconfig.json && tsc --p tsconfig-esm.json && npm run build-browser && npm run build-docs", "serve-docs": "webpack serve --config webpack.config.docs.js", "build-docs": "npx webpack --config webpack.config.docs.js --mode production && npx sass ./docs-src/scss/index.scss ./docs/assets/css/app.css --style compressed", "prepublishOnly": "npm run build",